forked from BBillot/SynthSeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testA.sh
43 lines (36 loc) · 1.63 KB
/
testA.sh
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
43
#!/usr/bin/bash
## ---------------------------
##
## PURPOSE
## This script runs the SynthSeg model on a test batch of data to verify a ## correct installation.
##
## AUTHOR(S)
## Margot Wagner (mwagner@ucsd.edu)
## Brandon Liu (bliu6@ucsd.edu)
##
## DATE CREATED
## 2023-02-02
##
## ---------------------------
##
## Usage Notes:
## - Set DATA_DIR and OUTPUT_DIR paths as needed
##
## ---------------------------
# set i/o directories
# path to a scan to segment (or a folder)
DATA_DIR="/snl/abcd/raw-data/smri/year2_depr/test/sub-NDARINV0AHJHA5D/ses-2YearFollowUpYArm1/anat/sub-NDARINV0AHJHA5D_ses-2YearFollowUpYArm1_run-01_T1w.nii"
# path to output directory (must be same type as input)
OUTPUT_DIR="/snl/abcd/raw-data/smri/year2_depr/test/sub-NDARINV0AHJHA5D/ses-2YearFollowUpYArm1/anat/sub-NDARINV0AHJHA5D_ses-2YearFollowUpYArm1_segmented.nii"
#OUTPUT_DIR="/cnl/abcd/data/imaging/smri/interim/synthseg/test_batch/sub-NDARINVCPPYNGF9_ses-baselineYear1Arm1_noparc_segmented.nii"
SYNTHSEG_DIR="./commands/SynthSeg_predict.py"
VOL_CSV="/snl/abcd/raw-data/smri/year2_depr/test/sub-NDARINV0AHJHA5D/ses-2YearFollowUpYArm1/anat/sub-NDARINV0AHJHA5D_ses-2YearFollowUpYArm1_volumes.csv"
#VOL_CSV="/cnl/abcd/data/imaging/smri/interim/synthseg/test_batch/sub-NDARINVCPPYNGF9_ses-baselineYear1Arm1_noparc_volumes.csv"
# activate python 3.8 environment
source "/home/mwagner/bin/anaconda3/etc/profile.d/conda.sh"
conda activate synthseg
# run SynthSeg
# see https://github.com/BBillot/SynthSeg for additional flag options
python $SYNTHSEG_DIR --i $DATA_DIR --o $OUTPUT_DIR --fast --cpu --threads 8 --vol $VOL_CSV
# deactivate environment
conda deactivate