UNPKG

dicomweb-proxy

Version:

A proxy to translate between dicomweb and dimse

2 lines 16.7 kB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8815],{28815:(e,o,t)=>{t.r(o),t.d(o,{default:()=>C});const a=JSON.parse('{"UU":"@ohif/mode-segmentation"}').UU;var i=t(62037);const r={commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["default","mpr","SRToolGroup","volume3d"]}},l=e=>[{commandName:"setViewportForToolConfiguration",commandOptions:{toolName:e}}],n=[{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:r,evaluate:"evaluate.cornerstoneTool"}},{id:"WindowLevel",uiType:"ohif.toolButton",props:{icon:"tool-window-level",label:"Window Level",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"Pan",uiType:"ohif.toolButton",props:{icon:"tool-move",label:"Pan",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"TrackballRotate",uiType:"ohif.toolButton",props:{type:"tool",icon:"tool-3d-rotate",label:"3D Rotate",commands:r,evaluate:{name:"evaluate.cornerstoneTool",disabledText:"Select a 3D viewport to enable this tool"}}},{id:"Capture",uiType:"ohif.toolButton",props:{icon:"tool-capture",label:"Capture",commands:"showDownloadViewportModal",evaluate:["evaluate.action",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["video","wholeSlide"]}]}},{id:"Layout",uiType:"ohif.layoutSelector",props:{rows:3,columns:4,evaluate:"evaluate.action",commands:"setViewportGridLayout"}},{id:"Crosshairs",uiType:"ohif.toolButton",props:{icon:"tool-crosshair",label:"Crosshairs",commands:{commandName:"setToolActiveToolbar",commandOptions:{toolGroupIds:["mpr"]}},evaluate:{name:"evaluate.cornerstoneTool",disabledText:"Select an MPR viewport to enable this tool"}}},{id:"Reset",uiType:"ohif.toolButton",props:{icon:"tool-reset",label:"Reset View",tooltip:"Reset View",commands:"resetViewport",evaluate:"evaluate.action"}},{id:"rotate-right",uiType:"ohif.toolButton",props:{icon:"tool-rotate-right",label:"Rotate Right",tooltip:"Rotate +90",commands:"rotateViewportCW",evaluate:"evaluate.action"}},{id:"flipHorizontal",uiType:"ohif.toolButton",props:{icon:"tool-flip-horizontal",label:"Flip Horizontal",tooltip:"Flip Horizontally",commands:"flipViewportHorizontal",evaluate:["evaluate.viewportProperties.toggle",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"ReferenceLines",uiType:"ohif.toolButton",props:{icon:"tool-referenceLines",label:"Reference Lines",tooltip:"Show Reference Lines",commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"ImageOverlayViewer",uiType:"ohif.toolButton",props:{icon:"toggle-dicom-overlay",label:"Image Overlay",tooltip:"Toggle Image Overlay",commands:"toggleEnabledDisabledToolbar",evaluate:"evaluate.cornerstoneTool.toggle"}},{id:"StackScroll",uiType:"ohif.toolButton",props:{icon:"tool-stack-scroll",label:"Stack Scroll",tooltip:"Stack Scroll",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"invert",uiType:"ohif.toolButton",props:{icon:"tool-invert",label:"Invert",tooltip:"Invert Colors",commands:"invertViewport",evaluate:"evaluate.viewportProperties.toggle"}},{id:"Cine",uiType:"ohif.toolButton",props:{icon:"tool-cine",label:"Cine",tooltip:"Cine",commands:"toggleCine",evaluate:["evaluate.cine",{name:"evaluate.viewport.supported",unsupportedViewportTypes:["volume3d"]}]}},{id:"Magnify",uiType:"ohif.toolButton",props:{icon:"tool-magnify",label:"Zoom-in",tooltip:"Zoom-in",commands:r,evaluate:"evaluate.cornerstoneTool"}},{id:"TagBrowser",uiType:"ohif.toolButton",props:{icon:"dicom-tag-browser",label:"Dicom Tag Browser",tooltip:"Dicom Tag Browser",commands:"openDICOMTagViewer"}},{id:"Brush",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-brush",label:"Brush",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircularBrush","SphereBrush"],disabledText:"Create new segmentation to enable this tool."},options:[{name:"Radius (mm)",id:"brush-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["CircularBrush","SphereBrush"]}}},{name:"Shape",type:"radio",id:"brush-mode",value:"CircularBrush",values:[{value:"CircularBrush",label:"Circle"},{value:"SphereBrush",label:"Sphere"}],commands:"setToolActiveToolbar"}]}},{id:"InterpolateLabelmap",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-interpolation",label:"Interpolate Labelmap",tooltip:"Automatically fill in missing slices between drawn segments. Use brush or threshold tools on at least two slices, then click to interpolate across slices. Works in any direction. Volume must be reconstructable.",evaluate:["evaluate.cornerstone.segmentation",{name:"evaluate.displaySetIsReconstructable",disabledText:"The current viewport cannot handle interpolation."}],commands:"interpolateLabelmap"}},{id:"SegmentBidirectional",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-bidirectional-segment",label:"Segment Bidirectional",tooltip:"Automatically detects the largest length and width across slices for the selected segment and displays a bidirectional measurement.",evaluate:{name:"evaluate.cornerstone.segmentation",disabledText:"Create new segmentation to enable this tool."},commands:"runSegmentBidirectional"}},{id:"RegionSegmentPlus",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-click-segment",label:"One Click Segment",tooltip:"Detects segmentable regions with one click. Hover for visual feedback—click when a plus sign appears to auto-segment the lesion.",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["RegionSegmentPlus"],disabledText:"Create new segmentation to enable this tool."},commands:"setToolActiveToolbar"}},{id:"LabelmapSlicePropagation",uiType:"ohif.toolBoxButton",props:{icon:"icon-labelmap-slice-propagation",label:"Labelmap Assist",tooltip:"Toggle AI assistance for segmenting nearby slices. After drawing on a slice, scroll to preview predictions. Press Enter to accept or Esc to skip.",evaluate:["evaluate.cornerstoneTool.toggle",{name:"evaluate.cornerstone.hasSegmentation"}],listeners:{[i.sI.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:l("LabelmapSlicePropagation"),[i.sI.EVENTS.VIEWPORTS_READY]:l("LabelmapSlicePropagation")},commands:"toggleEnabledDisabledToolbar"}},{id:"MarkerLabelmap",uiType:"ohif.toolBoxButton",props:{icon:"icon-marker-labelmap",label:"Marker Guided Labelmap",tooltip:"Use include/exclude markers to guide AI (SAM) segmentation. Click to place markers, Enter to accept results, Esc to reject, and N to go to the next slice while keeping markers.",evaluate:[{name:"evaluate.cornerstone.segmentation",toolNames:["MarkerLabelmap","MarkerInclude","MarkerExclude"]}],commands:"setToolActiveToolbar",listeners:{[i.sI.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]:l("MarkerLabelmap"),[i.sI.EVENTS.VIEWPORTS_READY]:l("MarkerLabelmap")},options:[{name:"Marker Mode",type:"radio",id:"marker-mode",value:"markerInclude",values:[{value:"markerInclude",label:"Include"},{value:"markerExclude",label:"Exclude"}],commands:({commandsManager:e,options:o})=>{"markerInclude"===o.find((e=>"marker-mode"===e.id)).value?e.run("setToolActive",{toolName:"MarkerInclude"}):e.run("setToolActive",{toolName:"MarkerExclude"})}},{name:"Clear Markers",type:"button",id:"clear-markers",commands:"clearMarkersForMarkerLabelmap"}]}},{id:"Eraser",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-eraser",label:"Eraser",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircularEraser","SphereEraser"]},options:[{name:"Radius (mm)",id:"eraser-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["CircularEraser","SphereEraser"]}}},{name:"Shape",type:"radio",id:"eraser-mode",value:"CircularEraser",values:[{value:"CircularEraser",label:"Circle"},{value:"SphereEraser",label:"Sphere"}],commands:"setToolActiveToolbar"}]}},{id:"Threshold",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-threshold",label:"Threshold Tool",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["ThresholdCircularBrush","ThresholdSphereBrush","ThresholdCircularBrushDynamic","ThresholdSphereBrushDynamic"]},options:[{name:"Radius (mm)",id:"threshold-radius",type:"range",min:.5,max:99.5,step:.5,value:25,commands:{commandName:"setBrushSize",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush","ThresholdCircularBrushDynamic","ThresholdSphereBrushDynamic"]}}},{name:"Shape",type:"radio",id:"threshold-shape",value:"ThresholdCircularBrush",values:[{value:"ThresholdCircularBrush",label:"Circle"},{value:"ThresholdSphereBrush",label:"Sphere"}],commands:({value:e,commandsManager:o,options:t})=>{"ThresholdDynamic"===t.find((e=>"dynamic-mode"===e.id)).value?o.run("setToolActive",{toolName:"ThresholdCircularBrush"===e?"ThresholdCircularBrushDynamic":"ThresholdSphereBrushDynamic"}):o.run("setToolActive",{toolName:e})}},{name:"Threshold",type:"radio",id:"dynamic-mode",value:"ThresholdDynamic",values:[{value:"ThresholdDynamic",label:"Dynamic"},{value:"ThresholdRange",label:"Range"}],commands:({value:e,commandsManager:o,options:t})=>{const a=t.find((e=>"threshold-shape"===e.id));if("ThresholdDynamic"===e)o.run("setToolActiveToolbar",{toolName:"ThresholdCircularBrush"===a.value?"ThresholdCircularBrushDynamic":"ThresholdSphereBrushDynamic"});else{o.run("setToolActiveToolbar",{toolName:a.value});const e=t.find((e=>"threshold-range"===e.id)).value;o.run("setThresholdRange",{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"],value:e})}}},{name:"ThresholdRange",type:"double-range",id:"threshold-range",min:-1e3,max:1e3,step:1,value:[50,600],condition:({options:e})=>"ThresholdRange"===e.find((e=>"dynamic-mode"===e.id)).value,commands:{commandName:"setThresholdRange",commandOptions:{toolNames:["ThresholdCircularBrush","ThresholdSphereBrush"]}}}]}},{id:"Shapes",uiType:"ohif.toolBoxButton",props:{icon:"icon-tool-shape",label:"Shapes",evaluate:{name:"evaluate.cornerstone.segmentation",toolNames:["CircleScissor","SphereScissor","RectangleScissor"],disabledText:"Create new segmentation to enable shapes tool."},options:[{name:"Shape",type:"radio",value:"CircleScissor",id:"shape-mode",values:[{value:"CircleScissor",label:"Circle"},{value:"SphereScissor",label:"Sphere"},{value:"RectangleScissor",label:"Rectangle"}],commands:"setToolActiveToolbar"}]}}],s={"viewport-0":"rgb(200, 0, 0)","viewport-1":"rgb(200, 200, 0)","viewport-2":"rgb(0, 200, 0)"},c={axial:"rgb(200, 0, 0)",sagittal:"rgb(200, 200, 0)",coronal:"rgb(0, 200, 0)"};function u(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:o.LabelmapSlicePropagation},{toolName:o.MarkerLabelmap},{toolName:o.RegionSegmentPlus},{toolName:"CircularEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_CIRCLE"}},{toolName:"SphereBrush",parentTool:"Brush",configuration:{activeStrategy:"FILL_INSIDE_SPHERE"}},{toolName:"SphereEraser",parentTool:"Brush",configuration:{activeStrategy:"ERASE_INSIDE_SPHERE"}},{toolName:"ThresholdCircularBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE"}},{toolName:"ThresholdSphereBrush",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_SPHERE"}},{toolName:"ThresholdCircularBrushDynamic",parentTool:"Brush",configuration:{activeStrategy:"THRESHOLD_INSIDE_CIRCLE",threshold:{isDynamic:!0,dynamicRadius:3}}},{toolName: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 m=function(e,o,t){!function(e,o,t,a){const i=u(e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"));o.createToolGroupAndAddTools(a,i)}(e,o,0,"default"),function(e,o,t){const a=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),i=e._servicesManager,{cornerstoneViewportService:r}=i.services,l=u(a);l.disabled.push({toolName:a.exports.toolNames.Crosshairs,configuration:{viewportIndicators:!0,viewportIndicatorsConfig:{circleRadius:5,xOffset:.95,yOffset:.05},disableOnPassive:!0,autoPan:{enabled:!1,panSize:10},getReferenceLineColor:e=>{const o=r.getViewportInfo(e),t=o?.viewportOptions;return t?s[t.id]||c[t.orientation]||"#0c0":(console.warn("missing viewport?",e),"#0c0")}}},{toolName:a.exports.toolNames.ReferenceLines}),o.createToolGroupAndAddTools("mpr",l)}(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)},d="@ohif/extension-default.layoutTemplateModule.viewerLayout",p="@ohif/extension-default.sopClassHandlerModule.stack",h="@ohif/extension-default.panelModule.seriesList",g="@ohif/extension-cornerstone.viewportModule.cornerstone",v="@ohif/extension-cornerstone.panelModule.panelSegmentationWithTools",T="@ohif/extension-cornerstone.panelModule.panelMeasurement",S="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",b="@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",y="@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt",B="@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt",f={"@ohif/extension-default":"^3.0.0","@ohif/extension-cornerstone":"^3.0.0","@ohif/extension-cornerstone-dicom-seg":"^3.0.0","@ohif/extension-cornerstone-dicom-rt":"^3.0.0"};const C={id:a,modeFactory:function({modeConfiguration:e}){return{id:a,routeName:"segmentation",displayName:"Segmentation",onModeEnter:({servicesManager:e,extensionManager:o,commandsManager:t})=>{const{measurementService:a,toolbarService:i,toolGroupService:r,customizationService:l}=e.services;a.clearMeasurements(),m(o,r,t),i.addButtons(n),i.createButtonSection("primary",["WindowLevel","Pan","Zoom","TrackballRotate","Capture","Layout","Crosshairs","MoreTools"]),i.createButtonSection("moreToolsSection",["Reset","rotate-right","flipHorizontal","ReferenceLines","ImageOverlayViewer","StackScroll","invert","Cine","Magnify","TagBrowser"]),i.createButtonSection("segmentationToolbox",["SegmentationUtilities","SegmentationTools"]),i.createButtonSection("segmentationToolboxUtilitySection",["LabelmapSlicePropagation","InterpolateLabelmap","SegmentBidirectional"]),i.createButtonSection("segmentationToolboxToolsSection",["BrushTools","MarkerLabelmap","RegionSegmentPlus","Shapes"]),i.createButtonSection("brushToolsSection",["Brush","Eraser","Threshold"])},onModeExit:({servicesManager:e})=>{const{toolGroupService:o,syncGroupService:t,segmentationService:a,cornerstoneViewportService:i,uiDialogService:r,uiModalService:l}=e.services;r.hideAll(),l.hide(),o.destroy(),t.destroy(),a.destroy(),i.destroy()},validationTags:{study:[],series:[]},isValidMode:({modalities:e})=>{const o=e.split("\\");return{valid:1!==o.length||!["SM","ECG","OT","DOC"].includes(o[0]),description:"The mode does not support studies that ONLY include the following modalities: SM, OT, DOC"}},routes:[{path:"template",layoutTemplate:({location:e,servicesManager:o})=>({id:d,props:{leftPanels:[h],leftPanelResizable:!0,rightPanels:[v,T],rightPanelResizable:!0,viewports:[{namespace:g,displaySetsToDisplay:[p]},{namespace:b,displaySetsToDisplay:[S]},{namespace:y,displaySetsToDisplay:[B]}]}})}],extensions:f,hangingProtocol:["@ohif/mnGrid"],sopClassHandlers:[p,S,B]}},extensionDependencies:f}}}]); //# sourceMappingURL=8815.bundle.3337de6f7e7de19c3de0.js.map