Practice 2: QSIrecon (~10-minutes)
📋 HPC Batch Job Instructions for QSIrecon
You will modify a script for running QSIrecon on your existing CAM003 data. QSIrecon is included in the qsiprep container.
Running QSIrecon will be similar to running QSIprep (For me, qsirecon took 9 hours and 18 minutes!).
✅ Log on to HPC OOD
✅ Navigate to the CAM003_bids_data
directory:
Note the path to this directory (Use pwd
to display the path), as you'll need it for the runqsirecon.sh
script.
✅ You should already have the runqsirecon.sh
script to your home bin
directory (There are two qsi*
scripts, this is the second one you'll work with)
export RECON_SPEC=pyafq_tractometry
● There are other choices for the recon spec, some of which are mentioned but commented out in the script! Note that the time is set to 7 hours, which should accommodate even a lengthy reconstruction.
● Because you have a work directory, you can run other reconstructions and they will re-use what they can from the run directory. This allows you to compare different reconstructions. I suggest making sure you specify a different APP_DERIV_DIR for each (or rename the default qsirecon directory after it has finished being created.
● See QSI Recon Reconstruction Algorithms.
✅ Save your modified batch job.
✅ I suggest switching to elgato:
Run the Batch Job
✅ Make sure you are in the directory where you want the SLURM logs to end up.
✅ Type:
✅ Go to the Jobs tab in OOD and see if the job has started yet.
✅ If the job has not failed immediately, then a subdirectory qsirecon
will have been created in derivatives
and qsirecon_work
will have been created in the MRIS directory.. Look to see if they are there.
- You do not need to be in interactive mode. The
sbatch
command will ensure the job is run as a batch job! - You can start the command from any directory, but wherever you start from, the SLURM log will be deposited there. It should have a name similar to this
slurm-543618.out
. If anything goes wrong (e.g., theqsirecon
directory is not generated, or the job finishes in seconds, look in the SLURM log to help troubleshoot. Common problems include not finding the script, not finding the right path or subject, a typo, etc.
● If it times out, you can restart it with the exact same command and the job will pick up where it left off (i.e., it'll use the work directory contents so as not to repeat any processing that was already completed).
● The qsirecon_work directory should be about 1.3 GB for the selected pyafq_tractometry reconstruction. Again, a different reconstruction choice can result in a much larger work directory: mrtrix_multishell_msmt_ACT-hsvs reconstruction requires ~25 GB for our participant.
Summary
QSIrecon generates additional files for analysis. You'll examine the output of both qsiprep and qsirecon in the next practice.
What to Expect
- Actual run time should be just over 2 hours. Your time allotment is only decremented by the time the job actually takes to run.
- SLURM sends you an email about the job. It'll tell you when it starts running, and when the job finishes (
ExitCode 0
is a good thing, but just means SLURM was happy with the job, not that the BIDS app succeeded). Importantly, this email also indicates the run time for your job. This can help you adjust the time you request for the job in the future. - A directory
derivatives/qsirecon
should now exist and contain output (including HTML reports) - The directory
qsirecon_work
will contain intermediate processing steps, includingqsirecon_wf
.
--skip-odf-reports
is used. This means the main report that is generated by qsirecon is just text and not very interesting! The developers are aware of the problem, which is some kind of interaction between the Fury viewer and some HPCs.Note, however, that pyafq_tractometry creates many really nice reports. You'll learn a bit more about these in practice 3.
Exit Questions
TO DO Checklist
✅ When your QSIrecon run finishes, rename the slurm*.out
log to slurm_qsirecon.txt
and upload it to the D2L qsirecon assignment.
✅ Participate in the Discord channel dmri and share your response to the exit question. Tag your post.