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

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


      Returns string

getCurrentImageIdIndex

getCurrentImageIdIndex: () => number

Type declaration

    • (): number
    • Uses viewport camera and volume actor to decide if the viewport is looking at the volume in the direction of acquisition (imageIds). If so, it uses the origin and focalPoint to calculate the slice index.


      Returns number

getDefaultProperties

getDefaultProperties: (volumeId?: string) => VolumeViewportProperties

Type declaration

    • Retrieve the viewport default properties If volumeId is given, we retrieve the default properties of a volumeId if it exists If not given,we return the global properties of the viewport default viewport properties including voi, invert, interpolation type, colormap


      Parameters

      • optionalvolumeId: string

      Returns VolumeViewportProperties

getFrameOfReferenceUID

getFrameOfReferenceUID: () => string

Type declaration

    • (): string
    • Returns string

getImageIds

getImageIds: (volumeId?: string) => string[]

Type declaration

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


      Parameters

      • optionalvolumeId: string

      Returns string[]

getProperties

getProperties: (volumeId?: string) => VolumeViewportProperties

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

hasImageURI

hasImageURI: (imageURI: string) => boolean

Type declaration

    • (imageURI: string): boolean
    • if the volume viewport has imageURI (no loader schema) in one of its volume actors


      Parameters

      • imageURI: string

      Returns boolean

hasVolumeId

hasVolumeId: (volumeId: string) => boolean

Type declaration

    • (volumeId: string): boolean
    • Checks if the viewport has a volume actor with the given volumeId


      Parameters

      • volumeId: string

      Returns boolean

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

useCPURendering

useCPURendering: boolean

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

addVolumes

  • addVolumes(volumeInputArray: IVolumeInput[], immediate?: boolean, suppressEvents?: boolean): Promise<void>
  • Creates and adds volume actors for all volumes defined in the volumeInputArray. For each entry, if a callback is supplied, it will be called with the new volume actor as input.


    Parameters

    • volumeInputArray: IVolumeInput[]
    • optionalimmediate: boolean
    • optionalsuppressEvents: boolean

    Returns Promise<void>

clearDefaultProperties

  • clearDefaultProperties(volumeId?: string): void
  • Remove the global default properties of the viewport or remove default properties for a volumeId if specified If volumeId is given, we remove the default properties only for this volumeId, if not the global default properties will be removed


    Parameters

    • optionalvolumeId: string

    Returns void

flip

  • Flip the viewport along the desired axis


    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[]

getBounds

  • getBounds(): any
  • getBounds gets the visible bounds of the viewport


    Returns any

getCamera

  • returns camera object


    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) Note: since the volume viewport supports fusion, to get the image data for a specific volume, use the optional volumeId argument.


    Parameters

    • optionalvolumeId: string

    Returns IImageData

getIntensityFromWorld

  • getIntensityFromWorld(point: Point3): number
  • Given a point in world coordinates, return the intensity at that point


    Parameters

    Returns 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

getSlabThickness

  • getSlabThickness(): number
  • Gets the slab thickness option in the Viewport‘s options.


    Returns number

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

removeVolumeActors

  • removeVolumeActors(actorUIDs: string[], immediate?: boolean): void
  • It removes the volume actor from the Viewport. If the volume actor is not in the viewport, it does nothing.


    Parameters

    • actorUIDs: string[]
    • optionalimmediate: boolean

    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, resetRotation?: boolean, supressEvents?: boolean): boolean
  • Reset the camera for the volume viewport


    Parameters

    • optionalresetPan: boolean
    • optionalresetZoom: boolean
    • optionalresetToCenter: boolean
    • optionalresetRotation: boolean
    • optionalsupressEvents: boolean

    Returns boolean

resetProperties

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


    Parameters

    • volumeId: string

    Returns void

resetSlabThickness

  • resetSlabThickness(): void
  • Reset the slab thickness for actors of the viewport.


    Returns void

setActors

  • set and overwrite actors in a viewport


    Parameters

    Returns void

setBlendMode

  • setBlendMode(blendMode: BlendModes, filterActorUIDs?: string[], immediate?: boolean): void
  • Sets the blendMode for actors of the viewport.


    Parameters

    • blendMode: BlendModes
    • optionalfilterActorUIDs: string[]
    • optionalimmediate: boolean

    Returns void

setCamera

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


    Parameters

    • cameraInterface: ICamera
    • optionalstoreAsInitialCamera: boolean

    Returns void

setDefaultProperties

  • Sets the default properties for the viewport. If no volumeId is provided it applies the properties to the default volume actor (first volume)


    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

setOptions

  • set options for the viewport


    Parameters

    Returns void

setOrientation

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. If no volumeId is provided it applies the properties to the default volume actor (first volume)


    Parameters

    Returns void

setRendered

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


    Returns void

setSlabThickness

  • setSlabThickness(slabThickness: number, filterActorUIDs?: string[]): void
  • Sets the slab thickness for actors of the viewport.


    Parameters

    • slabThickness: number
    • optionalfilterActorUIDs: string[]

    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

setVolumes

  • setVolumes(volumeInputArray: IVolumeInput[], immediate?: boolean, suppressEvents?: boolean): Promise<void>
  • Creates volume actors for all volumes defined in the volumeInputArray. For each entry, if a callback is supplied, it will be called with the new volume actor as input. For each entry, if a blendMode and/or slabThickness is defined, this will be set on the actor’s VolumeMapper.


    Parameters

    • volumeInputArray: IVolumeInput[]
    • optionalimmediate: boolean
    • optionalsuppressEvents: boolean

    Returns Promise<void>

setZoom

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


    Parameters

    • zoom: number
    • optionalstoreAsInitialCamera: boolean

    Returns any

