[Insight-users] insight-users@itk.org
Luis Ibanez
luis.ibanez at kitware.com
Thu Jan 31 21:49:07 EST 2008
Hi Iratxe,
Please write a MetaImage header for your raw image.
Then load the image in SNAP by opening the MetaImage header.
You will find instructions on how to create the MetaImage
header in the following web page:
http://www.itk.org/HTML/Data.htm
*Writing a MetaImage header for raw data*
One of the formats for which a reader is already available in the
toolkit is the MetaImage file format. This is a fairly simple yet
powerful format consisting of a text header and a binary data section.
The following instructions describe how you can write a MetaImage header
for the data that you download from the BrainWeb page.
The minimal structure of the MetaImage header is the following:
NDims = 3
DimSize = 181 217 181
ElementType = MET_UCHAR
ElementSpacing = 1.2 1.2 3.4
Offset = 13.4 27.5 43.2
ElementByteOrderMSB = False
ElementDataFile = brainweb1.raw
* NDims indicate that this is a 3D image. ITK can handle images of
arbitrary dimension.
* DimSize indicates the size of the volume in pixels along each
direction.
* ElementType indicate the primitive type used for pixels. In this
case is "unsigned char", implying that the data is digitized in 8 bits /
pixel.
* ElementSpacing indicates the physical separation between the
center of one pixel and the center of the next pixel along each
direction in space. The units used are millimeters.
* Offset indicates the position of the image origin. It is expected
to be specified in physical units (e.g. millimeters, microns...).
* ElementByteOrderMSB indicates is the data is encoded in little or
big endian order. You might want to play with this value when moving
data between different computer platforms.
* ElementDataFile is the name of the file containing the raw binary
data of the image. This file must be in the same directory as the header.
MetaImage headers are expected to have extension: ".mha" or ".mhd"
Once you write this header text file, it should be possible to read the
image into your ITK based application using the itk::FileIOToImageFilter
class.
Regards,
Luis
------------------
Iratxe wrote:
> Hi,
>
>
>
> I am a new user in ITK Snap. I would like to create a 3D image using
> ITK-SNAP software. To do so, I have created a .raw file in ImageJ and
> then I am trying input into ITK-SNAP but for some reason I am doing
> something wrong when I import the file and the ITK-SNAP software
> crashes. I think this is something related to the file properties input
> (header size…) but I do not how to solve it.
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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