[Insight-users] Extracting each connected component of a binary image

Richard Beare richard.beare at gmail.com
Sat Sep 14 01:32:07 EDT 2013


The label map tools make it easy to construct this kind of facility, with
bounding box computation and other useful options. There is also
AutoCropLabelMapFilter which may be a useful starting point.


On Sat, Sep 14, 2013 at 6:41 AM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> As far as I know, there is not an ITK filter that will extract N
> images from a label image. You could use itkThresholdImageFilter to
> extract each label.
>
> On Fri, Sep 13, 2013 at 4:33 PM, Pol Monsó <pol.monso+tools at gmail.com>
> wrote:
> > Hi,
> >
> > I've searching how to extract each connected component of a binary image
> > such as
> > http://blogs.mathworks.com/images/steve/2008/binary_indexed_vis_01.png
> > into a separate image through the ConnectedComponentFilter (or maybe the
> > labelmap?)
> >
> > I've seen how to extract the largest one on the examples, but I couldn't
> see
> > how to iterate over the image to extract each one of them into a separate
> > image. I could iterate over the image checking pixelvalues, but that does
> > not seem efficient and I suspect there's another way to do this.
> >
> > It looks that the ChangeLabelImageFilter should be able to do it but I
> > couldn't figure out how. A short example would be perfect, or a pointer
> to
> > how to iterate over the connected components.
> >
> > Cheers,
> >
> > Pol
> >
> > _____________________________________
> > 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
> >
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
> _____________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130914/6aeb74e1/attachment.htm>


More information about the Insight-users mailing list