-
Notifications
You must be signed in to change notification settings - Fork 0
Module 10 Diffusion Imaging
Watch these videos for an introduction to diffusion MRI. This will also be covered in class.
Intro: https://youtu.be/l5XtngIbehg
Another resource for those interested: https://youtu.be/1shFshj5Tgc
For this assignment, you will use an automated and containerized pipeline to preprocess diffusion data. [QSIPrep]https://qsiprep.readthedocs.io/en/latest/index.html) is a pipeline developed at the University of Pennsylvania, which has a rich history with MRI development and analyses.
"Diffusion-weighted magnetic resonance imaging (dMRI) is the primary method for noninvasively studying the organization of white matter in the human brain. Here we introduce QSIPrep, an integrative software platform for the processing of diffusion images that is compatible with nearly all dMRI sampling schemes. Drawing on a diverse set of software suites to capitalize on their complementary strengths, QSIPrep facilitates the implementation of best practices for processing of diffusion images." (https://www.nature.com/articles/s41592-021-01185-5)
I do not have a walk-through video for this. Please use previously developed skills to finish this assignment.
Steps to accomplish:
- Copy (do not move!) the Module10 directory to your own subdirectory. Please do this first before touching any files in that directory. If you accidentally do anything to the original Module10 directory, immediately contact me so I can help fix any issues.
- Within the copy of the Module10 directory you will see four directories. This is a BIDS style (but not fully complete) dataset. It will work with QSIPrep as I currently have the command.
code
derivatives
sub-004
sub-005
Within code is a sample script that should work once you update paths and other information in it. This is what the script file has in it. Update your copy of the file for where you data are. You will need to update a total of 3 lines: #SBATCH --mail-user and 2 lines starting with -B that are part of the apptainer command. Those need to be updated to match your email and where your data are! Do not run the script without first changing those lines! For example, these lines needs to change to match your path (remember, don't leave jjtanner in there):
-B /blue/clp7934/share/jjtanner/Module10:/in \
-B /blue/clp7934/share/jjtanner/Module10/derivatives:/out \
Here is the script for sub-005 (also in the code directory). This will use the GPU and CUDA to accelerate processing (don't worry if you don't know what that means). It also does not request burst class access so only two people in the class could run this at the same time. That means it might take a while for your job to start. It should only take about 2 hours to finish though. Please change the email address and paths.
#!/bin/bash
#SBATCH --time=6:00:00
#SBATCH --job-name=Module10-005_qsiprep
#SBATCH --output=Module10-005_qsiprep_%j.log
#SBATCH --mem=48GB
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=12
#SBATCH --account=clp7934
#SBATCH --qos=clp7934
#SBATCH --mail-type=END,FAIL
#SBATCH --mail-user=[gatorlink]@ufl.edu
#SBATCH --partition=gpu
#SBATCH --gpus=a100:1
pwd; hostname; date
module load cuda gcc/5.2.0
apptainer run --cleanenv --containall --nv \
-B /blue/clp7934/share/jjtanner/Module10:/in \
-B /blue/clp7934/share/jjtanner/Module10/derivatives:/out \
-B /apps/freesurfer/license/license.txt:/opt/freesurfer/license.txt \
/blue/clp7934/share/neurotools/qsiprep-v20.0.sif /in /out participant \
--participant_label sub-005 \
--skip_bids_validation \
--nthreads 12 \
--fs-license-file /opt/freesurfer/license.txt \
--output_resolution 2 \
--eddy-config /out/eddy_params.json \
-w /out/tmp/ -v -v
date
You do not need to change anything in the apptainer command if you change the other lines I mentioned previously. This has been tested multiple times and should complete successfully. If there are any errors, it's mostly likely because of a typo you made somewhere or you have an incomplete copy of the data (or a fellow student changed the source files). It's also possible the script will fail with an out of memory error. If this happens, delete the created files and start over. If it's still happening, send me both your scripts and I'll give you credit for the assignment.
- After editing this file, save the changes. Then make a copy of that script in the same directory and name it sub-004_ses-04_qsiprep.sh.
- Edit the new sub-004_ses-04_qsiprep.sh file to run on sub-004. If you previously edited the script before copying it, you will only need to change anywhere in the script it says 005 to 004 (a total of 3 instances -- two in the #SBATCH section and one in the apptainer command after the -sub flag).
- Submit the two scripts from within the code directory:
sbatch sub-004_ses-04_qsiprep.sh ; sbatch sub-005_ses-04_qsiprep.sh
Each script will require about 2 hours to run. It could be longer.
You will submit the images files called sub-004_ses-04_dir-AP_final_denoise_wf_biascorr.svg and sub-005_ses-04_dir-AP_final_denoise_wf_biascorr.svg. These can be found in the processed directories (again, your path will be slightly different because it will have your GatorlinkID in it): /blue/clp7934/share/jjtanner/Module10/derivatives/qsiprep/sub-004/figures and /blue/clp7934/share/jjtanner/Module10/derivatives/qsiprep/sub-005/figures