View Issue Details

IDProjectCategoryView StatusLast Update
0003416Slicer4Core: MRMLpublic2017-06-10 08:51
Reporterpinter Assigned Toalexy  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.3.0 
Target VersionSlicer 4.4.0Fixed in VersionSlicer 4.4.0 
Summary0003416: Custom reference roles cannot be loaded with a scene
Description

We found some issues with the node referencing mechanism, and developed an idea that would probably solve all these, and it would simplify the code too.

Basically these issues are:

  1. Custom reference roles cannot be loaded with a scene
  2. The MRML node attribute names have to be set before adding a reference, which causes issues (results in a crash in certain conditions, see http://www.na-mic.org/Bug/view.php?id=3413 )

We think that the referencing mechanism could work without explicitly setting and storing the NodeReferenceMRMLAttributeNames list. Saving the references to a scene (WriteXML) could happen into a serialized list in one attribute instead of separate attributes (this is the only reason why this list exists). This way the user wouldn't have to set the role explicitly (solves issue 2), and custom roles could also be loaded by a scene without having to create a custom node that sets the role in its constructor.
Example for the serialization:
Current: <Volume id="…" … displayNodeRef="dID1 dID2" storageNodeRef="sID2" …></Volume>
Proposed: <Volume id="…" … references="displayNode:dID1,dID2;storageNode:sID2" …></Volume>

TagsToBeBackported

Relationships

related to 0003413 closedalexy Saving a scene results in a crash if a node reference is added but its role is not 
parent of 0003469 closednicole RSNA 2013 3D visualization course 

Activities

pinter

pinter

2013-09-24 12:45

developer   ~0010078

First email about the issue:
http://slicer-devel.65872.n3.nabble.com/Recovering-user-node-references-when-importing-a-scene-td4030003.html

alexy

alexy

2013-10-08 09:43

developer   ~0010153

Last edited: 2013-10-08 09:44

Since there will be a backward compatibility issue in reading new MRML format, if implemented as proposed by Csaba, here is an intermediate solution:
a) leave current "hard-coded" reference nodes MRML syntax.
b) implement new generic syntax proposed above only for "custom" references that are added dynamically.
c) retire a) in the next major release.

Csaba, Jc, any thoughts?

pinter

pinter

2013-10-08 09:51

developer   ~0010154

I agree that this would be the most painless solution if we want to keep backward compatibility.
Thanks!

alexy

alexy

2013-10-13 08:31

developer   ~0010173

Added generic mechanism for persisting node references in .mrml files.
References stored in the form: references="role1:id1 id2 iid3;role2:id3;". Note that for backwards compatibility reference nodes such as displayable, transformable etc. still read/write their references the old way. Only custom references will use new generic syntax.
Rev: 22610.

pinter

pinter

2013-10-17 07:43

developer   ~0010189

I tried it and it works with custom attributes. Thanks a lot for the fix!

We need to make sure that the backwards-compatibility related code is phased out when the next stable is released.

jcfr

jcfr

2013-10-26 19:16

administrator   ~0010229

Backported to Slicer-4-3 branch as of r22644 and r22645

See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=22644
and http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=22645

jcfr

jcfr

2013-11-14 06:17

administrator   ~0010312

Test case contributed by Csaba has been integrated to the trunk as of r22700.
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=22700

@Csaba: Thanks again for your work on this.

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file 43e1d624

2013-11-14 11:12:56

jcfr

Details Diff
ENH: Added test for MRML node reference serialization and parsing
Issue 0003416

From: Csaba Pinter <csaba.pinter@queensu.ca>

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

Import 2017-06-07 23:51:09: master 43e1d624

2013-11-14 11:12:56

jcfr

Details Diff
ENH: Added test for MRML node reference serialization and parsing
Issue 0003416

From: Csaba Pinter <csaba.pinter@queensu.ca>

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

Issue History

Date Modified Username Field Change
2013-09-24 12:29 pinter New Issue
2013-09-24 12:29 pinter Status new => assigned
2013-09-24 12:29 pinter Assigned To => alexy
2013-09-24 12:30 jcfr Target Version => Slicer 4.3.2
2013-09-24 12:30 pinter Relationship added related to 0003413
2013-09-24 12:45 pinter Note Added: 0010078
2013-10-08 09:43 alexy Note Added: 0010153
2013-10-08 09:44 alexy Note Edited: 0010153
2013-10-08 09:51 pinter Note Added: 0010154
2013-10-13 08:32 alexy Note Added: 0010173
2013-10-13 08:32 alexy Status assigned => resolved
2013-10-13 08:32 alexy Resolution open => fixed
2013-10-17 07:43 pinter Note Added: 0010189
2013-10-18 13:52 pinter Status resolved => closed
2013-10-26 19:16 jcfr Note Added: 0010229
2013-10-26 19:16 jcfr Fixed in Version => Slicer 4.3.2
2013-11-05 08:02 nicole Relationship added parent of 0003469
2013-11-14 06:17 jcfr Note Added: 0010312
2013-11-14 08:22 jcfr Tag Attached: ToBeBackported
2014-03-06 10:16 nicole Target Version Slicer 4.3.2 => Slicer 4.4.0
2014-03-06 10:17 nicole Fixed in Version Slicer 4.3.2 => Slicer 4.4.0
2017-06-07 23:27 jcfr Changeset attached => Slicer 2145-support-for-installing-extension-from-file 43e1d624
2017-06-10 08:51 jcfr Changeset attached => Slicer master 43e1d624