<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"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></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 <<a href="mailto:hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a>> wrote:<br>
> All,<br>
><br>
> I wanted to pontificate on the virtues of living a good clean coding life<br>
> :) .<br>
><br>
> A need was identified on the user mailing list,<br>
> --February 8th, a SimpleITK suggestions was made<br>
> --February 12th, a re-implementation of that was provided in C++<br>
> --February 13th, an insight-journal article with illustrations,<br>
> alternative approaches, AND implementation files was submitted and is<br>
> available to the community<br>
> --Future these tools are being deployed TODAY for advancing our<br>
> understanding of human diseasee<br>
><br>
> It is wonderful to be part of such a distinguished community.<br>
><br>
> GO TEAM ITK!<br>
><br>
> Hans<br>
><br>
> On 2/13/13 4:34 AM, "Richard Beare" <<a href="mailto:richard.beare@gmail.com">richard.beare@gmail.com</a>> wrote:<br>
><br>
>>The parallel classes for this are now on InsightJournal. Article<br>
>>includes some comparisons - hope it helps:<br>
>><br>
>><a href="http://hdl.handle.net/10380/3399" target="_blank">http://hdl.handle.net/10380/3399</a><br>
>><br>
>><br>
>>On Tue, Feb 12, 2013 at 8:20 AM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>> wrote:<br>
>>> Today I finally managed to try it myself, and it works. Below is<br>
>>> implementation in ITK, if anyone needs it.<br>
>>><br>
>>> typedef itk::Image<unsigned char, 3> VisualizingImageType;<br>
>>> typedef itk::Image<float, 3> InternalImageType;<br>
>>><br>
>>> //function call example<br>
>>> std::vector<VisualizingImageType::IndexType> centers;<br>
>>> for (int i=0; i<vertebra.size(); i++)<br>
>>> centers.push_back(vertebra[i]->centerIndex);<br>
>>> VisualizingImageType::Pointer vInfluence=multilabelDilation(region, 50,<br>
>>> centers);<br>
>>><br>
>>><br>
>>> VisualizingImageType::Pointer multilabelDilation(itk::ImageRegion<3><br>
>>>region,<br>
>>> float radius, std::vector<VisualizingImageType::IndexType> points)<br>
>>> {<br>
>>> typedef<br>
>>> itk::BinaryBallStructuringElement<VisualizingImageType::PixelType,3><br>
>>> BallType;<br>
>>> BallType ball;<br>
>>> ball.SetRadius(radius);<br>
>>> ball.CreateStructuringElement();<br>
>>> typedef itk::BinaryDilateImageFilter<VisualizingImageType,<br>
>>> VisualizingImageType, BallType> growType;<br>
>>> growType::Pointer grow=growType::New();<br>
>>> grow->SetKernel(ball); //grow->SetRadius(radius);<br>
>>><br>
>>> VisualizingImageType::Pointer image=VisualizingImageType::New();<br>
>>> image->SetRegions(region);<br>
>>> image->Allocate();<br>
>>> image->FillBuffer(0);<br>
>>> for (int i=0; i<points.size(); i++)<br>
>>> image->SetPixel(points[i], grow->GetDilateValue());<br>
>>><br>
>>> grow->SetInput(image);<br>
>>> grow->Update();<br>
>>> writeImage(grow->GetOutput(), "1dilate.nrrd"); //debug<br>
>>><br>
>>> typedef<br>
>>>itk::SignedMaurerDistanceMapImageFilter<VisualizingImageType,<br>
>>> InternalImageType> DistanceMapType;<br>
>>> DistanceMapType::Pointer dm=DistanceMapType::New();<br>
>>> dm->SetInput(image);<br>
>>> dm->SetUseImageSpacing(true);<br>
>>> dm->InsideIsPositiveOff();<br>
>>> dm->Update();<br>
>>> writeImage(dm->GetOutput(), "2distanceMap.nrrd"); //debug<br>
>>><br>
>>> for (int i=0; i<points.size(); i++)<br>
>>> image->SetPixel(points[i], i+1); //now set index+1<br>
>>><br>
>>> typedef<br>
>>> itk::MorphologicalWatershedFromMarkersImageFilter<InternalImageType,<br>
>>> VisualizingImageType> morphoWSfMType;<br>
>>> morphoWSfMType::Pointer ws=morphoWSfMType::New();<br>
>>> ws->SetInput1(dm->GetOutput());<br>
>>> ws->SetInput2(image);<br>
>>> ws->Update();<br>
>>> writeImage(ws->GetOutput(), "3watershed.nrrd"); //debug<br>
>>><br>
>>> typedef itk::AndImageFilter<VisualizingImageType> AndType;<br>
>>> AndType::Pointer and=AndType::New();<br>
>>> and->SetInput1(ws->GetOutput());<br>
>>> and->SetInput2(grow->GetOutput());<br>
>>> and->Update();<br>
>>> writeImage(and->GetOutput(), "4multiplied.nrrd"); //debug<br>
>>><br>
>>> return and->GetOutput();<br>
>>> }<br>
>>><br>
>>><br>
>>> On Fri, Feb 8, 2013 at 11:36 AM, Bradley Lowekamp<br>
>>><<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>
>>> wrote:<br>
>>>><br>
>>>> Unfortunately, my helpful e-mail was too big to make it to the list. So<br>
>>>> here is the important bit, which defines a function in Python with<br>
>>>> SimpleITK:<br>
>>>><br>
>>>><br>
>>>> def MultilabelDilation(img,<br>
>>>> radius=1,kernel=sitk.BinaryDilateImageFilter.Ball):<br>
>>>><br>
>>>> distImg = sitk.SignedMaurerDistanceMap(img != 0,<br>
>>>> insideIsPositive=False, squaredDistance=False, useImageSpacing=False)<br>
>>>><br>
>>>> dilatImg = sitk.BinaryDilate(img!=0, radius, kernel)<br>
>>>><br>
>>>> wsImg = sitk.MorphologicalWatershedFromMarkers(distImg, img)<br>
>>>><br>
>>>> return dilatImg*wsImg<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Feb 8, 2013, at 9:42 AM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>> wrote:<br>
>>>><br>
>>>> Thanks for the interest and the provided code Brad. Hopefully I will<br>
>>>>get<br>
>>>> to work today to try it out myself :D (Blizzard warning in Boston,<br>
>>>>where I<br>
>>>> am for a couple months)<br>
>>>><br>
>>>><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.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>
> 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>
> ________________________________<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>
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>