DataSetFilters.gaussian_splatting#
- DataSetFilters.gaussian_splatting(
- *,
- radius: float = 0.1,
- dimensions: VectorLikeInt = (50, 50, 50),
- progress_bar: bool = False,
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:
- radius
float, 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.
- dimensions
VectorLikeInt, default: (50, 50, 50) Sampling dimensions of the structured point set. Higher values produce better results but are much slower. This is the
dimensionsof the returnedImageData.- progress_barbool, default:
False Display a progress bar to indicate progress.
- radius
- Returns:
pyvista.ImageDataImage 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.
>>> bunny = pv.examples.download_bunny()
Apply Gaussian splatter to generate a volumetric representation.
>>> volume = bunny.gaussian_splatting(radius=0.01)
Threshold the volume to filter out low-density regions.
>>> threshed = volume.threshold(0.05)
Visualize the thresholded volume with semi-transparency and no scalar bar.
>>> threshed.plot(opacity=0.5, show_scalar_bar=False)
See Also#
voxelize_binary_maskAlternative method for generating
ImageDatafrom a dataset.