r168: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 2 Aug 2000 18:06:00 +0000 (18:06 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 2 Aug 2000 18:06:00 +0000 (18:06 +0000)
ChangeLog
TODO
configure
configure.in
include/scanner.h
include/sgp.h
libctgraphics/sgp.cpp
libctsim/phantom.cpp
libctsim/scanner.cpp
src/views.cpp
tools/phm2if.cpp

index f80f630f7674c821c94e3d4a6594c0aaf1c2d307..73bbeb890e5ccde4148a79b64d9d5be9603c44d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2.0.0-b9 - 8/5/00
+   Added RPM Spec file for RPM package creation
+   Added loading of ASCII phanthom definitions from files
+       
 2.0.0-b8 - 8/1/00
    Added line color support to SGP
    Fixed lineAbs bug
diff --git a/TODO b/TODO
index 15c93d4ca31ea990d0fd67c4e795b7f960709b2b..006154230816e56c29446a50d375cb70a2caf967 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,3 +2,9 @@ Fix BUGS -- see BUGS file
 
 Convert pol to C++ object.
 
+Add loading / saving of arbitrary phantom objections in ASCII format.
+
+Adding animation of X-ray projection collection
+
+Add animation of filtering & backprojections
+
index 018913d4f5aa0e7fa8b1ce1abd0e95c5d3f84162..d32801366bb8dc377065a940219cce11aaffe41f 100755 (executable)
--- a/configure
+++ b/configure
@@ -712,7 +712,7 @@ fi
 
 PACKAGE=ctsim
 
-VERSION=2.0.0b8
+VERSION=2.0.0b9
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
index 6af88a0a8760bcdb78de093ae4f35f7d175a8d8b..b70cefe0759a5bcaebcb6798be1d1acb8dfa763d 100644 (file)
@@ -4,7 +4,7 @@ dnl Must reset CDPATH so that bash's cd does not print to stdout
 dnl CDPATH=
 
 AC_INIT(src/ctsim.cpp)
-AM_INIT_AUTOMAKE(ctsim,2.0.0b8)
+AM_INIT_AUTOMAKE(ctsim,2.0.0b9)
 AM_CONFIG_HEADER(config.h)
 
 dnl Checks for programs.
index 887c06ecdd54da2badfa6ba97ffa58193ac97524..550573a68e6ecdaccfd662d4ac4a36777e889407 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: scanner.h,v 1.10 2000/07/31 14:48:35 kevin Exp $
+**  $Id: scanner.h,v 1.11 2000/08/02 18:06:00 kevin Exp $
 **
 **
 **  This program is free software; you can redistribute it and/or modify
@@ -77,7 +77,7 @@ class Scanner
   Scanner (const Phantom& phm, const char* const geometryName, int nDet, int nView, int nSample, const double rot_anglen);
   ~Scanner();
   
-  void collectProjections (Projections& proj, const Phantom& phm, const int start_view, const int trace = TRACE_NONE, SGP* pSGP = NULL);
+  void collectProjections (Projections& proj, const Phantom& phm, const int start_view = 0, const int trace = TRACE_NONE, SGP* pSGP = NULL);
 
   void setNView (int nView);
 
index 32abbc405e2baae7c0ae11aec3903ac943a2c191..7cda247c9c52b2e64758807d06be24e64cc03f3b 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: sgp.h,v 1.12 2000/07/29 19:50:08 kevin Exp $
+**  $Id: sgp.h,v 1.13 2000/08/02 18:06:00 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
@@ -68,7 +68,7 @@ public:
   };
 
 #ifdef HAVE_WXWINDOWS
-  SGPDriver (wxDC* pDC, const char* szWinTitle = "", int xsize = 640, int ysize = 480);
+  SGPDriver (wxDC* pDC, int xsize = 640, int ysize = 480);
 #endif
 
   SGPDriver (const char* szWinTitle = "", int xsize = 640, int ysize = 480);
@@ -192,6 +192,7 @@ public:
   void setTextAngle (double angle);
   void setTextColor (int iFGcolor, int iBGcolor);
   void setMarker (int idMarker, int color);
