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 | 1x 13x 13x 13x 13x 13x 13x 13x | import { getEnabledElements, utilities as csUtils } from '@cornerstonejs/core'; import type { Types } from '@cornerstonejs/core'; import type { Annotation } from '../types'; const { isEqual } = csUtils; /** * Finds a all matching viewports in terms of the orientation of the annotation data * and the frame of reference. This doesn't mean the annotation IS being displayed * on these viewports, just that it could be by navigating the slice, and/or pan/zoom, * without changing the orientation. * * @param annotation - Annotation to find the viewports that it could display in * @returns All viewports to display in */ export default function getViewportsForAnnotation( annotation: Annotation ): (Types.IStackViewport | Types.IVolumeViewport)[] { const { metadata } = annotation; return getEnabledElements() .filter((enabledElement) => { Eif (enabledElement.FrameOfReferenceUID === metadata.FrameOfReferenceUID) { const viewport = enabledElement.viewport; const { viewPlaneNormal, viewUp } = viewport.getCamera(); return ( isEqual(viewPlaneNormal, metadata.viewPlaneNormal) && (!metadata.viewUp || isEqual(viewUp, metadata.viewUp)) ); } return; }) .map((enabledElement) => enabledElement.viewport); } |