-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript_CHBM.sh
47 lines (40 loc) · 1.38 KB
/
script_CHBM.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
44
45
46
47
#!/bin/bash
tittle="------Anatomy Pipeline------"
echo ""
echo $tittle
echo ""
echo "->> Starting process..."
anat_path="/data3_260T/data/CCLAB_DATASETS/CHBM/CHBM_ARIOKSY/realese_2/ds_bids_cbm_loris_012720/"
echo "->> Anat Path: "$anat_path
freesurfer_path="/data3_260T/data/CCLAB_DATASETS/CHBM/CHBM_ARIOKSY/realese_2/freesurfer/"
echo "->> Freesurfer OutPut Path: "$freesurfer_path
ciftify_work_dir="/data3_260T/data/CCLAB_DATASETS/CHBM/CHBM_ARIOKSY/realese_2/ciftify/"
echo "->> Ciftify OutPut Path: "$ciftify_path
export $freesurfer_path
for subject in "$anat_path"/*
do
if [ -d "$subject" ]; then
subject_dir=`dirname $subject`
subject_name=`basename $subject`
#echo $subject_name
T1w_file=$subject"/anat/"$subject_name"_T1w.nii.gz"
if [ -f "$T1w_file" ]; then
echo "$T1w_file exist"
recon-all -i $T1w_file -sd $freesurfer_path -s $subject_name -all > $freesurfer_path"/$subject_name.txt"
else
echo "->> Error:The subject: "$subject_name". Don't have any T1w."
fi
fi
done
wait
for subject_freesf in "$freesurfer_path"/*
do
if [ -d "$subject_freesf" ]; then
subject_dir=`dirname $subject_freesf`
subject_name=`basename $subject_freesf`
ciftify_recon_all --verbose --surf-reg FS --resample-to-T1w32k --fs-subjects-dir $freesurfer_path --ciftify-work-dir $ciftify_work_dir $subject_name
fi
done
echo ""
echo "Done.."
echo ""