[Insight-developers] Neighborhood Filter for Covariant Vector and is_signed

Gert Wollny gert at die.upm.es
Thu Jul 9 07:14:35 EDT 2009


Hi all, 

I'm trying to implement Normalized Gradient Fields [1] as a new
ImageToImageMetric. In order to evaluate the derivative, I need to
evaluate the gradient of a vector field. To do so I thought using the
NeighborhoodOperatorImageFilter with the SobelOperator might be a good
idea.

However, when i try to compile it, I get the following compile error: 

   error: ‘is_signed’ is not a member of   
   ‘itk::NumericTraits<itk::CovariantVector<float, 2u> >’

Next thing I tried was to add a specialization of vcl_numeric_limits
and std::numeric_limits for the CovariantVector<float, 2u> 

namespace std {
template <>
class numeric_limits< ::itk::CovariantVector<float, 2> >
{
 public:
  static const bool is_signed VCL_STATIC_CONST_INIT_INT_DECL(true);
};
}

but the  compiler didn't pick that up for some reason. 
Now I wonder, where would be the right place to persuade the compiler
that NumericTraits<itk::CovariantVector<float, 2u> > has a variable
is_signed and that it is set to true. 

Or, should I better use the GradientImageFilter on the vector field (I
use it already to evaluate the image gradient)?  It would result in a 
CovariantVector<CovariantVector<float, 2u>, 2u> and I wonder weather
this makes sense performance wise. 

Many thanks

Gert 

[1] E. Haber and J. Modersitzki
"Beyond Mutual Information: A Simple and Robust Alternative"
In Bildverarbeitung für die Medizin 2005
Springer Berlin Heidelberg




More information about the Insight-developers mailing list