I am trying to use the dicomanon function to update the "StudyDate" metadata element in an image file to set it to a new value "20010101"

2 views (last 30 days)
I tried to follow the syntax in the help file.
I tried the following command:
dicomanon('00000001anon.dcm', '00000001anon2.dcm', 'update', 'StudyDate', 20000101);
I get the following errors:
Error using dicomanon>parseInputs (line 272)
Parameter names must be a string.
Error in dicomanon (line 76)
args = parseInputs(varargin{:});
I also tried the following command:
dicomanon('00000001anon.dcm', '00000001anon2.dcm', 'StudyDate', '20000101');
Error using dicomanon>parseInputs (line 278)
Unrecognized parameter "StudyDate".
Error in dicomanon (line 76)
args = parseInputs(varargin{:});
I think the dicomanon function indicates that I should be able to update the values of metadata elements in the file. Is this limitted to a subset of metadata values? Do I need to read the metadata into a structure, update it, and then use dicomwrite?
Thank you!
Paul Hannon

Answers (1)

Saket Chirania
Saket Chirania on 15 Dec 2020
Hi Paul,
Try to read to read the meta data into structure and and use dicomwrite to write images as DICOM files. After you have the DICOM files you can use dicomanon to update the file according to your needs. Hope this helps.
For more details refers to following page: dicomwrite

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!