DICOM private fields not written correctly with custom dicomdict

7 visualizaciones (últimos 30 días)
Brian Keating
Brian Keating el 9 de Ag. de 2018
Editada: Jayanti el 21 de Ag. de 2025 a las 9:25
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?

Respuestas (1)

Jayanti
Jayanti el 21 de Ag. de 2025 a las 9:23
Editada: Jayanti el 21 de Ag. de 2025 a las 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":

Community Treasure Hunt

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

Start Hunting!

Translated by