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