From 56fbec0661aebd1b96871587ea4ff7260086e8d5 Mon Sep 17 00:00:00 2001 From: ArturRod Date: Wed, 14 Sep 2022 10:52:16 +0200 Subject: [PATCH] no message --- .npmignore | 3 ++- CHANGELOG.md | 4 ++++ example/index.umd.js | 2 +- package.json | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.npmignore b/.npmignore index 638558f..62e90db 100644 --- a/.npmignore +++ b/.npmignore @@ -6,4 +6,5 @@ example/ ## Root Files .gitignore -tsconfig.json \ No newline at end of file +tsconfig.json +CONTRIBUTING.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a28c0d..e7f4921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.1](https://github.com/ArturRod/ecg-dicom-web-viewer) (2022-08-24) + +**Note:** Repair bug -> https://github.com/ArturRod/ecg-dicom-web-viewer/issues/2 + ## [2.0.0](https://github.com/ArturRod/ecg-dicom-web-viewer) (2022-08-24) **Note:** The view and rendering with canvas is implemented. This allows to change the amplitude and the time (mm/mV, mm/s) It is also allowed to pan, and zoom. diff --git a/example/index.umd.js b/example/index.umd.js index dba7b46..ac4d56e 100644 --- a/example/index.umd.js +++ b/example/index.umd.js @@ -1,2 +1,2 @@ /*! For license information please see index.umd.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.$=t():e.$=t()}(self,(()=>(()=>{var e={228:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var a=r(402),n=r.n(a),i=r(352),o=r.n(i)()(n());o.push([e.id,"/*Table Data Study*/\n#infoECG {\n height: auto;\n}\n.divTableRow {\n display: table-row;\n}\n.divTableHeading {\n background-color: #eee;\n display: table-header-group;\n}\n.divTableCell,\n.divTableHead {\n display: table-cell;\n font-size: 13px;\n font-weight: 700;\n color: #000000;\n}\n.divTableCell i {\n font-weight: normal;\n}\n.divTableHeading {\n background-color: #eee;\n display: table-header-group;\n font-weight: bold;\n}\n.divTableFoot {\n background-color: #eee;\n display: table-footer-group;\n font-weight: bold;\n}\n#divTableBody {\n height: auto;\n background: #f9f8f2;\n width: 100%;\n display: table;\n padding: 10px;\n}\n\n/** Buttons **/\n#toolsECG {\n background: #f9f8f2;\n width: 100%;\n display: flow-root;\n border-top: 2px solid rgb(0, 0, 0);\n}\n.divTools {\n float: right;\n font-size: 13px;\n font-weight: 700;\n margin-left: 1.5rem;\n}\n.divTools i {\n font-weight: normal;\n}\n.divTools button {\n background-color: #dadada;\n color: black;\n padding: 5px 15px;\n margin: 4px 2px;\n border-radius: 10%;\n}\n\n/*Zoom buttons*/\n#zoomButons {\n position: absolute;\n width: 30px;\n top: 125px;\n right: 2px;\n}\n\n#zoomButons button {\n background-color: #dadada;\n color: black;\n padding: 5px;\n width: 30px;\n height: 30px;\n margin: 0px 0px 2px 0px;\n border-radius: 10%;\n}\n",""]);const s=o},352:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",a=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),a&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),a&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,a,n,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(a)for(var s=0;s0?" ".concat(f[5]):""," {").concat(f[1],"}")),f[5]=i),r&&(f[2]?(f[1]="@media ".concat(f[2]," {").concat(f[1],"}"),f[2]=r):f[2]=r),n&&(f[4]?(f[1]="@supports (".concat(f[4],") {").concat(f[1],"}"),f[4]=n):f[4]="".concat(n)),t.push(f))}},t}},402:e=>{"use strict";e.exports=function(e){return e[1]}},952:function(e,t,r){e.exports=function(e){return r=[function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t),r.d(t,"isStringVr",(function(){return n})),r.d(t,"isPrivateTag",(function(){return i})),r.d(t,"parsePN",(function(){return o})),r.d(t,"parseTM",(function(){return s})),r.d(t,"parseDA",(function(){return d})),r.d(t,"explicitElementToString",(function(){return l})),r.d(t,"explicitDataSetToJS",(function(){return f})),r.d(t,"createJPEGBasicOffsetTable",(function(){return m})),r.d(t,"parseDicomDataSetExplicit",(function(){return T})),r.d(t,"parseDicomDataSetImplicit",(function(){return C})),r.d(t,"readFixedString",(function(){return v})),r.d(t,"alloc",(function(){return U})),r.d(t,"version",(function(){return F})),r.d(t,"bigEndianByteArrayParser",(function(){return B})),r.d(t,"ByteStream",(function(){return M})),r.d(t,"sharedCopy",(function(){return L})),r.d(t,"DataSet",(function(){return x})),r.d(t,"findAndSetUNElementLength",(function(){return g})),r.d(t,"findEndOfEncapsulatedElement",(function(){return p})),r.d(t,"findItemDelimitationItemAndSetElementLength",(function(){return w})),r.d(t,"littleEndianByteArrayParser",(function(){return _})),r.d(t,"parseDicom",(function(){return V})),r.d(t,"readDicomElementExplicit",(function(){return O})),r.d(t,"readDicomElementImplicit",(function(){return E})),r.d(t,"readEncapsulatedImageFrame",(function(){return R})),r.d(t,"readEncapsulatedPixelData",(function(){return j})),r.d(t,"readEncapsulatedPixelDataFromFragments",(function(){return G})),r.d(t,"readPart10Header",(function(){return q})),r.d(t,"readSequenceItemsExplicit",(function(){return I})),r.d(t,"readSequenceItemsImplicit",(function(){return A})),r.d(t,"readSequenceItem",(function(){return P})),r.d(t,"readTag",(function(){return h}));var a={AE:!0,AS:!0,AT:!1,CS:!0,DA:!0,DS:!0,DT:!0,FL:!1,FD:!1,IS:!0,LO:!0,LT:!0,OB:!1,OD:!1,OF:!1,OW:!1,PN:!0,SH:!0,SL:!1,SQ:!1,SS:!1,ST:!0,TM:!0,UI:!0,UL:!1,UN:void 0,UR:!0,US:!1,UT:!0},n=function(e){return a[e]},i=function(e){return parseInt(e[4],10)%2==1},o=function(e){if(void 0!==e)return{familyName:(e=e.split("^"))[0],givenName:e[1],middleName:e[2],prefix:e[3],suffix:e[4]}};function s(e,t){if(2<=e.length){var r=parseInt(e.substring(0,2),10),a=4<=e.length?parseInt(e.substring(2,4),10):void 0,n=6<=e.length?parseInt(e.substring(4,6),10):void 0,i=(i=8<=e.length?e.substring(7,13):void 0)?parseInt(i,10)*Math.pow(10,6-i.length):void 0;if(t&&(isNaN(r)||void 0!==a&&isNaN(a)||void 0!==n&&isNaN(n)||void 0!==i&&isNaN(i)||r<0||23e.byteArray.length-e.position&&(d=e.byteArray.length-e.position),t.fragments.push({offset:e.position-o-8,position:e.position,length:d}),e.seek(d),void(t.length=e.position-t.dataOffset);t.fragments.push({offset:e.position-o-8,position:e.position,length:d}),e.seek(d)}r&&r.push("pixel data element ".concat(t.tag," missing sequence delimiter tag xfffee0dd"))}function g(e,t){if(void 0===e)throw"dicomParser.findAndSetUNElementLength: missing required parameter 'byteStream'";for(var r=e.byteArray.length-8;e.position<=r;)if(65534===e.readUint16()&&57565===e.readUint16())return 0!==e.readUint32()&&e.warnings("encountered non zero length following item delimiter at position ".concat(e.position-4," while reading element of undefined length with tag ").concat(t.tag)),void(t.length=e.position-t.dataOffset);t.length=e.byteArray.length-t.dataOffset,e.seek(e.byteArray.length-e.position)}function v(e,t,r){if(r<0)throw"dicomParser.readFixedString - length cannot be less than 0";if(t+r>e.length)throw"dicomParser.readFixedString: attempt to read past end of buffer";for(var a,n="",i=0;it.byteArray.length)throw"dicomParser.parseDicomDataSetExplicit: invalid value for parameter 'maxP osition'";for(var n=e.elements;t.positionr)throw"dicomParser:parseDicomDataSetExplicit: buffer overrun"}function C(e,t,r){var a=3t.byteArray.length)throw"dicomParser.parseDicomDataSetImplicit: invalid value for parameter 'maxPosition'";for(var n=e.elements;t.positione.length)throw"bigEndianByteArrayParser.readUint16: attempt to read past end of buffer";return(e[t]<<8)+e[t+1]},readInt16:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readInt16: position cannot be less than 0";if(t+2>e.length)throw"bigEndianByteArrayParser.readInt16: attempt to read past end of buffer";return 32768&(t=(e[t]<<8)+e[t+1])?t-65535-1:t},readUint32:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readUint32: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readUint32: attempt to read past end of buffer";return 256*(256*(256*e[t]+e[t+1])+e[t+2])+e[t+3]},readInt32:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readInt32: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readInt32: attempt to read past end of buffer";return(e[t]<<24)+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]},readFloat:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readFloat: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readFloat: attempt to read past end of buffer";var r=new Uint8Array(4);return r[3]=e[t],r[2]=e[t+1],r[1]=e[t+2],r[0]=e[t+3],new Float32Array(r.buffer)[0]},readDouble:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readDouble: position cannot be less than 0";if(t+8>e.length)throw"bigEndianByteArrayParser.readDouble: attempt to read past end of buffer";var r=new Uint8Array(8);return r[7]=e[t],r[6]=e[t+1],r[5]=e[t+2],r[4]=e[t+3],r[3]=e[t+4],r[2]=e[t+5],r[1]=e[t+6],r[0]=e[t+7],new Float64Array(r.buffer)[0]}};function L(e,t,r){if("undefined"!=typeof Buffer&&e instanceof Buffer)return e.slice(t,t+r);if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset+t,r);throw"dicomParser.from: unknown type for byteArray"}function k(e,t){for(var r=0;r=r.length)throw"dicomParser.ByteStream: parameter 'position' cannot be greater than or equal to 'byteArray' length";this.byteArrayParser=t,this.byteArray=r,this.position=a||0,this.warnings=[]}var t,r;return t=e,(r=[{key:"seek",value:function(e){if(this.position+e<0)throw"dicomParser.ByteStream.prototype.seek: cannot seek to position < 0";this.position+=e}},{key:"readByteStream",value:function(t){if(this.position+t>this.byteArray.length)throw"dicomParser.ByteStream.prototype.readByteStream: readByteStream - buffer overread";var r=L(this.byteArray,this.position,t);return this.position+=t,new e(this.byteArrayParser,r)}},{key:"getSize",value:function(){return this.byteArray.length}},{key:"readUint16",value:function(){var e=this.byteArrayParser.readUint16(this.byteArray,this.position);return this.position+=2,e}},{key:"readUint32",value:function(){var e=this.byteArrayParser.readUint32(this.byteArray,this.position);return this.position+=4,e}},{key:"readFixedString",value:function(e){var t=v(this.byteArray,this.position,e);return this.position+=e,t}}])&&k(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_={readUint16:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readUint16: position cannot be less than 0";if(t+2>e.length)throw"littleEndianByteArrayParser.readUint16: attempt to read past end of buffer";return e[t]+256*e[t+1]},readInt16:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readInt16: position cannot be less than 0";if(t+2>e.length)throw"littleEndianByteArrayParser.readInt16: attempt to read past end of buffer";return 32768&(t=e[t]+(e[t+1]<<8))?t-65535-1:t},readUint32:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readUint32: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readUint32: attempt to read past end of buffer";return e[t]+256*e[t+1]+256*e[t+2]*256+256*e[t+3]*256*256},readInt32:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readInt32: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readInt32: attempt to read past end of buffer";return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24)},readFloat:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readFloat: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readFloat: attempt to read past end of buffer";var r=new Uint8Array(4);return r[0]=e[t],r[1]=e[t+1],r[2]=e[t+2],r[3]=e[t+3],new Float32Array(r.buffer)[0]},readDouble:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readDouble: position cannot be less than 0";if(t+8>e.length)throw"littleEndianByteArrayParser.readDouble: attempt to read past end of buffer";var r=new Uint8Array(8);return r[0]=e[t],r[1]=e[t+1],r[2]=e[t+2],r[3]=e[t+3],r[4]=e[t+4],r[5]=e[t+5],r[6]=e[t+6],r[7]=e[t+7],new Float64Array(r.buffer)[0]}};function q(e){var t=1= 0";if(r>=t.fragments.length)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragmentIndex' must be < number of fragments";if(a<1)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'numFragments' must be > 0";if(r+a>t.fragments.length)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragment' + 'numFragments' < number of fragments";var i=new M(e.byteArrayParser,e.byteArray,t.dataOffset);if("xfffee000"!==(t=P(i)).tag)throw"dicomParser.readEncapsulatedPixelData: missing basic offset table xfffee000";i.seek(t.length);var o=i.position;if(1===a)return L(i.byteArray,o+n[r].offset+8,n[r].length);t=function(e,t,r){for(var a=0,n=t;n= 0";if(r>=a.length)throw"dicomParser.readEncapsulatedImageFrame: parameter 'frameIndex' must be < basicOffsetTable.length";var i=a[r];if(void 0===(i=function(e,t){for(var r=0;r= 0";return 0!==t.basicOffsetTable.length?R(e,t,r):G(e,t,0,t.fragments.length)}t.default={isStringVr:n,isPrivateTag:i,parsePN:o,parseTM:s,parseDA:d,explicitElementToString:l,explicitDataSetToJS:f,createJPEGBasicOffsetTable:m,parseDicomDataSetExplicit:T,parseDicomDataSetImplicit:C,readFixedString:v,alloc:U,version:F,bigEndianByteArrayParser:B,ByteStream:M,sharedCopy:L,DataSet:x,findAndSetUNElementLength:g,findEndOfEncapsulatedElement:p,findItemDelimitationItemAndSetElementLength:w,littleEndianByteArrayParser:_,parseDicom:V,readDicomElementExplicit:O,readDicomElementImplicit:E,readEncapsulatedImageFrame:R,readEncapsulatedPixelData:j,readEncapsulatedPixelDataFromFragments:G,readPart10Header:q,readSequenceItemsExplicit:I,readSequenceItemsImplicit:A,readSequenceItem:P,readTag:h,LEI:"1.2.840.10008.1.2",LEE:"1.2.840.10008.1.2.1"}}],a={},t.m=r,t.c=a,t.d=function(e,r,a){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)t.d(a,n,function(t){return e[t]}.bind(null,n));return a},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1);function t(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return r[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r,a}(r(848))},387:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var a=r(379),n=r.n(a),i=r(795),o=r.n(i),s=r(569),d=r.n(s),l=r(565),f=r.n(l),c=r(216),u=r.n(c),m=r(589),h=r.n(m),p=r(228),g={};g.styleTagTransform=h(),g.setAttributes=f(),g.insert=d().bind(null,"head"),g.domAPI=o(),g.insertStyleElement=u(),n()(p.Z,g);const v=p.Z&&p.Z.locals?p.Z.locals:void 0},379:e=>{"use strict";var t=[];function r(e){for(var r=-1,a=0;a{"use strict";var t={};e.exports=function(e,r){var a=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(r)}},216:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,r)=>{"use strict";e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},795:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var a="";r.supports&&(a+="@supports (".concat(r.supports,") {")),r.media&&(a+="@media ".concat(r.media," {"));var n=void 0!==r.layer;n&&(a+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),a+=r.css,n&&(a+="}"),r.media&&(a+="}"),r.supports&&(a+="}");var i=r.sourceMap;i&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},596:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uV:{name:"uV",min:-500,max:1500,deltaMain:500,deltaSecondary:100},mV:{name:"mV",min:-.5,max:1.5,deltaMain:.5,deltaSecondary:.1},mmHg:{name:"mmHg",min:0,max:200,deltaMain:100,deltaSecondary:20},def:{min:-500,max:1500,deltaMain:500,deltaSecondary:100},SOP_CLASS_UIDS:{Sop12LeadECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.1",GeneralECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.2",AmbulatoryECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.3",HemodynamicWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.2.1"}}},660:function(e,t,r){"use strict";var a,n=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(596),o=r(398),s={start:{x:null,y:null},offset:{x:0,y:0},globaloffset:{x:0,y:0}},d=function(e){function t(t,r){var a=e.call(this,t,r)||this;return a.margin=20,a.changeValues=.05,a.scale=1,a.scaleFactor=.8,s.start.x=null,s.start.y=null,s.offset.x=0,s.offset.y=0,s.globaloffset.x=0,s.globaloffset.y=0,a.buttonsEvents(),a}return n(t,e),t.prototype.draw=function(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(this.scale,this.scale),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.translate(s.offset.x,s.offset.y),this.drawGrid(),this.drawECG()},t.prototype.drawNoCompatible=function(){this.ctx.font="3rem Arial",this.ctx.fillText("ECG NO COMPATIBLE",this.canvas.width/2,this.canvas.height/2)},t.prototype.buttonsEvents=function(){var e=this;document.getElementById("amplitudeUp").addEventListener("click",(function(){return e.changeAmplitude(!0)})),document.getElementById("amplitudeDown").addEventListener("click",(function(){return e.changeAmplitude(!1)})),document.getElementById("timeLeft").addEventListener("click",(function(){return e.changeTempo(!0)})),document.getElementById("timeRight").addEventListener("click",(function(){return e.changeTempo(!1)})),document.getElementById("plus").addEventListener("click",(function(){return e.changeZoom(!1)})),document.getElementById("minus").addEventListener("click",(function(){return e.changeZoom(!0)})),this.canvas.addEventListener("mousedown",(function(t){return e.startPan(t)})),this.canvas.addEventListener("mouseleave",(function(){return e.endPan()})),this.canvas.addEventListener("mouseup",(function(){return e.endPan()}))},t.prototype.startPan=function(e){var t=this;this.canvas.addEventListener("mousemove",this.trackMouse),this.canvas.addEventListener("mousemove",(function(){return t.draw()})),s.start.x=e.clientX,s.start.y=e.clientY},t.prototype.endPan=function(){this.canvas.removeEventListener("mousemove",this.trackMouse),s.start.x=null,s.start.y=null,s.globaloffset.x=s.offset.x,s.globaloffset.y=s.offset.y},t.prototype.trackMouse=function(e){var t=e.clientX-s.start.x,r=e.clientY-s.start.y;s.offset.x=s.globaloffset.x+t,s.offset.y=s.globaloffset.y+r},t.prototype.changeZoom=function(e){e?(this.scale*=this.scaleFactor,this.configuration.CURVE_WIDTH<1.5&&this.scale<3.8&&(this.configuration.CURVE_WIDTH+=.2)):(this.scale/=this.scaleFactor,this.configuration.CURVE_WIDTH>.5&&(this.configuration.CURVE_WIDTH-=.2)),this.scale<=1?this.scale=1:this.draw()},t.prototype.changeAmplitude=function(e){var t;t=e?this.configuration.AMPLITUDE+this.changeValues:this.configuration.AMPLITUDE-this.changeValues,(t=Math.round(100*t)/100)<=1&&t>=this.changeValues&&(this.amplitude=t,this.draw(),document.getElementById("textAmplitude").innerText=" "+Math.round(100*t)+"mm/mV ")},t.prototype.changeTempo=function(e){var t;t=e?this.configuration.TIME-this.changeValues:this.configuration.TIME+this.changeValues,(t=Math.round(100*t)/100)<=1&&t>=this.changeValues&&(this.time=t,this.draw(),document.getElementById("textTime").innerText=" "+Math.round(100*t)+"mm/s ")},t.prototype.drawGrid=function(){var e=this.width-1,t=this.height-1,r=this.blockSize,a=this.cellSize,n=this.ctx.lineWidth,i=this.ctx.strokeStyle;this.ctx.strokeStyle=this.configuration.GRID_COLOR;for(var o=t;o>=0;o-=a)this.ctx.beginPath(),this.ctx.lineWidth=(t-o)%r?this.configuration.CELL_WIDTH:this.configuration.BLOCK_WIDTH,this.drawLine(0,o,e,o),this.ctx.closePath(),this.ctx.stroke();for(var s=0;s<=e;s+=a)this.ctx.beginPath(),this.ctx.lineWidth=s%r?this.configuration.CELL_WIDTH:this.configuration.BLOCK_WIDTH,this.drawLine(s,0,s,t),this.ctx.closePath(),this.ctx.stroke();this.ctx.lineWidth=n,this.ctx.strokeStyle=i,this.drawECGIndicators()},t.prototype.drawECGIndicators=function(){var e=this.canvas.width/this.configuration.COLUMNS,t=this.canvas.height/this.configuration.ROWS,r=10;this.ctx.font="small-caps 800 25px Times New Roman",this.positionsDraw=new Array;for(var a=0;a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){this.configuration={CELL_WIDTH:.1,CELL_SIZE:6,BLOCK_WIDTH:.2,BLOCK_SIZE:0,ROWS:6,COLUMNS:2,columnsText:[["I","II","III","aVR","aVL","aVF"],["V1","V2","V3","V4","V5","V6"]],CURVE_WIDTH:1.5,SAMPLING_RATE:125,FREQUENCY:250,TIME:.25,AMPLITUDE:.1,GRID_COLOR:"#F08080",LINE_COLOR:"#000033",BACKGROUND_COLOR:"#F9F8F2",HEIGHT_USER_INFO:100},this.dataMg=t,this.canvas=document.getElementById(e),this.ctx=this.canvas.getContext("2d");var r=document.getElementById("divTableBody").clientHeight+document.getElementById("toolsECG").clientHeight;this.canvas.width=window.innerWidth,this.canvas.height=window.innerHeight-r,this.canvas.style.width="100%",this.canvas.style.height="85%",this.canvas.style.backgroundColor=this.configuration.BACKGROUND_COLOR,this.configuration.BLOCK_SIZE=5*this.configuration.CELL_SIZE,this.configuration.FREQUENCY=t.samplingFrequency}return e.prototype.drawLine=function(e,t,r,a){this.ctx.moveTo(e,t),this.ctx.lineTo(r,a)},Object.defineProperty(e.prototype,"cellSize",{get:function(){return this.configuration.CELL_SIZE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blockSize",{get:function(){return 5*this.configuration.CELL_SIZE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cellsPerPeriod",{get:function(){return Math.floor(this.width/this.cellSize)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"samplesPerCell",{get:function(){return.04*this.samplingRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"samplingRate",{get:function(){return this.configuration.SAMPLING_RATE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"samplesPerPeriod",{get:function(){return Math.floor(.04*this.samplingRate*(this.width/this.cellSize))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.ctx.canvas.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ctx.canvas.height},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"period",{get:function(){return.04*this.width/this.cellSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"time",{set:function(e){this.configuration.TIME=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"amplitude",{set:function(e){this.configuration.AMPLITUDE=e},enumerable:!1,configurable:!0}),e}();t.default=r},417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(952),n=function(){function e(){}return e.getDataSet=function(e){return a.default.parseDicom(new Uint8Array(e))},e.readData=function(t){var r={sopClassUID:"",studyDate:"",sex:"",birthDate:"",patientName:"",patientID:"",patientAge:"",patientSize:"",patientWeight:"",waveformOriginality:"",numberOfWaveformChannels:0,numberOfWaveformSamples:0,samplingFrequency:0,multiplexGroupLabel:"",channels:[],waveformBitsAllocated:0,waveformSampleInterpretation:""},a=t.elements.x003a0208;void 0!==a&&a.items.length;var n=t.elements.x54000100;return void 0!==n&&(r.sopClassUID=t.string("x00080016"),r.studyDate=e.formatData(t.string("x00080020")),r.sex=t.string("x00100040"),r.birthDate=e.formatData(t.string("x00100030")),r.patientName=t.string("x00100010"),r.patientID=t.string("x00100020"),r.patientAge=t.string("x00101010"),r.patientSize=t.string("x00101020"),r.patientWeight=t.string("x00101030"),n.items.length>0&&n.items.forEach((function(a){if("xfffee000"==a.tag){var n=a.dataSet;r.waveformOriginality=n.string("x003a0004"),r.numberOfWaveformChannels=n.uint16("x003a0005"),r.numberOfWaveformSamples=n.uint32("x003a0010"),r.samplingFrequency=n.floatString("x003a001a"),r.multiplexGroupLabel=n.string("x003a0020"),r.channels=[];var i=n.elements.x003a0200,o=0;switch(void 0!==i&&i.items.length>0&&i.items.forEach((function(t){if("xfffee000"==t.tag){var a=t.dataSet,n={};n.channelSource=e.readCodeSequence(a.elements.x003a0208),n.channelSensitivity=a.string("x003a0210"),n.channelSensitivityUnits=e.readCodeSequence(a.elements.x003a0211),n.channelSensitivityCorrectionFactor=a.string("x003a0212"),n.channelBaseline=a.string("x003a0213"),n.waveformBitsStored=a.uint16("x003a021a"),r.channels[o]={},r.channels[o].channelDefinition=n,r.channels[o].samples=[],o++}})),r.waveformBitsAllocated=n.uint16("x54001004"),r.waveformSampleInterpretation=n.string("x54001006"),r.waveformBitsAllocated){case 8:r.waveformSampleInterpretation,n.string("x5400100a"),n.string("x54001010");break;case 16:switch(r.waveformSampleInterpretation){case"SS":n.int16("x5400100a"),n.string("x54001010");for(var s=n.elements.x54001010.dataOffset,d=r.numberOfWaveformSamples*r.numberOfWaveformChannels,l=new Int16Array(t.byteArray.buffer,s,d),f=0,c=0;c0){var r=e.items[0].dataSet;t.codeValue=r.string("x00080100"),t.codingSchemeDesignator=r.string("x00080102"),t.codingSchemeVersion=r.string("x00080103"),t.codeMeaning=r.string("x00080104")}return t},e.formatData=function(e){if(null==e)return e;var t=e.substring(0,4),r=e.substring(4,6);return e.substring(6,8)+"/"+r+"/"+t},e}();t.default=n},428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(596),n=r(417),i=r(660);r(387);var o=function(){function e(e,t,r){this.dataDICOMarrayBuffer=e,this.idView=t,this.nameView=r}return e.prototype.loadCanvas=function(){try{var e=n.default.getDataSet(this.dataDICOMarrayBuffer),t=n.default.readData(e);this.loadCanvasDOM(t.patientName,t.patientID,t.sex,t.birthDate,t.studyDate,t.patientAge,t.patientSize,t.patientWeight);var r=new i.default(this.idView+this.nameView,t);switch(t.sopClassUID){case a.default.SOP_CLASS_UIDS.HemodynamicWaveformStorage:r.draw();break;case a.default.SOP_CLASS_UIDS.AmbulatoryECGWaveformStorage:r.drawNoCompatible();break;case a.default.SOP_CLASS_UIDS.GeneralECGWaveformStorage:case a.default.SOP_CLASS_UIDS.Sop12LeadECGWaveformStorage:r.draw();break;default:r.drawNoCompatible(),console.log("Unsupported SOP Class UID: "+t.sopClassUID)}}catch(e){}},e.prototype.loadCanvasDOM=function(e,t,r,a,n,i,o,s){var d="";document.getElementById(this.idView).innerHTML=d,d='
NAME: '+e+'
SEX: '+r+'
PATIENT SIZE: '+o+'
PATIENT ID: '+t+'
PATIENT AGE: '+i+'
PATIENT WEIGHT: '+s+'
DATE: '+n+'
BIRTH: '+a+'
TIME: 25mm/s
AMPLITUDE: 10mm/mV
',document.getElementById(this.idView).innerHTML=d},e}();t.default=o},848:()=>{}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var i=t[a]={id:a,exports:{}};return e[a].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var a={};return(()=>{"use strict";var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=e.DicomECGViewer=e.ReadECGData=void 0;var t=r(417);e.ReadECGData=t.default;var n=r(596);e.Constants=n.default;var i=r(428);e.DicomECGViewer=i.default})(),a})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.$=t():e.$=t()}(self,(()=>(()=>{var e={228:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var a=r(402),n=r.n(a),i=r(352),o=r.n(i)()(n());o.push([e.id,"/*Table Data Study*/\r\n#infoECG {\r\n height: auto;\r\n}\r\n.divTableRow {\r\n display: table-row;\r\n}\r\n.divTableHeading {\r\n background-color: #eee;\r\n display: table-header-group;\r\n}\r\n.divTableCell,\r\n.divTableHead {\r\n display: table-cell;\r\n font-size: 13px;\r\n font-weight: 700;\r\n color: #000000;\r\n}\r\n.divTableCell i {\r\n font-weight: normal;\r\n}\r\n.divTableHeading {\r\n background-color: #eee;\r\n display: table-header-group;\r\n font-weight: bold;\r\n}\r\n.divTableFoot {\r\n background-color: #eee;\r\n display: table-footer-group;\r\n font-weight: bold;\r\n}\r\n#divTableBody {\r\n height: auto;\r\n background: #f9f8f2;\r\n width: 100%;\r\n display: table;\r\n padding: 10px;\r\n}\r\n\r\n/** Buttons **/\r\n#toolsECG {\r\n background: #f9f8f2;\r\n width: 100%;\r\n display: flow-root;\r\n border-top: 2px solid rgb(0, 0, 0);\r\n}\r\n.divTools {\r\n float: right;\r\n font-size: 13px;\r\n font-weight: 700;\r\n margin-left: 1.5rem;\r\n}\r\n.divTools i {\r\n font-weight: normal;\r\n}\r\n.divTools button {\r\n background-color: #dadada;\r\n color: black;\r\n padding: 5px 15px;\r\n margin: 4px 2px;\r\n border-radius: 10%;\r\n}\r\n\r\n/*Zoom buttons*/\r\n#zoomButons {\r\n position: absolute;\r\n width: 30px;\r\n top: 125px;\r\n right: 2px;\r\n}\r\n\r\n#zoomButons button {\r\n background-color: #dadada;\r\n color: black;\r\n padding: 5px;\r\n width: 30px;\r\n height: 30px;\r\n margin: 0px 0px 2px 0px;\r\n border-radius: 10%;\r\n}\r\n",""]);const s=o},352:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",a=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),a&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),a&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,a,n,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(a)for(var s=0;s0?" ".concat(f[5]):""," {").concat(f[1],"}")),f[5]=i),r&&(f[2]?(f[1]="@media ".concat(f[2]," {").concat(f[1],"}"),f[2]=r):f[2]=r),n&&(f[4]?(f[1]="@supports (".concat(f[4],") {").concat(f[1],"}"),f[4]=n):f[4]="".concat(n)),t.push(f))}},t}},402:e=>{"use strict";e.exports=function(e){return e[1]}},952:function(e,t,r){e.exports=function(e){return r=[function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t),r.d(t,"isStringVr",(function(){return n})),r.d(t,"isPrivateTag",(function(){return i})),r.d(t,"parsePN",(function(){return o})),r.d(t,"parseTM",(function(){return s})),r.d(t,"parseDA",(function(){return d})),r.d(t,"explicitElementToString",(function(){return l})),r.d(t,"explicitDataSetToJS",(function(){return f})),r.d(t,"createJPEGBasicOffsetTable",(function(){return m})),r.d(t,"parseDicomDataSetExplicit",(function(){return T})),r.d(t,"parseDicomDataSetImplicit",(function(){return C})),r.d(t,"readFixedString",(function(){return v})),r.d(t,"alloc",(function(){return U})),r.d(t,"version",(function(){return F})),r.d(t,"bigEndianByteArrayParser",(function(){return B})),r.d(t,"ByteStream",(function(){return M})),r.d(t,"sharedCopy",(function(){return L})),r.d(t,"DataSet",(function(){return x})),r.d(t,"findAndSetUNElementLength",(function(){return g})),r.d(t,"findEndOfEncapsulatedElement",(function(){return p})),r.d(t,"findItemDelimitationItemAndSetElementLength",(function(){return w})),r.d(t,"littleEndianByteArrayParser",(function(){return _})),r.d(t,"parseDicom",(function(){return V})),r.d(t,"readDicomElementExplicit",(function(){return O})),r.d(t,"readDicomElementImplicit",(function(){return E})),r.d(t,"readEncapsulatedImageFrame",(function(){return R})),r.d(t,"readEncapsulatedPixelData",(function(){return j})),r.d(t,"readEncapsulatedPixelDataFromFragments",(function(){return G})),r.d(t,"readPart10Header",(function(){return q})),r.d(t,"readSequenceItemsExplicit",(function(){return I})),r.d(t,"readSequenceItemsImplicit",(function(){return A})),r.d(t,"readSequenceItem",(function(){return P})),r.d(t,"readTag",(function(){return h}));var a={AE:!0,AS:!0,AT:!1,CS:!0,DA:!0,DS:!0,DT:!0,FL:!1,FD:!1,IS:!0,LO:!0,LT:!0,OB:!1,OD:!1,OF:!1,OW:!1,PN:!0,SH:!0,SL:!1,SQ:!1,SS:!1,ST:!0,TM:!0,UI:!0,UL:!1,UN:void 0,UR:!0,US:!1,UT:!0},n=function(e){return a[e]},i=function(e){return parseInt(e[4],10)%2==1},o=function(e){if(void 0!==e)return{familyName:(e=e.split("^"))[0],givenName:e[1],middleName:e[2],prefix:e[3],suffix:e[4]}};function s(e,t){if(2<=e.length){var r=parseInt(e.substring(0,2),10),a=4<=e.length?parseInt(e.substring(2,4),10):void 0,n=6<=e.length?parseInt(e.substring(4,6),10):void 0,i=(i=8<=e.length?e.substring(7,13):void 0)?parseInt(i,10)*Math.pow(10,6-i.length):void 0;if(t&&(isNaN(r)||void 0!==a&&isNaN(a)||void 0!==n&&isNaN(n)||void 0!==i&&isNaN(i)||r<0||23e.byteArray.length-e.position&&(d=e.byteArray.length-e.position),t.fragments.push({offset:e.position-o-8,position:e.position,length:d}),e.seek(d),void(t.length=e.position-t.dataOffset);t.fragments.push({offset:e.position-o-8,position:e.position,length:d}),e.seek(d)}r&&r.push("pixel data element ".concat(t.tag," missing sequence delimiter tag xfffee0dd"))}function g(e,t){if(void 0===e)throw"dicomParser.findAndSetUNElementLength: missing required parameter 'byteStream'";for(var r=e.byteArray.length-8;e.position<=r;)if(65534===e.readUint16()&&57565===e.readUint16())return 0!==e.readUint32()&&e.warnings("encountered non zero length following item delimiter at position ".concat(e.position-4," while reading element of undefined length with tag ").concat(t.tag)),void(t.length=e.position-t.dataOffset);t.length=e.byteArray.length-t.dataOffset,e.seek(e.byteArray.length-e.position)}function v(e,t,r){if(r<0)throw"dicomParser.readFixedString - length cannot be less than 0";if(t+r>e.length)throw"dicomParser.readFixedString: attempt to read past end of buffer";for(var a,n="",i=0;it.byteArray.length)throw"dicomParser.parseDicomDataSetExplicit: invalid value for parameter 'maxP osition'";for(var n=e.elements;t.positionr)throw"dicomParser:parseDicomDataSetExplicit: buffer overrun"}function C(e,t,r){var a=3t.byteArray.length)throw"dicomParser.parseDicomDataSetImplicit: invalid value for parameter 'maxPosition'";for(var n=e.elements;t.positione.length)throw"bigEndianByteArrayParser.readUint16: attempt to read past end of buffer";return(e[t]<<8)+e[t+1]},readInt16:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readInt16: position cannot be less than 0";if(t+2>e.length)throw"bigEndianByteArrayParser.readInt16: attempt to read past end of buffer";return 32768&(t=(e[t]<<8)+e[t+1])?t-65535-1:t},readUint32:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readUint32: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readUint32: attempt to read past end of buffer";return 256*(256*(256*e[t]+e[t+1])+e[t+2])+e[t+3]},readInt32:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readInt32: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readInt32: attempt to read past end of buffer";return(e[t]<<24)+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]},readFloat:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readFloat: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readFloat: attempt to read past end of buffer";var r=new Uint8Array(4);return r[3]=e[t],r[2]=e[t+1],r[1]=e[t+2],r[0]=e[t+3],new Float32Array(r.buffer)[0]},readDouble:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readDouble: position cannot be less than 0";if(t+8>e.length)throw"bigEndianByteArrayParser.readDouble: attempt to read past end of buffer";var r=new Uint8Array(8);return r[7]=e[t],r[6]=e[t+1],r[5]=e[t+2],r[4]=e[t+3],r[3]=e[t+4],r[2]=e[t+5],r[1]=e[t+6],r[0]=e[t+7],new Float64Array(r.buffer)[0]}};function L(e,t,r){if("undefined"!=typeof Buffer&&e instanceof Buffer)return e.slice(t,t+r);if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset+t,r);throw"dicomParser.from: unknown type for byteArray"}function k(e,t){for(var r=0;r=r.length)throw"dicomParser.ByteStream: parameter 'position' cannot be greater than or equal to 'byteArray' length";this.byteArrayParser=t,this.byteArray=r,this.position=a||0,this.warnings=[]}var t,r;return t=e,(r=[{key:"seek",value:function(e){if(this.position+e<0)throw"dicomParser.ByteStream.prototype.seek: cannot seek to position < 0";this.position+=e}},{key:"readByteStream",value:function(t){if(this.position+t>this.byteArray.length)throw"dicomParser.ByteStream.prototype.readByteStream: readByteStream - buffer overread";var r=L(this.byteArray,this.position,t);return this.position+=t,new e(this.byteArrayParser,r)}},{key:"getSize",value:function(){return this.byteArray.length}},{key:"readUint16",value:function(){var e=this.byteArrayParser.readUint16(this.byteArray,this.position);return this.position+=2,e}},{key:"readUint32",value:function(){var e=this.byteArrayParser.readUint32(this.byteArray,this.position);return this.position+=4,e}},{key:"readFixedString",value:function(e){var t=v(this.byteArray,this.position,e);return this.position+=e,t}}])&&k(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_={readUint16:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readUint16: position cannot be less than 0";if(t+2>e.length)throw"littleEndianByteArrayParser.readUint16: attempt to read past end of buffer";return e[t]+256*e[t+1]},readInt16:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readInt16: position cannot be less than 0";if(t+2>e.length)throw"littleEndianByteArrayParser.readInt16: attempt to read past end of buffer";return 32768&(t=e[t]+(e[t+1]<<8))?t-65535-1:t},readUint32:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readUint32: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readUint32: attempt to read past end of buffer";return e[t]+256*e[t+1]+256*e[t+2]*256+256*e[t+3]*256*256},readInt32:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readInt32: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readInt32: attempt to read past end of buffer";return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24)},readFloat:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readFloat: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readFloat: attempt to read past end of buffer";var r=new Uint8Array(4);return r[0]=e[t],r[1]=e[t+1],r[2]=e[t+2],r[3]=e[t+3],new Float32Array(r.buffer)[0]},readDouble:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readDouble: position cannot be less than 0";if(t+8>e.length)throw"littleEndianByteArrayParser.readDouble: attempt to read past end of buffer";var r=new Uint8Array(8);return r[0]=e[t],r[1]=e[t+1],r[2]=e[t+2],r[3]=e[t+3],r[4]=e[t+4],r[5]=e[t+5],r[6]=e[t+6],r[7]=e[t+7],new Float64Array(r.buffer)[0]}};function q(e){var t=1= 0";if(r>=t.fragments.length)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragmentIndex' must be < number of fragments";if(a<1)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'numFragments' must be > 0";if(r+a>t.fragments.length)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragment' + 'numFragments' < number of fragments";var i=new M(e.byteArrayParser,e.byteArray,t.dataOffset);if("xfffee000"!==(t=P(i)).tag)throw"dicomParser.readEncapsulatedPixelData: missing basic offset table xfffee000";i.seek(t.length);var o=i.position;if(1===a)return L(i.byteArray,o+n[r].offset+8,n[r].length);t=function(e,t,r){for(var a=0,n=t;n= 0";if(r>=a.length)throw"dicomParser.readEncapsulatedImageFrame: parameter 'frameIndex' must be < basicOffsetTable.length";var i=a[r];if(void 0===(i=function(e,t){for(var r=0;r= 0";return 0!==t.basicOffsetTable.length?R(e,t,r):G(e,t,0,t.fragments.length)}t.default={isStringVr:n,isPrivateTag:i,parsePN:o,parseTM:s,parseDA:d,explicitElementToString:l,explicitDataSetToJS:f,createJPEGBasicOffsetTable:m,parseDicomDataSetExplicit:T,parseDicomDataSetImplicit:C,readFixedString:v,alloc:U,version:F,bigEndianByteArrayParser:B,ByteStream:M,sharedCopy:L,DataSet:x,findAndSetUNElementLength:g,findEndOfEncapsulatedElement:p,findItemDelimitationItemAndSetElementLength:w,littleEndianByteArrayParser:_,parseDicom:V,readDicomElementExplicit:O,readDicomElementImplicit:E,readEncapsulatedImageFrame:R,readEncapsulatedPixelData:j,readEncapsulatedPixelDataFromFragments:G,readPart10Header:q,readSequenceItemsExplicit:I,readSequenceItemsImplicit:A,readSequenceItem:P,readTag:h,LEI:"1.2.840.10008.1.2",LEE:"1.2.840.10008.1.2.1"}}],a={},t.m=r,t.c=a,t.d=function(e,r,a){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)t.d(a,n,function(t){return e[t]}.bind(null,n));return a},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1);function t(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return r[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r,a}(r(848))},387:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var a=r(379),n=r.n(a),i=r(795),o=r.n(i),s=r(569),d=r.n(s),l=r(565),f=r.n(l),c=r(216),u=r.n(c),m=r(589),h=r.n(m),p=r(228),g={};g.styleTagTransform=h(),g.setAttributes=f(),g.insert=d().bind(null,"head"),g.domAPI=o(),g.insertStyleElement=u(),n()(p.Z,g);const v=p.Z&&p.Z.locals?p.Z.locals:void 0},379:e=>{"use strict";var t=[];function r(e){for(var r=-1,a=0;a{"use strict";var t={};e.exports=function(e,r){var a=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(r)}},216:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,r)=>{"use strict";e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},795:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var a="";r.supports&&(a+="@supports (".concat(r.supports,") {")),r.media&&(a+="@media ".concat(r.media," {"));var n=void 0!==r.layer;n&&(a+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),a+=r.css,n&&(a+="}"),r.media&&(a+="}"),r.supports&&(a+="}");var i=r.sourceMap;i&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},596:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uV:{name:"uV",min:-500,max:1500,deltaMain:500,deltaSecondary:100},mV:{name:"mV",min:-.5,max:1.5,deltaMain:.5,deltaSecondary:.1},mmHg:{name:"mmHg",min:0,max:200,deltaMain:100,deltaSecondary:20},def:{min:-500,max:1500,deltaMain:500,deltaSecondary:100},SOP_CLASS_UIDS:{Sop12LeadECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.1",GeneralECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.2",AmbulatoryECGWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.1.3",HemodynamicWaveformStorage:"1.2.840.10008.5.1.4.1.1.9.2.1"}}},660:function(e,t,r){"use strict";var a,n=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(596),o=r(398),s={start:{x:null,y:null},offset:{x:0,y:0},globaloffset:{x:0,y:0}},d=function(e){function t(t,r){var a=e.call(this,t,r)||this;return a.margin=20,a.changeValues=.05,a.scale=1,a.scaleFactor=.8,s.start.x=null,s.start.y=null,s.offset.x=0,s.offset.y=0,s.globaloffset.x=0,s.globaloffset.y=0,a.buttonsEvents(),a}return n(t,e),t.prototype.draw=function(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(this.scale,this.scale),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.translate(s.offset.x,s.offset.y),this.drawGrid(),this.drawECG()},t.prototype.drawNoCompatible=function(){this.ctx.font="3rem Arial",this.ctx.fillText("ECG NO COMPATIBLE",this.canvas.width/2,this.canvas.height/2)},t.prototype.buttonsEvents=function(){var e=this;document.getElementById("amplitudeUp").addEventListener("click",(function(){return e.changeAmplitude(!0)})),document.getElementById("amplitudeDown").addEventListener("click",(function(){return e.changeAmplitude(!1)})),document.getElementById("timeLeft").addEventListener("click",(function(){return e.changeTempo(!0)})),document.getElementById("timeRight").addEventListener("click",(function(){return e.changeTempo(!1)})),document.getElementById("plus").addEventListener("click",(function(){return e.changeZoom(!1)})),document.getElementById("minus").addEventListener("click",(function(){return e.changeZoom(!0)})),this.canvas.addEventListener("mousedown",(function(t){return e.startPan(t)})),this.canvas.addEventListener("mouseleave",(function(){return e.endPan()})),this.canvas.addEventListener("mouseup",(function(){return e.endPan()}))},t.prototype.startPan=function(e){var t=this;this.canvas.addEventListener("mousemove",this.trackMouse),this.canvas.addEventListener("mousemove",(function(){return t.draw()})),s.start.x=e.clientX,s.start.y=e.clientY},t.prototype.endPan=function(){this.canvas.removeEventListener("mousemove",this.trackMouse),s.start.x=null,s.start.y=null,s.globaloffset.x=s.offset.x,s.globaloffset.y=s.offset.y},t.prototype.trackMouse=function(e){var t=e.clientX-s.start.x,r=e.clientY-s.start.y;s.offset.x=s.globaloffset.x+t,s.offset.y=s.globaloffset.y+r},t.prototype.changeZoom=function(e){e?(this.scale*=this.scaleFactor,this.configuration.CURVE_WIDTH<1.5&&this.scale<3.8&&(this.configuration.CURVE_WIDTH+=.2)):(this.scale/=this.scaleFactor,this.configuration.CURVE_WIDTH>.5&&(this.configuration.CURVE_WIDTH-=.2)),this.scale<=1?this.scale=1:this.draw()},t.prototype.changeAmplitude=function(e){var t;t=e?this.configuration.AMPLITUDE+this.changeValues:this.configuration.AMPLITUDE-this.changeValues,(t=Math.round(100*t)/100)<=1&&t>=this.changeValues&&(this.amplitude=t,this.draw(),document.getElementById("textAmplitude").innerText=" "+Math.round(100*t)+"mm/mV ")},t.prototype.changeTempo=function(e){var t;t=e?this.configuration.TIME-this.changeValues:this.configuration.TIME+this.changeValues,(t=Math.round(100*t)/100)<=1&&t>=this.changeValues&&(this.time=t,this.draw(),document.getElementById("textTime").innerText=" "+Math.round(100*t)+"mm/s ")},t.prototype.drawGrid=function(){var e=this.width-1,t=this.height-1,r=this.blockSize,a=this.cellSize,n=this.ctx.lineWidth,i=this.ctx.strokeStyle;this.ctx.strokeStyle=this.configuration.GRID_COLOR;for(var o=t;o>=0;o-=a)this.ctx.beginPath(),this.ctx.lineWidth=(t-o)%r?this.configuration.CELL_WIDTH:this.configuration.BLOCK_WIDTH,this.drawLine(0,o,e,o),this.ctx.closePath(),this.ctx.stroke();for(var s=0;s<=e;s+=a)this.ctx.beginPath(),this.ctx.lineWidth=s%r?this.configuration.CELL_WIDTH:this.configuration.BLOCK_WIDTH,this.drawLine(s,0,s,t),this.ctx.closePath(),this.ctx.stroke();this.ctx.lineWidth=n,this.ctx.strokeStyle=i,this.drawECGIndicators()},t.prototype.drawECGIndicators=function(){var e=this.canvas.width/this.configuration.COLUMNS,t=this.canvas.height/this.configuration.ROWS,r=10;this.ctx.font="small-caps 800 25px Times New Roman",this.positionsDraw=new Array;for(var a=0;a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){this.configuration={CELL_WIDTH:.1,CELL_SIZE:6,BLOCK_WIDTH:.2,BLOCK_SIZE:0,ROWS:6,COLUMNS:2,columnsText:[["I","II","III","aVR","aVL","aVF"],["V1","V2","V3","V4","V5","V6"]],CURVE_WIDTH:1.5,SAMPLING_RATE:125,FREQUENCY:250,TIME:.25,AMPLITUDE:.1,GRID_COLOR:"#F08080",LINE_COLOR:"#000033",BACKGROUND_COLOR:"#F9F8F2",HEIGHT_USER_INFO:100},this.dataMg=t,this.canvas=document.getElementById(e),this.ctx=this.canvas.getContext("2d");var r=document.getElementById("divTableBody").clientHeight+document.getElementById("toolsECG").clientHeight;this.canvas.width=window.innerWidth,this.canvas.height=window.innerHeight-r,this.canvas.style.width="100%",this.canvas.style.height="85%",this.canvas.style.backgroundColor=this.configuration.BACKGROUND_COLOR,this.configuration.BLOCK_SIZE=5*this.configuration.CELL_SIZE,this.configuration.FREQUENCY=t.samplingFrequency}return e.prototype.drawLine=function(e,t,r,a){this.ctx.moveTo(e,t),this.ctx.lineTo(r,a)},Object.defineProperty(e.prototype,"cellSize",{get:function(){return this.configuration.CELL_SIZE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blockSize",{get:function(){return 5*this.configuration.CELL_SIZE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cellsPerPeriod",{get:function(){return Math.floor(this.width/this.cellSize)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"samplesPerCell",{get:function(){return.04*this.samplingRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"samplingRate",{get:function(){return this.configuration.SAMPLING_RATE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"samplesPerPeriod",{get:function(){return Math.floor(.04*this.samplingRate*(this.width/this.cellSize))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.ctx.canvas.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ctx.canvas.height},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"period",{get:function(){return.04*this.width/this.cellSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"time",{set:function(e){this.configuration.TIME=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"amplitude",{set:function(e){this.configuration.AMPLITUDE=e},enumerable:!1,configurable:!0}),e}();t.default=r},417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(952),n=function(){function e(){}return e.getDataSet=function(e){return a.default.parseDicom(new Uint8Array(e))},e.readData=function(t){var r={sopClassUID:"",studyDate:"",sex:"",birthDate:"",patientName:"",patientID:"",patientAge:"",patientSize:"",patientWeight:"",waveformOriginality:"",numberOfWaveformChannels:0,numberOfWaveformSamples:0,samplingFrequency:0,multiplexGroupLabel:"",channels:[],waveformBitsAllocated:0,waveformSampleInterpretation:""},a=t.elements.x003a0208;void 0!==a&&a.items.length;var n=t.elements.x54000100;return void 0!==n&&(r.sopClassUID=t.string("x00080016"),r.studyDate=e.formatData(t.string("x00080020")),r.sex=t.string("x00100040"),r.birthDate=e.formatData(t.string("x00100030")),r.patientName=t.string("x00100010"),r.patientID=t.string("x00100020"),r.patientAge=t.string("x00101010"),r.patientSize=t.string("x00101020"),r.patientWeight=t.string("x00101030"),n.items.length>0&&n.items.forEach((function(a){if("xfffee000"==a.tag){var n=a.dataSet;r.waveformOriginality=n.string("x003a0004"),r.numberOfWaveformChannels=n.uint16("x003a0005"),r.numberOfWaveformSamples=n.uint32("x003a0010"),r.samplingFrequency=n.floatString("x003a001a"),r.multiplexGroupLabel=n.string("x003a0020"),r.channels=[];var i=n.elements.x003a0200,o=0;switch(void 0!==i&&i.items.length>0&&i.items.forEach((function(t){if("xfffee000"==t.tag){var a=t.dataSet,n={};n.channelSource=e.readCodeSequence(a.elements.x003a0208),n.channelSensitivity=a.string("x003a0210"),n.channelSensitivityUnits=e.readCodeSequence(a.elements.x003a0211),n.channelSensitivityCorrectionFactor=a.string("x003a0212"),n.channelBaseline=a.string("x003a0213"),n.waveformBitsStored=a.uint16("x003a021a"),r.channels[o]={},r.channels[o].channelDefinition=n,r.channels[o].samples=[],o++}})),r.waveformBitsAllocated=n.uint16("x54001004"),r.waveformSampleInterpretation=n.string("x54001006"),r.waveformBitsAllocated){case 8:r.waveformSampleInterpretation,n.string("x5400100a"),n.string("x54001010");break;case 16:switch(r.waveformSampleInterpretation){case"SS":n.int16("x5400100a"),n.string("x54001010");for(var s=n.elements.x54001010.dataOffset,d=r.numberOfWaveformSamples*r.numberOfWaveformChannels,l=new Int16Array(t.byteArray.buffer,s,d),f=0,c=0;c0){var r=e.items[0].dataSet;t.codeValue=r.string("x00080100"),t.codingSchemeDesignator=r.string("x00080102"),t.codingSchemeVersion=r.string("x00080103"),t.codeMeaning=r.string("x00080104")}return t},e.formatData=function(e){if(null==e)return e;var t=e.substring(0,4),r=e.substring(4,6);return e.substring(6,8)+"/"+r+"/"+t},e}();t.default=n},428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(596),n=r(417),i=r(660);r(387);var o=function(){function e(e,t,r){this.dataDICOMarrayBuffer=e,this.idView=t,this.nameView=r}return e.prototype.loadCanvas=function(){try{var e=n.default.getDataSet(this.dataDICOMarrayBuffer),t=n.default.readData(e);this.loadCanvasDOM(t.patientName,t.patientID,t.sex,t.birthDate,t.studyDate,t.patientAge,t.patientSize,t.patientWeight);var r=new i.default(this.idView+this.nameView,t);switch(t.sopClassUID){case a.default.SOP_CLASS_UIDS.HemodynamicWaveformStorage:r.draw();break;case a.default.SOP_CLASS_UIDS.AmbulatoryECGWaveformStorage:r.drawNoCompatible();break;case a.default.SOP_CLASS_UIDS.GeneralECGWaveformStorage:case a.default.SOP_CLASS_UIDS.Sop12LeadECGWaveformStorage:r.draw();break;default:r.drawNoCompatible(),console.log("Unsupported SOP Class UID: "+t.sopClassUID)}}catch(e){}},e.prototype.loadCanvasDOM=function(e,t,r,a,n,i,o,s){var d="";document.getElementById(this.idView).innerHTML=d,d='
NAME: '+e+'
SEX: '+r+'
PATIENT SIZE: '+o+'
PATIENT ID: '+t+'
PATIENT AGE: '+i+'
PATIENT WEIGHT: '+s+'
DATE: '+n+'
BIRTH: '+a+'
TIME: 25mm/s
AMPLITUDE: 10mm/mV
',document.getElementById(this.idView).innerHTML=d},e}();t.default=o},848:()=>{}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var i=t[a]={id:a,exports:{}};return e[a].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var a={};return(()=>{"use strict";var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=e.DicomECGViewer=e.ReadECGData=void 0;var t=r(417);e.ReadECGData=t.default;var n=r(596);e.Constants=n.default;var i=r(428);e.DicomECGViewer=i.default})(),a})())); \ No newline at end of file diff --git a/package.json b/package.json index 8b63f49..6e66038 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ecg-dicom-web-viewer", - "version": "2.0.0", + "version": "2.0.1", "author": "Arturo Rodrigo (https://github.com/ArturRod)", "license": "MIT", "description": "Together with the cornerstone library, this project allows reading and drawing ECGs from a dcm in web version.",