+  void setRasterOp (int ro);
 
   void ctmClear ();
   void ctmSet (const TransformationMatrix2D& m);
@@ -232,6 +233,26 @@ enum {
     C_WHITE     = 15,
 };
 
+enum RasterOp {
+    RO_AND = 1,
+    RO_AND_INVERT,
+    RO_AND_REVERSE,
+    RO_CLEAR,
+    RO_COPY,
+    RO_EQUIV,
+    RO_INVERT,
+    RO_NAND,
+    RO_NOR,
+    RO_NO_OP,
+    RO_OR,
+    RO_OR_INVERT,
+    RO_OR_REVERSE,
+    RO_SET,
+    RO_SRC_INVERT,
+    RO_XOR,
+};
+
+
 class RGBColor {
  private:
   short int r;
index 1062901737201670c32db960935990d70bc26d5e..9d3f1fc0990e1c0cfab04cffdbcbc7d1caae7611 100644 (file)
@@ -7,7 +7,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: sgp.cpp,v 1.8 2000/07/31 14:48:35 kevin Exp $
+**  $Id: sgp.cpp,v 1.9 2000/08/02 18:06:00 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
@@ -52,8 +52,8 @@ RGBColor SGP::s_aRGBColor[] =
 int SGP::s_iRGBColorCount = sizeof(s_aRGBColor) / sizeof(class RGBColor);
 
 #ifdef HAVE_WXWINDOWS
-SGPDriver::SGPDriver (wxDC* pDC, const char* szWinTitle = "", int xsize = 640, int ysize = 480)
-  : m_iPhysicalXSize(xsize), m_iPhysicalYSize(ysize), m_sWindowTitle(szWinTitle), m_idDriver(0)
+SGPDriver::SGPDriver (wxDC* pDC, int xsize = 640, int ysize = 480)
+  : m_iPhysicalXSize(xsize), m_iPhysicalYSize(ysize), m_idDriver(0)
 {
   m_pDC = pDC;
   m_idDriver |= SGPDRIVER_WXWINDOWS;
@@ -232,6 +232,69 @@ SGP::setColor (int icol)
   }
 }
 
