Skip to main content

Types

Index

Namespaces

Classes

Interfaces

Type Aliases

Namespaces

EventTypes

EventTypes:

CameraModifiedEvent

CameraModifiedEvent: CustomEventType<CameraModifiedEventDetail>

CameraModified Event type

CameraModifiedEventDetail

CameraModifiedEventDetail: { camera: ICamera; element: HTMLDivElement; previousCamera: ICamera; renderingEngineId: string; rotation?: number; viewportId: string }

CAMERA_MODIFIED Event’s data


Type declaration

  • camera: ICamera

    Current camera properties

  • element: HTMLDivElement

    Viewport HTML element in the DOM

  • previousCamera: ICamera

    Previous camera properties

  • renderingEngineId: string

    Unique ID for the renderingEngine

  • optionalrotation?: number

    Rotation Optional

  • viewportId: string

    Viewport Unique ID in the renderingEngine

CameraResetEvent

CameraResetEvent: CustomEventType<CameraResetEventDetail>

CameraResetEventDetail

CameraResetEventDetail: { camera: ICamera; element: HTMLDivElement; renderingEngineId: string; viewportId: string }

CAMERA_RESET Event’s data


Type declaration

  • camera: ICamera

    Camera properties

  • element: HTMLDivElement

    Viewport HTML element in the DOM

  • renderingEngineId: string

    Unique ID for the renderingEngine

  • viewportId: string

    Viewport Unique ID in the renderingEngine

ColormapModifiedEvent

ColormapModifiedEvent: CustomEventType<ColormapModifiedEventDetail>

COLORMAP_MODIFIED Event type

ColormapModifiedEventDetail

ColormapModifiedEventDetail: { colormap: ColormapPublic; viewportId: string; volumeId?: string }

Type declaration

  • colormap: ColormapPublic

    The new colormap

  • viewportId: string

    Viewport Unique ID in the renderingEngine

  • optionalvolumeId?: string

    Unique ID for the volume in the cache

DisplayAreaModifiedEvent

DisplayAreaModifiedEvent: CustomEventType<DisplayAreaModifiedEventDetail>

DISPLAY_AREA_MODIFIED Event type

DisplayAreaModifiedEventDetail

DisplayAreaModifiedEventDetail: { displayArea: DisplayArea; storeAsInitialCamera?: boolean; viewportId: string; volumeId?: string }

DISPLAY_AREA_MODIFIED Event’s data


Type declaration

  • displayArea: DisplayArea

    new display area

  • optionalstoreAsInitialCamera?: boolean

    Whether displayArea was stored as initial view

  • viewportId: string

    Viewport Unique ID in the renderingEngine

  • optionalvolumeId?: string

    Unique ID for the volume in the cache

ElementDisabledEvent

ElementDisabledEvent: CustomEventType<ElementDisabledEventDetail>

ELEMENT_DISABLED Event type

ElementDisabledEventDetail

ElementDisabledEventDetail: { element: HTMLDivElement; renderingEngineId: string; viewportId: string }

ELEMENT_DISABLED Event’s data


Type declaration

  • element: HTMLDivElement

    Viewport HTML element in the DOM

  • renderingEngineId: string

    Unique ID for the renderingEngine

  • viewportId: string

    Viewport Unique ID in the renderingEngine

ElementEnabledEvent

ElementEnabledEvent: CustomEventType<ElementEnabledEventDetail>

ELEMENT_ENABLED Event type

ElementEnabledEventDetail

ElementEnabledEventDetail: { element: HTMLDivElement; renderingEngineId: string; viewportId: string }

ELEMENT_Enabled Event’s data


Type declaration

  • element: HTMLDivElement

    Viewport HTML element in the DOM

  • renderingEngineId: string

    Unique ID for the renderingEngine

  • viewportId: string

    Viewport Unique ID in the renderingEngine

ImageCacheImageAddedEvent

ImageCacheImageAddedEvent: CustomEventType<ImageCacheImageAddedEventDetail>

IMAGE_CACHE_IMAGE_ADDED Event type

ImageCacheImageAddedEventDetail

ImageCacheImageAddedEventDetail: { image: ICachedImage }

IMAGE_CACHE_IMAGE_ADDED Event’s data


Type declaration

ImageCacheImageRemovedEvent

ImageCacheImageRemovedEvent: CustomEventType<ImageCacheImageRemovedEventDetail>

IMAGE_CACHE_IMAGE_REMOVED Event type

ImageCacheImageRemovedEventDetail

ImageCacheImageRemovedEventDetail: { imageId: string }

IMAGE_CACHE_IMAGE_REMOVED Event’s data


Type declaration

  • imageId: string

    the removed image id

ImageLoadStageEventDetail

ImageLoadStageEventDetail: { numberOfFailures: number; numberOfImages: number; stageDurationInMS: number; stageId: string; startDurationInMS: number }

Type declaration

  • numberOfFailures: number
  • numberOfImages: number
  • stageDurationInMS: number
  • stageId: string
  • startDurationInMS: number

ImageLoadedEvent

ImageLoadedEvent: CustomEventType<ImageLoadedEventDetail>

IMAGE_LOADED Event type

ImageLoadedEventDetail

ImageLoadedEventDetail: { image: IImage }

IMAGE_LOADED Event’s data


Type declaration

ImageLoadedFailedEvent

ImageLoadedFailedEvent: CustomEventType<ImageLoadedFailedEventDetail>

IMAGE_LOADED_FAILED Event type

ImageLoadedFailedEventDetail

ImageLoadedFailedEventDetail: { error: unknown; imageId: string }

IMAGE_LOADED_FAILED Event’s data


Type declaration

  • error: unknown
  • imageId: string

    the imageId for the image

ImageRenderedEvent

ImageRenderedEvent: CustomEventType<ElementEnabledEventDetail>

IMAGE_RENDERED Event type

ImageRenderedEventDetail

ImageRenderedEventDetail: { element: HTMLDivElement; renderingEngineId: string; suppressEvents?: boolean; viewportId: string; viewportStatus: ViewportStatus }

IMAGE_RENDERED Event’s data


Type declaration

  • element: HTMLDivElement

    Viewport HTML element in the DOM

  • renderingEngineId: string

    Unique ID for the renderingEngine

  • optionalsuppressEvents?: boolean

    Whether to suppress the event

  • viewportId: string

    Viewport Unique ID in the renderingEngine

  • viewportStatus: ViewportStatus

    Include information on whether this is a real rendering or just background

ImageSpacingCalibratedEvent

ImageSpacingCalibratedEvent: CustomEventType<ImageSpacingCalibratedEventDetail>

IMAGE_SPACING_CALIBRATED

ImageSpacingCalibratedEventDetail

ImageSpacingCalibratedEventDetail: { calibration: IImageCalibration; element: HTMLDivElement; imageData: vtkImageData; imageId: string; renderingEngineId: string; viewportId: string; worldToIndex: mat4 }

IMAGE_SPACING_CALIBRATED Event’s data


Type declaration

  • calibration: IImageCalibration

    calibration contains the scaling information as well as other calibration info

  • element: HTMLDivElement
  • imageData: vtkImageData
  • imageId: string
  • renderingEngineId: string
  • viewportId: string
  • worldToIndex: mat4

ImageVolumeLoadingCompletedEvent

ImageVolumeLoadingCompletedEvent: CustomEventType<ImageVolumeLoadingCompletedEventDetail>

IMAGE_VOLUME_LOADING_COMPLETED Event type This event is fired when a volume is fully loaded, means all the frames are loaded and cached.

ImageVolumeLoadingCompletedEventDetail

ImageVolumeLoadingCompletedEventDetail: { FrameOfReferenceUID: string; volumeId: string }

IMAGE_VOLUME_LOADING_COMPLETED Event’s data


Type declaration

  • FrameOfReferenceUID: string

    FrameOfReferenceUID where the volume belongs to

  • volumeId: string

    the loaded volume

ImageVolumeModifiedEvent

ImageVolumeModifiedEvent: CustomEventType<ImageVolumeModifiedEventDetail>

IMAGE_VOLUME_MODIFIED Event type

ImageVolumeModifiedEventDetail

ImageVolumeModifiedEventDetail: { FrameOfReferenceUID: string; framesProcessed: number; imageVolume: IImageVolume; numberOfFrames: number }

IMAGE_VOLUME_MODIFIED Event’s data


Type declaration

  • FrameOfReferenceUID: string

    FrameOfReferenceUID where the volume belongs to

  • framesProcessed: number

    framesProcessed

  • imageVolume: IImageVolume

    the modified volume

  • numberOfFrames: number

    number of frames

PreStackNewImageEvent

PreStackNewImageEvent: CustomEventType<PreStackNewImageEventDetail>

START_NEW_IMAGE

PreStackNewImageEventDetail

PreStackNewImageEventDetail: { imageId: string; imageIdIndex: number; renderingEngineId: string; viewportId: string }

PRE_STACK_NEW_IMAGE Event’s data


Type declaration

  • imageId: string

    the image imageId

  • imageIdIndex: number

    the index of imageId in the stack

  • renderingEngineId: string

    unique id for the renderingEngine

  • viewportId: string

    unique id for the viewport

StackNewImageEvent

StackNewImageEvent: CustomEventType<StackNewImageEventDetail>

START_NEW_IMAGE

StackNewImageEventDetail

StackNewImageEventDetail: { image: IImage; imageId: string; imageIdIndex: number; renderingEngineId: string; viewportId: string }

STACK_NEW_IMAGE Event’s data


Type declaration

  • image: IImage

    the new image set on the stack viewport

  • imageId: string

    the image imageId

  • imageIdIndex: number

    the index of imageId in the stack

  • renderingEngineId: string

    unique id for the renderingEngine

  • viewportId: string

    unique id for the viewport

StackViewportNewStackEvent

StackViewportNewStackEvent: CustomEventType<StackViewportNewStackEventDetail>

STACK_VIEWPORT_NEW_STACK

StackViewportNewStackEventDetail

StackViewportNewStackEventDetail: { currentImageIdIndex: number; element: HTMLDivElement; imageIds: string[]; viewportId: string }

The STACK_VIEWPORT_NEW_STACK event’s data, when a new stack is set on a StackViewport


Type declaration

  • currentImageIdIndex: number
  • element: HTMLDivElement
  • imageIds: string[]
  • viewportId: string

StackViewportScrollEvent

StackViewportScrollEvent: CustomEventType<StackViewportScrollEventDetail>

StackViewportScrollEventDetail

StackViewportScrollEventDetail: { direction: number; imageId: string; newImageIdIndex: number }

Stack Scroll event detail


