[Insight-users] binary erosion

mauro maiorca mauromaiorca at gmail.com
Mon Nov 26 19:52:24 EST 2007


Hi Gaëtan,
thanks for your interest! The original 3D image (after smoothing,
region growing, etc.) is here:
http://traversata.altervista.org/segmented.zip
I'm trying to do erosion on the white part (with value 255), but
unfortunately with any luck.
A rude alternative (before implementing my own erosion library, as
last desperate attempt) is to export to vtk and then back again to
itk.
But I would be really happy to do the morphology just using itk.

cheers,
Mauro

On Nov 24, 2007 2:18 AM, Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr> wrote:
>
> Hi,
>
> I can't reproduce the problem on your 2D image. Can you send me the
> full 3D image, so I can try to reproduce the problem?
> Note that there was a bug in erode/dilate filters in ITK 3.2, which
> shouldn't change the result, only the execution time, but it may be
> safer to update to ITK 3.4.
>
> Regards,
>
> Gaëtan
>
>
> Le 23 nov. 07 à 14:15, mauro maiorca a écrit :
>
>
> > Hi people,
> > I'm trying to perform erosion with itk, but unfortunately without any
> > luck. The strange thing is that there isn't any problem with dilation.
> > starting from a volume (here a slice from the volume, the inside has
> > value 0, and the structure I'm interested in has value 255)
> > http://traversata.altervista.org/facial_segmented_28_starting.jpg
> > (or, if you like more png:
> > http://traversata.altervista.org/facial_segmented_28_starting.png )
> > unfortunately the result that I obtain is:
> > http://traversata.altervista.org/facial_segmented028.jpg
> > with mainly the colour reversed, and some changes far from the center
> > of the image. I'm using itk 3.2.0
> >
> > Any help/suggestion would be appreciated!
> > cheers,
> > Mauro
> >
> > The portion of code interested is:
> >
> > typedef itk::Image<PixelType, 3>  outputImageType;
> > typedef itk::BinaryBallStructuringElement< PixelType, 3 >
> > StructuringElementType;
> > typedef itk::BinaryErodeImageFilter< outputImageType, outputImageType,
> > StructuringElementType >  ErodeFilterType;
> > ErodeFilterType::Pointer  binaryErode  = ErodeFilterType::New();
> >
> >       StructuringElementType ball;
> >       StructuringElementType::SizeType ballSize;
> >       ballSize[0] = 6;
> >       ballSize[1] = 6;
> >       ballSize[2] = 1; //I also tried with other combinations of ballSize,
> > but with the same results
> >       ball.SetRadius(ballSize);
> >       ball.CreateStructuringElement();
> >
> > binaryErode->SetInput( confidence->GetOutput() );
> > /*confidence->GetOutput() is the image
> > http://traversata.altervista.org/facial_segmented_28_starting.jpg*/
> >
> > binaryErode->SetKernel(  ball );
> > binaryErode->SetErodeValue( 255 );
> > binaryErode->Update();
> >
> > facial_SegmentedPtr = binaryErode->GetOutput();
> > /*binaryErode->GetOutput() is the image
> > http://traversata.altervista.org/facial_segmented028.jpg*/
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
>
> --
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr
>
>
>
>
>


More information about the Insight-users mailing list