cell_track.tools.box module

cell_track.tools.box.extract_xyrange(box)

Gets range for a side of a box. Returns range(x), range(y)

Parameters:box (tuple) – Coordinates of the box in (x1, x2, y1, y2)
Returns:x_range (int), y_range (int)
Return type:Two values (int)
cell_track.tools.box.filter_boxes(in_boxes, in_scores, _passed_boxes=[], _passed_scores=[])
Filters overlapping boxes. Accepts two lists of equal length:
  1. a list of boxes (x1, x2, y1, y2)
  2. a list of scores for the boxes

Solves ties by 1) highest score, or if those are tied, by 2) largest size. If the boxes are overlapping, but more than 20px apart, this is probably two cells and not overlapping boxes.

Parameters:
  • in_boxes (list) – List of coordinates to filter, each item a tuple (x1, x2, y1, y2)
  • in_scores (list) – List of scores for each box
  • _passed_boxes (list) – Pass an empty list to this []
  • _passed_scores (list) – Pass an empty list to this []
Returns:

passed_boxes (list of tuples), and pased_scores (list).

Return type:

Two lists

cell_track.tools.box.get_box_center(box)

Gets the center of a box. Returns x, y.

Parameters:box (tuple) – Coordinates of the box in (x1, x2, y1, y2)
Returns:centerx (float), centerx (float)
Return type:Two values (float)