-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
# Usage: ./preprocess-nifti.sh <path_to_nifti> | ||
# Author: Kelvin Sarink <[email protected]> | ||
|
||
|
||
# Edit the following variables to your needs: | ||
path_to_compiled_spm="/scratch/tmp/e0trap/software/cat12_joint_pipeline/ksarink-cjp_v0008-spm12_v7771-cat12_r1720/" | ||
path_to_mcr="/scratch/tmp/e0trap/software/mcr/v96" | ||
path_to_batch_template="/scratch/tmp/e0trap/software/cat12_joint_pipeline/cat12_complete_joint_pipeline.mat" | ||
|
||
# path_which_needs_to_be_replaced does not need to be changed as long as you use cjp8 | ||
path_which_needs_to_be_replaced="/spm-data/Scratch/spielwiese_kelvin/cat12_joint_pipeline/cjp_v0008-spm12_v7771-cat12_r1720-modifiedcatdefaults/" | ||
|
||
|
||
|
||
# Do not edit anything below: | ||
[ -z "$1" ] && exit 1 | ||
nifti=`realpath $1` | ||
id=`basename $nifti | sed 's|.nii||g'` | ||
timestamp=`date +'%Y-%m-%d_%H-%M-%S'` | ||
workingdir="./workingdir/${id}_$timestamp" | ||
mkdir -p $workingdir | ||
workingdir=`realpath $workingdir` | ||
cd $workingdir | ||
|
||
export MCR_INHIBIT_CTF_LOCK=1 | ||
|
||
|
||
batchfilename=$workingdir/${id}-spm12batch.mat | ||
#Create SPM12 batch | ||
$path_to_compiled_spm/run_spm12.sh \ | ||
$path_to_mcr \ | ||
adjust_input \ | ||
$path_to_batch_template \ | ||
$batchfilename \ | ||
$nifti \ | ||
$path_which_needs_to_be_replaced &> ./adjusting.log; | ||
|
||
#Execute SPM12 batch | ||
$path_to_compiled_spm/run_spm12.sh \ | ||
$path_to_mcr \ | ||
batch $batchfilename &> ./spm12.log |