[Insight-users] Convert a set of 2D images to 3D

Andreas Schuh andreas.schuh.84 at googlemail.com
Mon Apr 13 23:47:32 EDT 2009


Hi Luis, Hi Wen,

actually I haven't found any filter that does that for you. But one way 
that should work is using the PadImageFilter (or ConstantPadImageFilter) 
to create a 3D volume of each 2D image, where each 2D image is placed in 
the appropriate slice, and then adding those 3D volumes using the 
AddImageFilter. However, this might be not very memory efficient ... If 
your 2D image is of type itk::Image<TPixel, 2>, you have to create a 
fresh itk::Image<TPixel, 3> with the size of the third dimension being 1 
and set the pixel buffer to the one of the original 2D image. Then pass 
this 3D image to the PadImageFilter to get a 3D volume of the desired 
size, where the 2D image is in the appropriate slice position.

--
regards
Andreas

Luis Roberto P. Paula schrieb:
> In my case, I have the 3D volume, but I use the ExtractImageFilter to 
> perform a segmentation in some slices. I need to return now the 
> results to 3D.
>
> Thanks,
>
> On Mon, Apr 13, 2009 at 11:16 PM, Wen Shi <wsa18 at sfu.ca 
> <mailto:wsa18 at sfu.ca>> wrote:
>
>
>     I am interested in this topic.
>     For me I used seriesreader to read the 2D slices, then output it
>     using common writer.
>     But i think here you need to be careful of the writer (I mean you
>     need to specify the output file format. It must be a special one
>     such as RAW image.)
>
>     ----- Original Message -----
>     From: "Luis Roberto P. Paula" <luisrpp at gmail.com
>     <mailto:luisrpp at gmail.com>>
>     To: insight-users at itk.org <mailto:insight-users at itk.org>
>     Sent: Monday, April 13, 2009 7:06:17 PM GMT -08:00 US/Canada Pacific
>     Subject: [Insight-users] Convert a set of 2D images to 3D
>
>
>     Hi All,
>
>     I have a set of 2D images in axial orientation and I want to
>     create a 3D volume with this images.
>
>     It would be de reverse operation of the class ExtractImageFilter.
>
>     Does anybody knows how to do it?
>
>     Thanks in advance,
>     Luis
>
>     _____________________________________
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Please keep messages on-topic and check the ITK FAQ at:
>     http://www.itk.org/Wiki/ITK_FAQ
>
>     Follow this link to subscribe/unsubscribe:
>     http://www.itk.org/mailman/listinfo/insight-users
>
>
> ------------------------------------------------------------------------
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>   



More information about the Insight-users mailing list