anscombe_inverse — PHOTON transform op

• Data kinds: image2d → image2d

• Call: import fullseye as fs; fs.ledger.anscombe_inverse(values, gain=1.0, read_sigma=0.0, offset=0.0, mode='algebraic') (implementation को सीधे call करना हो तो import photoncount; photoncount.anscombe_inverse(values, gain=1.0, read_sigma=0.0, offset=0.0, mode='algebraic'), registry से लेना हो तो opsphoton.get("anscombe_inverse"))

उपयोग

anscombe_transform का inverse — algebraic रूप से, या bias के बिना।

> नीचे का विस्तृत विवरण मूल text में है — सारांश और headings का अनुवाद हो चुका है।

mode="algebraic" is the exact algebraic inverse of anscombe_transform::

x = ((g*A/2)^2 - (3/8)*g^2 - sigma_r^2)/g + offset

so anscombe_inverse(anscombe_transform(x)) == x to machine precision (measured over 100001 values of x spanning [0, 1e4]: max absolute error 2.7e-12, max relative error 3.7e-16 for x > 1). It is, however,

biased: E[A(X)] != A(E[X]), so applying it to a *denoised* (i.e. averaged) Anscombe image underestimates the intensity.

mode="unbiased" is the closed-form exact unbiased inverse of Makitalo & Foi (IEEE TIP 2011)::

x = D^2/4 + (1/4)*sqrt(3/2)/D - (11/8)/D^2 + (5/8)*sqrt(3/2)/D^3 - 1/8

which is defined for the classical transform only (gain=1, read_sigma=0, offset=0) — passing generalised parameters with this mode raises rather than returning a formula that does not apply.

Measured bias — apply the inverse to the *ideal denoised* value D = E[A(X)], X ~ Poisson(lambda), and compare with lambda. Both computed exactly from the Poisson pmf (no sampling):

======== ================== ==================

lambda algebraic bias unbiased bias

======== ================== ==================

1 -0.179361 -0.003668

2 -0.231074 -0.006374

4 -0.249688 +0.003779

10 -0.250227 +0.016904

30 -0.250019 +0.017041

100 -0.250002 +0.011960

======== ================== ==================

The algebraic inverse converges to a constant -1/4 photon offset, which at 1 photon/pixel is a 18% error; the closed form keeps the worst case to 0.017 photons (a 49x reduction at lambda = 1, 15x at its own worst point near lambda = 10-30). It is a closed-form *approximation* of the exact unbiased inverse, so it is not bias-free — those +0.017 are the honest residual, not round-off.

The result is clipped at 0 — stated here rather than done quietly — but the clip essentially never fires: the closed form's positive root is exactly A(0) = 2*sqrt(3/8) = 1.2247448714 (measured: the root and A(0) agree to 0.0), which is also the smallest value anscombe_transform can produce, so over the whole valid domain the formula is non-negative to round-off (measured minimum -1.11e-16 over D in [A(0), 6] on 500001 samples). Below A(0) it does go genuinely negative (-0.0217 at D = 1.20), which is why values there are refused outright rather than clipped.

Returns a float64 array of the same shape as *values*.

Raises ValueError: non-finite *values*, an unknown *mode*, a non-positive *gain*, a negative *read_sigma*, mode="unbiased" combined with any non-default generalised parameter, and — instead of dividing by zero — mode="unbiased" with any value <= 0 (the 1/D^3 term).

उपयोग की विस्तृत guide

• photon_timeresolved family guide

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• photon_timeresolved — py -3.11 examples/photon_timeresolved.py

वे अगले ops जिनसे type जुड़ता है (image2d को input के रूप में लेते हैं)

photon_sample · photon_statistics · photon_uncertainty · anscombe_transform

इसी category के (transform)

anscombe_transform


*Provenance: photoncount.py — PHOTON operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.