Skip to main content

Function: calculateViewportsSpatialRegistration()

calculateViewportsSpatialRegistration(viewport1, viewport2): void

It calculates the registration matrix between two viewports (currently only translation is supported) If the viewports are in the same frame of reference, it will return early, but otherwise it will use the current image's metadata to calculate the translation between the two viewports and adds it to the spatialRegistrationModule metadata provider.

The current images are the reference, so the user can scroll both viewports to matching anatomy before the registration is calculated.

Parameters​

• viewport1: IStackViewport | VolumeViewport

The first stack viewport

• viewport2: IStackViewport | VolumeViewport

The second stack viewport

Returns​

void

Defined in​

packages/core/src/utilities/calculateViewportsSpatialRegistration.ts:34