Type declaration

  • direction: number

    direction of the scroll

  • imageId: string

    the new imageId in the stack that we just scroll to

  • newImageIdIndex: number

    the new imageId index in the stack that we just scroll to

VoiModifiedEvent

VoiModifiedEvent: CustomEventType<VoiModifiedEventDetail>

VOI_MODIFIED Event type

VoiModifiedEventDetail

VoiModifiedEventDetail: { VOILUTFunction?: VOILUTFunctionType; colormap?: ColormapPublic; invert?: boolean; invertStateChanged?: boolean; range: VOIRange; viewportId: string; volumeId?: string }

VOI_MODIFIED Event’s data


Type declaration

  • optionalVOILUTFunction?: VOILUTFunctionType

    VOILUTFunction

  • optionalcolormap?: ColormapPublic

    color map

  • optionalinvert?: boolean

    inverted

  • optionalinvertStateChanged?: boolean

    Indicates if the ‘invert’ state has changed from the previous state

  • range: VOIRange

    new VOI range

  • viewportId: string

    Viewport Unique ID in the renderingEngine

  • optionalvolumeId?: string

    Unique ID for the volume in the cache

VolumeCacheVolumeAddedEvent

VolumeCacheVolumeAddedEvent: CustomEventType<VolumeCacheVolumeAddedEventDetail>

VOLUME_CACHE_VOLUME_ADDED Event type

VolumeCacheVolumeAddedEventDetail

VolumeCacheVolumeAddedEventDetail: { volume: ICachedVolume }

VOLUME_CACHE_VOLUME_ADDED Event’s data


Type declaration

VolumeCacheVolumeRemovedEvent

VolumeCacheVolumeRemovedEvent: CustomEventType<VolumeCacheVolumeRemovedEventDetail>

VOLUME_CACHE_VOLUME_REMOVED Event type

VolumeCacheVolumeRemovedEventDetail

VolumeCacheVolumeRemovedEventDetail: { volumeId: string }

VOLUME_CACHE_VOLUME_REMOVED Event’s data


Type declaration

  • volumeId: string

    the removed volume id

VolumeLoadedEvent

VolumeLoadedEvent: CustomEventType<VolumeLoadedEventDetail>

VOLUME_LOADED Event type

VolumeLoadedEventDetail

VolumeLoadedEventDetail: { volume: IImageVolume }

VOLUME_LOADED Event’s data


Type declaration

VolumeLoadedFailedEvent

VolumeLoadedFailedEvent: CustomEventType<VolumeLoadedFailedEventDetail>

VOLUME_LOADED_FAILED Event type

VolumeLoadedFailedEventDetail

VolumeLoadedFailedEventDetail: { error: unknown; volumeId: string }

VOLUME_LOADED_FAILED Event’s data


Type declaration

  • error: unknown
  • volumeId: string

    the volumeId for the volume

VolumeNewImageEvent

VolumeNewImageEvent: CustomEventType<VolumeNewImageEventDetail>

VOLUME_NEW_IMAGE

VolumeNewImageEventDetail

VolumeNewImageEventDetail: { imageIndex: number; numberOfSlices: number; renderingEngineId: string; viewportId: string }

VOLUME_NEW_IMAGE Event’s data


Type declaration

  • imageIndex: number

    image index

  • numberOfSlices: number

    number of slices

  • renderingEngineId: string

    unique id for the renderingEngine

  • viewportId: string

    unique id for the viewport

Classes

PointsManager

PointsManager<T>:

PointsManager handles Point type data contained in a TypedArray representation where all the point data is consecutive from start to end. That is, the organization is x0,y0,z0,x1,y1,z1,...,xn,yn,zn. This optimizes the storage costs for large arrays of data, while still providing access to the point data as though it were a simple array of objects.

This representation is efficient for storing large numbers of points and for transferring them amongst systems and is planned to have more methods added for generic manipulation of data.


Type parameters

  • T

constructor

  • new PointsManager<T>(configuration?: PolyDataPointConfiguration): default<T>
  • Type parameters

    • T

    Parameters

    • configuration: PolyDataPointConfiguration = {}

    Returns default<T>

_byteSize

_byteSize: number = 4

_dimensions

_dimensions: number = 3

_length

_length: number = 0

array

array: ArrayBuffer

data

data: Float32Array

growSize

growSize: number = 128

publickIndex

kIndex: number

Allow storage for an index value to indicate where this array is contained in terms of the index location.

publicsources

sources: default<T>[]

Sources data for this array. Just used for external access, not updated here.

publicdimensionLength

  • get dimensionLength(): number
  • Returns number

publicdimensions

  • get dimensions(): number
  • Returns number

publiclength

  • get length(): number
  • Returns number

publicpoints

  • get points(): T[]
  • A points object containing Float32Array instances referring to the underlying data, contained in a FloatArray32[] instance. Note - changes to the data store will directly affect the points value returned here, even if stored separately.


    Returns T[]

publicforEach

  • forEach(func: (value: T, index: number) => void): void
  • Parameters

    • func: (value: T, index: number) => void

    Returns void

publicgetPoint

  • getPoint(index: number): T
  • Returns a Float32Array view of the given point. Changes to the data in this point will affect the underlying data.


    Parameters

    • index: number

      positive index from start, or negative from end

    Returns T

    Float32Array view onto the point at the given index

publicgetPointArray

  • getPointArray(index: number): T
  • Returns a number[] version of the given point. Changes to the array will NOT affect the underlying data.


    Parameters

    • index: number

      positive index from start, or negative from end

    Returns T

    A new number[] instance of the given point.

publicmap

  • map<R>(f: (value: any, index: number) => R): R[]
  • Maps the array onto another type.


    Type parameters

    • R

    Parameters

    • f: (value: any, index: number) => R

    Returns R[]

publicpush

  • push(point: T): void
  • Push a new point onto this arrays object


    Parameters

    • point: T

    Returns void

publicreverse

  • reverse(): void
  • Reverse the points in place.


    Returns void

publicsubselect

  • subselect(count?: number, offset?: number): default<T>
  • Select the given number of points from the array, evenly spaced at the given offset (which must be between (-count,count))


    Parameters

    • count: number = 10
    • offset: number = 0

    Returns default<T>

publictoXYZ

  • The XYZ representation of a points array is an object with three separate arrays, one for each of x,y and z, containing the point data, eg x: {x0, x1, x2, ...., xn } Will create just x,y for Point2 arrays.


    Returns PointsXYZ

    An XYZ array

publicstaticcreate2

  • Create a PointsManager

    <Point2>
    instance with available capacity of initialSize


    Parameters

    • initialSize: number = 128

    Returns default<Point2>

publicstaticcreate3

  • Create a PointsManager

    <Point3>
    instance with available capacity of initialSize


    Parameters

    • initialSize: number = 128

    Returns default<Point3>

publicstaticfromXYZ

  • Create an PointsArray3 from the x,y,z individual arrays (see toXYZ) Will create a Point3 array even if z is missing, with 0 as the value.


    Parameters

    Returns default<Point3>

Interfaces

CPUFallbackColormap

CPUFallbackColormap:

addColor

addColor: (rgba: Point4) => void

Type declaration

buildLookupTable

buildLookupTable: (lut: CPUFallbackLookupTable) => void

Type declaration

clearColors

clearColors: () => void

Type declaration

    • (): void
    • Returns void

createLookupTable

createLookupTable: () => CPUFallbackLookupTable

getColor

getColor: (index: number) => Point4

Type declaration

    • Parameters

      • index: number

      Returns Point4

getColorRepeating

getColorRepeating: (index: number) => Point4

Type declaration

    • Parameters

      • index: number

      Returns Point4

getColorSchemeName

getColorSchemeName: () => string

Type declaration

    • (): string
    • Returns string

getId

getId: () => string

Type declaration

    • (): string
    • Get id of colormap


      Returns string

getNumberOfColors

getNumberOfColors: () => number

Type declaration

    • (): number
    • Returns number

insertColor

insertColor: (index: number, rgba: Point4) => void

Type declaration

    • (index: number, rgba: Point4): void
    • Parameters

      Returns void

isValidIndex

isValidIndex: (index: number) => boolean

Type declaration

    • (index: number): boolean
    • Parameters

      • index: number

      Returns boolean

removeColor

removeColor: (index: number) => void

Type declaration

    • (index: number): void
    • Parameters

      • index: number

      Returns void

setColor

setColor: (index: number, rgba: Point4) => void

Type declaration

    • (index: number, rgba: Point4): void
    • Parameters

      Returns void

setColorSchemeName

setColorSchemeName: (name: string) => void

Type declaration

    • (name: string): void
    • Parameters

      • name: string

      Returns void

setNumberOfColors

setNumberOfColors: (numColors: number) => void

Type declaration

    • (numColors: number): void
    • Parameters

      • numColors: number

      Returns void

CPUFallbackEnabledElement

CPUFallbackEnabledElement:

optionalcanvas

canvas?: HTMLCanvasElement

optionalcolormap

optionalimage

image?: IImage

optionalinvalid

invalid?: boolean

optionalmetadata

metadata?: { dimensions?: Point3; direction?: Mat3; imagePixelModule?: ImagePixelModule; imagePlaneModule?: ImagePlaneModule; origin?: Point3; spacing?: Point3 }

Type declaration

optionalneedsRedraw

needsRedraw?: boolean

optionaloptions

options?: { colormap?: CPUFallbackColormap }

Type declaration

optionalpan

pan?: Point2

optionalrenderingTools

renderingTools?: CPUFallbackRenderingTools

optionalrotation

rotation?: number

optionalscale

scale?: number

optionaltransform

optionalviewport

optionalzoom

zoom?: number

CPUFallbackLookupTable

CPUFallbackLookupTable:

build

build: (force: boolean) => void

Type declaration

    • (force: boolean): void
    • Parameters

      • force: boolean

      Returns void

getColor

getColor: (scalar: number) => Point4

Type declaration

    • Parameters

      • scalar: number

      Returns Point4

setAlphaRange

setAlphaRange: (start: number, end: number) => void

Type declaration

    • (start: number, end: number): void
    • Parameters

      • start: number
      • end: number

      Returns void

setHueRange

setHueRange: (start: number, end: number) => void

Type declaration

    • (start: number, end: number): void
    • Parameters

      • start: number
      • end: number

      Returns void

setNumberOfTableValues

setNumberOfTableValues: (number: number) => void

Type declaration

    • (number: number): void
    • Parameters

      • number: number

      Returns void

setRamp

setRamp: (ramp: string) => void

Type declaration

    • (ramp: string): void
    • Parameters

      • ramp: string

      Returns void

setRange

setRange: (start: number, end: number) => void

Type declaration

    • (start: number, end: number): void
    • Parameters

      • start: number
      • end: number

      Returns void

