degree1_inference_processor#
This module provides functionality to run inference on the nature of degree=1 vertices in a vascular graph, detecting tip cells and interrupted vessels.
The main user function is degree1_verification, which performs inference on the graph vertices and updates the graph in place with predictions based on a pre-trained model.
- degree1_verification(sample_manager, model_weights_path=None, threshold=0.8, stitched_img_channel='vasc', graph_channel='vasc', graph_step=None)[source]#
Perform tip cells / interrupted vessels detection and update the graph with predictions. Called externally from the pipeline (e.g. tube_map_new_api.py) with no additional logic inside.
- Parameters:
sample_manager (ClearMap.processors.sample_preparation.SampleManager) – The SampleManager instance managing the sample data.
model_weights_path (str | Path | None) – Path to the model weights file for inference. Default is None, which uses the default model.
threshold (float) – Threshold for tip cell prediction. Default is 0.8.
stitched_img_channel (str) – The channel of the stitched image to use for inference. This is the channel which contains the grayscale of the tip cells. Default is ‘vasc’.
graph_channel (str or tuple or list) – The channel(s) of the graph. This can be a single channel or a tuple/list of channels. Default is (‘vasc’,).
graph_step (str or None) – The step in the graph processing pipeline to use for inference. Typically, one of [‘raw’, ‘cleaned’, ‘reduced’, ‘annotated’] If None, the default graph step will be used.
- export_vertex_coordinates(graph: Graph) DataFrame[source]#
Extract coordinates and degrees of all vertices from a graph into a DataFrame.
- Parameters:
graph (ClearMap.Analysis.graphs.graph_gt.Graph) – The graph from which to extract vertex properties.
Returns
- pd.DataFrame
A DataFrame containing vertex IDs, coordinates (x, y, z), and degrees.