Repository navigation
Voxel driven projector - #18
Merged
Merged
Conversation
VoxelDrivenProjector projects each voxel center onto the detector and spreads it over the 2 x 2 nearest cells by bilinear interpolation (one thread per voxel, loop over the views); the back projection gathers with the same weights, so it is the exact adjoint and needs no atomics. The per-view scale of the weights is injectable (AbstractVoxelScale, voxel_scale); the default LineIntegralScale makes the forward projection approximate the mean of the line integrals over each cell, UnitScale keeps the plain interpolation weights. Geometry: project_point(g, p, k) -> DetectorHit, the inverse of cell_ray, for ConeBeam, ArcConeBeam and ParallelBeam, with magnification and projection density. Tests: the projector (contract, mass of a voxel, comparison with distance driven, 2D, unit scale), project_point (inverse of cell_ray, density against a finite-difference Jacobian), and the voxel- driven projector in the masks, device, launch, precision and extension tests. The precision test bounds the error of atomic additions in Float16/BFloat16 data by the number of additions per cell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New explanation page Voxel-Driven Method: an interactive figure of one pixel in a fan beam, the two factors of the weights, the derivation of the line-integral scale (marked as ours, citing the weight factors named by De Man & Basu 2004), the 2D form, a custom scale, a uniform-disk check of small cells after Miao (2013), coverage, properties and references. System Matrix: voxel-driven row in the table and a static figure of the pieces of a ray per principal axis; the interactive principal-axis figure shows only its left panel, which keeps the page responsive. Comparing Projectors, README, index, API page and navigation list the new projector. Reviewed by two cold review agents; their findings are applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
==========================================
+ Coverage 97.39% 97.66% +0.26%
==========================================
Files 26 28 +2
Lines 882 1026 +144
==========================================
+ Hits 859 1002 +143
- Misses 23 24 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Voxel-driven projector
Adds
VoxelDrivenProjector, a fourth projector next to Siddon, Joseph and distance driven. Itworks voxel by voxel: in every view the voxel center is projected onto the detector and the voxel
contributes to the 2 x 2 nearest cells, with bilinear interpolation weights. This is the method that
De Man & Basu (2004) and Miao (2013) call pixel driven and Zhuang et al. (1994) bilinear
interpolation; FDK implementations usually back project this way, which is the next step (FDK
with FFTL.jl).
What's in it
src/operators/voxeldriven/): one thread per voxel within the bounding box of theimage mask, loop over the views. The back projection gathers (no atomics, deterministic), the
forward projection scatters with atomic additions. Forward and back projection use the same
weights, so the adjoint is exact. Image masks and ray masks are supported;
MultiRayandRayListare rejected with anArgumentError, since the method needs a detector.AbstractVoxelScale(
voxel_scale(scale, geometry, k, grid, hit), runs in the kernels).LineIntegralScale(default):V (R/r)^2 / (a cos phi), so that the forward projectionapproximates the mean of the line integrals over a cell, like distance driven. 2D images use
the fan-beam form with the cell width. The derivation (a change of variables) is ours; De Man &
Basu name the factors but give no formula. It is written out on the docs page.
UnitScale: the plain interpolation weights.project_point(g, p, k) -> DetectorHit, the inverse ofcell_ray, forConeBeam,ArcConeBeamandParallelBeam. It returns the detector position, magnification, row spacingand projection density. It is public, not exported.
normalOperatorreturns thegeneric one.
Accuracy (measured)
within 0.2%. With cells of half a voxel the difference is 23%, the known high-frequency artifact
of the method when cells are smaller than the projected voxels.
difference from distance driven for cells of 0.25 / 0.5 / 1 / 2 pixels.
Tests
test/operators/voxeldriven.jl: operator contract, the mass of a single voxel, a ballcompared with distance driven, 2D,
UnitScale.cell_ray, density against a finite-differenceJacobian.
LinearOperatorCollection and Sinograms tests. The precision test bounds the error of atomic
additions into Float16/BFloat16 data by the number of additions per cell (new
Projectionstest snippet).
Core.BFloat16with KernelAbstractions 0.10.4 on POCL: "unsupported use of bfloat value").This PR does not change them.
Docs
two factors of the weights, the derivation of the scale, a custom scale example, the disk check
of small cells, coverage, properties, references.
principal axis; the interactive principal-axis figure shows only its left panel, so the page no
longer hangs.
🤖 Generated with Claude Code