r69: BSpline changes
[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}phm2sdf sample-phm.sdf 256 256 --nsample 2 --phantom herman
12 if [ -f sample-phm.sdf ] ; then
13   ${bin}sdf2img sample-phm.sdf sample-phm.png --format png
14   ${bin}sdf2img sample-phm.sdf sample-phm16.png --format png16
15 fi
16
17 # Simulate CT data collection and generate raysum sinugram for display
18 ${bin}phm2rs  sample-rs.rs 367 320 --nray 2  --phantom herman
19 if [ -f sample-rs.rs ]; then
20   ${bin}rs2sdf  sample-rs.rs sample-rs.sdf
21 fi
22 if [ -f sample-rs.sdf ]; then
23   ${bin}sdf2img sample-rs.sdf sample-rs.png --format png
24   ${bin}sdf2img sample-rs.sdf sample-rs16.png --format png16
25 fi
26
27 # Reconstruct raysums and generate image for display
28 ${bin}ctrec   sample-rs.rs sample-rec.sdf 256 256 
29 if [ -f sample-rec.sdf ]; then 
30   ${bin}sdf2img sample-rec.sdf sample-rec.png --format png
31   ${bin}sdf2img sample-rec.sdf sample-rec16.png --format png16
32 fi
33
34 # Files sample-phm.png, sample-rs.png, and sample-rec.png are ready for display