[Insight-developers] Strange Core Dump

Hans Johnson hans-johnson@uiowa.edu
Tue, 25 Mar 2003 12:56:02 -0600


This is a multi-part message in MIME format.
--------------090607050908030302080904
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

I am getting a strange core dump, and was hoping that someone could shed
some light about what is going on.

The debugger seems to think that the seg fault occurs at line 91 of
itkDiscreteGaussianImageFilter.txx.

I was playing with the Canny parameters to see how they affected
differennt outputs by using a shotgun approach to looking at the parameters:

for var in 0.25 0.5 0.75 1.0 1.5 2.0 5.0 10.0; do
      for maxerror  in 0.001 0.01 0.1 1.0 10.0; do
         time ./itkCannyImageFilter
~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr
test_${var}_${maxerror}.hdr $var $maxerror; echo "Done with $var
$maxerror";
      done ;
done

I thought it was very strange that max errors of .1 and 1 always causes
errors but the other values did not.

Please let me know if I am doing something wrong.

Regards,
Hans
-- 
===================================================================
Hans J. Johnson                              W294 GH
hans-johnson@uiowa.edu                       Dept. of Psychiatry
http://www.psychiatry.uiowa.edu/~hjohnson    The University of Iowa
(319) 353-8587                               Iowa City, IA 52242
===================================================================


--------------090607050908030302080904
Content-Type: text/plain;
 name="itkCannyImageFilter.cxx"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="itkCannyImageFilter.cxx"

#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
//#include "itkRescaleIntensityImageFilter.h"
#include "itkCannyEdgeDetectionImageFilter.h"

int main( int argc, char * argv[] )
{
  if( argc < 5 )
  {
    std::cerr << "Usage: " << std::endl;
    std::cerr << argv[0] << " inputImageFile outputImageFile variance maxerror" << std::endl;
    return 1;
  }

  typedef    float    InputPixelType;
  typedef    float    OutputPixelType;
  typedef itk::Image< InputPixelType,  3 >   InputImageType;
  typedef itk::Image< OutputPixelType, 3 >   OutputImageType;
  typedef itk::ImageFileReader< InputImageType >  ReaderType;
  typedef itk::CannyEdgeDetectionImageFilter< InputImageType, OutputImageType >  FilterType;

  ReaderType::Pointer reader = ReaderType::New();
  reader->SetFileName( argv[1] );
  {
    FilterType::Pointer filter = FilterType::New();
    filter->SetInput( reader->GetOutput() );
    const double variance=atof(argv[3]);
    const double maxerror=atof(argv[4]);
    filter->SetVariance( variance );
    filter->SetMaximumError( maxerror );
    try {
      filter->Update();
    }
    catch(itk::ExceptionObject &err)
    {
      (&err)->Print(std::cerr);
      return 1;
    }
    catch(...)
    {
      std::cerr << "Some other type of error occured" << std::endl;
    }
    {
      //typedef unsigned char WritePixelType;
      typedef OutputPixelType WritePixelType;
      typedef itk::Image< WritePixelType, 3 > WriteImageType;
      //typedef itk::RescaleIntensityImageFilter< OutputImageType, WriteImageType > RescaleFilterType;
      //RescaleFilterType::Pointer rescaler = RescaleFilterType::New();
      //rescaler->SetOutputMinimum(   0 );
      //rescaler->SetOutputMaximum( 255 );

      typedef itk::ImageFileWriter< WriteImageType >  WriterType;
      WriterType::Pointer writer = WriterType::New();
      writer->SetFileName( argv[2] );
      //rescaler->SetInput( filter->GetOutput() );
      //writer->SetInput( rescaler->GetOutput() );
      writer->SetInput( filter->GetOutput() );
      writer->Update();
    }
  }
  return 0;
}



--------------090607050908030302080904
Content-Type: text/plain;
 name="CannyEdgeDetectorLog"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="CannyEdgeDetectorLog"


real	1m43.930s
user	1m39.121s
sys	0m1.584s
Done with 0.25 0.001

real	1m42.840s
user	1m39.887s
sys	0m1.609s
Done with 0.25 0.01

real	1m41.436s
user	1m33.547s
sys	0m2.084s
Done with 0.25 0.1
/bin/bash: line 228:  7010 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m4.724s
user	0m0.645s
sys	0m0.199s
Done with 0.25 1.0
/bin/bash: line 228:  7016 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.921s
user	0m0.662s
sys	0m0.254s
Done with 0.25 10.0

real	2m22.208s
user	1m52.771s
sys	0m1.600s
Done with 0.5 0.001

real	2m29.354s
user	1m39.426s
sys	0m1.150s
Done with 0.5 0.01

real	1m52.285s
user	1m35.734s
sys	0m1.582s
Done with 0.5 0.1
/bin/bash: line 228:  7593 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m3.079s
user	0m0.699s
sys	0m0.250s
Done with 0.5 1.0
/bin/bash: line 228:  7630 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m2.381s
user	0m0.621s
sys	0m0.221s
Done with 0.5 10.0

real	2m32.087s
user	1m47.926s
sys	0m1.609s
Done with 0.75 0.001

real	2m12.868s
user	1m39.701s
sys	0m1.125s
Done with 0.75 0.01

real	1m45.305s
user	1m34.754s
sys	0m1.646s
Done with 0.75 0.1
/bin/bash: line 228:  9934 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m2.786s
user	0m0.648s
sys	0m0.201s
Done with 0.75 1.0
/bin/bash: line 228:  9948 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m2.046s
user	0m0.645s
sys	0m0.219s
Done with 0.75 10.0

