Prewhiten#
- class pulserver.recon.Prewhiten[source]#
Bases:
GadgetWhiten the channels of each readout with the stream’s noise measurement.
Readouts flagged
IS_NOISE_MEASUREMENTare collected and consumed: no unit receives them. At the first readout that is not noise, the whitening matrixWis computed from the collected samples, withW Ψ W^H = Ifor their channel covarianceΨ(bartorch.tools.whiten()), and is stored incontext.noise. Every readout of the stream, that one included, is then multiplied byWfrom the left, so the noise of the whitened channels has unit covariance. A readout whosesample_time_usdiffers from that of the noise readouts is also multiplied by the square root of the ratio of the two, the noise variance of a sample being inversely proportional to its dwell time. Noise readouts after that first readout are consumed and not used.Without noise readouts,
Wis the exam’sNOISE_COVARIANCE, whichstartup()loads when its coil labels are those of the header. With neither, readouts pass unchanged and a warning is logged once. A plugin that rejects noise readouts withreject_flagsgives the gadget no noise to estimate from. bartorch is imported whenWis computed; thecoilsextra installs it.Corresponds to Gadgetron’s
NoiseAdjustGadget.- Parameters:
required – Raise
MissingCalibration, rather than log a warning, at the first readout that is not noise when there is noWto apply.- Raises:
ValueError – From a call, if the collected noise has at most as many samples as channels, or a readout does not have the channels of
W.
Methods