View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008574ITKpublic2009-02-20 14:562010-11-18 13:21
ReporterCasey B Goodlett 
Assigned ToLuis Ibanez 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product VersionITK-3-10 
Target VersionFixed in Version 
Summary0008574: SymmetricSecondRankTensor PreMultiply and PostMultiply have incorrect API
DescriptionBoth the PerMultiply and PostMultiply methods of SymmetricSecondRankTensor return a symmetric tensor, but pre or post multiplication of a symmetric tensor by a rotation matrix does not result in a symmetric tensor.

Assuming D is a diffusion tensor and R a rotation matrix, diffusion tensors are usually rotated by

rot(D) = R * D * R^T;

but both R * D and D * R^T are not themselves symmetric matrices. For example let D be an identity matrix and R a non-identity matrix. R*D is R which is not symmetric.

If you try to implement a rotation as D.PreMultiply(R).PostMultiply(R.transpose()), you get incorrect results because the return type enforces symmetry.

My opinion is that these methods should be removed and replaced with a single method named something like Rotate. Only premultiplication or only postmultiplication is probably not a useful operation at least for diffusion tensors. Backwards compatibility should not be preserved here because the current API can never give a correct answer for R * D as the return type enforces symmetry.

I have attached a patch which removes the incorrect methods and replaces them with a usable, though not particularly efficient, Rotate method. I also added to the test class a test that rotating a tensor gives a correct result.
TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Filespatch file icon symmetrictensor-rotate.patch [^] (5,848 bytes) 2009-02-20 14:56 [Show Content]
patch file icon SymmetricSecondRankTensorWithRotate.patch [^] (2,269 bytes) 2009-04-24 13:09 [Show Content]

 Relationships
has duplicate 0010195closedkentwilliams Pre-multiply and Post-mutliply functions in itkSymmetricSecondRankTensor 

  Notes
(0016186)
Luke Bloy (reporter)
2009-04-24 13:09

I'm attaching an alternative patch that just includes that Rotate method.

The main change is that the component type of the itk::matrix is templated.
(0022837)
kentwilliams (developer)
2010-11-04 12:56

I'm not enough of a Linear Algebraist to formulate a good regressiontest to add -- anyone want to suggest or write such a test?

 Issue History
Date Modified Username Field Change
2009-02-20 14:56 Casey B Goodlett New Issue
2009-02-20 14:56 Casey B Goodlett File Added: symmetrictensor-rotate.patch
2009-04-24 13:09 Luke Bloy Note Added: 0016186
2009-04-24 13:09 Luke Bloy File Added: SymmetricSecondRankTensorWithRotate.patch
2010-03-08 03:49 Tom Vercauteren Relationship added has duplicate 0010195
2010-11-02 14:03 Hans Johnson Status new => assigned
2010-11-02 14:03 Hans Johnson Assigned To => kentwilliams
2010-11-04 12:56 kentwilliams Note Added: 0022837
2010-11-18 13:21 kentwilliams Assigned To kentwilliams => Luis Ibanez


Copyright © 2000 - 2018 MantisBT Team