r115: *** empty log message ***
[ctsim.git] / src / sample-ctrec.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-phm16.png sample-phm.if sample-pj.pj sample-pj.if sample-pj.png sample-pj16.png sample-rec.if sample-rec.png sample-rec16.png
11   exit
12 fi
13
14 # Generate phantom image
15
16 ${bin}phm2if sample-phm.if 256 256 --nsample 2 --phantom herman
17 if [ -f sample-phm.if ] ; then
18   ${bin}if2img sample-phm.if sample-phm.png --format png
19   ${bin}if2img sample-phm.if sample-phm16.png --format png16
20 fi
21
22 # Simulate CT data collection and generate raysum sinugram for display
23 ${bin}phm2pj  sample-pj.pj 367 320 --nray 2  --phantom herman
24 if [ -f sample-pj.pj ]; then
25   ${bin}pj2if  sample-pj.pj sample-pj.if
26 fi
27 if [ -f sample-pj.if ]; then
28   ${bin}if2img sample-pj.if sample-pj.png --format png
29   ${bin}if2img sample-pj.if sample-pj16.png --format png16
30 fi
31
32 # Reconstruct raysums and generate image for display
33 ${bin}ctrec   sample-pj.pj sample-rec.if 256 256 
34 if [ -f sample-rec.if ]; then 
35   ${bin}if2img sample-rec.if sample-rec.png --format png
36   ${bin}if2img sample-rec.if sample-rec16.png --format png16
37 fi
38
39 # Files sample-phm.png, sample-pj.png, and sample-rec.png are ready for display