cleo.coords module#

Contains functions for assigning neuron coordinates and visualizing

cleo.coords.assign_coords(neuron_group: NeuronGroup, coords: Quantity)[source]#

Assigns x, y, and z coordinates for neuron group from (n, 3) array

cleo.coords.assign_coords_grid_rect_prism(neuron_group: NeuronGroup, xlim: Tuple[float, float], ylim: Tuple[float, float], zlim: Tuple[float, float], shape: Tuple[int, int, int], unit: Unit = mmetre) None[source]#

Assign grid coordinates to neurons in a rectangular grid

Parameters:
  • neuron_group (NeuronGroup) – The neuron group to assign coordinates to

  • xlim (Tuple[float, float]) – xmin, xmax, with no unit

  • ylim (Tuple[float, float]) – ymin, ymax, with no unit

  • zlim (Tuple[float, float]) – zmin, zmax with no unit

  • shape (Tuple[int, int, int]) – n_x, n_y, n_z tuple representing the shape of the resulting grid

  • unit (Unit, optional) – Brian unit determining what scale to use for coordinates, by default mm

Raises:

ValueError – When the shape is incompatible with the number of neurons in the group

cleo.coords.assign_coords_rand_cylinder(neuron_group: NeuronGroup, xyz_start: Tuple[float, float, float], xyz_end: Tuple[float, float, float], radius: float, unit: Unit = mmetre) None[source]#

Assign random coordinates within a cylinder.

Parameters:
  • neuron_group (NeuronGroup) – neurons to assign coordinates to

  • xyz_start (Tuple[float, float, float]) – starting position of cylinder without unit

  • xyz_end (Tuple[float, float, float]) – ending position of cylinder without unit

  • radius (float) – radius of cylinder without unit

  • unit (Unit, optional) – Brian unit to scale other params, by default mm

cleo.coords.assign_coords_rand_rect_prism(neuron_group: NeuronGroup, xlim: Tuple[float, float], ylim: Tuple[float, float], zlim: Tuple[float, float], unit: Unit = mmetre) None[source]#

Assign random coordinates to neurons within a rectangular prism

Parameters:
  • neuron_group (NeuronGroup) – neurons to assign coordinates to

  • xlim (Tuple[float, float]) – xmin, xmax without unit

  • ylim (Tuple[float, float]) – ymin, ymax without unit

  • zlim (Tuple[float, float]) – zmin, zmax without unit

  • unit (Unit, optional) – Brian unit to specify scale implied in limits, by default mm

cleo.coords.assign_coords_uniform_cylinder(neuron_group: NeuronGroup, xyz_start: Tuple[float, float, float], xyz_end: Tuple[float, float, float], radius: float, unit: Unit = mmetre) None[source]#

Assign uniformly spaced coordinates within a cylinder.

Parameters:
  • neuron_group (NeuronGroup) – neurons to assign coordinates to

  • xyz_start (Tuple[float, float, float]) – starting position of cylinder without unit

  • xyz_end (Tuple[float, float, float]) – ending position of cylinder without unit

  • radius (float) – radius of cylinder without unit

  • unit (Unit, optional) – Brian unit to scale other params, by default mm

cleo.coords.assign_xyz(neuron_group: NeuronGroup, x: ndarray, y: ndarray, z: ndarray, unit: Unit = mmetre)[source]#

Assign arbitrary coordinates to neuron group.

Parameters:
  • neuron_group (NeuronGroup) – neurons to be assigned coordinates

  • x (np.ndarray) – x positions to assign (preferably 1D with no unit)

  • y (np.ndarray) – y positions to assign (preferably 1D with no unit)

  • z (np.ndarray) – z positions to assign (preferably 1D with no unit)

  • unit (Unit, optional) – Brian unit determining what scale to use for coordinates, by default mm

cleo.coords.concat_coords(*coords: Quantity) Quantity[source]#

Combine multiple coordinate Quantity arrays into one

Parameters:

*coords (Quantity) – Multiple coordinate n x 3 Quantity arrays to combine

Returns:

A single n x 3 combined Quantity array

Return type:

Quantity

cleo.coords.coords_from_ng(ng: NeuronGroup) Quantity[source]#

Get (n, 3) coordinate array from NeuronGroup.

cleo.coords.coords_from_xyz(x: Quantity, y: Quantity, z: Quantity) Quantity[source]#

Create (…, 3) coordinate array from x, y, z arrays (with units).