Formatting

This commit is contained in:
dannyrb 2019-06-20 22:57:14 -04:00
parent 2326aa8ba1
commit a5b0e15369
5 changed files with 35 additions and 37 deletions

View File

@ -28,7 +28,7 @@ const mapStateToProps = (state, ownProps) => {
enableStackPrefetch: isActive,
//stack: viewportSpecificData.stack,
cineToolData: viewportSpecificData.cine,
viewport: viewportSpecificData.viewport
viewport: viewportSpecificData.viewport,
};
};
@ -56,7 +56,7 @@ const mapDispatchToProps = (dispatch, ownProps) => {
setViewportSpecificData(viewportIndex, {
// TODO: Hack to make sure our plugin info is available from the outset
plugin: 'cornerstone',
dom: enabledElement
dom: enabledElement,
})
);
},
@ -65,18 +65,18 @@ const mapDispatchToProps = (dispatch, ownProps) => {
const {
onAdded,
onRemoved,
onModified
onModified,
} = OHIF.measurements.MeasurementHandlers;
const actions = {
added: onAdded,
removed: onRemoved,
modified: throttle(event => {
return onModified(event);
}, 300)
}, 300),
};
return actions[action](event);
}
},
};
};

View File

@ -98,56 +98,54 @@ const actions = {
// if (!cornerstoneImageId || cornerstoneImageId === imageId)
// delete toolState[imageId];
// });
}
},
};
const definitions = {
rotateViewportCW: {
commandFn: actions.rotateViewport,
storeContexts: ['viewports'],
options: { rotation: 90 }
options: { rotation: 90 },
},
rotateViewportCCW: {
commandFn: actions.rotateViewport,
storeContexts: ['viewports'],
options: { rotation: -90 }
options: { rotation: -90 },
},
invertViewport: {
commandFn: actions.invertViewport,
storeContexts: ['viewports'],
options: {}
options: {},
},
flipViewportVertical: {
commandFn: actions.flipViewportVertical,
storeContexts: ['viewports'],
options: {}
options: {},
},
flipViewportHorizontal: {
commandFn: actions.flipViewportHorizontal,
storeContexts: ['viewports'],
options: {}
options: {},
},
scaleUpViewport: {
keys: '',
commandFn: actions.scaleViewport,
storeContexts: ['viewports'],
options: { direction: 1 }
options: { direction: 1 },
},
scaleDownViewport: {
keys: '',
commandFn: actions.scaleViewport,
storeContexts: ['viewports'],
options: { direction: -1 }
options: { direction: -1 },
},
fitViewportToWindow: {
commandFn: actions.scaleViewport,
storeContexts: ['viewports'],
options: { direction: 0 }
options: { direction: 0 },
},
resetViewport: {
commandFn: actions.resetViewport,
storeContexts: ['viewports'],
options: {}
options: {},
},
// TODO: Clear Annotations
// TODO: Next/Previous image
@ -156,19 +154,19 @@ const definitions = {
nextViewportDisplaySet: {
commandFn: actions.updateViewportDisplaySet,
storeContexts: [],
options: { direction: 1 }
options: { direction: 1 },
},
previousViewportDisplaySet: {
commandFn: actions.updateViewportDisplaySet,
storeContexts: [],
options: { direction: -1 }
options: { direction: -1 },
},
// TOOLS
setToolActive: {
commandFn: actions.setToolActive,
storeContexts: [],
options: {}
}
options: {},
},
};
/**
@ -183,5 +181,5 @@ function _getActiveViewportEnabledElement(viewports, activeIndex) {
export default {
actions,
definitions,
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE'
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE',
};

View File

@ -56,7 +56,7 @@ function retrieveDicomData(wadoUri) {
// 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.
return fetch(wadoUri, {
headers: OHIF.DICOMWeb.getAuthorizationHeader()
headers: OHIF.DICOMWeb.getAuthorizationHeader(),
}).then(response => response.arrayBuffer());
}
@ -123,7 +123,7 @@ async function handleSegmentationStorage(
return {
studyInstanceUid,
displaySetInstanceUid,
stack
stack,
};
}

View File

@ -19,5 +19,5 @@ export default {
},
getCommandsModule() {
return commandsModule;
}
},
};

View File

@ -22,7 +22,7 @@
const TOOLBAR_BUTTON_TYPES = {
COMMAND: 'command',
SET_TOOL_ACTIVE: 'setToolActive',
BUILT_IN: 'builtIn'
BUILT_IN: 'builtIn',
};
const definitions = [
@ -33,7 +33,7 @@ const definitions = [
//
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
commandName: 'setToolActive',
commandOptions: { toolName: 'StackScroll' }
commandOptions: { toolName: 'StackScroll' },
},
{
id: 'Zoom',
@ -42,7 +42,7 @@ const definitions = [
//
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
commandName: 'setToolActive',
commandOptions: { toolName: 'Zoom' }
commandOptions: { toolName: 'Zoom' },
},
{
id: 'Wwwc',
@ -51,7 +51,7 @@ const definitions = [
//
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
commandName: 'setToolActive',
commandOptions: { toolName: 'Wwwc' }
commandOptions: { toolName: 'Wwwc' },
},
{
id: 'Pan',
@ -60,7 +60,7 @@ const definitions = [
//
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
commandName: 'setToolActive',
commandOptions: { toolName: 'Pan' }
commandOptions: { toolName: 'Pan' },
},
{
id: 'Length',
@ -69,7 +69,7 @@ const definitions = [
//
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
commandName: 'setToolActive',
commandOptions: { toolName: 'Length' }
commandOptions: { toolName: 'Length' },
},
{
id: 'Angle',
@ -78,7 +78,7 @@ const definitions = [
//
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
commandName: 'setToolActive',
commandOptions: { toolName: 'Angle' }
commandOptions: { toolName: 'Angle' },
},
{
id: 'Reset',
@ -86,7 +86,7 @@ const definitions = [
icon: 'reset',
//
type: TOOLBAR_BUTTON_TYPES.COMMAND,
commandName: 'resetViewport'
commandName: 'resetViewport',
},
{
id: 'Cine',
@ -95,12 +95,12 @@ const definitions = [
//
type: TOOLBAR_BUTTON_TYPES.BUILT_IN,
options: {
behavior: 'CINE'
}
}
behavior: 'CINE',
},
},
];
export default {
definitions,
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE'
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE',
};