fix(tracked-measurement): SR viewports disable jump to measurement (#3518)

This commit is contained in:
Joe Boccanfuso 2023-07-05 08:43:01 -04:00 committed by GitHub
parent e742328ac1
commit c3c132d268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -225,6 +225,7 @@ function OHIFCornerstoneSRViewport(props) {
}} }}
onElementEnabled={onElementEnabled} onElementEnabled={onElementEnabled}
initialImageIndex={initialImageIndex} initialImageIndex={initialImageIndex}
isJumpToMeasurementDisabled={true}
></Component> ></Component>
); );
}, [activeImageDisplaySetData, viewportIndex, measurementSelected]); }, [activeImageDisplaySetData, viewportIndex, measurementSelected]);

View File

@ -119,6 +119,7 @@ const OHIFCornerstoneViewport = React.memo(props => {
servicesManager, servicesManager,
onElementEnabled, onElementEnabled,
onElementDisabled, onElementDisabled,
isJumpToMeasurementDisabled,
// Note: you SHOULD NOT use the initialImageIdOrIndex for manipulation // Note: you SHOULD NOT use the initialImageIdOrIndex for manipulation
// of the imageData in the OHIFCornerstoneViewport. This prop is used // of the imageData in the OHIFCornerstoneViewport. This prop is used
// to set the initial state of the viewport's first image to render // to set the initial state of the viewport's first image to render
@ -454,6 +455,10 @@ const OHIFCornerstoneViewport = React.memo(props => {
* the cache for jumping to see if there is any jump queued, then we jump to the correct slice. * the cache for jumping to see if there is any jump queued, then we jump to the correct slice.
*/ */
useEffect(() => { useEffect(() => {
if (isJumpToMeasurementDisabled) {
return;
}
const unsubscribeFromJumpToMeasurementEvents = _subscribeToJumpToMeasurementEvents( const unsubscribeFromJumpToMeasurementEvents = _subscribeToJumpToMeasurementEvents(
measurementService, measurementService,
displaySetService, displaySetService,
@ -716,6 +721,10 @@ function _jumpToMeasurement(
// Component displayName // Component displayName
OHIFCornerstoneViewport.displayName = 'OHIFCornerstoneViewport'; OHIFCornerstoneViewport.displayName = 'OHIFCornerstoneViewport';
OHIFCornerstoneViewport.defaultProps = {
isJumpToMeasurementDisabled: false,
};
OHIFCornerstoneViewport.propTypes = { OHIFCornerstoneViewport.propTypes = {
viewportIndex: PropTypes.number.isRequired, viewportIndex: PropTypes.number.isRequired,
displaySets: PropTypes.array.isRequired, displaySets: PropTypes.array.isRequired,
@ -724,6 +733,7 @@ OHIFCornerstoneViewport.propTypes = {
displaySetOptions: PropTypes.arrayOf(PropTypes.any), displaySetOptions: PropTypes.arrayOf(PropTypes.any),
servicesManager: PropTypes.object.isRequired, servicesManager: PropTypes.object.isRequired,
onElementEnabled: PropTypes.func, onElementEnabled: PropTypes.func,
isJumpToMeasurementDisabled: PropTypes.bool,
// Note: you SHOULD NOT use the initialImageIdOrIndex for manipulation // Note: you SHOULD NOT use the initialImageIdOrIndex for manipulation
// of the imageData in the OHIFCornerstoneViewport. This prop is used // of the imageData in the OHIFCornerstoneViewport. This prop is used
// to set the initial state of the viewport's first image to render // to set the initial state of the viewport's first image to render