fafbseg.flywire.get_lr_position#

fafbseg.flywire.get_lr_position(x, coordinates='nm')[source]#

Find out if given xyz positions are on the fly’s left or right.

This works by:
  1. Mirror positions from one side to the other (requires flybrains)

  2. Substracting original from the mirrored x-coordinate

Parameters:
  • x ((N, 3) array | TreeNeuron | MeshNeuron | Dotprops) – Array of xyz coordinates or a neuron. If a navis neuron, will use nodes, vertex or point coordinates for TreeNeurons, MeshNeurons and Dotprops, respectively.

  • coordinates ("nm" | "voxel") – Whether coordinates are in nm or voxel space.

Returns:

xm – A vector of point displacements in nanometers where 0 is at the midline and positive values are to the fly’s right.

Return type:

(N, ) array

Examples

>>> from fafbseg import flywire
>>> # Three example points: right, left, ~center
>>> flywire.get_lr_position([[104904, 47464, 5461],
...                          [140648, 49064, 2262],
...                          [131256, 29984, 2358]],
...                         coordinates='voxel')
array([110501.5, -39480. ,    306.5])