|
| get_lengths (str track_distribution, int track_length_mean, int total_tracks) |
|
dict | create_condensate_dict (np.ndarray initial_centers, np.ndarray initial_scale, np.ndarray diffusion_coefficient, np.ndarray hurst_exponent, np.ndarray cell_space, float cell_axial_range, **kwargs) |
|
| tophat_function_2d (var, center, radius, bias_subspace, space_prob, **kwargs) |
|
| generate_points (pdf, total_points, min_x, max_x, center, radius, bias_subspace_x, space_prob, density_dif) |
|
| generate_points_from_cls (pdf, total_points, min_x, max_x, min_y, max_y, min_z, max_z, density_dif) |
|
| generate_radial_points (total_points, center, radius) |
|
| generate_sphere_points (total_points, center, radius) |
|
| radius_spherical_cap (R, center, z_slice) |
|
| get_gaussian (mu, sigma, domain=[list(range(10)), list(range(10))]) |
|
float|np.ndarray | axial_intensity_factor (float|np.ndarray abs_axial_pos, float detection_range, **kwargs) |
|
np.ndarray | generate_map_from_points (np.ndarray points, float|np.ndarray point_intensity, np.ndarray|None map, bool movie, float base_noise, float psf_sigma) |
|
Documentation for the simulate_foci.py file.
This file contains the class for simulating foci in space.
Author: Baljyot Singh Parmar
dict SMS_BP.simulate_foci.create_condensate_dict |
( |
np.ndarray | initial_centers, |
|
|
np.ndarray | initial_scale, |
|
|
np.ndarray | diffusion_coefficient, |
|
|
np.ndarray | hurst_exponent, |
|
|
np.ndarray | cell_space, |
|
|
float | cell_axial_range, |
|
|
** | kwargs ) |
Docstring for create_condensate_dict:
Parameters:
-----------
inital_centers: numpy array of shape (num_condensates,2) with the initial centers of the condensates
initial_scale: numpy array of shape (num_condensates,2) with the initial scales of the condensates
diffusion_coefficient: numpy array of shape (num_condensates,2) with the diffusion coefficients of the condensates
hurst_exponent: numpy array of shape (num_condensates,2) with the hurst exponents of the condensates
cell_space: numpy array of shape (2,2) with the cell space
cell_axial_range: float
**kwargs: additional arguments to be passed to the condensate_movement.Condensate class
np.ndarray SMS_BP.simulate_foci.generate_map_from_points |
( |
np.ndarray | points, |
|
|
float | np.ndarray | point_intensity, |
|
|
np.ndarray | None | map, |
|
|
bool | movie, |
|
|
float | base_noise, |
|
|
float | psf_sigma ) |
Docstring for generate_map_from_points:
---------------------------
Generates the space map from the points. 2D
Parameters:
-----------
points: array-like
points numpy array of shape (total_points,2)
point_intensity: array-like
intensity of the points, if None, then self.point_intensity is used.
map: array-like
space map, if None, then a new space map is generated.
movie: bool
if True, then don't add the gaussian+noise for each point. Rather add the gaussians and then to the whole add the noise.
base_noise: float
base noise to add to the space map
psf_sigma: float
sigma of the psf (pix units)
Returns:
--------
1. space map as a numpy array of shape (max_x,max_x)
2. points as a numpy array of shape (total_points,2)
Notes:
------
1. The space map is generated using get_gaussian function.
2. For movie: In the segmented experimental images you are adding the noise of each frame to the whole subframe,
so for this (movie=False) add each gaussian point to the image with the noise per point.
(movie=True) add the gaussians together and then add the noise to the final image.
SMS_BP.simulate_foci.generate_radial_points |
( |
| total_points, |
|
|
| center, |
|
|
| radius ) |
Genereate uniformly distributed points in a circle of radius.
Parameters
----------
total_points : int
total points from this distribution
center : array-like or tuple
coordinate of the center of the radius. [x,y,...]
radius : float-like
radius of the region on which to
Returns
-------
(n,2) size array
array of coordinates of points genereated (N,3) N = # of points, 2 = dimentions
SMS_BP.simulate_foci.generate_sphere_points |
( |
| total_points, |
|
|
| center, |
|
|
| radius ) |
Genereate uniformly distributed points in a sphere of radius.
Parameters
----------
total_points : int
total points from this distribution
center : array-like or tuple
coordinate of the center of the radius. [x,y,...]
radius : float-like
radius of the region on which to
Returns
-------
(n,2) size array
array of coordinates of points genereated (N,3) N = # of points, 2 = dimentions
SMS_BP.simulate_foci.get_gaussian |
( |
| mu, |
|
|
| sigma, |
|
|
| domain = [list(range(10)), list(range(10))] ) |
Parameters
----------
mu : array-like or float of floats
center position of gaussian (x,y) or collection of (x,y)
sigma : float or array-like of floats of shape mu
sigma of the gaussian
domain : array-like, Defaults to 0->9 for x,y
x,y domain over which this gassuain is over
Returns
-------
array-like 2D
values of the gaussian centered at mu with sigma across the (x,y) points defined in domain
Notes:
------
THIS IS IMPORTANT: MAKE SURE THE TYPES IN EACH PARAMETER ARE THE SAME!!!!
SMS_BP.simulate_foci.radius_spherical_cap |
( |
| R, |
|
|
| center, |
|
|
| z_slice ) |
Find the radius of a spherical cap given the radius of the sphere and the z coordinate of the slice
Theory: https://en.wikipedia.org/wiki/Spherical_cap, https://mathworld.wolfram.com/SphericalCap.html
Parameters:
-----------
R : float,int
radius of the sphere
center : array-like
[x,y,z] coordinates of the center of the sphere
z_slice : float,int
z coordinate of the slice relative to the center of the sphere, z_slice = 0 is the center of the sphere
Returns:
--------
float
radius of the spherical cap at the z_slice
Notes:
------
1. This is a special case of the spherical cap equation where the center of the sphere is at the origin
SMS_BP.simulate_foci.tophat_function_2d |
( |
| var, |
|
|
| center, |
|
|
| radius, |
|
|
| bias_subspace, |
|
|
| space_prob, |
|
|
** | kwargs ) |
Defines a circular top hat probability distribution with a single biased region defining the hat.
The rest of the space is uniformly distrubuted in 2D
Parameters
----------
var : array-like, float
[x,y] defining sampling on the x,y span of this distribution
center : array-like, float
[c1,c2] defining the center coordinates of the top hat region
radius : float
defines the radius of the circular tophat from the center
bias_subspace : float
probability at the top position of the top hat
space_prob : float
probability everywhere not in the bias_subspace
Returns
-------
float, can be array-like if var[0],var[1] is array-like
returns the value of bias_subspace or space_prob depending on where the [x,y] data lies