ImagePixelModule

ImagePixelModule:

bitsAllocated

bitsAllocated: number

bitsStored

bitsStored: number

highBit

highBit: number

modality

modality: string

photometricInterpretation

photometricInterpretation: string

pixelRepresentation

pixelRepresentation: string

samplesPerPixel

samplesPerPixel: number

voiLUTFunction

voiLUTFunction: VOILUTFunctionType

windowCenter

windowCenter: number | number[]

windowWidth

windowWidth: number | number[]

ImagePlaneModule

ImagePlaneModule:

optionalcolumnCosines

columnCosines?: Point3

optionalcolumnPixelSpacing

columnPixelSpacing?: number

columns

columns: number

frameOfReferenceUID

frameOfReferenceUID: string

optionalimageOrientationPatient

imageOrientationPatient?: Float32Array

optionalimagePositionPatient

imagePositionPatient?: Point3

optionalpixelSpacing

pixelSpacing?: Point2

optionalrowCosines

rowCosines?: Point3

optionalrowPixelSpacing

rowPixelSpacing?: number

rows

rows: number

optionalsliceLocation

sliceLocation?: number

optionalsliceThickness

sliceThickness?: number

ImageVolumeProps

ImageVolumeProps:

ImageVolume which is considered a special case of a Volume, which is constructed out of set of images (imageIds). Unlike Volume which can be constructed from any type of volumetric data, such as nifti or nrrd,

optionaladditionalDetails

additionalDetails?: Record<string, any>

Property to store additional information

dimensions

dimensions: Point3

Dimensions of the volume (width, height, depth)

direction

direction: Mat3

Direction of the volume in world space

optionalimageData

imageData?: vtkImageData

Image data representing the volume

imageIds

imageIds: string[]

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

metadata

metadata: Metadata

Metadata describing the volume

origin

origin: Point3

Origin point of the volume in world space

optionalreferencedImageIds

referencedImageIds?: string[]

if the volume is created from a stack, the imageIds of the stack

optionalreferencedVolumeId

referencedVolumeId?: string

Optional ID of a referenced volume if this volume is derived from another

scalarData

Scalar data representing the volume’s intensity values

optionalscaling

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

Scaling parameters if the volume contains scaled data (optional)


Type declaration

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

optionalsizeInBytes

sizeInBytes?: number

Size of the volume data in bytes (optional)

spacing

spacing: Point3

Spacing between volume points in 3D world space

volumeId

volumeId: string

Unique identifier for the volume

RetrieveStage

RetrieveStage:

Retrieve stages are part of a retrieval of a set of image ids. Each retrieve stage defines which imageIds to include, as well as how that set should be handled. An imageID can be retrieved multiple times, done in order, one after the other, so that it is first retrieved as a lossy/low quality image, followed by higher qualities. The actual retrieve options used are abstracted out by the retrieve type, a simple string that defines what type of retrieve values are used.

See Progressive Loading in the overall docs for information on retrieval stages.

optionaldecimate

decimate?: number

Alternately to the positions, choose imageId’s by decimating at the given interval decimate interval/offset.

id

id: string

An id for the stage for use in the stage completion events

optionalnearbyFrames

nearbyFrames?: NearbyFrames[]

A set of frames which are nearby to replicate this frame to This allows defining how replication within the volume occurs.

optionaloffset

offset?: number

Use the given offset. For example, a decimate of 4 and offset of 1 will choose from the set [0...12] the values 1,5,9

optionalpositions

positions?: number[]

Set of positions in a list of imageID’s to select for this stage. Negative values are relative to the end, positive to the beginning, and fractional values between -1 and 1 are relative to frame count

optionalpriority

priority?: number

The queue priority to use

optionalrequestType

requestType?: RequestType

The queue request type to use.

optionalretrieveType

retrieveType?: string

Use a specified retrieve type to specify the type of retrieve this stage uses. There are four standard retrieve types, but others can be defined as required. The four standard ones are:

  • singleFast - for a fast/low quality single image
  • singleFinal - for the final quality single image
  • multipleFast - for a fast/low quality image for multiples
  • multipleFinal - for a final image for multiple images

The single/multiple split is done so that the single retrieve can be a streaming type retrieve, which doesn’t work well for multiple images where an entire set of lower quality images is desireable before starting with the high quality set, but the streaming retrieve does work very well for single images.

ViewportPreset

ViewportPreset:

ambient

ambient: string

colorTransfer

colorTransfer: string

diffuse

diffuse: string

gradientOpacity

gradientOpacity: string

interpolation

interpolation: string

name

name: string

scalarOpacity

scalarOpacity: string

shade

shade: string

specular

specular: string

specularPower

specularPower: string

VolumeProps

VolumeProps:

Properties required to instantiate a Volume object. This includes all the necessary data and metadata to define a volume in 3D/4D space.

optionaladditionalDetails

additionalDetails?: Record<string, any>

Property to store additional information

dimensions

dimensions: Point3

Dimensions of the volume (width, height, depth)

direction

direction: Mat3

Direction of the volume in world space

optionalimageData

imageData?: vtkImageData

Image data representing the volume

metadata

metadata: Metadata

Metadata describing the volume

origin

origin: Point3

Origin point of the volume in world space

optionalreferencedVolumeId

referencedVolumeId?: string

Optional ID of a referenced volume if this volume is derived from another

scalarData

Scalar data representing the volume’s intensity values

optionalscaling

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

Scaling parameters if the volume contains scaled data (optional)


Type declaration

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

optionalsizeInBytes

sizeInBytes?: number

Size of the volume data in bytes (optional)

spacing

spacing: Point3

Spacing between volume points in 3D world space

volumeId

volumeId: string

Unique identifier for the volume

