Edit this page

NA-MIC Project Weeks

Back to Projects List

JSON based scene file format

Key Investigators

Project Description

Overview

The primary objective of this feature is to introduce support for JSON format to enable writing and reading the full MRML scene file and its nodes. This serves as preparatory work for:

  1. Supporting a more structured format for the MRML file with explicit datatypes.
  2. Providing APIs in Slicer to facilitate collaborative features, such as retrieving and updating the status of individual nodes.

With this setup, we would start a first step for future adoption and compatibility with standards like OpenUSD and real-time collaborative toolkits (e.g. Omniverse). For example, having MRML structured in JSON will make it much easier to convert nodes to OpenUSD.


Implemented Features

Objective

  1. Get feedback on the current preliminary implementation PR and work a final design for the JSON based node status/scene file format.
  2. Discuss real-time collaboration toolkits for medical application (e.g. Omniverse)

Approach and Plan

  1. Have a meeting/demo with people interested for colletting feedback.
  2. Work on the final design of the JSON based node status/scene file format.

Progress and Next Steps

Progress

XML JSON

Next Steps

  1. When calling WriteJSONToString for nodes with a storageNode, we need to stringify certain parts of the node state information (for the single Node Status - real-time collaboration use case).
    • Markups use vtkMRMLMarkupsJsonStorageNode, which already utilizes the JSON format. However, the current infrastructure only allows saving this information to a file. We need to refactor vtkMRMLMarkupsNode and vtkMRMLMarkupsJsonStorageNode to use vtkMRMLMarkupsJsonWriter for stringifying to a stream instead of a file, enabling access to its methods from Python.
    • Transforms use vtkMRMLTransformStorageNode -> itk::TransformFileWriter has the the same issue of the Markups writer. We would need to refactor at the vtkMRMLNode level to be able to switch between writing to file and to a stream.
    • Volumes/Segmentations/Models: For now, storing the file location should suffice, but in the future, we may need to pass imageData as a blob.
  2. Add automated tests to cover all MRML nodes in Slicer core/modules.
  3. Investigate each feedback point gathered during the Tuesday meeting.

Background and References

PR