Files
UR/src/main.cxx

66 lines
1.7 KiB
C++
Raw Normal View History

2023-10-09 09:29:21 +08:00
#include "Parser.h"
2023-06-14 14:48:53 +08:00
#include "config/config.h"
2023-10-09 09:29:21 +08:00
#include "log/notify.h"
2023-06-28 16:48:28 +08:00
#include <vector>
2023-05-04 16:37:33 +08:00
#define EIGEN_USE_MKL_ALL
2023-06-28 16:48:28 +08:00
#include "src/common/fileHelper.h"
2023-06-02 15:51:45 +08:00
#include "startReconstructions.h"
2023-06-15 09:14:04 +08:00
#include "log/log.h"
2023-06-28 16:48:28 +08:00
/* 0 is data path.
1 is dataRef path.
2 is output path.
3 is config file path.
*/
int main(int argc, char *argv[])
2023-05-04 16:37:33 +08:00
{
2023-06-28 16:48:28 +08:00
int argNum = 4;
std::vector<std::string> args(argNum);
2023-10-09 09:29:21 +08:00
args[0] = "/home/sun/20230418T141000/";
args[1] = "/home/sun/20230418T145123/";
2023-06-28 16:48:28 +08:00
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]);
2023-06-15 09:14:04 +08:00
RECON_INFO("start");
2023-06-28 16:48:28 +08:00
Recon::startReconstructions(dataPath, dataRefPath, outPutPath);
2023-06-05 14:55:53 +08:00
SPDLOG_INFO("finish");
2023-05-04 16:37:33 +08:00
return 0;
}