Hi all,<br><br>I am trying to use itk::ConnectedComponentImageFilter in the following code.. <br>.....<br>.....<br> itk::ConnectedComponentImageFilter<ImageType, ImageType>::Pointer ccFilter = itk::ConnectedComponentImageFilter<ImageType, ImageType>::New();<br>
<br> /* Iterate through this code */ /* When to stop? When the two seed points pixels differ */<br> while(1)<br> { <br> <br> ImageType::Pointer e = BinaryErodeFilter3D( img, 1 ); <br>
ccFilter->SetInput( e ); <br> ccFilter->Update(); <br> if ( ccFilter->GetOutput()->GetPixel( pixelIndex1 ) == ccFilter->GetOutput()->GetPixel( pixelIndex2 ) ) // Same cluster<br>
{ <br> img = e;<br> ++noOfIterations;<br> std::cout << "Iteration no = "<<noOfIterations << std::endl;<br>
continue;<br> } <br> else // Different Cluster<br> { <br> break;<br> } <br> } <br><br>When I try to run this code, I get an exception like this after executing the line "ccFilter->Update();"<br>
<br>terminate called after throwing an instance of 'itk::ExceptionObject'<br> what(): /home/harishd/ITK/InsightToolkit-3.16.0/Code/Common/itkMultiThreader.cxx:475:<br>itk::ERROR: MultiThreader(0x86c0598): Exception occurred during SingleMethodExecute<br>
/home/harishd/ITK/InsightToolkit-3.16.0/Code/BasicFilters/itkConnectedComponentImageFilter.txx:352:<br>itk::ERROR: ConnectedComponentImageFilter(0x86af268): Number of objects greater than maximum of output pixel type <br>
-- Process completed<br><br>*** Exception executing: Child aborted<br>***Exception: Other<br><br>Any ideas on this error?<br><br><br>Thanks,<br>Harish<br>