View Issue Details

IDProjectCategoryView StatusLast Update
0001995Slicer4Module SceneViewspublic2012-08-21 09:47
Reporterfinetjul Assigned Toalexy  
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Product VersionSlicer 4.1.0 
Target VersionSlicer 4.2.0Fixed in VersionSlicer 4.2.0 
Summary0001995: Scene view references
Description

2 issues:

When storing a scene, the internal scene (vtkMRMLSceneViewNode::Nodes) references (vtkMRMLScene::ReferencingNodes) are not updated.
However, when loading a MRML scene that contains a MRML scene view node, the references are computed.
See vtkMRMLSceneViewNodeStoreSceneTest::references() first test

Manually calling vtkMRMLSceneViewNode::UpdateScene(scene) results in having nodes from the scene into the sceneview node scene (vtkMRMLSceneViewNode::Nodes) references.
See vtkMRMLSceneViewNodeStoreSceneTest::references() second test

Make sure py_LoadAnnotationRulerScene is passing

TagsNo tags attached.

Relationships

related to 0001992 closedalexy deleting a sceneview crashes slicer 
related to 0002018 closedalexy slicer crashes when trying to save a scene 

Activities

alexy

alexy

2012-05-08 06:30

developer   ~0004196

The described behavior seems reasonable to me, you need to update references when you add/change nodes in the scene but not when you copy existing state into a SceneView node.

What's it the real problem here?

finetjul

finetjul

2012-05-08 07:54

administrator   ~0004197

There is inconsistency between:
a) a vtkMRMLSceneViewNode created from Slicer session
b) and a vtkMRMLSceneViewNode loaded from MRML scene file.

In a) vtkMRMLSceneViewNode::Nodes scene doesn't have references
In b) vtkMRMLSceneViewNode::Nodes scene has references (because vtkMRMLSceneViewNode::UpdateScene() is called.

In case of b), there is a problem because:
1) vtkMRMLSceneViewNode::Nodes scene contains references to the main scene nodes.
2) at destruction time, the main scene is deleted, deleting all nodes (2a) and vtkMRMLSceneViewNodes (2b). vtkMRMLSceneViewNode::Nodes scene deletes mrml nodes that can attempt to remove reference from scene. It browses through the reference list which contains pointers on MRML nodes of the main scene, but these pointers have already been deleted in 2a which result in crash.

These errors are shown in py_LoadAnnotationRulerScene and vtkMRMLSceneViewNodeStoreSceneTest::references().

finetjul

finetjul

2012-05-08 13:05

administrator   ~0004202

I suggest:

  • call UpdateScene after "StoreScene"
  • vtkMRMLSceneViewNode::UpdateScene(mainScene) should not copy main scene reference nodes (vtkMRMLScene::ReferenceNodes) into the scene view node scene reference nodes (vtkMRMLSceneViewNode::Nodes::ReferenceNodes), but copy only the main scene node IDs (vtkMRMLScene::ReferenceNodeIDs). The scene view node scene reference nodes (vtkMRMLSceneViewNode::Nodes::ReferenceNodes) must be computed from the nodes in its internal scene (vtkMRMLSceneViewNode::Nodes) whose IDs match the ones of the main scene reference nodes (vtkMRMLScene::ReferenceNodes).
alexy

alexy

2012-05-11 14:51

developer   ~0004339

ViewNode builds it's own ReferencingNodes vector rather than copying one from the scene. Also cleans references when reusing ViewNode.

http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=20067

jcfr

jcfr

2012-07-27 15:40

administrator   ~0005368

Dear issue reporter,

Good news :) Slicer developers SOLVED the problem you reported - YOU now need to VERIFY and CLOSE this issue.

Issue History

Date Modified Username Field Change
2012-05-07 18:30 finetjul New Issue
2012-05-07 18:30 finetjul Status new => assigned
2012-05-07 18:30 finetjul Assigned To => alexy
2012-05-08 06:30 alexy Note Added: 0004196
2012-05-08 07:54 finetjul Note Added: 0004197
2012-05-08 13:05 finetjul Note Added: 0004202
2012-05-09 08:51 finetjul Relationship added related to 0001992
2012-05-10 19:47 finetjul Relationship added related to 0002018
2012-05-11 14:51 alexy Note Added: 0004339
2012-05-11 14:51 alexy Status assigned => resolved
2012-05-11 14:51 alexy Resolution open => fixed
2012-07-27 15:40 jcfr Note Added: 0005368
2012-07-30 07:25 finetjul Status resolved => closed
2012-07-30 07:25 finetjul Fixed in Version => Slicer 4.2.0 - October 1st 2012
2012-08-21 09:47 jcfr Target Version => Slicer 4.2.0 - Feature freeze Sept 1st 2012