Aurelie Le breton
2018-04-10 08:02:46 UTC
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.
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.