Integration TrizRis OHIF: key images, annotations, layouts, access control and reconstruction
Build and Deploy Docs / build-and-deploy-docs (push) Canceled after 0s

This commit is contained in:
Kenza committed 2026-10-11 10:34:47 +02:00
1 parent bbe37ff388
commit f00379a672
28 files changed
+1898 -105

No files matched your search

+58 -5
View File
@@ -1,7 +1,8 @@
import update from 'immutability-helper';
import { utils } from '@ohif/core';
import { getLayoutPreference } from '../../../extensions/default/src/services/TrizRisLayoutApi';
import initToolGroups from './initToolGroups';
import { checkTrizRisAccess } from '../../../extensions/default/src/services/TrizRisAccessApi';
import {
addActivatePanelTriggers,
applyToolGroupAdditions,
@@ -182,9 +183,19 @@ export const defaultActivatePanelTriggers = [
},
];
export function onModeEnter({ servicesManager, extensionManager, commandsManager }: withAppTypes) {
const { measurementService, toolbarService, toolGroupService, customizationService } =
servicesManager.services;
export function onModeEnter({
servicesManager,
extensionManager,
commandsManager,
studyInstanceUIDs,
}: withAppTypes) {
const {
measurementService,
toolbarService,
toolGroupService,
customizationService,
hangingProtocolService,
} = servicesManager.services;
measurementService.clearMeasurements();
@@ -220,7 +231,7 @@ export function onModeEnter({ servicesManager, extensionManager, commandsManager
);
// Note: the mode's `modeCustomizations` are NOT applied here — the mode
// route applies them right after the mode scope is reset, before the app
// route applies them right after the mode scope is reset, before the appf
// config / URL `mode` phase blocks, so the final value of every key is
// decided purely by customization scope precedence and application order.
@@ -230,6 +241,47 @@ export function onModeEnter({ servicesManager, extensionManager, commandsManager
this._unsubscriptions.push(
...addActivatePanelTriggers({ servicesManager }, this.activatePanelTriggers)
);
const restoreLayoutTrizRis = async (attempt = 0) => {
try {
const studyInstanceUID = studyInstanceUIDs?.[0];
if (!studyInstanceUID) {
console.log('### STUDY UID PAS ENCORE DISPONIBLE ###');
return;
}
console.log('### STUDY UID DIRECT POUR LAYOUT ###', studyInstanceUID);
console.log('### STUDY UID POUR LAYOUT ###', studyInstanceUID);
const layout = await getLayoutPreference(studyInstanceUID);
console.log('### LAYOUT RECUPERE DEPUIS TRIZRIS ###', layout);
if (!layout) {
console.log('### AUCUNE PREFERENCE LAYOUT -> OHIF / HANGING PROTOCOL CONSERVE ###');
return;
}
console.log('### PREFERENCE LAYOUT TROUVEE -> PRIORITE TRIZRIS ###');
commandsManager.runCommand('setViewportGridLayout', {
numRows: layout.numRows,
numCols: layout.numCols,
isHangingProtocolLayout: false,
savePreference: false,
});
console.log('### LAYOUT TRIZRIS APPLIQUE ###', layout.numRows, 'x', layout.numCols);
console.log('### LAYOUT TRIZRIS APPLIQUE ###', layout.numRows, 'x', layout.numCols);
} catch (error) {
console.error('### ERREUR RESTAURATION LAYOUT TRIZRIS ###', error);
}
};
restoreLayoutTrizRis();
}
export function onModeExit({ servicesManager }: withAppTypes) {
@@ -240,6 +292,7 @@ export function onModeExit({ servicesManager }: withAppTypes) {
cornerstoneViewportService,
uiDialogService,
uiModalService,
hangingProtocolService,
} = servicesManager.services;
this._unsubscriptions?.forEach(unsubscribe => unsubscribe());
+5 -1
View File
@@ -83,11 +83,15 @@ function initDefaultToolGroup(extensionManager, toolGroupService, commandsManage
{ toolName: toolNames.LivewireContour },
{ toolName: toolNames.WindowLevelRegion },
],
enabled: [{ toolName: toolNames.ImageOverlayViewer }, { toolName: toolNames.ReferenceLines }],
enabled: [{ toolName: toolNames.ImageOverlayViewer }],
disabled: [
{
toolName: toolNames.AdvancedMagnify,
},
{
toolName: toolNames.ReferenceLines,
},
],
};