# PYME.Analysis.PSFEst.psfQuality module¶

These functions assess a psf for quality and return a scalar ‘merit’ which indicates how good or bad the psf is wrt the particular measure.

Lower values are better, with the following breakpoints:

merit < 1 good OK to use 1 < merit < 2 marginal Might work in some situations but undesirable - use with caution merit > 3 unacceptable Almost garuanteed not to work
PYME.Analysis.PSFEst.psfQuality.background(image, psft)

This test uses the fact that the PSF should not extend to at edge of the image to judge background levels by looking at the mean values of the pixels along one edge. It assumes the PSF is normalised to a peak intensity of 1 (which it should be if extracted using the normal tools).

PYME.Analysis.PSFEst.psfQuality.colour(merit)
PYME.Analysis.PSFEst.psfQuality.crb3d(image, psft)

The Cramar-Rao bound describes the ammount of position information encoded in a PSF. This test computes the average 3D CRB (the vector norm of the 3 individual axis CRBs) over a 1 um depth range and compares it to that obtained from a simulated astigmatic PSF with 500nm lobe separation. The PSF is classed as good if the 3D CRB is less than twice that of the simulated PSF.

PYME.Analysis.PSFEst.psfQuality.dec_test(fcnName)
PYME.Analysis.PSFEst.psfQuality.depth_dec(image, psft)

Deconvolution needs a PSF which is at least 5-6 times the axial resolution of the data set and preferably as large as the stack to be deconvolved. In practice this means that the PSF should be at least 5 um deep.

PYME.Analysis.PSFEst.psfQuality.depth_loc(image, psft)

A psf used for 3D localisation should be sufficiently deep to capture the regions of the PSF which retain sufficient intensity to allow reasonable detection and localisation. In practice, a total range of 2-3um should be sufficient. Due to the implementation of the object finding algorithm, very large axial extents are actually a disadvantage as they will interfere with reliable event detection.

PYME.Analysis.PSFEst.psfQuality.glob_test(fcnName)
PYME.Analysis.PSFEst.psfQuality.loc_test(fcnName)
PYME.Analysis.PSFEst.psfQuality.noise(image, psft)

This test looks at a region to the side of the in-focus plane to assess noise levels. Noise can be improved by using a longer integration time when acquiring the bead images or by averaging more beads.

PYME.Analysis.PSFEst.psfQuality.positivity(image, psft)

The PSF should not contain any negative values

PYME.Analysis.PSFEst.psfQuality.runTests(image, psft)
PYME.Analysis.PSFEst.psfQuality.size_x(image, psft)

The extracted image should be large enough to capture the PSF, with a fair bit of wriggle room on either side. The default of 61 pixels does this in most situations. Smaller PSFs might work, but are are not guaranteed to - use with caution.

PYME.Analysis.PSFEst.psfQuality.voxelsize_x(image, psft)

The x pixel size should be sufficiently small to Nyquist the PSF. Making the pixels too large looses information whilst making them too small is empty magnification and is incurs extra noise and computational cost. A high NA oil immersion objective is assumed in these calculations

PYME.Analysis.PSFEst.psfQuality.voxelsize_z_dec(image, psft)

z spacing in psfs for deconvolution purposes should match the data spacing, which should be at Nyquist for the expected frequency content of the PSF. If abberated, PSFs will contain frequencies beyond the simple FWHM/2.35 calculalation typically used for voxel size selection. In most cases a z-spacing of 200 nm will be appropriate for a high NA oil immersion objective, although this might sometimes want to be reduced.

PYME.Analysis.PSFEst.psfQuality.voxelsize_z_loc(image, psft)

3D localisation microscopy relies on capturing subtle variations in pixel shape. Although these should nominally be captured in a Nyquist sampled PSF, it is wise to oversample in z (typically using 50 nm spacing) in order to reduce the sensitivity of psf shape to the interpolation algortihms used in the fitting. Oversampling also increases the effective SNR of the PSF