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.
GET /xapi/viewer/projects/{projectId}/experiments/{experimentId}/exists
Returns 200 if JSON metadata exists for the specified session.
GET /xapi/viewer/projects/{projectId}/experiments/{experimentId}
Returns cached JSON metadata for the specified session or generates it if it doesn't exist.
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.
POST /xapi/viewer/projects/{projectId}
Admin-only command to regenerate JSON metadata for all sessions in the specified project.
POST /xapi/viewer/projects/{projectId}/subjects/{subjectId}
Admin-only command to regenerate JSON metadata for all sessions in the specified subject.
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.
GET /xapi/ohifaiaa/projects/{projectId}/servers
Returns the AIAA server JSON for the specified project ID.
PUT /xapi/ohifaiaa/projects/{projectId}/servers
Sets the AIAA server JSON for the specified project.
GET /xapi/ohifaiaa/servers
Returns the AIAA server JSON for the site.
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
GET /ohifroicolor/projects/{projectId}/roicolor
Returns the ROI Colors JSON for the specified project ID.
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
[
{
"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.
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
{
"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"
}
]
}
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
[
{
"label": "Kidney (Right)",
"color": [0, 204, 0]
},
{
"label": "liver",
"color": [255, 255, 51]
}
]