<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>The fix for this bug is to return a Matrix instead of a SymmetricSecondRankTensor, but if you have some math like:&nbsp;</div><div><br></div><div>A = g*T*g' where T is a tensor and you know that the result A is a tensor, it would be nice to have a way to convert the Matrix that is produced by T.PreMultiply(g).PostMultiply(g.GetTranspose()) into a Tensor. &nbsp;A copy constructor or assignment operator may not be ideal as they could lead to unintended consequences from accidentally converting from a Matrix to a Tensor, but perhaps there could be a method with a name like InitFromMatrix so that one could write:</div><div><br></div><div>DiffusionTensor3D newT;</div><div>newT.InitFromMatrix(A);</div><div><br></div><div>I can add this new method under the same gerrit patch&nbsp;&nbsp;<a href="http://review.source.kitware.com/5943">http://review.source.kitware.com/5943</a>&nbsp;. &nbsp;Is there any preference for the name? &nbsp;Any reason this shouldn't be done?</div><div>-Kris</div><div><br></div><div><br></div><div><blockquote type="cite">Hello,<br>&nbsp;&nbsp;&nbsp;&nbsp;While working on some code that does math with DiffusionTensor3D &nbsp;<br>pixels, I found that DiffusionTensor3D's parent class &nbsp;<br>SymmetricSecondRankTensor returns a SymmetricSecondRankTensor from &nbsp;<br>both the PreMultiply(MatrixType m) and the PostMultiply(MatrixType &nbsp;<br>m). &nbsp;This code is in effect saying that a symmetric tensor multiplied &nbsp;<br>by any matrix results in a symmetric tensor which is not true! &nbsp;The &nbsp;<br>code needs to be changed to return a Matrix instead of a &nbsp;<br>SymmetricSecondRankTensor. &nbsp;Anyone who is using these PreMultiply and &nbsp;<br>PostMultiply methods currently is having important information from &nbsp;<br>the lower half of the matrix thrown away and getting incorrect &nbsp;<br>computations as a result.<br><br>I have added a patch that fixes this bug at&nbsp;<a href="http://review.source.kitware.com/5943">http://review.source.kitware.com/5943</a><br><br>-Kris<br></blockquote></div></body></html>