<div dir="ltr">Thanks everyone for your suggestive solutions. I&#39;ll probably start with option Bill suggested, however, Brad, where&#39;s the <strong class="">itkBoundingBoxImageLabelMapFilter </strong><span class="">? I couldn&#39;t find it on the reposit</span><span class="">ory<strong> </strong>you linked to.</span><strong class=""><br>
</strong></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/14 Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hello,<div><br></div><div>I have an ITK extension which does what Richard suggests:</div><div><br></div><div><a href="https://github.com/blowekamp/itkOBBLabelMap" target="_blank">https://github.com/blowekamp/itkOBBLabelMap</a></div>
<div><br></div><div>I believe this test does what you want:</div><div><br></div><div><a href="https://github.com/blowekamp/itkOBBLabelMap/blob/master/test/itkBoundingBoxImageLabelMapFilterTest.cxx" target="_blank">https://github.com/blowekamp/itkOBBLabelMap/blob/master/test/itkBoundingBoxImageLabelMapFilterTest.cxx</a></div>
<div><br></div><div>Also in the module is the computation of Oriented Bounding Boxes based on the orientation of the second movements. And similarly there is a way to extract the resampled images. However, there is an issue with the lack of thread safely with the interpolator, so a line needs to currently be commented out of OBB image.</div>
<div><br></div><div>I&#39;d recommend writing a test to validate the results are as expected before using it.</div><div><br></div><div>Let me know if it works for you.</div><div><br></div><div>Brad</div><div><div class="h5">
<div><br><div><div>On Sep 14, 2013, at 1:32 AM, Richard Beare &lt;<a href="mailto:richard.beare@gmail.com" target="_blank">richard.beare@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><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">&lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;</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><br>
On Fri, Sep 13, 2013 at 4:33 PM, Pol Monsó &lt;<a href="mailto:pol.monso%2Btools@gmail.com" target="_blank">pol.monso+tools@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;ve searching how to extract each connected component of a binary image<br>
&gt; such as<br>
&gt; <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>
&gt; into a separate image through the ConnectedComponentFilter (or maybe the<br>
&gt; labelmap?)<br>
&gt;<br>
&gt; I&#39;ve seen how to extract the largest one on the examples, but I couldn&#39;t see<br>
&gt; how to iterate over the image to extract each one of them into a separate<br>
&gt; image. I could iterate over the image checking pixelvalues, but that does<br>
&gt; not seem efficient and I suspect there&#39;s another way to do this.<br>
&gt;<br>
&gt; It looks that the ChangeLabelImageFilter should be able to do it but I<br>
&gt; couldn&#39;t figure out how. A short example would be perfect, or a pointer to<br>
&gt; how to iterate over the connected components.<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Pol<br>
&gt;<br>
</div></div>&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<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>
_____________________________________<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></div></div></div><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>
<br></blockquote></div><br></div>