[Insight-users] dot product of itk vector was completely wrong

David Doria daviddoria at gmail.com
Tue Feb 11 15:45:22 EST 2014


On Tue, Feb 11, 2014 at 3:04 PM, Bradley Lowekamp
<blowekamp at mail.nih.gov> wrote:
> http://www.itk.org/Doxygen/html/classitk_1_1Vector.html
>
> The return type for the operator* for a dot product is Vector::ValueType, a
> scalar, not a vector.
> http://www.itk.org/Doxygen/html/classitk_1_1Vector.html#a51bad5a3835ffc0fbbc02d5437f7e691
>
> By assigning to to a new Vector are implicitly calling this constructor:
> http://www.itk.org/Doxygen/html/classitk_1_1Vector.html#a106ee9550311054cceb66015e98c6457
>
> The example is wrong. Watch your types.
>
> Brad

Brad is right - the 'dotproduct' variable in the example should be a
VectorType::ComponentType, not just VectorType. I updated the page
with the fix.

David


More information about the Insight-users mailing list