Skip to main content

Function: getViewportContentMode()

getViewportContentMode(viewport): ViewportContentMode | undefined

Returns the content-true mode of the viewport's bound source data when the viewport can classify it (i.e. exposes getCurrentMode), otherwise undefined.

Unlike the capability guards above (which test method presence), this reports what the viewport is actually showing — the question a PLANAR_NEXT viewport cannot answer through viewportSupportsImageSlices / viewportSupportsVolumeId alone, since it supports both regardless of content. See ViewportContentMode.

Parameters​

• viewport: unknown

Returns​

ViewportContentMode | undefined

Defined in​

packages/core/src/utilities/viewportCapabilities.ts:162