API Reference#
High-level Projector#
Project floating tensors along parallel, fan, cone, or parallel3d trajectories. |
Projector takes trajectory tensors as described in Trajectories and Geometry. For
multiple GPUs and nodes, see Multiple GPUs and Nodes.
Each operation also accepts trajectory=... to replace the full trajectory
for that call, preserving its view count and the constructor default.
detector_surface defines native pixel positions for both projection and
matched backprojection. See Parameterized detector surfaces for its coordinate and
shape contract, and Examples for a runnable cylindrical detector.
Native CPU data uses streamed CUDA execution; backend="torch" computes
on its PyTorch device. precision selects fast FP32 or strict FP32/FP64.
Leading batch/channel axes and per-axis voxel spacing are supported; see
Precision, training and reconstruction. volume_chunk_shape,
view_chunk_size and detector_chunk_shape specify optional limits;
schedule allows operation-specific comparisons. partition="space"
assigns rank-local volume slabs. See Large Volumes and Chunked Execution for memory, storage,
geometry and autograd requirements, and Multiple GPUs and Nodes for ownership.
Complete Reconstruction Pipelines#
Differentiable parallel/fan FBP for fixed flat-detector geometry. |
|
Differentiable flat-detector FDK; fixed geometry, approximate inversion. |
|
Numerical streamed FBP into caller tensor/file storage; return |
|
Numerical streamed FDK into caller tensor/file storage; return |
|
Approximate axial helical FDK with one complete angular turn per slice. |
|
Return |
|
Gather filtered cone data using replaceable |
Numerical Solvers#
CGLS with a total iteration target, including resumed iterations. |
|
Row/column-normalized SIRT, with optional nonnegative iterates. |
|
Adam on half the global mean squared data error plus physical mean TV. |
|
CGLS into caller storage with mapped state and bounded block operations. |
|
Isotropic TV over every voxel, with physical forward differences. |
Geometry Helpers#
3D trajectories
Generate circular trajectory geometry for cone-beam CT. |
|
Lift the 2D parallel orbit into XY, with a vertical detector v axis. |
|
Generate random trajectory geometry for cone-beam CT. |
|
Generate spiral (helical) trajectory geometry for cone-beam CT. |
|
Generate sinusoidal trajectory geometry for cone-beam CT. |
|
Generate saddle-shaped trajectory geometry for cone-beam CT. |
|
Generate custom trajectory geometry for cone-beam CT using user-defined function. |
2D trajectories
Generate circular trajectory geometry for 2D parallel-beam CT. |
|
Generate sinusoidal trajectory geometry for 2D parallel-beam CT. |
|
Generate custom trajectory geometry for 2D parallel-beam CT using user-defined functions. |
|
Generate circular trajectory geometry for 2D fan-beam CT. |
|
Generate sinusoidal trajectory geometry for 2D fan-beam CT. |
|
Generate custom trajectory geometry for 2D fan-beam CT using user-defined function. |
Rigid transforms
Apply |
Block stores and batched surfaces#
Sample local detector offsets from global CPU pixel/view coordinates. |
project_into and backproject_into use caller-owned numerical outputs.
ParameterizedSurface exposes mutable geometry as explicit tensor
parameters and samples bounded global view/pixel rectangles. Legacy two-argument
surface callbacks remain available. See Parameterized detector surfaces.
Analytical Reconstruction Helpers#
These helpers build the pre-weights, angular weights, filter and weighted backprojection of an analytical FBP or FDK pipeline. The weighted backprojection helpers support sinogram autograd with dedicated transpose kernels, including higher derivatives. They use fixed geometry and reject geometry/isocenter gradients. The returned images are already scaled. See Differentiable analytical reconstruction for complete APIs and learnable filter/weight examples.
Analytical FBP and FDK assume a flat detector and an acquisition model. These
helpers do not accept detector_surface. Native curved data must be resampled
along matching rays onto a covered virtual flat detector before using these
flat-detector helpers; resampling adds interpolation error. The native
Projector forward/adjoint pair needs no such conversion. A non-circular
trajectory does not make the result exact. The helpers accept the same per-view
(src_pos, det_center, det_u[, det_v]) arrays as Projector.
Fan and cone backprojection accept a keyword-only isocenter vector in physical
units. With None (default), it is estimated from the detector normals. Give it
explicitly for non-circular or ambiguous geometry, including a single view. The
three weighted backprojection helpers need at least two detector bins along each
interpolated axis, including the cone detector’s v axis.
Return detector cell centre coordinates along a 1D axis. |
|
Trapezoidal per-view integration weights for the analytical FBP/FDK sum. |
|
Per-detector-cell |
|
Per-detector-cell |
|
Parker redundancy weights for a circular fan-beam short scan. |
|
Apply a finite discrete Ram-Lak filter along |
|
Voxel-driven parallel-beam FBP backprojection with analytical constant. |
|
Voxel-driven fan-beam FBP backprojection with analytical constant. |
|
Voxel-driven cone-beam FDK backprojection with analytical constant. |
Ramp Filter Options#
ramp_filter_1d is the filter used by the analytical examples. Its signature is:
ramp_filter_1d(sinogram_tensor, dim=-1, sample_spacing=1.0,
pad_factor=1, window=None, use_rfft=True)
sample_spacingPhysical detector-cell spacing along
dim, for exampledufor cone beam. The output is in physical units. Pass1.0to work in sample units.pad_factorZero-pads the signal to
pad_factor * Nsamples alongdim. Use2for cone-beam FDK. Use4when objects lie close to the detector edge.use_rfftUses the real FFT for real inputs. Set
Falseonly to force the complex FFT path.
The window argument selects a window applied to the Ram-Lak ramp:
|
Effect |
|---|---|
|
No window. Sharpest, with the most noise. |
|
Half-cosine roll-off. |
|
Sinc roll-off. Classical choice. |
|
Milder than Hann. |
|
Strongest high-frequency suppression. |
Low-level Functions#
These autograd.Function wrappers take explicit trajectory tensors. Use the
forward signature as the argument order for .apply(...). For new code,
prefer Projector, which checks inputs and manages devices.
Summary PyTorch autograd function for differentiable 2D parallel beam forward projection. |
|
Summary PyTorch autograd function for differentiable 2D parallel beam backprojection. |
|
Summary PyTorch autograd function for differentiable 2D fan beam forward projection. |
|
Summary PyTorch autograd function for differentiable 2D fan beam backprojection. |
|
Summary PyTorch autograd function for differentiable 3D cone beam forward projection. |
|
Summary PyTorch autograd function for differentiable 3D cone beam backprojection. |