[Insight-users] Using MultiResolutionPyramidImageFilter : Exception occurred during SingleMethodExecute - please help

Karsten N kn at daimi.au.dk
Fri Dec 22 06:13:13 EST 2006


Hi everybody

I'm trying to use the itk::MultiResolutionPyramidImageFilter. However, I 
get the following exception

   itk::ExceptionObject (0012F39C)
   Location: "void __thiscall 
itk::MultiThreader::SingleMethodExecute(void)"
   File: \devel\InsightToolkit-2.6.0\Code\Common\itkMultiThreader.cxx
   Line: 358
   Description: itk::ERROR: MultiThreader(053662C8): Exception occurred 
during SingleMethodExecute

I'm using ITK version 2.6.0. My code looks like this:

   typedef itk::MultiResolutionPyramidImageFilter<ImageType, ImageType>  
ImagePyramidType;
   ImagePyramidType::Pointer image_pyramid = ImagePyramidType::New();
   unsigned int levels = 4;
   image_pyramid->SetInput(input_image);
   itk::Vector<unsigned int,3> shrink_factors;

   shrink_factors[0] = 8;
   shrink_factors[1] = 8;
   shrink_factors[2] = 4;

   image_pyramid->SetNumberOfLevels(levels);
   image_pyramid->SetStartingShrinkFactors(shrink_factors.Begin());

   std::vector<ImageType::Pointer> images;

   try
   {
     image_pyramid->GetOutput(0)->Update();
     images.push_back(image_pyramid->GetOutput(0));      }
   catch(  itk::ExceptionObject & exp )
   {
       std::cerr << exp << std::endl;
   }

If have tried writing the input_image to disk and it looks fine. I have 
also tried  itk::MultiThreader::SetGlobalMaximumNumberOfThreads(1) 
without success.

What am I doing wrong?

Please help!

Best Regards
Karsten


More information about the Insight-users mailing list