[ITK-users] Problem with LabelSetErodeImageFilter

Richard Beare richard.beare at gmail.com
Tue Apr 10 05:18:46 EDT 2018


There isn't meant to be a limit to size of structuring element. A couple of
possibilities I can think of. If your test involves single pixels set to 1,
then perhaps there's a rounding error leading to the blank image. Single
pixels are a slightly tricky corner case when dealing with large
structuring elements, and probably not what you're going to be using in
practice. If it is what you're using for the test, try a larger component
instead.

Secondly, something to consider. Are you actually after label operations?
Testing with 1s and 0s only is a binary case and can be addressed with the
ParabolicMorphology module. The computational bits are similar but there
isn't the overhead of tracking the labels.

Finally closings on label sets are somewhat poorly defined, which is why
there isn't a label closing filter. You need to consider the precise
behaviour you want when performing the erosion - should it separate
touching labels or not. Also, you can construct arrangements of labels
which will result in some components disappearing, which wouldn't happen if
the operation was applied to each component separately - consider one label
completely surrounded by another - the dilation wouldn't change the
surrounded label, allowing the subsequent erosion operation to delete it if
the structuring element is large enough.

On Tue, Apr 10, 2018 at 6:02 PM, Aurelie Le breton <lebreton.a at gmail.com>
wrote:

> Hi,
> I have a question about the LabelSetErodeImageFilter.
> Is there a structurant element radius max, for the erode filter ?
> I need to use a closing filter, i've chosen to use the
> LabelSetDilateImageFilter followed by a LabelSetErodeImageFilter.
> My problem is that, when i set the radius to 15 pix, both of the dilate
> and erode filters give a result, but when the radius is set to 16 pix, only
> the dilate filter returns a correct output, the erode filter returns a
> black image, filled with '0' values. But there is no reason for the filter
> to fail..
>  Images are 1024*1024, containing only '0' and '1'.
> I've tested several datasets, i've the same behaviour.
>
>
> Here is my code (very basic) :
>
>
>     typedef itk::Image<char, 3> Mask3dType;
>
>     // dilate
>     auto dilateFilter = itk::LabelSetDilateImageFilter<Mask3dType,
> Mask3dType>::New();
>     dilateFilter->SetInput(input);
>     dilateFilter->SetRadius(radius);
>
>     // Erode
>     auto erodeFilter = itk::LabelSetErodeImageFilter<Mask3dType,
> Mask3dType>::New();
>     erodeFilter->SetInput(dilateFilter->GetOutput());
>     erodeFilter->SetRadius(radius);
>
>     erodeFilter->Update();
>
>
> Thanks in advance.
>
>
> The ITK community is transitioning from this mailing list to
> discourse.itk.org. Please join us there!
> ________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> https://itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://itk.org/pipermail/insight-users/attachments/20180410/9b5d393a/attachment.html>


More information about the Insight-users mailing list