@ohif/mode-segmentation 3.12.0-beta.12 → 3.12.0-beta.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("@ohif/core")):"function"==typeof define&&define.amd?define("@ohif/mode-segmentation",["@ohif/core"],o):"object"==typeof exports?exports["@ohif/mode-segmentation"]=o(require("@ohif/core")):e["@ohif/mode-segmentation"]=o(e["@ohif/core"])}("undefined"!=typeof self?self:this,e=>(()=>{"use strict";var o={498:o=>{o.exports=e}},t={};function a(e){var i=t[e];if(void 0!==i)return i.exports;var n=t[e]={exports:{}};return o[e](n,n.exports,a),n.exports}a.d=(e,o)=>{for(var t in o)a.o(o,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};a.r(i),a.d(i,{default:()=>T});const n=JSON.parse('{"UU":"@ohif/mode-segmentation"}').UU;var l=a(498);const r={commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["default","mpr","SRToolGroup","volume3d"]}},s=e=>[{commandName:"setViewportForToolConfiguration",commandOptions:{toolName:e}}],u=[{id:"AdvancedRenderingControls",uiType:"ohif.advancedRenderingControls",props:{buttonSection:!0}},{id:"modalityLoadBadge",uiType:"ohif.modalityLoadBadge",props:{icon:"Status",label:"Status",tooltip:"Status",evaluate:{name:"evaluate.modalityLoadBadge",hideWhenDisabled:!0}}},{id:"navigationComponent",uiType:"ohif.navigationComponent",props:{icon:"Navigation",label:"Navigation",tooltip:"Navigate between segments/measurements and manage their visibility",evaluate:{name:"evaluate.navigationComponent",hideWhenDisabled:!0}}},{id:"trackingStatus",uiType:"ohif.trackingStatus",props:{icon:"TrackingStatus",label:"Tracking Status",tooltip:"View and manage tracking status of measurements and annotations",evaluate:{name:"evaluate.trackingStatus",hideWhenDisabled:!0}}},{id:"dataOverlayMenu",uiType:"ohif.dataOverlayMenu",props:{icon:"ViewportViews",label:"Data Overlay",tooltip:"Configure data overlay options and manage foreground/background display sets",evaluate:"evaluate.dataOverlayMenu"}},{id:"orientationMenu",uiType:"ohif.orientationMenu",props:{icon:"OrientationSwitch",label:"Orientation",tooltip:"Change viewport orientation between axial, sagittal, coronal and reformat planes",evaluate:{name:"evaluate.orientationMenu"}}},{id:"windowLevelMenuEmbedded",uiType:"ohif.windowLevelMenuEmbedded",props:{icon:"WindowLevel",label:"Window Level",tooltip:"Adjust window/level presets and customize image contrast settings",evaluate:{name:"evaluate.windowLevelMenuEmbedded",hideWhenDisabled:!0}}},{id:"windowLevelMenu",uiType:"ohif.windowLevelMenu",props:{icon:"WindowLevel",label:"Window Level",tooltip:"Adjust window/level presets and customize image contrast settings",evaluate:"evaluate.windowLevelMenu"}},{id:"voiManualControlMenu",uiType:"ohif.voiManualControlMenu",props:{icon:"WindowLevelAdvanced",label:"Advanced Window Level",tooltip:"Advanced window/level settings with manual controls and presets",evaluate:"evaluate.voiManualControlMenu"}},{id:"thresholdMenu",uiType:"ohif.thresholdMenu",props:{icon:"Threshold",label:"Threshold",tooltip:"Image threshold settings",evaluate:{name:"evaluate.thresholdMenu",hideWhenDisabled:!0}}},{id:"opacityMenu",uiType:"ohif.opacityMenu",props:{icon:"Opacity",label:"Opacity",tooltip:"Image opacity settings",evaluate:{name:"evaluate.opacityMenu",hideWhenDisabled:!0}}},{id:"Colorbar",uiType:"ohif.colorbar",props:{type:"tool",label:"Colorbar"}},{id:"MoreTools",uiType:"ohif.toolButtonList",props:{buttonSection:!0}},{id:"BrushTools",uiType:"ohif.toolBoxButtonGroup",props:{buttonSection:!0}},{id:"SegmentationUtilities",uiType:"ohif.toolBoxButton",props:{buttonSection:!0}},{id:"SegmentationTools",uiType:"ohif.toolBoxButton",props:{buttonSection:!0}},{id:"Zoom",uiType:"ohif.toolButton",props:{icon:"tool-zoom",label:"Zoom",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"WindowLevel",uiType:"ohif.toolButton",props:{icon:"tool-window-level",label:"Window Level",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"Pan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:"Pan",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"TrackballRotate",uiType:"ohif.toolButton",props:{type:"tool",icon:"tool-3d-rotate",label:"3D Rotate",commands:r,evaluate:{name:"evaluate.cornerstoneTool",disabledText:"Select a 3D viewport to enable this tool"}}},{id:"Capture",uiType:"ohif.toolButton",props:{icon:"tool-capture",label:"Capture",commands:"showDownloadViewportModal",evaluate:["evaluate.action",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["video","wholeSlide"]}]}},{id:"Layout",uiType:"ohif.layoutSelector",props:{rows:3,columns:4,evaluate:"evaluate.action",commands:"setViewportGridLayout"}},{id:"Crosshairs",uiType:"ohif.toolButton",props:{icon:"tool-crosshair",label:"Crosshairs",commands:{commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["mpr"]}},evaluate:{name:"evaluate.cornerstoneTool",disabledText:"Select an MPR viewport to enable this tool"}}},{id:"Reset",uiType:"ohif.toolButton",props:{icon:"tool-reset",label:"Reset View",tooltip:"Reset View",commands:"resetViewport",evaluate:"evaluate.action"}},{id:"rotate-right",uiType:"ohif.toolButton",props:{icon:"tool-rotate-right",label:"Rotate Right",tooltip:"Rotate +90",commands:"rotateViewportCW",evaluate:"evaluate.action"}},{id:"flipHorizontal",uiType:"ohif.toolButton",props:{icon:"tool-flip-horizontal",label:"Flip Horizontal",tooltip:"Flip Horizontally",commands:"flipViewportHorizontal",evaluate:["evaluate.viewportProperties.toggle",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"ReferenceLines",uiType:"ohif.toolButton",props:{icon:"tool-referenceLines",label:"Reference Lines",tooltip:"Show Reference Lines",commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"ImageOverlayViewer",uiType:"ohif.toolButton",props:{icon:"toggle-dicom-overlay",label:"Image Overlay",tooltip:"Toggle Image Overlay",commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"StackScroll",uiType:"ohif.toolButton",props:{icon:"tool-stack-scroll",label:"Stack Scroll",tooltip:"Stack Scroll",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"invert",uiType:"ohif.toolButton",props:{icon:"tool-invert",label:"Invert",tooltip:"Invert Colors",commands:"invertViewport",evaluate:"evaluate.viewportProperties.toggle"}},{id:"Cine",uiType:"ohif.toolButton",props:{icon:"tool-cine",label:"Cine",tooltip:"Cine",commands:"toggleCine",evaluate:["evaluate.cine",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"Magnify",uiType:"ohif.toolButton",props:{icon:"tool-magnify",label:"Zoom-in",tooltip:"Zoom-in",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"TagBrowser",uiType:"ohif.toolButton",props:{icon:"dicom-tag-browser",label:"Dicom Tag Browser",tooltip:"Dicom Tag Browser",commands:"openDICOMTagViewer"}},{id:"Brush",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-brush",label:"Brush",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircularBrush","SphereBrush"],disabledText:"Create new segmentation to enable this tool."},options:[{name:"Radius (mm)",id:"brush-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["CircularBrush","SphereBrush"]}}},{name:"Shape",type:"radio",id:"brush-mode",value:"CircularBrush",values:[{value:"CircularBrush",label:"Circle"},{value:"SphereBrush",label:"Sphere"}],commands:"setToolActiveToolbar"}]}},{id:"InterpolateLabelmap",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-interpolation",label:"Interpolate Labelmap",tooltip:"Automatically fill in missing slices between drawn segments. Use brush or threshold tools on at least two slices, then click to interpolate across slices. Works in any direction. Volume must be reconstructable.",evaluate:["evaluate.cornerstone.segmentation",{name:"evaluate.displaySetIsReconstructable",disabledText:"The current viewport cannot handle interpolation."}],commands:"interpolateLabelmap"}},{id:"SegmentBidirectional",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-bidirectional-segment",label:"Segment Bidirectional",tooltip:"Automatically detects the largest length and width across slices for the selected segment and displays a bidirectional measurement.",evaluate:{name:"evaluate.cornerstone.segmentation",disabledText:"Create new segmentation to enable this tool."},commands:"runSegmentBidirectional"}},{id:"RegionSegmentPlus",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-click-segment",label:"One Click Segment",tooltip:"Detects segmentable regions with one click. Hover for visual feedback—click when a plus sign appears to auto-segment the lesion.",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["RegionSegmentPlus"],disabledText:"Create new segmentation to enable this tool."},commands:"setToolActiveToolbar"}},{id:"LabelmapSlicePropagation",uiType:"ohif.toolBoxButton",props:{icon:"icon-labelmap-slice-propagation",label:"Labelmap Assist",tooltip:"Toggle AI assistance for segmenting nearby slices. After drawing on a slice, scroll to preview predictions. Press Enter to accept or Esc to skip.",evaluate:["evaluate.cornerstoneTool.toggle",{name:"evaluate.cornerstone.hasSegmentation"}],listeners:{[l.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:s("LabelmapSlicePropagation"),[l.ViewportGridService.EVENTS.VIEWPORTS_READY]:s("LabelmapSlicePropagation")},commands:"toggleEnabledDisabledToolbar"}},{id:"MarkerLabelmap",uiType:"ohif.toolBoxButton",props:{icon:"icon-marker-labelmap",label:"Marker Guided Labelmap",tooltip:"Use include/exclude markers to guide AI (SAM) segmentation. Click to place markers, Enter to accept results, Esc to reject, and N to go to the next slice while keeping markers.",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["MarkerLabelmap","MarkerInclude","MarkerExclude"]}],commands:"setToolActiveToolbar",listeners:{[l.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:s("MarkerLabelmap"),[l.ViewportGridService.EVENTS.VIEWPORTS_READY]:s("MarkerLabelmap")},options:[{name:"Marker Mode",type:"radio",id:"marker-mode",value:"markerInclude",values:[{value:"markerInclude",label:"Include"},{value:"markerExclude",label:"Exclude"}],commands:({commandsManager:e,options:o})=>{"markerInclude"===o.find(e=>"marker-mode"===e.id).value?e.run("setToolActive",{toolName:"MarkerInclude"}):e.run("setToolActive",{toolName:"MarkerExclude"})}},{name:"Clear Markers",type:"button",id:"clear-markers",commands:"clearMarkersForMarkerLabelmap"}]}},{id:"Eraser",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-eraser",label:"Eraser",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircularEraser","SphereEraser"]},options:[{name:"Radius (mm)",id:"eraser-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["CircularEraser","SphereEraser"]}}},{name:"Shape",type:"radio",id:"eraser-mode",value:"CircularEraser",values:[{value:"CircularEraser",label:"Circle"},{value:"SphereEraser",label:"Sphere"}],commands:"setToolActiveToolbar"}]}},{id:"Threshold",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-threshold",label:"Threshold Tool",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["ThresholdCircularBrush","ThresholdSphereBrush","ThresholdCircularBrushDynamic","ThresholdSphereBrushDynamic"]},options:[{name:"Radius (mm)",id:"threshold-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush","ThresholdCircularBrushDynamic","ThresholdSphereBrushDynamic"]}}},{name:"Shape",type:"radio",id:"threshold-shape",value:"ThresholdCircularBrush",values:[{value:"ThresholdCircularBrush",label:"Circle"},{value:"ThresholdSphereBrush",label:"Sphere"}],commands:({value:e,commandsManager:o,options:t})=>{"ThresholdDynamic"===t.find(e=>"dynamic-mode"===e.id).value?o.run("setToolActive",{toolName:"ThresholdCircularBrush"===e?"ThresholdCircularBrushDynamic":"ThresholdSphereBrushDynamic"}):o.run("setToolActive",{toolName:e})}},{name:"Threshold",type:"radio",id:"dynamic-mode",value:"ThresholdDynamic",values:[{value:"ThresholdDynamic",label:"Dynamic"},{value:"ThresholdRange",label:"Range"}],commands:({value:e,commandsManager:o,options:t})=>{const a=t.find(e=>"threshold-shape"===e.id);if("ThresholdDynamic"===e)o.run("setToolActiveToolbar",{toolName:"ThresholdCircularBrush"===a.value?"ThresholdCircularBrushDynamic":"ThresholdSphereBrushDynamic"});else{o.run("setToolActiveToolbar",{toolName:a.value});const e=t.find(e=>"threshold-range"===e.id).value;o.run("setThresholdRange",{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"],value:e})}}},{name:"ThresholdRange",type:"double-range",id:"threshold-range",min:-1e3,max:1e3,step:1,value:[50,600],condition:({options:e})=>"ThresholdRange"===e.find(e=>"dynamic-mode"===e.id).value,commands:{commandName:"setThresholdRange",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"]}}}]}},{id:"Shapes",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-shape",label:"Shapes",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircleScissor","SphereScissor","RectangleScissor"],disabledText:"Create new segmentation to enable shapes tool."},options:[{name:"Shape",type:"radio",value:"CircleScissor",id:"shape-mode",values:[{value:"CircleScissor",label:"Circle"},{value:"SphereScissor",label:"Sphere"},{value:"RectangleScissor",label:"Rectangle"}],commands:"setToolActiveToolbar"}]}},{id:"SegmentLabelTool",uiType:"ohif.toolBoxButton",props:{icon:"tool-segment-label",label:"Segment Label Display",tooltip:"Click to show or hide segment labels when hovering with your mouse.",commands:{commandName:"toggleSegmentLabel"},evaluate:["evaluate.cornerstoneTool.toggle",{name:"evaluate.cornerstone.hasSegmentation"}]}}],d={"viewport-0":"rgb(200, 0, 0)","viewport-1":"rgb(200, 200, 0)","viewport-2":"rgb(0, 200, 0)"},c={axial:"rgb(200, 0, 0)",sagittal:"rgb(200, 200, 0)",coronal:"rgb(0, 200, 0)"};function m({utilityModule:e,commandsManager:o}){const{toolNames:t,Enums:a}=e.exports,i={active:[{toolName:t.WindowLevel,bindings:[{mouseButton:a.MouseBindings.Primary}]},{toolName:t.Pan,bindings:[{mouseButton:a.MouseBindings.Auxiliary}]},{toolName:t.Zoom,bindings:[{mouseButton:a.MouseBindings.Secondary},{numTouchPoints:2}]},{toolName:t.StackScroll,bindings:[{mouseButton:a.MouseBindings.Wheel},{numTouchPoints:3}]}],passive:[{toolName:"CircularBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_CIRCLE"}},{toolName:t.LabelmapSlicePropagation},{toolName:t.MarkerLabelmap},{toolName:t.RegionSegmentPlus},{toolName:"CircularEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_CIRCLE"}},{toolName:"SphereBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_SPHERE"}},{toolName:"SphereEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_SPHERE"}},{toolName:"ThresholdCircularBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE"}},{toolName:"ThresholdSphereBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE"}},{toolName:"ThresholdCircularBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE",threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:t.SegmentBidirectional},{toolName:t.SegmentSelect},{toolName:"ThresholdSphereBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE",threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:t.CircleScissors},{toolName:t.RectangleScissors},{toolName:t.SphereScissors},{toolName:t.StackScroll},{toolName:t.Magnify},{toolName:t.WindowLevelRegion},{toolName:t.UltrasoundDirectional}],disabled:[{toolName:t.ReferenceLines},{toolName:t.AdvancedMagnify}]};return o.run("initializeSegmentLabelTool",{tools:i})}const p="@ohif/extension-default.sopClassHandlerModule.stack",h="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",v="@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt",g={"@ohif/extension-default":"^3.0.0","@ohif/extension-cornerstone":"^3.0.0","@ohif/extension-cornerstone-dicom-seg":"^3.0.0","@ohif/extension-cornerstone-dicom-rt":"^3.0.0"},T={id:n,modeFactory:function({modeConfiguration:e}){return{id:n,routeName:"segmentation",displayName:"Segmentation",onModeEnter:({servicesManager:e,extensionManager:o,commandsManager:t})=>{const{measurementService:a,toolbarService:i,toolGroupService:n,customizationService:l}=e.services;a.clearMeasurements(),function(e,o,t){!function(e,o,t){const a=m({commandsManager:t,utilityModule:e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools")});o.createToolGroupAndAddTools("default",a)}(e,o,t),function(e,o,t){const a=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),i=e._servicesManager,{cornerstoneViewportService:n}=i.services,l=m({commandsManager:t,utilityModule:a});l.disabled.push({toolName:a.exports.toolNames.Crosshairs,configuration:{viewportIndicators:!0,viewportIndicatorsConfig:{circleRadius:5,xOffset:.95,yOffset:.05},disableOnPassive:!0,autoPan:{enabled:!1,panSize:10},getReferenceLineColor:e=>{const o=n.getViewportInfo(e),t=o?.viewportOptions;return t?d[t.id]||c[t.orientation]||"#0c0":(console.warn("missing viewport?",e),"#0c0")}}},{toolName:a.exports.toolNames.ReferenceLines}),o.createToolGroupAndAddTools("mpr",l)}(e,o,t),function(e,o){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:a,Enums:i}=t.exports,n={active:[{toolName:a.TrackballRotateTool,bindings:[{mouseButton:i.MouseBindings.Primary}]},{toolName:a.Zoom,bindings:[{mouseButton:i.MouseBindings.Secondary},{numTouchPoints:2}]},{toolName:a.Pan,bindings:[{mouseButton:i.MouseBindings.Auxiliary}]}]};o.createToolGroupAndAddTools("volume3d",n)}(e,o)}(o,n,t),i.register(u),i.updateSection(i.sections.primary,["WindowLevel","Pan","Zoom","TrackballRotate","Capture","Layout","Crosshairs","MoreTools"]),i.updateSection(i.sections.viewportActionMenu.topLeft,["orientationMenu","dataOverlayMenu"]),i.updateSection(i.sections.viewportActionMenu.bottomMiddle,["AdvancedRenderingControls"]),i.updateSection("AdvancedRenderingControls",["windowLevelMenuEmbedded","voiManualControlMenu","Colorbar","opacityMenu","thresholdMenu"]),i.updateSection(i.sections.viewportActionMenu.topRight,["modalityLoadBadge","trackingStatus","navigationComponent"]),i.updateSection(i.sections.viewportActionMenu.bottomLeft,["windowLevelMenu"]),i.updateSection("MoreTools",["Reset","rotate-right","flipHorizontal","ReferenceLines","ImageOverlayViewer","StackScroll","invert","Cine","Magnify","TagBrowser"]),i.updateSection(i.sections.segmentationToolbox,["SegmentationUtilities","SegmentationTools"]),i.updateSection("SegmentationUtilities",["LabelmapSlicePropagation","InterpolateLabelmap","SegmentBidirectional","SegmentLabelTool"]),i.updateSection("SegmentationTools",["BrushTools","MarkerLabelmap","RegionSegmentPlus","Shapes"]),i.updateSection("BrushTools",["Brush","Eraser","Threshold"])},onModeExit:({servicesManager:e})=>{const{toolGroupService:o,syncGroupService:t,segmentationService:a,cornerstoneViewportService:i,uiDialogService:n,uiModalService:l}=e.services;n.hideAll(),l.hide(),o.destroy(),t.destroy(),a.destroy(),i.destroy()},validationTags:{study:[],series:[]},isValidMode:({modalities:e})=>{const o=e.split("\\");return{valid:1!==o.length||!["SM","ECG","OT","DOC"].includes(o[0]),description:"The mode does not support studies that ONLY include the following modalities: SM, OT, DOC"}},routes:[{path:"template",layoutTemplate:({location:e,servicesManager:o})=>({id:"@ohif/extension-default.layoutTemplateModule.viewerLayout",props:{leftPanels:["@ohif/extension-default.panelModule.seriesList"],leftPanelResizable:!0,rightPanels:["@ohif/extension-cornerstone.panelModule.panelSegmentationWithTools"],rightPanelResizable:!0,viewports:[{namespace:"@ohif/extension-cornerstone.viewportModule.cornerstone",displaySetsToDisplay:[p]},{namespace:"@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",displaySetsToDisplay:[h]},{namespace:"@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt",displaySetsToDisplay:[v]}]}})}],extensions:g,hangingProtocol:["@ohif/mnGrid"],sopClassHandlers:[p,h,v]}},extensionDependencies:g};return i})());
1
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("@ohif/core"),require("i18next"),require("@ohif/mode-basic")):"function"==typeof define&&define.amd?define("@ohif/mode-segmentation",["@ohif/core","i18next","@ohif/mode-basic"],o):"object"==typeof exports?exports["@ohif/mode-segmentation"]=o(require("@ohif/core"),require("i18next"),require("@ohif/mode-basic")):e["@ohif/mode-segmentation"]=o(e["@ohif/core"],e.i18next,e["@ohif/mode-basic"])}("undefined"!=typeof self?self:this,(e,o,t)=>(()=>{"use strict";var n={498:o=>{o.exports=e},110:e=>{e.exports=t},310:e=>{e.exports=o}},a={};function i(e){var o=a[e];if(void 0!==o)return o.exports;var t=a[e]={exports:{}};return n[e](t,t.exports,i),t.exports}i.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return i.d(o,{a:o}),o},i.d=(e,o)=>{for(var t in o)i.o(o,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},i.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{default:()=>B,toolbarButtons:()=>g});const l=JSON.parse('{"UU":"@ohif/mode-segmentation"}').UU;var r=i(498),u=i(310),m=i.n(u);const p=.5,c=99.5,d={commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["default","mpr","SRToolGroup","volume3d"]}},h=e=>[{commandName:"setViewportForToolConfiguration",commandOptions:{toolName:e}}],g=[{id:"AdvancedRenderingControls",uiType:"ohif.advancedRenderingControls",props:{buttonSection:!0}},{id:"modalityLoadBadge",uiType:"ohif.modalityLoadBadge",props:{icon:"Status",label:m().t("Buttons:Status"),tooltip:m().t("Buttons:Status"),evaluate:{name:"evaluate.modalityLoadBadge",hideWhenDisabled:!0}}},{id:"navigationComponent",uiType:"ohif.navigationComponent",props:{icon:"Navigation",label:m().t("Buttons:Navigation"),tooltip:m().t("Buttons:Navigate between segments/measurements and manage their visibility"),evaluate:{name:"evaluate.navigationComponent",hideWhenDisabled:!0}}},{id:"trackingStatus",uiType:"ohif.trackingStatus",props:{icon:"TrackingStatus",label:m().t("Buttons:Tracking Status"),tooltip:m().t("Buttons:View and manage tracking status of measurements and annotations"),evaluate:{name:"evaluate.trackingStatus",hideWhenDisabled:!0}}},{id:"dataOverlayMenu",uiType:"ohif.dataOverlayMenu",props:{icon:"ViewportViews",label:m().t("Buttons:Data Overlay"),tooltip:m().t("Buttons:Configure data overlay options and manage foreground/background display sets"),evaluate:"evaluate.dataOverlayMenu"}},{id:"orientationMenu",uiType:"ohif.orientationMenu",props:{icon:"OrientationSwitch",label:m().t("Buttons:Orientation"),tooltip:m().t("Buttons:Change viewport orientation between axial, sagittal, coronal and reformat planes"),evaluate:{name:"evaluate.orientationMenu"}}},{id:"windowLevelMenuEmbedded",uiType:"ohif.windowLevelMenuEmbedded",props:{icon:"WindowLevel",label:m().t("Buttons:Window Level"),tooltip:m().t("Buttons:Adjust window/level presets and customize image contrast settings"),evaluate:{name:"evaluate.windowLevelMenuEmbedded",hideWhenDisabled:!0}}},{id:"windowLevelMenu",uiType:"ohif.windowLevelMenu",props:{icon:"WindowLevel",label:m().t("Buttons:Window Level"),tooltip:m().t("Buttons:Adjust window/level presets and customize image contrast settings"),evaluate:"evaluate.windowLevelMenu"}},{id:"voiManualControlMenu",uiType:"ohif.voiManualControlMenu",props:{icon:"WindowLevelAdvanced",label:m().t("Buttons:Advanced Window Level"),tooltip:m().t("Buttons:Advanced window/level settings with manual controls and presets"),evaluate:"evaluate.voiManualControlMenu"}},{id:"thresholdMenu",uiType:"ohif.thresholdMenu",props:{icon:"Threshold",label:m().t("Buttons:Threshold"),tooltip:m().t("Buttons:Image threshold settings"),evaluate:{name:"evaluate.thresholdMenu",hideWhenDisabled:!0}}},{id:"opacityMenu",uiType:"ohif.opacityMenu",props:{icon:"Opacity",label:m().t("Buttons:Opacity"),tooltip:m().t("Buttons:Image opacity settings"),evaluate:{name:"evaluate.opacityMenu",hideWhenDisabled:!0}}},{id:"Colorbar",uiType:"ohif.colorbar",props:{type:"tool",label:m().t("Buttons:Colorbar")}},{id:"MoreTools",uiType:"ohif.toolButtonList",props:{buttonSection:!0}},{id:"BrushTools",uiType:"ohif.toolBoxButtonGroup",props:{buttonSection:!0}},{id:"LabelMapUtilities",uiType:"ohif.Toolbar",props:{buttonSection:!0}},{id:"ContourUtilities",uiType:"ohif.Toolbar",props:{buttonSection:!0}},{id:"LabelMapTools",uiType:"ohif.toolBoxButtonGroup",props:{buttonSection:!0}},{id:"ContourTools",uiType:"ohif.toolBoxButtonGroup",props:{buttonSection:!0}},{id:"Zoom",uiType:"ohif.toolButton",props:{icon:"tool-zoom",label:m().t("Buttons:Zoom"),commands:d,evaluate:"evaluate.cornerstoneTool"}},{id:"WindowLevel",uiType:"ohif.toolButton",props:{icon:"tool-window-level",label:m().t("Buttons:Window Level"),commands:d,evaluate:"evaluate.cornerstoneTool"}},{id:"Pan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:m().t("Buttons:Pan"),commands:d,evaluate:"evaluate.cornerstoneTool"}},{id:"TrackballRotate",uiType:"ohif.toolButton",props:{type:"tool",icon:"tool-3d-rotate",label:m().t("Buttons:3D Rotate"),commands:d,evaluate:{name:"evaluate.cornerstoneTool",disabledText:m().t("Buttons:Select a 3D viewport to enable this tool")}}},{id:"Capture",uiType:"ohif.toolButton",props:{icon:"tool-capture",label:m().t("Buttons:Capture"),commands:"showDownloadViewportModal",evaluate:["evaluate.action",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["video","wholeSlide"]}]}},{id:"Layout",uiType:"ohif.layoutSelector",props:{rows:3,columns:4,evaluate:"evaluate.action",commands:"setViewportGridLayout"}},{id:"Crosshairs",uiType:"ohif.toolButton",props:{icon:"tool-crosshair",label:m().t("Buttons:Crosshairs"),commands:{commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["mpr"]}},evaluate:{name:"evaluate.cornerstoneTool",disabledText:m().t("Buttons:Select an MPR viewport to enable this tool")}}},{id:"Reset",uiType:"ohif.toolButton",props:{icon:"tool-reset",label:m().t("Buttons:Reset View"),tooltip:m().t("Buttons:Reset View"),commands:"resetViewport",evaluate:"evaluate.action"}},{id:"rotate-right",uiType:"ohif.toolButton",props:{icon:"tool-rotate-right",label:m().t("Buttons:Rotate Right"),tooltip:m().t("Buttons:Rotate +90"),commands:"rotateViewportCW",evaluate:"evaluate.action"}},{id:"flipHorizontal",uiType:"ohif.toolButton",props:{icon:"tool-flip-horizontal",label:m().t("Buttons:Flip Horizontal"),tooltip:m().t("Buttons:Flip Horizontally"),commands:"flipViewportHorizontal",evaluate:["evaluate.viewportProperties.toggle",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"ReferenceLines",uiType:"ohif.toolButton",props:{icon:"tool-referenceLines",label:m().t("Buttons:Reference Lines"),tooltip:m().t("Buttons:Show Reference Lines"),commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"ImageOverlayViewer",uiType:"ohif.toolButton",props:{icon:"toggle-dicom-overlay",label:m().t("Buttons:Image Overlay"),tooltip:m().t("Buttons:Toggle Image Overlay"),commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"StackScroll",uiType:"ohif.toolButton",props:{icon:"tool-stack-scroll",label:m().t("Buttons:Stack Scroll"),tooltip:m().t("Buttons:Stack Scroll"),commands:d,evaluate:"evaluate.cornerstoneTool"}},{id:"invert",uiType:"ohif.toolButton",props:{icon:"tool-invert",label:m().t("Buttons:Invert"),tooltip:m().t("Buttons:Invert Colors"),commands:"invertViewport",evaluate:"evaluate.viewportProperties.toggle"}},{id:"Cine",uiType:"ohif.toolButton",props:{icon:"tool-cine",label:m().t("Buttons:Cine"),tooltip:m().t("Buttons:Cine"),commands:"toggleCine",evaluate:["evaluate.cine",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"Magnify",uiType:"ohif.toolButton",props:{icon:"tool-magnify",label:m().t("Buttons:Zoom-in"),tooltip:m().t("Buttons:Zoom-in"),commands:d,evaluate:"evaluate.cornerstoneTool"}},{id:"TagBrowser",uiType:"ohif.toolButton",props:{icon:"dicom-tag-browser",label:m().t("Buttons:Dicom Tag Browser"),tooltip:m().t("Buttons:Dicom Tag Browser"),commands:"openDICOMTagViewer"}},{id:"PlanarFreehandContourSegmentationTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-freehand-roi",label:m().t("Buttons:Freehand Segmentation"),tooltip:m().t("Buttons:Freehand Segmentation"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["PlanarFreehandContourSegmentationTool"],disabledText:m().t("Buttons:Create new segmentation to enable this tool.")},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Contour"}],commands:[{commandName:"setToolActiveToolbar",commandOptions:{bindings:[{mouseButton:1},{mouseButton:1,modifierKey:16}]}},{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Contour"}}],options:[{name:m().t("Buttons:Interpolate Contours"),type:"switch",id:"planarFreehandInterpolateContours",value:!1,commands:{commandName:"setInterpolationToolConfiguration"}}]}},{id:"LivewireContourSegmentationTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-livewire",label:m().t("Buttons:Livewire Contour"),tooltip:m().t("Buttons:Livewire Contour"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["LivewireContourSegmentationTool"],disabledText:m().t("Buttons:Create new segmentation to enable this tool.")},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Contour"}],commands:[{commandName:"setToolActiveToolbar",commandOptions:{bindings:[{mouseButton:1},{mouseButton:1,modifierKey:16}]}},{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Contour"}}],options:[{name:m().t("Buttons:Interpolate Contours"),type:"switch",id:"livewireInterpolateContours",value:!1,commands:{commandName:"setInterpolationToolConfiguration"}}]}},{id:"SplineContourSegmentationTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-spline-roi",label:m().t("Buttons:Spline Contour Segmentation Tool"),tooltip:m().t("Buttons:Spline Contour Segmentation Tool"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["CatmullRomSplineROI","LinearSplineROI","BSplineROI"],disabledText:m().t("Buttons:Create new segmentation to enable this tool.")},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Contour"}],commands:[{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Contour"}}],options:[{name:m().t("Buttons:Spline Type"),type:"select",id:"splineTypeSelect",value:"CatmullRomSplineROI",values:[{id:"CatmullRomSplineROI",value:"CatmullRomSplineROI",label:m().t("Buttons:Catmull Rom Spline")},{id:"LinearSplineROI",value:"LinearSplineROI",label:m().t("Buttons:Linear Spline")},{id:"BSplineROI",value:"BSplineROI",label:m().t("Buttons:B-Spline")}],commands:{commandName:"setToolActiveToolbar",commandOptions:{bindings:[{mouseButton:1},{mouseButton:1,modifierKey:16}]}}},{name:m().t("Buttons:Simplified Spline"),type:"switch",id:"simplifiedSpline",value:!0,commands:{commandName:"setSimplifiedSplineForSplineContourSegmentationTool"}},{name:m().t("Buttons:Interpolate Contours"),type:"switch",id:"splineInterpolateContours",value:!1,commands:{commandName:"setInterpolationToolConfiguration",commandOptions:{toolNames:["CatmullRomSplineROI","LinearSplineROI","BSplineROI"]}}}]}},{id:"SculptorTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-sculptor",label:m().t("Buttons:Sculptor Tool"),tooltip:m().t("Buttons:Sculptor Tool"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["SculptorTool"],disabledText:m().t("Buttons:Create new segmentation to enable this tool.")},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Contour"}],commands:["setToolActiveToolbar",{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Contour"}}],options:[{name:m().t("Buttons:Dynamic Cursor Size"),type:"switch",id:"dynamicCursorSize",value:!0,commands:{commandName:"setDynamicCursorSizeForSculptorTool"}}]}},{id:"Brush",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-brush",label:m().t("Buttons:Brush"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["CircularBrush","SphereBrush"],disabledText:m().t("Buttons:Create new segmentation to enable this tool.")},{name:"evaluate.cornerstone.segmentation.synchronizeDrawingRadius",radiusOptionId:"brush-radius"},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],commands:{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}},options:[{name:m().t("Buttons:Radius (mm)"),id:"brush-radius",type:"range",explicitRunOnly:!0,min:p,max:c,step:.5,value:25,commands:[{commandName:"setBrushSize",commandOptions:{toolNames:["CircularBrush","SphereBrush"]}}]},{name:m().t("Buttons:Shape"),type:"radio",id:"brush-mode",value:"CircularBrush",values:[{value:"CircularBrush",label:m().t("Buttons:Circle")},{value:"SphereBrush",label:m().t("Buttons:Sphere")}],commands:["setToolActiveToolbar"]}]}},{id:"InterpolateLabelmap",uiType:"ohif.toolButton",props:{icon:"actions-interpolate",label:m().t("Buttons:Interpolate Labelmap"),tooltip:m().t("Buttons:Automatically fill in missing slices between drawn segments. Use brush or threshold tools on at least two slices, then click to interpolate across slices. Works in any direction. Volume must be reconstructable."),evaluate:[{name:"evaluate.cornerstone.segmentation"},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"},{name:"evaluate.displaySetIsReconstructable",disabledText:m().t("Buttons:The current viewport cannot handle interpolation.")}],commands:[{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}},"interpolateLabelmap"]}},{id:"SegmentBidirectional",uiType:"ohif.toolButton",props:{icon:"actions-bidirectional",label:m().t("Buttons:Segment Bidirectional"),tooltip:m().t("Buttons:Automatically detects the largest length and width across slices for the selected segment and displays a bidirectional measurement."),evaluate:[{name:"evaluate.cornerstone.segmentation",disabledText:m().t("Buttons:Create new segmentation to enable this tool.")},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],commands:[{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}},"runSegmentBidirectional"]}},{id:"RegionSegmentPlus",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-click-segment",label:m().t("Buttons:One Click Segment"),tooltip:m().t("Buttons:Detects segmentable regions with one click. Hover for visual feedback—click when a plus sign appears to auto-segment the lesion."),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["RegionSegmentPlus"],disabledText:m().t("Buttons:Create new segmentation to enable this tool.")},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],commands:["setToolActiveToolbar",{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}}]}},{id:"LabelmapSlicePropagation",uiType:"ohif.toolBoxButton",props:{icon:"icon-labelmap-slice-propagation",label:m().t("Buttons:Labelmap Assist"),tooltip:m().t("Buttons:Toggle AI assistance for segmenting nearby slices. After drawing on a slice, scroll to preview predictions. Press Enter to accept or Esc to skip."),evaluate:["evaluate.cornerstoneTool.toggle",{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],listeners:{[r.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:h("LabelmapSlicePropagation"),[r.ViewportGridService.EVENTS.VIEWPORTS_READY]:h("LabelmapSlicePropagation")},commands:[{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}},"toggleEnabledDisabledToolbar"]}},{id:"MarkerLabelmap",uiType:"ohif.toolBoxButton",props:{icon:"icon-marker-labelmap",label:m().t("Buttons:Marker Guided Labelmap"),tooltip:m().t("Buttons:Use include/exclude markers to guide AI (SAM) segmentation. Click to place markers, Enter to accept results, Esc to reject, and N to go to the next slice while keeping markers."),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["MarkerLabelmap","MarkerInclude","MarkerExclude"]},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],commands:["setToolActiveToolbar",{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}}],listeners:{[r.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:h("MarkerLabelmap"),[r.ViewportGridService.EVENTS.VIEWPORTS_READY]:h("MarkerLabelmap")},options:[{name:m().t("Buttons:Marker Mode"),type:"radio",id:"marker-mode",value:"markerInclude",values:[{value:"markerInclude",label:m().t("Buttons:Include")},{value:"markerExclude",label:m().t("Buttons:Exclude")}],commands:({commandsManager:e,options:o})=>{"markerInclude"===o.find(e=>"marker-mode"===e.id).value?e.run("setToolActive",{toolName:"MarkerInclude"}):e.run("setToolActive",{toolName:"MarkerExclude"})}},{name:m().t("Buttons:Clear Markers"),type:"button",id:"clear-markers",commands:"clearMarkersForMarkerLabelmap"}]}},{id:"Eraser",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-eraser",label:m().t("Buttons:Eraser"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["CircularEraser","SphereEraser"]},{name:"evaluate.cornerstone.segmentation.synchronizeDrawingRadius",radiusOptionId:"eraser-radius"},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],options:[{name:m().t("Buttons:Radius (mm)"),id:"eraser-radius",type:"range",explicitRunOnly:!0,min:p,max:c,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["CircularEraser","SphereEraser"]}}},{name:m().t("Buttons:Shape"),type:"radio",id:"eraser-mode",value:"CircularEraser",values:[{value:"CircularEraser",label:m().t("Buttons:Circle")},{value:"SphereEraser",label:m().t("Buttons:Sphere")}],commands:"setToolActiveToolbar"}],commands:{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}}}},{id:"Threshold",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-threshold",label:m().t("Buttons:Threshold Tool"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["ThresholdCircularBrush","ThresholdSphereBrush","ThresholdCircularBrushDynamic","ThresholdSphereBrushDynamic"]},{name:"evaluate.cornerstone.segmentation.synchronizeDrawingRadius",radiusOptionId:"threshold-radius"},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],commands:{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}},options:[{name:m().t("Buttons:Radius (mm)"),id:"threshold-radius",type:"range",explicitRunOnly:!0,min:p,max:c,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush","ThresholdCircularBrushDynamic","ThresholdSphereBrushDynamic"]}}},{name:m().t("Buttons:Shape"),type:"radio",id:"threshold-shape",value:"ThresholdCircularBrush",values:[{value:"ThresholdCircularBrush",label:m().t("Buttons:Circle")},{value:"ThresholdSphereBrush",label:m().t("Buttons:Sphere")}],commands:({value:e,commandsManager:o,options:t})=>{"ThresholdDynamic"===t.find(e=>"dynamic-mode"===e.id).value?o.run("setToolActive",{toolName:"ThresholdCircularBrush"===e?"ThresholdCircularBrushDynamic":"ThresholdSphereBrushDynamic"}):o.run("setToolActive",{toolName:e})}},{name:m().t("Buttons:Threshold"),type:"radio",id:"dynamic-mode",value:"ThresholdDynamic",values:[{value:"ThresholdDynamic",label:m().t("Buttons:Dynamic")},{value:"ThresholdRange",label:m().t("Buttons:Range")}],commands:({value:e,commandsManager:o,options:t})=>{const n=t.find(e=>"threshold-shape"===e.id);if("ThresholdDynamic"===e)o.run("setToolActiveToolbar",{toolName:"ThresholdCircularBrush"===n.value?"ThresholdCircularBrushDynamic":"ThresholdSphereBrushDynamic"});else{o.run("setToolActiveToolbar",{toolName:n.value});const e=t.find(e=>"threshold-range"===e.id).value;o.run("setThresholdRange",{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"],value:e})}}},{name:"ThresholdRange",type:"double-range",id:"threshold-range",min:-1e3,max:1e3,step:1,value:[50,600],condition:({options:e})=>"ThresholdRange"===e.find(e=>"dynamic-mode"===e.id).value,commands:{commandName:"setThresholdRange",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"]}}}]}},{id:"Shapes",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-shape",label:m().t("Buttons:Shapes"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["CircleScissor","SphereScissor","RectangleScissor"],disabledText:m().t("Buttons:Create new segmentation to enable shapes tool.")},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],commands:{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}},options:[{name:m().t("Buttons:Shape"),type:"radio",value:"CircleScissor",id:"shape-mode",values:[{value:"CircleScissor",label:m().t("Buttons:Circle")},{value:"SphereScissor",label:m().t("Buttons:Sphere")},{value:"RectangleScissor",label:m().t("Buttons:Rectangle")}],commands:"setToolActiveToolbar"}]}},{id:"SimplifyContours",uiType:"ohif.toolButton",props:{icon:"actions-simplify",label:"Simplify Contours",tooltip:"Simplify Contours",commands:["toggleActiveSegmentationUtility"],evaluate:[{name:"cornerstone.isActiveSegmentationUtility"}],options:"cornerstone.SimplifyContourOptions"}},{id:"SmoothContours",uiType:"ohif.toolButton",props:{icon:"actions-smooth",label:"Smooth Contours",tooltip:"Smooth Contours",commands:["toggleActiveSegmentationUtility"],evaluate:[{name:"cornerstone.isActiveSegmentationUtility"}],options:"cornerstone.SmoothContoursOptions"}},{id:"LogicalContourOperations",uiType:"ohif.toolButton",props:{icon:"actions-combine",label:"Combine Contours",tooltip:"Combine Contours",commands:["toggleActiveSegmentationUtility"],evaluate:[{name:"cornerstone.isActiveSegmentationUtility"}],options:"cornerstone.LogicalContourOperationsOptions"}},{id:"LabelMapEditWithContour",uiType:"ohif.toolBoxButton",props:{icon:"tool-labelmap-edit-with-contour",label:m().t("Buttons:Labelmap Edit with Contour Tool"),tooltip:m().t("Buttons:Labelmap Edit with Contour Tool"),commands:["setToolActiveToolbar",{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}}],evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["LabelMapEditWithContour"],disabledText:"Create new segmentation to enable this tool."},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}]}}],v=g,T={"viewport-0":"rgb(200, 0, 0)","viewport-1":"rgb(200, 200, 0)","viewport-2":"rgb(0, 200, 0)"},S={axial:"rgb(200, 0, 0)",sagittal:"rgb(200, 200, 0)",coronal:"rgb(0, 200, 0)"};function y({utilityModule:e,commandsManager:o}){const{toolNames:t,Enums:n}=e.exports,a={active:[{toolName:t.WindowLevel,bindings:[{mouseButton:n.MouseBindings.Primary}]},{toolName:t.Pan,bindings:[{mouseButton:n.MouseBindings.Auxiliary}]},{toolName:t.Zoom,bindings:[{mouseButton:n.MouseBindings.Secondary},{numTouchPoints:2}]},{toolName:t.StackScroll,bindings:[{mouseButton:n.MouseBindings.Wheel},{numTouchPoints:3}]}],passive:[{toolName:"CircularBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_CIRCLE",minRadius:p,maxRadius:c}},{toolName:t.LabelmapSlicePropagation},{toolName:t.MarkerLabelmap},{toolName:t.RegionSegmentPlus},{toolName:"CircularEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_CIRCLE",minRadius:p,maxRadius:c}},{toolName:"SphereBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_SPHERE",minRadius:p,maxRadius:c}},{toolName:"SphereEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_SPHERE",minRadius:p,maxRadius:c}},{toolName:"ThresholdCircularBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE",minRadius:p,maxRadius:c}},{toolName:"ThresholdSphereBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE",minRadius:p,maxRadius:c}},{toolName:"ThresholdCircularBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE",minRadius:p,maxRadius:c,threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:t.SegmentBidirectional},{toolName:t.SegmentSelect},{toolName:"ThresholdSphereBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE",minRadius:p,maxRadius:c,threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:t.LabelMapEditWithContourTool},{toolName:t.CircleScissors},{toolName:t.RectangleScissors},{toolName:t.SphereScissors},{toolName:t.StackScroll},{toolName:t.Magnify},{toolName:t.WindowLevelRegion},{toolName:t.UltrasoundDirectional},{toolName:t.PlanarFreehandContourSegmentation},{toolName:t.LivewireContourSegmentation},{toolName:t.SculptorTool},{toolName:t.PlanarFreehandROI},{toolName:"CatmullRomSplineROI",parentTool:t.SplineContourSegmentation,configuration:{spline:{type:"CATMULLROM",enableTwoPointPreview:!0}}},{toolName:"LinearSplineROI",parentTool:t.SplineContourSegmentation,configuration:{spline:{type:"LINEAR",enableTwoPointPreview:!0}}},{toolName:"BSplineROI",parentTool:t.SplineContourSegmentation,configuration:{spline:{type:"BSPLINE",enableTwoPointPreview:!0}}}],disabled:[{toolName:t.ReferenceLines},{toolName:t.AdvancedMagnify}]};return o.run("initializeSegmentLabelTool",{tools:a})}var b=i(110);const B={id:l,modeFactory:function({modeConfiguration:e}){const o=[];return{id:l,routeName:"segmentation",displayName:"Segmentation",onModeEnter:({servicesManager:e,extensionManager:t,commandsManager:n})=>{const{measurementService:a,toolbarService:i,toolGroupService:s,segmentationService:l,viewportGridService:r,panelService:u}=e.services;a.clearMeasurements(),function(e,o,t){!function(e,o,t){const n=y({commandsManager:t,utilityModule:e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools")});o.createToolGroupAndAddTools("default",n)}(e,o,t),function(e,o,t){const n=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),a=e._servicesManager,{cornerstoneViewportService:i}=a.services,s=y({commandsManager:t,utilityModule:n});s.disabled.push({toolName:n.exports.toolNames.Crosshairs,configuration:{viewportIndicators:!0,viewportIndicatorsConfig:{circleRadius:5,xOffset:.95,yOffset:.05},disableOnPassive:!0,autoPan:{enabled:!1,panSize:10},getReferenceLineColor:e=>{const o=i.getViewportInfo(e),t=o?.viewportOptions;return t?T[t.id]||S[t.orientation]||"#0c0":(console.warn("missing viewport?",e),"#0c0")}}},{toolName:n.exports.toolNames.ReferenceLines}),o.createToolGroupAndAddTools("mpr",s)}(e,o,t),function(e,o){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:n,Enums:a}=t.exports,i={active:[{toolName:n.TrackballRotateTool,bindings:[{mouseButton:a.MouseBindings.Primary}]},{toolName:n.Zoom,bindings:[{mouseButton:a.MouseBindings.Secondary},{numTouchPoints:2}]},{toolName:n.Pan,bindings:[{mouseButton:a.MouseBindings.Auxiliary}]}]};o.createToolGroupAndAddTools("volume3d",i)}(e,o)}(t,s,n),i.register(v),i.updateSection(i.sections.primary,["WindowLevel","Pan","Zoom","TrackballRotate","Capture","Layout","Crosshairs","MoreTools"]),i.updateSection(i.sections.viewportActionMenu.topLeft,["orientationMenu","dataOverlayMenu"]),i.updateSection(i.sections.viewportActionMenu.bottomMiddle,["AdvancedRenderingControls"]),i.updateSection("AdvancedRenderingControls",["windowLevelMenuEmbedded","voiManualControlMenu","Colorbar","opacityMenu","thresholdMenu"]),i.updateSection(i.sections.viewportActionMenu.topRight,["modalityLoadBadge","trackingStatus","navigationComponent"]),i.updateSection(i.sections.viewportActionMenu.bottomLeft,["windowLevelMenu"]),i.updateSection("MoreTools",["Reset","rotate-right","flipHorizontal","ReferenceLines","ImageOverlayViewer","StackScroll","invert","Cine","Magnify","TagBrowser"]),i.updateSection(i.sections.labelMapSegmentationToolbox,["LabelMapTools"]),i.updateSection(i.sections.contourSegmentationToolbox,["ContourTools"]),i.updateSection("LabelMapTools",["LabelmapSlicePropagation","BrushTools","MarkerLabelmap","RegionSegmentPlus","Shapes","LabelMapEditWithContour"]),i.updateSection("ContourTools",["PlanarFreehandContourSegmentationTool","SculptorTool","SplineContourSegmentationTool","LivewireContourSegmentationTool"]),i.updateSection(i.sections.labelMapSegmentationUtilities,["LabelMapUtilities"]),i.updateSection(i.sections.contourSegmentationUtilities,["ContourUtilities"]),i.updateSection("LabelMapUtilities",["InterpolateLabelmap","SegmentBidirectional"]),i.updateSection("ContourUtilities",["LogicalContourOperations","SimplifyContours","SmoothContours"]),i.updateSection("BrushTools",["Brush","Eraser","Threshold"]);const{unsubscribeAutoTabSwitchEvents:m}=function({segmentationService:e,viewportGridService:o,panelService:t}){const n=[e.EVENTS.SEGMENTATION_MODIFIED,e.EVENTS.SEGMENTATION_REPRESENTATION_MODIFIED];let a=!0;return{unsubscribeAutoTabSwitchEvents:n.map(n=>e.subscribe(n,()=>{if(!e.getSegmentations().length)return void(a=!0);const n=o.getActiveViewportId(),i=e.getSegmentationRepresentations(n)?.find(e=>e.active);if(i&&a)switch(a=!1,i.type){case"Labelmap":t.activatePanel("@ohif/extension-cornerstone.panelModule.panelSegmentationWithToolsLabelMap",!0);break;case"Contour":t.activatePanel("@ohif/extension-cornerstone.panelModule.panelSegmentationWithToolsContour",!0)}})).map(e=>e.unsubscribe)}}({segmentationService:l,viewportGridService:r,panelService:u});o.push(...m)},onModeExit:({servicesManager:e})=>{const{toolGroupService:t,syncGroupService:n,segmentationService:a,cornerstoneViewportService:i,uiDialogService:s,uiModalService:l}=e.services;o.forEach(e=>e()),o.length=0,s.hideAll(),l.hide(),t.destroy(),n.destroy(),a.destroy(),i.destroy()},validationTags:{study:[],series:[]},isValidMode:({modalities:e})=>{const o=e.split("\\");return{valid:1!==o.length||!["SM","ECG","OT","DOC"].includes(o[0]),description:"The mode does not support studies that ONLY include the following modalities: SM, OT, DOC"}},routes:[{path:"template",layoutTemplate:({location:e,servicesManager:o})=>({id:b.ohif.layout,props:{leftPanels:[b.ohif.thumbnailList],leftPanelResizable:!0,rightPanels:[b.cornerstone.labelMapSegmentationPanel,b.cornerstone.contourSegmentationPanel],rightPanelResizable:!0,viewports:[{namespace:b.cornerstone.viewport,displaySetsToDisplay:[b.ohif.sopClassHandler]},{namespace:b.segmentation.viewport,displaySetsToDisplay:[b.segmentation.sopClassHandler]},{namespace:b.dicomRT.viewport,displaySetsToDisplay:[b.dicomRT.sopClassHandler]}]}})}],extensions:b.extensionDependencies,hangingProtocol:["@ohif/mnGrid"],sopClassHandlers:[b.ohif.sopClassHandler,b.segmentation.sopClassHandler,b.dicomRT.sopClassHandler]}},extensionDependencies:b.extensionDependencies};return s})());
2
2
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,eACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,0BAA2B,CA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AgBG,SACX,CAAC,KAAM,MAAO,KAAM,OAAOC,SAASJ,EAAgB,IAE3DK,YACE,8FAeNC,OAAQ,CACN,CACEC,KAAM,WACNC,eAAgBA,EAAGC,WAAUrE,sBACpB,CACL7F,GA1LF,4DA2LES,MAAO,CACL0J,WAAY,CAzLb,kDA0LCC,oBAAoB,EACpBC,YAAa,CAtLd,sEAuLCC,qBAAqB,EAErBC,UAAW,CACT,CACEC,UA5LN,yDA6LMC,qBAAsB,CAACrF,IAEzB,CACEoF,UAzLN,iEA0LMC,qBAAsB,CAACpF,IAEzB,CACEmF,UAzLN,+DA0LMC,qBAAsB,CAACnF,UASrCoF,WAAYnF,EAIZoF,gBAAiB,CAAC,gBAElBC,iBAAkB,CAACxF,EAAsBC,EAA8BC,GAE3E,EAKEC,yB","sources":["webpack://@ohif/mode-segmentation/webpack/universalModuleDefinition","webpack://@ohif/mode-segmentation/external umd {\"commonjs2\":\"@ohif/core\",\"commonjs\":\"@ohif/core\",\"amd\":\"@ohif/core\",\"root\":\"@ohif/core\"}","webpack://@ohif/mode-segmentation/webpack/bootstrap","webpack://@ohif/mode-segmentation/webpack/runtime/define property getters","webpack://@ohif/mode-segmentation/webpack/runtime/hasOwnProperty shorthand","webpack://@ohif/mode-segmentation/webpack/runtime/make namespace object","webpack://@ohif/mode-segmentation/./src/id.js","webpack://@ohif/mode-segmentation/./src/toolbarButtons.ts","webpack://@ohif/mode-segmentation/./src/initToolGroups.ts","webpack://@ohif/mode-segmentation/./src/index.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@ohif/core\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@ohif/mode-segmentation\", [\"@ohif/core\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@ohif/mode-segmentation\"] = factory(require(\"@ohif/core\"));\n\telse\n\t\troot[\"@ohif/mode-segmentation\"] = factory(root[\"@ohif/core\"]);\n})(typeof self !== 'undefined' ? self : this, (__WEBPACK_EXTERNAL_MODULE__498__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__498__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import packageJson from '../package.json';\n\nconst id = packageJson.name;\n\nexport { id };\n","import type { Button } from '@ohif/core/types';\nimport { ViewportGridService } from '@ohif/core';\n\nconst setToolActiveToolbar = {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],\n },\n};\n\nconst callbacks = (toolName: string) => [\n {\n commandName: 'setViewportForToolConfiguration',\n commandOptions: {\n toolName,\n },\n },\n];\n\nconst toolbarButtons: Button[] = [\n {\n id: 'AdvancedRenderingControls',\n uiType: 'ohif.advancedRenderingControls',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'modalityLoadBadge',\n uiType: 'ohif.modalityLoadBadge',\n props: {\n icon: 'Status',\n label: 'Status',\n tooltip: 'Status',\n evaluate: {\n name: 'evaluate.modalityLoadBadge',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'navigationComponent',\n uiType: 'ohif.navigationComponent',\n props: {\n icon: 'Navigation',\n label: 'Navigation',\n tooltip: 'Navigate between segments/measurements and manage their visibility',\n evaluate: {\n name: 'evaluate.navigationComponent',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'trackingStatus',\n uiType: 'ohif.trackingStatus',\n props: {\n icon: 'TrackingStatus',\n label: 'Tracking Status',\n tooltip: 'View and manage tracking status of measurements and annotations',\n evaluate: {\n name: 'evaluate.trackingStatus',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'dataOverlayMenu',\n uiType: 'ohif.dataOverlayMenu',\n props: {\n icon: 'ViewportViews',\n label: 'Data Overlay',\n tooltip: 'Configure data overlay options and manage foreground/background display sets',\n evaluate: 'evaluate.dataOverlayMenu',\n },\n },\n {\n id: 'orientationMenu',\n uiType: 'ohif.orientationMenu',\n props: {\n icon: 'OrientationSwitch',\n label: 'Orientation',\n tooltip: 'Change viewport orientation between axial, sagittal, coronal and reformat planes',\n evaluate: {\n name: 'evaluate.orientationMenu',\n // hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'windowLevelMenuEmbedded',\n uiType: 'ohif.windowLevelMenuEmbedded',\n props: {\n icon: 'WindowLevel',\n label: 'Window Level',\n tooltip: 'Adjust window/level presets and customize image contrast settings',\n evaluate: {\n name: 'evaluate.windowLevelMenuEmbedded',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'windowLevelMenu',\n uiType: 'ohif.windowLevelMenu',\n props: {\n icon: 'WindowLevel',\n label: 'Window Level',\n tooltip: 'Adjust window/level presets and customize image contrast settings',\n evaluate: 'evaluate.windowLevelMenu',\n },\n },\n {\n id: 'voiManualControlMenu',\n uiType: 'ohif.voiManualControlMenu',\n props: {\n icon: 'WindowLevelAdvanced',\n label: 'Advanced Window Level',\n tooltip: 'Advanced window/level settings with manual controls and presets',\n evaluate: 'evaluate.voiManualControlMenu',\n },\n },\n {\n id: 'thresholdMenu',\n uiType: 'ohif.thresholdMenu',\n props: {\n icon: 'Threshold',\n label: 'Threshold',\n tooltip: 'Image threshold settings',\n evaluate: {\n name: 'evaluate.thresholdMenu',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'opacityMenu',\n uiType: 'ohif.opacityMenu',\n props: {\n icon: 'Opacity',\n label: 'Opacity',\n tooltip: 'Image opacity settings',\n evaluate: {\n name: 'evaluate.opacityMenu',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'Colorbar',\n uiType: 'ohif.colorbar',\n props: {\n type: 'tool',\n label: 'Colorbar',\n },\n },\n // sections\n {\n id: 'MoreTools',\n uiType: 'ohif.toolButtonList',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'BrushTools',\n uiType: 'ohif.toolBoxButtonGroup',\n props: {\n buttonSection: true,\n },\n },\n // Section containers for the nested toolbox\n {\n id: 'SegmentationUtilities',\n uiType: 'ohif.toolBoxButton',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'SegmentationTools',\n uiType: 'ohif.toolBoxButton',\n props: {\n buttonSection: true,\n },\n },\n // tool defs\n {\n id: 'Zoom',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-zoom',\n label: 'Zoom',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'WindowLevel',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-window-level',\n label: 'Window Level',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'Pan',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-move',\n label: 'Pan',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'TrackballRotate',\n uiType: 'ohif.toolButton',\n props: {\n type: 'tool',\n icon: 'tool-3d-rotate',\n label: '3D Rotate',\n commands: setToolActiveToolbar,\n evaluate: {\n name: 'evaluate.cornerstoneTool',\n disabledText: 'Select a 3D viewport to enable this tool',\n },\n },\n },\n {\n id: 'Capture',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-capture',\n label: 'Capture',\n commands: 'showDownloadViewportModal',\n evaluate: [\n 'evaluate.action',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['video', 'wholeSlide'],\n },\n ],\n },\n },\n {\n id: 'Layout',\n uiType: 'ohif.layoutSelector',\n props: {\n rows: 3,\n columns: 4,\n evaluate: 'evaluate.action',\n commands: 'setViewportGridLayout',\n },\n },\n {\n id: 'Crosshairs',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-crosshair',\n label: 'Crosshairs',\n commands: {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['mpr'],\n },\n },\n evaluate: {\n name: 'evaluate.cornerstoneTool',\n disabledText: 'Select an MPR viewport to enable this tool',\n },\n },\n },\n {\n id: 'Reset',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-reset',\n label: 'Reset View',\n tooltip: 'Reset View',\n commands: 'resetViewport',\n evaluate: 'evaluate.action',\n },\n },\n {\n id: 'rotate-right',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-rotate-right',\n label: 'Rotate Right',\n tooltip: 'Rotate +90',\n commands: 'rotateViewportCW',\n evaluate: 'evaluate.action',\n },\n },\n {\n id: 'flipHorizontal',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-flip-horizontal',\n label: 'Flip Horizontal',\n tooltip: 'Flip Horizontally',\n commands: 'flipViewportHorizontal',\n evaluate: [\n 'evaluate.viewportProperties.toggle',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['volume3d'],\n },\n ],\n },\n },\n {\n id: 'ReferenceLines',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-referenceLines',\n label: 'Reference Lines',\n tooltip: 'Show Reference Lines',\n commands: 'toggleEnabledDisabledToolbar',\n evaluate: 'evaluate.cornerstoneTool.toggle',\n },\n },\n {\n id: 'ImageOverlayViewer',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'toggle-dicom-overlay',\n label: 'Image Overlay',\n tooltip: 'Toggle Image Overlay',\n commands: 'toggleEnabledDisabledToolbar',\n evaluate: 'evaluate.cornerstoneTool.toggle',\n },\n },\n {\n id: 'StackScroll',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-stack-scroll',\n label: 'Stack Scroll',\n tooltip: 'Stack Scroll',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'invert',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-invert',\n label: 'Invert',\n tooltip: 'Invert Colors',\n commands: 'invertViewport',\n evaluate: 'evaluate.viewportProperties.toggle',\n },\n },\n {\n id: 'Cine',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-cine',\n label: 'Cine',\n tooltip: 'Cine',\n commands: 'toggleCine',\n evaluate: [\n 'evaluate.cine',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['volume3d'],\n },\n ],\n },\n },\n {\n id: 'Magnify',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-magnify',\n label: 'Zoom-in',\n tooltip: 'Zoom-in',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'TagBrowser',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'dicom-tag-browser',\n label: 'Dicom Tag Browser',\n tooltip: 'Dicom Tag Browser',\n commands: 'openDICOMTagViewer',\n },\n },\n\n {\n id: 'Brush',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-brush',\n label: 'Brush',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircularBrush', 'SphereBrush'],\n disabledText: 'Create new segmentation to enable this tool.',\n },\n options: [\n {\n name: 'Radius (mm)',\n id: 'brush-radius',\n type: 'range',\n min: 0.5,\n max: 99.5,\n step: 0.5,\n value: 25,\n commands: {\n commandName: 'setBrushSize',\n commandOptions: { toolNames: ['CircularBrush', 'SphereBrush'] },\n },\n },\n {\n name: 'Shape',\n type: 'radio',\n id: 'brush-mode',\n value: 'CircularBrush',\n values: [\n { value: 'CircularBrush', label: 'Circle' },\n { value: 'SphereBrush', label: 'Sphere' },\n ],\n commands: 'setToolActiveToolbar',\n },\n ],\n },\n },\n {\n id: 'InterpolateLabelmap',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-interpolation',\n label: 'Interpolate Labelmap',\n tooltip:\n 'Automatically fill in missing slices between drawn segments. Use brush or threshold tools on at least two slices, then click to interpolate across slices. Works in any direction. Volume must be reconstructable.',\n evaluate: [\n 'evaluate.cornerstone.segmentation',\n {\n name: 'evaluate.displaySetIsReconstructable',\n disabledText: 'The current viewport cannot handle interpolation.',\n },\n ],\n commands: 'interpolateLabelmap',\n },\n },\n {\n id: 'SegmentBidirectional',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-bidirectional-segment',\n label: 'Segment Bidirectional',\n tooltip:\n 'Automatically detects the largest length and width across slices for the selected segment and displays a bidirectional measurement.',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n disabledText: 'Create new segmentation to enable this tool.',\n },\n commands: 'runSegmentBidirectional',\n },\n },\n {\n id: 'RegionSegmentPlus',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-click-segment',\n label: 'One Click Segment',\n tooltip:\n 'Detects segmentable regions with one click. Hover for visual feedback—click when a plus sign appears to auto-segment the lesion.',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['RegionSegmentPlus'],\n disabledText: 'Create new segmentation to enable this tool.',\n },\n commands: 'setToolActiveToolbar',\n },\n },\n {\n id: 'LabelmapSlicePropagation',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-labelmap-slice-propagation',\n label: 'Labelmap Assist',\n tooltip:\n 'Toggle AI assistance for segmenting nearby slices. After drawing on a slice, scroll to preview predictions. Press Enter to accept or Esc to skip.',\n evaluate: [\n 'evaluate.cornerstoneTool.toggle',\n {\n name: 'evaluate.cornerstone.hasSegmentation',\n },\n ],\n listeners: {\n [ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks(\n 'LabelmapSlicePropagation'\n ),\n [ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('LabelmapSlicePropagation'),\n },\n commands: 'toggleEnabledDisabledToolbar',\n },\n },\n {\n id: 'MarkerLabelmap',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-marker-labelmap',\n label: 'Marker Guided Labelmap',\n tooltip:\n 'Use include/exclude markers to guide AI (SAM) segmentation. Click to place markers, Enter to accept results, Esc to reject, and N to go to the next slice while keeping markers.',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['MarkerLabelmap', 'MarkerInclude', 'MarkerExclude'],\n },\n ],\n commands: 'setToolActiveToolbar',\n listeners: {\n [ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks('MarkerLabelmap'),\n [ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('MarkerLabelmap'),\n },\n options: [\n {\n name: 'Marker Mode',\n type: 'radio',\n id: 'marker-mode',\n value: 'markerInclude',\n values: [\n { value: 'markerInclude', label: 'Include' },\n { value: 'markerExclude', label: 'Exclude' },\n ],\n commands: ({ commandsManager, options }) => {\n const markerModeOption = options.find(option => option.id === 'marker-mode');\n if (markerModeOption.value === 'markerInclude') {\n commandsManager.run('setToolActive', {\n toolName: 'MarkerInclude',\n });\n } else {\n commandsManager.run('setToolActive', {\n toolName: 'MarkerExclude',\n });\n }\n },\n },\n {\n name: 'Clear Markers',\n type: 'button',\n id: 'clear-markers',\n commands: 'clearMarkersForMarkerLabelmap',\n },\n ],\n },\n },\n {\n id: 'Eraser',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-eraser',\n label: 'Eraser',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircularEraser', 'SphereEraser'],\n },\n options: [\n {\n name: 'Radius (mm)',\n id: 'eraser-radius',\n type: 'range',\n min: 0.5,\n max: 99.5,\n step: 0.5,\n value: 25,\n commands: {\n commandName: 'setBrushSize',\n commandOptions: { toolNames: ['CircularEraser', 'SphereEraser'] },\n },\n },\n {\n name: 'Shape',\n type: 'radio',\n id: 'eraser-mode',\n value: 'CircularEraser',\n values: [\n { value: 'CircularEraser', label: 'Circle' },\n { value: 'SphereEraser', label: 'Sphere' },\n ],\n commands: 'setToolActiveToolbar',\n },\n ],\n },\n },\n {\n id: 'Threshold',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-threshold',\n label: 'Threshold Tool',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: [\n 'ThresholdCircularBrush',\n 'ThresholdSphereBrush',\n 'ThresholdCircularBrushDynamic',\n 'ThresholdSphereBrushDynamic',\n ],\n },\n options: [\n {\n name: 'Radius (mm)',\n id: 'threshold-radius',\n type: 'range',\n min: 0.5,\n max: 99.5,\n step: 0.5,\n value: 25,\n commands: {\n commandName: 'setBrushSize',\n commandOptions: {\n toolNames: [\n 'ThresholdCircularBrush',\n 'ThresholdSphereBrush',\n 'ThresholdCircularBrushDynamic',\n 'ThresholdSphereBrushDynamic',\n ],\n },\n },\n },\n {\n name: 'Shape',\n type: 'radio',\n id: 'threshold-shape',\n value: 'ThresholdCircularBrush',\n values: [\n { value: 'ThresholdCircularBrush', label: 'Circle' },\n { value: 'ThresholdSphereBrush', label: 'Sphere' },\n ],\n commands: ({ value, commandsManager, options }) => {\n const optionsDynamic = options.find(option => option.id === 'dynamic-mode');\n\n if (optionsDynamic.value === 'ThresholdDynamic') {\n commandsManager.run('setToolActive', {\n toolName:\n value === 'ThresholdCircularBrush'\n ? 'ThresholdCircularBrushDynamic'\n : 'ThresholdSphereBrushDynamic',\n });\n } else {\n commandsManager.run('setToolActive', {\n toolName: value,\n });\n }\n },\n },\n {\n name: 'Threshold',\n type: 'radio',\n id: 'dynamic-mode',\n value: 'ThresholdDynamic',\n values: [\n { value: 'ThresholdDynamic', label: 'Dynamic' },\n { value: 'ThresholdRange', label: 'Range' },\n ],\n commands: ({ value, commandsManager, options }) => {\n const thresholdRangeOption = options.find(option => option.id === 'threshold-shape');\n\n if (value === 'ThresholdDynamic') {\n commandsManager.run('setToolActiveToolbar', {\n toolName:\n thresholdRangeOption.value === 'ThresholdCircularBrush'\n ? 'ThresholdCircularBrushDynamic'\n : 'ThresholdSphereBrushDynamic',\n });\n } else {\n commandsManager.run('setToolActiveToolbar', {\n toolName: thresholdRangeOption.value,\n });\n\n const thresholdRangeValue = options.find(\n option => option.id === 'threshold-range'\n ).value;\n\n commandsManager.run('setThresholdRange', {\n toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],\n value: thresholdRangeValue,\n });\n }\n },\n },\n {\n name: 'ThresholdRange',\n type: 'double-range',\n id: 'threshold-range',\n min: -1000,\n max: 1000,\n step: 1,\n value: [50, 600],\n condition: ({ options }) =>\n options.find(option => option.id === 'dynamic-mode').value === 'ThresholdRange',\n commands: {\n commandName: 'setThresholdRange',\n commandOptions: {\n toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],\n },\n },\n },\n ],\n },\n },\n {\n id: 'Shapes',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-shape',\n label: 'Shapes',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircleScissor', 'SphereScissor', 'RectangleScissor'],\n disabledText: 'Create new segmentation to enable shapes tool.',\n },\n options: [\n {\n name: 'Shape',\n type: 'radio',\n value: 'CircleScissor',\n id: 'shape-mode',\n values: [\n { value: 'CircleScissor', label: 'Circle' },\n { value: 'SphereScissor', label: 'Sphere' },\n { value: 'RectangleScissor', label: 'Rectangle' },\n ],\n commands: 'setToolActiveToolbar',\n },\n ],\n },\n },\n {\n id: 'SegmentLabelTool',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'tool-segment-label',\n label: 'Segment Label Display',\n tooltip: 'Click to show or hide segment labels when hovering with your mouse.',\n commands: { commandName: 'toggleSegmentLabel' },\n evaluate: [\n 'evaluate.cornerstoneTool.toggle',\n {\n name: 'evaluate.cornerstone.hasSegmentation',\n },\n ],\n },\n },\n];\n\nexport default toolbarButtons;\n","const colours = {\n 'viewport-0': 'rgb(200, 0, 0)',\n 'viewport-1': 'rgb(200, 200, 0)',\n 'viewport-2': 'rgb(0, 200, 0)',\n};\n\nconst colorsByOrientation = {\n axial: 'rgb(200, 0, 0)',\n sagittal: 'rgb(200, 200, 0)',\n coronal: 'rgb(0, 200, 0)',\n};\n\nfunction createTools({ utilityModule, commandsManager }) {\n const { toolNames, Enums } = utilityModule.exports;\n\n const tools = {\n active: [\n { toolName: toolNames.WindowLevel, bindings: [{ mouseButton: Enums.MouseBindings.Primary }] },\n { toolName: toolNames.Pan, bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }] },\n {\n toolName: toolNames.Zoom,\n bindings: [{ mouseButton: Enums.MouseBindings.Secondary }, { numTouchPoints: 2 }],\n },\n {\n toolName: toolNames.StackScroll,\n bindings: [{ mouseButton: Enums.MouseBindings.Wheel }, { numTouchPoints: 3 }],\n },\n ],\n passive: [\n {\n toolName: 'CircularBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'FILL_INSIDE_CIRCLE',\n },\n },\n {\n toolName: toolNames.LabelmapSlicePropagation,\n },\n {\n toolName: toolNames.MarkerLabelmap,\n },\n {\n toolName: toolNames.RegionSegmentPlus,\n },\n {\n toolName: 'CircularEraser',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'ERASE_INSIDE_CIRCLE',\n },\n },\n {\n toolName: 'SphereBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'FILL_INSIDE_SPHERE',\n },\n },\n {\n toolName: 'SphereEraser',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'ERASE_INSIDE_SPHERE',\n },\n },\n {\n toolName: 'ThresholdCircularBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_CIRCLE',\n },\n },\n {\n toolName: 'ThresholdSphereBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_SPHERE',\n },\n },\n {\n toolName: 'ThresholdCircularBrushDynamic',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_CIRCLE',\n threshold: {\n isDynamic: true,\n dynamicRadius: 3,\n },\n },\n },\n {\n toolName: toolNames.SegmentBidirectional,\n },\n {\n toolName: toolNames.SegmentSelect,\n },\n {\n toolName: 'ThresholdSphereBrushDynamic',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_SPHERE',\n threshold: {\n isDynamic: true,\n dynamicRadius: 3,\n },\n },\n },\n { toolName: toolNames.CircleScissors },\n { toolName: toolNames.RectangleScissors },\n { toolName: toolNames.SphereScissors },\n { toolName: toolNames.StackScroll },\n { toolName: toolNames.Magnify },\n { toolName: toolNames.WindowLevelRegion },\n\n { toolName: toolNames.UltrasoundDirectional },\n ],\n disabled: [{ toolName: toolNames.ReferenceLines }, { toolName: toolNames.AdvancedMagnify }],\n };\n\n const updatedTools = commandsManager.run('initializeSegmentLabelTool', { tools });\n\n return updatedTools;\n}\n\nfunction initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const tools = createTools({ commandsManager, 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 servicesManager = extensionManager._servicesManager;\n const { cornerstoneViewportService } = servicesManager.services;\n const tools = createTools({ commandsManager, utilityModule });\n tools.disabled.push(\n {\n toolName: utilityModule.exports.toolNames.Crosshairs,\n configuration: {\n viewportIndicators: true,\n viewportIndicatorsConfig: {\n circleRadius: 5,\n xOffset: 0.95,\n yOffset: 0.05,\n },\n disableOnPassive: true,\n autoPan: {\n enabled: false,\n panSize: 10,\n },\n getReferenceLineColor: viewportId => {\n const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);\n const viewportOptions = viewportInfo?.viewportOptions;\n if (viewportOptions) {\n return (\n colours[viewportOptions.id] ||\n colorsByOrientation[viewportOptions.orientation] ||\n '#0c0'\n );\n } else {\n console.warn('missing viewport?', viewportId);\n return '#0c0';\n }\n },\n },\n },\n { toolName: utilityModule.exports.toolNames.ReferenceLines }\n );\n toolGroupService.createToolGroupAndAddTools('mpr', tools);\n}\n\nfunction initVolume3DToolGroup(extensionManager, toolGroupService) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n\n const { toolNames, Enums } = utilityModule.exports;\n\n const tools = {\n active: [\n {\n toolName: toolNames.TrackballRotateTool,\n bindings: [{ mouseButton: Enums.MouseBindings.Primary }],\n },\n {\n toolName: toolNames.Zoom,\n bindings: [{ mouseButton: Enums.MouseBindings.Secondary }, { numTouchPoints: 2 }],\n },\n {\n toolName: toolNames.Pan,\n bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],\n },\n ],\n };\n\n toolGroupService.createToolGroupAndAddTools('volume3d', tools);\n}\n\nfunction initToolGroups(extensionManager, toolGroupService, commandsManager) {\n initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, 'default');\n initMPRToolGroup(extensionManager, toolGroupService, commandsManager);\n initVolume3DToolGroup(extensionManager, toolGroupService);\n}\n\nexport default initToolGroups;\n","import { 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};\n\nconst cornerstone = {\n viewport: '@ohif/extension-cornerstone.viewportModule.cornerstone',\n panelTool: '@ohif/extension-cornerstone.panelModule.panelSegmentationWithTools',\n measurements: '@ohif/extension-cornerstone.panelModule.panelMeasurement',\n};\n\nconst segmentation = {\n sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',\n viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',\n};\n\nconst dicomRT = {\n viewport: '@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt',\n sopClassHandler: '@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt',\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 '@ohif/extension-cornerstone-dicom-rt': '^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 }: withAppTypes) => {\n const { measurementService, toolbarService, toolGroupService, customizationService } =\n servicesManager.services;\n\n measurementService.clearMeasurements();\n\n // Init Default and SR ToolGroups\n initToolGroups(extensionManager, toolGroupService, commandsManager);\n\n toolbarService.register(toolbarButtons);\n\n toolbarService.updateSection(toolbarService.sections.primary, [\n 'WindowLevel',\n 'Pan',\n 'Zoom',\n 'TrackballRotate',\n 'Capture',\n 'Layout',\n 'Crosshairs',\n 'MoreTools',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.topLeft, [\n 'orientationMenu',\n 'dataOverlayMenu',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.bottomMiddle, [\n 'AdvancedRenderingControls',\n ]);\n\n toolbarService.updateSection('AdvancedRenderingControls', [\n 'windowLevelMenuEmbedded',\n 'voiManualControlMenu',\n 'Colorbar',\n 'opacityMenu',\n 'thresholdMenu',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.topRight, [\n 'modalityLoadBadge',\n 'trackingStatus',\n 'navigationComponent',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.bottomLeft, [\n 'windowLevelMenu',\n ]);\n\n toolbarService.updateSection('MoreTools', [\n 'Reset',\n 'rotate-right',\n 'flipHorizontal',\n 'ReferenceLines',\n 'ImageOverlayViewer',\n 'StackScroll',\n 'invert',\n 'Cine',\n 'Magnify',\n 'TagBrowser',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.segmentationToolbox, [\n 'SegmentationUtilities',\n 'SegmentationTools',\n ]);\n toolbarService.updateSection('SegmentationUtilities', [\n 'LabelmapSlicePropagation',\n 'InterpolateLabelmap',\n 'SegmentBidirectional',\n 'SegmentLabelTool',\n ]);\n toolbarService.updateSection('SegmentationTools', [\n 'BrushTools',\n 'MarkerLabelmap',\n 'RegionSegmentPlus',\n 'Shapes',\n ]);\n toolbarService.updateSection('BrushTools', ['Brush', 'Eraser', 'Threshold']);\n },\n onModeExit: ({ servicesManager }: withAppTypes) => {\n const {\n toolGroupService,\n syncGroupService,\n segmentationService,\n cornerstoneViewportService,\n uiDialogService,\n uiModalService,\n } = servicesManager.services;\n\n uiDialogService.hideAll();\n uiModalService.hide();\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. Currently we don't have stack viewport\n * segmentations and we should exclude them\n */\n isValidMode: ({ modalities }) => {\n // Don't show the mode if the selected studies have only one modality\n // that is not supported by the mode\n const modalitiesArray = modalities.split('\\\\');\n return {\n valid:\n modalitiesArray.length === 1\n ? !['SM', 'ECG', 'OT', 'DOC'].includes(modalitiesArray[0])\n : true,\n description:\n 'The mode does not support studies that ONLY include the following modalities: SM, OT, DOC',\n };\n },\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 leftPanelResizable: true,\n rightPanels: [cornerstone.panelTool],\n rightPanelResizable: true,\n // leftPanelClosed: true,\n viewports: [\n {\n namespace: cornerstone.viewport,\n displaySetsToDisplay: [ohif.sopClassHandler],\n },\n {\n namespace: segmentation.viewport,\n displaySetsToDisplay: [segmentation.sopClassHandler],\n },\n {\n namespace: dicomRT.viewport,\n displaySetsToDisplay: [dicomRT.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 // Commented out to just use the most applicable registered hanging protocol\n // The example is used for a grid layout to specify that as a preferred layout\n hangingProtocol: ['@ohif/mnGrid'],\n /** SopClassHandlers used by the mode */\n sopClassHandlers: [ohif.sopClassHandler, segmentation.sopClassHandler, dicomRT.sopClassHandler],\n };\n}\n\nconst mode = {\n id,\n modeFactory,\n extensionDependencies,\n};\n\nexport default mode;\n"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__498__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","id","packageJson","setToolActiveToolbar","commandName","commandOptions","toolGroupIds","callbacks","toolName","uiType","props","buttonSection","icon","label","tooltip","evaluate","name","hideWhenDisabled","type","commands","disabledText","unsupportedViewportTypes","rows","columns","toolNames","options","min","max","step","values","listeners","ViewportGridService","EVENTS","ACTIVE_VIEWPORT_ID_CHANGED","VIEWPORTS_READY","commandsManager","find","option","run","thresholdRangeOption","thresholdRangeValue","condition","colours","colorsByOrientation","axial","sagittal","coronal","createTools","utilityModule","Enums","tools","active","WindowLevel","bindings","mouseButton","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","numTouchPoints","StackScroll","Wheel","passive","parentTool","configuration","activeStrategy","LabelmapSlicePropagation","MarkerLabelmap","RegionSegmentPlus","threshold","isDynamic","dynamicRadius","SegmentBidirectional","SegmentSelect","CircleScissors","RectangleScissors","SphereScissors","Magnify","WindowLevelRegion","UltrasoundDirectional","disabled","ReferenceLines","AdvancedMagnify","ohif","segmentation","dicomRT","extensionDependencies","modeFactory","modeConfiguration","routeName","displayName","onModeEnter","servicesManager","extensionManager","measurementService","toolbarService","toolGroupService","customizationService","services","clearMeasurements","getModuleEntry","createToolGroupAndAddTools","initDefaultToolGroup","_servicesManager","cornerstoneViewportService","push","Crosshairs","viewportIndicators","viewportIndicatorsConfig","circleRadius","xOffset","yOffset","disableOnPassive","autoPan","enabled","panSize","getReferenceLineColor","viewportId","viewportInfo","getViewportInfo","viewportOptions","orientation","console","warn","initMPRToolGroup","TrackballRotateTool","initVolume3DToolGroup","initToolGroups","register","toolbarButtons","updateSection","sections","primary","viewportActionMenu","topLeft","bottomMiddle","topRight","bottomLeft","segmentationToolbox","onModeExit","syncGroupService","segmentationService","uiDialogService","uiModalService","hideAll","hide","destroy","validationTags","study","series","isValidMode","modalities","modalitiesArray","split","valid","length","includes","description","routes","path","layoutTemplate","location","leftPanels","leftPanelResizable","rightPanels","rightPanelResizable","viewports","namespace","displaySetsToDisplay","extensions","hangingProtocol","sopClassHandlers"],"sourceRoot":""}
1
+ {"version":3,"file":"index.umd.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cAAeA,QAAQ,WAAYA,QAAQ,qBACnD,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,0BAA2B,CAAC,aAAc,UAAW,oBAAqBJ,GACvD,iBAAZC,QACdA,QAAQ,2BAA6BD,EAAQG,QAAQ,cAAeA,QAAQ,WAAYA,QAAQ,qBAEhGJ,EAAK,2BAA6BC,EAAQD,EAAK,cAAeA,EAAc,QAAGA,EAAK,oBACrF,CATD,CASmB,oBAATO,KAAuBA,KAAOC,KAAM,CAACC,EAAkCC,EAAkCC,I,kCCTnHR,EAAOD,QAAUO,C,UCAjBN,EAAOD,QAAUS,C,UCAjBR,EAAOD,QAAUQ,C,GCCbE,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAab,QAGrB,IAAIC,EAASS,EAAyBE,GAAY,CAGjDZ,QAAS,CAAC,GAOX,OAHAe,EAAoBH,GAAUX,EAAQA,EAAOD,QAASW,GAG/CV,EAAOD,OACf,CCrBAW,EAAoBK,EAAKf,IACxB,IAAIgB,EAAShB,GAAUA,EAAOiB,WAC7B,IAAOjB,EAAiB,QACxB,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kB,CAACpB,EAAAA,KAAKc,gBAAiBC,EAAAA,aAAaD,gBAAiBE,EAAAA,QAAQF,iBAEnF,EAKEI,sBAAqBA,EAAAA,uB","sources":["webpack://@ohif/mode-segmentation/webpack/universalModuleDefinition","webpack://@ohif/mode-segmentation/external umd {\"commonjs2\":\"@ohif/core\",\"commonjs\":\"@ohif/core\",\"amd\":\"@ohif/core\",\"root\":\"@ohif/core\"}","webpack://@ohif/mode-segmentation/external umd {\"commonjs2\":\"@ohif/mode-basic\",\"commonjs\":\"@ohif/mode-basic\",\"amd\":\"@ohif/mode-basic\",\"root\":\"@ohif/mode-basic\"}","webpack://@ohif/mode-segmentation/external umd {\"commonjs2\":\"i18next\",\"commonjs\":\"i18next\",\"amd\":\"i18next\",\"root\":\"i18next\"}","webpack://@ohif/mode-segmentation/webpack/bootstrap","webpack://@ohif/mode-segmentation/webpack/runtime/compat get default export","webpack://@ohif/mode-segmentation/webpack/runtime/define property getters","webpack://@ohif/mode-segmentation/webpack/runtime/hasOwnProperty shorthand","webpack://@ohif/mode-segmentation/webpack/runtime/make namespace object","webpack://@ohif/mode-segmentation/./src/id.js","webpack://@ohif/mode-segmentation/./src/constants.ts","webpack://@ohif/mode-segmentation/./src/toolbarButtons.ts","webpack://@ohif/mode-segmentation/./src/initToolGroups.ts","webpack://@ohif/mode-segmentation/./src/index.tsx","webpack://@ohif/mode-segmentation/./src/utils/setUpAutoTabSwitchHandler.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@ohif/core\"), require(\"i18next\"), require(\"@ohif/mode-basic\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@ohif/mode-segmentation\", [\"@ohif/core\", \"i18next\", \"@ohif/mode-basic\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@ohif/mode-segmentation\"] = factory(require(\"@ohif/core\"), require(\"i18next\"), require(\"@ohif/mode-basic\"));\n\telse\n\t\troot[\"@ohif/mode-segmentation\"] = factory(root[\"@ohif/core\"], root[\"i18next\"], root[\"@ohif/mode-basic\"]);\n})(typeof self !== 'undefined' ? self : this, (__WEBPACK_EXTERNAL_MODULE__498__, __WEBPACK_EXTERNAL_MODULE__310__, __WEBPACK_EXTERNAL_MODULE__110__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__498__;","module.exports = __WEBPACK_EXTERNAL_MODULE__110__;","module.exports = __WEBPACK_EXTERNAL_MODULE__310__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import packageJson from '../package.json';\n\nconst id = packageJson.name;\n\nexport { id };\n","export const MIN_SEGMENTATION_DRAWING_RADIUS = 0.5;\nexport const MAX_SEGMENTATION_DRAWING_RADIUS = 99.5;\n","import type { Button } from '@ohif/core/types';\nimport { ViewportGridService } from '@ohif/core';\nimport i18n from 'i18next';\n\nimport { MIN_SEGMENTATION_DRAWING_RADIUS, MAX_SEGMENTATION_DRAWING_RADIUS } from './constants';\n\nconst setToolActiveToolbar = {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],\n },\n};\n\nconst callbacks = (toolName: string) => [\n {\n commandName: 'setViewportForToolConfiguration',\n commandOptions: {\n toolName,\n },\n },\n];\n\nexport const toolbarButtons: Button[] = [\n {\n id: 'AdvancedRenderingControls',\n uiType: 'ohif.advancedRenderingControls',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'modalityLoadBadge',\n uiType: 'ohif.modalityLoadBadge',\n props: {\n icon: 'Status',\n label: i18n.t('Buttons:Status'),\n tooltip: i18n.t('Buttons:Status'),\n evaluate: {\n name: 'evaluate.modalityLoadBadge',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'navigationComponent',\n uiType: 'ohif.navigationComponent',\n props: {\n icon: 'Navigation',\n label: i18n.t('Buttons:Navigation'),\n tooltip: i18n.t('Buttons:Navigate between segments/measurements and manage their visibility'),\n evaluate: {\n name: 'evaluate.navigationComponent',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'trackingStatus',\n uiType: 'ohif.trackingStatus',\n props: {\n icon: 'TrackingStatus',\n label: i18n.t('Buttons:Tracking Status'),\n tooltip: i18n.t('Buttons:View and manage tracking status of measurements and annotations'),\n evaluate: {\n name: 'evaluate.trackingStatus',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'dataOverlayMenu',\n uiType: 'ohif.dataOverlayMenu',\n props: {\n icon: 'ViewportViews',\n label: i18n.t('Buttons:Data Overlay'),\n tooltip: i18n.t(\n 'Buttons:Configure data overlay options and manage foreground/background display sets'\n ),\n evaluate: 'evaluate.dataOverlayMenu',\n },\n },\n {\n id: 'orientationMenu',\n uiType: 'ohif.orientationMenu',\n props: {\n icon: 'OrientationSwitch',\n label: i18n.t('Buttons:Orientation'),\n tooltip: i18n.t(\n 'Buttons:Change viewport orientation between axial, sagittal, coronal and reformat planes'\n ),\n evaluate: {\n name: 'evaluate.orientationMenu',\n // hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'windowLevelMenuEmbedded',\n uiType: 'ohif.windowLevelMenuEmbedded',\n props: {\n icon: 'WindowLevel',\n label: i18n.t('Buttons:Window Level'),\n tooltip: i18n.t('Buttons:Adjust window/level presets and customize image contrast settings'),\n evaluate: {\n name: 'evaluate.windowLevelMenuEmbedded',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'windowLevelMenu',\n uiType: 'ohif.windowLevelMenu',\n props: {\n icon: 'WindowLevel',\n label: i18n.t('Buttons:Window Level'),\n tooltip: i18n.t('Buttons:Adjust window/level presets and customize image contrast settings'),\n evaluate: 'evaluate.windowLevelMenu',\n },\n },\n {\n id: 'voiManualControlMenu',\n uiType: 'ohif.voiManualControlMenu',\n props: {\n icon: 'WindowLevelAdvanced',\n label: i18n.t('Buttons:Advanced Window Level'),\n tooltip: i18n.t('Buttons:Advanced window/level settings with manual controls and presets'),\n evaluate: 'evaluate.voiManualControlMenu',\n },\n },\n {\n id: 'thresholdMenu',\n uiType: 'ohif.thresholdMenu',\n props: {\n icon: 'Threshold',\n label: i18n.t('Buttons:Threshold'),\n tooltip: i18n.t('Buttons:Image threshold settings'),\n evaluate: {\n name: 'evaluate.thresholdMenu',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'opacityMenu',\n uiType: 'ohif.opacityMenu',\n props: {\n icon: 'Opacity',\n label: i18n.t('Buttons:Opacity'),\n tooltip: i18n.t('Buttons:Image opacity settings'),\n evaluate: {\n name: 'evaluate.opacityMenu',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'Colorbar',\n uiType: 'ohif.colorbar',\n props: {\n type: 'tool',\n label: i18n.t('Buttons:Colorbar'),\n },\n },\n // sections\n {\n id: 'MoreTools',\n uiType: 'ohif.toolButtonList',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'BrushTools',\n uiType: 'ohif.toolBoxButtonGroup',\n props: {\n buttonSection: true,\n },\n },\n // Section containers for the nested toolboxes and toolbars.\n {\n id: 'LabelMapUtilities',\n uiType: 'ohif.Toolbar',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'ContourUtilities',\n uiType: 'ohif.Toolbar',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'LabelMapTools',\n uiType: 'ohif.toolBoxButtonGroup',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'ContourTools',\n uiType: 'ohif.toolBoxButtonGroup',\n props: {\n buttonSection: true,\n },\n },\n // tool defs\n {\n id: 'Zoom',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-zoom',\n label: i18n.t('Buttons:Zoom'),\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'WindowLevel',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-window-level',\n label: i18n.t('Buttons:Window Level'),\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'Pan',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-move',\n label: i18n.t('Buttons:Pan'),\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'TrackballRotate',\n uiType: 'ohif.toolButton',\n props: {\n type: 'tool',\n icon: 'tool-3d-rotate',\n label: i18n.t('Buttons:3D Rotate'),\n commands: setToolActiveToolbar,\n evaluate: {\n name: 'evaluate.cornerstoneTool',\n disabledText: i18n.t('Buttons:Select a 3D viewport to enable this tool'),\n },\n },\n },\n {\n id: 'Capture',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-capture',\n label: i18n.t('Buttons:Capture'),\n commands: 'showDownloadViewportModal',\n evaluate: [\n 'evaluate.action',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['video', 'wholeSlide'],\n },\n ],\n },\n },\n {\n id: 'Layout',\n uiType: 'ohif.layoutSelector',\n props: {\n rows: 3,\n columns: 4,\n evaluate: 'evaluate.action',\n commands: 'setViewportGridLayout',\n },\n },\n {\n id: 'Crosshairs',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-crosshair',\n label: i18n.t('Buttons:Crosshairs'),\n commands: {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['mpr'],\n },\n },\n evaluate: {\n name: 'evaluate.cornerstoneTool',\n disabledText: i18n.t('Buttons:Select an MPR viewport to enable this tool'),\n },\n },\n },\n {\n id: 'Reset',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-reset',\n label: i18n.t('Buttons:Reset View'),\n tooltip: i18n.t('Buttons:Reset View'),\n commands: 'resetViewport',\n evaluate: 'evaluate.action',\n },\n },\n {\n id: 'rotate-right',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-rotate-right',\n label: i18n.t('Buttons:Rotate Right'),\n tooltip: i18n.t('Buttons:Rotate +90'),\n commands: 'rotateViewportCW',\n evaluate: 'evaluate.action',\n },\n },\n {\n id: 'flipHorizontal',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-flip-horizontal',\n label: i18n.t('Buttons:Flip Horizontal'),\n tooltip: i18n.t('Buttons:Flip Horizontally'),\n commands: 'flipViewportHorizontal',\n evaluate: [\n 'evaluate.viewportProperties.toggle',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['volume3d'],\n },\n ],\n },\n },\n {\n id: 'ReferenceLines',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-referenceLines',\n label: i18n.t('Buttons:Reference Lines'),\n tooltip: i18n.t('Buttons:Show Reference Lines'),\n commands: 'toggleEnabledDisabledToolbar',\n evaluate: 'evaluate.cornerstoneTool.toggle',\n },\n },\n {\n id: 'ImageOverlayViewer',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'toggle-dicom-overlay',\n label: i18n.t('Buttons:Image Overlay'),\n tooltip: i18n.t('Buttons:Toggle Image Overlay'),\n commands: 'toggleEnabledDisabledToolbar',\n evaluate: 'evaluate.cornerstoneTool.toggle',\n },\n },\n {\n id: 'StackScroll',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-stack-scroll',\n label: i18n.t('Buttons:Stack Scroll'),\n tooltip: i18n.t('Buttons:Stack Scroll'),\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'invert',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-invert',\n label: i18n.t('Buttons:Invert'),\n tooltip: i18n.t('Buttons:Invert Colors'),\n commands: 'invertViewport',\n evaluate: 'evaluate.viewportProperties.toggle',\n },\n },\n {\n id: 'Cine',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-cine',\n label: i18n.t('Buttons:Cine'),\n tooltip: i18n.t('Buttons:Cine'),\n commands: 'toggleCine',\n evaluate: [\n 'evaluate.cine',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['volume3d'],\n },\n ],\n },\n },\n {\n id: 'Magnify',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-magnify',\n label: i18n.t('Buttons:Zoom-in'),\n tooltip: i18n.t('Buttons:Zoom-in'),\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'TagBrowser',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'dicom-tag-browser',\n label: i18n.t('Buttons:Dicom Tag Browser'),\n tooltip: i18n.t('Buttons:Dicom Tag Browser'),\n commands: 'openDICOMTagViewer',\n },\n },\n {\n id: 'PlanarFreehandContourSegmentationTool',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-freehand-roi',\n label: i18n.t('Buttons:Freehand Segmentation'),\n tooltip: i18n.t('Buttons:Freehand Segmentation'),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['PlanarFreehandContourSegmentationTool'],\n disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Contour',\n },\n ],\n commands: [\n {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n bindings: [\n {\n mouseButton: 1, // Left Click\n },\n {\n mouseButton: 1, // Left Click+Shift to create a hole\n modifierKey: 16, // Shift\n },\n ],\n },\n },\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Contour',\n },\n },\n ],\n options: [\n {\n name: i18n.t('Buttons:Interpolate Contours'),\n type: 'switch',\n id: 'planarFreehandInterpolateContours',\n value: false,\n commands: {\n commandName: 'setInterpolationToolConfiguration',\n },\n },\n ],\n },\n },\n {\n id: 'LivewireContourSegmentationTool',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-livewire',\n label: i18n.t('Buttons:Livewire Contour'),\n tooltip: i18n.t('Buttons:Livewire Contour'),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['LivewireContourSegmentationTool'],\n disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Contour',\n },\n ],\n commands: [\n {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n bindings: [\n {\n mouseButton: 1, // Left Click\n },\n {\n mouseButton: 1, // Left Click+Shift to create a hole\n modifierKey: 16, // Shift\n },\n ],\n },\n },\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Contour',\n },\n },\n ],\n options: [\n {\n name: i18n.t('Buttons:Interpolate Contours'),\n type: 'switch',\n id: 'livewireInterpolateContours',\n value: false,\n commands: {\n commandName: 'setInterpolationToolConfiguration',\n },\n },\n ],\n },\n },\n {\n id: 'SplineContourSegmentationTool',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-spline-roi',\n label: i18n.t('Buttons:Spline Contour Segmentation Tool'),\n tooltip: i18n.t('Buttons:Spline Contour Segmentation Tool'),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CatmullRomSplineROI', 'LinearSplineROI', 'BSplineROI'],\n disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Contour',\n },\n ],\n commands: [\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Contour',\n },\n },\n ],\n options: [\n {\n name: i18n.t('Buttons:Spline Type'),\n type: 'select',\n id: 'splineTypeSelect',\n value: 'CatmullRomSplineROI',\n values: [\n {\n id: 'CatmullRomSplineROI',\n value: 'CatmullRomSplineROI',\n label: i18n.t('Buttons:Catmull Rom Spline'),\n },\n { id: 'LinearSplineROI', value: 'LinearSplineROI', label: i18n.t('Buttons:Linear Spline') },\n { id: 'BSplineROI', value: 'BSplineROI', label: i18n.t('Buttons:B-Spline') },\n ],\n commands: {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n bindings: [\n {\n mouseButton: 1, // Left Click\n },\n {\n mouseButton: 1, // Left Click+Shift to create a hole\n modifierKey: 16, // Shift\n },\n ],\n },\n },\n },\n {\n name: i18n.t('Buttons:Simplified Spline'),\n type: 'switch',\n id: 'simplifiedSpline',\n value: true,\n commands: {\n commandName: 'setSimplifiedSplineForSplineContourSegmentationTool',\n },\n },\n {\n name: i18n.t('Buttons:Interpolate Contours'),\n type: 'switch',\n id: 'splineInterpolateContours',\n value: false,\n commands: {\n commandName: 'setInterpolationToolConfiguration',\n commandOptions: {\n toolNames: ['CatmullRomSplineROI', 'LinearSplineROI', 'BSplineROI'],\n },\n },\n },\n ],\n },\n },\n {\n id: 'SculptorTool',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-sculptor',\n label: i18n.t('Buttons:Sculptor Tool'),\n tooltip: i18n.t('Buttons:Sculptor Tool'),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['SculptorTool'],\n disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Contour',\n },\n ],\n commands: [\n 'setToolActiveToolbar',\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Contour',\n },\n },\n ],\n options: [\n {\n name: i18n.t('Buttons:Dynamic Cursor Size'),\n type: 'switch',\n id: 'dynamicCursorSize',\n value: true,\n commands: {\n commandName: 'setDynamicCursorSizeForSculptorTool',\n },\n },\n ],\n },\n },\n {\n id: 'Brush',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-brush',\n label: i18n.t('Buttons:Brush'),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircularBrush', 'SphereBrush'],\n disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),\n },\n {\n name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',\n radiusOptionId: 'brush-radius',\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n commands: {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n options: [\n {\n name: i18n.t('Buttons:Radius (mm)'),\n id: 'brush-radius',\n type: 'range',\n explicitRunOnly: true,\n min: MIN_SEGMENTATION_DRAWING_RADIUS,\n max: MAX_SEGMENTATION_DRAWING_RADIUS,\n step: 0.5,\n value: 25,\n commands: [\n {\n commandName: 'setBrushSize',\n commandOptions: { toolNames: ['CircularBrush', 'SphereBrush'] },\n },\n ],\n },\n {\n name: i18n.t('Buttons:Shape'),\n type: 'radio',\n id: 'brush-mode',\n value: 'CircularBrush',\n values: [\n { value: 'CircularBrush', label: i18n.t('Buttons:Circle') },\n { value: 'SphereBrush', label: i18n.t('Buttons:Sphere') },\n ],\n commands: ['setToolActiveToolbar'],\n },\n ],\n },\n },\n {\n id: 'InterpolateLabelmap',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'actions-interpolate',\n label: i18n.t('Buttons:Interpolate Labelmap'),\n tooltip: i18n.t(\n 'Buttons:Automatically fill in missing slices between drawn segments. Use brush or threshold tools on at least two slices, then click to interpolate across slices. Works in any direction. Volume must be reconstructable.'\n ),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n {\n name: 'evaluate.displaySetIsReconstructable',\n disabledText: i18n.t('Buttons:The current viewport cannot handle interpolation.'),\n },\n ],\n commands: [\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n 'interpolateLabelmap',\n ],\n },\n },\n {\n id: 'SegmentBidirectional',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'actions-bidirectional',\n label: i18n.t('Buttons:Segment Bidirectional'),\n tooltip: i18n.t(\n 'Buttons:Automatically detects the largest length and width across slices for the selected segment and displays a bidirectional measurement.'\n ),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n commands: [\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n 'runSegmentBidirectional',\n ],\n },\n },\n {\n id: 'RegionSegmentPlus',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-click-segment',\n label: i18n.t('Buttons:One Click Segment'),\n tooltip: i18n.t(\n 'Buttons:Detects segmentable regions with one click. Hover for visual feedback—click when a plus sign appears to auto-segment the lesion.'\n ),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['RegionSegmentPlus'],\n disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n commands: [\n 'setToolActiveToolbar',\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n ],\n },\n },\n {\n id: 'LabelmapSlicePropagation',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-labelmap-slice-propagation',\n label: i18n.t('Buttons:Labelmap Assist'),\n tooltip: i18n.t(\n 'Buttons:Toggle AI assistance for segmenting nearby slices. After drawing on a slice, scroll to preview predictions. Press Enter to accept or Esc to skip.'\n ),\n evaluate: [\n 'evaluate.cornerstoneTool.toggle',\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n listeners: {\n [ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks(\n 'LabelmapSlicePropagation'\n ),\n [ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('LabelmapSlicePropagation'),\n },\n commands: [\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n 'toggleEnabledDisabledToolbar',\n ],\n },\n },\n {\n id: 'MarkerLabelmap',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-marker-labelmap',\n label: i18n.t('Buttons:Marker Guided Labelmap'),\n tooltip: i18n.t(\n 'Buttons:Use include/exclude markers to guide AI (SAM) segmentation. Click to place markers, Enter to accept results, Esc to reject, and N to go to the next slice while keeping markers.'\n ),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['MarkerLabelmap', 'MarkerInclude', 'MarkerExclude'],\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n commands: [\n 'setToolActiveToolbar',\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n ],\n listeners: {\n [ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks('MarkerLabelmap'),\n [ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('MarkerLabelmap'),\n },\n options: [\n {\n name: i18n.t('Buttons:Marker Mode'),\n type: 'radio',\n id: 'marker-mode',\n value: 'markerInclude',\n values: [\n { value: 'markerInclude', label: i18n.t('Buttons:Include') },\n { value: 'markerExclude', label: i18n.t('Buttons:Exclude') },\n ],\n commands: ({ commandsManager, options }) => {\n const markerModeOption = options.find(option => option.id === 'marker-mode');\n if (markerModeOption.value === 'markerInclude') {\n commandsManager.run('setToolActive', {\n toolName: 'MarkerInclude',\n });\n } else {\n commandsManager.run('setToolActive', {\n toolName: 'MarkerExclude',\n });\n }\n },\n },\n {\n name: i18n.t('Buttons:Clear Markers'),\n type: 'button',\n id: 'clear-markers',\n commands: 'clearMarkersForMarkerLabelmap',\n },\n ],\n },\n },\n {\n id: 'Eraser',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-eraser',\n label: i18n.t('Buttons:Eraser'),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircularEraser', 'SphereEraser'],\n },\n {\n name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',\n radiusOptionId: 'eraser-radius',\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n options: [\n {\n name: i18n.t('Buttons:Radius (mm)'),\n id: 'eraser-radius',\n type: 'range',\n explicitRunOnly: true,\n min: MIN_SEGMENTATION_DRAWING_RADIUS,\n max: MAX_SEGMENTATION_DRAWING_RADIUS,\n step: 0.5,\n value: 25,\n commands: {\n commandName: 'setBrushSize',\n commandOptions: { toolNames: ['CircularEraser', 'SphereEraser'] },\n },\n },\n {\n name: i18n.t('Buttons:Shape'),\n type: 'radio',\n id: 'eraser-mode',\n value: 'CircularEraser',\n values: [\n { value: 'CircularEraser', label: i18n.t('Buttons:Circle') },\n { value: 'SphereEraser', label: i18n.t('Buttons:Sphere') },\n ],\n commands: 'setToolActiveToolbar',\n },\n ],\n commands: {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n },\n },\n {\n id: 'Threshold',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-threshold',\n label: i18n.t('Buttons:Threshold Tool'),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: [\n 'ThresholdCircularBrush',\n 'ThresholdSphereBrush',\n 'ThresholdCircularBrushDynamic',\n 'ThresholdSphereBrushDynamic',\n ],\n },\n {\n name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',\n radiusOptionId: 'threshold-radius',\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n commands: {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n options: [\n {\n name: i18n.t('Buttons:Radius (mm)'),\n id: 'threshold-radius',\n type: 'range',\n explicitRunOnly: true,\n min: MIN_SEGMENTATION_DRAWING_RADIUS,\n max: MAX_SEGMENTATION_DRAWING_RADIUS,\n step: 0.5,\n value: 25,\n commands: {\n commandName: 'setBrushSize',\n commandOptions: {\n toolNames: [\n 'ThresholdCircularBrush',\n 'ThresholdSphereBrush',\n 'ThresholdCircularBrushDynamic',\n 'ThresholdSphereBrushDynamic',\n ],\n },\n },\n },\n {\n name: i18n.t('Buttons:Shape'),\n type: 'radio',\n id: 'threshold-shape',\n value: 'ThresholdCircularBrush',\n values: [\n { value: 'ThresholdCircularBrush', label: i18n.t('Buttons:Circle') },\n { value: 'ThresholdSphereBrush', label: i18n.t('Buttons:Sphere') },\n ],\n commands: ({ value, commandsManager, options }) => {\n const optionsDynamic = options.find(option => option.id === 'dynamic-mode');\n\n if (optionsDynamic.value === 'ThresholdDynamic') {\n commandsManager.run('setToolActive', {\n toolName:\n value === 'ThresholdCircularBrush'\n ? 'ThresholdCircularBrushDynamic'\n : 'ThresholdSphereBrushDynamic',\n });\n } else {\n commandsManager.run('setToolActive', {\n toolName: value,\n });\n }\n },\n },\n {\n name: i18n.t('Buttons:Threshold'),\n type: 'radio',\n id: 'dynamic-mode',\n value: 'ThresholdDynamic',\n values: [\n { value: 'ThresholdDynamic', label: i18n.t('Buttons:Dynamic') },\n { value: 'ThresholdRange', label: i18n.t('Buttons:Range') },\n ],\n commands: ({ value, commandsManager, options }) => {\n const thresholdRangeOption = options.find(option => option.id === 'threshold-shape');\n\n if (value === 'ThresholdDynamic') {\n commandsManager.run('setToolActiveToolbar', {\n toolName:\n thresholdRangeOption.value === 'ThresholdCircularBrush'\n ? 'ThresholdCircularBrushDynamic'\n : 'ThresholdSphereBrushDynamic',\n });\n } else {\n commandsManager.run('setToolActiveToolbar', {\n toolName: thresholdRangeOption.value,\n });\n\n const thresholdRangeValue = options.find(\n option => option.id === 'threshold-range'\n ).value;\n\n commandsManager.run('setThresholdRange', {\n toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],\n value: thresholdRangeValue,\n });\n }\n },\n },\n {\n name: 'ThresholdRange',\n type: 'double-range',\n id: 'threshold-range',\n min: -1000,\n max: 1000,\n step: 1,\n value: [50, 600],\n condition: ({ options }) =>\n options.find(option => option.id === 'dynamic-mode').value === 'ThresholdRange',\n commands: {\n commandName: 'setThresholdRange',\n commandOptions: {\n toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],\n },\n },\n },\n ],\n },\n },\n {\n id: 'Shapes',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-shape',\n label: i18n.t('Buttons:Shapes'),\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircleScissor', 'SphereScissor', 'RectangleScissor'],\n disabledText: i18n.t('Buttons:Create new segmentation to enable shapes tool.'),\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n commands: {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: {\n segmentationRepresentationType: 'Labelmap',\n },\n },\n options: [\n {\n name: i18n.t('Buttons:Shape'),\n type: 'radio',\n value: 'CircleScissor',\n id: 'shape-mode',\n values: [\n { value: 'CircleScissor', label: i18n.t('Buttons:Circle') },\n { value: 'SphereScissor', label: i18n.t('Buttons:Sphere') },\n { value: 'RectangleScissor', label: i18n.t('Buttons:Rectangle') },\n ],\n commands: 'setToolActiveToolbar',\n },\n ],\n },\n },\n {\n id: 'SimplifyContours',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'actions-simplify',\n label: 'Simplify Contours',\n tooltip: 'Simplify Contours',\n commands: ['toggleActiveSegmentationUtility'],\n evaluate: [\n {\n name: 'cornerstone.isActiveSegmentationUtility',\n },\n ],\n options: 'cornerstone.SimplifyContourOptions',\n },\n },\n {\n id: 'SmoothContours',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'actions-smooth',\n label: 'Smooth Contours',\n tooltip: 'Smooth Contours',\n commands: ['toggleActiveSegmentationUtility'],\n evaluate: [\n {\n name: 'cornerstone.isActiveSegmentationUtility',\n },\n ],\n options: 'cornerstone.SmoothContoursOptions',\n },\n },\n {\n id: 'LogicalContourOperations',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'actions-combine',\n label: 'Combine Contours',\n tooltip: 'Combine Contours',\n commands: ['toggleActiveSegmentationUtility'],\n evaluate: [\n {\n name: 'cornerstone.isActiveSegmentationUtility',\n },\n ],\n options: 'cornerstone.LogicalContourOperationsOptions',\n },\n },\n {\n id: 'LabelMapEditWithContour',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'tool-labelmap-edit-with-contour',\n label: i18n.t('Buttons:Labelmap Edit with Contour Tool'),\n tooltip: i18n.t('Buttons:Labelmap Edit with Contour Tool'),\n commands: [\n 'setToolActiveToolbar',\n {\n commandName: 'activateSelectedSegmentationOfType',\n commandOptions: { segmentationRepresentationType: 'Labelmap' },\n },\n ],\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['LabelMapEditWithContour'],\n disabledText: 'Create new segmentation to enable this tool.',\n },\n {\n name: 'evaluate.cornerstone.hasSegmentationOfType',\n segmentationRepresentationType: 'Labelmap',\n },\n ],\n },\n },\n];\n\nexport default toolbarButtons;\n","import { MIN_SEGMENTATION_DRAWING_RADIUS, MAX_SEGMENTATION_DRAWING_RADIUS } from './constants';\n\nconst colours = {\n 'viewport-0': 'rgb(200, 0, 0)',\n 'viewport-1': 'rgb(200, 200, 0)',\n 'viewport-2': 'rgb(0, 200, 0)',\n};\n\nconst colorsByOrientation = {\n axial: 'rgb(200, 0, 0)',\n sagittal: 'rgb(200, 200, 0)',\n coronal: 'rgb(0, 200, 0)',\n};\n\nfunction createTools({ utilityModule, commandsManager }) {\n const { toolNames, Enums } = utilityModule.exports;\n\n const tools = {\n active: [\n { toolName: toolNames.WindowLevel, bindings: [{ mouseButton: Enums.MouseBindings.Primary }] },\n { toolName: toolNames.Pan, bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }] },\n {\n toolName: toolNames.Zoom,\n bindings: [{ mouseButton: Enums.MouseBindings.Secondary }, { numTouchPoints: 2 }],\n },\n {\n toolName: toolNames.StackScroll,\n bindings: [{ mouseButton: Enums.MouseBindings.Wheel }, { numTouchPoints: 3 }],\n },\n ],\n passive: [\n {\n toolName: 'CircularBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'FILL_INSIDE_CIRCLE',\n minRadius: MIN_SEGMENTATION_DRAWING_RADIUS,\n maxRadius: MAX_SEGMENTATION_DRAWING_RADIUS,\n },\n },\n {\n toolName: toolNames.LabelmapSlicePropagation,\n },\n {\n toolName: toolNames.MarkerLabelmap,\n },\n {\n toolName: toolNames.RegionSegmentPlus,\n },\n {\n toolName: 'CircularEraser',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'ERASE_INSIDE_CIRCLE',\n minRadius: MIN_SEGMENTATION_DRAWING_RADIUS,\n maxRadius: MAX_SEGMENTATION_DRAWING_RADIUS,\n },\n },\n {\n toolName: 'SphereBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'FILL_INSIDE_SPHERE',\n minRadius: MIN_SEGMENTATION_DRAWING_RADIUS,\n maxRadius: MAX_SEGMENTATION_DRAWING_RADIUS,\n },\n },\n {\n toolName: 'SphereEraser',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'ERASE_INSIDE_SPHERE',\n minRadius: MIN_SEGMENTATION_DRAWING_RADIUS,\n maxRadius: MAX_SEGMENTATION_DRAWING_RADIUS,\n },\n },\n {\n toolName: 'ThresholdCircularBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_CIRCLE',\n minRadius: MIN_SEGMENTATION_DRAWING_RADIUS,\n maxRadius: MAX_SEGMENTATION_DRAWING_RADIUS,\n },\n },\n {\n toolName: 'ThresholdSphereBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_SPHERE',\n minRadius: MIN_SEGMENTATION_DRAWING_RADIUS,\n maxRadius: MAX_SEGMENTATION_DRAWING_RADIUS,\n },\n },\n {\n toolName: 'ThresholdCircularBrushDynamic',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_CIRCLE',\n minRadius: MIN_SEGMENTATION_DRAWING_RADIUS,\n maxRadius: MAX_SEGMENTATION_DRAWING_RADIUS,\n threshold: {\n isDynamic: true,\n dynamicRadius: 3,\n },\n },\n },\n {\n toolName: toolNames.SegmentBidirectional,\n },\n {\n toolName: toolNames.SegmentSelect,\n },\n {\n toolName: 'ThresholdSphereBrushDynamic',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_SPHERE',\n minRadius: MIN_SEGMENTATION_DRAWING_RADIUS,\n maxRadius: MAX_SEGMENTATION_DRAWING_RADIUS,\n threshold: {\n isDynamic: true,\n dynamicRadius: 3,\n },\n },\n },\n {\n toolName: toolNames.LabelMapEditWithContourTool,\n },\n { toolName: toolNames.CircleScissors },\n { toolName: toolNames.RectangleScissors },\n { toolName: toolNames.SphereScissors },\n { toolName: toolNames.StackScroll },\n { toolName: toolNames.Magnify },\n { toolName: toolNames.WindowLevelRegion },\n\n { toolName: toolNames.UltrasoundDirectional },\n {\n toolName: toolNames.PlanarFreehandContourSegmentation,\n },\n { toolName: toolNames.LivewireContourSegmentation },\n { toolName: toolNames.SculptorTool },\n { toolName: toolNames.PlanarFreehandROI },\n {\n toolName: 'CatmullRomSplineROI',\n parentTool: toolNames.SplineContourSegmentation,\n configuration: {\n spline: {\n type: 'CATMULLROM',\n enableTwoPointPreview: true,\n },\n },\n },\n {\n toolName: 'LinearSplineROI',\n parentTool: toolNames.SplineContourSegmentation,\n configuration: {\n spline: {\n type: 'LINEAR',\n enableTwoPointPreview: true,\n },\n },\n },\n {\n toolName: 'BSplineROI',\n parentTool: toolNames.SplineContourSegmentation,\n configuration: {\n spline: {\n type: 'BSPLINE',\n enableTwoPointPreview: true,\n },\n },\n },\n ],\n disabled: [{ toolName: toolNames.ReferenceLines }, { toolName: toolNames.AdvancedMagnify }],\n };\n\n const updatedTools = commandsManager.run('initializeSegmentLabelTool', { tools });\n\n return updatedTools;\n}\n\nfunction initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const tools = createTools({ commandsManager, 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 servicesManager = extensionManager._servicesManager;\n const { cornerstoneViewportService } = servicesManager.services;\n const tools = createTools({ commandsManager, utilityModule });\n tools.disabled.push(\n {\n toolName: utilityModule.exports.toolNames.Crosshairs,\n configuration: {\n viewportIndicators: true,\n viewportIndicatorsConfig: {\n circleRadius: 5,\n xOffset: 0.95,\n yOffset: 0.05,\n },\n disableOnPassive: true,\n autoPan: {\n enabled: false,\n panSize: 10,\n },\n getReferenceLineColor: viewportId => {\n const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);\n const viewportOptions = viewportInfo?.viewportOptions;\n if (viewportOptions) {\n return (\n colours[viewportOptions.id] ||\n colorsByOrientation[viewportOptions.orientation] ||\n '#0c0'\n );\n } else {\n console.warn('missing viewport?', viewportId);\n return '#0c0';\n }\n },\n },\n },\n { toolName: utilityModule.exports.toolNames.ReferenceLines }\n );\n toolGroupService.createToolGroupAndAddTools('mpr', tools);\n}\n\nfunction initVolume3DToolGroup(extensionManager, toolGroupService) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n\n const { toolNames, Enums } = utilityModule.exports;\n\n const tools = {\n active: [\n {\n toolName: toolNames.TrackballRotateTool,\n bindings: [{ mouseButton: Enums.MouseBindings.Primary }],\n },\n {\n toolName: toolNames.Zoom,\n bindings: [{ mouseButton: Enums.MouseBindings.Secondary }, { numTouchPoints: 2 }],\n },\n {\n toolName: toolNames.Pan,\n bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],\n },\n ],\n };\n\n toolGroupService.createToolGroupAndAddTools('volume3d', tools);\n}\n\nfunction initToolGroups(extensionManager, toolGroupService, commandsManager) {\n initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, 'default');\n initMPRToolGroup(extensionManager, toolGroupService, commandsManager);\n initVolume3DToolGroup(extensionManager, toolGroupService);\n}\n\nexport default initToolGroups;\n","import { id } from './id';\nimport toolbarButtons from './toolbarButtons';\nimport initToolGroups from './initToolGroups';\nimport setUpAutoTabSwitchHandler from './utils/setUpAutoTabSwitchHandler';\nimport { ohif, cornerstone, extensionDependencies, dicomRT, segmentation } from '@ohif/mode-basic';\nexport * from './toolbarButtons';\n\nfunction modeFactory({ modeConfiguration }) {\n const _unsubscriptions = [];\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 }: withAppTypes) => {\n const {\n measurementService,\n toolbarService,\n toolGroupService,\n segmentationService,\n viewportGridService,\n panelService,\n } = servicesManager.services;\n\n measurementService.clearMeasurements();\n\n // Init Default and SR ToolGroups\n initToolGroups(extensionManager, toolGroupService, commandsManager);\n\n toolbarService.register(toolbarButtons);\n\n toolbarService.updateSection(toolbarService.sections.primary, [\n 'WindowLevel',\n 'Pan',\n 'Zoom',\n 'TrackballRotate',\n 'Capture',\n 'Layout',\n 'Crosshairs',\n 'MoreTools',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.topLeft, [\n 'orientationMenu',\n 'dataOverlayMenu',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.bottomMiddle, [\n 'AdvancedRenderingControls',\n ]);\n\n toolbarService.updateSection('AdvancedRenderingControls', [\n 'windowLevelMenuEmbedded',\n 'voiManualControlMenu',\n 'Colorbar',\n 'opacityMenu',\n 'thresholdMenu',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.topRight, [\n 'modalityLoadBadge',\n 'trackingStatus',\n 'navigationComponent',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.bottomLeft, [\n 'windowLevelMenu',\n ]);\n\n toolbarService.updateSection('MoreTools', [\n 'Reset',\n 'rotate-right',\n 'flipHorizontal',\n 'ReferenceLines',\n 'ImageOverlayViewer',\n 'StackScroll',\n 'invert',\n 'Cine',\n 'Magnify',\n 'TagBrowser',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.labelMapSegmentationToolbox, [\n 'LabelMapTools',\n ]);\n toolbarService.updateSection(toolbarService.sections.contourSegmentationToolbox, [\n 'ContourTools',\n ]);\n\n toolbarService.updateSection('LabelMapTools', [\n 'LabelmapSlicePropagation',\n 'BrushTools',\n 'MarkerLabelmap',\n 'RegionSegmentPlus',\n 'Shapes',\n 'LabelMapEditWithContour',\n ]);\n toolbarService.updateSection('ContourTools', [\n 'PlanarFreehandContourSegmentationTool',\n 'SculptorTool',\n 'SplineContourSegmentationTool',\n 'LivewireContourSegmentationTool',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.labelMapSegmentationUtilities, [\n 'LabelMapUtilities',\n ]);\n toolbarService.updateSection(toolbarService.sections.contourSegmentationUtilities, [\n 'ContourUtilities',\n ]);\n\n toolbarService.updateSection('LabelMapUtilities', [\n 'InterpolateLabelmap',\n 'SegmentBidirectional',\n ]);\n toolbarService.updateSection('ContourUtilities', [\n 'LogicalContourOperations',\n 'SimplifyContours',\n 'SmoothContours',\n ]);\n\n toolbarService.updateSection('BrushTools', ['Brush', 'Eraser', 'Threshold']);\n\n const { unsubscribeAutoTabSwitchEvents } = setUpAutoTabSwitchHandler({\n segmentationService,\n viewportGridService,\n panelService,\n });\n\n _unsubscriptions.push(...unsubscribeAutoTabSwitchEvents);\n },\n onModeExit: ({ servicesManager }: withAppTypes) => {\n const {\n toolGroupService,\n syncGroupService,\n segmentationService,\n cornerstoneViewportService,\n uiDialogService,\n uiModalService,\n } = servicesManager.services;\n\n _unsubscriptions.forEach(unsubscribe => unsubscribe());\n _unsubscriptions.length = 0;\n\n uiDialogService.hideAll();\n uiModalService.hide();\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. Currently we don't have stack viewport\n * segmentations and we should exclude them\n */\n isValidMode: ({ modalities }) => {\n // Don't show the mode if the selected studies have only one modality\n // that is not supported by the mode\n const modalitiesArray = modalities.split('\\\\');\n return {\n valid:\n modalitiesArray.length === 1\n ? !['SM', 'ECG', 'OT', 'DOC'].includes(modalitiesArray[0])\n : true,\n description:\n 'The mode does not support studies that ONLY include the following modalities: SM, OT, DOC',\n };\n },\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.thumbnailList],\n leftPanelResizable: true,\n rightPanels: [\n cornerstone.labelMapSegmentationPanel,\n cornerstone.contourSegmentationPanel,\n ],\n rightPanelResizable: true,\n // leftPanelClosed: true,\n viewports: [\n {\n namespace: cornerstone.viewport,\n displaySetsToDisplay: [ohif.sopClassHandler],\n },\n {\n namespace: segmentation.viewport,\n displaySetsToDisplay: [segmentation.sopClassHandler],\n },\n {\n namespace: dicomRT.viewport,\n displaySetsToDisplay: [dicomRT.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 // Commented out to just use the most applicable registered hanging protocol\n // The example is used for a grid layout to specify that as a preferred layout\n hangingProtocol: ['@ohif/mnGrid'],\n /** SopClassHandlers used by the mode */\n sopClassHandlers: [ohif.sopClassHandler, segmentation.sopClassHandler, dicomRT.sopClassHandler],\n };\n}\n\nconst mode = {\n id,\n modeFactory,\n extensionDependencies,\n};\n\nexport default mode;\n","/**\n * Sets up auto tab switching for when the first segmentation is added into the viewer.\n */\nexport default function setUpAutoTabSwitchHandler({\n segmentationService,\n viewportGridService,\n panelService,\n}) {\n const autoTabSwitchEvents = [\n segmentationService.EVENTS.SEGMENTATION_MODIFIED,\n segmentationService.EVENTS.SEGMENTATION_REPRESENTATION_MODIFIED,\n ];\n\n // Initially there are no segmentations, so we should switch the tab whenever the first segmentation is added.\n let shouldSwitchTab = true;\n\n const unsubscribeAutoTabSwitchEvents = autoTabSwitchEvents\n .map(eventName =>\n segmentationService.subscribe(eventName, () => {\n const segmentations = segmentationService.getSegmentations();\n\n if (!segmentations.length) {\n // If all the segmentations are removed, then the next time a segmentation is added, we should switch the tab.\n shouldSwitchTab = true;\n return;\n }\n\n const activeViewportId = viewportGridService.getActiveViewportId();\n const activeRepresentation = segmentationService\n .getSegmentationRepresentations(activeViewportId)\n ?.find(representation => representation.active);\n\n if (activeRepresentation && shouldSwitchTab) {\n shouldSwitchTab = false;\n\n switch (activeRepresentation.type) {\n case 'Labelmap':\n panelService.activatePanel(\n '@ohif/extension-cornerstone.panelModule.panelSegmentationWithToolsLabelMap',\n true\n );\n break;\n case 'Contour':\n panelService.activatePanel(\n '@ohif/extension-cornerstone.panelModule.panelSegmentationWithToolsContour',\n true\n );\n break;\n }\n }\n })\n )\n .map(subscription => subscription.unsubscribe);\n\n return { unsubscribeAutoTabSwitchEvents };\n}\n"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__498__","__WEBPACK_EXTERNAL_MODULE__310__","__WEBPACK_EXTERNAL_MODULE__110__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","id","packageJson","MIN_SEGMENTATION_DRAWING_RADIUS","MAX_SEGMENTATION_DRAWING_RADIUS","setToolActiveToolbar","commandName","commandOptions","toolGroupIds","callbacks","toolName","toolbarButtons","uiType","props","buttonSection","icon","label","i18n","tooltip","evaluate","name","hideWhenDisabled","type","commands","disabledText","unsupportedViewportTypes","rows","columns","toolNames","segmentationRepresentationType","bindings","mouseButton","modifierKey","options","values","radiusOptionId","explicitRunOnly","min","max","step","listeners","ViewportGridService","EVENTS","ACTIVE_VIEWPORT_ID_CHANGED","VIEWPORTS_READY","commandsManager","find","option","run","thresholdRangeOption","thresholdRangeValue","condition","colours","colorsByOrientation","axial","sagittal","coronal","createTools","utilityModule","Enums","tools","active","WindowLevel","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","numTouchPoints","StackScroll","Wheel","passive","parentTool","configuration","activeStrategy","minRadius","maxRadius","LabelmapSlicePropagation","MarkerLabelmap","RegionSegmentPlus","threshold","isDynamic","dynamicRadius","SegmentBidirectional","SegmentSelect","LabelMapEditWithContourTool","CircleScissors","RectangleScissors","SphereScissors","Magnify","WindowLevelRegion","UltrasoundDirectional","PlanarFreehandContourSegmentation","LivewireContourSegmentation","SculptorTool","PlanarFreehandROI","SplineContourSegmentation","spline","enableTwoPointPreview","disabled","ReferenceLines","AdvancedMagnify","modeFactory","modeConfiguration","_unsubscriptions","routeName","displayName","onModeEnter","servicesManager","extensionManager","measurementService","toolbarService","toolGroupService","segmentationService","viewportGridService","panelService","services","clearMeasurements","getModuleEntry","createToolGroupAndAddTools","initDefaultToolGroup","_servicesManager","cornerstoneViewportService","push","Crosshairs","viewportIndicators","viewportIndicatorsConfig","circleRadius","xOffset","yOffset","disableOnPassive","autoPan","enabled","panSize","getReferenceLineColor","viewportId","viewportInfo","getViewportInfo","viewportOptions","orientation","console","warn","initMPRToolGroup","TrackballRotateTool","initVolume3DToolGroup","initToolGroups","register","updateSection","sections","primary","viewportActionMenu","topLeft","bottomMiddle","topRight","bottomLeft","labelMapSegmentationToolbox","contourSegmentationToolbox","labelMapSegmentationUtilities","contourSegmentationUtilities","unsubscribeAutoTabSwitchEvents","autoTabSwitchEvents","SEGMENTATION_MODIFIED","SEGMENTATION_REPRESENTATION_MODIFIED","shouldSwitchTab","map","eventName","subscribe","getSegmentations","length","activeViewportId","getActiveViewportId","activeRepresentation","getSegmentationRepresentations","representation","activatePanel","subscription","unsubscribe","setUpAutoTabSwitchHandler","onModeExit","syncGroupService","uiDialogService","uiModalService","forEach","hideAll","hide","destroy","validationTags","study","series","isValidMode","modalities","modalitiesArray","split","valid","includes","description","routes","path","layoutTemplate","location","ohif","layout","leftPanels","thumbnailList","leftPanelResizable","rightPanels","cornerstone","labelMapSegmentationPanel","contourSegmentationPanel","rightPanelResizable","viewports","namespace","viewport","displaySetsToDisplay","sopClassHandler","segmentation","dicomRT","extensions","extensionDependencies","hangingProtocol","sopClassHandlers"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohif/mode-segmentation",
3
- "version": "3.12.0-beta.12",
3
+ "version": "3.12.0-beta.121",
4
4
  "description": "OHIF segmentation mode which enables labelmap segmentation read/edit/export",
5
5
  "author": "@ohif",
6
6
  "license": "MIT",
@@ -35,43 +35,44 @@
35
35
  "test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
36
36
  },
37
37
  "peerDependencies": {
38
- "@ohif/core": "3.12.0-beta.12",
39
- "@ohif/extension-cornerstone": "3.12.0-beta.12",
40
- "@ohif/extension-cornerstone-dicom-rt": "3.12.0-beta.12",
41
- "@ohif/extension-cornerstone-dicom-seg": "3.12.0-beta.12",
42
- "@ohif/extension-cornerstone-dicom-sr": "3.12.0-beta.12",
43
- "@ohif/extension-default": "3.12.0-beta.12",
44
- "@ohif/extension-dicom-pdf": "3.12.0-beta.12",
45
- "@ohif/extension-dicom-video": "3.12.0-beta.12"
38
+ "@ohif/core": "3.12.0-beta.121",
39
+ "@ohif/extension-cornerstone": "3.12.0-beta.121",
40
+ "@ohif/extension-cornerstone-dicom-rt": "3.12.0-beta.121",
41
+ "@ohif/extension-cornerstone-dicom-seg": "3.12.0-beta.121",
42
+ "@ohif/extension-cornerstone-dicom-sr": "3.12.0-beta.121",
43
+ "@ohif/extension-default": "3.12.0-beta.121",
44
+ "@ohif/extension-dicom-pdf": "3.12.0-beta.121",
45
+ "@ohif/extension-dicom-video": "3.12.0-beta.121",
46
+ "@ohif/mode-basic": "3.12.0-beta.121"
46
47
  },
47
48
  "dependencies": {
48
- "@babel/runtime": "^7.20.13",
49
- "i18next": "^17.0.3"
49
+ "@babel/runtime": "7.28.2",
50
+ "i18next": "17.3.1"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@babel/core": "7.28.0",
53
54
  "@babel/eslint-parser": "7.28.0",
54
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
55
- "@babel/plugin-transform-arrow-functions": "^7.16.7",
56
- "@babel/plugin-transform-class-properties": "^7.27.1",
57
- "@babel/plugin-transform-object-rest-spread": "^7.28.0",
58
- "@babel/plugin-transform-private-methods": "^7.27.1",
59
- "@babel/plugin-transform-regenerator": "^7.16.7",
55
+ "@babel/plugin-syntax-dynamic-import": "7.8.3",
56
+ "@babel/plugin-transform-arrow-functions": "7.27.1",
57
+ "@babel/plugin-transform-class-properties": "7.27.1",
58
+ "@babel/plugin-transform-object-rest-spread": "7.28.0",
59
+ "@babel/plugin-transform-private-methods": "7.27.1",
60
+ "@babel/plugin-transform-regenerator": "7.28.1",
60
61
  "@babel/plugin-transform-runtime": "7.28.0",
61
- "@babel/plugin-transform-typescript": "^7.28.0",
62
+ "@babel/plugin-transform-typescript": "7.28.0",
62
63
  "@babel/preset-env": "7.28.0",
63
- "@babel/preset-react": "^7.27.1",
64
- "@babel/preset-typescript": "^7.27.1",
65
- "@svgr/webpack": "^8.1.0",
66
- "babel-loader": "^8.0.0-beta.4",
67
- "clean-webpack-plugin": "^4.0.0",
68
- "copy-webpack-plugin": "^10.2.0",
69
- "cross-env": "^7.0.3",
70
- "dotenv": "^14.1.0",
71
- "eslint": "^8.39.0",
72
- "eslint-loader": "^2.0.0",
64
+ "@babel/preset-react": "7.27.1",
65
+ "@babel/preset-typescript": "7.27.1",
66
+ "@svgr/webpack": "8.1.0",
67
+ "babel-loader": "8.4.1",
68
+ "clean-webpack-plugin": "3.0.0",
69
+ "copy-webpack-plugin": "9.1.0",
70
+ "cross-env": "7.0.3",
71
+ "dotenv": "8.6.0",
72
+ "eslint": "8.57.1",
73
+ "eslint-loader": "2.2.1",
73
74
  "webpack": "5.95.0",
74
- "webpack-cli": "^4.7.2",
75
- "webpack-merge": "^5.7.3"
75
+ "webpack-cli": "5.1.4",
76
+ "webpack-merge": "5.10.0"
76
77
  }
77
78
  }