gaussians_to_voxel — REPRCONV gaussians op

• Data kinds: gaussians → voxel

• Call: import fullseye as fs; fs.ledger.gaussians_to_voxel(gaussians, shape=(32, 32, 32), origin=(0.0, 0.0, 0.0), spacing=(1.0, 1.0, 1.0), truncate=3.0) (to call the implementation directly, import reprconv; reprconv.gaussians_to_voxel(gaussians, shape=(32, 32, 32), origin=(0.0, 0.0, 0.0), spacing=(1.0, 1.0, 1.0), truncate=3.0); from the registry, opsreprconv.get("gaussians_to_voxel"))

Usage

gaussians → a density voxel (D,H,W). The second exit from gaussians.

Truncates each Gaussian at truncate * sigma and accumulates. The key point is that the grid origin and step are explicit arguments: using the default spacing=(1,1,1) as is means "using world coordinates directly as indices", which with real data is almost always wrong -- and since no exception is raised and the density just appears somewhere else, you cannot notice. tests/test_reprconv.py measures this mix-up explicitly.

Irreversible. There are 3 losses, each measurable as a number:

• Truncation -- the truncation is an axis-parallel box (±truncate*sigma on each axis), so the remaining mass is erf(t/sqrt(2))**3. At t = 3 it is 99.194%. ★This was once wrong: at first it said "the mass of a 3 sigma sphere, 97.07%", but the implementation is a box, so the value differs. Refining the step 1.0 → 0.125 and taking the limit, it converges 99.30% → 99.19% and does not approach the sphere's 97.07%, which refuted it (tests/test_reprconv.py::test_gaussians_to_voxel_mass_matches_box_truncation). No exception and no NaN -- exactly the kind of error that "silently returns a wrong number".

• Grid quadrature -- it is the midpoint rule, so when the step is coarse relative to sigma it overshoots (measured: with sigma = 1.5, 99.94% at step 1.0, 99.30% at 0.125).

• Boundary clipping -- whatever part of the box leaves the volume is dropped. For Gaussians whose centre is close to the edge, this loss is far larger than the truncation.

Args:

gaussians: dict with mu / sigma / w. mu is (z, y, x).

shape: (D, H, W).

origin: (z, y, x) origin of the grid (world coordinates).

spacing: (dz, dy, dx) step of the grid (world units / voxel).

truncate: at how many sigma to truncate (default 3).

Returns:

(D, H, W) float64 density (values are "weight sum per voxel", and the volume integral

approaches sum(w)).

Raises:

ValueError: bad shape/spacing / truncate <= 0 / bad gaussians.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• representation_roundtrip — py -3.11 examples/representation_roundtrip.py

Ops the type connects to (they accept voxel as input)

correlation_score

Same category (gaussians)

points_to_gaussians · gaussians_to_points


*Provenance: reprconv.py — REPRCONV operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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