Type Aliases

AABB2

AABB2: { maxX: number; maxY: number; minX: number; minY: number }

Type declaration

  • maxX: number
  • maxY: number
  • minX: number
  • minY: number

AABB3

AABB3: { maxX: number; maxY: number; maxZ: number; minX: number; minY: number; minZ: number }

Type declaration

  • maxX: number
  • maxY: number
  • maxZ: number
  • minX: number
  • minY: number
  • minZ: number

Actor

Actor: vtkActor

ActorEntry

ActorEntry: { actor: Actor | VolumeActor | ImageActor | ICanvasActor; clippingFilter?: any; referenceId?: string; slabThickness?: number; uid: string }

Cornerstone Actor Entry including actor uid, actual Actor, and slabThickness for the actor. ActorEntry is the object that is retrieved from viewport when calling viewport.getActor(s)


Type declaration

  • actor: Actor | VolumeActor | ImageActor | ICanvasActor

    actual actor object

  • optionalclippingFilter?: any

    clipping filter applied to actor surfaces

  • optionalreferenceId?: string

    the id of the reference volume from which this actor is derived or created

  • optionalslabThickness?: number

    slab thickness for the actor

  • uid: string

    actor UID

ActorSliceRange

ActorSliceRange: { actor: VolumeActor; current: number; focalPoint: Point3; max: number; min: number; viewPlaneNormal: Point3 }

Object containing the min, max and current position in the normal direction for the actor


Type declaration

AffineMatrix

AffineMatrix: [[number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number]]

BoundsIJK

BoundsIJK: [Point2, Point2, Point2]

BoundsLPS

BoundsLPS: [Point2, Point2, Point2]

CPUFallbackColormapData

CPUFallbackColormapData: { colors?: Point4[]; gamma?: number; name: string; numColors?: number; numOfColors?: number; segmentedData?: unknown }

Type declaration

  • optionalcolors?: Point4[]
  • optionalgamma?: number
  • name: string
  • optionalnumColors?: number
  • optionalnumOfColors?: number
  • optionalsegmentedData?: unknown

CPUFallbackColormapsData

CPUFallbackColormapsData: {}

Type declaration

CPUFallbackLUT

CPUFallbackLUT: { lut: number[] }

Type declaration

  • lut: number[]

CPUFallbackRenderingTools

CPUFallbackRenderingTools: { colorLUT?: CPUFallbackLookupTable; colormapId?: string; lastRenderedImageId?: string; lastRenderedIsColor?: boolean; lastRenderedViewport?: { colormap: unknown; hflip: boolean; invert: boolean; modalityLUT: CPUFallbackLUT; rotation: number; vflip: boolean; voiLUT: CPUFallbackLUT; windowCenter: number | number[]; windowWidth: number | number[] }; renderCanvas?: HTMLCanvasElement; renderCanvasContext?: CanvasRenderingContext2D; renderCanvasData?: ImageData }

Type declaration

  • optionalcolorLUT?: CPUFallbackLookupTable
  • optionalcolormapId?: string
  • optionallastRenderedImageId?: string
  • optionallastRenderedIsColor?: boolean
  • optionallastRenderedViewport?: { colormap: unknown; hflip: boolean; invert: boolean; modalityLUT: CPUFallbackLUT; rotation: number; vflip: boolean; voiLUT: CPUFallbackLUT; windowCenter: number | number[]; windowWidth: number | number[] }
    • colormap: unknown
    • hflip: boolean
    • invert: boolean
    • modalityLUT: CPUFallbackLUT
    • rotation: number
    • vflip: boolean
    • voiLUT: CPUFallbackLUT
    • windowCenter: number | number[]
    • windowWidth: number | number[]
  • optionalrenderCanvas?: HTMLCanvasElement
  • optionalrenderCanvasContext?: CanvasRenderingContext2D
  • optionalrenderCanvasData?: ImageData

CPUFallbackViewport

CPUFallbackViewport: { colormap?: CPUFallbackColormap; displayedArea?: CPUFallbackViewportDisplayedArea; focalPoint?: number[]; hflip?: boolean; invert?: boolean; modality?: string; modalityLUT?: CPUFallbackLUT; parallelScale?: number; pixelReplication?: boolean; rotation?: number; scale?: number; translation?: { x: number; y: number }; vflip?: boolean; voi?: { windowCenter: number; windowWidth: number }; voiLUT?: CPUFallbackLUT }

Type declaration

  • optionalcolormap?: CPUFallbackColormap
  • optionaldisplayedArea?: CPUFallbackViewportDisplayedArea
  • optionalfocalPoint?: number[]
  • optionalhflip?: boolean
  • optionalinvert?: boolean
  • optionalmodality?: string
  • optionalmodalityLUT?: CPUFallbackLUT
  • optionalparallelScale?: number
  • optionalpixelReplication?: boolean
  • optionalrotation?: number
  • optionalscale?: number
  • optionaltranslation?: { x: number; y: number }
    • x: number
    • y: number
  • optionalvflip?: boolean
  • optionalvoi?: { windowCenter: number; windowWidth: number }
    • windowCenter: number
    • windowWidth: number
  • optionalvoiLUT?: CPUFallbackLUT

CPUFallbackViewportDisplayedArea

CPUFallbackViewportDisplayedArea: { brhc: { x: number; y: number }; columnPixelSpacing: number; presentationSizeMode: string; rowPixelSpacing: number; tlhc: { x: number; y: number } }

Type declaration

  • brhc: { x: number; y: number }
    • x: number
    • y: number
  • columnPixelSpacing: number
  • presentationSizeMode: string
  • rowPixelSpacing: number
  • tlhc: { x: number; y: number }
    • x: number
    • y: number

