Modules.ProbabilisticMarchingTetrahedra package
Submodules
Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra module
- Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra.probabilistic_marching_tetrahedra(ensemble_data, tetrahedral_mesh, points, isovalue, plotter=None, opacity='linear', colormap='viridis')[source]
Compute and visualize probabilistic marching tetrahedra.
This function implements the complete stats->mesh->vis pipeline for probabilistic marching tetrahedra visualization. It calculates the probability of isosurface presence in each tetrahedron and creates a PyVista volume rendering visualization.
Parameters:
- ensemble_datanp.ndarray
2D array of shape (n_points, n_ensemble) where each column is a realization and each row corresponds to a vertex in the tetrahedral mesh.
- tetrahedral_meshnp.ndarray
2D array of shape (n_tetrahedra, 4) representing the tetrahedralization of the points.
- pointsnp.ndarray
2D array of shape (n_points, 3) with point coordinates.
- isovaluefloat
The isovalue for which to compute the isosurface.
- plotterpyvista.Plotter, optional
An existing PyVista plotter to add the volume rendering to. If None, a new plotter is created.
- opacitystr or list, optional
Opacity mapping for the volume rendering. Default is ‘linear’.
- colormapstr, optional
Colormap for the volume rendering. Default is ‘viridis’.
Returns:
- plotterpyvista.Plotter
The pyvista plotter with the visualized probabilistic isosurface.
Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra_stats module
- Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra_stats.probabilistic_marching_tetrahedra_summary_statistics(ensemble_data, tetrahedral_mesh, isovalue)[source]
Compute level crossing probability for probabilistic marching tetrahedra.
This function calculates the probability of an isosurface crossing through each tetrahedron in a 3D tetrahedral mesh based on an ensemble of scalar fields.
Parameters:
- ensemble_datanp.ndarray
2D array of shape (n_points, n_ensemble) where each column is a realization and each row corresponds to a vertex in the tetrahedral mesh.
- tetrahedral_meshnp.ndarray
2D array of shape (n_tetrahedra, 4) representing the tetrahedra. Each row contains the indices of the four vertices forming a tetrahedron.
- isovaluefloat
The isovalue for which to compute the isosurface crossing probability.
Returns:
- dict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
1D array of shape (n_tetrahedra,) with probabilities of isosurface presence in each tetrahedron. Values range from 0 to 1.
Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra_vis module
- Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra_vis.visualize_probabilistic_marching_tetrahedra(mesh_data, points, tetrahedral_mesh, plotter=None, opacity='linear', colormap='viridis')[source]
Visualize probabilistic marching tetrahedra using PyVista volume rendering.
This function creates a 3D visualization of the crossing probabilities using PyVista’s volume rendering capabilities for tetrahedral meshes.
Parameters:
- mesh_datanp.ndarray
1D array of shape (n_tetrahedra,) with probabilities of isosurface presence in each tetrahedron.
- pointsnp.ndarray
2D array of shape (n_points, 3) representing the coordinates of the points.
- tetrahedral_meshnp.ndarray
2D array of shape (n_tetrahedra, 4) representing the tetrahedralization of the points.
- plotterpyvista.Plotter, optional
An existing PyVista plotter to add the volume rendering to. If None, a new plotter is created.
- opacitystr or list, optional
Opacity mapping for the volume rendering. Default is ‘linear’.
- colormapstr, optional
Colormap for the volume rendering. Default is ‘viridis’.
Returns:
- plotterpyvista.Plotter
The pyvista plotter with the visualized probabilistic isosurface.
Module contents
ProbabilisticMarchingTetrahedra Module
This module provides functionality for performing probabilistic marching tetrahedra on 3D tetrahedral meshes with uncertainty. It includes methods for calculating tetrahedron crossing probabilities and visualizing the results using PyVista.
- Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra(ensemble_data, tetrahedral_mesh, points, isovalue, plotter=None, opacity='linear', colormap='viridis')[source]
Compute and visualize probabilistic marching tetrahedra.
This function implements the complete stats->mesh->vis pipeline for probabilistic marching tetrahedra visualization. It calculates the probability of isosurface presence in each tetrahedron and creates a PyVista volume rendering visualization.
Parameters:
- ensemble_datanp.ndarray
2D array of shape (n_points, n_ensemble) where each column is a realization and each row corresponds to a vertex in the tetrahedral mesh.
- tetrahedral_meshnp.ndarray
2D array of shape (n_tetrahedra, 4) representing the tetrahedralization of the points.
- pointsnp.ndarray
2D array of shape (n_points, 3) with point coordinates.
- isovaluefloat
The isovalue for which to compute the isosurface.
- plotterpyvista.Plotter, optional
An existing PyVista plotter to add the volume rendering to. If None, a new plotter is created.
- opacitystr or list, optional
Opacity mapping for the volume rendering. Default is ‘linear’.
- colormapstr, optional
Colormap for the volume rendering. Default is ‘viridis’.
Returns:
- plotterpyvista.Plotter
The pyvista plotter with the visualized probabilistic isosurface.
- Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra_mesh(summary_statistics)[source]
Identity function that passes through summary statistics.
This function exists to maintain consistency with the stats->mesh->vis pipeline architecture used in other modules, even though no mesh transformation is needed for probabilistic marching tetrahedra.
Parameters:
- summary_statisticsdict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
1D array of shape (n_tetrahedra,) representing the probability of isosurface presence in each tetrahedron.
Returns:
- level_crossing_probabilitynp.ndarray
1D array of probabilities extracted from the input dictionary.
- Modules.ProbabilisticMarchingTetrahedra.probabilistic_marching_tetrahedra_summary_statistics(ensemble_data, tetrahedral_mesh, isovalue)[source]
Compute level crossing probability for probabilistic marching tetrahedra.
This function calculates the probability of an isosurface crossing through each tetrahedron in a 3D tetrahedral mesh based on an ensemble of scalar fields.
Parameters:
- ensemble_datanp.ndarray
2D array of shape (n_points, n_ensemble) where each column is a realization and each row corresponds to a vertex in the tetrahedral mesh.
- tetrahedral_meshnp.ndarray
2D array of shape (n_tetrahedra, 4) representing the tetrahedra. Each row contains the indices of the four vertices forming a tetrahedron.
- isovaluefloat
The isovalue for which to compute the isosurface crossing probability.
Returns:
- dict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
1D array of shape (n_tetrahedra,) with probabilities of isosurface presence in each tetrahedron. Values range from 0 to 1.
- Modules.ProbabilisticMarchingTetrahedra.visualize_probabilistic_marching_tetrahedra(mesh_data, points, tetrahedral_mesh, plotter=None, opacity='linear', colormap='viridis')[source]
Visualize probabilistic marching tetrahedra using PyVista volume rendering.
This function creates a 3D visualization of the crossing probabilities using PyVista’s volume rendering capabilities for tetrahedral meshes.
Parameters:
- mesh_datanp.ndarray
1D array of shape (n_tetrahedra,) with probabilities of isosurface presence in each tetrahedron.
- pointsnp.ndarray
2D array of shape (n_points, 3) representing the coordinates of the points.
- tetrahedral_meshnp.ndarray
2D array of shape (n_tetrahedra, 4) representing the tetrahedralization of the points.
- plotterpyvista.Plotter, optional
An existing PyVista plotter to add the volume rendering to. If None, a new plotter is created.
- opacitystr or list, optional
Opacity mapping for the volume rendering. Default is ‘linear’.
- colormapstr, optional
Colormap for the volume rendering. Default is ‘viridis’.
Returns:
- plotterpyvista.Plotter
The pyvista plotter with the visualized probabilistic isosurface.