spateo.tdr.widgets.vtk_interpolate#

Module Contents#

Functions#

interpolate_model(model, source[, source_key, radius, ...])

Interpolate over source to port its data onto the current object using various kernels.

spateo.tdr.widgets.vtk_interpolate.interpolate_model(model, source, source_key: Union[str, list] = None, radius: Optional[float] = None, N: Optional[int] = None, kernel: Literal[shepard, gaussian, linear] = 'shepard', where: Literal[point_data, cell_data] = 'cell_data', nullStrategy: Literal[0, 1, 2] = 1, nullValue: Union[int, float] = 0)[source]#

Interpolate over source to port its data onto the current object using various kernels.

Parameters
model

Model that require interpolation.

source

A data source that provides coordinates and data. Usually a point cloud object.

source_key

Which data to migrate to the model object. If source_key is None, migrate all to the model object.

radius

Set the radius of the point cloud. If you are generating a Gaussian distribution, then this is the standard deviation for each of x, y, and z.

N

Specify the number of points for the source object to hold. If N (number of the closest points to use) is set then radius value is ignored.

kernel

The kernel of interpolation kernel. Available kernels are: * shepard: vtkShepardKernel is an interpolation kernel that uses the method of Shepard to perform

interpolation. The weights are computed as 1/r^p, where r is the distance to a neighbor point within the kernel radius R; and p (the power parameter) is a positive exponent (typically p=2).

  • gaussian: vtkGaussianKernel is an interpolation kernel that simply returns the weights for all

    points found in the sphere defined by radius R. The weights are computed as: exp(-(s*r/R)^2) where r is the distance from the point to be interpolated to a neighboring point within R. The sharpness s simply affects the rate of fall off of the Gaussian.

  • linear: vtkLinearKernel is an interpolation kernel that averages the contributions of all points in

    the basis.

where

The location where the data is stored in the model.

nullStrategy

Specify a strategy to use when encountering a “null” point during the interpolation process.

Null points occur when the local neighborhood(of nearby points to interpolate from) is empty.

  • Case 0: an output array is created that marks points as being valid (=1) or null (invalid =0), and

    the nullValue is set as well

  • Case 1: the output data value(s) are set to the provided nullValue

  • Case 2: simply use the closest point to perform the interpolation.

nullValue

see above.

Returns

Interpolated model.

Return type

interpolated_model