View Issue Details

IDProjectCategoryView StatusLast Update
0004006Slicer4Module SceneViewspublic2018-03-02 11:06
Reporternicole Assigned Tonicole  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.5.0-1Fixed in VersionSlicer 4.5.0-1 
Summary0004006: Loading an MRB with a manual scene view disables Editor effects
Description

From Steve:
...it seems that the Editor's singleton node is replaced when loading a scene that has Scene Views in it (not the default Master Scene View, but one created manually).

Steps To Reproduce

It's easiest to trigger when reloading an MRB while having the Editor module open:

Sample data, load MRHead
Editor, threshold, and make model
Add fiducial
Save scene view
Save MRB
Go back to editor model
Close scene
Load MRB
Unable to change the editor effect.

TagsNo tags attached.

Relationships

related to 0004128 closedpieper Error when closing the scene 

Activities

nicole

nicole

2015-06-17 13:53

administrator   ~0013133

If I skip the "make a scene view" step, still get the effects not changing (though it seems like in this case get button press feedback but not GUI swap out). I also have to set the master volume after loading the MRB.

nicole

nicole

2015-09-04 08:06

administrator   ~0013253

Some more testing: if I save just as a MRML file, close the scene and reload it: same issue in the Editor. Suspect that it's sometjing about making the default master scene view on save of mrml or mrb.

nicole

nicole

2015-09-04 11:11

administrator   ~0013257

A few things are contributing to this bug:

Singleton tags are not written to XML. When a scene is read in with a scripted module node for the editor, it only has ModuleName set (Editor), the singleton tag (Editor) wasn't saved.

So on importing from the MRML file on disk, if you're in the Editor module, there is a singleton editor parameter node in the scene, but the incoming scripted module node isn't detected as a singleton so both are present in the scene.

In EditUtil.py _findParameterNodeInScene, it looks through the scene only checking for scripted module nodes that have the ModuleName set to Editor, and after loading a new scene, the new one is found first and used, even though it's not tagged as a singleton.

I did quick test to see if I could fix it inside the Editor rather than having to change the vtkMRMLNode Read/Write XML to read and print out the singleton tags, and expanding the test in _findParameterNodeInScene seems to have fixed the "not able to switch tools" problem by making sure it uses the original singleton editor parameter node rather than the one that was in the scene on disk:
if n.GetModuleName() == "Editor" and n.GetSingletonTag() == "Editor":

But in a larger sense, not having the singleton tags in the XML file means that any (most?) singleton nodes aren't going to get updated properly on loading in a new MRML scene.

pieper

pieper

2015-09-09 12:07

administrator   ~0013264

I did some quick testing and I agree with your assessment. It seems we can fix the Editor now by adding the check for the SingletonTag as you suggest.

Longer term I don't see any problems (only benefits) from including the SingletonTag in the XML. Not sure why it wasn't included in the first case.

nicole

nicole

2015-09-09 12:12

administrator   ~0013265

Okay, will make that quick fix.
JC and I talked about it on the dev hangout and he suggested asking the dev list for feedback to see if there are any historical reasons for leaving them out of MRML. Is Alex still watching the dev list? The original commit that JC found was from him.

nicole

nicole

2015-09-09 12:16

administrator   ~0013266

Last edited: 2015-09-09 12:54

Editor effects work on scene load in svn 24528:
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24528
and git:
https://github.com/Slicer/Slicer/commit/b1bb1b7c30bd76258414b2c6ba527f80f583c49a

pieper

pieper

2015-09-09 16:00

administrator   ~0013267

Confirmed - nice!

nicole

nicole

2015-09-28 10:04

administrator   ~0013321

Pull request for serialising the singleton tags:
https://github.com/Slicer/Slicer/pull/357

nicole

nicole

2015-09-29 13:32

administrator   ~0013323

Serialising singleton nodes integrated in:
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24582
https://github.com/Slicer/Slicer/commit/808c8e68438c8fff6e77f4886b67facb77659a9b

nicole

nicole

2015-10-06 13:42

administrator   ~0013347

Updated two tests with new baseline mrml files:
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24585
http://viewvc.slicer.org/viewvc.cgi/Slicer3?view=revision&revision=17107