CPUIImageData

CPUIImageData: { calibration?: IImageCalibration; dimensions: Point3; direction: Mat3; hasPixelSpacing?: boolean; imageData: CPUImageData; metadata: { Modality: string }; origin: Point3; preScale?: { scaled?: boolean; scalingParameters?: { modality?: string; rescaleIntercept?: number; rescaleSlope?: number; suvbw?: number } }; scalarData: PixelDataTypedArray; scaling: Scaling; spacing: Point3 }

Type declaration

  • optionalcalibration?: IImageCalibration
  • dimensions: Point3
  • direction: Mat3
  • optionalhasPixelSpacing?: boolean

    whether the image has pixel spacing and it is not undefined

  • imageData: CPUImageData
  • metadata: { Modality: string }
    • Modality: string
  • origin: Point3
  • optionalpreScale?: { scaled?: boolean; scalingParameters?: { modality?: string; rescaleIntercept?: number; rescaleSlope?: number; suvbw?: number } }

    preScale object

    • 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: PixelDataTypedArray
  • scaling: Scaling
  • spacing: Point3

CPUImageData

CPUImageData: { getDimensions?: () => Point3; getDirection?: () => Mat3; getIndexToWorld?: () => Point3; getScalarData?: () => PixelDataTypedArray; getSpacing?: () => Point3; getWorldToIndex?: () => Point3; indexToWorld?: (point: Point3) => Point3; worldToIndex?: (point: Point3) => Point3 }

Type declaration

Color

Color: [number, number, number, number]

Four elements RGBA as 0-255

ColorLUT

ColorLUT: Color[]

Color LUT Array - Array of colors [[0,0,0,0], [200,200,200,200], ….]

ColormapPublic

ColormapPublic: { name?: string; opacity?: OpacityMapping[] | number }

Type declaration

  • optionalname?: string

    name of the colormap

  • optionalopacity?: OpacityMapping[] | number

ColormapRegistration

ColormapRegistration: { ColorSpace: string; Name: string; RGBPoints: RGB[] | number[] }

Type declaration

  • ColorSpace: string
  • Name: string
  • RGBPoints: RGB[] | number[]

ContourData

ContourData: { color: Point3; points: Point3[]; segmentIndex: number; type: ContourType }

Type declaration

ContourSetData

ContourSetData: { color?: Point3; data: ContourData[]; frameOfReferenceUID: string; id: string; segmentIndex?: number }

Type declaration

  • optionalcolor?: Point3
  • data: ContourData[]
  • frameOfReferenceUID: string
  • id: string
  • optionalsegmentIndex?: number

Cornerstone3DConfig

Cornerstone3DConfig: { detectGPUConfig: GetGPUTier; enableCacheOptimization: boolean; gpuTier?: TierResult; isMobile: boolean; rendering: { preferSizeOverAccuracy: boolean; strictZSpacingForVolumeViewport: boolean; useCPURendering: boolean; useNorm16Texture: boolean } }

Type declaration

  • detectGPUConfig: GetGPUTier

    When the gpuTier is not provided, the detectGPUConfig is passed as an argument to the getGPUTier method. Its type is the GetGPUTier in the detect-gpu library. https://github.com/pmndrs/detect-gpu/blob/master/src/index.ts#L20

  • enableCacheOptimization: boolean

    This flag controls whether to enable cache optimization or not. Basically, when we have a stack viewport (image stack) and we convert it to a volume the volume will be cached as well as the stack. However, if we can optimize this by going back to the image cache and create a view at the correct offset of the bigger volume array buffer, this will save memory. This will get enabled if cornerstone3D is configured to use SharedArrayBuffer, the reason is that when we modify the image cache then the images are referring to a different buffer (SharedArrayBuffer) and some systems don’t support shared array buffers.

  • optionalgpuTier?: TierResult

    It is used to store the device information, we use it if provided if not a network call is performed. Its type is the TierResult in the detect-gpu library. https://github.com/pmndrs/detect-gpu/blob/master/src/index.ts#L82

  • isMobile: boolean

    Whether the device is mobile or not.

  • rendering: { preferSizeOverAccuracy: boolean; strictZSpacingForVolumeViewport: boolean; useCPURendering: boolean; useNorm16Texture: boolean }
    • preferSizeOverAccuracy: boolean
    • strictZSpacingForVolumeViewport: boolean

      flag to control whether to use fallback behavior for z-spacing calculation in volume viewports when the necessary metadata is missing. If enabled, we will fall back to using slice thickness or a default value of 1 to render the volume viewport when z-spacing cannot be calculated from images This can help improve the usability and robustness of the visualization in scenarios where the metadata is incomplete or missing, but it might be wrong assumption in certain scenarios.

    • useCPURendering: boolean
    • useNorm16Texture: boolean

DisplayArea

DisplayArea: { imageArea?: [number, number]; imageCanvasPoint?: { canvasPoint?: [number, number]; imagePoint: [number, number] }; interpolationType?: InterpolationType; scale?: number; storeAsInitialCamera?: boolean; type?: SCALE | FIT }

The display area type allows specifying or updating the image position and size based on the display area that it is shown in and based on the image size.

Two types are currently defined, the default ‘FIT’, specifies scaling to fit the given image area. For this type, the area that is scaled to fit is the imageArea times the image size. For example, an imageArea of [0.5,2] with a 512 square image will try to fit 0.5512 = 256 pixels width wise, and 2512 = 1024 height wise.

The type ‘SCALE’ means to use a scale factor, such as 1.0, which means to make every image pixel fit one physical display pixel.

Then, the image is positioned such that the image fractional position imagePoint is located at the canvas fractional point canvasPoint. Using fractional points allows being independent of image size.

