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:
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:
- 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.
- It checks the key-value pairs under the pipeline in the setup YAML (shown above) other than 'path', and adds them to the body.
- 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).