[Insight-users] Convert signed short to float in DICOM

Peter Cech pcech at vision.ee.ethz.ch
Wed Mar 28 03:02:37 EST 2007


On Wed, Mar 28, 2007 at 00:15:18 +0800, Goo wrote:
> In my program,
> there are two difference type in pipeline.
> 
> At first,I am casting 'signed short' to 'float'.
> Through the processing of gradient filter this float data
> is casting to signed short.
> 
> The pipeline as below:
> signed short data -->cast1 -->float data --> Filter --> float data -->
> cast2 -->signed short data -->write to dicom
> 
> The result is full white.
> I don't know what happen?
> Can anybody give me some suggestion?

Sounds like your float values are out of range for signed short type.
Try using MinimumMaximumImageCalculator or MinimumMaximumImageFilter
to find out the value range after the filter. 

Or try saving the float image into MetaImage (.mha or .mhd) format and
inspect the image. If you already have Slicer installed, you can try but
I never tried to load float images in it, so I'm not sure it supports
them. I'm using ImageJ (http://www.ij.org) with MetaImage IO plugin. You
have to save the image as .mhd to get *.mhd and *.raw files, otherwise
it won't load. The plugin also complains about some header entries, so
you'll need to edit the .mhd file and remove TransformMatrix and (IIRC)
CenterOfRotation fields.

Regards,
Peter Cech


More information about the Insight-users mailing list