[Insight-users] binary erosion

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Fri Nov 23 10:18:50 EST 2007


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




-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: =?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?=
Url : http://public.kitware.com/pipermail/insight-users/attachments/20071123/f5dfdaee/PGP.pgp


More information about the Insight-users mailing list