-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate_gray_surfaces.sh
31 lines (26 loc) · 2.26 KB
/
generate_gray_surfaces.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
#!/bin/bash
# This script generates new gray matter surfaces at indicated fractions of the cortical thickness. Takes the average of white matter surfaces generated from CIVET and an additional surface (e.g. midsurface (generated by CIVET), 25%, or 12.5% surfaces (generated by a previous iteration of this script)
base_surface=$1
old_fraction=$2 #fraction used alongside the white matter to calculate new surface (expressed w/o percentage sign). E.g 25, mid
new_fraction=$3 #new percentile surface fraction of cortical thickness (expressed w/o percentage sign). E.g. 12_5 (corresponds to 25 as old_fraction), 25 (corresponds to mid as old_fraction)
if [ $1 == '0' ]
then
for file in ./surfaces/WM_0_surfaces/*left*
do
echo average_surfaces ./surfaces/GM_"$new_fraction"_surfaces/$(basename $file _WM_0_surface_left.obj)_GM_"$new_fraction"_surface_left.obj none none 1 $file ./surfaces/GM_"$old_fraction"_surfaces/$(basename $file _WM_0_surface_left.obj)_GM_"$old_fraction"_surface_left.obj
done > joblist_GM_"$new_fraction"
for file in ./surfaces/WM_0_surfaces/*right*
do
echo average_surfaces ./surfaces/GM_"$new_fraction"_surfaces/$(basename $file _WM_0_surface_right.obj)_GM_"$new_fraction"_surface_right.obj none none 1 $file ./surfaces/GM_"$old_fraction"_surfaces/$(basename $file _WM_0_surface_right.obj)_GM_"$old_fraction"_surface_right.obj
done >> joblist_GM_"$new_fraction"
elif [ $1 == '12_5' ]
then
for file in ./surfaces/GM_12_5_surfaces/*left*
do
echo average_surfaces ./surfaces/GM_"$new_fraction"_surfaces/$(basename $file _GM_12_5_surface_left.obj)_GM_"$new_fraction"_surface_left.obj none none 1 $file ./surfaces/GM_"$old_fraction"_surfaces/$(basename $file _GM_12_5_surface_left.obj)_GM_"$old_fraction"_surface_left.obj
done > joblist_GM_"$new_fraction"
for file in ./surfaces/GM_12_5_surfaces/*right*
do
echo average_surfaces ./surfaces/GM_"$new_fraction"_surfaces/$(basename $file _GM_12_5_surface_right.obj)_GM_"$new_fraction"_surface_right.obj none none 1 $file ./surfaces/GM_"$old_fraction"_surfaces/$(basename $file _GM_12_5_surface_right.obj)_GM_"$old_fraction"_surface_right.obj
done >> joblist_GM_"$new_fraction"
fi