All files / extensions/cornerstone/src/services/ViewportService/backends IViewportServiceInternals.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48                                                                                               
import type { Types } from '@cornerstonejs/core';
import type ViewportInfo from '../Viewport';
import type { Presentations } from '../../../types/Presentation';
import type { StackViewportData, VolumeViewportData } from '../../../types/CornerstoneCacheService';
import type { OverlayMountTask } from './IViewportBackend';
 
/**
 * The narrow slice of CornerstoneViewportService that a viewport backend is
 * allowed to reach (migration plan ยง4.3 access pattern). The service `implements`
 * this and passes `this` to each backend, so a backend can dispatch the per-family
 * mount work back to the shared service methods without reaching into unrelated
 * internals. Keeping this interface narrow is what stops the off (legacy) path
 * from drifting as the next backend grows.
 */
export interface IViewportServiceInternals {
  _setStackViewport(
    viewport: Types.IStackViewport,
    viewportData: StackViewportData,
    viewportInfo: ViewportInfo,
    presentations?: Presentations
  ): Promise<void>;
 
  _setVolumeViewport(
    viewport: Types.IVolumeViewport,
    viewportData: VolumeViewportData,
    viewportInfo: ViewportInfo,
    presentations?: Presentations
  ): Promise<void>;
 
  _setEcgViewport(viewport: Types.IECGViewport, viewportData: StackViewportData): Promise<void>;
 
  _setOtherViewport(
    viewport: Types.IStackViewport,
    viewportData: StackViewportData,
    viewportInfo: ViewportInfo,
    presentations?: Presentations
  ): Promise<void>;
 
  /** Applies lut/position/segmentation presentations to a mounted viewport. */
  setPresentations(viewportId: string, presentations: Presentations): void;
 
  /** Runs the pending overlay (SEG/RTSTRUCT) adds produced by the mount prelude. */
  _addOverlayRepresentations(overlayProcessingResults?: OverlayMountTask[]): Promise<void>;
 
  /** Records which display sets a viewport shows (service bookkeeping). */
  _trackViewportDisplaySets(viewportId: string, displaySetInstanceUIDs: string[]): void;
}