Update config from files.
This commit is contained in:
@@ -1,9 +1,623 @@
|
||||
#include "Function2D.h"
|
||||
#include "Matrix.h"
|
||||
#include <vector>
|
||||
#define GLOBLE_CONFIG
|
||||
#include "config.h"
|
||||
#include "src/log/log.h"
|
||||
#include "json.hpp"
|
||||
#include <fstream>
|
||||
|
||||
namespace Recon
|
||||
{
|
||||
const std::string ReconParamsFileName = "configReconstruction_USCT3Dv3.json";
|
||||
const std::string ReflectParamsFileName = "configReflectionReconstruction_USCT3Dv3.json";
|
||||
const std::string TransParramsFileName = "configTransmissionReconstruction_USCT3Dv3.json";
|
||||
const std::string ConfigPath= "./";
|
||||
|
||||
Aurora::Matrix readToMatrix(const nlohmann::json& aJsonObj, bool aIsHorizontal = true)
|
||||
{
|
||||
if(aJsonObj.is_array())
|
||||
{
|
||||
std::vector<double> vec = aJsonObj.get<std::vector<double>>();
|
||||
double* data = vec.data();
|
||||
int size = vec.size();
|
||||
if(aIsHorizontal)
|
||||
{
|
||||
return Aurora::Matrix::copyFromRawData(data, 1, size);
|
||||
}
|
||||
return Aurora::Matrix::copyFromRawData(data, size);
|
||||
}
|
||||
|
||||
if(aJsonObj.is_number())
|
||||
{
|
||||
double value = aJsonObj.get<double>();
|
||||
return Aurora::Matrix::fromRawData(new double[1]{value}, 1);
|
||||
}
|
||||
|
||||
return Aurora::Matrix();
|
||||
}
|
||||
|
||||
void initalizeConfigFromFiles()
|
||||
{
|
||||
nlohmann::json reconParamsJson;
|
||||
nlohmann::json reflectParamsJson;
|
||||
nlohmann::json transParamsJson;
|
||||
std::ifstream reconParamsFile(ReconParamsFileName);
|
||||
std::ifstream reflectParamsFile(ReflectParamsFileName);
|
||||
std::ifstream transParamsFile(TransParramsFileName);
|
||||
if(reconParamsFile.good())
|
||||
{
|
||||
reconParamsFile >> reconParamsJson;
|
||||
if(reconParamsJson.contains("files"))
|
||||
{
|
||||
nlohmann::json files = reconParamsJson.at("files");
|
||||
if(files.contains("measurementInfo"))
|
||||
{
|
||||
nlohmann::json measurementInfo = files.at("measurementInfo");
|
||||
if(measurementInfo.contains("ce"))
|
||||
{
|
||||
nlohmann::json ce = measurementInfo.at("ce");
|
||||
if(ce.contains("useCEMeasured"))
|
||||
{
|
||||
reconParams::useCEMeasured = ce.at("useCEMeasured").get<int>();
|
||||
}
|
||||
if(ce.contains("removeOutliersFromCEMeasured"))
|
||||
{
|
||||
reconParams::removeOutliersFromCEMeasured = ce.at("removeOutliersFromCEMeasured").get<int>();
|
||||
}
|
||||
if(ce.contains("offsetFilterEnabled"))
|
||||
{
|
||||
reconParams::offsetFilterEnabled = ce.at("offsetFilterEnabled").get<double>();
|
||||
}
|
||||
if(ce.contains("offsetFilterDisabled"))
|
||||
{
|
||||
reconParams::offsetFilterDisabled = ce.at("offsetFilterDisabled").get<double>();
|
||||
}
|
||||
}
|
||||
|
||||
if(measurementInfo.contains("temp"))
|
||||
{
|
||||
nlohmann::json temp = measurementInfo.at("temp");
|
||||
if(temp.contains("useTASTempComp"))
|
||||
{
|
||||
reconParams::useTASTempComp = temp.at("useTASTempComp").get<int>();
|
||||
}
|
||||
if(temp.contains("correctTASTemp"))
|
||||
{
|
||||
reconParams::correctTASTemp = temp.at("correctTASTemp").get<int>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(files.contains("hardwareSelection"))
|
||||
{
|
||||
nlohmann::json hardwareSelection = files.at("hardwareSelection");
|
||||
if(hardwareSelection.contains("gpuSelectionList"))
|
||||
{
|
||||
nlohmann::json gpuSelectionList = hardwareSelection.at("gpuSelectionList");
|
||||
reconParams::gpuSelectionList = readToMatrix(gpuSelectionList, false);
|
||||
}
|
||||
}
|
||||
|
||||
if(files.contains("dataInfo"))
|
||||
{
|
||||
nlohmann::json dataInfo = files.at("dataInfo");
|
||||
if(dataInfo.contains("expectedAScanLength"))
|
||||
{
|
||||
reconParams::expectedAScanDataLength = dataInfo.at("expectedAScanLength").get<int>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RECON_INFO(ReconParamsFileName + " not found.");
|
||||
}
|
||||
|
||||
if(reflectParamsFile.good())
|
||||
{
|
||||
reflectParamsFile >> reflectParamsJson;
|
||||
if(reflectParamsJson.contains("params"))
|
||||
{
|
||||
nlohmann::json params = reflectParamsJson.at("params");
|
||||
if(params.contains("runReflectionReco"))
|
||||
{
|
||||
reflectParams::runReflectionReco = params.at("runReflectionReco").get<int>();
|
||||
}
|
||||
|
||||
if(params.contains("dataSelection"))
|
||||
{
|
||||
nlohmann::json dataSelection = params.at("dataSelection");
|
||||
if(dataSelection.contains("senderTasList"))
|
||||
{
|
||||
reflectParams::senderTasList = readToMatrix(dataSelection.at("senderTasList"), false);
|
||||
}
|
||||
if(dataSelection.contains("senderElementList"))
|
||||
{
|
||||
reflectParams::senderElementList = readToMatrix(dataSelection.at("senderElementList"), false);
|
||||
}
|
||||
if(dataSelection.contains("receiverTasList"))
|
||||
{
|
||||
reflectParams::receiverTasList = readToMatrix(dataSelection.at("receiverTasList"), false);
|
||||
}
|
||||
if(dataSelection.contains("receiverElementList"))
|
||||
{
|
||||
reflectParams::receiverElementList = readToMatrix(dataSelection.at("receiverElementList"), false);
|
||||
}
|
||||
if(dataSelection.contains("motorPos"))
|
||||
{
|
||||
reflectParams::motorPos = readToMatrix(dataSelection.at("motorPos"), false);
|
||||
}
|
||||
if(dataSelection.contains("constrictReflectionAngles"))
|
||||
{
|
||||
reflectParams::constrictReflectionAngles = dataSelection.at("constrictReflectionAngles").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("angleLowerLimit"))
|
||||
{
|
||||
reflectParams::angleLowerLimit = dataSelection.at("angleLowerLimit").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("angleUpperLimit"))
|
||||
{
|
||||
reflectParams::angleUpperLimit = dataSelection.at("angleUpperLimit").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("findDefects"))
|
||||
{
|
||||
reflectParams::findDefects = dataSelection.at("findDefects").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("epsilon"))
|
||||
{
|
||||
reflectParams::epsilon = dataSelection.at("epsilon").get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("dataBlocking"))
|
||||
{
|
||||
nlohmann::json dataBlocking = params.at("dataBlocking");
|
||||
if(dataBlocking.contains("mpSize"))
|
||||
{
|
||||
reflectParams::mpSize = dataBlocking.at("mpSize").get<int>();
|
||||
}
|
||||
if(dataBlocking.contains("senderTASSize"))
|
||||
{
|
||||
reflectParams::senderTASSize = dataBlocking.at("senderTASSize").get<int>();
|
||||
}
|
||||
if(dataBlocking.contains("senderElementSize"))
|
||||
{
|
||||
reflectParams::senderElementSize = dataBlocking.at("senderElementSize").get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("qualityCheck"))
|
||||
{
|
||||
nlohmann::json qualityCheck = params.at("qualityCheck");
|
||||
if(qualityCheck.contains("qualityCheck"))
|
||||
{
|
||||
reflectParams::qualityCheck = qualityCheck.at("qualityCheck").get<int>();
|
||||
}
|
||||
if(qualityCheck.contains("warningThreshold"))
|
||||
{
|
||||
reflectParams::warningThreshold = qualityCheck.at("warningThreshold").get<double>();
|
||||
}
|
||||
if(qualityCheck.contains("errorThreshold"))
|
||||
{
|
||||
reflectParams::errorThreshold = qualityCheck.at("errorThreshold").get<double>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("dataPreparation"))
|
||||
{
|
||||
nlohmann::json dataPreparation = params.at("dataPreparation");
|
||||
if(dataPreparation.contains("version"))
|
||||
{
|
||||
reflectParams::version = dataPreparation.at("version").get<int>();
|
||||
}
|
||||
if(dataPreparation.contains("aScanReconstructionFrequency"))
|
||||
{
|
||||
reflectParams::aScanReconstructionFrequency = dataPreparation.at("aScanReconstructionFrequency").get<int>();
|
||||
}
|
||||
if(dataPreparation.contains("offsetElectronic"))
|
||||
{
|
||||
reflectParams::offsetElectronic = dataPreparation.at("offsetElectronic").get<double>();
|
||||
}
|
||||
if(dataPreparation.contains("removeDCOffset"))
|
||||
{
|
||||
reflectParams::removeDCOffset = dataPreparation.at("removeDCOffset").get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("imageInfos"))
|
||||
{
|
||||
nlohmann::json imageInfos = params.at("imageInfos");
|
||||
if(imageInfos.contains("pixelResolutionX"))
|
||||
{
|
||||
reflectParams::pixelResolutionX = imageInfos.at("pixelResolutionX").get<double>();
|
||||
}
|
||||
if(imageInfos.contains("pixelResolutionY"))
|
||||
{
|
||||
reflectParams::pixelResolutionY = imageInfos.at("pixelResolutionY").get<double>();
|
||||
}
|
||||
if(imageInfos.contains("imageStartpoint"))
|
||||
{
|
||||
reflectParams::imageStartpoint = readToMatrix(imageInfos.at("imageStartpoint"));
|
||||
}
|
||||
if(imageInfos.contains("imageEndpoint"))
|
||||
{
|
||||
reflectParams::imageEndpoint = readToMatrix(imageInfos.at("imageEndpoint"));
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("signalProcessing"))
|
||||
{
|
||||
nlohmann::json signalProcessing = params.at("signalProcessing");
|
||||
if(signalProcessing.contains("useOptPulse"))
|
||||
{
|
||||
reflectParams::useOptPulse = signalProcessing.at("useOptPulse").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("optPulseFactor"))
|
||||
{
|
||||
reflectParams::optPulseFactor = signalProcessing.at("optPulseFactor").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("expectedPulseLength"))
|
||||
{
|
||||
reflectParams::expectedPulseLength = signalProcessing.at("expectedPulseLength").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("limitNumPulsesTo"))
|
||||
{
|
||||
reflectParams::limitNumPulsesTo = signalProcessing.at("limitNumPulsesTo").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("normalizePeaks"))
|
||||
{
|
||||
reflectParams::normalizePeaks = signalProcessing.at("normalizePeaks").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("removeTransmissionSignal"))
|
||||
{
|
||||
reflectParams::removeTransmissionSignal = signalProcessing.at("removeTransmissionSignal").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("suppressSameHead"))
|
||||
{
|
||||
reflectParams::suppressSameHead = signalProcessing.at("suppressSameHead").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("suppressSameHeadLength"))
|
||||
{
|
||||
reflectParams::suppressSameHeadLength = signalProcessing.at("suppressSameHeadLength").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("useCorrelation"))
|
||||
{
|
||||
reflectParams::useCorrelation = signalProcessing.at("useCorrelation").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("matchedFilterCeAScan"))
|
||||
{
|
||||
reflectParams::matchedFilterCeAScan = signalProcessing.at("matchedFilterCeAScan").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("windowLength"))
|
||||
{
|
||||
reflectParams::windowLength = signalProcessing.at("windowLength").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("numThreads"))
|
||||
{
|
||||
reflectParams::numThreads = signalProcessing.at("numThreads").get<int>();
|
||||
}
|
||||
if(signalProcessing.contains("expectedUSSpeedRange"))
|
||||
{
|
||||
reflectParams::expectedUSSpeedRange = readToMatrix(signalProcessing.at("expectedUSSpeedRange"));
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("transmissionCorrection"))
|
||||
{
|
||||
nlohmann::json transmissionCorrection = params.at("transmissionCorrection");
|
||||
if(transmissionCorrection.contains("soundSpeedCorrection"))
|
||||
{
|
||||
reflectParams::soundSpeedCorrection = transmissionCorrection.at("soundSpeedCorrection").get<int>();
|
||||
}
|
||||
if(transmissionCorrection.contains("attenuationCorrection"))
|
||||
{
|
||||
reflectParams::attenuationCorrection = transmissionCorrection.at("attenuationCorrection").get<int>();
|
||||
}
|
||||
if(transmissionCorrection.contains("saveTransmInReflCoords"))
|
||||
{
|
||||
reflectParams::saveTransmInReflCoords = transmissionCorrection.at("saveTransmInReflCoords").get<int>();
|
||||
}
|
||||
if(transmissionCorrection.contains("resolutionTransmMap"))
|
||||
{
|
||||
reflectParams::resolutionTransmMap = transmissionCorrection.at("resolutionTransmMap").get<double>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("saft"))
|
||||
{
|
||||
nlohmann::json saft = params.at("saft");
|
||||
if(saft.contains("debugMode"))
|
||||
{
|
||||
reflectParams::debugMode = saft.at("debugMode").get<int>();
|
||||
}
|
||||
if(saft.contains("blockSizeReco"))
|
||||
{
|
||||
reflectParams::blockSizeReco = saft.at("blockSizeReco").get<int>();
|
||||
}
|
||||
if(saft.contains("medianWindowSize"))
|
||||
{
|
||||
reflectParams::medianWindowSize = saft.at("medianWindowSize").get<int>();
|
||||
}
|
||||
if(saft.contains("saftVariant"))
|
||||
{
|
||||
reflectParams::saftVariant = readToMatrix(saft.at("saftVariant"));
|
||||
}
|
||||
if(saft.contains("useAscanIndex"))
|
||||
{
|
||||
reflectParams::useAscanIndex = saft.at("useAscanIndex").get<int>();
|
||||
}
|
||||
if(saft.contains("attenuationCorrectionLimit"))
|
||||
{
|
||||
reflectParams::attenuationCorrectionLimit = saft.at("attenuationCorrectionLimit").get<int>();
|
||||
}
|
||||
if(saft.contains("blockDimXYZ"))
|
||||
{
|
||||
reflectParams::blockDimXYZ = readToMatrix(saft.at("blockDimXYZ"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RECON_INFO(ReflectParamsFileName + " not found.");
|
||||
}
|
||||
|
||||
if(transParamsFile.good())
|
||||
{
|
||||
transParamsFile >> transParamsJson;
|
||||
if(transParamsJson.contains("params"))
|
||||
{
|
||||
nlohmann::json params = transParamsJson.at("params");
|
||||
if(params.contains("runTransmissionReco"))
|
||||
{
|
||||
transParams::runTransmissionReco = params.at("runTransmissionReco").get<int>();
|
||||
}
|
||||
|
||||
if(params.contains("verbose"))
|
||||
{
|
||||
transParams::verbose = params.at("verbose").get<int>();
|
||||
}
|
||||
|
||||
if(params.contains("saveReco"))
|
||||
{
|
||||
transParams::saveRecon = params.at("saveReco").get<int>();
|
||||
}
|
||||
|
||||
if(params.contains("saveDebugInformation"))
|
||||
{
|
||||
transParams::saveDebugInfomation = params.at("saveDebugInformation").get<int>();
|
||||
}
|
||||
|
||||
if(params.contains("dataSelection"))
|
||||
{
|
||||
nlohmann::json dataSelection = params.at("dataSelection");
|
||||
if(dataSelection.contains("senderTasList"))
|
||||
{
|
||||
reflectParams::senderTasList = readToMatrix(dataSelection.at("senderTasList"), false);
|
||||
}
|
||||
if(dataSelection.contains("receiverTasList"))
|
||||
{
|
||||
reflectParams::receiverTasList = readToMatrix(dataSelection.at("receiverTasList"), false);
|
||||
}
|
||||
if(dataSelection.contains("senderElementList"))
|
||||
{
|
||||
reflectParams::senderElementList = readToMatrix(dataSelection.at("senderElementList"), false);
|
||||
}
|
||||
if(dataSelection.contains("receiverElementList"))
|
||||
{
|
||||
reflectParams::receiverElementList = readToMatrix(dataSelection.at("receiverElementList"), false);
|
||||
}
|
||||
if(dataSelection.contains("motorPos"))
|
||||
{
|
||||
reflectParams::motorPos = readToMatrix(dataSelection.at("motorPos"), false);
|
||||
}
|
||||
if(dataSelection.contains("filterSensitivity"))
|
||||
{
|
||||
transParams::filterSensitivity = dataSelection.at("filterSensitivity").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("sensFilter"))
|
||||
{
|
||||
transParams::sensFilter = dataSelection.at("sensFilter").get<double>();
|
||||
}
|
||||
if(dataSelection.contains("angleLowerLimit"))
|
||||
{
|
||||
transParams::angleLowerLimit = dataSelection.at("angleLowerLimit").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("angleUpperLimit"))
|
||||
{
|
||||
transParams::angleUpperLimit = dataSelection.at("angleUpperLimit").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("applyCalib"))
|
||||
{
|
||||
transParams::applyCalib = dataSelection.at("applyCalib").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("snrThreshold"))
|
||||
{
|
||||
transParams::snrThreshold = dataSelection.at("snrThreshold").get<int>();
|
||||
}
|
||||
if(dataSelection.contains("calibReferenceTas"))
|
||||
{
|
||||
nlohmann::json calibReferenceTas = dataSelection.at("calibReferenceTas");
|
||||
transParams::calibReferenceTas = readToMatrix(calibReferenceTas, false);
|
||||
}
|
||||
if(dataSelection.contains("calibReferenceMotorPosition"))
|
||||
{
|
||||
nlohmann::json calibReferenceMotorPosition = dataSelection.at("calibReferenceMotorPosition");
|
||||
transParams::calibReferenceMotorPosition = readToMatrix(calibReferenceMotorPosition, false);
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("qualityCheck"))
|
||||
{
|
||||
nlohmann::json qualityCheck = params.at("qualityCheck");
|
||||
if(qualityCheck.contains("qualityCheck"))
|
||||
{
|
||||
transParams::qualityCheck = qualityCheck.at("qualityCheck").get<int>();
|
||||
}
|
||||
if(qualityCheck.contains("warningThreshold"))
|
||||
{
|
||||
transParams::warningThreshold = qualityCheck.at("warningThreshold").get<double>();
|
||||
}
|
||||
if(qualityCheck.contains("errorThreshold"))
|
||||
{
|
||||
transParams::errorThreshold = qualityCheck.at("errorThreshold").get<double>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("dataBlocking"))
|
||||
{
|
||||
nlohmann::json dataBlocking = params.at("dataBlocking");
|
||||
if(dataBlocking.contains("mpSize"))
|
||||
{
|
||||
transParams::mpSize = dataBlocking.at("mpSize").get<int>();
|
||||
}
|
||||
if(dataBlocking.contains("senderTASSize"))
|
||||
{
|
||||
transParams::senderTASSize = dataBlocking.at("senderTASSize").get<int>();
|
||||
}
|
||||
if(dataBlocking.contains("senderElementSize"))
|
||||
{
|
||||
transParams::senderElementSize = dataBlocking.at("senderElementSize").get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("dataPreparation"))
|
||||
{
|
||||
nlohmann::json dataPreparation = params.at("dataPreparation");
|
||||
if(dataPreparation.contains("numPixelXY"))
|
||||
{
|
||||
transParams::numPixelXY = dataPreparation.at("numPixelXY").get<int>();
|
||||
}
|
||||
if(dataPreparation.contains("offsetElectronic"))
|
||||
{
|
||||
transParams::offsetElectronic = dataPreparation.at("offsetElectronic").get<double>();
|
||||
}
|
||||
if(dataPreparation.contains("aScanReconstructionFrequency"))
|
||||
{
|
||||
transParams::aScanReconstructionFrequency = dataPreparation.at("aScanReconstructionFrequency").get<int>();
|
||||
}
|
||||
if(dataPreparation.contains("minTemperature"))
|
||||
{
|
||||
transParams::minTemperature = dataPreparation.at("minTemperature").get<double>();
|
||||
}
|
||||
if(dataPreparation.contains("maxTemperature"))
|
||||
{
|
||||
transParams::maxTemperature = dataPreparation.at("maxTemperature").get<double>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("detection"))
|
||||
{
|
||||
nlohmann::json detection = params.at("detection");
|
||||
if(detection.contains("forceRedetect"))
|
||||
{
|
||||
transParams::forceRedetect = detection.at("forceRedetect").get<int>();
|
||||
}
|
||||
if(detection.contains("saveDetection"))
|
||||
{
|
||||
transParams::saveDetection = detection.at("saveDetection").get<int>();
|
||||
}
|
||||
if(detection.contains("version"))
|
||||
{
|
||||
transParams::version = detection.at("version").get<int>();
|
||||
}
|
||||
if(detection.contains("useTimeWindowing"))
|
||||
{
|
||||
transParams::useTimeWindowing = detection.at("useTimeWindowing").get<int>();
|
||||
}
|
||||
if(detection.contains("gaussWindow"))
|
||||
{
|
||||
transParams::gaussWindow = detection.at("gaussWindow").get<int>();
|
||||
}
|
||||
if(detection.contains("outlierOnTasDetection"))
|
||||
{
|
||||
transParams::outlierOnTasDetection = detection.at("outlierOnTasDetection").get<int>();
|
||||
}
|
||||
if(detection.contains("resampleFactor"))
|
||||
{
|
||||
transParams::resampleFactor = detection.at("resampleFactor").get<int>();
|
||||
}
|
||||
if(detection.contains("nThreads"))
|
||||
{
|
||||
transParams::nThreads = detection.at("nThreads").get<int>();
|
||||
}
|
||||
if(detection.contains("minSpeedOfSound"))
|
||||
{
|
||||
transParams::minSpeedOfSound = detection.at("minSpeedOfSound").get<int>();
|
||||
}
|
||||
if(detection.contains("maxSpeedOfSound"))
|
||||
{
|
||||
transParams::maxSpeedOfSound = detection.at("maxSpeedOfSound").get<int>();
|
||||
}
|
||||
if(detection.contains("detectionWindowSOS"))
|
||||
{
|
||||
transParams::detectionWindowSOS = detection.at("detectionWindowSOS").get<int>();
|
||||
}
|
||||
if(detection.contains("detectionWindowATT"))
|
||||
{
|
||||
transParams::detectionWindowATT = detection.at("detectionWindowATT").get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("rayTracing"))
|
||||
{
|
||||
nlohmann::json rayTracing = params.at("rayTracing");
|
||||
if(rayTracing.contains("bentReconstruction"))
|
||||
{
|
||||
transParams::bentReconstruction = rayTracing.at("bentReconstruction").get<int>();
|
||||
}
|
||||
if(rayTracing.contains("bresenham"))
|
||||
{
|
||||
transParams::bresenham = rayTracing.at("bresenham").get<int>();
|
||||
}
|
||||
if(rayTracing.contains("bentMethod"))
|
||||
{
|
||||
transParams::bentMethod = rayTracing.at("bentMethod").get<int>();
|
||||
}
|
||||
if(rayTracing.contains("bentTol"))
|
||||
{
|
||||
transParams::bentTol = rayTracing.at("bentTol").get<int>();
|
||||
}
|
||||
if(rayTracing.contains("bentIter"))
|
||||
{
|
||||
transParams::bentIter = rayTracing.at("bentIter").get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
if(params.contains("solver"))
|
||||
{
|
||||
nlohmann::json solver = params.at("solver");
|
||||
if(solver.contains("name"))
|
||||
{
|
||||
transParams::name = solver.at("name").get<std::string>();
|
||||
}
|
||||
if(solver.contains("maxIter"))
|
||||
{
|
||||
transParams::maxIter = solver.at("maxIter").get<int>();
|
||||
}
|
||||
if(solver.contains("muValues"))
|
||||
{
|
||||
nlohmann::json muValues = solver.at("muValues");
|
||||
transParams::muValues = readToMatrix(solver.at("muValues"), false);
|
||||
}
|
||||
if(solver.contains("betaValues"))
|
||||
{
|
||||
nlohmann::json betaValues = solver.at("betaValues");
|
||||
transParams::betaValues = readToMatrix(solver.at("betaValues"), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RECON_INFO(TransParramsFileName + " not found.");
|
||||
}
|
||||
reflectParams::expectedAScanDataLength = reconParams::expectedAScanDataLength;
|
||||
reflectParams::gpuSelectionList = reconParams::gpuSelectionList;
|
||||
transParams::gpuSelectionList = reconParams::gpuSelectionList;
|
||||
}
|
||||
|
||||
void initalizeConfig()
|
||||
{
|
||||
//reconParams.measurementInfo.ce
|
||||
@@ -17,7 +631,7 @@ namespace Recon
|
||||
//reconParams.hardwareSelection
|
||||
reconParams::gpuSelectionList = Aurora::Matrix::fromRawData(new double[8] {0,1,2,3,4,5,6,7},8);
|
||||
//reconParams.dataInfo
|
||||
reconParams::expectedAScanDataLength = 4000;
|
||||
reconParams::expectedAScanDataLength = 4000;
|
||||
|
||||
//reflectParams.dataSelection
|
||||
reflectParams::senderTasList = Aurora::Matrix::fromRawData(new double[128] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128},128); //1~128
|
||||
@@ -29,7 +643,7 @@ namespace Recon
|
||||
reflectParams::angleLowerLimit = 45;
|
||||
reflectParams::angleUpperLimit = 360;
|
||||
reflectParams::findDefects = 1;
|
||||
reflectParams::epsilon = 10;
|
||||
reflectParams::epsilon = 4;
|
||||
//reflectParams.dataBlocking
|
||||
reflectParams::mpSize = 1;
|
||||
reflectParams::senderTASSize = 2;
|
||||
@@ -67,8 +681,8 @@ namespace Recon
|
||||
reflectParams::numThreads = 30;
|
||||
reflectParams::expectedUSSpeedRange = Aurora::Matrix::fromRawData(new double[2] {1420,1600}, 1, 2);
|
||||
//reflectParams.transmissionCorrection
|
||||
reflectParams::soundSpeedCorrection = 1;
|
||||
reflectParams::attenuationCorrection = 1;
|
||||
reflectParams::soundSpeedCorrection = 0;
|
||||
reflectParams::attenuationCorrection = 0;
|
||||
reflectParams::saveTransmInReflCoords = 1;
|
||||
reflectParams::resolutionTransmMap = 0.005;
|
||||
//reflectParams.saft
|
||||
@@ -83,7 +697,7 @@ namespace Recon
|
||||
//reflectParams
|
||||
reflectParams::VERSION_MATLAB_MAJOR = 9;
|
||||
reflectParams::OS_UNIX = 0;
|
||||
reflectParams::runReflectionReco = true;
|
||||
reflectParams::runReflectionReco = false;
|
||||
|
||||
transParams::gpuSelectionList = reconParams::gpuSelectionList;
|
||||
//transParams.dataSelection
|
||||
@@ -145,6 +759,8 @@ namespace Recon
|
||||
transParams::muValues = Aurora::Matrix::fromRawData(new double[1] {100}, 1);
|
||||
transParams::betaValues = Aurora::Matrix::fromRawData(new double[1] {1}, 1);
|
||||
transParams::runTransmissionReco = true;
|
||||
transParams::nonNeg = false;
|
||||
transParams::nonNeg = false;
|
||||
|
||||
initalizeConfigFromFiles();
|
||||
}
|
||||
}
|
||||
|
||||
22091
src/config/json.hpp
Executable file
22091
src/config/json.hpp
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user