filesbox/web/dist/p__User__FilesPreview.71d2b...

2 lines
6.1 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[68681],{70575:function(p){p.exports={dcmmodalbox:"dcmmodalbox___1brEn"}},82425:function(p,g,s){"use strict";s.r(g),s.d(g,{default:function(){return k}});var T=s(11849),H=s(34895),U=s(28216),u=s(67294),G=s(73935),A=s(68628),d=s(86618),J=s.n(d),x=s(40352),Q=s.n(x),r=s(75720),X=s.n(r),w=s(50840),j=s.n(w),I=s(82424),Y=s.n(I),D=s(34705),q=s.n(D),B=s(90505),K=s(96132),ee=s.n(K),y=s(70575),S=s.n(y),M=s(37406),o=s(85893),P,O;r.external.cornerstone=d,r.external.cornerstoneMath=x,I.external.dicomParser=D,I.external.cornerstone=d,r.external.Hammer=j();var te="https://rawgit.com/cornerstonejs/cornerstoneWebImageLoader/master/examples/Renal_Cell_Carcinoma.jpg",$={width:"100%",height:"100%",position:"relative",color:"white"},b={bottom:"5px",left:"5px",position:"absolute",color:"white"},N={bottom:"5px",right:"5px",position:"absolute",color:"white"};class z extends u.Component{constructor(e){super(e);this.state={stack:e.stack,viewport:d.getDefaultViewport(null,void 0),imageId:e.stack.imageIds[e.stack.currentImageIdIndex||0],currentImageIdIndex:e.stack.currentImageIdIndex||0,infoList:[],infoListvisible:!1},this.onImageRendered=this.onImageRendered.bind(this),this.onNewImage=this.onNewImage.bind(this),this.onWindowResize=this.onWindowResize.bind(this),window.onWindowResizex=this.onWindowResize}render(){var e=this.state,t=e.currentImageIdIndex,a=e.infoList,i=a===void 0?[]:a;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"viewportElement",style:$,ref:n=>{this.element=n},children:[(0,o.jsx)("canvas",{className:"cornerstone-canvas"}),(0,o.jsxs)("div",{style:b,children:["Zoom: ",parseInt(this.state.viewport.scale*100)+"%"]}),(0,o.jsxs)("div",{style:N,children:["WW/WC: ",this.state.viewport.voi.windowWidth," / ",this.state.viewport.voi.windowCenter]}),this.state.infoListvisible&&(0,o.jsx)("div",{className:"infoListbox",children:i.map((n,l)=>(0,o.jsxs)("div",{className:"infoli",children:[(0,o.jsxs)("div",{className:"left",children:[n.name,"\uFF1A"]}),(0,o.jsx)("div",{className:"right",children:n.text})]},l))})]}),(0,o.jsx)("div",{onClick:n=>{n.preventDefault(),n.stopPropagation(),this.setState({infoListvisible:!this.state.infoListvisible})},className:this.state.infoListvisible?"infolistbtn infolistbtnactive":"infolistbtn",children:(0,o.jsx)(A.Z,{})})]})}onWindowResize(){!this.element||d.resize(this.element)}onImageRendered(){var e=d.getViewport(this.element);this.setState({viewport:e})}onNewImage(){var e=d.getEnabledElement(this.element);this.setState({imageId:e.image.imageId})}dumpDataSet(e){for(var t=["\u60A3\u8005\u59D3\u540D","\u60A3\u8005\u7F16\u53F7","\u60A3\u8005\u51FA\u751F\u65E5\u671F","\u60A3\u8005\u6027\u522B","\u60A3\u8005\u5E74\u9F84","\u60A3\u8005\u8EAB\u9AD8","\u60A3\u8005\u4F53\u91CD","\u5185\u5BB9\u65E5\u671F","\u5185\u5BB9\u65F6\u95F4"],a=["x00100010","x00100020","x00100030","x00100040","x00101010","x00101020","x00101030","x00080023","x00080033"],i=[],n=0;n<a.length;n++){var l=a[n],f=e.elements[l],c="";if(f!==void 0){var v=e.string(l);v!==void 0&&(c=v)}i.push({name:t[n],text:c})}this.setState({infoList:i})}componentDidMount(){var e=this.element;d.enable(e),d.loadAndCacheImage(this.state.imageId).then(t=>{d.displayImage(e,t),this.dumpDataSet(t.data);var a=this.props.stack;r.addStackStateManager(e,["stack"]),r.addToolState(e,"stack",a),r.mouseInput.enable(e),r.mouseWheelInput.enable(e),r.wwwc.activate(e,1),r.pan.activate(e,2),r.zoom.activate(e,4),r.zoomWheel.activate(e),r.touchInput.enable(e),r.panTouchDrag.activate(e),r.zoomTouchPinch.activate(e),e.addEventListener("cornerstoneimagerendered",this.onImageRendered),e.addEventListener("cornerstonenewimage",this.onNewImage),window.addEventListener("resize",this.onWindowResize)})}componentWillUnmount(){var e=this.element;e.removeEventListener("cornerstoneimagerendered",this.onImageRendered),e.removeEventListener("cornerstonenewimage",this.onNewImage),window.removeEventListener("resize",this.onWindowResize),d.disable(e)}componentDidUpdate(e,t){var a=r.getToolState(this.element,"stack");if