What's the best approach to saving additional data associated with a module?

If your json is more than a few hundred characters then it may be more appropriate to store it in a slicer.vtkMRMLTextNode:

  • You have the option to save the text in a separate file (so that you can view/edit more easily in external software).
  • There is a separate TextModifiedEvent for indicating text content modifications
  • “Texts” module has a small text editor
  • You can show/edit the content of the text node in your module using slicer.qMRMLTextWidget

You can keep using the scripted module node for other parameters and add a node reference to the text node to store the json text.

1 Like