PYME.recipes.pointcloud module

class PYME.recipes.pointcloud.DelaunayCircumcentres(parent=None, invalidate_parent=True, **kwargs)

Bases: ModuleBase

append_original_locs = <PYME.misc.mock_traits.CStr object>
execute(namespace)

takes a namespace (a dictionary like object) from which it reads its inputs and into which it writes outputs

NOTE: This was previously the function to define / override to make a module work. To support automatic metadata propagation and reduce the ammount of boiler plate, new modules should override the run() method instead.

input = <PYME.recipes.traits.Input object>
output = <PYME.recipes.traits.Output object>
class PYME.recipes.pointcloud.DelaunayTesselation(parent=None, invalidate_parent=True, **kwargs)

Bases: ModuleBase

execute(namespace)

takes a namespace (a dictionary like object) from which it reads its inputs and into which it writes outputs

NOTE: This was previously the function to define / override to make a module work. To support automatic metadata propagation and reduce the ammount of boiler plate, new modules should override the run() method instead.

input = <PYME.recipes.traits.Input object>
output = <PYME.recipes.traits.Output object>
three_d = <PYME.misc.mock_traits.CStr object>
class PYME.recipes.pointcloud.GaussianMixtureModel(parent=None, invalidate_parent=True, **kwargs)

Bases: ModuleBase

Fit a Gaussian Mixture to a pointcloud, predicting component membership for each input point.

Parameters
input_points: PYME.IO.tabular

points to fit. Currently hardcoded to use x, y, and z keys.

n: Int

number of Gaussian components in the model for optimization mode n and bayesian, or maxinum number of components for bic

mode: Enum

optimization on the number of components. For n and bayesian the GMM uses exactly n components, while for bic it is the maximum number of components used, with the optimum Bayesian Information Criterion used to select the best model.

covariance: Enum

type of covariance to use in the model

label_key: str

name of membership/label key in output datasource, ‘gmm_label’ by default

output_labeled: PYME.IO.tabular

input source with additional column indicating predicted component membership of each point

Notes

Directly implements or closely wraps scikit-learn mixture.GaussianMixture and mixture.BayesianGaussianMixture. See sklearn documentation for more information.

covariance = <PYME.misc.mock_traits.CStr object>
execute(namespace)

takes a namespace (a dictionary like object) from which it reads its inputs and into which it writes outputs

NOTE: This was previously the function to define / override to make a module work. To support automatic metadata propagation and reduce the ammount of boiler plate, new modules should override the run() method instead.

init_params = <PYME.misc.mock_traits.CStr object>
input_points = <PYME.recipes.traits.Input object>
label_key = <PYME.misc.mock_traits.CStr object>
max_iter = <PYME.misc.mock_traits.CStr object>
mode = <PYME.misc.mock_traits.CStr object>
n = <PYME.misc.mock_traits.CStr object>
output_labeled = <PYME.recipes.traits.Output object>
class PYME.recipes.pointcloud.LocalPointDensity(parent=None, invalidate_parent=True, **kwargs)

Bases: ModuleBase

Estimate the local density around a localization by fitting a scaling function to the number of Neigbours vs distance. The expected scaling function for a uniform density is used ($N propto r^2$ for 2D, $Npropto r^3$ for 3D.

TODO - find the correct scaling factors (probably involving pi) to convert this to $locs/um^{N_{dim}}$

execute(namespace)

takes a namespace (a dictionary like object) from which it reads its inputs and into which it writes outputs

NOTE: This was previously the function to define / override to make a module work. To support automatic metadata propagation and reduce the ammount of boiler plate, new modules should override the run() method instead.

input = <PYME.recipes.traits.Input object>
input_sample_locations = <PYME.recipes.traits.Input object>
n_nearest_neighbours = <PYME.misc.mock_traits.CStr object>
output = <PYME.recipes.traits.Output object>
three_d = <PYME.misc.mock_traits.CStr object>
class PYME.recipes.pointcloud.Octree(parent=None, invalidate_parent=True, **kwargs)

Bases: ModuleBase

execute(namespace)

takes a namespace (a dictionary like object) from which it reads its inputs and into which it writes outputs

NOTE: This was previously the function to define / override to make a module work. To support automatic metadata propagation and reduce the ammount of boiler plate, new modules should override the run() method instead.

input_localizations = <PYME.recipes.traits.Input object>
max_depth = <PYME.misc.mock_traits.CStr object>
minimum_pixel_size = <PYME.misc.mock_traits.Float object>
output_octree = <PYME.recipes.traits.Output object>
samples_per_node = <PYME.misc.mock_traits.CStr object>
class PYME.recipes.pointcloud.Ripleys(parent=None, invalidate_parent=True, **kwargs)

Bases: ModuleBase

Ripley’s K-function, and alternate normalizations, for examining clustering and dispersion of points within aregion R, where R is defined by a mask (2D or 3D) of the data.

inputPositionstraits.Input

Localization data source to analyze as PYME.IO.tabular types

inputMasktraits.Input

PYME.IO.image.ImageStack mask defining the localization bounding region

outputNametraits.Output

Name of resulting PYME.IO.tabular.DictSource data ource

normalizationtraits.Enum

Ripley’s normalization type. See M. A. Kiskowski, J. F. Hancock, and A. K. Kenworthy, “On the use of Ripley’s K-function and its derivatives to analyze domain size,” Biophys. J., vol. 97, no. 4, pp. 1095-1103, 2009.

nbinstraits.Int

Number of bins over which to analyze K-function

binSizetraits.Float

K-function bin size in nm

samplingtraits.Float

spacing (in nm) of samples from mask / region.

statisticstraits.Bool

Monte-Carlo sampling of the structure to determine clustering/ dispersion probability.

nsimint

Number of Monte-Carlo simulations to run. More simulations = more statistical power. Used if statistics == True.

significancefloat

Desired significance of

threadedbool

Calculate pairwise distances using multithreading (faster)

three_dbool

Analyze localizations in 2D or 3D. Requires correct dimensionality of input localizations and mask.

binSize = <PYME.misc.mock_traits.Float object>
execute(namespace)

takes a namespace (a dictionary like object) from which it reads its inputs and into which it writes outputs

NOTE: This was previously the function to define / override to make a module work. To support automatic metadata propagation and reduce the ammount of boiler plate, new modules should override the run() method instead.

inputMask = <PYME.recipes.traits.Input object>
inputPositions = <PYME.recipes.traits.Input object>
nbins = <PYME.misc.mock_traits.CStr object>
normalization = <PYME.misc.mock_traits.CStr object>
nsim = <PYME.misc.mock_traits.CStr object>
outputName = <PYME.recipes.traits.Output object>
sampling = <PYME.misc.mock_traits.Float object>
significance = <PYME.misc.mock_traits.Float object>
statistics = <PYME.misc.mock_traits.CStr object>
threaded = <PYME.misc.mock_traits.CStr object>
three_d = <PYME.misc.mock_traits.CStr object>
class PYME.recipes.pointcloud.Tesselation(point_data, three_d=True)

Bases: TabularBase, TrianglesBase

A wrapper class which encapsulates both a tesselation and the underlying point data source

FIXME - move somewhere more sensible

circumcentres()
property face_normals
property faces
keys()

returns the names of possible vertex attributes

property vertex_normals