For the first function, I would like to copy the value of an element into another element (with compatible VR) in the same file. So the only thing that should change in the element I am copying TO is the value and value length as far as I am aware. The closest method I can find is "findAndInsertCopyOfElement()" in dcitem.h. However, from my understanding, this method copies the element whole i.e. tag included, therefore I can't actually copy the data into a different element/tag.
Is there any way to do this without having to retrieve the actual value which would then require a lot of if statements to handle the possible types/vr of the value?
In the second function, I would like to retrieve the actual value of the element and perform operations on it, such as appending in the case of a string, then put it back into the same element. I expect I will have to worry about the data types in this case but would love to hear if there are other functions in dcmdata that I may have missed that allows me to avoid this.
Here is how I have started:
Code: Select all
DcmFileFormat fileformat;
DcmDataset* dset;
fileformat.loadFile("path");
dset = fileformat.getDataset();
/* Here I would like to grab a copy of the value from one tag,
then paste it into another */
fileformat.saveFile("path")