View Issue Details

IDProjectCategoryView StatusLast Update
0004073Slicer4Core: MRMLpublic2018-03-02 11:06
Reporterlassoan Assigned Tolassoan  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.5.0-1Fixed in VersionSlicer 4.5.0-1 
Summary0004073: BSpline-linear composite transform becomes inconsitent when split and edited
Description

When a new-style composite bspline transform is loaded that contains a linear and bspline component, the transform is split to components, and the linear component is edited, the changes not show up in slice viewer but models and transform glyphs are updated correctly.

How to reproduce:

  • Load the attached transform
  • Load MRHead
  • Go to Transforms module
  • Apply the transform to MRHead
  • Click "Split"
  • Enable transform display
  • Move the sliders
  • Transform glyphs are updated => OK
  • MRHead volume does not move in the slice viewers => ERROR!
TagsNo tags attached.

Activities

2015-11-02 13:53

 

BSplineLinearCompositeTransform.h5 (94,088 bytes)
lassoan

lassoan

2015-11-02 18:18

developer   ~0013518

Submitted a pull request with the fix:
https://github.com/Slicer/Slicer/pull/396

jcfr

jcfr

2015-11-02 19:29

administrator   ~0013519

Fixed in r24688
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24688

Related Changesets

Import 2017-06-07 23:51:09: master a8cbe3d7

2015-11-02 23:52:00

jcfr

Details Diff
BUG: Fixed transform splitting. Fixes 0004073

Fixes https://www.na-mic.org/Mantis/view.php?id=4073

Problem was that when a composite transform contained an inverse
linear transform, the inverse transform was used as transformToParent.
When transformToParent was later modified by the transform sliders on
the GUI, transformToParent was updated, but transformFromParent was
unchanged.

Script to reproduce the issue:

t1=vtk.vtkTransform()
m1=vtk.vtkMatrix4x4()
m1.SetElement(0,3,15)
t1.SetMatrix(m1)
t2=t1.GetInverse()
print t1.GetMatrix()
print t1.GetInverseFlag()
print t2.GetMatrix() # this is required, otherwise the behavior will not be inconsistent
print t2.GetInverseFlag()
t2.Inverse() # editing the inverse transform
print t1.GetMatrix() # returns ... 15 ...
print t1.GetInverseFlag() # returns 0
print t2.GetMatrix() # returns ... 15 ...
print t2.GetInverseFlag() # returns 0
0 on both and the matrix values are the same.

It seems that if a computed inverse transform is modified then the
transform pipeline becomes inconsistent. It may be the expected behavior
in VTK, one should simply never modify a computed transform. I'll confirm
this with David Gobbi.

The solution was to always set the forward transform in the node so that
when it is modified, it updates the inverse transform as well.

Tested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24688 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Core/Testing/NonLinearTransformScene.mrml Diff File
add - Libs/MRML/Core/Testing/TestData/BSplineLinearCompositeTransform.h5 Diff File
mod - Libs/MRML/Core/Testing/vtkMRMLNonlinearTransformNodeTest1.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTransformNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTransformNode.h Diff File

Issue History

Date Modified Username Field Change
2015-11-02 13:53 lassoan New Issue
2015-11-02 13:53 lassoan Status new => assigned
2015-11-02 13:53 lassoan Assigned To => alexy
2015-11-02 13:53 lassoan File Added: BSplineLinearCompositeTransform.h5
2015-11-02 17:11 lassoan Assigned To alexy => lassoan
2015-11-02 18:18 lassoan Note Added: 0013518
2015-11-02 18:33 jcfr Target Version => Slicer 4.5.0-1
2015-11-02 19:29 jcfr Note Added: 0013519
2015-11-02 19:29 jcfr Status assigned => resolved
2015-11-02 19:29 jcfr Fixed in Version => Slicer 4.5.0-1
2015-11-02 19:29 jcfr Resolution open => fixed
2017-06-10 08:51 jcfr Changeset attached => Slicer master a8cbe3d7
2018-03-02 11:06 jcfr Status resolved => closed