Documentation/Labs/ParameterSerializer

From Slicer Wiki
Jump to: navigation, search
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

  • 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.