Skip to main content

Pull data from XNAT to M3

Follow these simple steps to download data from Monash-XNAT to M3.

  1. Create an account on M3.

    If you already have an M3 account, go to step 2.

  2. Request an M3 project.

    If you already have an M3 project, go to step 3.

  3. Pull data from XNAT to M3 using the xnat-utils module. xnat-utils is a collection of scripts for conveniently uploading, downloading and listing data in XNAT projects. After loading this module on M3, additional command line options become available:

    module load xnat-utils  # Loading module
    xnat-get # download scans and resources from XNAT to M3.
    xnat-put # upload scans and resources (requires write privileges to project) from M3 to XNAT
    xnat-ls # list projects/subjects/sessions/scans
    xnat-rename # renames an XNAT session
    xnat-varget # set a metadata field (including “custom variables”)
    xnat-varput # retrieve a metadata field (including “custom variables”)

    The code below shows an example of pulling data from Monash-XNAT to M3:

    # If using xnat-utils for the first time on M3, you will be prompted with
    # the address of the server you would like to connect to, in addition to
    # your username and password:
    xnat-ls
    XNAT server hostname (e.g. mbi-xnat.erc.monash.edu.au): xnat.monash.edu
    XNAT username for 'xnat.monash.edu':
    Password:

    # To list available projects at Monash-XNAT use ‘xnat-ls’ command
    xnat-ls

    # To list all subjects within a specific project at Monash-XNAT
    # For example: project id = 'MMH000'
    xnat-ls MMH000

    # To pull data from Monash-XNAT to M3 use the ‘xnat-get’ command
    # line. You can specify project name, subject directory within a project or
    # a specific sequence to download to M3.
    # Use ‘xnat-get -h’ for possible options:
    xnat-get MMH000

    # By default xnat_get download data to your M3 project’s home directory.
    # However, you can specify a path to the target by using ‘--target’ option.
    # For example:
    xnat-get MMH000 --target ~/'DOWNLOAD-DATA-TO-THIS-PATH'/