@ohif/mode-segmentation 3.10.0-beta.130 → 3.10.0-beta.131

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():"function"==typeof define&&define.amd?define("@ohif/mode-segmentation",[],o):"object"==typeof exports?exports["@ohif/mode-segmentation"]=o():e["@ohif/mode-segmentation"]=o()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var e={d:(o,t)=>{for(var a in t)e.o(t,a)&&!e.o(o,a)&&Object.defineProperty(o,a,{enumerable:!0,get:t[a]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{default:()=>m});const t=JSON.parse('{"UU":"@ohif/mode-segmentation"}').UU,a={commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["default","mpr","SRToolGroup","volume3d"]}},i=[{id:"MoreTools",uiType:"ohif.toolButtonList",props:{buttonSection:"moreToolsSection",groupId:"MoreTools"}},{id:"BrushTools",uiType:"ohif.toolBoxButtonGroup",props:{groupId:"BrushTools",buttonSection:"brushToolsSection"}},{id:"SegmentationUtilities",uiType:"ohif.toolBoxButton",props:{groupId:"SegmentationUtilities",buttonSection:"segmentationToolboxUtilitySection"}},{id:"SegmentationTools",uiType:"ohif.toolBoxButton",props:{groupId:"SegmentationTools",buttonSection:"segmentationToolboxToolsSection"}},{id:"Zoom",uiType:"ohif.toolButton",props:{icon:"tool-zoom",label:"Zoom",commands:a,evaluate:"evaluate.cornerstoneTool"}},{id:"WindowLevel",uiType:"ohif.toolButton",props:{icon:"tool-window-level",label:"Window Level",commands:a,evaluate:"evaluate.cornerstoneTool"}},{id:"Pan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:"Pan",commands:a,evaluate:"evaluate.cornerstoneTool"}},{id:"TrackballRotate",uiType:"ohif.toolButton",props:{type:"tool",icon:"tool-3d-rotate",label:"3D Rotate",commands:a,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:a,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:a,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",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:"Finding the largest bidirectional measurement per lesion",evaluate:{name:"evaluate.cornerstone.segmentation",disabledText:"Create new segmentation to enable this tool."},commands:"runSegmentBidirectional"}},{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"}]}}],r={"viewport-0":"rgb(200, 0, 0)","viewport-1":"rgb(200, 200, 0)","viewport-2":"rgb(0, 200, 0)"},n={axial:"rgb(200, 0, 0)",sagittal:"rgb(200, 200, 0)",coronal:"rgb(0, 200, 0)"};function l(e){const{toolNames:o,Enums:t}=e.exports;return{active:[{toolName:o.WindowLevel,bindings:[{mouseButton:t.MouseBindings.Primary}]},{toolName:o.Pan,bindings:[{mouseButton:t.MouseBindings.Auxiliary}]},{toolName:o.Zoom,bindings:[{mouseButton:t.MouseBindings.Secondary}]},{toolName:o.StackScroll,bindings:[{mouseButton:t.MouseBindings.Wheel}]}],passive:[{toolName:"CircularBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_CIRCLE"}},{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:o.SegmentBidirectional},{toolName:"ThresholdSphereBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE",threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:o.CircleScissors},{toolName:o.RectangleScissors},{toolName:o.SphereScissors},{toolName:o.StackScroll},{toolName:o.Magnify},{toolName:o.WindowLevelRegion},{toolName:o.UltrasoundDirectional}],disabled:[{toolName:o.ReferenceLines},{toolName:o.AdvancedMagnify}]}}const s="@ohif/extension-default.sopClassHandlerModule.stack",u="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",c="@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt",d={"@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"},m={id:t,modeFactory:function({modeConfiguration:e}){return{id:t,routeName:"segmentation",displayName:"Segmentation",onModeEnter:({servicesManager:e,extensionManager:o,commandsManager:t})=>{const{measurementService:a,toolbarService:s,toolGroupService:u,customizationService:c}=e.services;a.clearMeasurements(),function(e,o){!function(e,o){const t=l(e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"));o.createToolGroupAndAddTools("default",t)}(e,o),function(e,o){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),a=e._servicesManager,{cornerstoneViewportService:i}=a.services,s=l(t);s.disabled.push({toolName:t.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?r[t.id]||n[t.orientation]||"#0c0":(console.warn("missing viewport?",e),"#0c0")}}},{toolName:t.exports.toolNames.ReferenceLines}),o.createToolGroupAndAddTools("mpr",s)}(e,o),function(e,o){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:a,Enums:i}=t.exports,r={active:[{toolName:a.TrackballRotateTool,bindings:[{mouseButton:i.MouseBindings.Primary}]},{toolName:a.Zoom,bindings:[{mouseButton:i.MouseBindings.Secondary}]},{toolName:a.Pan,bindings:[{mouseButton:i.MouseBindings.Auxiliary}]}]};o.createToolGroupAndAddTools("volume3d",r)}(e,o)}(o,u),s.addButtons(i),s.createButtonSection("primary",["WindowLevel","Pan","Zoom","TrackballRotate","Capture","Layout","Crosshairs","MoreTools"]),s.createButtonSection("moreToolsSection",["Reset","rotate-right","flipHorizontal","ReferenceLines","ImageOverlayViewer","StackScroll","invert","Cine","Magnify","TagBrowser"]),s.createButtonSection("segmentationToolbox",["SegmentationUtilities","SegmentationTools"]),s.createButtonSection("segmentationToolboxUtilitySection",["InterpolateLabelmap","SegmentBidirectional"]),s.createButtonSection("segmentationToolboxToolsSection",["BrushTools","Shapes"]),s.createButtonSection("brushToolsSection",["Brush","Eraser","Threshold"])},onModeExit:({servicesManager:e})=>{const{toolGroupService:o,syncGroupService:t,segmentationService:a,cornerstoneViewportService:i,uiDialogService:r,uiModalService:n}=e.services;r.hideAll(),n.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","@ohif/extension-cornerstone.panelModule.panelMeasurement"],rightPanelResizable:!0,viewports:[{namespace:"@ohif/extension-cornerstone.viewportModule.cornerstone",displaySetsToDisplay:[s]},{namespace:"@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",displaySetsToDisplay:[u]},{namespace:"@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt",displaySetsToDisplay:[c]}]}})}],extensions:d,sopClassHandlers:[s,u,c]}},extensionDependencies:d};return o})()));
1
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("@ohif/mode-segmentation",[],o):"object"==typeof exports?exports["@ohif/mode-segmentation"]=o():e["@ohif/mode-segmentation"]=o()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var e={d:(o,t)=>{for(var a in t)e.o(t,a)&&!e.o(o,a)&&Object.defineProperty(o,a,{enumerable:!0,get:t[a]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{default:()=>m});const t=JSON.parse('{"UU":"@ohif/mode-segmentation"}').UU,a={commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["default","mpr","SRToolGroup","volume3d"]}},i=[{id:"MoreTools",uiType:"ohif.toolButtonList",props:{buttonSection:"moreToolsSection",groupId:"MoreTools"}},{id:"BrushTools",uiType:"ohif.toolBoxButtonGroup",props:{groupId:"BrushTools",buttonSection:"brushToolsSection"}},{id:"SegmentationUtilities",uiType:"ohif.toolBoxButton",props:{groupId:"SegmentationUtilities",buttonSection:"segmentationToolboxUtilitySection"}},{id:"SegmentationTools",uiType:"ohif.toolBoxButton",props:{groupId:"SegmentationTools",buttonSection:"segmentationToolboxToolsSection"}},{id:"Zoom",uiType:"ohif.toolButton",props:{icon:"tool-zoom",label:"Zoom",commands:a,evaluate:"evaluate.cornerstoneTool"}},{id:"WindowLevel",uiType:"ohif.toolButton",props:{icon:"tool-window-level",label:"Window Level",commands:a,evaluate:"evaluate.cornerstoneTool"}},{id:"Pan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:"Pan",commands:a,evaluate:"evaluate.cornerstoneTool"}},{id:"TrackballRotate",uiType:"ohif.toolButton",props:{type:"tool",icon:"tool-3d-rotate",label:"3D Rotate",commands:a,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:a,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:a,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",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:"Finding the largest bidirectional measurement per lesion",evaluate:{name:"evaluate.cornerstone.segmentation",disabledText:"Create new segmentation to enable this tool."},commands:"runSegmentBidirectional"}},{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"}]}}],r={"viewport-0":"rgb(200, 0, 0)","viewport-1":"rgb(200, 200, 0)","viewport-2":"rgb(0, 200, 0)"},n={axial:"rgb(200, 0, 0)",sagittal:"rgb(200, 200, 0)",coronal:"rgb(0, 200, 0)"};function l(e){const{toolNames:o,Enums:t}=e.exports;return{active:[{toolName:o.WindowLevel,bindings:[{mouseButton:t.MouseBindings.Primary}]},{toolName:o.Pan,bindings:[{mouseButton:t.MouseBindings.Auxiliary}]},{toolName:o.Zoom,bindings:[{mouseButton:t.MouseBindings.Secondary}]},{toolName:o.StackScroll,bindings:[{mouseButton:t.MouseBindings.Wheel}]}],passive:[{toolName:"CircularBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_CIRCLE"}},{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:o.SegmentBidirectional},{toolName:o.SegmentSelect},{toolName:"ThresholdSphereBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE",threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName:o.CircleScissors},{toolName:o.RectangleScissors},{toolName:o.SphereScissors},{toolName:o.StackScroll},{toolName:o.Magnify},{toolName:o.WindowLevelRegion},{toolName:o.UltrasoundDirectional}],disabled:[{toolName:o.ReferenceLines},{toolName:o.AdvancedMagnify}]}}const s="@ohif/extension-default.sopClassHandlerModule.stack",u="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",c="@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt",d={"@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"},m={id:t,modeFactory:function({modeConfiguration:e}){return{id:t,routeName:"segmentation",displayName:"Segmentation",onModeEnter:({servicesManager:e,extensionManager:o,commandsManager:t})=>{const{measurementService:a,toolbarService:s,toolGroupService:u,customizationService:c}=e.services;a.clearMeasurements(),function(e,o){!function(e,o){const t=l(e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"));o.createToolGroupAndAddTools("default",t)}(e,o),function(e,o){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),a=e._servicesManager,{cornerstoneViewportService:i}=a.services,s=l(t);s.disabled.push({toolName:t.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?r[t.id]||n[t.orientation]||"#0c0":(console.warn("missing viewport?",e),"#0c0")}}},{toolName:t.exports.toolNames.ReferenceLines}),o.createToolGroupAndAddTools("mpr",s)}(e,o),function(e,o){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:a,Enums:i}=t.exports,r={active:[{toolName:a.TrackballRotateTool,bindings:[{mouseButton:i.MouseBindings.Primary}]},{toolName:a.Zoom,bindings:[{mouseButton:i.MouseBindings.Secondary}]},{toolName:a.Pan,bindings:[{mouseButton:i.MouseBindings.Auxiliary}]}]};o.createToolGroupAndAddTools("volume3d",r)}(e,o)}(o,u),s.addButtons(i),s.createButtonSection("primary",["WindowLevel","Pan","Zoom","TrackballRotate","Capture","Layout","Crosshairs","MoreTools"]),s.createButtonSection("moreToolsSection",["Reset","rotate-right","flipHorizontal","ReferenceLines","ImageOverlayViewer","StackScroll","invert","Cine","Magnify","TagBrowser"]),s.createButtonSection("segmentationToolbox",["SegmentationUtilities","SegmentationTools"]),s.createButtonSection("segmentationToolboxUtilitySection",["InterpolateLabelmap","SegmentBidirectional"]),s.createButtonSection("segmentationToolboxToolsSection",["BrushTools","Shapes"]),s.createButtonSection("brushToolsSection",["Brush","Eraser","Threshold"])},onModeExit:({servicesManager:e})=>{const{toolGroupService:o,syncGroupService:t,segmentationService:a,cornerstoneViewportService:i,uiDialogService:r,uiModalService:n}=e.services;r.hideAll(),n.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","@ohif/extension-cornerstone.panelModule.panelMeasurement"],rightPanelResizable:!0,viewports:[{namespace:"@ohif/extension-cornerstone.viewportModule.cornerstone",displaySetsToDisplay:[s]},{namespace:"@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",displaySetsToDisplay:[u]},{namespace:"@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt",displaySetsToDisplay:[c]}]}})}],extensions:d,sopClassHandlers:[s,u,c]}},extensionDependencies:d};return o})()));
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,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,0BAA2B,GAAIH,GACZ,iBAAZC,QACdA,QAAQ,2BAA6BD,IAErCD,EAAK,2BAA6BC,GACnC,CATD,CASmB,oBAATK,KAAuBA,KAAOC,MAAM,I,mBCR9C,IAAIC,EAAsB,CCA1BA,EA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C,eAAgBA,EAAGC,WAAU9D,sBACpB,CACLjF,GA3JF,4DA4JEO,MAAO,CACLyI,WAAY,CA1Jb,kDA2JCC,oBAAoB,EACpBC,YAAa,CAvJd,qEACG,4DAuJFC,qBAAqB,EAErBC,UAAW,CACT,CACEC,UA7JN,yDA8JMC,qBAAsB,CAAC9E,IAEzB,CACE6E,UA1JN,iEA2JMC,qBAAsB,CAAC7E,IAEzB,CACE4E,UA1JN,+DA2JMC,qBAAsB,CAAC5E,UASrC6E,WAAY5E,EAMZ6E,iBAAkB,CAAChF,EAAsBC,EAA8BC,GAE3E,EAKEC,yB","sources":["webpack://@ohif/mode-segmentation/webpack/universalModuleDefinition","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();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@ohif/mode-segmentation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@ohif/mode-segmentation\"] = factory();\n\telse\n\t\troot[\"@ohif/mode-segmentation\"] = factory();\n})(typeof self !== 'undefined' ? self : this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\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';\n\nconst setToolActiveToolbar = {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],\n },\n};\n\nconst toolbarButtons: Button[] = [\n // sections\n {\n id: 'MoreTools',\n uiType: 'ohif.toolButtonList',\n props: {\n buttonSection: 'moreToolsSection',\n groupId: 'MoreTools',\n },\n },\n {\n id: 'BrushTools',\n uiType: 'ohif.toolBoxButtonGroup',\n props: {\n groupId: 'BrushTools',\n buttonSection: 'brushToolsSection',\n },\n },\n // Section containers for the nested toolbox\n {\n id: 'SegmentationUtilities',\n uiType: 'ohif.toolBoxButton',\n props: {\n groupId: 'SegmentationUtilities',\n buttonSection: 'segmentationToolboxUtilitySection',\n },\n },\n {\n id: 'SegmentationTools',\n uiType: 'ohif.toolBoxButton',\n props: {\n groupId: 'SegmentationTools',\n buttonSection: 'segmentationToolboxToolsSection',\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 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: 'Finding the largest bidirectional measurement per lesion',\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: '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\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) {\n const { toolNames, Enums } = utilityModule.exports;\n return {\n active: [\n { toolName: toolNames.WindowLevel, bindings: [{ mouseButton: Enums.MouseBindings.Primary }] },\n { toolName: toolNames.Pan, bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }] },\n { toolName: toolNames.Zoom, bindings: [{ mouseButton: Enums.MouseBindings.Secondary }] },\n { toolName: toolNames.StackScroll, bindings: [{ mouseButton: Enums.MouseBindings.Wheel }] },\n ],\n passive: [\n {\n toolName: 'CircularBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'FILL_INSIDE_CIRCLE',\n },\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 // preview: {\n // enabled: true,\n // },\n threshold: {\n isDynamic: true,\n dynamicRadius: 3,\n },\n },\n },\n {\n toolName: toolNames.SegmentBidirectional,\n },\n {\n toolName: 'ThresholdSphereBrushDynamic',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'THRESHOLD_INSIDE_SPHERE',\n // preview: {\n // enabled: true,\n // },\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\nfunction initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const tools = createTools(utilityModule);\n toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);\n}\n\nfunction initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const servicesManager = extensionManager._servicesManager;\n const { cornerstoneViewportService } = servicesManager.services;\n const tools = createTools(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 }],\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.addButtons(toolbarButtons);\n\n toolbarService.createButtonSection('primary', [\n 'WindowLevel',\n 'Pan',\n 'Zoom',\n 'TrackballRotate',\n 'Capture',\n 'Layout',\n 'Crosshairs',\n 'MoreTools',\n ]);\n\n toolbarService.createButtonSection('moreToolsSection', [\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.createButtonSection('segmentationToolbox', [\n 'SegmentationUtilities',\n 'SegmentationTools',\n ]);\n toolbarService.createButtonSection('segmentationToolboxUtilitySection', [\n 'InterpolateLabelmap',\n 'SegmentBidirectional',\n ]);\n toolbarService.createButtonSection('segmentationToolboxToolsSection', [\n 'BrushTools',\n 'Shapes',\n ]);\n toolbarService.createButtonSection('brushToolsSection', ['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, cornerstone.measurements],\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","define","amd","self","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","id","packageJson","setToolActiveToolbar","commandName","commandOptions","toolGroupIds","uiType","props","buttonSection","groupId","icon","label","commands","evaluate","type","name","disabledText","unsupportedViewportTypes","rows","columns","tooltip","toolNames","options","min","max","step","values","commandsManager","find","option","run","toolName","thresholdRangeOption","thresholdRangeValue","condition","colours","colorsByOrientation","axial","sagittal","coronal","createTools","utilityModule","Enums","active","WindowLevel","bindings","mouseButton","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","StackScroll","Wheel","passive","parentTool","configuration","activeStrategy","threshold","isDynamic","dynamicRadius","SegmentBidirectional","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","tools","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","addButtons","toolbarButtons","createButtonSection","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","sopClassHandlers"],"sourceRoot":""}
1
+ {"version":3,"file":"index.umd.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,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,CACdC,MAAO,GACPC,OAAQ,IAOVC,YAAaA,EAAGC,iBAGd,MAAMC,EAAkBD,EAAWE,MAAM,MACzC,MAAO,CACLC,MAC6B,IAA3BF,EAAgBG,SACX,CAAC,KAAM,MAAO,KAAM,OAAOC,SAASJ,EAAgB,IAE3DK,YACE,4FACH,EAcHC,OAAQ,CACN,CACEC,KAAM,WACNC,eAAgBA,EAAGC,WAAU9D,sBACpB,CACLlF,GA3JF,4DA4JEO,MAAO,CACL0I,WAAY,CA1Jb,kDA2JCC,oBAAoB,EACpBC,YAAa,CAvJd,qEACG,4DAuJFC,qBAAqB,EAErBC,UAAW,CACT,CACEC,UA7JN,yDA8JMC,qBAAsB,CAAC9E,IAEzB,CACE6E,UA1JN,iEA2JMC,qBAAsB,CAAC7E,IAEzB,CACE4E,UA1JN,+DA2JMC,qBAAsB,CAAC5E,UASrC6E,WAAY5E,EAMZ6E,iBAAkB,CAAChF,EAAsBC,EAA8BC,GAE3E,EAKEC,yB","sources":["webpack://@ohif/mode-segmentation/webpack/universalModuleDefinition","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();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@ohif/mode-segmentation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@ohif/mode-segmentation\"] = factory();\n\telse\n\t\troot[\"@ohif/mode-segmentation\"] = factory();\n})(typeof self !== 'undefined' ? self : this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\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';\n\nconst setToolActiveToolbar = {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],\n },\n};\n\nconst toolbarButtons: Button[] = [\n // sections\n {\n id: 'MoreTools',\n uiType: 'ohif.toolButtonList',\n props: {\n buttonSection: 'moreToolsSection',\n groupId: 'MoreTools',\n },\n },\n {\n id: 'BrushTools',\n uiType: 'ohif.toolBoxButtonGroup',\n props: {\n groupId: 'BrushTools',\n buttonSection: 'brushToolsSection',\n },\n },\n // Section containers for the nested toolbox\n {\n id: 'SegmentationUtilities',\n uiType: 'ohif.toolBoxButton',\n props: {\n groupId: 'SegmentationUtilities',\n buttonSection: 'segmentationToolboxUtilitySection',\n },\n },\n {\n id: 'SegmentationTools',\n uiType: 'ohif.toolBoxButton',\n props: {\n groupId: 'SegmentationTools',\n buttonSection: 'segmentationToolboxToolsSection',\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 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: 'Finding the largest bidirectional measurement per lesion',\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: '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\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) {\n const { toolNames, Enums } = utilityModule.exports;\n return {\n active: [\n { toolName: toolNames.WindowLevel, bindings: [{ mouseButton: Enums.MouseBindings.Primary }] },\n { toolName: toolNames.Pan, bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }] },\n { toolName: toolNames.Zoom, bindings: [{ mouseButton: Enums.MouseBindings.Secondary }] },\n { toolName: toolNames.StackScroll, bindings: [{ mouseButton: Enums.MouseBindings.Wheel }] },\n ],\n passive: [\n {\n toolName: 'CircularBrush',\n parentTool: 'Brush',\n configuration: {\n activeStrategy: 'FILL_INSIDE_CIRCLE',\n },\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\nfunction initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const tools = createTools(utilityModule);\n toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);\n}\n\nfunction initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {\n const utilityModule = extensionManager.getModuleEntry(\n '@ohif/extension-cornerstone.utilityModule.tools'\n );\n const servicesManager = extensionManager._servicesManager;\n const { cornerstoneViewportService } = servicesManager.services;\n const tools = createTools(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 }],\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.addButtons(toolbarButtons);\n\n toolbarService.createButtonSection('primary', [\n 'WindowLevel',\n 'Pan',\n 'Zoom',\n 'TrackballRotate',\n 'Capture',\n 'Layout',\n 'Crosshairs',\n 'MoreTools',\n ]);\n\n toolbarService.createButtonSection('moreToolsSection', [\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.createButtonSection('segmentationToolbox', [\n 'SegmentationUtilities',\n 'SegmentationTools',\n ]);\n toolbarService.createButtonSection('segmentationToolboxUtilitySection', [\n 'InterpolateLabelmap',\n 'SegmentBidirectional',\n ]);\n toolbarService.createButtonSection('segmentationToolboxToolsSection', [\n 'BrushTools',\n 'Shapes',\n ]);\n toolbarService.createButtonSection('brushToolsSection', ['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, cornerstone.measurements],\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","define","amd","self","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","id","packageJson","setToolActiveToolbar","commandName","commandOptions","toolGroupIds","uiType","props","buttonSection","groupId","icon","label","commands","evaluate","type","name","disabledText","unsupportedViewportTypes","rows","columns","tooltip","toolNames","options","min","max","step","values","commandsManager","find","option","run","toolName","thresholdRangeOption","thresholdRangeValue","condition","colours","colorsByOrientation","axial","sagittal","coronal","createTools","utilityModule","Enums","active","WindowLevel","bindings","mouseButton","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","StackScroll","Wheel","passive","parentTool","configuration","activeStrategy","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","tools","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","addButtons","toolbarButtons","createButtonSection","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","sopClassHandlers"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohif/mode-segmentation",
3
- "version": "3.10.0-beta.130",
3
+ "version": "3.10.0-beta.131",
4
4
  "description": "OHIF segmentation mode which enables labelmap segmentation read/edit/export",
5
5
  "author": "@ohif",
6
6
  "license": "MIT",
@@ -35,14 +35,14 @@
35
35
  "test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
36
36
  },
37
37
  "peerDependencies": {
38
- "@ohif/core": "3.10.0-beta.130",
39
- "@ohif/extension-cornerstone": "3.10.0-beta.130",
40
- "@ohif/extension-cornerstone-dicom-rt": "3.10.0-beta.130",
41
- "@ohif/extension-cornerstone-dicom-seg": "3.10.0-beta.130",
42
- "@ohif/extension-cornerstone-dicom-sr": "3.10.0-beta.130",
43
- "@ohif/extension-default": "3.10.0-beta.130",
44
- "@ohif/extension-dicom-pdf": "3.10.0-beta.130",
45
- "@ohif/extension-dicom-video": "3.10.0-beta.130"
38
+ "@ohif/core": "3.10.0-beta.131",
39
+ "@ohif/extension-cornerstone": "3.10.0-beta.131",
40
+ "@ohif/extension-cornerstone-dicom-rt": "3.10.0-beta.131",
41
+ "@ohif/extension-cornerstone-dicom-seg": "3.10.0-beta.131",
42
+ "@ohif/extension-cornerstone-dicom-sr": "3.10.0-beta.131",
43
+ "@ohif/extension-default": "3.10.0-beta.131",
44
+ "@ohif/extension-dicom-pdf": "3.10.0-beta.131",
45
+ "@ohif/extension-dicom-video": "3.10.0-beta.131"
46
46
  },
47
47
  "dependencies": {
48
48
  "@babel/runtime": "^7.20.13",