Skip to content

Demo for xnat downloader

Michelle Voss edited this page Sep 10, 2024 · 8 revisions

The xnat_downloader tool allows us to use code to download MRI data from the storage space that MRRF sends our data to (called XNAT) and store it on our computers in both it's "raw" and "reconstructed" forms. Access the source data for xnat_downloader here.

The "raw" form for our MR image data are referred to as DICOM images. DICOM stands for Digital Imaging and Communication in Medicine, and provides includes metadata about the image and the raw components of the image data. DICOM data have a file extension of .dcm and all the DICOM files that make up an image are stored in a folder looking something like this:

dicomList

We don't typically look at the raw form of the header data. Rather it's common to use a tool that takes the DICOM files as input and produces output that includes (a) meta-data about the image, extracted from the DICOM header data, (b) a reconstructed image in the form of a NIFTI file. The tool most commonly used for this is dcm2niix, developed by Dr. Chris Rorden.

Fortunately, the xnat_downloader tool both downloads data from our xnat storage space AND reconstructs it with dcm2niix. Here are steps for using xnat_downloader:

  1. Obtain access to an executable source of xnat_downloader. In our lab we use a singularity container, which is like a mini virtual machine stored on our server. We store the container in a folder that contains all the singularity containers our lab uses, for example the path is /Volumes/vosslabhpc/UniversalSoftware/SingularityContainers/xnat_downloader-v0.2.8.sif.

  2. Create a config file that will be your input to xnat_downloader and store this as a .json file. Here are example contents of a config file:

	"server": "https://rpacs.iibi.uiowa.edu/xnat",
	"destination": "/out",
	"project": "PSYCH_4025",
	"subjects": ["20231017_1","DEMO"],
	"sub_dict": {
							"20231017_1":"001",
							"DEMO":"002" 
						},				
	"scan_dict": {
        "func-bold_task-REST": "func-bold_task-rest",
        "anat-T1w": "anat-T1w",
        "func-bold_task-taskswitch":"func-bold_task-flanker" 
	              }
}

Clone this wiki locally