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

frankmiller at jhmi.edu frankmiller at jhmi.edu
Tue Oct 2 10:39:00 EDT 2007


Esteghamat,

To load a 2D image as a 3D volume, use itk::ImageFileReader with a 3D
image type for the TOutputImage template parameter.

Something like,

  typedef unsigned short PixelType;
  typedef itk::Image< PixelType, 3 > SliceType;
  typedef itk::ImageFileReader< SliceType > SliceReaderType;

  SliceReaderType::Pointer pSliceReader = SliceReaderType::New();
  pSliceReader->SetFileName( fileName );
  SliceType::Pointer pSlice = pSliceReader->GetOutput();
  pSlice->Update();

Also, just in case you don't know, the trick to slice-to-volume
registration is to use the slice as the fixed image and the volume as
the moving image.

Good luck.

Frank

On Tue, Oct 02, 2007 at 01:22:59AM -0700, 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
> -- 
>   soosho
>   esteghamat at fastmail.fm
> 
> -- 
> http://www.fastmail.fm - The way an email service should be
> 
> _______________________________________________
> 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