[Insight-users] Problem with connected component Image filter

Bill Lorensen bill.lorensen at gmail.com
Tue Jan 26 23:09:24 EST 2010


What is the type of ImageType?

On Tue, Jan 26, 2010 at 8:01 PM, Harish Doddi <harish.slicer at gmail.com> wrote:
> Hi all,
>
> I am trying to use  itk::ConnectedComponentImageFilter in the following
> code..
> .....
> .....
>   itk::ConnectedComponentImageFilter<ImageType, ImageType>::Pointer ccFilter
> = itk::ConnectedComponentImageFilter<ImageType, ImageType>::New();
>
>         /* Iterate through this code */ /* When to stop? When the two seed
> points pixels differ */
>         while(1)
>         {
>
>                 ImageType::Pointer e = BinaryErodeFilter3D( img, 1 );
>                 ccFilter->SetInput( e );
>                 ccFilter->Update();
>                 if ( ccFilter->GetOutput()->GetPixel( pixelIndex1 ) ==
> ccFilter->GetOutput()->GetPixel( pixelIndex2 ) ) // Same cluster
>                 {
>                         img = e;
>                         ++noOfIterations;
>                         std::cout << "Iteration no = "<<noOfIterations <<
> std::endl;
>                         continue;
>                 }
>                 else // Different Cluster
>                 {
>                         break;
>                 }
>         }
>
> When I try to run this code, I get an exception like this after executing
> the line "ccFilter->Update();"
>
> terminate called after throwing an instance of 'itk::ExceptionObject'
>   what():
> /home/harishd/ITK/InsightToolkit-3.16.0/Code/Common/itkMultiThreader.cxx:475:
> itk::ERROR: MultiThreader(0x86c0598): Exception occurred during
> SingleMethodExecute
> /home/harishd/ITK/InsightToolkit-3.16.0/Code/BasicFilters/itkConnectedComponentImageFilter.txx:352:
> itk::ERROR: ConnectedComponentImageFilter(0x86af268): Number of objects
> greater than maximum of output pixel type
> -- Process completed
>
> *** Exception executing: Child aborted
> ***Exception: Other
>
> Any ideas on this error?
>
>
> Thanks,
> Harish
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list