Finally, the store as initial camera allows the zoom and pan values to be set to 1 and [0,0] respectively for the initially displayed position, as well as having the reset camera reset to the specified display area.


Type declaration

  • optionalimageArea?: [number, number]
  • optionalimageCanvasPoint?: { canvasPoint?: [number, number]; imagePoint: [number, number] }
    • optionalcanvasPoint?: [number, number]

      Pan the image such that the target imagePoint is located at the canvas point fraction of the canvas.

    • imagePoint: [number, number]

      Use the fractional imagePoint as the target image point to position

  • optionalinterpolationType?: InterpolationType
  • optionalscale?: number
  • optionalstoreAsInitialCamera?: boolean

    Make this display area the default and reset/navigate will reapply this

  • optionaltype?: SCALE | FIT

FlipDirection

FlipDirection: { flipHorizontal?: boolean; flipVertical?: boolean }

Flip direction which can be horizontal or vertical.


Type declaration

  • optionalflipHorizontal?: boolean
  • optionalflipVertical?: boolean

IVolume

Backwards compatibility for IVolume

ImageActor

ImageActor: vtkImageSlice

ImageLoadListener

ImageLoadListener: { errorCallback: (imageId: any, permanent: any, reason: any) => void; getLoaderImageOptions?: (imageId: any) => Record<string, unknown>; successCallback: (imageId: any, image: any) => void }

Type declaration

  • errorCallback: (imageId: any, permanent: any, reason: any) => void
      • (imageId: any, permanent: any, reason: any): void
      • Called when an image fails to load. A failure is permanent if no more attempts will be made.


        Parameters

        • imageId: any
        • permanent: any
        • reason: any

        Returns void

  • optionalgetLoaderImageOptions?: (imageId: any) => Record<string, unknown>
      • (imageId: any): Record<string, unknown>
      • Gets the target options for loading a given image, used by the image loader.

        @throws

        exception to prevent further loading of this image


        Parameters

        • imageId: any

        Returns Record<string, unknown>

        Loader image options to use when loading the image. Note this is often a DICOMLoaderImageOptions, but doesn’t have to be.

  • successCallback: (imageId: any, image: any) => void
      • (imageId: any, image: any): void
      • Called when an image is loaded. May be called multiple times with increasing status values.


        Parameters

        • imageId: any
        • image: any

        Returns void

ImageLoaderFn

ImageLoaderFn: (imageId: string, options?: Record<string, any>) => { cancelFn?: () => void | undefined; decache?: () => void | undefined; promise: Promise<Record<string, any>> }

Type declaration

    • (imageId: string, options?: Record<string, any>): { cancelFn?: () => void | undefined; decache?: () => void | undefined; promise: Promise<Record<string, any>> }
    • Any imageLoader function should implement a loading given the imageId and returns a mandatory promise which will resolve to the loaded image object. Additional cancelFn and decache can be implemented.


      Parameters

      • imageId: string
      • optionaloptions: Record<string, any>

      Returns { cancelFn?: () => void | undefined; decache?: () => void | undefined; promise: Promise<Record<string, any>> }

      • optionalcancelFn?: () => void | undefined
          • (): void | undefined
          • Returns void | undefined

      • optionaldecache?: () => void | undefined
          • (): void | undefined
          • Returns void | undefined

      • promise: Promise<Record<string, any>>

        Promise that resolves to the image object

ImageSliceData

ImageSliceData: { imageIndex: number; numberOfSlices: number }

Type declaration

  • imageIndex: number
  • numberOfSlices: number

InternalVideoCamera

InternalVideoCamera: { panWorld?: Point2; parallelScale?: number }

Type declaration

  • optionalpanWorld?: Point2
  • optionalparallelScale?: number

Mat3

Mat3: [number, number, number, number, number, number, number, number, number] | Float32Array

This represents a 3x3 matrix of numbers

Metadata

Metadata: { BitsAllocated: number; BitsStored: number; Columns: number; FrameOfReferenceUID: string; HighBit: number; ImageOrientationPatient: number[]; Modality: string; PhotometricInterpretation: string; PixelRepresentation: number; PixelSpacing: number[]; Rows: number; SamplesPerPixel: number; SeriesInstanceUID?: string; VOILUTFunction: string; voiLut: VOI[] }

Type declaration

  • BitsAllocated: number

    Number of bits allocated for each pixel sample. Each sample shall have the same number of bits allocated

  • BitsStored: number

    Number of bits stored for each pixel sample

  • Columns: number

    Number of columns in the image.

  • FrameOfReferenceUID: string

    Uniquely identifies the Frame of Reference for a Series

  • HighBit: number

    Most significant bit for pixel sample data

  • ImageOrientationPatient: number[]

    The direction cosines of the first row and the first column with respect to the patient

  • Modality: string

    Image Modality

  • PhotometricInterpretation: string

    Specifies the intended interpretation of the pixel data

  • PixelRepresentation: number

    Data representation of the pixel samples.

  • PixelSpacing: number[]

    Physical distance in the patient between the center of each pixel

  • Rows: number

    Number of rows in the image.

  • SamplesPerPixel: number
  • optionalSeriesInstanceUID?: string

    SeriesInstanceUID of the volume

  • VOILUTFunction: string

    VOILUTFunction for the image which is LINEAR or SAMPLED_SIGMOID

  • voiLut: VOI[]

    Window Level/Center for the image

NearbyFrames

NearbyFrames: { imageQualityStatus?: ImageQualityStatus; offset: number }

Nearby frames are used in a volume to fill the entire volume quickly without needing to have retrieved them from a remote/slow location. This gives the appearance of a complete volume extremely quickly.


