Voxelize
This module provides a complicated algorithm for making voxels out of regularly gridded points. Considering that this algorithm is rather complex, we are keeping it in its own module until we can simplify it, clean up the code, and make it capable of handling non-uniformly gridded points
Voxelize Points
- class PVGeo.filters.voxelize.VoxelizePoints(**kwargs)[source]
Bases:
FilterBase
This makes a
vtkUnstructuredGrid
of scattered points given voxel sizes as input arrays. This assumes that the data is at least 2-Dimensional on the XY Plane.- static _copy_arrays(pdi, pdo)[source]
internal helper to copy arrays from point data to cell data in the voxels.
- static add_cell_data(grid, arr, name)[source]
Add a NumPy array as cell data to the given grid input
- estimate_uniform_spacing(x, y, z)[source]
This assumes that the input points make up some sort of uniformly spaced grid on at least an XY plane.
- get_angle(degrees=True)[source]
Returns the recovered angle if set to recover the input grid. If the input points are rotated, then this angle will reflect a close approximation of that rotation.
- Parameters:
degrees (bool) – A flag on to return decimal degrees or radians.
- points_to_grid(xo, yo, zo, dx, dy, dz, grid=None)[source]
Convert XYZ points to a
vtkUnstructuredGrid
.
- set_delta_x(dx)[source]
Set the X cells spacing
- Parameters:
dx (float or np.array(floats)) – the spacing(s) for the cells in the X-direction
- set_delta_y(dy)[source]
Set the Y cells spacing
- Parameters:
dy (float or np.array(floats)) – the spacing(s) for the cells in the Y-direction
- set_delta_z(dz)[source]
Set the Z cells spacing
- Parameters:
dz (float or np.array(floats)) – the spacing(s) for the cells in the Z-direction
- set_deltas(dx, dy, dz)[source]
Set the cell spacings for each axial direction
- Parameters:
dx (float or np.array(floats)) – the spacing(s) for the cells in the X-direction
dy (float or np.array(floats)) – the spacing(s) for the cells in the Y-direction
dz (float or np.array(floats)) – the spacing(s) for the cells in the Z-direction