View Issue Details

IDProjectCategoryView StatusLast Update
0004080Slicer4Module Transformspublic2018-06-02 01:06
ReporterlassoanAssigned Tojcfr 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version 
Target VersionSlicer 4.9.0Fixed in VersionSlicer 4.9.0 
Summary0004080: Transform module is not updated properly after importing a scene
Description

Copied from: https://github.com/Slicer/Slicer/pull/398#issuecomment-153754024

To reproduce:

(1) Start Slicer
(2) Switch to Transforms module
(3) Load this scene (it contains a transform applied to the MRBrainTumor1 volume): http://1drv.ms/1XPkXuy
(4) Choose GridTransformSmall in the transform node selector

=> ERROR: The MRBrainTumor1 volume should appear in the "Transformed" tree at the bottom right of the Transforms module GUI
(if the scene is loaded before switching to Transforms module then the MRBrainTumor1 correctly appears in the tree)

TagsNo tags attached.

Relationships

related to 0004570 assignedjcfr Selection in node selector is lost if importing a scene 
child of 0004081 assignedjcfr Ensure reference are updated before NodeAddedEvent is invoked 

Activities

jcfr

jcfr

2015-11-11 11:10

administrator   ~0013591

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

jcfr

jcfr

2015-11-12 08:58

administrator   ~0013600

Reverted in r24734
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24734

lassoan

lassoan

2017-09-27 11:11

developer   ~0015167

The issue is still there Slicer 4.7.0-2017-09-26 on Windows10.

The test scene is available here:
https://1drv.ms/u/s!Arm_AFxB9yqHsKtWHFuufICWI0mAww

lassoan

lassoan

2018-03-10 09:18

developer   ~0015542

Another way to reproduce this:

[quote="mholden8, post:11, topic:2153"]
experience the same issue as Nathan. Here are the steps that I can do to reproduce the issue (latest Slicer nightly 2018-03-05, Windows 10):

Open fresh Slicer.
Create a transform node. Call it FirstTransformNode.
Save the scene.
Create a another transform node. Call it SecondTransformNode.
Make SecondTransformNode the parent of FirstTransformNode.
Save the scene.
Clear the scene.
Reload the saved scene created in Step 6.

In the reloaded scene, SecondTransformNode does not appear to be the parent of FirstTransformNode in the Data module GUI (transform hierarchy tab). Likewise, in the Transforms module, FirstTransformNode does not appear to be transformed by SecondTransformNode in the GUI. But I observe that if I check the parent node of FirstTransformNode through the Python interactor, it is SecondTransformNode. See commands below:

firstTransformNode = slicer.util.getNode( “FirstTransformNode” )

parentTransformNode = firstTransformNode.GetParentTransformNode()

print( parentTransformNode )
[/quote]

See more discussion here:
https://discourse.slicer.org/t/transform-hierarchy-in-data-module-not-showing-multiple-transforms-correctly/2153/11

lassoan

lassoan

2018-03-10 13:02

developer   ~0015543

Even simpler way to reproduce:

  1. Start Slicer or close scene

  2. Copy-paste to Python console:
    sceneXMLString = """
    <MRML  version="Slicer4.4.0" userTags="">
    <LinearTransform
    id="vtkMRMLLinearTransformNode4" name="FirstTransformNode" hideFromEditors="false" selectable="true" selected="false" transformNodeRef="vtkMRMLLinearTransformNode5" references="transform:vtkMRMLLinearTransformNode5;" userTags="" matrixTransformToParent="1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1" ></LinearTransform>
    <LinearTransform
    id="vtkMRMLLinearTransformNode5" name="SecondTransformNode" hideFromEditors="false" selectable="true" selected="false" references="" userTags="" matrixTransformToParent="1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1" ></LinearTransform>
    </MRML>
    """
    slicer.mrmlScene.SetLoadFromXMLString(1);
    slicer.mrmlScene.SetSceneXMLString(sceneXMLString)
    slicer.mrmlScene.Import()
    

