neurots.morphmath.sample

Definition of distributions to sample from.

Functions

azimuth_angles(distrib, N[, random_generator])

Return N azimuth angles, depending on the input distribution.

d_transform(distr, funct, **kwargs)

Transform a distribution according to a selected function.

n_neurites(distrib[, random_generator])

Return a number of neurites as sampled from a distribution plus some constraints.

ph(phs[, random_generator])

Samples randomly a persistence diagram from the input distribution.

sample_spherical_unit_vectors(rng)

Sample a point uniformly on the sphere.

soma_size(distrib[, random_generator])

Return a random soma radius as sampled from a distribution plus some constraints.

trunk_absolute_angles(distrib, N[, ...])

Return N absolute angles, depending on the input distribution.

trunk_angles(distrib, N[, random_generator])

Return N relative angles, depending on the input distribution.

Classes

Distr(params[, random_generator])

Class of custom distributions.

class neurots.morphmath.sample.Distr(params, random_generator=numpy.random)

Bases: object

Class of custom distributions.

Parameters:
  • params (dict) – The parameters of the distribution.

  • random_generator (numpy.random.Generator) – The random number generator to use.

draw()

Return a sampled number.

draw_positive()

Return a positive sampled number.

static expon(params)

Return loc, scale as expected from scipy from mean, std data.

static norm(params)

Return loc, scale as expected from scipy from mean, std data.

set_distribution(params)

Return a statistical distribution according to input parameters.

static uniform(params)

Return loc, scale as expected from scipy from min, max of a uniform.

neurots.morphmath.sample.azimuth_angles(distrib, N, random_generator=numpy.random)

Return N azimuth angles, depending on the input distribution.

neurots.morphmath.sample.d_transform(distr, funct, **kwargs)

Transform a distribution according to a selected function.

neurots.morphmath.sample.n_neurites(distrib, random_generator=numpy.random)

Return a number of neurites as sampled from a distribution plus some constraints.

It ensures the number will be an INT.

neurots.morphmath.sample.ph(phs, random_generator=numpy.random)

Samples randomly a persistence diagram from the input distribution.

neurots.morphmath.sample.sample_spherical_unit_vectors(rng)

Sample a point uniformly on the sphere.

Parameters:

rng – random number generator

neurots.morphmath.sample.soma_size(distrib, random_generator=numpy.random)

Return a random soma radius as sampled from a distribution plus some constraints.

neurots.morphmath.sample.trunk_absolute_angles(distrib, N, random_generator=numpy.random)

Return N absolute angles, depending on the input distribution.

neurots.morphmath.sample.trunk_angles(distrib, N, random_generator=numpy.random)

Return N relative angles, depending on the input distribution.