[Insight-users] MetaImage

Luis Ibanez luis . ibanez at kitware . com
Fri, 13 Jun 2003 15:37:53 -0400


Hi Yinpeng,

Yes, this means that you must decide
the pixel type before reading your data.

This may be inconvenient if you plan
to develop a generic image processing
application, but it is fundamental for
the specific case of Medical Image
applications.

Developers *must* be aware of the PixelType
used to represent the data being processed.
This drives many trade-offs in precision,
computational burden and memory consumption.

It is unlikely that real Medical Image
applications end up using generic methods.

Every segmentation/registration application
has specific requirement that change with
the anatomical structure being considered,
the image modality used as input, and the
final purpose of the processing (e.g. image
guided surgery, or diagnosis, or radiation
treatment...)  A realistic application must
be customized for all these characteristics.

For example if you are considering to
process mamograms, it is clear that your
input data must be 'unsigned short', and
that if you plan to run anisotropics diffusion
filter on it, the next pixel type in the
pipeline must be 'float or double', for
representing final segmentation you certainly
want 'unsigned char', and so on...

PixelType selection is probably the first
exercise in the design process of your
applications, and should be revisited each
time you modify the data pipeline.

In a simple application you could get away
by using pixel type 'double' everywhere,
but unless  your images are really small
or you computer memory is really large,
this will not let you go very far.



Regards,


   Luis



------------------------
Yinpeng Jin wrote:
> does this mean that you have to know the Pixeltype and dimension before
> you use the itkReader?
> or I should always use something like
> itk::Image<double, 3>  to make sure that my Image object can "accomodate"
> the data if I don't know such info.
> 
> 
> 
> ----- Original Message -----
> From: "Luis Ibanez" <luis . ibanez at kitware . com>
> To: "Anouk Stein M.D." <anouk_stein at earthlink . net>
> Cc: <insight-users at www . itk . org>
> Sent: Thursday, June 12, 2003 9:59 PM
> Subject: Re: [Insight-users] MetaImage
> 
> 
> 
>>Hi Anouk,
>>
>>You don't need to do this by yourself.
>>
>>The ImageFileReader<> filter will do all this directly.
>>
> 
> http://public . kitware . com/Insight/Doxygen/html/classitk_1_1ImageFileReader . h
> tml
> 
>>Simply instantiate an image with a pixel type
>>that is capable of receiving the numerical values
>>stored in the actual image file.  Then, instantiate
>>an image file reader.
>>
>>The whole code will look like:
>>
>>typedef   unsigned short  PixelType;
>>typedef   itk::Image< PixelType, 3 > ImageType;
>>typedef   itk::ImageFileReader< ImageType > ReaderType;
>>
>>ReaderType::Pointer reader = ReaderType::New();
>>
>>reader->SetFileName("myImageFile.mha");
>>reader->Update();
>>
>>ImageType::ConstPointer image = reader->GetOutput();
>>
>>
>>"image" will contain at this point the data read
>>from your MetaImage file.
>>
>>You will find details about ITK's IO architecture
>>in the Chapter 6 of the SoftwareGuide, pdf-page 159.
>>
>>     http://www . itk . org/ItkSoftwareGuide . pdf
>>
>>
>>The associated examples can be found in the directory
>>
>>         Insitht/Examples/IO
>>
>>--
>>
>>
>>  Regards,
>>
>>
>>     Luis
>>
>>
>>----------------------------------
>>Anouk Stein M.D. wrote:
>>
>>>Dear ITK users group,
>>>
>>>I'm trying to use the info from a metaImage file to instantiate Image<>
>>>.  The element type in the header is listed as MET_SHORT which is a
>>>
>>>MET_ValueEnumType which is also what MetaImage::ElementType() returns.
>>>How do I convert this to a typename so that
>>>
>>>typedef itk::Image <TPixel, dimensions> ImageType recognizes it?
>>>
>>>Also I would like to use the number of dimensions from the header but
>>>it's a protected member. What do you think I should do? Thankyou,
>>>
>>>Anouk Stein
>>>
>>
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at www . itk . org
>>http://www . itk . org/mailman/listinfo/insight-users
> 
> 
>