If parent transform node is listed in the scene first then the hierarchy appears correctly:

sceneXMLString = """
<MRML  version="Slicer4.4.0" userTags="">
 <LinearTransform
  id="vtkMRMLLinearTransformNode5" name="SecondTransformNode" hideFromEditors="false" selectable="true" selected="false" references="" userTags="" matrixTransformToParent="1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1" ></LinearTransform>
 <LinearTransform
  id="vtkMRMLLinearTransformNode4" name="FirstTransformNode" hideFromEditors="false" selectable="true" selected="false" transformNodeRef="vtkMRMLLinearTransformNode5" references="transform:vtkMRMLLinearTransformNode5;" userTags="" matrixTransformToParent="1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1" ></LinearTransform>
</MRML>
"""
slicer.mrmlScene.SetLoadFromXMLString(1);
slicer.mrmlScene.SetSceneXMLString(sceneXMLString)
slicer.mrmlScene.Import()
lassoan

lassoan

2018-03-10 13:25

developer   ~0015544

Submitted a pull request with a potential fix:

https://github.com/Slicer/Slicer/pull/915

lassoan

lassoan

2018-03-14 10:03

developer   ~0015555

Fix committed r27077

jcfr

jcfr

2018-03-14 16:43

administrator   ~0015562

Last edited: 2018-03-14 16:43

View 2 revisions

Thanks Andras

Would it be possible to evaluate the work that was already done as part of issue 0004081

More specifically, this topic is getting us closer I think:

https://github.com/jcfr/Slicer/compare/add-vtkEventSpy...jcfr:4081-ensure-reference-are-up-to-date-on-import

lassoan

lassoan

2018-03-15 09:34

developer   ~0015564

I completely agree that it should be done, but I have priority tasks now. 0004081 is still open, so it should keep this task on our radar.

Issue History

Date Modified Username Field Change
2015-11-11 08:14 jcfr New Issue
2015-11-11 08:14 jcfr Status new => assigned
2015-11-11 08:14 jcfr Assigned To => lassoan
2015-11-11 08:15 jcfr Reporter jcfr => lassoan
2015-11-11 08:15 jcfr Assigned To lassoan => jcfr
2015-11-11 08:15 jcfr Target Version => Slicer 4.5.0-1
2015-11-11 11:10 jcfr Note Added: 0013591
2015-11-11 11:10 jcfr Status assigned => resolved
2015-11-11 11:10 jcfr Fixed in Version => Slicer 4.5.0-1
2015-11-11 11:10 jcfr Resolution open => fixed
2015-11-12 08:17 jcfr Relationship added child of 0004081
2015-11-12 08:18 jcfr Status resolved => assigned
2015-11-12 08:18 jcfr Fixed in Version Slicer 4.5.0-1 =>
2015-11-12 08:18 jcfr Target Version Slicer 4.5.0-1 => Slicer 4.5.1
2015-11-12 08:58 jcfr Note Added: 0013600
2016-10-12 02:56 jcfr Target Version Slicer 4.5.1 => Slicer 4.7.0
2017-09-27 11:11 lassoan Note Added: 0015167
2017-09-27 11:13 lassoan Target Version Slicer 4.7.0 => Slicer 4.9.0
2018-03-10 09:18 lassoan Note Added: 0015542
2018-03-10 13:02 lassoan Note Added: 0015543
2018-03-10 13:25 lassoan Note Added: 0015544
2018-03-14 10:03 lassoan Status assigned => resolved
2018-03-14 10:03 lassoan Fixed in Version => Slicer 4.9.0
2018-03-14 10:03 lassoan Note Added: 0015555
2018-03-14 16:43 jcfr Note Added: 0015562
2018-03-14 16:43 jcfr Note Edited: 0015562 View Revisions
2018-03-15 09:34 lassoan Note Added: 0015564
2018-06-02 01:06 jcfr Relationship added related to 0004570