Skip to main content

Class: WSIViewport

A viewport which shows a microscopy view using the dicom-microscopy-viewer library. This viewport accepts standard CS3D annotations, and responds similar to how the other types of viewports do for things like zoom/pan.

This viewport required the dicom-microscopy-viewer import to be available from the peerImport function in the CS3D init configuration. See the example initDemo.js for one possible implementation, but the actual implementation of this will depend on your platform.

Extends​

Constructors​

new WSIViewport()​

new WSIViewport(props): WSIViewport

Parameters​

• props: ViewportInput

Returns​

WSIViewport

Overrides​

Viewport.constructor

Defined in​

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

Properties​

_actors​

_actors: Map<string, ActorEntry>

a Map containing the actor uid and actors

Inherited from​

Viewport._actors

Defined in​

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


_suppressCameraModifiedEvents​

_suppressCameraModifiedEvents: boolean = false

informs if a new actor was added before a resetCameraClippingRange phase

Inherited from​

Viewport._suppressCameraModifiedEvents

Defined in​

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


calibration​

protected calibration: IImageCalibration

Inherited from​

Viewport.calibration

Defined in​

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


canvas​

readonly canvas: HTMLCanvasElement

an internal canvas that is created on the provided HTML element

Inherited from​

Viewport.canvas

Defined in​

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


defaultOptions​

readonly defaultOptions: ViewportInputOptions

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

Inherited from​

Viewport.defaultOptions

Defined in​

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


element​

readonly element: HTMLDivElement

HTML element in DOM that is used for rendering the viewport

Inherited from​

Viewport.element

Defined in​

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


fitToCanvasCamera​

protected fitToCanvasCamera: ICamera

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

Inherited from​

Viewport.fitToCanvasCamera

Defined in​

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


flipHorizontal​

protected flipHorizontal: boolean = false

Inherited from​

Viewport.flipHorizontal

Defined in​

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


flipVertical​

protected flipVertical: boolean = false

Inherited from​

Viewport.flipVertical

Defined in​

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


hasPixelSpacing​

protected hasPixelSpacing: boolean = true

Inherited from​

Viewport.hasPixelSpacing

Defined in​

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


id​

readonly id: string

unique identifier for the viewport

Inherited from​

Viewport.id

Defined in​

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


imageIds​

protected imageIds: string[]

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:38


initialCamera​

protected initialCamera: ICamera

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

Inherited from​

Viewport.initialCamera

Defined in​

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


insetImageMultiplier​

protected insetImageMultiplier: number = 1.1

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

Inherited from​

Viewport.insetImageMultiplier

Defined in​

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


isDisabled​

isDisabled: boolean

Inherited from​

Viewport.isDisabled

Defined in​

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


map​

protected map: any

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:51


metadata​

protected metadata: any

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:45


metadataDicomweb​

protected metadataDicomweb: any

Defined in​

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


modality​

modality: any

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:36


options​

options: ViewportInputOptions

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

Inherited from​

Viewport.options

Defined in​

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


renderingEngineId​

readonly renderingEngineId: string

RenderingEngine id that the viewport belongs to

Overrides​

Viewport.renderingEngineId

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:40


sHeight​

sHeight: number

sHeight of viewport on the offscreen canvas

Inherited from​

Viewport.sHeight

Defined in​

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


suppressEvents​

readonly suppressEvents: boolean

A flag representing if viewport methods should fire events or not

Inherited from​

Viewport.suppressEvents

Defined in​

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


sWidth​

sWidth: number

sWidth of viewport on the offscreen canvas

Inherited from​

Viewport.sWidth

Defined in​

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


sx​

sx: number

sx of viewport on the offscreen canvas

Inherited from​

Viewport.sx

Defined in​

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


sy​

sy: number

sy of viewport on the offscreen canvas

Inherited from​

Viewport.sy

Defined in​

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


type​

readonly type: ViewportType

Type of viewport

Inherited from​

Viewport.type

Defined in​

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


uid​

readonly uid: any

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:39


updateRenderingPipeline()​

updateRenderingPipeline: () => void

Returns​

void

Inherited from​

Viewport.updateRenderingPipeline

Defined in​

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


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​

Viewport.viewportStatus

Defined in​

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


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​

Viewport.CameraViewPresentation

Defined in​

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


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​

Viewport.TransferViewPresentation

Defined in​

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

Accessors​

useCustomRenderingPipeline​

get static useCustomRenderingPipeline(): boolean

Returns​

boolean

Overrides​

Viewport.useCustomRenderingPipeline

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:124

Methods​

