[Insight-users] itk::Image to itk::OrientedImage

Luis Ibanez luis.ibanez at kitware.com
Thu Mar 15 16:25:33 EST 2007


HI Sophie,

You can simply instantiate the itk::ImageFileReader
using an itk::OrientedImage as template argument.


The code will look like:


#include "itkOrientedImage.h"
#include "itkImageFileReader.h"

typedef  signed short   PixelType;
const unsigned int Dimension = 3;

typedef itk::OrientedImage< PixelType, Dimension > ImageType;
typedef itk::ImageFileReader< ImageType >  ReaderType;

ReaderType::Pointer reader = ReaderType::New();

reader->SetFileName( "myimage.hdr" );
reader->Update();

ImageType::ConstPointer  image = reader->GetOutput();

Note however, that, if you are trying to use IGSTK,
there are already specific reader developed in
IGSTK that encapsulate the ITK readers inside safe
state machine classes.




    Regards,



         Luis


=====================================
On 3/15/07, sblestel at irisa.fr <sblestel at irisa.fr> wrote:
> Hello,
>
> I use a specific image reader that only returns an itk::image, and I need
> an itk::OrientedImage to display my image (with igstk).
> Has a mapper already been done ?
>
> Thanks,
>
> Sophie
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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