Transmission detection fix and refactor.
This commit is contained in:
@@ -60,11 +60,56 @@ TEST_F(Detection_Test, detectTofAndAttMex) {
|
||||
Recon::transParams::minSpeedOfSound,
|
||||
Recon::transParams::maxSpeedOfSound, Recon::transParams::gaussWindow);
|
||||
|
||||
MatlabReader m2("/home/krad/TestData/tofResult.mat");
|
||||
|
||||
auto tof = m2.read("tof");
|
||||
MatlabReader m2("/home/krad/TestData/sosResult.mat");
|
||||
auto sosvalue = m2.read("sosValue");
|
||||
EXPECT_EQ(tof.getDataSize(), result.tof.getDataSize());
|
||||
ASSERT_EQ(sosvalue.getDataSize(), result.tof.getDataSize());
|
||||
ASSERT_EQ(sosvalue.getDataSize(), result.sosValue.getDataSize());
|
||||
ASSERT_EQ(sosvalue.getDataSize(), result.att.getDataSize());
|
||||
#pragma omp parallel for
|
||||
for (size_t i = 0; i < result.tof.getDataSize(); i++)
|
||||
{
|
||||
EXPECT_DOUBLE_AE(0,result.tof[i])<<",index:"<<i;
|
||||
EXPECT_DOUBLE_AE(sosvalue[i],result.sosValue[i])<<",index:"<<i;
|
||||
EXPECT_TRUE(std::isnan(result.att[i]))<<",index:"<<i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TEST_F(Detection_Test, detectTofAndAtt) {
|
||||
|
||||
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::detectTofAndAtt(
|
||||
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/sosResult.mat");
|
||||
auto sosvalue = m2.read("sosValue");
|
||||
ASSERT_EQ(sosvalue.getDataSize(), result.tof.getDataSize());
|
||||
ASSERT_EQ(sosvalue.getDataSize(), result.sosValue.getDataSize());
|
||||
ASSERT_EQ(sosvalue.getDataSize(), result.att.getDataSize());
|
||||
#pragma omp parallel for
|
||||
for (size_t i = 0; i < result.tof.getDataSize(); i++)
|
||||
{
|
||||
EXPECT_DOUBLE_AE(0,result.tof[i])<<",index:"<<i;
|
||||
EXPECT_DOUBLE_AE(sosvalue[i],result.sosValue[i])<<",index:"<<i;
|
||||
EXPECT_TRUE(std::isnan(result.att[i]))<<",index:"<<i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -172,10 +217,10 @@ TEST_F(Detection_Test, detectTofVectorized) {
|
||||
|
||||
auto tof = m2.read("tof");
|
||||
auto sosvalue = m2.read("sosValue");
|
||||
EXPECT_EQ(tof.getDataSize(), result.getDataSize());
|
||||
EXPECT_EQ(tof.getDataSize(), result.tof.getDataSize());
|
||||
#pragma omp parallel for
|
||||
for (size_t i = 0; i < tof.getDataSize(); i++)
|
||||
{
|
||||
EXPECT_DOUBLE_AE(tof[i],result[i])<<",index:"<<i;
|
||||
EXPECT_DOUBLE_AE(tof[i],result.tof[i])<<",index:"<<i;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user