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/B,EAAkBC,EAAkBC,KA0BhD2B,eAAgB5B,EAAiB+B,UAClC/B,EAAiBgC,OAAOC,gBAvBLC,KACnBR,EAAeS,kBAAkB,CAC/BxF,QAAS,cACTyF,gBAAiB,OACjB9G,SAAU,CACR,CACEY,YAAa,gBACbC,eAAgB,CACdI,SAAU,eAEZH,QAAS,kBAOfwF,GAAa,KAUfF,EAAeW,KAAKtC,GACpB2B,EAAeY,WAAWC,GAC1Bb,EAAec,oBAAoB,UAAW,CAC5C,OACA,cACA,MACA,UACA,SACA,MACA,aACA,aACA,EAEJC,WAAYC,IAAyB,IAAxB,gBAAElB,GAAiBkB,EAC9B,MAAM,iBACJ1C,EAAgB,iBAChB2C,EAAgB,eAChBjB,EAAc,oBACdkB,EAAmB,2BACnBC,GACErB,EAAgBG,SAEpB3B,EAAiB8C,UACjBH,EAAiBG,UACjBF,EAAoBE,UACpBD,EAA2BC,SAAS,EAGtCC,eAAgB,CACdC,MAAO,GACPC,OAAQ,IAMVC,YAAaC,IAAA,IAAC,WAAEC,GAAYD,EAAA,OAAK,CAAI,EAarCE,OAAQ,CACN,CACEC,KAAM,WACNC,eAAgBC,IAAmC,IAAlC,SAAEC,EAAQ,gBAAEjC,GAAiBgC,EAC5C,MAAO,CACL1I,GAAI+F,EACJnE,MAAO,CACLgH,WAAY,CAAC7C,GACb8C,YAAa,CAAC5C,GACd6C,UAAW,CACT,CACEC,UAAW/C,EACXgD,qBAAsB,CAACjD,IAEzB,CACEgD,UAAW9C,EACX+C,qBAAsB,CAAC/C,MAI9B,IAKPgD,WAAY/C,EAIZgD,iBAAkB,CAACnD,EAAsBE,GAEzCkD,QAAS,IAAIA,EAAAA,GAAQhJ,SAASiJ,gBAElC,EAKElD,wB","sources":["webpack:///../../../modes/segmentation/src/id.js","webpack:///../../../modes/segmentation/src/toolbarButtons.ts","webpack:///../../../modes/segmentation/src/initToolGroups.ts","webpack:///../../../modes/segmentation/src/index.tsx"],"sourcesContent":["import packageJson from '../package.json';\n\nconst id = packageJson.name;\n\nexport { id };\n","import {\n // ExpandableToolbarButton,\n // ListMenu,\n WindowLevelMenuItem,\n} from '@ohif/ui';\nimport { defaults } from '@ohif/core';\n\nconst { windowLevelPresets } = defaults;\n/**\n *\n * @param {*} type - 'tool' | 'action' | 'toggle'\n * @param {*} id\n * @param {*} icon\n * @param {*} label\n */\nfunction _createButton(type, id, icon, label, commands, tooltip, uiType) {\n return {\n id,\n icon,\n label,\n type,\n commands,\n tooltip,\n uiType,\n };\n}\n\nconst _createActionButton = _createButton.bind(null, 'action');\nconst _createToggleButton = _createButton.bind(null, 'toggle');\nconst _createToolButton = _createButton.bind(null, 'tool');\n\n/**\n *\n * @param {*} preset - preset number (from above import)\n * @param {*} title\n * @param {*} subtitle\n */\nfunction _createWwwcPreset(preset, title, subtitle) {\n return {\n id: preset.toString(),\n title,\n subtitle,\n type: 'action',\n commands: [\n {\n commandName: 'setWindowLevel',\n commandOptions: {\n ...windowLevelPresets[preset],\n },\n context: 'CORNERSTONE',\n },\n ],\n };\n}\n\nconst toolGroupIds = ['default', 'mpr', 'SRToolGroup'];\n\n/**\n * Creates an array of 'setToolActive' commands for the given toolName - one for\n * each toolGroupId specified in toolGroupIds.\n * @param {string} toolName\n * @returns {Array} an array of 'setToolActive' commands\n */\nfunction _createSetToolActiveCommands(toolName) {\n const temp = toolGroupIds.map(toolGroupId => ({\n commandName: 'setToolActive',\n commandOptions: {\n toolGroupId,\n toolName,\n },\n context: 'CORNERSTONE',\n }));\n return temp;\n}\n\nconst toolbarButtons = [\n // Zoom..\n {\n id: 'Zoom',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-zoom',\n label: 'Zoom',\n commands: _createSetToolActiveCommands('Zoom'),\n },\n },\n // Window Level + Presets...\n {\n id: 'WindowLevel',\n type: 'ohif.splitButton',\n props: {\n groupId: 'WindowLevel',\n primary: _createToolButton(\n 'WindowLevel',\n 'tool-window-level',\n 'Window Level',\n [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'WindowLevel',\n },\n context: 'CORNERSTONE',\n },\n ],\n 'Window Level'\n ),\n secondary: {\n icon: 'chevron-down',\n label: 'W/L Manual',\n isActive: true,\n tooltip: 'W/L Presets',\n },\n isAction: true, // ?\n renderer: WindowLevelMenuItem,\n items: [\n _createWwwcPreset(1, 'Soft tissue', '400 / 40'),\n _createWwwcPreset(2, 'Lung', '1500 / -600'),\n _createWwwcPreset(3, 'Liver', '150 / 90'),\n _createWwwcPreset(4, 'Bone', '2500 / 480'),\n _createWwwcPreset(5, 'Brain', '80 / 40'),\n ],\n },\n },\n // Pan...\n {\n id: 'Pan',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-move',\n label: 'Pan',\n commands: _createSetToolActiveCommands('Pan'),\n },\n },\n {\n id: 'Capture',\n type: 'ohif.action',\n props: {\n icon: 'tool-capture',\n label: 'Capture',\n type: 'action',\n commands: [\n {\n commandName: 'showDownloadViewportModal',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n },\n },\n {\n id: 'Layout',\n type: 'ohif.layoutSelector',\n props: {\n rows: 3,\n columns: 3,\n },\n },\n {\n id: 'MPR',\n type: 'ohif.action',\n props: {\n type: 'toggle',\n icon: 'icon-mpr',\n label: 'MPR',\n commands: [\n {\n commandName: 'toggleHangingProtocol',\n commandOptions: {\n protocolId: 'mpr',\n },\n context: 'DEFAULT',\n },\n ],\n },\n },\n {\n id: 'Crosshairs',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-crosshair',\n label: 'Crosshairs',\n commands: [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'Crosshairs',\n toolGroupId: 'mpr',\n },\n context: 'CORNERSTONE',\n },\n ],\n },\n },\n // More...\n {\n id: 'MoreTools',\n type: 'ohif.splitButton',\n props: {\n isRadio: true, // ?\n groupId: 'MoreTools',\n primary: _createActionButton(\n 'Reset',\n 'tool-reset',\n 'Reset View',\n [\n {\n commandName: 'resetViewport',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Reset'\n ),\n secondary: {\n icon: 'chevron-down',\n label: '',\n isActive: true,\n tooltip: 'More Tools',\n },\n items: [\n _createActionButton(\n 'Reset',\n 'tool-reset',\n 'Reset View',\n [\n {\n commandName: 'resetViewport',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Reset'\n ),\n _createActionButton(\n 'rotate-right',\n 'tool-rotate-right',\n 'Rotate Right',\n [\n {\n commandName: 'rotateViewportCW',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Rotate +90'\n ),\n _createActionButton(\n 'flip-horizontal',\n 'tool-flip-horizontal',\n 'Flip Horizontally',\n [\n {\n commandName: 'flipViewportHorizontal',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Flip Horizontal'\n ),\n _createToggleButton('StackImageSync', 'link', 'Stack Image Sync', [\n {\n commandName: 'toggleStackImageSync',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ]),\n _createToggleButton(\n 'ReferenceLines',\n 'tool-referenceLines', // change this with the new icon\n 'Reference Lines',\n [\n {\n commandName: 'toggleReferenceLines',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ]\n ),\n _createToolButton(\n 'StackScroll',\n 'tool-stack-scroll',\n 'Stack Scroll',\n [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'StackScroll',\n },\n context: 'CORNERSTONE',\n },\n ],\n 'Stack Scroll'\n ),\n _createActionButton(\n 'invert',\n 'tool-invert',\n 'Invert',\n [\n {\n commandName: 'invertViewport',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Invert Colors'\n ),\n _createToggleButton(\n 'cine',\n 'tool-cine',\n 'Cine',\n [\n {\n commandName: 'toggleCine',\n context: 'CORNERSTONE',\n },\n ],\n 'Cine'\n ),\n _createToolButton(\n 'Magnify',\n 'tool-magnify',\n 'Magnify',\n [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'Magnify',\n },\n context: 'CORNERSTONE',\n },\n ],\n 'Magnify'\n ),\n _createActionButton(\n 'TagBrowser',\n 'list-bullets',\n 'Dicom Tag Browser',\n [\n {\n commandName: 'openDICOMTagViewer',\n commandOptions: {},\n context: 'DEFAULT',\n },\n ],\n 'Dicom Tag Browser'\n ),\n ],\n },\n },\n];\n\nexport default toolbarButtons;\n","const brushInstanceNames = {\n CircularBrush: 'CircularBrush',\n CircularEraser: 'CircularEraser',\n SphereBrush: 'SphereBrush',\n SphereEraser: 'SphereEraser',\n ThresholdCircularBrush: 'ThresholdCircularBrush',\n ThresholdSphereBrush: 'ThresholdSphereBrush',\n};\n\nconst brushStrategies = {\n CircularBrush: 'FILL_INSIDE_CIRCLE',\n CircularEraser: 'ERASE_INSIDE_CIRCLE',\n SphereBrush: 'FILL_INSIDE_SPHERE',\n SphereEraser: 'ERASE_INSIDE_SPHERE',\n ThresholdCircularBrush: 'THRESHOLD_INSIDE_CIRCLE',\n ThresholdSphereBrush: 'THRESHOLD_INSIDE_SPHERE',\n};\n\nfunction createTools(utilityModule) {\n const { toolNames, Enums } = utilityModule.exports;\n return {\n active: [\n { toolName: toolNames.WindowLevel, bindings: [{ mouseButton: Enums.MouseBindings.Primary }] },\n { toolName: toolNames.Pan, bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }] },\n { toolName: toolNames.Zoom, bindings: [{ mouseButton: Enums.MouseBindings.Secondary }] },\n { toolName: toolNames.StackScrollMouseWheel, bindings: [] },\n ],\n passive: Object.keys(brushInstanceNames)\n .map(brushName => ({\n toolName: brushName,\n parentTool: 'Brush',\n configuration: {\n activeStrategy: brushStrategies[brushName],\n },\n }))\n .concat([\n { toolName: toolNames.CircleScissors },\n { toolName: toolNames.RectangleScissors },\n { toolName: toolNames.SphereScissors },\n { toolName: toolNames.StackScroll },\n { toolName: toolNames.Magnify },\n { toolName: toolNames.SegmentationDisplay },\n ]),\n disabled: [{ toolName: toolNames.ReferenceLines }],\n };\n}\n\nfunction initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const tools = createTools(utilityModule);\n toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);\n}\n\nfunction initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const tools = createTools(utilityModule);\n tools.disabled.push(\n {\n toolName: utilityModule.exports.toolNames.Crosshairs,\n configuration: {\n viewportIndicators: false,\n autoPan: {\n enabled: false,\n panSize: 10,\n },\n },\n },\n { toolName: utilityModule.exports.toolNames.ReferenceLines }\n );\n toolGroupService.createToolGroupAndAddTools('mpr', tools);\n}\n\nfunction initToolGroups(extensionManager, toolGroupService, commandsManager) {\n initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, 'default');\n initMPRToolGroup(extensionManager, toolGroupService, commandsManager);\n}\n\nexport default initToolGroups;\n","import { hotkeys } from '@ohif/core';\nimport { id } from './id';\nimport toolbarButtons from './toolbarButtons';\nimport initToolGroups from './initToolGroups';\n\nconst ohif = {\n layout: '@ohif/extension-default.layoutTemplateModule.viewerLayout',\n sopClassHandler: '@ohif/extension-default.sopClassHandlerModule.stack',\n hangingProtocol: '@ohif/extension-default.hangingProtocolModule.default',\n leftPanel: '@ohif/extension-default.panelModule.seriesList',\n rightPanel: '@ohif/extension-default.panelModule.measure',\n};\n\nconst cornerstone = {\n viewport: '@ohif/extension-cornerstone.viewportModule.cornerstone',\n};\n\nconst segmentation = {\n panel: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentation',\n panelTool: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentationWithTools',\n sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',\n viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',\n};\n\n/**\n * Just two dependencies to be able to render a viewport with panels in order\n * to make sure that the mode is working.\n */\nconst extensionDependencies = {\n '@ohif/extension-default': '^3.0.0',\n '@ohif/extension-cornerstone': '^3.0.0',\n '@ohif/extension-cornerstone-dicom-seg': '^3.0.0',\n};\n\nfunction modeFactory({ modeConfiguration }) {\n return {\n /**\n * Mode ID, which should be unique among modes used by the viewer. This ID\n * is used to identify the mode in the viewer's state.\n */\n id,\n routeName: 'segmentation',\n /**\n * Mode name, which is displayed in the viewer's UI in the workList, for the\n * user to select the mode.\n */\n displayName: 'Segmentation',\n /**\n * Runs when the Mode Route is mounted to the DOM. Usually used to initialize\n * Services and other resources.\n */\n onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {\n const { measurementService, toolbarService, toolGroupService } = servicesManager.services;\n\n measurementService.clearMeasurements();\n\n // Init Default and SR ToolGroups\n initToolGroups(extensionManager, toolGroupService, commandsManager);\n\n let unsubscribe;\n\n const activateTool = () => {\n toolbarService.recordInteraction({\n groupId: 'WindowLevel',\n interactionType: 'tool',\n commands: [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'WindowLevel',\n },\n context: 'CORNERSTONE',\n },\n ],\n });\n\n // We don't need to reset the active tool whenever a viewport is getting\n // added to the toolGroup.\n unsubscribe();\n };\n\n // Since we only have one viewport for the basic cs3d mode and it has\n // only one hanging protocol, we can just use the first viewport\n ({ unsubscribe } = toolGroupService.subscribe(\n toolGroupService.EVENTS.VIEWPORT_ADDED,\n activateTool\n ));\n\n toolbarService.init(extensionManager);\n toolbarService.addButtons(toolbarButtons);\n toolbarService.createButtonSection('primary', [\n 'Zoom',\n 'WindowLevel',\n 'Pan',\n 'Capture',\n 'Layout',\n 'MPR',\n 'Crosshairs',\n 'MoreTools',\n ]);\n },\n onModeExit: ({ servicesManager }) => {\n const {\n toolGroupService,\n syncGroupService,\n toolbarService,\n segmentationService,\n cornerstoneViewportService,\n } = servicesManager.services;\n\n toolGroupService.destroy();\n syncGroupService.destroy();\n segmentationService.destroy();\n cornerstoneViewportService.destroy();\n },\n /** */\n validationTags: {\n study: [],\n series: [],\n },\n /**\n * A boolean return value that indicates whether the mode is valid for the\n * modalities of the selected studies. For instance a PET/CT mode should be\n */\n isValidMode: ({ modalities }) => true,\n /**\n * Mode Routes are used to define the mode's behavior. A list of Mode Route\n * that includes the mode's path and the layout to be used. The layout will\n * include the components that are used in the layout. For instance, if the\n * default layoutTemplate is used (id: '@ohif/extension-default.layoutTemplateModule.viewerLayout')\n * it will include the leftPanels, rightPanels, and viewports. However, if\n * you define another layoutTemplate that includes a Footer for instance,\n * you should provide the Footer component here too. Note: We use Strings\n * to reference the component's ID as they are registered in the internal\n * ExtensionManager. The template for the string is:\n * `${extensionId}.{moduleType}.${componentId}`.\n */\n routes: [\n {\n path: 'template',\n layoutTemplate: ({ location, servicesManager }) => {\n return {\n id: ohif.layout,\n props: {\n leftPanels: [ohif.leftPanel],\n rightPanels: [segmentation.panelTool],\n viewports: [\n {\n namespace: cornerstone.viewport,\n displaySetsToDisplay: [ohif.sopClassHandler],\n },\n {\n namespace: segmentation.viewport,\n displaySetsToDisplay: [segmentation.sopClassHandler],\n },\n ],\n },\n };\n },\n },\n ],\n /** List of extensions that are used by the mode */\n extensions: extensionDependencies,\n /** HangingProtocol used by the mode */\n // hangingProtocol: [''],\n /** SopClassHandlers used by the mode */\n sopClassHandlers: [ohif.sopClassHandler, segmentation.sopClassHandler],\n /** hotkeys for mode */\n hotkeys: [...hotkeys.defaults.hotkeyBindings],\n };\n}\n\nconst mode = {\n id,\n modeFactory,\n extensionDependencies,\n};\n\nexport default mode;\n"],"names":["id","packageJson","windowLevelPresets","defaults","_createButton","type","icon","label","commands","tooltip","uiType","_createActionButton","bind","_createToggleButton","_createToolButton","_createWwwcPreset","preset","title","subtitle","toString","commandName","commandOptions","context","toolGroupIds","_createSetToolActiveCommands","toolName","map","toolGroupId","props","groupId","primary","secondary","isActive","isAction","renderer","WindowLevelMenuItem","items","rows","columns","protocolId","isRadio","brushInstanceNames","CircularBrush","CircularEraser","SphereBrush","SphereEraser","ThresholdCircularBrush","ThresholdSphereBrush","brushStrategies","createTools","utilityModule","toolNames","Enums","exports","active","WindowLevel","bindings","mouseButton","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","StackScrollMouseWheel","passive","Object","keys","brushName","parentTool","configuration","activeStrategy","concat","CircleScissors","RectangleScissors","SphereScissors","StackScroll","Magnify","SegmentationDisplay","disabled","ReferenceLines","extensionManager","toolGroupService","commandsManager","tools","getModuleEntry","createToolGroupAndAddTools","initDefaultToolGroup","push","Crosshairs","viewportIndicators","autoPan","enabled","panSize","initMPRToolGroup","ohif","cornerstone","segmentation","extensionDependencies","modeFactory","_ref","modeConfiguration","routeName","displayName","onModeEnter","_ref2","servicesManager","measurementService","toolbarService","services","unsubscribe","clearMeasurements","initToolGroups","subscribe","EVENTS","VIEWPORT_ADDED","activateTool","recordInteraction","interactionType","init","addButtons","toolbarButtons","createButtonSection","onModeExit","_ref3","syncGroupService","segmentationService","cornerstoneViewportService","destroy","validationTags","study","series","isValidMode","_ref4","modalities","routes","path","layoutTemplate","_ref5","location","leftPanels","rightPanels","viewports","namespace","displaySetsToDisplay","extensions","sopClassHandlers","hotkeys","hotkeyBindings"],"sourceRoot":""}