Introduction
vtkImageMapper provides 2D image display support for vtk.
It can be associated with a vtkImageSlice prop and placed within a Renderer.
This class resolves coincident topology with the same methods as vtkMapper.
Methods
extend
Method use to decorate a given object (publicAPI+model) with vtkAbstractImageMapper 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 |
IAbstractImageMapperInitialValues | No | (default: {}) |
getBackgroundColor
Return the currently set background color.
getBackgroundColorByReference
Return the currently set background color.
getBoundsForSlice
Get bounds for a specified slice.
To be implemented by derived classes.
Argument | Type | Required | Description |
---|---|---|---|
slice |
Number | Yes | The slice index. If undefined, the current slice is considered. |
thickness |
Number | Yes | The slice thickness. If undefined, 0 is considered. |
getColorTextureWidth
Get the color texture width.
getCurrentImage
Return currently active image for the mapper. Overridden by deriving classes.
getCustomDisplayExtent
getCustomDisplayExtentByReference
getIsOpaque
getLabelOutlineTextureWidth
Get the label outline texture width.
getOpacityTextureWidth
Get the opacity texture width.
getSlice
Get the slice index.
getUseCustomExtents
setBackgroundColor
Argument | Type | Required | Description |
---|---|---|---|
color |
Yes | specify background color as an array of 4 values. |
setBackgroundColor
Argument | Type | Required | Description |
---|---|---|---|
r |
Yes | red component of background color | |
g |
Yes | green component of background color | |
b |
Yes | blue component of background color | |
a |
Yes | opacity component of background color |
setBackgroundColorFrom
Argument | Type | Required | Description |
---|---|---|---|
color |
RGBAColor | Yes | specify the background color to use in RGBA format as an array of 4 values. Values are copied. |
setColorTextureWidth
Set the color texture width.
The default width (1024) should be fine in most instances.
Only set this property if your color transfer function range width is
larger than 1024.
A reasonable max texture size would be either 2048 or 4096, as those
widths are supported by the vast majority of devices. Any width larger
than that will have issues with device support.
Specifying a width that is less than or equal to 0 will use the largest
possible texture width on the device. Use this with caution! The max texture
width of one device may not be the same for another device.
You can find more information about supported texture widths at the following link:
https://web3dsurvey.com/webgl/parameters/MAX_TEXTURE_SIZE
Argument | Type | Required | Description |
---|---|---|---|
width |
Number | Yes | the texture width (defaults to 1024) |
setCustomDisplayExtent
Argument | Type | Required | Description |
---|---|---|---|
extents |
Yes | specify extents as an array of 6 values [minx, maxx, …] |
setCustomDisplayExtent
Argument | Type | Required | Description |
---|---|---|---|
x1 |
Number | Yes | The x coordinate of the first point. |
x2 |
Number | Yes | The x coordinate of the second point. |
y1 |
Number | Yes | The y coordinate of the first point. |
y2 |
Number | Yes | The y coordinate of the second point. |
z1 |
Number | Yes | The z coordinate of the first point. |
z2 |
Number | Yes | The z coordinate of the second point. |
setCustomDisplayExtentFrom
Argument | Type | Required | Description |
---|---|---|---|
customDisplayExtent |
Yes |
setLabelOutlineTextureWidth
Set the label outline texture width.
The default width (1024) should be fine in most instances.
Only set this property if you have more than 1024 labels
that you want to render with thickness.
A reasonable max texture size would be either 2048 or 4096, as those
widths are supported by the vast majority of devices. Any width larger
than that will have issues with device support.
Specifying a width that is less than or equal to 0 will use the largest
possible texture width on the device. Use this with caution! The max texture
width of one device may not be the same for another device.
You can find more information about supported texture widths at the following link:
https://web3dsurvey.com/webgl/parameters/MAX_TEXTURE_SIZE
Argument | Type | Required | Description |
---|---|---|---|
width |
Number | Yes | the texture width (defaults to 1024) |
setOpacityTextureWidth
Set the opacity texture width.
The default width (1024) should be fine in most instances.
Only set this property if your opacity function range width is
larger than 1024.
A reasonable max texture size would be either 2048 or 4096, as those
widths are supported by the vast majority of devices. Any width larger
than that will have issues with device support.
Specifying a width that is less than or equal to 0 will use the largest
possible texture width on the device. Use this with caution! The max texture
width of one device may not be the same for another device.
You can find more information about supported texture widths at the following link:
https://web3dsurvey.com/webgl/parameters/MAX_TEXTURE_SIZE
Argument | Type | Required | Description |
---|---|---|---|
width |
Number | Yes | the texture width (defaults to 1024) |
setSlice
Argument | Type | Required | Description |
---|---|---|---|
slice |
Number | Yes | The slice index. |
setUseCustomExtents
Argument | Type | Required | Description |
---|---|---|---|
useCustomExtents |
Boolean | Yes |
Source
import { vec3 } from 'gl-matrix'; |
import vtkAbstractMapper3D, { |
import macro from 'vtk.js/Sources/macros'; |