ImageDataFilters.extract_subset#
- ImageDataFilters.extract_subset(
- voi: VectorLikeInt,
- rate: VectorLikeInt = (1, 1, 1),
- *,
- boundary: bool = False,
- rebase_coordinates: bool = True,
- progress_bar: bool = False,
Select piece (for example, volume of interest).
To use this filter set the VOI
ivarwhich are i-j-k min/max indices that specify a rectangular region in the data. (Note that these are 0-offset.) You can also specify a sampling rate to subsample the data.Typical applications of this filter are to extract a slice from a volume for image processing, subsampling large volumes to reduce data size, or extracting regions of a volume with interesting data.
- Parameters:
- voi
VectorLikeInt Length 6 iterable of
ints:(x_min, x_max, y_min, y_max, z_min, z_max). These bounds specify the volume of interest in i-j-k min/max indices. Must be within this mesh’sextent.- rate
VectorLikeInt, default: (1, 1, 1) Length 3 iterable of
ints:(xrate, yrate, zrate).- boundarybool, default:
False Control whether to enforce that the “boundary” of the grid is output in the subsampling process. This only has effect when the rate in any direction is not equal to 1. When this is enabled, the subsampling will always include the boundary of the grid even though the sample rate is not an even multiple of the grid dimensions. By default this is disabled.
- rebase_coordinatesbool, default:
True If
True(default), reset the coordinate reference of the extracted subset:The rebasing effectively applies a positive translation in world (XYZ) coordinates and a similar (that is, inverse) negative translation in voxel (IJK) coordinates. As a result, the
boundsof the output are unchanged, but the coordinate reference frame is modified.Set this to
Falseto leave the origin unmodified and keep the offset specified by thevoiparameter.Added in version 0.46.
- progress_barbool, default:
False Display a progress bar to indicate progress.
- voi
- Returns:
pyvista.ImageDataImageData subset.
See Also#
Used In#
API Examples
DataSetFilters.color_labels(1 use)ImageDataFilters.contour_labels(1 use)
Gallery Examples