Applied initial patches for wx2.8 compatibility
[ctsim.git] / helical / sample-helical.sh.in
1 #!/bin/sh
2
3 if test "$1" != "" ; then
4   bin=$1
5 else
6   bin="@prefix@/bin/"
7 fi
8
9 if test "$1" = "clean" ; then
10   rm -f sample-phm.png sample-phm.if sample-pj.pj sample-pj.if sample-pj.png sample-rec.if sample-rec.png 540-pj.pj  540-pj.if 540-pj.png  540-rec.if 540-rec.png dynphm
11   exit
12 fi
13
14 # Generate phantom image
15
16 cc -o dynphm dynphm.c -lm
17 dynphm 100 200 tmpphm
18 ${bin}ctsimtext phm2if sample-phm.if 256 256 --nsample 2 --phmfile tmpphm
19 rm -f tmpphm 
20 if [ -f sample-phm.if ] ; then
21   ${bin}ctsimtext ifexport sample-phm.if sample-phm.png --format png
22 fi
23
24 # Simulate helical CT data collection and generate raysum sinugram for display
25 ${bin}ctsimtext phm2helix  sample-pj.pj 367 1080 dynphm --nray 2  --geometry equiangular --rotangle 3
26 if [ -f sample-pj.pj ]; then
27   ${bin}ctsimtext pj2if  sample-pj.pj sample-pj.if
28 fi
29 if [ -f sample-pj.if ]; then
30   ${bin}ctsimtext ifexport sample-pj.if sample-pj.png --format png
31 fi
32 if [ -f sample-pj.pj ]; then 
33   ${bin}ctsimtext pjHinterp sample-pj.pj 540-pj.pj --interpview 540
34 fi
35 if [ -f 540-pj.pj ]; then
36   ${bin}ctsimtext pj2if  540-pj.pj 540-pj.if
37 fi
38 if [ -f sample-pj.if ]; then
39   ${bin}ctsimtext ifexport 540-pj.if 540-pj.png --format png
40 fi
41
42 # Reconstruct raysums and generate image for display
43 ${bin}ctsimtext pjrec   540-pj.pj 540-rec.if 256 256 
44 if [ -f sample-rec.if ]; then 
45   ${bin}ctsimtext ifexport 540-rec.if 540-rec.png --format png
46
47   # Display comparison statistics
48   ${bin}ctsimtext if2 sample-phm.if 540-rec.if --comp
49 fi
50