tobac.analysis.cell_analysis.get_bounding_box#

tobac.analysis.cell_analysis.get_bounding_box(x, buffer=1)#

Finds the bounding box of a ndarray

This is the smallest bounding rectangle for nonzero values as explained here: https://stackoverflow.com/questions/31400769/bounding-box-of-numpy-array

Parameters:
  • x (numpy.ndarray) – Array for which the bounding box is to be determined.

  • buffer (int, optional) – Number to set a buffer between the nonzero values and the edges of the box. Default is 1.

Returns:

bbox – Dimensionwise list of the indices representing the edges of the bounding box.

Return type:

list