[Insight-users] problem with dilate and erode filter

m0985501 m0985501 at mail.nuk.edu.tw
Sat May 8 23:22:32 EDT 2010


Hello all

i am a beginner in itk. Here's a newbie question that troubles me. Hope somebody could help me.

After processing with dilate filter and erode filter. the result looks same as the original one, nothing changes at all.

BUT if i write the output of dilate filter, and then read again to erode filter. it works.

my code is like this.

ImageType3D::Pointer inputSeries= reader->GetOutput();

KernelType  ball;
ball.SetRadius( 30);
ball.CreateStructuringElement();

BinaryDilateFilterType::Pointer dilateFilter= BinaryDilateFilterType::New();
dilateFilter->SetInput( mask);
dilateFilter->SetKernel( ball);
dilateFilter->SetDilateValue(1);

BinaryErodeFilterType::Pointer erodeFilter= BinaryErodeFilterType::New();
erodeFilter->SetInput( dilateFilter->GetOutput());
erodeFilter->SetKernel( ball2);
erodeFilter->SetErodeValue( 1);
erodeFilter->Update();

return erodeFilter->GetOutput();
then write the image to disk

It also occured with grayscale ones. The filters seems do nothing, but still time consuming.
i tried with itk 3.14, 3.16 and 3.18, and compiled with vc 6, 7, 8, 9.

Could anyone help me please.
thank you



Chia-Hsiang Hu
Machine Learning and Medical Application Lab
Dept. of Computer Science and Information Engineering
National University of Kauhsiung
(e) m0985501_AT_mail_DOT_nuk_DOT_edu_DOT_tw


More information about the Insight-users mailing list