<div dir="ltr"><font><font face="verdana,sans-serif">It feels even better if you were the initiator :D</font></font></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 13, 2013 at 12:01 PM, Matt McCormick <span dir="ltr">&lt;<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for explicitly recognizing this, Hans.  It is important to<br>
acknowledge how outstanding this is!<br>
<br>
Go team,<br>
Matt<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Feb 13, 2013 at 7:56 AM, Johnson, Hans J &lt;<a href="mailto:hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a>&gt; wrote:<br>
&gt; All,<br>
&gt;<br>
&gt; I wanted to pontificate on the virtues of living a good clean coding life<br>
&gt; :) .<br>
&gt;<br>
&gt; A need was identified on the user mailing list,<br>
&gt; --February 8th, a SimpleITK suggestions was made<br>
&gt; --February 12th, a re-implementation of that was provided in C++<br>
&gt; --February 13th, an insight-journal article with illustrations,<br>
&gt; alternative approaches, AND implementation files was submitted and is<br>
&gt; available to the community<br>
&gt; --Future these tools are being deployed TODAY for advancing our<br>
&gt; understanding of human diseasee<br>
&gt;<br>
&gt; It is wonderful to be part of such a distinguished community.<br>
&gt;<br>
&gt; GO TEAM ITK!<br>
&gt;<br>
&gt; Hans<br>
&gt;<br>
&gt; On 2/13/13 4:34 AM, &quot;Richard Beare&quot; &lt;<a href="mailto:richard.beare@gmail.com">richard.beare@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;The parallel classes for this are now on InsightJournal. Article<br>
&gt;&gt;includes some comparisons - hope it helps:<br>
&gt;&gt;<br>
&gt;&gt;<a href="http://hdl.handle.net/10380/3399" target="_blank">http://hdl.handle.net/10380/3399</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;On Tue, Feb 12, 2013 at 8:20 AM, Dženan Zukić &lt;<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; Today I finally managed to try it myself, and it works. Below is<br>
&gt;&gt;&gt; implementation in ITK, if anyone needs it.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; typedef itk::Image&lt;unsigned char, 3&gt; VisualizingImageType;<br>
&gt;&gt;&gt; typedef itk::Image&lt;float, 3&gt; InternalImageType;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; //function call example<br>
&gt;&gt;&gt; std::vector&lt;VisualizingImageType::IndexType&gt; centers;<br>
&gt;&gt;&gt; for (int i=0; i&lt;vertebra.size(); i++)<br>
&gt;&gt;&gt; centers.push_back(vertebra[i]-&gt;centerIndex);<br>
&gt;&gt;&gt; VisualizingImageType::Pointer vInfluence=multilabelDilation(region, 50,<br>
&gt;&gt;&gt; centers);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; VisualizingImageType::Pointer multilabelDilation(itk::ImageRegion&lt;3&gt;<br>
&gt;&gt;&gt;region,<br>
&gt;&gt;&gt; float radius, std::vector&lt;VisualizingImageType::IndexType&gt; points)<br>
&gt;&gt;&gt; {<br>
&gt;&gt;&gt;     typedef<br>
&gt;&gt;&gt; itk::BinaryBallStructuringElement&lt;VisualizingImageType::PixelType,3&gt;<br>
&gt;&gt;&gt; BallType;<br>
&gt;&gt;&gt;     BallType ball;<br>
&gt;&gt;&gt;     ball.SetRadius(radius);<br>
&gt;&gt;&gt;     ball.CreateStructuringElement();<br>
&gt;&gt;&gt;     typedef itk::BinaryDilateImageFilter&lt;VisualizingImageType,<br>
&gt;&gt;&gt; VisualizingImageType, BallType&gt; growType;<br>
&gt;&gt;&gt;     growType::Pointer grow=growType::New();<br>
&gt;&gt;&gt;     grow-&gt;SetKernel(ball); //grow-&gt;SetRadius(radius);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     VisualizingImageType::Pointer image=VisualizingImageType::New();<br>
&gt;&gt;&gt;     image-&gt;SetRegions(region);<br>
&gt;&gt;&gt;     image-&gt;Allocate();<br>
&gt;&gt;&gt;     image-&gt;FillBuffer(0);<br>
&gt;&gt;&gt;     for (int i=0; i&lt;points.size(); i++)<br>
&gt;&gt;&gt;         image-&gt;SetPixel(points[i], grow-&gt;GetDilateValue());<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     grow-&gt;SetInput(image);<br>
&gt;&gt;&gt;     grow-&gt;Update();<br>
&gt;&gt;&gt;     writeImage(grow-&gt;GetOutput(), &quot;1dilate.nrrd&quot;); //debug<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     typedef<br>
&gt;&gt;&gt;itk::SignedMaurerDistanceMapImageFilter&lt;VisualizingImageType,<br>
&gt;&gt;&gt; InternalImageType&gt; DistanceMapType;<br>
&gt;&gt;&gt;     DistanceMapType::Pointer dm=DistanceMapType::New();<br>
&gt;&gt;&gt;     dm-&gt;SetInput(image);<br>
&gt;&gt;&gt;     dm-&gt;SetUseImageSpacing(true);<br>
&gt;&gt;&gt;     dm-&gt;InsideIsPositiveOff();<br>
&gt;&gt;&gt;     dm-&gt;Update();<br>
&gt;&gt;&gt;     writeImage(dm-&gt;GetOutput(), &quot;2distanceMap.nrrd&quot;); //debug<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     for (int i=0; i&lt;points.size(); i++)<br>
&gt;&gt;&gt;         image-&gt;SetPixel(points[i], i+1); //now set index+1<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     typedef<br>
&gt;&gt;&gt; itk::MorphologicalWatershedFromMarkersImageFilter&lt;InternalImageType,<br>
&gt;&gt;&gt; VisualizingImageType&gt; morphoWSfMType;<br>
&gt;&gt;&gt;     morphoWSfMType::Pointer ws=morphoWSfMType::New();<br>
&gt;&gt;&gt;     ws-&gt;SetInput1(dm-&gt;GetOutput());<br>
&gt;&gt;&gt;     ws-&gt;SetInput2(image);<br>
&gt;&gt;&gt;     ws-&gt;Update();<br>
&gt;&gt;&gt;     writeImage(ws-&gt;GetOutput(), &quot;3watershed.nrrd&quot;); //debug<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     typedef itk::AndImageFilter&lt;VisualizingImageType&gt; AndType;<br>
&gt;&gt;&gt;     AndType::Pointer and=AndType::New();<br>
&gt;&gt;&gt;     and-&gt;SetInput1(ws-&gt;GetOutput());<br>
&gt;&gt;&gt;     and-&gt;SetInput2(grow-&gt;GetOutput());<br>
&gt;&gt;&gt;     and-&gt;Update();<br>
&gt;&gt;&gt;     writeImage(and-&gt;GetOutput(), &quot;4multiplied.nrrd&quot;); //debug<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     return and-&gt;GetOutput();<br>
&gt;&gt;&gt; }<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Fri, Feb 8, 2013 at 11:36 AM, Bradley Lowekamp<br>
&gt;&gt;&gt;&lt;<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Unfortunately, my helpful e-mail was too big to make it to the list. So<br>
&gt;&gt;&gt;&gt; here is the important bit, which defines a function in Python with<br>
&gt;&gt;&gt;&gt; SimpleITK:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; def MultilabelDilation(img,<br>
&gt;&gt;&gt;&gt; radius=1,kernel=sitk.BinaryDilateImageFilter.Ball):<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;     distImg = sitk.SignedMaurerDistanceMap(img != 0,<br>
&gt;&gt;&gt;&gt; insideIsPositive=False, squaredDistance=False, useImageSpacing=False)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;     dilatImg = sitk.BinaryDilate(img!=0, radius, kernel)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;     wsImg = sitk.MorphologicalWatershedFromMarkers(distImg, img)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;     return dilatImg*wsImg<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Feb 8, 2013, at 9:42 AM, Dženan Zukić &lt;<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks for the interest and the provided code Brad. Hopefully I will<br>
&gt;&gt;&gt;&gt;get<br>
&gt;&gt;&gt;&gt; to work today to try it out myself :D (Blizzard warning in Boston,<br>
&gt;&gt;&gt;&gt;where I<br>
&gt;&gt;&gt;&gt; am for a couple months)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;_____________________________________<br>
&gt;&gt;Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt;Visit other Kitware open-source projects at<br>
&gt;&gt;<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt;Kitware offers ITK Training Courses, for more information visit:<br>
&gt;&gt;<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
&gt;&gt;<br>
&gt;&gt;Please keep messages on-topic and check the ITK FAQ at:<br>
&gt;&gt;<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt;Follow this link to subscribe/unsubscribe:<br>
&gt;&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>
&gt;<br>
&gt;<br>
&gt; ________________________________<br>
&gt; Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.<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.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>
_____________________________________<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>
</div></div></blockquote></div><br></div>