[Insight-users] ConnectedComponents and RelabeledConnectedComponents
Ken Urish
ken.urish at gmail.com
Fri Jan 7 13:34:58 EST 2005
Im a long times listener, first time caller -
Ive hit a brick wall that I have not been able to get past for the
past week and a half using ConnectedComponentsImageFilter and
RelabeledComponentsImageFilter.
I have a binary tiff (unisgned char) image that I have thresholded,
and I want to count the number of white pixeled islands against a
black background. I am using ConnectedComponentsImageFilter and then
I use RelabeledComponents to count the number of islands. The program
works if I have only 5 or less white connected components( CC ). It
falls apart if I have a large number of CCs. Ultimately I will have
more than a thousand.
Fooling around with different pictures, here is my problem:
1) No matter how many CCs I have, I always generate the itk warning:
"ConnectedComponentImageFilter::GenerateData: Number of labels exceeds
number of available labels for the output type." If I have only 5 or
7 CCs, even thou the warning is generated I still get an accurate
answer, however I think this is the root of my problem.
2) If I take the same picture I made that has 5 white pixeled islands,
copy it over and over to use as a template to make images of 10, 25,
50 and 75 white pixeled CCs, and print out the size of the connected
components, I will only get a max of 5 connected components even when
I have 75 CC. In addition, at 25, 50 and 75 CCs all of the CCs that
are counted all have the same size and are all the very 1st white
island I have of the series of 5 pixeled island.
- I thought that I could fix the problem using "unsigned long" or
"unsigned int". If I do this I get the CC saying I have only 0 and of
course I cant view the image since its not supported by tiff or jpeg.
-Even if i get an accurate count of 75 or 100 white pixeled islands
how can I get it too handle 500, 1000, or even 10,000??? I am
absolutely baffeled, please help.
Thanks
--Ken--
More information about the Insight-users
mailing list