[Insight-users] 3D image containing just one 2D image

Luis Ibanez luis.ibanez at kitware.com
Mon Oct 8 09:26:44 EDT 2007


Hi Soosho,

It should be enough to instantiate a 3D image and to use
an imageFileReader to read into it your 2D image.



Something like:


    typedef itk::Image< PixelType, 3 >           ImageType;
    typedef itk::ImageFileReader< ImageType >    ReaderType;

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

    reader->SetFileName("my2DImage.png");

    reader->Update();

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



This should give you a 3D image that contains a single slice.



    Regards,


        Luis


--------------------------
soosho wrote:
> Hi Mr. Luis Ibanez
> 
> Hope you are fine.
> 
> I want to create 3D image containing just one 2D image. I used
> ImageSeriesReadWrite but it neads at least two 2D images. I am trying to
> register a 2D image into a 3D volume. Is there any alternative please?
> 
> Thanks a lot,
> Esteghamat


More information about the Insight-users mailing list