neuralib.calimg.cellular

final class neuralib.calimg.cellular.CellularCoordinates[source]

Container with coordinates information (in mm) for each ROIs

Dimension parameters:

N: number of neurons

P: number of plane types

neuron_idx: np.ndarray

neuron index. Array[float, N]

ap: np.ndarray

anterior posterior coordinates (default in mm). Array[float, N]

ml: np.ndarray

medial lateral coordinates (default in mm). Array[float, N]

plane_index: int | np.ndarray | None

optic plane index. i.e., used for depth analysis. If array type, Array[int, P]

source_plane_index: np.ndarray | None

neuron’s corresponding image plane. Array[float, N]

value: np.ndarray | None

metric (i.e., used in topographical analysis). Array[float, N]

unit: Literal['mm', 'um']

unit of the coordinates. {‘mm’, ‘um’}

__init__(neuron_idx, ap, ml, *, plane_index=None, source_plane_index=None, value=None, unit='mm')

Method generated by attrs for class CellularCoordinates.

Parameters:
  • neuron_idx (np.ndarray)

  • ap (np.ndarray)

  • ml (np.ndarray)

  • plane_index (int | np.ndarray | None)

  • source_plane_index (np.ndarray | None)

  • value (np.ndarray | None)

  • unit (Literal['mm', 'um'])

Return type:

None

check(attribute, value)[source]
to_um()[source]

unit from mm to um

Return type:

Self

with_value(value)[source]

assign value for CellularCoordinates

Parameters:

value (ndarray) – value array for the corresponding coordinates. Array[float, N]

Returns:

Return type:

Self

with_selection(mask)[source]

masking for cell selection

Parameters:

mask (ndarray) – numpy bool array. Array[bool, N]

Return type:

Self

in_relative_bregma(fov)[source]

TODO check register cellular coordinates to IBL coordinates space

Parameters:

fov (ObjectiveFov) – ObjectiveFov

Return type:

Self

static ml_rotate(x, y, deg)[source]

calculate the values for x axis rotation

Parameters:
  • x (ndarray) – coordinate x. Array[float, N]

  • y (ndarray) – coordinate Y. Array[float, N]

  • deg (float) – rotation degree

Returns:

value to be subtracted. dx (N,) and dy (N,)

Return type:

tuple[ndarray, ndarray]

static ap_rotate()[source]