geopro/src/io/gpr/Gpr3dvVolumeBridge.hpp

52 lines
2.8 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef GEOPRO_IO_GPR_GPR3DVVOLUMEBRIDGE_HPP
#define GEOPRO_IO_GPR_GPR3DVVOLUMEBRIDGE_HPP
#include <string>
#include "core/algo/GprVolumeBuilder.hpp" // geopro::core::BuiltI16
namespace geopro::io::gpr {
// 把 vendored gpr3dv(P1) 处理链产出的【处理后立方体】桥接成 geopro 的量化体
// (BuiltI16),供 ChunkedVolumeStore::write + buildPyramid + VTK 体绘制消费。
//
// 链路(走 P1 原版 API算法零改动)
// IprhParser::loadImpulseMultiChannel(dir, base, model)
// → model.buildVolumeData() // 处理前立方体
// → RadarProcessor::runPipeline(默认链) // 原位变换 traces不重建 volumeData
// → model.buildVolumeData() // ★必须再建:拿处理后立方体
// 得 volumeData[通道][道][样本]。
//
// 轴映射(geopro 体)X=道(沿测线)、Y=通道(横向)、Z=样本(深度)。
// 即 nx=道数、ny=通道数、nz=样本数,逐 (ch,trace,sample) 填值。
// 量化:扫处理后值域 → Quant(offset=中点,防溢出),空值=kBlank。
// 世界 spacing
// X=道间距 dx(header DISTANCE INTERVAL取不到用 1.0)
// Y=通道横向间距(chYOffsets 跨度/(通道数-1),取不到用 ~1.37/(通道数-1))
// Z=深度采样间距(timeWindow/samples × 波速 / 2取不到用 1.0)。origin=0。
struct BridgeMetrics {
int nx = 0, ny = 0, nz = 0; // 体维度(道 × 通道 × 样本)
double meanAbsBefore = 0.0; // 处理前 traces 平均绝对幅值
double meanAbsAfter = 0.0; // 处理后 traces 平均绝对幅值
double vminPhys = 0.0, vmaxPhys = 0.0;
double dx = 0.0, dy = 0.0, dz = 0.0; // 世界 spacing
double loadMs = 0.0; // 读 + 建立方体
double pipelineMs = 0.0; // runPipeline + 再建立方体
double fillMs = 0.0; // 扫值域 + 量化填体
};
// 走 P1 链得处理后立方体 → 量化映射成 geopro BuiltI16(轴 X=道/Y=通道/Z=样本)。
// lineDir/linePrefix 同 gpr3dv-smoke(如 "D:/Downloads/明星路", "明星路_001")。
// metricsOut 非空时回填维度/量化/spacing/耗时(供 CLI 报告,不编造)。
// coarse(下采样因子≥1):沿测线(道/X 轴)每 coarse 道取 1spacing.x ×coarse 保形;
// 通道/样本(横向/深度)保留全分辨率。coarse≤1 即全分辨率。磁盘紧张时省空间用。
// 失败(加载失败/立方体为空) → 抛 std::runtime_error。
geopro::core::BuiltI16 buildLineVolumeFromGpr3dv(const std::string& lineDir,
const std::string& linePrefix,
BridgeMetrics* metricsOut,
int coarse = 1);
} // namespace geopro::io::gpr
#endif // GEOPRO_IO_GPR_GPR3DVVOLUMEBRIDGE_HPP