DataSetFilters.gaussian_splatting

DataSetFilters.gaussian_splatting#

DataSetFilters.gaussian_splatting(
*,
radius: float = 0.1,
dimensions: VectorLikeInt = (50, 50, 50),
progress_bar: bool = False,
) → ImageData[source]#

Splat points into a volume using a Gaussian distribution.

This filter uses vtkGaussianSplatter to splat points into a volume dataset. Each point is surrounded with a Gaussian distribution function weighted by input scalar data. The distribution function is volumetrically sampled to create a structured dataset.

Added in version 0.46.

Parameters:
radiusfloat, default: 0.1

This value is expressed as a percentage of the length of the longest side of the sampling volume. This determines the “width” of the splatter in terms of the distribution. Smaller numbers greatly reduce execution time.

dimensionsVectorLikeInt, default: (50, 50, 50)

Sampling dimensions of the structured point set. Higher values produce better results but are much slower. This is the dimensions of the returned ImageData.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.ImageData

Image data with scalar values representing the splatting of the points.

Examples#

Download Python source code | Download Jupyter notebook

Create an image data volume from a point cloud using Gaussian splatter.

>>> import pyvista as pv

Load the Stanford Bunny mesh.

Apply Gaussian splatter to generate a volumetric representation.

>>> volume = bunny.gaussian_splatting(radius=0.01)

Threshold the volume to filter out low-density regions.

Visualize the thresholded volume with semi-transparency and no scalar bar.

>>> threshed.plot(opacity=0.5, show_scalar_bar=False)
../../../_images/pyvista-DataSetFilters-gaussian_splatting-5462f87dc7c99f2c_00_00.png

See Also#

voxelize_binary_mask

Alternative method for generating ImageData from a dataset.