pyvista.ImageGridSource

Contents

pyvista.ImageGridSource#

class ImageGridSource(origin=None, extent=None, spacing=None)[source]#

Create an image of a grid.

Added in version 0.44.0.

Parameters:
originsequence[float]

The origin of the grid.

extentsequence[int]

The extent of the whole output image, Default: (0,255,0,255,0,0).

spacingtuple

The pixel spacing.

Examples

Create an image of a grid.

>>> import pyvista as pv
>>> source = pv.ImageGridSource(
...     extent=(0, 20, 0, 20, 0, 0),
...     spacing=(1, 1, 1),
... )
>>> source.output.plot(cpos='xy')
../../../_images/pyvista-ImageGridSource-1_00_00.png

Methods

Attributes

ImageGridSource.extent

Get extent of the whole output image.

ImageGridSource.origin

Get the origin of the data.

ImageGridSource.output

Get the output image as a ImageData.

ImageGridSource.spacing

Get the spacing of the grid.