Skip to content

ImageGridSource ​

Introduction ​

vtkImageGridSource produces an image of a grid. The voxels that fall on a grid line get the line value, all the others get the fill value. The grid line period and offset are expressed in voxels through the grid spacing and the grid origin, while the geometry of the produced image is controlled by the data extent, origin, spacing and direction.

Usage ​

js
import vtkImageGridSource from '@kitware/vtk.js/Filters/Sources/ImageGridSource';

const grid = vtkImageGridSource.newInstance({ gridSpacing: [20, 20, 0] });
const imageData = grid.getOutputData();

Methods ​

extend ​

Method used to decorate a given object (publicAPI+model) with vtkImageGridSource characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIImageGridSourceInitialValuesNo(default: {})

getDataDirection ​

Get the direction matrix of the output image.

getDataDirectionByReference ​

Get the direction matrix of the output image.

getDataExtent ​

Get the extent of the output image.

getDataExtentByReference ​

Get the extent of the output image.

getDataOrigin ​

Get the origin of the output image.

getDataOriginByReference ​

Get the origin of the output image.

getDataSpacing ​

Get the spacing of the output image.

getDataSpacingByReference ​

Get the spacing of the output image.

getFillValue ​

Get the value used for the voxels that are not on a grid line.

getGridOrigin ​

Get the grid origin, expressed in voxel index.

getGridOriginByReference ​

Get the grid origin, expressed in voxel index.

getGridSpacing ​

Get the grid line period along each axis, expressed in voxels. A period of 0 disables the grid lines for that axis.

getGridSpacingByReference ​

Get the grid line period along each axis, expressed in voxels.

getLineValue ​

Get the value used for the voxels that are on a grid line.

newInstance ​

Method used to create a new instance of vtkImageGridSource.

ArgumentTypeRequiredDescription
initialValuesIImageGridSourceInitialValuesNofor pre-setting some of its content

requestData ​

Expose methods

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setDataDirection ​

Set the direction matrix of the output image.

ArgumentTypeRequiredDescription
e00NumberYes
e01NumberYes
e02NumberYes
e10NumberYes
e11NumberYes
e12NumberYes
e20NumberYes
e21NumberYes
e22NumberYes

setDataDirection ​

Set the direction matrix of the output image.

ArgumentTypeRequiredDescription
dataDirectionMatrix3x3Yes

setDataDirectionFrom ​

Set the direction matrix of the output image.

ArgumentTypeRequiredDescription
dataDirectionMatrix3x3Yes

setDataExtent ​

Set the extent of the output image.

ArgumentTypeRequiredDescription
x1NumberYes
x2NumberYes
y1NumberYes
y2NumberYes
z1NumberYes
z2NumberYes

setDataExtent ​

Set the extent of the output image.

ArgumentTypeRequiredDescription
dataExtentExtentYes

setDataExtentFrom ​

Set the extent of the output image.

ArgumentTypeRequiredDescription
dataExtentExtentYes

setDataOrigin ​

Set the origin of the output image.

ArgumentTypeRequiredDescription
dataOriginVector3Yes

setDataOrigin ​

Set the origin of the output image.

ArgumentTypeRequiredDescription
xNumberYesThe x coordinate.
yNumberYesThe y coordinate.
zNumberYesThe z coordinate.

setDataOriginFrom ​

Set the origin of the output image.

ArgumentTypeRequiredDescription
dataOriginVector3Yes

setDataSpacing ​

Set the spacing of the output image.

ArgumentTypeRequiredDescription
dataSpacingVector3Yes

setDataSpacing ​

Set the spacing of the output image.

ArgumentTypeRequiredDescription
xNumberYesThe x spacing.
yNumberYesThe y spacing.
zNumberYesThe z spacing.

setDataSpacingFrom ​

Set the spacing of the output image.

ArgumentTypeRequiredDescription
dataSpacingVector3Yes

setFillValue ​

Set the value used for the voxels that are not on a grid line.

ArgumentTypeRequiredDescription
fillValueNumberYes

setGridOrigin ​

Set the grid origin, expressed in voxel index.

ArgumentTypeRequiredDescription
gridOriginVector3Yes

setGridOrigin ​

Set the grid origin, expressed in voxel index.

ArgumentTypeRequiredDescription
xNumberYesThe x coordinate.
yNumberYesThe y coordinate.
zNumberYesThe z coordinate.

setGridOriginFrom ​

Set the grid origin, expressed in voxel index.

ArgumentTypeRequiredDescription
gridOriginVector3Yes

setGridSpacing ​

Set the grid line period along each axis, expressed in voxels.

ArgumentTypeRequiredDescription
gridSpacingVector3Yes

setGridSpacing ​

Set the grid line period along each axis, expressed in voxels. A period of 0 disables the grid lines for that axis.

ArgumentTypeRequiredDescription
xNumberYesThe x period.
yNumberYesThe y period.
zNumberYesThe z period.

setGridSpacingFrom ​

Set the grid line period along each axis, expressed in voxels.

ArgumentTypeRequiredDescription
gridSpacingVector3Yes

setLineValue ​

Set the value used for the voxels that are on a grid line.

ArgumentTypeRequiredDescription
lineValueNumberYes