[ITK-users] In-place extraction of N-1 dimensional images from N dimensional images

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Thu Jul 28 13:24:44 EDT 2016


Hello,

I think the missing features to implement this proper is one step lower that the ExtractImageFilter, rather in the ImportImageContainer. The container would need to support presenting one buffer, but holding the whole buffer someplace. Also the ability to share buffers between images is not supported either. When filters are run “InPlace” the output steals the buffer from the input, so there is no buffer sharing. This is essentially adding different “view” to a buffer.

I had been concerned about the performance of the ExtractImageFilter filter previously. If I recall correctly I update the filter to use the ImageAlgorithm::Copy method and improved the performance by something like 100x for some test cases. You could profile the filter run with the default number of thread and with just 1 thread to determine how best to run it. Also you would need to veriify that the pipeline is executing as expected and efficiently. If this still does not meet your timing requirements you’d likely be better off just writing a function to create a ImportImageContainer with your “view”, and manage the memory yourself. This would bypass the pipeline.

HTH,
Brad

On Jul 28, 2016, at 1:06 PM, Dženan Zukić <dzenanz at gmail.com<mailto:dzenanz at gmail.com>> wrote:

Hi Toby,

Extract filter could theoretically run in place only when the extraction region differs from largest possible region only along the slowest changing index. To make this possible, ExtractImageFilter should override CanRunInPlace() which it inherits from InPlaceImageFilter and implement this theoretical check. Of course, other changes will be required to make it function properly.

Regards,
Dženan

On Thu, Jul 28, 2016 at 9:23 AM, Wood, Tobias <tobias.wood at kcl.ac.uk<mailto:tobias.wood at kcl.ac.uk>> wrote:
Hello Dženan,

I have had the same problem as Edwin with ExtractImageFilter, but in a different context. Eventually I gave up and accepted the speed/memory penalty of copying the 3D volumes out of the 4D series. Is there really no way in ITK to get a temporary “view” of a subregion for processing, without resorting to referencing the raw arrays?

Thanks,
Toby

On 28/07/2016, 13:40, "Insight-users on behalf of Dženan Zukić" <insight-users-bounces at itk.org<mailto:insight-users-bounces at itk.org> on behalf of dzenanz at gmail.com<mailto:dzenanz at gmail.com>> wrote:


    Hi Edwin,


    you should be able to achieve your goal using
    import image filter <http://www.vtk.org/doc/nightly/html/classvtkImageImport.html#details>. ITK has import image filter
    too <https://itk.org/Doxygen/html/classitk_1_1ImportImageFilter.html>, so you can decide in which library to do dimensional reduction.


    Regards,
    Dženan


    On Thu, Jul 28, 2016 at 4:37 AM, Edwin Bennink
    <hebennink at gmail.com<mailto:hebennink at gmail.com>> wrote:

    Hello,


    I am working on an ITK/VTK viewer for visualizing 3D+time image data. The data is represented by 4D images in ITK (x,y,z,t). I would like to be able to access the 3D data in VTK without copying it, since that would slow down scrolling through time in large
     datasets. I noticed that, although in-place extraction should be possible, the ExtractImageFilter 'says no' to in-place extraction when the input and output dimensions differ. Does anyone know a way to achieve my goal using existing ITK functions? For example,
     if there would be some way of reducing the dimension of 'flat' images, i.e. 3D (Nx,Ny,1) to 2D (Nx, Ny), then I could still use the ExtractImageFilter.


    Best,
    Edwin


    _____________________________________
    Powered by www.kitware.com<http://www.kitware.com/> <http://www.kitware.com<http://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://public.kitware.com/mailman/listinfo/insight-users











_____________________________________
Powered by www.kitware.com<http://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://public.kitware.com/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160728/98d49c7a/attachment.html>


More information about the Insight-users mailing list