[Insight-users] bug in gradientRecursiveGaussianImageFilter?

Luis Ibanez luis.ibanez at kitware.com
Wed Sep 28 16:13:08 EDT 2005


Hi Martin,


Thanks for pointing this out.

You are right, this is indeed a bug.

I share your amazement about why this has not
produced a segmentation fault, nor showed up
as an error on the Valgrind tests.

A fix has now been committed to the cvs repository.
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkGradientRecursiveGaussianImageFilter.txx?root=Insight&sortby=date&r2=1.31&r1=1.30


Please let us know if you find any other problem,


   Thanks


      Luis



----------------------------
Martin Urschler wrote:
> hello,
> 
> i was digging into the GradientRecursiveGaussian filter and found 
> something that might cause seg faults (actually i wonder why it doesn´t)
> 
> I use 3D images, i.e. ImageDimension equals 3
> 
> The class creates 2 smoothing Image filters and one derivative filter in 
> my case. In the generateData method of this filter there is a while loop 
> setting up the directions of these 3 filters.
> 
> for (unsigned int dim=0; dim < ImageDimension; ++dim)
> {
>   unsigned int i=0;
>   unsigned int j=0;
>   while( i < ImageDimension )
>   {
>      if (i == dim)
>      {
>         j++;
>      }
> 
>      std::cout << "setting smoothing filter[" i <<         "] to 
> direction [" << j << "]" << std::endl;
> 
>      m_SmoothingFilters[i]->SetDirection( j );
>      ++i;
>      ++j;
>   }
> 
>   m_DerivativeFilter->SetDirection( dim );
> 
>   .... do the other stuff ....
> }
> 
> If I introduce the cout message as shown above I get the following 
> console output:
> 
> dim = 0:
> setting smoothing filter [0] to direction [1]
> setting smoothing filter [1] to direction [2]
> setting smoothing filter [2] to direction [3]
> 
> dim = 1:
> setting smoothing filter [0] to direction [0]
> setting smoothing filter [1] to direction [2]
> setting smoothing filter [2] to direction [3]
> 
> dim = 2:
> setting smoothing filter [0] to direction [0]
> setting smoothing filter [1] to direction [1]
> setting smoothing filter [2] to direction [3]
> 
> 
> However smoothing filter [2] has nowhere been created. I guess this 
> should segfault, at least sometimes, but obviously it doesn't which is 
> strange since every registration application using a metric derived from 
> itkImageToImageMetric uses this class to calculate moving image 
> derivatives. so there should be lots of test cases all around the world...
> 
> regards, Martin
> 
> _______________________________________________
> 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