MantisBT - VTK
View Issue Details
0011837VTK(No Category)public2011-02-10 12:202011-02-10 13:44
David Gobbi 
David Gobbi 
normalmajoralways
closedfixed 
 
 
0011837: Wrong result for warp transforms in some circumstances
If the reslice input origin, spacing are 0.0, 1.0 and if the ResliceAxes are not set or are identity, then any warp transform (i.e. transform not expressible as a 4x4 matrix) will be applied with an incorrect shift and/or scale applied to the coordinates, unless the output origin, spacing are also 0.0, 1.0.

These circumstances seem to be rare enough that this bug has gone undetected since it was introduced in Aug, 2001 by commit 5a638df69fe075a1d231b307fd354edd2cb890e7.
In Hybrid/Testing/Tcl/TestGridWarpCubic.tcl, add the following lines to the reslice setup:

  reslice SetOutputOrigin -32.0 -32.0 0.0
  reslice SetOutputExtent 0 255 0 255 0 0

One would expect that this would cause a translation in the output, but it does not.
The following patch fixes the issue:

--- a/Imaging/vtkImageReslice.cxx
+++ b/Imaging/vtkImageReslice.cxx
@@ -3514,7 +3514,7 @@ vtkMatrix4x4 *vtkImageReslice::GetIndexMatrix(vtkInformation *inInfo,
     if ((this->OptimizedTransform == NULL &&
          (inSpacing[i] != outSpacing[i] || inOrigin[i] != outOrigin[i])) ||
         (this->OptimizedTransform != NULL &&
- (inSpacing[i] != 1.0 || inOrigin[i] != 0.0)))
+ (outSpacing[i] != 1.0 || outOrigin[i] != 0.0)))
       {
       isIdentity = 0;
       }
No tags attached.
Issue History
2011-02-10 12:20David GobbiNew Issue
2011-02-10 12:20David GobbiStatusbacklog => tabled
2011-02-10 12:20David GobbiAssigned To => David Gobbi
2011-02-10 13:44David GobbiNote Added: 0025381
2011-02-10 13:44David GobbiStatustabled => closed
2011-02-10 13:44David GobbiResolutionopen => fixed

Notes
(0025381)
David Gobbi   
2011-02-10 13:44   
Fixed by commit cc1e8f59fda5a2c97afd1e81ae98cdab44ae5f94