Interim work on creating projections from an imagefile
[ctsim.git] / tools / phm2if.cpp
index ab3115107b8998ec4b235a91886bc9ff3291d233..13f5b922705fad8074ea5004e34441169e9e9a04 100644 (file)
@@ -7,9 +7,7 @@
 **   Date Started:  1984
 **
 **  This is part of the CTSim program
-**  Copyright (C) 1983-2000 Kevin Rosenberg
-**
-**  $Id$
+**  Copyright (C) 1983-2009 Kevin Rosenberg
 **
 **  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
@@ -123,6 +121,8 @@ phm2if_main (int argc, char* const argv[])
   char *endstr;
   Timer timerProgram;
 
+  UNUSED(optDebug);
+
 #ifdef HAVE_MPI
   ImageFile* pImLocal = NULL;
   MPIWorld mpiWorld (argc, argv);
@@ -241,33 +241,34 @@ phm2if_main (int argc, char* const argv[])
 
     std::ostringstream oss;
     oss << "phm2if: nx=" << opt_nx << ", ny=" << opt_ny << ", viewRatio=" << optViewRatio << ", nsample=" << opt_nsample << ", ";
-    if (optPhmFilename != "")
+    if (!optPhmFilename.empty()) {
       oss << "phantomFile=" << optPhmFilename;
-    else if (optPhmName != "")
+    } else if (!optPhmName.empty()) {
       oss << "phantom=" << optPhmName;
-    else if (optFilterName != "") {
+    } else if (!optFilterName.empty()) {
       oss << "filter=" << optFilterName << " - " << optDomainName;
     }
-    if (optDesc != "")
+    if (!optDesc.empty())
       oss << ": " << optDesc;
     optDesc = oss.str();
 
-    if (optPhmName != "") {
+    if (! optPhmName.empty()) {
       phm.createFromPhantom (optPhmName.c_str());
       if (phm.fail()) {
         std::cout << phm.failMessage() << std::endl << std::endl;
         phm2if_usage(argv[0]);
         return (1);
       }
-    }
-
-    if (optPhmFilename != "") {
-      phm.createFromFile(optPhmFilename.c_str());
+    } else if (!optPhmFilename.empty()) {
+      phm.createFromPhmFile(optPhmFilename.c_str());
 #ifdef HAVE_MPI
       if (mpiWorld.getRank() == 0)
         std::cerr << "Can't use phantom from file in MPI mode\n";
       return (1);
 #endif
+    } else {
+      std::cerr << "Internal error\n";
+      return (1);
     }
 
     if (optVerbose)