[Insight-users] Example on how to compute the connected components of an image

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Fri Dec 19 08:29:11 EST 2008


Le 19 déc. 08 à 12:35, Juliette Deniau a écrit :

> Dear itk user,
> Is there any example on how to compute the connected components of  
> an image resulting from a segmentation process? based on my reserach  
> in the mailing list of itk, it can be done using the  
> itk::ConnectedComponentImageFilter but I don't know how ?
> There is an example RelabelComponentImageFilter in segmentation  
> example folder. could please tel me what's the link between this  
> example and the itk::ConnectedComponentImageFilter?
>


Hi Juliette,

The itk::ConnectedComponentImageFilter takes a binary image as input  
and produce a label image as output where the connected components  
have a new label. Also, with the new algorithm used in ITK for a few  
versions, the filter always produce consecutive labels, so, if you  
don't need to have your connected components sorted by size, you don't  
need to use the relabel filter.

So you just give it your binary image, get the label image as output,  
and that's all :-)

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081219/81c67ba8/attachment.pgp>


More information about the Insight-users mailing list