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 | import type { Annotation } from '../types'; import type { Types } from '@cornerstonejs/core'; import getViewportsForAnnotation from './getViewportsForAnnotation'; /** * Finds a matching viewport in terms of the orientation of the annotation data * and the frame of reference. This doesn't mean the annotation IS being displayed * in the viewport, just that it could be by navigating the slice, and/or pan/zoom, * without changing the orientation. * * @param annotation - to find a viewport that it could display in * @returns The viewport to display in */ export default function getViewportForAnnotation( annotation: Annotation ): Types.IStackViewport | Types.IVolumeViewport | undefined { const viewports = getViewportsForAnnotation(annotation); return viewports.length ? viewports[0] : undefined; } |