Why some DICOM info cannot be added to the Header?

3 visualizaciones (últimos 30 días)
mohammed
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

Respuesta aceptada

Nalini Vishnoi
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
  1 comentario
mohammed
mohammed el 9 de Mayo de 2015
Hi Nalini,
Thanks for your answer. That certainly helped and worked. However, I it did not accept strings for exposure time and current. It accepted strings for the KVP. I was able to work around it and get the current in, but it had a strange behavior when entering the exposure.
It rounds the number, i.e. if the number is 0.6 it makes it 1. So, I thought maybe I should multiply it by 1000 to make it in milliseconds. However, when adding 400 it takes it as 1.
Your help is appreciated since I have a deadline :/
Thanks Mohammed Ali

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre DICOM Format en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by