Types
Index
Namespaces
Interfaces
- CPUFallbackColormap
- CPUFallbackEnabledElement
- CPUFallbackLookupTable
- CPUFallbackTransform
- CustomEventType
- ICache
- ICachedGeometry
- ICachedImage
- ICachedVolume
- ICamera
- IContour
- IContourSet
- IEnabledElement
- IGeometry
- IGeometryLoadObject
- IImage
- IImageData
- IImageLoadObject
- IImageVolume
- IRegisterImageLoader
- IRenderingEngine
- IStackViewport
- IStreamingImageVolume
- IStreamingVolumeProperties
- IViewport
- IViewportId
- IVolume
- IVolumeInput
- IVolumeLoadObject
- IVolumeViewport
- ViewportPreset
Type Aliases
- Actor
- ActorEntry
- ActorSliceRange
- CPUFallbackColormapData
- CPUFallbackColormapsData
- CPUFallbackLUT
- CPUFallbackRenderingTools
- CPUFallbackViewport
- CPUFallbackViewportDisplayedArea
- CPUIImageData
- CPUImageData
- ContourData
- ContourSetData
- FlipDirection
- ImageLoaderFn
- ImageSliceData
- Mat3
- Metadata
- OrientationVectors
- PTScaling
- Plane
- Point2
- Point3
- Point4
- PublicContourSetData
- PublicSurfaceData
- PublicViewportInput
- Scaling
- ScalingParameters
- StackViewportProperties
- SurfaceData
- TransformMatrix2D
- VOI
- VOIRange
- ViewportInputOptions
- VolumeActor
- VolumeInputCallback
- VolumeLoaderFn
- VolumeViewportProperties
Namespaces
EventTypes
CameraModifiedEvent
CameraModifiedEventDetail
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
ElementDisabledEvent
ELEMENT_DISABLED Event type
ElementDisabledEventDetail
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
ELEMENT_ENABLED Event type
ElementEnabledEventDetail
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
IMAGE_CACHE_IMAGE_ADDED Event type
ImageCacheImageAddedEventDetail
ImageCacheImageRemovedEvent
IMAGE_CACHE_IMAGE_REMOVED Event type
ImageCacheImageRemovedEventDetail
IMAGE_CACHE_IMAGE_REMOVED Event’s data
Type declaration
imageId: string
the removed image id
ImageLoadProgressEvent
IMAGE_LOAD_PROGRESS
ImageLoadProgressEventDetail
IMAGE_LOAD_PROGRESS Event’s data. Note this is only for one image load and NOT volume load.
Type declaration
imageId: string
loading image image id
loaded: number
the bytes browser receive
percent: number
loaded divided by total * 100 - shows the percentage of the image loaded
total: number
the total bytes settled by the header
url: string
url we are loading from
ImageLoadedEvent
IMAGE_LOADED Event type
ImageLoadedEventDetail
ImageLoadedFailedEvent
IMAGE_LOADED_FAILED Event type
ImageLoadedFailedEventDetail
IMAGE_LOADED_FAILED Event’s data
Type declaration
error: unknown
imageId: string
the imageId for the image
ImageRenderedEvent
IMAGE_RENDERED Event type
ImageRenderedEventDetail
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
ImageSpacingCalibratedEvent
IMAGE_SPACING_CALIBRATED
ImageSpacingCalibratedEventDetail
IMAGE_SPACING_CALIBRATED Event’s data
Type declaration
columnScale: number
element: HTMLDivElement
imageData: vtkImageData
imageId: string
renderingEngineId: string
rowScale: number
viewportId: string
worldToIndex: mat4
ImageVolumeModifiedEvent
IMAGE_VOLUME_MODIFIED Event type
ImageVolumeModifiedEventDetail
IMAGE_VOLUME_MODIFIED Event’s data
Type declaration
FrameOfReferenceUID: string
FrameOfReferenceUID where the volume belongs to
imageVolume: IImageVolume
the modified volume
PreStackNewImageEvent
START_NEW_IMAGE
PreStackNewImageEventDetail
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
START_NEW_IMAGE
StackNewImageEventDetail
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
STACK_VIEWPORT_NEW_STACK
StackViewportNewStackEventDetail
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
StackViewportScrollEventDetail
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
VOI_MODIFIED Event type
VoiModifiedEventDetail
VOI_MODIFIED Event’s data
Type declaration
range: VOIRange
new VOI range
viewportId: string
Viewport Unique ID in the renderingEngine
optionalvolumeId?: string
Unique ID for the volume in the cache
VolumeCacheVolumeAddedEvent
VOLUME_CACHE_VOLUME_ADDED Event type
VolumeCacheVolumeAddedEventDetail
VolumeCacheVolumeRemovedEvent
VOLUME_CACHE_VOLUME_REMOVED Event type
VolumeCacheVolumeRemovedEventDetail
VOLUME_CACHE_VOLUME_REMOVED Event’s data
Type declaration
volumeId: string
the removed volume id
VolumeLoadedEvent
VOLUME_LOADED Event type
VolumeLoadedEventDetail
VolumeLoadedFailedEvent
VOLUME_LOADED_FAILED Event type
VolumeLoadedFailedEventDetail
VOLUME_LOADED_FAILED Event’s data
Type declaration
error: unknown
volumeId: string
the volumeId for the volume
VolumeNewImageEvent
VOLUME_NEW_IMAGE
VolumeNewImageEventDetail
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
Interfaces
CPUFallbackColormap
addColor
Type declaration
Parameters
rgba: Point4
Returns void
buildLookupTable
Type declaration
Parameters
Returns void
clearColors
Type declaration
Returns void
createLookupTable
Type declaration
Returns CPUFallbackLookupTable
getColor
Type declaration
Parameters
index: number
Returns Point4
getColorRepeating
Type declaration
Parameters
index: number
Returns Point4
getColorSchemeName
Type declaration
Returns string
getId
Type declaration
Get id of colormap
Returns string
getNumberOfColors
Type declaration
Returns number
insertColor
Type declaration
Parameters
index: number
rgba: Point4
Returns void
isValidIndex
Type declaration
Parameters
index: number
Returns boolean
removeColor
Type declaration
Parameters
index: number
Returns void
setColor
Type declaration
Parameters
index: number
rgba: Point4
Returns void
setColorSchemeName
Type declaration
Parameters
name: string
Returns void
setNumberOfColors
Type declaration
Parameters
numColors: number
Returns void
CPUFallbackEnabledElement
optionalcanvas
optionalcolormap
optionalimage
optionalinvalid
optionalmetadata
Type declaration
optionaldimensions?: Point3
Last index is always 1 for CPU
optionaldirection?: Mat3
optionalimagePixelModule?: { bitsAllocated: number; bitsStored: number; bluePaletteColorLookupTableData: number[]; bluePaletteColorLookupTableDescriptor?: number[]; columns: number; greenPaletteColorLookupTableData: number[]; greenPaletteColorLookupTableDescriptor?: number[]; highBit: number; largestPixelValue?: number; photometricInterpretation: string; pixelAspectRatio?: number; pixelRepresentation: number; planarConfiguration?: number; redPaletteColorLookupTableData: number[]; redPaletteColorLookupTableDescriptor?: number[]; rows: number; samplesPerPixel: number; smallestPixelValue?: number }
bitsAllocated: number
bitsStored: number
bluePaletteColorLookupTableData: number[]
optionalbluePaletteColorLookupTableDescriptor?: number[]
columns: number
greenPaletteColorLookupTableData: number[]
optionalgreenPaletteColorLookupTableDescriptor?: number[]
highBit: number
optionallargestPixelValue?: number
photometricInterpretation: string
optionalpixelAspectRatio?: number
pixelRepresentation: number
optionalplanarConfiguration?: number
redPaletteColorLookupTableData: number[]
optionalredPaletteColorLookupTableDescriptor?: number[]
rows: number
samplesPerPixel: number
optionalsmallestPixelValue?: number
optionalimagePlaneModule?: { columnCosines: Point3; columnPixelSpacing: number; columns: number; frameOfReferenceUID: string; imageOrientationPatient: number[]; imagePositionPatient: number[]; pixelSpacing: Point2; rowCosines: Point3; rowPixelSpacing: number; rows: number; sliceLocation?: number; sliceThickness?: number }
optionalorigin?: Point3
optionalspacing?: Point3
Last spacing is always EPSILON for CPU
optionalneedsRedraw
optionaloptions
Type declaration
[key string]: unknown
optionalcolormap?: CPUFallbackColormap
optionalpan
optionalrenderingTools
optionalrotation
optionalscale
optionaltransform
optionalviewport
optionalzoom
CPUFallbackLookupTable
build
Type declaration
Parameters
force: boolean
Returns void
getColor
Type declaration
Parameters
scalar: number
Returns Point4
setAlphaRange
Type declaration
Parameters
start: number
end: number
Returns void
setHueRange
Type declaration
Parameters
start: number
end: number
Returns void
setNumberOfTableValues
Type declaration
Parameters
number: number
Returns void
setRamp
Type declaration
Parameters
ramp: string
Returns void
setRange
Type declaration
Parameters
start: number
end: number
Returns void
setSaturationRange
Type declaration
Parameters
start: number
end: number
Returns void
setTableRange
Type declaration
Parameters
start: number
end: number
Returns void
setValueRange
Type declaration
Parameters
start: number
end: number
Returns void
setTableValue
Parameters
index: number
rgba: Point4
Returns any
CPUFallbackTransform
clone
Type declaration
Returns CPUFallbackTransform
getMatrix
Type declaration
Returns TransformMatrix2D
invert
Type declaration
Returns void
multiply
Type declaration
Parameters
matrix: TransformMatrix2D
Returns void
reset
Type declaration
Returns void
rotate
Type declaration
Parameters
rad: number
Returns void
scale
Type declaration
Parameters
sx: number
sy: number
Returns void
transformPoint
translate
Type declaration
Parameters
x: number
y: number
Returns void
CustomEventType
Type parameters
- T = any
readonlydetail
Returns any custom data event was created with. Typically used for synthetic events.
initCustomEvent
Parameters
typeArg: string
canBubbleArg: boolean
cancelableArg: boolean
detailArg: T
Returns void
ICache
getCacheSize
Type declaration
Get the current cache size
Returns number
getImageLoadObject
Type declaration
Retrieves the imageLoad Object from the cache
Parameters
imageId: string
Returns void | IImageLoadObject
getMaxCacheSize
Type declaration
Get the maximum cache size
Returns number
getVolumeLoadObject
Type declaration
Retrieves the volumeLoad Object from the cache
Parameters
volumeId: string
Returns void | IVolumeLoadObject
purgeCache
Type declaration
Purge cache both image and volume
Returns void
putImageLoadObject
Type declaration
Stores the imageLoad Object inside the cache
Parameters
imageId: string
imageLoadObject: IImageLoadObject
Returns Promise<any>
putVolumeLoadObject
Type declaration
Stores the volumeLoad Object inside the cache
Parameters
volumeId: string
volumeLoadObject: IVolumeLoadObject
Returns Promise<any>
setMaxCacheSize
Type declaration
Set the maximum cache size
Parameters
maxCacheSize: number
Returns void
ICachedGeometry
optionalgeometry
geometryId
geometryLoadObject
loaded
sizeInBytes
timeStamp
ICachedImage
optionalimage
imageId
imageLoadObject
loaded
optionalsharedCacheKey
sizeInBytes
timeStamp
ICachedVolume
loaded
sizeInBytes
timeStamp
optionalvolume
volumeId
volumeLoadObject
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
clipping range
optionalflipHorizontal
flip Horizontal
optionalflipVertical
flip Vertical
optionalfocalPoint
Camera Focal point
optionalparallelProjection
Camera Parallel Projection flag - whether camera is using parallel projection
optionalparallelScale
Camera parallel scale - used for parallel projection zoom, smaller values zoom in
optionalposition
Camera position
optionalscale
Scale factor for the camera, it is the ratio of how much an image pixel takes up one screen pixel
optionalviewAngle
Camera view angle - 90 degrees is orthographic
optionalviewPlaneNormal
Camera viewPlaneNormal - negative of the direction the camera is pointing or directionOfProjection
optionalviewUp
Camera viewUp - the direction of viewUP in camera
IContour
color
readonlyid
points
readonlysizeInBytes
_getSizeInBytes
Returns number
getColor
Returns Point3
getFlatPointsArray
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
Returns ContourType
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
readonlyframeOfReferenceUID
readonlyid
readonlysizeInBytes
_createEachContour
Parameters
data: ContourData[]
Returns void
getColor
Returns any
getContours
This function returns the contours of the image
Returns IContour[]
The contours of the image.
getFlatPointsArray
It returns an array of all the points in the glyph
Returns Point3[]
An array of points.
getNumberOfContours
This function returns the number of contours in the current shape.
Returns number
The number of contours in the glyph.
getNumberOfPointsArray
It returns an array of the number of points in each contour.
Returns number[]
An array of numbers.
getNumberOfPointsInAContour
“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
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.
getSizeInBytes
Returns number
getTotalNumberOfPoints
It loops through each contour in the
contours
array, and adds the number of points in each contour to thenumberOfPoints
variableReturns number
The number of points in the contours.
IEnabledElement
Cornerstone Enabled Element interface
FrameOfReferenceUID
FrameOfReference the enabledElement is rendering inside
renderingEngine
Cornerstone Rendering Engine instance
renderingEngineId
Unique ID of the renderingEngine
viewport
Cornerstone Viewport instance - can be Stack or Volume Viewport as of now
viewportId
Unique ID of the viewport in the renderingEngine
IGeometry
data
id
sizeInBytes
type
IGeometryLoadObject
optionalcancelFn
Type declaration
optional cancel function for loading
Returns void
optionaldecache
Type declaration
optional decache function
Returns void
promise
promise that resolves to an ImageVolume
IImage
Cornerstone Image interface, it is used for both CPU and GPU rendering
optionalcachedLut
CPU: image cached LUT
Type declaration
optionalinvert?: boolean
optionallutArray?: Uint8ClampedArray
optionalmodalityLUT?: unknown
optionalvoiLUT?: CPUFallbackLUT
optionalwindowCenter?: number | number[]
optionalwindowWidth?: number | number[]
color
is image a color image
optionalcolormap
CPU: custom color map for image
columnPixelSpacing
column pixel spacing
columns
image number of columns
getCanvas
Type declaration
Returns HTMLCanvasElement
getPixelData
Type declaration
function that returns the pixelData as an array
Returns number[]
height
image height
imageId
Image Id
intercept
intercept from metadata for scaling
invert
whether image pixels are inverted in color
optionalisPreScaled
Whether the image is Pre-scaled during loading
maxPixelValue
minPixelValue
minimum pixel value of the image
optionalmodalityLUT
CPU: custom modality LUT for image
numComps
number of components in the image
optionalpreScale
preScale object
Type declaration
scaled: boolean
boolean flag to indicate whether the image has been scaled
scalingParameters: { 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
optionalrender
Type declaration
CPU: custom render method for the image
Parameters
enabledElement: CPUFallbackEnabledElement
invalidated: boolean
Returns unknown
rgba
is image rgb and alpha
rowPixelSpacing
row pixel spacing
rows
image number of rows
optionalscaling
image scaling metadata - including PT suv values
Type declaration
optionalPET?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
optionalSUVbsaFactor?: number
optionalSUVlbmFactor?: number
optionalsuvbwToSuvbsa?: number
optionalsuvbwToSuvlbm?: number
optionalsharedCacheKey
sizeInBytes
image size in number of bytes
optionalsliceThickness
slice thickness
slope
slope from metadata for scaling
optionalstats
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
width
image width
windowCenter
windowCenter from metadata
windowWidth
windowWidth from metadata
IImageData
IImageData of an image, which stores actual scalarData and metaData about the image. IImageData is different from vtkImageData.
dimensions
image dimensions
direction
image direction
optionalhasPixelSpacing
whether the image has pixel spacing and it is not undefined
imageData
vtkImageData object
metadata
image metadata - currently only modality
Type declaration
Modality: string
origin
image origin
optionalpreScale
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
image scalarData which stores the array of pixelData
optionalscaling
image scaling for scaling pixelArray
spacing
image spacing
IImageLoadObject
ImageLoadObject interface which any imageLoader should return
optionalcancelFn
Type declaration
optional cancel function for loading
Returns void
optionaldecache
Type declaration
optional decache function
Returns void
promise
promise that resolves to an image
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)
optionalcancelLoading
Type declaration
Returns void
optionalconvertToCornerstoneImage
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
dimensions
volume dimensions
direction
volume direction
hasPixelSpacing
whether the metadata for the pixel spacing is not undefined
optionalimageData
volume image data as vtkImageData
optionalimageIds
imageIds of the volume (if it is built of separate imageIds)
isPrescaled
Whether preScaling has been performed on the volume
optionalloadStatus
loading status object for the volume containing loaded/loading statuses
metadata
volume metadata
numVoxels
number of voxels in the volume
origin
volume origin - set to the imagePositionPatient of the last image in the volume
optionalreferencedVolumeId
volume referencedVolumeId (if it is derived from another volume)
scalarData
volume scalar data
optionalscaling
volume scaling metadata
Type declaration
optionalPET?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
optionalSUVbsaFactor?: number
optionalSUVlbmFactor?: number
optionalsuvbwToSuvbsa?: number
optionalsuvbwToSuvlbm?: number
optionalsizeInBytes
volume size in bytes
spacing
volume spacing
readonlyvolumeId
unique identifier of the volume in the cache
vtkOpenGLTexture
openGL texture for the volume
IRegisterImageLoader
Register image loader interface
registerImageLoader
Type declaration
Parameters
scheme: string
imageLoader: ImageLoaderFn
Returns void
IRenderingEngine
hasBeenDestroyed
id
offScreenCanvasContainer
offscreenMultiRenderWindow
_debugRender
Returns void
destroy
Returns void
disableElement
Parameters
viewportId: string
Returns void
enableElement
Parameters
viewportInputEntry: PublicViewportInput
Returns void
fillCanvasWithBackgroundColor
Parameters
canvas: HTMLCanvasElement
backgroundColor: [number, number, number]
Returns void
getStackViewports
Returns default[]
getViewport
getViewports
getVolumeViewports
Returns default[]
render
Returns void
renderFrameOfReference
Parameters
FrameOfReferenceUID: string
Returns void
renderViewport
Parameters
viewportId: string
Returns void
renderViewports
Parameters
viewportIds: string[]
Returns void
resize
Parameters
optionalimmediate: boolean
optionalresetPan: boolean
optionalresetZoom: boolean
Returns void
setViewports
Parameters
viewports: PublicViewportInput[]
Returns void
IStackViewport
Interface for Stack Viewport
_actors
actors rendered in the viewport
canvas
canvas associated to the viewport
canvasToWorld
customRenderViewportToCanvas
Type declaration
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
viewport default options including the axis, and background color
element
public DOM element associated to the viewport
getCurrentImageId
Type declaration
Returns the currently rendered imageId
Returns string
getCurrentImageIdIndex
Type declaration
Returns the index of the imageId being renderer
Returns number
getFrameOfReferenceUID
Type declaration
Returns the frame of reference UID, if the image doesn’t have imagePlaneModule metadata, it returns undefined, otherwise, frameOfReferenceUID is returned.
Returns string
getImageIds
Type declaration
Returns the list of image Ids for the current viewport
Returns string[]
getProperties
Type declaration
Retrieve the viewport properties
Returns StackViewportProperties
hasImageId
Type declaration
Returns true if the viewport contains the imageId
Parameters
imageId: string
Returns boolean
hasImageURI
Type declaration
Returns true if the viewport contains the imageURI
Parameters
imageURI: string
Returns boolean
id
unique identifier of the viewport
isDisabled
if the viewport has been disabled
modality
options
viewport options
renderingEngineId
renderingEngineId the viewport belongs to
resize
Type declaration
Resizes the viewport - only used in CPU fallback for StackViewport. The GPU resizing happens inside the RenderingEngine.
Returns void
sHeight
height of the viewport on the offscreen canvas (if rendering using GPU)
sWidth
width of the viewport on the offscreen canvas (if rendering using GPU)
scaling
Scaling parameters
suppressEvents
Suppress events
sx
sx of the viewport on the offscreen canvas (if rendering using GPU)
sy
sy of the viewport on the offscreen canvas (if rendering using GPU)
type
viewport type, can be ORTHOGRAPHIC or STACK for now
worldToCanvas
_getCorners
Parameters
bounds: number[]
Returns number[][]
addActor
add one actor
Parameters
actorEntry: ActorEntry
Returns void
addActors
add actors to the list of actors
Parameters
actors: ActorEntry[]
Returns void
calibrateSpacing
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
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
returns specific actor uid by array index
Parameters
index: number
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
returns the canvas
Returns HTMLCanvasElement
getDefaultActor
get the first actor
Returns ActorEntry
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
getPan
Gets the canvas pan value
Returns Point2
getRenderer
If the renderer is CPU based, throw an error. Otherwise, returns the
vtkRenderer
responsible for rendering theViewport
.Returns any
getRenderingEngine
returns the renderingEngine instance the viewport belongs to
Returns any
getZoom
returns the parallel zoom relative to the default (eg returns 1 after reset)
Returns number
removeActors
remove array of uids
Parameters
actorUIDs: string[]
Returns void
removeAllActors
remove all actors from the viewport
Returns void
render
triggers render for all actors in the viewport
Returns void
reset
reset camera and options
Parameters
immediate: boolean
Returns void
resetCamera
Centers Pan and resets the zoom for stack viewport.
Parameters
optionalresetPan: boolean
optionalresetZoom: boolean
Returns boolean
resetProperties
Reset the viewport properties to the default values
Returns void
setActors
set and overwrite actors in a viewport
Parameters
actors: ActorEntry[]
Returns void
setCamera
Set the camera based on the provided camera object.
Parameters
cameraInterface: ICamera
Returns void
setColormap
Sets the colormap for the current viewport.
Parameters
colormap: CPUFallbackColormapData
The colormap data to use.
Returns void
setImageIdIndex
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
options: ViewportInputOptions
immediate: boolean
Returns void
setPan
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
__namedParameters: StackViewportProperties
optionalsuppressEvents: boolean
Returns void
setStack
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>
setZoom
Sets the relative zoom - set to 1 to reset it
Parameters
zoom: number
optionalstoreAsInitialCamera: boolean
Returns any
unsetColormap
It sets the colormap to the default colormap.
Returns void
IStreamingImageVolume
Cornerstone StreamingImageVolume which extends ImageVolume
cancelLoading
Type declaration
Returns void
dimensions
Dimensions of the volume
direction
volume direction in world space
hasPixelSpacing
whether the metadata for the pixel spacing is not undefined
optionalimageData
volume image data
optionalimageIds
optional image ids for the volume if it is made of separated images
isPrescaled
Whether preScaling has been performed on the volume
optionalloadStatus
load status object for the volume
metadata
volume metadata
numVoxels
volume number of voxels
origin
volume origin, Note this is an opinionated origin for the volume
optionalreferencedVolumeId
optional reference volume id if the volume is derived from another volume
scalarData
volume scalar data
optionalscaling
volume scaling parameters if it contains scaled data
Type declaration
optionalPET?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
optionalSUVbsaFactor?: number
optionalSUVlbmFactor?: number
optionalsuvbwToSuvbsa?: number
optionalsuvbwToSuvlbm?: number
optionalsizeInBytes
volume size in bytes
spacing
volume spacing in 3d world space
readonlyvolumeId
Read-only unique identifier for the volume
vtkOpenGLTexture
open gl texture for the volume
clearLoadCallbacks
method to load all the loading requests
Returns void
convertToCornerstoneImage
method to convert the volume data in the volume cache, to separate images in the image cache
Parameters
imageId: string
imageIdIndex: number
Returns any
decache
method to decache the volume from cache
Parameters
completelyRemove: boolean
Returns void
IStreamingVolumeProperties
imageIds
imageIds of the volume
loadStatus
loading status object for the volume containing loaded/loading statuses
Type declaration
cachedFrames: boolean[]
callbacks: () => void[]
loaded: boolean
loading: boolean
IViewport
Viewport interface for cornerstone viewports
_actors
actors rendered in the viewport
canvas
canvas associated to the viewport
canvasToWorld
customRenderViewportToCanvas
Type declaration
whether the viewport has custom rendering
Returns unknown
defaultOptions
viewport default options including the axis, and background color
element
public DOM element associated to the viewport
getFrameOfReferenceUID
Type declaration
frameOfReferenceUID the viewport’s default actor is rendering
Returns string
id
unique identifier of the viewport
isDisabled
if the viewport has been disabled
options
viewport options
renderingEngineId
renderingEngineId the viewport belongs to
sHeight
height of the viewport on the offscreen canvas (if rendering using GPU)
sWidth
width of the viewport on the offscreen canvas (if rendering using GPU)
suppressEvents
Suppress events
sx
sx of the viewport on the offscreen canvas (if rendering using GPU)
sy
sy of the viewport on the offscreen canvas (if rendering using GPU)
type
viewport type, can be ORTHOGRAPHIC or STACK for now
worldToCanvas
_getCorners
Parameters
bounds: number[]
Returns number[][]
addActor
add one actor
Parameters
actorEntry: ActorEntry
Returns void
addActors
add actors to the list of actors
Parameters
actors: ActorEntry[]
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
returns specific actor uid by array index
Parameters
index: number
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
returns the canvas
Returns HTMLCanvasElement
getDefaultActor
get the first actor
Returns ActorEntry
getPan
Gets the canvas pan value
Returns Point2
getRenderer
returns the vtkRenderer (for GPU rendering) of the viewport
Returns void
getRenderingEngine
returns the renderingEngine instance the viewport belongs to
Returns any
getZoom
returns the parallel zoom relative to the default (eg returns 1 after reset)
Returns number
removeActors
remove array of uids
Parameters
actorUIDs: string[]
Returns void
removeAllActors
remove all actors from the viewport
Returns void
render
triggers render for all actors in the viewport
Returns void
reset
reset camera and options
Parameters
immediate: boolean
Returns void
setActors
set and overwrite actors in a viewport
Parameters
actors: ActorEntry[]
Returns void
setCamera
sets the camera
Parameters
cameraInterface: ICamera
optionalstoreAsInitialCamera: boolean
Returns void
setOptions
set options for the viewport
Parameters
options: ViewportInputOptions
immediate: boolean
Returns void
setPan
Sets the canvas pan value
Parameters
pan: Point2
optionalstoreAsInitialCamera: boolean
Returns any
setZoom
Sets the relative zoom - set to 1 to reset it
Parameters
zoom: number
optionalstoreAsInitialCamera: boolean
Returns any
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
viewportId
IVolume
Cornerstone ImageVolume interface.
dimensions
volume dimensions
direction
volume direction
optionalimageData
volume image data as vtkImageData
metadata
volume metadata
origin
volume origin
optionalreferencedVolumeId
referencedVolumeId if volume is derived from another volume
scalarData
volume scalarData
optionalscaling
volume scaling metadata
Type declaration
optionalPET?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
optionalSUVbsaFactor?: number
optionalSUVlbmFactor?: number
optionalsuvbwToSuvbsa?: number
optionalsuvbwToSuvlbm?: number
optionalsizeInBytes
volume size in bytes
spacing
volume spacing
volumeId
unique identifier for the volume in the cache
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
optionalblendMode
Blend mode of the volume - by default it is additive
optionalcallback
Callback to be called when the volume is added to the viewport
optionalslabThickness
Slab thickness of the volume - by default it is 0.05
optionalvisibility
Visibility of the volume - by default it is true
volumeId
Volume ID of the volume in the cache
IVolumeLoadObject
VolumeLoadObject interface which any volumeLoader should return
optionalcancelFn
Type declaration
optional cancel function for loading
Returns void
optionaldecache
Type declaration
optional decache function
Returns void
promise
promise that resolves to an ImageVolume
IVolumeViewport
Interface for the Volume Viewport
_actors
actors rendered in the viewport
canvas
canvas associated to the viewport
canvasToWorld
customRenderViewportToCanvas
Type declaration
whether the viewport has custom rendering
Returns unknown
defaultOptions
viewport default options including the axis, and background color
element
public DOM element associated to the viewport
getCurrentImageId
Type declaration
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
Type declaration
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
getFrameOfReferenceUID
Type declaration
Returns string
getProperties
Type declaration
Returns any
hasImageURI
Type declaration
if the volume viewport has imageURI (no loader schema) in one of its volume actors
Parameters
imageURI: string
Returns boolean
hasVolumeId
Type declaration
Checks if the viewport has a volume actor with the given volumeId
Parameters
volumeId: string
Returns boolean
id
unique identifier of the viewport
isDisabled
if the viewport has been disabled
options
viewport options
renderingEngineId
renderingEngineId the viewport belongs to
sHeight
height of the viewport on the offscreen canvas (if rendering using GPU)
sWidth
width of the viewport on the offscreen canvas (if rendering using GPU)
suppressEvents
Suppress events
sx
sx of the viewport on the offscreen canvas (if rendering using GPU)
sy
sy of the viewport on the offscreen canvas (if rendering using GPU)
type
viewport type, can be ORTHOGRAPHIC or STACK for now
useCPURendering
worldToCanvas
_getCorners
Parameters
bounds: number[]
Returns number[][]
addActor
add one actor
Parameters
actorEntry: ActorEntry
Returns void
addActors
add actors to the list of actors
Parameters
actors: ActorEntry[]
Returns void
addVolumes
Creates and adds volume actors for all volumes defined in the
volumeInputArray
. For each entry, if acallback
is supplied, it will be called with the new volume actor as input.Parameters
volumeInputArray: IVolumeInput[]
optionalimmediate: boolean
optionalsuppressEvents: boolean
Returns Promise<void>
flip
Flip the viewport along the desired axis
Parameters
flipDirection: FlipDirection
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
returns specific actor uid by array index
Parameters
index: number
Returns string
getActors
returns all the actor entires for a viewport which is an object containing actor and its uid
Returns ActorEntry[]
getBounds
getBounds gets the visible bounds of the viewport
Returns any
getCamera
returns camera object
Returns ICamera
getCanvas
returns the canvas
Returns HTMLCanvasElement
getDefaultActor
get the first actor
Returns ActorEntry
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
Given a point in world coordinates, return the intensity at that point
Parameters
point: Point3
Returns number
getPan
Gets the canvas pan value
Returns Point2
getRenderer
returns the vtkRenderer (for GPU rendering) of the viewport
Returns void
getRenderingEngine
returns the renderingEngine instance the viewport belongs to
Returns any
getSlabThickness
Gets the slab thickness option in the
Viewport
‘soptions
.Returns number
getZoom
returns the parallel zoom relative to the default (eg returns 1 after reset)
Returns number
removeActors
remove array of uids
Parameters
actorUIDs: string[]
Returns void
removeAllActors
remove all actors from the viewport
Returns void
removeVolumeActors
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
triggers render for all actors in the viewport
Returns void
reset
reset camera and options
Parameters
immediate: boolean
Returns void
resetCamera
Reset the camera for the volume viewport
Parameters
optionalresetPan: boolean
optionalresetZoom: boolean
optionalresetToCenter: boolean
Returns boolean
setActors
set and overwrite actors in a viewport
Parameters
actors: ActorEntry[]
Returns void
setBlendMode
Sets the blendMode for actors of the viewport.
Parameters
blendMode: BlendModes
optionalfilterActorUIDs: string[]
optionalimmediate: boolean
Returns void
setCamera
sets the camera
Parameters
cameraInterface: ICamera
optionalstoreAsInitialCamera: boolean
Returns void
setOptions
set options for the viewport
Parameters
options: ViewportInputOptions
immediate: boolean
Returns void
setOrientation
Parameters
orientation: OrientationAxis
Returns void
setPan
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
__namedParameters: VolumeViewportProperties
optionalvolumeId: string
optionalsuppressEvents: boolean
Returns void
setSlabThickness
Sets the slab thickness for actors of the viewport.
Parameters
slabThickness: number
optionalfilterActorUIDs: string[]
Returns void
setVolumes
Creates volume actors for all volumes defined in the
volumeInputArray
. For each entry, if acallback
is supplied, it will be called with the new volume actor as input. For each entry, if ablendMode
and/orslabThickness
is defined, this will be set on the actor’sVolumeMapper
.Parameters
volumeInputArray: IVolumeInput[]
optionalimmediate: boolean
optionalsuppressEvents: boolean
Returns Promise<void>
setZoom
Sets the relative zoom - set to 1 to reset it
Parameters
zoom: number
optionalstoreAsInitialCamera: boolean
Returns any
ViewportPreset
ambient
colorTransfer
diffuse
gradientOpacity
interpolation
name
scalarOpacity
shade
specular
specularPower
Type Aliases
Actor
ActorEntry
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
actual actor object
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
Object containing the min, max and current position in the normal direction for the actor
Type declaration
actor: VolumeActor
current: number
focalPoint: Point3
max: number
min: number
viewPlaneNormal: Point3
CPUFallbackColormapData
Type declaration
optionalcolors?: Point4[]
optionalgamma?: number
name: string
optionalnumColors?: number
optionalnumOfColors?: number
optionalsegmentedData?: unknown
CPUFallbackColormapsData
Type declaration
[key string]: CPUFallbackColormapData
CPUFallbackLUT
Type declaration
lut: number[]
CPUFallbackRenderingTools
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
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
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
Type declaration
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: number[]
scaling: Scaling
spacing: Point3
CPUImageData
Type declaration
optionalgetDimensions?: () => Point3
Last index is always 1
Returns Point3
optionalgetDirection?: () => Mat3
Returns Mat3
optionalgetIndexToWorld?: () => Point3
Returns Point3
optionalgetScalarData?: () => number[]
Returns number[]
optionalgetSpacing?: () => Point3
Last spacing is always EPSILON
Returns Point3
optionalgetWorldToIndex?: () => Point3
Returns Point3
optionalindexToWorld?: (point: Point3) => Point3
optionalworldToIndex?: (point: Point3) => Point3
ContourData
Type declaration
optionalcolor?: Point3
points: Point3[]
type: ContourType
ContourSetData
Type declaration
optionalcolor?: Point3
data: ContourData[]
frameOfReferenceUID: string
id: string
FlipDirection
Flip direction which can be horizontal or vertical.
Type declaration
optionalflipHorizontal?: boolean
optionalflipVertical?: boolean
ImageLoaderFn
Type declaration
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
anddecache
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
Returns void | undefined
optionaldecache?: () => void | undefined
Returns void | undefined
promise: Promise<Record<string, any>>
Promise that resolves to the image object
ImageSliceData
Type declaration
imageIndex: number
numberOfSlices: number
Mat3
This represents a 3x3 matrix of numbers
Metadata
Metadata for images, More information can be found in the https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#table_C.7-11c
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
voiLut: VOI[]
Window Level/Center for the image
OrientationVectors
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
Type declaration
PTScaling
Type declaration
optionalsuvbwToSuvbsa?: number
suv body weight to suv body surface area
optionalsuvbwToSuvlbm?: number
suv body weight to suv lean body mass
Plane
Plane equation Ax+By+Cz=D, plane is defined by [A, B, C, D]
Point2
This duplicates the typing established in gl-matrix for a vec2
Point3
This duplicates the typing established in gl-matrix for a vec3
Point4
This represents a 4-vector or RGBA value.
PublicContourSetData
PublicSurfaceData
Type declaration
optionalcolor?: Point3
data: SurfaceData
frameOfReferenceUID: string
id: string
PublicViewportInput
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
Scaling
Type declaration
optionalPET?: PTScaling
ScalingParameters
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
StackViewportProperties
Stack Viewport Properties
Type declaration
optionalinterpolationType?: InterpolationType
interpolation type - linear or nearest neighbor
optionalinvert?: boolean
invert flag - whether the image is inverted
optionalrotation?: number
image rotation
optionalsuppressEvents?: boolean
suppress events (optional)
optionalvoiRange?: VOIRange
voi range (upper, lower) for the viewport
SurfaceData
Type declaration
points: number[]
polys: number[]
TransformMatrix2D
used for CPU rendering
VOI
Type declaration
windowCenter: number
Window Center for display
windowWidth: number
Window Width for display
VOIRange
Type declaration
lower: number
lower value for display
upper: number
upper value for display
ViewportInputOptions
This type defines the shape of viewport input options, so we can throw when it is incorrect.
Type declaration
optionalbackground?: [number, number, number]
background color
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
VolumeActor
VolumeInputCallback
Type declaration
Volume input callback type, used to perform operations on the volume data after it has been loaded.
Parameters
params: { volumeActor: VolumeActor; volumeId: string }
Returns unknown
VolumeLoaderFn
Type declaration
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
anddecache
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
cancel function
Returns void | undefined
optionaldecache?: () => void | undefined
decache function
Returns void | undefined
promise: Promise<Record<string, any>>
promise that resolves to the volume object
VolumeViewportProperties
Stack Viewport Properties
Type declaration
optionalvoiRange?: VOIRange
voi range (upper, lower) for the viewport
CameraModified Event type