spyrit.core.prep.DirectPoisson
- class spyrit.core.prep.DirectPoisson(alpha: float, meas_op)[source]
Bases:
ModulePreprocess the raw data acquired with a direct measurement operator assuming Poisson noise. It also compensates for the affine transformation applied to the images to get positive intensities.
It computes \(m = \frac{2}{\alpha}y - H1\) and the variance \(\sigma^2 = 4\frac{y}{\alpha^{2}}\), where \(y = Hx\) are obtained using a direct linear measurement operator (see
spyrit.core.Linear), \(\alpha\) is the image intensity, and 1 is the all-ones vector.- Args:
alpha: maximun image intensity \(\alpha\) (in counts)meas_op: measurement operator (seemeas)- Example:
>>> H = torch.rand([400,32*32]) >>> meas_op = Linear(H) >>> prep_op = DirectPoisson(1.0, meas_op)
Methods
denormalize_expe(x, beta[, h, w])Denormalize images from the range [-1;1] to the range [0; \(\beta\)]
forward(x)Preprocess measurements to compensate for the affine image normalization
sigma(x)Estimates the variance of raw measurements
unsplit(x[, mode])Unsplits measurements by combining odd and even indices.