[Insight-users] short format

Luis Ibanez luis.ibanez at kitware.com
Sun Jun 5 14:10:56 EDT 2011


Hi John,

The code should become

>   typedef short               InputPixelType;
>   typedef short       OutputPixelType;
>   const   unsigned int        Dimension = 3;
>
>   typedef itk::Image< InputPixelType,  Dimension >    InputImageType;
>   typedef itk::Image< OutputPixelType, Dimension >    OutputImageType;
>   typedef itk::ImageFileReader< InputImageType  >  ReaderType;
>
>   typedef short        InputPixelType_extract;
>   typedef short        OutputPixelType_extract;
>   typedef itk::Image< InputPixelType_extract,  3 >
> InputImageType_extract;
>   typedef itk::Image< OutputPixelType_extract, 2 >
> OutputImageType_extract;


and you could use as output file
format any of the following:

* MetaImage ( extension .mha)
* VTK (extension .vtk)
* Nifty (extension .nii)
* Nrrd (extension .nrrd)

They all support "short" as a pixel type.

You can view any of this format
with the SNAP, Slicer, VV, and
the simple ImageViewer in
InsightApplications.


    Luis


------------------------------------------------
On Sun, Jun 5, 2011 at 5:12 AM, john smith <mkitkinsightuser at gmail.com> wrote:
> Hello,
>
> I am using "itkExtractImageFilter.h" and "itkRescaleIntensityImageFilter.h",
> in order to read a 3D volume and display a rescaled slice with values
> [0,255]. So far I displayed my results in a png image with these
> characteristics:
>
>   typedef short               InputPixelType;
>   typedef unsigned char       OutputPixelType;
>   const   unsigned int        Dimension = 3;
>
>   typedef itk::Image< InputPixelType,  Dimension >    InputImageType;
>   typedef itk::Image< OutputPixelType, Dimension >    OutputImageType;
>   typedef itk::ImageFileReader< InputImageType  >  ReaderType;
>
>   typedef unsigned char        InputPixelType_extract;
>   typedef unsigned char        OutputPixelType_extract;
>   typedef itk::Image< InputPixelType_extract,  3 >
> InputImageType_extract;
>   typedef itk::Image< OutputPixelType_extract, 2 >
> OutputImageType_extract;
>
> I want to read a 3D image of short format and get my result also in short
> format. I want to ask what type of file I must use, as a png image can't
> display images of short format. Also, what should be changed in the above
> declarations?
>
> Thanks in advance
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list