[ITK-users] How to remove a tag from MetaDataDictionary?

Matt McCormick matt.mccormick at kitware.com
Mon Oct 6 11:08:10 EDT 2014


Hi Arnaud,


> I am trying to write a DICOM file in which, the orientation (among others)
> has changed in my pipeline...
>
> 1- After having a look
> https://github.com/Kitware/ITK/blob/master/Modules/IO/GDCM/src/itkGDCMImageIO.cxx#L883-L919
>
> It appears to me that if the orientation is in the MetaDataDictionary, it is
> saved anyway into the DICOM image, there is no way to force the ImageIO to
> recompute it from the image and save it ???
> If there is, can anyone give me a pointer?

If there is a Direction on the input image, it should use it [1].  But
the DICOM tag 0020|0037 cannot be present.


> 2- Since I can't find a way to update the image orientation in
> itk::GDCMImageIO, I have been looking at removing the corresponding tag from
> the MetaDataDictionary. I could not find any method or any way to do it???
> If there is, can anyone give me a pointer?
>
> I wish I would not have to copy the dictionary and add if statement to avoid
> copying the direction...

This is the method I usually apply...

Sorry for the lack of new tricks!
Matt

[1] https://github.com/Kitware/ITK/blob/master/Modules/IO/GDCM/src/itkGDCMImageIO.cxx#L816-L828


More information about the Insight-users mailing list