@ohif/mode-segmentation 3.12.0-beta.90 → 3.12.0-beta.91

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"),require("i18next")):"function"==typeof define&&define.amd?define("@ohif/mode-segmentation",["@ohif/core","i18next"],o):"object"==typeof exports?exports["@ohif/mode-segmentation"]=o(require("@ohif/core"),require("i18next")):e["@ohif/mode-segmentation"]=o(e["@ohif/core"],e.i18next)}("undefined"!=typeof self?self:this,(e,o)=>(()=>{"use strict";var t={498:o=>{o.exports=e},310:e=>{e.exports=o}},n={};function a(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,a),i.exports}a.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return a.d(o,{a:o}),o},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:()=>B});const l=JSON.parse('{"UU":"@ohif/mode-segmentation"}').UU;var s=a(498),r=a(310),u=a.n(r);const m=.5,p=99.5,c={commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["default","mpr","SRToolGroup","volume3d"]}},d=e=>[{commandName:"setViewportForToolConfiguration",commandOptions:{toolName:e}}],h=[{id:"AdvancedRenderingControls",uiType:"ohif.advancedRenderingControls",props:{buttonSection:!0}},{id:"modalityLoadBadge",uiType:"ohif.modalityLoadBadge",props:{icon:"Status",label:u().t("Buttons:Status"),tooltip:u().t("Buttons:Status"),evaluate:{name:"evaluate.modalityLoadBadge",hideWhenDisabled:!0}}},{id:"navigationComponent",uiType:"ohif.navigationComponent",props:{icon:"Navigation",label:u().t("Buttons:Navigation"),tooltip:u().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:u().t("Buttons:Tracking Status"),tooltip:u().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:u().t("Buttons:Data Overlay"),tooltip:u().t("Buttons:Configure data overlay options and manage foreground/background display sets"),evaluate:"evaluate.dataOverlayMenu"}},{id:"orientationMenu",uiType:"ohif.orientationMenu",props:{icon:"OrientationSwitch",label:u().t("Buttons:Orientation"),tooltip:u().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:u().t("Buttons:Window Level"),tooltip:u().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:u().t("Buttons:Window Level"),tooltip:u().t("Buttons:Adjust window/level presets and customize image contrast settings"),evaluate:"evaluate.windowLevelMenu"}},{id:"voiManualControlMenu",uiType:"ohif.voiManualControlMenu",props:{icon:"WindowLevelAdvanced",label:u().t("Buttons:Advanced Window Level"),tooltip:u().t("Buttons:Advanced window/level settings with manual controls and presets"),evaluate:"evaluate.voiManualControlMenu"}},{id:"thresholdMenu",uiType:"ohif.thresholdMenu",props:{icon:"Threshold",label:u().t("Buttons:Threshold"),tooltip:u().t("Buttons:Image threshold settings"),evaluate:{name:"evaluate.thresholdMenu",hideWhenDisabled:!0}}},{id:"opacityMenu",uiType:"ohif.opacityMenu",props:{icon:"Opacity",label:u().t("Buttons:Opacity"),tooltip:u().t("Buttons:Image opacity settings"),evaluate:{name:"evaluate.opacityMenu",hideWhenDisabled:!0}}},{id:"Colorbar",uiType:"ohif.colorbar",props:{type:"tool",label:u().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:u().t("Buttons:Zoom"),commands:c,evaluate:"evaluate.cornerstoneTool"}},{id:"WindowLevel",uiType:"ohif.toolButton",props:{icon:"tool-window-level",label:u().t("Buttons:Window Level"),commands:c,evaluate:"evaluate.cornerstoneTool"}},{id:"Pan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:u().t("Buttons:Pan"),commands:c,evaluate:"evaluate.cornerstoneTool"}},{id:"TrackballRotate",uiType:"ohif.toolButton",props:{type:"tool",icon:"tool-3d-rotate",label:u().t("Buttons:3D Rotate"),commands:c,evaluate:{name:"evaluate.cornerstoneTool",disabledText:u().t("Buttons:Select a 3D viewport to enable this tool")}}},{id:"Capture",uiType:"ohif.toolButton",props:{icon:"tool-capture",label:u().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:u().t("Buttons:Crosshairs"),commands:{commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["mpr"]}},evaluate:{name:"evaluate.cornerstoneTool",disabledText:u().t("Buttons:Select an MPR viewport to enable this tool")}}},{id:"Reset",uiType:"ohif.toolButton",props:{icon:"tool-reset",label:u().t("Buttons:Reset View"),tooltip:u().t("Buttons:Reset View"),commands:"resetViewport",evaluate:"evaluate.action"}},{id:"rotate-right",uiType:"ohif.toolButton",props:{icon:"tool-rotate-right",label:u().t("Buttons:Rotate Right"),tooltip:u().t("Buttons:Rotate +90"),commands:"rotateViewportCW",evaluate:"evaluate.action"}},{id:"flipHorizontal",uiType:"ohif.toolButton",props:{icon:"tool-flip-horizontal",label:u().t("Buttons:Flip Horizontal"),tooltip:u().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:u().t("Buttons:Reference Lines"),tooltip:u().t("Buttons:Show Reference Lines"),commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"ImageOverlayViewer",uiType:"ohif.toolButton",props:{icon:"toggle-dicom-overlay",label:u().t("Buttons:Image Overlay"),tooltip:u().t("Buttons:Toggle Image Overlay"),commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"StackScroll",uiType:"ohif.toolButton",props:{icon:"tool-stack-scroll",label:u().t("Buttons:Stack Scroll"),tooltip:u().t("Buttons:Stack Scroll"),commands:c,evaluate:"evaluate.cornerstoneTool"}},{id:"invert",uiType:"ohif.toolButton",props:{icon:"tool-invert",label:u().t("Buttons:Invert"),tooltip:u().t("Buttons:Invert Colors"),commands:"invertViewport",evaluate:"evaluate.viewportProperties.toggle"}},{id:"Cine",uiType:"ohif.toolButton",props:{icon:"tool-cine",label:u().t("Buttons:Cine"),tooltip:u().t("Buttons:Cine"),commands:"toggleCine",evaluate:["evaluate.cine",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"Magnify",uiType:"ohif.toolButton",props:{icon:"tool-magnify",label:u().t("Buttons:Zoom-in"),tooltip:u().t("Buttons:Zoom-in"),commands:c,evaluate:"evaluate.cornerstoneTool"}},{id:"TagBrowser",uiType:"ohif.toolButton",props:{icon:"dicom-tag-browser",label:u().t("Buttons:Dicom Tag Browser"),tooltip:u().t("Buttons:Dicom Tag Browser"),commands:"openDICOMTagViewer"}},{id:"PlanarFreehandContourSegmentationTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-freehand-roi",label:"Freehand Segmentation",tooltip:"Freehand Segmentation",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["PlanarFreehandContourSegmentationTool"],disabledText:"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:"Interpolate Contours",type:"switch",id:"planarFreehandInterpolateContours",value:!1,commands:{commandName:"setInterpolationToolConfiguration"}}]}},{id:"LivewireContourSegmentationTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-livewire",label:"Livewire Contour",tooltip:"Livewire Contour",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["LivewireContourSegmentationTool"],disabledText:"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:"Interpolate Contours",type:"switch",id:"livewireInterpolateContours",value:!1,commands:{commandName:"setInterpolationToolConfiguration"}}]}},{id:"SplineContourSegmentationTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-spline-roi",label:"Spline Contour Segmentation Tool",tooltip:"Spline Contour Segmentation Tool",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["CatmullRomSplineROI","LinearSplineROI","BSplineROI"],disabledText:"Create new segmentation to enable this tool."},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Contour"}],commands:[{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Contour"}}],options:[{name:"Spline Type",type:"select",id:"splineTypeSelect",value:"CatmullRomSplineROI",values:[{id:"CatmullRomSplineROI",value:"CatmullRomSplineROI",label:"Catmull Rom Spline"},{id:"LinearSplineROI",value:"LinearSplineROI",label:"Linear Spline"},{id:"BSplineROI",value:"BSplineROI",label:"B-Spline"}],commands:{commandName:"setToolActiveToolbar",commandOptions:{bindings:[{mouseButton:1},{mouseButton:1,modifierKey:16}]}}},{name:"Simplified Spline",type:"switch",id:"simplifiedSpline",value:!0,commands:{commandName:"setSimplifiedSplineForSplineContourSegmentationTool"}},{name:"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:"Sculptor Tool",tooltip:"Sculptor Tool",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["SculptorTool"],disabledText:"Create new segmentation to enable this tool."},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Contour"}],commands:["setToolActiveToolbar",{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Contour"}}],options:[{name:"Dynamic Cursor Size",type:"switch",id:"dynamicCursorSize",value:!0,commands:{commandName:"setDynamicCursorSizeForSculptorTool"}}]}},{id:"Brush",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-brush",label:u().t("Buttons:Brush"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["CircularBrush","SphereBrush"],disabledText:u().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:"Radius (mm)",id:"brush-radius",type:"range",explicitRunOnly:!0,min:m,max:p,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.toolButton",props:{icon:"actions-interpolate",label:u().t("Buttons:Interpolate Labelmap"),tooltip:u().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:u().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:u().t("Buttons:Segment Bidirectional"),tooltip:u().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:u().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:u().t("Buttons:One Click Segment"),tooltip:u().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:u().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:u().t("Buttons:Labelmap Assist"),tooltip:u().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:{[s.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:d("LabelmapSlicePropagation"),[s.ViewportGridService.EVENTS.VIEWPORTS_READY]:d("LabelmapSlicePropagation")},commands:[{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}},"toggleEnabledDisabledToolbar"]}},{id:"MarkerLabelmap",uiType:"ohif.toolBoxButton",props:{icon:"icon-marker-labelmap",label:u().t("Buttons:Marker Guided Labelmap"),tooltip:u().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:{[s.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:d("MarkerLabelmap"),[s.ViewportGridService.EVENTS.VIEWPORTS_READY]:d("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:u().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:"Radius (mm)",id:"eraser-radius",type:"range",explicitRunOnly:!0,min:m,max:p,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"}],commands:{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}}}},{id:"Threshold",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-threshold",label:"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:"Radius (mm)",id:"threshold-radius",type:"range",explicitRunOnly:!0,min:m,max:p,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 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:u().t("Buttons:Shapes"),evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["CircleScissor","SphereScissor","RectangleScissor"],disabledText:u().t("Buttons:Create new segmentation to enable shapes tool.")},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Labelmap"}],commands:{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}},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:"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:"Labelmap Edit with Contour Tool",tooltip:"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"}]}}],g={"viewport-0":"rgb(200, 0, 0)","viewport-1":"rgb(200, 200, 0)","viewport-2":"rgb(0, 200, 0)"},v={axial:"rgb(200, 0, 0)",sagittal:"rgb(200, 200, 0)",coronal:"rgb(0, 200, 0)"};function T({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:m,maxRadius:p}},{toolName:t.LabelmapSlicePropagation},{toolName:t.MarkerLabelmap},{toolName:t.RegionSegmentPlus},{toolName:"CircularEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_CIRCLE",minRadius:m,maxRadius:p}},{toolName:"SphereBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_SPHERE",minRadius:m,maxRadius:p}},{toolName:"SphereEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_SPHERE",minRadius:m,maxRadius:p}},{toolName:"ThresholdCircularBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE",minRadius:m,maxRadius:p}},{toolName:"ThresholdSphereBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE",minRadius:m,maxRadius:p}},{toolName:"ThresholdCircularBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE",minRadius:m,maxRadius:p,threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:t.SegmentBidirectional},{toolName:t.SegmentSelect},{toolName:"ThresholdSphereBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE",minRadius:m,maxRadius:p,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})}const S="@ohif/extension-default.sopClassHandlerModule.stack",y="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",b="@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt",f={"@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"},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:l,segmentationService:s,viewportGridService:r,panelService:u}=e.services;a.clearMeasurements(),function(e,o,t){!function(e,o,t){const n=T({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,l=T({commandsManager:t,utilityModule:n});l.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?g[t.id]||v[t.orientation]||"#0c0":(console.warn("missing viewport?",e),"#0c0")}}},{toolName:n.exports.toolNames.ReferenceLines}),o.createToolGroupAndAddTools("mpr",l)}(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,l,n),i.register(h),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:s,viewportGridService:r,panelService:u});o.push(...m)},onModeExit:({servicesManager:e})=>{const{toolGroupService:t,syncGroupService:n,segmentationService:a,cornerstoneViewportService:i,uiDialogService:l,uiModalService:s}=e.services;o.forEach(e=>e()),o.length=0,l.hideAll(),s.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:"@ohif/extension-default.layoutTemplateModule.viewerLayout",props:{leftPanels:["@ohif/extension-default.panelModule.seriesList"],leftPanelResizable:!0,rightPanels:["@ohif/extension-cornerstone.panelModule.panelSegmentationWithToolsLabelMap","@ohif/extension-cornerstone.panelModule.panelSegmentationWithToolsContour"],rightPanelResizable:!0,viewports:[{namespace:"@ohif/extension-cornerstone.viewportModule.cornerstone",displaySetsToDisplay:[S]},{namespace:"@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",displaySetsToDisplay:[y]},{namespace:"@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt",displaySetsToDisplay:[b]}]}})}],extensions:f,hangingProtocol:["@ohif/mnGrid"],sopClassHandlers:[S,y,b]}},extensionDependencies:f};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 l={};i.r(l),i.d(l,{default:()=>f,toolbarButtons:()=>g});const s=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:"Freehand Segmentation",tooltip:"Freehand Segmentation",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["PlanarFreehandContourSegmentationTool"],disabledText:"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:"Interpolate Contours",type:"switch",id:"planarFreehandInterpolateContours",value:!1,commands:{commandName:"setInterpolationToolConfiguration"}}]}},{id:"LivewireContourSegmentationTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-livewire",label:"Livewire Contour",tooltip:"Livewire Contour",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["LivewireContourSegmentationTool"],disabledText:"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:"Interpolate Contours",type:"switch",id:"livewireInterpolateContours",value:!1,commands:{commandName:"setInterpolationToolConfiguration"}}]}},{id:"SplineContourSegmentationTool",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-spline-roi",label:"Spline Contour Segmentation Tool",tooltip:"Spline Contour Segmentation Tool",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["CatmullRomSplineROI","LinearSplineROI","BSplineROI"],disabledText:"Create new segmentation to enable this tool."},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Contour"}],commands:[{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Contour"}}],options:[{name:"Spline Type",type:"select",id:"splineTypeSelect",value:"CatmullRomSplineROI",values:[{id:"CatmullRomSplineROI",value:"CatmullRomSplineROI",label:"Catmull Rom Spline"},{id:"LinearSplineROI",value:"LinearSplineROI",label:"Linear Spline"},{id:"BSplineROI",value:"BSplineROI",label:"B-Spline"}],commands:{commandName:"setToolActiveToolbar",commandOptions:{bindings:[{mouseButton:1},{mouseButton:1,modifierKey:16}]}}},{name:"Simplified Spline",type:"switch",id:"simplifiedSpline",value:!0,commands:{commandName:"setSimplifiedSplineForSplineContourSegmentationTool"}},{name:"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:"Sculptor Tool",tooltip:"Sculptor Tool",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["SculptorTool"],disabledText:"Create new segmentation to enable this tool."},{name:"evaluate.cornerstone.hasSegmentationOfType",segmentationRepresentationType:"Contour"}],commands:["setToolActiveToolbar",{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Contour"}}],options:[{name:"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:"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:"Shape",type:"radio",id:"brush-mode",value:"CircularBrush",values:[{value:"CircularBrush",label:"Circle"},{value:"SphereBrush",label:"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:"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: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:"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:"Shape",type:"radio",id:"eraser-mode",value:"CircularEraser",values:[{value:"CircularEraser",label:"Circle"},{value:"SphereEraser",label:"Sphere"}],commands:"setToolActiveToolbar"}],commands:{commandName:"activateSelectedSegmentationOfType",commandOptions:{segmentationRepresentationType:"Labelmap"}}}},{id:"Threshold",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-threshold",label:"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:"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:"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 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:"Shape",type:"radio",value:"CircleScissor",id:"shape-mode",values:[{value:"CircleScissor",label:"Circle"},{value:"SphereScissor",label:"Sphere"},{value:"RectangleScissor",label:"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:"Labelmap Edit with Contour Tool",tooltip:"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 f={id:s,modeFactory:function({modeConfiguration:e}){const o=[];return{id:s,routeName:"segmentation",displayName:"Segmentation",onModeEnter:({servicesManager:e,extensionManager:t,commandsManager:n})=>{const{measurementService:a,toolbarService:i,toolGroupService:l,segmentationService:s,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,l=y({commandsManager:t,utilityModule:n});l.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",l)}(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,l,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:s,viewportGridService:r,panelService:u});o.push(...m)},onModeExit:({servicesManager:e})=>{const{toolGroupService:t,syncGroupService:n,segmentationService:a,cornerstoneViewportService:i,uiDialogService:l,uiModalService:s}=e.services;o.forEach(e=>e()),o.length=0,l.hideAll(),s.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 l})());
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,cAAeA,QAAQ,YAC/B,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,0BAA2B,CAAC,aAAc,WAAYJ,GACnC,iBAAZC,QACdA,QAAQ,2BAA6BD,EAAQG,QAAQ,cAAeA,QAAQ,YAE5EJ,EAAK,2BAA6BC,EAAQD,EAAK,cAAeA,EAAc,QAC7E,CATD,CASmB,oBAATO,KAAuBA,KAAOC,KAAM,CAACC,EAAkCC,I,kCCTjFP,EAAOD,QAAUO,C,UCAjBN,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EA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E1BY,EAAgBG,UAChBF,EAAeG,OACfzE,EAAiB0E,UACjBN,EAAiBM,UACjBzE,EAAoByE,UACpBhE,EAA2BgE,WAG7BC,eAAgB,CACdC,MAAO,GACPC,OAAQ,IAOVC,YAAaA,EAAGC,iBAGd,MAAMC,EAAkBD,EAAWE,MAAM,MACzC,MAAO,CACLC,MAC6B,IAA3BF,EAAgBvB,SACX,CAAC,KAAM,MAAO,KAAM,OAAO0B,SAASH,EAAgB,IAE3DI,YACE,8FAeNC,OAAQ,CACN,CACEC,KAAM,WACNC,eAAgBA,EAAGC,WAAU5F,sBACpB,CACL/G,GAtOF,4DAuOEW,MAAO,CACLiM,WAAY,CArOb,kDAsOCC,oBAAoB,EACpBC,YAAa,CAjOvB,6EAEA,6EAmOUC,qBAAqB,EAErBC,UAAW,CACT,CACEC,UA3ON,yDA4OMC,qBAAsB,CAAC7G,IAEzB,CACE4G,UArON,iEAsOMC,qBAAsB,CAAC5G,IAEzB,CACE2G,UArON,+DAsOMC,qBAAsB,CAAC3G,UASrC4G,WAAY3G,EAIZ4G,gBAAiB,CAAC,gBAElBC,iBAAkB,CAAChH,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/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\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@ohif/mode-segmentation\", [\"@ohif/core\", \"i18next\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@ohif/mode-segmentation\"] = factory(require(\"@ohif/core\"), require(\"i18next\"));\n\telse\n\t\troot[\"@ohif/mode-segmentation\"] = factory(root[\"@ohif/core\"], root[\"i18next\"]);\n})(typeof self !== 'undefined' ? self : this, (__WEBPACK_EXTERNAL_MODULE__498__, __WEBPACK_EXTERNAL_MODULE__310__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__498__;","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\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: 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: 'Freehand Segmentation',\n tooltip: 'Freehand Segmentation',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['PlanarFreehandContourSegmentationTool'],\n disabledText: '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: '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: 'Livewire Contour',\n tooltip: 'Livewire Contour',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['LivewireContourSegmentationTool'],\n disabledText: '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: '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: 'Spline Contour Segmentation Tool',\n tooltip: 'Spline Contour Segmentation Tool',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CatmullRomSplineROI', 'LinearSplineROI', 'BSplineROI'],\n disabledText: '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: 'Spline Type',\n type: 'select',\n id: 'splineTypeSelect',\n value: 'CatmullRomSplineROI',\n values: [\n {\n id: 'CatmullRomSplineROI',\n value: 'CatmullRomSplineROI',\n label: 'Catmull Rom Spline',\n },\n { id: 'LinearSplineROI', value: 'LinearSplineROI', label: 'Linear Spline' },\n { id: 'BSplineROI', value: 'BSplineROI', label: '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: 'Simplified Spline',\n type: 'switch',\n id: 'simplifiedSpline',\n value: true,\n commands: {\n commandName: 'setSimplifiedSplineForSplineContourSegmentationTool',\n },\n },\n {\n name: '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: 'Sculptor Tool',\n tooltip: 'Sculptor Tool',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['SculptorTool'],\n disabledText: '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: '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: '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: '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.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: '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: 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: '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: '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 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: '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: '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: '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: 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: '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: '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: 'Labelmap Edit with Contour Tool',\n tooltip: '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';\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 labelMapSegmentationPanel:\n '@ohif/extension-cornerstone.panelModule.panelSegmentationWithToolsLabelMap',\n contourSegmentationPanel:\n '@ohif/extension-cornerstone.panelModule.panelSegmentationWithToolsContour',\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 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.leftPanel],\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_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","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","ohif","segmentation","dicomRT","extensionDependencies","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","toolbarButtons","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","leftPanels","leftPanelResizable","rightPanels","rightPanelResizable","viewports","namespace","displaySetsToDisplay","extensions","hangingProtocol","sopClassHandlers"],"sourceRoot":""}
1
+ {"version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AA,aAAaD,kBAEtC,CACEH,UAAWK,EAAAA,QAAQJ,SACnBC,qBAAsB,CAACG,EAAAA,QAAQF,wBAS7CG,WAAYC,EAAAA,sBAIZC,gBAAiB,CAAC,gBAElBC,iBAAkB,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: 'Freehand Segmentation',\n tooltip: 'Freehand Segmentation',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['PlanarFreehandContourSegmentationTool'],\n disabledText: '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: '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: 'Livewire Contour',\n tooltip: 'Livewire Contour',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['LivewireContourSegmentationTool'],\n disabledText: '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: '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: 'Spline Contour Segmentation Tool',\n tooltip: 'Spline Contour Segmentation Tool',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CatmullRomSplineROI', 'LinearSplineROI', 'BSplineROI'],\n disabledText: '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: 'Spline Type',\n type: 'select',\n id: 'splineTypeSelect',\n value: 'CatmullRomSplineROI',\n values: [\n {\n id: 'CatmullRomSplineROI',\n value: 'CatmullRomSplineROI',\n label: 'Catmull Rom Spline',\n },\n { id: 'LinearSplineROI', value: 'LinearSplineROI', label: 'Linear Spline' },\n { id: 'BSplineROI', value: 'BSplineROI', label: '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: 'Simplified Spline',\n type: 'switch',\n id: 'simplifiedSpline',\n value: true,\n commands: {\n commandName: 'setSimplifiedSplineForSplineContourSegmentationTool',\n },\n },\n {\n name: '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: 'Sculptor Tool',\n tooltip: 'Sculptor Tool',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['SculptorTool'],\n disabledText: '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: '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: '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: '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.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: '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: 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: '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: '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 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: '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: '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: '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: 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: '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: '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: 'Labelmap Edit with Contour Tool',\n tooltip: '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.90",
3
+ "version": "3.12.0-beta.91",
4
4
  "description": "OHIF segmentation mode which enables labelmap segmentation read/edit/export",
5
5
  "author": "@ohif",
6
6
  "license": "MIT",
@@ -35,14 +35,15 @@
35
35
  "test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
36
36
  },
