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

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri May 30 19:03:08 EDT 2008


Hi Luis,


  No need for a DICOM guru here. "0008|103e" simply means the pair of
unsigned short 0x0008,0x103e. AFAIK the c library sscanf/printf should
support both hexadecimal representation. I do not know whether we
(ITK, GDCM?) are restricting it, or if this is an issue with the C
library.

  Anyway Andreas this should not be hard to track down. Please let us
know if this is an issue in ITK and/or GDCM.

Thanks,
-Mathieu

On Fri, May 30, 2008 at 5:03 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>
> 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
>>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>



-- 
Mathieu


More information about the Insight-users mailing list