Why some DICOM info cannot be added to the Header?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
mohammed
el 3 de Mayo de 2015
Comentada: mohammed
el 9 de Mayo de 2015
Hello all,
I am creating a DICOM file using MatLab and adding data to the header. What I could not understand or figure out is when when I used for example the following code:
info.(dicomlookup('0010', '0010'))='name'
to enter the patient name it worked, as well as many other metadata. However, when I tried entering some other info, it did not give me an error at first, but after creating the dicom file then trying reading the specific data in the dicom info, it kept saying reference to non existed field.
For example, I tried entering clinic name using the following line: info.(dicomlookup('0008', '0080'))
It did not give me an error when creating the file, but after I tried to dicomread what has already been written, it said:
(Reference to non-existent field 'InstitutionName').
I used the same method for other data like patient name and it worked though. Can anyone please help me understand how to do this. I also used different versions at school hoping that it is just a bug but with no luck!
Thanks in advance!
Ali
0 comentarios
Respuesta aceptada
Nalini Vishnoi
el 6 de Mayo de 2015
Editada: Walter Roberson
el 6 de Mayo de 2015
Hello Mohammed,
This behavior seems to be related to the 'CreateMode' option of the dicomwrite function. It is set to 'Create' by default. If you set it to 'Copy' everything works fine. I have tested the following example with MATLAB R2014a and it seems to work fine:
>> X = dicomread('CT-MONO2-16-ankle.dcm');
>> info = dicominfo('CT-MONO2-16-ankle.dcm');
>> info.(dicomlookup('0010', '0010'))='name';
>> info.(dicomlookup('0008', '0080')) = 'Abc XyZ';
>> dicomwrite(X, 'ct_file.dcm', info,'CreateMode','Copy');
>> metadata = dicominfo('ct_file.dcm');
>> metadata.PatientName
>> metadata.InstitutionName
I hope this information and example helps.
Nalini
Más respuestas (0)
Ver también
Categorías
Más información sobre DICOM Format en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!