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

Bill Lorensen bill.lorensen at gmail.com
Fri Sep 13 16:41:22 EDT 2013


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


More information about the Insight-users mailing list