X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fsample-ctrec.sh.in;h=1a9f105842b59ddcdff715530914263cbfdbf460;hp=b85e71f615ab57d78e8bf001d3aa2f9f22bf876b;hb=2d39e823ba389fc68e5317c422b55be006094252;hpb=c95a927599e20c3d7762073450e3126d9694107d diff --git a/src/sample-ctrec.sh.in b/src/sample-ctrec.sh.in index b85e71f..1a9f105 100755 --- a/src/sample-ctrec.sh.in +++ b/src/sample-ctrec.sh.in @@ -1,27 +1,39 @@ #!/bin/sh -bin="@prefix@/bin/" +if test "$1" != "" ; then + bin=$1 +else + bin="@prefix@/bin/" +fi + +if test "$1" = "clean" ; then + 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 + exit +fi # Generate phantom image -${bin}phm2sdf sample-phm.sdf 256 256 --nsample 2 --phantom herman -if [ -f sample-phm.sdf ] ; then - ${bin}sdf2img sample-phm.sdf sample-phm.png --format png +${bin}phm2if sample-phm.if 256 256 --nsample 2 --phantom herman +if [ -f sample-phm.if ] ; then + ${bin}if2img sample-phm.if sample-phm.png --format png + ${bin}if2img sample-phm.if sample-phm16.png --format png16 fi # Simulate CT data collection and generate raysum sinugram for display -${bin}phm2rs sample-rs.rs 367 320 --nray 2 --phantom herman -if [ -f sample-rs.rs ]; then - ${bin}rs2sdf sample-rs.rs sample-rs.sdf +${bin}phm2pj sample-pj.pj 367 320 --nray 2 --phantom herman +if [ -f sample-pj.pj ]; then + ${bin}pj2if sample-pj.pj sample-pj.if fi -if [ -f sample-rs.sdf ]; then - ${bin}sdf2img sample-rs.sdf sample-rs.png --format png +if [ -f sample-pj.if ]; then + ${bin}if2img sample-pj.if sample-pj.png --format png + ${bin}if2img sample-pj.if sample-pj16.png --format png16 fi # Reconstruct raysums and generate image for display -${bin}ctrec sample-rs.rs sample-rec.sdf 256 256 -if [ -f sample-rec.sdf ]; then - ${bin}sdf2img sample-rec.sdf sample-rec.png --format png +${bin}ctrec sample-pj.pj sample-rec.if 256 256 +if [ -f sample-rec.if ]; then + ${bin}if2img sample-rec.if sample-rec.png --format png + ${bin}if2img sample-rec.if sample-rec16.png --format png16 fi -# Files sample-phm.png, sample-rs.png, and sample-rec.png are ready for display +# Files sample-phm.png, sample-pj.png, and sample-rec.png are ready for display