[Insight-users] GradientRecursiveGaussianImageFilter
Julien Michel
julien.michel at c-s.cnes.fr
Mon Mar 3 12:06:08 EST 2008
Dear ITK users,
Lately we tried a pipeline of our with some images whose vertical
spacing is negative. This did not give the expected result and after
some investigation, we identified the error source as beeing the
itk::GradientRecursiveGaussianImageFilter, not giving the same result
than with the same image with positive spacing.
By reading the code from itk::GradientRecursiveGaussianImageFilter, I
found that the internal derivative filter seemed to handle negative
spacing (there is a specific case in the SetUp() method from
itk::RecursiveGaussianImageFilter.
Meanwhile, in the GenerateData() method from
itk::GradientRecursiveGaussianImageFilter, the output from the
derivative filters is divided by the spacing along the given dimension,
without any caution regarding negative spacing:
In file itkGradientRecursiveGaussianImageFilter.txx
00246 const RealType spacing = inputImage->GetSpacing()[ dim ];
00247
00248 it.GoToBegin();
00249 ot.GoToBegin();
00250 while( !it.IsAtEnd() )
00251 {
00252 ot.Set( it.Get() / spacing );
00253 ++it;
00254 ++ot;
00255 }
I can not figure out by myself if it is normal to divide by a possibly
negative spacing at this step of the filter. Any idea on this issue ?
Thanks a lot,
Best regards,
Julien Michel
More information about the Insight-users
mailing list