[Insight-developers] NumericTraits for FixedArray does not define Zero

Dan Mueller dan.muel at gmail.com
Sun Feb 21 03:52:40 EST 2010


Hi Insight Developers,

I notice NumericTraits for FixedArray does not define Zero. eg.
    typedef itk::FixedArray<unsigned char, 3> PixelType;
    PixelType zero = itk::NumericTraits<PixelType>::Zero;
returns
    error C2039: 'Zero' : is not a member of
'itk::NumericTraits<itk::FixedArray<TValueType,VLength>>'
(VIsual Studio 8.0, ITK 3.16, Windows Vista 32-bit).

Is there a good reason for this?

Couldn't it be defined similar to VariableLengthVector? ie.
(though without needing to pass in self for the size)

  static const Self Zero( const Self  & a ) \
  {  \
    Self b(a.Size());  \
    b.Fill( NumericTraits< T >::Zero ); \
    return b; \
  } \

Thanks for any advice.

Regards, Dan


More information about the Insight-developers mailing list