-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17gaj40_make_precomputed_files.bash
More file actions
48 lines (42 loc) · 1.6 KB
/
17gaj40_make_precomputed_files.bash
File metadata and controls
48 lines (42 loc) · 1.6 KB
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
48
project_code="17.gaj.40"
label_type="WHS_heritability";
is_windows=1;
in_dir=/Volumes/PWP-CIVM-CTX01/freshscreen_n5_library/17.gaj.40;
out_dir=/Volumes/PWP-CIVM-CTX01/freshscreen_n5_library/to_S3/labels;
code_dir=/Users/harry/scratch/neuroglancer_python_prototype;
if [ $is_windows ]; then
in_dir=/u/freshscreen_n5_library/17.gaj.40;
out_dir=/u/freshscreen_n5_library/to_S3/labels;
code_dir=/k/workstation/code/display/python_freshscreen/;
fi
outout=$out_dir/WHS_heritability;
cd ${in_dir}
for x in BTBR C57BL_6J CAST DB2; do
cd $x/Done/;
for y in $(ls); do
# everything before the first underscore is the spec_id_fresh
# everything after is the runno (but also trim the trailing slash)
label_dir=${in_dir}/${x}/Done/${y}/labels*/${label_type};
spec_id_fresh=${y%_*};
runno=${y##*_};
runno=${runno%/*};
in_nii=$(ls ${label_dir}/${runno}*labels*nii);
if [ ! -f $in_nii ]; then
# the tool used to read a nhdr cannot handle compressed data files
in_nii=$(ls ${label_dir}/${runno}*labels*nii.gz);
gunzip $in_nii;
in_nii=$(ls ${label_dir}/${runno}*labels*nii);
fi
in_nhdr=${in_nii%.nii};
in_nhdr=${in_nhdr}.nhdr;
if [ ! -f $in_nhdr ]; then
mk_nhdr ${in_nii};
fi
in_file=$in_nhdr;
out_file=${out_dir}/${spec_id_fresh}_${runno}_${label_type}_labels.precomputed;
if [ ! -d $out_file ]; then
python ${code_dir}/prototype_make_precomputed_file.py ${in_file} ${out_file} $label_type
fi
done;
cd ../../;
done