Skip to content

ImageArrayMapper

Introduction

vtkImageArrayMapper provides display support for a collection of single/multi-frame images. Images can have variable dimensions (width, height, depth in pixels), can be mixture of color (RGB) and grayscale images, origin point and direction cosines. 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

computeSlice

Calculate the global slice number that corresponds to the provided image and subSlice number. The global slice number corresponds to the total number of 2D image frames that a collection has.

ArgumentTypeRequiredDescription
imageIndexYesThe image number is the index of the vtkImageData object in the input collection.
subSliceYesThe subSlice number is the k-index of a slice within a vtkImageData object in the input collection.

computeTotalSlices

Calculate the total number of slices in the input collection.

extend

Method use to decorate a given object (publicAPI+model) with vtkImageArrayMapper characteristics.

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

getBounds

Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax].

getBoundsForSlice

Get the bounds for a given slice as [xmin, xmax, ymin, ymax,zmin, zmax].

ArgumentTypeRequiredDescription
sliceNumberNoThe slice index. If undefined, the current slice is considered.
halfThicknessNumberNoHalf the slice thickness in index space (unit voxel spacing). If undefined, 0 is considered.

getClosestIJKAxis

Get the closest IJK axis

getCurrentImage

Return currently active image. This depends on the currently active slice number.

getImage

Get vtkImageData corresponding to the provided (global) slice number.

ArgumentTypeRequiredDescription
sliceYes(global) slice number. If a slice number is not provided, the function uses the current slice number (i.e. the output of getSlice()).

getImageIndex

Get the vtkImageData index corresponding to the provided global slice number.

ArgumentTypeRequiredDescription
sliceYesglobal slice number. If a slice number is not provided, the function uses the current slice number (i.e. the output of getSlice()).

getSubSlice

Given a global slice number, identify the subSlice number (slice k-index within a vtkImageData).

ArgumentTypeRequiredDescription
sliceYesglobal slice number. If a slice number is not provided, the function uses the current slice number (i.e. the output of getSlice()).

getTotalSlices

Fetch the pre-calculated total number of slices in the input collection.

intersectWithLineForCellPicking

ArgumentTypeRequiredDescription
p1Array[Number]YesThe coordinates of the first point.
p2Array[Number]YesThe coordinates of the second point.

intersectWithLineForPointPicking

ArgumentTypeRequiredDescription
p1Array[Number]YesThe coordinates of the first point.
p2Array[Number]YesThe coordinates of the second point.

newInstance

Method use to create a new instance of vtkImageArrayMapper

ArgumentTypeRequiredDescription
initialValuesIImageArrayMapperInitialValuesNofor pre-setting some of its content

setInputData

ArgumentTypeRequiredDescription
inputDataYesset input as a vtkCollection of vtkImageData objects.

setSlice

ArgumentTypeRequiredDescription
sliceNumberYesThe slice index.

setSlicingMode

Set the slicing mode.

ArgumentTypeRequiredDescription
modeNumberYesThe slicing mode.