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