projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r175: *** empty log message ***
[ctsim.git]
/
tools
/
pjrec.cpp
diff --git
a/tools/pjrec.cpp
b/tools/pjrec.cpp
index dd4ad81b6695334ecf4daa1506f36fb3bb4407d8..bab43e7a36ac1c947cca57c31b4467aa3ffc7fec 100644
(file)
--- a/
tools/pjrec.cpp
+++ b/
tools/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.
3 2000/07/20 11:17:31
kevin Exp $
+** $Id: pjrec.cpp,v 1.
10 2000/08/03 09:57:29
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,7
+29,7
@@
#include "timer.h"
#include "timer.h"
-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};
+enum {O_INTERP, O_FILTER, O_FILTER_METHOD, O_ZEROPAD, O_FILTER_PARAM, O_
FREQUENCY_FILTER, O_
BACKPROJ, O_PREINTERPOLATION_FACTOR, O_VERBOSE, O_TRACE, O_HELP, O_DEBUG, O_VERSION};
static struct option my_options[] =
{
static struct option my_options[] =
{
@@
-38,6
+38,7
@@
static struct option my_options[] =
{"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},
+ {"frequency-filter", 1, 0, O_FREQUENCY_FILTER},
{"filter-param", 1, 0, O_FILTER_PARAM},
{"backproj", 1, 0, O_BACKPROJ},
{"trace", 1, 0, O_TRACE},
{"filter-param", 1, 0, O_FILTER_PARAM},
{"backproj", 1, 0, O_BACKPROJ},
{"trace", 1, 0, O_TRACE},
@@
-48,6
+49,7
@@
static struct option my_options[] =
{0, 0, 0, 0}
};
{0, 0, 0, 0}
};
+static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.10 2000/08/03 09:57:29 kevin Exp $";
void
pjrec_usage (const char *program)
void
pjrec_usage (const char *program)
@@
-89,6
+91,9
@@
pjrec_usage (const char *program)
#endif
cout << " --zeropad n Set zeropad level (default = 0)\n";
cout << " set n to number of powers to two to pad\n";
#endif
cout << " --zeropad n Set zeropad level (default = 0)\n";
cout << " set n to number of powers to two to pad\n";
+ cout << " --frequency-filter Set type of frequency filter\n";
+ cout << " direct_frequency Use direct frequency filter\n";
+ cout << " inverse_spatial Use inverse fourier transform of spatial filter\n";
cout << " --backproj Backprojection Method" << endl;
cout << " trig Trigometric functions at every point" << endl;
cout << " table Trigometric functions with precalculated table" << endl;
cout << " --backproj Backprojection Method" << endl;
cout << " trig Trigometric functions at every point" << endl;
cout << " table Trigometric functions with precalculated table" << endl;
@@
-131,10
+136,11
@@
pjrec_main (int argc, char * argv[])
int optZeroPad = 0;
int optTrace = TRACE_NONE;
double optFilterParam = -1;
int optZeroPad = 0;
int optTrace = TRACE_NONE;
double optFilterParam = -1;
- string optFilterName = SignalFilter::FILTER_ABS_BANDLIMIT_STR;
- string optFilterMethodName = SignalFilter::FILTER_METHOD_CONVOLUTION_STR;
- string optInterpName = Backprojector::INTERP_LINEAR_STR;
- string optBackprojName = Backprojector::BPROJ_IDIFF2_STR;
+ string optFilterName (SignalFilter::convertFilterIDToName (SignalFilter::FILTER_ABS_BANDLIMIT));
+ string optFilterMethodName (SignalFilter::convertFilterMethodIDToName (SignalFilter::FILTER_METHOD_CONVOLUTION));
+ string optFrequencyFilterName (SignalFilter::convertFrequencyFilterIDToName (SignalFilter::FREQUENCY_FILTER_INVERSE_SPATIAL));
+ string optInterpName (Backprojector::convertInterpIDToName (Backprojector::INTERP_LINEAR));
+ string optBackprojName (Backprojector::convertBackprojectIDToName (Backprojector::BPROJ_IDIFF3));
int optPreinterpolationFactor = 1;
int nx, ny;
#ifdef HAVE_MPI
int optPreinterpolationFactor = 1;
int nx, ny;
#ifdef HAVE_MPI
@@
-174,8
+180,8
@@
pjrec_main (int argc, char * argv[])
case O_FILTER_METHOD:
optFilterMethodName = optarg;
break;
case O_FILTER_METHOD:
optFilterMethodName = optarg;
break;
- case O_
BACKPROJ
:
- opt
Backproj
Name = optarg;
+ case O_
FREQUENCY_FILTER
:
+ opt
FrequencyFilter
Name = optarg;
break;
case O_FILTER_PARAM:
optFilterParam = strtod(optarg, &endptr);
break;
case O_FILTER_PARAM:
optFilterParam = strtod(optarg, &endptr);
@@
-191,6
+197,9
@@
pjrec_main (int argc, char * argv[])
return(1);
}
break;
return(1);
}
break;
+ case O_BACKPROJ:
+ optBackprojName = optarg;
+ break;
case O_VERBOSE:
optVerbose = 1;
break;
case O_VERBOSE:
optVerbose = 1;
break;
@@
-205,7
+214,7
@@
pjrec_main (int argc, char * argv[])
break;
case O_VERSION:
#ifdef VERSION
break;
case O_VERSION:
#ifdef VERSION
- cout << "Version " << VERSION << endl;
+ cout << "Version " << VERSION << endl
<< g_szIdStr << endl
;
#else
cout << "Unknown version number" << endl;
#endif
#else
cout << "Unknown version number" << endl;
#endif
@@
-239,7
+248,7
@@
pjrec_main (int argc, char * argv[])
filterDesc << optFilterName;
ostringstream label;
filterDesc << optFilterName;
ostringstream label;
- label << "pjrec: " << nx << "x" << ny << ", " << filterDesc.str() << ", " << optInterpName << ", preinterpolation=" << optPreinterpolationFactor << ", " << optBackprojName;
+ label << "pjrec: " << nx << "x" << ny << ", " << filterDesc.str() << ", " << optInterpName << ", preinterpolation
Factor
=" << optPreinterpolationFactor << ", " << optBackprojName;
remark = label.str();
if (optVerbose)
remark = label.str();
if (optVerbose)
@@
-309,7
+318,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(), optPreinterpolationFactor, optBackprojName.c_str(), optTrace);
+ projLocal.reconstruct (*imLocal, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optZeroPad, opt
FrequencyFilterName.c_str(), opt
InterpName.c_str(), optPreinterpolationFactor, optBackprojName.c_str(), optTrace);
if (optVerbose)
timerReconstruct.timerEndAndReport ("Time to reconstruct");
if (optVerbose)
timerReconstruct.timerEndAndReport ("Time to reconstruct");
@@
-318,7
+327,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(), optPreinterpolationFactor, optBackprojName.c_str(), optTrace);
+ projGlobal.reconstruct (*imGlobal, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optZeroPad, opt
FrequencyFilterName.c_str(), opt
InterpName.c_str(), optPreinterpolationFactor, optBackprojName.c_str(), optTrace);
#endif
#ifdef HAVE_MPI
#endif
#ifdef HAVE_MPI