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