neurots.morphmath.utils

Util functions useful for general purposes.

Functions

ball_query(points, ball_center, ball_radius)

Return the ids of the tree_points that are located inside the ball with center and radius.

from_to_direction(point1, point2[, ...])

Return weight and normalized direction to target.

get_random_point([D, random_generator])

Return 3-d coordinates of a new random point.

in_same_halfspace(vectors, normal[, return_dots])

Return a mask of vectors that are in the same halfspace as its normal.

in_squared_proximity(point1, point2, ...)

Return true if point1 is in the proximity of point2.

norm(vector)

Return the norm of the numpy array.

normalize_inplace(vector)

Normalizes a vector in place and returns it.

normalize_vectors(vectors)

Return normalized vectors.

upper_half_ball_query(points, ball_center, ...)

Return the points from a ball that are in the same halfspace as the given direction.

neurots.morphmath.utils.ball_query(points, ball_center, ball_radius)

Return the ids of the tree_points that are located inside the ball with center and radius.

neurots.morphmath.utils.from_to_direction(point1, point2, return_length=False)

Return weight and normalized direction to target.

neurots.morphmath.utils.get_random_point(D=1.0, random_generator=numpy.random)

Return 3-d coordinates of a new random point.

The distance between the produced point and (0,0,0) is given by the value D.

neurots.morphmath.utils.in_same_halfspace(vectors, normal, return_dots=False)

Return a mask of vectors that are in the same halfspace as its normal.

neurots.morphmath.utils.in_squared_proximity(point1, point2, squared_proximity)

Return true if point1 is in the proximity of point2.

neurots.morphmath.utils.norm(vector)

Return the norm of the numpy array.

neurots.morphmath.utils.normalize_inplace(vector)

Normalizes a vector in place and returns it.

It is faster because it avoids a copy but be careful when using it because it mutates its argument.

neurots.morphmath.utils.normalize_vectors(vectors)

Return normalized vectors.

neurots.morphmath.utils.upper_half_ball_query(points, ball_center, ball_radius, direction)

Return the points from a ball that are in the same halfspace as the given direction.

This function returns the points that are included in the hemisphere that has ref_point as center, hemisphere_radius and are in the same halfspace as direction.