diff --git a/extensions/cornerstone/src/hps/frameView.ts b/extensions/cornerstone/src/hps/frameView.ts index e699f68cc..72f3a9a90 100644 --- a/extensions/cornerstone/src/hps/frameView.ts +++ b/extensions/cornerstone/src/hps/frameView.ts @@ -9,7 +9,7 @@ const frameView: Types.HangingProtocol.Protocol = { toolGroupIds: ['default'], protocolMatchingRules: [], displaySetSelectors: { - defaultDisplaySetId: { + activeDisplaySet: { seriesMatchingRules: [ { attribute: 'numImageFrames', @@ -36,8 +36,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', - matchedDisplaySetsIndex: -1, + id: 'activeDisplaySet', }, ], }, @@ -86,7 +85,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -123,7 +122,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -160,7 +159,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -197,7 +196,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -234,7 +233,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -271,7 +270,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -308,7 +307,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -345,7 +344,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -382,7 +381,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -419,7 +418,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -456,7 +455,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -493,7 +492,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -530,7 +529,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -567,7 +566,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -604,7 +603,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -641,7 +640,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -690,7 +689,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -726,7 +725,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -762,7 +761,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -798,7 +797,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -834,7 +833,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -870,7 +869,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -906,7 +905,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -942,7 +941,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -978,7 +977,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1027,7 +1026,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1063,7 +1062,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1099,7 +1098,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1135,7 +1134,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1171,7 +1170,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1207,7 +1206,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1256,7 +1255,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1292,7 +1291,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1328,7 +1327,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1364,7 +1363,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1413,7 +1412,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1449,7 +1448,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1485,7 +1484,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1534,7 +1533,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, @@ -1570,7 +1569,7 @@ const frameView: Types.HangingProtocol.Protocol = { }, displaySets: [ { - id: 'defaultDisplaySetId', + id: 'activeDisplaySet', }, ], }, diff --git a/extensions/cornerstone/src/synchronizers/frameViewSynchronizer.ts b/extensions/cornerstone/src/synchronizers/frameViewSynchronizer.ts index 758c962e4..299b255db 100644 --- a/extensions/cornerstone/src/synchronizers/frameViewSynchronizer.ts +++ b/extensions/cornerstone/src/synchronizers/frameViewSynchronizer.ts @@ -43,7 +43,8 @@ const createFrameViewSynchronizer = (synchronizerName: string): Synchronizer => const synchronizer = SynchronizerManager.createSynchronizer( synchronizerName, EVENTS.STACK_VIEWPORT_SCROLL, - frameViewSyncCallback + frameViewSyncCallback, + { auxiliaryEvents: [{ name: EVENTS.CAMERA_MODIFIED, source: 'element' }] } ); return synchronizer; }; diff --git a/extensions/default/src/commandsModule.ts b/extensions/default/src/commandsModule.ts index f84f13e1f..b701ab3be 100644 --- a/extensions/default/src/commandsModule.ts +++ b/extensions/default/src/commandsModule.ts @@ -395,6 +395,7 @@ const commandsModule = ({ hangingProtocolService.setProtocol(protocolId, { stageId, stageIndex: useStageIdx, + displaySetSelectorMap, }); } else { hangingProtocolService.setProtocol(protocolId, { diff --git a/extensions/default/src/utils/reuseCachedLayouts.ts b/extensions/default/src/utils/reuseCachedLayouts.ts index 3e6f72850..b9a030f83 100644 --- a/extensions/default/src/utils/reuseCachedLayouts.ts +++ b/extensions/default/src/utils/reuseCachedLayouts.ts @@ -61,7 +61,8 @@ const reuseCachedLayout = (state, hangingProtocolService: HangingProtocolService if (viewportId === activeViewportId && i === 0) { setDisplaySetSelector(`${activeStudyUID}:activeDisplaySet:0`, displaySetUID); } - if (displaySetOptions[i]?.id) { + // The activeDisplaySet selector should only be set once (i.e. for the actual active display set) + if (displaySetOptions[i]?.id && displaySetOptions[i].id !== 'activeDisplaySet') { setDisplaySetSelector( `${activeStudyUID}:${displaySetOptions[i].id}:${ displaySetOptions[i].matchedDisplaySetsIndex || 0