[Insight-users] convert unsign int pixel type dicom file into MetaImage with gdcm

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Apr 29 18:35:10 EDT 2009


[Please CC the ITK user ML]

On Wed, Apr 29, 2009 at 5:57 PM, Hsiang-Chi Kuo <kuoxgx at gmail.com> wrote:
> Thanks Mathieu.
> I will try the gdcmFile.cxx 1.27 revision today.
> Yes, you're right, I am dealing with RT Dose file. I have done registraion
> with ITK. I need to warp the dose file with the deformed field output from
> the registration results.

ok

> Actually the problem is that the current gdcm ( either 1.x or 2.x) dose not
> support 32 bit uint with itk (either itk::GDCMIMAGEIO or itk::IMAGEIO).

This should be fixed now.

$ cvs ci -m"ENH: Add support for 32bits image (RT Dose Storage namely)
in gdcm 1.x. Cleanup gdcm 2.x code"
Running style check
Running style check
Processing itkGDCMImageIO.cxx



/cvsroot/Insight/Insight/Code/IO/itkGDCMImageIO.cxx,v  <--
Code/IO/itkGDCMImageIO.cxx
new revision: 1.159; previous revision: 1.158


> My previous code can read the Z spacing. It's the "*imageData =
> fh->GetImageDataRaw();" which seems only support unit8_t. If I define my
> image  at the itk Read Image level as 'unsign int', this line will cause
> message of "cannot convert from'unit8_t' to unsign int"; if I define the
> image as 'unsign short', this line will produce "cannot convert from
> 'unit_t' to unsign short" like I showed in the previous email (there was a
> confusion between the code and the error message).
> I appreciate your time, I am wondering in this case, if the gdcmFile.cxx
> (1.27) would allow me to read 32U since I need to read raw data through
> gdcmFileHelper, right?

It should now.

Please be extremely careful that support for RT Dose Storage may not
work in case the Grid Frame Vector Offset is not consistant (in the
form spacing = a*x + b). ITK only deals with 3D homogenous volume, in
this case you can only pass the 'x' value to ITK.

2cts
-- 
Mathieu


More information about the Insight-users mailing list