spyrit.core.recon.TikhoNet

class spyrit.core.recon.TikhoNet(noise, prep, sigma: tensor, denoi=Identity())[source]

Bases: Module

Tikhonov reconstruction network.

This is a two-step reconstruction method. Typically, only the last step involves learnable parameters.

  1. Tikhonov regularisation.

  2. (Learned) Denoising in the image domain.

Args:

noise (spyrit.core.noise): Acquisition operator (see noise)

prep (spyrit.core.prep): Preprocessing operator (see prep)

sigma (torch.tensor): Image-domain covariance prior (for details, see the Tikhonov() class)

denoi (torch.nn.Module, optional): Image denoising operator (see nnet). Default Identity

Input / Output:

input (torch.tensor): Ground-truth images with shape \((B,C,H,W)\).

output (torch.tensor): Reconstructed images with shape \((B,C,H,W)\).

Attributes:

acqu: Acquisition operator initialized as noise

prep: Preprocessing operator initialized as prep

tikho: Data consistency layer initialized as Tikhonov(noise.meas_op, sigma)

denoi: Image denoising operator initialized as denoi

Example:
>>> B, H, M, N = 85, 17, 32, 64
>>> sigma = torch.rand(N, N)
>>> gamma = torch.rand(M, M)
>>> A = torch.rand([M,N])
>>> meas = Linear(A, meas_shape=(1,N))
>>> noise = NoNoise(meas)
>>> prep = DirectPoisson(1, meas)
>>> recon = TikhoNet(noise, prep, sigma)
>>> y = torch.rand(B,H,M)
>>> x = recon(y, gamma)
>>> print(y.shape)
>>> print(x.shape)
torch.Size([85, 17, 32])
torch.Size([85, 17, 1, 64])

Methods

forward(x)

Full pipeline (image-to-image mapping)

reconstruct(x)

Reconstruction (measurement-to-image mapping)

reconstruct_expe(x)

Reconstruction (measurement-to-image mapping) for experimental data.