fix: left right hotkeys and remove non working ones (#2922)

* fix: constant should be enums in cs3d

* remove non working hotkeys for now
This commit is contained in:
Alireza authored and GitHub committed 2022-09-08 22:02:20 -04:00
1 parent aec48b065c
commit 71f5fa8e2f
21 files changed
+168 -170

No files matched your search

+2 -2
View File
@@ -43,9 +43,9 @@
},
"dependencies": {
"@babel/runtime": "7.17.9",
"@cornerstonejs/core": "^0.15.3",
"@cornerstonejs/core": "^0.16.1",
"@cornerstonejs/streaming-image-volume-loader": "^0.4.23",
"@cornerstonejs/tools": "^0.23.3",
"@cornerstonejs/tools": "^0.24.1",
"@kitware/vtk.js": "^24.18.7",
"dom-to-image": "^2.6.0",
"lodash.debounce": "4.0.8",
@@ -404,6 +404,17 @@ const commandsModule = ({ servicesManager }) => {
viewport.render();
}
},
incrementActiveViewport: () => {
const { activeViewportIndex, viewports } = ViewportGridService.getState();
const nextViewportIndex = (activeViewportIndex + 1) % viewports.length;
ViewportGridService.setActiveViewportIndex(nextViewportIndex);
},
decrementActiveViewport: () => {
const { activeViewportIndex, viewports } = ViewportGridService.getState();
const nextViewportIndex =
(activeViewportIndex - 1 + viewports.length) % viewports.length;
ViewportGridService.setActiveViewportIndex(nextViewportIndex);
},
};
const definitions = {
@@ -432,6 +443,14 @@ const commandsModule = ({ servicesManager }) => {
storeContexts: [],
options: { rotation: -90 },
},
incrementActiveViewport: {
commandFn: actions.incrementActiveViewport,
storeContexts: [],
},
decrementActiveViewport: {
commandFn: actions.decrementActiveViewport,
storeContexts: [],
},
flipViewportHorizontal: {
commandFn: actions.flipViewportHorizontal,
storeContexts: [],
-2
View File
@@ -3,7 +3,6 @@ import * as cornerstone from '@cornerstonejs/core';
import * as cornerstoneTools from '@cornerstonejs/tools';
import {
Enums as cs3DEnums,
CONSTANTS,
imageLoadPoolManager,
imageRetrievalPoolManager,
} from '@cornerstonejs/core';
@@ -119,7 +118,6 @@ const cornerstoneExtension = {
name: 'core',
exports: {
Enums: cs3DEnums,
CONSTANTS,
},
},
{
@@ -1,4 +1,4 @@
import { Types, Enums, CONSTANTS } from '@cornerstonejs/core';
import { Types, Enums } from '@cornerstonejs/core';
import getCornerstoneBlendMode from '../../utils/getCornerstoneBlendMode';
import getCornerstoneOrientation from '../../utils/getCornerstoneOrientation';
import getCornerstoneViewportType from '../../utils/getCornerstoneViewportType';
@@ -137,7 +137,7 @@ class ViewportInfo {
if (viewportOptionsEntry.viewportType?.toLowerCase() === VOLUME) {
orientation = getCornerstoneOrientation(viewportOptionsEntry.orientation);
} else {
orientation = CONSTANTS.ORIENTATION.AXIAL;
orientation = Enums.OrientationAxis.AXIAL;
}
if (!toolGroupId) {
@@ -1,4 +1,4 @@
import { CONSTANTS } from '@cornerstonejs/core';
import { Enums } from '@cornerstonejs/core';
import { log } from '@ohif/core';
const AXIAL = 'axial';
@@ -7,16 +7,16 @@ const CORONAL = 'coronal';
export default function getCornerstoneOrientation(
orientation: string
): CONSTANTS.ORIENTATION {
): Enums.OrientationAxis {
switch (orientation.toLowerCase()) {
case AXIAL:
return CONSTANTS.ORIENTATION.AXIAL;
return Enums.OrientationAxis.AXIAL;
case SAGITTAL:
return CONSTANTS.ORIENTATION.SAGITTAL;
return Enums.OrientationAxis.SAGITTAL;
case CORONAL:
return CONSTANTS.ORIENTATION.CORONAL;
return Enums.OrientationAxis.CORONAL;
default:
log.wanr('Choosing default orientation: axial');
return CONSTANTS.ORIENTATION.AXIAL;
log.wanr('Choosing acquisition plane orientation');
return Enums.OrientationAxis.ACQUISITION;
}
}