...
Experiment Assessors such as a Manual QC performed on an Image Session are also experiments in their own right. As such, the Experiment Management API applies in many cases to assessors as well. In fact, assessors show up alongside other image sessions and experiments in a "Get All Experiments" API call. However, there are custom API calls related to managing an assessor in relationship to the image session it relates to. There are also custom behaviors as related to assessors that result from pipeline executions.
...
Code Block |
---|
GET - /data/experiments/{session-id}/assessors GET - /data/projects/{project-id}/subjects/{subject-id | subject-label}/experiments/{session-id | session-label}/assessors |
Parameters
{session-id} or {session-label} | Required path parameter. session-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
|
columns | Optional querystring parameter, specifying specific columns via Experiment Data REST XML Path Shortcuts. Always included:
Included by default if no columns are specified:
|
date | Optional querystring parameter – can be used to restrict the search to a single date or a date range. The date must be formatted as MM/DD/YYYY. Example:
|
{param} | Optional querystring parameter – can be used to restrict the search by any string parameter listed in Image Assessor Data REST XML Path Shortcuts, using a wildcard string search. Example:
|
Response
Code Block |
---|
{ "ResultSet": { "Result": [ { "date": "date", "insert_date": "datetime", "ID": "string {assessor-id}", "label": "string {assessor-label}", "project": "string", "session_ID": "string {session-id}", "session_label": "string {session-label}", "URI": "/data/experiments/{assessor-id}" "xnat:imageassessordata/id": "string {assessor-id}", "xsiType": "xsiType", }, ... ], "totalRecords": "integer" } } |
...
Code Block |
---|
GET - /data/experiments/{session-id}/assessors/{assessor-id} GET - /data/projects/{project-id}/subjects/{subject-id | subject-label}/experiments/{session-id | session-label}/assessors/{assessor-id | assessor-label} |
Parameters
{assessor-id} or {assessor-label} | Required path parameter. assessor-label is a project-specific field and can only be used if project-id is also specified |
---|---|
{session-id} or {session-label} | Required path parameter. session-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
|
Response
Each assessor's data response will have a unique set of parameters. Here is an example Manual QC, represented in JSON. A QC is performed on one or more scans of the parent image session, hence the assessor object also contains a "scans/scan" object. Note that there is a "Pass" parameter for each scan, and another "Pass" parameter for the overall assessor.
...
Code Block |
---|
POST - /data/experiments/{session-id}/assessors POST - /data/projects/{project-id}/subjects/{subject-id | subject-label}/experiments/{session-id | session-label}/assessors |
Parameters
{session-id} or {session-label} | Required path parameter session-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 |
file | Required file to be submitted in the body of the request. XML is the most reliable format. |
inbody=true | Optional querystring parameter. Use if the file is being submitted in the body of the request, rather than as part of multi-part form data. |
Response Codes
201 | Created |
---|---|
403 | Permission Denied – User does not have permission to create data in this project |
404 | Not Found – Project ID not recognized |
417 | Expectation Failed – No xsiType parameter was specified, XNAT cannot parse the assessor data |
422 | Unprocessable Entity – Unknown xsiType parameter was specified, XNAT cannot parse the assessor data |
Response Format
On 201 - Success, the response is a simple string of the new experiment's accession ID. For example:
...
Modify An Existing Image Assessor
It is possible to modify select experiment metadata by performing a PUT to this URI without a file attached, by specifying Image Assessor Data REST XML Path Shortcuts as params. However, there are so few of these fields that can be modified in this manner that a more reliable method is to simply PUT a new XML definition file in place of the original.
Code Block |
---|
PUT - /data/experiments/{session-id}/assessors/{assessor-id} PUT - /data/projects/{project-id}/subjects/{subject-id | subject-label}/experiments/{session-id | session-label}/assessors/{assessor-id | assessor-label} |
Parameters
{assessor-id} or {assessor-label} | Required path parameter assessor-label is a project-specific field and can only be used if project-id is also specified |
---|---|
{session-id} or {session-label} | Required path parameter session-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 |
file | Required file to be submitted in the body of the request. XML is the most reliable format. |
inbody=true | Optional querystring parameter. Use if the file is being submitted in the body of the request, rather than as part of multi-part form data. |
... (sharing)
Delete (Or Unshare) An Image Assessor
Performing this call in a project that owns an image assessor record will permanently delete the experiment data from your project and your XNAT archive.
Performing this call in a project that this assessor has been shared into will simply delete the sharing relationship – no data will be deleted from your XNAT archive, it will simply be removed from this project.
Code Block |
---|
DELETE - /data/experiments/{session-id}/assessors/{assessor-id} DELETE - /data/projects/{project-id}/subjects/{subject-id | subject-label}/experiments/{session-id | session-label}/assessors/{assessor-id | assessor-label} |
Parameters
{assessor-id} or {assessor-label} | Required path parameter assessor-label is a project-specific field and can only be used if project-id is also specified |
---|---|
{session-id} or {session-label} | Required path parameter session-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 |