Page tree
Skip to end of metadata
Go to start of metadata

The first thing XNAT Populate does is resolve dependencies, so it may appear to be hanging for a couple minutes when running it for the first time.

XNAT Populate is very much a new project, and there is very little error handling. If something goes wrong, the script will likely terminate and print a stack trace out to the command line.

XNAT Populate is a groovy project to push data into an XNAT (XNAT 1.7 required!) instance. Its main uses would be to push a lot of data into an XNAT if the data can be organized according to the desired YAML structure, or to populate a demo/sandbox server with a variety of data. The script uses groovy with dependencies managed by Grape, so the only prerequisite is a recent groovy installation. Then, simply invoke it on the command line by:

groovy PopulateXnat.groovy <parameters>

The script has the following parameters:

Short parameter nameLong parameter nameRequired?Takes argument?Description
-u--useryesyesSpecifies the XNAT user to upload data. For full functionality, the user should be an admin, but this is not strictly required to use only parts of the features.
-p--passyesyes

The password for the user specified above.

-s--urlyesyes

The site URL for your XNAT instance to populate.

-d--datayesyesThis specifies a text file which defines the data to upload (separated by newlines). See Populate Data for more information about available data. Alternatively, instead of specifying a file, you can enter a comma-separated list of projects here.
-g--confignoyesSpecifies a YAML file as defined in Site Configuration to set site level properties.
-c--cleannonoDANGEROUS. Add this flag to delete preexisting XNAT projects matching the data list. Don't use in production. Also, always back up your data just in case something goes wrong.
-r--refresh-datanono

Semi-dangerous. Add this flag to clear out the data folder on startup. Useful to grab updated copies of data.

-y--refresh-yaml

no

noAdd this flag to delete all YAML files in data folder on startup. Useful to grab updated configuration YAML.
-k--insecurenonoAdd this flag to ignore SSL errors on https sites. Useful for dev/test environments.
-su--secure-usersnonoAdd this flag to only add existing XNAT users to created projects. Users that are specified in project configurations will not be created (to prevent insecure user accounts).
-e--export-modenonoAdd this flag to use XNAT Populate to export data *from* your XNAT to the local file system in a format that it can understand (can then be used to send to a different XNAT).
-w--delaynoyesOptional delay (in milliseconds) after each session import. Useful if rapid session imports is degrading performance on the server in constrained memory situations.



  • No labels