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
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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IImageGridSourceInitialValues | No | (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.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IImageGridSourceInitialValues | No | for pre-setting some of its content |
requestData
Expose methods
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setDataDirection
Set the direction matrix of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
e00 | Number | Yes | |
e01 | Number | Yes | |
e02 | Number | Yes | |
e10 | Number | Yes | |
e11 | Number | Yes | |
e12 | Number | Yes | |
e20 | Number | Yes | |
e21 | Number | Yes | |
e22 | Number | Yes |
setDataDirection
Set the direction matrix of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
dataDirection | Matrix3x3 | Yes |
setDataDirectionFrom
Set the direction matrix of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
dataDirection | Matrix3x3 | Yes |
setDataExtent
Set the extent of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
x1 | Number | Yes | |
x2 | Number | Yes | |
y1 | Number | Yes | |
y2 | Number | Yes | |
z1 | Number | Yes | |
z2 | Number | Yes |
setDataExtent
Set the extent of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
dataExtent | Extent | Yes |
setDataExtentFrom
Set the extent of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
dataExtent | Extent | Yes |
setDataOrigin
Set the origin of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
dataOrigin | Vector3 | Yes |
setDataOrigin
Set the origin of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setDataOriginFrom
Set the origin of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
dataOrigin | Vector3 | Yes |
setDataSpacing
Set the spacing of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
dataSpacing | Vector3 | Yes |
setDataSpacing
Set the spacing of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x spacing. |
y | Number | Yes | The y spacing. |
z | Number | Yes | The z spacing. |
setDataSpacingFrom
Set the spacing of the output image.
| Argument | Type | Required | Description |
|---|---|---|---|
dataSpacing | Vector3 | Yes |
setFillValue
Set the value used for the voxels that are not on a grid line.
| Argument | Type | Required | Description |
|---|---|---|---|
fillValue | Number | Yes |
setGridOrigin
Set the grid origin, expressed in voxel index.
| Argument | Type | Required | Description |
|---|---|---|---|
gridOrigin | Vector3 | Yes |
setGridOrigin
Set the grid origin, expressed in voxel index.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setGridOriginFrom
Set the grid origin, expressed in voxel index.
| Argument | Type | Required | Description |
|---|---|---|---|
gridOrigin | Vector3 | Yes |
setGridSpacing
Set the grid line period along each axis, expressed in voxels.
| Argument | Type | Required | Description |
|---|---|---|---|
gridSpacing | Vector3 | Yes |
setGridSpacing
Set the grid line period along each axis, expressed in voxels. A period of 0 disables the grid lines for that axis.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x period. |
y | Number | Yes | The y period. |
z | Number | Yes | The z period. |
setGridSpacingFrom
Set the grid line period along each axis, expressed in voxels.
| Argument | Type | Required | Description |
|---|---|---|---|
gridSpacing | Vector3 | Yes |
setLineValue
Set the value used for the voxels that are on a grid line.
| Argument | Type | Required | Description |
|---|---|---|---|
lineValue | Number | Yes |