Skip to main content
Skip table of contents

XNAT OHIF Plugin API

REST XAPI

The /viewer XAPI has these end points:


CODE
GET /viewer/projects/{projectId}/experiments/{experimentId}/exists

Returns 200 if JSON metadata exists for the specified session.


CODE
GET /viewer/projects/{projectId}/experiments/{experimentId}

Returns cached JSON metadata for the specified session or generates it if it doesn't exist.


CODE
POST /viewer/generate-all-metadata

Admin only command to rebuild all JSON metadata on the entire XNAT instance. This operation may take a long time if used on an instance with a large number of sessions.

CODE
POST /viewer/projects/{projectId}

Admin only command to regenerate JSON metadata for all sessions in the specified project.

CODE
POST /viewer/projects/{projectId}/subjects/{subjectId}

Admin only command to regenerate JSON metadata for all sessions in the specified subject.

CODE
POST /viewer/projects/{projectId}/experiments/{experimentId}

Admin only command to regenerate JSON metadata for the specified session. A tool used if automation is down for any reason.

Missing JSON being generated and cached in the GET request means a user with READ only permissions to a session can view a session without the need for admin/owner/member intervention.


The /ohifaiaa XAPI has these end points:


CODE
GET /ohifaiaa/projects/{projectId}/servers

Returns the AIAA server JSON for the specified project ID.


CODE
PUT /ohifaiaa/projects/{projectId}/servers

Sets the AIAA server JSON for the specified project.


CODE
GET /ohifaiaa/servers

Returns the AIAA server JSON for the site.


CODE
PUT /ohifaiaa/servers

Sets the AIAA server JSON for the site.



The /ohifroicolor XAPI has these end points:


CODE
GET /ohifroicolor/projects/{projectId}/roicolor

Returns the ROI Colors JSON for the specified project ID.


CODE
PUT /ohifroicolor/projects/{projectId}/roicolor

Sets the ROI Colors JSON for the specified project. Use a list of JSON objects with each item defining both ROI label and color values. The color should be specified with a comma-separated list of three numeric values (ranging from 0 to 255). Example:

Example

CODE
[
  {
    "label": "Kidney (Right)",
    "color": "0, 204, 0"
  },
  {
    "label": "Kidney (Left)",
    "color": "255, 51, 51"
  },
  {
    "label": "liver",
    "color": "255, 255, 51"
  }
]

The /viewerConfig XAPI serves the following end points:


CODE
GET /viewerConfig/projects/{projectId}/roipreset

Returns the ROI Presets for the specified project and ROI type.

Valid ROI types: AIM (for contour-based ROIs), SEG (for mask-based ROIs), and MEAS (for measurement annotation ROIs).

Example output.

Example

CODE
{
  "MEAS": [
    {
      "color": [0,0,0],
      "label": "Arm (L)"
    },
    {
      "color": [0,0,0],
      "label": "Arm (R)"
    },
    {
      "color": [0,0,0],
      "label": "Head"
    },
    {
      "color": [0,0,0],
      "label": "Muscle"
    }
  ]
}



CODE
PUT /viewerConfig/projects/{projectId}/roipreset

Sets the ROI Presets for the specified project and ROI type. Use a list of JSON objects with each item defining both ROI label and color values. The color is optional. If the color array was not provided, black color ([0,0,0]) is set by default. Presets with duplicated label values will not be stored.

Example

CODE
[
  {
    "label": "Kidney (Right)",
    "color": [0, 204, 0]
  },
  {
    "label": "liver",
    "color": [255, 255, 51]
  }
]
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.