* Update props for new react-cornerstone-viewport implementation * Create an preRegistration hook for the cornerstone extension to setup cornerstone tools (takes configuration) * Isolate measurements panel logic * reorder extension registration * remove unused setupTools * Restore CINE connection * fix stack prefetcher toggling * Cleanup OHIFCornerstoneViewport props * updated yarn lock * bust yarn.lock to get updated react-cornerstone-viewport * fix review comment; us isActive to better show it's influence on prefetch * refactor: remove pass through method * review performance optimization * review; comment out unused variable * shift tool under correct comment * Use alternative csTools config, if provided * Note regarding config options
28 lines
1.0 KiB
JavaScript
28 lines
1.0 KiB
JavaScript
import Hammer from 'hammerjs';
|
|
import cornerstone from 'cornerstone-core';
|
|
import cornerstoneMath from 'cornerstone-math';
|
|
import cornerstoneTools from 'cornerstone-tools';
|
|
|
|
export default function(configuration = {}) {
|
|
// For debugging
|
|
window.cornerstoneTools = cornerstoneTools;
|
|
|
|
cornerstoneTools.external.cornerstone = cornerstone;
|
|
cornerstoneTools.external.Hammer = Hammer;
|
|
cornerstoneTools.external.cornerstoneMath = cornerstoneMath;
|
|
cornerstoneTools.init(configuration);
|
|
|
|
// Set the tool font and font size
|
|
// context.font = "[style] [variant] [weight] [size]/[line height] [font family]";
|
|
const fontFamily =
|
|
'Roboto, OpenSans, HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif';
|
|
cornerstoneTools.textStyle.setFont(`16px ${fontFamily}`);
|
|
|
|
// Tool styles/colors
|
|
cornerstoneTools.toolStyle.setToolWidth(2);
|
|
cornerstoneTools.toolColors.setToolColor('rgb(255, 255, 0)');
|
|
cornerstoneTools.toolColors.setActiveColor('rgb(0, 255, 0)');
|
|
|
|
cornerstoneTools.store.state.touchProximity = 40;
|
|
}
|