[Insight-users] Cannot change the series description (0008|103E) of a dicom file using ITK

Luis Ibanez luis.ibanez at kitware.com
Fri May 30 11:03:11 EDT 2008



Hi Andreas,


Please use:

                    "0008|103e"

instead of:

                    "0008|103E"


I just tested this by simply running the executable of
DicomImageReadChangeHeaderWrite with a command line such
as:


DicomImageReadChangeHeaderWrite inslice.dcm outslice.dcm "0008|103e" FOO


I don't know what DICOM says about case-sensitivity in the tags..

we must defer to our DICOM gurus in the list. (Please help !)



    Thanks


       Luis



-----------------------
andreasfm at web.de wrote:
> Dear ITK users!
> 
> I want to change the header of a dicom file. It works fine with all but one dicom tag. I cannot change the series description (0008|103E).
> My code below is adapted from DicomImageReadChangeHeaderWrite.
> Does anyone know why
>     itk::EncapsulateMetaData<string>( dictionary, "0008|103E", "a new series description, THIS DOES NOT WORK" );
> is not working, i.e. after saving the dicom file the tags has not changed?
> Thanks,
> Andreas
> 
> //****
> typedef itk::ImageFileReader<TImage> ReaderType;
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName(inputFile);
> 
> typedef itk::GDCMImageIO ImageIOType;
> ImageIOType::Pointer gdcmImageIO = ImageIOType::New();
> reader->SetImageIO( gdcmImageIO );
> 	
> TImage::Pointer inputImage = reader->GetOutput();
> 
> typedef itk::MetaDataDictionary DictionaryType;
> DictionaryType& dictionary = inputImage->GetMetaDataDictionary();
> 
> itk::EncapsulateMetaData<string>( dictionary, "0008|1010", "a new station name, THIS WORKS" );
> itk::EncapsulateMetaData<string>( dictionary, "0008|103E", "a new series description, THIS DOES NOT WORK" );
> 
> typedef itk::ImageFileWriter<TImageSShort2D> WriterType;
> WriterType::Pointer writer = WriterType::New();
> writer->SetInput(reader->GetOutput());
> writer->SetFileName(outputFile);
> writer->SetImageIO(gdcmImageIO);
> writer->Update();
> 
> _______________________________________________
> 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