miv_simulator.geometry.geometry#

Classes and procedures related to neuronal geometry and distance calculation.

Functions

distance_interpolant(comm, layer_extents, ...)

euclidean_distance(a, b)

Row-wise euclidean distance.

generate_nodes(alpha, nsample, nodeitr)

get_layer_extents(layer_extents, layer)

get_total_extents(layer_extents)

get_volume_distances(ip_vol[, origin_spec, ...])

Computes arc-distances along the dimensions of an RBFVolume instance.

icp_transform(comm, geometry_config, volume, ...)

Uses the iterative closest point (ICP) algorithm of the PCL library to transform soma coordinates onto a surface for a particular L value.

interp_soma_distances(comm, ip_dist_u, ...)

Interpolates path lengths of cell coordinates along the dimensions of an RBFVolume instance.

load_alpha_shape(file_path, dataset_path)

make_alpha_shape(vol[, alpha_radius])

make_distance_interpolant(comm, ...[, ...])

make_rotate3d(rotate)

Creates a rotation matrix based on angles in degrees.

make_uvl_distance(vol, xyz_coords[, rotate])

measure_distance_extents(geometry_config, volume)

measure_distances(comm, geometry_config, ...)

measure_soma_distances(comm, layer_extents, ...)

optimize_inverse_uvl_coords(vol, xyz_coords, ...)

rotate2d(theta)

Returns the 2D rotation matrix associated with counterclockwise rotation around the origin by theta radians.

rotate3d(axis, theta)

Returns the 3D rotation matrix associated with counterclockwise rotation about the given axis by theta radians.

save_alpha_shape(file_path, dataset_path, ...)

transform_volume(transform, u, v, l[, rotate])

Transform to Euclidean volume.

uvl_in_bounds(uvl_coords, layer_extents, ...)

miv_simulator.geometry.geometry.rotate2d(theta)[source]#

Returns the 2D rotation matrix associated with counterclockwise rotation around the origin by theta radians.

miv_simulator.geometry.geometry.rotate3d(axis, theta)[source]#

Returns the 3D rotation matrix associated with counterclockwise rotation about the given axis by theta radians.

miv_simulator.geometry.geometry.make_rotate3d(rotate)[source]#

Creates a rotation matrix based on angles in degrees.

miv_simulator.geometry.geometry.transform_volume(transform, u, v, l, rotate=None)[source]#

Transform to Euclidean volume.

miv_simulator.geometry.geometry.euclidean_distance(a, b)[source]#

Row-wise euclidean distance. a, b are row vectors of points.

miv_simulator.geometry.geometry.get_volume_distances(ip_vol, origin_spec=None, nsample=1000, alpha_radius=None, nodeitr=20, comm=None)[source]#

Computes arc-distances along the dimensions of an RBFVolume instance.

Parameters:
ip_volRBFVolume

An interpolated volume instance of class RBFVolume.

origin_coordsarray(float)

Origin point to use for distance computation.

nsampleint

Number of points to sample inside the volume.

alpha_radiusfloat

Parameter for creation of alpha volume that encloses the RBFVolume. Smaller values improve the quality of alpha volume, but increase the time for sampling points inside the volume.

nodeitrint

Number of iterations for distributing sampled points inside the volume.

commMPIComm (optional)

mpi4py MPI communicator: if provided, node generation and distance computation will be performed in parallel

Returns
——-
(Y1, X1, … , YN, XN) where N is the number of dimensions of the volume.
Xarray of coordinates

The sampled coordinates.

Yarray of distances

The arc-distance from the starting index of the coordinate space to the corresponding coordinates in X.

miv_simulator.geometry.geometry.interp_soma_distances(comm, ip_dist_u, ip_dist_v, soma_coords, layer_extents, population_layers, interp_chunk_size=1000, populations=None, allgather=False)[source]#

Interpolates path lengths of cell coordinates along the dimensions of an RBFVolume instance.

Parameters:
commMPIComm

mpi4py MPI communicator

ip_dist_uRBFInterpolant

Interpolation function for computing arc distances along the first dimension of the volume.

ip_dist_vRBFInterpolant

Interpolation function for computing arc distances along the second dimension of the volume.

soma_coords{ population_namecoords_dict }
A dictionary that maps each cell population name to a dictionary of coordinates. The dictionary of coordinates must have the following type:

coords_dict : { gid : (u, v, l) } where: - gid: cell identifier - u, v, l: floating point coordinates

population_layers: { population_namelayers }

A dictionary of population count per layer Argument layers has the following type:

{ layer_name: count }

allgather: boolean (default: False)

if True, the results are gathered from all ranks and combined

Returns
——-
A dictionary of the form:

{ population: { gid: (distance_U, distance_V } }

miv_simulator.geometry.geometry.icp_transform(comm, geometry_config, volume, make_surface, soma_coords, projection_ls, population_extents, rotate=None, populations=None, icp_iter=1000, opt_iter=100)[source]#

Uses the iterative closest point (ICP) algorithm of the PCL library to transform soma coordinates onto a surface for a particular L value. http://pointclouds.org/documentation/tutorials/iterative_closest_point.php#iterative-closest-point