[Insight-users] auto crop image

Anja Ende anja.ende at googlemail.com
Mon Sep 23 17:58:29 EDT 2013


Thanks guys. In the end, I ended up using the
 itkImageSliceConstIteratorWithIndex as I only needed to crop along one
dimension and it worked quite well but the solution suggested might be
better and I will give it a try.

Thanks!

Anja


On 23 September 2013 14:01, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:

> Hello,
>
> Another option would be to use the LabelStatisticsImageFilter to get the
> bounding box:
> http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html
>
> http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html#a132a7474536f24a7285950353cfe0e3c
>
> Then combine that with the largest possible region to make the
> itk::ImageRegion you want. And place that into on of these filters:
>
>
> http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html
> http://www.itk.org/Doxygen/html/classitk_1_1CropImageFilter.html
>
> Brad
>
> On Sep 22, 2013, at 7:35 PM, Dan Mueller <dan.muel at gmail.com> wrote:
>
> > Hi Anja,
> >
> > You might want to try the AutoCropLabelMapImageFilter:
> > http://www.itk.org/Doxygen/html/classitk_1_1AutoCropLabelMapFilter.html
> >
> > HTH
> >
> > Cheers, Dan
> >
> > On 23 September 2013 05:16, Anja Ende <anja.ende at googlemail.com> wrote:
> >> Hello,
> >>
> >> Is there a way to auto crop an image along a particular dimension in
> ITK.
> >> So, basically I want to remove all the zero value background rows in an
> >> image and adjust the image origin accordingly according to the removed
> rows.
> >>
> >> Is there an easy way to do this in ITK? Sort of like an auto crop
> filter?
> >>
> >> Thanks for your help.
> >>
> >> Cheers,
> >>
> >> Anja
> >>
> >> _____________________________________
> >> 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
> >>
> > _____________________________________
> > 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
>
>


-- 
Cheers,

Anja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130923/f26fc9ca/attachment.htm>


More information about the Insight-users mailing list