Skip to main content

Class: VolumeViewport

An object representing a VolumeViewport. VolumeViewports are used to render 3D volumes from which various orientations can be viewed. Since VolumeViewports use SharedVolumeMappers behind the scene, memory footprint of visualizations of the same volume in different orientations is very small.

For setting volumes on viewports you need to use addVolumesToViewports which will add volumes to the specified viewports.

Extends

Constructors

new VolumeViewport()

new VolumeViewport(props): VolumeViewport

Parameters

props: ViewportInput

Returns

VolumeViewport

Overrides

BaseVolumeViewport.constructor

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:47

Properties

_actors

_actors: Map<string, ActorEntry>

a Map containing the actor uid and actors

Inherited from

BaseVolumeViewport._actors

Defined in

packages/core/src/RenderingEngine/Viewport.ts:119


_suppressCameraModifiedEvents

_suppressCameraModifiedEvents: boolean = false

informs if a new actor was added before a resetCameraClippingRange phase

Inherited from

BaseVolumeViewport._suppressCameraModifiedEvents

Defined in

packages/core/src/RenderingEngine/Viewport.ts:125


calibration

protected calibration: IImageCalibration

Inherited from

BaseVolumeViewport.calibration

Defined in

packages/core/src/RenderingEngine/Viewport.ts:129


canvas

readonly canvas: HTMLCanvasElement

an internal canvas that is created on the provided HTML element

Inherited from

BaseVolumeViewport.canvas

Defined in

packages/core/src/RenderingEngine/Viewport.ts:92


customRenderViewportToCanvas()

customRenderViewportToCanvas: () => unknown

Returns

unknown

Inherited from

BaseVolumeViewport.customRenderViewportToCanvas

Defined in

packages/core/src/RenderingEngine/Viewport.ts:170


defaultOptions

readonly defaultOptions: ViewportInputOptions

Default options for the viewport which includes orientation, viewPlaneNormal and backgroundColor

Inherited from

BaseVolumeViewport.defaultOptions

Defined in

packages/core/src/RenderingEngine/Viewport.ts:121


element

readonly element: HTMLDivElement

HTML element in DOM that is used for rendering the viewport

Inherited from

BaseVolumeViewport.element

Defined in

packages/core/src/RenderingEngine/Viewport.ts:90


fitToCanvasCamera

protected fitToCanvasCamera: ICamera

The camera that is defined for resetting displayArea to ensure absolute displayArea settings

Inherited from

BaseVolumeViewport.fitToCanvasCamera

Defined in

packages/core/src/RenderingEngine/Viewport.ts:137


flipHorizontal

protected flipHorizontal: boolean = false

Inherited from

BaseVolumeViewport.flipHorizontal

Defined in

packages/core/src/RenderingEngine/Viewport.ts:102


flipVertical

protected flipVertical: boolean = false

Inherited from

BaseVolumeViewport.flipVertical

Defined in

packages/core/src/RenderingEngine/Viewport.ts:103


hasPixelSpacing

protected hasPixelSpacing: boolean = true

Inherited from

BaseVolumeViewport.hasPixelSpacing

Defined in

packages/core/src/RenderingEngine/Viewport.ts:128


id

readonly id: string

unique identifier for the viewport

Inherited from

BaseVolumeViewport.id

Defined in

packages/core/src/RenderingEngine/Viewport.ts:88


initialCamera

protected initialCamera: ICamera

The camera that is initially defined on the reset for the relative pan/zoom

Inherited from

BaseVolumeViewport.initialCamera

Defined in

packages/core/src/RenderingEngine/Viewport.ts:133


initialTransferFunctionNodes

protected initialTransferFunctionNodes: TransferFunctionNodes

Inherited from

BaseVolumeViewport.initialTransferFunctionNodes

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:78


initialViewUp

protected initialViewUp: Point3

Inherited from

BaseVolumeViewport.initialViewUp

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:86


insetImageMultiplier

protected insetImageMultiplier: number = 1.1

The amount by which the images are inset in a viewport by default.

Inherited from

BaseVolumeViewport.insetImageMultiplier

Defined in

packages/core/src/RenderingEngine/Viewport.ts:100


isDisabled

isDisabled: boolean

Inherited from

BaseVolumeViewport.isDisabled

Defined in

packages/core/src/RenderingEngine/Viewport.ts:104


options

options: ViewportInputOptions

options for the viewport which includes orientation axis, backgroundColor and displayArea

Inherited from

BaseVolumeViewport.options

Defined in

packages/core/src/RenderingEngine/Viewport.ts:123


renderingEngineId

readonly renderingEngineId: string

RenderingEngine id that the viewport belongs to

Inherited from

BaseVolumeViewport.renderingEngineId

Defined in

packages/core/src/RenderingEngine/Viewport.ts:94


resize()

resize: () => void

Returns

void

Inherited from

BaseVolumeViewport.resize

Defined in

packages/core/src/RenderingEngine/Viewport.ts:171


sHeight

sHeight: number

sHeight of viewport on the offscreen canvas

Inherited from

BaseVolumeViewport.sHeight

Defined in

packages/core/src/RenderingEngine/Viewport.ts:117


suppressEvents

readonly suppressEvents: boolean

A flag representing if viewport methods should fire events or not

Inherited from

BaseVolumeViewport.suppressEvents

Defined in

packages/core/src/RenderingEngine/Viewport.ts:127


sWidth

sWidth: number

sWidth of viewport on the offscreen canvas