_getCorners()​

_getCorners(bounds): number[][]

Parameters​

• bounds: number[]

Returns​

number[][]

Inherited from​

Viewport._getCorners

Defined in​

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


_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​

Viewport._getEdges

Defined in​

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


_getFocalPointForResetCamera()​

_getFocalPointForResetCamera(centeredFocalPoint, previousCamera, __namedParameters): Point3

Parameters​

• centeredFocalPoint: Point3

• previousCamera: ICamera

• __namedParameters

• __namedParameters.resetPan: boolean = true

• __namedParameters.resetToCenter: boolean = true

Returns​

Point3

Inherited from​

Viewport._getFocalPointForResetCamera

Defined in​

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


_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​

Viewport._isInBounds

Defined in​

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


_removeActor()​

_removeActor(actorUID): ActorEntry

Remove the actor from the viewport

Parameters​

• actorUID: string

The unique identifier for the actor.

Returns​

ActorEntry

The removed actor entry or undefined if it didn't exist

Inherited from​

Viewport._removeActor

Defined in​

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


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​

Viewport.addActor

Defined in​

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


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​

Viewport.addActors

Defined in​

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


addWidget()​

addWidget(widgetId, widget): void

Parameters​

• widgetId: any

• widget: any

Returns​

void

Inherited from​

Viewport.addWidget

Defined in​

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


canvasToIndex()​

protected canvasToIndex(canvasPos): Point3

Parameters​

• canvasPos: Point2

Returns​

Point3

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:690


canvasToWorld()​

canvasToWorld(canvasPos): Point3

Converts a VideoViewport canvas coordinate to a video coordinate.

Parameters​

• canvasPos: Point2

Returns​

Point3

World position

Overrides​

Viewport.canvasToWorld

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:536


computeTransforms()​

computeTransforms(): object

Returns​

object

indexToWorld​

indexToWorld: mat4

worldToIndex​

worldToIndex: mat4

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:284


customRenderViewportToCanvas()​

customRenderViewportToCanvas(): void

Returns​

void

Overrides​

Viewport.customRenderViewportToCanvas

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:771


flip()​

protected flip(flipOptions): void

Flip the viewport on horizontal or vertical axis, this method works with vtk-js backed rendering pipeline.

Parameters​

• flipOptions: FlipDirection

Flip options specifying the axis of flip

  • flipOptions.flipHorizontal - Flip the viewport on horizontal axis
  • flipOptions.flipVertical - Flip the viewport on vertical axis

Returns​

void

Inherited from​

Viewport.flip

Defined in​

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


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​

Viewport.getActor

Defined in​

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


getActorByIndex()​

getActorByIndex(index): ActorEntry

Get an actor by its index

Parameters​

• index: number

array index.

Returns​

ActorEntry

actorUID

Inherited from​

Viewport.getActorByIndex

Defined in​

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


getActors()​

getActors(): ActorEntry[]

Get all the actors in the viewport

Returns​

ActorEntry[]

An array of ActorEntry objects.

Inherited from​

Viewport.getActors

Defined in​

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


getActorUIDByIndex()​

getActorUIDByIndex(index): string

Get an actor UID by its index

Parameters​

• index: number

array index.

Returns​

string

actorUID

Inherited from​

Viewport.getActorUIDByIndex

Defined in​

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


getActorUIDs()​

getActorUIDs(): string[]

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

Returns​

string[]

An array of strings

Inherited from​

Viewport.getActorUIDs

Defined in​

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


getCamera()​

getCamera(): ICamera

Get the camera's current state

Returns​

ICamera

The camera object.

Overrides​

Viewport.getCamera

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:418


getCameraNoRotation()​

protected getCameraNoRotation(): ICamera

Returns​

ICamera

Inherited from​

Viewport.getCameraNoRotation

Defined in​

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


getCanvas()​

getCanvas(): HTMLCanvasElement

Gets the target output canvas for the Viewport.

Returns​

HTMLCanvasElement

an HTMLCanvasElement.

Inherited from​

Viewport.getCanvas

Defined in​

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


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​

Viewport.getClippingPlanesForActor

Defined in​

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


getCurrentImageId()​

getCurrentImageId(): string

This function returns the imageID associated with either the current frame being displayed, or the range of frames being played. This may not correspond to any particular imageId that has imageId metadata, as the format is one of: <DICOMweb URI>/frames/<Start Frame>(-<End Frame>)? or <Other URI>[?&]frameNumber=<Start Frame>(-<EndFrame>)? for a URL parameter.

Returns​

string

an imageID for video

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:410


