[Insight-users] Multilabel dilation
Bradley Lowekamp
blowekamp at mail.nih.gov
Fri Feb 8 11:36:49 EST 2013
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:
def MultilabelDilation(img, radius=1,kernel=sitk.BinaryDilateImageFilter.Ball):
distImg = sitk.SignedMaurerDistanceMap(img != 0, insideIsPositive=False, squaredDistance=False, useImageSpacing=False)
dilatImg = sitk.BinaryDilate(img!=0, radius, kernel)
wsImg = sitk.MorphologicalWatershedFromMarkers(distImg, img)
return dilatImg*wsImg
On Feb 8, 2013, at 9:42 AM, Dženan Zukić <dzenanz at gmail.com> wrote:
> 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)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130208/47c439ff/attachment.htm>
More information about the Insight-users
mailing list