[Insight-developers] InsightApplications/ConvertBetweenFileFormats not working for DICOM images with slope/intercept

Marius Staring marius at isi.uu.nl
Thu Feb 9 05:06:55 EST 2006


The reason why I commented the float part out was because I thought that 
GDCM did not support float types, but only doubles. Checking the code I 
think I was wrong, however in the function 
InternalReadImageInformation() there is no check for float pixeltypes, 
only for (unsigned) char short int and double.

So, the commenting out was intentional, and I am not sure if floats are 
supported.

Regards,

Marius

Kent Williams wrote:
> ConvertBetweenFileFormats, in addition to being a useful example, is a 
> very useful program to have around for use in shell scripts.  It does 
> a good job job of converting between any ITK-supported file format, to 
> any other ITK-supported file format.
>
> But, it was defeated by a DICOM data set that turned up here at Iowa.  
> ConvertBetweenFileFormats silently gives up the ghost without writing 
> any output.
>
> This seemed mysterious until I poked around in itkGDCMImageIO.cxx and 
> saw what it was doing to recover the input image data type.  In the 
> case of integer data, if the slope is not 1.0 and/or the intercept is 
> not 0.0, it promotes the ComponentType of the file to float, in order 
> to allow the Pixel(X) = Slope * X + Intercept calculation to get 
> reasonable results.
>
> This, unfortunately runs afoul of the DicomFileConverterScaler and 
> DicomFileConverterScalerA functions that do the real work for 
> ConvertBetweenFileFormats, because the code to convert from float to 
> other data types was commented out.  I've just checked in a change 
> that uncomments this code -- it looks as though the commenting-out was 
> unintentional.
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>

-- 
Marius Staring
Image Sciences Institute
University Medical Centre Utrecht
Heidelberglaan 100, 3584 CX Utrecht, The Netherlands
phone: +31 (0)30 250 3186, fax: +31 (0)30 251 3399
marius at isi.uu.nl, http://www.isi.uu.nl/People/Marius



More information about the Insight-developers mailing list