getCurrentImageIdIndex()​

getCurrentImageIdIndex(): number

Returns​

number

Overrides​

Viewport.getCurrentImageIdIndex

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:821


getDefaultActor()​

getDefaultActor(): ActorEntry

Get the default actor

Returns​

ActorEntry

An actor entry.

Inherited from​

Viewport.getDefaultActor

Defined in​

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


getDisplayArea()​

getDisplayArea(): DisplayArea

Returns​

DisplayArea

Inherited from​

Viewport.getDisplayArea

Defined in​

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


getFrameNumber()​

getFrameNumber(): number

Returns​

number

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:414


getFrameOfReferenceUID()​

getFrameOfReferenceUID(): string

The FOR for whole slide imaging is the frame of reference in the DICOM metadata, and should be the same for all slices being viewed.

Returns​

string

Overrides​

Viewport.getFrameOfReferenceUID

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:466


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​

Viewport.getImageActor

Defined in​

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


getImageData()​

getImageData(): CPUIImageData

Returns​

CPUIImageData

Overrides​

Viewport.getImageData

Defined in​

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


getImageIds()​

getImageIds(): string[]

Returns the list of image Ids for the viewport. Currently only returns the first/primary image id.

Returns​

string[]

list of strings for image Ids

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:788


getNumberOfSlices()​

getNumberOfSlices(): number

Gets the number of slices - this will be the number of focal planes, and not hte actual number of slices in the image sets.

Returns​

number

Overrides​

Viewport.getNumberOfSlices

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:447


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​

Viewport.getPan

Defined in​

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


getProperties()​

getProperties(): ViewportProperties

Returns​

ViewportProperties

Overrides​

Viewport.getProperties

Defined in​

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


getRenderer()​

getRenderer(): vtkRenderer

Returns the vtkRenderer responsible for rendering the Viewport.

Returns​

vtkRenderer

The vtkRenderer for the Viewport.

Inherited from​

Viewport.getRenderer

Defined in​

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


getRenderingEngine()​

getRenderingEngine(): RenderingEngine

Returns the rendering engine driving the Viewport.

Returns​

RenderingEngine

The RenderingEngine instance.

Inherited from​

Viewport.getRenderingEngine

Defined in​

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


getRotation()​

getRotation(): number

Returns​

number

Overrides​

Viewport.getRotation

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:688


getScalarData()​

protected getScalarData(): any

Returns​

any

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:280


getSliceIndex()​

getSliceIndex(): number

This can be implemented later when multi-slice WSI is supported

Returns​

number

Overrides​

Viewport.getSliceIndex

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:707


getSliceViewInfo()​

getSliceViewInfo(): object

Returns​

object

height​

height: number

indexToSliceMatrix​

indexToSliceMatrix: mat4

sliceIndex​

sliceIndex: number

slicePlane​

slicePlane: number

sliceToIndexMatrix​

sliceToIndexMatrix: mat4

width​

width: number

Inherited from​

Viewport.getSliceViewInfo

Defined in​

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


getTransform()​

protected getTransform(): Transform

The transform here is from index to canvas points, so this takes into account the scaling applied and the center location, but nothing to do with world coordinate transforms. Note that the 'index' values are often negative values with respect to the overall image area, as that is what is used internally for the view.

Returns​

Transform

A transform from index to canvas points

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:800


getView()​

getView(): any

Gets the internal OpenLayers view object being rendered Note this is not typeds right now, but might add typing later.

Returns​

any

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:715


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​

Viewport.getViewPresentation

Defined in​

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


getViewReference()​

getViewReference(viewRefSpecifier?): ViewReference

Gets a view target specifying WHAT a view is displaying, allowing for checking if a given image is displayed or could be displayed in a given viewport. See getViewPresentation for HOW a view is displayed.

Parameters​

• viewRefSpecifier?: ViewReferenceSpecifier

choose an alternate view to be specified, typically a different slice index in the same set of images.

Returns​

ViewReference

Inherited from​

Viewport.getViewReference

Defined in​

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


getViewReferenceId()​

getViewReferenceId(): string

Gets a referenced image url of some sort - could be a real image id, or could be a URL with parameters. Regardless it refers to the currently displaying image as a string value.

Returns​

string

Overrides​

Viewport.getViewReferenceId

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:817


getVtkActiveCamera()​

protected getVtkActiveCamera(): vtkCamera | vtkSlabCamera

Gets the active vtkCamera for the viewport.

Returns​

vtkCamera | vtkSlabCamera

vtk driven camera

Inherited from​

Viewport.getVtkActiveCamera

