Demonstrate tool configuration via App redux settings (using Freehand tool) (ohif-cornerstone-extension: 0.0.8, ohif-viewer 0.0.10)

This commit is contained in:
Erik Ziegler 2019-02-10 22:28:42 +01:00
parent e235980040
commit b413527371
7 changed files with 40 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ohif-cornerstone-extension",
"version": "0.0.7",
"version": "0.0.8",
"description": "OHIF extension for Cornerstone",
"author": "OHIF",
"license": "MIT",

View File

@ -8,6 +8,11 @@ const { setViewportActive, setViewportSpecificData, clearViewportSpecificData }
const mapStateToProps = (state, ownProps) => {
const activeButton = state.tools.buttons.find(tool => tool.active === true);
let availableTools;
if (state.extensions && state.extensions.cornerstone && state.extensions.availableTools) {
availableTools = state.extensions.availableTools;
};
// If this is the active viewport, enable prefetching.
const { viewportIndex } = ownProps;//.viewportData;
@ -18,6 +23,7 @@ const mapStateToProps = (state, ownProps) => {
layout: state.viewports.layout,
isActive,
activeTool: activeButton && activeButton.command,
availableTools,
enableStackPrefetch: isActive,
//stack: viewportSpecificData.stack,
cineToolData: viewportSpecificData.cine,

@ -1 +1 @@
Subproject commit 847511a526739d20b9178878989ae8593800e031
Subproject commit b77ff9c585fac5c75abe674d9460c8552af40127

View File

@ -1,6 +1,6 @@
{
"name": "ohif-viewer",
"version": "0.0.9",
"version": "0.0.10",
"description": "OHIF Viewer",
"author": "OHIF Contributors",
"license": "MIT",
@ -103,8 +103,8 @@
"dicomweb-client": "^0.4.2",
"hammerjs": "^2.0.8",
"lodash.isequal": "^4.5.0",
"ohif-core": "^0.2.7",
"ohif-cornerstone-extension": "^0.0.7",
"ohif-core": "^0.2.8",
"ohif-cornerstone-extension": "^0.0.8",
"ohif-dicom-html-extension": "^0.0.2",
"ohif-dicom-microscopy-extension": "^0.0.5",
"ohif-dicom-pdf-extension": "^0.0.5",

View File

@ -103,6 +103,13 @@ const defaultButtons = [
iconClasses: 'fa fa-circle',
active: false
},
{
command: 'FreehandMouse',
type: 'tool',
text: 'Freehand',
iconClasses: 'fa fa-star',
active: false
},
{
command: 'reset',
type: 'command',
@ -116,6 +123,26 @@ const buttonsAction = OHIF.redux.actions.setAvailableButtons(defaultButtons);
store.dispatch(buttonsAction);
const availableTools = [
{ name: 'Pan', mouseButtonMasks: [1, 4] },
{ name: 'Zoom', mouseButtonMasks: [1, 2] },
{ name: 'Wwwc', mouseButtonMasks: [1] },
{ name: 'Bidirectional', mouseButtonMasks: [1] },
{ name: 'Length', mouseButtonMasks: [1] },
{ name: 'Angle', mouseButtonMasks: [1] },
{ name: 'StackScroll', mouseButtonMasks: [1] },
{ name: 'Brush', mouseButtonMasks: [1] },
{ name: 'FreehandMouse', mouseButtonMasks: [1] },
{ name: 'PanMultiTouch' },
{ name: 'ZoomTouchPinch' },
{ name: 'StackScrollMouseWheel' },
{ name: 'StackScrollMultiTouch' }
];
const toolAction = OHIF.redux.actions.setExtensionData('cornerstone', { availableTools });
store.dispatch(toolAction);
/** TODO: extensions should be passed in as prop as soon as we have the extensions as separate packages and then registered by ExtensionsManager */
const extensions = [
new OHIFCornerstoneExtension(),

View File

@ -1 +1 @@
export default '2868b08a4aa5f31d63e945c150e1e412f032c633';
export default 'e2359800402212ac6ab18e8a0cfed34b238516d7';

View File

@ -1 +1 @@
export default '0.0.8';
export default '0.0.9';