SCTrack.reclassification module

class SCTrack.reclassification.TreeParser(track_tree: TrackingTree)[source]

Bases: object

parse TrackingTree

bfs()[source]

Traverse TrackingTree according to breadth first

static check_ctype_exit(type_name, end_index, linage_cell, threshold=6.0)[source]

To judge the exit of cell_type, the judgment principle is the same as entering cell_type, if the cells start to exit cell_type, check later

static check_ctype_start(type_name, start_index, linage_cell, threshold=6.0)[source]

Check the entry of cell_type, if the cell is predicted to be in indicate cell_type, check 10 frames later, If the number of remaining frames is less than 10 frames, check all the remaining frames. If the cumulative predicted indicate cell type is greater than the threshold, If the judgment succeeds, otherwise, the judgment fails

static check_mitosis_start(start_index, lineage_cell, area_size_t=0.9, mitosis_gap=20, m_predict_threshold=5)[source]

Check the entry of the M period, if the area meets the conditions, check the next frame, if the area of the next frame is too small, it is not considered to have entered, and it is judged as a segmentation misjudgment. If the check is passed, check the next 6 frames. If the number of M phases is predicted to be greater than or equal to the threshold, it is judged to enter the M cell_type to pass, otherwise, the judgment fails. If the interval from the last entry to M is too short, it is also considered a misjudgment

get_child(parent: CellNode) List[CellNode][source]

Return all child nodes according to the parent node, including only direct child nodes

get_lineage_dict()[source]
parse_g1_g2(lineage: dict, root: CellNode, lineage_index=None)[source]

Accurately distinguish G1/G2 into G1, G2

parse_lineage(root_node)[source]

Get the cell node sequence contained in each branch

parse_lineage_branch_id(lineage, branch_id)[source]
parse_lineage_phase(lineage: dict, root: CellNode, linage_index)[source]
parse_mitosis(lineage: dict, root: CellNode, lineage_index=None)[source]

Parse entry and exit of mitosis

parse_mitosis_error(lineage: dict, root: CellNode, lineage_index=None)[source]

If the two daughter cells after division are not matched, all subsequent cells will be in the M cell_type. At this time, it should be corrected to G1 within a certain period of time.

parse_s(lineage: dict, root: CellNode, lineage_index=None)[source]

To judge the entry of S cell_type

record_cell_division_count()[source]
search_root_node()[source]

Find the root node of each generation of cells, that is, the first node of each branch of TrackingTree This method is to deal with the situation where mitosis occurs, that is, the tree begins to branch When the cell begins to undergo mitosis, the tree will split, record the node at this time, and backtrack as a generation of cells

set_cell_id(lineage: dict, root: CellNode, lineage_index)[source]
smooth_type(cell_lineage, root, lineage_index)[source]
SCTrack.reclassification.find_combinations_objects(A, B, gap_threshold)[source]
SCTrack.reclassification.pares_single_tree(tree: TrackingTree)[source]
SCTrack.reclassification.paste(tree_pre: TrackingTree, paste_node: CellNode, tree_next: TrackingTree)[source]

When the frame rate of the root node of a tree is greater than the frame rate of the leaf node of another tree, and the difference between the two is within a certain range, it is judged whether the two trees can be relinked, according to the similarity of this two cell

SCTrack.reclassification.run(annotation, output_dir, basename, track_range=None, save_visualize=True, visualize_background_image=None, dic=None, mcy=None, track_to_json=True)[source]
SCTrack.reclassification.run_track(annotation, track_range=None, dic=None, mcy=None, speed_filename=None)[source]
SCTrack.reclassification.track_tree_to_TRA(tracker: Tracker, output_fname=None, xrange=None, basename=None)[source]

Export track result as TRA format

SCTrack.reclassification.track_tree_to_mask(tracker, width, height, output_dir)[source]
SCTrack.reclassification.track_tree_to_table(tracker: Tracker, filepath)[source]

Export track result to table

SCTrack.reclassification.track_trees_to_json(tracker: Tracker, output_fname, xrange, basename=None)[source]

Export track result to json file