spateo.tdr.models.utilities.label_utils ======================================= .. py:module:: spateo.tdr.models.utilities.label_utils Functions --------- .. autoapisummary:: spateo.tdr.models.utilities.label_utils.add_model_labels Module Contents --------------- .. py:function:: add_model_labels(model: Union[pyvista.PolyData, pyvista.UnstructuredGrid], labels: numpy.ndarray, key_added: str = 'groups', where: Literal['point_data', 'cell_data'] = 'cell_data', colormap: Union[str, list, dict, numpy.ndarray] = 'rainbow', alphamap: Union[float, list, dict, numpy.ndarray] = 1.0, mask_color: Optional[str] = 'gainsboro', mask_alpha: Optional[float] = 0.0, inplace: bool = False) -> Tuple[Optional[PolyData or UnstructuredGrid], Optional[Union[str]]] Add rgba color to each point of model based on labels. :param model: A reconstructed model. :param labels: An array of labels of interest. :param key_added: The key under which to add the labels. :param where: The location where the label information is recorded in the model. :param colormap: Colors to use for plotting data. :param alphamap: The opacity of the color to use for plotting data. :param mask_color: Color to use for plotting mask information. :param mask_alpha: The opacity of the color to use for plotting mask information. :param inplace: Updates model in-place. :returns: ``model.cell_data[key_added]`` or ``model.point_data[key_added]``, the labels array; ``model.cell_data[f'{key_added}_rgba']`` or ``model.point_data[f'{key_added}_rgba']``, the rgba colors of the labels. plot_cmap: Recommended colormap parameter values for plotting. :rtype: A model, which contains the following properties