In addition to what Nicholas said, label manipulation in ITK is explained in this insight journal article:<div><br></div><div><a href="http://www.insight-journal.org/browse/publication/176">http://www.insight-journal.org/browse/publication/176</a></div>
<div><br></div><div><a href="http://www.insight-journal.org/browse/publication/176"></a>(those filters are now part of the standard ITK package)</div><div><br></div><div>regards</div><div><br><div class="gmail_quote">On Wed, Dec 8, 2010 at 8:41 PM, Nicholas Tustison <span dir="ltr">&lt;<a href="mailto:ntustison@gmail.com">ntustison@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;">Hi Neal,<br>
<br>
Would this help?<br>
<br>
<a href="http://www.insight-journal.org/browse/publication/707" target="_blank">http://www.insight-journal.org/browse/publication/707</a><br>
<br>
Nick<br>
<div><div></div><div class="h5"><br>
On Dec 8, 2010, at 2:22 PM, Neal R. Harvey wrote:<br>
<br>
&gt; I am trying to write some code with which I can efficiently compare segmentation results with<br>
&gt; a known ground truth. There are several papers that describe interesting metrics for doing this.<br>
&gt; A common theme is finding intersection between segments.<br>
&gt; There seems to be most of the functionality within ITK for doing this, but I haven&#39;t been able to<br>
&gt; figure out how to do it effectively/efficiently.<br>
&gt; I want to be able to go through each region in a segmented image (i.e. the pixels that have the same<br>
&gt; value &quot;i&quot; in that image) and calculate the number of pixels within that region that intersect with<br>
&gt; each region in a ground truth image (i.e. the pixels that have the same value &quot;j&quot; in that image).<br>
&gt; I don&#39;t want to have to go through every pixel in the image and test to see if it is value &quot;i&quot;<br>
&gt; or &quot;j&quot;, but want to have some way of limiting my processing to only those pixels that have the<br>
&gt; required values.<br>
&gt; I am sure that this should be possible within ITK, I just haven&#39;t been able to figure it out.<br>
&gt; If anyone has any suggestions, it would be very much appreciated.<br>
&gt;<br>
&gt; Cheers<br>
&gt;<br>
&gt; Harve<br>
&gt;<br>
&gt; --<br>
&gt; HARVE (Neal R. Harvey)           Email: <a href="mailto:harve@lanl.gov">harve@lanl.gov</a><br>
&gt; ISR-2                            Phone: 505 667 9077<br>
&gt; Los Alamos National Laboratory   Fax: 505 664 0362<br>
&gt; Los Alamos, NM 87545, USA        Mail Stop: D-436<br>
&gt; The generation of random numbers is too important to be left to chance.<br>
&gt;<br>
&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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Sergio Vera<br><br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. (+34) 932 380 592<br> <a href="http://www.alma3d.com">www.alma3d.com</a><br>

</div>