cuda2023
This commit is contained in:
44
src/main.cxx
44
src/main.cxx
@@ -3,11 +3,17 @@
|
||||
#include "config/config.h"
|
||||
#include "log/notify.h"
|
||||
#include "log/notify.h"
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
#include "MatlabReader.h"
|
||||
#define EIGEN_USE_MKL_ALL
|
||||
|
||||
#include "src/common/fileHelper.h"
|
||||
#include "startReconstructions.h"
|
||||
|
||||
#include "transmissionReconstruction/detection/detection.h"
|
||||
#include "transmissionReconstruction/detection/detection.cuh"
|
||||
#include "startReconstructions.h"
|
||||
#include "log/log.h"
|
||||
/* 0 is data path.
|
||||
1 is dataRef path.
|
||||
@@ -20,8 +26,8 @@ int main(int argc, char *argv[])
|
||||
int argNum = 5;
|
||||
std::vector<std::string> args(argNum);
|
||||
args[0] = "";
|
||||
args[1] = "";
|
||||
args[2] = "";
|
||||
args[1] = "/home/sun/20230418T145123/";
|
||||
args[2] = "/home/sun/20230418T141000/";
|
||||
args[3] = Recon::DEFAULT_OUTPUT_PATH;
|
||||
args[4] = Recon::DEFAULT_CONFIG_PATH;
|
||||
argc = argc <= argNum? argc-1 : argNum;
|
||||
@@ -29,30 +35,29 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
args[i] = argv[i+1];
|
||||
}
|
||||
if(args[0].empty())
|
||||
{
|
||||
printf("No recon id.");
|
||||
return -1;
|
||||
}
|
||||
std::string outPutPath = args[3];
|
||||
std::string directoryPath = outPutPath;
|
||||
auto defaultLogger = getLogger("Main",outPutPath.data());
|
||||
spdlog::set_default_logger(defaultLogger);
|
||||
std::string ReconID = args[0];
|
||||
ReconID = ReconID=="none"?"":ReconID;
|
||||
RECON_INFO("Read UR Args =====================");
|
||||
RECON_INFO("ReconID:{0}",ReconID);
|
||||
if(args[1].empty())
|
||||
{
|
||||
printf("No reconstruction data.");
|
||||
RECON_INFO("No reconstruction data.");
|
||||
return -2;
|
||||
}
|
||||
std::string configPath = Recon::fixPathSlash(args[4]);
|
||||
Recon::initalizeConfig(configPath);
|
||||
if( args[2].empty() && Recon::transParams::runTransmissionReco)
|
||||
{
|
||||
printf("Running transmission reconstruction, but no refrence data.");
|
||||
RECON_INFO("Running transmission reconstruction, but no refrence data.");
|
||||
return -3;
|
||||
}
|
||||
RECON_INFO("configPath:{0}",configPath);
|
||||
|
||||
std::string outPutPath = args[3];
|
||||
std::string directoryPath = outPutPath;
|
||||
auto defaultLogger = getLogger("Main",outPutPath.data());
|
||||
spdlog::set_default_logger(defaultLogger);
|
||||
|
||||
|
||||
outPutPath = Recon::fixPathSlash(outPutPath);
|
||||
|
||||
if(!Recon::isDirectory(directoryPath))
|
||||
@@ -60,15 +65,18 @@ int main(int argc, char *argv[])
|
||||
RECON_INFO("Output directory is not valid.");
|
||||
return -4;
|
||||
}
|
||||
|
||||
RECON_INFO("outPutPath:{0}",directoryPath);
|
||||
std::string dataPath = Recon::fixPathSlash(args[1]);
|
||||
RECON_INFO("dataPath:{0}",dataPath);
|
||||
std::string dataRefPath = Recon::fixPathSlash(args[2]);
|
||||
RECON_INFO("start");
|
||||
RECON_INFO("dataRefPath:{0}",dataRefPath);
|
||||
RECON_INFO("UR Args End=======================");
|
||||
RECON_INFO("UR Start");
|
||||
Recon::notifyStart(ReconID);
|
||||
int exitcode = Recon::startReconstructions(dataPath, dataRefPath, outPutPath);
|
||||
int exitcode = Recon::startReconstructions(dataPath, dataRefPath, outPutPath+Recon::DEFAULT_OUTPUT_FILENAME);
|
||||
if (exitcode == 0)
|
||||
{
|
||||
RECON_INFO("finish");
|
||||
RECON_INFO("UR Finish");
|
||||
if (!Recon::notifyFinish()) {
|
||||
RECON_ERROR("Notify Finish failed!");
|
||||
return -100;
|
||||
|
||||
Reference in New Issue
Block a user