[Insight-users] replacing the pixels of a DICOM image by a RAW FILE

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Oct 24 04:43:57 EDT 2008


On Fri, Oct 24, 2008 at 10:12 AM, Stéphane CALANDE <scalande at gmail.com> wrote:
> Hi all,
>
>
> I hope you'll be able to help me !
>
> I have :
>
>> one DICOM image (2D)
>> one MHD/RAW image (2D)
> (these images have the same resolution (size, spacing,...)
>
> My question is the following one :
>
> How can I replace the part of the DICOM file that represents the pixels
> matrix by the RAW file ?
> So I want to change the pixels of DICOM but I don't won't to change the
> patient characteristics...
>
>
> Does something exist to do that easily ?
>
>

7.12.2 Reading and Writing a 2D Image

...
We now need to explicitly set the proper image IO (GDCMImageIO), but
also we must tell
the ImageFileWriter to not use the MetaDataDictionary from the input
but from the GDCMImageIO
since this is the one that contains the DICOM specific information
The GDCMImageIO object will automatically detect the pixel type, in
this case unsigned
char and it will update the DICOM header information accordingly.
...


You can even manually change any tab you do not like, or that must be
updated, have a look at ImageReadDicomSeriesWrite.cxx

(for some reason I cannot find it in the ItkSoftwareGuide, must have
been added after the latest pdf generation).

HTH
-- 
Mathieu


More information about the Insight-users mailing list