feat: Remove redudent TransDetection lib

This commit is contained in:
kradchen
2024-12-19 10:39:49 +08:00
parent cd8fd76846
commit e475edd243
4 changed files with 120 additions and 153 deletions

View File

@@ -38,45 +38,6 @@ protected:
}
};
TEST_F(Detection_Test, detectTofAndAttMex) {
MatlabReader m("/home/sun/testData/transmissionDetection.mat");
auto AscanBlock = m.read("AscanBlock");
auto AscanRefBlock = m.read("AscanRefBlock");
auto distBlock = m.read("dists");
auto distBlockRef = m.read("distRefBlock");
auto sosWaterBlock = Recon::temperatureToSoundSpeed(m.read("waterTempBlock"),"marczak");
auto sosWaterRefBlock = Recon::temperatureToSoundSpeed(m.read("waterTempRefBlock"),"marczak");
float expectedSOSWater = 1.512677498767504e+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::detectionWindowATT,Recon::transParams::offsetElectronic,
Recon::transParams::detectionWindowSOS,
Recon::transParams::minSpeedOfSound,
Recon::transParams::maxSpeedOfSound, Recon::transParams::gaussWindow);
MatlabReader m3("/home/krad/TestData/sosResult.mat");
auto sosvalue = m3.read("sosValue");
auto tof = m3.read("tofRel");
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(tof[i],result.tof[i])<<",index:"<<i;
EXPECT_DOUBLE_AE(sosvalue[i],result.sosValue[i])<<",index:"<<i;
// EXPECT_TRUE(result.att[i]==0)<<",index:"<<i;
}
}
TEST_F(Detection_Test, detectTofAndAtt) {
MatlabReader m("/home/sun/testData/transmissionDetection.mat");