[Insight-users] joining multiple slices into a 3D image

Miller, James V (Research) millerjv@crd.ge.com
Tue, 15 Apr 2003 15:33:59 -0400


While not an elegant solution, there is a way to do this.  You will need
to update from the CVS repository. This capability is not available in 
the official releases.

You will need to use the following filters:

CastImageFilter
ConstantPadImageFilter
PasteImageFilter

Take each of your Image<unsigned char, 2> images and run them through a
CastImageFilter<Image<unsigned char, 2>, Image<unsigned char, 3> >.  This
will "convert" each of your 2D images into 3D images (each 3D image will 
have just one slice).  

Then use the ConstantPadImageFilter to add extra slices to one of 3D images
(using the PadUpperBound() method to define the number of extra slices).

Then use the PasteImageFilter to overwrite a slice in the padded 3D image
with one of the one slice 3D images from above.  Unfortunately, you will
need multiple PasteImageFilters (one for each slice that needs to be written
into the volume).

I was planning on encapsulating this into its own filter, naming it
something 
like StackImageFilter. Just haven't gotten around to it yet.

If the 2D images exist on the file system, you may be able to create a
MetaImage
header for them and read them into ITK as volume directly.

Jim


> -----Original Message-----
> From: salah [mailto:salah@gris.uni-tuebingen.de]
> Sent: Tuesday, April 15, 2003 8:34 AM
> To: ITK Users
> Subject: [Insight-users] joining multiple slices into a 3D image
> 
> 
> Hello,
> 
> How can I join a number of equa-size slices defined as 
> itk::image<unsigned char,  2>
> into one single 3D image of the form itk::image <unsigned char, 3>
> 
> 
> Thanks,
> 
> 
> ->8<------------->8<------------->8<------------->8<----------
> --->8<------------->8<-
> Zein I. Salah 
> University of Tubingen, WSI-GRIS, Sand 14, 72076 Tubingen 
> Email: salah@gris.uni-tuebingen.de
> Tel.: (07071) 29 75465 (GRIS),           Fax: (07071) 29 54 66
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>