SCTrack.base module¶
- class SCTrack.base.Cell(*args, **kwargs)[source]¶
Bases:
object
Define the cell class, which is the core class of SC-Track. The smallest unit of all operations is the Cell instance, and the Cell is implemented as a conditional singleton mode: that is, different objects are generated according to the parameters passed in. If the parameters passed in are the same , only one object is instantiated. When defining the Cell object, Cell class can be guaranteed that there is only one Cell instance for the same cell in one frame, and differentCell instances are generated in different frames. If you want to instantiate a Cell object, at least its position information needs to be passed in, that is, all the xy coordinate points that constitute the outline of the cell.
- property area¶
Area of a cell
- Type:
return
- property available_range: Rectangle¶
Define the matchable range of the two frames before and after, the default is twice the horizontal and vertical coordinates of the cell :return: Rectangle instance
- property bbox¶
bounding box coordinates
- property branch_id¶
- property cell_id¶
Cell id, parent cell and daughter cell have different value
- property center¶
cell physical center
- Type:
return
- change_mitosis_flag(flag: bool)[source]¶
- When the cell enters mitosis for the first time, self.mitosis_start_flag is set to True, and when the cell
completes division, it is reset to false.
- property contours¶
Convert the list of xy coordinate points into contour points list :return: if successful, return contours, else return None
- property d_long¶
Long side diameter of cell bounding box
- Type:
return
- property d_short¶
Short side diameter of cell bounding box
- Type:
return
- property feature¶
- property is_accurate_matched¶
- property is_be_matched¶
I f participated in the match, return match status, otherwise, False
- move(speed: Vector, time: int = 1)[source]¶
- Parameters:
speed – move speed, Vector object instance
time – move time,frame
- Returns:
New Cell instance after moving
- property parent¶
- static polygon_area(x, y)[source]¶
Calculate cell area
- Parameters:
x – A list of x-coordinates of all points of the cell counters
y – A list of y-coordinates of all points of the cell counters
- Returns:
Area of cell
- static polygon_centroid(vertex_coordinates)[source]¶
Calculate the physical center of gravity of the cell counters. :param vertex_coordinates: list of cell outline coordinate points, the format is [[x1, x2,…xn], [y1, y2,..yn]] :return: physical center of gravity
- property r_long¶
Cell bounding box long side radius
- Type:
return
- property r_short¶
Cell bounding box short side radius
- Type:
return
- property region¶
- set_status(status: TreeStatus | CellStatus)[source]¶
- property status¶
- property track_id¶
- class SCTrack.base.CellStatus(*args, **kwargs)[source]¶
Bases:
TreeStatus
Record the status of cells and exclude them from other matching candidates if they have participated in precise matching. If the cell has undergone Mitosis in a short time, it will not participate in Mitosis matching.
- class SCTrack.base.MatchStatus(value)[source]¶
Bases:
Enum
Matching status enumeration object, including matched, unmatched, and missing matches, is the status value of TrackingTree.
- LossMatch = 2¶
- Matched = 0¶
- Unmatched = 1¶
- class SCTrack.base.Rectangle(x_min, x_max, y_min, y_max)[source]¶
Bases:
object
Rectangular class , used to record the bounding box and available range of cells
- property area¶
Return the Rectangle area,
- class SCTrack.base.SingleInstance(*args, **kwargs)[source]¶
Bases:
object
Singleton pattern base class. If the parameters are the same, only one instance object will be instantiated
- init_flag = False¶
- class SCTrack.base.TreeStatus(*args, **kwargs)[source]¶
Bases:
object
Record the state of the tracked cells, including cell cell_type status, division status, and matching status Phase: whether Mitosis has entered, and which frame has entered Mitosis Division: whether there is Mitosis Matching situation: Is there any loss of matching in this cell
- property exit_mitosis_time¶
- get_status(status_type: str)[source]¶
- Parameters:
status_type – __status_types member
- Returns:
member status
- property is_mitosis_enter¶
- property predict_M_len¶
- property status¶
- class SCTrack.base.Vector(x=None, y=None, shape=(2, ), dtype=<class 'float'>, buffer=None, offset=0, strides=None, order=None)[source]¶
Bases:
ndarray
2D plane vector class
- property cos¶
Return the cosine value of vector
- cosDistance(other)[source]¶
Cosine distance, numerically equal to 1 minus cosine similarity, range of values [0,2]
- cosSimilar(other)[source]¶
Compare the cosine similarity of two vectors, with a range of values [-1, 1]
- property module¶
Return the modulus of vector