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 次查看(过去 30 天)
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

回答(1 个)

Saket Chirania
Saket Chirania 2020-12-15
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

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by