fsqc.sh 2.4 KB
Newer Older
Bo-Chun Chen's avatar
Bo-Chun Chen committed
1
2
3
4
5
6
7
#!/bin/bash

echo "<html>" 																						>  index.html
echo "<table>"																						>> index.html
for sub in $(ls ${SUBJECTS_DIR});
do
	echo "<tr>"																						>> index.html
Bo-Chun Chen's avatar
Bo-Chun Chen committed
8
9
10
11
	echo "<td><a href=\"file:"$sub".lh.lat.hr.png\"><img src=\""$sub".lh.lat.lr.png\"></a></td>"	>> index.html
	echo "<td><a href=\"file:"$sub".lh.med.hr.png\"><img src=\""$sub".lh.med.lr.png\"></a></td>"	>> index.html
	echo "<td><a href=\"file:"$sub".rh.lat.hr.png\"><img src=\""$sub".rh.lat.lr.png\"></a></td>"	>> index.html
	echo "<td><a href=\"file:"$sub".rh.med.hr.png\"><img src=\""$sub".rh.med.lr.png\"></a></td>"	>> index.html
Bo-Chun Chen's avatar
Bo-Chun Chen committed
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
49
50
	echo "</tr>"																					>> index.html
	echo "<tr>"																						>> index.html
	echo "<td colspan=4><center>"$sub"</center><br></td>"											>> index.html
	echo "</tr>"																					>> index.html


	echo "labl_import_annotation \"aparc.annot\""	> tmp.tcl
	echo "scale_brain 1.35"							>>tmp.tcl
	echo "redraw"									>>tmp.tcl
	echo "save_tiff "$sub".lh.lat.hr.tif"			>>tmp.tcl
	echo "rotate_brain_y 180.0"						>>tmp.tcl
	echo "redraw"									>>tmp.tcl
	echo "save_tiff "$sub".lh.med.hr.tif"			>>tmp.tcl
	echo "resize_window 300"						>>tmp.tcl
	echo "rotate_brain_y -180.0"					>>tmp.tcl
	echo "redraw"									>>tmp.tcl
	echo "save_tiff "$sub".lh.lat.lr.tif"			>>tmp.tcl
	echo "rotate_brain_y 180.0"						>>tmp.tcl
	echo "redraw"									>>tmp.tcl
	echo "save_tiff "$sub".lh.med.lr.tif"			>>tmp.tcl
	echo "exit 0"									>>tmp.tcl
	tksurfer $sub lh pial -tcl tmp.tcl

	echo "labl_import_annotation \"aparc.annot\""	> tmp.tcl
	echo "scale_brain 1.35"							>>tmp.tcl
	echo "redraw"									>>tmp.tcl
	echo "save_tiff "$sub".rh.lat.hr.tif"			>>tmp.tcl
	echo "rotate_brain_y 180.0"						>>tmp.tcl
	echo "redraw"									>>tmp.tcl
	echo "save_tiff "$sub".rh.med.hr.tif"			>>tmp.tcl
	echo "rotate_brain_y -180.0"					>>tmp.tcl
	echo "resize_window 300"						>>tmp.tcl
	echo "redraw"									>>tmp.tcl
	echo "save_tiff "$sub".rh.lat.lr.tif"			>>tmp.tcl
	echo "rotate_brain_y 180.0"						>>tmp.tcl
	echo "redraw"									>>tmp.tcl
	echo "save_tiff "$sub".rh.med.lr.tif"			>>tmp.tcl
	echo "exit 0"									>>tmp.tcl
	tksurfer $sub rh pial -tcl tmp.tcl
Bo-Chun Chen's avatar
Bo-Chun Chen committed
51

Bo-Chun Chen's avatar
Bo-Chun Chen committed
52
53
54
	rm tmp.tcl
done;
echo "</table>"										>> index.html
Bo-Chun Chen's avatar
Bo-Chun Chen committed
55
56
57
58
59
60
61
62
echo "</html>"										>> index.html

# Convert tif to PNG and remove TIFF files
for f in *.tif; do
    echo "Converting $f";
    convert "$f"  "$(basename "$f" .tif).png";
    rm $f
done