[Insight-users] ApproximateSignedDistanceMapImageFilter exception

Luis Ibanez luis.ibanez at kitware.com
Wed Mar 5 18:14:44 EST 2008


Hi Derek,


       It is hard to tell from this message alone...

However, if you upgrade to ITK 3.4, we modified the error messages
from the MultiThreader so that they are more informative.

You could also, instead of upgrading to ITK 3.4, just apply the
following changes to the itkMultiThreader.cxx file in the directory
Insight/Code/Common

http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkMultiThreader.cxx?root=Insight&r1=1.39&r2=1.40

Please give it a try, and then post again to the list the
new (hopefully more informative) error message.


    Thanks


       Luis


-------------------
Derek Magee wrote:
> 
> 
> 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.cxx
> Line: 368
> Description: itk::ERROR: MultiThreader(00BBD508): Exception occurred 
> during SingleMethodExecute
>  
> I'm using msvc2005 and ITK 3.0.1. Code is below (NB replacing 
> ApproximateSignedDistanceMapImageFilter with
> SignedDanielssonDistanceMapImageFilter makes everything work ok). The 
> volume is simply a synthetic 100x100x100 8-bit binary analyze volume 
> with a single connected component.
> 
> Any clues?
>  
> Thanks
> Derek 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 printed
> 
> DTFilter::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 ;
> 
> 
> ------------------------------------------------------------------------
> Messenger on the move. Text MSN to 63463 now! 
> <http://mobile.uk.msn.com/pc/messenger.aspx >
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list