setSaturationRange

setSaturationRange: (start: number, end: number) => void

Type declaration

    • (start: number, end: number): void
    • Parameters

      • start: number
      • end: number

      Returns void

setTableRange

setTableRange: (start: number, end: number) => void

Type declaration

    • (start: number, end: number): void
    • Parameters

      • start: number
      • end: number

      Returns void

setValueRange

setValueRange: (start: number, end: number) => void

Type declaration

    • (start: number, end: number): void
    • Parameters

      • start: number
      • end: number

      Returns void

setTableValue

  • setTableValue(index: number, rgba: Point4): any
  • Parameters

    Returns any

CPUFallbackTransform

CPUFallbackTransform:

clone

Type declaration

getMatrix

getMatrix: () => TransformMatrix2D

Type declaration

invert

invert: () => void

Type declaration

    • (): void
    • Returns void

multiply

multiply: (matrix: TransformMatrix2D) => void

Type declaration

reset

reset: () => void

Type declaration

    • (): void
    • Returns void

rotate

rotate: (rad: number) => void

Type declaration

    • (rad: number): void
    • Parameters

      • rad: number

      Returns void

scale

scale: (sx: number, sy: number) => void

Type declaration

    • (sx: number, sy: number): void
    • Parameters

      • sx: number
      • sy: number

      Returns void

transformPoint

transformPoint: (point: Point2) => Point2

Type declaration

translate

translate: (x: number, y: number) => void

Type declaration

    • (x: number, y: number): void
    • Parameters

      • x: number
      • y: number

      Returns void

CustomEventType

CustomEventType<T>:

Type parameters

  • T = any

readonlydetail

detail: T

Returns any custom data event was created with. Typically used for synthetic events.

initCustomEvent

  • initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void
  • Parameters

    • typeArg: string
    • canBubbleArg: boolean
    • cancelableArg: boolean
    • detailArg: T

    Returns void

ICache

ICache:

getCacheSize

getCacheSize: () => number

Type declaration

    • (): number
    • Get the current cache size


      Returns number

getImageLoadObject

getImageLoadObject: (imageId: string) => void | IImageLoadObject

Type declaration

getMaxCacheSize

getMaxCacheSize: () => number

Type declaration

    • (): number
    • Get the maximum cache size


      Returns number

getVolumeLoadObject

getVolumeLoadObject: (volumeId: string) => void | IVolumeLoadObject

Type declaration

purgeCache

purgeCache: () => void

Type declaration

    • (): void
    • Purge cache both image and volume


      Returns void

putImageLoadObject

putImageLoadObject: (imageId: string, imageLoadObject: IImageLoadObject, updateCache?: boolean) => Promise<any>

Type declaration

    • (imageId: string, imageLoadObject: IImageLoadObject, updateCache?: boolean): Promise<any>
    • Stores the imageLoad Object inside the cache


      Parameters

      Returns Promise<any>

putVolumeLoadObject

putVolumeLoadObject: (volumeId: string, volumeLoadObject: IVolumeLoadObject) => Promise<any>

Type declaration

    • Stores the volumeLoad Object inside the cache


      Parameters

      Returns Promise<any>

setMaxCacheSize

setMaxCacheSize: (maxCacheSize: number) => void

Type declaration

    • (maxCacheSize: number): void
    • Set the maximum cache size


      Parameters

      • maxCacheSize: number

      Returns void

ICachedGeometry

ICachedGeometry:

optionalgeometry

geometry?: IGeometry

geometryId

geometryId: string

geometryLoadObject

geometryLoadObject: IGeometryLoadObject

loaded

loaded: boolean

sizeInBytes

sizeInBytes: number

timeStamp

timeStamp: number

ICachedImage

ICachedImage:

optionalimage

image?: IImage

imageId

imageId: string

imageLoadObject

imageLoadObject: IImageLoadObject

loaded

loaded: boolean

optionalsharedCacheKey

sharedCacheKey?: string

sizeInBytes

sizeInBytes: number

timeStamp

timeStamp: number

ICachedVolume

ICachedVolume:

loaded

loaded: boolean

sizeInBytes

sizeInBytes: number

timeStamp

timeStamp: number

optionalvolume

volume?: IImageVolume

volumeId

volumeId: string

volumeLoadObject

volumeLoadObject: IVolumeLoadObject

ICamera

ICamera:

Camera Interface. See https://kitware.github.io/vtk-examples/site/VTKBook/03Chapter3/#35-cameras if you want to know more about the camera.

optionalclippingRange

clippingRange?: Point2

clipping range

optionalflipHorizontal

flipHorizontal?: boolean

flip Horizontal

optionalflipVertical

flipVertical?: boolean

flip Vertical

optionalfocalPoint

focalPoint?: Point3

Camera Focal point

optionalparallelProjection

parallelProjection?: boolean

Camera Parallel Projection flag - whether camera is using parallel projection

optionalparallelScale

parallelScale?: number

Camera parallel scale - used for parallel projection zoom, smaller values zoom in

optionalposition

position?: Point3

Camera position

optionalscale

scale?: number

Scale factor for the camera, it is the ratio of how much an image pixel takes up one screen pixel

optionalviewAngle

viewAngle?: number

Camera view angle - 90 degrees is orthographic

optionalviewPlaneNormal

viewPlaneNormal?: Point3

Camera viewPlaneNormal - negative of the direction the camera is pointing or directionOfProjection

optionalviewUp

viewUp?: Point3

Camera viewUp - the direction of viewUP in camera

ICanvasActor

ICanvasActor:

getClassName

  • getClassName(): string
  • Returns string

getMapper

  • getMapper(): any
  • Returns any

getProperty

  • getProperty(): any
  • Returns any

isA

  • isA(actorType: any): boolean
  • Parameters

    • actorType: any

    Returns boolean

render

  • render(viewport: any, context: any): void
  • Parameters

    • viewport: any
    • context: any

    Returns void

IContour

IContour:

color

color: any

readonlyid

id: string

points

points: Point3[]

readonlysizeInBytes

sizeInBytes: number

_getSizeInBytes

  • _getSizeInBytes(): number
  • Returns number

getColor

getFlatPointsArray

  • getFlatPointsArray(): number[]
  • Returns number[]

getPoints

  • It returns the value of the points property of the data object


    Returns Point3[]

    The points property of the data object.

getType

IContourSet

IContourSet:

This class represents a set of contours in 3d space. Usually contours are grouped together in a contour set to represent a meaningful shape.

contours

contours: IContour[]

readonlyframeOfReferenceUID

frameOfReferenceUID: string

readonlyid

id: string

readonlysizeInBytes

sizeInBytes: number

_createEachContour

getCentroid

getColor

  • getColor(): any
  • Returns any

getContours

  • This function returns the contours of the image


    Returns IContour[]

    The contours of the image.

getFlatPointsArray

  • getFlatPointsArray(): Point3[]
  • It returns an array of all the points in the glyph


    Returns Point3[]

    An array of points.

getNumberOfContours

  • getNumberOfContours(): number
  • This function returns the number of contours in the current shape.


    Returns number

    The number of contours in the glyph.

getNumberOfPointsArray

  • getNumberOfPointsArray(): number[]
  • It returns an array of the number of points in each contour.


    Returns number[]

    An array of numbers.

getNumberOfPointsInAContour

  • getNumberOfPointsInAContour(contourIndex: number): number
  • “This function returns the number of points in a contour.”


    Parameters

    • contourIndex: number

      The index of the contour you want to get the number of points from.

    Returns number

    The number of points in the contour.

getPointsInContour

  • getPointsInContour(contourIndex: number): Point3[]
  • It returns the points in a contour.


    Parameters

    • contourIndex: number

      The index of the contour you want to get the points from.

    Returns Point3[]

    An array of Point3 objects.

getSegmentIndex

  • getSegmentIndex(): number
  • Returns number

getSizeInBytes

  • getSizeInBytes(): number
  • Returns number

getTotalNumberOfPoints

  • getTotalNumberOfPoints(): number
  • It loops through each contour in the contours array, and adds the number of points in each contour to the numberOfPoints variable


    Returns number

    The number of points in the contours.

IDynamicImageVolume

IDynamicImageVolume:

Cornerstone ImageVolume interface. Todo: we should define new IVolume class with appropriate typings for the other types of volume that don’t have images (nrrd, nifti)

optionaladditionalDetails

additionalDetails?: Record<string, any>

Property to store additional information

optionalcancelLoading

cancelLoading?: () => void

Type declaration

    • (): void
    • Returns void

optionalconvertToCornerstoneImage

convertToCornerstoneImage?: (imageId: string, imageIdIndex: number) => IImageLoadObject

Type declaration

    • method to convert the volume data in the volume cache, to separate images in the image cache


      Parameters

      • imageId: string
      • imageIdIndex: number

      Returns IImageLoadObject

optionaldecache

decache?: (completelyRemove?: boolean) => void

Type declaration

    • (completelyRemove?: boolean): void
    • decache


      Parameters

      • optionalcompletelyRemove: boolean

      Returns void

dimensions

dimensions: Point3

volume dimensions

direction

direction: Mat3

volume direction

hasPixelSpacing

hasPixelSpacing: boolean

whether the metadata for the pixel spacing is not undefined

optionalimageData

imageData?: vtkImageData

volume image data as vtkImageData

imageIds

imageIds: string[]

imageIds of the volume (if it is built of separate imageIds)

isPreScaled

isPreScaled: boolean

Whether preScaling has been performed on the volume

optionalloadStatus

loadStatus?: Record<string, any>

loading status object for the volume containing loaded/loading statuses

metadata

metadata: Metadata

volume metadata

numVoxels

numVoxels: number

number of voxels in the volume

origin

origin: Point3

volume origin - set to the imagePositionPatient of the last image in the volume

optionalreferencedImageIds

referencedImageIds?: string[]

volume referencedImageIds (if it is derived from set of images in the image cache)

optionalreferencedVolumeId

referencedVolumeId?: string

volume referencedVolumeId (if it is derived from another volume)

optionalscaling

scaling?: { PT?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number } }

volume scaling metadata


Type declaration

  • optionalPT?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
    • optionalSUVbsaFactor?: number
    • optionalSUVlbmFactor?: number
    • optionalsuvbwToSuvbsa?: number
    • optionalsuvbwToSuvlbm?: number

optionalsizeInBytes

sizeInBytes?: number

volume size in bytes

spacing

spacing: Point3

volume spacing

readonlyvolumeId

volumeId: string

unique identifier of the volume in the cache

optionalvoxelManager

voxelManager?: default<number> | default<RGB>

A voxel manager to manage the scalar data

vtkOpenGLTexture

vtkOpenGLTexture: any

openGL texture for the volume

