** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: phm2pj.cpp,v 1.29 2001/03/02 20:25:11 kevin Exp $
+** $Id: phm2pj.cpp,v 1.31 2001/09/24 09:40:42 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
enum { O_PHANTOM, O_DESC, O_NRAY, O_ROTANGLE, O_PHMFILE, O_GEOMETRY, O_FOCAL_LENGTH, O_CENTER_DETECTOR_LENGTH,
-O_VIEW_RATIO, O_SCAN_RATIO, O_TRACE, O_VERBOSE, O_HELP, O_DEBUG, O_VERSION };
+O_VIEW_RATIO, O_SCAN_RATIO, O_OFFSETVIEW, O_TRACE, O_VERBOSE, O_HELP, O_DEBUG, O_VERSION };
static struct option phm2pj_options[] =
{
{"geometry", 1, 0, O_GEOMETRY},
{"focal-length", 1, 0, O_FOCAL_LENGTH},
{"center-detector-length", 1, 0, O_CENTER_DETECTOR_LENGTH},
+ {"offsetview", 1, 0, O_OFFSETVIEW},
{"view-ratio", 1, 0, O_VIEW_RATIO},
{"scan-ratio", 1, 0, O_SCAN_RATIO},
{"trace", 1, 0, O_TRACE},
{0, 0, 0, 0}
};
-static const char* g_szIdStr = "$Id: phm2pj.cpp,v 1.29 2001/03/02 20:25:11 kevin Exp $";
+static const char* g_szIdStr = "$Id: phm2pj.cpp,v 1.31 2001/09/24 09:40:42 kevin Exp $";
void
std::cout << " nview Number of rotated views\n";
std::cout << " --phantom Phantom to use for projection\n";
std::cout << " herman Herman head phantom\n";
- std::cout << " herman-b Herman head phantom (Bordered)\n";
std::cout << " shepp-logan Shepp-Logan head phantom\n";
- std::cout << " shepp-logan-b Shepp-Logan head phantom (Bordered)\n";
- std::cout << " unitpulse Unit pulse phantom\n";
+ std::cout << " unit-pulse Unit pulse phantom\n";
std::cout << " --phmfile Get Phantom from phantom file\n";
std::cout << " --desc Description of raysum\n";
std::cout << " --nray Number of rays per detector (default = 1)\n";
std::cout << " (default = 1)\n";
std::cout << " --scan-ratio Length to scan (scan diameter to view diameter)\n";
std::cout << " (default = 1)\n";
+ std::cout << " --offsetview Initial gantry offset in 'views' (default = 0)\n";
std::cout << " --trace Trace level to use\n";
std::cout << " none No tracing (default)\n";
std::cout << " console Trace text level\n";
std::string optPhmFileName;
int opt_ndet;
int opt_nview;
+ int opt_offsetview = 0;
int opt_nray = 1;
double dOptFocalLength = 2.;
double dOptCenterDetectorLength = 2.;
return (1);
}
break;
+ case O_OFFSETVIEW:
+ opt_offsetview = strtol(optarg, &endptr, 10);
+ endstr = optarg + strlen(optarg);
+ if (endptr != endstr) {
+ std::cerr << "Error setting --offsetview to %s" << optarg << std::endl;
+ phm2pj_usage(argv[0]);
+ return (1);
+ }
+ break;
+
case O_VERSION:
#ifdef VERSION
std::cout << "Version: " << VERSION << std::endl << g_szIdStr << std::endl;
}
std::ostringstream desc;
- desc << "phm2pj: NDet=" << opt_ndet << ", Nview=" << opt_nview << ", NRay=" << opt_nray << ", RotAngle=" << opt_rotangle << ", Geometry=" << optGeometryName << ", ";
+ desc << "phm2pj: NDet=" << opt_ndet << ", Nview=" << opt_nview << ", NRay=" << opt_nray << ", RotAngle=" << opt_rotangle << "OffsetView =" << opt_offsetview << ", Geometry=" << optGeometryName << ", ";
if (optPhmFileName.length()) {
desc << "PhantomFile=" << optPhmFileName;
} else if (optPhmName != "") {
#endif
opt_rotangle *= TWOPI;
- Scanner scanner (phm, optGeometryName.c_str(), opt_ndet, opt_nview, opt_nray, opt_rotangle, dOptFocalLength,
- dOptCenterDetectorLength, dOptViewRatio, dOptScanRatio);
+ Scanner scanner (phm, optGeometryName.c_str(), opt_ndet, opt_nview, opt_offsetview, opt_nray,
+ opt_rotangle, dOptFocalLength, dOptCenterDetectorLength, dOptViewRatio, dOptScanRatio);
if (scanner.fail()) {
std::cout << "Scanner Creation Error: " << scanner.failMessage() << std::endl;
return (1);
#else
Projections pjGlobal (scanner);
- scanner.collectProjections (pjGlobal, phm, opt_trace);
+ scanner.collectProjections (pjGlobal, phm, 0, opt_nview, opt_offsetview, true, opt_trace);
#endif
#ifdef HAVE_MPI