Skip to content

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

ts
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

ts
ViewerStateInfo.currentCoord

Accessors

mouseState

Get Signature

ts
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
ts
viewName: string | null;
imageCoordinate
ts
imageCoordinate: 
  | {
  x: number;
  y: number;
}
  | null;
volumeCoordinate
ts
volumeCoordinate: number[] | null;
worldCoordinate
ts
worldCoordinate: number[] | null;

Implementation of

ts
ViewerStateInfo.mouseState

sliceIndices

Get Signature

ts
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

ts
ViewerStateInfo.sliceIndices

totalSlices

Get Signature

ts
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

ts
ViewerStateInfo.totalSlices

viewOrientation

Get Signature

ts
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

ts
ViewerStateInfo.viewOrientation

scale

Get Signature

ts
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

ts
ViewerStateInfo.scale

viewerType

Get Signature

ts
get viewerType(): string;

Defined in: src/display/OrthogonalImageViewer.ts:783

Identifies this as an orthogonal viewer.

Returns

string

Implementation of

ts
ViewerStateInfo.viewerType

visibleLayers

Get Signature

ts
get visibleLayers(): object[];

Defined in: src/display/OrthogonalImageViewer.ts:791

Returns information about visible layers.

Returns

object[]

Implementation of

ts
ViewerStateInfo.visibleLayers

Methods

create()

ts
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()

ts
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()

ts
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()

ts
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()

ts
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?

OrientationLabelOptions

Optional styling applied to every sub-view.

Returns

void


getImageLayer()

ts
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

ImageLayer


applyToImageLayers()

ts
applyToImageLayers(handler): void;

Defined in: src/display/OrthogonalImageViewer.ts:656

Parameters

handler

(layer) => void

Returns

void


getSliceViewer()

ts
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

SliceViewer


dispose()

ts
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

Released under the MIT License.