Inherited from

BaseVolumeViewport.sWidth

Defined in

packages/core/src/RenderingEngine/Viewport.ts:115


sx

sx: number

sx of viewport on the offscreen canvas

Inherited from

BaseVolumeViewport.sx

Defined in

packages/core/src/RenderingEngine/Viewport.ts:111


sy

sy: number

sy of viewport on the offscreen canvas

Inherited from

BaseVolumeViewport.sy

Defined in

packages/core/src/RenderingEngine/Viewport.ts:113


type

readonly type: ViewportType

Type of viewport

Inherited from

BaseVolumeViewport.type

Defined in

packages/core/src/RenderingEngine/Viewport.ts:96


updateRenderingPipeline()

updateRenderingPipeline: () => void

Returns

void

Inherited from

BaseVolumeViewport.updateRenderingPipeline

Defined in

packages/core/src/RenderingEngine/Viewport.ts:173


useCPURendering

useCPURendering: boolean = false

Inherited from

BaseVolumeViewport.useCPURendering

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:75


viewportProperties

protected viewportProperties: VolumeViewportProperties = {}

Inherited from

BaseVolumeViewport.viewportProperties

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:87


viewportStatus

viewportStatus: ViewportStatus = ViewportStatus.NO_DATA

Record the rendering status, mostly for testing purposes, but can also be useful for knowing things like whether the viewport is initialized

Inherited from

BaseVolumeViewport.viewportStatus

Defined in

packages/core/src/RenderingEngine/Viewport.ts:108


CameraViewPresentation

readonly static CameraViewPresentation: ViewPresentationSelector

CameraViewPresentation is a view presentation selector that has all the camera related presentation selections, and would typically be used for choosing presentation information between two viewports showing the same type of orientation of a view, such as the CT, PT and fusion views in the same orientation view.

Inherited from

BaseVolumeViewport.CameraViewPresentation

Defined in

packages/core/src/RenderingEngine/Viewport.ts:69


TransferViewPresentation

readonly static TransferViewPresentation: ViewPresentationSelector

TransferViewPresentation is a view presentation selector that selects all the transfer function related attributes. It would typically be used for synchronizing different orientations of the same series, or for synchronizing two views of the same type of series such as a CT.

Inherited from

BaseVolumeViewport.TransferViewPresentation

Defined in

packages/core/src/RenderingEngine/Viewport.ts:82

Accessors

useCustomRenderingPipeline

get static useCustomRenderingPipeline(): boolean

Returns

boolean

Inherited from

BaseVolumeViewport.useCustomRenderingPipeline

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:123

Methods

_getCorners()

_getCorners(bounds): number[][]

Parameters

bounds: number[]

Returns

number[][]

Inherited from

BaseVolumeViewport._getCorners

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1835


_getEdges()

_getEdges(bounds): [number[], number[]][]

Returns a list of edges for the imageData bounds, which are the cube edges in the case of volumeViewport edges. p1: front, bottom, left p2: front, top, left p3: back, bottom, left p4: back, top, left p5: front, bottom, right p6: front, top, right p7: back, bottom, right p8: back, top, right

Parameters

bounds: number[]

Bounds of the renderer

Returns

[number[], number[]][]

Edges of the containing bounds

Inherited from

BaseVolumeViewport._getEdges

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1931


_getFocalPointForResetCamera()

_getFocalPointForResetCamera(centeredFocalPoint, previousCamera, __namedParameters): Point3

Parameters

centeredFocalPoint: Point3

previousCamera: ICamera

__namedParameters

__namedParameters.resetPan: boolean = true

__namedParameters.resetToCenter: boolean = true

Returns

Point3

Inherited from

BaseVolumeViewport._getFocalPointForResetCamera

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1848


_getOrientationVectors()

protected _getOrientationVectors(orientation): OrientationVectors

Parameters

orientation: OrientationVectors | OrientationAxis

Returns

OrientationVectors

Inherited from

BaseVolumeViewport._getOrientationVectors

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1647


_isInBounds()

_isInBounds(point, bounds): boolean

Determines whether or not the 3D point position is inside the boundaries of the 3D imageData.

Parameters

point: Point3

3D coordinate

bounds: number[]

Bounds of the image

Returns

boolean

boolean

Inherited from

BaseVolumeViewport._isInBounds

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1908


_removeActor()

_removeActor(actorUID): void

Remove the actor from the viewport

Parameters

actorUID: string

The unique identifier for the actor.

Returns

void

Inherited from

BaseVolumeViewport._removeActor

Defined in

packages/core/src/RenderingEngine/Viewport.ts:535


addActor()

addActor(actorEntry): void

Add an actor to the viewport including its id, its actor and slabThickness if defined

Parameters

actorEntry: ActorEntry

ActorEntry

  • actorEntry.uid - The unique identifier for the actor.
  • actorEntry.actor - The volume actor.
  • actorEntry.slabThickness - The slab thickness.

Returns

void

Inherited from

BaseVolumeViewport.addActor

Defined in

packages/core/src/RenderingEngine/Viewport.ts:598


addActors()

addActors(actors, options): void

Add a list of actors (actor entries) to the viewport

Parameters

actors: ActorEntry[]

An array of ActorEntry objects.

options = {}

options.resetCamera?: boolean

Returns

void

Inherited from

BaseVolumeViewport.addActors

Defined in

packages/core/src/RenderingEngine/Viewport.ts:562


addVolumes()

