[Insight-users] ApproximateSignedDistanceMapImageFilter exception

Derek Magee derekmagee at hotmail.com
Thu Feb 28 09:07:19 EST 2008


This problem has been raised a couple of times before on the list, but I can't find any solution posted. I'm getting an error with ApproximateSignedDistanceMapImageFilter of the form:
itk::ExceptionObject (0012FC44)Location: "void __thiscall itk::MultiThreader::SingleMethodExecute(void)"File: .\itkMultiThreader.cxxLine: 368Description: itk::ERROR: MultiThreader(00BBD508): Exception occurred during SingleMethodExecute I'm using msvc2005 and ITK 3.0.1. Code is below (NB replacing ApproximateSignedDistanceMapImageFilter withSignedDanielssonDistanceMapImageFilter makes everything work ok). The volume is simply a synthetic 100x100x100 8-bit binary analyze volume with a single connected component.Any clues?
 
ThanksDerek Magee
#include <itkImage.h>
#include <itkImageFileReader.h>
#include <itkSmartPointer.h>
#include <itkApproximateSignedDistanceMapImageFilter.h>
#include <itkSignedDanielssonDistanceMapImageFilter.h>
#include <iostream>
using namespace std;
typedef itk::Image< unsigned char, 3> SGInputImageType ;typedef itk::ImageFileReader< SGInputImageType> SGImgReaderType ;typedef itk::Image< float, 3> SGDTImageType ;typedef itk::ApproximateSignedDistanceMapImageFilter DTFilter ;//typedef itk::SignedDanielssonDistanceMapImageFilter DTFilter ; SGImgReaderType::Pointer reader = SGImgReaderType::New() ;reader->SetFileName( argv[1] ) ; // This is a 100x100x100 8-bit binary analyze volume
try{    reader->Update() ;}catch( itk::ExceptionObject & err ){    cerr << "Error reading file" << endl ;return -1 ;}cerr << "Read file OK" << endl ; // File is read ok, as this is printedDTFilter::Pointer dt_obj= DTFilter::New() ; dt_obj->SetInput(reader->GetOutput()) ;dt_obj->SetInsideValue(255);dt_obj->SetOutsideValue(0); try{dt_obj->Update() ;}catch( itk::ExceptionObject & err ){cerr << "Error calculating distance transform: " << err << endl ;return -1;}cerr << "Done calculating distance transform" << endl ;
_________________________________________________________________
Telly addicts unite!
http://www.searchgamesbox.com/tvtown.shtml
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20080228/632221f6/attachment.htm


More information about the Insight-users mailing list