Difference between revisions of "2008 Winter Project Week:MRMLScenesForExecutionModel"

From NAMIC Wiki
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 27: Line 27:
 
<h1>Approach, Plan </h1>
 
<h1>Approach, Plan </h1>
  
Goal: pass MRML scenes and subscenes back and forth between Slicer3 and command line executables/plug-ins.
+
'''Goal:''' pass MRML scenes and subscenes back and forth between Slicer3 and command line executables/plug-ins.
  
MRML scenes are currently used as wrappers to pass transforms and model hierarchy nodes to command line executables/plug-ins. Does this infrastructure need to be expanded to support other node types? Or is a separate mechanism needed to pass complete scenes?
+
'''Requirements/Design:''' MRML scenes are currently used as wrappers to pass transforms and model hierarchy nodes to command line executables/plug-ins. Does this infrastructure need to be expanded to support other node types? Or is a separate mechanism needed to pass complete scenes?
  
Id remapping is major concern when passing scenes. A second concern is how to indicate that a subscene is to be replaced.  
+
'''Concerns:''' Id remapping is major concern when passing scenes. A second concern is how to indicate that a subscene is to be replaced. MRML manipulation routines may have to be added to libMRML as opposed to being spread through the Slicer code base.
 
</div>
 
</div>
  
Line 43: Line 43:
 
====Jan 2008 Project Half Week====
 
====Jan 2008 Project Half Week====
  
 +
A productive discussion led to a strategy for handling reference handling wich was subsequently implemented and checked in to slicer.  See email exchange below.
  
 
</div>
 
</div>
  
 
<br style="clear: both;" />
 
<br style="clear: both;" />
 +
<pre>
 +
 +
Hi Brad,
 +
 +
I have changed vtkSetReferenceStringMacro so that it removes old
 +
references from the reference cache on the scene. Please let me know it
 +
fixed the problems that you were having.
 +
 +
Alex
 +
 +
Brad Davis wrote:
 +
> > Hi Alex and other MRML gurus,
 +
> >
 +
> > I'm having some problems with the MRML functionality and I wonder if
 +
> > you can help.
 +
> >
 +
> > Suppose that I start with a mrml ReferencingNode, which references
 +
> > OldReferencedNode.
 +
> >
 +
> > Now I use vtkSetReferenceStringMacro to change the reference from
 +
> > OldReferencedNode to NewReferencedNode.
 +
> >
 +
> > This adds entries in vtkMRMLScene::ReferencingNodes and
 +
> > vtkMRMLScene::ReferencedIDs.  However, it does not remove the entry
 +
> > that associates ReferencingNode and OldReferencedNode.
 +
> >
 +
> > Now, when I use vtkMRMLScene::GetReferencedNodes(ReferencingNode) both
 +
> > ReferencedNode and OldReferencedNode are added to the collection.  But
 +
> > I didn't want OldReferencedNode since it is no longer referenced.
 +
> >
 +
> > Is there an idiom for removing old defunct references from the mrml
 +
> > scene when vtkSetReferenceStringMacro is used?  Is there a better
 +
> > solution?
 +
> >
 +
> > Best,
 +
> > Brad
 +
> > 
 +
</pre>
  
 
</div>
 
</div>
 
  
 
===References===
 
===References===

Latest revision as of 18:40, 1 February 2008

Home < 2008 Winter Project Week:MRMLScenesForExecutionModel


Key Investigators

  • GE: Jim Miller
  • Kitware: Brad Davis
  • BWH: Nicole Aucoin
  • Isomics: Alex Yarmarkovich, Steve Pieper


Objective

Integrate MRML Scenes into Execution Model modules.

Approach, Plan

Goal: pass MRML scenes and subscenes back and forth between Slicer3 and command line executables/plug-ins.

Requirements/Design: MRML scenes are currently used as wrappers to pass transforms and model hierarchy nodes to command line executables/plug-ins. Does this infrastructure need to be expanded to support other node types? Or is a separate mechanism needed to pass complete scenes?

Concerns: Id remapping is major concern when passing scenes. A second concern is how to indicate that a subscene is to be replaced. MRML manipulation routines may have to be added to libMRML as opposed to being spread through the Slicer code base.

Progress

Jun 2007 Project Week

MRML Scenes for the Execution Model including Transforms

Jan 2008 Project Half Week

A productive discussion led to a strategy for handling reference handling wich was subsequently implemented and checked in to slicer. See email exchange below.



Hi Brad,

I have changed vtkSetReferenceStringMacro so that it removes old 
references from the reference cache on the scene. Please let me know it 
fixed the problems that you were having.

Alex

Brad Davis wrote:
> > Hi Alex and other MRML gurus,
> >
> > I'm having some problems with the MRML functionality and I wonder if
> > you can help.
> >
> > Suppose that I start with a mrml ReferencingNode, which references
> > OldReferencedNode.
> >
> > Now I use vtkSetReferenceStringMacro to change the reference from
> > OldReferencedNode to NewReferencedNode.
> >
> > This adds entries in vtkMRMLScene::ReferencingNodes and
> > vtkMRMLScene::ReferencedIDs.  However, it does not remove the entry
> > that associates ReferencingNode and OldReferencedNode.
> >
> > Now, when I use vtkMRMLScene::GetReferencedNodes(ReferencingNode) both
> > ReferencedNode and OldReferencedNode are added to the collection.  But
> > I didn't want OldReferencedNode since it is no longer referenced.
> >
> > Is there an idiom for removing old defunct references from the mrml
> > scene when vtkSetReferenceStringMacro is used?  Is there a better
> > solution?
> >
> > Best,
> > Brad
> >   

References