addVolumes(volumeInputArray, immediate, suppressEvents): Promise<void>

Creates and adds volume actors for all volumes defined in the volumeInputArray. For each entry, if a callback is supplied, it will be called with the new volume actor as input.

Parameters

volumeInputArray: IVolumeInput[]

The array of VolumeInputs which define the volumes to add.

immediate: boolean = false

Whether the Viewport should be rendered as soon as volumes are added.

suppressEvents: boolean = false

Returns

Promise<void>

Overrides

BaseVolumeViewport.addVolumes

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:104


addWidget()

addWidget(widgetId, widget): void

Parameters

widgetId: any

widget: any

Returns

void

Inherited from

BaseVolumeViewport.addWidget

Defined in

packages/core/src/RenderingEngine/Viewport.ts:186


applyViewOrientation()

protected applyViewOrientation(orientation, resetCamera): void

Parameters

orientation: OrientationVectors | OrientationAxis

resetCamera: boolean = true

Returns

void

Inherited from

BaseVolumeViewport.applyViewOrientation

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:138


canvasToWorld()

canvasToWorld(canvasPos): Point3

canvasToWorld Returns the world coordinates of the given canvasPos projected onto the plane defined by the Viewport's vtkCamera's focal point and the direction of projection.

Parameters

canvasPos: Point2

The position in canvas coordinates.

Returns

Point3

The corresponding world coordinates.

Inherited from

BaseVolumeViewport.canvasToWorld

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1496


clearDefaultProperties()

clearDefaultProperties(volumeId?): void

Remove the global default properties of the viewport or remove default properties for a volumeId if specified

Parameters

volumeId?: string

If given, we remove the default properties only for this volumeId, if not the global default properties will be removed

Returns

void

Inherited from

BaseVolumeViewport.clearDefaultProperties

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:578


flip()

flip(flipDirection): void

Flip the viewport along the desired axis

Parameters

flipDirection: FlipDirection

FlipDirection

Returns

void

Inherited from

BaseVolumeViewport.flip

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1368


getActor()

getActor(actorUID): ActorEntry

Get an actor by its UID

Parameters

actorUID: string

The unique ID of the actor.

Returns

ActorEntry

An ActorEntry object.

Inherited from

BaseVolumeViewport.getActor

Defined in

packages/core/src/RenderingEngine/Viewport.ts:473


getActorByIndex()

getActorByIndex(index): ActorEntry

Get an actor by its index

Parameters

index: number

array index.

Returns

ActorEntry

actorUID

Inherited from

BaseVolumeViewport.getActorByIndex

Defined in

packages/core/src/RenderingEngine/Viewport.ts:516


getActors()

getActors(): ActorEntry[]

Get all the actors in the viewport

Returns

ActorEntry[]

An array of ActorEntry objects.

Inherited from

BaseVolumeViewport.getActors

Defined in

packages/core/src/RenderingEngine/Viewport.ts:456


getActorUIDByIndex()

getActorUIDByIndex(index): string

Get an actor UID by its index

Parameters

index: number

array index.

Returns

string

actorUID

Inherited from

BaseVolumeViewport.getActorUIDByIndex

Defined in

packages/core/src/RenderingEngine/Viewport.ts:504


getActorUIDs()

getActorUIDs(): string[]

Returns an array of unique identifiers for all the actors in the viewport.

Returns

string[]

An array of strings

Inherited from

BaseVolumeViewport.getActorUIDs

Defined in

packages/core/src/RenderingEngine/Viewport.ts:464


getAllVolumeIds()

getAllVolumeIds(): string[]

Returns an array of all volumeIds currently in the viewport.

Returns

string[]

An array of strings representing all volumeIds.

Inherited from

BaseVolumeViewport.getAllVolumeIds

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1820


getBounds()

getBounds(): number[]

gets the visible bounds of the viewport in the world coordinate system

Returns

number[]

Inherited from

BaseVolumeViewport.getBounds

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1358


getCamera()

getCamera(): ICamera

Get the camera's current state

Returns

ICamera

The camera object.

Inherited from

BaseVolumeViewport.getCamera

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1350


getCameraNoRotation()

protected getCameraNoRotation(): ICamera

Returns

ICamera

Inherited from

BaseVolumeViewport.getCameraNoRotation

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1307


getCanvas()

getCanvas(): HTMLCanvasElement

Gets the target output canvas for the Viewport.

Returns

HTMLCanvasElement

an HTMLCanvasElement.

Inherited from

BaseVolumeViewport.getCanvas

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1293


getClippingPlanesForActor()

getClippingPlanesForActor(actorEntry?): vtkPlane[]

Method to get the clipping planes of a given actor

Parameters

actorEntry?: ActorEntry

