ImageDataFilters.gaussian_smooth#
- ImageDataFilters.gaussian_smooth(
- *,
- radius_factor: float | VectorLikeFloat = 1.5,
- std_dev: float | VectorLikeFloat = 2.0,
- scalars: str | None = None,
- progress_bar: bool = False,
Smooth the data with a Gaussian kernel.
- Parameters:
- radius_factor
float|VectorLikeFloat, default: 1.5 Unitless factor to limit the extent of the kernel.
- std_dev
float|VectorLikeFloat, default: 2.0 Standard deviation of the kernel in pixel units.
- scalars
str, optional Name of scalars to process. Defaults to currently active scalars.
- progress_barbool, default:
False Display a progress bar to indicate progress.
- radius_factor
- Returns:
pyvista.ImageDataUniform grid with smoothed scalars.
Notes#
This filter only supports point data. For inputs with cell data, consider
re-meshing the cell data as point data with
cells_to_points()
or resampling the cell data to point data with
cell_data_to_point_data().
Examples#
Download Python source code | Download Jupyter notebook
First, create sample data to smooth. Here, we use
pyvista.perlin_noise()
to create meaningful data.
>>> import numpy as np
>>> import pyvista as pv
>>> noise = pv.perlin_noise(0.1, (2, 5, 8), (0, 0, 0))
>>> grid = pv.sample_function(
... noise, bounds=[0, 1, 0, 1, 0, 1], dim=(20, 20, 20)
... )
>>> grid.plot(show_scalar_bar=False)
Next, smooth the sample data.
>>> smoothed = grid.gaussian_smooth()
>>> smoothed.plot(show_scalar_bar=False)
Used In#
Gallery Examples