imageCacheOffsetMap

  • get imageCacheOffsetMap(): Map<string, any>
  • Returns Map<string, any>

numTimePoints

  • get numTimePoints(): number
  • Returns the number of time points


    Returns number

timePointIndex

  • get timePointIndex(): number
  • set timePointIndex(newTimePointIndex: number): void
  • Returns the active time point index


    Returns number

  • Set the active time point index which also updates the active scalar data


    Parameters

    • newTimePointIndex: number

    Returns void

convertToImageSlicesAndCache

  • convertToImageSlicesAndCache(): string[]
  • Returns string[]

destroy

  • destroy(): void
  • destroy the volume and make it unusable


    Returns void

getImageIdIndex

  • getImageIdIndex(imageId: string): number
  • return the index of a given imageId


    Parameters

    • imageId: string

    Returns number

getImageURIIndex

  • getImageURIIndex(imageURI: string): number
  • return the index of a given imageURI


    Parameters

    • imageURI: string

    Returns number

getScalarData

  • return the volume scalar data


    Returns PixelDataTypedArray

getScalarDataArrays

isDynamicVolume

  • isDynamicVolume(): boolean
  • return true if it is a 4D volume or false if it is 3D volume


    Returns boolean

modified

  • modified(): void
  • Mark the volume as having had the pixel data changed externally which in background will re-configure the volume to use the new pixel data.


    Returns void

IEnabledElement

IEnabledElement:

Cornerstone Enabled Element interface

FrameOfReferenceUID

FrameOfReferenceUID: string

FrameOfReference the enabledElement is rendering inside

renderingEngine

renderingEngine: default

Cornerstone Rendering Engine instance

renderingEngineId

renderingEngineId: string

Unique ID of the renderingEngine

viewport

viewport: default | default

Cornerstone Viewport instance - can be Stack or Volume, or Video Viewport as of now. For the moment, need to cast to unknown first before casting to IVideoViewport (TODO) - this will be done as part of adding annotation tools for video

viewportId

viewportId: string

Unique ID of the viewport in the renderingEngine

IGeometry

IGeometry:

data

id

id: string

sizeInBytes

sizeInBytes: number

type

IGeometryLoadObject

IGeometryLoadObject:

optionalcancelFn

cancelFn?: () => void

Type declaration

    • (): void
    • optional cancel function for loading


      Returns void

optionaldecache

decache?: () => void

Type declaration

    • (): void
    • optional decache function


      Returns void

promise

promise: Promise<IGeometry>

promise that resolves to an ImageVolume

IImage

IImage:

Cornerstone Image interface, it is used for both CPU and GPU rendering

optionalbufferView

bufferView?: { buffer: ArrayBuffer; offset: number }

Type declaration

  • buffer: ArrayBuffer
  • offset: number

optionalcachedLut

cachedLut?: { invert?: boolean; lutArray?: Uint8ClampedArray; modalityLUT?: unknown; voiLUT?: CPUFallbackLUT; windowCenter?: number | number[]; windowWidth?: number | number[] }

CPU: image cached LUT


Type declaration

  • optionalinvert?: boolean
  • optionallutArray?: Uint8ClampedArray
  • optionalmodalityLUT?: unknown
  • optionalvoiLUT?: CPUFallbackLUT
  • optionalwindowCenter?: number | number[]
  • optionalwindowWidth?: number | number[]

optionalcalibration

calibration?: IImageCalibration

color

color: boolean

is image a color image

optionalcolormap

CPU: custom color map for image

columnPixelSpacing

columnPixelSpacing: number

column pixel spacing

columns

columns: number

image number of columns

optionaldecodeTimeInMS

decodeTimeInMS?: number

getCanvas

getCanvas: () => HTMLCanvasElement

Type declaration

    • (): HTMLCanvasElement
    • Returns HTMLCanvasElement

getPixelData

getPixelData: () => PixelDataTypedArray

Type declaration

height

height: number

image height

optionalimageFrame

imageFrame?: any

imageId

imageId: string

Image Id

optionalimageQualityStatus

imageQualityStatus?: ImageQualityStatus

intercept

intercept: number

intercept from metadata for scaling

invert

invert: boolean

whether image pixels are inverted in color

optionalisPreScaled

isPreScaled?: boolean

Whether the image is Pre-scaled during loading

optionalloadTimeInMS

loadTimeInMS?: number

maxPixelValue

maxPixelValue: number

minPixelValue

minPixelValue: number

minimum pixel value of the image

optionalmodalityLUT

modalityLUT?: CPUFallbackLUT

CPU: custom modality LUT for image

numComps

numComps: number

number of components in the image

optionalphotometricInterpretation

photometricInterpretation?: string

image photometric interpretation

optionalpreScale

preScale?: { enabled: boolean; scaled?: boolean; scalingParameters?: { modality?: string; rescaleIntercept?: number; rescaleSlope?: number; suvbw?: number } }

preScale object


Type declaration

  • enabled: boolean
  • optionalscaled?: boolean

    boolean flag to indicate whether the image has been scaled

  • optionalscalingParameters?: { modality?: string; rescaleIntercept?: number; rescaleSlope?: number; suvbw?: number }

    scaling parameters

    • optionalmodality?: string

      modality of the image

    • optionalrescaleIntercept?: number

      rescale intercept

    • optionalrescaleSlope?: number

      rescale slop

    • optionalsuvbw?: number

      PT suvbw

optionalreferencedImageId

referencedImageId?: string

referenced imageId if this image is derived from

optionalrender

render?: (enabledElement: CPUFallbackEnabledElement, invalidated: boolean) => unknown

Type declaration

rgba

rgba: boolean

is image rgb and alpha

rowPixelSpacing

rowPixelSpacing: number

row pixel spacing

rows

rows: number

image number of rows

optionalscaling

scaling?: { PT?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number } }

image scaling metadata - including PT suv values


Type declaration

  • optionalPT?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
    • optionalSUVbsaFactor?: number
    • optionalSUVlbmFactor?: number
    • optionalsuvbwToSuvbsa?: number
    • optionalsuvbwToSuvlbm?: number

optionalsharedCacheKey

sharedCacheKey?: string

sizeInBytes

sizeInBytes: number

image size in number of bytes

optionalsliceThickness

sliceThickness?: number

slice thickness

slope

slope: number

slope from metadata for scaling

optionalstats

stats?: { lastGetPixelDataTime?: number; lastLutGenerateTime?: number; lastPutImageDataTime?: number; lastRenderTime?: number; lastRenderedViewport?: unknown; lastStoredPixelDataToCanvasImageDataTime?: number }

CPU: image statistics for rendering


Type declaration

  • optionallastGetPixelDataTime?: number
  • optionallastLutGenerateTime?: number
  • optionallastPutImageDataTime?: number
  • optionallastRenderTime?: number
  • optionallastRenderedViewport?: unknown
  • optionallastStoredPixelDataToCanvasImageDataTime?: number

optionalvoiLUT

CPU: custom VOI LUT for image

voiLUTFunction

voiLUTFunction: string

voiLUTFunction from metadata

optionalvoxelManager

voxelManager?: default<number> | default<RGB>

width

width: number

image width

windowCenter

windowCenter: number | number[]

windowCenter from metadata

windowWidth

windowWidth: number | number[]

windowWidth from metadata

IImageCalibration

IImageCalibration:

IImageCalibration is an object that stores information about the type of image calibration.

optionalaspect

aspect?: number

The calibration aspect ratio for non-square calibrations. This is the aspect ratio similar to the scale above that applies when the viewport is displaying non-square image pixels as square screen pixels.

Defaults to 1 if not specified, and is also 1 if the Viewport has squared up the image pixels so that they are displayed as a square. Not well handled currently as this needs to be incorporated into tools when doing calculations.

optionalcolumnPixelSpacing

columnPixelSpacing?: number

optionalrowPixelSpacing

rowPixelSpacing?: number

The pixel spacing for the image, in mm between pixel centers These are not required, and are deprecated in favour of getting the original image spacing and then applying the transforms. The values here should be identical to original spacing.

optionalscale

scale?: number

The scaling of measurement values relative to the base pixel spacing (1 if not specified)

optionalsequenceOfUltrasoundRegions

sequenceOfUltrasoundRegions?: Record<string, unknown>[]

The DICOM defined ultrasound regions. Used for non-distance spacing units.

optionaltooltip

tooltip?: string

A tooltip which can be used to explain the calibration information

type

The type of the pixel spacing, distinguishing between various types projection (CR/DX/MG) spacing and volumetric spacing (the type is an empty string as it doesn’t get a suffix, but this distinguishes it from other types)

IImageData

IImageData:

IImageData of an image, which stores actual scalarData and metaData about the image. IImageData is different from vtkImageData.

optionalcalibration

calibration?: IImageCalibration

dimensions

dimensions: Point3

image dimensions

direction

direction: Mat3

image direction

optionalhasPixelSpacing

hasPixelSpacing?: boolean

whether the image has pixel spacing and it is not undefined

imageData

imageData: vtkImageData

vtkImageData object

metadata

metadata: { Modality: string }

image metadata - currently only modality


Type declaration

  • Modality: string

origin

origin: Point3

image origin

optionalpreScale

preScale?: { scaled?: boolean; scalingParameters?: { modality?: string; rescaleIntercept?: number; rescaleSlope?: number; suvbw?: number } }

preScale object


Type declaration

  • optionalscaled?: boolean

    boolean flag to indicate whether the image has been scaled

  • optionalscalingParameters?: { modality?: string; rescaleIntercept?: number; rescaleSlope?: number; suvbw?: number }

    scaling parameters

    • optionalmodality?: string

      modality of the image

    • optionalrescaleIntercept?: number

      rescale intercept

    • optionalrescaleSlope?: number

      rescale slop

    • optionalsuvbw?: number

      PT suvbw

scalarData

scalarData: Float32Array | Int16Array | Uint16Array | Uint8Array

image scalarData which stores the array of pixelData

optionalscaling

scaling?: Scaling

image scaling for scaling pixelArray

spacing

spacing: Point3

image spacing

IImageLoadObject

IImageLoadObject:

ImageLoadObject interface which any imageLoader should return

optionalcancelFn

cancelFn?: () => void

Type declaration

    • (): void
    • optional cancel function for loading


      Returns void

optionaldecache

decache?: () => void

Type declaration

    • (): void
    • optional decache function


      Returns void

promise

promise: Promise<IImage>

promise that resolves to an image

IImageVolume

IImageVolume:

Cornerstone ImageVolume interface. Todo: we should define new IVolume class with appropriate typings for the other types of volume that don’t have images (nrrd, nifti)

optionaladditionalDetails

additionalDetails?: Record<string, any>

Property to store additional information

