#!/bin/bash -l # Set SCC project #$ -P PROJECT_NAME # Give this job a name #$ -N JOB_NAME # Combine output and error files into a single file #$ -j y # Send an email when the job finishes or if it is aborted (by default no email is sent). #$ -m ae # Request 4 cores for the -parellel flag. #$ -pe omp 4 # Defaults to fair-share mem_per_core, which is at minimum 4GB. #$ -l mem_per_core=4G # Submit N jobs. Gives access to the enviormental variable $SGE_TASK_ID, which is equal to the current job number # This example creates 3 jobs #$ -t 1-3 # Load desired version of freesurfer module load freesurfer/7.4.1 # create a list of inputs from the text files "subject_list.txt" and "scan_list.txt". # These text files must be in the same directory as this file. # Each new entry must by on a new line readarray -t SUBJECT_LIST < "subject_list.txt" readarray -t SCAN_LIST < "scan_list.txt" # Set environment variables. # INPUT_IMAGE # description: the full path to this subject's high resolution anatomical scan. Typically given names like "T1", "T1w", and "MEMPRAGE" # example: INPUT_IMAGE=/projectnb/scv/kkurkela/bids/sub-test002/ses-test002MR1/anat/sub-test002_ses-test002MR1_run-1_T1w.nii.gz INPUT_SCAN=${SCAN_LIST[$(($SGE_TASK_ID-1))]} # SUBJECT_ID # description: an arbitrary string to identify this subject # examples: SUBJECT_ID=sub-001 SUBJECT_ID=${SUBJECT_LIST[$(($SGE_TASK_ID-1))]} # SUBJECTS_DIR # description: the full path to a directory where the output will be written. A new folder $SUBJECTS_DIR/$SUBJECT_ID will be created # examples: SUBJECTS_DIR=/projectnb/scv/kkurkela/bids/derivatives/freesurfer/ # note: freesurfer will look for this variable in the enviornment. See recon-all -help export SUBJECTS_DIR=/FULL/PATH/TO/SOME/OUTPUT/DIRECTORY # Set recon-all variables recon-all -all -subjid $SUBJECT_ID -i $INPUT_SCAN -parallel -openmp $NSLOTS