projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r142: *** empty log message ***
[ctsim.git]
/
src
/
pjrec.cpp
diff --git
a/src/pjrec.cpp
b/src/pjrec.cpp
index c64f6ae849c958e6e228e0907550d80099f4607a..d6a229caeb35cdc7ffb0ff3ccc24716a9dc1159c 100644
(file)
--- a/
src/pjrec.cpp
+++ b/
src/pjrec.cpp
@@
-9,7
+9,7
@@
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: pjrec.cpp,v 1.
8 2000/07/06 18:37:2
4 kevin Exp $
+** $Id: pjrec.cpp,v 1.
10 2000/07/11 10:32:4
4 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
@@
-29,11
+29,12
@@
#include "timer.h"
#include "timer.h"
-enum {O_INTERP, O_FILTER, O_FILTER_METHOD, O_ZEROPAD, O_FILTER_PARAM, O_BACKPROJ, O_VERBOSE, O_TRACE, O_HELP, O_DEBUG, O_VERSION};
+enum {O_INTERP, O_FILTER, O_FILTER_METHOD, O_ZEROPAD, O_FILTER_PARAM, O_BACKPROJ, O_
PREINTERPOLATION_FACTOR, O_
VERBOSE, O_TRACE, O_HELP, O_DEBUG, O_VERSION};
static struct option my_options[] =
{
{"interp", 1, 0, O_INTERP},
static struct option my_options[] =
{
{"interp", 1, 0, O_INTERP},
+ {"preinterpolation-factor", 1, 0, O_PREINTERPOLATION_FACTOR},
{"filter", 1, 0, O_FILTER},
{"filter-method", 1, 0, O_FILTER_METHOD},
{"zeropad", 1, 0, O_ZEROPAD},
{"filter", 1, 0, O_FILTER},
{"filter-method", 1, 0, O_FILTER_METHOD},
{"zeropad", 1, 0, O_ZEROPAD},
@@
-64,6
+65,8
@@
pjrec_usage (const char *program)
#if HAVE_BSPLINE_INTERP
cout << " bspline B-spline interpolation" << endl;
#endif
#if HAVE_BSPLINE_INTERP
cout << " bspline B-spline interpolation" << endl;
#endif
+ cout << " --preinterpolate Preinterpolation factor (default = 1)\n";
+ cout << " Used only with frequency-based filtering\n";
cout << " --filter Filter name" << endl;
cout << " abs_bandlimit Abs * Bandlimiting (default)" << endl;
cout << " abs_sinc Abs * Sinc" << endl;
cout << " --filter Filter name" << endl;
cout << " abs_bandlimit Abs * Bandlimiting (default)" << endl;
cout << " abs_sinc Abs * Sinc" << endl;
@@
-92,6
+95,7
@@
pjrec_usage (const char *program)
cout << " diff Difference method" << endl;
cout << " diff2 Optimized difference method (default)" << endl;
cout << " idiff2 Optimized difference method with integer math" << endl;
cout << " diff Difference method" << endl;
cout << " diff2 Optimized difference method (default)" << endl;
cout << " idiff2 Optimized difference method with integer math" << endl;
+ cout << " idiff3 Highly-optimized difference method with integer math" << endl;
cout << " --filter-param Alpha level for Hamming filter" << endl;
cout << " --trace Set tracing to level" << endl;
cout << " none No tracing (default)" << endl;
cout << " --filter-param Alpha level for Hamming filter" << endl;
cout << " --trace Set tracing to level" << endl;
cout << " none No tracing (default)" << endl;
@@
-132,7
+136,7
@@
pjrec_main (int argc, char * argv[])
string optInterpName = Backprojector::INTERP_LINEAR_STR;
string optBackprojName = Backprojector::BPROJ_IDIFF2_STR;
// string optFilterMethodName = SignalFilter::FILTER_METHOD_CONVOLUTION_STR;
string optInterpName = Backprojector::INTERP_LINEAR_STR;
string optBackprojName = Backprojector::BPROJ_IDIFF2_STR;
// string optFilterMethodName = SignalFilter::FILTER_METHOD_CONVOLUTION_STR;
- int opt
InterpParam
= 1;
+ int opt
PreinterpolationFactor
= 1;
int nx, ny;
#ifdef HAVE_MPI
ImageFile* imLocal;
int nx, ny;
#ifdef HAVE_MPI
ImageFile* imLocal;
@@
-158,6
+162,13
@@
pjrec_main (int argc, char * argv[])
case O_INTERP:
optInterpName = optarg;
break;
case O_INTERP:
optInterpName = optarg;
break;
+ case O_PREINTERPOLATION_FACTOR:
+ optPreinterpolationFactor = strtol(optarg, &endptr, 10);
+ if (endptr != optarg + strlen(optarg)) {
+ pjrec_usage(argv[0]);
+ return(1);
+ }
+ break;
case O_FILTER:
optFilterName = optarg;
break;
case O_FILTER:
optFilterName = optarg;
break;
@@
-171,12
+182,14
@@
pjrec_main (int argc, char * argv[])
optFilterParam = strtod(optarg, &endptr);
if (endptr != optarg + strlen(optarg)) {
pjrec_usage(argv[0]);
optFilterParam = strtod(optarg, &endptr);
if (endptr != optarg + strlen(optarg)) {
pjrec_usage(argv[0]);
+ return(1);
}
break;
case O_ZEROPAD:
optZeroPad = strtol(optarg, &endptr, 10);
if (endptr != optarg + strlen(optarg)) {
pjrec_usage(argv[0]);
}
break;
case O_ZEROPAD:
optZeroPad = strtol(optarg, &endptr, 10);
if (endptr != optarg + strlen(optarg)) {
pjrec_usage(argv[0]);
+ return(1);
}
break;
case O_VERBOSE:
}
break;
case O_VERBOSE:
@@
-227,7
+240,7
@@
pjrec_main (int argc, char * argv[])
filterDesc << optFilterName;
ostringstream label;
filterDesc << optFilterName;
ostringstream label;
- label << "pjrec: " << nx << "x" << ny << ", " << filterDesc.str() << ", " << optInterpName << ", " << optBackprojName;
+ label << "pjrec: " << nx << "x" << ny << ", " << filterDesc.str() << ", " << optInterpName << ",
preinterpolation=" << optPreinterpolationFactor << ",
" << optBackprojName;
remark = label.str();
if (optVerbose)
remark = label.str();
if (optVerbose)
@@
-259,7
+272,7
@@
pjrec_main (int argc, char * argv[])
mpiWorld.getComm().Bcast (&optTrace, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&optFilterParam, 1, MPI::DOUBLE, 0);
mpiWorld.getComm().Bcast (&optZeroPad, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&optTrace, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&optFilterParam, 1, MPI::DOUBLE, 0);
mpiWorld.getComm().Bcast (&optZeroPad, 1, MPI::INT, 0);
- mpiWorld.getComm().Bcast (&opt
InterpParam
, 1, MPI::INT, 0);
+ mpiWorld.getComm().Bcast (&opt
PreinterpolationFactor
, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&mpi_ndet, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&mpi_nview, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&mpi_detinc, 1, MPI::DOUBLE, 0);
mpiWorld.getComm().Bcast (&mpi_ndet, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&mpi_nview, 1, MPI::INT, 0);
mpiWorld.getComm().Bcast (&mpi_detinc, 1, MPI::DOUBLE, 0);
@@
-297,7
+310,7
@@
pjrec_main (int argc, char * argv[])
#ifdef HAVE_MPI
TimerCollectiveMPI timerReconstruct (mpiWorld.getComm());
#ifdef HAVE_MPI
TimerCollectiveMPI timerReconstruct (mpiWorld.getComm());
- projLocal.reconstruct (*imLocal, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optZeroPad, optInterpName.c_str(), opt
InterpParam
, optBackprojName.c_str(), optTrace);
+ projLocal.reconstruct (*imLocal, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optZeroPad, optInterpName.c_str(), opt
PreinterpolationFactor
, optBackprojName.c_str(), optTrace);
if (optVerbose)
timerReconstruct.timerEndAndReport ("Time to reconstruct");
if (optVerbose)
timerReconstruct.timerEndAndReport ("Time to reconstruct");
@@
-306,7
+319,7
@@
pjrec_main (int argc, char * argv[])
if (optVerbose)
timerReduce.timerEndAndReport ("Time to reduce image");
#else
if (optVerbose)
timerReduce.timerEndAndReport ("Time to reduce image");
#else
- projGlobal.reconstruct (*imGlobal, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optZeroPad, optInterpName.c_str(), opt
InterpParam
, optBackprojName.c_str(), optTrace);
+ projGlobal.reconstruct (*imGlobal, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optZeroPad, optInterpName.c_str(), opt
PreinterpolationFactor
, optBackprojName.c_str(), optTrace);
#endif
#ifdef HAVE_MPI
#endif
#ifdef HAVE_MPI