Papermill Slurm Job Submission#

Author: Steffen Bollmann

Date: 22 June 2025

Citation and Resources:#

Tools included in this workflow#

FSL

Dataset#

MP2RAGE T1-weighted average 7T model (human brain model)

  • Bollmann, Steffen, Andrew Janke, Lars Marstaller, David Reutens, Kieran O’Brien, and Markus Barth. “MP2RAGE T1-weighted average 7T model” January 1, 2017. doi:10.14264/uql.2017.266

Load software tools#

#load FSL 6.0.4
import module
await module.load('fsl/6.0.4')
await module.list()
['julia/1.10.4',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 'openssl/1.1',
 'python/3.10.4-gcccore-11.3.0',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 '<H>',
 'libxslt/1.1.34-gcccore-11.3.0',
 'lxml/4.9.1-gcccore-11.3.0',
 'beautifulsoup/4.10.0-gcccore-11.3.0',
 '<H>',
 'jupyter-server/1.21.0-gcccore-11.3.0',
 'jupyterlab/3.5.0-gcccore-11.3.0',
 'fsl/6.0.4']

Data preparation#

![ -f ./mp2rage-01.nii  ] && echo "$FILE exist." || wget https://imaging.org.au/uploads/Human7T/mp2rageModel_L13_work03-plus-hippocampus-7T-sym-norm-mincanon_v0.8.nii -O ./mp2rage-01.nii 
![ -f ./mp2rage-02.nii  ] && echo "$FILE exist." || cp ./mp2rage-01.nii ./mp2rage-02.nii 
 exist.
 exist.

Analysis#

#This cell needs to be tagged as "parameters" and it will be replaced at runtime - this can be done by clicking the little cog-wheels in the top right and then tagging the cell
subject_id='01'
!bet mp2rage-{subject_id}.nii mask-sub-{subject_id}.nii -R
mp2rage-01.nii mask-sub-01.nii -R

Running it on the HPC#

# Save Notebook and Run this on the terminal to test
# papermill papermill-slurm-submission-example.ipynb papermill_output.ipynb --parameters_raw subject_id 02
# create sbat file with the following content and make sure to replace account string and and execution times and modules loaded:
#then run the sbat file:
#sbatch papermill.sbat

Dependencies in Jupyter/Python#

  • Using the package watermark to document system environment and software versions used in this notebook

%load_ext watermark

%watermark
%watermark --iversions
Last updated: 2025-12-05T00:19:16.020071+00:00

Python implementation: CPython
Python version       : 3.11.6
IPython version      : 8.16.1

Compiler    : GCC 12.3.0
OS          : Linux
Release     : 5.4.0-204-generic
Machine     : x86_64
Processor   : x86_64
CPU cores   : 32
Architecture: 64bit