neurots.astrocyte.section¶
Astrocyte section growers.
Functions
|
Grow towards the target_point with segment_length step from the given point and direction. |
Classes
|
|
|
Section grower that is influenced by a point cloud. |
- class neurots.astrocyte.section.NextPointData(point, direction, segment_length)¶
Bases:
tuple
- _asdict()¶
Return a new dict which maps field names to their values.
- classmethod _make(iterable)¶
Make a new NextPointData object from a sequence or iterable
- _replace(**kwds)¶
Return a new NextPointData object replacing specified fields with new values
- direction¶
Alias for field number 1
- point¶
Alias for field number 0
- segment_length¶
Alias for field number 2
- class neurots.astrocyte.section.SectionSpatialGrower(*args, **kwargs)¶
Bases:
SectionGrowerPath
Section grower that is influenced by a point cloud.
Note
The main difference with a regular grower is that randomness is calculated by the nearest neighbor in the point cloud. This way there is a local influence by the distribution of the seeds. As the seeds get removed when a new point is created, the new points are influenced only by the seeds that area available. This leads to a more spread out occupancy of space.
- _add_new_data(point, direction, segment_length)¶
Update relevant data after a next point action.
Following a next point action, make an update of the relevant data and remove a hemisphere of seed points around center point, directed backwards to direction.
- _grow_endfoot_section(initial_point, initial_direction, segment_length)¶
Creates all the points of the endfoot section at once and makes the relevant updates.
- _neighbor_contribution(current_point)¶
Return the direction considering the nearest neighbor.
Random contribution has a two case component: the influence from the closest seed attractor if any, otherwise a random direction.
- _next_point(current_point)¶
Create the next point.
Also update if no collision takes place or if the section type is endfoot. In addition, if the section type is endfoot, grow all points until the endfoot target and return None, to terminate.
- first_point()¶
Generates the first point of the section.
The generation depends on the growth method and the previous point. This gives flexibility to implement a specific computation for the first point, and ensures the section has at least one point.
Warning
The first point should be always called from the initialization when the section grower is added in the active list. It guarantees at least two point sections.
- property morphology_points¶
Returns entire morphology’s points from context.
- next()¶
Creates one point and returns the next state: bifurcate, terminate or continue.
- next_direction(current_point)¶
Return the next direction.
Given a starting point, find the new direction taking into account three contributions: the targeting, history and random contributions. Space colonization random contribution is calculated by the closest seed point in the point cloud.
- Parameters:
current_point (numpy.ndarray) – The current point.
- Returns:
The normalized direction.
- Return type:
- property point_cloud¶
Returns point cloud from context.
- neurots.astrocyte.section.grow_to_target(start_point, start_direction, target_point, segment_length, p=0.5)¶
Grow towards the target_point with segment_length step from the given point and direction.
- Parameters:
start_point (numpy.ndarray) – Starting point of the grower.
start_direction (numpy.ndarray) – Normalized initial direction.
target_point (numpy.ndarray) – Target point to grow to.
segment_length (numpy.ndarray) – The step size of the grower.
p (float, optional) – Influence from the target. If zero the grower will grow a straight line from the start point along the initial direction, and if 1.0 it will grow a straight line from the start point to the target point. Defaults to 0.5
- Returns:
A list of the generated 3D points.
- Return type: