[Insight-users] Dicom anonymize - gdcm::FileHelper::SetKeepMediaStorageSOPClassUID(true)

Mathieu Malaterre mathieu.malaterre at kitware.com
Fri Oct 6 16:01:56 EDT 2006


Thomas Boettger wrote:
> Hello everybody,
> 
> I wrote a small program to anonymize a loaded dicom dataset.
> Unfortunately my Image Type will always get modified as well (to
> "Derived\Primary"), which is not good as I need to keep this tag as it
> was, because otherwise my main application (commercial one) won't
> accept the anonymized dataset.
> 
> I found the gdcm::FileHelper would actually allow that kind of stuff,
> documentation:
> 
> "...4) When user *knows* he didn't modified the pixels, he may ask the
> writer to keep some
> informations unchanged :
> 'Media Storage SOP Class UID' (0x0002,0x0002)
> 'SOP Class UID'               (0x0008,0x0016)
> 'Image Type'                  (0x0008,0x0008)                <---- THATS 
> MY TAG
> 'Conversion Type'             (0x0008,0x0064)
> He has to use gdcm::FileHelper::SetKeepMediaStorageSOPClassUID(true)..."
> 
> 
> But in the itk::GDCMImageIO I did not find a method to call this one.
> Thats why the tag gets always overwritten.
> 
> Did I miss something and does anybody know a quick solution?


You have to reuse the same GDCMImageIO for your writer. There are couple 
of example/tests for this. This is a little more difficult in the case 
of a Series but it is documented in the SoftwareGuide.pdf

HTH
Mathieu


More information about the Insight-users mailing list