PYME.LMVis.visHelpers module

PYME.LMVis.visHelpers.Gauss2D(Xv, Yv, A, x0, y0, s)
PYME.LMVis.visHelpers.Gauss3d(X, Y, Z, x0, y0, z0, wxy, wz)

3D PSF model function with constant background - parameter vector [A, x0, y0, z0, background]

PYME.LMVis.visHelpers.calcNeighbourDistPart(di, x, y, edb, nStart, nEnd)
PYME.LMVis.visHelpers.calcNeighbourDists(T)
PYME.LMVis.visHelpers.genEdgeDB(T)
PYME.LMVis.visHelpers.rendGauss(x, y, sx, imageBounds, pixelSize)
Parameters
xndarray

x positions [nm]

yndarray

y positions [nm]

sxndarray

(gaussian) lateral width (sigma) [nm]

imageBoundsPYME.IO.ImageBounds

ImageBounds instance - range in each dimension should be an integer multiple of pixelSize. ImageBounds (x0, y0) and (x1, y1) correspond to the inside edge of the outer pixels.

pixelSizefloat

size of pixels to be rendered [nm]

Returns
imndarray

2D Gaussian rendering. Note that im[0, 0] is centered at 0.5 * [pixelSize, pixelSize] (FIXME)

TODOS:
  • speed improvements? Parallelisation?
  • variable ROI size? We currently base our ROI size on the median localization/jitter error, with the parts of the
Gaussians which extend past the ROI being dropped. This is usually not an issue, but could become one if we have a
large range of localization precisions (or if we are using something else - e.g. neighbour distances - as sigma).
PYME.LMVis.visHelpers.rendGauss3D(x, y, z, sx, sz, imageBounds, pixelSize, zb, sliceSize=100)
PYME.LMVis.visHelpers.rendGaussProd(x, y, sx, imageBounds, pixelSize)

EXPERIMENTAL code to try and generate a log-likelihood rendering

WARNING - needs lots of revision

PYME.LMVis.visHelpers.rendHist(x, y, imageBounds, pixelSize)
PYME.LMVis.visHelpers.rendHist3D(x, y, z, imageBounds, pixelSize, sliceSize=100)
PYME.LMVis.visHelpers.rendJTet(im, x, y, z, jsig, jsigz, mcp, n)
PYME.LMVis.visHelpers.rendJitTet(x, y, z, n, jsig, jsigz, mcp, imageBounds, pixelSize, sliceSize=100)
PYME.LMVis.visHelpers.rendJitTri(im, x, y, jsig, mcp, imageBounds, pixelSize, n=1, seed=None)
PYME.LMVis.visHelpers.rendJitTri2(im, im1, x, y, jsig, mcp, imageBounds, pixelSize, n=1)
PYME.LMVis.visHelpers.rendJitTriang(x, y, n, jsig, mcp, imageBounds, pixelSize, seeds=None, geometric_mean=True, mdh=None)
Parameters
xndarray

x positions [nm]

yndarray

y positions [nm]

nnumber of jittered renderings to average into final rendering
jsigndarray (or scalar float)

standard deviations [nm] of normal distributions to sample when jittering for each point

mcpfloat

Monte Carlo sampling probability (0, 1]

imageBoundsPYME.IO.ImageBounds

ImageBounds instance - range in each dimension should ideally be an integer multiple of pixelSize.

pixelSizefloat

size of pixels to be rendered [nm]

seedsndarray

[optional] supplied seeds if we want to strictly reconstruct a previously generated image

geometric_meanbool

[optional] Flag to scale intensity by geometric mean (True) or [localizations / um^2] (False)

mdh: PYME.IO.MetaDataHandler.MDHandlerBase or subclass

[optional] metadata handler to store seeds to

Returns
imndarray

2D Jittered Triangulation rendering.

Notes

Triangles which reach outside of the image bounds are dropped and not included in the rendering.

PYME.LMVis.visHelpers.rendJitTriang2(x, y, n, jsig, mcp, imageBounds, pixelSize)
PYME.LMVis.visHelpers.rendTri(T, imageBounds, pixelSize, c=None, im=None, geometric_mean=False)
PYME.LMVis.visHelpers.rendTri2(T, imageBounds, pixelSize, c=None, im=None, im1=None)
PYME.LMVis.visHelpers.rendVoronoi(x, y, imageBounds, pixelSize)
PYME.LMVis.visHelpers.rend_density_estimate(x, y, imageBounds, pixelSize, N=10)
Parameters
xndarray

x positions [nm]

yndarray

y positions [nm]

sxndarray

(gaussian) lateral width (sigma) [nm]

imageBoundsPYME.IO.ImageBounds

ImageBounds instance - range in each dimension should be an integer multiple of pixelSize. ImageBounds (x0, y0) and (x1, y1) correspond to the inside edge of the outer pixels.

pixelSizefloat

size of pixels to be rendered [nm]

Returns
imndarray

2D Gaussian rendering. Note that im[0, 0] is centered at 0.5 * [pixelSize, pixelSize] (FIXME)

TODOS:
  • speed improvements? Parallelisation?
  • variable ROI size? We currently base our ROI size on the median localization/jitter error, with the parts of the
Gaussians which extend past the ROI being dropped. This is usually not an issue, but could become one if we have a
large range of localization precisions (or if we are using something else - e.g. neighbour distances - as sigma).