DICOM private fields not written correctly with custom dicomdict
8 次查看(过去 30 天)
显示 更早的评论
I've created a dicom dict text file that contains (among other things) a floating point private tag (9003,1038).
>> current_dicom_dict = dicomdict('get_current')
current_dicom_dict =
'/Users/brian/apps/copilot/share/dicom-dict-cp.txt'
>> !cat /Users/brian/apps/copilot/share/dicom-dict-cp.txt | tail -n 1
(9003,1038) FL DaysSincePriorStudy 1
The value of this tag is correctly set in the metadata struct:
>> metadata_out.Private_9003_1038
ans =
single
24.3231
I write the file with DICOMWRITE and read the file metadata back in with DICOMINFO:
dicomwrite(dat, 'test.dcm', metadata_out, 'CreateMode', 'copy', 'WritePrivate', 1);
metadata_in = dicominfo('test.dcm');
The metadata that I read back in failed to parse the private field correctly:
>> metadata_in.Private_9003_1038
ans =
4×1 uint8 column vector
176
149
194
65
Why is my private field not parsed correctly by DICOMINFO?
0 个评论
回答(1 个)
Jayanti
2025-8-21,9:23
编辑:Jayanti
2025-8-21,9:25
Hi Brian,
It looks like the issue might be due to the fact that "dicominfo" is not using your custom DICOM dictionary when reading the file back.
So before calling "dicominfo", set your custom dictionary like below:
dicomdict('set', current_dicom_dict);
For more details please refer to the below offical documentation link on "dicomdict":
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!