2007 Project Week MIT MRML Scenes for the Execution Model

From NAMIC Wiki
Jump to: navigation, search
Home < 2007 Project Week MIT MRML Scenes for the Execution Model

Strawman Plan

  • MRML
    • virtual method on each node GetReferencedNodes() returns a list of nodes (e.g. model node returns display node, storage node, transform node)
      [Jim]
      Is this a list of nodes or list of node ids?
      Referenced nodes are managed in an ad hoc manner. We could have a map of reference ids. Key would be a string for the name of the reference, for instance "TransformNodeID". Value would be a string for the id. This would allow the GetReferencedNodes() method to be written abstractly on the container of reference ids rather than having to be implemented in node that adds a reference id to the hierarchy.
    • [Steve]: yes, a list of ids.
    • [Steve]: I like the container idea - each node needs to have a custom set of referenced nodes, but keeping them in a standard container type might also allow us to handle the observer/event management more consistently.
    • method in MRMLScene GetSubscene(nodeList) returns list all the nodes referenced by all the nodes in the list (recursively searches)
  • CommandLineModule
    • need a way in XML to say that a module is 'mrml aware' -- call them mrmlCLIs
    • when nodes are selected as args to a mrmlCLI
      • need to create a subscene containing all the selected nodes and referenced nodes (use GetSubscene)
      • need to pass mrml ids for arguments rather than filenames
      • need to write the subscene to temp space, along with any volumes or models that aren't saved (needs to use the storage nodes) and pass that as argument to mrmlCLI
    • needs to import the resulting mrml scene written by mrmlCLI back into Slicer3's scene

Example Scenario

  1. User reads grayscale
  2. Creates labelmap with Editor or Segmenter (label volume is not yeat saved)
  3. User enters ModelMaker and selects label map as input and hits Apply
    1. a temp mrml scene is created with
      1. label map volume node
      2. volume display node (ref'd by volume)
      3. color node (ref'd by display)
      4. possibly a transform node (ref'd by volume)
      5. possibly more transform nodes (ref'd by transform nodes)
      6. volume storage node (created by CommandLineModule to point to temp storage of label map)
    2. model maker is invoked with arguments for:
      1. the temp mrml scene
      2. id of the input volume
      3. parameters
    3. model maker
      1. reads mrml scene
      2. pulls out needed info (e.g. label names for each model it makes)
      3. builds the models
      4. puts output into mrml scene that it saves out
    4. CommandLineModule
      1. imports mrml scene file in to current slicer scene

Other Issues

  • Model maker may use mrml scene hierarchy nodes to group the output together so all models from a given build can be deleted as a group.
  • We will want to find a way to tell Slicer that the newly created models should have the same transform ID as the source volume (this is complicated because the current scene import will try to give each node a unique ID, so it may not be possible for the scene written by the mrmlCLI to point to nodes in the Slicer3 mrml scene).