spateo.tdr.models.models_backbone.backbone_utils ================================================ .. py:module:: spateo.tdr.models.models_backbone.backbone_utils Functions --------- .. autoapisummary:: spateo.tdr.models.models_backbone.backbone_utils.map_points_to_backbone spateo.tdr.models.models_backbone.backbone_utils.map_gene_to_backbone spateo.tdr.models.models_backbone.backbone_utils._euclidean_distance spateo.tdr.models.models_backbone.backbone_utils.sort_nodes_of_curve Module Contents --------------- .. py:function:: map_points_to_backbone(model: Union[pyvista.PolyData, pyvista.UnstructuredGrid], backbone_model: pyvista.PolyData, nodes_key: str = 'nodes', key_added: Optional[str] = 'nodes', inplace: bool = False, **kwargs) Find the closest principal tree node to any point in the model through KDTree. :param model: The reconstructed model. :param backbone_model: The constructed backbone model. :param nodes_key: The key that corresponds to the coordinates of the nodes in the backbone. :param key_added: The key under which to add the nodes labels. :param inplace: Updates model in-place. :param \*\*kwargs: Additional parameters that will be passed to ``scipy.spatial.KDTree.`` function. :returns: `model.point_data[key_added]`, the nodes labels array. :rtype: A model, which contains the following properties .. py:function:: map_gene_to_backbone(model: Union[pyvista.PolyData, pyvista.UnstructuredGrid], tree: pyvista.PolyData, key: Union[str, list], nodes_key: Optional[str] = 'nodes', inplace: bool = False) Find the closest principal tree node to any point in the model through KDTree. :param model: A reconstructed model contains the gene expression label. :param tree: A three-dims principal tree model contains the nodes label. :param key: The key that corresponds to the gene expression. :param nodes_key: The key that corresponds to the coordinates of the nodes in the tree. :param inplace: Updates tree model in-place. :returns: `tree.point_data[key]`, the gene expression array. :rtype: A tree, which contains the following properties .. py:function:: _euclidean_distance(N1, N2) .. py:function:: sort_nodes_of_curve(nodes, started_node)