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A,EAAqBC,MAG3D,CACLC,YAAa,EACbC,aAAc,UAHlB,CAOM,GAET,EAEHC,WAAYC,IAAyB,IAAxB,gBAAEtD,GAAiBsD,EAC9B,MAAM,iBACJzJ,EAAgB,iBAChB0J,EAAgB,oBAChBC,EAAmB,2BACnBC,GACEzD,EAAgBK,SAEpBb,EAAgBkE,SAAQhD,GAAeA,MACvC7G,EAAiB8J,UACjBJ,EAAiBI,UACjBH,EAAoBG,UACpBF,EAA2BE,SAAS,EAEtCC,eAAgB,CACdC,MAAO,GACPC,OAAQ,IAEVC,YAAaC,IAA2B,IAA1B,WAAEC,EAAU,MAAEJ,GAAOG,EACjC,MAAME,EAAkBD,EAAWE,MAAM,MAezC,OAXED,EAAgBE,SAAS,OACzBF,EAAgBE,SAAS,QAJD,CAAC,MAKNC,MAAKC,GAAYJ,EAAgBE,SAASE,MAMlC,8DAA3BT,EAAMU,gBAGM,EAEhBC,OAAQ,CACN,CACEC,KAAM,OAINC,eAAgBC,IAAmC,IAAlC,SAAEC,EAAQ,gBAAE5E,GAAiB2E,EAC5C,MAAO,CACL1H,GAAImC,EACJhB,MAAO,CACLyG,WAAY,CAACzF,GACb0F,wBAAwB,EACxBC,YAAa,CAACzF,EAAwBA,GACtC0F,UAAW,CACT,CACEC,UAAW5F,EACX6F,qBAAsB,CAAC9F,MAI9B,IAIP+F,WAAY5F,EACZ6F,gBAAiB9F,EACjB+F,iBAAkB,CAACjG,GACnBkG,QAAS,IAAIA,EAAAA,GAAQxI,SAASyI,mBAC3B5F,EAEP,EAKEJ,wB","sources":["webpack:///../../../modes/tmtv/src/initToolGroups.js","webpack:///../../../modes/tmtv/src/toolbarButtons.js","webpack:///../../../modes/tmtv/src/id.js","webpack:///../../../modes/tmtv/src/index.js","webpack:///../../../modes/tmtv/src/utils/setCrosshairsConfiguration.js","webpack:///../../../modes/tmtv/src/utils/setFusionActiveVolume.js"],"sourcesContent":["export const toolGroupIds = {\n CT: 'ctToolGroup',\n PT: 'ptToolGroup',\n Fusion: 'fusionToolGroup',\n MIP: 'mipToolGroup',\n default: 'default',\n // MPR: 'mpr',\n};\n\nfunction _initToolGroups(toolNames, Enums, toolGroupService, commandsManager) {\n const tools = {\n active: [\n {\n toolName: toolNames.WindowLevel,\n bindings: [{ mouseButton: Enums.MouseBindings.Primary }],\n },\n {\n toolName: toolNames.Pan,\n bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],\n },\n {\n toolName: toolNames.Zoom,\n bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],\n },\n { toolName: toolNames.StackScrollMouseWheel, bindings: [] },\n ],\n passive: [\n { toolName: toolNames.Length },\n {\n toolName: toolNames.ArrowAnnotate,\n configuration: {\n getTextCallback: (callback, eventDetails) => {\n commandsManager.runCommand('arrowTextCallback', {\n callback,\n eventDetails,\n });\n },\n\n changeTextCallback: (data, eventDetails, callback) =>\n commandsManager.runCommand('arrowTextCallback', {\n callback,\n data,\n eventDetails,\n }),\n },\n },\n { toolName: toolNames.Bidirectional },\n { toolName: toolNames.DragProbe },\n { toolName: toolNames.Probe },\n { toolName: toolNames.EllipticalROI },\n { toolName: toolNames.RectangleROI },\n { toolName: toolNames.StackScroll },\n { toolName: toolNames.Angle },\n { toolName: toolNames.CobbAngle },\n { toolName: toolNames.Magnify },\n ],\n enabled: [{ toolName: toolNames.SegmentationDisplay }],\n disabled: [\n {\n toolName: toolNames.Crosshairs,\n configuration: {\n viewportIndicators: false,\n autoPan: {\n enabled: false,\n panSize: 10,\n },\n },\n },\n ],\n };\n\n toolGroupService.createToolGroupAndAddTools(toolGroupIds.CT, tools);\n toolGroupService.createToolGroupAndAddTools(toolGroupIds.PT, {\n active: tools.active,\n passive: [...tools.passive, { toolName: 'RectangleROIStartEndThreshold' }],\n enabled: tools.enabled,\n disabled: tools.disabled,\n });\n toolGroupService.createToolGroupAndAddTools(toolGroupIds.Fusion, tools);\n toolGroupService.createToolGroupAndAddTools(toolGroupIds.default, tools);\n\n const mipTools = {\n active: [\n {\n toolName: toolNames.VolumeRotateMouseWheel,\n configuration: {\n rotateIncrementDegrees: 0.1,\n },\n },\n {\n toolName: toolNames.MipJumpToClick,\n configuration: {\n toolGroupId: toolGroupIds.PT,\n },\n bindings: [{ mouseButton: Enums.MouseBindings.Primary }],\n },\n ],\n enabled: [{ toolName: toolNames.SegmentationDisplay }],\n };\n\n toolGroupService.createToolGroupAndAddTools(toolGroupIds.MIP, mipTools);\n}\n\nfunction initToolGroups(toolNames, Enums, toolGroupService, commandsManager) {\n _initToolGroups(toolNames, Enums, toolGroupService, commandsManager);\n}\n\nexport default initToolGroups;\n","// TODO: torn, can either bake this here; or have to create a whole new button type\n// Only ways that you can pass in a custom React component for render :l\nimport { WindowLevelMenuItem } from '@ohif/ui';\nimport { defaults } from '@ohif/core';\nimport { toolGroupIds } from './initToolGroups';\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) {\n return {\n id,\n icon,\n label,\n type,\n commands,\n tooltip,\n };\n}\n\nfunction _createColormap(label, colormap) {\n return {\n id: label,\n label,\n type: 'action',\n commands: [\n {\n commandName: 'setFusionPTColormap',\n commandOptions: {\n toolGroupId: toolGroupIds.Fusion,\n colormap,\n },\n },\n ],\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\nfunction _createCommands(commandName, toolName, toolGroupIds) {\n return toolGroupIds.map(toolGroupId => ({\n /* It's a command that is being run when the button is clicked. */\n commandName,\n commandOptions: {\n toolName,\n toolGroupId,\n },\n context: 'CORNERSTONE',\n }));\n}\n\nconst toolbarButtons = [\n // Measurement\n {\n id: 'MeasurementTools',\n type: 'ohif.splitButton',\n props: {\n groupId: 'MeasurementTools',\n isRadio: true, // ?\n // Switch?\n primary: _createToolButton(\n 'Length',\n 'tool-length',\n 'Length',\n [\n ..._createCommands('setToolActive', 'Length', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\n ]),\n ],\n 'Length'\n ),\n secondary: {\n icon: 'chevron-down',\n label: '',\n isActive: true,\n tooltip: 'More Measure Tools',\n },\n items: [\n _createToolButton(\n 'Length',\n 'tool-length',\n 'Length',\n [\n ..._createCommands('setToolActive', 'Length', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\n ]),\n ],\n 'Length Tool'\n ),\n _createToolButton(\n 'Bidirectional',\n 'tool-bidirectional',\n 'Bidirectional',\n [\n ..._createCommands('setToolActive', 'Bidirectional', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\n ]),\n ],\n 'Bidirectional Tool'\n ),\n _createToolButton(\n 'ArrowAnnotate',\n 'tool-annotate',\n 'Annotation',\n [\n ..._createCommands('setToolActive', 'ArrowAnnotate', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\n ]),\n ],\n 'Arrow Annotate'\n ),\n _createToolButton(\n 'EllipticalROI',\n 'tool-elipse',\n 'Ellipse',\n [\n ..._createCommands('setToolActive', 'EllipticalROI', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\n ]),\n ],\n 'Ellipse Tool'\n ),\n ],\n },\n },\n // Zoom..\n {\n id: 'Zoom',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-zoom',\n label: 'Zoom',\n commands: [\n ..._createCommands('setToolActive', 'Zoom', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\n ]),\n ],\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 // 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 ..._createCommands('setToolActive', 'WindowLevel', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\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 {\n id: 'Crosshairs',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-crosshair',\n label: 'Crosshairs',\n commands: [\n ..._createCommands('setToolActive', 'Crosshairs', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\n ]),\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: [\n ..._createCommands('setToolActive', 'Pan', [\n toolGroupIds.CT,\n toolGroupIds.PT,\n toolGroupIds.Fusion,\n // toolGroupIds.MPR,\n ]),\n ],\n },\n },\n {\n id: 'RectangleROIStartEndThreshold',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-create-threshold',\n label: 'Rectangle ROI Threshold',\n commands: [\n ..._createCommands('setToolActive', 'RectangleROIStartEndThreshold', [toolGroupIds.PT]),\n {\n commandName: 'displayNotification',\n commandOptions: {\n title: 'RectangleROI Threshold Tip',\n text: 'RectangleROI Threshold tool should be used on PT Axial Viewport',\n type: 'info',\n },\n },\n {\n commandName: 'setViewportActive',\n commandOptions: {\n viewportId: 'ptAXIAL',\n },\n },\n ],\n },\n },\n {\n id: 'fusionPTColormap',\n type: 'ohif.splitButton',\n props: {\n groupId: 'fusionPTColormap',\n primary: _createToolButton(\n 'fusionPTColormap',\n 'tool-fusion-color',\n 'Fusion PT Colormap',\n [],\n 'Fusion PT Colormap'\n ),\n secondary: {\n icon: 'chevron-down',\n label: 'PT Colormap',\n isActive: true,\n tooltip: 'PET Image Colormap',\n },\n isAction: true, // ?\n items: [\n _createColormap('HSV', 'hsv'),\n _createColormap('Hot Iron', 'hot_iron'),\n _createColormap('S PET', 's_pet'),\n _createColormap('Red Hot', 'red_hot'),\n _createColormap('Perfusion', 'perfusion'),\n _createColormap('Rainbow', 'rainbow_2'),\n _createColormap('SUV', 'suv'),\n _createColormap('GE 256', 'ge_256'),\n _createColormap('GE', 'ge'),\n _createColormap('Siemens', 'siemens'),\n ],\n },\n },\n];\n\nexport default toolbarButtons;\n","import packageJson from '../package.json';\n\nconst id = packageJson.name;\n\nexport { id };\n","import { hotkeys, classes } from '@ohif/core';\nimport toolbarButtons from './toolbarButtons.js';\nimport { id } from './id.js';\nimport initToolGroups, { toolGroupIds } from './initToolGroups.js';\nimport setCrosshairsConfiguration from './utils/setCrosshairsConfiguration.js';\nimport setFusionActiveVolume from './utils/setFusionActiveVolume.js';\n\nconst { MetadataProvider } = classes;\n\nconst ohif = {\n layout: '@ohif/extension-default.layoutTemplateModule.viewerLayout',\n sopClassHandler: '@ohif/extension-default.sopClassHandlerModule.stack',\n measurements: '@ohif/extension-default.panelModule.measure',\n thumbnailList: '@ohif/extension-default.panelModule.seriesList',\n};\n\nconst cs3d = {\n viewport: '@ohif/extension-cornerstone.viewportModule.cornerstone',\n};\n\nconst tmtv = {\n hangingProtocol: '@ohif/extension-tmtv.hangingProtocolModule.ptCT',\n petSUV: '@ohif/extension-tmtv.panelModule.petSUV',\n ROIThresholdPanel: '@ohif/extension-tmtv.panelModule.ROIThresholdSeg',\n};\n\nconst extensionDependencies = {\n // Can derive the versions at least process.env.from npm_package_version\n '@ohif/extension-default': '^3.0.0',\n '@ohif/extension-cornerstone': '^3.0.0',\n '@ohif/extension-tmtv': '^3.0.0',\n};\n\nlet unsubscriptions = [];\nfunction modeFactory({ modeConfiguration }) {\n return {\n // TODO: We're using this as a route segment\n // We should not be.\n id,\n routeName: 'tmtv',\n displayName: 'Total Metabolic Tumor Volume',\n /**\n * Lifecycle hooks\n */\n onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {\n const { toolbarService, toolGroupService, hangingProtocolService, displaySetService } =\n servicesManager.services;\n\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n\n const { toolNames, Enums } = utilityModule.exports;\n\n // Init Default and SR ToolGroups\n initToolGroups(toolNames, Enums, toolGroupService, commandsManager);\n\n const setWindowLevelActive = () => {\n toolbarService.recordInteraction({\n groupId: 'WindowLevel',\n interactionType: 'tool',\n commands: [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: toolNames.WindowLevel,\n toolGroupId: toolGroupIds.CT,\n },\n context: 'CORNERSTONE',\n },\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: toolNames.WindowLevel,\n toolGroupId: toolGroupIds.PT,\n },\n context: 'CORNERSTONE',\n },\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: toolNames.WindowLevel,\n toolGroupId: toolGroupIds.Fusion,\n },\n context: 'CORNERSTONE',\n },\n ],\n });\n };\n\n const { unsubscribe } = toolGroupService.subscribe(\n toolGroupService.EVENTS.VIEWPORT_ADDED,\n () => {\n // For fusion toolGroup we need to add the volumeIds for the crosshairs\n // since in the fusion viewport we don't want both PT and CT to render MIP\n // when slabThickness is modified\n const { displaySetMatchDetails } = hangingProtocolService.getMatchDetails();\n\n setCrosshairsConfiguration(\n displaySetMatchDetails,\n toolNames,\n toolGroupService,\n displaySetService\n );\n\n setFusionActiveVolume(\n displaySetMatchDetails,\n toolNames,\n toolGroupService,\n displaySetService\n );\n\n setWindowLevelActive();\n }\n );\n\n unsubscriptions.push(unsubscribe);\n toolbarService.init(extensionManager);\n toolbarService.addButtons(toolbarButtons);\n toolbarService.createButtonSection('primary', [\n 'MeasurementTools',\n 'Zoom',\n 'WindowLevel',\n 'Crosshairs',\n 'Pan',\n 'RectangleROIStartEndThreshold',\n 'fusionPTColormap',\n ]);\n\n // For the hanging protocol we need to decide on the window level\n // based on whether the SUV is corrected or not, hence we can't hard\n // code the window level in the hanging protocol but we add a custom\n // attribute to the hanging protocol that will be used to get the\n // window level based on the metadata\n hangingProtocolService.addCustomAttribute(\n 'getPTVOIRange',\n 'get PT VOI based on corrected or not',\n props => {\n const ptDisplaySet = props.find(imageSet => imageSet.Modality === 'PT');\n\n if (!ptDisplaySet) {\n return;\n }\n\n const { imageId } = ptDisplaySet.images[0];\n const imageIdScalingFactor = MetadataProvider.get('scalingModule', imageId);\n\n const isSUVAvailable = imageIdScalingFactor && imageIdScalingFactor.suvbw;\n\n if (isSUVAvailable) {\n return {\n windowWidth: 5,\n windowCenter: 2.5,\n };\n }\n\n return;\n }\n );\n },\n onModeExit: ({ servicesManager }) => {\n const {\n toolGroupService,\n syncGroupService,\n segmentationService,\n cornerstoneViewportService,\n } = servicesManager.services;\n\n unsubscriptions.forEach(unsubscribe => unsubscribe());\n toolGroupService.destroy();\n syncGroupService.destroy();\n segmentationService.destroy();\n cornerstoneViewportService.destroy();\n },\n validationTags: {\n study: [],\n series: [],\n },\n isValidMode: ({ modalities, study }) => {\n const modalities_list = modalities.split('\\\\');\n const invalidModalities = ['SM'];\n\n const isValid =\n modalities_list.includes('CT') &&\n modalities_list.includes('PT') &&\n !invalidModalities.some(modality => modalities_list.includes(modality)) &&\n // This is study is a 4D study with PT and CT and not a 3D study for the tmtv\n // mode, until we have a better way to identify 4D studies we will use the\n // StudyInstanceUID to identify the study\n // Todo: when we add the 4D mode which comes with a mechanism to identify\n // 4D studies we can use that\n study.studyInstanceUid !== '1.3.6.1.4.1.12842.1.1.14.3.20220915.105557.468.2963630849';\n\n // there should be both CT and PT modalities and the modality should not be SM\n return isValid;\n },\n routes: [\n {\n path: 'tmtv',\n /*init: ({ servicesManager, extensionManager }) => {\n //defaultViewerRouteInit\n },*/\n layoutTemplate: ({ location, servicesManager }) => {\n return {\n id: ohif.layout,\n props: {\n leftPanels: [ohif.thumbnailList],\n leftPanelDefaultClosed: true,\n rightPanels: [tmtv.ROIThresholdPanel, tmtv.petSUV],\n viewports: [\n {\n namespace: cs3d.viewport,\n displaySetsToDisplay: [ohif.sopClassHandler],\n },\n ],\n },\n };\n },\n },\n ],\n extensions: extensionDependencies,\n hangingProtocol: tmtv.hangingProtocol,\n sopClassHandlers: [ohif.sopClassHandler],\n hotkeys: [...hotkeys.defaults.hotkeyBindings],\n ...modeConfiguration,\n };\n}\n\nconst mode = {\n id,\n modeFactory,\n extensionDependencies,\n};\n\nexport default mode;\n","import { toolGroupIds } from '../initToolGroups';\n\nexport default function setCrosshairsConfiguration(\n matches,\n toolNames,\n toolGroupService,\n displaySetService\n) {\n const matchDetails = matches.get('ctDisplaySet');\n\n if (!matchDetails) {\n return;\n }\n\n const { SeriesInstanceUID } = matchDetails;\n const displaySets = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);\n\n const toolConfig = toolGroupService.getToolConfiguration(\n toolGroupIds.Fusion,\n toolNames.Crosshairs\n );\n\n const crosshairsConfig = {\n ...toolConfig,\n filterActorUIDsToSetSlabThickness: [displaySets[0].displaySetInstanceUID],\n };\n\n toolGroupService.setToolConfiguration(\n toolGroupIds.Fusion,\n toolNames.Crosshairs,\n crosshairsConfig\n );\n}\n","import { toolGroupIds } from '../initToolGroups';\n\nexport default function setFusionActiveVolume(\n matches,\n toolNames,\n toolGroupService,\n displaySetService\n) {\n const matchDetails = matches.get('ptDisplaySet');\n\n if (!matchDetails) {\n return;\n }\n\n const { SeriesInstanceUID } = matchDetails;\n\n const displaySets = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);\n\n if (!displaySets || displaySets.length === 0) {\n return;\n }\n\n const wlToolConfig = toolGroupService.getToolConfiguration(\n toolGroupIds.Fusion,\n toolNames.WindowLevel\n );\n\n const ellipticalToolConfig = toolGroupService.getToolConfiguration(\n toolGroupIds.Fusion,\n toolNames.EllipticalROI\n );\n\n // Todo: this should not take into account the loader id\n const volumeId = `cornerstoneStreamingImageVolume:${displaySets[0].displaySetInstanceUID}`;\n\n const windowLevelConfig = {\n ...wlToolConfig,\n volumeId,\n };\n\n const ellipticalROIConfig = {\n ...ellipticalToolConfig,\n volumeId,\n };\n\n toolGroupService.setToolConfiguration(\n toolGroupIds.Fusion,\n toolNames.WindowLevel,\n windowLevelConfig\n );\n\n toolGroupService.setToolConfiguration(\n toolGroupIds.Fusion,\n toolNames.EllipticalROI,\n ellipticalROIConfig\n );\n}\n"],"names":["toolGroupIds","CT","PT","Fusion","MIP","default","toolNames","Enums","toolGroupService","commandsManager","tools","active","toolName","WindowLevel","bindings","mouseButton","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","StackScrollMouseWheel","passive","Length","ArrowAnnotate","configuration","getTextCallback","callback","eventDetails","runCommand","changeTextCallback","data","Bidirectional","DragProbe","Probe","EllipticalROI","RectangleROI","StackScroll","Angle","CobbAngle","Magnify","enabled","SegmentationDisplay","disabled","Crosshairs","viewportIndicators","autoPan","panSize","createToolGroupAndAddTools","mipTools","VolumeRotateMouseWheel","rotateIncrementDegrees","MipJumpToClick","toolGroupId","_initToolGroups","windowLevelPresets","defaults","_createButton","type","id","icon","label","commands","tooltip","_createColormap","colormap","commandName","commandOptions","bind","_createToolButton","_createWwwcPreset","preset","title","subtitle","toString","context","_createCommands","map","props","groupId","isRadio","primary","secondary","isActive","items","protocolId","isAction","renderer","WindowLevelMenuItem","text","viewportId","packageJson","MetadataProvider","classes","ohif","cs3d","tmtv","extensionDependencies","unsubscriptions","modeFactory","_ref","modeConfiguration","routeName","displayName","onModeEnter","_ref2","servicesManager","extensionManager","toolbarService","hangingProtocolService","displaySetService","services","utilityModule","getModuleEntry","exports","initToolGroups","unsubscribe","subscribe","EVENTS","VIEWPORT_ADDED","displaySetMatchDetails","getMatchDetails","matches","matchDetails","get","SeriesInstanceUID","displaySets","getDisplaySetsForSeries","crosshairsConfig","getToolConfiguration","filterActorUIDsToSetSlabThickness","displaySetInstanceUID","setToolConfiguration","setCrosshairsConfiguration","length","wlToolConfig","ellipticalToolConfig","volumeId","windowLevelConfig","ellipticalROIConfig","setFusionActiveVolume","recordInteraction","interactionType","push","init","addButtons","toolbarButtons","createButtonSection","addCustomAttribute","ptDisplaySet","find","imageSet","Modality","imageId","images","imageIdScalingFactor","suvbw","windowWidth","windowCenter","onModeExit","_ref3","syncGroupService","segmentationService","cornerstoneViewportService","forEach","destroy","validationTags","study","series","isValidMode","_ref4","modalities","modalities_list","split","includes","some","modality","studyInstanceUid","routes","path","layoutTemplate","_ref5","location","leftPanels","leftPanelDefaultClosed","rightPanels","viewports","namespace","displaySetsToDisplay","extensions","hangingProtocol","sopClassHandlers","hotkeys","hotkeyBindings"],"sourceRoot":""}