Mapping Neurons¶
Fragment Generation¶
-
class
brainlit.map_neurons.
DiffeomorphismAction
[source]¶ Interface for differentiable mappings e.g. transformations that register a brain image to an atlas.
-
D
(self, position: np.array, deriv: np.array, order: int = 1)[source]¶ Evaluate the mapping on a set of derivatives at specified positions.
- Parameters
position (np.array) -- Coordinates in the original space.
deriv (np.array) -- Derivatives at the respective positions
order (int, optional) -- Derivative order. Defaults to 1.
- Returns
Transformed derivatives.
- Return type
np.array
-
-
class
brainlit.map_neurons.
Diffeomorphism_Transform
(points, values)[source]¶ Object that takes a discrete vector field and creates a continuous one which can also give derivative (Jacobian) information. Implements DiffeomorphismAction which is an interface to transform points and tangent vectors.
-
D
(self, positions: np.array, derivs: np.array, order: int = 1, verbose=False)[source]¶ Compute transformed derivatives of mapping at given positions. Only for the non-affine component.
- Parameters
position (np.array) -- nx3 positions at which to compute derivatives.
deriv (np.array) -- nx3 derivatives at the respective positions.
order (int, optional) -- Order of derivative (must be 1). Defaults to 1.
- Raises
ValueError -- Only derivative order 1 is allowed here.
- Returns
Transformed derivatives
- Return type
np.array
-
-
class
brainlit.map_neurons.
CloudReg_Transform
(vpath: str, Apath: str, direction: str = 'atlas')[source]¶ Object that can read mat files from CloudReg, and compute transformations on points and Jacobians. Implements DiffeomorphismAction which is an interface to transform points and tangent vectors.
-
D
(self, position: np.array, deriv: np.array, order: int = 1)[source]¶ Compute transformed derivatives of mapping at given positions. Only for the non-affine component.
- Parameters
position (np.array) -- nx3 positions at which to compute derivatives.
deriv (np.array) -- nx3 derivatives at the respective positions.
order (int, optional) -- Order of derivative (must be 1). Defaults to 1.
- Raises
ValueError -- Only derivative order 1 is allowed here.
- Returns
Transformed derivatives
- Return type
np.array
-
Jacobian
(self, pos: np.array)[source]¶ Compute Jacobian of transformation at a given point.
- Parameters
pos (np.array) -- Coordinate in space.
- Returns
Jacobian at that coordinate
- Return type
np.array
-
-
brainlit.map_neurons.
diffeo_gen_ara
(sigma)[source]¶ Return random diffeomorphism generated by sampling Gaussian noise then passing through Riemannian exponential.
- Parameters
sigma (float) -- standard deviation of noise in microns.
- Returns
list of sampled points in spatial domain. np.array: range of diffeomorphism at sampled points.
- Return type
List