real	2m18.768s
user	1m55.814s
sys	0m1.670s
Done with 1.0 0.001

real	1m52.386s
user	1m51.691s
sys	0m1.650s
Done with 1.0 0.01

real	1m23.644s
user	1m39.488s
sys	0m1.320s
Done with 1.0 0.1
/bin/bash: line 228: 11369 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.869s
user	0m0.631s
sys	0m0.229s
Done with 1.0 1.0
/bin/bash: line 228: 11370 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m2.622s
user	0m0.684s
sys	0m0.270s
Done with 1.0 10.0

real	2m6.464s
user	2m3.771s
sys	0m1.199s
Done with 1.5 0.001

real	1m53.264s
user	1m46.123s
sys	0m2.240s
Done with 1.5 0.01

real	1m43.595s
user	1m39.752s
sys	0m1.678s
Done with 1.5 0.1
/bin/bash: line 228: 11450 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.880s
user	0m0.650s
sys	0m0.209s
Done with 1.5 1.0
/bin/bash: line 228: 11451 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.871s
user	0m0.660s
sys	0m0.203s
Done with 1.5 10.0

real	2m6.496s
user	2m3.072s
sys	0m2.082s
Done with 2.0 0.001

real	1m57.097s
user	1m54.363s
sys	0m2.055s
Done with 2.0 0.01

real	1m40.585s
user	1m39.404s
sys	0m1.660s
Done with 2.0 0.1
/bin/bash: line 228: 11502 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.912s
user	0m0.666s
sys	0m0.195s
Done with 2.0 1.0
/bin/bash: line 228: 11503 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.922s
user	0m0.674s
sys	0m0.189s
Done with 2.0 10.0
WARNING: In /usr/robin_home/scratch/hjohnson/src/buildhome/athlon/DEBUG/include/InsightToolkit/Common/itkGaussianOperator.txx, line 54
itkGaussianOperator (0xbfffd020): Kernel size has exceeded the specified maximum width of 32 and has been truncated to 33 elements.  You can raise the maximum width using the SetMaximumKernelWidth method.

WARNING: In /usr/robin_home/scratch/hjohnson/src/buildhome/athlon/DEBUG/include/InsightToolkit/Common/itkGaussianOperator.txx, line 54
itkGaussianOperator (0xbfffd020): Kernel size has exceeded the specified maximum width of 32 and has been truncated to 33 elements.  You can raise the maximum width using the SetMaximumKernelWidth method.

WARNING: In /usr/robin_home/scratch/hjohnson/src/buildhome/athlon/DEBUG/include/InsightToolkit/Common/itkGaussianOperator.txx, line 54
itkGaussianOperator (0xbfffd020): Kernel size has exceeded the specified maximum width of 32 and has been truncated to 33 elements.  You can raise the maximum width using the SetMaximumKernelWidth method.

WARNING: In /usr/robin_home/scratch/hjohnson/src/buildhome/athlon/DEBUG/include/InsightToolkit/Common/itkGaussianOperator.txx, line 54
itkGaussianOperator (0x818a6d0): Kernel size has exceeded the specified maximum width of 32 and has been truncated to 33 elements.  You can raise the maximum width using the SetMaximumKernelWidth method.

WARNING: In /usr/robin_home/scratch/hjohnson/src/buildhome/athlon/DEBUG/include/InsightToolkit/Common/itkGaussianOperator.txx, line 54
itkGaussianOperator (0x818a6d0): Kernel size has exceeded the specified maximum width of 32 and has been truncated to 33 elements.  You can raise the maximum width using the SetMaximumKernelWidth method.

WARNING: In /usr/robin_home/scratch/hjohnson/src/buildhome/athlon/DEBUG/include/InsightToolkit/Common/itkGaussianOperator.txx, line 54
itkGaussianOperator (0x818a6d0): Kernel size has exceeded the specified maximum width of 32 and has been truncated to 33 elements.  You can raise the maximum width using the SetMaximumKernelWidth method.


real	10m57.980s
user	14m28.742s
sys	0m3.922s
Done with 5.0 0.001

real	1m53.254s
user	2m12.951s
sys	0m1.990s
Done with 5.0 0.01

real	1m32.578s
user	2m1.463s
sys	0m1.574s
Done with 5.0 0.1
/bin/bash: line 228: 11569 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.863s
user	0m0.656s
sys	0m0.207s
Done with 5.0 1.0
/bin/bash: line 228: 11570 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.861s
user	0m0.654s
sys	0m0.205s
Done with 5.0 10.0

real	2m45.964s
user	3m39.850s
sys	0m1.850s
Done with 10.0 0.001

real	2m10.681s
user	2m36.291s
sys	0m2.098s
Done with 10.0 0.01

real	1m58.299s
user	2m3.088s
sys	0m2.104s
Done with 10.0 0.1
/bin/bash: line 228: 11617 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m0.870s
user	0m0.662s
sys	0m0.207s
Done with 10.0 1.0
/bin/bash: line 228: 11618 Aborted                 (core dumped) ./itkCannyImageFilter ~/src/regressiontest/SGI/MR/5x-B2/TEST/10_ACPC/14831300_10_segment.hdr test_${var}_${maxerror}.hdr $var $maxerror

real	0m2.711s
user	0m0.699s
sys	0m0.291s
Done with 10.0 10.0


--------------090607050908030302080904--