spyrit.core.recon.PinvNet
- class spyrit.core.recon.PinvNet(noise, prep, denoi=Identity())[source]
Bases:
ModulePseudo inverse reconstruction network.
- Args:
noise: Acquisition operator (seenoise)prep: Preprocessing operator (seeprep)denoi(optional): Image denoising operator (seennet). DefaultIdentity- Input / Output:
input: Ground-truth images with shape \((B,C,H,W)\) corresponding to the batch size, number of channels, height, and width.output: Reconstructed images with shape \((B,C,H,W)\) corresponding to the batch size, number of channels, height, and width.- Attributes:
Acq: Acquisition operator initialized asnoiseprep: Preprocessing operator initialized aspreppinv: Analytical reconstruction operator initialized asPseudoInverse()Denoi: Image 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) >>> recnet = PinvNet(noise, prep) >>> x = torch.FloatTensor(B,C,H,H).uniform_(-1, 1) >>> z = recnet(x) >>> print(z.shape) >>> print(torch.linalg.norm(x - z)/torch.linalg.norm(x)) torch.Size([10, 1, 64, 64]) tensor(5.8912e-06)
Methods
acquire(x)Simulates data acquisition
forward(x)Full pipeline of reconstrcution network
meas2img(y)Returns images from raw measurement vectors
reconstruct(x)Preprocesses, reconstructs, and denoises raw measurement vectors.
Reconstruction step of a reconstruction network
Preprocesses and reconstructs raw measurement vectors.