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:
parent
aec48b065c
commit
71f5fa8e2f
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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: [],
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -76,18 +76,18 @@ const bindings = [
|
||||
keys: ['left'],
|
||||
isEditable: true,
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
isEditable: true,
|
||||
},
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
isEditable: true,
|
||||
},
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// isEditable: true,
|
||||
// },
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// isEditable: true,
|
||||
// },
|
||||
{
|
||||
commandName: 'nextImage',
|
||||
label: 'Next Image',
|
||||
|
||||
@ -29,7 +29,6 @@ getUtilityModule({ servicesManager }) {
|
||||
name: 'core',
|
||||
exports: {
|
||||
Enums: cs3DEnums,
|
||||
CONSTANTS,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@ -98,16 +98,16 @@ window.config = {
|
||||
{ commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
|
||||
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
|
||||
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
},
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// },
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// },
|
||||
{ commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] },
|
||||
// ~ Window level presets
|
||||
{
|
||||
|
||||
@ -102,17 +102,22 @@ window.config = {
|
||||
{ commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
|
||||
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
|
||||
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// },
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// },
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Zoom' },
|
||||
label: 'Zoom',
|
||||
keys: ['z'],
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
},
|
||||
{ commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] },
|
||||
// ~ Window level presets
|
||||
{
|
||||
commandName: 'windowLevelPreset1',
|
||||
|
||||
@ -46,16 +46,16 @@ window.config = {
|
||||
{ commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
|
||||
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
|
||||
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
},
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// },
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// },
|
||||
{ commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] },
|
||||
// ~ Window level presets
|
||||
{
|
||||
|
||||
@ -99,16 +99,16 @@ window.config = {
|
||||
{ commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
|
||||
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
|
||||
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
},
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// },
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// },
|
||||
{ commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] },
|
||||
// ~ Window level presets
|
||||
{
|
||||
|
||||
@ -117,16 +117,16 @@ window.config = {
|
||||
{ commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
|
||||
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
|
||||
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
},
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// },
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// },
|
||||
{ commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] },
|
||||
// ~ Window level presets
|
||||
{
|
||||
|
||||
@ -99,16 +99,16 @@ window.config = {
|
||||
{ commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
|
||||
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
|
||||
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
},
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// },
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// },
|
||||
{ commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] },
|
||||
// ~ Window level presets
|
||||
{
|
||||
|
||||
@ -96,16 +96,16 @@ window.config = {
|
||||
{ commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
|
||||
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
|
||||
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
},
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// },
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// },
|
||||
{ commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] },
|
||||
// ~ Window level presets
|
||||
{
|
||||
|
||||
@ -50,16 +50,16 @@ window.config = {
|
||||
{ commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
|
||||
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
|
||||
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
|
||||
{
|
||||
commandName: 'previousViewportDisplaySet',
|
||||
label: 'Previous Series',
|
||||
keys: ['pagedown'],
|
||||
},
|
||||
{
|
||||
commandName: 'nextViewportDisplaySet',
|
||||
label: 'Next Series',
|
||||
keys: ['pageup'],
|
||||
},
|
||||
// {
|
||||
// commandName: 'previousViewportDisplaySet',
|
||||
// label: 'Previous Series',
|
||||
// keys: ['pagedown'],
|
||||
// },
|
||||
// {
|
||||
// commandName: 'nextViewportDisplaySet',
|
||||
// label: 'Next Series',
|
||||
// keys: ['pageup'],
|
||||
// },
|
||||
{ commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] },
|
||||
// ~ Window level presets
|
||||
{
|
||||
|
||||
18
yarn.lock
18
yarn.lock
@ -2306,6 +2306,14 @@
|
||||
detect-gpu "^4.0.7"
|
||||
lodash.clonedeep "4.5.0"
|
||||
|
||||
"@cornerstonejs/core@^0.16.1":
|
||||
version "0.16.1"
|
||||
resolved "https://registry.npmjs.org/@cornerstonejs/core/-/core-0.16.1.tgz#796016bae79950bd76cfb8aaf57bc7c3d131059c"
|
||||
integrity sha512-cWu/NswDKcbdnheiJ8w0BhUL9960z9uL9MVV378f1/k3oh2lW3IIwSlUPk2oQfh9qDVH6MY89KjbKDvooDwvag==
|
||||
dependencies:
|
||||
detect-gpu "^4.0.7"
|
||||
lodash.clonedeep "4.5.0"
|
||||
|
||||
"@cornerstonejs/streaming-image-volume-loader@^0.4.23":
|
||||
version "0.4.23"
|
||||
resolved "https://registry.npmjs.org/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-0.4.23.tgz#77d8d0de03ea7343ff73af7b98ec2035212c1215"
|
||||
@ -2314,12 +2322,12 @@
|
||||
"@cornerstonejs/core" "^0.15.3"
|
||||
cornerstone-wado-image-loader "^4.2.1"
|
||||
|
||||
"@cornerstonejs/tools@^0.23.3":
|
||||
version "0.23.3"
|
||||
resolved "https://registry.npmjs.org/@cornerstonejs/tools/-/tools-0.23.3.tgz#4fde6b4218605eec4ba21ffe4ec25a75f48f1da1"
|
||||
integrity sha512-j2nbwVQDihSBsbDhSa0tSmqFoqhNbx9w4TX2szXW6toqT2jgshwZQ4c3/UCWr5wBRBhKDe/gVRlU9IfjJSt89A==
|
||||
"@cornerstonejs/tools@^0.24.1":
|
||||
version "0.24.1"
|
||||
resolved "https://registry.npmjs.org/@cornerstonejs/tools/-/tools-0.24.1.tgz#d6c38af6167b515b3545b7dc2db43b34f6e43d30"
|
||||
integrity sha512-X98m1MZahte1m+hd/J8oSUH5zxj+hv/7Stav3AHOUfyMPTm9tcl32bH87WpLK7cm9bLRzMNp23/6U1biEH2+Gg==
|
||||
dependencies:
|
||||
"@cornerstonejs/core" "^0.15.3"
|
||||
"@cornerstonejs/core" "^0.16.1"
|
||||
lodash.clonedeep "4.5.0"
|
||||
lodash.get "^4.4.2"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user