[Insight-users] writing grayscale TIFF files

Luis Ibanez luis.ibanez at kitware.com
Wed, 07 Apr 2004 15:19:11 -0400


Hi Peter,

I haven't been able to replicate the
problem you reported.  When I use

   Insight/Examples/ImageReadWrite

in order to convert

   BrainProtonDensitySlice.png

into

   brain.tif

I got a file of size: 79428 which
is consistent with a 16bits/pixel
image of size 181 X 217.

Running the "Identify" tool from
ImageMagick on this TIFF image
returns the following:

   brain.tif TIFF 181x217+0+0
   PseudoClass 65536c 16-bit
   77.6k 0.010u 0:01

which doesn't look like a Color type.

Is there anything particular in your
installation ?  for example, are you
using the system installed TIFF library
instead of the one distributed with ITK
in Insight/Utilities ?


Regards,


    Luis


---------------
P K wrote:

> I'm having trouble writing grayscale TIFF files in
> ITK.
> Using the code from Examples/IO/ImageReadWrite.cxx, I
> attempt to read and then write a 8- or 16-bit
> grayscale TIFF file.
> In both cases, the file written has colortype:
> 'truecolor' rather than 'grayscale,' and Matlab gives
> the following error:
> ??? RGB image has 1 (not 3) samples per pixel.
> 
> Any ideas?
> Thanks,
> --Peter
>