neurorosettes.subcellular#

This module deals with the two components of the neurons: soma cells and neurites

Module Contents#

Classes#

CellBody

Class to represent a cell body with physical properties.

Neurite

Class to represent a neurite with physical properties.

ObjectFactory

Helper class to create instances of cell bodies and neurties based on defined properties.

class neurorosettes.subcellular.CellBody(position, mechanics)[source]#

Class to represent a cell body with physical properties.

Parameters
  • position (numpy.ndarray) – The coordinates of the cell body centre.

  • mechanics (neurorosettes.physics.PhysicalProperties) – The physical properties of the sphere that defines the cell body object.

set_center_position(coordinates)[source]#

Sets the cell position based on the given coordinates.

Parameters

coordinates (numpy.ndarray) – The cocordinates of the cell body centre.

Return type

None

set_force_from_daughter(force)[source]#

Sets the force transmitted by the cell’s daughter, if it exists.

Parameters

force (numpy.ndarray) – The force components of the force transmitted by the daughter object.

Return type

None

set_mechanics(mechanics)[source]#

Sets the physical properties of the cell

Parameters

mechanics (neurorosettes.physics.PhysicalProperties) –

Return type

None

set_sphere_representation(animator, color='red')[source]#

Creates and sets the sphere representation of the cell

Parameters

animator (neurorosettes.utilities.Animator) –

Return type

None

update_representation()[source]#

Updates the sphere representation of the cell

Return type

None

get_neighbor_force(neighbor, interaction)[source]#

Returns the interaction force between two cells

Parameters
Return type

numpy.ndarray

class neurorosettes.subcellular.Neurite(proximal_point, axis, cylinder_mechanics)[source]#

Class to represent a neurite with physical properties.

Parameters
  • proximal_point (numpy.ndarray) – The coordinates of the neurite’s proximal point.

  • axis (numpy.ndarray) – The axis of growth used to calculate the neurite’s distal point.

  • cylinder_mechanics (neurorosettes.physics.CylinderProperties) – The physical properties of the sphere that defines the cell body object.

property tension: float#

Returns the tension of the spring.

Return type

float

property spring_axis: numpy.ndarray#

Returns the vector that defines the spring.

Return type

numpy.ndarray

property current_length: float#

Returns the current length of the spring.

Return type

float

set_force_from_daughter(force)[source]#

Sets the force transmitted by the cell’s daughter, if it exists.

Parameters

force – The force components of the force transmitted by the daughter object.

create_neurite_representation(animator)[source]#

Creates a spring+sphere representation of the neurite.

Parameters

animator (neurorosettes.utilities.Animator) –

update_representation()[source]#

Updates the Animator representation of the neurite.

move_distal_point(coordinates)[source]#

Moves the distal point of the spring to the given position.

Parameters

coordinates (numpy.ndarray) –

Return type

None

move_proximal_point(coordinates)[source]#

Moves the proximal point of the spring to the given position.

Return type

None

get_growth_force(magnitude)[source]#

Returns the force created by neurite growth

Parameters

magnitude (float) –

get_spring_force()[source]#

Returns the force created by spring tension

Return type

numpy.ndarray

get_cell_neighbor_force(neighbor, interaction)[source]#

Returns the interaction force between the neurite and a CellBody.

Parameters
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.

Return type

Tuple[numpy.ndarray, float]

get_neurite_neighbor_force(neighbor, interaction)[source]#

Returns the interaction force between the neurite and another Neurite.

Parameters
  • neighbor (Neurite) – The other Neurite with which the object is interacting.

  • interactions – The contact force to be used to calculate the interaction force.

  • interaction (neurorosettes.physics.ContactForces) –

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.

Return type

Tuple[numpy.ndarray, float]

class neurorosettes.subcellular.ObjectFactory[source]#

Helper class to create instances of cell bodies and neurties based on defined properties.

cell_radius :float#

The cell radius.

cell_interaction_factor :float#

The factor used to calculate the cell’s interaction radius.

neurite_radius :float#

The neurite radius.

neurite_interaction_factor :float#

The factor used to calculate the neurite’s interaction radius.

neurite_spring_constant :float#

The neurite’s spring constant.

neurite_default_length :float#

The initial default length of a new neuritte.

get_cell_body(center_position)[source]#

Returns a CellBody object centred on the given position.

Parameters

center_position (numpy.ndarray) – The coordinates of the cell body’s centre.

Return type

A CellBody with the given coordinates and the chosen properties.

get_neurite(proximal_position, axis, restriction_factor=0.9)[source]#

Returns a Neurite object placed on the given position, pointing towards the axis.

Parameters
  • proximal_position (numpy.ndarray) – The coordinates of the neurite’s proximal point.

  • axis (numpy.ndarray) – The axis of growth of the new neurite.

  • restriction_factor (float) – 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.

Return type

A Neurite with the given coordinates and the chosen properties.