[Insight-users] GrayscaleErodeImageFilter - SetKernel

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Sun Dec 28 17:28:02 EST 2008


Le 28 déc. 08 à 22:55, Paulo Henrique Junqueira Amorim a écrit :

> Hi Gaetan,
>
> Thank's
>
> The  "dim" is diameter in number integer ? and the size is size of  
> image (100,100) image 100x100

dim is the dimension of the image - in your case, it's 3.
size is the size of the structuring element. It can be an integer or  
an itk.Size[dim] or a python sequence of length dim. If it's an  
integer, the size will be the same on the 3 dimensions. With the  
itk.Size or with the python sequences, the size can be different on  
the dimensions.

Ex:

k1 = itk.FlatStructuringElement[3].Ball(5)
k2 = itk.FlatStructuringElement[3].Ball([5, 5, 5])
size = itk.Size[3]()
size[0] = size[1] = size[2] = 5
k3 = itk.FlatStructuringElement[3].Ball(size)

k1, k2 and k3 are the same in that example.

Gaëtan

>
>
> Regards
> Paulo
>
>
>
> 2008/12/28 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>
>
> Le 28 déc. 08 à 22:18, Paulo Henrique Junqueira Amorim a écrit :
>
>
> Hi,
>
> I am using the GrayscaleErodeImageFilter, but my ITK not have  
> BinaryBallStructuringElement to use SetKernel().
>
> how can I use SetKernel () ?
>
> code:
>        erode = itk.GrayscaleErodeImageFilter.IF3IF3SE3.New()
>        erode.SetInput(image.GetOutput())
>        erode.SetKernel( ?? )
>
>
> Hi,
>
> BinaryBallStructuringElement is not used any more in wrappers.
> You can produce a structuring element with:
> i. itk.strel(dim, size) - it's a shortcut to produce a ball  
> structuring element inherited of the time when creating a ball  
> structuring element was requiring several lines of code;
> ii. itk.FlatStructuringElement[dim].Ball(size). A few more methods  
> are available in that class to produce box, annulus, ... structuring  
> elements.
>
> Regards,
>
> 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  http://www.mandriva.org
> http://www.itk.org  http://www.clavier-dvorak.org
>
>

-- 
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  http://www.mandriva.org
http://www.itk.org  http://www.clavier-dvorak.org



More information about the Insight-users mailing list