Skip to content

AbstractImageMapper

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.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIAbstractImageMapperInitialValuesNo(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.

ArgumentTypeRequiredDescription
sliceNumberYesThe slice index. If undefined, the current slice is considered.
thicknessNumberYesThe 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

ArgumentTypeRequiredDescription
colorYesspecify background color as an array of 4 values.

setBackgroundColor

ArgumentTypeRequiredDescription
rYesred component of background color
gYesgreen component of background color
bYesblue component of background color
aYesopacity component of background color

setBackgroundColorFrom

ArgumentTypeRequiredDescription
colorRGBAColorYesspecify 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

ArgumentTypeRequiredDescription
widthNumberYesthe texture width (defaults to 1024)

setCustomDisplayExtent

ArgumentTypeRequiredDescription
extentsYesspecify extents as an array of 6 values [minx, maxx, ...]

setCustomDisplayExtent

ArgumentTypeRequiredDescription
x1NumberYesThe x coordinate of the first point.
x2NumberYesThe x coordinate of the second point.
y1NumberYesThe y coordinate of the first point.
y2NumberYesThe y coordinate of the second point.
z1NumberYesThe z coordinate of the first point.
z2NumberYesThe z coordinate of the second point.

setCustomDisplayExtentFrom

ArgumentTypeRequiredDescription
customDisplayExtentYes

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

ArgumentTypeRequiredDescription
widthNumberYesthe 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

ArgumentTypeRequiredDescription
widthNumberYesthe texture width (defaults to 1024)

setSlice

ArgumentTypeRequiredDescription
sliceNumberYesThe slice index.

setUseCustomExtents

ArgumentTypeRequiredDescription
useCustomExtentsBooleanYes