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

sblestel at irisa.fr sblestel at irisa.fr
Fri Mar 16 04:03:21 EST 2007


Hi,

I can't do that because I don't use itkImageFileReader to read my image. I
use a specific reader (because the format of the image is very specific).
I can only obtain an itk::Image (3D) and I need to modify it to obtain an
itk::OrientedImage (and I know the orientation of the image)

Thanks,

           Sophie


> 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