The actor entry (a specific type you'll define dependent on your code)

Returns

vtkPlane[]

vtkPlanes - An array of vtkPlane objects associated with the given actor

Inherited from

BaseVolumeViewport.getClippingPlanesForActor

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1621


getCurrentImageId()

getCurrentImageId(): string

Uses viewport camera and volume actor to decide if the viewport is looking at the volume in the direction of acquisition (imageIds). If so, it uses the origin and focalPoint to find which imageId is currently being viewed.

Returns

string

ImageId

Overrides

BaseVolumeViewport.getCurrentImageId

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:651


getCurrentImageIdIndex()

getCurrentImageIdIndex(volumeId?): number

Returns the imageId index of the current slice in the volume viewport. Note: this is not guaranteed to be the same as the slice index in the view To get the slice index in the view (scroll position), use getSliceIndex()

In future we will even delete this method as it should not be used at all.

Parameters

volumeId?: string

Returns

number

The slice index in the direction of the view

Overrides

BaseVolumeViewport.getCurrentImageIdIndex

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:454


getCurrentSlicePixelData()

getCurrentSlicePixelData(): PixelDataTypedArray

Retrieves the pixel data for the current slice being displayed in the viewport.

Note: this method cannot return the oblique planes pixel data as they are interpolated in the gpu side

Returns

PixelDataTypedArray

The pixel data for the current slice, which can be in any of the axial, sagittal or coronal directions

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:636


getDefaultActor()

getDefaultActor(): ActorEntry

Get the default actor

Returns

ActorEntry

An actor entry.

Inherited from

BaseVolumeViewport.getDefaultActor

Defined in

packages/core/src/RenderingEngine/Viewport.ts:448


getDefaultProperties()

getDefaultProperties(volumeId?): VolumeViewportProperties

Retrieve the viewport default properties

Parameters

volumeId?: string

If given, we retrieve the default properties of a volumeId if it exists If not given,we return the global properties of the viewport

Returns

VolumeViewportProperties

default viewport properties including voi, invert, interpolation type, colormap

Inherited from

BaseVolumeViewport.getDefaultProperties

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:943


getDisplayArea()

getDisplayArea(): DisplayArea

Returns

DisplayArea

Inherited from

BaseVolumeViewport.getDisplayArea

Defined in

packages/core/src/RenderingEngine/Viewport.ts:921


getFrameOfReferenceUID()

getFrameOfReferenceUID(): string

Returns

string

Inherited from

BaseVolumeViewport.getFrameOfReferenceUID

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1372


getImageActor()

getImageActor(volumeId?): vtkImageSlice

Retrieves an image actor from the viewport actors.

Parameters

volumeId?: string

Optional. The ID of the volume to find the corresponding image actor.

Returns

vtkImageSlice

The image actor if found, otherwise null.

Inherited from

BaseVolumeViewport.getImageActor

Defined in

packages/core/src/RenderingEngine/Viewport.ts:483


getImageData()

getImageData(volumeId?): IImageData

Returns the image and its properties that is being shown inside the stack viewport. It returns, the image dimensions, image direction, image scalar data, vtkImageData object, metadata, and scaling (e.g., PET suvbw) Note: since the volume viewport supports fusion, to get the image data for a specific volume, use the optional volumeId argument.

Parameters

volumeId?: string

The volumeId of the volume to get the image for.

Returns

IImageData

IImageData

Inherited from

BaseVolumeViewport.getImageData

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1414


getImageIds()

getImageIds(volumeId?): string[]

Returns the list of image Ids for the current viewport

Parameters

volumeId?: string

volumeId

Returns

string[]

list of strings for image Ids

Inherited from

BaseVolumeViewport.getImageIds

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1715


getIntensityFromWorld()

getIntensityFromWorld(point): number

Given a point in world coordinates, return the intensity at that point

Parameters

point: Point3

The point in world coordinates to get the intensity from.

Returns

number

The intensity value of the voxel at the given point.

Inherited from

BaseVolumeViewport.getIntensityFromWorld

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1694


getNumberOfSlices()

getNumberOfSlices(): number

Gets the number of slices the volume is broken up into in the camera direction

Returns

number

Overrides

BaseVolumeViewport.getNumberOfSlices

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:92


getPan()

getPan(initialCamera): Point2

Helper function to return the current canvas pan value.

Parameters

initialCamera: ICamera = ...

Returns

Point2

a Point2 containing the current pan values on the canvas, computed from the current camera, where the initial pan value is [0,0].

Inherited from

BaseVolumeViewport.getPan

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1134


getProperties()

getProperties(volumeId?): VolumeViewportProperties

Retrieve the viewport properties

Parameters

volumeId?: string

The volume id to get the properties for (if undefined, the first volume)

Returns

VolumeViewportProperties

viewport properties including voi, interpolation type: TODO: slabThickness, invert

Inherited from

BaseVolumeViewport.getProperties

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:965


getRenderer()

getRenderer(): vtkRenderer

Returns the vtkRenderer responsible for rendering the Viewport.

Returns

vtkRenderer

The vtkRenderer for the Viewport.

Inherited from

BaseVolumeViewport.getRenderer

Defined in

packages/core/src/RenderingEngine/Viewport.ts:244


getRenderingEngine()

getRenderingEngine(): RenderingEngine

Returns the rendering engine driving the Viewport.

Returns

RenderingEngine

The RenderingEngine instance.

Inherited from

BaseVolumeViewport.getRenderingEngine

Defined in

packages/core/src/RenderingEngine/Viewport.ts:235


getRotation()

getRotation(): number

Gets the rotation resulting from the value set in setRotation AND taking into account any flips that occurred subsequently from the camera provided or the viewport.

Returns

number

the rotation resulting from the value set in setRotation AND taking into account any flips that occurred subsequently.

Inherited from

BaseVolumeViewport.getRotation

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1312


getSlabThickness()

getSlabThickness(): number

Gets the largest slab thickness from all actors in the viewport.

Returns

number

slabThickness - The slab thickness.

Inherited from

BaseVolumeViewport.getSlabThickness

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1677


getSliceIndex()

getSliceIndex(): number

Returns the image index associated with the volume viewport in the current view, the difference between this method and getCurrentImageIdIndex is that this method returns the index of the slice in the volume in view direction so at the top (scrollbar top) of the viewport the index will be 0 and at the bottom (scrollbar bottom) the index will be the number of slices - 1. But the getCurrentImageIdIndex returns the index of current image in the imageIds which is not guaranteed to be the same as the slice index in the view.

Returns

number

The image index.

Overrides

BaseVolumeViewport.getSliceIndex

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:488


getSlicePlaneCoordinates()

getSlicePlaneCoordinates(): object[]

Returns an array of 3D coordinates representing the slice plane positions. It starts by the focal point as a reference point on the current slice that the camera is looking at, and then it calculates the slice plane positions by moving the focal point in the direction of the view plane normal back and forward, and snaps them to the slice.

Returns

object[]

An array of Point3 representing the slice plane coordinates.

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:801


getSlicesClippingPlanes()

getSlicesClippingPlanes(): object[]

Retrieves the clipping planes for the slices in the volume viewport.

Returns

object[]

An array of vtkPlane objects representing the clipping planes, or an array of objects with normal and origin properties if raw is true.

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:761


getSliceViewInfo()

getSliceViewInfo(): object

Returns detailed information about the current slice view in the volume viewport. This method provides comprehensive data about the slice's position, orientation, and dimensions within the volume.

Returns

object

An object containing the following properties:

height

height: number

indexToSliceMatrix

indexToSliceMatrix: mat4

sliceIndex

sliceIndex: number

slicePlane

slicePlane: number

sliceToIndexMatrix

sliceToIndexMatrix: mat4

width

width: number

Throws

If the view is oblique or if the slice axis cannot be determined.

Overrides

BaseVolumeViewport.getSliceViewInfo

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:508


getViewPresentation()

getViewPresentation(viewPresSel): ViewPresentation

Gets a view presentation information specifying HOW a viewport displays something, but not what is being displayed. See getViewReference to get information on WHAT is being displayed.

This is intended to have information on how an image is presented to the user, without specifying what image s displayed. All of this information is available externally, but this method combines the parts of this that are appropriate for remember or applying to other views, without necessarily needing to know what all the attributes are. That differs from methods like getCamera which fetch exact view details that are not likely to be identical between viewports as they change sizes or apply to different images.

Note that the results of this can be used on different viewports, for example, the pan values can be applied to a volume viewport showing a CT, and a stack viewport showing an ultrasound.

The selector allows choosing which view presentation attributes to return. Some default values are available from Viewport.CameraViewPresentation and Viewport.TransferViewPresentation

Parameters

viewPresSel: ViewPresentationSelector = ...

select which attributes to display.

Returns

ViewPresentation

Inherited from

BaseVolumeViewport.getViewPresentation

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1778


getViewReference()

getViewReference(viewRefSpecifier): ViewReference

Gets a view target, allowing comparison between view positions as well as restoring views later. Add the referenced image id.

Parameters

viewRefSpecifier: ViewReferenceSpecifier = {}

Returns

ViewReference

Overrides

BaseVolumeViewport.getViewReference

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:674


getViewReferenceId()

getViewReferenceId(specifier): string

For a volume viewport, the reference id will be a URN starting with volumeId:<volumeId>, followed by additional arguments to specify the view orientation. This will end up being a unique string that identifies the view reference being shown. It is different from the view reference in that the values are all incorporated into a string to allow using it as a parameter key.

Parameters

specifier: ViewReferenceSpecifier = {}

Returns

string

Inherited from

BaseVolumeViewport.getViewReferenceId

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1774


getVOIModifiedEventDetail()

protected getVOIModifiedEventDetail(volumeId): VoiModifiedEventDetail

Parameters

volumeId: string

Returns

VoiModifiedEventDetail

Inherited from

BaseVolumeViewport.getVOIModifiedEventDetail

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:369


getVolumeId()

getVolumeId(specifier?): string

Gets the volumeId to use for references. Returns undefined if the specified volume is NOT in this viewport.

Parameters

specifier?: ViewReferenceSpecifier

Returns

string

Inherited from

BaseVolumeViewport.getVolumeId

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1740


getVtkActiveCamera()

protected getVtkActiveCamera(): vtkSlabCamera | vtkCamera

Gets the active vtkCamera for the viewport.

Returns

vtkSlabCamera | vtkCamera

vtk driven camera

Inherited from

BaseVolumeViewport.getVtkActiveCamera

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1301


getWidget()

getWidget(id): any

Parameters

id: any

Returns

any

Inherited from

BaseVolumeViewport.getWidget

Defined in

packages/core/src/RenderingEngine/Viewport.ts:190


getWidgets()

getWidgets(): any[]

Returns

any[]

Inherited from

BaseVolumeViewport.getWidgets

Defined in

packages/core/src/RenderingEngine/Viewport.ts:194


getZoom()

getZoom(compareCamera): number

Returns a current zoom level relative to the initial parallel scale originally applied to the image. That is, on initial display, the zoom level is 1. Computed as a function of the camera.

Parameters

compareCamera: ICamera = ...

Returns

number

Inherited from

BaseVolumeViewport.getZoom

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1217


hasImageURI()

hasImageURI(imageURI): boolean

Parameters

imageURI: string

Returns

boolean

Inherited from

BaseVolumeViewport.hasImageURI

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1629


hasVolumeId()

hasVolumeId(volumeId): boolean

Checks if the viewport has a volume actor with the given volumeId

Parameters

volumeId: string

the volumeId to look for

Returns

boolean

Boolean indicating if the volume is present in the viewport

Inherited from

BaseVolumeViewport.hasVolumeId

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1381


hasVolumeURI()

hasVolumeURI(volumeURI): boolean

Checks if the viewport has a volume with the given volumeURI.

Parameters

volumeURI: string

The URI of the volume to check for.

Returns

boolean

A boolean indicating whether the viewport contains a volume with the given URI.

Inherited from

BaseVolumeViewport.hasVolumeURI

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1393


isReferenceViewable()

isReferenceViewable(viewRef, options?): boolean

Find out if this viewport would show this view

Parameters

viewRef: ViewReference

options?: ReferenceCompatibleOptions

allows specifying whether the view COULD display this with some modification - either navigation or displaying as volume.

Returns

boolean

true if the target is compatible with this view

Inherited from

BaseVolumeViewport.isReferenceViewable

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:634


jumpToWorld()

jumpToWorld(worldPos): boolean

Parameters

worldPos: Point3

Returns

boolean

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:125


removeActors()

removeActors(actorUIDs): void

Remove the actors with the given UIDs from the viewport

Parameters

actorUIDs: string[]

An array of actor UIDs to remove.

Returns

void

Inherited from

BaseVolumeViewport.removeActors

Defined in

packages/core/src/RenderingEngine/Viewport.ts:550


removeAllActors()

removeAllActors(): void

Remove all actors from the renderer

Returns

void

Inherited from

BaseVolumeViewport.removeAllActors

Defined in

packages/core/src/RenderingEngine/Viewport.ts:630


removeVolumeActors()

removeVolumeActors(actorUIDs, immediate): void

It removes the volume actor from the Viewport. If the volume actor is not in the viewport, it does nothing.

Parameters

actorUIDs: string[]

Array of actor UIDs to remove. In case of simple volume it will be the volume Id, but in case of Segmentation it will be {volumeId}-{representationType} since the same volume can be rendered in multiple representations.

immediate: boolean = false

If true, the Viewport will be rendered immediately

Returns

void

Inherited from

BaseVolumeViewport.removeVolumeActors

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1209


removeWidgets()

removeWidgets(): void

Returns

void

Inherited from

BaseVolumeViewport.removeWidgets

Defined in

packages/core/src/RenderingEngine/Viewport.ts:198


render()

render(): void

Renders the Viewport using the RenderingEngine.

Returns

void

Inherited from

BaseVolumeViewport.render

Defined in

packages/core/src/RenderingEngine/Viewport.ts:257


reset()

reset(immediate): void

Resets the options the Viewport's defaultOptions

Parameters

immediate: boolean = false

If true, renders the viewport after the options are reset.

Returns

void

Inherited from

BaseVolumeViewport.reset

Defined in

packages/core/src/RenderingEngine/Viewport.ts:287


resetCamera()

resetCamera(options?): boolean

Reset the camera for the volume viewport

Parameters

options?: any

Returns

boolean

Overrides

BaseVolumeViewport.resetCamera

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:308


resetCameraForResize()

resetCameraForResize(): boolean

Returns

boolean

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:295


resetCameraNoEvent()

protected resetCameraNoEvent(): void

Reset the camera to the default viewport camera without firing events

Returns

void

Inherited from

BaseVolumeViewport.resetCameraNoEvent

Defined in

packages/core/src/RenderingEngine/Viewport.ts:639


resetProperties()

resetProperties(volumeId?): void

Reset the viewport properties to the default values

Parameters

volumeId?: string

Optional volume ID to specify which volume properties to reset. If not provided, it will reset the properties of the default actor.

Returns

void

void

Overrides

BaseVolumeViewport.resetProperties

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:698


resetSlabThickness()

resetSlabThickness(): void

Uses the origin and focalPoint to calculate the slice index.

Resets the slab thickness of the actors of the viewport to the default value.

Returns

void

Overrides

BaseVolumeViewport.resetSlabThickness

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:429


resetToDefaultProperties()

resetToDefaultProperties(volumeId): void

Reset the viewport properties to the default values

Parameters

volumeId: string

Returns

void

Inherited from

BaseVolumeViewport.resetToDefaultProperties

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:853


scroll()

scroll(delta): void

Scrolls the viewport in the given direction/amount

Parameters

delta: number = 1

Returns

void

Inherited from

BaseVolumeViewport.scroll

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:660


setActors()

setActors(actors): void

It removes all actors from the viewport and then adds the actors from the array.

Parameters

actors: ActorEntry[]

An array of ActorEntry objects.

Returns

void

Inherited from

BaseVolumeViewport.setActors

Defined in

packages/core/src/RenderingEngine/Viewport.ts:524


setBlendMode()

setBlendMode(blendMode, filterActorUIDs, immediate): void

Parameters

blendMode: BlendModes

filterActorUIDs: any[] = []

immediate: boolean = false

Returns

void

Overrides

BaseVolumeViewport.setBlendMode

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:269


setCamera()

setCamera(cameraInterface, storeAsInitialCamera?): void

Set the camera parameters

Parameters

cameraInterface: ICamera

ICamera

storeAsInitialCamera?: boolean

to set the provided camera as the initial one, used to compute differences for things like pan and zoom.

Returns

void

Inherited from

BaseVolumeViewport.setCamera

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1462


setCameraClippingRange()

protected setCameraClippingRange(): void

Returns

void

Overrides

BaseVolumeViewport.setCameraClippingRange

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:203


setCameraNoEvent()

protected setCameraNoEvent(camera): void

Sets the camera to the default viewport camera without firing events

Parameters

camera: ICamera

The camera to use for the viewport.

Returns

void

Inherited from

BaseVolumeViewport.setCameraNoEvent

Defined in

packages/core/src/RenderingEngine/Viewport.ts:649


setDataIds()

setDataIds(_imageIds, _options?): void

This is a wrapper for setStack/setVideo/etc

Parameters

_imageIds: string[]

_options?: ImageSetOptions

Returns

void

Inherited from

BaseVolumeViewport.setDataIds

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1968


setDefaultProperties()

setDefaultProperties(ViewportProperties, volumeId?): void

Update the default properties for the volume viewport on the volume

Parameters

ViewportProperties: VolumeViewportProperties

The properties to set

volumeId?: string

The volume id to set the default properties for (if undefined, we set the global default viewport properties)

Returns

void

Inherited from

BaseVolumeViewport.setDefaultProperties

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:562


setDisplayArea()

setDisplayArea(displayArea, suppressEvents): void

Sets the camera to an initial bounds. If resetPan and resetZoom are true it places the focal point at the center of the volume (or slice); otherwise, only the camera zoom and camera Pan or Zoom is reset for the current view.

Parameters

displayArea: DisplayArea

The display area of interest.

suppressEvents: boolean = false

If true, don't fire displayArea event.

Returns

void

Inherited from

BaseVolumeViewport.setDisplayArea

Defined in

packages/core/src/RenderingEngine/Viewport.ts:718


setDisplayAreaFit()

protected setDisplayAreaFit(displayArea): void

This applies a display area with a fit of the provided area to the available area. The zoom level is controlled by the imageArea parameter, which is a pair of percentage width in the horizontal and vertical dimension is scaled to fit the displayable area. Both values are taken into account, and the scaling is set so that both fractions of the image area are visible.

The panning is controlled by the imageCanvasPoint, which has two values, teh imagePoint and the canvasPoint. They are fractional values of the image and canvas respectively, with the panning set to display the image pixel at the given fraction on top of the canvas at the given percentage. The default points are 0.5.

For example, if the zoom level is [2,1], then the image is displayed such that at least twice the width is visible, and the height is visible. That will result in the image width being black, divided up on the left and right according to the imageCanvasPoint

Then, if the imagePoint is [1,0] and the canvas point is [1,0], then the right most edge of the image, at the top of the image, will be displayed at the right most edge of the canvas, at the top.

Parameters

displayArea: DisplayArea

Returns

void

Inherited from

BaseVolumeViewport.setDisplayAreaFit

Defined in

packages/core/src/RenderingEngine/Viewport.ts:855


setDisplayAreaScale()

protected setDisplayAreaScale(displayArea): void

Sets the viewport to pixel scaling mode. Pixel scaling displays 1 image pixel as 1 (or scale) physical screen pixels. That is, a 1024x512 image will be displayed with scale=2, as 2048x1024 physical image pixels.

Parameters

displayArea: DisplayArea

display area to set

  • displayArea.scale - the number of physical pixels to display each image pixel in. Values < 1 mean smaller than physical, while values > 1 mean more than one pixel. Default is 1 Suggest using whole numbers or integer fractions (eg 1/3)

Returns

void

Inherited from

BaseVolumeViewport.setDisplayAreaScale

Defined in

packages/core/src/RenderingEngine/Viewport.ts:782


setFitToCanvasCamera()

protected setFitToCanvasCamera(camera): void

Sets the provided camera as the displayArea camera. This allows computing differences applied later as compared to the initial position, for things like zoom and pan.

Parameters

camera: ICamera

to store as the initial value.

Returns

void

Inherited from

BaseVolumeViewport.setFitToCanvasCamera

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1122


setInitialCamera()

protected setInitialCamera(camera): void

Sets the provided camera as the initial camera. This allows computing differences applied later as compared to the initial position, for things like zoom and pan.

Parameters

camera: ICamera

to store as the initial value.

Returns

void

Inherited from

BaseVolumeViewport.setInitialCamera

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1112


setInterpolationType()

protected setInterpolationType(interpolationType, volumeId?): void

Sets the interpolation type. No-op in the base.

Parameters

interpolationType: InterpolationType

volumeId?: string

Returns

void

Inherited from

BaseVolumeViewport.setInterpolationType

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:427


setOptions()

setOptions(options, immediate): void

Sets new options and (TODO) applies them.

Parameters

options: ViewportInputOptions

The viewport options to set.

immediate: boolean = false

If true, renders the viewport after the options are set.

Returns

void

Inherited from

BaseVolumeViewport.setOptions

Defined in

packages/core/src/RenderingEngine/Viewport.ts:269


setOrientation()

setOrientation(orientation, immediate): void

It sets the orientation for the camera, the orientation can be one of the following: axial, sagittal, coronal, default. Use the Enums.OrientationAxis to set the orientation. The "default" orientation is the orientation that the volume was acquired in (scan axis)

Parameters

orientation: OrientationVectors | OrientationAxis

The orientation to set the camera to.

immediate: boolean = true

Whether the Viewport should be rendered as soon as the camera is set.

Returns

void

Overrides

BaseVolumeViewport.setOrientation

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:168


setOrientationOfClippingPlanes()

setOrientationOfClippingPlanes(vtkPlanes, slabThickness, viewPlaneNormal, focalPoint): void

Parameters

vtkPlanes: vtkPlane[]

slabThickness: number

viewPlaneNormal: Point3

focalPoint: Point3

Returns

void

Inherited from

BaseVolumeViewport.setOrientationOfClippingPlanes

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1584


setPan()

setPan(pan, storeAsInitialCamera): void

Sets the canvas pan value relative to the initial view position of 0,0 Modifies the camera to perform the pan.

Parameters

pan: Point2

storeAsInitialCamera: boolean = false

Returns

void

Inherited from

BaseVolumeViewport.setPan

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1183


setProperties()

setProperties(VolumeViewportProperties, volumeId?, suppressEvents?): void

Sets the properties for the volume viewport on the volume and if setProperties is called for the first time, the properties will also become the default one. (if fusion, it sets it for the first volume in the fusion)

Parameters

VolumeViewportProperties: VolumeViewportProperties = {}

The properties to set

volumeId?: string

The volume id to set the properties for (if undefined, the first volume)

suppressEvents?: boolean = false

If true, the viewport will not emit events

Returns

void

Inherited from

BaseVolumeViewport.setProperties

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:787


setRendered()

setRendered(): void

Indicate that the image has been rendered. This will set the viewportStatus to RENDERED if there is image data available to actually be rendered - otherwise, the rendering simply showed the background image.

Returns

void

Inherited from

BaseVolumeViewport.setRendered

Defined in

packages/core/src/RenderingEngine/Viewport.ts:220


setRotation()

protected setRotation(rotation): void

Parameters

rotation: number

Returns

void

Inherited from

BaseVolumeViewport.setRotation

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:508


setSlabThickness()

setSlabThickness(slabThickness, filterActorUIDs): void

It sets the slabThickness of the actors of the viewport. If filterActorUIDs are provided, only the actors with the given UIDs will be affected. If no filterActorUIDs are provided, all actors will be affected.

Parameters

slabThickness: number

The slab thickness to set.

filterActorUIDs: any[] = []

Optional argument to filter the actors to apply the slab thickness to (if not provided, all actors will be affected).

Returns

void

Overrides

BaseVolumeViewport.setSlabThickness

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:395


setViewPresentation()

setViewPresentation(viewPres): void

Applies the display area, zoom, pan and rotation from the view presentation. No-op is viewPres isn't defined.

Parameters

viewPres: ViewPresentation

Returns

void

Inherited from

BaseVolumeViewport.setViewPresentation

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1818


setViewReference()

setViewReference(viewRef): void

Navigates to the specified view reference.

Parameters

viewRef: ViewReference

Returns

void

Inherited from

BaseVolumeViewport.setViewReference

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:693


setVolumes()

setVolumes(volumeInputArray, immediate, suppressEvents): Promise<void>

Creates volume actors for all volumes defined in the volumeInputArray. For each entry, if a callback is supplied, it will be called with the new volume actor as input. For each entry, if a blendMode and/or slabThickness is defined, this will be set on the actor's VolumeMapper.

Parameters

volumeInputArray: IVolumeInput[]

The array of VolumeInputs which define the volumes to add.

immediate: boolean = false

Whether the Viewport should be rendered as soon as volumes are added.

suppressEvents: boolean = false

Returns

Promise<void>

Overrides

BaseVolumeViewport.setVolumes

Defined in

packages/core/src/RenderingEngine/VolumeViewport.ts:70


setZoom()

setZoom(value, storeAsInitialCamera): void

Zooms the image using parallel scale by updating the camera value.

Parameters

value: number

The relative parallel scale to apply. It is relative to the initial offsets value.

storeAsInitialCamera: boolean = false

can be set to true to reset the camera after applying this zoom as the initial camera. A subsequent getZoom call will return "1", but the zoom will have been applied.

Returns

void

Inherited from

BaseVolumeViewport.setZoom

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1234


triggerCameraModifiedEventIfNecessary()

triggerCameraModifiedEventIfNecessary(previousCamera, updatedCamera): void

Trigger camera modified event

Parameters

previousCamera: ICamera

updatedCamera: ICamera

Returns

void

Inherited from

BaseVolumeViewport.triggerCameraModifiedEventIfNecessary

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1506


updateCameraClippingPlanesAndRange()

updateCameraClippingPlanesAndRange(): void

Updates the camera's clipping planes and range.

Returns

void

Inherited from

BaseVolumeViewport.updateCameraClippingPlanesAndRange

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1526


updateClippingPlanesForActors()

protected updateClippingPlanesForActors(updatedCamera): Promise<void>

Updates the actors clipping planes orientation from the camera properties

Parameters

updatedCamera: ICamera

ICamera

Returns

Promise<void>

Inherited from

BaseVolumeViewport.updateClippingPlanesForActors

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1536


worldToCanvas()

worldToCanvas(worldPos): Point2

Returns the canvas coordinates of the given worldPos projected onto the Viewport's canvas.

Parameters

worldPos: Point3

The position in world coordinates.

Returns

Point2

The corresponding canvas coordinates.

Inherited from

BaseVolumeViewport.worldToCanvas

Defined in

packages/core/src/RenderingEngine/BaseVolumeViewport.ts:1562


boundsRadius()

static boundsRadius(bounds): number

Computes the bounds radius value

Parameters

bounds: number[]

Returns

number

Inherited from

BaseVolumeViewport.boundsRadius

Defined in

packages/core/src/RenderingEngine/Viewport.ts:1952