DICOM read and write is giving me the wrong image

1 view (last 30 days)
Hello,
I am using the Dicom Tags Read and Write by Dirk-Jan Kroon (https://www.mathworks.com/matlabcentral/fileexchange/29145-dicom-tags-read-and-write) and am having trouble getting the intended output.
As far as I can understand, the files "ReadDicomElementList" and "WriteDicomElementList" are supposed to read the DICOM tags of the source .dcm file, write it into the workspace as "Elements" and then write these tags to the target .dcm file. Now the tags do transfer but from the multiple attempts I've made, it also copies the image as well.
Here's what's been happening:
Initial goal:I want only the tags from file X and replace the tags from file Y with them. So I run the code mentioned above as
Elements = ReadDicomElementList;
WriteDicomElementList(Elements,uiputfile('.dcm', 'Choose a dicom file to replace tags'));
and choose the source .dcm file as X and the file to get these tags to be Y. However, the output is always a file with the name Y with the tags and image of X. i.e. a copy of X with the file name Y (checked with ImageJ).
I don't understand why this is happening and would love the community's input to resolve this issue and help me change the code to replace just the DICOM tags and not the image.

Answers (0)

Categories

Find more on DICOM Format in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!