Add transmossion detection functions.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <cmath>
|
||||
#include <gtest/gtest.h>
|
||||
#include <limits>
|
||||
|
||||
@@ -36,6 +37,62 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(Detection_Test, detectTofAndAttMex) {
|
||||
|
||||
MatlabReader m("/home/krad/TestData/getBlockOfTransmissionData.mat");
|
||||
|
||||
auto AscanBlock = m.read("AscanBlock");
|
||||
auto AscanRefBlock = m.read("AscanRefBlock");
|
||||
auto distBlock = m.read("dists");
|
||||
auto distBlockRef = m.read("distRefBlock");
|
||||
auto sosWaterBlock = m.read("waterTempBlock");
|
||||
auto sosWaterRefBlock = m.read("waterTempRefBlock");
|
||||
double expectedSOSWater = 1.511948131508464e+03;
|
||||
|
||||
auto result = Recon::detectTofAndAttMex(
|
||||
AscanBlock, AscanRefBlock, distBlock, distBlockRef, sosWaterBlock,
|
||||
sosWaterRefBlock, Recon::transParams::resampleFactor,
|
||||
Recon::transParams::nThreads, expectedSOSWater,
|
||||
Recon::transParams::useTimeWindowing,
|
||||
Recon::transParams::aScanReconstructionFrequency,
|
||||
Recon::transParams::offsetElectronic,Recon::transParams::detectionWindowATT,
|
||||
Recon::transParams::detectionWindowSOS,
|
||||
Recon::transParams::minSpeedOfSound,
|
||||
Recon::transParams::maxSpeedOfSound, Recon::transParams::gaussWindow);
|
||||
|
||||
MatlabReader m2("/home/krad/TestData/tofResult.mat");
|
||||
|
||||
auto tof = m2.read("tof");
|
||||
auto sosvalue = m2.read("sosValue");
|
||||
EXPECT_EQ(tof.getDataSize(), result.tof.getDataSize());
|
||||
|
||||
}
|
||||
|
||||
TEST_F(Detection_Test, detectAttVectorized) {
|
||||
|
||||
MatlabReader m("/home/krad/TestData/getBlockOfTransmissionData.mat");
|
||||
|
||||
auto AscanBlock = m.read("AscanBlock");
|
||||
auto AscanRefBlock = m.read("AscanRefBlock");
|
||||
auto distBlockRef = m.read("distRefBlock");
|
||||
auto sosWaterRefBlock = m.read("waterTempRefBlock");
|
||||
MatlabReader m2("/home/krad/TestData/tofResult.mat");
|
||||
auto tof = m2.read("tof");
|
||||
|
||||
double expectedSOSWater = 1.511948131508464e+03;
|
||||
|
||||
auto result = Recon::detectAttVectorized(
|
||||
AscanBlock, AscanRefBlock, distBlockRef,sosWaterRefBlock,
|
||||
tof,
|
||||
Recon::transParams::aScanReconstructionFrequency,
|
||||
Recon::transParams::offsetElectronic,
|
||||
Recon::transParams::detectionWindowSOS);
|
||||
for (size_t i = 0; i < result.getDataSize(); i++)
|
||||
{
|
||||
EXPECT_TRUE(std::isnan(result[i]))<<",index:"<<i;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(Detection_Test, calculateStarEndSearchPosition) {
|
||||
|
||||
auto distBlock = Aurora::Matrix::fromRawData(new double[3]{0.22, 0.21, 0.11}, 3, 1);
|
||||
|
||||
Reference in New Issue
Block a user