optionalcancelLoading

cancelLoading?: () => void

Type declaration

    • (): void
    • Returns void

optionalconvertToCornerstoneImage

convertToCornerstoneImage?: (imageId: string, imageIdIndex: number) => IImageLoadObject

Type declaration

    • method to convert the volume data in the volume cache, to separate images in the image cache


      Parameters

      • imageId: string
      • imageIdIndex: number

      Returns IImageLoadObject

optionaldecache

decache?: (completelyRemove?: boolean) => void

Type declaration

    • (completelyRemove?: boolean): void
    • decache


      Parameters

      • optionalcompletelyRemove: boolean

      Returns void

dimensions

dimensions: Point3

volume dimensions

direction

direction: Mat3

volume direction

hasPixelSpacing

hasPixelSpacing: boolean

whether the metadata for the pixel spacing is not undefined

optionalimageData

imageData?: vtkImageData

volume image data as vtkImageData

imageIds

imageIds: string[]

imageIds of the volume (if it is built of separate imageIds)

isPreScaled

isPreScaled: boolean

Whether preScaling has been performed on the volume

optionalloadStatus

loadStatus?: Record<string, any>

loading status object for the volume containing loaded/loading statuses

metadata

metadata: Metadata

volume metadata

numVoxels

numVoxels: number

number of voxels in the volume

origin

origin: Point3

volume origin - set to the imagePositionPatient of the last image in the volume

optionalreferencedImageIds

referencedImageIds?: string[]

volume referencedImageIds (if it is derived from set of images in the image cache)

optionalreferencedVolumeId

referencedVolumeId?: string

volume referencedVolumeId (if it is derived from another volume)

optionalscaling

scaling?: { PT?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number } }

volume scaling metadata


Type declaration

  • optionalPT?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
    • optionalSUVbsaFactor?: number
    • optionalSUVlbmFactor?: number
    • optionalsuvbwToSuvbsa?: number
    • optionalsuvbwToSuvlbm?: number

optionalsizeInBytes

sizeInBytes?: number

volume size in bytes

spacing

spacing: Point3

volume spacing

readonlyvolumeId

volumeId: string

unique identifier of the volume in the cache

optionalvoxelManager

voxelManager?: default<number> | default<RGB>

A voxel manager to manage the scalar data

vtkOpenGLTexture

vtkOpenGLTexture: any

openGL texture for the volume

imageCacheOffsetMap

  • get imageCacheOffsetMap(): Map<string, any>
  • Returns Map<string, any>

convertToImageSlicesAndCache

  • convertToImageSlicesAndCache(): string[]
  • Returns string[]

destroy

  • destroy(): void
  • destroy the volume and make it unusable


    Returns void

getImageIdIndex

  • getImageIdIndex(imageId: string): number
  • return the index of a given imageId


    Parameters

    • imageId: string

    Returns number

getImageURIIndex

  • getImageURIIndex(imageURI: string): number
  • return the index of a given imageURI


    Parameters

    • imageURI: string

    Returns number

getScalarData

isDynamicVolume

  • isDynamicVolume(): boolean
  • return true if it is a 4D volume or false if it is 3D volume


    Returns boolean

modified

  • modified(): void
  • Mark the volume as having had the pixel data changed externally which in background will re-configure the volume to use the new pixel data.


    Returns void

IImagesLoader

IImagesLoader:

Provides a method to load a stack of images.

loadImages

loadImages: (imageIds: string[], listener: ImageLoadListener) => Promise<unknown>

Type declaration

IRegisterImageLoader

IRegisterImageLoader:

Register image loader interface

registerImageLoader

registerImageLoader: (scheme: string, imageLoader: ImageLoaderFn) => void

Type declaration

IRenderingEngine

IRenderingEngine:

hasBeenDestroyed

hasBeenDestroyed: boolean

id

id: string

offScreenCanvasContainer

offScreenCanvasContainer: any

offscreenMultiRenderWindow

offscreenMultiRenderWindow: any

_debugRender

  • _debugRender(): void
  • Returns void

destroy

  • destroy(): void
  • Returns void

disableElement

  • disableElement(viewportId: string): void
  • Parameters

    • viewportId: string

    Returns void

enableElement

fillCanvasWithBackgroundColor

  • fillCanvasWithBackgroundColor(canvas: HTMLCanvasElement, backgroundColor: [number, number, number]): void
  • Parameters

    • canvas: HTMLCanvasElement
    • backgroundColor: [number, number, number]

    Returns void

getStackViewports

getVideoViewports

getViewport

getViewports

getVolumeViewports

render

  • render(): void
  • Returns void

renderFrameOfReference

  • renderFrameOfReference(FrameOfReferenceUID: string): void
  • Parameters

    • FrameOfReferenceUID: string

    Returns void

renderViewport

  • renderViewport(viewportId: string): void
  • Parameters

    • viewportId: string

    Returns void

renderViewports

  • renderViewports(viewportIds: string[]): void
  • Parameters

    • viewportIds: string[]

    Returns void

resize

  • resize(immediate?: boolean, keepCamera?: boolean): void
  • Parameters

    • optionalimmediate: boolean
    • optionalkeepCamera: boolean

    Returns void

setViewports

IRetrieveConfiguration

IRetrieveConfiguration:

Defines how the retrieve configuration is handled for single and multi frame volumes. Currently, the only configuration is a list of stages specify how sets of images ids get retrieved together or separately, and what type of retrieves and which queue is used for retrieving.

The intent is to add other information on how to retrieve here in the future. This could include the specific retrieve options or could control queue strategy, prefetch etc.

optionalcreate

create?: (IRetrieveConfiguration: any) => IImagesLoader

Type declaration

    • Creates an image loader, defaulting to ProgressiveRetrieveImages


      Parameters

      • IRetrieveConfiguration: any

      Returns IImagesLoader

optionalretrieveOptions

retrieveOptions?: Record<string, RetrieveOptions>

optionalstages

stages?: RetrieveStage[]

IStackInput

IStackInput:

StackInput that can be used to add an image actor to a viewport. It includes mandatory imageId but other options such as visibility and callback can also be provided

optionalactorUID

actorUID?: string

optionalcallback

Callback to be called when the image is added to the viewport

imageId

imageId: string

imageId of the image in the cache

optionalvisibility

visibility?: boolean

Visibility of the image actor - by default it is true

IStackViewport

IStackViewport:

Interface for Stack Viewport

_actors

_actors: Map<string, any>

actors rendered in the viewport

addWidget

addWidget: (id: string, widget: any) => void

Type declaration

    • (id: string, widget: any): void
    • Parameters

      • id: string
      • widget: any

      Returns void

canvas

canvas: HTMLCanvasElement

canvas associated to the viewport

canvasToWorld

canvasToWorld: (canvasPos: Point2) => Point3

Type declaration

    • canvasToWorld Returns the world coordinates of the given canvasPos projected onto the plane defined by the Viewport‘s camera.


      Parameters

      Returns Point3

customRenderViewportToCanvas

customRenderViewportToCanvas: () => { canvas: HTMLCanvasElement; element: HTMLDivElement; renderingEngineId: string; viewportId: string }

Type declaration

    • (): { canvas: HTMLCanvasElement; element: HTMLDivElement; renderingEngineId: string; viewportId: string }
    • Custom rendering pipeline for the rendering for the CPU fallback


      Returns { canvas: HTMLCanvasElement; element: HTMLDivElement; renderingEngineId: string; viewportId: string }

      • canvas: HTMLCanvasElement
      • element: HTMLDivElement
      • renderingEngineId: string
      • viewportId: string

defaultOptions

defaultOptions: any

viewport default options including the axis, and background color

element

element: HTMLDivElement

public DOM element associated to the viewport

getCornerstoneImage

getCornerstoneImage: () => IImage

Type declaration

    • Returns the raw/loaded image being shown inside the stack viewport.


      Returns IImage

getCurrentImageId

getCurrentImageId: () => string

Type declaration

    • (): string
    • Returns the currently rendered imageId


      Returns string

getCurrentImageIdIndex

getCurrentImageIdIndex: () => number

Type declaration

    • (): number
    • Returns the index of the imageId being renderer


      Returns number

getDefaultProperties

getDefaultProperties: (imageId?: string) => StackViewportProperties

Type declaration

getFrameOfReferenceUID

getFrameOfReferenceUID: () => string

Type declaration

    • (): string
    • Returns the frame of reference UID, if the image doesn’t have imagePlaneModule metadata, it returns undefined, otherwise, frameOfReferenceUID is returned.


      Returns string

getImageIds

getImageIds: () => string[]

Type declaration

    • (): string[]
    • Returns the list of image Ids for the current viewport


      Returns string[]

getProperties

getProperties: () => StackViewportProperties

Type declaration

getRotation

getRotation: () => number

Type declaration

    • (): number
    • get the rotation either from the camera provided or the viewport if not provided


      Returns number

getWidget

getWidget: (id: string) => any

Type declaration

    • (id: string): any
    • Parameters

      • id: string

      Returns any

getWidgets

getWidgets: () => any

Type declaration

    • (): any
    • Returns any

hasImageId

hasImageId: (imageId: string) => boolean

Type declaration

    • (imageId: string): boolean
    • Returns true if the viewport contains the imageId


      Parameters

      • imageId: string

      Returns boolean

hasImageURI

hasImageURI: (imageURI: string) => boolean

Type declaration

    • (imageURI: string): boolean
    • Returns true if the viewport contains the imageURI


      Parameters

      • imageURI: string

      Returns boolean

id

id: string

unique identifier of the viewport

isDisabled

isDisabled: boolean

if the viewport has been disabled

modality

modality: string

options

viewport options

removeWidgets

removeWidgets: () => void

Type declaration

    • (): void
    • Returns void

renderingEngineId

renderingEngineId: string

renderingEngineId the viewport belongs to

resize

resize: () => void

Type declaration

    • (): void
    • Resizes the viewport - only used in CPU fallback for StackViewport. The GPU resizing happens inside the RenderingEngine.


      Returns void

sHeight

sHeight: number

height of the viewport on the offscreen canvas (if rendering using GPU)

sWidth

sWidth: number

width of the viewport on the offscreen canvas (if rendering using GPU)

scaling

scaling: Scaling

Scaling parameters

stackActorReInitialized

stackActorReInitialized: boolean

suppressEvents

suppressEvents: boolean

Suppress events

sx

sx: number

sx of the viewport on the offscreen canvas (if rendering using GPU)

sy

sy: number

sy of the viewport on the offscreen canvas (if rendering using GPU)

type

viewport type, can be ORTHOGRAPHIC or STACK for now

updateRenderingPipeline

updateRenderingPipeline: () => void

