Difference between revisions of "Documentation/Labs/ParameterSerializer"

From Slicer Wiki
Jump to: navigation, search
 
Line 37: Line 37:
  
 
=== TODO ===
 
=== TODO ===
 +
 +
* Build JsonCpp in Slicer
 +
** Branch for improving JsonCpp support in [https://github.com/Slicer/SlicerExecutionModel Slicer Execution Model]
 +
** Branch for being able to build & package Slicer with JsonCpp.
 +
[DONE, see r25335, r25336 and r25337]
 +
* Build Parameter Serializer in Slicer
 +
[DONE, see r25335, r25336 and r25337]
  
 
* Make CLI storable in Json files
 
* Make CLI storable in Json files

Latest revision as of 18:38, 9 September 2016

Home < Documentation < Labs < ParameterSerializer

Overview

This page gathers the information regarding the integration of the Parameter Serializer.

Limitations of the current infrastructure

  • The only way to serialize CLIs is through the MRML scene, it's hard to save the configuration of just one CLI.
  • When running a CLI with the command line, you have to specify all the arguments that are not default. It would be nice to be able to use a file instead.

Proposed improvements

By adding support for the Parameter Serializer users would be able to save(/load) their CLI configuration to(/from) a JSON file. That would be applicable both for using CLI through the command line and for using CLIs in the Slicer application. That serialization should also mesh well with the python infrastructure.

Example of a Json file obtained from the Gaussian Blur Filter:

 {
  "Parameters" : 
   {
    "IO" : 
     {
      "inputVolume" : "W:/Slicer/Data/MRHead.nrrd",
      "outputVolume" : "W:/Slicer/Data/MRHead-blurred.nrrd",
      "sigma" : 1
     }
    }
 }


Plan of integration

What already exists

TODO

  • Build JsonCpp in Slicer
    • Branch for improving JsonCpp support in Slicer Execution Model
    • Branch for being able to build & package Slicer with JsonCpp.

[DONE, see r25335, r25336 and r25337]

  • Build Parameter Serializer in Slicer

[DONE, see r25335, r25336 and r25337]

  • Make CLI storable in Json files
    • Make the vtkMRMLCommandLineModuleNode a vtkMRMLStorableNode
    • Implement vtkMRMLCommandLineModuleStorageNode
  • Make Python module storable in Json files
    • Make the vtkMRMLScriptedNode a vtkMRMLStorableNode
    • Implement vtkMRMLScriptedStorageNode to save the parameter node like a CLI node.