[Insight-users] writing float dicom images

Mark Wyszomierski markww at gmail.com
Thu Feb 15 11:25:29 EST 2007


I know this is probably not a good solution, but you could store the
floating point array as a private data block in the image. No viewers
would be able to make any sense of it, but you could restore and use
the data yourself if you wanted to.

Mark

On 2/15/07, Mathieu Malaterre <mathieu.malaterre at kitware.com> wrote:
> Salut André,
>
> a.bongers at mediri.com wrote:
> > Hi,
> >
> > I was trying to use the FileWriter to write a 2D DICOM image with float
> > values.
> > My rough procedure is:
> > 1. create a 2D float image, and allocate it.
> > 2. copy some values from another image into this image.
> > 3. create a float file writer Object with the float image as input
> > 4. set the filename to something with ending ".dcm"
> > 5. update the writer
> >
> > The problem is that the FileWriter crashes when I try this with my float
> > image. An ERROR is caught which tells me: "DICOM does not support this
> > component type". Can anyone tell me what this means ?
>
> It means that the DICOM standard does not specify a way to store
> floating point pixel data.
>
> > When I use unsigned short images and writer instead I have no problems at
> > all.
> > Is the writer not able to write float dicom images? Does DICOM support
> > float images at all? Could it be that the bit depth for the file writer
> > is set or taken wrongly ?  Do I possibly have to tell the fileWriter the
> > bit depth explicitely (besides the declaration) ?
> >
> > Would be really great if someone could give me a useful hint!
>
> Writing floating point DICOM image can be tricky. The only way to
> achieve that is to rescale your image on let say (un)signed short pixel
> data and specify a good rescale/intercept slope (in general you will
> loose precision in this step).
>  From the top of my head only RT allow 32bits images anyway, so for
> anything else you have to deal with the 16bits limitation :(
>
> HTH,
> -Mathieu
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list