Type declaration

    • (): void
    • Returns void

viewportStatus

viewportStatus: ViewportStatus

The rendering state of this viewport

worldToCanvas

worldToCanvas: (worldPos: Point3) => Point2

Type declaration

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


      Parameters

      Returns Point2

_getCorners

  • _getCorners(bounds: number[]): number[][]
  • Parameters

    • bounds: number[]

    Returns number[][]

addActor

  • add one actor


    Parameters

    Returns void

addActors

  • add actors to the list of actors


    Parameters

    Returns void

addImages

  • addImages(stackInputs: IStackInput[], immediateRender: boolean, suppressEvents: boolean): any
  • Add Image Slices actors to the viewport


    Parameters

    • stackInputs: IStackInput[]
    • immediateRender: boolean
    • suppressEvents: boolean

    Returns any

calibrateSpacing

  • calibrateSpacing(imageId: string): void
  • Calibrates the image with new metadata that has been added for imageId. To calibrate a viewport, you should add your calibration data manually to calibratedPixelSpacingMetadataProvider and call viewport.calibrateSpacing for it get applied.


    Parameters

    • imageId: string

    Returns void

clearDefaultProperties

  • clearDefaultProperties(imageId?: string): void
  • Remove the global default properties of the viewport or remove default properties for an imageId if specified


    Parameters

    • optionalimageId: string

    Returns void

getActor

  • returns specific actor by its uid


    Parameters

    • actorUID: string

    Returns ActorEntry

getActorByIndex

  • returns specific actor by array index


    Parameters

    • index: number

    Returns ActorEntry

getActorUIDByIndex

  • getActorUIDByIndex(index: number): string
  • returns specific actor uid by array index


    Parameters

    • index: number

    Returns string

getActorUIDs

  • getActorUIDs(): string[]
  • get actor UIDs


    Returns string[]

getActors

  • returns all the actor entires for a viewport which is an object containing actor and its uid


    Returns ActorEntry[]

getCamera

  • If the user has selected CPU rendering, return the CPU camera, otherwise return the default camera


    Returns ICamera

getCanvas

  • getCanvas(): HTMLCanvasElement
  • returns the canvas


    Returns HTMLCanvasElement

getDefaultActor

  • get the first actor


    Returns ActorEntry

getDisplayArea

  • returns the displayArea


    Returns DisplayArea

getImageData

  • 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)


    Returns IImageData | CPUIImageData

getImageDataMetadata

  • getImageDataMetadata(image: IImage): any
  • Parameters

    Returns any

getNumberOfSlices

  • getNumberOfSlices(): number
  • Gets the number of slices in the current camera orientation


    Returns number

getPan

  • Gets the canvas pan value


    Returns Point2

getReferenceId

  • 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.


    Parameters

    Returns string

getRenderer

  • getRenderer(): any
  • If the renderer is CPU based, throw an error. Otherwise, returns the vtkRenderer responsible for rendering the Viewport.


    Returns any

getRenderingEngine

  • getRenderingEngine(): any
  • returns the renderingEngine instance the viewport belongs to


    Returns any

getViewPresentation

  • 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 atributes 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

    Returns ViewPresentation

getViewReference

  • 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

    • optionalviewRefSpecifier: ViewReferenceSpecifier

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

    Returns ViewReference

getZoom

  • getZoom(): number
  • returns the parallel zoom relative to the default (eg returns 1 after reset)


    Returns number

isReferenceViewable

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


    Parameters

    Returns boolean

    true if the viewport could show this view reference

removeActors

  • removeActors(actorUIDs: string[]): void
  • remove array of uids


    Parameters

    • actorUIDs: string[]

    Returns void

removeAllActors

  • removeAllActors(): void
  • remove all actors from the viewport


    Returns void

render

  • render(): void
  • triggers render for all actors in the viewport


    Returns void

reset

  • reset(immediate: boolean): void
  • reset camera and options


    Parameters

    • immediate: boolean

    Returns void

resetCamera

  • resetCamera(resetPan?: boolean, resetZoom?: boolean): boolean
  • Centers Pan and resets the zoom for stack viewport.


    Parameters

    • optionalresetPan: boolean
    • optionalresetZoom: boolean

    Returns boolean

resetProperties

  • resetProperties(): void
  • Reset the viewport properties to the default metadata values


    Returns void

resetToDefaultProperties

  • resetToDefaultProperties(): void
  • Reset the viewport properties to the his default values if possible


    Returns void

setActors

  • set and overwrite actors in a viewport


    Parameters

    Returns void

setCamera

  • setCamera(cameraInterface: ICamera): void
  • Set the camera based on the provided camera object.


    Parameters

    Returns void

setDefaultProperties

  • Update the default properties of the viewport and add properties by imageId if specified setting the VOI, inverting the colors and setting the interpolation type, rotation


    Parameters

    Returns void

setDisplayArea

  • setDisplayArea(displayArea: DisplayArea, callResetCamera?: boolean, suppressEvents?: boolean): any
  • set displayArea for the viewport


    Parameters

    • displayArea: DisplayArea
    • optionalcallResetCamera: boolean
    • optionalsuppressEvents: boolean

    Returns any

setImageIdIndex

  • setImageIdIndex(imageIdIndex: number): Promise<string>
  • Loads the image based on the provided imageIdIndex. It is an Async function which returns a promise that resolves to the imageId.


    Parameters

    • imageIdIndex: number

    Returns Promise<string>

setOptions

  • set options for the viewport


    Parameters

    Returns void

setPan

  • setPan(pan: Point2, storeAsInitialCamera?: boolean): any
  • Sets the canvas pan value


    Parameters

    • pan: Point2
    • optionalstoreAsInitialCamera: boolean

    Returns any

setProperties

  • Sets the properties for the viewport on the default actor. Properties include setting the VOI, inverting the colors and setting the interpolation type, rotation


    Parameters

    Returns void

setRendered

  • setRendered(): void
  • Sets the rendered state to rendered if the render actually showed image data


    Returns void

setStack

  • setStack(imageIds: string[], currentImageIdIndex?: number): Promise<string>
  • Sets the imageIds to be visualized inside the stack viewport. It accepts list of imageIds, the index of the first imageId to be viewed. It is a asynchronous function that returns a promise resolving to imageId being displayed in the stack viewport.


    Parameters

    • imageIds: string[]
    • optionalcurrentImageIdIndex: number

    Returns Promise<string>

setViewPresentation

  • Sets the presentation parameters from the specified viewPres object. Sets display area, zoom, pan, rotation, voi LUT


    Parameters

    Returns any

setViewReference

  • Navigates this viewport to the specified viewRef. Throws an exception if that isn’t possible on this viewport. Returns immediately if viewRef isn’t defined.


    Parameters

    Returns any

setZoom

  • setZoom(zoom: number, storeAsInitialCamera?: boolean): any
  • Sets the relative zoom - set to 1 to reset it


    Parameters

    • zoom: number
    • optionalstoreAsInitialCamera: boolean

    Returns any

unsetColormap

  • unsetColormap(): void
  • It sets the colormap to the default colormap.


    Returns void

IStreamingImageVolume

IStreamingImageVolume:

Cornerstone StreamingImageVolume which extends ImageVolume

optionaladditionalDetails

additionalDetails?: Record<string, any>

Property to store additional information

cancelLoading

cancelLoading: () => void

Type declaration

    • (): void
    • Returns void

dimensions

dimensions: Point3

Dimensions of the volume

direction

direction: Mat3

volume direction in world space

hasPixelSpacing

hasPixelSpacing: boolean

whether the metadata for the pixel spacing is not undefined

imageCacheOffsetMap

imageCacheOffsetMap: Map<any, any> = ...

optionalimageData

imageData?: vtkImageData

volume image data

isPreScaled

isPreScaled: boolean = false

Whether preScaling has been performed on the volume

optionalloadStatus

loadStatus?: Record<string, any>

load status object for the volume

metadata

metadata: Metadata

volume metadata

numVoxels

numVoxels: number

volume number of voxels

origin

origin: Point3

volume origin, Note this is an opinionated origin for the volume

optionalreferencedImageIds

referencedImageIds?: string[]

optional reference image ids if the volume is derived from a set of images in the image cache

optionalreferencedVolumeId

referencedVolumeId?: string

optional reference volume id if the volume is derived from another volume

optionalscaling

scaling?: { PT?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number } }

volume scaling parameters if it contains scaled data


Type declaration

  • optionalPT?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
    • optionalSUVbsaFactor?: number
    • optionalSUVlbmFactor?: number
    • optionalsuvbwToSuvbsa?: number
    • optionalsuvbwToSuvlbm?: number

optionalsizeInBytes

sizeInBytes?: number

volume size in bytes

spacing

spacing: Point3

volume spacing in 3d world space

readonlyvolumeId

volumeId: string

Read-only unique identifier for the volume

vtkOpenGLTexture

vtkOpenGLTexture: any

open gl texture for the volume

publicimageIds

  • get imageIds(): string[]
  • set imageIds(newImageIds: string[]): void
  • return the image ids for the volume if it is made of separated images


    Returns string[]

  • updates the image ids


    Parameters

    • newImageIds: string[]

    Returns void

clearLoadCallbacks

  • clearLoadCallbacks(): void
  • method to load all the loading requests


    Returns void

convertToCornerstoneImage

  • convertToCornerstoneImage(imageId: string, imageIdIndex: number): any
  • method to convert the volume data in the volume cache, to separate images in the image cache


    Parameters

    • imageId: string
    • imageIdIndex: number

    Returns any

publicconvertToImageSlicesAndCache

  • convertToImageSlicesAndCache(): string[]
  • Converts all the volume images (imageIds) to cornerstoneImages and caches them. It iterates over all the imageIds and convert them until there is no enough space left inside the imageCache. Finally it will decache the Volume.


    Returns string[]

decache

  • decache(completelyRemove: boolean): void
  • method to decache the volume from cache


    Parameters

    • completelyRemove: boolean

    Returns void

destroy

  • destroy(): void
  • destroy the volume and make it unusable


    Returns void

publicgetCornerstoneImage

  • getCornerstoneImage(imageId: string, imageIdIndex: number): IImage
  • Converts the requested imageId inside the volume to a cornerstoneImage object. It uses the typedArray set method to copy the pixelData from the correct offset in the scalarData to a new array for the image


    Parameters

    • imageId: string

      the imageId of the image to be converted

    • imageIdIndex: number

      the index of the imageId in the imageIds array

    Returns IImage

    image object containing the pixel data, metadata, and other information

