Summary of what happened:
Hello everyone! For the univariate fMRI analysis of my data I want to normalize the images to a custom Dartel template. We create this template in SPM12, using the raw T1w images of the full study sample. Besides the template itself I also created a brain mask and a json file. According to the fmriprep documentation, I should be able to save this template anywhere, as long as I define this correctly in my script. But I keep getting errors, so I think that I’m calling it incorrectly. I would really appreciate some help with this, because there is barely any documentation on this. I don’t want to share the template on templateflow, because this is a very study-specific template.
Command used:
#!/bin/bash
#SBATCH --account=owner-guest
#SBATCH --mail-user=u1350546@utah.edu
#SBATCH --partition=notchpeak-shared-guest
#SBATCH --job-name=fmriprep
#SBATCH --nodes=1
#SBATCH --ntasks=10
#SBATCH --mem=50G
#SBATCH --time=48:00:00
#SBATCH -o run_fmriprep_sif-%j.out-%N
#SBATCH -e run_fmriprep_sif-%j.err-%N
# * Environment
container="/uufs/chpc.utah.edu/common/home/u1350546/fmriprep_latest.sif"
base="/uufs/chpc.utah.edu/common/home/u1350546/Documents/fmriprep"
output_base="/uufs/chpc.utah.edu/common/home/bking-group1"
template_dir="/uufs/chpc.utah.edu/common/home/u1350546/Documents/fmriprep/TEMPLATEFLOW_HOME/tpl-Dartel"
fslicense="${base}/license.txt"
dat_dir="${base}/OfflineBrain_BIDS"
der_dir="${output_base}/derivatives"
wrk_dir="${output_base}/tmp"
subject="108" # Test Subject ID, should not contain 'sub-'
mkdir -p "${der_dir}" "${wrk_dir}"
# * Load singularity/Apptainer
module load python
module load apptainer
# * Run fMRIprep
apptainer \
run \
--cleanenv \
-B "${dat_dir}":/data:ro \
-B "${der_dir}":/derivatives \
-B "${wrk_dir}":/work \
-B "${fslicense}":/license.txt:ro \
-B "${template_dir}":/templateflow \
"${container}" \
/data \
"/derivatives/fMRIPrep" \
participant \
--participant-label "${subject}" \
-w /work/ \
--fs-no-reconall \
--output-spaces Dartel \
--write-graph \
--notrack \
--fs-license-file /license.txt \
--ignore slicetiming \
-vv \
--skip-bids-validation
exit
Version:
24.1.0
Environment
Apptainer, within a high performance computing cluster
Folder organization
TEMPLATEFLOW_HOME/
tpl-Dartel/
template_description.json
tpl-Dartel_res-1_T1w.nii.gz
tpl-Dartel_res-1_desc-brain_mask.nii.gz
Relevant error outputs:
ValueError: space identifier "Dartel" is invalid.
Valid identifiers are: Fischer344, MNI152Lin, MNI152NLin2009aAsym, MNI152NLin2009aSym, MNI152NLin2009bAsym, MNI152NLin2009bSym, MNI152NLin2009cAsym, MNI152NLin2009cSym, MNI152NLin6Asym, MNI152NLin6Sym, MNI305, MNIColin27, MNIInfant, MNIPediatricAsym, MouseIn, NKI, NMT31Sym, OASIS30ANTs, PNC, RESILIENT, UNCInfant, VALiDATe29, WHS, dhcpAsym, dhcpSym, dhcpVol, fsLR, fsaverage, onavg, T1w, T2w, anat, fsnative, func, run, sbref, session, individual, dwi, asl
JSON file:
{
"Name": "Dartel",
"TemplateFlowVersion": "0.7.1",
"Resolution": [1],
"ReferencesAndLinks": [
" "
]
}