Type declaration

  • optionalimageQualityStatus?: ImageQualityStatus

    The status to set a newly filled image from

  • offset: number

    The offset of the nearby frame to fill from the current position. For example, if the current image is index 32, and the offset is -1, then the frame at index 31 will be filled with 32’s image data.

OrientationVectors

OrientationVectors: { viewPlaneNormal: Point3; viewUp: Point3 }
  • viewUp - An array of three floating point numbers describing a vector that represents the up direction for the view.
  • viewPlaneNormal - The direction of the projection

see Axial vs Sagittal vs Coronal see Rendering_Core_Camera

@example
renderingEngine.setViewports([
{
viewportId: 'a-viewport-uid',
type: ViewportType.ORTHOGRAPHIC,
element: document.querySelector('div'),
defaultOptions: {
orientation: {
viewUp: [0, 0, 1],
viewPlaneNormal: [1, 0, 0],
},
background: [1, 0, 0],
},
}]);

Type declaration

  • viewPlaneNormal: Point3

    Slice Normal for the viewport - the normal that points in the opposite direction of the slice normal out of screen and is negative of direction of projection

  • viewUp: Point3

    viewUp direction for the viewport - the vector that points from bottom to top of the viewport

PTScaling

PTScaling: { suvbsa?: number; suvbw?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number; suvlbm?: number }

Type declaration

  • optionalsuvbsa?: number

    SUV body surface area

  • optionalsuvbw?: number

    SUV body weight

  • optionalsuvbwToSuvbsa?: number

    suv body weight to suv body surface area

  • optionalsuvbwToSuvlbm?: number

    suv body weight to suv lean body mass

  • optionalsuvlbm?: number

    SUV lean body mass

PixelDataTypedArray

PixelDataTypedArray: Float32Array | Int16Array | Uint16Array | Uint8Array | Int8Array | Uint8ClampedArray

PixelDataTypedArrayString

PixelDataTypedArrayString: Float32Array | Int16Array | Uint16Array | Uint8Array | Int8Array | Uint8ClampedArray

Plane

Plane: [number, number, number, number]

Plane equation Ax+By+Cz=D, plane is defined by [A, B, C, D]

Point2

Point2: [number, number]

This duplicates the typing established in gl-matrix for a vec2

Point3

Point3: [number, number, number]

This duplicates the typing established in gl-matrix for a vec3

Point4

Point4: [number, number, number, number]

This represents a 4-vector or RGBA value.

PointsXYZ

PointsXYZ: { x: number[]; y: number[]; z: number[] }

Some algorithms use separated values


Type declaration

  • x: number[]
  • y: number[]
  • z: number[]

PublicContourSetData

PublicContourSetData: ContourSetData

PublicSurfaceData

PublicSurfaceData: { color?: Point3; data: SurfaceData; frameOfReferenceUID: string; id: string }

Type declaration

PublicViewportInput

PublicViewportInput: { defaultOptions?: ViewportInputOptions; element: HTMLDivElement; type: ViewportType; viewportId: string }

Public Interface for viewport input to get enabled/disabled or set


Type declaration

  • optionaldefaultOptions?: ViewportInputOptions

    options for the viewport

  • element: HTMLDivElement

    HTML element in the DOM

  • type: ViewportType

    type of the viewport

  • viewportId: string

    unique id for the viewport in the renderingEngine

RGB

RGB: [number, number, number]

RGB color type.

RangeRetrieveOptions

RangeRetrieveOptions: BaseRetrieveOptions & { chunkSize?: number | (metadata: any) => number; rangeIndex: number }

Range retrieves are used to retrieve part of an image, before the rest of the data is available. This is different from streaming, below, in that the request itself uses a byte range to retrieve part of the data, and retrieves the entire request, but part of the image data. That separates the timing for the retrieve, and is essential for fast retrieve for multiple images.

Often the total size of the range is unknown due to cors issues, if so, the decodeLevel will need to be set manually here.

ReferenceCompatibleOptions

ReferenceCompatibleOptions: { asVolume?: boolean; imageURI?: string; withNavigation?: boolean; withOrientation?: boolean }

It is often important to decide if a given view can display a specific view reference. For example, annotations need to know if they are shown on a view. Some operations need to know if the view COULD show the given object if certain changes were made to the view. This object allows specifying what changes are permitted in order to determine if the view could show the image.


Type declaration

  • optionalasVolume?: boolean

    For a stack viewport, return true if this viewport could show the given view if it were converted into a volume viewport. Has no affect on volume viewports.

  • optionalimageURI?: string

    Use this imageURI for testing - may or may not be the current one. Should be a straight contains URI for the set of imageIds in any of the volumes or set of image ids. This is an optimization setting only that makes the test faster, and does not need to be provided.

  • optionalwithNavigation?: boolean

    Test whether the view could be shown if the viewport were navigated. That is, test is just changing the slice position and zoom/pan would allow showing the view.

  • optionalwithOrientation?: boolean

    For volume viewports, return true if this viewport could show the given view if the orientation was changed.

RetrieveOptions

RetrieveOptions: BaseRetrieveOptions | StreamingRetrieveOptions | RangeRetrieveOptions

Retrieve options are Base, Range or Streaming RetrieveOptions.

Scaling

Scaling: { PT?: PTScaling }

Type declaration

ScalingParameters

ScalingParameters: { modality: string; rescaleIntercept: number; rescaleSlope: number; suvbsa?: number; suvbw?: number; suvlbm?: number }

Type declaration

  • modality: string

    modality

  • rescaleIntercept: number

    b in m*p+b which specifies the offset of the transformation

  • rescaleSlope: number

    m in m*p+b which specifies the linear transformation from stored pixels to memory value

  • optionalsuvbsa?: number

    SUV body surface area

  • optionalsuvbw?: number

    SUV body weight

  • optionalsuvlbm?: number

    SUV lean body mass