Related Changesets

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

2015-09-09 15:41:11

naucoin

Details Diff
BUG: expand the Editor parameter node checking

When an Editor parameter node is present in the current
scene as well as in a MRML file about to be loaded, the
check for the singleton node was failing (the singleton
tag is not serialised to XML), this change expands
the check so that the original singleton parameter
node is found (the loaded one is not a singleton).

Issue 0004006


git-svn-id: http://svn.slicer.org/Slicer4/trunk@24528 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Scripted/EditorLib/EditUtil.py Diff File

Import 2017-06-07 23:51:09: master 808c8e68

2015-09-29 16:55:06

naucoin

Details Diff
ENH: serialise singleton tags

Singleton nodes were not having their singleton tag serialised to MRML,
so on loading a scene back in, two nodes would be present in the scene
if the node logic is relying on the tag to update the originally in
the scene node.
This fix serialised the singleton tag to MRML, adds a utility method
to uniformly turn the property on or off, adds a test, and expands
the node documentation to note that the hack in the scene to get
untagged singleton nodes is needed for legacy scene files. Also
gave examples for the conventions for singleton tag strings
in the mrml node header file.

Issue 0004006

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24582 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Core/vtkMRMLCoreTestingMacros.h Diff File
mod - Libs/MRML/Core/vtkMRMLNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLNode.h Diff File
mod - Libs/MRML/Core/vtkMRMLScene.cxx Diff File

Import 2017-06-07 23:51:09: master 59b0f874

2015-09-29 18:33:16

naucoin

Details Diff
BUG: update the baseline mrml file for singleton changes

Add the singleton tag to the baseline mrml file for the
camera displayable manager test.

Issue 0004006


git-svn-id: http://svn.slicer.org/Slicer4/trunk@24585 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/DisplayableManager/Testing/Data/vtkMRMLCameraDisplayableManagerTest1.mrml Diff File

Import 2017-06-07 23:51:09: master 30a89fef

2015-10-06 16:49:04

naucoin

Details Diff
BUG: update EMSegment to fix failing test

Updated the EMSegment testing MRML file to
include the singletonTag so that the comparison
between the baseline mrml file and the written
one will succeed. Fixes test EMSeg_MRML_DiffReadWriteNodes

Issue 0004006



git-svn-id: http://svn.slicer.org/Slicer4/trunk@24607 3bd1e089-480b-0410-8dfb-8563597acbee
mod - SuperBuild.cmake Diff File

Issue History

Date Modified Username Field Change
2015-06-17 11:58 nicole New Issue
2015-06-17 11:58 nicole Status new => assigned
2015-06-17 11:58 nicole Assigned To => nicole
2015-06-17 13:53 nicole Note Added: 0013133
2015-09-04 08:06 nicole Note Added: 0013253
2015-09-04 11:11 nicole Note Added: 0013257
2015-09-09 12:07 pieper Note Added: 0013264
2015-09-09 12:12 nicole Note Added: 0013265
2015-09-09 12:16 nicole Note Added: 0013266
2015-09-09 12:16 nicole Status assigned => resolved
2015-09-09 12:16 nicole Fixed in Version => Slicer 4.5.0-1
2015-09-09 12:16 nicole Resolution open => fixed
2015-09-09 12:54 nicole Note Edited: 0013266
2015-09-09 16:00 pieper Note Added: 0013267
2015-09-09 16:00 pieper Status resolved => closed
2015-09-28 10:04 nicole Note Added: 0013321
2015-09-29 13:32 nicole Note Added: 0013323
2015-09-29 13:32 nicole Status closed => resolved
2015-10-06 13:42 nicole Note Added: 0013347
2016-01-22 12:43 pieper Relationship added related to 0004128
2017-06-10 08:51 Changeset attached => Slicer master 30a89fef
2017-06-10 08:51 Changeset attached => Slicer master 59b0f874
2017-06-10 08:51 Changeset attached => Slicer master 808c8e68
2017-06-10 08:51 Changeset attached => Slicer master b1bb1b7c
2018-03-02 11:06 jcfr Status resolved => closed