Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Contents

Related

  • Experiment Resource API


Get All Experiments In XNAT

This API call is essentially a search of one or more data types, and is formatted to return a table of results.

GET - /data/experiments

Parameters

format

Optional querystring parameter

  • json (default)
  • xml
  • html
  • csv
columns

Optional querystring parameter, specifying specific columns via Experiment Data REST XML Path Shortcuts.

Always included:

  • ID
  • URI

Included by default if no columns are specified:

  • date
  • insert_date
  • label
  • project
  • xsiType
xsiType

Optional querystring parameter – can be used to restrict the search to one XNAT data type. The xsiType must match the data type's XSD label.

Example:

  • ?xsiType=xnat:mrSessionData

Response

{
  "ResultSet": {
    "Result": [
      {
        "date": "",
        "xsiType": "xnat:mrSessionData",
        "insert_date": "datetime",
        "project": "string {project-id}",
        "ID": "string {experiment-id}",
        "label": "string {experiment-label}",
        "URI": "path"
      },
      ...
    ],
    "totalRecords": "integer",
    "title": "Matching experiments"
  }
}


Get All Experiments In A Project

This API call is essentially a search of one or more data types, and is formatted to return a table of results.

This API call only returns experiments that are subject assessors (i.e. image sessions, clinical examinations), not experiment assessors (i.e. QC assessors, Freesurfer outputs)


GET - /data/projects/{project-id}/experiments

Parameters

{project-id}Required path parameter
format

Optional querystring parameter

  • json (default)
  • xml
  • html
  • csv
columns

Optional querystring parameter, specifying specific columns via Experiment Data REST XML Path Shortcuts.

Always included:

  • ID
  • URI

Included by default if no columns are specified:

  • date
  • insert_date
  • label
  • project
  • xsiType
xsiType

Optional querystring parameter – can be used to restrict the search to one XNAT data type. The xsiType must match the data type's XSD label.

Example:

  • ?xsiType=xnat:mrSessionData

Response

{
  "ResultSet": {
    "Result": [
      {
        "date": "",
        "subject_label": "string",
        "insert_date": "datetime",
        "project": "string {project-id}",
        "ID": "string {experiment-id}",
        "label": "string {experiment-label}",
        "URI": "path"
      },
      ...
    ],
    "totalRecords": "integer",
    "title": "Matching experiments"
  }
}

Get A Single Experiment Record

This API call returns a much more detailed experiment record, including child data that is owned by the experiment, including scans and assessors

GET - /data/experiments/{experiment-id}
GET - /data/projects/{project-id}/experiments/{experiment-label | experiment-id}
GET - /data/projects/{project-id}/subjects/{subject-label | subject-id}/experiments/{experiment-label | experiment-id}

Parameters

{experiment-id} or {experiment-label}

Required path parameter.

experiment-label is a project-specific field and can only be used if project-id is also specified

{subject-id} or {subject-label}

Optional (but common) path parameter.

subject-label is a project-specific field and can only be used if project-id is also specified


{project-id}Optional (but common) path parameter
format

Optional querystring parameter

  • xml (default)
  • html
  • json
  • csv

Response

Example of a JSON output on a query of an image session

{
  "items": [
    {
      "children": [
        {
          "field": "assessors/assessor",
          "items": [ ... ]
        },
        {
          "field": "scans/scan",
          "items": [ ... ]
        }
      ],
      "meta": {
        "create_event_id": integer,
        "xsi:type": "xnat:mrSessionData",
        "isHistory": boolean,
        "start_date": "UTC datetime"
      },
      "data_fields": {
        "acquisition_site": "string",
        "date": "{YYYY-MM-DD}",
        "dcmAccessionNumber": ".",
        "dcmPatientBirthDate": "{YYYY-MM-DD}",
        "dcmPatientId": "string {experiment-label}",
        "dcmPatientName": "string {subject-label}",
        "fieldStrength": "float",
        "ID": "string {experiment-id}",
        "id": "string {experiment-id}",
        "label": "string {experiment-label}",
        "modality": "MR",
        "prearchivePath": "path",
        "project": "string",
        "scanner": "string",
        "scanner/model": "string",
        "scanner/manufacturer": "string",
        "subject_ID": "string {subject-id}",
        "session_type": "string {project-id}",
        "time": "{HH:MM:SS}",
        "UID": "string"
      }
    }
  ]
}



Create A New Experiment

Use this call to create a new experiment record in a project, where the specified experiment label is not already in use.

PUT - /data/projects/{project-id}/subjects/{subject-id | subject-label}/experiments/{experiment-label}


  • No labels