@ohif/mode-segmentation 3.8.0-beta.8 → 3.8.0-beta.81
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(o,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@ohif/core"),require("@ohif/ui")):"function"==typeof define&&define.amd?define("@ohif/mode-segmentation",["@ohif/core","@ohif/ui"],e):"object"==typeof exports?exports["@ohif/mode-segmentation"]=e(require("@ohif/core"),require("@ohif/ui")):o["@ohif/mode-segmentation"]=e(o["@ohif/core"],o["@ohif/ui"])}("undefined"!=typeof self?self:this,((o,e)=>(()=>{"use strict";var t={310:e=>{e.exports=o},214:o=>{o.exports=e}},n={};function i(o){var e=n[o];if(void 0!==e)return e.exports;var r=n[o]={exports:{}};return t[o](r,r.exports,i),r.exports}i.d=(o,e)=>{for(var t in e)i.o(e,t)&&!i.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:e[t]})},i.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),i.r=o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var r={};return(()=>{i.r(r),i.d(r,{default:()=>E});var o=i(310);const e=JSON.parse('{"u2":"@ohif/mode-segmentation"}').u2;var t=i(214);const{windowLevelPresets:n}=o.defaults;function s(o,e,t,n,i,r,s){return{id:e,icon:t,label:n,type:o,commands:i,tooltip:r,uiType:s}}const a=s.bind(null,"action"),l=s.bind(null,"toggle"),c=s.bind(null,"tool");function m(o,e,t){return{id:o.toString(),title:e,subtitle:t,type:"action",commands:[{commandName:"setWindowLevel",commandOptions:{...n[o]},context:"CORNERSTONE"}]}}const d=["default","mpr","SRToolGroup"];function p(o){return d.map((e=>({commandName:"setToolActive",commandOptions:{toolGroupId:e,toolName:o},context:"CORNERSTONE"})))}const u=[{id:"Zoom",type:"ohif.radioGroup",props:{type:"tool",icon:"tool-zoom",label:"Zoom",commands:p("Zoom")}},{id:"WindowLevel",type:"ohif.splitButton",props:{groupId:"WindowLevel",primary:c("WindowLevel","tool-window-level","Window Level",[{commandName:"setToolActive",commandOptions:{toolName:"WindowLevel"},context:"CORNERSTONE"}],"Window Level"),secondary:{icon:"chevron-down",label:"W/L Manual",isActive:!0,tooltip:"W/L Presets"},isAction:!0,renderer:t.WindowLevelMenuItem,items:[m(1,"Soft tissue","400 / 40"),m(2,"Lung","1500 / -600"),m(3,"Liver","150 / 90"),m(4,"Bone","2500 / 480"),m(5,"Brain","80 / 40")]}},{id:"Pan",type:"ohif.radioGroup",props:{type:"tool",icon:"tool-move",label:"Pan",commands:p("Pan")}},{id:"Capture",type:"ohif.action",props:{icon:"tool-capture",label:"Capture",type:"action",commands:[{commandName:"showDownloadViewportModal",commandOptions:{},context:"CORNERSTONE"}]}},{id:"Layout",type:"ohif.layoutSelector",props:{rows:3,columns:3}},{id:"MPR",type:"ohif.action",props:{type:"toggle",icon:"icon-mpr",label:"MPR",commands:[{commandName:"toggleHangingProtocol",commandOptions:{protocolId:"mpr"},context:"DEFAULT"}]}},{id:"Crosshairs",type:"ohif.radioGroup",props:{type:"tool",icon:"tool-crosshair",label:"Crosshairs",commands:[{commandName:"setToolActive",commandOptions:{toolName:"Crosshairs",toolGroupId:"mpr"},context:"CORNERSTONE"}]}},{id:"MoreTools",type:"ohif.splitButton",props:{isRadio:!0,groupId:"MoreTools",primary:a("Reset","tool-reset","Reset View",[{commandName:"resetViewport",commandOptions:{},context:"CORNERSTONE"}],"Reset"),secondary:{icon:"chevron-down",label:"",isActive:!0,tooltip:"More Tools"},items:[a("Reset","tool-reset","Reset View",[{commandName:"resetViewport",commandOptions:{},context:"CORNERSTONE"}],"Reset"),a("rotate-right","tool-rotate-right","Rotate Right",[{commandName:"rotateViewportCW",commandOptions:{},context:"CORNERSTONE"}],"Rotate +90"),a("flip-horizontal","tool-flip-horizontal","Flip Horizontally",[{commandName:"flipViewportHorizontal",commandOptions:{},context:"CORNERSTONE"}],"Flip Horizontal"),l("StackImageSync","link","Stack Image Sync",[{commandName:"toggleStackImageSync",commandOptions:{},context:"CORNERSTONE"}]),l("ReferenceLines","tool-referenceLines","Reference Lines",[{commandName:"toggleReferenceLines",commandOptions:{},context:"CORNERSTONE"}]),c("StackScroll","tool-stack-scroll","Stack Scroll",[{commandName:"setToolActive",commandOptions:{toolName:"StackScroll"},context:"CORNERSTONE"}],"Stack Scroll"),a("invert","tool-invert","Invert",[{commandName:"invertViewport",commandOptions:{},context:"CORNERSTONE"}],"Invert Colors"),l("cine","tool-cine","Cine",[{commandName:"toggleCine",context:"CORNERSTONE"}],"Cine"),c("Magnify","tool-magnify","Magnify",[{commandName:"setToolActive",commandOptions:{toolName:"Magnify"},context:"CORNERSTONE"}],"Magnify"),a("TagBrowser","list-bullets","Dicom Tag Browser",[{commandName:"openDICOMTagViewer",commandOptions:{},context:"DEFAULT"}],"Dicom Tag Browser")]}}],h={CircularBrush:"CircularBrush",CircularEraser:"CircularEraser",SphereBrush:"SphereBrush",SphereEraser:"SphereEraser",ThresholdCircularBrush:"ThresholdCircularBrush",ThresholdSphereBrush:"ThresholdSphereBrush"},f={CircularBrush:"FILL_INSIDE_CIRCLE",CircularEraser:"ERASE_INSIDE_CIRCLE",SphereBrush:"FILL_INSIDE_SPHERE",SphereEraser:"ERASE_INSIDE_SPHERE",ThresholdCircularBrush:"THRESHOLD_INSIDE_CIRCLE",ThresholdSphereBrush:"THRESHOLD_INSIDE_SPHERE"};function S(o){const{toolNames:e,Enums:t}=o.exports;return{active:[{toolName:e.WindowLevel,bindings:[{mouseButton:t.MouseBindings.Primary}]},{toolName:e.Pan,bindings:[{mouseButton:t.MouseBindings.Auxiliary}]},{toolName:e.Zoom,bindings:[{mouseButton:t.MouseBindings.Secondary}]},{toolName:e.StackScrollMouseWheel,bindings:[]}],passive:Object.keys(h).map((o=>({toolName:o,parentTool:"Brush",configuration:{activeStrategy:f[o]}}))).concat([{toolName:e.CircleScissors},{toolName:e.RectangleScissors},{toolName:e.SphereScissors},{toolName:e.StackScroll},{toolName:e.Magnify},{toolName:e.SegmentationDisplay}]),disabled:[{toolName:e.ReferenceLines}]}}const N="@ohif/extension-default.sopClassHandlerModule.stack",g="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",y={"@ohif/extension-default":"^3.0.0","@ohif/extension-cornerstone":"^3.0.0","@ohif/extension-cornerstone-dicom-seg":"^3.0.0"},E={id:e,modeFactory:function(t){let{modeConfiguration:n}=t;return{id:e,routeName:"segmentation",displayName:"Segmentation",onModeEnter:o=>{let{servicesManager:e,extensionManager:t,commandsManager:n}=o;const{measurementService:i,toolbarService:r,toolGroupService:s}=e.services;let a;i.clearMeasurements(),function(o,e,t){!function(o,e,t,n){const i=S(o.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"));e.createToolGroupAndAddTools("default",i)}(o,e),function(o,e,t){const n=o.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),i=S(n);i.disabled.push({toolName:n.exports.toolNames.Crosshairs,configuration:{viewportIndicators:!1,autoPan:{enabled:!1,panSize:10}}},{toolName:n.exports.toolNames.ReferenceLines}),e.createToolGroupAndAddTools("mpr",i)}(o,e)}(t,s),({unsubscribe:a}=s.subscribe(s.EVENTS.VIEWPORT_ADDED,(()=>{r.recordInteraction({groupId:"WindowLevel",interactionType:"tool",commands:[{commandName:"setToolActive",commandOptions:{toolName:"WindowLevel"},context:"CORNERSTONE"}]}),a()}))),r.init(t),r.addButtons(u),r.createButtonSection("primary",["Zoom","WindowLevel","Pan","Capture","Layout","MPR","Crosshairs","MoreTools"])},onModeExit:o=>{let{servicesManager:e}=o;const{toolGroupService:t,syncGroupService:n,toolbarService:i,segmentationService:r,cornerstoneViewportService:s}=e.services;t.destroy(),n.destroy(),r.destroy(),s.destroy()},validationTags:{study:[],series:[]},isValidMode:o=>{let{modalities:e}=o;return!0},routes:[{path:"template",layoutTemplate:o=>{let{location:e,servicesManager:t}=o;return{id:"@ohif/extension-default.layoutTemplateModule.viewerLayout",props:{leftPanels:["@ohif/extension-default.panelModule.seriesList"],rightPanels:["@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentationWithTools"],viewports:[{namespace:"@ohif/extension-cornerstone.viewportModule.cornerstone",displaySetsToDisplay:[N]},{namespace:"@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",displaySetsToDisplay:[g]}]}}}}],extensions:y,sopClassHandlers:[N,g],hotkeys:[...o.hotkeys.defaults.hotkeyBindings]}},extensionDependencies:y}})(),r})()));
|
|
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}},a={};function t(e){var r=a[e];if(void 0!==r)return r.exports;var l=a[e]={exports:{}};return o[e](l,l.exports,t),l.exports}t.d=(e,o)=>{for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{t.r(r),t.d(r,{default:()=>h});var e=t(498);const o=JSON.parse('{"UU":"@ohif/mode-segmentation"}').UU,{createButton:a}=e.ToolbarService,l=[{commandName:"setSourceViewportForReferenceLinesTool",context:"CORNERSTONE"}],i={commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["default","mpr","SRToolGroup","volume3d"]}},n=[{id:"Zoom",uiType:"ohif.radioGroup",props:{icon:"tool-zoom",label:"Zoom",commands:i,evaluate:"evaluate.cornerstoneTool"}},{id:"WindowLevel",uiType:"ohif.radioGroup",props:{icon:"tool-window-level",label:"Window Level",commands:i,evaluate:"evaluate.cornerstoneTool"}},{id:"Pan",uiType:"ohif.radioGroup",props:{icon:"tool-move",label:"Pan",commands:i,evaluate:"evaluate.cornerstoneTool"}},{id:"TrackballRotate",uiType:"ohif.radioGroup",props:{type:"tool",icon:"tool-3d-rotate",label:"3D Rotate",commands:i,evaluate:{name:"evaluate.cornerstoneTool",disabledText:"Select a 3D viewport to enable this tool"}}},{id:"Capture",uiType:"ohif.radioGroup",props:{icon:"tool-capture",label:"Capture",commands:"showDownloadViewportModal",evaluate:"evaluate.action"}},{id:"Layout",uiType:"ohif.layoutSelector",props:{rows:3,columns:4,evaluate:"evaluate.action",commands:"setViewportGridLayout"}},{id:"Crosshairs",uiType:"ohif.radioGroup",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:"MoreTools",uiType:"ohif.splitButton",props:{groupId:"MoreTools",evaluate:"evaluate.group.promoteToPrimaryIfCornerstoneToolNotActiveInTheList",primary:a({id:"Reset",icon:"tool-reset",tooltip:"Reset View",label:"Reset",commands:"resetViewport",evaluate:"evaluate.action"}),secondary:{icon:"chevron-down",label:"",tooltip:"More Tools"},items:[a({id:"Reset",icon:"tool-reset",label:"Reset View",tooltip:"Reset View",commands:"resetViewport",evaluate:"evaluate.action"}),a({id:"rotate-right",icon:"tool-rotate-right",label:"Rotate Right",tooltip:"Rotate +90",commands:"rotateViewportCW",evaluate:"evaluate.action"}),a({id:"flipHorizontal",icon:"tool-flip-horizontal",label:"Flip Horizontal",tooltip:"Flip Horizontally",commands:"flipViewportHorizontal",evaluate:["evaluate.viewportProperties.toggle","evaluate.not3D"]}),a({id:"ReferenceLines",icon:"tool-referenceLines",label:"Reference Lines",tooltip:"Show Reference Lines",commands:"toggleEnabledDisabledToolbar",listeners:{[e.ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:l,[e.ViewportGridService.EVENTS.VIEWPORTS_READY]:l},evaluate:"evaluate.cornerstoneTool.toggle"}),a({id:"ImageOverlayViewer",icon:"toggle-dicom-overlay",label:"Image Overlay",tooltip:"Toggle Image Overlay",commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}),a({id:"StackScroll",icon:"tool-stack-scroll",label:"Stack Scroll",tooltip:"Stack Scroll",commands:i,evaluate:"evaluate.cornerstoneTool"}),a({id:"invert",icon:"tool-invert",label:"Invert",tooltip:"Invert Colors",commands:"invertViewport",evaluate:"evaluate.viewportProperties.toggle"}),a({id:"Probe",icon:"tool-probe",label:"Probe",tooltip:"Probe",commands:i,evaluate:"evaluate.cornerstoneTool"}),a({id:"Cine",icon:"tool-cine",label:"Cine",tooltip:"Cine",commands:"toggleCine",evaluate:["evaluate.cine","evaluate.not3D"]}),a({id:"Angle",icon:"tool-angle",label:"Angle",tooltip:"Angle",commands:i,evaluate:"evaluate.cornerstoneTool"}),a({id:"Magnify",icon:"tool-magnify",label:"Magnify",tooltip:"Magnify",commands:i,evaluate:"evaluate.cornerstoneTool"}),a({id:"RectangleROI",icon:"tool-rectangle",label:"Rectangle",tooltip:"Rectangle",commands:i,evaluate:"evaluate.cornerstoneTool"}),a({id:"CalibrationLine",icon:"tool-calibration",label:"Calibration",tooltip:"Calibration Line",commands:i,evaluate:"evaluate.cornerstoneTool"}),a({id:"TagBrowser",icon:"dicom-tag-browser",label:"Dicom Tag Browser",tooltip:"Dicom Tag Browser",commands:"openDICOMTagViewer"}),a({id:"AdvancedMagnify",icon:"icon-tool-loupe",label:"Loupe",tooltip:"Loupe",commands:"toggleActiveDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle.ifStrictlyDisabled"}),a({id:"UltrasoundDirectionalTool",icon:"icon-tool-ultrasound-bidirectional",label:"Ultrasound Directional",tooltip:"Ultrasound Directional",commands:i,evaluate:["evaluate.cornerstoneTool","evaluate.isUS"]})]}}];function s(e){return[{commandName:"setToolActive",commandOptions:{toolName:e}}]}const c=[{id:"BrushTools",uiType:"ohif.buttonGroup",props:{groupId:"BrushTools",items:[{id:"Brush",icon:"icon-tool-brush",label:"Brush",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircularBrush","SphereBrush"],disabledText:"Create new segmentation to enable this tool."},commands:s("CircularBrush"),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:"Eraser",icon:"icon-tool-eraser",label:"Eraser",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircularEraser","SphereEraser"]},commands:s("CircularEraser"),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",icon:"icon-tool-threshold",label:"Threshold Tool",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"]},commands:s("ThresholdCircularBrush"),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"]}}},{name:"Shape",type:"radio",id:"eraser-mode",value:"ThresholdCircularBrush",values:[{value:"ThresholdCircularBrush",label:"Circle"},{value:"ThresholdSphereBrush",label:"Sphere"}],commands:"setToolActiveToolbar"},{name:"Threshold",type:"radio",id:"dynamic-mode",value:"ThresholdRange",values:[{value:"ThresholdDynamic",label:"Dynamic"},{value:"ThresholdRange",label:"Range"}],commands:({value:e,commandsManager:o})=>{"ThresholdDynamic"===e?o.run("setToolActive",{toolName:"ThresholdCircularBrushDynamic"}):o.run("setToolActive",{toolName:"ThresholdCircularBrush"})}},{name:"ThresholdRange",type:"double-range",id:"threshold-range",min:-1e3,max:1e3,step:1,values:[100,600],condition:({options:e})=>"ThresholdRange"===e.find((e=>"dynamic-mode"===e.id)).value,commands:{commandName:"setThresholdRange",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"]}}}]}]}},{id:"Shapes",uiType:"ohif.radioGroup",props:{label:"Shapes",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircleScissor","SphereScissor","RectangleScissor"]},icon:"icon-tool-shape",commands:s("CircleScissor"),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"}]}}];function u(e){const{toolNames:o,Enums:a}=e.exports;return{active:[{toolName:o.WindowLevel,bindings:[{mouseButton:a.MouseBindings.Primary}]},{toolName:o.Pan,bindings:[{mouseButton:a.MouseBindings.Auxiliary}]},{toolName:o.Zoom,bindings:[{mouseButton:a.MouseBindings.Secondary}]},{toolName:o.StackScrollMouseWheel,bindings:[]}],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",preview:{enabled:!0},strategySpecificConfiguration:{THRESHOLD:{isDynamic:!0,dynamicRadius:3}}}},{toolName:o.CircleScissors},{toolName:o.RectangleScissors},{toolName:o.SphereScissors},{toolName:o.StackScroll},{toolName:o.Magnify},{toolName:o.SegmentationDisplay},{toolName:o.UltrasoundDirectional}],disabled:[{toolName:o.ReferenceLines},{toolName:o.AdvancedMagnify}]}}const d="@ohif/extension-default.sopClassHandlerModule.stack",m="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",p={"@ohif/extension-default":"^3.0.0","@ohif/extension-cornerstone":"^3.0.0","@ohif/extension-cornerstone-dicom-seg":"^3.0.0"},h={id:o,modeFactory:function({modeConfiguration:a}){return{id:o,routeName:"segmentation",displayName:"Segmentation",onModeEnter:({servicesManager:e,extensionManager:o,commandsManager:a})=>{const{measurementService:t,toolbarService:r,toolGroupService:l}=e.services;t.clearMeasurements(),function(e,o,a){!function(e,o,a,t){const r=u(e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"));o.createToolGroupAndAddTools("default",r)}(e,o),function(e,o,a){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),r=u(t);r.disabled.push({toolName:t.exports.toolNames.Crosshairs,configuration:{viewportIndicators:!1,disableOnPassive:!0,autoPan:{enabled:!1,panSize:10}}},{toolName:t.exports.toolNames.ReferenceLines}),o.createToolGroupAndAddTools("mpr",r)}(e,o),function(e,o){const a=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:t,Enums:r}=a.exports,l={active:[{toolName:t.TrackballRotateTool,bindings:[{mouseButton:r.MouseBindings.Primary}]},{toolName:t.Zoom,bindings:[{mouseButton:r.MouseBindings.Secondary}]},{toolName:t.Pan,bindings:[{mouseButton:r.MouseBindings.Auxiliary}]}]};o.createToolGroupAndAddTools("volume3d",l)}(e,o)}(o,l),r.addButtons(n),r.addButtons(c),r.createButtonSection("primary",["WindowLevel","Pan","Zoom","TrackballRotate","Capture","Layout","Crosshairs","MoreTools"]),r.createButtonSection("segmentationToolbox",["BrushTools","Shapes"])},onModeExit:({servicesManager:e})=>{const{toolGroupService:o,syncGroupService:a,toolbarService:t,segmentationService:r,cornerstoneViewportService:l,uiDialogService:i,uiModalService:n}=e.services;i.dismissAll(),n.hide(),o.destroy(),a.destroy(),r.destroy(),l.destroy()},validationTags:{study:[],series:[]},isValidMode:({modalities:e})=>{const o=e.split("\\");return{valid:1!==o.length||!["SM","US","MG","OT","DOC","CR"].includes(o[0]),description:"The mode does not support studies that ONLY include the following modalities: SM, US, MG, OT, DOC, CR"}},routes:[{path:"template",layoutTemplate:({location:e,servicesManager:o})=>({id:"@ohif/extension-default.layoutTemplateModule.viewerLayout",props:{leftPanels:["@ohif/extension-default.panelModule.seriesList"],rightPanels:["@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentationWithTools"],viewports:[{namespace:"@ohif/extension-cornerstone.viewportModule.cornerstone",displaySetsToDisplay:[d]},{namespace:"@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",displaySetsToDisplay:[m]}]}})}],extensions:p,sopClassHandlers:[d,m],hotkeys:[...e.hotkeys.defaults.hotkeyBindings]}},extensionDependencies:p}})(),r})()));
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cAAeA,QAAQ,aAC/B,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,0BAA2B,CAAC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uB,MAAO,CACLvB,KAAM,SACNC,KAAM,WACNC,MAAO,MACPC,SAAU,CACR,CACEY,YAAa,wBACbC,eAAgB,CACdkB,WAAY,OAEdjB,QAAS,cAKjB,CACEtB,GAAI,aACJK,KAAM,kBACNuB,MAAO,CACLvB,KAAM,OACNC,KAAM,iBACNC,MAAO,aACPC,SAAU,CACR,CACEY,YAAa,gBACbC,eAAgB,CACdI,SAAU,aACVE,YAAa,OAEfL,QAAS,kBAMjB,CACEtB,GAAI,YACJK,KAAM,mBACNuB,MAAO,CACLY,SAAS,EACTX,QAAS,YACTC,QAASnB,EACP,QACA,aACA,aACA,CACE,CACES,YAAa,gBACbC,eAAgB,CAAC,EACjBC,QAAS,gBAGb,SAEFS,UAAW,CACTzB,KAAM,eACNC,MAAO,GACPyB,UAAU,EACVvB,QAAS,cAEX2B,MAAO,CACLzB,EACE,QACA,aACA,aACA,CACE,CACES,YAAa,gBACbC,eAAgB,CAAC,EACjBC,QAAS,gBAGb,SAEFX,EACE,eACA,oBACA,eACA,CACE,CACES,YAAa,mBACbC,eAAgB,CAAC,EACjBC,QAAS,gBAGb,cAEFX,EACE,kBACA,uBACA,oBACA,CACE,CACES,YAAa,yBACbC,eAAgB,CAAC,EACjBC,QAAS,gBAGb,mBAEFT,EAAoB,iBAAkB,OAAQ,mBAAoB,CAChE,CACEO,YAAa,uBACbC,eAAgB,CAAC,EACjBC,QAAS,iBAGbT,EACE,iBACA,sBACA,kBACA,CACE,CACEO,YAAa,uBACbC,eAAgB,CAAC,EACjBC,QAAS,iBAIfR,EACE,cACA,oBACA,eACA,CACE,CACEM,YAAa,gBACbC,eAAgB,CACdI,SAAU,eAEZH,QAAS,gBAGb,gBAEFX,EACE,SACA,cACA,SACA,CACE,CACES,YAAa,iBACbC,eAAgB,CAAC,EACjBC,QAAS,gBAGb,iBAEFT,EACE,OACA,YACA,OACA,CACE,CACEO,YAAa,aACbE,QAAS,gBAGb,QAEFR,EACE,UACA,eACA,UACA,CACE,CACEM,YA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,iBACJ3B,EAAgB,iBAChB4B,EAAgB,eAChB7B,EAAc,oBACd8B,EAAmB,2BACnBC,GACEnC,EAAgBM,SAEpBD,EAAiB+B,UACjBH,EAAiBG,UACjBF,EAAoBE,UACpBD,EAA2BC,SAAS,EAGtCC,eAAgB,CACdC,MAAO,GACPC,OAAQ,IAMVC,YAAaC,IAAA,IAAC,WAAEC,GAAYD,EAAA,OAAK,CAAI,EAarCE,OAAQ,CACN,CACEC,KAAM,WACNC,eAAgBC,IAAmC,IAAlC,SAAEC,EAAQ,gBAAE/C,GAAiB8C,EAC5C,MAAO,CACLvI,GAxIF,4DAyIE4B,MAAO,CACL6G,WAAY,CAvIb,kDAwICC,YAAa,CA9Hd,gFA+HCC,UAAW,CACT,CACEC,UAtIN,yDAuIMC,qBAAsB,CAAC9D,IAEzB,CACE6D,UAnIN,iEAoIMC,qBAAsB,CAAC7D,MAI9B,IAKP8D,WAAY7D,EAIZ8D,iBAAkB,CAAChE,EAAsBC,GAEzCgE,QAAS,IAAIA,EAAAA,QAAQ7I,SAAS8I,gBAElC,EAKEhE,wB","sources":["webpack://@ohif/mode-segmentation/webpack/universalModuleDefinition","webpack://@ohif/mode-segmentation/external umd {\"commonjs2\":\"@ohif/core\",\"commonjs\":\"@ohif/core\",\"amd\":\"@ohif/core\",\"root\":\"@ohif/core\"}","webpack://@ohif/mode-segmentation/external umd {\"commonjs2\":\"@ohif/ui\",\"commonjs\":\"@ohif/ui\",\"amd\":\"@ohif/ui\",\"root\":\"@ohif/ui\"}","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\"), require(\"@ohif/ui\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@ohif/mode-segmentation\", [\"@ohif/core\", \"@ohif/ui\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@ohif/mode-segmentation\"] = factory(require(\"@ohif/core\"), require(\"@ohif/ui\"));\n\telse\n\t\troot[\"@ohif/mode-segmentation\"] = factory(root[\"@ohif/core\"], root[\"@ohif/ui\"]);\n})(typeof self !== 'undefined' ? self : this, (__WEBPACK_EXTERNAL_MODULE__310__, __WEBPACK_EXTERNAL_MODULE__214__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__310__;","module.exports = __WEBPACK_EXTERNAL_MODULE__214__;","// 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 {\n // ExpandableToolbarButton,\n // ListMenu,\n WindowLevelMenuItem,\n} from '@ohif/ui';\nimport { defaults } from '@ohif/core';\n\nconst { windowLevelPresets } = defaults;\n/**\n *\n * @param {*} type - 'tool' | 'action' | 'toggle'\n * @param {*} id\n * @param {*} icon\n * @param {*} label\n */\nfunction _createButton(type, id, icon, label, commands, tooltip, uiType) {\n return {\n id,\n icon,\n label,\n type,\n commands,\n tooltip,\n uiType,\n };\n}\n\nconst _createActionButton = _createButton.bind(null, 'action');\nconst _createToggleButton = _createButton.bind(null, 'toggle');\nconst _createToolButton = _createButton.bind(null, 'tool');\n\n/**\n *\n * @param {*} preset - preset number (from above import)\n * @param {*} title\n * @param {*} subtitle\n */\nfunction _createWwwcPreset(preset, title, subtitle) {\n return {\n id: preset.toString(),\n title,\n subtitle,\n type: 'action',\n commands: [\n {\n commandName: 'setWindowLevel',\n commandOptions: {\n ...windowLevelPresets[preset],\n },\n context: 'CORNERSTONE',\n },\n ],\n };\n}\n\nconst toolGroupIds = ['default', 'mpr', 'SRToolGroup'];\n\n/**\n * Creates an array of 'setToolActive' commands for the given toolName - one for\n * each toolGroupId specified in toolGroupIds.\n * @param {string} toolName\n * @returns {Array} an array of 'setToolActive' commands\n */\nfunction _createSetToolActiveCommands(toolName) {\n const temp = toolGroupIds.map(toolGroupId => ({\n commandName: 'setToolActive',\n commandOptions: {\n toolGroupId,\n toolName,\n },\n context: 'CORNERSTONE',\n }));\n return temp;\n}\n\nconst toolbarButtons = [\n // Zoom..\n {\n id: 'Zoom',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-zoom',\n label: 'Zoom',\n commands: _createSetToolActiveCommands('Zoom'),\n },\n },\n // Window Level + Presets...\n {\n id: 'WindowLevel',\n type: 'ohif.splitButton',\n props: {\n groupId: 'WindowLevel',\n primary: _createToolButton(\n 'WindowLevel',\n 'tool-window-level',\n 'Window Level',\n [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'WindowLevel',\n },\n context: 'CORNERSTONE',\n },\n ],\n 'Window Level'\n ),\n secondary: {\n icon: 'chevron-down',\n label: 'W/L Manual',\n isActive: true,\n tooltip: 'W/L Presets',\n },\n isAction: true, // ?\n renderer: WindowLevelMenuItem,\n items: [\n _createWwwcPreset(1, 'Soft tissue', '400 / 40'),\n _createWwwcPreset(2, 'Lung', '1500 / -600'),\n _createWwwcPreset(3, 'Liver', '150 / 90'),\n _createWwwcPreset(4, 'Bone', '2500 / 480'),\n _createWwwcPreset(5, 'Brain', '80 / 40'),\n ],\n },\n },\n // Pan...\n {\n id: 'Pan',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-move',\n label: 'Pan',\n commands: _createSetToolActiveCommands('Pan'),\n },\n },\n {\n id: 'Capture',\n type: 'ohif.action',\n props: {\n icon: 'tool-capture',\n label: 'Capture',\n type: 'action',\n commands: [\n {\n commandName: 'showDownloadViewportModal',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n },\n },\n {\n id: 'Layout',\n type: 'ohif.layoutSelector',\n props: {\n rows: 3,\n columns: 3,\n },\n },\n {\n id: 'MPR',\n type: 'ohif.action',\n props: {\n type: 'toggle',\n icon: 'icon-mpr',\n label: 'MPR',\n commands: [\n {\n commandName: 'toggleHangingProtocol',\n commandOptions: {\n protocolId: 'mpr',\n },\n context: 'DEFAULT',\n },\n ],\n },\n },\n {\n id: 'Crosshairs',\n type: 'ohif.radioGroup',\n props: {\n type: 'tool',\n icon: 'tool-crosshair',\n label: 'Crosshairs',\n commands: [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'Crosshairs',\n toolGroupId: 'mpr',\n },\n context: 'CORNERSTONE',\n },\n ],\n },\n },\n // More...\n {\n id: 'MoreTools',\n type: 'ohif.splitButton',\n props: {\n isRadio: true, // ?\n groupId: 'MoreTools',\n primary: _createActionButton(\n 'Reset',\n 'tool-reset',\n 'Reset View',\n [\n {\n commandName: 'resetViewport',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Reset'\n ),\n secondary: {\n icon: 'chevron-down',\n label: '',\n isActive: true,\n tooltip: 'More Tools',\n },\n items: [\n _createActionButton(\n 'Reset',\n 'tool-reset',\n 'Reset View',\n [\n {\n commandName: 'resetViewport',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Reset'\n ),\n _createActionButton(\n 'rotate-right',\n 'tool-rotate-right',\n 'Rotate Right',\n [\n {\n commandName: 'rotateViewportCW',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Rotate +90'\n ),\n _createActionButton(\n 'flip-horizontal',\n 'tool-flip-horizontal',\n 'Flip Horizontally',\n [\n {\n commandName: 'flipViewportHorizontal',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Flip Horizontal'\n ),\n _createToggleButton('StackImageSync', 'link', 'Stack Image Sync', [\n {\n commandName: 'toggleStackImageSync',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ]),\n _createToggleButton(\n 'ReferenceLines',\n 'tool-referenceLines', // change this with the new icon\n 'Reference Lines',\n [\n {\n commandName: 'toggleReferenceLines',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ]\n ),\n _createToolButton(\n 'StackScroll',\n 'tool-stack-scroll',\n 'Stack Scroll',\n [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'StackScroll',\n },\n context: 'CORNERSTONE',\n },\n ],\n 'Stack Scroll'\n ),\n _createActionButton(\n 'invert',\n 'tool-invert',\n 'Invert',\n [\n {\n commandName: 'invertViewport',\n commandOptions: {},\n context: 'CORNERSTONE',\n },\n ],\n 'Invert Colors'\n ),\n _createToggleButton(\n 'cine',\n 'tool-cine',\n 'Cine',\n [\n {\n commandName: 'toggleCine',\n context: 'CORNERSTONE',\n },\n ],\n 'Cine'\n ),\n _createToolButton(\n 'Magnify',\n 'tool-magnify',\n 'Magnify',\n [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'Magnify',\n },\n context: 'CORNERSTONE',\n },\n ],\n 'Magnify'\n ),\n _createActionButton(\n 'TagBrowser',\n 'list-bullets',\n 'Dicom Tag Browser',\n [\n {\n commandName: 'openDICOMTagViewer',\n commandOptions: {},\n context: 'DEFAULT',\n },\n ],\n 'Dicom Tag Browser'\n ),\n ],\n },\n },\n];\n\nexport default toolbarButtons;\n","const brushInstanceNames = {\n CircularBrush: 'CircularBrush',\n CircularEraser: 'CircularEraser',\n SphereBrush: 'SphereBrush',\n SphereEraser: 'SphereEraser',\n ThresholdCircularBrush: 'ThresholdCircularBrush',\n ThresholdSphereBrush: 'ThresholdSphereBrush',\n};\n\nconst brushStrategies = {\n CircularBrush: 'FILL_INSIDE_CIRCLE',\n CircularEraser: 'ERASE_INSIDE_CIRCLE',\n SphereBrush: 'FILL_INSIDE_SPHERE',\n SphereEraser: 'ERASE_INSIDE_SPHERE',\n ThresholdCircularBrush: 'THRESHOLD_INSIDE_CIRCLE',\n ThresholdSphereBrush: 'THRESHOLD_INSIDE_SPHERE',\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.StackScrollMouseWheel, bindings: [] },\n ],\n passive: Object.keys(brushInstanceNames)\n .map(brushName => ({\n toolName: brushName,\n parentTool: 'Brush',\n configuration: {\n activeStrategy: brushStrategies[brushName],\n },\n }))\n .concat([\n { toolName: toolNames.CircleScissors },\n { toolName: toolNames.RectangleScissors },\n { toolName: toolNames.SphereScissors },\n { toolName: toolNames.StackScroll },\n { toolName: toolNames.Magnify },\n { toolName: toolNames.SegmentationDisplay },\n ]),\n disabled: [{ toolName: toolNames.ReferenceLines }],\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 tools = createTools(utilityModule);\n tools.disabled.push(\n {\n toolName: utilityModule.exports.toolNames.Crosshairs,\n configuration: {\n viewportIndicators: false,\n autoPan: {\n enabled: false,\n panSize: 10,\n },\n },\n },\n { toolName: utilityModule.exports.toolNames.ReferenceLines }\n );\n toolGroupService.createToolGroupAndAddTools('mpr', tools);\n}\n\nfunction initToolGroups(extensionManager, toolGroupService, commandsManager) {\n initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, 'default');\n initMPRToolGroup(extensionManager, toolGroupService, commandsManager);\n}\n\nexport default initToolGroups;\n","import { hotkeys } from '@ohif/core';\nimport { 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 rightPanel: '@ohif/extension-default.panelModule.measure',\n};\n\nconst cornerstone = {\n viewport: '@ohif/extension-cornerstone.viewportModule.cornerstone',\n};\n\nconst segmentation = {\n panel: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentation',\n panelTool: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentationWithTools',\n sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',\n viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',\n};\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};\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 }) => {\n const { measurementService, toolbarService, toolGroupService } = servicesManager.services;\n\n measurementService.clearMeasurements();\n\n // Init Default and SR ToolGroups\n initToolGroups(extensionManager, toolGroupService, commandsManager);\n\n let unsubscribe;\n\n const activateTool = () => {\n toolbarService.recordInteraction({\n groupId: 'WindowLevel',\n interactionType: 'tool',\n commands: [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName: 'WindowLevel',\n },\n context: 'CORNERSTONE',\n },\n ],\n });\n\n // We don't need to reset the active tool whenever a viewport is getting\n // added to the toolGroup.\n unsubscribe();\n };\n\n // Since we only have one viewport for the basic cs3d mode and it has\n // only one hanging protocol, we can just use the first viewport\n ({ unsubscribe } = toolGroupService.subscribe(\n toolGroupService.EVENTS.VIEWPORT_ADDED,\n activateTool\n ));\n\n toolbarService.init(extensionManager);\n toolbarService.addButtons(toolbarButtons);\n toolbarService.createButtonSection('primary', [\n 'Zoom',\n 'WindowLevel',\n 'Pan',\n 'Capture',\n 'Layout',\n 'MPR',\n 'Crosshairs',\n 'MoreTools',\n ]);\n },\n onModeExit: ({ servicesManager }) => {\n const {\n toolGroupService,\n syncGroupService,\n toolbarService,\n segmentationService,\n cornerstoneViewportService,\n } = servicesManager.services;\n\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. For instance a PET/CT mode should be\n */\n isValidMode: ({ modalities }) => true,\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 rightPanels: [segmentation.panelTool],\n viewports: [\n {\n namespace: cornerstone.viewport,\n displaySetsToDisplay: [ohif.sopClassHandler],\n },\n {\n namespace: segmentation.viewport,\n displaySetsToDisplay: [segmentation.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 // hangingProtocol: [''],\n /** SopClassHandlers used by the mode */\n sopClassHandlers: [ohif.sopClassHandler, segmentation.sopClassHandler],\n /** hotkeys for mode */\n hotkeys: [...hotkeys.defaults.hotkeyBindings],\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__310__","__WEBPACK_EXTERNAL_MODULE__214__","__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","windowLevelPresets","defaults","_createButton","type","icon","label","commands","tooltip","uiType","_createActionButton","bind","_createToggleButton","_createToolButton","_createWwwcPreset","preset","title","subtitle","toString","commandName","commandOptions","context","toolGroupIds","_createSetToolActiveCommands","toolName","map","toolGroupId","props","groupId","primary","secondary","isActive","isAction","renderer","WindowLevelMenuItem","items","rows","columns","protocolId","isRadio","brushInstanceNames","CircularBrush","CircularEraser","SphereBrush","SphereEraser","ThresholdCircularBrush","ThresholdSphereBrush","brushStrategies","createTools","utilityModule","toolNames","Enums","active","WindowLevel","bindings","mouseButton","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","StackScrollMouseWheel","passive","keys","brushName","parentTool","configuration","activeStrategy","concat","CircleScissors","RectangleScissors","SphereScissors","StackScroll","Magnify","SegmentationDisplay","disabled","ReferenceLines","ohif","segmentation","extensionDependencies","modeFactory","_ref","modeConfiguration","routeName","displayName","onModeEnter","_ref2","servicesManager","extensionManager","commandsManager","measurementService","toolbarService","toolGroupService","services","unsubscribe","clearMeasurements","tools","getModuleEntry","createToolGroupAndAddTools","initDefaultToolGroup","push","Crosshairs","viewportIndicators","autoPan","enabled","panSize","initMPRToolGroup","initToolGroups","subscribe","EVENTS","VIEWPORT_ADDED","activateTool","recordInteraction","interactionType","init","addButtons","toolbarButtons","createButtonSection","onModeExit","_ref3","syncGroupService","segmentationService","cornerstoneViewportService","destroy","validationTags","study","series","isValidMode","_ref4","modalities","routes","path","layoutTemplate","_ref5","location","leftPanels","rightPanels","viewports","namespace","displaySetsToDisplay","extensions","sopClassHandlers","hotkeys","hotkeyBindings"],"sourceRoot":""}
|
|
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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C,EAAiBM,2BAA2B,WAAYF,EAC1D,CAKEY,CAAsBnB,EAAkBG,EAC1C,CCjFMiB,CAAepB,EAAkBG,GAEjCD,EAAemB,WAAWC,GAC1BpB,EAAemB,WAAWE,GAE1BrB,EAAesB,oBAAoB,UAAW,CAC5C,cACA,MACA,OACA,kBACA,UACA,SACA,aACA,cAEFtB,EAAesB,oBAAoB,sBAAuB,CAAC,aAAc,UAAU,EAErFC,WAAYA,EAAG1B,sBACb,MAAM,iBACJI,EAAgB,iBAChBuB,EAAgB,eAChBxB,EAAc,oBACdyB,EAAmB,2BACnBC,EAA0B,gBAC1BC,EAAe,eACfC,GACE/B,EAAgBK,SAEpByB,EAAgBE,aAChBD,EAAeE,OACf7B,EAAiB8B,UACjBP,EAAiBO,UACjBN,EAAoBM,UACpBL,EAA2BK,SAAS,EAGtCC,eAAgB,CACdC,MAAO,GACPC,OAAQ,IAOVC,YAAaA,EAAGC,iBAGd,MAAMC,EAAkBD,EAAWE,MAAM,MACzC,MAAO,CACLC,MAC6B,IAA3BF,EAAgBG,SACX,CAAC,KAAM,KAAM,KAAM,KAAM,MAAO,MAAMC,SAASJ,EAAgB,IAEtEK,YACE,wGACH,EAcHC,OAAQ,CACN,CACEC,KAAM,WACNC,eAAgBA,EAAGC,WAAUjD,sBACpB,CACLtF,GA9HF,4DA+HEW,MAAO,CACL6H,WAAY,CA7Hb,kDA8HCC,YAAa,CApHd,gFAqHCC,UAAW,CACT,CACEC,UA5HN,yDA6HMC,qBAAsB,CAAC9D,IAEzB,CACE6D,UAzHN,iEA0HMC,qBAAsB,CAAC7D,UASrC8D,WAAY7D,EAIZ8D,iBAAkB,CAAChE,EAAsBC,GAEzCgE,QAAS,IAAIA,EAAAA,QAAQC,SAASC,gBAElC,EAKEjE,wB","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/segmentationButtons.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 { defaults, ToolbarService, ViewportGridService } from '@ohif/core';\n\nconst { createButton } = ToolbarService;\n\nconst ReferenceLinesListeners: RunCommand = [\n {\n commandName: 'setSourceViewportForReferenceLinesTool',\n context: 'CORNERSTONE',\n },\n];\n\nexport const setToolActiveToolbar = {\n commandName: 'setToolActiveToolbar',\n commandOptions: {\n toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],\n },\n};\n\nconst toolbarButtons: Button[] = [\n {\n id: 'Zoom',\n uiType: 'ohif.radioGroup',\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.radioGroup',\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.radioGroup',\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.radioGroup',\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.radioGroup',\n props: {\n icon: 'tool-capture',\n label: 'Capture',\n commands: 'showDownloadViewportModal',\n evaluate: 'evaluate.action',\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.radioGroup',\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: 'MoreTools',\n uiType: 'ohif.splitButton',\n props: {\n groupId: 'MoreTools',\n evaluate: 'evaluate.group.promoteToPrimaryIfCornerstoneToolNotActiveInTheList',\n primary: createButton({\n id: 'Reset',\n icon: 'tool-reset',\n tooltip: 'Reset View',\n label: 'Reset',\n commands: 'resetViewport',\n evaluate: 'evaluate.action',\n }),\n secondary: {\n icon: 'chevron-down',\n label: '',\n tooltip: 'More Tools',\n },\n items: [\n createButton({\n id: 'Reset',\n icon: 'tool-reset',\n label: 'Reset View',\n tooltip: 'Reset View',\n commands: 'resetViewport',\n evaluate: 'evaluate.action',\n }),\n createButton({\n id: 'rotate-right',\n icon: 'tool-rotate-right',\n label: 'Rotate Right',\n tooltip: 'Rotate +90',\n commands: 'rotateViewportCW',\n evaluate: 'evaluate.action',\n }),\n createButton({\n id: 'flipHorizontal',\n icon: 'tool-flip-horizontal',\n label: 'Flip Horizontal',\n tooltip: 'Flip Horizontally',\n commands: 'flipViewportHorizontal',\n evaluate: ['evaluate.viewportProperties.toggle', 'evaluate.not3D'],\n }),\n createButton({\n id: 'ReferenceLines',\n icon: 'tool-referenceLines',\n label: 'Reference Lines',\n tooltip: 'Show Reference Lines',\n commands: 'toggleEnabledDisabledToolbar',\n listeners: {\n [ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: ReferenceLinesListeners,\n [ViewportGridService.EVENTS.VIEWPORTS_READY]: ReferenceLinesListeners,\n },\n evaluate: 'evaluate.cornerstoneTool.toggle',\n }),\n createButton({\n id: 'ImageOverlayViewer',\n icon: 'toggle-dicom-overlay',\n label: 'Image Overlay',\n tooltip: 'Toggle Image Overlay',\n commands: 'toggleEnabledDisabledToolbar',\n evaluate: 'evaluate.cornerstoneTool.toggle',\n }),\n createButton({\n id: 'StackScroll',\n icon: 'tool-stack-scroll',\n label: 'Stack Scroll',\n tooltip: 'Stack Scroll',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n }),\n createButton({\n id: 'invert',\n icon: 'tool-invert',\n label: 'Invert',\n tooltip: 'Invert Colors',\n commands: 'invertViewport',\n evaluate: 'evaluate.viewportProperties.toggle',\n }),\n createButton({\n id: 'Probe',\n icon: 'tool-probe',\n label: 'Probe',\n tooltip: 'Probe',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n }),\n createButton({\n id: 'Cine',\n icon: 'tool-cine',\n label: 'Cine',\n tooltip: 'Cine',\n commands: 'toggleCine',\n evaluate: ['evaluate.cine', 'evaluate.not3D'],\n }),\n createButton({\n id: 'Angle',\n icon: 'tool-angle',\n label: 'Angle',\n tooltip: 'Angle',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n }),\n createButton({\n id: 'Magnify',\n icon: 'tool-magnify',\n label: 'Magnify',\n tooltip: 'Magnify',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n }),\n createButton({\n id: 'RectangleROI',\n icon: 'tool-rectangle',\n label: 'Rectangle',\n tooltip: 'Rectangle',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n }),\n createButton({\n id: 'CalibrationLine',\n icon: 'tool-calibration',\n label: 'Calibration',\n tooltip: 'Calibration Line',\n commands: setToolActiveToolbar,\n evaluate: 'evaluate.cornerstoneTool',\n }),\n createButton({\n id: 'TagBrowser',\n icon: 'dicom-tag-browser',\n label: 'Dicom Tag Browser',\n tooltip: 'Dicom Tag Browser',\n commands: 'openDICOMTagViewer',\n }),\n createButton({\n id: 'AdvancedMagnify',\n icon: 'icon-tool-loupe',\n label: 'Loupe',\n tooltip: 'Loupe',\n commands: 'toggleActiveDisabledToolbar',\n evaluate: 'evaluate.cornerstoneTool.toggle.ifStrictlyDisabled',\n }),\n createButton({\n id: 'UltrasoundDirectionalTool',\n icon: 'icon-tool-ultrasound-bidirectional',\n label: 'Ultrasound Directional',\n tooltip: 'Ultrasound Directional',\n commands: setToolActiveToolbar,\n evaluate: ['evaluate.cornerstoneTool', 'evaluate.isUS'],\n }),\n ],\n },\n },\n];\n\nexport default toolbarButtons;\n","import type { Button } from '@ohif/core/types';\n\nfunction _createSetToolActiveCommands(toolName) {\n return [\n {\n commandName: 'setToolActive',\n commandOptions: {\n toolName,\n },\n },\n ];\n}\n\nconst toolbarButtons: Button[] = [\n {\n id: 'BrushTools',\n uiType: 'ohif.buttonGroup',\n props: {\n groupId: 'BrushTools',\n items: [\n {\n id: 'Brush',\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 commands: _createSetToolActiveCommands('CircularBrush'),\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 id: 'Eraser',\n icon: 'icon-tool-eraser',\n label: 'Eraser',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircularEraser', 'SphereEraser'],\n },\n commands: _createSetToolActiveCommands('CircularEraser'),\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 id: 'Threshold',\n icon: 'icon-tool-threshold',\n label: 'Threshold Tool',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],\n },\n commands: _createSetToolActiveCommands('ThresholdCircularBrush'),\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: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],\n },\n },\n },\n {\n name: 'Shape',\n type: 'radio',\n id: 'eraser-mode',\n value: 'ThresholdCircularBrush',\n values: [\n { value: 'ThresholdCircularBrush', label: 'Circle' },\n { value: 'ThresholdSphereBrush', label: 'Sphere' },\n ],\n commands: 'setToolActiveToolbar',\n },\n {\n name: 'Threshold',\n type: 'radio',\n id: 'dynamic-mode',\n value: 'ThresholdRange',\n values: [\n { value: 'ThresholdDynamic', label: 'Dynamic' },\n { value: 'ThresholdRange', label: 'Range' },\n ],\n commands: ({ value, commandsManager }) => {\n if (value === 'ThresholdDynamic') {\n commandsManager.run('setToolActive', {\n toolName: 'ThresholdCircularBrushDynamic',\n });\n } else {\n commandsManager.run('setToolActive', {\n toolName: 'ThresholdCircularBrush',\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 values: [100, 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 },\n {\n id: 'Shapes',\n uiType: 'ohif.radioGroup',\n props: {\n label: 'Shapes',\n evaluate: {\n name: 'evaluate.cornerstone.segmentation',\n toolNames: ['CircleScissor', 'SphereScissor', 'RectangleScissor'],\n },\n icon: 'icon-tool-shape',\n commands: _createSetToolActiveCommands('CircleScissor'),\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","function 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.StackScrollMouseWheel, bindings: [] },\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 strategySpecificConfiguration: {\n THRESHOLD: {\n isDynamic: true,\n dynamicRadius: 3,\n },\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.SegmentationDisplay },\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 tools = createTools(utilityModule);\n tools.disabled.push(\n {\n toolName: utilityModule.exports.toolNames.Crosshairs,\n configuration: {\n viewportIndicators: false,\n disableOnPassive: true,\n autoPan: {\n enabled: false,\n panSize: 10,\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 { hotkeys } from '@ohif/core';\nimport { id } from './id';\nimport toolbarButtons from './toolbarButtons';\nimport segmentationButtons from './segmentationButtons';\nimport initToolGroups from './initToolGroups';\n\nconst DEFAULT_TOOL_GROUP_ID = 'default';\nconst VOLUME3D_TOOL_GROUP_ID = 'volume3d';\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 rightPanel: '@ohif/extension-default.panelModule.measure',\n};\n\nconst cornerstone = {\n viewport: '@ohif/extension-cornerstone.viewportModule.cornerstone',\n};\n\nconst segmentation = {\n panel: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentation',\n panelTool: '@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentationWithTools',\n sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',\n viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',\n};\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};\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 }) => {\n const { measurementService, toolbarService, toolGroupService } = servicesManager.services;\n\n measurementService.clearMeasurements();\n\n // Init Default and SR ToolGroups\n initToolGroups(extensionManager, toolGroupService, commandsManager);\n\n toolbarService.addButtons(toolbarButtons);\n toolbarService.addButtons(segmentationButtons);\n\n toolbarService.createButtonSection('primary', [\n 'WindowLevel',\n 'Pan',\n 'Zoom',\n 'TrackballRotate',\n 'Capture',\n 'Layout',\n 'Crosshairs',\n 'MoreTools',\n ]);\n toolbarService.createButtonSection('segmentationToolbox', ['BrushTools', 'Shapes']);\n },\n onModeExit: ({ servicesManager }) => {\n const {\n toolGroupService,\n syncGroupService,\n toolbarService,\n segmentationService,\n cornerstoneViewportService,\n uiDialogService,\n uiModalService,\n } = servicesManager.services;\n\n uiDialogService.dismissAll();\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', 'US', 'MG', 'OT', 'DOC', 'CR'].includes(modalitiesArray[0])\n : true,\n description:\n 'The mode does not support studies that ONLY include the following modalities: SM, US, MG, OT, DOC, CR',\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 rightPanels: [segmentation.panelTool],\n viewports: [\n {\n namespace: cornerstone.viewport,\n displaySetsToDisplay: [ohif.sopClassHandler],\n },\n {\n namespace: segmentation.viewport,\n displaySetsToDisplay: [segmentation.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 // hangingProtocol: [''],\n /** SopClassHandlers used by the mode */\n sopClassHandlers: [ohif.sopClassHandler, segmentation.sopClassHandler],\n /** hotkeys for mode */\n hotkeys: [...hotkeys.defaults.hotkeyBindings],\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","createButton","ToolbarService","ReferenceLinesListeners","commandName","context","setToolActiveToolbar","commandOptions","toolGroupIds","uiType","props","icon","label","commands","evaluate","type","name","disabledText","rows","columns","groupId","primary","tooltip","secondary","items","listeners","ViewportGridService","EVENTS","ACTIVE_VIEWPORT_ID_CHANGED","VIEWPORTS_READY","_createSetToolActiveCommands","toolName","toolNames","options","min","max","step","values","commandsManager","run","condition","find","option","createTools","utilityModule","Enums","active","WindowLevel","bindings","mouseButton","MouseBindings","Primary","Pan","Auxiliary","Zoom","Secondary","StackScrollMouseWheel","passive","parentTool","configuration","activeStrategy","preview","enabled","strategySpecificConfiguration","THRESHOLD","isDynamic","dynamicRadius","CircleScissors","RectangleScissors","SphereScissors","StackScroll","Magnify","SegmentationDisplay","UltrasoundDirectional","disabled","ReferenceLines","AdvancedMagnify","ohif","segmentation","extensionDependencies","modeFactory","modeConfiguration","routeName","displayName","onModeEnter","servicesManager","extensionManager","measurementService","toolbarService","toolGroupService","services","clearMeasurements","toolGroupId","tools","getModuleEntry","createToolGroupAndAddTools","initDefaultToolGroup","push","Crosshairs","viewportIndicators","disableOnPassive","autoPan","panSize","initMPRToolGroup","TrackballRotateTool","initVolume3DToolGroup","initToolGroups","addButtons","toolbarButtons","segmentationButtons","createButtonSection","onModeExit","syncGroupService","segmentationService","cornerstoneViewportService","uiDialogService","uiModalService","dismissAll","hide","destroy","validationTags","study","series","isValidMode","modalities","modalitiesArray","split","valid","length","includes","description","routes","path","layoutTemplate","location","leftPanels","rightPanels","viewports","namespace","displaySetsToDisplay","extensions","sopClassHandlers","hotkeys","defaults","hotkeyBindings"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohif/mode-segmentation",
|
|
3
|
-
"version": "3.8.0-beta.
|
|
3
|
+
"version": "3.8.0-beta.81",
|
|
4
4
|
"description": "OHIF segmentation mode which enables labelmap segmentation read/edit/export",
|
|
5
5
|
"author": "@ohif",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"yarn": ">=1.16.0"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
+
"clean": "shx rm -rf dist",
|
|
28
|
+
"clean:deep": "yarn run clean && shx rm -rf node_modules",
|
|
27
29
|
"dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo",
|
|
28
30
|
"dev:cornerstone": "yarn run dev",
|
|
29
31
|
"build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js",
|
|
@@ -33,25 +35,33 @@
|
|
|
33
35
|
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
|
|
34
36
|
},
|
|
35
37
|
"peerDependencies": {
|
|
36
|
-
"@ohif/core": "3.8.0-beta.
|
|
38
|
+
"@ohif/core": "3.8.0-beta.81",
|
|
39
|
+
"@ohif/extension-cornerstone": "3.8.0-beta.81",
|
|
40
|
+
"@ohif/extension-cornerstone-dicom-rt": "3.8.0-beta.81",
|
|
41
|
+
"@ohif/extension-cornerstone-dicom-seg": "3.8.0-beta.81",
|
|
42
|
+
"@ohif/extension-cornerstone-dicom-sr": "3.8.0-beta.81",
|
|
43
|
+
"@ohif/extension-default": "3.8.0-beta.81",
|
|
44
|
+
"@ohif/extension-dicom-pdf": "3.8.0-beta.81",
|
|
45
|
+
"@ohif/extension-dicom-video": "3.8.0-beta.81"
|
|
37
46
|
},
|
|
38
47
|
"dependencies": {
|
|
39
|
-
"@babel/runtime": "^7.20.13"
|
|
48
|
+
"@babel/runtime": "^7.20.13",
|
|
49
|
+
"i18next": "^17.0.3"
|
|
40
50
|
},
|
|
41
51
|
"devDependencies": {
|
|
42
|
-
"@babel/core": "^7.
|
|
52
|
+
"@babel/core": "^7.23.2",
|
|
43
53
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
44
54
|
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
|
|
45
55
|
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
46
56
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
47
57
|
"@babel/plugin-transform-arrow-functions": "^7.16.7",
|
|
48
58
|
"@babel/plugin-transform-regenerator": "^7.16.7",
|
|
49
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
59
|
+
"@babel/plugin-transform-runtime": "^7.23.2",
|
|
50
60
|
"@babel/plugin-transform-typescript": "^7.13.0",
|
|
51
|
-
"@babel/preset-env": "
|
|
61
|
+
"@babel/preset-env": "7.23.2",
|
|
52
62
|
"@babel/preset-react": "^7.16.7",
|
|
53
63
|
"@babel/preset-typescript": "^7.13.0",
|
|
54
|
-
"babel-eslint": "^
|
|
64
|
+
"babel-eslint": "^10.1.0",
|
|
55
65
|
"babel-loader": "^8.0.0-beta.4",
|
|
56
66
|
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
57
67
|
"clean-webpack-plugin": "^4.0.0",
|