StackInputCallback

StackInputCallback: (params: { imageActor: ImageActor; imageId: string }) => unknown

Type declaration

    • (params: { imageActor: ImageActor; imageId: string }): unknown
    • Stack input callback type, used to perform operations on the image data after it has been loaded.


      Parameters

      • params: { imageActor: ImageActor; imageId: string }

      Returns unknown

StackViewportProperties

StackViewportProperties: ViewportProperties & { interpolationType?: InterpolationType; isComputedVOI?: boolean; rotation?: number; suppressEvents?: boolean }

Stack Viewport Properties

StreamingRetrieveOptions

StreamingRetrieveOptions: BaseRetrieveOptions & { streaming: boolean }

Streaming retrieve is done when a request is decoded as it arrives. That is, if you receive the first 73k as the first part of the request, then that will attempt to be decoded.

SurfaceData

SurfaceData: { points: number[]; polys: number[] }

Type declaration

  • points: number[]
  • polys: number[]

TransformMatrix2D

TransformMatrix2D: [number, number, number, number, number, number]

used for CPU rendering

VOI

VOI: { windowCenter: number; windowWidth: number }

Type declaration

  • windowCenter: number

    Window Center for display

  • windowWidth: number

    Window Width for display

VOIRange

VOIRange: { lower: number; upper: number }

Type declaration

  • lower: number

    lower value for display

  • upper: number

    upper value for display

VideoViewportInput

VideoViewportInput: { canvas: HTMLCanvasElement; defaultOptions: any; element: HTMLDivElement; id: string; renderingEngineId: string; sHeight: number; sWidth: number; sx: number; sy: number; type: ViewportType }

Type declaration

  • canvas: HTMLCanvasElement
  • defaultOptions: any
  • element: HTMLDivElement
  • id: string
  • renderingEngineId: string
  • sHeight: number
  • sWidth: number
  • sx: number
  • sy: number
  • type: ViewportType

VideoViewportProperties

VideoViewportProperties: ViewportProperties & { loop?: boolean; muted?: boolean; pan?: Point2; playbackRate?: number; scrollSpeed?: number }

Stack Viewport Properties

ViewPresentation

ViewPresentation: { displayArea?: DisplayArea; pan?: Point2; rotation?: number; slabThickness?: number; zoom?: number }

A view presentation stores information about how the view is presented to the user, such as rotation, the displayed area, pan/zoom etc. This is represented as values which are independent of the view type or size as much as possible, by normalizing the values to the type of view presented. This allows remember or synchronizing values in a much wider variety of places than using the raw/underlying view data such as camera position.


Type declaration

  • optionaldisplayArea?: DisplayArea

    The display area being shown. This is more consistent than applying a set of boundary areas.

  • optionalpan?: Point2

    The pan value is how far the pan has moved relative to the fit to canvas or relative to the display area initial position/sizing. true is the default units, which is relative to the initial canvas setting, in zoom relative units.

  • optionalrotation?: number

    The rotation of the view - this is related to cameraViewUp, but is relative to the viewNormal and the default viewUp for that viewNormal.

  • optionalslabThickness?: number

    The slice thickness - in frames(true/default) it will be 1 for a frame distance of 1 pixel thickness, while for mm will be in mm distance.

  • optionalzoom?: number

    The zoom value is a zoom factor relative either to fit to canvas or relative to the display area. The default true units are relative to the initial camera scale to fit is used to get units relative to the scale to fit camera.

ViewPresentationSelector

ViewPresentationSelector: { displayArea?: boolean; paletteLut?: boolean; pan?: boolean; rotation?: boolean; slabThickness?: boolean; windowLevel?: boolean; zoom?: boolean }

A view presentation selector allows choosing what view attributes should be returned by a call to getViewPresentation. This allows a shared selection object to be used to specify which presentation attributes are to be used.

For example, a synchronizer might choose to use a presentation selector so that multiple viewports could specify to synchronizer, say slabThickness and windowLevel across one set, while a different synchronizer would choose to apply zoom and pan. Then, a resize operation might choose to synchronize display area, zoom and pan, but not window level or slab thickness. A store/remember state of viewport might choose to synchronize everything Individual tools might choose to use synchronization of the specific attribute which they are modifying (such as rotation) for history undo/redo, but use the same re-apply function to undo the remembered history.

It is certainly possible to implement each of these with their own selectors which call the particular get/set functions, but that makes it more work to share particular sets for different uses.


Type declaration

  • optionaldisplayArea?: boolean
  • optionalpaletteLut?: boolean
  • optionalpan?: boolean
  • optionalrotation?: boolean
  • optionalslabThickness?: boolean
  • optionalwindowLevel?: boolean
  • optionalzoom?: boolean

ViewReference

ViewReference: { FrameOfReferenceUID: string; bounds?: BoundsLPS; cameraFocalPoint?: Point3; referencedImageId?: string; sliceIndex?: number | [number, number]; viewPlaneNormal?: Point3; viewUp?: Point3; volumeId?: string }

A view reference references the image/location of an image. Typical use cases include remembering the current position of a viewport to allow returning to it later, as well as determining whether specific views should show annotations or other overlay information.


