[Insight-users] Rewriting Dicom header entries

Jean-Pierre Roux jpr at creatis.insa-lyon.fr
Tue Oct 16 03:32:13 EDT 2007


Angela Wang wrote:
> I am trying to write two values into a DICOM header entry for my 
> processed
> image file. This one tag does not write my values. I am able, however, to
> change other DICOM header entries. The tag is (0008,0008) for Image Iype
> and takes type CS = code string.
> The code looks like:
>
> ReaderType::DictionaryArrayRawPointer dictPointer =
> reader -> GetMetaDataDictionaryArray();
> ReaderType::DictionaryRawPointer dict = (*dictPointer)[i];
> itk::MetaDataDictionary & dictionary= *dict;
> std::string tagkey, value;
> tagkey = "0008|0008"; // Image Type vr = CS
> value = "ORIGINAL\\SECONDARY";
> itk::EncapsulateMetaData<std::string>(dictionary, tagkey, value);
>
> Does anyone know how to make this work?
Hi, Angela
I'm afraid you cannot do that with the curent ITK version :
gdcm performs some consistency checkings (out of the control of ITK)
I read in the comments of gdcm::FileHelper::CheckMandatoryElements() 
method :

// 'Image Type' (0x0008,0x0008) is forced to "DERIVED\PRIMARY"

I think I read a post from David Clunnie (Dicom world wide guru) that 
the value of this field is now not so important.
Is it important for you?
(Do you use a special clinical work station that *demands* 
ORIGINAL\\SECONDARY in 0008|0008?
If so, the quicker solution for you should be a wild patch in the 
gdcm::FileHelper::CheckMandatoryElements() method, and recompile ITK .
HTH

Jean-Pierre Roux
gdcm team

> Thanks.
> Angela
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>



More information about the Insight-users mailing list