[Insight-developers] itkSmoothingRecursiveGaussianImageFilter concept check too strong

Wheeler, Frederick W (GE Global Research) wheeler at ge.com
Thu Mar 3 12:42:20 EST 2011


Class itk::SmoothingRecursiveGaussianImageFilter has this concept check

  itkConceptMacro( InputHasNumericTraitsCheck,
                                   ( Concept::HasNumericTraits<
PixelType > ) );

When I use this type for both the input and output image

  itk::Image<itk::SymmetricSecondRankTensor<double, 3u>, 3u>

the concept fails becasue IsPositive, IsNonpositive, IsNegative, and
IsNonnegative
are not members of
itk::NumericTraits<itk::SymmetricSecondRankTensor<double, 3u> >

But if I turn off concept checking by doing this at the top of my file

#include "itkConfigure.h"
#undef ITK_USE_CONCEPT_CHECKING

my code compiles and runs fine.  So I think this concept check is too
strong for this class.

( This makes sense to me since a smoothing filter like this one needs
to multiply pixel values by scalars with the result still being a
pixel value and it needs to add pixel values.  Even if these traits
were present I think their values would not matter for this class
since the Gaussian kernel is non-negative.  I guess I'm not sure of
any requirements on the pixel type that might come from intermediate
calculations. )

Fred Wheeler



More information about the Insight-developers mailing list