connected components use the same label for different objects


(esme) #1

Dear all,

I am writing becaue i am using this method because i want every different object (not connected) with a different value but i obtained but results and i figured out that there are separate objects labeled with the same label. Has someone the same problem?

Thanks

    typedef itk::ConnectedComponentImageFilter <ImageType, ImageType >
		ConnectedComponentImageFilterType;

	ConnectedComponentImageFilterType::Pointer connected =
		ConnectedComponentImageFilterType::New();
	connected->SetInput(ROISegm->GetOutput());
	connected->Update();

(Dženan Zukić) #2

That might be possible due to a few reasons:

  1. Objects might be connected in 3D space even if they don’t look connected on any individual 2D slice
  2. There are more objects/labels than ImageType’s PixelType can represent. If there are 300 objects and pixel type of output image is unsigned char, then objects 256 and later will be given labels 0 through 44.
  3. There is a bug somewhere

Can you narrow it down to one of there options?