Sync between M3 & XNAT
Follow these simple steps to share data between Monash-XNAT and M3.
-
If you already have an M3 account, go to step 2.
-
Request or create a project on M3
If you already have an M3 project, go to step 3.
-
Pull data from XNAT to M3 using the
xnat-utilsmodule.xnat-utilsis 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 modulexnat-get # download scans and resources from XNAT to M3.xnat-put # upload scans and resources (requires write privileges to project) from M3 to XNATxnat-ls # list projects/subjects/sessions/scansxnat-rename # renames an XNAT sessionxnat-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-lsXNAT server hostname (e.g. mbi-xnat.erc.monash.edu.au): xnat.monash.eduXNAT username for 'xnat.monash.edu':Password:# To list available projects at Monash-XNAT use ‘xnat-ls’ commandxnat-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'/