Function parallax_correction(double, double, std::array<double, 2>, Vector3d, Vector3d, Vector3d)

Function Documentation

std::array<double, 2> parallax_correction(double mu, double t0, std::array<double, 2> xy, Vector3d fast, Vector3d slow, Vector3d origin)

Apply parallax correction to mm coordinates for conversion back to pixels. This is the reverse of the parallax correction applied in px_to_mm.

Given mm coordinates (x,y), construct the ray direction: s₁ = origin + x·fast + y·slow, then normalize |s₁| = 1

Calculate attenuation length: o = f(μ, t₀, s₁) Apply correction: x’ = x + (s₁·fast)·o, y’ = y + (s₁·slow)·o

Parameters:
  • mu – Linear attenuation coefficient μ (mm⁻¹)

  • t0 – Sensor thickness t₀ (mm)

  • xy – The (x,y) mm coordinate to correct

  • fast – Detector fast direction vector f̂

  • slow – Detector slow direction vector ŝ

  • origin – Detector origin vector r₀

Returns:

Corrected mm coordinates (x’,y’) ready for pixel conversion