@ohif/app 3.8.0-beta.63 → 3.8.0-beta.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{121.bundle.f6c25e845985d96c423c.js → 121.bundle.fda405f29003c308ce09.js} +4 -4
- package/dist/{155.bundle.9e3dd18c9a3961232504.js → 155.bundle.a57744809d0f46030ee0.js} +12 -7
- package/dist/{188.bundle.528e9ad81159c776affa.js → 188.bundle.c448aed48915741e9f97.js} +2 -2
- package/dist/{270.bundle.fd387adff5b064fca506.js → 270.bundle.16ac8114c5c4ce006f4a.js} +51 -28
- package/dist/{295.bundle.c132f53e1397ef9d432a.js → 295.bundle.57700cd41fd87e1521b4.js} +4 -4
- package/dist/{339.bundle.591a0a6075220b14c249.js → 339.bundle.57dac3644803cefe3e3d.js} +27 -69
- package/dist/{68.bundle.efc5ba2a44aa2b96ee1a.js → 41.bundle.58b85dd990fb6fac615e.js} +280 -494
- package/dist/{250.bundle.d8b502b7ef6afc79a87e.js → 448.bundle.d195aba3aef25ec286d1.js} +284 -388
- package/dist/{530.bundle.ef1ea9d98f7b377a9d3a.js → 530.bundle.72d9812f117036615a38.js} +2 -2
- package/dist/{544.bundle.05b543f28d0c124950ef.js → 544.bundle.c3009e245ceb1554c70a.js} +5 -17
- package/dist/{559.bundle.fc08eab02848a451ed34.js → 559.bundle.05bd51e94422a2cab116.js} +6 -10
- package/dist/{594.bundle.3a5fa2e7d5636ddccb32.js → 594.bundle.14b122ab995e4b13e652.js} +147 -188
- package/dist/{50.bundle.55ad62f1f656f5fd5a36.js → 638.bundle.a63003e18bed65f227bb.js} +159 -395
- package/dist/699.bundle.efc67171e6d212f25a24.js +774 -0
- package/dist/{963.bundle.874395d7b2d80f9e5831.js → 701.bundle.bc40f1a7d5d6b1a4dd38.js} +554 -215
- package/dist/{724.bundle.294a41af83a5af33f3cc.js → 724.bundle.3945f8d2e9c8b0b23628.js} +86 -164
- package/dist/{862.bundle.c8eba798644149650775.js → 862.bundle.d787dac01f4567560a42.js} +2 -2
- package/dist/{889.bundle.a776c87be9e3580f3437.js → 889.bundle.ffc727aa6d1a74f2138d.js} +180 -207
- package/dist/{704.bundle.842ada45436f1fb029aa.js → 90.bundle.abde898ebd3c74f521f9.js} +323 -334
- package/dist/{905.bundle.73a711d0255cb988fa6e.js → 905.bundle.6b5b42b2403e4676bb3a.js} +119 -89
- package/dist/{907.bundle.6932f0458b9e0143c18a.js → 907.bundle.fbd5768fa5b53f9d3f86.js} +2 -14
- package/dist/{961.bundle.6cf1599ed3a2871c040f.js → 961.bundle.8bb5a713fc5a3817c6a6.js} +2 -15
- package/dist/{987.bundle.e7c041a6dfb4ddb41813.js → 987.bundle.91d4867efedd5b4d84cb.js} +5 -1
- package/dist/{app.bundle.22ffa6050ebef98b2066.js → app.bundle.0c24b249dc8b631916ef.js} +2234 -980
- package/dist/app.bundle.css +1 -1
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.99be036bab9b7f011b0c.js → polySeg.bundle.c1cec6312eb6c6dc3701.js} +1 -1
- package/dist/sw.js +1 -1
- package/package.json +17 -17
- package/dist/317.bundle.dd0879c5035c4b90fad3.js +0 -562
- /package/dist/{164.bundle.710b5db3fef4d536a59f.js → 164.bundle.ff12d6019a627cda2a6c.js} +0 -0
- /package/dist/{50.css → 638.css} +0 -0
- /package/dist/{963.css → 701.css} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[
|
|
2
|
+
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[701],{
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 20701:
|
|
5
5
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6
6
|
|
|
7
7
|
// ESM COMPAT FLAG
|
|
@@ -39,8 +39,8 @@ var react = __webpack_require__(41766);
|
|
|
39
39
|
var esm = __webpack_require__(50719);
|
|
40
40
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 16 modules
|
|
41
41
|
var dist_esm = __webpack_require__(20767);
|
|
42
|
-
// EXTERNAL MODULE: ../../core/src/index.ts +
|
|
43
|
-
var src = __webpack_require__(
|
|
42
|
+
// EXTERNAL MODULE: ../../core/src/index.ts + 67 modules
|
|
43
|
+
var src = __webpack_require__(78198);
|
|
44
44
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/streaming-image-volume-loader/dist/esm/index.js + 13 modules
|
|
45
45
|
var streaming_image_volume_loader_dist_esm = __webpack_require__(23722);
|
|
46
46
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js
|
|
@@ -119,8 +119,8 @@ function destroy() {
|
|
|
119
119
|
}
|
|
120
120
|
webWorkers.length = 0;
|
|
121
121
|
}
|
|
122
|
-
// EXTERNAL MODULE: ../../ui/src/index.js +
|
|
123
|
-
var ui_src = __webpack_require__(
|
|
122
|
+
// EXTERNAL MODULE: ../../ui/src/index.js + 497 modules
|
|
123
|
+
var ui_src = __webpack_require__(58046);
|
|
124
124
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/callInputDialog.tsx
|
|
125
125
|
|
|
126
126
|
|
|
@@ -3563,7 +3563,6 @@ function imageRenderedListener(evt) {
|
|
|
3563
3563
|
|
|
3564
3564
|
|
|
3565
3565
|
|
|
3566
|
-
|
|
3567
3566
|
// TODO: Cypress tests are currently grabbing this from the window?
|
|
3568
3567
|
window.cornerstone = esm;
|
|
3569
3568
|
window.cornerstoneTools = dist_esm;
|
|
@@ -3574,7 +3573,6 @@ async function init({
|
|
|
3574
3573
|
servicesManager,
|
|
3575
3574
|
commandsManager,
|
|
3576
3575
|
extensionManager,
|
|
3577
|
-
configuration,
|
|
3578
3576
|
appConfig
|
|
3579
3577
|
}) {
|
|
3580
3578
|
// Note: this should run first before initializing the cornerstone
|
|
@@ -3623,12 +3621,14 @@ async function init({
|
|
|
3623
3621
|
cineService,
|
|
3624
3622
|
cornerstoneViewportService,
|
|
3625
3623
|
hangingProtocolService,
|
|
3626
|
-
toolGroupService,
|
|
3627
3624
|
toolbarService,
|
|
3628
3625
|
viewportGridService,
|
|
3629
3626
|
stateSyncService,
|
|
3630
|
-
|
|
3627
|
+
segmentationService
|
|
3631
3628
|
} = servicesManager.services;
|
|
3629
|
+
toolbarService.registerEventForToolbarUpdate(cornerstoneViewportService, [cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED]);
|
|
3630
|
+
toolbarService.registerEventForToolbarUpdate(segmentationService, [segmentationService.EVENTS.SEGMENTATION_ADDED, segmentationService.EVENTS.SEGMENTATION_REMOVED, segmentationService.EVENTS.SEGMENTATION_UPDATED]);
|
|
3631
|
+
toolbarService.registerEventForToolbarUpdate(esm.eventTarget, [dist_esm.Enums.Events.TOOL_ACTIVATED]);
|
|
3632
3632
|
window.services = servicesManager.services;
|
|
3633
3633
|
window.extensionManager = extensionManager;
|
|
3634
3634
|
window.commandsManager = commandsManager;
|
|
@@ -3732,52 +3732,6 @@ async function init({
|
|
|
3732
3732
|
commandsManager
|
|
3733
3733
|
});
|
|
3734
3734
|
|
|
3735
|
-
/**
|
|
3736
|
-
* When a viewport gets a new display set, this call will go through all the
|
|
3737
|
-
* active tools in the toolbar, and call any commands registered in the
|
|
3738
|
-
* toolbar service with a callback to re-enable on displaying the viewport.
|
|
3739
|
-
*/
|
|
3740
|
-
const toolbarEventListener = evt => {
|
|
3741
|
-
const {
|
|
3742
|
-
element
|
|
3743
|
-
} = evt.detail;
|
|
3744
|
-
const activeTools = toolbarService.getActiveTools();
|
|
3745
|
-
activeTools.forEach(tool => {
|
|
3746
|
-
const toolData = toolbarService.getNestedButton(tool);
|
|
3747
|
-
const commands = toolData?.listeners?.[evt.type];
|
|
3748
|
-
commandsManager.run(commands, {
|
|
3749
|
-
element,
|
|
3750
|
-
evt
|
|
3751
|
-
});
|
|
3752
|
-
});
|
|
3753
|
-
};
|
|
3754
|
-
|
|
3755
|
-
/** Listens for active viewport events and fires the toolbar listeners */
|
|
3756
|
-
const activeViewportEventListener = evt => {
|
|
3757
|
-
const {
|
|
3758
|
-
viewportId
|
|
3759
|
-
} = evt;
|
|
3760
|
-
const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
|
|
3761
|
-
const activeTools = toolbarService.getActiveTools();
|
|
3762
|
-
activeTools.forEach(tool => {
|
|
3763
|
-
if (!toolGroup?._toolInstances?.[tool]) {
|
|
3764
|
-
return;
|
|
3765
|
-
}
|
|
3766
|
-
|
|
3767
|
-
// check if tool is active on the new viewport
|
|
3768
|
-
const toolEnabled = toolGroup._toolInstances[tool].mode === dist_esm.Enums.ToolModes.Enabled;
|
|
3769
|
-
if (!toolEnabled) {
|
|
3770
|
-
return;
|
|
3771
|
-
}
|
|
3772
|
-
const button = toolbarService.getNestedButton(tool);
|
|
3773
|
-
const commands = button?.listeners?.[evt.type];
|
|
3774
|
-
commandsManager.run(commands, {
|
|
3775
|
-
viewportId,
|
|
3776
|
-
evt
|
|
3777
|
-
});
|
|
3778
|
-
});
|
|
3779
|
-
};
|
|
3780
|
-
|
|
3781
3735
|
/**
|
|
3782
3736
|
* Runs error handler for failed requests.
|
|
3783
3737
|
* @param event
|
|
@@ -3788,27 +3742,6 @@ async function init({
|
|
|
3788
3742
|
const handler = src/* errorHandler */.r_.getHTTPErrorHandler();
|
|
3789
3743
|
handler(detail.error);
|
|
3790
3744
|
};
|
|
3791
|
-
const resetCrosshairs = evt => {
|
|
3792
|
-
const {
|
|
3793
|
-
element
|
|
3794
|
-
} = evt.detail;
|
|
3795
|
-
const {
|
|
3796
|
-
viewportId,
|
|
3797
|
-
renderingEngineId
|
|
3798
|
-
} = esm.getEnabledElement(element);
|
|
3799
|
-
const toolGroup = dist_esm.ToolGroupManager.getToolGroupForViewport(viewportId, renderingEngineId);
|
|
3800
|
-
if (!toolGroup || !toolGroup._toolInstances?.['Crosshairs']) {
|
|
3801
|
-
return;
|
|
3802
|
-
}
|
|
3803
|
-
const mode = toolGroup._toolInstances['Crosshairs'].mode;
|
|
3804
|
-
if (mode === dist_esm.Enums.ToolModes.Active) {
|
|
3805
|
-
toolGroup.setToolActive('Crosshairs');
|
|
3806
|
-
} else if (mode === dist_esm.Enums.ToolModes.Passive) {
|
|
3807
|
-
toolGroup.setToolPassive('Crosshairs');
|
|
3808
|
-
} else if (mode === dist_esm.Enums.ToolModes.Enabled) {
|
|
3809
|
-
toolGroup.setToolEnabled('Crosshairs');
|
|
3810
|
-
}
|
|
3811
|
-
};
|
|
3812
3745
|
esm.eventTarget.addEventListener(esm.EVENTS.STACK_VIEWPORT_NEW_STACK, evt => {
|
|
3813
3746
|
const {
|
|
3814
3747
|
element
|
|
@@ -3821,18 +3754,30 @@ async function init({
|
|
|
3821
3754
|
const {
|
|
3822
3755
|
element
|
|
3823
3756
|
} = evt.detail;
|
|
3824
|
-
element.addEventListener(esm.EVENTS.CAMERA_RESET,
|
|
3825
|
-
|
|
3757
|
+
element.addEventListener(esm.EVENTS.CAMERA_RESET, evt => {
|
|
3758
|
+
const {
|
|
3759
|
+
element
|
|
3760
|
+
} = evt.detail;
|
|
3761
|
+
const {
|
|
3762
|
+
viewportId
|
|
3763
|
+
} = (0,esm.getEnabledElement)(element);
|
|
3764
|
+
commandsManager.runCommand('resetCrosshairs', {
|
|
3765
|
+
viewportId
|
|
3766
|
+
});
|
|
3767
|
+
});
|
|
3768
|
+
|
|
3769
|
+
// eventTarget.addEventListener(EVENTS.STACK_VIEWPORT_NEW_STACK, toolbarEventListener);
|
|
3770
|
+
|
|
3826
3771
|
initViewTiming({
|
|
3827
|
-
element
|
|
3828
|
-
eventTarget: esm.eventTarget
|
|
3772
|
+
element
|
|
3829
3773
|
});
|
|
3830
3774
|
}
|
|
3831
3775
|
function elementDisabledHandler(evt) {
|
|
3832
3776
|
const {
|
|
3833
3777
|
element
|
|
3834
3778
|
} = evt.detail;
|
|
3835
|
-
|
|
3779
|
+
|
|
3780
|
+
// element.removeEventListener(EVENTS.CAMERA_RESET, resetCrosshairs);
|
|
3836
3781
|
|
|
3837
3782
|
// TODO - consider removing the callback when all elements are gone
|
|
3838
3783
|
// eventTarget.removeEventListener(
|
|
@@ -3842,7 +3787,11 @@ async function init({
|
|
|
3842
3787
|
}
|
|
3843
3788
|
esm.eventTarget.addEventListener(esm.EVENTS.ELEMENT_ENABLED, elementEnabledHandler.bind(null));
|
|
3844
3789
|
esm.eventTarget.addEventListener(esm.EVENTS.ELEMENT_DISABLED, elementDisabledHandler.bind(null));
|
|
3845
|
-
|
|
3790
|
+
|
|
3791
|
+
// viewportGridService.subscribe(
|
|
3792
|
+
// viewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED,
|
|
3793
|
+
// activeViewportEventListener
|
|
3794
|
+
// );
|
|
3846
3795
|
}
|
|
3847
3796
|
function CPUModal() {
|
|
3848
3797
|
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("p", null, "Your computer does not have enough GPU power to support the default GPU rendering mode. OHIF has switched to CPU rendering mode. Please note that CPU rendering does not support all features such as Volume Rendering, Multiplanar Reconstruction, and Segmentation Overlays."));
|
|
@@ -4699,7 +4648,7 @@ const CornerstoneViewportDownloadForm = ({
|
|
|
4699
4648
|
|
|
4700
4649
|
// add the viewport to the toolGroup
|
|
4701
4650
|
toolGroup.addViewport(downloadViewportId, renderingEngineId);
|
|
4702
|
-
Object.keys(toolGroup.
|
|
4651
|
+
Object.keys(toolGroup.getToolInstances()).forEach(toolName => {
|
|
4703
4652
|
// make all tools Enabled so that they can not be interacted with
|
|
4704
4653
|
// in the download viewport
|
|
4705
4654
|
if (toggle && toolName !== 'Crosshairs') {
|
|
@@ -4745,21 +4694,31 @@ CornerstoneViewportDownloadForm.propTypes = {
|
|
|
4745
4694
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/imageSliceSync/toggleImageSliceSync.ts
|
|
4746
4695
|
const IMAGE_SLICE_SYNC_NAME = 'IMAGE_SLICE_SYNC';
|
|
4747
4696
|
function toggleImageSliceSync({
|
|
4748
|
-
toggledState,
|
|
4749
4697
|
servicesManager,
|
|
4750
|
-
viewports: providedViewports
|
|
4698
|
+
viewports: providedViewports,
|
|
4699
|
+
syncId
|
|
4751
4700
|
}) {
|
|
4752
|
-
if (!toggledState) {
|
|
4753
|
-
return disableSync(IMAGE_SLICE_SYNC_NAME, servicesManager);
|
|
4754
|
-
}
|
|
4755
4701
|
const {
|
|
4756
4702
|
syncGroupService,
|
|
4757
4703
|
viewportGridService,
|
|
4758
4704
|
displaySetService,
|
|
4759
4705
|
cornerstoneViewportService
|
|
4760
4706
|
} = servicesManager.services;
|
|
4707
|
+
syncId ||= IMAGE_SLICE_SYNC_NAME;
|
|
4761
4708
|
const viewports = providedViewports || getReconstructableStackViewports(viewportGridService, displaySetService);
|
|
4762
4709
|
|
|
4710
|
+
// Todo: right now we don't have a proper way to define specific
|
|
4711
|
+
// viewports to add to synchronizers, and right now it is global or not
|
|
4712
|
+
// after we do that, we should do fine grained control of the synchronizers
|
|
4713
|
+
const someViewportHasSync = viewports.some(viewport => {
|
|
4714
|
+
const syncStates = syncGroupService.getSynchronizersForViewport(viewport.viewportOptions.viewportId);
|
|
4715
|
+
const imageSync = syncStates.find(syncState => syncState.id === syncId);
|
|
4716
|
+
return !!imageSync;
|
|
4717
|
+
});
|
|
4718
|
+
if (someViewportHasSync) {
|
|
4719
|
+
return disableSync(syncId, servicesManager);
|
|
4720
|
+
}
|
|
4721
|
+
|
|
4763
4722
|
// create synchronization group and add the viewports to it.
|
|
4764
4723
|
viewports.forEach(gridViewport => {
|
|
4765
4724
|
const {
|
|
@@ -4770,8 +4729,8 @@ function toggleImageSliceSync({
|
|
|
4770
4729
|
return;
|
|
4771
4730
|
}
|
|
4772
4731
|
syncGroupService.addViewportToSyncGroup(viewportId, viewport.getRenderingEngine().id, {
|
|
4773
|
-
type: '
|
|
4774
|
-
id:
|
|
4732
|
+
type: 'imageSlice',
|
|
4733
|
+
id: syncId,
|
|
4775
4734
|
source: true,
|
|
4776
4735
|
target: true
|
|
4777
4736
|
});
|
|
@@ -4826,6 +4785,95 @@ function getReconstructableStackViewports(viewportGridService, displaySetService
|
|
|
4826
4785
|
});
|
|
4827
4786
|
return viewports;
|
|
4828
4787
|
}
|
|
4788
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/toggleVOISliceSync.ts
|
|
4789
|
+
const VOI_SYNC_NAME = 'VOI_SYNC';
|
|
4790
|
+
const getSyncId = modality => `${VOI_SYNC_NAME}_${modality}`;
|
|
4791
|
+
function toggleVOISliceSync({
|
|
4792
|
+
servicesManager,
|
|
4793
|
+
viewports: providedViewports,
|
|
4794
|
+
syncId
|
|
4795
|
+
}) {
|
|
4796
|
+
const {
|
|
4797
|
+
syncGroupService,
|
|
4798
|
+
viewportGridService,
|
|
4799
|
+
displaySetService,
|
|
4800
|
+
cornerstoneViewportService
|
|
4801
|
+
} = servicesManager.services;
|
|
4802
|
+
const viewports = providedViewports || groupViewportsByModality(viewportGridService, displaySetService);
|
|
4803
|
+
|
|
4804
|
+
// Todo: right now we don't have a proper way to define specific
|
|
4805
|
+
// viewports to add to synchronizers, and right now it is global or not
|
|
4806
|
+
// after we do that, we should do fine grained control of the synchronizers
|
|
4807
|
+
|
|
4808
|
+
// we can apply voi sync within each modality group
|
|
4809
|
+
for (const [modality, modalityViewports] of Object.entries(viewports)) {
|
|
4810
|
+
const syncIdToUse = syncId || getSyncId(modality);
|
|
4811
|
+
const someViewportHasSync = modalityViewports.some(viewport => {
|
|
4812
|
+
const syncStates = syncGroupService.getSynchronizersForViewport(viewport.viewportOptions.viewportId);
|
|
4813
|
+
const imageSync = syncStates.find(syncState => syncState.id === syncIdToUse);
|
|
4814
|
+
return !!imageSync;
|
|
4815
|
+
});
|
|
4816
|
+
if (someViewportHasSync) {
|
|
4817
|
+
return toggleVOISliceSync_disableSync(modalityViewports, syncIdToUse, servicesManager);
|
|
4818
|
+
}
|
|
4819
|
+
|
|
4820
|
+
// create synchronization group and add the modalityViewports to it.
|
|
4821
|
+
modalityViewports.forEach(gridViewport => {
|
|
4822
|
+
const {
|
|
4823
|
+
viewportId
|
|
4824
|
+
} = gridViewport.viewportOptions;
|
|
4825
|
+
const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
|
|
4826
|
+
if (!viewport) {
|
|
4827
|
+
return;
|
|
4828
|
+
}
|
|
4829
|
+
syncGroupService.addViewportToSyncGroup(viewportId, viewport.getRenderingEngine().id, {
|
|
4830
|
+
type: 'voi',
|
|
4831
|
+
id: syncIdToUse,
|
|
4832
|
+
source: true,
|
|
4833
|
+
target: true
|
|
4834
|
+
});
|
|
4835
|
+
});
|
|
4836
|
+
}
|
|
4837
|
+
}
|
|
4838
|
+
function toggleVOISliceSync_disableSync(modalityViewports, syncId, servicesManager) {
|
|
4839
|
+
const {
|
|
4840
|
+
syncGroupService,
|
|
4841
|
+
cornerstoneViewportService
|
|
4842
|
+
} = servicesManager.services;
|
|
4843
|
+
const viewports = modalityViewports;
|
|
4844
|
+
viewports.forEach(gridViewport => {
|
|
4845
|
+
const {
|
|
4846
|
+
viewportId
|
|
4847
|
+
} = gridViewport.viewportOptions;
|
|
4848
|
+
const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
|
|
4849
|
+
if (!viewport) {
|
|
4850
|
+
return;
|
|
4851
|
+
}
|
|
4852
|
+
syncGroupService.removeViewportFromSyncGroup(viewport.id, viewport.getRenderingEngine().id, syncId);
|
|
4853
|
+
});
|
|
4854
|
+
}
|
|
4855
|
+
function groupViewportsByModality(viewportGridService, displaySetService) {
|
|
4856
|
+
let {
|
|
4857
|
+
viewports
|
|
4858
|
+
} = viewportGridService.getState();
|
|
4859
|
+
viewports = [...viewports.values()];
|
|
4860
|
+
|
|
4861
|
+
// group the viewports by modality
|
|
4862
|
+
return viewports.reduce((acc, viewport) => {
|
|
4863
|
+
const {
|
|
4864
|
+
displaySetInstanceUIDs
|
|
4865
|
+
} = viewport;
|
|
4866
|
+
// Todo: add proper fusion support
|
|
4867
|
+
const displaySetInstanceUID = displaySetInstanceUIDs[0];
|
|
4868
|
+
const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
|
|
4869
|
+
const modality = displaySet.Modality;
|
|
4870
|
+
if (!acc[modality]) {
|
|
4871
|
+
acc[modality] = [];
|
|
4872
|
+
}
|
|
4873
|
+
acc[modality].push(viewport);
|
|
4874
|
+
return acc;
|
|
4875
|
+
}, {});
|
|
4876
|
+
}
|
|
4829
4877
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/commandsModule.ts
|
|
4830
4878
|
|
|
4831
4879
|
|
|
@@ -4835,6 +4883,11 @@ function getReconstructableStackViewports(viewportGridService, displaySetService
|
|
|
4835
4883
|
|
|
4836
4884
|
|
|
4837
4885
|
|
|
4886
|
+
|
|
4887
|
+
const toggleSyncFunctions = {
|
|
4888
|
+
imageSlice: toggleImageSliceSync,
|
|
4889
|
+
voi: toggleVOISliceSync
|
|
4890
|
+
};
|
|
4838
4891
|
function commandsModule({
|
|
4839
4892
|
servicesManager,
|
|
4840
4893
|
commandsManager
|
|
@@ -4843,11 +4896,11 @@ function commandsModule({
|
|
|
4843
4896
|
viewportGridService,
|
|
4844
4897
|
toolGroupService,
|
|
4845
4898
|
cineService,
|
|
4846
|
-
toolbarService,
|
|
4847
4899
|
uiDialogService,
|
|
4848
4900
|
cornerstoneViewportService,
|
|
4849
4901
|
uiNotificationService,
|
|
4850
|
-
measurementService
|
|
4902
|
+
measurementService,
|
|
4903
|
+
syncGroupService
|
|
4851
4904
|
} = servicesManager.services;
|
|
4852
4905
|
const {
|
|
4853
4906
|
measurementServiceSource
|
|
@@ -5040,22 +5093,6 @@ function commandsModule({
|
|
|
5040
5093
|
}) => {
|
|
5041
5094
|
utils_callInputDialog(uiDialogService, data, callback);
|
|
5042
5095
|
},
|
|
5043
|
-
cleanUpCrosshairs: () => {
|
|
5044
|
-
// if the crosshairs tool is active, deactivate it and set window level active
|
|
5045
|
-
// since we are going back to main non-mpr HP
|
|
5046
|
-
const activeViewportToolGroup = toolGroupService.getToolGroup(null);
|
|
5047
|
-
if (activeViewportToolGroup._toolInstances?.Crosshairs?.mode === dist_esm.Enums.ToolModes.Active) {
|
|
5048
|
-
actions.toolbarServiceRecordInteraction({
|
|
5049
|
-
interactionType: 'tool',
|
|
5050
|
-
commands: [{
|
|
5051
|
-
commandOptions: {
|
|
5052
|
-
toolName: 'WindowLevel'
|
|
5053
|
-
},
|
|
5054
|
-
context: 'CORNERSTONE'
|
|
5055
|
-
}]
|
|
5056
|
-
});
|
|
5057
|
-
}
|
|
5058
|
-
},
|
|
5059
5096
|
toggleCine: () => {
|
|
5060
5097
|
const {
|
|
5061
5098
|
viewports
|
|
@@ -5064,11 +5101,6 @@ function commandsModule({
|
|
|
5064
5101
|
isCineEnabled
|
|
5065
5102
|
} = cineService.getState();
|
|
5066
5103
|
cineService.setIsCineEnabled(!isCineEnabled);
|
|
5067
|
-
toolbarService.setButton('Cine', {
|
|
5068
|
-
props: {
|
|
5069
|
-
isActive: !isCineEnabled
|
|
5070
|
-
}
|
|
5071
|
-
});
|
|
5072
5104
|
viewports.forEach((_, index) => cineService.setCine({
|
|
5073
5105
|
id: index,
|
|
5074
5106
|
isPlaying: false
|
|
@@ -5105,34 +5137,48 @@ function commandsModule({
|
|
|
5105
5137
|
});
|
|
5106
5138
|
viewport.render();
|
|
5107
5139
|
},
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5140
|
+
setToolEnabled: ({
|
|
5141
|
+
toolName,
|
|
5142
|
+
toggle
|
|
5143
|
+
}) => {
|
|
5144
|
+
const {
|
|
5145
|
+
viewports
|
|
5146
|
+
} = viewportGridService.getState();
|
|
5147
|
+
if (!viewports.size) {
|
|
5148
|
+
return;
|
|
5149
|
+
}
|
|
5150
|
+
const toolGroup = toolGroupService.getToolGroup(null);
|
|
5151
|
+
if (!toolGroup) {
|
|
5152
|
+
return;
|
|
5153
|
+
}
|
|
5154
|
+
const toolIsEnabled = toolGroup.getToolOptions(toolName).mode === dist_esm.Enums.ToolModes.Enabled;
|
|
5155
|
+
|
|
5156
|
+
// Toggle the tool's state only if the toggle is true
|
|
5157
|
+
if (toggle) {
|
|
5158
|
+
toolIsEnabled ? toolGroup.setToolDisabled(toolName) : toolGroup.setToolEnabled(toolName);
|
|
5159
|
+
}
|
|
5160
|
+
const renderingEngine = cornerstoneViewportService.getRenderingEngine();
|
|
5161
|
+
renderingEngine.render();
|
|
5113
5162
|
},
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5163
|
+
setToolActiveToolbar: ({
|
|
5164
|
+
value,
|
|
5165
|
+
itemId,
|
|
5166
|
+
toolGroupIds = []
|
|
5167
|
+
}) => {
|
|
5168
|
+
// Sometimes it is passed as value (tools with options), sometimes as itemId (toolbar buttons)
|
|
5169
|
+
const toolName = itemId || value;
|
|
5170
|
+
toolGroupIds = toolGroupIds.length ? toolGroupIds : toolGroupService.getToolGroupIds();
|
|
5171
|
+
toolGroupIds.forEach(toolGroupId => {
|
|
5172
|
+
actions.setToolActive({
|
|
5173
|
+
toolName,
|
|
5174
|
+
toolGroupId
|
|
5175
|
+
});
|
|
5176
|
+
});
|
|
5118
5177
|
},
|
|
5119
5178
|
setToolActive: ({
|
|
5120
5179
|
toolName,
|
|
5121
|
-
toolGroupId = null
|
|
5122
|
-
toggledState
|
|
5180
|
+
toolGroupId = null
|
|
5123
5181
|
}) => {
|
|
5124
|
-
if (toolName === 'Crosshairs') {
|
|
5125
|
-
const activeViewportToolGroup = toolGroupService.getToolGroup(null);
|
|
5126
|
-
if (!activeViewportToolGroup._toolInstances.Crosshairs) {
|
|
5127
|
-
uiNotificationService.show({
|
|
5128
|
-
title: 'Crosshairs',
|
|
5129
|
-
message: 'You need to be in a MPR view to use Crosshairs. Click on MPR button in the toolbar to activate it.',
|
|
5130
|
-
type: 'info',
|
|
5131
|
-
duration: 3000
|
|
5132
|
-
});
|
|
5133
|
-
throw new Error('Crosshairs tool is not available in this viewport');
|
|
5134
|
-
}
|
|
5135
|
-
}
|
|
5136
5182
|
const {
|
|
5137
5183
|
viewports
|
|
5138
5184
|
} = viewportGridService.getState();
|
|
@@ -5143,31 +5189,13 @@ function commandsModule({
|
|
|
5143
5189
|
if (!toolGroup) {
|
|
5144
5190
|
return;
|
|
5145
5191
|
}
|
|
5146
|
-
if (!toolGroup.
|
|
5147
|
-
|
|
5148
|
-
title: `${toolName} tool`,
|
|
5149
|
-
message: `The ${toolName} tool is not available in this viewport.`,
|
|
5150
|
-
type: 'info',
|
|
5151
|
-
duration: 3000
|
|
5152
|
-
});
|
|
5153
|
-
throw new Error(`ToolGroup ${toolGroup.id} does not have this tool.`);
|
|
5192
|
+
if (!toolGroup.hasTool(toolName)) {
|
|
5193
|
+
return;
|
|
5154
5194
|
}
|
|
5155
5195
|
const activeToolName = toolGroup.getActivePrimaryMouseButtonTool();
|
|
5156
5196
|
if (activeToolName) {
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
if (activeToolName === 'Crosshairs') {
|
|
5160
|
-
toolGroup.setToolDisabled(activeToolName);
|
|
5161
|
-
} else {
|
|
5162
|
-
toolGroup.setToolPassive(activeToolName);
|
|
5163
|
-
}
|
|
5164
|
-
}
|
|
5165
|
-
|
|
5166
|
-
// If there is a toggle state, then simply set the enabled/disabled state without
|
|
5167
|
-
// setting the tool active.
|
|
5168
|
-
if (toggledState != null) {
|
|
5169
|
-
toggledState ? toolGroup.setToolEnabled(toolName) : toolGroup.setToolDisabled(toolName);
|
|
5170
|
-
return;
|
|
5197
|
+
const activeToolOptions = toolGroup.getToolConfiguration(activeToolName);
|
|
5198
|
+
activeToolOptions?.disableOnPassive ? toolGroup.setToolDisabled(activeToolName) : toolGroup.setToolPassive(activeToolName);
|
|
5171
5199
|
}
|
|
5172
5200
|
|
|
5173
5201
|
// Set the new toolName to be active
|
|
@@ -5419,29 +5447,54 @@ function commandsModule({
|
|
|
5419
5447
|
const nextViewportIndex = (currentIndex + direction + viewportIds.length) % viewportIds.length;
|
|
5420
5448
|
viewportGridService.setActiveViewportId(viewportIds[nextViewportIndex]);
|
|
5421
5449
|
},
|
|
5422
|
-
|
|
5423
|
-
|
|
5450
|
+
/**
|
|
5451
|
+
* If the syncId is given and a synchronizer with that ID already exists, it will
|
|
5452
|
+
* toggle it on/off for the provided viewports. If not, it will attempt to create
|
|
5453
|
+
* a new synchronizer using the given syncId and type for the specified viewports.
|
|
5454
|
+
* If no viewports are provided, you may notice some default behavior.
|
|
5455
|
+
* - 'voi' type, we will aim to synchronize all viewports with the same modality
|
|
5456
|
+
* -'imageSlice' type, we will aim to synchronize all viewports with the same orientation.
|
|
5457
|
+
*
|
|
5458
|
+
* @param options
|
|
5459
|
+
* @param options.viewports - The viewports to synchronize
|
|
5460
|
+
* @param options.syncId - The synchronization group ID
|
|
5461
|
+
* @param options.type - The type of synchronization to perform
|
|
5462
|
+
*/
|
|
5463
|
+
toggleSynchronizer: ({
|
|
5464
|
+
type,
|
|
5465
|
+
viewports,
|
|
5466
|
+
syncId
|
|
5424
5467
|
}) => {
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5468
|
+
const synchronizer = syncGroupService.getSynchronizer(syncId);
|
|
5469
|
+
if (synchronizer) {
|
|
5470
|
+
synchronizer.isDisabled() ? synchronizer.setEnabled(true) : synchronizer.setEnabled(false);
|
|
5471
|
+
return;
|
|
5472
|
+
}
|
|
5473
|
+
const fn = toggleSyncFunctions[type];
|
|
5474
|
+
if (fn) {
|
|
5475
|
+
fn({
|
|
5476
|
+
servicesManager,
|
|
5477
|
+
viewports,
|
|
5478
|
+
syncId
|
|
5479
|
+
});
|
|
5480
|
+
}
|
|
5429
5481
|
},
|
|
5430
5482
|
setSourceViewportForReferenceLinesTool: ({
|
|
5431
|
-
toggledState,
|
|
5432
5483
|
viewportId
|
|
5433
5484
|
}) => {
|
|
5434
5485
|
if (!viewportId) {
|
|
5435
5486
|
const {
|
|
5436
5487
|
activeViewportId
|
|
5437
5488
|
} = viewportGridService.getState();
|
|
5438
|
-
viewportId = activeViewportId;
|
|
5489
|
+
viewportId = activeViewportId ?? 'default';
|
|
5439
5490
|
}
|
|
5440
5491
|
const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
|
|
5441
|
-
toolGroup
|
|
5492
|
+
toolGroup?.setToolConfiguration(dist_esm.ReferenceLinesTool.toolName, {
|
|
5442
5493
|
sourceViewportId: viewportId
|
|
5443
5494
|
}, true // overwrite
|
|
5444
5495
|
);
|
|
5496
|
+
const renderingEngine = cornerstoneViewportService.getRenderingEngine();
|
|
5497
|
+
renderingEngine.render();
|
|
5445
5498
|
},
|
|
5446
5499
|
storePresentation: ({
|
|
5447
5500
|
viewportId
|
|
@@ -5469,6 +5522,25 @@ function commandsModule({
|
|
|
5469
5522
|
unsubscribe(EVENT);
|
|
5470
5523
|
}
|
|
5471
5524
|
});
|
|
5525
|
+
},
|
|
5526
|
+
resetCrosshairs: ({
|
|
5527
|
+
viewportId
|
|
5528
|
+
}) => {
|
|
5529
|
+
const crosshairInstances = [];
|
|
5530
|
+
const getCrosshairInstances = toolGroupId => {
|
|
5531
|
+
const toolGroup = toolGroupService.getToolGroup(toolGroupId);
|
|
5532
|
+
crosshairInstances.push(toolGroup.getToolInstance('Crosshairs'));
|
|
5533
|
+
};
|
|
5534
|
+
if (!viewportId) {
|
|
5535
|
+
const toolGroupIds = toolGroupService.getToolGroupIds();
|
|
5536
|
+
toolGroupIds.forEach(getCrosshairInstances);
|
|
5537
|
+
} else {
|
|
5538
|
+
const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
|
|
5539
|
+
getCrosshairInstances(toolGroup.id);
|
|
5540
|
+
}
|
|
5541
|
+
crosshairInstances.forEach(ins => {
|
|
5542
|
+
ins.resetCrosshairs();
|
|
5543
|
+
});
|
|
5472
5544
|
}
|
|
5473
5545
|
};
|
|
5474
5546
|
const definitions = {
|
|
@@ -5476,7 +5548,6 @@ function commandsModule({
|
|
|
5476
5548
|
// context menu
|
|
5477
5549
|
showCornerstoneContextMenu: {
|
|
5478
5550
|
commandFn: actions.showCornerstoneContextMenu,
|
|
5479
|
-
storeContexts: [],
|
|
5480
5551
|
options: {
|
|
5481
5552
|
menuCustomizationId: 'measurementsContextMenu',
|
|
5482
5553
|
commands: [{
|
|
@@ -5488,9 +5559,7 @@ function commandsModule({
|
|
|
5488
5559
|
commandFn: actions.getNearbyToolData
|
|
5489
5560
|
},
|
|
5490
5561
|
getNearbyAnnotation: {
|
|
5491
|
-
commandFn: actions.getNearbyAnnotation
|
|
5492
|
-
storeContexts: [],
|
|
5493
|
-
options: {}
|
|
5562
|
+
commandFn: actions.getNearbyAnnotation
|
|
5494
5563
|
},
|
|
5495
5564
|
deleteMeasurement: {
|
|
5496
5565
|
commandFn: actions.deleteMeasurement
|
|
@@ -5504,12 +5573,15 @@ function commandsModule({
|
|
|
5504
5573
|
setWindowLevel: {
|
|
5505
5574
|
commandFn: actions.setWindowLevel
|
|
5506
5575
|
},
|
|
5507
|
-
toolbarServiceRecordInteraction: {
|
|
5508
|
-
commandFn: actions.toolbarServiceRecordInteraction
|
|
5509
|
-
},
|
|
5510
5576
|
setToolActive: {
|
|
5511
5577
|
commandFn: actions.setToolActive
|
|
5512
5578
|
},
|
|
5579
|
+
setToolActiveToolbar: {
|
|
5580
|
+
commandFn: actions.setToolActiveToolbar
|
|
5581
|
+
},
|
|
5582
|
+
setToolEnabled: {
|
|
5583
|
+
commandFn: actions.setToolEnabled
|
|
5584
|
+
},
|
|
5513
5585
|
rotateViewportCW: {
|
|
5514
5586
|
commandFn: actions.rotateViewport,
|
|
5515
5587
|
options: {
|
|
@@ -5612,14 +5684,14 @@ function commandsModule({
|
|
|
5612
5684
|
storePresentation: {
|
|
5613
5685
|
commandFn: actions.storePresentation
|
|
5614
5686
|
},
|
|
5615
|
-
setToolbarToggled: {
|
|
5616
|
-
commandFn: actions.setToolbarToggled
|
|
5617
|
-
},
|
|
5618
|
-
cleanUpCrosshairs: {
|
|
5619
|
-
commandFn: actions.cleanUpCrosshairs
|
|
5620
|
-
},
|
|
5621
5687
|
attachProtocolViewportDataListener: {
|
|
5622
5688
|
commandFn: actions.attachProtocolViewportDataListener
|
|
5689
|
+
},
|
|
5690
|
+
resetCrosshairs: {
|
|
5691
|
+
commandFn: actions.resetCrosshairs
|
|
5692
|
+
},
|
|
5693
|
+
toggleSynchronizer: {
|
|
5694
|
+
commandFn: actions.toggleSynchronizer
|
|
5623
5695
|
}
|
|
5624
5696
|
};
|
|
5625
5697
|
return {
|
|
@@ -5633,7 +5705,9 @@ function commandsModule({
|
|
|
5633
5705
|
const fourUp = {
|
|
5634
5706
|
id: 'fourUp',
|
|
5635
5707
|
locked: true,
|
|
5636
|
-
name: '
|
|
5708
|
+
name: '3D four up',
|
|
5709
|
+
icon: 'layout-advanced-3d-four-up',
|
|
5710
|
+
isPreset: true,
|
|
5637
5711
|
createdDate: '2023-03-15T10:29:44.894Z',
|
|
5638
5712
|
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
5639
5713
|
availableTo: {},
|
|
@@ -5741,7 +5815,9 @@ const fourUp = {
|
|
|
5741
5815
|
const main3D = {
|
|
5742
5816
|
id: 'main3D',
|
|
5743
5817
|
locked: true,
|
|
5744
|
-
name: '
|
|
5818
|
+
name: '3D main',
|
|
5819
|
+
icon: 'layout-advanced-3d-main',
|
|
5820
|
+
isPreset: true,
|
|
5745
5821
|
createdDate: '2023-03-15T10:29:44.894Z',
|
|
5746
5822
|
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
5747
5823
|
availableTo: {},
|
|
@@ -5869,8 +5945,10 @@ const main3D = {
|
|
|
5869
5945
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/mpr.ts
|
|
5870
5946
|
const mpr = {
|
|
5871
5947
|
id: 'mpr',
|
|
5872
|
-
name: '
|
|
5948
|
+
name: 'MPR',
|
|
5873
5949
|
locked: true,
|
|
5950
|
+
icon: 'layout-advanced-mpr',
|
|
5951
|
+
isPreset: true,
|
|
5874
5952
|
createdDate: '2021-02-23',
|
|
5875
5953
|
modifiedDate: '2023-08-15',
|
|
5876
5954
|
availableTo: {},
|
|
@@ -5887,11 +5965,8 @@ const mpr = {
|
|
|
5887
5965
|
protocolId: 'mpr'
|
|
5888
5966
|
},
|
|
5889
5967
|
context: 'DEFAULT'
|
|
5890
|
-
}],
|
|
5891
|
-
// Turns off crosshairs when switching out of MPR mode
|
|
5892
|
-
onProtocolExit: [{
|
|
5893
|
-
commandName: 'cleanUpCrosshairs'
|
|
5894
5968
|
}]
|
|
5969
|
+
// Turns off crosshairs when switching out of MPR mode
|
|
5895
5970
|
},
|
|
5896
5971
|
displaySetSelectors: {
|
|
5897
5972
|
activeDisplaySet: {
|
|
@@ -6111,7 +6186,9 @@ const mprAnd3DVolumeViewport = {
|
|
|
6111
6186
|
const only3D = {
|
|
6112
6187
|
id: 'only3D',
|
|
6113
6188
|
locked: true,
|
|
6114
|
-
name: '
|
|
6189
|
+
name: '3D only',
|
|
6190
|
+
icon: 'layout-advanced-3d-only',
|
|
6191
|
+
isPreset: true,
|
|
6115
6192
|
createdDate: '2023-03-15T10:29:44.894Z',
|
|
6116
6193
|
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
6117
6194
|
availableTo: {},
|
|
@@ -6165,7 +6242,9 @@ const only3D = {
|
|
|
6165
6242
|
const primary3D = {
|
|
6166
6243
|
id: 'primary3D',
|
|
6167
6244
|
locked: true,
|
|
6168
|
-
name: '
|
|
6245
|
+
name: '3D primary',
|
|
6246
|
+
icon: 'layout-advanced-3d-primary',
|
|
6247
|
+
isPreset: true,
|
|
6169
6248
|
createdDate: '2023-03-15T10:29:44.894Z',
|
|
6170
6249
|
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
6171
6250
|
availableTo: {},
|
|
@@ -6294,7 +6373,9 @@ const primary3D = {
|
|
|
6294
6373
|
const primaryAxial = {
|
|
6295
6374
|
id: 'primaryAxial',
|
|
6296
6375
|
locked: true,
|
|
6297
|
-
name: '
|
|
6376
|
+
name: 'Axial Primary',
|
|
6377
|
+
icon: 'layout-advanced-axial-primary',
|
|
6378
|
+
isPreset: true,
|
|
6298
6379
|
createdDate: '2023-03-15T10:29:44.894Z',
|
|
6299
6380
|
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
6300
6381
|
availableTo: {},
|
|
@@ -6431,6 +6512,250 @@ function getHangingProtocolModule() {
|
|
|
6431
6512
|
}];
|
|
6432
6513
|
}
|
|
6433
6514
|
/* harmony default export */ const src_getHangingProtocolModule = (getHangingProtocolModule);
|
|
6515
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/getToolbarModule.tsx
|
|
6516
|
+
|
|
6517
|
+
const getToggledClassName = isToggled => {
|
|
6518
|
+
return isToggled ? '!text-primary-active' : '!text-common-bright hover:!bg-primary-dark hover:text-primary-light';
|
|
6519
|
+
};
|
|
6520
|
+
function getToolbarModule({
|
|
6521
|
+
commandsManager,
|
|
6522
|
+
servicesManager
|
|
6523
|
+
}) {
|
|
6524
|
+
const {
|
|
6525
|
+
toolGroupService,
|
|
6526
|
+
syncGroupService,
|
|
6527
|
+
cornerstoneViewportService,
|
|
6528
|
+
hangingProtocolService,
|
|
6529
|
+
displaySetService,
|
|
6530
|
+
viewportGridService
|
|
6531
|
+
} = servicesManager.services;
|
|
6532
|
+
return [
|
|
6533
|
+
// functions/helpers to be used by the toolbar buttons to decide if they should
|
|
6534
|
+
// enabled or not
|
|
6535
|
+
{
|
|
6536
|
+
name: 'evaluate.cornerstoneTool',
|
|
6537
|
+
evaluate: ({
|
|
6538
|
+
viewportId,
|
|
6539
|
+
button
|
|
6540
|
+
}) => {
|
|
6541
|
+
const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
|
|
6542
|
+
if (!toolGroup) {
|
|
6543
|
+
return;
|
|
6544
|
+
}
|
|
6545
|
+
const toolName = getToolNameForButton(button);
|
|
6546
|
+
if (!toolGroup || !toolGroup.hasTool(toolName)) {
|
|
6547
|
+
return {
|
|
6548
|
+
disabled: true,
|
|
6549
|
+
className: '!text-common-bright ohif-disabled'
|
|
6550
|
+
};
|
|
6551
|
+
}
|
|
6552
|
+
const isPrimaryActive = toolGroup.getActivePrimaryMouseButtonTool() === toolName;
|
|
6553
|
+
return {
|
|
6554
|
+
disabled: false,
|
|
6555
|
+
className: isPrimaryActive ? '!text-black bg-primary-light' : '!text-common-bright hover:!bg-primary-dark hover:!text-primary-light',
|
|
6556
|
+
// Todo: isActive right now is used for nested buttons where the primary
|
|
6557
|
+
// button needs to be fully rounded (vs partial rounded) when active
|
|
6558
|
+
// otherwise it does not have any other use
|
|
6559
|
+
isActive: isPrimaryActive
|
|
6560
|
+
};
|
|
6561
|
+
}
|
|
6562
|
+
}, {
|
|
6563
|
+
name: 'evaluate.group.promoteToPrimaryIfCornerstoneToolNotActiveInTheList',
|
|
6564
|
+
evaluate: ({
|
|
6565
|
+
viewportId,
|
|
6566
|
+
button,
|
|
6567
|
+
itemId
|
|
6568
|
+
}) => {
|
|
6569
|
+
const {
|
|
6570
|
+
items
|
|
6571
|
+
} = button.props;
|
|
6572
|
+
const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
|
|
6573
|
+
if (!toolGroup) {
|
|
6574
|
+
return {
|
|
6575
|
+
primary: button.props.primary,
|
|
6576
|
+
items
|
|
6577
|
+
};
|
|
6578
|
+
}
|
|
6579
|
+
const activeToolName = toolGroup.getActivePrimaryMouseButtonTool();
|
|
6580
|
+
|
|
6581
|
+
// check if the active toolName is part of the items then we need
|
|
6582
|
+
// to move it to the primary button
|
|
6583
|
+
const activeToolIndex = items.findIndex(item => {
|
|
6584
|
+
const toolName = getToolNameForButton(item);
|
|
6585
|
+
return toolName === activeToolName;
|
|
6586
|
+
});
|
|
6587
|
+
|
|
6588
|
+
// if there is an active tool in the items dropdown bound to the primary mouse/touch
|
|
6589
|
+
// we should show that no matter what
|
|
6590
|
+
if (activeToolIndex > -1) {
|
|
6591
|
+
return {
|
|
6592
|
+
primary: items[activeToolIndex],
|
|
6593
|
+
items
|
|
6594
|
+
};
|
|
6595
|
+
}
|
|
6596
|
+
if (!itemId) {
|
|
6597
|
+
return {
|
|
6598
|
+
primary: button.props.primary,
|
|
6599
|
+
items
|
|
6600
|
+
};
|
|
6601
|
+
}
|
|
6602
|
+
|
|
6603
|
+
// other wise we can move the clicked tool to the primary button
|
|
6604
|
+
const clickedItemProps = items.find(item => item.id === itemId || item.itemId === itemId);
|
|
6605
|
+
return {
|
|
6606
|
+
primary: clickedItemProps,
|
|
6607
|
+
items
|
|
6608
|
+
};
|
|
6609
|
+
}
|
|
6610
|
+
}, {
|
|
6611
|
+
name: 'evaluate.action',
|
|
6612
|
+
evaluate: ({
|
|
6613
|
+
viewportId,
|
|
6614
|
+
button
|
|
6615
|
+
}) => {
|
|
6616
|
+
return {
|
|
6617
|
+
className: '!text-common-bright hover:!bg-primary-dark hover:text-primary-light'
|
|
6618
|
+
};
|
|
6619
|
+
}
|
|
6620
|
+
}, {
|
|
6621
|
+
name: 'evaluate.cornerstoneTool.toggle',
|
|
6622
|
+
evaluate: ({
|
|
6623
|
+
viewportId,
|
|
6624
|
+
button
|
|
6625
|
+
}) => {
|
|
6626
|
+
const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
|
|
6627
|
+
if (!toolGroup) {
|
|
6628
|
+
return;
|
|
6629
|
+
}
|
|
6630
|
+
const toolName = getToolNameForButton(button);
|
|
6631
|
+
if (!toolGroup || !toolGroup.hasTool(toolName)) {
|
|
6632
|
+
return {
|
|
6633
|
+
disabled: true,
|
|
6634
|
+
className: '!text-common-bright ohif-disabled'
|
|
6635
|
+
};
|
|
6636
|
+
}
|
|
6637
|
+
const isOff = [dist_esm.Enums.ToolModes.Disabled, dist_esm.Enums.ToolModes.Passive].includes(toolGroup.getToolOptions(toolName).mode);
|
|
6638
|
+
return {
|
|
6639
|
+
className: getToggledClassName(!isOff)
|
|
6640
|
+
};
|
|
6641
|
+
}
|
|
6642
|
+
}, {
|
|
6643
|
+
name: 'evaluate.cornerstone.synchronizer',
|
|
6644
|
+
evaluate: ({
|
|
6645
|
+
viewportId,
|
|
6646
|
+
button
|
|
6647
|
+
}) => {
|
|
6648
|
+
let synchronizers = syncGroupService.getSynchronizersForViewport(viewportId);
|
|
6649
|
+
if (!synchronizers?.length) {
|
|
6650
|
+
return {
|
|
6651
|
+
className: getToggledClassName(false)
|
|
6652
|
+
};
|
|
6653
|
+
}
|
|
6654
|
+
const synchronizerType = button?.commands?.[0]?.commandOptions?.type;
|
|
6655
|
+
synchronizers = syncGroupService.getSynchronizersOfType(synchronizerType);
|
|
6656
|
+
if (!synchronizers?.length) {
|
|
6657
|
+
return {
|
|
6658
|
+
className: getToggledClassName(false)
|
|
6659
|
+
};
|
|
6660
|
+
}
|
|
6661
|
+
|
|
6662
|
+
// Todo: we need a better way to find the synchronizers based on their
|
|
6663
|
+
// type, but for now we just check the first one and see if it is
|
|
6664
|
+
// enabled
|
|
6665
|
+
const synchronizer = synchronizers[0];
|
|
6666
|
+
const isEnabled = synchronizer?._enabled;
|
|
6667
|
+
return {
|
|
6668
|
+
className: getToggledClassName(isEnabled)
|
|
6669
|
+
};
|
|
6670
|
+
}
|
|
6671
|
+
}, {
|
|
6672
|
+
name: 'evaluate.not3D',
|
|
6673
|
+
evaluate: ({
|
|
6674
|
+
viewportId,
|
|
6675
|
+
button
|
|
6676
|
+
}) => {
|
|
6677
|
+
const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
|
|
6678
|
+
if (viewport?.type === 'volume3d') {
|
|
6679
|
+
return {
|
|
6680
|
+
disabled: true,
|
|
6681
|
+
className: '!text-common-bright ohif-disabled'
|
|
6682
|
+
};
|
|
6683
|
+
}
|
|
6684
|
+
}
|
|
6685
|
+
}, {
|
|
6686
|
+
name: 'evaluate.viewportProperties.toggle',
|
|
6687
|
+
evaluate: ({
|
|
6688
|
+
viewportId,
|
|
6689
|
+
button
|
|
6690
|
+
}) => {
|
|
6691
|
+
const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
|
|
6692
|
+
if (!viewport || viewport.isDisabled) {
|
|
6693
|
+
return;
|
|
6694
|
+
}
|
|
6695
|
+
const propId = button.id;
|
|
6696
|
+
const properties = viewport.getProperties();
|
|
6697
|
+
const camera = viewport.getCamera();
|
|
6698
|
+
const prop = camera?.[propId] || properties?.[propId];
|
|
6699
|
+
if (!prop) {
|
|
6700
|
+
return {
|
|
6701
|
+
disabled: false,
|
|
6702
|
+
className: '!text-common-bright hover:!bg-primary-dark hover:text-primary-light'
|
|
6703
|
+
};
|
|
6704
|
+
}
|
|
6705
|
+
const isToggled = prop;
|
|
6706
|
+
return {
|
|
6707
|
+
className: getToggledClassName(isToggled)
|
|
6708
|
+
};
|
|
6709
|
+
}
|
|
6710
|
+
}, {
|
|
6711
|
+
name: 'evaluate.mpr',
|
|
6712
|
+
evaluate: ({
|
|
6713
|
+
viewportId,
|
|
6714
|
+
button
|
|
6715
|
+
}) => {
|
|
6716
|
+
const {
|
|
6717
|
+
protocol
|
|
6718
|
+
} = hangingProtocolService.getActiveProtocol();
|
|
6719
|
+
const displaySetUIDs = viewportGridService.getDisplaySetsUIDsForViewport(viewportId);
|
|
6720
|
+
if (!displaySetUIDs?.length) {
|
|
6721
|
+
return;
|
|
6722
|
+
}
|
|
6723
|
+
const displaySets = displaySetUIDs.map(displaySetService.getDisplaySetByUID);
|
|
6724
|
+
const areReconstructable = displaySets.every(displaySet => {
|
|
6725
|
+
return displaySet.isReconstructable;
|
|
6726
|
+
});
|
|
6727
|
+
if (!areReconstructable) {
|
|
6728
|
+
return {
|
|
6729
|
+
disabled: true,
|
|
6730
|
+
className: '!text-common-bright ohif-disabled'
|
|
6731
|
+
};
|
|
6732
|
+
}
|
|
6733
|
+
const isMpr = protocol?.id === 'mpr';
|
|
6734
|
+
return {
|
|
6735
|
+
disabled: false,
|
|
6736
|
+
className: getToggledClassName(isMpr)
|
|
6737
|
+
};
|
|
6738
|
+
}
|
|
6739
|
+
}];
|
|
6740
|
+
}
|
|
6741
|
+
function getToolNameForButton(button) {
|
|
6742
|
+
const {
|
|
6743
|
+
props
|
|
6744
|
+
} = button;
|
|
6745
|
+
const commands = props?.commands || button.commands;
|
|
6746
|
+
const commandsArray = Array.isArray(commands) ? commands : [commands];
|
|
6747
|
+
const firstCommand = commandsArray[0];
|
|
6748
|
+
if (typeof firstCommand === 'string') {
|
|
6749
|
+
// likely not a cornerstone tool
|
|
6750
|
+
return null;
|
|
6751
|
+
}
|
|
6752
|
+
if ('commandOptions' in firstCommand) {
|
|
6753
|
+
return firstCommand.commandOptions.toolName ?? props?.id ?? button.id;
|
|
6754
|
+
}
|
|
6755
|
+
|
|
6756
|
+
// use id as a fallback for toolName
|
|
6757
|
+
return props?.id ?? button.id;
|
|
6758
|
+
}
|
|
6434
6759
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ToolGroupService/ToolGroupService.ts
|
|
6435
6760
|
var _class;
|
|
6436
6761
|
|
|
@@ -6567,19 +6892,6 @@ class ToolGroupService {
|
|
|
6567
6892
|
this.addToolsToToolGroup(toolGroupId, tools);
|
|
6568
6893
|
return toolGroup;
|
|
6569
6894
|
}
|
|
6570
|
-
|
|
6571
|
-
/**
|
|
6572
|
-
private changeConfigurationIfNecessary(toolGroup, volumeUID) {
|
|
6573
|
-
// handle specific assignment for volumeUID (e.g., fusion)
|
|
6574
|
-
const toolInstances = toolGroup._toolInstances;
|
|
6575
|
-
// Object.values(toolInstances).forEach(toolInstance => {
|
|
6576
|
-
// if (toolInstance.configuration) {
|
|
6577
|
-
// toolInstance.configuration.volumeUID = volumeUID;
|
|
6578
|
-
// }
|
|
6579
|
-
// });
|
|
6580
|
-
}
|
|
6581
|
-
*/
|
|
6582
|
-
|
|
6583
6895
|
/**
|
|
6584
6896
|
* Get the tool's configuration based on the tool name and tool group id
|
|
6585
6897
|
* @param toolGroupId - The id of the tool group that the tool instance belongs to.
|
|
@@ -6698,6 +7010,7 @@ ToolGroupService.REGISTRATION = {
|
|
|
6698
7010
|
var SyncGroupService_class;
|
|
6699
7011
|
|
|
6700
7012
|
|
|
7013
|
+
|
|
6701
7014
|
const SyncGroupService_EVENTS = {
|
|
6702
7015
|
TOOL_GROUP_CREATED: 'event::cornerstone::syncgroupservice:toolgroupcreated'
|
|
6703
7016
|
};
|
|
@@ -6711,6 +7024,7 @@ const POSITION = 'cameraposition';
|
|
|
6711
7024
|
const VOI = 'voi';
|
|
6712
7025
|
const ZOOMPAN = 'zoompan';
|
|
6713
7026
|
const STACKIMAGE = 'stackimage';
|
|
7027
|
+
const IMAGE_SLICE = 'imageslice';
|
|
6714
7028
|
const asSyncGroup = syncGroup => typeof syncGroup === 'string' ? {
|
|
6715
7029
|
type: syncGroup
|
|
6716
7030
|
} : syncGroup;
|
|
@@ -6723,8 +7037,12 @@ class SyncGroupService {
|
|
|
6723
7037
|
[POSITION]: dist_esm.synchronizers.createCameraPositionSynchronizer,
|
|
6724
7038
|
[VOI]: dist_esm.synchronizers.createVOISynchronizer,
|
|
6725
7039
|
[ZOOMPAN]: dist_esm.synchronizers.createZoomPanSynchronizer,
|
|
6726
|
-
|
|
7040
|
+
// todo: remove stack image since it is legacy now and the image_slice
|
|
7041
|
+
// handles both stack and volume viewports
|
|
7042
|
+
[STACKIMAGE]: dist_esm.synchronizers.createImageSliceSynchronizer,
|
|
7043
|
+
[IMAGE_SLICE]: dist_esm.synchronizers.createImageSliceSynchronizer
|
|
6727
7044
|
};
|
|
7045
|
+
this.synchronizersByType = {};
|
|
6728
7046
|
this.servicesManager = serviceManager;
|
|
6729
7047
|
this.listeners = {};
|
|
6730
7048
|
this.EVENTS = SyncGroupService_EVENTS;
|
|
@@ -6732,13 +7050,22 @@ class SyncGroupService {
|
|
|
6732
7050
|
Object.assign(this, src/* pubSubServiceInterface */.Ml);
|
|
6733
7051
|
}
|
|
6734
7052
|
_createSynchronizer(type, id, options) {
|
|
7053
|
+
// Initialize if not already done
|
|
7054
|
+
this.synchronizersByType[type] = this.synchronizersByType[type] || [];
|
|
6735
7055
|
const syncCreator = this.synchronizerCreators[type.toLowerCase()];
|
|
6736
7056
|
if (syncCreator) {
|
|
6737
|
-
|
|
7057
|
+
const synchronizer = syncCreator(id, options);
|
|
7058
|
+
if (synchronizer) {
|
|
7059
|
+
this.synchronizersByType[type].push(synchronizer);
|
|
7060
|
+
return synchronizer;
|
|
7061
|
+
}
|
|
6738
7062
|
} else {
|
|
6739
|
-
console.warn(
|
|
7063
|
+
console.warn(`Unknown synchronizer type: ${type}, id: ${id}`);
|
|
6740
7064
|
}
|
|
6741
7065
|
}
|
|
7066
|
+
getSyncCreatorForType(type) {
|
|
7067
|
+
return this.synchronizerCreators[type.toLowerCase()];
|
|
7068
|
+
}
|
|
6742
7069
|
|
|
6743
7070
|
/**
|
|
6744
7071
|
* Creates a synchronizer type.
|
|
@@ -6751,6 +7078,15 @@ class SyncGroupService {
|
|
|
6751
7078
|
getSynchronizer(id) {
|
|
6752
7079
|
return dist_esm.SynchronizerManager.getSynchronizer(id);
|
|
6753
7080
|
}
|
|
7081
|
+
|
|
7082
|
+
/**
|
|
7083
|
+
* Retrieves an array of synchronizers of a specific type.
|
|
7084
|
+
* @param type - The type of synchronizers to retrieve.
|
|
7085
|
+
* @returns An array of synchronizers of the specified type.
|
|
7086
|
+
*/
|
|
7087
|
+
getSynchronizersOfType(type) {
|
|
7088
|
+
return this.synchronizersByType[type];
|
|
7089
|
+
}
|
|
6754
7090
|
_getOrCreateSynchronizer(type, id, options) {
|
|
6755
7091
|
let synchronizer = dist_esm.SynchronizerManager.getSynchronizer(id);
|
|
6756
7092
|
if (!synchronizer) {
|
|
@@ -6791,8 +7127,12 @@ class SyncGroupService {
|
|
|
6791
7127
|
destroy() {
|
|
6792
7128
|
dist_esm.SynchronizerManager.destroy();
|
|
6793
7129
|
}
|
|
6794
|
-
getSynchronizersForViewport(viewportId
|
|
6795
|
-
|
|
7130
|
+
getSynchronizersForViewport(viewportId) {
|
|
7131
|
+
const renderingEngine = (0,esm.getRenderingEngines)().find(re => {
|
|
7132
|
+
return re.getViewports().find(vp => vp.id === viewportId);
|
|
7133
|
+
}) || (0,esm.getRenderingEngines)()[0];
|
|
7134
|
+
const synchronizers = dist_esm.SynchronizerManager.getAllSynchronizers();
|
|
7135
|
+
return synchronizers.filter(s => s.hasSourceViewport(renderingEngine.id, viewportId) || s.hasTargetViewport(renderingEngine.id, viewportId));
|
|
6796
7136
|
}
|
|
6797
7137
|
removeViewportFromSyncGroup(viewportId, renderingEngineId, syncGroupId) {
|
|
6798
7138
|
const synchronizers = dist_esm.SynchronizerManager.getAllSynchronizers();
|
|
@@ -7065,7 +7405,7 @@ class SegmentationService extends src/* PubSubService */.Rc {
|
|
|
7065
7405
|
|
|
7066
7406
|
// Force use of a Uint8Array SharedArrayBuffer for the segmentation to save space and so
|
|
7067
7407
|
// it is easily compressible in worker thread.
|
|
7068
|
-
await esm.volumeLoader.
|
|
7408
|
+
await esm.volumeLoader.createAndCacheDerivedSegmentationVolume(volumeId, {
|
|
7069
7409
|
volumeId: segmentationId,
|
|
7070
7410
|
targetBuffer: {
|
|
7071
7411
|
type: 'Uint8Array',
|
|
@@ -7229,8 +7569,6 @@ class SegmentationService extends src/* PubSubService */.Rc {
|
|
|
7229
7569
|
};
|
|
7230
7570
|
this.setConfiguration = configuration => {
|
|
7231
7571
|
const {
|
|
7232
|
-
brushSize,
|
|
7233
|
-
brushThresholdGate,
|
|
7234
7572
|
fillAlpha,
|
|
7235
7573
|
fillAlphaInactive,
|
|
7236
7574
|
outlineWidthActive,
|
|
@@ -8168,7 +8506,6 @@ class SegmentationService extends src/* PubSubService */.Rc {
|
|
|
8168
8506
|
}
|
|
8169
8507
|
segmentInfo.label = label;
|
|
8170
8508
|
if (suppressEvents === false) {
|
|
8171
|
-
// this._setSegmentationModified(segmentationId);
|
|
8172
8509
|
this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
|
|
8173
8510
|
segmentation
|
|
8174
8511
|
});
|
|
@@ -9105,7 +9442,7 @@ class CornerstoneViewportService extends src/* PubSubService */.Rc {
|
|
|
9105
9442
|
viewPlaneNormal,
|
|
9106
9443
|
viewUp
|
|
9107
9444
|
} = csViewport.getCamera();
|
|
9108
|
-
const initialImageIndex = csViewport.getCurrentImageIdIndex();
|
|
9445
|
+
const initialImageIndex = csViewport.getCurrentImageIdIndex() || 0;
|
|
9109
9446
|
const zoom = csViewport.getZoom();
|
|
9110
9447
|
const pan = csViewport.getPan();
|
|
9111
9448
|
return {
|
|
@@ -9208,7 +9545,7 @@ class CornerstoneViewportService extends src/* PubSubService */.Rc {
|
|
|
9208
9545
|
stateSyncService,
|
|
9209
9546
|
syncGroupService
|
|
9210
9547
|
} = this.servicesManager.services;
|
|
9211
|
-
const synchronizers = syncGroupService.getSynchronizersForViewport(viewportId
|
|
9548
|
+
const synchronizers = syncGroupService.getSynchronizersForViewport(viewportId);
|
|
9212
9549
|
const {
|
|
9213
9550
|
positionPresentationStore,
|
|
9214
9551
|
synchronizersStore,
|
|
@@ -10034,6 +10371,7 @@ function src_extends() { src_extends = Object.assign ? Object.assign.bind() : fu
|
|
|
10034
10371
|
|
|
10035
10372
|
|
|
10036
10373
|
|
|
10374
|
+
|
|
10037
10375
|
|
|
10038
10376
|
|
|
10039
10377
|
const Component = /*#__PURE__*/react.lazy(() => {
|
|
@@ -10078,6 +10416,7 @@ const cornerstoneExtension = {
|
|
|
10078
10416
|
servicesManager.registerService(services_CornerstoneCacheService.REGISTRATION);
|
|
10079
10417
|
return init.call(this, props);
|
|
10080
10418
|
},
|
|
10419
|
+
getToolbarModule: getToolbarModule,
|
|
10081
10420
|
getHangingProtocolModule: src_getHangingProtocolModule,
|
|
10082
10421
|
getViewportModule({
|
|
10083
10422
|
servicesManager,
|