<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><a href="http://www.itk.org/Doxygen/html/classitk_1_1Vector.html">http://www.itk.org/Doxygen/html/classitk_1_1Vector.html</a></div><div><br></div>The return type for the operator* for a dot product is Vector::ValueType, a scalar, not a vector.<div><a href="http://www.itk.org/Doxygen/html/classitk_1_1Vector.html#a51bad5a3835ffc0fbbc02d5437f7e691">http://www.itk.org/Doxygen/html/classitk_1_1Vector.html#a51bad5a3835ffc0fbbc02d5437f7e691</a><br><div><br></div><div>By assigning to to a new Vector are implicitly calling this constructor:<div>http://www.itk.org/Doxygen/html/classitk_1_1Vector.html#a106ee9550311054cceb66015e98c6457</div><div><br></div><div>The example is wrong. Watch your types. </div><div><br></div><div>Brad<br><div><br><div><div>On Feb 11, 2014, at 2:46 PM, WANG Chengjia <wangchengjia1986@gmail.com> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div dir="ltr">Hi, <div><br></div><div>I'm not sure whether this is a bug, but I had two itk::vector<double, 3> and when I printed them out, one of them are [0 0 1], the other one is [0 0 4]. I follow the example given in <a href="http://www.itk.org/Wiki/ITK/Examples/Math/DotProduct">http://www.itk.org/Wiki/ITK/Examples/Math/DotProduct</a></div>
<div>(directly multiply the two vector using '*')</div><div>and finally I got a inner product of them as [ 4 4 4], which is completely wrong. </div><div><br></div><div>Is there something wrong in version 4.5?</div>
<div><br></div><div>Best,</div><div>Chengjia</div><div><div><br></div>-- <br>Chengjia Wang<br>Phd Student, <br>University of Edinburgh<br>Clinical Research Imaging Center (CRIC)<br>Toshiba Medical Visualization Systems Europe, Ltd<br>
Email: <a href="mailto:wangchengjia1986@gmail.com" target="_blank">wangchengjia1986@gmail.com</a><br>
</div></div>
_____________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at<br>http://www.kitware.com/opensource/opensource.html<br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></blockquote></div><br></div></div></div></div></body></html>