[Insight-users] itk::ConnectedComponentImageFilter ?
Miller, James V (Research)
millerjv at crd.ge.com
Wed Jan 12 09:49:33 EST 2005
The connected component image filter does not necessarily produce an
image with contiguous labels. All it guarentees is that the labels
are unique. To collapse the components to be sequential requires
an extra pass through the image. Since many consumers of connected
components do not care if the labels are sequential, we do not make
this extra pass through the image.
You can run the output of the connected component image filter through
a RelabelComponentImageFilter which will renumber the components to
be sequential and sorted based on size.
Jim
-----Original Message-----
From: Lagaffe [mailto:lagaffe74130 at yahoo.fr]
Sent: Wednesday, January 12, 2005 7:38 AM
To: ITK mailing
Subject: [Insight-users] itk::ConnectedComponentImageFilter ?
Hello,
I don't understand why when I use the
ConnectedComponentImageFilter on the input image below
there is 4 labels instead of 3 ?
any idea
thanks,
Lagaffe
The PixelType for the inputImage is unsigned short
typedef itk::ConnectedComponentImageFilter <
ImageType, ImageType >
ConnectedComponentImageFilterType;
ConnectedComponentImageFilterType::Pointer labelFilter
= ConnectedComponentImageFilterType::New ();
labelFilter->SetInput(inputImage);
labelFilter->Update();
- Input Image - -
0 0 0 0 0 1 1
0 0 0 0 0 0 1
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 1 1 1 0 0 0
0 0 1 0 0 0 0
0 0 0 0 1 1 1
0 0 0 0 0 1 1
- Label Image - -
0 0 0 0 0 1 1
0 0 0 0 0 0 1
0 0 0 0 0 0 0
0 0 2 0 0 0 0
0 2 2 2 0 0 0
0 0 2 0 0 0 0
0 0 0 0 4 4 4
0 0 0 0 0 4 4
Decouvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos
mails !
Creez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list