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 (seenoise)prep: Preprocessing operator (seeprep)sigma: UPDATE!! Tikhonov reconstruction operator of typeTikhonovMeasurementPriorDiag()denoi(optional): Image denoising operator (seennet). DefaultIdentitynoise_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 withshape \((B,C+1,H,W)\)
output: Reconstructed images with shape \((B,C,H,W)\)- Attributes:
Acq: Acquisition operator initialized asnoisePreP: Preprocessing operator initialized asprepDC_Layer: Data consistency layer initialized astikhoDenoi: Image (DRUNet architecture type) denoising operator initialized asdenoi- 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
Concatenation of noise level map to reconstructed images
forward(x)Full pipeline of the reconstruction network
reconstruct(x)Reconstruction step of a reconstruction network
Reconstruction step of a reconstruction network
set_noise_level(noise_level)Reset noise level value