[Insight-users] Problem reading Raw files of different types

Mathieu Malaterre Mathieu.Malaterre@creatis.insa-lyon.fr
Fri, 28 Feb 2003 09:15:46 +0100


Neha,

	Before using RawImageReadWrite with short type pixels, did you 
recompile it (itkRawImageReadWrite.cxx) after doing the necessary changes:

Changing (line 53-54):
   typedef  unsigned char    PixelType;
   const    unsigned int     Dimension = 3;

into
   typedef  short    PixelType;
   const    unsigned int     Dimension = 2;

BTW:
rawReader->SetByteOrderToBigEndian() is not necessary as it is the 
default of the class.

HTH
mathieu

Neha D wrote:
> Hi All,
> 
> Is anybody working on raw image files ? I am trying to use 
> "RawImageReadWrite" example. For a unsigned char images, it works fine. 
> I need to read short type raw ( REAL type ) files ( big-endian ), so I 
> have built this program out of ITK source and in that, I  have defined 
> the image type with short datatype and 2 dimension , program crashes.
> 
> Does anybody have idea about this ?
> 
> Thanks,
> 
> Neha
> 

-- 
Mathieu Malaterre
CREATIS
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
http://www.creatis.insa-lyon.fr/~malaterre/