Defined in​

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


getWidget()​

getWidget(id): any

Parameters​

• id: any

Returns​

any

Inherited from​

Viewport.getWidget

Defined in​

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


getWidgets()​

getWidgets(): any[]

Returns​

any[]

Inherited from​

Viewport.getWidgets

Defined in​

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


getZoom()​

getZoom(): any

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.

Returns​

any

Overrides​

Viewport.getZoom

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:775


hasImageURI()​

hasImageURI(imageURI): boolean

Checks to see if the imageURI is currently being displayed. The imageURI may contain frame numbers according to the DICOM standard format, which will be stripped to compare the base image URI, and then the values used to check if that frame is currently being displayed.

The DICOM standard allows for comma separated values as well, however, this is not supported here, with only a single range or single value being tested.

For a single value, the time range +/- 5 frames is permitted to allow the detection to actually succeed when nearby without requiring an exact time frame to be matched.

Parameters​

• imageURI: string

containing frame number or range.

Returns​

boolean

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:371


indexToCanvas()​

protected indexToCanvas(indexPos): Point2

Parameters​

• indexPos: Point3

Returns​

Point2

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:699


indexToWorld()​

indexToWorld(point): Point3

Parameters​

• point: Point3

Returns​

Point3

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:522


indexToWorldWSI()​

indexToWorldWSI(point): Point3

Converts a image coordinate to a slide coordinate using WSI utils functions

Parameters​

• point: Point2

Returns​

Point3

Defined in​

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


isPlaneViewable()​

isPlaneViewable(planeRestriction, options?): boolean

Parameters​

• planeRestriction: PlaneRestriction

• options?: ReferenceCompatibleOptions

Returns​

boolean

Inherited from​

Viewport.isPlaneViewable

Defined in​

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


isReferenceViewable()​

isReferenceViewable(viewRef, options?): boolean

Find out if this viewport does or could show this view reference.

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 viewport could show this view reference

Inherited from​

Viewport.isReferenceViewable

Defined in​

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


postrender()​

postrender(): void

Returns​

void

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:666


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​

Viewport.removeActors

Defined in​

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


removeAllActors()​

removeAllActors(): void

Remove all actors from the renderer

Returns​

void

Inherited from​

Viewport.removeAllActors

Defined in​

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


removeWidgets()​

removeWidgets(): void

Returns​

void

Inherited from​

Viewport.removeWidgets

Defined in​

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


render()​

render(): void

Renders the Viewport using the RenderingEngine.

Returns​

void

Inherited from​

Viewport.render

Defined in​

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


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​

Viewport.reset

Defined in​

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


resetCamera()​

resetCamera(): boolean

Resets the camera based on the rendering volume(s) 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.

Returns​

boolean

boolean

Overrides​

Viewport.resetCamera

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:439


resetCameraNoEvent()​

protected resetCameraNoEvent(): void

Reset the camera to the default viewport camera without firing events

Returns​

void

Inherited from​

Viewport.resetCameraNoEvent

Defined in​

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


resetProperties()​

resetProperties(): void

resetProperties resets the properties of the viewport to the default values. It is called by the resetViewer command in OHIF which is called when using the reset toolbar button.

Returns​

void

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:246


resize()​

resize(): void

Returns​

void

Overrides​

Viewport.resize

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:470


scroll()​

scroll(delta): void

Scrolls the image - for WSI, this changes the zoom ratio since different images are used to represent different zoom levels, although this also allows fractional zoom levels

Parameters​

• delta: number

Returns​

void

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:681


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​

Viewport.setActors

Defined in​

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


setAverageWhite()​

setAverageWhite(averageWhite): void

Parameters​

• averageWhite: [number, number, number]

Returns​

void

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:275


setCamera()​

setCamera(camera): void

Set the camera parameters

Parameters​

• camera: ICamera

Returns​

void

Overrides​

Viewport.setCamera

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:376


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​

Viewport.setCameraNoEvent

Defined in​

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


setColorTransform()​

protected setColorTransform(voiRange, averageWhite): any

This applies a color transform as an svg filter to the output image.

Parameters​

• voiRange: any

• averageWhite: any

Returns​

any

Inherited from​

Viewport.setColorTransform

Defined in​

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


setDataIds()​

setDataIds(imageIds, options?): Promise<void>

This is a wrapper for setWSI to allow generic behaviour

Parameters​

• imageIds: string[]

• options?: ImageSetOptions & object

Returns​

Promise<void>

Overrides​

Viewport.setDataIds

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:567


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​

Viewport.setDisplayArea

Defined in​

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


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​

