clustertracking.artificial.SimulatedImage

class clustertracking.artificial.SimulatedImage(shape, size, dtype=<class 'numpy.uint8'>, saturation=None, hard_radius=None, signal=None, noise=0, feat_func=<function feat_gauss at 0x000000000B4EB1E0>, **feat_kwargs)[source]

This class makes it easy to generate artificial pictures.

Parameters:

shape : tuple of int

dtype : numpy.dtype, default np.uint8

saturation : maximum value in image

hard_radius : default radius of particles, used for determining the

distance between particles in clusters

feat_dict : dictionary of arguments passed to tp.artificial.draw_feature

Examples

image = SimulatedImage(shape=(50, 50), dtype=np.uint8, hard_radius=7,
feat_dict={‘diameter’: 20, ‘max_value’: 100,
‘feat_func’: SimulatedImage.feat_hat, ‘disc_size’: 0.2})

image.draw_feature((10, 10)) image.draw_dimer((32, 35), angle=75) image.add_noise(5) image()

Attributes

image (ndarray containing pixel values)
center (the center [y, x] to use for radial coordinates)
__init__(shape, size, dtype=<class 'numpy.uint8'>, saturation=None, hard_radius=None, signal=None, noise=0, feat_func=<function feat_gauss at 0x000000000B4EB1E0>, **feat_kwargs)[source]

Methods

__init__(shape, size[, dtype, saturation, ...])
clear() Clears the current image
denoised(noise_level, noise_size[, ...])
draw_cluster(cluster_size[, center, angle, ...]) Draws a cluster of size n at pos with angle angle.
draw_clusters(N, cluster_size[, ...]) Draws N clusters at random locations, using minimum separation and a margin.
draw_dimer(pos, angle[, hard_radius]) Draws a dimer at pos with angle angle.
draw_dumbell(pos, angle[, hard_radius]) Draws a dimer at pos with angle angle.
draw_feature(pos) Draws a feature at pos.
draw_feature_radial(r, angle[, center]) Draws a feature at radial coordinates r, angle.
draw_features(N[, separation, margin]) Draws N features at random locations, using minimum separation and a margin.
draw_triangle(pos, angle[, hard_radius]) Draws a trimer at pos with angle angle.
draw_trimer(pos, angle[, hard_radius]) Draws a trimer at pos with angle angle.
f([noise])
noisy_image(noise_level) Adds noise to the current image, uniformly distributed between 0 and noise_level, not including noise_level.

Attributes

coords