<div dir="ltr"><div>Hi,<br><br>I&#39;ve searching how to extract each connected component of a binary image such as <a href="http://blogs.mathworks.com/images/steve/2008/binary_indexed_vis_01.png">http://blogs.mathworks.com/images/steve/2008/binary_indexed_vis_01.png</a><br>
</div><div>into a separate image through the ConnectedComponentFilter (or maybe the labelmap?)<br><br></div><div>I&#39;ve seen how to extract the largest one on the examples, but I couldn&#39;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&#39;s another way to do this.<br>
<br></div><div>It looks that the ChangeLabelImageFilter should be able to do it but I couldn&#39;t figure out how. A short example would be perfect, or a pointer to how to iterate over the connected components.<br><br></div>
<div>Cheers,<br><br>Pol<br></div></div>