Viewport.setDisplayAreaFit

Defined in​

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


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​

Viewport.setDisplayAreaScale

Defined in​

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


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​

Viewport.setFitToCanvasCamera

Defined in​

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


setFrameNumber()​

setFrameNumber(frame): Promise<void>

Parameters​

• frame: number

Returns​

Promise<void>

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:225


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​

Viewport.setInitialCamera

Defined in​

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


setInterpolationType()​

protected setInterpolationType(_interpolationType, _arg?): void

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

Parameters​

• _interpolationType: InterpolationType

• _arg?: any

Returns​

void

Inherited from​

Viewport.setInterpolationType

Defined in​

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


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​

Viewport.setOptions

Defined in​

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


setOrientationOfClippingPlanes()​

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

Parameters​

• vtkPlanes: vtkPlane[]

• slabThickness: number

• viewPlaneNormal: Point3

• focalPoint: Point3

Returns​

void

Inherited from​

Viewport.setOrientationOfClippingPlanes

Defined in​

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


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​

Viewport.setPan

Defined in​

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


setProperties()​

setProperties(props): void

Parameters​

• props: ViewportProperties

Returns​

void

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:229


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​

Viewport.setRendered

Defined in​

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


setRotation()​

protected setRotation(_rotation): void

Parameters​

• _rotation: number

Returns​

void

Inherited from​

Viewport.setRotation

Defined in​

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


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​

Viewport.setViewPresentation

Defined in​

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


setViewReference()​

setViewReference(viewRef): void

Navigates to the image specified by the viewRef.

Parameters​

• viewRef: ViewReference

Returns​

void

Inherited from​

Viewport.setViewReference

Defined in​

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


setVOI()​

setVOI(voiRange): void

setVOI sets the window level and window width for the image. This is used to set the contrast and brightness of the image. feFilter is an inline string value for the CSS filter on the openLayers CSS filters can reference SVG filters, so for the typical use case here the CSS filter is actually an link link to a SVG filter. the WSI viewport has two openlayers canvases; one for the main display and one for the map overlay on the bottom left corner.

Parameters​

• voiRange: VOIRange

Returns​

void

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:264


setWSI()​

setWSI(imageIds, client): Promise<void>

Parameters​

• imageIds: string[]

• client: any

Returns​

Promise<void>

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:590


setZoom()​

setZoom(zoom): void

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

Parameters​

• zoom: number

Returns​

void

Overrides​

Viewport.setZoom

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:779


triggerCameraModifiedEventIfNecessary()​

triggerCameraModifiedEventIfNecessary(previousCamera, updatedCamera): void

Trigger camera modified event

Parameters​

• previousCamera: ICamera

• updatedCamera: ICamera

Returns​

void

Inherited from​

Viewport.triggerCameraModifiedEventIfNecessary

Defined in​

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


updateCameraClippingPlanesAndRange()​

updateCameraClippingPlanesAndRange(): void

Updates the camera's clipping planes and range.

Returns​

void

Inherited from​

Viewport.updateCameraClippingPlanesAndRange

Defined in​

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


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​

Viewport.updateClippingPlanesForActors

Defined in​

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


worldToCanvas()​

worldToCanvas(worldPos): Point2

Converts and [x,y] video coordinate to a Cornerstone3D VideoViewport.

Parameters​

• worldPos: Point3

world coord to convert to canvas

Returns​

Point2

Canvas position

Overrides​

Viewport.worldToCanvas

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:552


worldToIndex()​

worldToIndex(point): Point3

Parameters​

• point: Point3

Returns​

Point3

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:515


worldToIndexWSI()​

worldToIndexWSI(point): Point2

Converts a slide coordinate to a image coordinate using WSI utils functions

Parameters​

• point: Point3

Returns​

Point2

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:487


addMiniNavigationOverlayCss()​

static addMiniNavigationOverlayCss(): void

Returns​

void

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:827


boundsRadius()​

static boundsRadius(bounds): number

Computes the bounds radius value

Parameters​

• bounds: number[]

Returns​

number

Inherited from​

Viewport.boundsRadius

Defined in​

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


getDicomMicroscopyViewer()​

static getDicomMicroscopyViewer(): Promise<any>

Encapsulate the dicom microscopy fetch so that it can be replaced with the browser import function. Webpack munges this and then throws exceptions trying to get this working, so this has to be provided externally as a globalThis.browserImportFunction taking the package name, and a set of options defining how to get the value out of the package.

Returns​

Promise<any>

Defined in​

packages/core/src/RenderingEngine/WSIViewport.ts:458