[Insight-users] IsoContourDistanceImageFilter

Kishore Mosaliganti kishoreraom at gmail.com
Mon Jul 9 06:53:31 EDT 2007


Hi,
I am getting the following bug while trying to use the
IsoContourDistanceImageFilter.

itk::ExceptionObject (0xad98c0)
Location: "void itk::MultiThreader::SingleMethodExecute()"
File: /tmp/InsightToolkit-3.2.0/Code/Common/itkMultiThreader.cxx
Line: 368
Description: itk::ERROR: MultiThreader(0xad1100): Exception occurred
during SingleMethodExecute


Basically, I am using a binary image having 0 to 255 values to
initialize the filter. Since the image is slightly large
(1000x1000x50), I am trying to use a IsoContourDistanceImageFilter
followed by the FastChamferDistanceImageFilter in place of the
DanielsonDistanceMapFilter. I am placing my code below for you
perusal. Any help will be appreciated.

------------------------------------------------------------------------------------------------------------------------

typedef itk::IsoContourDistanceImageFilter<InternalImageType,InternalImageType>
IsoContourFilterType;
typedef itk::FastChamferDistanceImageFilter<InternalImageType,InternalImageType>
ChamferFilterType;

	tIsoContourFilterType::Pointer isoContour = IsoContourFilterType::New();
	isoContour->SetInput(mask);
	isoContour->SetLevelSetValue(128);
	isoContour->SetFarValue(5);
	isoContour->SetNumberOfThreads(1);
	isoContour->NarrowBandingOff();
	try {
		isoContour->Update();
    }
       catch( itk::ExceptionObject & err ){
      std::cout << "ExceptionObject caught !" << std::endl;
      std::cout << err << std::endl;
	  return mask;
    }

	ChamferFilterType::Pointer chamferDist = ChamferFilterType::New();
	chamferDist->SetInput(isoContour->GetOutput());
	chamferDist->SetMaximumDistance(255);
	chamferDist->Update();

	InternalImageType::Pointer dist = isoContour->GetOutput();


--------------------------------------------------------------------------------------------------------------------------

Kishore


More information about the Insight-users mailing list