Skip to content

Subject and session metadata§

In addition to imaging files, XNAT stores metadata for each subject and session. You can modify this metadata and add your own custom data fields.


Subject metadata§

XNAT stores metadata for each subject. This can include subject demographics and other variables which can be customised for your project.

Metadata are useful in various ways. Metadata can be viewed by your users and modified on the web interface. Metadata fields can be searched and can be exported to data tables and spreadsheets.

Some metadata fields are automatically set by XNAT when you create a subject or upload data. You can set other fields manually on the website or by using the XNAT REST API as part of your custom uploading process.

Viewing subject metadata§

You can view metadata for a subject by navigating to the subject report page.

  • You can edit the metadata by clicking Edit on the Actions menu.
  • You can view or export the metadata as XML by clicking View XML or Download XML on the Actions menu.

Customising the subject data fields for your project§

The project administrator can add additional metadata fields to subjects in their project. These can then be viewed and edited on the session report page.

  • See Customising subject or session data fields in your project below.

Session metadata§

Similar to subjects, XNAT stores metadata for each session. This can include information about the imaging session and can also be used to store custom variables such as clinical test results.

Metadata are useful in various ways. Metadata can be viewed by your users and modified on the web interface. Metadata fields can be searched and can be exported to data tables and spreadsheets.

Some metadata fields are automatically set by XNAT when you upload data. You can set other fields manually on the website or by using the XNAT REST API as part of your custom uploading process.

Viewing session metadata§

You can view metadata for a session by navigating to the session report page.

  • You can edit the metadata by clicking Edit on the Actions menu.
  • You can view or export the metadata as XML by clicking View > View XML or Download > Download XML on the Actions menu.

Customising the session data fields for your project§

The project administrator can add additional metadata fields to particular session types in their project. These can then be viewed and edited on the session report page.

  • See Customising subject or session data fields in your project below.

Customising subject or session data fields in your project§

The project administrator can add additional metadata fields to subjects and sessions in their project. This allows you to store additional data variables for each subject or session. These can then be viewed and edited on the subject report page or session report page.

Custom fields are added by defining all the new fields in a custom variable set and then adding that new set to subjects or each session type in your project.

Configuring custom variables for your project§

  • Navigate to your project (Click the Browse drop-down, click My Projects and select your project)
  • Under Details click Manage Custom Variables
  • Under Add variable(s) to: choose
  • Subject to add fields to the subject report pages
  • MR Sessions, CR Sessions etc to add fields to a particular type of imaging session
  • Under the box, click Add a custom variable set Add a custom variable set
  • Choose a Name and Description describing the set of variables
  • Under Custom Variables, add one or more custom variables. Refer to Adding Custom Demographic Metadata to Subjects for guidance.
  • Click Save when complete
  • Ensure your new custom variable set is checked
  • Click Done

Setting or modifying the values of custom variables§

As well as modifying manually on the user interface, custom variable values can be set in bulk using XNAT spreadsheet upload. Your may also wish to set variables using the XNAT API as part of your custom uploading code.