<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Unfortunately, my helpful e-mail was too big to make it to the list. So here is the important bit, which defines a function in Python with SimpleITK:<div><br></div><div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; font-family: inherit; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; "><span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(0, 128, 0); font-weight: bold; ">def</span> <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">MultilabelDilation</span>(<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">img</span>, <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">radius</span>=<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(0, 0, 128); ">1</span>,<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">kernel</span>=<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">sitk.BinaryDilateImageFilter.Ball</span>):</pre><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; font-family: inherit; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; "> <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">distImg</span> = <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">sitk.SignedMaurerDistanceMap</span>(<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">img</span> <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(170, 34, 255); font-weight: bold; ">!=</span> <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(0, 0, 128); ">0</span>, <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">insideIsPositive</span>=<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(0, 128, 0); ">False</span>, <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">squaredDistance</span>=<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(0, 128, 0); ">False</span>, <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">useImageSpacing</span>=<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(0, 128, 0); ">False</span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; font-family: inherit; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; "> <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">dilatImg</span> = <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">sitk.BinaryDilate</span>(<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">img</span><span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(170, 34, 255); font-weight: bold; ">!=</span><span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(0, 0, 128); ">0</span>, <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">radius</span>, <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">kernel</span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; font-family: inherit; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; "> <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">wsImg</span> = <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">sitk.MorphologicalWatershedFromMarkers</span>(<span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">distImg</span>, <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">img</span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; font-family: inherit; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; "> <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(0, 128, 0); font-weight: bold; ">return</span> <span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">dilatImg</span><span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; color: rgb(170, 34, 255); font-weight: bold; ">*</span><span style="margin: 0px; padding: 0px; border: 0px; font: inherit; vertical-align: baseline; ">wsImg</span></pre><div><br></div><div><br></div><div><br><div><div>On Feb 8, 2013, at 9:42 AM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><font><font face="verdana,sans-serif">Thanks for the interest and the provided code Brad. Hopefully I will get to work today to try it out myself :D (Blizzard warning in Boston, where I am for a couple months)</font></font>
</div><div class="gmail_extra"><br></div></blockquote></div><br></div></div></body></html>