37
37
  "peerDependencies": {
38
- "@ohif/core": "3.12.0-beta.90",
39
- "@ohif/extension-cornerstone": "3.12.0-beta.90",
40
- "@ohif/extension-cornerstone-dicom-rt": "3.12.0-beta.90",
41
- "@ohif/extension-cornerstone-dicom-seg": "3.12.0-beta.90",
42
- "@ohif/extension-cornerstone-dicom-sr": "3.12.0-beta.90",
43
- "@ohif/extension-default": "3.12.0-beta.90",
44
- "@ohif/extension-dicom-pdf": "3.12.0-beta.90",
45
- "@ohif/extension-dicom-video": "3.12.0-beta.90"
38
+ "@ohif/core": "3.12.0-beta.91",
39
+ "@ohif/extension-cornerstone": "3.12.0-beta.91",
40
+ "@ohif/extension-cornerstone-dicom-rt": "3.12.0-beta.91",
41
+ "@ohif/extension-cornerstone-dicom-seg": "3.12.0-beta.91",
42
+ "@ohif/extension-cornerstone-dicom-sr": "3.12.0-beta.91",
43
+ "@ohif/extension-default": "3.12.0-beta.91",
44
+ "@ohif/extension-dicom-pdf": "3.12.0-beta.91",
45
+ "@ohif/extension-dicom-video": "3.12.0-beta.91",
46
+ "@ohif/mode-basic": "3.12.0-beta.91"
46
47
  },
47
48
  "dependencies": {
48
49
  "@babel/runtime": "7.28.2",