[Insight-users] Re: binary erosion
Gaëtan Lehmann
gaetan.lehmann at jouy.inra.fr
Thu Nov 29 01:58:59 EST 2007
Hi Mauro,
I didn't have time to try your 3D image yet :-/
Le 29 nov. 07 à 01:48, mauro maiorca a écrit :
> On Nov 24, 2007 12:15 AM, mauro maiorca <mauromaiorca at gmail.com>
> wrote:
>> 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.
>
> problem solved adding:
>
> binaryErode->SetBackgroundValue( 0 );
> binaryErode->SetForegroundValue( 255 );
>
> to
>
>> binaryErode->SetKernel( ball );
>> binaryErode->SetErodeValue( 255 );
This last line is equivalent to "binaryErode->SetForegroundValue
( 255 );". The implementation is:
void SetErodeValue(const InputPixelType& value)
{ this->SetForegroundValue( value ); }
So the only difference seems to be "binaryErode->SetBackgroundValue
( 0 );", which should not explain the behavior you have.
What is the PixelType used in your code?
>
> hope it helps someone else: this thing was undocumented.
> It is incredibly slow, but probably switching to ITK 3.4 will solve
> the problem.
It will help: binary erosion/dilation filters had a bug in ITK 3.2
which was making them very slow, but wasn't affecting the result
(that's why we didn't found the bug with the tests).
http://itk.org/cgi-bin/cvsweb.cgi/Code/BasicFilters/
itkBinaryMorphologyImageFilter.txx?root=Insight&r1=1.8&r2=1.9
> By the way, do you have any idea how to update just the
> erosion/dilation from 3.2 to 3.4 without reinstalling everything (it
> needs time, I want to postpone this)
just replace the file itkBinaryMorphologyImageFilter.txx in you
installation tree by itkBinaryMorphologyImageFilter.txx from ITK 3.4.
Gaëtan
--
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/20071129/b3e553e1/PGP.pgp
More information about the Insight-users
mailing list