@ohif/mode-segmentation 3.12.0-beta.9 → 3.12.0-beta.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("@ohif/core")):"function"==typeof define&&define.amd?define("@ohif/mode-segmentation",["@ohif/core"],o):"object"==typeof exports?exports["@ohif/mode-segmentation"]=o(require("@ohif/core")):e["@ohif/mode-segmentation"]=o(e["@ohif/core"])}("undefined"!=typeof self?self:this,e=>(()=>{"use strict";var o={498:o=>{o.exports=e}},t={};function a(e){var i=t[e];if(void 0!==i)return i.exports;var n=t[e]={exports:{}};return o[e](n,n.exports,a),n.exports}a.d=(e,o)=>{for(var t in o)a.o(o,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};a.r(i),a.d(i,{default:()=>T});const n=JSON.parse('{"UU":"@ohif/mode-segmentation"}').UU;var l=a(498);const r={commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["default","mpr","SRToolGroup","volume3d"]}},s=e=>[{commandName:"setViewportForToolConfiguration",commandOptions:{toolName:e}}],u=[{id:"AdvancedRenderingControls",uiType:"ohif.advancedRenderingControls",props:{buttonSection:!0}},{id:"modalityLoadBadge",uiType:"ohif.modalityLoadBadge",props:{icon:"Status",label:"Status",tooltip:"Status",evaluate:{name:"evaluate.modalityLoadBadge",hideWhenDisabled:!0}}},{id:"navigationComponent",uiType:"ohif.navigationComponent",props:{icon:"Navigation",label:"Navigation",tooltip:"Navigate between segments/measurements and manage their visibility",evaluate:{name:"evaluate.navigationComponent",hideWhenDisabled:!0}}},{id:"trackingStatus",uiType:"ohif.trackingStatus",props:{icon:"TrackingStatus",label:"Tracking Status",tooltip:"View and manage tracking status of measurements and annotations",evaluate:{name:"evaluate.trackingStatus",hideWhenDisabled:!0}}},{id:"dataOverlayMenu",uiType:"ohif.dataOverlayMenu",props:{icon:"ViewportViews",label:"Data Overlay",tooltip:"Configure data overlay options and manage foreground/background display sets",evaluate:"evaluate.dataOverlayMenu"}},{id:"orientationMenu",uiType:"ohif.orientationMenu",props:{icon:"OrientationSwitch",label:"Orientation",tooltip:"Change viewport orientation between axial, sagittal, coronal and reformat planes",evaluate:{name:"evaluate.orientationMenu"}}},{id:"windowLevelMenuEmbedded",uiType:"ohif.windowLevelMenuEmbedded",props:{icon:"WindowLevel",label:"Window Level",tooltip:"Adjust window/level presets and customize image contrast settings",evaluate:{name:"evaluate.windowLevelMenuEmbedded",hideWhenDisabled:!0}}},{id:"windowLevelMenu",uiType:"ohif.windowLevelMenu",props:{icon:"WindowLevel",label:"Window Level",tooltip:"Adjust window/level presets and customize image contrast settings",evaluate:"evaluate.windowLevelMenu"}},{id:"voiManualControlMenu",uiType:"ohif.voiManualControlMenu",props:{icon:"WindowLevelAdvanced",label:"Advanced Window Level",tooltip:"Advanced window/level settings with manual controls and presets",evaluate:"evaluate.voiManualControlMenu"}},{id:"thresholdMenu",uiType:"ohif.thresholdMenu",props:{icon:"Threshold",label:"Threshold",tooltip:"Image threshold settings",evaluate:{name:"evaluate.thresholdMenu",hideWhenDisabled:!0}}},{id:"opacityMenu",uiType:"ohif.opacityMenu",props:{icon:"Opacity",label:"Opacity",tooltip:"Image opacity settings",evaluate:{name:"evaluate.opacityMenu",hideWhenDisabled:!0}}},{id:"Colorbar",uiType:"ohif.colorbar",props:{type:"tool",label:"Colorbar"}},{id:"MoreTools",uiType:"ohif.toolButtonList",props:{buttonSection:!0}},{id:"BrushTools",uiType:"ohif.toolBoxButtonGroup",props:{buttonSection:!0}},{id:"SegmentationUtilities",uiType:"ohif.toolBoxButton",props:{buttonSection:!0}},{id:"SegmentationTools",uiType:"ohif.toolBoxButton",props:{buttonSection:!0}},{id:"Zoom",uiType:"ohif.toolButton",props:{icon:"tool-zoom",label:"Zoom",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"WindowLevel",uiType:"ohif.toolButton",props:{icon:"tool-window-level",label:"Window Level",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"Pan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:"Pan",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"TrackballRotate",uiType:"ohif.toolButton",props:{type:"tool",icon:"tool-3d-rotate",label:"3D Rotate",commands:r,evaluate:{name:"evaluate.cornerstoneTool",disabledText:"Select a 3D viewport to enable this tool"}}},{id:"Capture",uiType:"ohif.toolButton",props:{icon:"tool-capture",label:"Capture",commands:"showDownloadViewportModal",evaluate:["evaluate.action",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["video","wholeSlide"]}]}},{id:"Layout",uiType:"ohif.layoutSelector",props:{rows:3,columns:4,evaluate:"evaluate.action",commands:"setViewportGridLayout"}},{id:"Crosshairs",uiType:"ohif.toolButton",props:{icon:"tool-crosshair",label:"Crosshairs",commands:{commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["mpr"]}},evaluate:{name:"evaluate.cornerstoneTool",disabledText:"Select an MPR viewport to enable this tool"}}},{id:"Reset",uiType:"ohif.toolButton",props:{icon:"tool-reset",label:"Reset View",tooltip:"Reset View",commands:"resetViewport",evaluate:"evaluate.action"}},{id:"rotate-right",uiType:"ohif.toolButton",props:{icon:"tool-rotate-right",label:"Rotate Right",tooltip:"Rotate +90",commands:"rotateViewportCW",evaluate:"evaluate.action"}},{id:"flipHorizontal",uiType:"ohif.toolButton",props:{icon:"tool-flip-horizontal",label:"Flip Horizontal",tooltip:"Flip Horizontally",commands:"flipViewportHorizontal",evaluate:["evaluate.viewportProperties.toggle",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"ReferenceLines",uiType:"ohif.toolButton",props:{icon:"tool-referenceLines",label:"Reference Lines",tooltip:"Show Reference Lines",commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"ImageOverlayViewer",uiType:"ohif.toolButton",props:{icon:"toggle-dicom-overlay",label:"Image Overlay",tooltip:"Toggle Image Overlay",commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"StackScroll",uiType:"ohif.toolButton",props:{icon:"tool-stack-scroll",label:"Stack Scroll",tooltip:"Stack Scroll",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"invert",uiType:"ohif.toolButton",props:{icon:"tool-invert",label:"Invert",tooltip:"Invert Colors",commands:"invertViewport",evaluate:"evaluate.viewportProperties.toggle"}},{id:"Cine",uiType:"ohif.toolButton",props:{icon:"tool-cine",label:"Cine",tooltip:"Cine",commands:"toggleCine",evaluate:["evaluate.cine",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"Magnify",uiType:"ohif.toolButton",props:{icon:"tool-magnify",label:"Zoom-in",tooltip:"Zoom-in",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"TagBrowser",uiType:"ohif.toolButton",props:{icon:"dicom-tag-browser",label:"Dicom Tag Browser",tooltip:"Dicom Tag Browser",commands:"openDICOMTagViewer"}},{id:"Brush",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-brush",label:"Brush",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircularBrush","SphereBrush"],disabledText:"Create new segmentation to enable this tool."},options:[{name:"Radius (mm)",id:"brush-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["CircularBrush","SphereBrush"]}}},{name:"Shape",type:"radio",id:"brush-mode",value:"CircularBrush",values:[{value:"CircularBrush",label:"Circle"},{value:"SphereBrush",label:"Sphere"}],commands:"setToolActiveToolbar"}]}},{id:"InterpolateLabelmap",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-interpolation",label:"Interpolate Labelmap",tooltip:"Automatically fill in missing slices between drawn segments. Use brush or threshold tools on at least two slices, then click to interpolate across slices. Works in any direction. Volume must be reconstructable.",evaluate:["evaluate.cornerstone.segmentation",{name:"evaluate.displaySetIsReconstructable",disabledText:"The current viewport cannot handle interpolation."}],commands:"interpolateLabelmap"}},{id:"SegmentBidirectional",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-bidirectional-segment",label:"Segment Bidirectional",tooltip:"Automatically detects the largest length and width across slices for the selected segment and displays a bidirectional measurement.",evaluate:{name:"evaluate.cornerstone.segmentation",disabledText:"Create new segmentation to enable this tool."},commands:"runSegmentBidirectional"}},{id:"RegionSegmentPlus",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-click-segment",label:"One Click Segment",tooltip:"Detects segmentable regions with one click. Hover for visual feedback—click when a plus sign appears to auto-segment the lesion.",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["RegionSegmentPlus"],disabledText:"Create new segmentation to enable this tool."},commands:"setToolActiveToolbar"}},{id:"LabelmapSlicePropagation",uiType:"ohif.toolBoxButton",props:{icon:"icon-labelmap-slice-propagation",label:"Labelmap Assist",tooltip:"Toggle AI assistance for segmenting nearby slices. After drawing on a slice, scroll to preview predictions. Press Enter to accept or Esc to skip.",evaluate:["evaluate.cornerstoneTool.toggle",{name:"evaluate.cornerstone.hasSegmentation"}],listeners:{[l.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:s("LabelmapSlicePropagation"),[l.ViewportGridService.EVENTS.VIEWPORTS_READY]:s("LabelmapSlicePropagation")},commands:"toggleEnabledDisabledToolbar"}},{id:"MarkerLabelmap",uiType:"ohif.toolBoxButton",props:{icon:"icon-marker-labelmap",label:"Marker Guided Labelmap",tooltip:"Use include/exclude markers to guide AI (SAM) segmentation. Click to place markers, Enter to accept results, Esc to reject, and N to go to the next slice while keeping markers.",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["MarkerLabelmap","MarkerInclude","MarkerExclude"]}],commands:"setToolActiveToolbar",listeners:{[l.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:s("MarkerLabelmap"),[l.ViewportGridService.EVENTS.VIEWPORTS_READY]:s("MarkerLabelmap")},options:[{name:"Marker Mode",type:"radio",id:"marker-mode",value:"markerInclude",values:[{value:"markerInclude",label:"Include"},{value:"markerExclude",label:"Exclude"}],commands:({commandsManager:e,options:o})=>{"markerInclude"===o.find(e=>"marker-mode"===e.id).value?e.run("setToolActive",{toolName:"MarkerInclude"}):e.run("setToolActive",{toolName:"MarkerExclude"})}},{name:"Clear Markers",type:"button",id:"clear-markers",commands:"clearMarkersForMarkerLabelmap"}]}},{id:"Eraser",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-eraser",label:"Eraser",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircularEraser","SphereEraser"]},options:[{name:"Radius (mm)",id:"eraser-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["CircularEraser","SphereEraser"]}}},{name:"Shape",type:"radio",id:"eraser-mode",value:"CircularEraser",values:[{value:"CircularEraser",label:"Circle"},{value:"SphereEraser",label:"Sphere"}],commands:"setToolActiveToolbar"}]}},{id:"Threshold",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-threshold",label:"Threshold Tool",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["ThresholdCircularBrush","ThresholdSphereBrush","ThresholdCircularBrushDynamic","ThresholdSphereBrushDynamic"]},options:[{name:"Radius (mm)",id:"threshold-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush","ThresholdCircularBrushDynamic","ThresholdSphereBrushDynamic"]}}},{name:"Shape",type:"radio",id:"threshold-shape",value:"ThresholdCircularBrush",values:[{value:"ThresholdCircularBrush",label:"Circle"},{value:"ThresholdSphereBrush",label:"Sphere"}],commands:({value:e,commandsManager:o,options:t})=>{"ThresholdDynamic"===t.find(e=>"dynamic-mode"===e.id).value?o.run("setToolActive",{toolName:"ThresholdCircularBrush"===e?"ThresholdCircularBrushDynamic":"ThresholdSphereBrushDynamic"}):o.run("setToolActive",{toolName:e})}},{name:"Threshold",type:"radio",id:"dynamic-mode",value:"ThresholdDynamic",values:[{value:"ThresholdDynamic",label:"Dynamic"},{value:"ThresholdRange",label:"Range"}],commands:({value:e,commandsManager:o,options:t})=>{const a=t.find(e=>"threshold-shape"===e.id);if("ThresholdDynamic"===e)o.run("setToolActiveToolbar",{toolName:"ThresholdCircularBrush"===a.value?"ThresholdCircularBrushDynamic":"ThresholdSphereBrushDynamic"});else{o.run("setToolActiveToolbar",{toolName:a.value});const e=t.find(e=>"threshold-range"===e.id).value;o.run("setThresholdRange",{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"],value:e})}}},{name:"ThresholdRange",type:"double-range",id:"threshold-range",min:-1e3,max:1e3,step:1,value:[50,600],condition:({options:e})=>"ThresholdRange"===e.find(e=>"dynamic-mode"===e.id).value,commands:{commandName:"setThresholdRange",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"]}}}]}},{id:"Shapes",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-shape",label:"Shapes",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircleScissor","SphereScissor","RectangleScissor"],disabledText:"Create new segmentation to enable shapes tool."},options:[{name:"Shape",type:"radio",value:"CircleScissor",id:"shape-mode",values:[{value:"CircleScissor",label:"Circle"},{value:"SphereScissor",label:"Sphere"},{value:"RectangleScissor",label:"Rectangle"}],commands:"setToolActiveToolbar"}]}},{id:"SegmentLabelTool",uiType:"ohif.toolBoxButton",props:{icon:"tool-segment-label",label:"Segment Label Display",tooltip:"Click to show or hide segment labels when hovering with your mouse.",commands:{commandName:"toggleSegmentLabel"},evaluate:["evaluate.cornerstoneTool.toggle",{name:"evaluate.cornerstone.hasSegmentation"}]}}],d={"viewport-0":"rgb(200, 0, 0)","viewport-1":"rgb(200, 200, 0)","viewport-2":"rgb(0, 200, 0)"},c={axial:"rgb(200, 0, 0)",sagittal:"rgb(200, 200, 0)",coronal:"rgb(0, 200, 0)"};function m({utilityModule:e,commandsManager:o}){const{toolNames:t,Enums:a}=e.exports,i={active:[{toolName:t.WindowLevel,bindings:[{mouseButton:a.MouseBindings.Primary}]},{toolName:t.Pan,bindings:[{mouseButton:a.MouseBindings.Auxiliary}]},{toolName:t.Zoom,bindings:[{mouseButton:a.MouseBindings.Secondary},{numTouchPoints:2}]},{toolName:t.StackScroll,bindings:[{mouseButton:a.MouseBindings.Wheel},{numTouchPoints:3}]}],passive:[{toolName:"CircularBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_CIRCLE"}},{toolName:t.LabelmapSlicePropagation},{toolName:t.MarkerLabelmap},{toolName:t.RegionSegmentPlus},{toolName:"CircularEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_CIRCLE"}},{toolName:"SphereBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_SPHERE"}},{toolName:"SphereEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_SPHERE"}},{toolName:"ThresholdCircularBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE"}},{toolName:"ThresholdSphereBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE"}},{toolName:"ThresholdCircularBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE",threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:t.SegmentBidirectional},{toolName:t.SegmentSelect},{toolName:"ThresholdSphereBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE",threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:t.CircleScissors},{toolName:t.RectangleScissors},{toolName:t.SphereScissors},{toolName:t.StackScroll},{toolName:t.Magnify},{toolName:t.WindowLevelRegion},{toolName:t.UltrasoundDirectional}],disabled:[{toolName:t.ReferenceLines},{toolName:t.AdvancedMagnify}]};return o.run("initializeSegmentLabelTool",{tools:i})}const p="@ohif/extension-default.sopClassHandlerModule.stack",h="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",v="@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt",g={"@ohif/extension-default":"^3.0.0","@ohif/extension-cornerstone":"^3.0.0","@ohif/extension-cornerstone-dicom-seg":"^3.0.0","@ohif/extension-cornerstone-dicom-rt":"^3.0.0"},T={id:n,modeFactory:function({modeConfiguration:e}){return{id:n,routeName:"segmentation",displayName:"Segmentation",onModeEnter:({servicesManager:e,extensionManager:o,commandsManager:t})=>{const{measurementService:a,toolbarService:i,toolGroupService:n,customizationService:l}=e.services;a.clearMeasurements(),function(e,o,t){!function(e,o,t){const a=m({commandsManager:t,utilityModule:e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools")});o.createToolGroupAndAddTools("default",a)}(e,o,t),function(e,o,t){const a=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),i=e._servicesManager,{cornerstoneViewportService:n}=i.services,l=m({commandsManager:t,utilityModule:a});l.disabled.push({toolName:a.exports.toolNames.Crosshairs,configuration:{viewportIndicators:!0,viewportIndicatorsConfig:{circleRadius:5,xOffset:.95,yOffset:.05},disableOnPassive:!0,autoPan:{enabled:!1,panSize:10},getReferenceLineColor:e=>{const o=n.getViewportInfo(e),t=o?.viewportOptions;return t?d[t.id]||c[t.orientation]||"#0c0":(console.warn("missing viewport?",e),"#0c0")}}},{toolName:a.exports.toolNames.ReferenceLines}),o.createToolGroupAndAddTools("mpr",l)}(e,o,t),function(e,o){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:a,Enums:i}=t.exports,n={active:[{toolName:a.TrackballRotateTool,bindings:[{mouseButton:i.MouseBindings.Primary}]},{toolName:a.Zoom,bindings:[{mouseButton:i.MouseBindings.Secondary},{numTouchPoints:2}]},{toolName:a.Pan,bindings:[{mouseButton:i.MouseBindings.Auxiliary}]}]};o.createToolGroupAndAddTools("volume3d",n)}(e,o)}(o,n,t),i.register(u),i.updateSection(i.sections.primary,["WindowLevel","Pan","Zoom","TrackballRotate","Capture","Layout","Crosshairs","MoreTools"]),i.updateSection(i.sections.viewportActionMenu.topLeft,["orientationMenu","dataOverlayMenu"]),i.updateSection(i.sections.viewportActionMenu.bottomMiddle,["AdvancedRenderingControls"]),i.updateSection("AdvancedRenderingControls",["windowLevelMenuEmbedded","voiManualControlMenu","Colorbar","opacityMenu","thresholdMenu"]),i.updateSection(i.sections.viewportActionMenu.topRight,["modalityLoadBadge","trackingStatus","navigationComponent"]),i.updateSection(i.sections.viewportActionMenu.bottomLeft,["windowLevelMenu"]),i.updateSection("MoreTools",["Reset","rotate-right","flipHorizontal","ReferenceLines","ImageOverlayViewer","StackScroll","invert","Cine","Magnify","TagBrowser"]),i.updateSection(i.sections.segmentationToolbox,["SegmentationUtilities","SegmentationTools"]),i.updateSection("SegmentationUtilities",["LabelmapSlicePropagation","InterpolateLabelmap","SegmentBidirectional","SegmentLabelTool"]),i.updateSection("SegmentationTools",["BrushTools","MarkerLabelmap","RegionSegmentPlus","Shapes"]),i.updateSection("BrushTools",["Brush","Eraser","Threshold"])},onModeExit:({servicesManager:e})=>{const{toolGroupService:o,syncGroupService:t,segmentationService:a,cornerstoneViewportService:i,uiDialogService:n,uiModalService:l}=e.services;n.hideAll(),l.hide(),o.destroy(),t.destroy(),a.destroy(),i.destroy()},validationTags:{study:[],series:[]},isValidMode:({modalities:e})=>{const o=e.split("\\");return{valid:1!==o.length||!["SM","ECG","OT","DOC"].includes(o[0]),description:"The mode does not support studies that ONLY include the following modalities: SM, OT, DOC"}},routes:[{path:"template",layoutTemplate:({location:e,servicesManager:o})=>({id:"@ohif/extension-default.layoutTemplateModule.viewerLayout",props:{leftPanels:["@ohif/extension-default.panelModule.seriesList"],leftPanelResizable:!0,rightPanels:["@ohif/extension-cornerstone.panelModule.panelSegmentationWithTools"],rightPanelResizable:!0,viewports:[{namespace:"@ohif/extension-cornerstone.viewportModule.cornerstone",displaySetsToDisplay:[p]},{namespace:"@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",displaySetsToDisplay:[h]},{namespace:"@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt",displaySetsToDisplay:[v]}]}})}],extensions:g,hangingProtocol:["@ohif/mnGrid"],sopClassHandlers:[p,h,v]}},extensionDependencies:g};return i})());
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("@ohif/core"),require("i18next")):"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})());
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,eACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,0BAA2B,CAAC,cAAeJ,GACxB,iBAAZC,QACdA,QAAQ,2BAA6BD,EAAQG,QAAQ,eAErDJ,EAAK,2BAA6BC,EAAQD,EAAK,cAChD,CATD,CASmB,oBAATO,KAAuBA,KAAOC,KAAOC,G,kCCT/CN,EAAOD,QAAUO,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,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LN,yDA6LMC,qBAAsB,CAACrF,IAEzB,CACEoF,UAzLN,iEA0LMC,qBAAsB,CAACpF,IAEzB,CACEmF,UAzLN,+DA0LMC,qBAAsB,CAACnF,UASrCoF,WAAYnF,EAIZoF,gBAAiB,CAAC,gBAElBC,iBAAkB,CAACxF,EAAsBC,EAA8BC,GAE3E,EAKEC,yB","sources":["webpack://@ohif/mode-segmentation/webpack/universalModuleDefinition","webpack://@ohif/mode-segmentation/external umd {\"commonjs2\":\"@ohif/core\",\"commonjs\":\"@ohif/core\",\"amd\":\"@ohif/core\",\"root\":\"@ohif/core\"}","webpack://@ohif/mode-segmentation/webpack/bootstrap","webpack://@ohif/mode-segmentation/webpack/runtime/define property getters","webpack://@ohif/mode-segmentation/webpack/runtime/hasOwnProperty shorthand","webpack://@ohif/mode-segmentation/webpack/runtime/make namespace object","webpack://@ohif/mode-segmentation/./src/id.js","webpack://@ohif/mode-segmentation/./src/toolbarButtons.ts","webpack://@ohif/mode-segmentation/./src/initToolGroups.ts","webpack://@ohif/mode-segmentation/./src/index.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@ohif/core\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@ohif/mode-segmentation\", [\"@ohif/core\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@ohif/mode-segmentation\"] = factory(require(\"@ohif/core\"));\n\telse\n\t\troot[\"@ohif/mode-segmentation\"] = factory(root[\"@ohif/core\"]);\n})(typeof self !== 'undefined' ? self : this, (__WEBPACK_EXTERNAL_MODULE__498__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__498__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import packageJson from '../package.json';\n\nconst id = packageJson.name;\n\nexport { id };\n","import type { Button } from '@ohif/core/types';\nimport { ViewportGridService } from '@ohif/core';\n\nconst setToolActiveToolbar = {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],\n },\n};\n\nconst callbacks = (toolName: string) => [\n {\n commandName: 'setViewportForToolConfiguration',\n commandOptions: {\n toolName,\n },\n },\n];\n\nconst toolbarButtons: Button[] = [\n {\n id: 'AdvancedRenderingControls',\n uiType: 'ohif.advancedRenderingControls',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'modalityLoadBadge',\n uiType: 'ohif.modalityLoadBadge',\n props: {\n icon: 'Status',\n label: 'Status',\n tooltip: 'Status',\n evaluate: {\n name: 'evaluate.modalityLoadBadge',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'navigationComponent',\n uiType: 'ohif.navigationComponent',\n props: {\n icon: 'Navigation',\n label: 'Navigation',\n tooltip: 'Navigate between segments/measurements and manage their visibility',\n evaluate: {\n name: 'evaluate.navigationComponent',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'trackingStatus',\n uiType: 'ohif.trackingStatus',\n props: {\n icon: 'TrackingStatus',\n label: 'Tracking Status',\n tooltip: 'View and manage tracking status of measurements and annotations',\n evaluate: {\n name: 'evaluate.trackingStatus',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'dataOverlayMenu',\n uiType: 'ohif.dataOverlayMenu',\n props: {\n icon: 'ViewportViews',\n label: 'Data Overlay',\n tooltip: 'Configure data overlay options and manage foreground/background display sets',\n evaluate: 'evaluate.dataOverlayMenu',\n },\n },\n {\n id: 'orientationMenu',\n uiType: 'ohif.orientationMenu',\n props: {\n icon: 'OrientationSwitch',\n label: 'Orientation',\n tooltip: 'Change viewport orientation between axial, sagittal, coronal and reformat planes',\n evaluate: {\n name: 'evaluate.orientationMenu',\n // hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'windowLevelMenuEmbedded',\n uiType: 'ohif.windowLevelMenuEmbedded',\n props: {\n icon: 'WindowLevel',\n label: 'Window Level',\n tooltip: 'Adjust window/level presets and customize image contrast settings',\n evaluate: {\n name: 'evaluate.windowLevelMenuEmbedded',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'windowLevelMenu',\n uiType: 'ohif.windowLevelMenu',\n props: {\n icon: 'WindowLevel',\n label: 'Window Level',\n tooltip: 'Adjust window/level presets and customize image contrast settings',\n evaluate: 'evaluate.windowLevelMenu',\n },\n },\n {\n id: 'voiManualControlMenu',\n uiType: 'ohif.voiManualControlMenu',\n props: {\n icon: 'WindowLevelAdvanced',\n label: 'Advanced Window Level',\n tooltip: 'Advanced window/level settings with manual controls and presets',\n evaluate: 'evaluate.voiManualControlMenu',\n },\n },\n {\n id: 'thresholdMenu',\n uiType: 'ohif.thresholdMenu',\n props: {\n icon: 'Threshold',\n label: 'Threshold',\n tooltip: 'Image threshold settings',\n evaluate: {\n name: 'evaluate.thresholdMenu',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'opacityMenu',\n uiType: 'ohif.opacityMenu',\n props: {\n icon: 'Opacity',\n label: 'Opacity',\n tooltip: 'Image opacity settings',\n evaluate: {\n name: 'evaluate.opacityMenu',\n hideWhenDisabled: true,\n },\n },\n },\n {\n id: 'Colorbar',\n uiType: 'ohif.colorbar',\n props: {\n type: 'tool',\n label: 'Colorbar',\n },\n },\n // sections\n {\n id: 'MoreTools',\n uiType: 'ohif.toolButtonList',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'BrushTools',\n uiType: 'ohif.toolBoxButtonGroup',\n props: {\n buttonSection: true,\n },\n },\n // Section containers for the nested toolbox\n {\n id: 'SegmentationUtilities',\n uiType: 'ohif.toolBoxButton',\n props: {\n buttonSection: true,\n },\n },\n {\n id: 'SegmentationTools',\n uiType: 'ohif.toolBoxButton',\n props: {\n buttonSection: true,\n },\n },\n // tool defs\n {\n id: 'Zoom',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-zoom',\n label: 'Zoom',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'WindowLevel',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-window-level',\n label: 'Window Level',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'Pan',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-move',\n label: 'Pan',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'TrackballRotate',\n uiType: 'ohif.toolButton',\n props: {\n type: 'tool',\n icon: 'tool-3d-rotate',\n label: '3D Rotate',\n commands: setToolActiveToolbar,\n evaluate: {\n name: 'evaluate.cornerstoneTool',\n disabledText: 'Select a 3D viewport to enable this tool',\n },\n },\n },\n {\n id: 'Capture',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-capture',\n label: 'Capture',\n commands: 'showDownloadViewportModal',\n evaluate: [\n 'evaluate.action',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['video', 'wholeSlide'],\n },\n ],\n },\n },\n {\n id: 'Layout',\n uiType: 'ohif.layoutSelector',\n props: {\n rows: 3,\n columns: 4,\n evaluate: 'evaluate.action',\n commands: 'setViewportGridLayout',\n },\n },\n {\n id: 'Crosshairs',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-crosshair',\n label: 'Crosshairs',\n commands: {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['mpr'],\n },\n },\n evaluate: {\n name: 'evaluate.cornerstoneTool',\n disabledText: 'Select an MPR viewport to enable this tool',\n },\n },\n },\n {\n id: 'Reset',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-reset',\n label: 'Reset View',\n tooltip: 'Reset View',\n commands: 'resetViewport',\n evaluate: 'evaluate.action',\n },\n },\n {\n id: 'rotate-right',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-rotate-right',\n label: 'Rotate Right',\n tooltip: 'Rotate +90',\n commands: 'rotateViewportCW',\n evaluate: 'evaluate.action',\n },\n },\n {\n id: 'flipHorizontal',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-flip-horizontal',\n label: 'Flip Horizontal',\n tooltip: 'Flip Horizontally',\n commands: 'flipViewportHorizontal',\n evaluate: [\n 'evaluate.viewportProperties.toggle',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['volume3d'],\n },\n ],\n },\n },\n {\n id: 'ReferenceLines',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-referenceLines',\n label: 'Reference Lines',\n tooltip: 'Show Reference Lines',\n commands: 'toggleEnabledDisabledToolbar',\n evaluate: 'evaluate.cornerstoneTool.toggle',\n },\n },\n {\n id: 'ImageOverlayViewer',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'toggle-dicom-overlay',\n label: 'Image Overlay',\n tooltip: 'Toggle Image Overlay',\n commands: 'toggleEnabledDisabledToolbar',\n evaluate: 'evaluate.cornerstoneTool.toggle',\n },\n },\n {\n id: 'StackScroll',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-stack-scroll',\n label: 'Stack Scroll',\n tooltip: 'Stack Scroll',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'invert',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-invert',\n label: 'Invert',\n tooltip: 'Invert Colors',\n commands: 'invertViewport',\n evaluate: 'evaluate.viewportProperties.toggle',\n },\n },\n {\n id: 'Cine',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-cine',\n label: 'Cine',\n tooltip: 'Cine',\n commands: 'toggleCine',\n evaluate: [\n 'evaluate.cine',\n {\n name: 'evaluate.viewport.supported',\n unsupportedViewportTypes: ['volume3d'],\n },\n ],\n },\n },\n {\n id: 'Magnify',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'tool-magnify',\n label: 'Zoom-in',\n tooltip: 'Zoom-in',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n },\n },\n {\n id: 'TagBrowser',\n uiType: 'ohif.toolButton',\n props: {\n icon: 'dicom-tag-browser',\n label: 'Dicom Tag Browser',\n tooltip: 'Dicom Tag Browser',\n commands: 'openDICOMTagViewer',\n },\n },\n\n {\n id: 'Brush',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-brush',\n label: 'Brush',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircularBrush', 'SphereBrush'],\n disabledText: 'Create new segmentation to enable this tool.',\n },\n options: [\n {\n name: 'Radius (mm)',\n id: 'brush-radius',\n type: 'range',\n min: 0.5,\n max: 99.5,\n step: 0.5,\n value: 25,\n commands: {\n commandName: 'setBrushSize',\n commandOptions: { toolNames: ['CircularBrush', 'SphereBrush'] },\n },\n },\n {\n name: 'Shape',\n type: 'radio',\n id: 'brush-mode',\n value: 'CircularBrush',\n values: [\n { value: 'CircularBrush', label: 'Circle' },\n { value: 'SphereBrush', label: 'Sphere' },\n ],\n commands: 'setToolActiveToolbar',\n },\n ],\n },\n },\n {\n id: 'InterpolateLabelmap',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-interpolation',\n label: 'Interpolate Labelmap',\n tooltip:\n 'Automatically fill in missing slices between drawn segments. Use brush or threshold tools on at least two slices, then click to interpolate across slices. Works in any direction. Volume must be reconstructable.',\n evaluate: [\n 'evaluate.cornerstone.segmentation',\n {\n name: 'evaluate.displaySetIsReconstructable',\n disabledText: 'The current viewport cannot handle interpolation.',\n },\n ],\n commands: 'interpolateLabelmap',\n },\n },\n {\n id: 'SegmentBidirectional',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-bidirectional-segment',\n label: 'Segment Bidirectional',\n tooltip:\n 'Automatically detects the largest length and width across slices for the selected segment and displays a bidirectional measurement.',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n disabledText: 'Create new segmentation to enable this tool.',\n },\n commands: 'runSegmentBidirectional',\n },\n },\n {\n id: 'RegionSegmentPlus',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-click-segment',\n label: 'One Click Segment',\n tooltip:\n 'Detects segmentable regions with one click. Hover for visual feedback—click when a plus sign appears to auto-segment the lesion.',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['RegionSegmentPlus'],\n disabledText: 'Create new segmentation to enable this tool.',\n },\n commands: 'setToolActiveToolbar',\n },\n },\n {\n id: 'LabelmapSlicePropagation',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-labelmap-slice-propagation',\n label: 'Labelmap Assist',\n tooltip:\n 'Toggle AI assistance for segmenting nearby slices. After drawing on a slice, scroll to preview predictions. Press Enter to accept or Esc to skip.',\n evaluate: [\n 'evaluate.cornerstoneTool.toggle',\n {\n name: 'evaluate.cornerstone.hasSegmentation',\n },\n ],\n listeners: {\n [ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks(\n 'LabelmapSlicePropagation'\n ),\n [ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('LabelmapSlicePropagation'),\n },\n commands: 'toggleEnabledDisabledToolbar',\n },\n },\n {\n id: 'MarkerLabelmap',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-marker-labelmap',\n label: 'Marker Guided Labelmap',\n tooltip:\n 'Use include/exclude markers to guide AI (SAM) segmentation. Click to place markers, Enter to accept results, Esc to reject, and N to go to the next slice while keeping markers.',\n evaluate: [\n {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['MarkerLabelmap', 'MarkerInclude', 'MarkerExclude'],\n },\n ],\n commands: 'setToolActiveToolbar',\n listeners: {\n [ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks('MarkerLabelmap'),\n [ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('MarkerLabelmap'),\n },\n options: [\n {\n name: 'Marker Mode',\n type: 'radio',\n id: 'marker-mode',\n value: 'markerInclude',\n values: [\n { value: 'markerInclude', label: 'Include' },\n { value: 'markerExclude', label: 'Exclude' },\n ],\n commands: ({ commandsManager, options }) => {\n const markerModeOption = options.find(option => option.id === 'marker-mode');\n if (markerModeOption.value === 'markerInclude') {\n commandsManager.run('setToolActive', {\n toolName: 'MarkerInclude',\n });\n } else {\n commandsManager.run('setToolActive', {\n toolName: 'MarkerExclude',\n });\n }\n },\n },\n {\n name: 'Clear Markers',\n type: 'button',\n id: 'clear-markers',\n commands: 'clearMarkersForMarkerLabelmap',\n },\n ],\n },\n },\n {\n id: 'Eraser',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-eraser',\n label: 'Eraser',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircularEraser', 'SphereEraser'],\n },\n options: [\n {\n name: 'Radius (mm)',\n id: 'eraser-radius',\n type: 'range',\n min: 0.5,\n max: 99.5,\n step: 0.5,\n value: 25,\n commands: {\n commandName: 'setBrushSize',\n commandOptions: { toolNames: ['CircularEraser', 'SphereEraser'] },\n },\n },\n {\n name: 'Shape',\n type: 'radio',\n id: 'eraser-mode',\n value: 'CircularEraser',\n values: [\n { value: 'CircularEraser', label: 'Circle' },\n { value: 'SphereEraser', label: 'Sphere' },\n ],\n commands: 'setToolActiveToolbar',\n },\n ],\n },\n },\n {\n id: 'Threshold',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-threshold',\n label: 'Threshold Tool',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: [\n 'ThresholdCircularBrush',\n 'ThresholdSphereBrush',\n 'ThresholdCircularBrushDynamic',\n 'ThresholdSphereBrushDynamic',\n ],\n },\n options: [\n {\n name: 'Radius (mm)',\n id: 'threshold-radius',\n type: 'range',\n min: 0.5,\n max: 99.5,\n step: 0.5,\n value: 25,\n commands: {\n commandName: 'setBrushSize',\n commandOptions: {\n toolNames: [\n 'ThresholdCircularBrush',\n 'ThresholdSphereBrush',\n 'ThresholdCircularBrushDynamic',\n 'ThresholdSphereBrushDynamic',\n ],\n },\n },\n },\n {\n name: 'Shape',\n type: 'radio',\n id: 'threshold-shape',\n value: 'ThresholdCircularBrush',\n values: [\n { value: 'ThresholdCircularBrush', label: 'Circle' },\n { value: 'ThresholdSphereBrush', label: 'Sphere' },\n ],\n commands: ({ value, commandsManager, options }) => {\n const optionsDynamic = options.find(option => option.id === 'dynamic-mode');\n\n if (optionsDynamic.value === 'ThresholdDynamic') {\n commandsManager.run('setToolActive', {\n toolName:\n value === 'ThresholdCircularBrush'\n ? 'ThresholdCircularBrushDynamic'\n : 'ThresholdSphereBrushDynamic',\n });\n } else {\n commandsManager.run('setToolActive', {\n toolName: value,\n });\n }\n },\n },\n {\n name: 'Threshold',\n type: 'radio',\n id: 'dynamic-mode',\n value: 'ThresholdDynamic',\n values: [\n { value: 'ThresholdDynamic', label: 'Dynamic' },\n { value: 'ThresholdRange', label: 'Range' },\n ],\n commands: ({ value, commandsManager, options }) => {\n const thresholdRangeOption = options.find(option => option.id === 'threshold-shape');\n\n if (value === 'ThresholdDynamic') {\n commandsManager.run('setToolActiveToolbar', {\n toolName:\n thresholdRangeOption.value === 'ThresholdCircularBrush'\n ? 'ThresholdCircularBrushDynamic'\n : 'ThresholdSphereBrushDynamic',\n });\n } else {\n commandsManager.run('setToolActiveToolbar', {\n toolName: thresholdRangeOption.value,\n });\n\n const thresholdRangeValue = options.find(\n option => option.id === 'threshold-range'\n ).value;\n\n commandsManager.run('setThresholdRange', {\n toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],\n value: thresholdRangeValue,\n });\n }\n },\n },\n {\n name: 'ThresholdRange',\n type: 'double-range',\n id: 'threshold-range',\n min: -1000,\n max: 1000,\n step: 1,\n value: [50, 600],\n condition: ({ options }) =>\n options.find(option => option.id === 'dynamic-mode').value === 'ThresholdRange',\n commands: {\n commandName: 'setThresholdRange',\n commandOptions: {\n toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],\n },\n },\n },\n ],\n },\n },\n {\n id: 'Shapes',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'icon-tool-shape',\n label: 'Shapes',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircleScissor', 'SphereScissor', 'RectangleScissor'],\n disabledText: 'Create new segmentation to enable shapes tool.',\n },\n options: [\n {\n name: 'Shape',\n type: 'radio',\n value: 'CircleScissor',\n id: 'shape-mode',\n values: [\n { value: 'CircleScissor', label: 'Circle' },\n { value: 'SphereScissor', label: 'Sphere' },\n { value: 'RectangleScissor', label: 'Rectangle' },\n ],\n commands: 'setToolActiveToolbar',\n },\n ],\n },\n },\n {\n id: 'SegmentLabelTool',\n uiType: 'ohif.toolBoxButton',\n props: {\n icon: 'tool-segment-label',\n label: 'Segment Label Display',\n tooltip: 'Click to show or hide segment labels when hovering with your mouse.',\n commands: { commandName: 'toggleSegmentLabel' },\n evaluate: [\n 'evaluate.cornerstoneTool.toggle',\n {\n name: 'evaluate.cornerstone.hasSegmentation',\n },\n ],\n },\n },\n];\n\nexport default toolbarButtons;\n","const colours = {\n 'viewport-0': 'rgb(200, 0, 0)',\n 'viewport-1': 'rgb(200, 200, 0)',\n 'viewport-2': 'rgb(0, 200, 0)',\n};\n\nconst colorsByOrientation = {\n axial: 'rgb(200, 0, 0)',\n sagittal: 'rgb(200, 200, 0)',\n coronal: 'rgb(0, 200, 0)',\n};\n\nfunction createTools({ utilityModule, commandsManager }) {\n const { toolNames, Enums } = utilityModule.exports;\n\n const tools = {\n active: [\n { toolName: toolNames.WindowLevel, bindings: [{ mouseButton: Enums.MouseBindings.Primary }] },\n { toolName: toolNames.Pan, bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }] },\n {\n toolName: toolNames.Zoom,\n bindings: [{ mouseButton: Enums.MouseBindings.Secondary }, { numTouchPoints: 2 }],\n },\n {\n toolName: toolNames.StackScroll,\n bindings: [{ mouseButton: Enums.MouseBindings.Wheel }, { numTouchPoints: 3 }],\n },\n ],\n passive: [\n {\n toolName: 'CircularBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'FILL_INSIDE_CIRCLE',\n },\n },\n {\n toolName: toolNames.LabelmapSlicePropagation,\n },\n {\n toolName: toolNames.MarkerLabelmap,\n },\n {\n toolName: toolNames.RegionSegmentPlus,\n },\n {\n toolName: 'CircularEraser',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'ERASE_INSIDE_CIRCLE',\n },\n },\n {\n toolName: 'SphereBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'FILL_INSIDE_SPHERE',\n },\n },\n {\n toolName: 'SphereEraser',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'ERASE_INSIDE_SPHERE',\n },\n },\n {\n toolName: 'ThresholdCircularBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_CIRCLE',\n },\n },\n {\n toolName: 'ThresholdSphereBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_SPHERE',\n },\n },\n {\n toolName: 'ThresholdCircularBrushDynamic',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_CIRCLE',\n threshold: {\n isDynamic: true,\n dynamicRadius: 3,\n },\n },\n },\n {\n toolName: toolNames.SegmentBidirectional,\n },\n {\n toolName: toolNames.SegmentSelect,\n },\n {\n toolName: 'ThresholdSphereBrushDynamic',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_SPHERE',\n threshold: {\n isDynamic: true,\n dynamicRadius: 3,\n },\n },\n },\n { toolName: toolNames.CircleScissors },\n { toolName: toolNames.RectangleScissors },\n { toolName: toolNames.SphereScissors },\n { toolName: toolNames.StackScroll },\n { toolName: toolNames.Magnify },\n { toolName: toolNames.WindowLevelRegion },\n\n { toolName: toolNames.UltrasoundDirectional },\n ],\n disabled: [{ toolName: toolNames.ReferenceLines }, { toolName: toolNames.AdvancedMagnify }],\n };\n\n const updatedTools = commandsManager.run('initializeSegmentLabelTool', { tools });\n\n return updatedTools;\n}\n\nfunction initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const tools = createTools({ commandsManager, utilityModule });\n toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);\n}\n\nfunction initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const servicesManager = extensionManager._servicesManager;\n const { cornerstoneViewportService } = servicesManager.services;\n const tools = createTools({ commandsManager, utilityModule });\n tools.disabled.push(\n {\n toolName: utilityModule.exports.toolNames.Crosshairs,\n configuration: {\n viewportIndicators: true,\n viewportIndicatorsConfig: {\n circleRadius: 5,\n xOffset: 0.95,\n yOffset: 0.05,\n },\n disableOnPassive: true,\n autoPan: {\n enabled: false,\n panSize: 10,\n },\n getReferenceLineColor: viewportId => {\n const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);\n const viewportOptions = viewportInfo?.viewportOptions;\n if (viewportOptions) {\n return (\n colours[viewportOptions.id] ||\n colorsByOrientation[viewportOptions.orientation] ||\n '#0c0'\n );\n } else {\n console.warn('missing viewport?', viewportId);\n return '#0c0';\n }\n },\n },\n },\n { toolName: utilityModule.exports.toolNames.ReferenceLines }\n );\n toolGroupService.createToolGroupAndAddTools('mpr', tools);\n}\n\nfunction initVolume3DToolGroup(extensionManager, toolGroupService) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n\n const { toolNames, Enums } = utilityModule.exports;\n\n const tools = {\n active: [\n {\n toolName: toolNames.TrackballRotateTool,\n bindings: [{ mouseButton: Enums.MouseBindings.Primary }],\n },\n {\n toolName: toolNames.Zoom,\n bindings: [{ mouseButton: Enums.MouseBindings.Secondary }, { numTouchPoints: 2 }],\n },\n {\n toolName: toolNames.Pan,\n bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],\n },\n ],\n };\n\n toolGroupService.createToolGroupAndAddTools('volume3d', tools);\n}\n\nfunction initToolGroups(extensionManager, toolGroupService, commandsManager) {\n initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, 'default');\n initMPRToolGroup(extensionManager, toolGroupService, commandsManager);\n initVolume3DToolGroup(extensionManager, toolGroupService);\n}\n\nexport default initToolGroups;\n","import { id } from './id';\nimport toolbarButtons from './toolbarButtons';\nimport initToolGroups from './initToolGroups';\n\nconst ohif = {\n layout: '@ohif/extension-default.layoutTemplateModule.viewerLayout',\n sopClassHandler: '@ohif/extension-default.sopClassHandlerModule.stack',\n hangingProtocol: '@ohif/extension-default.hangingProtocolModule.default',\n leftPanel: '@ohif/extension-default.panelModule.seriesList',\n};\n\nconst cornerstone = {\n viewport: '@ohif/extension-cornerstone.viewportModule.cornerstone',\n panelTool: '@ohif/extension-cornerstone.panelModule.panelSegmentationWithTools',\n measurements: '@ohif/extension-cornerstone.panelModule.panelMeasurement',\n};\n\nconst segmentation = {\n sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',\n viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',\n};\n\nconst dicomRT = {\n viewport: '@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt',\n sopClassHandler: '@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt',\n};\n/**\n * Just two dependencies to be able to render a viewport with panels in order\n * to make sure that the mode is working.\n */\nconst extensionDependencies = {\n '@ohif/extension-default': '^3.0.0',\n '@ohif/extension-cornerstone': '^3.0.0',\n '@ohif/extension-cornerstone-dicom-seg': '^3.0.0',\n '@ohif/extension-cornerstone-dicom-rt': '^3.0.0',\n};\n\nfunction modeFactory({ modeConfiguration }) {\n return {\n /**\n * Mode ID, which should be unique among modes used by the viewer. This ID\n * is used to identify the mode in the viewer's state.\n */\n id,\n routeName: 'segmentation',\n /**\n * Mode name, which is displayed in the viewer's UI in the workList, for the\n * user to select the mode.\n */\n displayName: 'Segmentation',\n /**\n * Runs when the Mode Route is mounted to the DOM. Usually used to initialize\n * Services and other resources.\n */\n onModeEnter: ({ servicesManager, extensionManager, commandsManager }: withAppTypes) => {\n const { measurementService, toolbarService, toolGroupService, customizationService } =\n servicesManager.services;\n\n measurementService.clearMeasurements();\n\n // Init Default and SR ToolGroups\n initToolGroups(extensionManager, toolGroupService, commandsManager);\n\n toolbarService.register(toolbarButtons);\n\n toolbarService.updateSection(toolbarService.sections.primary, [\n 'WindowLevel',\n 'Pan',\n 'Zoom',\n 'TrackballRotate',\n 'Capture',\n 'Layout',\n 'Crosshairs',\n 'MoreTools',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.topLeft, [\n 'orientationMenu',\n 'dataOverlayMenu',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.bottomMiddle, [\n 'AdvancedRenderingControls',\n ]);\n\n toolbarService.updateSection('AdvancedRenderingControls', [\n 'windowLevelMenuEmbedded',\n 'voiManualControlMenu',\n 'Colorbar',\n 'opacityMenu',\n 'thresholdMenu',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.topRight, [\n 'modalityLoadBadge',\n 'trackingStatus',\n 'navigationComponent',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.viewportActionMenu.bottomLeft, [\n 'windowLevelMenu',\n ]);\n\n toolbarService.updateSection('MoreTools', [\n 'Reset',\n 'rotate-right',\n 'flipHorizontal',\n 'ReferenceLines',\n 'ImageOverlayViewer',\n 'StackScroll',\n 'invert',\n 'Cine',\n 'Magnify',\n 'TagBrowser',\n ]);\n\n toolbarService.updateSection(toolbarService.sections.segmentationToolbox, [\n 'SegmentationUtilities',\n 'SegmentationTools',\n ]);\n toolbarService.updateSection('SegmentationUtilities', [\n 'LabelmapSlicePropagation',\n 'InterpolateLabelmap',\n 'SegmentBidirectional',\n 'SegmentLabelTool',\n ]);\n toolbarService.updateSection('SegmentationTools', [\n 'BrushTools',\n 'MarkerLabelmap',\n 'RegionSegmentPlus',\n 'Shapes',\n ]);\n toolbarService.updateSection('BrushTools', ['Brush', 'Eraser', 'Threshold']);\n },\n onModeExit: ({ servicesManager }: withAppTypes) => {\n const {\n toolGroupService,\n syncGroupService,\n segmentationService,\n cornerstoneViewportService,\n uiDialogService,\n uiModalService,\n } = servicesManager.services;\n\n uiDialogService.hideAll();\n uiModalService.hide();\n toolGroupService.destroy();\n syncGroupService.destroy();\n segmentationService.destroy();\n cornerstoneViewportService.destroy();\n },\n /** */\n validationTags: {\n study: [],\n series: [],\n },\n /**\n * A boolean return value that indicates whether the mode is valid for the\n * modalities of the selected studies. Currently we don't have stack viewport\n * segmentations and we should exclude them\n */\n isValidMode: ({ modalities }) => {\n // Don't show the mode if the selected studies have only one modality\n // that is not supported by the mode\n const modalitiesArray = modalities.split('\\\\');\n return {\n valid:\n modalitiesArray.length === 1\n ? !['SM', 'ECG', 'OT', 'DOC'].includes(modalitiesArray[0])\n : true,\n description:\n 'The mode does not support studies that ONLY include the following modalities: SM, OT, DOC',\n };\n },\n /**\n * Mode Routes are used to define the mode's behavior. A list of Mode Route\n * that includes the mode's path and the layout to be used. The layout will\n * include the components that are used in the layout. For instance, if the\n * default layoutTemplate is used (id: '@ohif/extension-default.layoutTemplateModule.viewerLayout')\n * it will include the leftPanels, rightPanels, and viewports. However, if\n * you define another layoutTemplate that includes a Footer for instance,\n * you should provide the Footer component here too. Note: We use Strings\n * to reference the component's ID as they are registered in the internal\n * ExtensionManager. The template for the string is:\n * `${extensionId}.{moduleType}.${componentId}`.\n */\n routes: [\n {\n path: 'template',\n layoutTemplate: ({ location, servicesManager }) => {\n return {\n id: ohif.layout,\n props: {\n leftPanels: [ohif.leftPanel],\n leftPanelResizable: true,\n rightPanels: [cornerstone.panelTool],\n rightPanelResizable: true,\n // leftPanelClosed: true,\n viewports: [\n {\n namespace: cornerstone.viewport,\n displaySetsToDisplay: [ohif.sopClassHandler],\n },\n {\n namespace: segmentation.viewport,\n displaySetsToDisplay: [segmentation.sopClassHandler],\n },\n {\n namespace: dicomRT.viewport,\n displaySetsToDisplay: [dicomRT.sopClassHandler],\n },\n ],\n },\n };\n },\n },\n ],\n /** List of extensions that are used by the mode */\n extensions: extensionDependencies,\n /** HangingProtocol used by the mode */\n // Commented out to just use the most applicable registered hanging protocol\n // The example is used for a grid layout to specify that as a preferred layout\n hangingProtocol: ['@ohif/mnGrid'],\n /** SopClassHandlers used by the mode */\n sopClassHandlers: [ohif.sopClassHandler, segmentation.sopClassHandler, dicomRT.sopClassHandler],\n };\n}\n\nconst mode = {\n id,\n modeFactory,\n extensionDependencies,\n};\n\nexport default mode;\n"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__498__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","id","packageJson","setToolActiveToolbar","commandName","commandOptions","toolGroupIds","callbacks","toolName","uiType","props","buttonSection","icon","label","tooltip","evaluate","name","hideWhenDisabled","type","commands","disabledText","unsupportedViewportTypes","rows","columns","toolNames","options","min","max","step","values","listeners","ViewportGridService","EVENTS","ACTIVE_VIEWPORT_ID_CHANGED","VIEWPORTS_READY","commandsManager","find","option","run","thresholdRangeOption","thresholdRangeValue","condition","colours","colorsByOrientation","axial","sagittal","coronal","createTools","utilityModule","Enums","tools","active","WindowLevel","bindings","mouseButton","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","numTouchPoints","StackScroll","Wheel","passive","parentTool","configuration","activeStrategy","LabelmapSlicePropagation","MarkerLabelmap","RegionSegmentPlus","threshold","isDynamic","dynamicRadius","SegmentBidirectional","SegmentSelect","CircleScissors","RectangleScissors","SphereScissors","Magnify","WindowLevelRegion","UltrasoundDirectional","disabled","ReferenceLines","AdvancedMagnify","ohif","segmentation","dicomRT","extensionDependencies","modeFactory","modeConfiguration","routeName","displayName","onModeEnter","servicesManager","extensionManager","measurementService","toolbarService","toolGroupService","customizationService","services","clearMeasurements","getModuleEntry","createToolGroupAndAddTools","initDefaultToolGroup","_servicesManager","cornerstoneViewportService","push","Crosshairs","viewportIndicators","viewportIndicatorsConfig","circleRadius","xOffset","yOffset","disableOnPassive","autoPan","enabled","panSize","getReferenceLineColor","viewportId","viewportInfo","getViewportInfo","viewportOptions","orientation","console","warn","initMPRToolGroup","TrackballRotateTool","initVolume3DToolGroup","initToolGroups","register","toolbarButtons","updateSection","sections","primary","viewportActionMenu","topLeft","bottomMiddle","topRight","bottomLeft","segmentationToolbox","onModeExit","syncGroupService","segmentationService","uiDialogService","uiModalService","hideAll","hide","destroy","validationTags","study","series","isValidMode","modalities","modalitiesArray","split","valid","length","includes","description","routes","path","layoutTemplate","location","leftPanels","leftPanelResizable","rightPanels","rightPanelResizable","viewports","namespace","displaySetsToDisplay","extensions","hangingProtocol","sopClassHandlers"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.umd.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cAAeA,QAAQ,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,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUV,EAAQA,EAAOD,QAASU,GAG/CT,EAAOD,OACf,CCrBAU,EAAoBK,EAAKd,IACxB,IAAIe,EAASf,GAAUA,EAAOgB,WAC7B,IAAOhB,EAAiB,QACxB,IAAM,EAEP,OADAS,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRN,EAAoBQ,EAAI,CAAClB,EAASoB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEtB,EAASqB,IAC5EE,OAAOC,eAAexB,EAASqB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EA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B,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":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohif/mode-segmentation",
|
|
3
|
-
"version": "3.12.0-beta.
|
|
3
|
+
"version": "3.12.0-beta.90",
|
|
4
4
|
"description": "OHIF segmentation mode which enables labelmap segmentation read/edit/export",
|
|
5
5
|
"author": "@ohif",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,43 +35,43 @@
|
|
|
35
35
|
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@ohif/core": "3.12.0-beta.
|
|
39
|
-
"@ohif/extension-cornerstone": "3.12.0-beta.
|
|
40
|
-
"@ohif/extension-cornerstone-dicom-rt": "3.12.0-beta.
|
|
41
|
-
"@ohif/extension-cornerstone-dicom-seg": "3.12.0-beta.
|
|
42
|
-
"@ohif/extension-cornerstone-dicom-sr": "3.12.0-beta.
|
|
43
|
-
"@ohif/extension-default": "3.12.0-beta.
|
|
44
|
-
"@ohif/extension-dicom-pdf": "3.12.0-beta.
|
|
45
|
-
"@ohif/extension-dicom-video": "3.12.0-beta.
|
|
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"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@babel/runtime": "
|
|
49
|
-
"i18next": "
|
|
48
|
+
"@babel/runtime": "7.28.2",
|
|
49
|
+
"i18next": "17.3.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@babel/core": "7.28.0",
|
|
53
53
|
"@babel/eslint-parser": "7.28.0",
|
|
54
|
-
"@babel/plugin-syntax-dynamic-import": "
|
|
55
|
-
"@babel/plugin-transform-arrow-functions": "
|
|
56
|
-
"@babel/plugin-transform-class-properties": "
|
|
57
|
-
"@babel/plugin-transform-object-rest-spread": "
|
|
58
|
-
"@babel/plugin-transform-private-methods": "
|
|
59
|
-
"@babel/plugin-transform-regenerator": "
|
|
54
|
+
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
55
|
+
"@babel/plugin-transform-arrow-functions": "7.27.1",
|
|
56
|
+
"@babel/plugin-transform-class-properties": "7.27.1",
|
|
57
|
+
"@babel/plugin-transform-object-rest-spread": "7.28.0",
|
|
58
|
+
"@babel/plugin-transform-private-methods": "7.27.1",
|
|
59
|
+
"@babel/plugin-transform-regenerator": "7.28.1",
|
|
60
60
|
"@babel/plugin-transform-runtime": "7.28.0",
|
|
61
|
-
"@babel/plugin-transform-typescript": "
|
|
61
|
+
"@babel/plugin-transform-typescript": "7.28.0",
|
|
62
62
|
"@babel/preset-env": "7.28.0",
|
|
63
|
-
"@babel/preset-react": "
|
|
64
|
-
"@babel/preset-typescript": "
|
|
65
|
-
"@svgr/webpack": "
|
|
66
|
-
"babel-loader": "
|
|
67
|
-
"clean-webpack-plugin": "
|
|
68
|
-
"copy-webpack-plugin": "
|
|
69
|
-
"cross-env": "
|
|
70
|
-
"dotenv": "
|
|
71
|
-
"eslint": "
|
|
72
|
-
"eslint-loader": "
|
|
63
|
+
"@babel/preset-react": "7.27.1",
|
|
64
|
+
"@babel/preset-typescript": "7.27.1",
|
|
65
|
+
"@svgr/webpack": "8.1.0",
|
|
66
|
+
"babel-loader": "8.4.1",
|
|
67
|
+
"clean-webpack-plugin": "3.0.0",
|
|
68
|
+
"copy-webpack-plugin": "9.1.0",
|
|
69
|
+
"cross-env": "7.0.3",
|
|
70
|
+
"dotenv": "8.6.0",
|
|
71
|
+
"eslint": "8.57.1",
|
|
72
|
+
"eslint-loader": "2.2.1",
|
|
73
73
|
"webpack": "5.95.0",
|
|
74
|
-
"webpack-cli": "
|
|
75
|
-
"webpack-merge": "
|
|
74
|
+
"webpack-cli": "5.1.4",
|
|
75
|
+
"webpack-merge": "5.10.0"
|
|
76
76
|
}
|
|
77
77
|
}
|