Interim work on creating projections from an imagefile
[ctsim.git] / tools / phm2if.cpp
index 040f7e17e6d264bddcb05e57bfd12e18c610ca18..13f5b922705fad8074ea5004e34441169e9e9a04 100644 (file)
@@ -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)