X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=tools%2Fphm2if.cpp;fp=tools%2Fphm2if.cpp;h=13f5b922705fad8074ea5004e34441169e9e9a04;hp=040f7e17e6d264bddcb05e57bfd12e18c610ca18;hb=747a2ec9e0f3c49723b36da0cc77270fbecc9dfe;hpb=728543fba0d875b2977ea2b6562df1ee4a6af8f7 diff --git a/tools/phm2if.cpp b/tools/phm2if.cpp index 040f7e1..13f5b92 100644 --- a/tools/phm2if.cpp +++ b/tools/phm2if.cpp @@ -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)