Formatting
This commit is contained in:
parent
2326aa8ba1
commit
a5b0e15369
@ -28,7 +28,7 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
enableStackPrefetch: isActive,
|
enableStackPrefetch: isActive,
|
||||||
//stack: viewportSpecificData.stack,
|
//stack: viewportSpecificData.stack,
|
||||||
cineToolData: viewportSpecificData.cine,
|
cineToolData: viewportSpecificData.cine,
|
||||||
viewport: viewportSpecificData.viewport
|
viewport: viewportSpecificData.viewport,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ const mapDispatchToProps = (dispatch, ownProps) => {
|
|||||||
setViewportSpecificData(viewportIndex, {
|
setViewportSpecificData(viewportIndex, {
|
||||||
// TODO: Hack to make sure our plugin info is available from the outset
|
// TODO: Hack to make sure our plugin info is available from the outset
|
||||||
plugin: 'cornerstone',
|
plugin: 'cornerstone',
|
||||||
dom: enabledElement
|
dom: enabledElement,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -65,18 +65,18 @@ const mapDispatchToProps = (dispatch, ownProps) => {
|
|||||||
const {
|
const {
|
||||||
onAdded,
|
onAdded,
|
||||||
onRemoved,
|
onRemoved,
|
||||||
onModified
|
onModified,
|
||||||
} = OHIF.measurements.MeasurementHandlers;
|
} = OHIF.measurements.MeasurementHandlers;
|
||||||
const actions = {
|
const actions = {
|
||||||
added: onAdded,
|
added: onAdded,
|
||||||
removed: onRemoved,
|
removed: onRemoved,
|
||||||
modified: throttle(event => {
|
modified: throttle(event => {
|
||||||
return onModified(event);
|
return onModified(event);
|
||||||
}, 300)
|
}, 300),
|
||||||
};
|
};
|
||||||
|
|
||||||
return actions[action](event);
|
return actions[action](event);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -98,56 +98,54 @@ const actions = {
|
|||||||
// if (!cornerstoneImageId || cornerstoneImageId === imageId)
|
// if (!cornerstoneImageId || cornerstoneImageId === imageId)
|
||||||
// delete toolState[imageId];
|
// delete toolState[imageId];
|
||||||
// });
|
// });
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const definitions = {
|
const definitions = {
|
||||||
rotateViewportCW: {
|
rotateViewportCW: {
|
||||||
commandFn: actions.rotateViewport,
|
commandFn: actions.rotateViewport,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: { rotation: 90 }
|
options: { rotation: 90 },
|
||||||
},
|
},
|
||||||
rotateViewportCCW: {
|
rotateViewportCCW: {
|
||||||
commandFn: actions.rotateViewport,
|
commandFn: actions.rotateViewport,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: { rotation: -90 }
|
options: { rotation: -90 },
|
||||||
},
|
},
|
||||||
invertViewport: {
|
invertViewport: {
|
||||||
commandFn: actions.invertViewport,
|
commandFn: actions.invertViewport,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: {}
|
options: {},
|
||||||
},
|
},
|
||||||
flipViewportVertical: {
|
flipViewportVertical: {
|
||||||
commandFn: actions.flipViewportVertical,
|
commandFn: actions.flipViewportVertical,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: {}
|
options: {},
|
||||||
},
|
},
|
||||||
flipViewportHorizontal: {
|
flipViewportHorizontal: {
|
||||||
commandFn: actions.flipViewportHorizontal,
|
commandFn: actions.flipViewportHorizontal,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: {}
|
options: {},
|
||||||
},
|
},
|
||||||
scaleUpViewport: {
|
scaleUpViewport: {
|
||||||
keys: '',
|
|
||||||
commandFn: actions.scaleViewport,
|
commandFn: actions.scaleViewport,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: { direction: 1 }
|
options: { direction: 1 },
|
||||||
},
|
},
|
||||||
scaleDownViewport: {
|
scaleDownViewport: {
|
||||||
keys: '',
|
|
||||||
commandFn: actions.scaleViewport,
|
commandFn: actions.scaleViewport,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: { direction: -1 }
|
options: { direction: -1 },
|
||||||
},
|
},
|
||||||
fitViewportToWindow: {
|
fitViewportToWindow: {
|
||||||
commandFn: actions.scaleViewport,
|
commandFn: actions.scaleViewport,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: { direction: 0 }
|
options: { direction: 0 },
|
||||||
},
|
},
|
||||||
resetViewport: {
|
resetViewport: {
|
||||||
commandFn: actions.resetViewport,
|
commandFn: actions.resetViewport,
|
||||||
storeContexts: ['viewports'],
|
storeContexts: ['viewports'],
|
||||||
options: {}
|
options: {},
|
||||||
},
|
},
|
||||||
// TODO: Clear Annotations
|
// TODO: Clear Annotations
|
||||||
// TODO: Next/Previous image
|
// TODO: Next/Previous image
|
||||||
@ -156,19 +154,19 @@ const definitions = {
|
|||||||
nextViewportDisplaySet: {
|
nextViewportDisplaySet: {
|
||||||
commandFn: actions.updateViewportDisplaySet,
|
commandFn: actions.updateViewportDisplaySet,
|
||||||
storeContexts: [],
|
storeContexts: [],
|
||||||
options: { direction: 1 }
|
options: { direction: 1 },
|
||||||
},
|
},
|
||||||
previousViewportDisplaySet: {
|
previousViewportDisplaySet: {
|
||||||
commandFn: actions.updateViewportDisplaySet,
|
commandFn: actions.updateViewportDisplaySet,
|
||||||
storeContexts: [],
|
storeContexts: [],
|
||||||
options: { direction: -1 }
|
options: { direction: -1 },
|
||||||
},
|
},
|
||||||
// TOOLS
|
// TOOLS
|
||||||
setToolActive: {
|
setToolActive: {
|
||||||
commandFn: actions.setToolActive,
|
commandFn: actions.setToolActive,
|
||||||
storeContexts: [],
|
storeContexts: [],
|
||||||
options: {}
|
options: {},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -183,5 +181,5 @@ function _getActiveViewportEnabledElement(viewports, activeIndex) {
|
|||||||
export default {
|
export default {
|
||||||
actions,
|
actions,
|
||||||
definitions,
|
definitions,
|
||||||
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE'
|
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE',
|
||||||
};
|
};
|
||||||
|
|||||||
@ -56,7 +56,7 @@ function retrieveDicomData(wadoUri) {
|
|||||||
// TODO: Authorization header depends on the server. If we ever have multiple servers
|
// TODO: Authorization header depends on the server. If we ever have multiple servers
|
||||||
// we will need to figure out how / when to pass this information in.
|
// we will need to figure out how / when to pass this information in.
|
||||||
return fetch(wadoUri, {
|
return fetch(wadoUri, {
|
||||||
headers: OHIF.DICOMWeb.getAuthorizationHeader()
|
headers: OHIF.DICOMWeb.getAuthorizationHeader(),
|
||||||
}).then(response => response.arrayBuffer());
|
}).then(response => response.arrayBuffer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ async function handleSegmentationStorage(
|
|||||||
return {
|
return {
|
||||||
studyInstanceUid,
|
studyInstanceUid,
|
||||||
displaySetInstanceUid,
|
displaySetInstanceUid,
|
||||||
stack
|
stack,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,5 +19,5 @@ export default {
|
|||||||
},
|
},
|
||||||
getCommandsModule() {
|
getCommandsModule() {
|
||||||
return commandsModule;
|
return commandsModule;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
const TOOLBAR_BUTTON_TYPES = {
|
const TOOLBAR_BUTTON_TYPES = {
|
||||||
COMMAND: 'command',
|
COMMAND: 'command',
|
||||||
SET_TOOL_ACTIVE: 'setToolActive',
|
SET_TOOL_ACTIVE: 'setToolActive',
|
||||||
BUILT_IN: 'builtIn'
|
BUILT_IN: 'builtIn',
|
||||||
};
|
};
|
||||||
|
|
||||||
const definitions = [
|
const definitions = [
|
||||||
@ -33,7 +33,7 @@ const definitions = [
|
|||||||
//
|
//
|
||||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||||
commandName: 'setToolActive',
|
commandName: 'setToolActive',
|
||||||
commandOptions: { toolName: 'StackScroll' }
|
commandOptions: { toolName: 'StackScroll' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'Zoom',
|
id: 'Zoom',
|
||||||
@ -42,7 +42,7 @@ const definitions = [
|
|||||||
//
|
//
|
||||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||||
commandName: 'setToolActive',
|
commandName: 'setToolActive',
|
||||||
commandOptions: { toolName: 'Zoom' }
|
commandOptions: { toolName: 'Zoom' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'Wwwc',
|
id: 'Wwwc',
|
||||||
@ -51,7 +51,7 @@ const definitions = [
|
|||||||
//
|
//
|
||||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||||
commandName: 'setToolActive',
|
commandName: 'setToolActive',
|
||||||
commandOptions: { toolName: 'Wwwc' }
|
commandOptions: { toolName: 'Wwwc' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'Pan',
|
id: 'Pan',
|
||||||
@ -60,7 +60,7 @@ const definitions = [
|
|||||||
//
|
//
|
||||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||||
commandName: 'setToolActive',
|
commandName: 'setToolActive',
|
||||||
commandOptions: { toolName: 'Pan' }
|
commandOptions: { toolName: 'Pan' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'Length',
|
id: 'Length',
|
||||||
@ -69,7 +69,7 @@ const definitions = [
|
|||||||
//
|
//
|
||||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||||
commandName: 'setToolActive',
|
commandName: 'setToolActive',
|
||||||
commandOptions: { toolName: 'Length' }
|
commandOptions: { toolName: 'Length' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'Angle',
|
id: 'Angle',
|
||||||
@ -78,7 +78,7 @@ const definitions = [
|
|||||||
//
|
//
|
||||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||||
commandName: 'setToolActive',
|
commandName: 'setToolActive',
|
||||||
commandOptions: { toolName: 'Angle' }
|
commandOptions: { toolName: 'Angle' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'Reset',
|
id: 'Reset',
|
||||||
@ -86,7 +86,7 @@ const definitions = [
|
|||||||
icon: 'reset',
|
icon: 'reset',
|
||||||
//
|
//
|
||||||
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
||||||
commandName: 'resetViewport'
|
commandName: 'resetViewport',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'Cine',
|
id: 'Cine',
|
||||||
@ -95,12 +95,12 @@ const definitions = [
|
|||||||
//
|
//
|
||||||
type: TOOLBAR_BUTTON_TYPES.BUILT_IN,
|
type: TOOLBAR_BUTTON_TYPES.BUILT_IN,
|
||||||
options: {
|
options: {
|
||||||
behavior: 'CINE'
|
behavior: 'CINE',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
definitions,
|
definitions,
|
||||||
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE'
|
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE',
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user