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
@@ -45,7 +45,7 @@
"dependencies": {
"@babel/runtime": "7.16.3",
"classnames": "^2.2.6",
"@cornerstonejs/core": "^0.15.3",
"@cornerstonejs/tools": "^0.23.3"
"@cornerstonejs/core": "^0.16.1",
"@cornerstonejs/tools": "^0.24.1"
}
}
+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;
}
}
+12 -12
View File
@@ -45,18 +45,18 @@ const dicomPDFExtension = {
{ name: 'dicom-pdf', component: ExtendedOHIFCornerstonePdfViewport },
];
},
getCommandsModule({ servicesManager }) {
return {
definitions: {
setToolActive: {
commandFn: () => null,
storeContexts: [],
options: {},
},
},
defaultContext: 'ACTIVE_VIEWPORT::PDF',
};
},
// getCommandsModule({ servicesManager }) {
// return {
// definitions: {
// setToolActive: {
// commandFn: () => null,
// storeContexts: [],
// options: {},
// },
// },
// defaultContext: 'ACTIVE_VIEWPORT::PDF',
// };
// },
getSopClassHandlerModule,
};
+13 -23
View File
@@ -46,29 +46,19 @@ const dicomVideoExtension = {
{ name: 'dicom-video', component: ExtendedOHIFCornerstoneVideoViewport },
];
},
getCommandsModule({ servicesManager }) {
return {
definitions: {
setToolActive: {
commandFn: ({ toolName, element }) => {
if (!toolName) {
console.warn('No toolname provided to setToolActive command');
}
// Set same tool or alt tool
const toolAlias = _getToolAlias(toolName);
cornerstoneTools.setToolActiveForElement(element, toolAlias, {
mouseButtonMask: 1,
});
},
storeContexts: [],
options: {},
},
},
defaultContext: 'ACTIVE_VIEWPORT::VIDEO',
};
},
// getCommandsModule({ servicesManager }) {
// return {
// definitions: {
// setToolActive: {
// commandFn: ({ toolName, element }) => {
// },
// storeContexts: [],
// options: {},
// },
// },
// defaultContext: 'ACTIVE_VIEWPORT::VIDEO',
// };
// },
getSopClassHandlerModule,
};
+2 -2
View File
@@ -32,8 +32,8 @@
"peerDependencies": {
"@ohif/core": "^3.0.0",
"classnames": "^2.2.6",
"@cornerstonejs/core": "^0.15.3",
"@cornerstonejs/tools": "^0.23.3",
"@cornerstonejs/core": "^0.16.1",
"@cornerstonejs/tools": "^0.24.1",
"@ohif/extension-cornerstone-dicom-sr": "^3.0.0",
"dcmjs": "^0.24.5",
"prop-types": "^15.6.2",
@@ -12,27 +12,6 @@ const measurementTrackingExtension = {
getContextModule,
getPanelModule,
getViewportModule,
getCommandsModule({ servicesManager }) {
return {
definitions: {
setToolActive: {
commandFn: ({ toolName, element }) => {
if (!toolName) {
console.warn('No toolname provided to setToolActive command');
}
// Set same tool or alt tool
cornerstoneTools.setToolActiveForElement(element, toolName, {
mouseButtonMask: 1,
});
},
storeContexts: [],
options: {},
},
},
defaultContext: 'ACTIVE_VIEWPORT::TRACKED',
};
},
};
export default measurementTrackingExtension;