#include "Parser.h" #include "config/config.h" #include "log/notify.h" #include #define EIGEN_USE_MKL_ALL #include "src/common/fileHelper.h" #include "startReconstructions.h" #include "log/log.h" /* 0 is data path. 1 is dataRef path. 2 is output path. 3 is config file path. */ int main(int argc, char *argv[]) { int argNum = 4; std::vector args(argNum); args[0] = "/home/sun/20230418T141000/"; args[1] = "/home/sun/20230418T145123/"; args[2] = Recon::DEFAULT_OUTPUT_PATH; args[3] = Recon::DEFAULT_CONFIG_PATH; argc = argc <= argNum? argc-1 : argNum; for (int i = 0; i < argc; i++) { args[i] = argv[i+1]; } if(args[0].empty()) { RECON_INFO("No reconstruction data."); return 0; } std::string configPath = Recon::fixPathSlash(args[3]); Recon::initalizeConfig(configPath); if( args[1].empty() && Recon::transParams::runTransmissionReco) { RECON_INFO("Running transmission reconstruction, but no refrence data."); return 0; } std::string outPutPath = args[2]; std::string directoryPath = outPutPath; if(Recon::endsWithMat(outPutPath)) { directoryPath = Recon::getPath(outPutPath); } else { outPutPath = Recon::fixPathSlash(outPutPath) + Recon::DEFAULT_OUTPUT_FILENAME; } if(!Recon::isDirectory(directoryPath)) { RECON_INFO("Output directory is not valid."); return 0; } std::string dataPath = Recon::fixPathSlash(args[0]); std::string dataRefPath = Recon::fixPathSlash(args[1]); RECON_INFO("start"); Recon::startReconstructions(dataPath, dataRefPath, outPutPath); SPDLOG_INFO("finish"); return 0; }