publicgetCornerstoneImageLoadObject

  • getCornerstoneImageLoadObject(imageId: string, imageIdIndex: number): IImageLoadObject
  • Converts the requested imageId inside the volume to a cornerstoneImage object. It uses the typedArray set method to copy the pixelData from the correct offset in the scalarData to a new array for the image


    Parameters

    • imageId: string

      the imageId of the image to be converted

    • imageIdIndex: number

      the index of the imageId in the imageIds array

    Returns IImageLoadObject

    imageLoadObject containing the promise that resolves to the cornerstone image

publicgetCornerstoneImages

  • getCornerstoneImages(): IImage[]
  • Returns an array of all the volume’s images as Cornerstone images. It iterates over all the imageIds and converts them to Cornerstone images.


    Returns IImage[]

    An array of Cornerstone images.

publicgetImageIdIndex

  • getImageIdIndex(imageId: string): number
  • return the index of a given imageId


    Parameters

    • imageId: string

      imageId

    Returns number

    imageId index

publicgetImageURIIndex

  • getImageURIIndex(imageURI: string): number
  • return the index of a given imageURI


    Parameters

    • imageURI: string

    Returns number

    imageURI index

publicgetScalarData

  • Return the scalar data for 3D volumes or the active scalar data (current time point) for 4D volumes


    Returns PixelDataTypedArray

publicgetScalarDataArrays

  • Return all scalar data objects (buffers) which will be only one for 3D volumes and one per time point for 4D volumes images of each 3D volume is stored


    Returns PixelDataTypedArray[]

    scalar data array

publicgetScalarDataLength

  • getScalarDataLength(): number
  • Returns number

publicisDynamicVolume

  • isDynamicVolume(): boolean
  • return true if it is a 4D volume or false if it is 3D volume


    Returns boolean

publicmodified

  • modified(): void
  • Updates the internals of the volume to reflect the changes in the underlying scalar data. This should be called when the scalar data is modified externally


    Returns void

publicremoveFromCache

  • removeFromCache(): void
  • Returns void

IStreamingVolumeProperties

IStreamingVolumeProperties:

imageIds

imageIds: string[]

imageIds of the volume

loadStatus

loadStatus: { cachedFrames: ImageQualityStatus[]; callbacks: () => void[]; cancelled: boolean; loaded: boolean; loading: boolean }

loading status object for the volume containing loaded/loading statuses


Type declaration

  • cachedFrames: ImageQualityStatus[]
  • callbacks: () => void[]
  • cancelled: boolean
  • loaded: boolean
  • loading: boolean

ISurface

ISurface:

readonlyframeOfReferenceUID

frameOfReferenceUID: string

readonlyid

id: string

readonlysizeInBytes

sizeInBytes: number

getColor

getPoints

  • getPoints(): number[]
  • Returns number[]

getPolys

  • getPolys(): number[]
  • Returns number[]

getSizeInBytes

  • getSizeInBytes(): number
  • Returns number

setColor

  • Parameters

    Returns void

setPoints

  • setPoints(points: number[]): void
  • Parameters

    • points: number[]

    Returns void

setPolys

  • setPolys(polys: number[]): void
  • Parameters

    • polys: number[]

    Returns void

IVideoViewport

IVideoViewport:

Interface for Stack Viewport

_actors

_actors: Map<string, any>

actors rendered in the viewport

addWidget

addWidget: (id: string, widget: any) => void

Type declaration

    • (id: string, widget: any): void
    • Parameters

      • id: string
      • widget: any

      Returns void

canvas

canvas: HTMLCanvasElement

canvas associated to the viewport

canvasToWorld

canvasToWorld: (canvasPos: Point2) => Point3

Type declaration

customRenderViewportToCanvas

customRenderViewportToCanvas: () => unknown

Type declaration

    • (): unknown
    • whether the viewport has custom rendering


      Returns unknown

defaultOptions

defaultOptions: any

viewport default options including the axis, and background color

element

element: HTMLDivElement

public DOM element associated to the viewport

getFrameOfReferenceUID

getFrameOfReferenceUID: () => string

Type declaration

    • (): string
    • frameOfReferenceUID the viewport’s default actor is rendering


      Returns string

getProperties

getProperties: () => VideoViewportProperties

Type declaration

getRotation

getRotation: () => number

Type declaration

    • (): number
    • get the rotation either from the camera provided or the viewport if not provided


      Returns number

getWidget

getWidget: (id: string) => any

Type declaration

    • (id: string): any
    • Parameters

      • id: string

      Returns any

getWidgets

getWidgets: () => any

Type declaration

    • (): any
    • Returns any

id

id: string

unique identifier of the viewport

isDisabled

isDisabled: boolean

if the viewport has been disabled

options

viewport options

pause

pause: () => void

Type declaration

    • (): void
    • Returns void

play

play: () => void

Type declaration

    • (): void
    • Returns void

removeWidgets

removeWidgets: () => void

Type declaration

    • (): void
    • Returns void

renderingEngineId

renderingEngineId: string

renderingEngineId the viewport belongs to

resize

resize: () => void

Type declaration

    • (): void
    • Resizes the viewport - only used in CPU fallback for StackViewport. The GPU resizing happens inside the RenderingEngine.


      Returns void

sHeight

sHeight: number

height of the viewport on the offscreen canvas (if rendering using GPU)

sWidth

sWidth: number

width of the viewport on the offscreen canvas (if rendering using GPU)

setVideo

setVideo: (imageIds: string, imageIdIndex?: number) => Promise<unknown>

Type declaration

    • (imageIds: string, imageIdIndex?: number): Promise<unknown>
    • Sets the video to play. The video should have at least some metadata in the metadata provider, including:

      • study/series/sop common module for UIDs
      • cineModule for information on number of frames and playback rate
      • imageUrlModule - to get the URL for the image under the rendered attribute

      Without these, other tools requiring metadata wont work, although basic playback does work if the setVideoURL is used instead.


      Parameters

      • imageIds: string
      • optionalimageIdIndex: number

      Returns Promise<unknown>

setVideoURL

setVideoURL: (url: string) => void

Type declaration

    • (url: string): void
    • Displays a raw video, without any metadata associated with it. Plays back, but does not permit tools to apply to the viewport, which requires providing additional metadata for the study.


      Parameters

      • url: string

        to display

      Returns void

suppressEvents

suppressEvents: boolean

Suppress events

sx

sx: number

sx of the viewport on the offscreen canvas (if rendering using GPU)

sy

sy: number

sy of the viewport on the offscreen canvas (if rendering using GPU)

type

viewport type, can be ORTHOGRAPHIC or STACK for now

updateRenderingPipeline

updateRenderingPipeline: () => void

Type declaration

    • (): void
    • Returns void

viewportStatus

viewportStatus: ViewportStatus

The rendering state of this viewport

worldToCanvas

worldToCanvas: (worldPos: Point3) => Point2

Type declaration

_getCorners

  • _getCorners(bounds: number[]): number[][]
  • Parameters

    • bounds: number[]

    Returns number[][]

addActor

  • add one actor


    Parameters

    Returns void

addActors

  • add actors to the list of actors


    Parameters

    Returns void

getActor

  • returns specific actor by its uid


    Parameters

    • actorUID: string

    Returns ActorEntry

getActorByIndex

  • returns specific actor by array index


    Parameters

    • index: number

    Returns ActorEntry

getActorUIDByIndex

  • getActorUIDByIndex(index: number): string
  • returns specific actor uid by array index


    Parameters

    • index: number

    Returns string

getActorUIDs

  • getActorUIDs(): string[]
  • get actor UIDs


    Returns string[]

getActors

  • returns all the actor entires for a viewport which is an object containing actor and its uid


    Returns ActorEntry[]

getCamera

  • returns camera object


    Returns ICamera

getCanvas

  • getCanvas(): HTMLCanvasElement
  • returns the canvas


    Returns HTMLCanvasElement

getCurrentImageId

  • getCurrentImageId(): string
  • Gets the current image id, including frame selction or frameless.


    Returns string

getCurrentImageIdIndex

  • getCurrentImageIdIndex(): number
  • Gets the current slice in the current camera orientation


    Returns number

getDefaultActor

  • get the first actor


    Returns ActorEntry

getDisplayArea

  • returns the displayArea


    Returns DisplayArea

getFrameNumber

  • getFrameNumber(): number
  • Gets the current frame, 1 based


    Returns number

getFrameRange

  • getFrameRange(): [number, number]
  • Returns [number, number]

getNumberOfSlices

  • getNumberOfSlices(): number
  • Gets the number of slices in the current camera orientation


    Returns number

getPan

  • Gets the canvas pan value


    Returns Point2

getReferenceId

  • 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.


    Parameters

    Returns string

getRenderer

  • getRenderer(): void
  • returns the vtkRenderer (for GPU rendering) of the viewport


    Returns void

getRenderingEngine

  • getRenderingEngine(): any
  • returns the renderingEngine instance the viewport belongs to


    Returns any

getViewPresentation

  • 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 atributes 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

    Returns ViewPresentation

getViewReference

  • 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

    • optionalviewRefSpecifier: ViewReferenceSpecifier

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

    Returns ViewReference

getZoom

  • getZoom(): number
  • returns the parallel zoom relative to the default (eg returns 1 after reset)


    Returns number

isReferenceViewable

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


    Parameters

    Returns boolean

    true if the viewport could show this view reference

removeActors

  • removeActors(actorUIDs: string[]): void
  • remove array of uids


    Parameters

    • actorUIDs: string[]

    Returns void

removeAllActors

  • removeAllActors(): void
  • remove all actors from the viewport


    Returns void

render

  • render(): void
  • triggers render for all actors in the viewport


    Returns void

reset

  • reset(immediate: boolean): void
  • reset camera and options


    Parameters

    • immediate: boolean

    Returns void

resetCamera

  • resetCamera(resetPan?: boolean, resetZoom?: boolean): boolean
  • Centers Pan and resets the zoom for stack viewport.


    Parameters

    • optionalresetPan: boolean
    • optionalresetZoom: boolean

    Returns boolean

resetProperties

  • resetProperties(): void
  • Reset the viewport properties to the default values


    Returns void

setActors

  • set and overwrite actors in a viewport


    Parameters

    Returns void

setCamera

  • setCamera(cameraInterface: ICamera, storeAsInitialCamera?: boolean): void
  • sets the camera


    Parameters

    • cameraInterface: ICamera
    • optionalstoreAsInitialCamera: boolean

    Returns void

setDisplayArea

  • setDisplayArea(displayArea: DisplayArea, callResetCamera?: boolean, suppressEvents?: boolean): any
  • set displayArea for the viewport


    Parameters

    • displayArea: DisplayArea
    • optionalcallResetCamera: boolean
    • optionalsuppressEvents: boolean

    Returns any

setFrameNumber

  • setFrameNumber(frameNo: number): any
  • Sets the current frame


    Parameters

    • frameNo: number

    Returns any

