Class: OrthogonalImageViewer
Defined in: src/display/OrthogonalImageViewer.ts:102
OrthogonalImageViewer manages three simultaneous SliceViewers (Axial, Coronal, Sagittal), each displaying a different orientation of the same data. The user can interact with any sub-view to change the shared coordinate, updating the other sub-views in sync.
All the sub-viewers are arranged in a grid layout. The class handles:
- Creating the DOM elements for each view.
- Initializing and disposing the sub-viewers.
- Synchronizing the position (currentCoord) among the sub-viewers.
- Handling window resize events and re-drawing each view.
- Reactively updating the sub-viewers if the user adjusts slice indices in any one viewer.
Implements
ViewerStateInfo
Properties
currentCoord
currentCoord: number[];Defined in: src/display/OrthogonalImageViewer.ts:107
The current 3D coordinate shared by all sub-viewers. This is updated whenever one of the SliceViewers changes its currentCoord.
Implementation of
ViewerStateInfo.currentCoordAccessors
mouseState
Get Signature
get mouseState(): object;Defined in: src/display/OrthogonalImageViewer.ts:723
Exposes the current mouse state as a computed property for external read-only usage. This includes which sub-view triggered it, the 2D image coordinate, and the 3D volume coordinate.
Returns
object
viewName
viewName: string | null;imageCoordinate
imageCoordinate:
| {
x: number;
y: number;
}
| null;volumeCoordinate
volumeCoordinate: number[] | null;worldCoordinate
worldCoordinate: number[] | null;Implementation of
ViewerStateInfo.mouseStatesliceIndices
Get Signature
get sliceIndices(): Record<ViewName, number>;Defined in: src/display/OrthogonalImageViewer.ts:736
Returns an object with slice indices for each view.
Returns
Record<ViewName, number>
Implementation of
ViewerStateInfo.sliceIndicestotalSlices
Get Signature
get totalSlices(): Record<ViewName, number>;Defined in: src/display/OrthogonalImageViewer.ts:749
Returns the total number of slices available in each view.
Returns
Record<ViewName, number>
Implementation of
ViewerStateInfo.totalSlicesviewOrientation
Get Signature
get viewOrientation(): Record<ViewName, any>;Defined in: src/display/OrthogonalImageViewer.ts:762
Returns the view orientation information for each view.
Returns
Record<ViewName, any>
Implementation of
ViewerStateInfo.viewOrientationscale
Get Signature
get scale(): Record<ViewName, number>;Defined in: src/display/OrthogonalImageViewer.ts:770
Returns the current scale/zoom level for each view.
Returns
Record<ViewName, number>
Implementation of
ViewerStateInfo.scaleviewerType
Get Signature
get viewerType(): string;Defined in: src/display/OrthogonalImageViewer.ts:783
Identifies this as an orthogonal viewer.
Returns
string
Implementation of
ViewerStateInfo.viewerTypevisibleLayers
Get Signature
get visibleLayers(): object[];Defined in: src/display/OrthogonalImageViewer.ts:791
Returns information about visible layers.
Returns
object[]
Implementation of
ViewerStateInfo.visibleLayersMethods
create()
static create(params): Promise<OrthogonalImageViewer>;Defined in: src/display/OrthogonalImageViewer.ts:210
Creates an OrthogonalImageViewer, asynchronously building its sub-viewers.
Parameters
params
OrthogonalImageViewerParams
Contains the container HTMLElement, imageLayer, and viewer options.
Returns
Promise<OrthogonalImageViewer>
A fully-initialized instance of OrthogonalImageViewer.
setWorldCoord()
setWorldCoord(coord): void;Defined in: src/display/OrthogonalImageViewer.ts:378
Programmatically set the shared world coordinate for all sub-views.
Parameters
coord
number[]
Returns
void
setCrosshairVisible()
setCrosshairVisible(visible): void;Defined in: src/display/OrthogonalImageViewer.ts:494
Toggle crosshair overlay at runtime across all sub-views.
Parameters
visible
boolean
Returns
void
setFocusedView()
setFocusedView(viewName): void;Defined in: src/display/OrthogonalImageViewer.ts:572
Sets which view receives keyboard input for slice navigation.
Parameters
viewName
ViewName | null
The view to focus ('axial', 'coronal', or 'sagittal')
Returns
void
setOrientationLabelsVisible()
setOrientationLabelsVisible(visible, options?): void;Defined in: src/display/OrthogonalImageViewer.ts:582
Toggle anatomical orientation labels (L/R/A/P/S/I) across all three views.
Parameters
visible
boolean
Whether the labels should be shown.
options?
Optional styling applied to every sub-view.
Returns
void
getImageLayer()
getImageLayer(): ImageLayer;Defined in: src/display/OrthogonalImageViewer.ts:652
Gets the underlying ImageLayer used by these sub-viewers, which provides the actual volume data stack.
Returns
applyToImageLayers()
applyToImageLayers(handler): void;Defined in: src/display/OrthogonalImageViewer.ts:656
Parameters
handler
(layer) => void
Returns
void
getSliceViewer()
getSliceViewer(viewName): SliceViewer;Defined in: src/display/OrthogonalImageViewer.ts:668
Retrieves the SliceViewer corresponding to one of the standard views.
Parameters
viewName
"axial" | "coronal" | "sagittal"
e.g. 'axial', 'coronal', or 'sagittal'.
Returns
dispose()
dispose(): void;Defined in: src/display/OrthogonalImageViewer.ts:676
Cleans up all sub-viewers and DOM elements, removing them from the container, and unsubscribes from MobX reactions.
Returns
void