:py:mod:`neurorosettes.utilities` ================================= .. py:module:: neurorosettes.utilities Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: neurorosettes.utilities.Tissue neurorosettes.utilities.RectangularTissue neurorosettes.utilities.HexagonalTissue neurorosettes.utilities.Animator Functions ~~~~~~~~~ .. autoapisummary:: neurorosettes.utilities.get_random_position neurorosettes.utilities.get_random_unit_vector .. py:class:: Tissue(use_2d = True) Bases: :py:obj:`abc.ABC` Class to represent a multicellular tissue through the cell cooridnates. :param use_2d: If the cells are placed in a single plane or if the tissue is a 3D tissue. .. py:method:: get_coordinates() :abstractmethod: Returns the initial cell coordinates according to the tissue geometry .. py:class:: RectangularTissue(size, spacing = 16.0, use_2d = True) Bases: :py:obj:`Tissue` Class to represent a tissue that is a rectangular grid. :param size: The domain bounds of the tissue. :param spacing: The distance between cell centres. :param use_2d: If the cells are placed in a single plane or if the tissue is a 3D tissue. .. py:method:: get_coordinates() Returns the initial cell coordinates according to the tissue geometry .. py:class:: HexagonalTissue(size, spacing = 20.0, use_2d = True) Bases: :py:obj:`Tissue` Class to represent a tissue that is a hexagonal grid. :param size: The domain bounds of the tissue. :param spacing: The distance between cell centres. :param use_2d: If the cells are placed in a single plane or if the tissue is a 3D tissue. .. py:method:: get_coordinates() Returns the initial cell coordinates according to the tissue geometry .. py:function:: get_random_position(scaling_factor) Returns the coordinates for a random position between -scaling_factor and scaling factor. :param scaling_factor: The range of the interval where coorinates will be sampled from. .. py:function:: get_random_unit_vector(two_dimensions=False) Returns a vector for a random point in a unit sphere. .. py:class:: Animator Class to render the simulaiton results through vedo. .. py:method:: show(interactive = False) Shows the simulation results in a display window. :param interactive: If the plot should support user interaction. .. py:method:: update_clock(time_point) Updates the simulation clock string with the new time point. :param time_point: The new time point to be shown on the clock string. .. py:method:: add_grid(x_grid, y_grid) Adds a 2D grid object to the middle plane of the domain. :param x_grid: The x coordinates of the cells of the grid. :param y_grid: The y coordinates of the cell of the grid. .. py:method:: set_camera(height) Places the plotter camera at a given height. :param height: The height to place the camera at. .. py:method:: draw_spring(base_point, top_point, radius) 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. :param base_point: The coordinates for the base of the spring. :param top_point: The coordinates for the top of the spring. :param radius: The radius of the cylinder object. .. py:method:: draw_sphere(center, radius, **kwargs) Plots a sphere to represent a sphere object. :param center: The coordinates for the sphere center. :param radius: The radius of the sphere. .. py:method:: save_screenshot(file_name) Saves the current rendering to a PNG file. :param file_name: The name of the PNG file to be created.