Repository navigation
Conversation
FocalSpot(fu, fv; points, weights) and DetectorSampling(points; weights) describe the samples of the source and of the detector cells; DiskPoints places points in a disk for circular spots. sampled(op; source, detector, execution) averages a projector over them: detector sampling in the kernels of Siddon and Joseph (through MultiRay), otherwise one projector per sample on a shifted geometry, summed in a SampleSum; stacked returns the samples side by side (SampleStack, sample_weights). shift moves source and detector of ConeBeam and ParallelBeam; an ArcConeBeam becomes a Shifted geometry whose detector stays fixed, with its own project_point for the voxel-driven projector. supports_sampling, fuses_sampling and varies_per_cell decide by dispatch which projector does what. Tests: offsets and frames, shifted geometries, fused against sequential with an error model, adjoints, subsets, masks, the blur of a box spot against its exact form, devices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IntensityModel(op; source, detector) averages intensities over the samples before the log, p(x) = -log sum_k w_k exp(-(A_k x)) per data element, on a SampleStack with a stable log-sum-exp from broadcasts and reductions. jacobian gives its derivative as a SampleSum with weights per data element (SampleSum now takes those as well as weights per view), gradient! the gradient J(x)' (p(x) - y), and IntensityGradient that gradient as an operator for the solvers of RegularizedLeastSquares.jl that take only a normal operator. Tests: Jensen's inequality, the second-order term against the variance of the samples, the Jacobian at 0 and against central differences, the gradient, devices; each with its error model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MultiRay is no longer exported: it is the internal geometry CellSampled, which sampled builds for projectors that sample the cells in their kernel (Siddon, Joseph). Users write sampled(op; detector=DetectorSampling(points; weights)); the point and weighting strategies serve detector sampling and focal spots. The tests of several rays per cell use the new API with unchanged invariants; the docs pages, the custom projector of "Write a Sampling Strategy" (which now declares fuses_sampling) and the benchmark README follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Model the Focal Spot" shows the blur of a focal spot in a fan beam against the prediction by variance addition, the shapes of a spot, and reconstructions with the linear and the intensity model. "Sampling the Beam" (formerly "Several Rays per Cell", now after "Comparing Projectors") adds the intensity model and the focal spot, with figures computed by the package: the scene, the detector image, the shadows of the spot samples and profiles. Docstrings of the sampling types and of IntensityModel cite De Man et al. (1999). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes from a review of all pages: outdated statements (FBP and Parker weights, the buffer of the normal operator, distance-driven claims, Liu et al. 2017), citations (Miao for more rays, Parker for redundancy weights), numbers that the pages now compute, stray output, figure descriptions, terms and line lengths. References use full journal names and uniform headings. The start page and the README list FDK and detector sampling; the ordered-subsets how-to is renamed to "Use Ordered Subsets and Normalizations". Docstring examples for SampleSum, SampleStack, stacked, IntensityModel and IntensityGradient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
sampled(op; source, detector)averages a projector over samples of the focal spot (FocalSpot) and of the detector cells (DetectorSampling). The result has the data size ofopand its exact adjoint.IntensityModelaverages the intensitiesexp(-p)over the samples before the log, as a detector does. It comes with its Jacobian, the gradient of the least-squares objective, andIntensityGradientfor first-order solvers of RegularizedLeastSquares.jl.MultiRayis no longer exported.SiddonProjector(image, MultiRay(geometry, points; weights))becomessampled(SiddonProjector(image, geometry); detector=DetectorSampling(points; weights)). The kernels are the same.Sampling
FocalSpot(fu, fv=fu; points, weights=UniformWeights()): a spot of sizefu × fvin the plane perpendicular to the central ray. The point strategy is required. The existing strategies work here too, andDiskPoints(rings, angles=6)adds circular spots.DetectorSampling(points; weights=UniformWeights()): several rays per detector cell, with the strategiesMultiRaytook before.execution=:auto,:fusedor:sequential):MultiRaydid. The fused normal operator of LinearOperatorCollection.jl still applies.sampledbuilds one projector per sample on a shifted geometry and sums them in aSampleSum, which holds a data and an image buffer.varies_per_cell).ConeBeamandParallelBeamstay plain geometries of their type. AnArcConeBeambecomes aShiftedgeometry, whose detector does not move with the source. It has its ownproject_pointfor the voxel-driven projector.stacked(op; source, detector)returns the projections of all samples side by side (SampleStack, withsample_weights).supports_sampling,fuses_samplingandvaries_per_celllet projectors of other packages declare what they support.Intensity model
IntensityModel(op; source, detector)evaluatesp(x) = -log sum_k w_k exp(-(A_k x))per data element, with a stable log-sum-exp.CTOperators.jacobian(m, x)returns aSampleSumwith weights per data element.SampleSumnow accepts weights per data element as well as per view.CTOperators.gradient!(g, m, x, y)computes the gradient of|p(x) - y|^2 / 2.IntensityGradient(m, y)wraps it as an operator, e.g. forFISTA(; AHA=G, rho).Docs
fuses_sampling.Tests