Type declaration

  • FrameOfReferenceUID: string

    The FrameOfReferenceUID

  • optionalbounds?: BoundsLPS

    The bounds that are shown. Allows specifying whether a view includes particular bounds or not. This will be in world coordinates.

  • optionalcameraFocalPoint?: Point3

    The focal point of the camera in world space. The focal point is used for to define the stack positioning, but not the zoom/pan (which is defined by the view presentation object.)

    Single point objects (probe etc) should use the probe point as the camera focal point as that allows omitting the view plane normal and showing the probe in any orientation.

  • optionalreferencedImageId?: string

    An optional property used to specify the particular image that this view includes. For volumes, that will specify which image is closest to the requested point(s) in some fashion, or will be undefined when the reference applies to any volume with the same frame of reference.

    The naming of this particular attribute matches the DICOM SR naming for the referenced image, as well as historical naming in CS3D.

  • optionalsliceIndex?: number | [number, number]

    The slice index or range for this view.

    <b>
    NOTE
    </b>
    The slice index is relative to the volume or stack of images. You cannot apply a slice index from one volume to another as they do NOT apply. The referencedImageId should belong to the volume you are trying to apply to, the viewPlane normal should be identical, and then you can apply the sliceIndex.

    For stack viewports, the referencedImageId should occur at the given slice index.

    <b>
    Note 2
    </b>
    slice indices don’t necessarily indicate anything positionally within the stack of images - subsequent slice indexes can be at opposite ends or can be co-incident but separate types of images.

  • optionalviewPlaneNormal?: Point3

    The normal for the current view. This defines the plane used to show the 2d annotation. This should be omitted if the annotation is a point to allows for single-point annotations.

  • optionalviewUp?: Point3

    The view up - this is only used for resetting orientation

  • optionalvolumeId?: string

    VolumeId that the referencedImageId was chosen from

ViewReferenceSpecifier

ViewReferenceSpecifier: { forFrameOfReference?: boolean; points?: Point3[]; sliceIndex?: number | [number, number]; volumeId?: string }

Specifies what view to get a reference for. This set of options allows a Viewport to return a reference for an image not currently in view, such as for a different slice, or containing a given set of points.


Type declaration

  • optionalforFrameOfReference?: boolean

    Specifies to get a view reference that refers to the generic frame of reference rather than to a specific volume or stack. Thus, the view reference would be compatible with any view showing the same frame of reference UID.

  • optionalpoints?: Point3[]

    Set of points to get a reference for, in world space

  • optionalsliceIndex?: number | [number, number]

    The slice index within the current viewport camera to get a reference for. Note that slice indexes are dependent on the particular view being shown and cannot be shared across different view types such as stacks and volumes, or two viewports showing different orientations or slab thicknesses.

  • optionalvolumeId?: string

    The volumeId to reference

ViewportInputOptions

ViewportInputOptions: { background?: RGB; displayArea?: DisplayArea; orientation?: OrientationAxis | OrientationVectors; parallelProjection?: boolean; suppressEvents?: boolean }

This type defines the shape of viewport input options, so we can throw when it is incorrect.


Type declaration

  • optionalbackground?: RGB

    background color

  • optionaldisplayArea?: DisplayArea

    displayArea of interest

  • optionalorientation?: OrientationAxis | OrientationVectors

    orientation of the viewport which can be either an Enum for axis Enums.OrientationAxis.[AXIAL|SAGITTAL|CORONAL|DEFAULT] or an object with viewPlaneNormal and viewUp

  • optionalparallelProjection?: boolean

    parallel projection settings, Note that this will only be used for VOLUME_3D viewport. You can’t modify the parallel projection of a stack viewport or volume viewport using viewport input options.

  • optionalsuppressEvents?: boolean

    whether the events should be suppressed and not fired

ViewportProperties

ViewportProperties: { VOILUTFunction?: VOILUTFunctionType; colormap?: ColormapPublic; interpolationType?: InterpolationType; invert?: boolean; rotation?: number; voiRange?: VOIRange }

Shared Viewport Properties between Stack and Volume Viewports


Type declaration

  • optionalVOILUTFunction?: VOILUTFunctionType

    VOILUTFunction type which is LINEAR or SAMPLED_SIGMOID

  • optionalcolormap?: ColormapPublic

    Colormap applied to the viewport

  • optionalinterpolationType?: InterpolationType

    interpolation type

  • optionalinvert?: boolean

    invert flag - whether the image is inverted

  • optionalrotation?: number

    Rotation of the camera

  • optionalvoiRange?: VOIRange

    voi range (upper, lower) for the viewport

VolumeActor

VolumeActor: vtkVolume

VolumeInputCallback

VolumeInputCallback: (params: { volumeActor: VolumeActor; volumeId: string }) => unknown

Type declaration

    • (params: { volumeActor: VolumeActor; volumeId: string }): unknown
    • Volume input callback type, used to perform operations on the volume data after it has been loaded.


      Parameters

      Returns unknown

VolumeLoaderFn

VolumeLoaderFn: (volumeId: string, options?: Record<string, any>) => { cancelFn?: () => void | undefined; decache?: () => void | undefined; promise: Promise<Record<string, any>> }

Type declaration

    • (volumeId: string, options?: Record<string, any>): { cancelFn?: () => void | undefined; decache?: () => void | undefined; promise: Promise<Record<string, any>> }
    • Any volumeLoader function should implement a loading given the volumeId and returns a mandatory promise which will resolve to the loaded volume object. Additional cancelFn and decache can be implemented.


      Parameters

      • volumeId: string
      • optionaloptions: Record<string, any>

      Returns { cancelFn?: () => void | undefined; decache?: () => void | undefined; promise: Promise<Record<string, any>> }

      • optionalcancelFn?: () => void | undefined
          • (): void | undefined
          • cancel function


            Returns void | undefined

      • optionaldecache?: () => void | undefined
          • (): void | undefined
          • decache function


            Returns void | undefined

      • promise: Promise<Record<string, any>>

        promise that resolves to the volume object

VolumeViewportProperties

VolumeViewportProperties: ViewportProperties & { orientation?: OrientationAxis; preset?: string; slabThickness?: number }

Stack Viewport Properties