+void
+SGP::setRasterOp (int ro)
+{
+#if HAVE_WXWINDOWS
+  if (m_driver.isWX()) {
+    int wxFxn = -1;
+    switch (ro) {
+    case RO_AND:
+      wxFxn = wxAND;
+      break;
+    case RO_AND_INVERT:
+      wxFxn = wxAND_INVERT;
+      break;
+    case RO_AND_REVERSE:
+      wxFxn = wxAND_REVERSE;
+      break;
+    case RO_CLEAR:
+      wxFxn = wxCLEAR;
+      break;
+    case RO_COPY:
+      wxFxn = wxCOPY;
+      break;
+    case RO_EQUIV:
+      wxFxn = wxEQUIV;
+      break;
+    case RO_INVERT:
+      wxFxn = wxINVERT;
+      break;
+    case RO_NAND:
+      wxFxn = wxNAND;
+      break;
+    case RO_NOR:
+      wxFxn = wxNOR;
+      break;
+    case RO_NO_OP:
+      wxFxn = wxNO_OP;
+      break;
+    case RO_OR:
+      wxFxn = wxOR;
+      break;
+    case RO_OR_INVERT:
+      wxFxn = wxOR_INVERT;
+      break;
+    case RO_OR_REVERSE:
+      wxFxn = wxOR_REVERSE;
+      break;
+    case RO_SET:
+      wxFxn = wxSET;
+      break;
+    case RO_SRC_INVERT:
+      wxFxn = wxSRC_INVERT;
+      break;
+    case RO_XOR:
+      wxFxn = wxXOR;
+      break;
+    }
+    if (wxFxn >= 0)
+      m_driver.idWX()->SetLogicalFunction (wxFxn);
+  }
+#endif
+}
+
+
 void
 SGP::setMarker (int idMarke, int iColor)
 {
index ccf728a11d503c34c9ea1d507461c60efd1d78dd..09245b2205332b7ba02d2df14f0e63d66c5dbe97 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: phantom.cpp,v 1.14 2000/07/31 14:48:35 kevin Exp $
+**  $Id: phantom.cpp,v 1.15 2000/08/02 18:06:00 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
@@ -204,19 +204,25 @@ Phantom::createFromFile (const char* const fname)
     return (false);
 
   do {
-    double cx, cy, u, v, rot, dens;
-    char pelemtype[80];
-    int n = fscanf (fp, "%79s %lf %lf %lf %lf %lf %lf",
-               pelemtype, &cx, &cy, &u, &v, &rot, &dens);
+    if (! feof(fp)) {
+      double cx, cy, u, v, rot, dens;
+      char pelemtype[80];
+      char str[1024];
+      fgets (str, sizeof(str), fp);
+      int n = sscanf (str, "%79s %lf %lf %lf %lf %lf %lf", pelemtype, &cx, &cy, &u, &v, &rot, &dens);
     
-    if (n == EOF || n == 0) {  /* end of file */
-      stoploop = true;
-      retval = false;
-    } else if (n != 7) {
-      stoploop = true;
-      retval = false;
+      if (n == EOF || n == 0) {        /* end of file */
+       stoploop = true;
+       retval = false;
+      } else if (n != 7) {
+       stoploop = true;
+       retval = false;
+      } else {
+       addPElem (pelemtype, cx, cy, u, v, rot, dens);
+       retval = true;
+      }
     } else {
-      addPElem (pelemtype, cx, cy, u, v, rot, dens);
+      stoploop = true;
       retval = true;
     }
   } while (stoploop == false);
index 75da0ae4e2986b7f1c600682df044f33fe9ab0a7..5888d45569a16ea9ed0784003278dfd37bace071 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: scanner.cpp,v 1.8 2000/07/31 14:48:35 kevin Exp $
+**  $Id: scanner.cpp,v 1.9 2000/08/02 18:06:00 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
@@ -180,7 +180,7 @@ Scanner::convertGeometryNameToID (const char* const geomName)
 */
 
 void
-Scanner::collectProjections (Projections& proj, const Phantom& phm, const int start_view, const int trace = TRACE_NONE, SGP* pSGP = NULL)
+Scanner::collectProjections (Projections& proj, const Phantom& phm, const int start_view = 0, const int trace = TRACE_NONE, SGP* pSGP = NULL)
 {
   GRFMTX_2D rotmtx_initial, temp;
   GRFMTX_2D rotmtx_incr;
@@ -202,28 +202,26 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int st
 
 #ifdef HAVE_SGP 
   if (pSGP && m_trace >= TRACE_PHM) {
-    double wsize = 1.42 * m_phmLen / 2;        /* sqrt(2) * radius */
+    double halfPhmLen = m_phmLen / 2;
+    double wsize = SQRT2 * halfPhmLen;
 
+    pSGP->setRasterOp (RO_SET);
+    pSGP->eraseWindow ();
     pSGP->setColor (C_LTBLUE);
     pSGP->setWindow (xcent - wsize, ycent - wsize, xcent + wsize, ycent + wsize);
     pSGP->setColor (C_BROWN);
-#if RADIUS
-    pSGP->drawCircle (m_phmLen / 2);
-#else
-    pSGP->drawRect (xcent - m_phmLen / 2, ycent - m_phmLen / 2,
-                   xcent + m_phmLen / 2, ycent + m_phmLen / 2);
-#endif
+    pSGP->drawRect (xcent - halfPhmLen, ycent - halfPhmLen, xcent + halfPhmLen, ycent + halfPhmLen);
     pSGP->setColor (C_BROWN);
     pSGP->moveAbs (0., 0.);
     pSGP->drawCircle (wsize);
-    //      raysum_trace_menu_column = (crt->xsize * crt->asp) / 8 + 3;
+
     traceShowParam ("X-Ray Simulator", "%s", RAYSUM_TRACE_ROW_TITLE, C_BLACK, " ");
     traceShowParam ("---------------", "%s", RAYSUM_TRACE_ROW_TITLE2, C_BLACK, " ");
     traceShowParam ("Phantom:",       "%s", RAYSUM_TRACE_ROW_PHANT_ID, C_YELLOW, " Herman");
     traceShowParam ("Chomaticity  :", "%s", RAYSUM_TRACE_ROW_CHROMATIC, C_LTGREEN, "Mono");
     traceShowParam ("Scatter      :", "%5.1f", RAYSUM_TRACE_ROW_SCATTER, C_LTGREEN, 0.);
     traceShowParam ("Photon Uncert:", "%5.1f", RAYSUM_TRACE_ROW_PHOT_STAT, C_LTGREEN, 0.);
-    traceShowParam ("Num Scanners:", "%5d", RAYSUM_TRACE_ROW_NDET, C_LTRED, proj.nDet());
+    traceShowParam ("Num Detectors:", "%5d", RAYSUM_TRACE_ROW_NDET, C_LTRED, proj.nDet());
     traceShowParam ("Num Views    :", "%5d", RAYSUM_TRACE_ROW_NVIEW, C_LTRED, proj.nView());
     traceShowParam ("Samples / Ray:", "%5d", RAYSUM_TRACE_ROW_SAMPLES, C_LTRED, m_nSample);
     
@@ -260,6 +258,7 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int st
 
 #ifdef HAVE_SGP
     if (pSGP && m_trace >= TRACE_PHM) {
+      pSGP->setRasterOp (RO_XOR);
       pSGP->setColor (C_RED);
       pSGP->moveAbs (xd1, yd1);
       pSGP->lineAbs (xd2, yd2);
index 7f12594dee0b52802c19b99912e360e563ee35e0..1ca02ebf624e834c812079968c83138b65907c2d 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.12 2000/07/31 23:07:23 kevin Exp $
+**  $Id: views.cpp,v 1.13 2000/08/02 18:06:00 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
@@ -407,17 +407,16 @@ PhantomView::OnProjections (wxCommandEvent& event)
       rProj.initFromScanner (theScanner);
 
 #if 1
-      //wxScrolledWindow win (m_canvas, -1, wxDefaultPosition, wxSize(500,500), 0);
-      //win.SetSize (500, 500);
-      //      wxClientDC dc (&win);
-      //win.PrepareDC ();
-      //win.Show();
-      wxClientDC dc (m_canvas);
-      SGPDriver driver ((wxDC*) &dc, "Projections", 400, 400);
+      wxFrame frame (m_frame, -1, "", wxDefaultPosition, wxSize(500,500));
+      frame.Show();
+      wxClientDC dc (&frame);
+      int x, y;
+      frame.GetClientSize(&x, &y);
+      SGPDriver driver (dynamic_cast<wxDC*>(&dc), x, y);
       SGP sgp (driver);
       theScanner.collectProjections (rProj, rPhantom, 0, TRACE_PHM, &sgp);
 #else
-      theScanner.collectProjections (rProj, rPhantom, 0, TRACE_PHM);
+      theScanner.collectProjections (rProj, rPhantom);
 #endif
 
       pProjectionDoc->Modify(true);
@@ -573,7 +572,7 @@ PhantomView::OnDraw (wxDC* dc)
 {
   int xsize, ysize;
   m_canvas->GetClientSize (&xsize, &ysize);
-  SGPDriver driver (dc, "", xsize, ysize);
+  SGPDriver driver (dc, xsize, ysize);
   SGP sgp (driver);
   const Phantom& rPhantom = GetDocument()->getPhantom();
   sgp.setColor (C_RED);
index b027975bdc156f76bfc9b85115cee2bae164e795..d87afaffc65a69bbe3724ca77eafa89f8565b6c6 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: phm2if.cpp,v 1.4 2000/07/23 01:49:03 kevin Exp $
+**  $Id: phm2if.cpp,v 1.5 2000/08/02 18:06:00 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
@@ -50,6 +50,8 @@ static struct option my_options[] =
   {0, 0, 0, 0}
 };
 
+static const char* szIdStr = "$Id";
+
 void 
 phm2if_usage (const char *program)
 {
@@ -98,7 +100,7 @@ phm2if_usage (const char *program)
 }
 
 #ifdef HAVE_MPI
-void mpi_gather_image (MPIWorld& mpiWorld, ImageFile* pImGlobal, ImageFile* pImLocal, const int opt_debug);
+void mpi_gather_image (MPIWorld& mpiWorld, ImageFile* pImGlobal, ImageFile* pImLocal, const int optDebug);
 #endif
 
 int 
@@ -106,28 +108,25 @@ phm2if_main (int argc, char* argv[])
 {
   ImageFile* pImGlobal = NULL;
   Phantom phm;
-  int opt_nx = 0, opt_ny = 0;
-  int opt_nsample = 1;
   string optPhmName (Phantom::convertPhantomIDToName(Phantom::PHM_HERMAN));
   string optFilterName;
   string optDomainName (SignalFilter::convertDomainIDToName (SignalFilter::DOMAIN_SPATIAL));
-  char *opt_outfile = NULL;
-  int opt_debug = 0;
-  string opt_desc;
-  string opt_phmFileName;
-  char *endstr, *endptr;
-  double opt_filter_param = 1;
-  double opt_filter_bw = 1.;
-  int opt_trace = TRACE_NONE;
-  bool opt_verbose = false;
+  string optOutFilename;
+  string optDesc;
+  string optPhmFilename;
+  int opt_nx = 0;
+  int opt_ny = 0;
+  int opt_nsample = 1;
+  double optFilterParam = 1.;
+  double optFilterBW = 1.;
+  int optTrace = TRACE_NONE;
+  bool optVerbose = false;
+  bool optDebug = false;
+  Timer timerProgram;
+
 #ifdef HAVE_MPI
   ImageFile* pImLocal = NULL;
   MPIWorld mpiWorld (argc, argv);
-#endif
-
-  Timer timerProgram;
-  
-#ifdef HAVE_MPI
   if (mpiWorld.getRank() == 0) {
 #endif
     while (1) {
@@ -143,16 +142,16 @@ phm2if_main (int argc, char* argv[])
        optPhmName = optarg;
        break;
       case O_PHMFILE:
-       opt_phmFileName = optarg;
+       optPhmFilename = optarg;
        break;
       case O_VERBOSE:
-       opt_verbose = true;
+       optVerbose = true;
        break;
       case O_DEBUG:
-       opt_debug = 1;
+       optDebug = true;
        break;
       case O_TRACE:
-       if ((opt_trace = TraceLevel::convertTraceNameToID(optarg)) == TRACE_INVALID) {
+       if ((optTrace = TraceLevel::convertTraceNameToID(optarg)) == TRACE_INVALID) {
          phm2if_usage(argv[0]);
          return (1);
        }
@@ -164,10 +163,10 @@ phm2if_main (int argc, char* argv[])
        optDomainName = optarg;
        break;
       case O_DESC:
-       opt_desc =  optarg;
+       optDesc =  optarg;
        break;
       case O_FILTER_BW:
-       opt_filter_bw = strtod(optarg, &endptr);
+       optFilterBW = strtod(optarg, &endptr);
        endstr = optarg + strlen(optarg);
        if (endptr != endstr) {
          sys_error(ERR_SEVERE,"Error setting --filter-bw to %s\n", optarg);
@@ -176,7 +175,7 @@ phm2if_main (int argc, char* argv[])
        }
        break;
       case O_FILTER_PARAM:
-       opt_filter_param = strtod(optarg, &endptr);
+       optFilterParam = strtod(optarg, &endptr);
        endstr = optarg + strlen(optarg);
        if (endptr != endstr) {
          sys_error(ERR_SEVERE,"Error setting --filter-param to %s\n", optarg);
@@ -209,7 +208,7 @@ phm2if_main (int argc, char* argv[])
       }
     }
     
-    if (optPhmName == "" && optFilterName == "" && opt_phmFileName == "") {
+    if (optPhmName == "" && optFilterName == "" && optPhmFilename == "") {
       cerr << "No phantom defined" << endl << endl;
       phm2if_usage(argv[0]);
       return (1);
@@ -219,7 +218,7 @@ phm2if_main (int argc, char* argv[])
       phm2if_usage(argv[0]);
       return (1);
     }
-    opt_outfile = argv[optind];
+    optOutFilename = argv[optind];
     opt_nx = strtol(argv[optind+1], &endptr, 10);
     endstr = argv[optind+1] + strlen(argv[optind+1]);
     if (endptr != endstr) {
@@ -237,16 +236,16 @@ phm2if_main (int argc, char* argv[])
     
     ostringstream oss;
     oss << "phm2if: nx=" << opt_nx << ", ny=" << opt_ny << ", nsample=" << opt_nsample << ", ";
-    if (opt_phmFileName != "")
-      oss << "phantom=" << opt_phmFileName;
+    if (optPhmFilename != "")
+      oss << "phantomFile=" << optPhmFilename;
     else if (optPhmName != "")
       oss << "phantom=" << optPhmName;
     else if (optFilterName != "") {
       oss << "filter=" << optFilterName << " - " << optDomainName;
     }
-    if (opt_desc != "")
-      oss << ": " << opt_desc;
-    opt_desc = oss.str();
+    if (optDesc != "")
+      oss << ": " << optDesc;
+    optDesc = oss.str();
     
     if (optPhmName != "") {
       phm.createFromPhantom (optPhmName.c_str());
@@ -257,8 +256,8 @@ phm2if_main (int argc, char* argv[])
       }
     }
 
-    if (opt_phmFileName != "") {
-      phm.createFromFile(opt_phmFileName.c_str());
+    if (optPhmFilename != "") {
+      phm.createFromFile(optPhmFilename.c_str());
 #ifdef HAVE_MPI
       if (mpiWorld.getRank() == 0) 
        cerr << "Can't use phantom from file in MPI mode" << endl;
@@ -266,7 +265,7 @@ phm2if_main (int argc, char* argv[])
 #endif
     }
 
-    if (opt_verbose)
+    if (optVerbose)
       cout << "Rasterize Phantom to Image" << endl << endl;
 #ifdef HAVE_MPI
   }
@@ -275,19 +274,19 @@ phm2if_main (int argc, char* argv[])
 #ifdef HAVE_MPI
   TimerCollectiveMPI timerBcast (mpiWorld.getComm());
   mpiWorld.BcastString (optPhmName);
-  mpiWorld.getComm().Bcast (&opt_verbose, 1, MPI::INT, 0);
-  mpiWorld.getComm().Bcast (&opt_debug, 1, MPI::INT, 0);
-  mpiWorld.getComm().Bcast (&opt_trace, 1, MPI::INT, 0);
+  mpiWorld.getComm().Bcast (&optVerbose, 1, MPI::INT, 0);
+  mpiWorld.getComm().Bcast (&optDebug, 1, MPI::INT, 0);
+  mpiWorld.getComm().Bcast (&optTrace, 1, MPI::INT, 0);
   mpiWorld.getComm().Bcast (&opt_nx, 1, MPI::INT, 0);
   mpiWorld.getComm().Bcast (&opt_ny, 1, MPI::INT, 0);
   mpiWorld.getComm().Bcast (&opt_nsample, 1, MPI::INT, 0);
-  mpiWorld.getComm().Bcast (&opt_filter_param, 1, MPI::DOUBLE, 0);
-  mpiWorld.getComm().Bcast (&opt_filter_bw, 1, MPI::DOUBLE, 0);
+  mpiWorld.getComm().Bcast (&optFilterParam, 1, MPI::DOUBLE, 0);
+  mpiWorld.getComm().Bcast (&optFilterBW, 1, MPI::DOUBLE, 0);
 
   mpiWorld.BcastString (optFilterName);
   mpiWorld.BcastString (optDomainName);
 
-  if (opt_verbose)
+  if (optVerbose)
     timerBcast.timerEndAndReport ("Time to broadcast variables");
 
   mpiWorld.setTotalWorkUnits (opt_nx);
@@ -314,17 +313,17 @@ phm2if_main (int argc, char* argv[])
     }
   } else if (optFilterName != "") {
     if (mpiWorld.getRank() == 0) {
-      pImGlobal->filterResponse (optDomainName.c_str(), opt_filter_bw, optFilterName.c_str(), opt_filter_param);
+      pImGlobal->filterResponse (optDomainName.c_str(), optFilterBW, optFilterName.c_str(), optFilterParam);
     }
   } else {
     TimerCollectiveMPI timerRasterize (mpiWorld.getComm());
-    phm.convertToImagefile (*pImLocal, opt_nsample, opt_trace, mpiWorld.getMyStartWorkUnit(), mpiWorld.getMyLocalWorkUnits());
-    if (opt_verbose)
+    phm.convertToImagefile (*pImLocal, opt_nsample, optTrace, mpiWorld.getMyStartWorkUnit(), mpiWorld.getMyLocalWorkUnits());
+    if (optVerbose)
       timerRasterize.timerEndAndReport ("Time to rasterize phantom");
 
     TimerCollectiveMPI timerGather (mpiWorld.getComm());
-    mpi_gather_image (mpiWorld, pImGlobal, pImLocal, opt_debug);
-    if (opt_verbose)
+    mpi_gather_image (mpiWorld, pImGlobal, pImLocal, optDebug);
+    if (optVerbose)
       timerGather.timerEndAndReport ("Time to gather image");
   }
 #else
@@ -332,13 +331,13 @@ phm2if_main (int argc, char* argv[])
   if (phm.getComposition() == P_UNIT_PULSE) {
     v[opt_nx/2][opt_ny/2] = 1.;
   } else if (optFilterName != "") {
-    pImGlobal->filterResponse (optDomainName.c_str(), opt_filter_bw, optFilterName.c_str(), opt_filter_param);
+    pImGlobal->filterResponse (optDomainName.c_str(), optFilterBW, optFilterName.c_str(), optFilterParam);
   } else {
 #if HAVE_SGP
-      if (opt_trace >= TRACE_PHM)
+      if (optTrace >= TRACE_PHM)
        phm.show();
 #endif
-      phm.convertToImagefile (*pImGlobal, opt_nsample, opt_trace);
+      phm.convertToImagefile (*pImGlobal, opt_nsample, optTrace);
   }
 #endif
 
@@ -347,12 +346,12 @@ phm2if_main (int argc, char* argv[])
 #endif
   {
     double calctime = timerProgram.timerEnd ();
-    pImGlobal->labelAdd (Array2dFileLabel::L_HISTORY, opt_desc.c_str(), calctime);
-    pImGlobal->fileWrite (opt_outfile);
-    if (opt_verbose)
+    pImGlobal->labelAdd (Array2dFileLabel::L_HISTORY, optDesc.c_str(), calctime);
+    pImGlobal->fileWrite (optOutFilename.c_str());
+    if (optVerbose)
       cout << "Time to rasterized phantom: " << calctime << " seconds" << endl;
 
-    if (opt_trace >= TRACE_PHM) {
+    if (optTrace >= TRACE_PHM) {
       double dmin, dmax;
       int nscale;
       
@@ -375,7 +374,7 @@ phm2if_main (int argc, char* argv[])
 
 
 #ifdef HAVE_MPI
-void mpi_gather_image (MPIWorld& mpiWorld, ImageFile* pImGlobal, ImageFile* pImLocal, const int opt_debug)
+void mpi_gather_image (MPIWorld& mpiWorld, ImageFile* pImGlobal, ImageFile* pImLocal, const int optDebug)
 {
   ImageFileArray vLocal = pImLocal->getArray();
   ImageFileArray vGlobal = NULL;