spateo.tdr.models.models_individual.voxel ========================================= .. py:module:: spateo.tdr.models.models_individual.voxel Functions --------- .. autoapisummary:: spateo.tdr.models.models_individual.voxel.voxelize_pc spateo.tdr.models.models_individual.voxel.voxelize_mesh Module Contents --------------- .. py:function:: voxelize_pc(pc: pyvista.PolyData, voxel_size: Optional[numpy.ndarray] = None) -> pyvista.UnstructuredGrid Voxelize the point cloud. :param pc: A point cloud model. :param voxel_size: The size of the voxelized points. The shape of voxel_size is (pc.n_points, 3). :returns: A voxel model. :rtype: voxel .. py:function:: voxelize_mesh(mesh: Union[pyvista.PolyData, pyvista.UnstructuredGrid], voxel_pc: Union[pyvista.PolyData, pyvista.UnstructuredGrid] = None, key_added: str = 'groups', label: str = 'voxel', color: Optional[str] = 'gainsboro', alpha: Union[float, int] = 1.0, smooth: Optional[int] = 200) -> Tuple[Union[pyvista.UnstructuredGrid, Any], Optional[str]] Construct a volumetric mesh based on surface mesh. :param mesh: A surface mesh model. :param voxel_pc: A voxel model which contains the ``voxel_pc.cell_data['obs_index']`` and ``voxel_pc.cell_data[key_added]``. :param key_added: The key under which to add the labels. :param label: The label of reconstructed voxel model. :param color: Color to use for plotting mesh. The default color is ``'gainsboro'``. :param alpha: The opacity of the color to use for plotting model. The default alpha is ``0.8``. :param smooth: The smoothness of the voxel model. :returns: A reconstructed voxel model, which contains the following properties: `voxel_model.cell_data[key_added]`, the `label` array; `voxel_model.cell_data[f'{key_added}_rgba']`, the rgba colors of the `label` array. `voxel_model.cell_data['obs_index']`, the cell labels if not (voxel_pc is None). plot_cmap: Recommended colormap parameter values for plotting. :rtype: voxel_model