:py:mod:`neurorosettes.subcellular` =================================== .. py:module:: neurorosettes.subcellular .. autoapi-nested-parse:: This module deals with the two components of the neurons: soma cells and neurites Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: neurorosettes.subcellular.CellBody neurorosettes.subcellular.Neurite neurorosettes.subcellular.ObjectFactory .. py:class:: CellBody(position, mechanics) Class to represent a cell body with physical properties. :param position: The coordinates of the cell body centre. :param mechanics: The physical properties of the sphere that defines the cell body object. .. py:method:: set_center_position(coordinates) Sets the cell position based on the given coordinates. :param coordinates: The cocordinates of the cell body centre. .. py:method:: set_force_from_daughter(force) Sets the force transmitted by the cell's daughter, if it exists. :param force: The force components of the force transmitted by the daughter object. .. py:method:: set_mechanics(mechanics) Sets the physical properties of the cell .. py:method:: set_sphere_representation(animator, color='red') Creates and sets the sphere representation of the cell .. py:method:: update_representation() Updates the sphere representation of the cell .. py:method:: get_neighbor_force(neighbor, interaction) Returns the interaction force between two cells .. py:class:: Neurite(proximal_point, axis, cylinder_mechanics) Class to represent a neurite with physical properties. :param proximal_point: The coordinates of the neurite's proximal point. :param axis: The axis of growth used to calculate the neurite's distal point. :param cylinder_mechanics: The physical properties of the sphere that defines the cell body object. .. py:property:: tension :type: float Returns the tension of the spring. .. py:property:: spring_axis :type: numpy.ndarray Returns the vector that defines the spring. .. py:property:: current_length :type: float Returns the current length of the spring. .. py:method:: set_force_from_daughter(force) Sets the force transmitted by the cell's daughter, if it exists. :param force: The force components of the force transmitted by the daughter object. .. py:method:: create_neurite_representation(animator) Creates a spring+sphere representation of the neurite. .. py:method:: update_representation() Updates the Animator representation of the neurite. .. py:method:: move_distal_point(coordinates) Moves the distal point of the spring to the given position. .. py:method:: move_proximal_point(coordinates) Moves the proximal point of the spring to the given position. .. py:method:: get_growth_force(magnitude) Returns the force created by neurite growth .. py:method:: get_spring_force() Returns the force created by spring tension .. py:method:: get_cell_neighbor_force(neighbor, interaction) Returns the interaction force between the neurite and a CellBody. :param neighbor: The CellBody with which the object is interacting. :param interactions: The contact force to be used to calculate the interaction force. :returns: * *np.ndarray* -- The components of the interaction force between the two objects. * *float* -- The fraction of the force to be applied to the distal point. .. py:method:: get_neurite_neighbor_force(neighbor, interaction) Returns the interaction force between the neurite and another Neurite. :param neighbor: The other Neurite with which the object is interacting. :param interactions: The contact force to be used to calculate the interaction force. :returns: * *np.ndarray* -- The components of the interaction force between the two objects. * *float* -- The fraction of the force to be applied to the distal point. .. py:class:: ObjectFactory Helper class to create instances of cell bodies and neurties based on defined properties. .. py:attribute:: cell_radius :type: float The cell radius. .. py:attribute:: cell_interaction_factor :type: float The factor used to calculate the cell's interaction radius. .. py:attribute:: neurite_radius :type: float The neurite radius. .. py:attribute:: neurite_interaction_factor :type: float The factor used to calculate the neurite's interaction radius. .. py:attribute:: neurite_spring_constant :type: float The neurite's spring constant. .. py:attribute:: neurite_default_length :type: float The initial default length of a new neuritte. .. py:method:: get_cell_body(center_position) Returns a CellBody object centred on the given position. :param center_position: The coordinates of the cell body's centre. :rtype: A CellBody with the given coordinates and the chosen properties. .. py:method:: get_neurite(proximal_position, axis, restriction_factor = 0.9) Returns a Neurite object placed on the given position, pointing towards the axis. :param proximal_position: The coordinates of the neurite's proximal point. :param axis: The axis of growth of the new neurite. :param restriction_factor: The restriction factor used to compute the direction of a new neurite (the neurite will follow the axis with a given degree of freedom, defined by the restriction factor). Should be between 0 and 1. :rtype: A Neurite with the given coordinates and the chosen properties.