[ITK] [ITK-users] Splitting and repasting a volume with overlap
Bradley Lowekamp
blowekamp at mail.nih.gov
Mon Mar 16 10:20:24 EDT 2015
You may find this method useful:
http://www.itk.org/Doxygen/html/structitk_1_1ImageAlgorithm.html#a5ec5bcac992cb3b1302840636530ba20
Brad
On Mar 16, 2015, at 10:16 AM, Pol Monsó Purtí <lluna.nova at gmail.com> wrote:
> Mmh, I believe I misread the RegionOfInterestImageFilter documentation, confusing dimension with size. That should work.
>
> I still have the computation of the splitting regions problem to handle, but maybe with this filter is easier than with the ExtractImageFilter. Or maybe it just removes step 7?
>
> Is there a way to ease the repasting back to the original region with it? How should I use the physical space index?
>
> 2015-03-16 14:25 GMT+01:00 Pol Monsó Purtí <lluna.nova at gmail.com>:
> Hello Bradley,
>
> Thank you for your answer and suggestion.
>
> Answering your question: It's not for multi-threading purposes, I have to split the image due to memory limitations.
>
> I would use extractImage directly and do streaming, but the client and the low-level libraries might not work correctly if I do that. I have to provide itk images disconnected from the pipeline and with proper indexes and sizes.
>
> The RegionOfInterestImageFilter would have the same memory footprint, and it would still be tricky to compute the regions of interest, due to the overlapping.
>
>
>
> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp <blowekamp at mail.nih.gov>:
> Hello,
>
> The RegionOfInterestImageFilter[1] is very similar to the ExtractImageFilter, but returns an image whose starting index is always zeros.
>
> The process you described is remarkable close to what occur in each filter for the multi-threading process. Also what occurs in the StreamingImageFilter is very similar, but just copies the region.
>
> As you didn't mention you motivation for chunking the data this way be it for threading or memory requirements, I can't fully advise.
>
> Brad
>
>
> [1 ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html
> [2] https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213
>
>
> On Mar 16, 2015, at 7:37 AM, Pol Monsó Purtí <lluna.nova at gmail.com> wrote:
>
> > Hello everyone,
> >
> > We need to split a volume into pieces, overlaped by a certain amount, do some computation and then repaste them.
> >
> > The computation requires the pieces' region indexes to be set to zero. The original volume might not have index at zero, but be a subregion itself.
> >
> > What is the best way to achieve this?
> >
> > I've thought of the following pipeline:
> >
> > 1. imageRegionSplitterSlowDimension
> > 2. Store the index and size of each region
> > 3. manually increase the size of each region (and modify index)
> > 4. crop with the largestPossibleRegion of the original volume (to prevent requesting more than available)
> > iterate over regions:
> > 5. extractImageFilter
> > 6. disconnect pipeline for each region
> > 7. reset indexes
> > 8. perform computation
> > 9. crop with the regions in step 1 to remove the added overlap
> > 10. restore indexes
> > 11. pasteImageFilter
> >
> > I'll have to think of a smart way to deal with the index restore/cropping of steps 9 and 10.
> >
> > I somehow feel somebody will have already dealt with this... And there's certainly a better way to do it.
> > _____________________________________
> > 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://public.kitware.com/mailman/listinfo/insight-users
>
>
>
> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp <blowekamp at mail.nih.gov>:
> Hello,
>
> The RegionOfInterestImageFilter[1] is very similar to the ExtractImageFilter, but returns an image whose starting index is always zeros.
>
> The process you described is remarkable close to what occur in each filter for the multi-threading process. Also what occurs in the StreamingImageFilter is very similar, but just copies the region.
>
> As you didn't mention you motivation for chunking the data this way be it for threading or memory requirements, I can't fully advise.
>
> Brad
>
>
> [1 ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html
> [2] https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213
>
>
> On Mar 16, 2015, at 7:37 AM, Pol Monsó Purtí <lluna.nova at gmail.com> wrote:
>
> > Hello everyone,
> >
> > We need to split a volume into pieces, overlaped by a certain amount, do some computation and then repaste them.
> >
> > The computation requires the pieces' region indexes to be set to zero. The original volume might not have index at zero, but be a subregion itself.
> >
> > What is the best way to achieve this?
> >
> > I've thought of the following pipeline:
> >
> > 1. imageRegionSplitterSlowDimension
> > 2. Store the index and size of each region
> > 3. manually increase the size of each region (and modify index)
> > 4. crop with the largestPossibleRegion of the original volume (to prevent requesting more than available)
> > iterate over regions:
> > 5. extractImageFilter
> > 6. disconnect pipeline for each region
> > 7. reset indexes
> > 8. perform computation
> > 9. crop with the regions in step 1 to remove the added overlap
> > 10. restore indexes
> > 11. pasteImageFilter
> >
> > I'll have to think of a smart way to deal with the index restore/cropping of steps 9 and 10.
> >
> > I somehow feel somebody will have already dealt with this... And there's certainly a better way to do it.
> > _____________________________________
> > 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://public.kitware.com/mailman/listinfo/insight-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150316/41e62602/attachment.html>
-------------- next part --------------
_____________________________________
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://public.kitware.com/mailman/listinfo/insight-users
More information about the Community
mailing list