Quickstart

Requirements

DataLad and datalad-xnat are available for all major operating systems (Linux, MacOS, Windows 10 [1]). The relevant requirements are listed below.

An XNAT account with appropriate permissions

You need access to an XNAT server to able to interact with it, and appropriate permissions to access the projects you are interested in. Keep your XNAT instance's URL and your user name and password to your account close by.

DataLad

If you don't have DataLad and its underlying tools (git, git-annex) installed yet, please follow the instructions from the datalad handbook.

Installation

datalad-xnat is a Python package available on pypi and installable via pip.

# create and enter a new virtual environment (optional)
$ virtualenv --python=python3 ~/env/dl-xnat
$ . ~/env/dl-xnat/bin/activate
# install from PyPi
$ pip install datalad-xnat

Getting started

Here's the gist of some of this extension's functionality. Checkout the Tutorial for more detailed demonstrations.

Start by creating and initializing a new DataLad dataset to track a specific XNAT project. This example uses the XNAT central instance with anonymous credentials for the project DCMPHANTOM.

$ datalad create dcm_phantom
$ cd dcm_phantom
$ datalad xnat-init https://central.xnat.org --credential anonymous --project DCMPHANTOM

After initialization, run xnat-update to download all files for the project.

$ datalad xnat-update --credential anonymous --subject CENTRAL_S01742

HELP! I'm new to this!

If you are confused about the words DataLad dataset, please head over to the DataLad Handbook for an introduction to DataLad.

If you are confused about the words project, experiment, or session in the context of XNAT, take a look at the Glossary or in the XNAT documentation.

Footnotes