Skip to main content

Function: getViewportWithMatchingViewPlaneNormal()

getViewportWithMatchingViewPlaneNormal(viewports, annotation, dotThreshold): Types.IViewport | undefined

Finds the viewport with a camera viewPlaneNormal that matches the annotation's viewPlaneNormal. Compares the viewPlaneNormal from annotation metadata with each viewport's camera viewPlaneNormal using dot product.

Parameters​

• viewports: Viewport[]

Array of viewports to search through

• annotation: ContourSegmentationAnnotation

The annotation containing metadata with viewPlaneNormal

• dotThreshold: number = 0.99

The threshold for dot product comparison (default: 0.99, closer to 1.0 means more similar)

Returns​

Types.IViewport | undefined

The first viewport with matching viewPlaneNormal, or undefined if none found

Defined in​

tools/src/stateManagement/segmentation/utilities/getViewportAssociatedToSegmentation.ts:55