neurorosettes.utilities#
Module Contents#
Classes#
Class to represent a multicellular tissue through the cell cooridnates. |
|
Class to represent a tissue that is a rectangular grid. |
|
Class to represent a tissue that is a hexagonal grid. |
|
Class to render the simulaiton results through vedo. |
Functions#
|
Returns the coordinates for a random position between -scaling_factor and scaling factor. |
|
Returns a vector for a random point in a unit sphere. |
- class neurorosettes.utilities.Tissue(use_2d=True)[source]#
Bases:
abc.ABCClass to represent a multicellular tissue through the cell cooridnates.
- Parameters:
use_2d (bool) – If the cells are placed in a single plane or if the tissue is a 3D tissue.
- class neurorosettes.utilities.RectangularTissue(size, spacing=16.0, use_2d=True)[source]#
Bases:
TissueClass to represent a tissue that is a rectangular grid.
- Parameters:
size (float) – The domain bounds of the tissue.
spacing (float) – The distance between cell centres.
use_2d (bool) – If the cells are placed in a single plane or if the tissue is a 3D tissue.
- class neurorosettes.utilities.HexagonalTissue(size, spacing=20.0, use_2d=True)[source]#
Bases:
TissueClass to represent a tissue that is a hexagonal grid.
- Parameters:
size (float) – The domain bounds of the tissue.
spacing (float) – The distance between cell centres.
use_2d (bool) – If the cells are placed in a single plane or if the tissue is a 3D tissue.
- neurorosettes.utilities.get_random_position(scaling_factor)[source]#
Returns the coordinates for a random position between -scaling_factor and scaling factor.
- Parameters:
scaling_factor (float) – The range of the interval where coorinates will be sampled from.
- Return type:
numpy.ndarray
- neurorosettes.utilities.get_random_unit_vector(two_dimensions=False)[source]#
Returns a vector for a random point in a unit sphere.
- Return type:
numpy.ndarray
- class neurorosettes.utilities.Animator[source]#
Class to render the simulaiton results through vedo.
- show(interactive=False)[source]#
Shows the simulation results in a display window.
- Parameters:
interactive (bool) – If the plot should support user interaction.
- update_clock(time_point)[source]#
Updates the simulation clock string with the new time point.
- Parameters:
time_point (float) – The new time point to be shown on the clock string.
- Return type:
None
- add_grid(x_grid, y_grid)[source]#
Adds a 2D grid object to the middle plane of the domain.
- Parameters:
x_grid (numpy.ndarray) – The x coordinates of the cells of the grid.
y_grid (numpy.ndarray) – The y coordinates of the cell of the grid.
- Return type:
None
- set_camera(height)[source]#
Places the plotter camera at a given height.
- Parameters:
height (float) – The height to place the camera at.
- draw_spring(base_point, top_point, radius)[source]#
Plots a spring and a sphere to represent a cylinder object.
The spring connects the two points passed as coordinates, and a sphere is placed centred on the top point.
- Parameters:
base_point (numpy.ndarray) – The coordinates for the base of the spring.
top_point (numpy.ndarray) – The coordinates for the top of the spring.
radius (float) – The radius of the cylinder object.