spyrit.core.recon.DCDRUNet

class spyrit.core.recon.DCDRUNet(noise, prep, sigma, denoi=Identity(), noise_level=5)[source]

Bases: DCNet

Denoised completion reconstruction network based on DRUNet wich concatenates a

noise level map to the input

Args:

noise: Acquisition operator (see noise)

prep: Preprocessing operator (see prep)

sigma: UPDATE!! Tikhonov reconstruction operator of type TikhonovMeasurementPriorDiag()

denoi (optional): Image denoising operator (see nnet). Default Identity

noise_level (optional): Noise level in the range [0, 255], default is noise_level=5

Input / Output:
input: Ground-truth images with concatenated noise level map with

shape \((B,C+1,H,W)\)

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

Attributes:

Acq: Acquisition operator initialized as noise

PreP: Preprocessing operator initialized as prep

DC_Layer: Data consistency layer initialized as tikho

Denoi: Image (DRUNet architecture type) denoising operator initialized as denoi

Example:
>>> B, C, H, M = 10, 1, 64, 64**2
>>> Ord = torch.ones((H,H))
>>> meas = HadamSplit(M, H, Ord)
>>> noise = NoNoise(meas)
>>> prep = SplitPoisson(1.0, M, H*H)
>>> sigma = torch.rand([H**2, H**2])
>>> n_channels = 1                   # 1 for grayscale image
>>> model_drunet_path = './spyrit/drunet/model_zoo/drunet_gray.pth'
>>> denoi_drunet = drunet(in_nc=n_channels+1, out_nc=n_channels, nc=[64, 128, 256, 512], nb=4, act_mode='R',
    downsample_mode="strideconv", upsample_mode="convtranspose")
>>> recnet = DCDRUNet(noise,prep,sigma,denoi_drunet)
>>> z = recnet(x)
>>> print(z.shape)
torch.Size([10, 1, 64, 64])

Methods

acquire(x)

Simulate data acquisition

concat_noise_map(x)

Concatenation of noise level map to reconstructed images

forward(x)

Full pipeline of the reconstruction network

reconstruct(x)

Reconstruction step of a reconstruction network

reconstruct_expe(x)

Reconstruction step of a reconstruction network

set_noise_level(noise_level)

Reset noise level value