Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

v3-stable jumpToMeasurement applies to all viewports rather than just active viewport

Open Ouwen opened this issue 1 year ago • 1 comments

Before Creating an issue

  • Are you running the latest version? Yes v3-stable
  • Are you reporting to the correct repository? Yes
  • Did you search existing issues? Yes

Bug Report

Describe the Bug

When there are multiple viewports with annotations, clicking a measurement to activate the jumpToMeasurement function will change all viewports. I believe the expected behavior is that only the active viewport should change.

What steps can we follow to reproduce the bug?

  1. Open up public link
  2. Create a 1x2
  3. Make a tracked annotation
  4. Click on the tracked annotation panel (both viewports will jump rather than just the active one)

Ouwen avatar Aug 25 '22 22:08 Ouwen

Checking that viewportIndex === vI will change the behavior as previous v3-stable. (I'm unsure if jumpToSlice behavior is actually a bug or specific to PET/CT fusion in the TMTV mode)

function _subscribeToJumpToMeasurementEvents(
  MeasurementService,
  DisplaySetService,
  elementRef,
  viewportIndex,
  displaySets,
  viewportGridService
) {
  const displaysUIDs = displaySets.map(
    displaySet => displaySet.displaySetInstanceUID
  );
  const { unsubscribe } = MeasurementService.subscribe(
    MeasurementService.EVENTS.JUMP_TO_MEASUREMENT,
    ({ measurement, viewportIndex: vI }) => {
      if (!measurement) return;

      // Jump the the measurement if the viewport contains the displaySetUID (fusion)
      if (displaysUIDs.includes(measurement.displaySetInstanceUID) && vI === viewportIndex) {
        _jumpToMeasurement(
          measurement,
          elementRef,
          viewportIndex,
          MeasurementService,
          DisplaySetService,
          viewportGridService
        );
      }
    }
  );

  return unsubscribe;
}

Ouwen avatar Aug 25 '22 22:08 Ouwen

@jbocce ditto

sedghi avatar Oct 13 '23 14:10 sedghi

In master at this point in time, only one viewport performs the jump to measurement:

  • if there is a viewport on screen that contains the measurement clicked, that viewport will navigate to the image with the measurement
  • if there is NOT a viewport on screen that contains the measurement clicked, then the active viewport will switch to the series containing the image with the measurement and will subsequently navigate to the image with the measurement

jbocce avatar Oct 13 '23 18:10 jbocce