Skip to main content
Skip table of contents

XNAT OHIF Plugin API

 /xapi/viewer endpoints

These endpoints are used to generate or validate the existence of JSON metadata that enables image viewing. Note: Using a GET request to generate and cache missing metadata allows a user with READ only permissions to a session can view a session without the need for admin/owner/member intervention.

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

Returns 200 if JSON metadata exists for the specified session.

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

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

CODE
POST /xapi/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 /xapi/viewer/projects/{projectId}

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

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

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

CODE
POST /xapi/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.

/xapi/ohifaiaa endpoints

These endpoints are used to configure settings for an attached NVIDIA AIAA server. See XNAT OHIF Plugin Installation and Administration for server installation instructions. 

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

Returns the AIAA server JSON for the specified project ID.

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

Sets the AIAA server JSON for the specified project.

CODE
GET /xapi/ohifaiaa/servers

Returns the AIAA server JSON for the site.

CODE
PUT /xapi/ohifaiaa/servers

Sets the AIAA server JSON for the site.

/xapi/ohifroicolor endpoints

Used to get and set a custom project-specific color scheme for ROIs

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"
  }
]

/xapi/viewerConfig endpoints

Used to get or set project-specific customizations on viewer behavior. 

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]
  }
]

Viewer DICOMWeb API

JavaScript errors detected

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

If this problem persists, please contact our support.