:orphan: :py:mod:`traccuracy.loaders._ctc` ================================= .. py:module:: traccuracy.loaders._ctc Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: traccuracy.loaders._ctc.ctc_to_graph traccuracy.loaders._ctc.load_tiffs traccuracy.loaders._ctc.load_ctc_data Attributes ~~~~~~~~~~ .. autoapisummary:: traccuracy.loaders._ctc.logger .. py:data:: logger .. py:function:: ctc_to_graph(df: pandas.DataFrame, detections: pandas.DataFrame) -> networkx.DiGraph Create a Graph from DataFrame of CTC info with node attributes. :param df: CTC-style dataframe with columns [segmentation_id, start_frame, end_frame, parent_id] :type df: pd.DataFrame :param detections: Dataframe from _get_node_attributes with position and segmentation label for each cell detection :type detections: pd.DataFrame :returns: Graph representation of the CTC data. :rtype: networkx.DiGraph .. py:function:: load_tiffs(data_dir: str) -> numpy.ndarray Load a directory of individual frames into a stack. :param data_dir: Path to directory of tiff files :type data_dir: str :raises FileNotFoundError: No tif files found in data_dir :returns: 4D array with dims TYXC :rtype: np.array .. py:function:: load_ctc_data(data_dir: str, track_path: str | None = None, name: str | None = None, run_checks: bool = True, border_margin: float | None = None) -> traccuracy._tracking_graph.TrackingGraph Read the CTC segmentations and track file and create a TrackingGraph. :param data_dir: Path to directory containing CTC tiffs. :type data_dir: str :param track_path: Path to CTC track file. If not passed, finds `*_track.txt` in data_dir. :type track_path: optional, str :param name: Name of data to store in TrackingGraph :type name: optional, str :param run_checks: If set to `True` (default), runs checks on the data to ensure valid CTC format. :type run_checks: optional, bool :param border_margin: If set, nodes whose centroid is within this distance (in pixels) of the spatial border will be excluded from the graph. Defaults to None (no filtering). :type border_margin: float, optional :returns: TrackingGraph object containing segmentations and graph. :rtype: traccuracy.TrackingGraph :raises ValueError: If the tracks file is not found. If `run_checks` is True, whenever any of the CTC format checks are violated. If `run_checks` is False, whenever any other Exception occurs while creating the graph.