Class: VideoViewport
An object representing a single stack viewport, which is a camera
looking into an internal scene, and an associated target output canvas.
Extends
Constructors
new VideoViewport()
new VideoViewport(
props):VideoViewport
Parameters
• props: VideoViewportInput
Returns
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:121
Properties
_actors
_actors:
Map<string,ActorEntry>
a Map containing the actor uid and actors
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:135
_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:141
calibration
protectedcalibration:IImageCalibration
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:145
canvas
readonlycanvas:HTMLCanvasElement
an internal canvas that is created on the provided HTML element
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:97
canvasContext
readonlycanvasContext:CanvasRenderingContext2D
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:59
defaultOptions
readonlydefaultOptions:ViewportInputOptions
Default options for the viewport which includes orientation, viewPlaneNormal and backgroundColor
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:137
element
readonlyelement:HTMLDivElement
HTML element in DOM that is used for rendering the viewport
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:95
fitToCanvasCamera
protectedfitToCanvasCamera:ICamera<number>
The camera that is defined for resetting displayArea to ensure absolute displayArea settings
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:153
flipHorizontal
protectedflipHorizontal:boolean=false
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:118
flipVertical
protectedflipVertical:boolean=false
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:119
hasPixelSpacing
protectedhasPixelSpacing:boolean=true
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:144
id
readonlyid:string
unique identifier for the viewport
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:93
imageId
protectedimageId:string
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:56
initialCamera
protectedinitialCamera:ICamera<number>
The camera that is initially defined on the reset for the relative pan/zoom
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:149
insetImageMultiplier
protectedinsetImageMultiplier:number
The amount by which the images are inset in a viewport by default.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:113
isDisabled
isDisabled:
boolean
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:120
metadata
protectedmetadata:any
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:83
modality
modality:
any
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:54
options
options:
ViewportInputOptions
options for the viewport which includes orientation axis, backgroundColor and displayArea
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:139
renderingEngineId
readonlyrenderingEngineId:string
RenderingEngine id that the viewport belongs to
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:58
requestedType?
optionalrequestedType:ViewportType
The viewport type originally requested by the caller, before any internal
compatibility remap (e.g. STACK/ORTHOGRAPHIC requested as PLANAR_NEXT when
rendering.useGenericViewport is enabled). Equals type when not remapped.
Set by the rendering engine at creation. Use this when branching on the
legacy viewport type so the branch is transparent across compat adapters.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:109
sHeight
sHeight:
number
sHeight of viewport on the offscreen canvas
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:133
suppressEvents
readonlysuppressEvents:boolean
A flag representing if viewport methods should fire events or not
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:143
sWidth
sWidth:
number
sWidth of viewport on the offscreen canvas
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:131
sx
sx:
number
sx of viewport on the offscreen canvas
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:127
sy
sy:
number
sy of viewport on the offscreen canvas
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:129
type
readonlytype:ViewportType
Type of viewport
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:101
uid
readonlyuid:any
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:57
updateRenderingPipeline()
updateRenderingPipeline: () =>
void
Returns
void
Inherited from
Viewport.updateRenderingPipeline
Defined in
packages/core/src/RenderingEngine/Viewport.ts:188
useCustomRenderingPipeline
useCustomRenderingPipeline:
boolean=true
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:616
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:124
CameraViewPresentation
readonlystaticCameraViewPresentation: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:73
frameRangeExtractor
staticframeRangeExtractor:RegExp
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:52
TransferViewPresentation
readonlystaticTransferViewPresentation: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:87
Accessors
useCustomRenderingPipeline
getstaticuseCustomRenderingPipeline():boolean
Returns
boolean
Overrides
Viewport.useCustomRenderingPipeline
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:145
Methods
_getCorners()
_getCorners(
bounds):number[][]
Parameters
• bounds: number[]
Returns
number[][]
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:2273
_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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:2369
_getFocalPointForResetCamera()
_getFocalPointForResetCamera(
centeredFocalPoint,previousCamera,__namedParameters):Point3
Parameters
• centeredFocalPoint: Point3
• previousCamera: ICamera<number>
• __namedParameters
• __namedParameters.resetPan: boolean = true
• __namedParameters.resetToCenter: boolean = true
Returns
Inherited from
Viewport._getFocalPointForResetCamera
Defined in
packages/core/src/RenderingEngine/Viewport.ts:2286
_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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:2346
_removeActor()
_removeActor(
actorUID):ActorEntry
Remove the actor from the viewport
Parameters
• actorUID: string
The unique identifier for the actor.
Returns
The removed actor entry or undefined if it didn't exist
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:650
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:745
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:696
addImages()
addImages(
stackInputs):void
Parameters
• stackInputs: IStackInput[]
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:1079
addWidget()
addWidget(
widgetId,widget):void
Parameters
• widgetId: any
• widget: any
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:234
canvasToIndex()
protectedcanvasToIndex(canvasPos):Point2
Uses the transform to convert canvas coordinates into index coordinates.
Parameters
• canvasPos: Point2
Returns
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:974
canvasToWorld()
canvasToWorld(
canvasPos,destPos):Point3
Converts a VideoViewport canvas coordinate to a video coordinate.
Parameters
• canvasPos: Point2
to convert to world
• destPos: Point3 = ...
Returns
World position
Overrides
Viewport.canvasToWorld
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:918
createActorMapper()
protectedcreateActorMapper(image):CanvasActor
Parameters
• image: any
Returns
CanvasActor
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:1100
customRenderViewportToCanvas()
customRenderViewportToCanvas():
void
Returns
void
Overrides
Viewport.customRenderViewportToCanvas
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:1029
destroy()
destroy():
void
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:276
dispose()
dispose():
void
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:271
end()
end():
Promise<void>
Returns
Promise<void>
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:353
flip()
protectedflip(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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:419
getActor()
getActor(
actorUID):ActorEntry
Get an actor by its UID
Parameters
• actorUID: string
The unique ID of the actor.
Returns
An ActorEntry object.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:579
getActorByIndex()
getActorByIndex(
index):ActorEntry
Get an actor by its index
Parameters
• index: number
array index.
Returns
actorUID
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:622
getActors()
getActors():
ActorEntry[]
Get all the actors in the viewport
Returns
An array of ActorEntry objects.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:562
getActorUIDByIndex()
getActorUIDByIndex(
index):string
Get an actor UID by its index
Parameters
• index: number
array index.
Returns
string
actorUID
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:610
getActorUIDs()
getActorUIDs():
string[]
Returns an array of unique identifiers for all the actors in the viewport.
Returns
string[]
An array of strings
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:570
getAspectRatio()
getAspectRatio():
Point2
Returns the current aspect ratio of the viewport as a 2D point [widthRatio, heightRatio].
Returns
The current aspect ratio [widthRatio, heightRatio]
based on the active camera settings.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1451
getCamera()
getCamera():
ICamera<number>
Get the camera's current state
Returns
ICamera<number>
The camera object.
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:843
getCameraNoRotation()
protectedgetCameraNoRotation():ICamera<number>
Returns
ICamera<number>
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1560
getCanvas()
getCanvas():
HTMLCanvasElement
Gets the target output canvas for the Viewport.
Returns
HTMLCanvasElement
an HTMLCanvasElement.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1541
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:1958
getCurrentImageId()
getCurrentImageId(
index):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.
Parameters
• index: number = ...
Returns
string
an imageID for video
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:712
getCurrentImageIdIndex()
getCurrentImageIdIndex():
number
Returns
number
Overrides
Viewport.getCurrentImageIdIndex
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:835
getDefaultActor()
getDefaultActor():
ActorEntry
Get the default actor
Returns
An actor entry.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:554
getDisplayArea()
getDisplayArea():
DisplayArea
Returns
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1103
getFrameNumber()
getFrameNumber():
number
Gets the 1 based frame number (ala DICOM value), eg 1+ currentImageIdIndex
Returns
number
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:830
getFrameOfReferenceUID()
getFrameOfReferenceUID():
string
Returns
string
Overrides
Viewport.getFrameOfReferenceUID
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:889
getFrameRange()
getFrameRange(): [
number,number]
Returns
[number, number]
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:436
getFrameRate()
getFrameRate():
number
Returns
number
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:885
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:589
getImageData()
getImageData():
IImageData|CPUIImageData
Returns
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:538
getImageDataMetadata()
getImageDataMetadata(
image):VideoImageMetadata
Parameters
• image: string | IImage
Returns
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:168
getImageIds()
getImageIds():
string[]
Gets all the image ids associated with this video element. This will have # of frames elements.
Returns
string[]
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:272
getMiddleSliceData()
getMiddleSliceData():
never
Returns
never
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:612
getNumberOfSlices()
getNumberOfSlices():
number
Returns
number
Overrides
Viewport.getNumberOfSlices
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:878
getPan()
getPan():
Point2
Helper function to return the current canvas pan value.
Returns
a Point2 containing the current pan values on the canvas, computed from the current camera, where the initial pan value is [0,0].
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:964
getProperties()
getProperties():
VideoViewportProperties
Returns
Overrides
Viewport.getProperties
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:486
getRenderer()
getRenderer():
vtkRenderer
Returns the vtkRenderer responsible for rendering the Viewport.
Returns
vtkRenderer
The vtkRenderer for the Viewport.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:346
getRenderingEngine()
getRenderingEngine():
RenderingEngine
Returns the rendering engine driving the Viewport.
Returns
The RenderingEngine instance.
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:337
getRenderPasses()
getRenderPasses():
any
Get render passes for this viewport. Viewports can override this to provide custom render passes (e.g., for sharpening).
Returns
any
Array of VTK render passes or null if no custom passes are needed
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:251
getRotation()
getRotation():
number
Returns
number
Overrides
Viewport.getRotation
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:969
getScalarData()
protectedgetScalarData():CanvasScalarData
Returns
CanvasScalarData
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:507
getSliceIndex()
getSliceIndex():
number
Returns
number
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:839
getSliceIndexForImage()
getSliceIndexForImage(
reference):number
Parameters
• reference: string | ViewReference
Returns
number
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:423
getSliceViewInfo()
getSliceViewInfo():
object
Returns
object
height
height:
number
indexToSliceMatrix
indexToSliceMatrix:
mat4
sliceIndex
sliceIndex:
number
slicePlane
slicePlane:
number
sliceToIndexMatrix
sliceToIndexMatrix:
mat4
width
width:
number
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:389
getTransform()
protectedgetTransform():Transform
Creates a transform from video index coordinates to canvas coordinates.
Returns
Transform
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:1036
getUseCustomRenderingPipeline()
getUseCustomRenderingPipeline():
boolean
Returns
boolean
Inherited from
Viewport.getUseCustomRenderingPipeline
Defined in
packages/core/src/RenderingEngine/Viewport.ts:198
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
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:2168
getViewReference()
getViewReference(
viewRefSpecifier?):ViewReference
Gets a view target that species what type of view is required to show the current view, or the one specified in the forTarget modifiers.
Parameters
• viewRefSpecifier?: ViewReferenceSpecifier
Returns
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:802
getViewReferenceId()
getViewReferenceId(
specifier):string
Gets a target id that can be used to specify how to show this
Parameters
• specifier: ViewReferenceSpecifier = {}
Returns
string
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:720
getVtkActiveCamera()
protectedgetVtkActiveCamera():vtkCamera|vtkSlabCamera
Gets the active vtkCamera for the viewport.
Returns
vtkCamera | vtkSlabCamera
vtk driven camera
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1549
getWidget()
getWidget(
id):any
Parameters
• id: any
Returns
any
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:238
getWidgets()
getWidgets():
any[]
Returns
any[]
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:242
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<number> = ...
Returns
number
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1412
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/VideoViewport.ts:635
indexToCanvas()
protectedindexToCanvas(indexPos):Point2
Parameters
• indexPos: Point2
Returns
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:983
isOrientationChangeable()
isOrientationChangeable():
boolean
Returns whether the viewport supports changing orientation (e.g. via setCamera with viewPlaneNormal/viewUp). Used by tools like OrientationControllerTool to decide where to show interactive orientation markers.
Returns
boolean
Inherited from
Viewport.isOrientationChangeable
Defined in
packages/core/src/RenderingEngine/Viewport.ts:227
isPlaneViewable()
isPlaneViewable(
planeRestriction,options?):boolean
Parameters
• planeRestriction: PlaneRestriction
• options?: ReferenceCompatibleOptions
Returns
boolean
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:2074
isReferenceViewable()
isReferenceViewable(
viewRef,options):boolean
Figure out if a given view can be shown in the current viewport.
Parameters
• viewRef: ViewReference
• options: ReferenceCompatibleOptions = {}
Returns
boolean
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:741
pause()
pause():
void
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:305
play()
play():
Promise<void>
Returns
Promise<void>
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:291
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:671
removeAllActors()
removeAllActors():
void
Remove all actors from the renderer
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:785
removeWidgets()
removeWidgets():
void
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:255
render()
render():
void
Renders the Viewport using the RenderingEngine.
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:359
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:389
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
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:866
resetCameraNoEvent()
protectedresetCameraNoEvent():void
Reset the camera to the default viewport camera without firing events
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:804
resetProperties()
resetProperties():
void
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:496
resize()
resize():
void
Returns
void
Overrides
Viewport.resize
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:894
resizeForRenderingEngine()
resizeForRenderingEngine(
__namedParameters):void
RenderingEngine-owned resize hook for custom-pipeline viewports. Legacy viewports keep the previous camera-preserving behavior by default.
Parameters
• __namedParameters: RenderingEngineResizeOptions = {}
Returns
void
Inherited from
Viewport.resizeForRenderingEngine
Defined in
packages/core/src/RenderingEngine/Viewport.ts:206
scroll()
scroll(
delta):Promise<void>
Parameters
• delta: number = 1
Returns
Promise<void>
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:314
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:630
setAspectRatio()
setAspectRatio(
value,isFitViewportAfterStretch,storeAsInitialCamera):void
Sets the aspect ratio of the viewport (canvas) using the provided 2D point
[widthRatio, heightRatio].
This updates the VTK camera's projection matrix to apply axis-based stretching during rendering.
As a result:
- World-to-canvas mapping is updated via the camera projection.
- Canvas-to-world mapping is also updated and remains consistent, as VTK utilizes the inverse of the same projection matrix for picking and coordinate transformations.
Note:
- The camera pose and orientation (position, focal point, and viewPlaneNormal) remain unchanged.
- Image data, spacing, and world coordinates are not modified.
Parameters
• value: Point2
The aspect ratio to set as [widthRatio, heightRatio].
• isFitViewportAfterStretch: boolean = true
• storeAsInitialCamera: boolean = false
Whether to store the updated camera state as the initial camera.
Defaults to false.
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1478
setAverageWhite()
setAverageWhite(
averageWhite):void
Parameters
• averageWhite: [number, number, number]
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:657
setCamera()
setCamera(
camera):void
Set the camera parameters
Parameters
• camera: ICamera<number>
Returns
void
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:662
setCameraNoEvent()
protectedsetCameraNoEvent(camera):void
Sets the camera to the default viewport camera without firing events
Parameters
• camera: ICamera<number>
The camera to use for the viewport.
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:815
setColorTransform()
protectedsetColorTransform(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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:307
setDataIds()
setDataIds(
imageIds,options?):void
This is a wrapper for setVideo to allow generic behaviour
Parameters
• imageIds: string[]
a singleton list containing the imageId of a video.
• options?: ImageSetOptions
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:182
setDataList()
setDataList(
entries):Promise<unknown>
GenericViewport compat shim – delegates to setVideo.
Parameters
• entries: object[]
Returns
Promise<unknown>
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:190
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:885
setDisplayAreaFit()
protectedsetDisplayAreaFit(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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1022
setDisplayAreaScale()
protectedsetDisplayAreaScale(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
< 1mean smaller than physical, while values> 1mean more than one pixel. Default is 1 Suggest using whole numbers or integer fractions (eg1/3)
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:949
setFitToCanvasCamera()
protectedsetFitToCanvasCamera(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<number>
to store as the initial value.
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1317
setFrameNumber()
setFrameNumber(
frame):Promise<void>
Parameters
• frame: number
Returns
Promise<void>
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:401
setFrameRange()
setFrameRange(
frameRange):void
Sets the playback frame range. The video will play over the given set of frames (assuming it is playing).
Parameters
• frameRange: number[]
the minimum to maximum (inclusive) frames to play over
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:412
setInitialCamera()
protectedsetInitialCamera(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<number>
to store as the initial value.
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1307
setInterpolationType()
protectedsetInterpolationType(_interpolationType,_arg?):void
Sets the interpolation type. No-op in the base.
Parameters
• _interpolationType: InterpolationType
• _arg?: any
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:873
setNeedsRender()
setNeedsRender():
void
Mark the viewport as needing a render pass (e.g. after external display-set / segmentation updates). Does not queue a render; the rendering engine’s normal RAF cycle will pick this up.
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:300
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:371
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:1921
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1378
setPlaybackRate()
setPlaybackRate(
rate):void
Parameters
• rate: number = 1
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:462
setProperties()
setProperties(
props):void
Parameters
• props: VideoViewportProperties
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:440
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:286
setRotation()
protectedsetRotation(_rotation):void
Parameters
• _rotation: number
Returns
void
Inherited from
Defined in
packages/core/src/RenderingEngine/Viewport.ts:190
setScrollSpeed()
setScrollSpeed(
scrollSpeed,unit):void
Parameters
• scrollSpeed: number = 1
• unit: SpeedUnit = VideoViewportEnum.SpeedUnit.FRAME
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:476
setTime()
setTime(
timeInSeconds):Promise<void>
Parameters
• timeInSeconds: number
Returns
Promise<void>
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:371
setVideo()
setVideo(
imageId,frameNumber?):Promise<unknown>
Sets the video image id to show and hte frame number. Requirements are to have the imageUrlModule in the metadata with the rendered endpoint being the raw video in video/mp4 format.
Parameters
• imageId: string
• frameNumber?: number
Returns
Promise<unknown>
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:204
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:2232
setViewReference()
setViewReference(
viewRef):void
Navigates the video to the specific view reference
Parameters
• viewRef: ViewReference
Returns
void
Overrides
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:790
setVOI()
setVOI(
voiRange):void
Parameters
• voiRange: VOIRange
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:644
setWindowLevel()
setWindowLevel(
windowWidth,windowCenter):void
Parameters
• windowWidth: number = 256
• windowCenter: number = 128
Returns
void
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:650
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
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1429
start()
start():
Promise<void>
Returns
Promise<void>
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:335
togglePlayPause()
togglePlayPause():
boolean
Returns
boolean
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:281
triggerCameraModifiedEventIfNecessary()
triggerCameraModifiedEventIfNecessary(
previousCamera,updatedCamera):void
Trigger camera modified event
Parameters
• previousCamera: ICamera<number>
• updatedCamera: ICamera<number>
Returns
void
Inherited from
Viewport.triggerCameraModifiedEventIfNecessary
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1843
updateCameraClippingPlanesAndRange()
updateCameraClippingPlanesAndRange():
void
Nothing to do for the clipping planes for video as they don't exist.
Returns
void
Overrides
Viewport.updateCameraClippingPlanesAndRange
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:1075
updateClippingPlanesForActors()
protectedupdateClippingPlanesForActors(updatedCamera):Promise<void>
Updates the actors clipping planes orientation from the camera properties
Parameters
• updatedCamera: ICamera<number>
ICamera
Returns
Promise<void>
Inherited from
Viewport.updateClippingPlanesForActors
Defined in
packages/core/src/RenderingEngine/Viewport.ts:1873
worldToCanvas()
worldToCanvas(
worldPos):Point2
Converts [x, y, 0] world video coordinate to canvas CSS coordinates.
Parameters
• worldPos: Point3
world coord to convert to canvas
Returns
Canvas position
Overrides
Viewport.worldToCanvas
Defined in
packages/core/src/RenderingEngine/VideoViewport.ts:952
boundsRadius()
staticboundsRadius(bounds):number
Computes the bounds radius value
Parameters
• bounds: number[]
Returns
number