[Insight-developers] NumericTraits for FixedArray does not define Zero
Bradley Lowekamp
blowekamp at mail.nih.gov
Sun Feb 21 10:37:52 EST 2010
Hello Dan,
Are you using the latest CVS? ( ahh I see you are using 3.16... )
I believe that this may be been addressed in the past couple of months with a macro for many of the array like types.
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itkNumericTraitsFixedArrayPixel.h?revision=1.8&root=Insight&view=markup
Brad
On Feb 21, 2010, at 3:52 AM, Dan Mueller wrote:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.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