How can I copy the metadata from one dicom to another?
Show older comments
Briefly, I need to convert my dicoms to analyze to manipulate them, and then need to convert them back. Some header info gets lost during this process, which I need. I found the dicomwrite section in the Documentation Center, but Matlab is not reading the image in my dicom file, so this does not work. Is there a method of saving header info to a dicom without changing the image?
Answers (1)
Sean de Wolski
on 11 Jun 2014
Perhaps I'm missing something, but can't you read the image in and then write it out with modified info?
For example:
info = dicominfo('CT-MONO2-16-ankle.dcm');
X = dicomread('CT-MONO2-16-ankle.dcm');
modify info
info.PatientName.FamilyName = 'Sean';
dicomwrite(X, 'sc_file.dcm',info);
%%verify
infonew = dicominfo('sc_file.dcm');
infonew.PatientName.FamilyName
4 Comments
Natalie
on 11 Jun 2014
Sean de Wolski
on 11 Jun 2014
How did you convert them from Analyze?
Natalie
on 11 Jun 2014
Sean de Wolski
on 16 Jun 2014
Hi Natalie,
Please contact technical support and reference this thread.
Categories
Find more on Read and Write Image Data from Files 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!