Skip to content

Commit

Permalink
Merge pull request #1 from KrisThielemans/SRT2Dfixes
Browse files Browse the repository at this point in the history
SRT2D fixes
  • Loading branch information
Dimitra-Kyriakopoulou authored May 20, 2024
2 parents 30804fb + 23149d8 commit 23e8a5a
Show file tree
Hide file tree
Showing 8 changed files with 1,675 additions and 1,398 deletions.
15 changes: 15 additions & 0 deletions recon_test_pack/SRT2D_test_sim.par
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SRT2DParameters :=
; test file for SRT2D
input file := my_precorrected_sino${suffix}.hs

xy output image size (in pixels) := 91
zoom := .5

wiener filter := 0
median filter := 0
gamma filter := 0

output filename prefix := my_test_sim_image_SRT2D


end:=
14 changes: 9 additions & 5 deletions recon_test_pack/run_test_simulate_and_recon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,23 @@ input_ROI_mean=`awk 'NR>2 {print $2}' ${input_image}.roistats`
# warning: currently OSMAPOSL needs to be run before OSSPS as
# the OSSPS par file uses an OSMAPOSL result as initial image
# and reuses its subset sensitivities
for recon in FBP2D FBP3DRP OSMAPOSL OSSPS; do
for recon in FBP2D FBP3DRP SRT2D OSMAPOSL OSSPS; do
echo "========== Testing `command -v ${recon}`"
for parfile in ${recon}_test_sim*.par; do
for dataSuffix in "" "$TOF_suffix"; do
echo "===== data suffix: \"$dataSuffix\""
# test first if analytic reconstruction and if so, run pre-correction
isFBP=0
is_analytic=0
if expr "$recon" : FBP > /dev/null; then
is_analytic=1
elif expr "$recon" : SRT > /dev/null; then
is_analytic=1
fi
if [ $is_analytic = 1 ]; then
if expr "$dataSuffix" : '.*TOF.*' > /dev/null; then
echo "Skipping TOF as not yet supported for FBP"
echo "Skipping TOF as not yet supported for FBP etc"
break
fi
isFBP=1
suffix=$zero_view_suffix
export suffix
echo "Running precorrection"
Expand Down Expand Up @@ -148,7 +152,7 @@ for recon in FBP2D FBP3DRP OSMAPOSL OSSPS; do
output_filename=`awk -F':=' '/output[ _]*filename[ _]*prefix/ { value=$2;gsub(/[ \t]/, "", value); printf("%s", value) }' "$parfile"`
# substitute env variables (e.g. to fill in suffix)
output_filename=`eval echo "${output_filename}"`
if [ ${isFBP} -eq 0 ]; then
if [ ${is_analytic} -eq 0 ]; then
# iterative algorithm, so we need to append the num_subiterations
num_subiterations=`awk -F':=' '/number[ _]*of[ _]*subiterations/ { value=$2;gsub(/[ \t]/, "", value); printf("%s", value) }' ${parfile}`
output_filename=${output_filename}_${num_subiterations}
Expand Down
16 changes: 7 additions & 9 deletions src/analytic/SRT2D/SRT2D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,17 @@
#include "stir/analytic/SRT2D/SRT2DReconstruction.h"
#include "stir/Succeeded.h"
#ifndef PARALLEL
#define Main main
# define Main main
#else
#define Main master_main
# define Main master_main
#endif

USING_NAMESPACE_STIR

int Main(int argc, char **argv)
{
SRT2DReconstruction
reconstruction_object(argc>1?argv[1]:"");

int
Main(int argc, char** argv)
{
SRT2DReconstruction reconstruction_object(argc > 1 ? argv[1] : "");

return reconstruction_object.reconstruct() == Succeeded::yes ?
EXIT_SUCCESS : EXIT_FAILURE;
return reconstruction_object.reconstruct() == Succeeded::yes ? EXIT_SUCCESS : EXIT_FAILURE;
}
Loading

0 comments on commit 23e8a5a

Please sign in to comment.