Compare commits

...
Author SHA1 Message Date
ohif-bot 4fd0c6dfcb chore(release): publish [skip ci]
- @ohif/extension-cornerstone@2.3.1
 - @ohif/viewer@3.6.3
2020-02-14 20:56:06 +00:00
Gustavo André Lelis 06a4af06fa fix: Creating 2 commands to activate zoom tool and also to move between displaySets (#1446) 2020-02-14 15:54:08 -05:00
9 changed files with 86 additions and 40 deletions

No files matched your search

+11
View File
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.3.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.3.0...@ohif/extension-cornerstone@2.3.1) (2020-02-14)
### Bug Fixes
* Creating 2 commands to activate zoom tool and also to move between displaySets ([#1446](https://github.com/OHIF/Viewers/issues/1446)) ([06a4af0](https://github.com/OHIF/Viewers/commit/06a4af06faaecf6fa06ccd90cdfa879ee8d53053))
# [2.3.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.2.2...@ohif/extension-cornerstone@2.3.0) (2020-02-10)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone",
"version": "2.3.0",
"version": "2.3.1",
"description": "OHIF extension for Cornerstone",
"author": "OHIF",
"license": "MIT",
+6 -17
View File
@@ -74,10 +74,6 @@ const commandsModule = ({ servicesManager }) => {
}
cornerstoneTools.setToolActive(toolName, { mouseButtonMask: 1 });
},
updateViewportDisplaySet: ({ direction }) => {
// TODO
console.warn('updateDisplaySet: ', direction);
},
clearAnnotations: ({ viewports }) => {
const element = getEnabledElement(viewports.activeViewportIndex);
if (!element) {
@@ -245,7 +241,7 @@ const commandsModule = ({ servicesManager }) => {
},
setCornerstoneLayout: () => {
setCornerstoneLayout();
}
},
};
const definitions = {
@@ -334,24 +330,17 @@ const commandsModule = ({ servicesManager }) => {
storeContexts: ['viewports'],
options: {},
},
// TODO: First/Last image
// Next/Previous series/DisplaySet
nextViewportDisplaySet: {
commandFn: actions.updateViewportDisplaySet,
storeContexts: [],
options: { direction: 1 },
},
previousViewportDisplaySet: {
commandFn: actions.updateViewportDisplaySet,
storeContexts: [],
options: { direction: -1 },
},
// TOOLS
setToolActive: {
commandFn: actions.setToolActive,
storeContexts: [],
options: {},
},
setZoomTool: {
commandFn: actions.setToolActive,
storeContexts: [],
options: { toolName: 'Zoom' },
},
setCornerstoneLayout: {
commandFn: actions.setCornerstoneLayout,
storeContexts: [],
+11
View File
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.6.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@3.6.2...@ohif/viewer@3.6.3) (2020-02-14)
### Bug Fixes
* Creating 2 commands to activate zoom tool and also to move between displaySets ([#1446](https://github.com/OHIF/Viewers/issues/1446)) ([06a4af0](https://github.com/OHIF/Viewers/commit/06a4af06faaecf6fa06ccd90cdfa879ee8d53053))
## [3.6.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@3.6.1...@ohif/viewer@3.6.2) (2020-02-12)
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/viewer",
"version": "3.6.2",
"version": "3.6.3",
"description": "OHIF Viewer",
"author": "OHIF Contributors",
"license": "MIT",
@@ -48,7 +48,7 @@
"dependencies": {
"@babel/runtime": "^7.5.5",
"@ohif/core": "^2.4.1",
"@ohif/extension-cornerstone": "^2.3.0",
"@ohif/extension-cornerstone": "^2.3.1",
"@ohif/extension-dicom-html": "^1.1.0",
"@ohif/extension-dicom-microscopy": "^0.50.6",
"@ohif/extension-dicom-pdf": "^1.0.1",
+2 -2
View File
@@ -58,12 +58,12 @@ window.config = {
// firstImage
// lastImage
{
commandName: 'nextViewportDisplaySet',
commandName: 'previousViewportDisplaySet',
label: 'Previous Series',
keys: ['pagedown'],
},
{
commandName: 'previousViewportDisplaySet',
commandName: 'nextViewportDisplaySet',
label: 'Next Series',
keys: ['pageup'],
},
+2 -2
View File
@@ -48,12 +48,12 @@ window.config = {
{ commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
{ commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
{
commandName: 'nextViewportDisplaySet',
commandName: 'previousViewportDisplaySet',
label: 'Previous Series',
keys: ['pagedown'],
},
{
commandName: 'previousViewportDisplaySet',
commandName: 'nextViewportDisplaySet',
label: 'Next Series',
keys: ['pageup'],
},
+2 -2
View File
@@ -53,12 +53,12 @@ window.config = {
// firstImage
// lastImage
{
commandName: 'nextViewportDisplaySet',
commandName: 'previousViewportDisplaySet',
label: 'Previous Series',
keys: ['pagedown'],
},
{
commandName: 'previousViewportDisplaySet',
commandName: 'nextViewportDisplaySet',
label: 'Next Series',
keys: ['pageup'],
},
@@ -1,12 +1,8 @@
import { redux } from "@ohif/core";
import store from "./../../store";
const { setViewportActive } = redux.actions;
import { redux, utils } from '@ohif/core';
import store from './../../store';
const { setViewportActive, setActiveViewportSpecificData } = redux.actions;
const actions = {
updateViewportDisplaySet: ({ direction }) => {
// TODO
// console.warn('updateDisplaySet: ', direction);
},
updateActiveViewport: ({ viewports, direction }) => {
const { viewportSpecificData, activeViewportIndex } = viewports;
const maxIndex = Object.keys(viewportSpecificData).length - 1;
@@ -16,24 +12,63 @@ const actions = {
newIndex = newIndex < 0 ? maxIndex : newIndex;
store.dispatch(setViewportActive(newIndex));
}
},
updateViewportDisplaySet: ({ viewports, direction }) => {
const viewportSpecificData = { ...viewports.viewportSpecificData };
const activeViewport = viewportSpecificData[viewports.activeViewportIndex];
const studyMetadata = utils.studyMetadataManager.get(
activeViewport.studyInstanceUid
);
if (!studyMetadata) {
return;
}
const allDisplaySets = studyMetadata.getDisplaySets();
const currentDisplaySetIndex = allDisplaySets.findIndex(
displaySet =>
displaySet.displaySetInstanceUid ===
activeViewport.displaySetInstanceUid
);
if (currentDisplaySetIndex < 0) {
return;
}
const newDisplaySetIndex = currentDisplaySetIndex + direction;
const newDisplaySetData = allDisplaySets[newDisplaySetIndex];
if (!newDisplaySetData) {
return;
}
store.dispatch(setActiveViewportSpecificData(newDisplaySetData));
},
};
const definitions = {
// Next/Previous active viewport
incrementActiveViewport: {
commandFn: actions.updateActiveViewport,
storeContexts: ["viewports"],
options: { direction: 1 }
storeContexts: ['viewports'],
options: { direction: 1 },
},
decrementActiveViewport: {
commandFn: actions.updateActiveViewport,
storeContexts: ["viewports"],
options: { direction: -1 }
}
storeContexts: ['viewports'],
options: { direction: -1 },
},
nextViewportDisplaySet: {
commandFn: actions.updateViewportDisplaySet,
storeContexts: ['viewports'],
options: { direction: 1 },
},
previousViewportDisplaySet: {
commandFn: actions.updateViewportDisplaySet,
storeContexts: ['viewports'],
options: { direction: -1 },
},
};
export default {
definitions,
defaultContext: "VIEWER"
defaultContext: 'VIEWER',
};