setFrameRange

  • setFrameRange(range?: [number, number]): any
  • Sets the range of frames for displaying. This is the range of frames that are shown/looped over when the video is playing. Note that ability to playback a frame range depends on the server implementing byte range requests, OR the video being easily cached in memory.


    Parameters

    • optionalrange: [number, number]

    Returns any

setOptions

  • set options for the viewport


    Parameters

    Returns void

setPan

  • setPan(pan: Point2, storeAsInitialCamera?: boolean): any
  • Sets the canvas pan value


    Parameters

    • pan: Point2
    • optionalstoreAsInitialCamera: boolean

    Returns any

setProperties

  • Sets the properties for the viewport on the default actor.


    Parameters

    Returns void

setRendered

  • setRendered(): void
  • Sets the rendered state to rendered if the render actually showed image data


    Returns void

setTime

  • setTime(time: number): any
  • Sets the current video time, in seconds


    Parameters

    • time: number

    Returns any

setViewPresentation

  • Sets the presentation parameters from the specified viewPres object. Sets display area, zoom, pan, rotation, voi LUT


    Parameters

    Returns any

setViewReference

  • Navigates this viewport to the specified viewRef. Throws an exception if that isn’t possible on this viewport. Returns immediately if viewRef isn’t defined.


    Parameters

    Returns any

setZoom

  • setZoom(zoom: number, storeAsInitialCamera?: boolean): any
  • Sets the relative zoom - set to 1 to reset it


    Parameters

    • zoom: number
    • optionalstoreAsInitialCamera: boolean

    Returns any

IViewport

IViewport:

Viewport interface for cornerstone viewports

_actors

_actors: Map<string, any>

actors rendered in the viewport

addWidget

addWidget: (id: string, widget: any) => void

Type declaration

    • (id: string, widget: any): void
    • Parameters

      • id: string
      • widget: any

      Returns void

canvas

canvas: HTMLCanvasElement

canvas associated to the viewport

canvasToWorld

canvasToWorld: (canvasPos: Point2) => Point3

Type declaration

customRenderViewportToCanvas

customRenderViewportToCanvas: () => unknown

Type declaration

    • (): unknown
    • whether the viewport has custom rendering


      Returns unknown

defaultOptions

defaultOptions: any

viewport default options including the axis, and background color

element

element: HTMLDivElement

public DOM element associated to the viewport

getFrameOfReferenceUID

getFrameOfReferenceUID: () => string

Type declaration

    • (): string
    • frameOfReferenceUID the viewport’s default actor is rendering


      Returns string

getRotation

getRotation: () => number

Type declaration

    • (): number
    • get the rotation either from the camera provided or the viewport if not provided


      Returns number

getWidget

getWidget: (id: string) => any

Type declaration

    • (id: string): any
    • Parameters

      • id: string

      Returns any

getWidgets

getWidgets: () => any

Type declaration

    • (): any
    • Returns any

id

id: string

unique identifier of the viewport

isDisabled

isDisabled: boolean

if the viewport has been disabled

options

viewport options

removeWidgets

removeWidgets: () => void

Type declaration

    • (): void
    • Returns void

renderingEngineId

renderingEngineId: string

renderingEngineId the viewport belongs to

sHeight

sHeight: number

height of the viewport on the offscreen canvas (if rendering using GPU)

sWidth

sWidth: number

width of the viewport on the offscreen canvas (if rendering using GPU)

suppressEvents

suppressEvents: boolean

Suppress events

sx

sx: number

sx of the viewport on the offscreen canvas (if rendering using GPU)

sy

sy: number

sy of the viewport on the offscreen canvas (if rendering using GPU)

type

viewport type, can be ORTHOGRAPHIC or STACK for now

updateRenderingPipeline

updateRenderingPipeline: () => void

Type declaration

    • (): void
    • Returns void

viewportStatus

viewportStatus: ViewportStatus

The rendering state of this viewport

worldToCanvas

worldToCanvas: (worldPos: Point3) => Point2

Type declaration

_getCorners

  • _getCorners(bounds: number[]): number[][]
  • Parameters

    • bounds: number[]

    Returns number[][]

addActor

  • add one actor


    Parameters

    Returns void

addActors

  • add actors to the list of actors


    Parameters

    Returns void

getActor

  • returns specific actor by its uid


    Parameters

    • actorUID: string

    Returns ActorEntry

getActorByIndex

  • returns specific actor by array index


    Parameters

    • index: number

    Returns ActorEntry

getActorUIDByIndex

  • getActorUIDByIndex(index: number): string
  • returns specific actor uid by array index


    Parameters

    • index: number

    Returns string

getActorUIDs

  • getActorUIDs(): string[]
  • get actor UIDs


    Returns string[]

getActors

  • returns all the actor entires for a viewport which is an object containing actor and its uid


    Returns ActorEntry[]

getCamera

  • returns camera object


    Returns ICamera

getCanvas

  • getCanvas(): HTMLCanvasElement
  • returns the canvas


    Returns HTMLCanvasElement

getCurrentImageIdIndex

  • getCurrentImageIdIndex(): number
  • Gets the current slice in the current camera orientation


    Returns number

getDefaultActor

getDisplayArea

getNumberOfSlices

  • getNumberOfSlices(): number
  • Gets the number of slices in the current camera orientation


    Returns number

getPan

  • Gets the canvas pan value


    Returns Point2

getReferenceId

  • 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.


    Parameters

    Returns string

getRenderer

  • getRenderer(): void
  • returns the vtkRenderer (for GPU rendering) of the viewport


    Returns void

getRenderingEngine

  • getRenderingEngine(): any
  • returns the renderingEngine instance the viewport belongs to


    Returns any

getViewPresentation

  • 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 atributes 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

    Returns ViewPresentation

getViewReference

  • 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

    • optionalviewRefSpecifier: ViewReferenceSpecifier

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

    Returns ViewReference

getZoom

  • getZoom(): number
  • returns the parallel zoom relative to the default (eg returns 1 after reset)


    Returns number

isReferenceViewable

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


    Parameters

    Returns boolean

    true if the viewport could show this view reference

removeActors

  • removeActors(actorUIDs: string[]): void
  • remove array of uids


    Parameters

    • actorUIDs: string[]

    Returns void

removeAllActors

  • removeAllActors(): void
  • remove all actors from the viewport


    Returns void

render

  • render(): void
  • triggers render for all actors in the viewport


    Returns void

reset

  • reset(immediate: boolean): void
  • reset camera and options


    Parameters

    • immediate: boolean

    Returns void

resetCamera

  • resetCamera(resetPan?: boolean, resetZoom?: boolean, resetToCenter?: boolean, storeAsInitialCamera?: boolean): boolean
  • Resets the camera


    Parameters

    • optionalresetPan: boolean
    • optionalresetZoom: boolean
    • optionalresetToCenter: boolean
    • optionalstoreAsInitialCamera: boolean

    Returns boolean

setActors

  • set and overwrite actors in a viewport


    Parameters

    Returns void

setCamera

  • setCamera(cameraInterface: ICamera, storeAsInitialCamera?: boolean): void
  • sets the camera


    Parameters

    • cameraInterface: ICamera
    • optionalstoreAsInitialCamera: boolean

    Returns void

setDisplayArea

  • setDisplayArea(displayArea: DisplayArea, callResetCamera?: boolean, suppressEvents?: boolean): any
  • set displayArea for the viewport


    Parameters

    • displayArea: DisplayArea
    • optionalcallResetCamera: boolean
    • optionalsuppressEvents: boolean

    Returns any

setOptions

setPan

  • setPan(pan: Point2, storeAsInitialCamera?: boolean): any
  • Sets the canvas pan value


    Parameters

    • pan: Point2
    • optionalstoreAsInitialCamera: boolean

    Returns any

setRendered

  • setRendered(): void
  • Sets the rendered state to rendered if the render actually showed image data


    Returns void

setViewPresentation

  • Sets the presentation parameters from the specified viewPres object. Sets display area, zoom, pan, rotation, voi LUT


    Parameters

    Returns any

setViewReference

  • Navigates this viewport to the specified viewRef. Throws an exception if that isn’t possible on this viewport. Returns immediately if viewRef isn’t defined.


    Parameters

    Returns any

setZoom

  • setZoom(zoom: number, storeAsInitialCamera?: boolean): any
  • Sets the relative zoom - set to 1 to reset it


    Parameters

    • zoom: number
    • optionalstoreAsInitialCamera: boolean

    Returns any

IViewportId

IViewportId:

Interface to uniquely define a viewport in cornerstone. Note: viewportIds can be shared between different rendering engines, but having a renderingEngineId and a viewportId is required to uniquely define a viewport.

renderingEngineId

renderingEngineId: string

viewportId

viewportId: string

IVolumeInput

IVolumeInput:

VolumeInput that can be used to add a volume to a viewport. It includes mandatory volumeId but other options such as visibility, blendMode, slabThickness and callback can also be provided

optionalactorUID

actorUID?: string

optionalblendMode

blendMode?: BlendModes

Blend mode of the volume - by default it is additive

optionalcallback

Callback to be called when the volume is added to the viewport

optionalslabThickness

slabThickness?: number

Slab thickness of the volume - by default it is 0.05

optionalvisibility

visibility?: boolean

Visibility of the volume - by default it is true

volumeId

volumeId: string

Volume ID of the volume in the cache

IVolumeLoadObject

IVolumeLoadObject:

VolumeLoadObject interface which any volumeLoader should return

optionalcancelFn

cancelFn?: () => void

Type declaration

    • (): void
    • optional cancel function for loading


      Returns void

optionaldecache

decache?: () => void

Type declaration

    • (): void
    • optional decache function


      Returns void

promise

promise: Promise<IImageVolume>

promise that resolves to an ImageVolume

IVolumeViewport

IVolumeViewport:

Interface for the Volume Viewport

_actors

_actors: Map<string, any>

actors rendered in the viewport

addWidget

addWidget: (id: string, widget: any) => void

Type declaration

    • (id: string, widget: any): void
    • Parameters

      • id: string
      • widget: any

      Returns void

canvas

canvas: HTMLCanvasElement

canvas associated to the viewport

canvasToWorld

canvasToWorld: (canvasPos: Point2) => Point3

Type declaration

    • 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

      Returns Point3

customRenderViewportToCanvas

customRenderViewportToCanvas: () => unknown

Type declaration

    • (): unknown
    • whether the viewport has custom rendering


      Returns unknown

defaultOptions

defaultOptions: any

viewport default options including the axis, and background color

element

element: HTMLDivElement

public DOM element associated to the viewport

getCurrentImageId

getCurrentImageId: () => string

Type declaration