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

Bill Lorensen bill.lorensen at gmail.com
Wed May 28 08:12:48 EDT 2008


I think the hex numbers need to be in lower case (0008|103e). This
looks like a bug to me. Please report it:

http://www.itk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes

Bill

On Tue, May 27, 2008 at 7:51 PM,  <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