-
Notifications
You must be signed in to change notification settings - Fork 0
/
dcm2niix.slurm
42 lines (28 loc) · 1.1 KB
/
dcm2niix.slurm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# Convert DICOM files to Nifti
# Set the account
#SBATCH --account=psych
# Set the partition
#SBATCH --partition=cpu-g2-mem2x
# Set the job name:
#SBATCH --job-name=hpc-dcm2niix
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
# Request 8GB of memory per task:
#SBATCH --mem=8G
# Request 1 hour of runtime max:
#SBATCH --time=1:00:00
# Run 4 array tasks:
#SBATCH --array=0-3
# Load the dcm2niix module to convert DICOM files to NIfTI
module load escience/dcm2niix
# Create an output directory for the converted files under /gscratch/scrubbed
# The $USER variable will be replaced with your UW NetID
mkdir -p "/gscratch/scrubbed/$USER/hpc-workshop-01-output"
# Convert the DICOM files in each of these directories to NIfTI format:
# -o precedes the output directory
# the input directory is the last argument
# $SLURM_ARRAY_TASK_ID will be replaced by 0,1,2,3 at runtime
srun dcm2niix -o /gscratch/scrubbed/$USER/hpc-workshop-01-output /mmfs1/gscratch/psych/hpc-workshop-01/datafiles/$SLURM_ARRAY_TASK_ID
# Print a message to the job log to indicate that the conversion is done
echo "Done!"