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

Gert Wollny gert at die.upm.es
Mon Jul 13 07:39:14 EDT 2009


After some research I now found out that in order to use a Neighborhood
Operator Image Filter on a vector valued image, one needs to use the
class VectorNeighborhoodOperatorImageFilter which, in its essence,
duplicates the code of  NeighborhoodOperatorImageFilter without testing
the is_signed property of the  pixel class, and without supporting
different boundary conditions.

I think that these two classes should be unified and I filed a bug
report accordingly: http://www.vtk.org/Bug/view.php?id=9263

Best, 

Gert

On Thu, 2009-07-09 at 13:14 +0200, Gert Wollny wrote:
> 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
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
> 



More information about the Insight-developers mailing list