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

« Previous Version 8 Current »

As described in Getting Started / Configuration, you may use the -g and specify a YAML file for setting properties to your XNAT instance. An example YAML configuration file, which contains all currently supported operations is below:

siteConfig :
    siteDescriptionText : "Welcome to the XNAT 1.7 sandbox server!\n\nPlease enjoy your stay :)"
    siteDescriptionType : Text
    enableCsrfToken : false
pipelines : 
    DicomToNifti :
        path : "/data/xnatdev/pipeline/catalog/mricron/DicomToNifti.xml"
anon :
    file : sample_anon.das
dataTypes :
    sessions : [DX, MG, NM, OPT, OT, US, XA]
    YGTSS :
        singularName : 'Yale Global Tic Severity Scale Assessment'
        code : 'YGTSS'
        xsiType : 'xnat_a:ygtssData'
    YBOCS :
        singularName : 'Yale-Brown Obsessive-Compulsive Scale Assessment'
        code : 'YBOCS'
        xsiType : 'xnat_a:ybocsData'

Each of the top level elements "siteConfig", "pipelines", "anon", and "dataTypes" are optional, and may be omitted or included independently of each other (although many of the REST calls with fail if enableCsrfToken is not set to false).


Under siteConfig, you can specify key-value pairs of configuration that will be passed in one REST POST to /xapi/siteConfig.


Under the pipelines setting, you can specify one or more XNAT pipelines to be registered to your XNAT instance. The first child level under "pipelines", specifies the name of the pipeline. XNAT Populate will take this and look for a pipeline YAML file in the ./pipelines folder (here it would look for DicomToNifti.yaml). There is currently no REST API to register pipelines, so what the script does instead is:

  1. It prepares URL-encoded body with "eventSubmit_doAdd" = "Add" and sets various path values in the body to the value of 'path' in the YAML. These are the two parameters necessary to set up the pipeline.
  2. It checks the key-value pairs under the pipeline in the setup YAML (shown above) other than 'path', and adds them to the body.
  3. It POSTs the body to $server/app/action/ManagePipelines. This currently requires CSRF tokens to be disabled (hence enableCsrf : false, in the YAML).


Under anon, you can specify one of two child elements "url", or "file". If "url" is specified, sitewide anonymization will be set up with the response from the URL provided. If instead "file" is specified, the contents of the anon script file (in the current directory) will be used for anonymization at the site level.


This section is broken up into 'sessions', which is a simple array of modality codes to set up the corresponding XNAT data type. The above config would set up DX sessions, MG sessions, NM sessions, and so on. Additionally, you can specify data types with a singularName, pluralName (defaults to singularName + s if left out), code, and xsiType. The above config would set up the xnat_a:ygtssData and xnat_a:ybocsData data types (available but not set up in default XNAT).

  • No labels