Event Triggers
Events are triggered internally by a subset of Create, Update, and Delete operations on XNAT datatypes. Click here for a detailed review of the XNAT data model.
Supported Events and corresponding sample payloads are listed below. Upon Event trigger, these payloads can be used to detect specific events of interest using a Subscription Payload Filter. See the Payload Capture section to generate a serialized payload specific to your event object.
Project Created or Deleted
These events are triggered upon new project creation and deletion. The event payload has the same structure for both operations.
Sample Project Create Event payload
{
"id": "Fruit_Struct",
"label": "Fruit_Struct",
"xsiType": "xnat:projectData",
"uri": "/archive/projects/Fruit_Struct",
"resources": [],
"subjects": [],
"directory": "/data/xnat/archive/Fruit_Struct/arc001",
"title": "Fruit_Struct",
"accessibility": "private",
"aliases": [],
"investigators": [],
"project-assets": [],
"running-title": "Fruit_Struct"
}
Sample Project Delete Event payload
{
"id": "Fruit_Struct",
"label": "Fruit and Vegetable Internal Structure (MRI) study",
"xsiType": "xnat:projectData",
"uri": "/archive/projects/Fruit_Struct",
"directory": "/data/xnat/archive/Fruit_Struct/arc001",
"title": "Fruit and Vegetable Internal Structure (MRI) study",
"description": "This project contains MRI imaging data of various fruits and vegetables to study their internal structure before being exposed to sunlight.",
"keywords": "MRI MR Fruit Vegetable Structure",
"accessibility": "private",
"aliases": [],
"pi": {
"type": "Investigator",
"label": "Plum_Honeycombe",
"firstname": "Plum",
"lastname": "Honeycombe",
"primaryProjects": [],
"investigatorProjects": [],
"xsitype": "xnat:investigatorData"
},
"investigators": [],
"running-title": "Fruit/Vegetable Structure"
}
Note the inclusion of several additional key-value pairs in the Project Delete Event payload, corresponding to properties that were added to the project after its initial creation.
Subject Created or Deleted
These events are triggered upon new subject creation and deletion.
Sample Subject Created Event payload
{
"id": "XNAT_S00010",
"label": "Macaroni",
"xsiType": "xnat:subjectData",
"uri": "/archive/subjects/XNAT_S00010",
"sessions": [],
"resources": [],
"project-id": "Cat_Imaging"
}
Subject Assessor Created or Deleted
These events are triggered upon new subject assessor creation and deletion. Although imaging sessions are the most common type of subject assessor, there are others that may be of interest, e.g. NIH Stroke Scale assessor listed below.
Sample Subject Assessor (NIH Stroke Scale) Event Payload
{
"id": "XNAT_E00008",
"label": "12345",
"xsiType": "xnatx:nihStrokeScaleData",
"uri": "/archive/experiments/XNAT_E00008",
"resources": [],
"directory": "/data/xnat/archive/test/arc001/12345/",
"project-id": "test",
"subject-id": "XNAT_S00016"
}
Session Created or Deleted
These events are triggered upon new imaging session creation and deletion. Although imaging sessions are a type of subject assessor, imaging session events are common enough to warrant their own event type.
If an imaging session contains scans, scan creation events are triggered separately for each of the scans.
{
"id": "XNAT_E00010",
"label": "Cooper_MR",
"xsiType": "xnat:mrSessionData",
"uri": "/archive/experiments/XNAT_E00010",
"scans": [
{
"type": "Scan",
"id": "0",
"label": "0 - Cat_Scan",
"xsiType": "xnat:mrScanData",
"uri": "/archive/experiments/XNAT_E00010/scans/0",
"resources": [
{
"type": "Resource",
"id": "DICOM",
"label": "DICOM",
"xsiType": "xnat:resourceCatalog",
"uri": "/archive/experiments/XNAT_E00010/scans/0/resources/DICOM",
"directory": "/data/xnat/archive/Cat_Imaging/arc001/Cooper_MR/SCANS/0/DICOM",
"files": [
{
"type": "File",
"label": "Cooper_MR_0.dcm",
"uri": "/archive/experiments/XNAT_E00010/scans/0/resources/DICOM/files/Cooper_MR_0.dcm",
"name": "Cooper_MR_0.dcm",
"path": "/data/xnat/archive/Cat_Imaging/arc001/Cooper_MR/SCANS/0/DICOM/Cooper_MR_0.dcm",
"tags": [""],
"format": "DICOM",
"content": "DICOM",
"size": 7078898,
"checksum": "73467857280c0257b6f315dcde7a65ff"
}
],
"integer-id": 17,
}
],
"directory": "/data/xnat/archive/Cat_Imaging/arc001/Cooper_MR/SCANS/0",
"frames": 1,
"modality": "MR",
"quality": "usable",
"uid": "1.2.276.0.7230010.3.1.3.1194068452.6760.1503945144.214",
"integer-id": 14,
"scan-type": "Cat_Scan",
"session-id": "XNAT_E00010",
"series-description": "Cat_Scan"
}
],
"assessors": [],
"resources": [],
"directory": "/data/xnat/archive/Cat_Imaging/arc001/Cooper_MR/",
"project-id": "Cat_Imaging",
"subject-id": "XNAT_S00007",
"modalities-in-study": ["MR"]
}
Scan Created
This event is triggered upon scan creation. Scans can be created along with a new session or by updating an existing imaging session. Either of these creation methods will trigger a scan event for each new scan object created.
{
"id": "4",
"label": "4 - t1_mpr_1mm_p2_pos50",
"xsiType": "xnat:mrScanData",
"uri": "/archive/experiments/XNAT6_E00030/scans/4",
"resources": [
{
"type": "Resource",
"id": "DICOM",
"label": "DICOM",
"xsiType": "xnat:resourceCatalog",
"uri": "/archive/experiments/XNAT6_E00030/scans/4/resources/DICOM",
"directory": "/data/xnat/archive/Fruit_Struct/arc001/Grape_MR1/SCANS/4/DICOM",
"files": [
{
"type": "File",
"label": "1.MR.head_DHead.4.175.20061214.091206.156000.1443018602.dcm",
"uri": "/archive/experiments/XNAT6_E00030/scans/4/resources/DICOM/files/1.MR.head_DHead.4.175.20061214.091206.156000.1443018602.dcm",
"name": "1.MR.head_DHead.4.175.20061214.091206.156000.1443018602.dcm",
"path": "/data/xnat/archive/Fruit_Struct/arc001/Grape_MR1/SCANS/4/DICOM/1.MR.head_DHead.4.175.20061214.091206.156000.1443018602.dcm",
"tags": [""],
"format": "DICOM",
"content": "DICOM",
"size": 192288,
"checksum": "75f93a65a29497f2736593911822e8e9"
},
{
"type": "File",
"label": "1.MR.head_DHead.4.30.20061214.091206.156000.1724218095.dcm",
"uri": "/archive/experiments/XNAT6_E00030/scans/4/resources/DICOM/files/1.MR.head_DHead.4.30.20061214.091206.156000.1724218095.dcm",
"name": "1.MR.head_DHead.4.30.20061214.091206.156000.1724218095.dcm",
"path": "/data/xnat/archive/Fruit_Struct/arc001/Grape_MR1/SCANS/4/DICOM/1.MR.head_DHead.4.30.20061214.091206.156000.1724218095.dcm",
"tags": [""],
"format": "DICOM",
"content": "DICOM",
"size": 192290,
"checksum": "47cc978a9b155712a4d06519d3accc23"
},
...
{
"type": "File",
"label": "1.MR.head_DHead.4.164.20061214.091206.156000.9685918580.dcm",
"uri": "/archive/experiments/XNAT6_E00030/scans/4/resources/DICOM/files/1.MR.head_DHead.4.164.20061214.091206.156000.9685918580.dcm",
"name": "1.MR.head_DHead.4.164.20061214.091206.156000.9685918580.dcm",
"path": "/data/xnat/archive/Fruit_Struct/arc001/Grape_MR1/SCANS/4/DICOM/1.MR.head_DHead.4.164.20061214.091206.156000.9685918580.dcm",
"tags": [""],
"format": "DICOM",
"content": "DICOM",
"size": 192286,
"checksum": "211b2b227981fd8615a07ca69dc52e7a"
}
],
"integer-id": 90
}
],
"directory": "/data/xnat/archive/Fruit_Struct/arc001/Grape_MR1/SCANS/4",
"frames": 176,
"modality": "MR",
"quality": "usable",
"scanner": "MEDPC",
"uid": "1.3.12.2.1107.5.2.32.35177.3.2006121409284535196417894.0.0.0",
"integer-id": 75,
"scan-type": "t1_mpr_1mm_p2_pos50",
"project-id": "Fruit_Struct",
"session-id": "XNAT6_E00030",
"scanner-manufacturer": "SIEMENS",
"scanner-model": "TrioTim",
"series-description": "t1_mpr_1mm_p2_pos50",
"start-time": "09:37:11"
}
Scan Resource Created
The Resource Created event is triggered upon resource folder creation under a scan. Note that a Resource Created Event is not triggered if the resource is created as part of a new scan or session archive.
{
"id": "SCAN_RESOURCE",
"label": "SCAN_RESOURCE",
"xsiType": "xnat:resourceCatalog",
"uri": "/data/xnat/archive/test/arc001/RT001_MR_Pre/SCANS/1/SCAN_RESOURCE/1_catalog.xml",
"directory": "/data/xnat/archive/test/arc001/RT001_MR_Pre/SCANS/1/SCAN_RESOURCE",
"files": [],
"integer-id": 34
}
Project/Subject/Session/Scan Resource Updated
The Resource Updated event is triggered upon changes to the content of a resource folder. Resource folders can be associated with scans, sessions, subjects, or projects. Although the xsiType
is the same for this event regardless of the Resource parent type, directory
and uri
strings indicate the specific location of a resource.
Scan resource updated with notes.txt
file
{
"id": "SCAN_RESOURCE",
"label": "SCAN_RESOURCE",
"xsiType": "xnat:resourceCatalog",
"uri": "/data/xnat/archive/test/arc001/RT001_MR_Pre/SCANS/1/SCAN_RESOURCE/1_catalog.xml",
"directory": "/data/xnat/archive/test/arc001/RT001_MR_Pre/SCANS/1/SCAN_RESOURCE",
"files": [
{
"type": "File",
"label": "notes.txt",
"uri": "/data/xnat/archive/test/arc001/RT001_MR_Pre/SCANS/1/SCAN_RESOURCE/1_catalog.xml/files/notes.txt",
"name": "notes.txt",
"path": "/data/xnat/archive/test/arc001/RT001_MR_Pre/SCANS/1/SCAN_RESOURCE/notes.txt",
"tags": [""],
"size": 747,
"checksum": "8486651ec83a7f0a030ccd4a90c84b32"
}
],
"integer-id": 34
}
Session resource updated with notes.txt
file
{
"id": "SESSION_RESOURCE",
"label": "SESSION_RESOURCE",
"xsiType": "xnat:resourceCatalog",
"uri": "/data/xnat/archive/test/arc001/RT001_MR_Pre/RESOURCES/SESSION_RESOURCE/SESSION_RESOURCE_catalog.xml",
"directory": "/data/xnat/archive/test/arc001/RT001_MR_Pre/RESOURCES/SESSION_RESOURCE",
"files": [
{
"type": "File",
"label": "notes.txt",
"uri": "/data/xnat/archive/test/arc001/RT001_MR_Pre/RESOURCES/SESSION_RESOURCE/SESSION_RESOURCE_catalog.xml/files/notes.txt",
"name": "notes.txt",
"path": "/data/xnat/archive/test/arc001/RT001_MR_Pre/RESOURCES/SESSION_RESOURCE/notes.txt",
"tags": [""],
"size": 747,
"checksum": "8486651ec83a7f0a030ccd4a90c84b32"
}
],
"integer-id": 33
}
Subject resource updated with notes.txt
file
{
"id": "SUBJ_RESOURCE",
"label": "SUBJ_RESOURCE",
"xsiType": "xnat:resourceCatalog",
"uri": "/data/xnat/archive/test/subjects/RT001/SUBJ_RESOURCE/SUBJ_RESOURCE_catalog.xml",
"directory": "/data/xnat/archive/test/subjects/RT001/SUBJ_RESOURCE",
"files": [
{
"type": "File",
"label": "notes.txt",
"uri": "/data/xnat/archive/test/subjects/RT001/SUBJ_RESOURCE/SUBJ_RESOURCE_catalog.xml/files/notes.txt",
"name": "notes.txt",
"path": "/data/xnat/archive/test/subjects/RT001/SUBJ_RESOURCE/notes.txt",
"tags": [""],
"size": 747,
"checksum": "8486651ec83a7f0a030ccd4a90c84b32"
}
],
"integer-id": 32
}
Project resource updated with notes.txt
file
{
"id": "PROJECT_RESOURCE",
"label": "PROJECT_RESOURCE",
"xsiType": "xnat:resourceCatalog",
"uri": "/data/xnat/archive/test/resources/PROJECT_RESOURCE/PROJECT_RESOURCE_catalog.xml",
"directory": "/data/xnat/archive/test/resources/PROJECT_RESOURCE",
"files": [
{
"type": "File",
"label": "notes.txt",
"uri": "/data/xnat/archive/test/resources/PROJECT_RESOURCE/PROJECT_RESOURCE_catalog.xml/files/notes.txt",
"name": "notes.txt",
"path": "/data/xnat/archive/test/resources/PROJECT_RESOURCE/notes.txt",
"tags": [""],
"size": 747,
"checksum": "8486651ec83a7f0a030ccd4a90c84b32"
}
],
"integer-id": 31
}
Image Assessor Created or Deleted
These events are triggered upon image assessor creation and deletion. The sample below shows the payload for an ROI Collection type assessor created by the OHIF Viewer when exporting ROI Contours to XNAT.
Sample Image Assessor Event payload
{
"id": "RoiCollection_hkytpXX_8Q2Q5fVphjp",
"label": "AIM_20210205_153707",
"xsiType": "icr:roiCollectionData",
"uri": "/experiments/XNAT_E00009/assessors/RoiCollection_hkytpXX_8Q2Q5fVphjp",
"resources": [],
"project-id": "Cat_Imaging",
"session-id": "XNAT_E00009",
"props": {
"uid": "0.a.1.4.5.6.70b7.62b.e.2.4841f14728ee8d83b7758a29a05363f80a6ccb2",
"name": "purr_roi",
"id": "RoiCollection_hkytpXX_8Q2Q5fVphjp",
"roicollectiondata_info": 2,
"subjectid": "XNAT_S00006",
"collectiontype": "AIM"
}
}