[ITK Community] Problems with slice extraction from a 3D image for directions different from z

Bradley Lowekamp blowekamp at mail.nih.gov
Sat Mar 8 16:05:38 EST 2014


Luis,

Nice helpful post as always.

Regarding:

On Mar 8, 2014, at 3:24 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:

> 
> What I see out of order in your code is the line
> 
> filter->InPlaceOn();
> 
> which doesn't work well in the Extract image
> filter when you are extracting a 2D image out
> of a 3D image.
> 
> The InPlaceOn() method is intended for saving
> memory in the cases where an output image is
> of the same type of an input image.
> 
> In your case, the two images are of different
> dimension, and hence the output can not be
> stored in the input image.


It's correct that currently the ExtractImageFilter doesn't actually work InPlace, for this extract slice case. But it does work fine with the setting, it just currently is ignored.

For many standard pixel types, for this very common case, the input buffer is exactly the same as the output. So this is a case that filter could be optimize to just copying the buffer pointer, and not do any pixel operations...

Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140308/915f96e7/attachment-0002.html>


More information about the Community mailing list