[Insight-users] how to change 2D ITK-images to 3D Image Volume

shiwei swingsw89 at 163.com
Thu Sep 26 11:03:47 EDT 2013


Hi!
   I stil have a problem when using the "iitkJoinImageFilter".
  Here is the thing:
   typedef itk::Image< double, 2 >   ImageType2D;  // defying the Readertype,they are 2D slices
   typedef itk::Image< double,3 >    ImageType3D; // the 3D volume which I want to get from the JoinImageFilter


  As I read a series of 2D slices with a "for" loop,then after processing them , I use JoinImageFilter to get a 3D output, then I had a problem:


 typedef itk::JoinImageFilter<ImageType2D, ImageType3D> JoinImageFilterType;
 JoinImageFilterType::Pointer joinFilter = JoinImageFilterType::New();


  for(int slice=0;slice<10,slice++)
{
         .........read the 2D slice...........
         ..........processing............
        ...........2D output Image......
    joinFilter->SetInput(slice,outputImage);
}
 joinFilter->update;


But after I did this ,vs comes out an error says itk can't convert from 2D to 3D,  If it's convienient can you show me an example like this with the "iitkJoinImageFilter"? To show me how to make this right? Thank you! Also,if I want to test whether I get a proper 3D volume,what shall I do then? 


         






At 2013-09-25 14:23:27,shiwei <swingsw89 at 163.com> wrote:

Thank you very much! Brad!


                                         shiwei






At 2013-09-25 00:00:50,"Bradley Lowekamp" <blowekamp at mail.nih.gov> wrote:

Hello,


To join a series of 2D image into a 3D volume you can you the JoinImageFilter:
http://www.itk.org/Insight/Doxygen/html/classitk_1_1JoinImageFilter.html


The extract a 2D image from a 3D volume you can use the ExtractImageFilter:
http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html


To extract a 3D volume from a 3D volume there are a few filter:
http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html
http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html
http://www.itk.org/Doxygen/html/classitk_1_1CropImageFilter.html


Hope that helps,
Brad


On Sep 24, 2013, at 11:14 AM, shiwei <swingsw89 at 163.com> wrote:


Hi,all~
As I first read a 3D Image Volume slice by slice,then after processing each slice I need to change them to a 3D volume for further processing, However, I can't use itk::ImageSeriesReader for my pixeltype now is double and it takes to much time to write out the 2D image first.
       I wonder if there is a class to help me read the 2D slices directly to 3D volume just in the memory.Also, I still eager to know whether there is a class can direclty extract a part of 3D volume from a bigger one.Beacuse IF there is no way to deal with that ,I will have to change all the 2D images to 2D Array then combine them to 3D Array which I think may take a lot of time.
       Do you have any way to figure this out? Thank you all !


_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

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





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130926/933c65a4/attachment.htm>


More information about the Insight-users mailing list