gaussians opgaussians → voxelimport 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) (実装を直接呼ぶなら 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)、台帳から引くなら opsreprconv.get("gaussians_to_voxel"))gaussians → 密度 voxel (D,H,W)。gaussians の 2 つ目の出口。
各ガウシアンを truncate * sigma で打ち切って加算する。格子の原点と
刻みを明示引数にしてあるのが要点で、既定の spacing=(1,1,1) を
そのまま使うと「世界座標をそのまま添字にする」ことになり、実データでは
まず間違う —— しかも例外は出ず、密度が別の場所に立つだけなので気づけない。
tests/test_reprconv.py はこの取り違えを明示的に測っている。
不可逆。損失は 3 つあり、どれも数字で測れる:
erf(t/sqrt(2))**3。t = 3 で 99.194%。
★ここは一度間違えた: 最初「3 sigma の球の質量 97.07%」と書いたが、
実装は箱なので値が違う。刻みを 1.0 → 0.125 と細かくして極限を取ると
99.30% → 99.19% へ収束し、球の 97.07% には近づかないことで反証できた
(tests/test_reprconv.py::test_gaussians_to_voxel_mass_matches_box_truncation)。
例外も NaN も出ない、まさに「黙って間違った数字を返す」種類の誤り。Args:
gaussians: mu / sigma / w を持つ dict。mu は (z, y, x)。
shape: (D, H, W)。
origin: 格子の (z, y, x) 原点(世界座標)。
spacing: 格子の (dz, dy, dx) 刻み(世界単位 / voxel)。
truncate: 何 sigma で打ち切るか(既定 3)。
Returns:
(D, H, W) float64 の密度(値は「voxel あたりの重み和」で、体積積分が
sum(w) に近づく)。
Raises:
ValueError: shape/spacing 不正 / truncate <= 0 / gaussians 不正。
py -3.11 examples/representation_roundtrip.pyvoxel を入力に取れる)gaussians)points_to_gaussians · gaussians_to_points
Provenance: reprconv.py — REPRCONV operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.