DeepFBP.py 🚧¢

Source: LION/models/learned_fbp/DeepFBP.py

Warning

This file has not yet received a complete narrative and docstring audit. Its public source-level API is listed automatically below.

class LearnableFilter(init_filter, per_angle=False, num_angles=None)

Learnable frequency-domain filter module for CT sinograms. This module replaces traditional filters like Ram-Lak with trainable parameters in the frequency domain. It supports shared or per-angle filters. Args: init_filter (torch.Tensor): Initial 1D filter in the frequency domain. per_angle (bool): If True, uses one filter per angle. num_angles (int, optional): Required if per_angle=True.

LearnableFilter.forward(self, x)

Applies the learnable frequency filter to each projection. Args: x (Tensor): Input sinogram of shape [B, A, D], where B = batch size, A = number of angles, D = number of detectors. Returns: Tensor: Filtered sinogram of the same shape.

class IntermediateResidualBlock(channels)

Depthwise 1D residual block used for angular interpolation. Each channel is processed independently (depthwise convolution), allowing flexible angle-wise feature transformation. Args: channels (int): Number of input/output channels (must match).

IntermediateResidualBlock.forward(self, x)

No docstring is available.

class DenoisingResidualBlock(channels)

2D residual block for image denoising.

DenoisingResidualBlock.forward(self, x)

No docstring is available.

class DeepFBPNetwork(geometry: ct.Geometry, model_parameters: LIONParameter = None)

Deep Filtered Backprojection Network for CT reconstruction. Pipeline: - Learnable frequency filter (Ram-Lak based init) - Angular interpolation via depthwise convolutions - Differentiable backprojection (Tomosipo) - Residual CNN-based denoiser Args: num_detectors (int): Number of detector bins. num_angles (int): Number of projection angles. A (ts.Operator): Tomosipo projection operator. filter_type (str): Either β€˜Filter I’ (shared) or per-angle. device (torch.device): Computation device.

DeepFBPNetwork.compute_projection_size_padded(self)

Computes the next power-of-two padding size to avoid aliasing.

DeepFBPNetwork.ram_lak_filter(self, size)

Generates Ram-Lak filter directly in frequency domain.

DeepFBPNetwork.default_parameters()

No docstring is available.

DeepFBPNetwork.forward(self, x)

Runs a forward pass through the DeepFBP pipeline. Steps: 1. Apply learnable frequency-domain filter. 2. Perform angular interpolation via 1D convolutions. 3. Apply differentiable backprojection using Tomosipo. 4. Normalize projection output. 5. Apply residual 2D CNN denoising network. Args: x (Tensor): Input sinogram of shape [B, 1, A, D]. Returns: Tensor: Reconstructed image tensor of shape [B, 1, H, W], with pixel values in [0, 1].