<div dir="ltr">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.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sat, Sep 14, 2013 at 6:41 AM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As far as I know, there is not an ITK filter that will extract N<br>
images from a label image. You could use itkThresholdImageFilter to<br>
extract each label.<br>
<div><div class="h5"><br>
On Fri, Sep 13, 2013 at 4:33 PM, Pol Monsó <<a href="mailto:pol.monso%2Btools@gmail.com">pol.monso+tools@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I've searching how to extract each connected component of a binary image<br>
> such as<br>
> <a href="http://blogs.mathworks.com/images/steve/2008/binary_indexed_vis_01.png" target="_blank">http://blogs.mathworks.com/images/steve/2008/binary_indexed_vis_01.png</a><br>
> into a separate image through the ConnectedComponentFilter (or maybe the<br>
> labelmap?)<br>
><br>
> I've seen how to extract the largest one on the examples, but I couldn't see<br>
> how to iterate over the image to extract each one of them into a separate<br>
> image. I could iterate over the image checking pixelvalues, but that does<br>
> not seem efficient and I suspect there's another way to do this.<br>
><br>
> It looks that the ChangeLabelImageFilter should be able to do it but I<br>
> couldn't figure out how. A short example would be perfect, or a pointer to<br>
> how to iterate over the connected components.<br>
><br>
> Cheers,<br>
><br>
> Pol<br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
<br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div>