@ohif/mode-test 3.5.0-beta.1

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.
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Open Health Imaging Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Test mode
2
+
3
+ This mode is used to test the basic functionality of the OHIF viewer
4
+ in a controlled environment. It is not intended to be used for
5
+ development or production.
@@ -0,0 +1 @@
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/core","@ohif/ui"],e):"object"==typeof exports?exports["ohif-mode-basic-test"]=e(require("@ohif/core"),require("@ohif/ui")):o["ohif-mode-basic-test"]=e(o["@ohif/core"],o["@ohif/ui"])}(globalThis,((o,e)=>(()=>{"use strict";var t={762:e=>{e.exports=o},369:o=>{o.exports=e}},n={};function i(o){var e=n[o];if(void 0!==e)return e.exports;var a=n[o]={exports:{}};return t[o](a,a.exports,i),a.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);var a={};return(()=>{i.d(a,{default:()=>M});var o=i(762),e=i(369);const{windowLevelPresets:t}=o.defaults;function n(o,e,t,n,i,a,l){return{id:e,icon:t,label:n,type:o,commands:i,tooltip:a,uiType:l}}const l=n.bind(null,"action"),s=n.bind(null,"toggle"),c=n.bind(null,"tool");function m(o,e,n){return{id:o.toString(),title:e,subtitle:n,type:"action",commands:[{commandName:"setWindowLevel",commandOptions:{...t[o]},context:"CORNERSTONE"}]}}const r=[{id:"MeasurementTools",type:"ohif.splitButton",props:{groupId:"MeasurementTools",isRadio:!0,primary:c("Length","tool-length","Length",[{commandName:"setToolActive",commandOptions:{toolName:"Length"},context:"CORNERSTONE"},{commandName:"setToolActive",commandOptions:{toolName:"SRLength",toolGroupId:"SRToolGroup"},context:"CORNERSTONE"}],"Length"),secondary:{icon:"chevron-down",label:"",isActive:!0,tooltip:"More Measure Tools"},items:[c("Length","tool-length","Length",[{commandName:"setToolActive",commandOptions:{toolName:"Length"},context:"CORNERSTONE"},{commandName:"setToolActive",commandOptions:{toolName:"SRLength",toolGroupId:"SRToolGroup"},context:"CORNERSTONE"}],"Length Tool"),c("Bidirectional","tool-bidirectional","Bidirectional",[{commandName:"setToolActive",commandOptions:{toolName:"Bidirectional"},context:"CORNERSTONE"},{commandName:"setToolActive",commandOptions:{toolName:"SRBidirectional",toolGroupId:"SRToolGroup"},context:"CORNERSTONE"}],"Bidirectional Tool"),c("ArrowAnnotate","tool-annotate","Annotation",[{commandName:"setToolActive",commandOptions:{toolName:"ArrowAnnotate"},context:"CORNERSTONE"},{commandName:"setToolActive",commandOptions:{toolName:"SRArrowAnnotate",toolGroupId:"SRToolGroup"},context:"CORNERSTONE"}],"Arrow Annotate"),c("EllipticalROI","tool-elipse","Ellipse",[{commandName:"setToolActive",commandOptions:{toolName:"EllipticalROI"},context:"CORNERSTONE"},{commandName:"setToolActive",commandOptions:{toolName:"SREllipticalROI",toolGroupId:"SRToolGroup"},context:"CORNERSTONE"}],"Ellipse Tool"),c("CircleROI","tool-circle","Circle",[{commandName:"setToolActive",commandOptions:{toolName:"CircleROI"},context:"CORNERSTONE"},{commandName:"setToolActive",commandOptions:{toolName:"SRCircleROI",toolGroupId:"SRToolGroup"},context:"CORNERSTONE"}],"Circle Tool")]}},{id:"Zoom",type:"ohif.radioGroup",props:{type:"tool",icon:"tool-zoom",label:"Zoom",commands:[{commandName:"setToolActive",commandOptions:{toolName:"Zoom"},context:"CORNERSTONE"}]}},{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:e.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:[{commandName:"setToolActive",commandOptions:{toolName:"Pan"},context:"CORNERSTONE"}]}},{id:"Capture",type:"ohif.action",props:{icon:"tool-capture",label:"Capture",type:"action",commands:[{commandName:"showDownloadViewportModal",commandOptions:{},context:"CORNERSTONE"}]}},{id:"Layout",type:"ohif.splitButton",props:{groupId:"LayoutTools",isRadio:!1,primary:{id:"Layout",type:"action",uiType:"ohif.layoutSelector",icon:"tool-layout",label:"Grid Layout",props:{rows:4,columns:4,commands:[{commandName:"setLayout",commandOptions:{},context:"CORNERSTONE"}]}},secondary:{icon:"chevron-down",label:"",isActive:!0,tooltip:"Hanging Protocols"},items:[{id:"2x2",type:"action",label:"2x2",commands:[{commandName:"setHangingProtocol",commandOptions:{protocolId:"@ohif/mnGrid",stageId:"2x2"},context:"DEFAULT"}]},{id:"3x1",type:"action",label:"3x1",commands:[{commandName:"setHangingProtocol",commandOptions:{protocolId:"@ohif/mnGrid",stageId:"3x1"},context:"DEFAULT"}]},{id:"2x1",type:"action",label:"2x1",commands:[{commandName:"setHangingProtocol",commandOptions:{protocolId:"@ohif/mnGrid",stageId:"2x1"},context:"DEFAULT"}]},{id:"1x1",type:"action",label:"1x1",commands:[{commandName:"setHangingProtocol",commandOptions:{protocolId:"@ohif/mnGrid",stageId:"1x1"},context:"DEFAULT"}]}]}},{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:{toolGroupId:"mpr",toolName:"Crosshairs"},context:"CORNERSTONE"}]}},{id:"MoreTools",type:"ohif.splitButton",props:{isRadio:!0,groupId:"MoreTools",primary:l("Reset","tool-reset","Reset View",[{commandName:"resetViewport",commandOptions:{},context:"CORNERSTONE"}],"Reset"),secondary:{icon:"chevron-down",label:"",isActive:!0,tooltip:"More Tools"},items:[l("Reset","tool-reset","Reset View",[{commandName:"resetViewport",commandOptions:{},context:"CORNERSTONE"}],"Reset"),l("rotate-right","tool-rotate-right","Rotate Right",[{commandName:"rotateViewportCW",commandOptions:{},context:"CORNERSTONE"}],"Rotate +90"),l("flip-horizontal","tool-flip-horizontal","Flip Horizontally",[{commandName:"flipViewportHorizontal",commandOptions:{},context:"CORNERSTONE"}],"Flip Horizontal"),s("StackImageSync","link","Stack Image Sync",[{commandName:"toggleStackImageSync",commandOptions:{},context:"CORNERSTONE"}]),s("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"),l("invert","tool-invert","Invert",[{commandName:"invertViewport",commandOptions:{},context:"CORNERSTONE"}],"Invert Colors"),c("Probe","tool-probe","Probe",[{commandName:"setToolActive",commandOptions:{toolName:"DragProbe"},context:"CORNERSTONE"}],"Probe"),s("cine","tool-cine","Cine",[{commandName:"toggleCine",context:"CORNERSTONE"}],"Cine"),c("Angle","tool-angle","Angle",[{commandName:"setToolActive",commandOptions:{toolName:"Angle"},context:"CORNERSTONE"}],"Angle"),c("Magnify","tool-magnify","Magnify",[{commandName:"setToolActive",commandOptions:{toolName:"Magnify"},context:"CORNERSTONE"}],"Magnify"),c("Rectangle","tool-rectangle","Rectangle",[{commandName:"setToolActive",commandOptions:{toolName:"RectangleROI"},context:"CORNERSTONE"}],"Rectangle"),l("TagBrowser","list-bullets","Dicom Tag Browser",[{commandName:"openDICOMTagViewer",commandOptions:{},context:"DEFAULT"}],"Dicom Tag Browser")]}}],d=JSON.parse('{"u2":"@ohif/mode-test"}').u2;const p=function(o,e,t){!function(o,e,t,n){const i=o.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:a,Enums:l}=i.exports,s={active:[{toolName:a.WindowLevel,bindings:[{mouseButton:l.MouseBindings.Primary}]},{toolName:a.Pan,bindings:[{mouseButton:l.MouseBindings.Auxiliary}]},{toolName:a.Zoom,bindings:[{mouseButton:l.MouseBindings.Secondary}]},{toolName:a.StackScrollMouseWheel,bindings:[]}],passive:[{toolName:a.Length},{toolName:a.ArrowAnnotate},{toolName:a.Bidirectional},{toolName:a.DragProbe},{toolName:a.EllipticalROI},{toolName:a.CircleROI},{toolName:a.RectangleROI},{toolName:a.StackScroll},{toolName:a.Angle},{toolName:a.Magnify},{toolName:a.SegmentationDisplay}],disabled:[{toolName:a.ReferenceLines}]},c={[a.ArrowAnnotate]:{getTextCallback:(o,e)=>t.runCommand("arrowTextCallback",{callback:o,eventDetails:e}),changeTextCallback:(o,e,n)=>t.runCommand("arrowTextCallback",{callback:n,data:o,eventDetails:e})}};e.createToolGroupAndAddTools(n,s,c)}(o,e,t,"default"),function(o,e,t){const n=o.getModuleEntry("@ohif/extension-cornerstone-dicom-sr.utilityModule.tools"),i=o.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:a}=n.exports,{toolNames:l,Enums:s}=i.exports,c={active:[{toolName:l.WindowLevel,bindings:[{mouseButton:s.MouseBindings.Primary}]},{toolName:l.Pan,bindings:[{mouseButton:s.MouseBindings.Auxiliary}]},{toolName:l.Zoom,bindings:[{mouseButton:s.MouseBindings.Secondary}]},{toolName:l.StackScrollMouseWheel,bindings:[]}],passive:[{toolName:a.SRLength},{toolName:a.SRArrowAnnotate},{toolName:a.SRBidirectional},{toolName:a.SREllipticalROI},{toolName:a.SRCircleROI}],enabled:[{toolName:a.DICOMSRDisplay,bindings:[]}]},m={[l.ArrowAnnotate]:{getTextCallback:(o,e)=>t.runCommand("arrowTextCallback",{callback:o,eventDetails:e}),changeTextCallback:(o,e,n)=>t.runCommand("arrowTextCallback",{callback:n,data:o,eventDetails:e})}};e.createToolGroupAndAddTools("SRToolGroup",c,m)}(o,e,t),function(o,e,t){const n=o.getModuleEntry("@ohif/extension-cornerstone.utilityModule.tools"),{toolNames:i,Enums:a}=n.exports,l={active:[{toolName:i.WindowLevel,bindings:[{mouseButton:a.MouseBindings.Primary}]},{toolName:i.Pan,bindings:[{mouseButton:a.MouseBindings.Auxiliary}]},{toolName:i.Zoom,bindings:[{mouseButton:a.MouseBindings.Secondary}]},{toolName:i.StackScrollMouseWheel,bindings:[]}],passive:[{toolName:i.Length},{toolName:i.ArrowAnnotate},{toolName:i.Bidirectional},{toolName:i.DragProbe},{toolName:i.EllipticalROI},{toolName:i.CircleROI},{toolName:i.RectangleROI},{toolName:i.StackScroll},{toolName:i.Angle},{toolName:i.SegmentationDisplay}],disabled:[{toolName:i.Crosshairs},{toolName:i.ReferenceLines}]},s={[i.Crosshairs]:{viewportIndicators:!1,autoPan:{enabled:!1,panSize:10}},[i.ArrowAnnotate]:{getTextCallback:(o,e)=>t.runCommand("arrowTextCallback",{callback:o,eventDetails:e}),changeTextCallback:(o,e,n)=>t.runCommand("arrowTextCallback",{callback:n,data:o,eventDetails:e})}};e.createToolGroupAndAddTools("mpr",l,s)}(o,e,t)},u=["SM","ECG","SR","SEG"],N="@ohif/extension-default.layoutTemplateModule.viewerLayout",g="@ohif/extension-default.sopClassHandlerModule.stack",R="@ohif/extension-measurement-tracking.panelModule.trackedMeasurements",O="@ohif/extension-measurement-tracking.panelModule.seriesList",T="@ohif/extension-measurement-tracking.viewportModule.cornerstone-tracked",x="@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr",f="@ohif/extension-cornerstone-dicom-sr.viewportModule.dicom-sr",S="@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video",y="@ohif/extension-dicom-video.viewportModule.dicom-video",h="@ohif/extension-dicom-pdf.sopClassHandlerModule.dicom-pdf",v="@ohif/extension-dicom-pdf.viewportModule.dicom-pdf",E="@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg",C="@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg",b="@ohif/extension-cornerstone-dicom-seg.panelModule.panelSegmentation",A={"@ohif/extension-default":"^3.0.0","@ohif/extension-cornerstone":"^3.0.0","@ohif/extension-measurement-tracking":"^3.0.0","@ohif/extension-cornerstone-dicom-sr":"^3.0.0","@ohif/extension-cornerstone-dicom-seg":"^3.0.0","@ohif/extension-dicom-pdf":"^3.0.1","@ohif/extension-dicom-video":"^3.0.1","@ohif/extension-test":"^0.0.1"};const M={id:d,modeFactory:function(){return{id:d,routeName:"basic-test",displayName:"Basic Test Mode",onModeEnter:o=>{let{servicesManager:e,extensionManager:t,commandsManager:n}=o;const{measurementService:i,toolbarService:a,toolGroupService:l,customizationService:s}=e.services;let c;i.clearMeasurements(),p(t,l,n),s.addModeCustomizations(["@ohif/extension-test.customizationModule.custom-context-menu"]);({unsubscribe:c}=l.subscribe(l.EVENTS.VIEWPORT_ADDED,(()=>{a.recordInteraction({groupId:"WindowLevel",itemId:"WindowLevel",interactionType:"tool",commands:[{commandName:"setToolActive",commandOptions:{toolName:"WindowLevel"},context:"CORNERSTONE"}]}),c()}))),a.init(t),a.addButtons(r),a.createButtonSection("primary",["MeasurementTools","Zoom","WindowLevel","Pan","Capture","Layout","MPR","Crosshairs","MoreTools"])},onModeExit:o=>{let{servicesManager:e}=o;const{toolGroupService:t,syncGroupService:n,segmentationService:i,cornerstoneViewportService:a}=e.services;t.destroy(),n.destroy(),i.destroy(),a.destroy()},validationTags:{study:[],series:[]},isValidMode:function(o){let{modalities:e}=o;return!!e.split("\\").filter((o=>-1===u.indexOf(o))).length},routes:[{path:"basic-test",layoutTemplate:()=>({id:N,props:{leftPanels:[O],rightPanels:[b,R],viewports:[{namespace:T,displaySetsToDisplay:[g]},{namespace:f,displaySetsToDisplay:[x]},{namespace:y,displaySetsToDisplay:[S]},{namespace:v,displaySetsToDisplay:[h]},{namespace:C,displaySetsToDisplay:[E]}]}})}],extensions:A,hangingProtocol:"default",sopClassHandlers:[S,E,g,h,x],hotkeys:{name:"basic-test-hotkeys",hotkeys:[...o.hotkeys.defaults.hotkeyBindings]}}},extensionDependencies:A}})(),a=a.default})()));
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@ohif/mode-test",
3
+ "version": "3.5.0-beta.1",
4
+ "description": "Basic mode for testing",
5
+ "author": "OHIF",
6
+ "license": "MIT",
7
+ "repository": "OHIF/Viewers",
8
+ "main": "dist/ohif-mode-test.umd.js",
9
+ "module": "src/index.js",
10
+ "engines": {
11
+ "node": ">=14",
12
+ "npm": ">=6",
13
+ "yarn": ">=1.16.0"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "keywords": [
23
+ "ohif-mode"
24
+ ],
25
+ "scripts": {
26
+ "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo",
27
+ "dev:cornerstone": "yarn run dev",
28
+ "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js",
29
+ "build:package": "yarn run build",
30
+ "start": "yarn run dev",
31
+ "test:unit": "jest --watchAll",
32
+ "test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
33
+ },
34
+ "peerDependencies": {
35
+ "@ohif/core": "3.5.0-beta.1",
36
+ "@ohif/extension-cornerstone": "3.5.0-beta.1",
37
+ "@ohif/extension-cornerstone-dicom-sr": "3.5.0-beta.1",
38
+ "@ohif/extension-default": "3.5.0-beta.1",
39
+ "@ohif/extension-dicom-pdf": "3.5.0-beta.1",
40
+ "@ohif/extension-dicom-video": "3.5.0-beta.1",
41
+ "@ohif/extension-measurement-tracking": "3.5.0-beta.1",
42
+ "@ohif/extension-test": "3.5.0-beta.1"
43
+ },
44
+ "dependencies": {
45
+ "@babel/runtime": "^7.20.13"
46
+ },
47
+ "devDependencies": {
48
+ "webpack": "^5.50.0",
49
+ "webpack-merge": "^5.7.3"
50
+ },
51
+ "gitHead": "6d7561946b02ce49fbaa9a0f47df5818eb3d7983"
52
+ }