pymaid.get_nodes_in_volume

pymaid.get_nodes_in_volume(*x, coord_format='NM', resolution=(4, 4, 50), remote_instance=None)[source]

Retrieve nodes and connectors in given bounding box.

Please note that there is a cap on the number of nodes returned that is hard wired into the CATMAID server’s settings.

Parameters
  • *x

    Coordinates defining the bounding box. Can be either:

    • 1d list of coordinates: left, right, top, bottom, z1, z2

    • 2d list of coordinates: [[left, right], [top, bottom], [z1, z2]]

    • pymaid.Volume

    Can be given in nm or pixels.

  • coord_format (str, optional) – Define whether provided coordinates are in nanometer (‘NM’) or in pixels/slices (‘PIXEL’).

  • resolution (tuple of floats, optional) – x/y/z resolution in nm [default = (4, 4, 50)] Used to transform to nm if limits are given in pixels.

  • remote_instance (CatmaidInstance, optional) – If not passed directly, will try using global.

Returns

  • nodes (pandas.DataFrame) –

    DataFrame in which each row is a node:

       node_id  parent_id  x  y  z  confidence  radius  skeleton_id  edition_time  user_id
    0
    1
    2
    
  • connectors (pandas.DataFrame) –

    DataFrame in which each row is a connector:

       connector_id x y z confidence edition_time user_id partners
    0
    1
    2
    
       ``partners`` are lists of::
    
       [node_id, relation_id, link_confidence, link_edition_time, link_id]
    
  • truncated (bool) – If True, lists are truncated due to node limit reached.

  • relation_map (dict) – Map for relation_id in connector’s partner column.

Examples

Get (truncated) lists of nodes and connectors in the bounding box of the AL:

>>> al = pymaid.get_volume('AL_R')
>>> nodes, connectors, truncated, relation_map = pymaid.get_nodes_in_volume(al)
>>> truncated
True