[Insight-users] Re-sort a 3D Volume

Luis Ibanez luis.ibanez at kitware.com
Sat Apr 7 18:33:36 EDT 2007


Hi Roger,

You will need to run the ExtractImageFilter first in a loop,
and at each iteration extract a different slice.

You should put the output of the ExtractImageFilter into a
std::vector of SmartPointers, and after pushing it in the
vector you *MUST* call DisconnectPipeline() on that image.

Otherwise, all your "slice" images are using the *same SmartPointer*.
That is, the ExtractFilter output is reusing the same instance of the
image object every time.

I'm guessing that what you see as output of the TileImageFilter
is that all the tiles contain a replication of the "Last" slice
that you extracted with the ExtractImageFilter.


Adding the call to DisconnectPipeline() will force the Extract
ImageFilter to create a new instance of the image object for
storing its output at every iteration.


    Regards,


       Luis


---------------------------------
Roger Bramon Feixas wrote:
> Hi,
> 
> I need to re-order the slices of a 3D volume. I tried to extract 2D  
> slices using a "itkExtractImageFilter" and create a new volume using  
> "itkTileImageFilter" but it doesn't work. The extraction works good  
> because I write the output in an image and it's correct. The problem  is 
> in "itkTileImageFilter". I receive data empty error when I want to  use 
> tileImageFilter output. That is my algorism:
> 
> before the loop:
> 
>  - I instantiate the TileImageFilter
>  - I set the layout in 1,1,0
> 
> into the loop over the images:
> 
>  - I allocated a different ExtractImageFilter for each image
>  - I fed the TileImageFilter with the output of each different  
> ExtractImageFilter: tileFilter->PushBackInput( extractFilter- 
>  >GetOutput() ). I also tried to do that using: tileFilter->SetInput ( 
> i, extractFilter->GetOutput() )
> 
> after the loop:
> 
>  TileImageFilter->Update();
> 
> After the loop, the layout is : 1,1,X where X is the number of slices  
> that I pushed. Also, I read in a insight-user mail that they solved a  
> similar problem saving all of ExtractimageFilter objects in a vector  
> but in my way it doesn't work.
> 
> I hope anybody know anything about my problem.
> 
> 
> Thanks,
> 
> Roger
> 
> _______________________________________________
> 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