dwv 0.33.1 → 0.34.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/dist/dwv.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("konva"),require("jszip"),require("magic-wand-tool")):"function"==typeof define&&define.amd?define(["konva","jszip","konmagic-wand-tool"],t):"object"==typeof exports?exports.dwv=t(require("konva"),require("jszip"),require("magic-wand-tool")):e.dwv=t(e.Konva,e.JSZip,e.MagicWand)}(this,(function(e,t,n){return function(){"use strict";var i={654:function(e){e.exports=t},944:function(t){t.exports=e},324:function(e){e.exports=n}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return i[e](n,n.exports,o),n.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){o.r(a),o.d(a,{App:function(){return Xi},AppOptions:function(){return Yi},BLACK:function(){return p},ChangeSegmentColourCommand:function(){return _i},ColourMap:function(){return S},DataElement:function(){return Te},DeleteSegmentCommand:function(){return Zi},DicomCode:function(){return bt},DicomParser:function(){return ke},DicomWriter:function(){return Pt},DrawController:function(){return In},DrawDetails:function(){return pn},DrawLayer:function(){return Tn},DrawMeta:function(){return mn},Geometry:function(){return it},Image:function(){return Yt},Index:function(){return e},LayerGroup:function(){return On},MaskFactory:function(){return Ht},MaskSegment:function(){return Ft},MaskSegmentHelper:function(){return ji},MaskSegmentViewHelper:function(){return Ki},Matrix33:function(){return w},NumberRange:function(){return tt},Orientation:function(){return De},OverlayData:function(){return hi},PlaneHelper:function(){return Kt},Point:function(){return R},Point2D:function(){return b},Point3D:function(){return x},RGB:function(){return m},RescaleSlopeAndIntercept:function(){return je},Scalar2D:function(){return Ji},Scalar3D:function(){return $i},ScrollWheel:function(){return gi},Size:function(){return Ze},Spacing:function(){return nt},Tag:function(){return le},TagValueExtractor:function(){return ht},ToolConfig:function(){return Wi},ToolboxController:function(){return Bn},Vector3D:function(){return T},View:function(){return _t},ViewConfig:function(){return zi},ViewController:function(){return Jt},ViewLayer:function(){return an},WindowLevel:function(){return r},WriterRule:function(){return pt},addTagsToDictionary:function(){return Y},buildMultipart:function(){return z},createImage:function(){return zt},createMaskImage:function(){return Wt},createView:function(){return Zt},customUI:function(){return en},decoderScripts:function(){return Xn},defaultPresets:function(){return s},defaults:function(){return Li},getDefaultDicomSegJson:function(){return kt},getDwvVersion:function(){return Le},getElementsFromJSONTags:function(){return At},getEllipseIndices:function(){return Ui},getLayerDetailsFromEvent:function(){return Pn},getMousePoint:function(){return rn},getOrientationName:function(){return be},getPixelDataTag:function(){return Se},getReverseOrientation:function(){return Ae},getTagFromKey:function(){return ce},getTouchPoints:function(){return nn},getTypedArray:function(){return Me},getUID:function(){return yt},hasDicomPrefix:function(){return Pe},i18n:function(){return mi},isEqualRgb:function(){return f},labToUintLab:function(){return D},logger:function(){return i},luts:function(){return g},precisionRound:function(){return B},srgbToCielab:function(){return v},toolList:function(){return Gi}});class e{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create index with no values.");if(0===e.length)throw new Error("Cannot create index with empty values.");if(!e.every((function(e){return!isNaN(e)})))throw new Error("Cannot create index with non number values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}canCompare(e){return!!e&&this.length()===e.length()}equals(e){if(!this.canCompare(e))return!1;for(let t=0,n=this.length();t<n;++t)if(this.get(t)!==e.get(t))return!1;return!0}compare(e){if(!this.canCompare(e))return null;const t=[];for(let n=0,i=this.length();n<i;++n)this.get(n)!==e.get(n)&&t.push(n);return t}add(t){if(!this.canCompare(t))return null;const n=[];for(let e=0,i=this.length();e<i;++e)n.push(this.get(e)+t.get(e));return new e(n)}getWithNew2D(t,n){const i=[t,n];for(let e=2,t=this.length();e<t;++e)i.push(this.get(e));return new e(i)}toStringId(e){if(void 0===e){e=[];for(let t=0;t<this.length();++t)e.push(t)}for(let t=0;t<e.length;++t)if(e[t]>=this.length())throw new Error("Non valid dimension for toStringId.");let t="";for(let n=0;n<e.length;++n)0!==n&&(t+="_"),t+="#"+e[n]+"-"+this.get(e[n]);return t}}function t(t){const n=t.split("_");let i,r=3;for(let e=0;e<n.length;++e)i=parseInt(n[e].substring(1,2),10),i+1>r&&(r=i+1);const o=new Array(r);o.fill(0);for(let e=0;e<n.length;++e){i=parseInt(n[e].substring(1,2),10);const t=parseInt(n[e].substring(3),10);o[i]=t}return new e(o)}class n{#t;#n;#i;#r;constructor(e,t){if(this.#t=e,this.#n=e.isID(),this.#i=Math.pow(2,t),!this.#n){this.#r=new Float32Array(this.#i);for(let e=0;e<this.#i;++e)this.#r[e]=this.#t.apply(e)}}getRSI(){return this.#t}getLength(){return this.#i}getValue(e){return this.#n?e:this.#r[e]}}const i={levels:{TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4},level:3,trace:function(e){this.level<=this.levels.TRACE&&console.trace(e)},debug:function(e){this.level<=this.levels.DEBUG&&console.debug(e)},info:function(e){this.level<=this.levels.INFO&&console.info(e)},warn:function(e){this.level<=this.levels.WARN&&console.warn(e)},error:function(e){this.level<=this.levels.ERROR&&console.error(e)}};class r{center;width;constructor(e,t){t<1&&(i.warn("Using minimum window width since input is not valid: "+t),t=1),this.center=e,this.width=t}equals(e){return null!=e&&this.center===e.center&&this.width===e.width}}const s={CT:{mediastinum:new r(40,400),lung:new r(-500,1500),bone:new r(500,2e3),brain:new r(40,80),head:new r(90,350)}};class l{#o;#a=0;#s=0;#l=255;#c=null;#u=null;#d=null;#h=null;constructor(e){this.#o=e,this.#S()}getWindowLevel(){return this.#o}#S(){const e=this.#o.center,t=this.#o.width,n=e+this.#a;this.#c=n-.5-(t-1)/2,this.#u=n-.5+(t-1)/2,this.#d=(this.#l-this.#s)/(t-1),this.#h=(-(n-.5)/(t-1)+.5)*(this.#l-this.#s)+this.#s}setSignedOffset(e){this.#a=e,this.#S()}apply(e){return e<=this.#c?this.#s:e>this.#u?this.#l:e*this.#d+this.#h}}class c{#g;#m;#r;#p=0;#f=!0;constructor(e,t,n){if(this.#g=e,t){const e=this.#g.getLength();this.#p=e/2}else this.#p=0;this.#f=n}getVoiLut(){return this.#m}getModalityLut(){return this.#g}setVoiLut(e){if(this.#m=e,this.#m.setSignedOffset(this.#g.getRSI().getSlope()*this.#p),this.#f){const e=this.#g.getLength();this.#r=new Uint8ClampedArray(e);for(let t=0;t<e;++t)this.#r[t]=this.#m.apply(this.#g.getValue(t))}}getValue(e){return this.#f?this.#r[e+this.#p]:Math.floor(this.#m.apply(e+this.#p))}}function u(e){const t=[];for(let n=0;n<256;++n)t.push(e(n));return t}function d(e){return e}function h(e){return 255-e}class S{red;green;blue;constructor(e,t,n){this.red=e,this.green=t,this.blue=n}}const g={plain:{red:u(d),green:u(d),blue:u(d)},invPlain:{red:u(h),green:u(h),blue:u(h)},rainbow:{blue:[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,200,208,216,224,232,240,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,251,249,247,245,243,241,239,237,235,233,231,229,227,225,223,221,219,217,215,213,211,209,207,205,203,201,199,197,195,193,192,189,186,183,180,177,174,171,168,165,162,159,156,153,150,147,144,141,138,135,132,129,126,123,120,117,114,111,108,105,102,99,96,93,90,87,84,81,78,75,72,69,66,63,60,57,54,51,48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3],red:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,62,60,58,56,54,52,50,48,46,44,42,40,38,36,34,32,30,28,26,24,22,20,18,16,14,12,10,8,6,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]},hot:{red:u((function(e){const t=3*e;return t>255?255:t})),green:u((function(e){const t=256/3;let n=0;return e>=t&&(n=3*(e-t),n>255)?255:n})),blue:u((function(e){const t=256/3;let n=0;return e>=2*t&&(n=3*(e-2*t),n>255)?255:n}))},hot_iron:{red:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,255],blue:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255]},pet:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,128,126,124,122,120,118,116,114,112,110,108,106,104,102,100,98,96,94,92,90,88,86,84,82,80,78,76,74,72,70,68,66,64,63,61,59,57,55,53,51,49,47,45,43,41,39,37,35,33,31,29,27,25,23,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,255],blue:[0,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,252,248,244,240,236,232,228,224,220,216,212,208,204,200,196,192,188,184,180,176,172,168,164,160,156,152,148,144,140,136,132,128,124,120,116,112,108,104,100,96,92,88,84,80,76,72,68,64,60,56,52,48,44,40,36,32,28,24,20,16,12,8,4,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,255]},hot_metal_blue:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,9,12,15,18,21,24,26,29,32,35,38,41,44,47,50,52,55,57,59,62,64,66,69,71,74,76,78,81,83,85,88,90,93,96,99,102,105,108,111,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,166,169,172,175,178,181,184,187,190,194,198,201,205,209,213,217,221,224,228,232,236,240,244,247,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,9,11,13,15,17,19,21,23,24,26,28,30,32,34,36,38,40,41,43,45,47,49,51,53,55,56,58,60,62,64,66,68,70,72,73,75,77,79,81,83,85,87,88,90,92,94,96,98,100,102,104,105,107,109,111,113,115,117,119,120,122,124,126,128,130,132,134,136,137,139,141,143,145,147,149,151,152,154,156,158,160,162,164,166,168,169,171,173,175,177,179,181,183,184,186,188,190,192,194,196,198,200,201,203,205,207,209,211,213,215,216,218,220,222,224,226,228,229,231,233,235,237,239,240,242,244,246,248,250,251,253,255],blue:[0,2,4,6,8,10,12,14,16,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,184,186,188,190,192,194,196,198,200,197,194,191,188,185,182,179,176,174,171,168,165,162,159,156,153,150,144,138,132,126,121,115,109,103,97,91,85,79,74,68,62,56,50,47,44,41,38,35,32,29,26,24,21,18,15,12,9,6,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,9,12,15,18,21,24,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,176,179,182,185,188,191,194,197,200,203,206,210,213,216,219,223,226,229,232,236,239,242,245,249,252,255]},pet_20step:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,96,96,96,96,96,96,96,96,96,96,96,96,96,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,112,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,64,64,64,64,64,64,64,64,64,64,64,64,224,224,224,224,224,224,224,224,224,224,224,224,224,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192,192,192,192,192,176,176,176,176,176,176,176,176,176,176,176,176,176,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,112,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,96,96,96,96,96,96,96,96,96,96,96,96,96,144,144,144,144,144,144,144,144,144,144,144,144,144,192,192,192,192,192,192,192,192,192,192,192,192,192,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,208,208,208,208,208,208,208,208,208,208,208,208,208,176,176,176,176,176,176,176,176,176,176,176,176,176,144,144,144,144,144,144,144,144,144,144,144,144,96,96,96,96,96,96,96,96,96,96,96,96,96,48,48,48,48,48,48,48,48,48,48,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255],blue:[0,0,0,0,0,0,0,0,0,0,0,0,0,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,128,176,176,176,176,176,176,176,176,176,176,176,176,176,192,192,192,192,192,192,192,192,192,192,192,192,192,224,224,224,224,224,224,224,224,224,224,224,224,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,64,64,64,64,64,64,64,64,64,64,64,64,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,64,64,64,64,64,64,64,64,64,64,64,64,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255]}};class m{r;g;b;constructor(e,t,n){this.r=e,this.g=t,this.b=n}}const p={r:0,g:0,b:0};function f(e,t){return null!==e&&null!==t&&void 0!==e&&void 0!==t&&e.r===t.r&&e.g===t.g&&e.b===t.b}function y(e){return function(e){return n=e,.001172549*(t={r:parseInt(n.substring(1,3),16),g:parseInt(n.substring(3,5),16),b:parseInt(n.substring(5,7),16)}).r+.002301961*t.g+447059e-9*t.b<.5;var t,n}(e)?"#fff":"#000"}function D(e){return{l:655.35*e.l,a:257*e.a+32896,b:257*e.b+32896}}const C={x:95.0489,y:100,z:108.884};function v(e){return function(e){function t(e){let t=null;return t=e>.008856452?Math.pow(e,.333333333):7.787037037*e+.137931034,t}const n=C,i=t(e.y/n.y);return{l:116*i-16,a:500*(t(e.x/n.x)-i),b:200*(i-t(e.z/n.z))}}(function(e){function t(e){let t=null;return t=e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),t}const n=t(e.r/255),i=t(e.g/255),r=t(e.b/255);return{x:100*(.4124*n+.3576*i+.1805*r),y:100*(.2126*n+.7152*i+.0722*r),z:100*(.0193*n+.1192*i+.9505*r)}}(e))}function I(e){const t={Yellow:"#ffff00",Red:"#ff0000",White:"#ffffff",Green:"#008000",Blue:"#0000ff",Lime:"#00ff00",Fuchsia:"#ff00ff",Black:"#000000"};let n="#ffff00";return void 0!==t[e]&&(n=t[e]),n}class T{#y;#D;#C;constructor(e,t,n){this.#y=e,this.#D=t,this.#C=n}getX(){return this.#y}getY(){return this.#D}getZ(){return this.#C}equals(e){return null!==e&&this.#y===e.getX()&&this.#D===e.getY()&&this.#C===e.getZ()}toString(){return"("+this.#y+", "+this.#D+", "+this.#C+")"}norm(){return Math.sqrt(this.#y*this.#y+this.#D*this.#D+this.#C*this.#C)}crossProduct(e){return new T(this.#D*e.getZ()-e.getY()*this.#C,this.#C*e.getX()-e.getZ()*this.#y,this.#y*e.getY()-e.getX()*this.#D)}dotProduct(e){return this.#y*e.getX()+this.#D*e.getY()+this.#C*e.getZ()}isCodirectional(e){return this.dotProduct(e)>0}}Number.EPSILON;const L=1e-4;function P(e,t,n){return void 0===n&&(n=Number.EPSILON),Math.abs(e-t)<n}class w{#e;#v;constructor(e){this.#e=e}get(e,t){return this.#e[3*e+t]}getInverse(){return void 0===this.#v&&(this.#v=function(e){const t=e.get(0,0),n=e.get(0,1),r=e.get(0,2),o=e.get(1,0),a=e.get(1,1),s=e.get(1,2),l=e.get(2,0),c=e.get(2,1),u=e.get(2,2),d=a*u-s*c,h=s*l-o*u,S=o*c-a*l;let g=t*d+n*h+r*S;if(0!==g)return g=1/g,new w([g*d,g*(r*c-n*u),g*(n*s-r*a),g*h,g*(t*u-r*l),g*(r*o-t*s),g*S,g*(n*l-t*c),g*(t*a-n*o)]);i.warn("Cannot invert 3*3 matrix with zero determinant.")}(this)),this.#v}equals(e,t){for(let n=0;n<3;++n)for(let i=0;i<3;++i)if(!P(this.get(n,i),e.get(n,i),t))return!1;return!0}toString(){let e="[";for(let t=0;t<3;++t){0!==t&&(e+=", \n ");for(let n=0;n<3;++n)0!==n&&(e+=", "),e+=this.get(t,n)}return e+="]",e}multiply(e){const t=[];for(let n=0;n<3;++n)for(let i=0;i<3;++i){let r=0;for(let t=0;t<3;++t)r+=this.get(n,t)*e.get(t,i);t.push(r)}return new w(t)}getAbs(){const e=[];for(let t=0;t<3;++t)for(let n=0;n<3;++n)e.push(Math.abs(this.get(t,n)));return new w(e)}multiplyArray3D(e){if(3!==e.length)throw new Error("Cannot multiply 3x3 matrix with non 3D array: "+e.length);const t=[];for(let n=0;n<3;++n){let i=0;for(let t=0;t<3;++t)i+=this.get(n,t)*e[t];t.push(i)}return t}multiplyVector3D(e){const t=this.multiplyArray3D([e.getX(),e.getY(),e.getZ()]);return new T(t[0],t[1],t[2])}multiplyPoint3D(e){const t=this.multiplyArray3D([e.getX(),e.getY(),e.getZ()]);return new x(t[0],t[1],t[2])}multiplyIndex3D(t){const n=this.multiplyArray3D(t.getValues());return new e(n)}getRowAbsMax(e){const t=[Math.abs(this.get(e,0)),Math.abs(this.get(e,1)),Math.abs(this.get(e,2))],n=Math.max.apply(null,t),i=t.indexOf(n);return{value:this.get(e,i),index:i}}getColAbsMax(e){const t=[Math.abs(this.get(0,e)),Math.abs(this.get(1,e)),Math.abs(this.get(2,e))],n=Math.max.apply(null,t),i=t.indexOf(n);return{value:this.get(i,e),index:i}}asOneAndZeros(){const e=[];for(let t=0;t<3;++t){const n=this.getRowAbsMax(t),i=n.value>0?1:-1;for(let t=0;t<3;++t)t===n.index?e.push(1*i):e.push(0)}return new w(e)}getThirdColMajorDirection(){return this.getColAbsMax(2).index}}function O(){return new w([1,0,0,0,1,0,0,0,1])}function A(e){return e.equals(O())}class b{#y;#D;constructor(e,t){this.#y=e,this.#D=t}getX(){return this.#y}getY(){return this.#D}equals(e){return null!=e&&this.#y===e.getX()&&this.#D===e.getY()}toString(){return"("+this.#y+", "+this.#D+")"}}class x{#y;#D;#C;constructor(e,t,n){this.#y=e,this.#D=t,this.#C=n}getX(){return this.#y}getY(){return this.#D}getZ(){return this.#C}equals(e){return null!==e&&this.#y===e.getX()&&this.#D===e.getY()&&this.#C===e.getZ()}isSimilar(e,t){return null!==e&&P(this.#y,e.getX(),t)&&P(this.#D,e.getY(),t)&&P(this.#C,e.getZ(),t)}toString(){return"("+this.#y+", "+this.#D+", "+this.#C+")"}getDistance(e){return Math.sqrt(this.#I(e))}#I(e){const t=this.#y-e.getX(),n=this.#D-e.getY(),i=this.#C-e.getZ();return t*t+n*n+i*i}getClosest(e){let t=0,n=this.#I(e[t]);for(let i=0;i<e.length;++i){const r=this.#I(e[i]);r<n&&(t=i,n=r)}return t}minus(e){return new T(this.#y-e.getX(),this.#D-e.getY(),this.#C-e.getZ())}}class R{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create point with no values.");if(0===e.length)throw new Error("Cannot create point with empty values.");if(!e.every((function(e){return!isNaN(e)})))throw new Error("Cannot create point with non number values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}canCompare(e){return!!e&&this.length()===e.length()}equals(e){if(!this.canCompare(e))return!1;for(let t=0,n=this.length();t<n;++t)if(this.get(t)!==e.get(t))return!1;return!0}compare(e){if(!this.canCompare(e))return null;const t=[];for(let n=0,i=this.length();n<i;++n)this.get(n)!==e.get(n)&&t.push(n);return t}get3D(){return new x(this.get(0),this.get(1),this.get(2))}add(e){if(!this.canCompare(e))return null;const t=[],n=this.getValues(),i=e.getValues();for(let e=0;e<n.length;++e)t.push(n[e]+i[e]);return new R(t)}mergeWith3D(e){const t=this.getValues();return t[0]=e.getX(),t[1]=e.getY(),t[2]=e.getZ(),new R(t)}}function F(e,t,n){if(null==e||null==t)return!1;const i=n>0?0|n:0;return e.substring(i,i+t.length)===t}function E(e,t){return null!=e&&null!=t&&e.substring(e.length-t.length)===t}function q(e){const t=[];if(null==e)return t;const n=/{(\w+)}/g;let i=n.exec(e);for(;i;)t.push(i[1]),i=n.exec(e);return t}function U(e,t){let n="";if(null==e)return n;if(n=e,null==t)return n;const i=q(e);for(let e=0;e<i.length;++e){const r=t[i[e]];if(null!=r&&null!==r.value&&void 0!==r.value){let t=r.value.toPrecision(4);null!==r.unit&&void 0!==r.unit&&0!==r.unit.length&&("degree"!==r.unit&&(t+=" "),t+=r.unit);const o="{"+i[e]+"}";n=n.replace(o,t)}}return n}function M(e){let t=null;if(null!=e&&"."!==e[0]){const n=e.toLowerCase().split(".");1!==n.length&&(t=n.pop(),/[a-z]/.test(t)&&!t.includes("/")||(t=null))}return t}function Q(e){const t=new Uint8Array(e.length);for(let n=0,i=e.length;n<i;n++)t[n]=e.charCodeAt(n);return t}function B(e,t){const n=Math.pow(10,t),i=.01/n;return Math.round(e*n+i)/n}function N(e,t){return null!==e&&null!==t&&void 0!==e&&void 0!==t&&V(e.slice().sort(),t.slice().sort())}function V(e,t){return null!==e&&null!==t&&void 0!==e&&void 0!==t&&e.length===t.length&&e.every((function(e,n){return e===t[n]}))}function G(e){return String.fromCharCode.apply(String,e)}function k(e,t,n,i){(void 0===n||n<0||n>=e.length)&&(n=0),(void 0===i||i<=n||i>e.length)&&(i=e.length);for(let r=n;r<i;++r)if(t(e[r],r,e))return r}function H(e){return function(t,n,i){for(let t=0;t<e.length;++t)if(i[n+t]!==e[t])return!1;return!0}}function z(e,t){const n="\r\n";let i=0;const r=[];for(let o=0;o<e.length;++o){let a="";0!==o&&(a+=n),a+="--"+t+n;const s=Object.keys(e[o]);for(let t=0;t<s.length;++t){const i=s[t];"data"!==i&&(a+=i+": "+e[o][i]+n)}a+=n;const l=Q(a);r.push(l),i+=l.byteLength+e[o].data.byteLength}const o=Q("\r\n--"+t+"--"+n),a=new Uint8Array(i+o.byteLength);let s=0;for(let t=0;t<e.length;++t)a.set(r[t],s),s+=r[t].byteLength,a.set(new Uint8Array(e[t].data),s),s+=e[t].data.byteLength;return a.set(o,s),a}const W={"0000":{"0000":["UL","1","CommandGroupLength"],"0001":["UL","1","CommandLengthToEnd"],"0002":["UI","1","AffectedSOPClassUID"],"0003":["UI","1","RequestedSOPClassUID"],"0010":["SH","1","CommandRecognitionCode"],"0100":["US","1","CommandField"],"0110":["US","1","MessageID"],"0120":["US","1","MessageIDBeingRespondedTo"],"0200":["AE","1","Initiator"],"0300":["AE","1","Receiver"],"0400":["AE","1","FindLocation"],"0600":["AE","1","MoveDestination"],"0700":["US","1","Priority"],"0800":["US","1","CommandDataSetType"],"0850":["US","1","NumberOfMatches"],"0860":["US","1","ResponseSequenceNumber"],"0900":["US","1","Status"],"0901":["AT","1-n","OffendingElement"],"0902":["LO","1","ErrorComment"],"0903":["US","1","ErrorID"],1e3:["UI","1","AffectedSOPInstanceUID"],1001:["UI","1","RequestedSOPInstanceUID"],1002:["US","1","EventTypeID"],1005:["AT","1-n","AttributeIdentifierList"],1008:["US","1","ActionTypeID"],1020:["US","1","NumberOfRemainingSuboperations"],1021:["US","1","NumberOfCompletedSuboperations"],1022:["US","1","NumberOfFailedSuboperations"],1023:["US","1","NumberOfWarningSuboperations"],1030:["AE","1","MoveOriginatorApplicationEntityTitle"],1031:["US","1","MoveOriginatorMessageID"],4e3:["LT","1","DialogReceiver"],4010:["LT","1","TerminalType"],5010:["SH","1","MessageSetID"],5020:["SH","1","EndMessageID"],5110:["LT","1","DisplayFormat"],5120:["LT","1","PagePositionID"],5130:["CS","1","TextFormatID"],5140:["CS","1","NormalReverse"],5150:["CS","1","AddGrayScale"],5160:["CS","1","Borders"],5170:["IS","1","Copies"],5180:["CS","1","CommandMagnificationType"],5190:["CS","1","Erase"],"51A0":["CS","1","Print"],"51B0":["US","1-n","Overlays"]},"0002":{"0000":["UL","1","FileMetaInformationGroupLength"],"0001":["OB","1","FileMetaInformationVersion"],"0002":["UI","1","MediaStorageSOPClassUID"],"0003":["UI","1","MediaStorageSOPInstanceUID"],"0010":["UI","1","TransferSyntaxUID"],"0012":["UI","1","ImplementationClassUID"],"0013":["SH","1","ImplementationVersionName"],"0016":["AE","1","SourceApplicationEntityTitle"],"0017":["AE","1","SendingApplicationEntityTitle"],"0018":["AE","1","ReceivingApplicationEntityTitle"],"0026":["UR","1","SourcePresentationAddress"],"0027":["UR","1","SendingPresentationAddress"],"0028":["UR","1","ReceivingPresentationAddress"],"0031":["OB","1","RTVMetaInformationVersion"],"0032":["UI","1","RTVCommunicationSOPClassUID"],"0033":["UI","1","RTVCommunicationSOPInstanceUID"],"0035":["OB","1","RTVSourceIdentifier"],"0036":["OB","1","RTVFlowIdentifier"],"0037":["UL","1","RTVFlowRTPSamplingRate"],"0038":["FD","1","RTVFlowActualFrameDuration"],"0100":["UI","1","PrivateInformationCreatorUID"],"0102":["OB","1","PrivateInformation"]},"0004":{"0000":["UL","1","GenericGroupLength"],1130:["CS","1","FileSetID"],1141:["CS","1-8","FileSetDescriptorFileID"],1142:["CS","1","SpecificCharacterSetOfFileSetDescriptorFile"],1200:["UL","1","OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity"],1202:["UL","1","OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity"],1212:["US","1","FileSetConsistencyFlag"],1220:["SQ","1","DirectoryRecordSequence"],1400:["UL","1","OffsetOfTheNextDirectoryRecord"],1410:["US","1","RecordInUseFlag"],1420:["UL","1","OffsetOfReferencedLowerLevelDirectoryEntity"],1430:["CS","1","DirectoryRecordType"],1432:["UI","1","PrivateRecordUID"],1500:["CS","1-8","ReferencedFileID"],1504:["UL","1","MRDRDirectoryRecordOffset"],1510:["UI","1","ReferencedSOPClassUIDInFile"],1511:["UI","1","ReferencedSOPInstanceUIDInFile"],1512:["UI","1","ReferencedTransferSyntaxUIDInFile"],"151A":["UI","1-n","ReferencedRelatedGeneralSOPClassUIDInFile"],1600:["UL","1","NumberOfReferences"]},"0008":{"0000":["UL","1","GenericGroupLength"],"0001":["UL","1","LengthToEnd"],"0005":["CS","1-n","SpecificCharacterSet"],"0006":["SQ","1","LanguageCodeSequence"],"0008":["CS","2-n","ImageType"],"0010":["SH","1","RecognitionCode"],"0012":["DA","1","InstanceCreationDate"],"0013":["TM","1","InstanceCreationTime"],"0014":["UI","1","InstanceCreatorUID"],"0015":["DT","1","InstanceCoercionDateTime"],"0016":["UI","1","SOPClassUID"],"0018":["UI","1","SOPInstanceUID"],"001A":["UI","1-n","RelatedGeneralSOPClassUID"],"001B":["UI","1","OriginalSpecializedSOPClassUID"],"0020":["DA","1","StudyDate"],"0021":["DA","1","SeriesDate"],"0022":["DA","1","AcquisitionDate"],"0023":["DA","1","ContentDate"],"0024":["DA","1","OverlayDate"],"0025":["DA","1","CurveDate"],"002A":["DT","1","AcquisitionDateTime"],"0030":["TM","1","StudyTime"],"0031":["TM","1","SeriesTime"],"0032":["TM","1","AcquisitionTime"],"0033":["TM","1","ContentTime"],"0034":["TM","1","OverlayTime"],"0035":["TM","1","CurveTime"],"0040":["US","1","DataSetType"],"0041":["LO","1","DataSetSubtype"],"0042":["CS","1","NuclearMedicineSeriesType"],"0050":["SH","1","AccessionNumber"],"0051":["SQ","1","IssuerOfAccessionNumberSequence"],"0052":["CS","1","QueryRetrieveLevel"],"0053":["CS","1","QueryRetrieveView"],"0054":["AE","1-n","RetrieveAETitle"],"0055":["AE","1","StationAETitle"],"0056":["CS","1","InstanceAvailability"],"0058":["UI","1-n","FailedSOPInstanceUIDList"],"0060":["CS","1","Modality"],"0061":["CS","1-n","ModalitiesInStudy"],"0062":["UI","1-n","SOPClassesInStudy"],"0063":["SQ","1","AnatomicRegionsInStudyCodeSequence"],"0064":["CS","1","ConversionType"],"0068":["CS","1","PresentationIntentType"],"0070":["LO","1","Manufacturer"],"0080":["LO","1","InstitutionName"],"0081":["ST","1","InstitutionAddress"],"0082":["SQ","1","InstitutionCodeSequence"],"0090":["PN","1","ReferringPhysicianName"],"0092":["ST","1","ReferringPhysicianAddress"],"0094":["SH","1-n","ReferringPhysicianTelephoneNumbers"],"0096":["SQ","1","ReferringPhysicianIdentificationSequence"],"009C":["PN","1-n","ConsultingPhysicianName"],"009D":["SQ","1","ConsultingPhysicianIdentificationSequence"],"0100":["SH","1","CodeValue"],"0101":["LO","1","ExtendedCodeValue"],"0102":["SH","1","CodingSchemeDesignator"],"0103":["SH","1","CodingSchemeVersion"],"0104":["LO","1","CodeMeaning"],"0105":["CS","1","MappingResource"],"0106":["DT","1","ContextGroupVersion"],"0107":["DT","1","ContextGroupLocalVersion"],"0108":["LT","1","ExtendedCodeMeaning"],"0109":["SQ","1","CodingSchemeResourcesSequence"],"010A":["CS","1","CodingSchemeURLType"],"010B":["CS","1","ContextGroupExtensionFlag"],"010C":["UI","1","CodingSchemeUID"],"010D":["UI","1","ContextGroupExtensionCreatorUID"],"010E":["UR","1","CodingSchemeURL"],"010F":["CS","1","ContextIdentifier"],"0110":["SQ","1","CodingSchemeIdentificationSequence"],"0112":["LO","1","CodingSchemeRegistry"],"0114":["ST","1","CodingSchemeExternalID"],"0115":["ST","1","CodingSchemeName"],"0116":["ST","1","CodingSchemeResponsibleOrganization"],"0117":["UI","1","ContextUID"],"0118":["UI","1","MappingResourceUID"],"0119":["UC","1","LongCodeValue"],"0120":["UR","1","URNCodeValue"],"0121":["SQ","1","EquivalentCodeSequence"],"0122":["LO","1","MappingResourceName"],"0123":["SQ","1","ContextGroupIdentificationSequence"],"0124":["SQ","1","MappingResourceIdentificationSequence"],"0201":["SH","1","TimezoneOffsetFromUTC"],"0202":["","",""],"0220":["SQ","1","ResponsibleGroupCodeSequence"],"0221":["CS","1","EquipmentModality"],"0222":["LO","1","ManufacturerRelatedModelGroup"],"0300":["SQ","1","PrivateDataElementCharacteristicsSequence"],"0301":["US","1","PrivateGroupReference"],"0302":["LO","1","PrivateCreatorReference"],"0303":["CS","1","BlockIdentifyingInformationStatus"],"0304":["US","1-n","NonidentifyingPrivateElements"],"0305":["SQ","1","DeidentificationActionSequence"],"0306":["US","1-n","IdentifyingPrivateElements"],"0307":["CS","1","DeidentificationAction"],"0308":["US","1","PrivateDataElement"],"0309":["UL","1-3","PrivateDataElementValueMultiplicity"],"030A":["CS","1","PrivateDataElementValueRepresentation"],"030B":["UL","1-2","PrivateDataElementNumberOfItems"],"030C":["UC","1","PrivateDataElementName"],"030D":["UC","1","PrivateDataElementKeyword"],"030E":["UT","1","PrivateDataElementDescription"],"030F":["UT","1","PrivateDataElementEncoding"],"0310":["SQ","1","PrivateDataElementDefinitionSequence"],1e3:["AE","1","NetworkID"],1010:["SH","1","StationName"],1030:["LO","1","StudyDescription"],1032:["SQ","1","ProcedureCodeSequence"],"103E":["LO","1","SeriesDescription"],"103F":["SQ","1","SeriesDescriptionCodeSequence"],1040:["LO","1","InstitutionalDepartmentName"],1041:["SQ","1","InstitutionalDepartmentTypeCodeSequence"],1048:["PN","1-n","PhysiciansOfRecord"],1049:["SQ","1","PhysiciansOfRecordIdentificationSequence"],1050:["PN","1-n","PerformingPhysicianName"],1052:["SQ","1","PerformingPhysicianIdentificationSequence"],1060:["PN","1-n","NameOfPhysiciansReadingStudy"],1062:["SQ","1","PhysiciansReadingStudyIdentificationSequence"],1070:["PN","1-n","OperatorsName"],1072:["SQ","1","OperatorIdentificationSequence"],1080:["LO","1-n","AdmittingDiagnosesDescription"],1084:["SQ","1","AdmittingDiagnosesCodeSequence"],1090:["LO","1","ManufacturerModelName"],1100:["SQ","1","ReferencedResultsSequence"],1110:["SQ","1","ReferencedStudySequence"],1111:["SQ","1","ReferencedPerformedProcedureStepSequence"],1115:["SQ","1","ReferencedSeriesSequence"],1120:["SQ","1","ReferencedPatientSequence"],1125:["SQ","1","ReferencedVisitSequence"],1130:["SQ","1","ReferencedOverlaySequence"],1134:["SQ","1","ReferencedStereometricInstanceSequence"],"113A":["SQ","1","ReferencedWaveformSequence"],1140:["SQ","1","ReferencedImageSequence"],1145:["SQ","1","ReferencedCurveSequence"],"114A":["SQ","1","ReferencedInstanceSequence"],"114B":["SQ","1","ReferencedRealWorldValueMappingInstanceSequence"],1150:["UI","1","ReferencedSOPClassUID"],1155:["UI","1","ReferencedSOPInstanceUID"],1156:["SQ","1","DefinitionSourceSequence"],"115A":["UI","1-n","SOPClassesSupported"],1160:["IS","1-n","ReferencedFrameNumber"],1161:["UL","1-n","SimpleFrameList"],1162:["UL","3-3n","CalculatedFrameList"],1163:["FD","2","TimeRange"],1164:["SQ","1","FrameExtractionSequence"],1167:["UI","1","MultiFrameSourceSOPInstanceUID"],1190:["UR","1","RetrieveURL"],1195:["UI","1","TransactionUID"],1196:["US","1","WarningReason"],1197:["US","1","FailureReason"],1198:["SQ","1","FailedSOPSequence"],1199:["SQ","1","ReferencedSOPSequence"],"119A":["SQ","1","OtherFailuresSequence"],1200:["SQ","1","StudiesContainingOtherReferencedInstancesSequence"],1250:["SQ","1","RelatedSeriesSequence"],2110:["CS","1","LossyImageCompressionRetired"],2111:["ST","1","DerivationDescription"],2112:["SQ","1","SourceImageSequence"],2120:["SH","1","StageName"],2122:["IS","1","StageNumber"],2124:["IS","1","NumberOfStages"],2127:["SH","1","ViewName"],2128:["IS","1","ViewNumber"],2129:["IS","1","NumberOfEventTimers"],"212A":["IS","1","NumberOfViewsInStage"],2130:["DS","1-n","EventElapsedTimes"],2132:["LO","1-n","EventTimerNames"],2133:["SQ","1","EventTimerSequence"],2134:["FD","1","EventTimeOffset"],2135:["SQ","1","EventCodeSequence"],2142:["IS","1","StartTrim"],2143:["IS","1","StopTrim"],2144:["IS","1","RecommendedDisplayFrameRate"],2200:["CS","1","TransducerPosition"],2204:["CS","1","TransducerOrientation"],2208:["CS","1","AnatomicStructure"],2218:["SQ","1","AnatomicRegionSequence"],2220:["SQ","1","AnatomicRegionModifierSequence"],2228:["SQ","1","PrimaryAnatomicStructureSequence"],2229:["SQ","1","AnatomicStructureSpaceOrRegionSequence"],2230:["SQ","1","PrimaryAnatomicStructureModifierSequence"],2240:["SQ","1","TransducerPositionSequence"],2242:["SQ","1","TransducerPositionModifierSequence"],2244:["SQ","1","TransducerOrientationSequence"],2246:["SQ","1","TransducerOrientationModifierSequence"],2251:["SQ","1","AnatomicStructureSpaceOrRegionCodeSequenceTrial"],2253:["SQ","1","AnatomicPortalOfEntranceCodeSequenceTrial"],2255:["SQ","1","AnatomicApproachDirectionCodeSequenceTrial"],2256:["ST","1","AnatomicPerspectiveDescriptionTrial"],2257:["SQ","1","AnatomicPerspectiveCodeSequenceTrial"],2258:["ST","1","AnatomicLocationOfExaminingInstrumentDescriptionTrial"],2259:["SQ","1","AnatomicLocationOfExaminingInstrumentCodeSequenceTrial"],"225A":["SQ","1","AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial"],"225C":["SQ","1","OnAxisBackgroundAnatomicStructureCodeSequenceTrial"],3001:["SQ","1","AlternateRepresentationSequence"],3002:["UI","1-n","AvailableTransferSyntaxUID"],3010:["UI","1-n","IrradiationEventUID"],3011:["SQ","1","SourceIrradiationEventSequence"],3012:["UI","1","RadiopharmaceuticalAdministrationEventUID"],4e3:["LT","1","IdentifyingComments"],9007:["CS","4","FrameType"],9092:["SQ","1","ReferencedImageEvidenceSequence"],9121:["SQ","1","ReferencedRawDataSequence"],9123:["UI","1","CreatorVersionUID"],9124:["SQ","1","DerivationImageSequence"],9154:["SQ","1","SourceImageEvidenceSequence"],9205:["CS","1","PixelPresentation"],9206:["CS","1","VolumetricProperties"],9207:["CS","1","VolumeBasedCalculationTechnique"],9208:["CS","1","ComplexImageComponent"],9209:["CS","1","AcquisitionContrast"],9215:["SQ","1","DerivationCodeSequence"],9237:["SQ","1","ReferencedPresentationStateSequence"],9410:["SQ","1","ReferencedOtherPlaneSequence"],9458:["SQ","1","FrameDisplaySequence"],9459:["FL","1","RecommendedDisplayFrameRateInFloat"],9460:["CS","1","SkipFrameRangeFlag"]},"0010":{"0000":["UL","1","GenericGroupLength"],"0010":["PN","1","PatientName"],"0020":["LO","1","PatientID"],"0021":["LO","1","IssuerOfPatientID"],"0022":["CS","1","TypeOfPatientID"],"0024":["SQ","1","IssuerOfPatientIDQualifiersSequence"],"0026":["SQ","1","SourcePatientGroupIdentificationSequence"],"0027":["SQ","1","GroupOfPatientsIdentificationSequence"],"0028":["US","3","SubjectRelativePositionInImage"],"0030":["DA","1","PatientBirthDate"],"0032":["TM","1","PatientBirthTime"],"0033":["LO","1","PatientBirthDateInAlternativeCalendar"],"0034":["LO","1","PatientDeathDateInAlternativeCalendar"],"0035":["CS","1","PatientAlternativeCalendar"],"0040":["CS","1","PatientSex"],"0050":["SQ","1","PatientInsurancePlanCodeSequence"],"0101":["SQ","1","PatientPrimaryLanguageCodeSequence"],"0102":["SQ","1","PatientPrimaryLanguageModifierCodeSequence"],"0200":["CS","1","QualityControlSubject"],"0201":["SQ","1","QualityControlSubjectTypeCodeSequence"],"0212":["UC","1","StrainDescription"],"0213":["LO","1","StrainNomenclature"],"0214":["LO","1","StrainStockNumber"],"0215":["SQ","1","StrainSourceRegistryCodeSequence"],"0216":["SQ","1","StrainStockSequence"],"0217":["LO","1","StrainSource"],"0218":["UT","1","StrainAdditionalInformation"],"0219":["SQ","1","StrainCodeSequence"],"0221":["SQ","1","GeneticModificationsSequence"],"0222":["UC","1","GeneticModificationsDescription"],"0223":["LO","1","GeneticModificationsNomenclature"],"0229":["SQ","1","GeneticModificationsCodeSequence"],1e3:["LO","1-n","OtherPatientIDs"],1001:["PN","1-n","OtherPatientNames"],1002:["SQ","1","OtherPatientIDsSequence"],1005:["PN","1","PatientBirthName"],1010:["AS","1","PatientAge"],1020:["DS","1","PatientSize"],1021:["SQ","1","PatientSizeCodeSequence"],1022:["DS","1","PatientBodyMassIndex"],1023:["DS","1","MeasuredAPDimension"],1024:["DS","1","MeasuredLateralDimension"],1030:["DS","1","PatientWeight"],1040:["LO","1","PatientAddress"],1050:["LO","1-n","InsurancePlanIdentification"],1060:["PN","1","PatientMotherBirthName"],1080:["LO","1","MilitaryRank"],1081:["LO","1","BranchOfService"],1090:["LO","1","MedicalRecordLocator"],1100:["SQ","1","ReferencedPatientPhotoSequence"],2e3:["LO","1-n","MedicalAlerts"],2110:["LO","1-n","Allergies"],2150:["LO","1","CountryOfResidence"],2152:["LO","1","RegionOfResidence"],2154:["SH","1-n","PatientTelephoneNumbers"],2155:["LT","1","PatientTelecomInformation"],2160:["SH","1","EthnicGroup"],2180:["SH","1","Occupation"],"21A0":["CS","1","SmokingStatus"],"21B0":["LT","1","AdditionalPatientHistory"],"21C0":["US","1","PregnancyStatus"],"21D0":["DA","1","LastMenstrualDate"],"21F0":["LO","1","PatientReligiousPreference"],2201:["LO","1","PatientSpeciesDescription"],2202:["SQ","1","PatientSpeciesCodeSequence"],2203:["CS","1","PatientSexNeutered"],2210:["CS","1","AnatomicalOrientationType"],2292:["LO","1","PatientBreedDescription"],2293:["SQ","1","PatientBreedCodeSequence"],2294:["SQ","1","BreedRegistrationSequence"],2295:["LO","1","BreedRegistrationNumber"],2296:["SQ","1","BreedRegistryCodeSequence"],2297:["PN","1","ResponsiblePerson"],2298:["CS","1","ResponsiblePersonRole"],2299:["LO","1","ResponsibleOrganization"],4e3:["LT","1","PatientComments"],9431:["FL","1","ExaminedBodyThickness"]},"0012":{"0000":["UL","1","GenericGroupLength"],"0010":["LO","1","ClinicalTrialSponsorName"],"0020":["LO","1","ClinicalTrialProtocolID"],"0021":["LO","1","ClinicalTrialProtocolName"],"0030":["LO","1","ClinicalTrialSiteID"],"0031":["LO","1","ClinicalTrialSiteName"],"0040":["LO","1","ClinicalTrialSubjectID"],"0042":["LO","1","ClinicalTrialSubjectReadingID"],"0050":["LO","1","ClinicalTrialTimePointID"],"0051":["ST","1","ClinicalTrialTimePointDescription"],"0052":["FD","1","LongitudinalTemporalOffsetFromEvent"],"0053":["CS","1","LongitudinalTemporalEventType"],"0060":["LO","1","ClinicalTrialCoordinatingCenterName"],"0062":["CS","1","PatientIdentityRemoved"],"0063":["LO","1-n","DeidentificationMethod"],"0064":["SQ","1","DeidentificationMethodCodeSequence"],"0071":["LO","1","ClinicalTrialSeriesID"],"0072":["LO","1","ClinicalTrialSeriesDescription"],"0081":["LO","1","ClinicalTrialProtocolEthicsCommitteeName"],"0082":["LO","1","ClinicalTrialProtocolEthicsCommitteeApprovalNumber"],"0083":["SQ","1","ConsentForClinicalTrialUseSequence"],"0084":["CS","1","DistributionType"],"0085":["CS","1","ConsentForDistributionFlag"],"0086":["DA","1","EthicsCommitteeApprovalEffectivenessStartDate"],"0087":["DA","1","EthicsCommitteeApprovalEffectivenessEndDate"]},"0014":{"0000":["UL","1","GenericGroupLength"],"0023":["ST","1","CADFileFormat"],"0024":["ST","1","ComponentReferenceSystem"],"0025":["ST","1","ComponentManufacturingProcedure"],"0028":["ST","1","ComponentManufacturer"],"0030":["DS","1-n","MaterialThickness"],"0032":["DS","1-n","MaterialPipeDiameter"],"0034":["DS","1-n","MaterialIsolationDiameter"],"0042":["ST","1","MaterialGrade"],"0044":["ST","1","MaterialPropertiesDescription"],"0045":["ST","1","MaterialPropertiesFileFormatRetired"],"0046":["LT","1","MaterialNotes"],"0050":["CS","1","ComponentShape"],"0052":["CS","1","CurvatureType"],"0054":["DS","1","OuterDiameter"],"0056":["DS","1","InnerDiameter"],"0100":["LO","1-n","ComponentWelderIDs"],"0101":["CS","1","SecondaryApprovalStatus"],"0102":["DA","1","SecondaryReviewDate"],"0103":["TM","1","SecondaryReviewTime"],"0104":["PN","1","SecondaryReviewerName"],"0105":["ST","1","RepairID"],"0106":["SQ","1","MultipleComponentApprovalSequence"],"0107":["CS","1-n","OtherApprovalStatus"],"0108":["CS","1-n","OtherSecondaryApprovalStatus"],1010:["ST","1","ActualEnvironmentalConditions"],1020:["DA","1","ExpiryDate"],1040:["ST","1","EnvironmentalConditions"],2002:["SQ","1","EvaluatorSequence"],2004:["IS","1","EvaluatorNumber"],2006:["PN","1","EvaluatorName"],2008:["IS","1","EvaluationAttempt"],2012:["SQ","1","IndicationSequence"],2014:["IS","1","IndicationNumber"],2016:["SH","1","IndicationLabel"],2018:["ST","1","IndicationDescription"],"201A":["CS","1-n","IndicationType"],"201C":["CS","1","IndicationDisposition"],"201E":["SQ","1","IndicationROISequence"],2030:["SQ","1","IndicationPhysicalPropertySequence"],2032:["SH","1","PropertyLabel"],2202:["IS","1","CoordinateSystemNumberOfAxes"],2204:["SQ","1","CoordinateSystemAxesSequence"],2206:["ST","1","CoordinateSystemAxisDescription"],2208:["CS","1","CoordinateSystemDataSetMapping"],"220A":["IS","1","CoordinateSystemAxisNumber"],"220C":["CS","1","CoordinateSystemAxisType"],"220E":["CS","1","CoordinateSystemAxisUnits"],2210:["OB","1","CoordinateSystemAxisValues"],2220:["SQ","1","CoordinateSystemTransformSequence"],2222:["ST","1","TransformDescription"],2224:["IS","1","TransformNumberOfAxes"],2226:["IS","1-n","TransformOrderOfAxes"],2228:["CS","1","TransformedAxisUnits"],"222A":["DS","1-n","CoordinateSystemTransformRotationAndScaleMatrix"],"222C":["DS","1-n","CoordinateSystemTransformTranslationMatrix"],3011:["DS","1","InternalDetectorFrameTime"],3012:["DS","1","NumberOfFramesIntegrated"],3020:["SQ","1","DetectorTemperatureSequence"],3022:["ST","1","SensorName"],3024:["DS","1","HorizontalOffsetOfSensor"],3026:["DS","1","VerticalOffsetOfSensor"],3028:["DS","1","SensorTemperature"],3040:["SQ","1","DarkCurrentSequence"],3050:["ox","1","DarkCurrentCounts"],3060:["SQ","1","GainCorrectionReferenceSequence"],3070:["ox","1","AirCounts"],3071:["DS","1","KVUsedInGainCalibration"],3072:["DS","1","MAUsedInGainCalibration"],3073:["DS","1","NumberOfFramesUsedForIntegration"],3074:["LO","1","FilterMaterialUsedInGainCalibration"],3075:["DS","1","FilterThicknessUsedInGainCalibration"],3076:["DA","1","DateOfGainCalibration"],3077:["TM","1","TimeOfGainCalibration"],3080:["OB","1","BadPixelImage"],3099:["LT","1","CalibrationNotes"],3100:["LT","1","LinearityCorrectionTechnique"],3101:["LT","1","BeamHardeningCorrectionTechnique"],4002:["SQ","1","PulserEquipmentSequence"],4004:["CS","1","PulserType"],4006:["LT","1","PulserNotes"],4008:["SQ","1","ReceiverEquipmentSequence"],"400A":["CS","1","AmplifierType"],"400C":["LT","1","ReceiverNotes"],"400E":["SQ","1","PreAmplifierEquipmentSequence"],"400F":["LT","1","PreAmplifierNotes"],4010:["SQ","1","TransmitTransducerSequence"],4011:["SQ","1","ReceiveTransducerSequence"],4012:["US","1","NumberOfElements"],4013:["CS","1","ElementShape"],4014:["DS","1","ElementDimensionA"],4015:["DS","1","ElementDimensionB"],4016:["DS","1","ElementPitchA"],4017:["DS","1","MeasuredBeamDimensionA"],4018:["DS","1","MeasuredBeamDimensionB"],4019:["DS","1","LocationOfMeasuredBeamDiameter"],"401A":["DS","1","NominalFrequency"],"401B":["DS","1","MeasuredCenterFrequency"],"401C":["DS","1","MeasuredBandwidth"],"401D":["DS","1","ElementPitchB"],4020:["SQ","1","PulserSettingsSequence"],4022:["DS","1","PulseWidth"],4024:["DS","1","ExcitationFrequency"],4026:["CS","1","ModulationType"],4028:["DS","1","Damping"],4030:["SQ","1","ReceiverSettingsSequence"],4031:["DS","1","AcquiredSoundpathLength"],4032:["CS","1","AcquisitionCompressionType"],4033:["IS","1","AcquisitionSampleSize"],4034:["DS","1","RectifierSmoothing"],4035:["SQ","1","DACSequence"],4036:["CS","1","DACType"],4038:["DS","1-n","DACGainPoints"],"403A":["DS","1-n","DACTimePoints"],"403C":["DS","1-n","DACAmplitude"],4040:["SQ","1","PreAmplifierSettingsSequence"],4050:["SQ","1","TransmitTransducerSettingsSequence"],4051:["SQ","1","ReceiveTransducerSettingsSequence"],4052:["DS","1","IncidentAngle"],4054:["ST","1","CouplingTechnique"],4056:["ST","1","CouplingMedium"],4057:["DS","1","CouplingVelocity"],4058:["DS","1","ProbeCenterLocationX"],4059:["DS","1","ProbeCenterLocationZ"],"405A":["DS","1","SoundPathLength"],"405C":["ST","1","DelayLawIdentifier"],4060:["SQ","1","GateSettingsSequence"],4062:["DS","1","GateThreshold"],4064:["DS","1","VelocityOfSound"],4070:["SQ","1","CalibrationSettingsSequence"],4072:["ST","1","CalibrationProcedure"],4074:["SH","1","ProcedureVersion"],4076:["DA","1","ProcedureCreationDate"],4078:["DA","1","ProcedureExpirationDate"],"407A":["DA","1","ProcedureLastModifiedDate"],"407C":["TM","1-n","CalibrationTime"],"407E":["DA","1-n","CalibrationDate"],4080:["SQ","1","ProbeDriveEquipmentSequence"],4081:["CS","1","DriveType"],4082:["LT","1","ProbeDriveNotes"],4083:["SQ","1","DriveProbeSequence"],4084:["DS","1","ProbeInductance"],4085:["DS","1","ProbeResistance"],4086:["SQ","1","ReceiveProbeSequence"],4087:["SQ","1","ProbeDriveSettingsSequence"],4088:["DS","1","BridgeResistors"],4089:["DS","1","ProbeOrientationAngle"],"408B":["DS","1","UserSelectedGainY"],"408C":["DS","1","UserSelectedPhase"],"408D":["DS","1","UserSelectedOffsetX"],"408E":["DS","1","UserSelectedOffsetY"],4091:["SQ","1","ChannelSettingsSequence"],4092:["DS","1","ChannelThreshold"],"409A":["SQ","1","ScannerSettingsSequence"],"409B":["ST","1","ScanProcedure"],"409C":["DS","1","TranslationRateX"],"409D":["DS","1","TranslationRateY"],"409F":["DS","1","ChannelOverlap"],"40A0":["LO","1-n","ImageQualityIndicatorType"],"40A1":["LO","1-n","ImageQualityIndicatorMaterial"],"40A2":["LO","1-n","ImageQualityIndicatorSize"],5002:["IS","1","LINACEnergy"],5004:["IS","1","LINACOutput"],5100:["US","1","ActiveAperture"],5101:["DS","1","TotalAperture"],5102:["DS","1","ApertureElevation"],5103:["DS","1","MainLobeAngle"],5104:["DS","1","MainRoofAngle"],5105:["CS","1","ConnectorType"],5106:["SH","1","WedgeModelNumber"],5107:["DS","1","WedgeAngleFloat"],5108:["DS","1","WedgeRoofAngle"],5109:["CS","1","WedgeElement1Position"],"510A":["DS","1","WedgeMaterialVelocity"],"510B":["SH","1","WedgeMaterial"],"510C":["DS","1","WedgeOffsetZ"],"510D":["DS","1","WedgeOriginOffsetX"],"510E":["DS","1","WedgeTimeDelay"],"510F":["SH","1","WedgeName"],5110:["SH","1","WedgeManufacturerName"],5111:["LO","1","WedgeDescription"],5112:["DS","1","NominalBeamAngle"],5113:["DS","1","WedgeOffsetX"],5114:["DS","1","WedgeOffsetY"],5115:["DS","1","WedgeTotalLength"],5116:["DS","1","WedgeInContactLength"],5117:["DS","1","WedgeFrontGap"],5118:["DS","1","WedgeTotalHeight"],5119:["DS","1","WedgeFrontHeight"],"511A":["DS","1","WedgeRearHeight"],"511B":["DS","1","WedgeTotalWidth"],"511C":["DS","1","WedgeInContactWidth"],"511D":["DS","1","WedgeChamferHeight"],"511E":["CS","1","WedgeCurve"],"511F":["DS","1","RadiusAlongWedge"]},"0016":{"0000":["UL","1","GenericGroupLength"],"0001":["DS","1","WhitePoint"],"0002":["DS","3","PrimaryChromaticities"],"0003":["UT","1","BatteryLevel"],"0004":["DS","1","ExposureTimeInSeconds"],"0005":["DS","1","FNumber"],"0006":["IS","1","OECFRows"],"0007":["IS","1","OECFColumns"],"0008":["UC","1-n","OECFColumnNames"],"0009":["DS","1-n","OECFValues"],"000A":["IS","1","SpatialFrequencyResponseRows"],"000B":["IS","1","SpatialFrequencyResponseColumns"],"000C":["UC","1-n","SpatialFrequencyResponseColumnNames"],"000D":["DS","1-n","SpatialFrequencyResponseValues"],"000E":["IS","1","ColorFilterArrayPatternRows"],"000F":["IS","1","ColorFilterArrayPatternColumns"],"0010":["DS","1-n","ColorFilterArrayPatternValues"],"0011":["US","1","FlashFiringStatus"],"0012":["US","1","FlashReturnStatus"],"0013":["US","1","FlashMode"],"0014":["US","1","FlashFunctionPresent"],"0015":["US","1","FlashRedEyeMode"],"0016":["US","1","ExposureProgram"],"0017":["UT","1","SpectralSensitivity"],"0018":["IS","1","PhotographicSensitivity"],"0019":["IS","1","SelfTimerMode"],"001A":["US","1","SensitivityType"],"001B":["IS","1","StandardOutputSensitivity"],"001C":["IS","1","RecommendedExposureIndex"],"001D":["IS","1","ISOSpeed"],"001E":["IS","1","ISOSpeedLatitudeyyy"],"001F":["IS","1","ISOSpeedLatitudezzz"],"0020":["UT","1","EXIFVersion"],"0021":["DS","1","ShutterSpeedValue"],"0022":["DS","1","ApertureValue"],"0023":["DS","1","BrightnessValue"],"0024":["DS","1","ExposureBiasValue"],"0025":["DS","1","MaxApertureValue"],"0026":["DS","1","SubjectDistance"],"0027":["US","1","MeteringMode"],"0028":["US","1","LightSource"],"0029":["DS","1","FocalLength"],"002A":["IS","2-4","SubjectArea"],"002B":["OB","1","MakerNote"],"0030":["DS","1","Temperature"],"0031":["DS","1","Humidity"],"0032":["DS","1","Pressure"],"0033":["DS","1","WaterDepth"],"0034":["DS","1","Acceleration"],"0035":["DS","1","CameraElevationAngle"],"0036":["DS","1-2","FlashEnergy"],"0037":["IS","2","SubjectLocation"],"0038":["DS","1","PhotographicExposureIndex"],"0039":["US","1","SensingMethod"],"003A":["US","1","FileSource"],"003B":["US","1","SceneType"],"0041":["US","1","CustomRendered"],"0042":["US","1","ExposureMode"],"0043":["US","1","WhiteBalance"],"0044":["DS","1","DigitalZoomRatio"],"0045":["IS","1","FocalLengthIn35mmFilm"],"0046":["US","1","SceneCaptureType"],"0047":["US","1","GainControl"],"0048":["US","1","Contrast"],"0049":["US","1","Saturation"],"004A":["US","1","Sharpness"],"004B":["OB","1","DeviceSettingDescription"],"004C":["US","1","SubjectDistanceRange"],"004D":["UT","1","CameraOwnerName"],"004E":["DS","4","LensSpecification"],"004F":["UT","1","LensMake"],"0050":["UT","1","LensModel"],"0051":["UT","1","LensSerialNumber"],"0061":["CS","1","InteroperabilityIndex"],"0062":["OB","1","InteroperabilityVersion"],"0070":["OB","1","GPSVersionID"],"0071":["CS","1","GPSLatitudeRef"],"0072":["DS","3","GPSLatitude"],"0073":["CS","1","GPSLongitudeRef"],"0074":["DS","3","GPSLongitude"],"0075":["US","1","GPSAltitudeRef"],"0076":["DS","1","GPSAltitude"],"0077":["DT","1","GPSTimeStamp"],"0078":["UT","1","GPSSatellites"],"0079":["CS","1","GPSStatus"],"007A":["CS","1","GPSMeasureMode"],"007B":["DS","1","GPSDOP"],"007C":["CS","1","GPSSpeedRef"],"007D":["DS","1","GPSSpeed"],"007E":["CS","1","GPSTrackRef"],"007F":["DS","1","GPSTrack"],"0080":["CS","1","GPSImgDirectionRef"],"0081":["DS","1","GPSImgDirection"],"0082":["UT","1","GPSMapDatum"],"0083":["CS","1","GPSDestLatitudeRef"],"0084":["DS","3","GPSDestLatitude"],"0085":["CS","1","GPSDestLongitudeRef"],"0086":["DS","3","GPSDestLongitude"],"0087":["CS","1","GPSDestBearingRef"],"0088":["DS","1","GPSDestBearing"],"0089":["CS","1","GPSDestDistanceRef"],"008A":["DS","1","GPSDestDistance"],"008B":["OB","1","GPSProcessingMethod"],"008C":["OB","1","GPSAreaInformation"],"008D":["DT","1","GPSDateStamp"],"008E":["IS","1","GPSDifferential"],1001:["CS","1","LightSourcePolarization"],1002:["DS","1","EmitterColorTemperature"],1003:["CS","1","ContactMethod"],1004:["CS","1-n","ImmersionMedia"],1005:["DS","1","OpticalMagnificationFactor"]},"0018":{"0000":["UL","1","GenericGroupLength"],"0010":["LO","1","ContrastBolusAgent"],"0012":["SQ","1","ContrastBolusAgentSequence"],"0013":["FL","1","ContrastBolusT1Relaxivity"],"0014":["SQ","1","ContrastBolusAdministrationRouteSequence"],"0015":["CS","1","BodyPartExamined"],"0020":["CS","1-n","ScanningSequence"],"0021":["CS","1-n","SequenceVariant"],"0022":["CS","1-n","ScanOptions"],"0023":["CS","1","MRAcquisitionType"],"0024":["SH","1","SequenceName"],"0025":["CS","1","AngioFlag"],"0026":["SQ","1","InterventionDrugInformationSequence"],"0027":["TM","1","InterventionDrugStopTime"],"0028":["DS","1","InterventionDrugDose"],"0029":["SQ","1","InterventionDrugCodeSequence"],"002A":["SQ","1","AdditionalDrugSequence"],"0030":["LO","1-n","Radionuclide"],"0031":["LO","1","Radiopharmaceutical"],"0032":["DS","1","EnergyWindowCenterline"],"0033":["DS","1-n","EnergyWindowTotalWidth"],"0034":["LO","1","InterventionDrugName"],"0035":["TM","1","InterventionDrugStartTime"],"0036":["SQ","1","InterventionSequence"],"0037":["CS","1","TherapyType"],"0038":["CS","1","InterventionStatus"],"0039":["CS","1","TherapyDescription"],"003A":["ST","1","InterventionDescription"],"0040":["IS","1","CineRate"],"0042":["CS","1","InitialCineRunState"],"0050":["DS","1","SliceThickness"],"0060":["DS","1","KVP"],"0061":["DS","1",""],"0070":["IS","1","CountsAccumulated"],"0071":["CS","1","AcquisitionTerminationCondition"],"0072":["DS","1","EffectiveDuration"],"0073":["CS","1","AcquisitionStartCondition"],"0074":["IS","1","AcquisitionStartConditionData"],"0075":["IS","1","AcquisitionTerminationConditionData"],"0080":["DS","1","RepetitionTime"],"0081":["DS","1","EchoTime"],"0082":["DS","1","InversionTime"],"0083":["DS","1","NumberOfAverages"],"0084":["DS","1","ImagingFrequency"],"0085":["SH","1","ImagedNucleus"],"0086":["IS","1-n","EchoNumbers"],"0087":["DS","1","MagneticFieldStrength"],"0088":["DS","1","SpacingBetweenSlices"],"0089":["IS","1","NumberOfPhaseEncodingSteps"],"0090":["DS","1","DataCollectionDiameter"],"0091":["IS","1","EchoTrainLength"],"0093":["DS","1","PercentSampling"],"0094":["DS","1","PercentPhaseFieldOfView"],"0095":["DS","1","PixelBandwidth"],1e3:["LO","1","DeviceSerialNumber"],1002:["UI","1","DeviceUID"],1003:["LO","1","DeviceID"],1004:["LO","1","PlateID"],1005:["LO","1","GeneratorID"],1006:["LO","1","GridID"],1007:["LO","1","CassetteID"],1008:["LO","1","GantryID"],1009:["UT","1","UniqueDeviceIdentifier"],"100A":["SQ","1","UDISequence"],"100B":["UI","1-n","ManufacturerDeviceClassUID"],1010:["LO","1","SecondaryCaptureDeviceID"],1011:["LO","1","HardcopyCreationDeviceID"],1012:["DA","1","DateOfSecondaryCapture"],1014:["TM","1","TimeOfSecondaryCapture"],1016:["LO","1","SecondaryCaptureDeviceManufacturer"],1017:["LO","1","HardcopyDeviceManufacturer"],1018:["LO","1","SecondaryCaptureDeviceManufacturerModelName"],1019:["LO","1-n","SecondaryCaptureDeviceSoftwareVersions"],"101A":["LO","1-n","HardcopyDeviceSoftwareVersion"],"101B":["LO","1","HardcopyDeviceManufacturerModelName"],1020:["LO","1-n","SoftwareVersions"],1022:["SH","1","VideoImageFormatAcquired"],1023:["LO","1","DigitalImageFormatAcquired"],1030:["LO","1","ProtocolName"],1040:["LO","1","ContrastBolusRoute"],1041:["DS","1","ContrastBolusVolume"],1042:["TM","1","ContrastBolusStartTime"],1043:["TM","1","ContrastBolusStopTime"],1044:["DS","1","ContrastBolusTotalDose"],1045:["IS","1","SyringeCounts"],1046:["DS","1-n","ContrastFlowRate"],1047:["DS","1-n","ContrastFlowDuration"],1048:["CS","1","ContrastBolusIngredient"],1049:["DS","1","ContrastBolusIngredientConcentration"],1050:["DS","1","SpatialResolution"],1060:["DS","1","TriggerTime"],1061:["LO","1","TriggerSourceOrType"],1062:["IS","1","NominalInterval"],1063:["DS","1","FrameTime"],1064:["LO","1","CardiacFramingType"],1065:["DS","1-n","FrameTimeVector"],1066:["DS","1","FrameDelay"],1067:["DS","1","ImageTriggerDelay"],1068:["DS","1","MultiplexGroupTimeOffset"],1069:["DS","1","TriggerTimeOffset"],"106A":["CS","1","SynchronizationTrigger"],"106C":["US","2","SynchronizationChannel"],"106E":["UL","1","TriggerSamplePosition"],1070:["LO","1","RadiopharmaceuticalRoute"],1071:["DS","1","RadiopharmaceuticalVolume"],1072:["TM","1","RadiopharmaceuticalStartTime"],1073:["TM","1","RadiopharmaceuticalStopTime"],1074:["DS","1","RadionuclideTotalDose"],1075:["DS","1","RadionuclideHalfLife"],1076:["DS","1","RadionuclidePositronFraction"],1077:["DS","1","RadiopharmaceuticalSpecificActivity"],1078:["DT","1","RadiopharmaceuticalStartDateTime"],1079:["DT","1","RadiopharmaceuticalStopDateTime"],1080:["CS","1","BeatRejectionFlag"],1081:["IS","1","LowRRValue"],1082:["IS","1","HighRRValue"],1083:["IS","1","IntervalsAcquired"],1084:["IS","1","IntervalsRejected"],1085:["LO","1","PVCRejection"],1086:["IS","1","SkipBeats"],1088:["IS","1","HeartRate"],1090:["IS","1","CardiacNumberOfImages"],1094:["IS","1","TriggerWindow"],1100:["DS","1","ReconstructionDiameter"],1110:["DS","1","DistanceSourceToDetector"],1111:["DS","1","DistanceSourceToPatient"],1114:["DS","1","EstimatedRadiographicMagnificationFactor"],1120:["DS","1","GantryDetectorTilt"],1121:["DS","1","GantryDetectorSlew"],1130:["DS","1","TableHeight"],1131:["DS","1","TableTraverse"],1134:["CS","1","TableMotion"],1135:["DS","1-n","TableVerticalIncrement"],1136:["DS","1-n","TableLateralIncrement"],1137:["DS","1-n","TableLongitudinalIncrement"],1138:["DS","1","TableAngle"],"113A":["CS","1","TableType"],1140:["CS","1","RotationDirection"],1141:["DS","1","AngularPosition"],1142:["DS","1-n","RadialPosition"],1143:["DS","1","ScanArc"],1144:["DS","1","AngularStep"],1145:["DS","1","CenterOfRotationOffset"],1146:["DS","1-n","RotationOffset"],1147:["CS","1","FieldOfViewShape"],1149:["IS","1-2","FieldOfViewDimensions"],1150:["IS","1","ExposureTime"],1151:["IS","1","XRayTubeCurrent"],1152:["IS","1","Exposure"],1153:["IS","1","ExposureInuAs"],1154:["DS","1","AveragePulseWidth"],1155:["CS","1","RadiationSetting"],1156:["CS","1","RectificationType"],"115A":["CS","1","RadiationMode"],"115E":["DS","1","ImageAndFluoroscopyAreaDoseProduct"],1160:["SH","1","FilterType"],1161:["LO","1-n","TypeOfFilters"],1162:["DS","1","IntensifierSize"],1164:["DS","2","ImagerPixelSpacing"],1166:["CS","1-n","Grid"],1170:["IS","1","GeneratorPower"],1180:["SH","1","CollimatorGridName"],1181:["CS","1","CollimatorType"],1182:["IS","1-2","FocalDistance"],1183:["DS","1-2","XFocusCenter"],1184:["DS","1-2","YFocusCenter"],1190:["DS","1-n","FocalSpots"],1191:["CS","1","AnodeTargetMaterial"],"11A0":["DS","1","BodyPartThickness"],"11A2":["DS","1","CompressionForce"],"11A3":["DS","1","CompressionPressure"],"11A4":["LO","1","PaddleDescription"],"11A5":["DS","1","CompressionContactArea"],"11B0":["LO","1","AcquisitionMode"],"11B1":["LO","1","DoseModeName"],"11B2":["CS","1","AcquiredSubtractionMaskFlag"],"11B3":["CS","1","FluoroscopyPersistenceFlag"],"11B4":["CS","1","FluoroscopyLastImageHoldPersistenceFlag"],"11B5":["IS","1","UpperLimitNumberOfPersistentFluoroscopyFrames"],"11B6":["CS","1","ContrastBolusAutoInjectionTriggerFlag"],"11B7":["FD","1","ContrastBolusInjectionDelay"],"11B8":["SQ","1","XAAcquisitionPhaseDetailsSequence"],"11B9":["FD","1","XAAcquisitionFrameRate"],"11BA":["SQ","1","XAPlaneDetailsSequence"],"11BB":["LO","1","AcquisitionFieldOfViewLabel"],"11BC":["SQ","1","XRayFilterDetailsSequence"],"11BD":["FD","1","XAAcquisitionDuration"],"11BE":["CS","1","ReconstructionPipelineType"],"11BF":["SQ","1","ImageFilterDetailsSequence"],"11C0":["CS","1","AppliedMaskSubtractionFlag"],"11C1":["SQ","1","RequestedSeriesDescriptionCodeSequence"],1200:["DA","1-n","DateOfLastCalibration"],1201:["TM","1-n","TimeOfLastCalibration"],1202:["DT","1","DateTimeOfLastCalibration"],1203:["DT","1","CalibrationDateTime"],1210:["SH","1-n","ConvolutionKernel"],1240:["IS","1-n","UpperLowerPixelValues"],1242:["IS","1","ActualFrameDuration"],1243:["IS","1","CountRate"],1244:["US","1","PreferredPlaybackSequencing"],1250:["SH","1","ReceiveCoilName"],1251:["SH","1","TransmitCoilName"],1260:["SH","1","PlateType"],1261:["LO","1","PhosphorType"],1271:["FD","1","WaterEquivalentDiameter"],1272:["SQ","1","WaterEquivalentDiameterCalculationMethodCodeSequence"],1300:["DS","1","ScanVelocity"],1301:["CS","1-n","WholeBodyTechnique"],1302:["IS","1","ScanLength"],1310:["US","4","AcquisitionMatrix"],1312:["CS","1","InPlanePhaseEncodingDirection"],1314:["DS","1","FlipAngle"],1315:["CS","1","VariableFlipAngleFlag"],1316:["DS","1","SAR"],1318:["DS","1","dBdt"],1320:["FL","1","B1rms"],1400:["LO","1","AcquisitionDeviceProcessingDescription"],1401:["LO","1","AcquisitionDeviceProcessingCode"],1402:["CS","1","CassetteOrientation"],1403:["CS","1","CassetteSize"],1404:["US","1","ExposuresOnPlate"],1405:["IS","1","RelativeXRayExposure"],1411:["DS","1","ExposureIndex"],1412:["DS","1","TargetExposureIndex"],1413:["DS","1","DeviationIndex"],1450:["DS","1","ColumnAngulation"],1460:["DS","1","TomoLayerHeight"],1470:["DS","1","TomoAngle"],1480:["DS","1","TomoTime"],1490:["CS","1","TomoType"],1491:["CS","1","TomoClass"],1495:["IS","1","NumberOfTomosynthesisSourceImages"],1500:["CS","1","PositionerMotion"],1508:["CS","1","PositionerType"],1510:["DS","1","PositionerPrimaryAngle"],1511:["DS","1","PositionerSecondaryAngle"],1520:["DS","1-n","PositionerPrimaryAngleIncrement"],1521:["DS","1-n","PositionerSecondaryAngleIncrement"],1530:["DS","1","DetectorPrimaryAngle"],1531:["DS","1","DetectorSecondaryAngle"],1600:["CS","1-3","ShutterShape"],1602:["IS","1","ShutterLeftVerticalEdge"],1604:["IS","1","ShutterRightVerticalEdge"],1606:["IS","1","ShutterUpperHorizontalEdge"],1608:["IS","1","ShutterLowerHorizontalEdge"],1610:["IS","2","CenterOfCircularShutter"],1612:["IS","1","RadiusOfCircularShutter"],1620:["IS","2-2n","VerticesOfThePolygonalShutter"],1622:["US","1","ShutterPresentationValue"],1623:["US","1","ShutterOverlayGroup"],1624:["US","3","ShutterPresentationColorCIELabValue"],1630:["CS","1","OutlineShapeType"],1631:["FD","1","OutlineLeftVerticalEdge"],1632:["FD","1","OutlineRightVerticalEdge"],1633:["FD","1","OutlineUpperHorizontalEdge"],1634:["FD","1","OutlineLowerHorizontalEdge"],1635:["FD","2","CenterOfCircularOutline"],1636:["FD","1","DiameterOfCircularOutline"],1637:["UL","1","NumberOfPolygonalVertices"],1638:["OF","1","VerticesOfThePolygonalOutline"],1700:["CS","1-3","CollimatorShape"],1702:["IS","1","CollimatorLeftVerticalEdge"],1704:["IS","1","CollimatorRightVerticalEdge"],1706:["IS","1","CollimatorUpperHorizontalEdge"],1708:["IS","1","CollimatorLowerHorizontalEdge"],1710:["IS","2","CenterOfCircularCollimator"],1712:["IS","1","RadiusOfCircularCollimator"],1720:["IS","2-2n","VerticesOfThePolygonalCollimator"],1800:["CS","1","AcquisitionTimeSynchronized"],1801:["SH","1","TimeSource"],1802:["CS","1","TimeDistributionProtocol"],1803:["LO","1","NTPSourceAddress"],2001:["IS","1-n","PageNumberVector"],2002:["SH","1-n","FrameLabelVector"],2003:["DS","1-n","FramePrimaryAngleVector"],2004:["DS","1-n","FrameSecondaryAngleVector"],2005:["DS","1-n","SliceLocationVector"],2006:["SH","1-n","DisplayWindowLabelVector"],2010:["DS","2","NominalScannedPixelSpacing"],2020:["CS","1","DigitizingDeviceTransportDirection"],2030:["DS","1","RotationOfScannedFilm"],2041:["SQ","1","BiopsyTargetSequence"],2042:["UI","1","TargetUID"],2043:["FL","2","LocalizingCursorPosition"],2044:["FL","3","CalculatedTargetPosition"],2045:["SH","1","TargetLabel"],2046:["FL","1","DisplayedZValue"],3100:["CS","1","IVUSAcquisition"],3101:["DS","1","IVUSPullbackRate"],3102:["DS","1","IVUSGatedRate"],3103:["IS","1","IVUSPullbackStartFrameNumber"],3104:["IS","1","IVUSPullbackStopFrameNumber"],3105:["IS","1-n","LesionNumber"],4e3:["LT","1","AcquisitionComments"],5e3:["SH","1-n","OutputPower"],5010:["LO","1-n","TransducerData"],5011:["SQ","1","TransducerIdentificationSequence"],5012:["DS","1","FocusDepth"],5020:["LO","1","ProcessingFunction"],5021:["LO","1","PostprocessingFunction"],5022:["DS","1","MechanicalIndex"],5024:["DS","1","BoneThermalIndex"],5026:["DS","1","CranialThermalIndex"],5027:["DS","1","SoftTissueThermalIndex"],5028:["DS","1","SoftTissueFocusThermalIndex"],5029:["DS","1","SoftTissueSurfaceThermalIndex"],5030:["DS","1","DynamicRange"],5040:["DS","1","TotalGain"],5050:["IS","1","DepthOfScanField"],5100:["CS","1","PatientPosition"],5101:["CS","1","ViewPosition"],5104:["SQ","1","ProjectionEponymousNameCodeSequence"],5210:["DS","6","ImageTransformationMatrix"],5212:["DS","3","ImageTranslationVector"],6e3:["DS","1","Sensitivity"],6011:["SQ","1","SequenceOfUltrasoundRegions"],6012:["US","1","RegionSpatialFormat"],6014:["US","1","RegionDataType"],6016:["UL","1","RegionFlags"],6018:["UL","1","RegionLocationMinX0"],"601A":["UL","1","RegionLocationMinY0"],"601C":["UL","1","RegionLocationMaxX1"],"601E":["UL","1","RegionLocationMaxY1"],6020:["SL","1","ReferencePixelX0"],6022:["SL","1","ReferencePixelY0"],6024:["US","1","PhysicalUnitsXDirection"],6026:["US","1","PhysicalUnitsYDirection"],6028:["FD","1","ReferencePixelPhysicalValueX"],"602A":["FD","1","ReferencePixelPhysicalValueY"],"602C":["FD","1","PhysicalDeltaX"],"602E":["FD","1","PhysicalDeltaY"],6030:["UL","1","TransducerFrequency"],6031:["CS","1","TransducerType"],6032:["UL","1","PulseRepetitionFrequency"],6034:["FD","1","DopplerCorrectionAngle"],6036:["FD","1","SteeringAngle"],6038:["UL","1","DopplerSampleVolumeXPositionRetired"],6039:["SL","1","DopplerSampleVolumeXPosition"],"603A":["UL","1","DopplerSampleVolumeYPositionRetired"],"603B":["SL","1","DopplerSampleVolumeYPosition"],"603C":["UL","1","TMLinePositionX0Retired"],"603D":["SL","1","TMLinePositionX0"],"603E":["UL","1","TMLinePositionY0Retired"],"603F":["SL","1","TMLinePositionY0"],6040:["UL","1","TMLinePositionX1Retired"],6041:["SL","1","TMLinePositionX1"],6042:["UL","1","TMLinePositionY1Retired"],6043:["SL","1","TMLinePositionY1"],6044:["US","1","PixelComponentOrganization"],6046:["UL","1","PixelComponentMask"],6048:["UL","1","PixelComponentRangeStart"],"604A":["UL","1","PixelComponentRangeStop"],"604C":["US","1","PixelComponentPhysicalUnits"],"604E":["US","1","PixelComponentDataType"],6050:["UL","1","NumberOfTableBreakPoints"],6052:["UL","1-n","TableOfXBreakPoints"],6054:["FD","1-n","TableOfYBreakPoints"],6056:["UL","1","NumberOfTableEntries"],6058:["UL","1-n","TableOfPixelValues"],"605A":["FL","1-n","TableOfParameterValues"],6060:["FL","1-n","RWaveTimeVector"],6070:["US","1","ActiveImageAreaOverlayGroup"],7e3:["CS","1","DetectorConditionsNominalFlag"],7001:["DS","1","DetectorTemperature"],7004:["CS","1","DetectorType"],7005:["CS","1","DetectorConfiguration"],7006:["LT","1","DetectorDescription"],7008:["LT","1","DetectorMode"],"700A":["SH","1","DetectorID"],"700C":["DA","1","DateOfLastDetectorCalibration"],"700E":["TM","1","TimeOfLastDetectorCalibration"],7010:["IS","1","ExposuresOnDetectorSinceLastCalibration"],7011:["IS","1","ExposuresOnDetectorSinceManufactured"],7012:["DS","1","DetectorTimeSinceLastExposure"],7014:["DS","1","DetectorActiveTime"],7016:["DS","1","DetectorActivationOffsetFromExposure"],"701A":["DS","2","DetectorBinning"],7020:["DS","2","DetectorElementPhysicalSize"],7022:["DS","2","DetectorElementSpacing"],7024:["CS","1","DetectorActiveShape"],7026:["DS","1-2","DetectorActiveDimensions"],7028:["DS","2","DetectorActiveOrigin"],"702A":["LO","1","DetectorManufacturerName"],"702B":["LO","1","DetectorManufacturerModelName"],7030:["DS","2","FieldOfViewOrigin"],7032:["DS","1","FieldOfViewRotation"],7034:["CS","1","FieldOfViewHorizontalFlip"],7036:["FL","2","PixelDataAreaOriginRelativeToFOV"],7038:["FL","1","PixelDataAreaRotationAngleRelativeToFOV"],7040:["LT","1","GridAbsorbingMaterial"],7041:["LT","1","GridSpacingMaterial"],7042:["DS","1","GridThickness"],7044:["DS","1","GridPitch"],7046:["IS","2","GridAspectRatio"],7048:["DS","1","GridPeriod"],"704C":["DS","1","GridFocalDistance"],7050:["CS","1-n","FilterMaterial"],7052:["DS","1-n","FilterThicknessMinimum"],7054:["DS","1-n","FilterThicknessMaximum"],7056:["FL","1-n","FilterBeamPathLengthMinimum"],7058:["FL","1-n","FilterBeamPathLengthMaximum"],7060:["CS","1","ExposureControlMode"],7062:["LT","1","ExposureControlModeDescription"],7064:["CS","1","ExposureStatus"],7065:["DS","1","PhototimerSetting"],8150:["DS","1","ExposureTimeInuS"],8151:["DS","1","XRayTubeCurrentInuA"],9004:["CS","1","ContentQualification"],9005:["SH","1","PulseSequenceName"],9006:["SQ","1","MRImagingModifierSequence"],9008:["CS","1","EchoPulseSequence"],9009:["CS","1","InversionRecovery"],9010:["CS","1","FlowCompensation"],9011:["CS","1","MultipleSpinEcho"],9012:["CS","1","MultiPlanarExcitation"],9014:["CS","1","PhaseContrast"],9015:["CS","1","TimeOfFlightContrast"],9016:["CS","1","Spoiling"],9017:["CS","1","SteadyStatePulseSequence"],9018:["CS","1","EchoPlanarPulseSequence"],9019:["FD","1","TagAngleFirstAxis"],9020:["CS","1","MagnetizationTransfer"],9021:["CS","1","T2Preparation"],9022:["CS","1","BloodSignalNulling"],9024:["CS","1","SaturationRecovery"],9025:["CS","1","SpectrallySelectedSuppression"],9026:["CS","1","SpectrallySelectedExcitation"],9027:["CS","1","SpatialPresaturation"],9028:["CS","1","Tagging"],9029:["CS","1","OversamplingPhase"],9030:["FD","1","TagSpacingFirstDimension"],9032:["CS","1","GeometryOfKSpaceTraversal"],9033:["CS","1","SegmentedKSpaceTraversal"],9034:["CS","1","RectilinearPhaseEncodeReordering"],9035:["FD","1","TagThickness"],9036:["CS","1","PartialFourierDirection"],9037:["CS","1","CardiacSynchronizationTechnique"],9041:["LO","1","ReceiveCoilManufacturerName"],9042:["SQ","1","MRReceiveCoilSequence"],9043:["CS","1","ReceiveCoilType"],9044:["CS","1","QuadratureReceiveCoil"],9045:["SQ","1","MultiCoilDefinitionSequence"],9046:["LO","1","MultiCoilConfiguration"],9047:["SH","1","MultiCoilElementName"],9048:["CS","1","MultiCoilElementUsed"],9049:["SQ","1","MRTransmitCoilSequence"],9050:["LO","1","TransmitCoilManufacturerName"],9051:["CS","1","TransmitCoilType"],9052:["FD","1-2","SpectralWidth"],9053:["FD","1-2","ChemicalShiftReference"],9054:["CS","1","VolumeLocalizationTechnique"],9058:["US","1","MRAcquisitionFrequencyEncodingSteps"],9059:["CS","1","Decoupling"],9060:["CS","1-2","DecoupledNucleus"],9061:["FD","1-2","DecouplingFrequency"],9062:["CS","1","DecouplingMethod"],9063:["FD","1-2","DecouplingChemicalShiftReference"],9064:["CS","1","KSpaceFiltering"],9065:["CS","1-2","TimeDomainFiltering"],9066:["US","1-2","NumberOfZeroFills"],9067:["CS","1","BaselineCorrection"],9069:["FD","1","ParallelReductionFactorInPlane"],9070:["FD","1","CardiacRRIntervalSpecified"],9073:["FD","1","AcquisitionDuration"],9074:["DT","1","FrameAcquisitionDateTime"],9075:["CS","1","DiffusionDirectionality"],9076:["SQ","1","DiffusionGradientDirectionSequence"],9077:["CS","1","ParallelAcquisition"],9078:["CS","1","ParallelAcquisitionTechnique"],9079:["FD","1-n","InversionTimes"],9080:["ST","1","MetaboliteMapDescription"],9081:["CS","1","PartialFourier"],9082:["FD","1","EffectiveEchoTime"],9083:["SQ","1","MetaboliteMapCodeSequence"],9084:["SQ","1","ChemicalShiftSequence"],9085:["CS","1","CardiacSignalSource"],9087:["FD","1","DiffusionBValue"],9089:["FD","3","DiffusionGradientOrientation"],9090:["FD","3","VelocityEncodingDirection"],9091:["FD","1","VelocityEncodingMinimumValue"],9092:["SQ","1","VelocityEncodingAcquisitionSequence"],9093:["US","1","NumberOfKSpaceTrajectories"],9094:["CS","1","CoverageOfKSpace"],9095:["UL","1","SpectroscopyAcquisitionPhaseRows"],9096:["FD","1","ParallelReductionFactorInPlaneRetired"],9098:["FD","1-2","TransmitterFrequency"],9100:["CS","1-2","ResonantNucleus"],9101:["CS","1","FrequencyCorrection"],9103:["SQ","1","MRSpectroscopyFOVGeometrySequence"],9104:["FD","1","SlabThickness"],9105:["FD","3","SlabOrientation"],9106:["FD","3","MidSlabPosition"],9107:["SQ","1","MRSpatialSaturationSequence"],9112:["SQ","1","MRTimingAndRelatedParametersSequence"],9114:["SQ","1","MREchoSequence"],9115:["SQ","1","MRModifierSequence"],9117:["SQ","1","MRDiffusionSequence"],9118:["SQ","1","CardiacSynchronizationSequence"],9119:["SQ","1","MRAveragesSequence"],9125:["SQ","1","MRFOVGeometrySequence"],9126:["SQ","1","VolumeLocalizationSequence"],9127:["UL","1","SpectroscopyAcquisitionDataColumns"],9147:["CS","1","DiffusionAnisotropyType"],9151:["DT","1","FrameReferenceDateTime"],9152:["SQ","1","MRMetaboliteMapSequence"],9155:["FD","1","ParallelReductionFactorOutOfPlane"],9159:["UL","1","SpectroscopyAcquisitionOutOfPlanePhaseSteps"],9166:["CS","1","BulkMotionStatus"],9168:["FD","1","ParallelReductionFactorSecondInPlane"],9169:["CS","1","CardiacBeatRejectionTechnique"],9170:["CS","1","RespiratoryMotionCompensationTechnique"],9171:["CS","1","RespiratorySignalSource"],9172:["CS","1","BulkMotionCompensationTechnique"],9173:["CS","1","BulkMotionSignalSource"],9174:["CS","1","ApplicableSafetyStandardAgency"],9175:["LO","1","ApplicableSafetyStandardDescription"],9176:["SQ","1","OperatingModeSequence"],9177:["CS","1","OperatingModeType"],9178:["CS","1","OperatingMode"],9179:["CS","1","SpecificAbsorptionRateDefinition"],9180:["CS","1","GradientOutputType"],9181:["FD","1","SpecificAbsorptionRateValue"],9182:["FD","1","GradientOutput"],9183:["CS","1","FlowCompensationDirection"],9184:["FD","1","TaggingDelay"],9185:["ST","1","RespiratoryMotionCompensationTechniqueDescription"],9186:["SH","1","RespiratorySignalSourceID"],9195:["FD","1","ChemicalShiftMinimumIntegrationLimitInHz"],9196:["FD","1","ChemicalShiftMaximumIntegrationLimitInHz"],9197:["SQ","1","MRVelocityEncodingSequence"],9198:["CS","1","FirstOrderPhaseCorrection"],9199:["CS","1","WaterReferencedPhaseCorrection"],9200:["CS","1","MRSpectroscopyAcquisitionType"],9214:["CS","1","RespiratoryCyclePosition"],9217:["FD","1","VelocityEncodingMaximumValue"],9218:["FD","1","TagSpacingSecondDimension"],9219:["SS","1","TagAngleSecondAxis"],9220:["FD","1","FrameAcquisitionDuration"],9226:["SQ","1","MRImageFrameTypeSequence"],9227:["SQ","1","MRSpectroscopyFrameTypeSequence"],9231:["US","1","MRAcquisitionPhaseEncodingStepsInPlane"],9232:["US","1","MRAcquisitionPhaseEncodingStepsOutOfPlane"],9234:["UL","1","SpectroscopyAcquisitionPhaseColumns"],9236:["CS","1","CardiacCyclePosition"],9239:["SQ","1","SpecificAbsorptionRateSequence"],9240:["US","1","RFEchoTrainLength"],9241:["US","1","GradientEchoTrainLength"],9250:["CS","1","ArterialSpinLabelingContrast"],9251:["SQ","1","MRArterialSpinLabelingSequence"],9252:["LO","1","ASLTechniqueDescription"],9253:["US","1","ASLSlabNumber"],9254:["FD","1","ASLSlabThickness"],9255:["FD","3","ASLSlabOrientation"],9256:["FD","3","ASLMidSlabPosition"],9257:["CS","1","ASLContext"],9258:["UL","1","ASLPulseTrainDuration"],9259:["CS","1","ASLCrusherFlag"],"925A":["FD","1","ASLCrusherFlowLimit"],"925B":["LO","1","ASLCrusherDescription"],"925C":["CS","1","ASLBolusCutoffFlag"],"925D":["SQ","1","ASLBolusCutoffTimingSequence"],"925E":["LO","1","ASLBolusCutoffTechnique"],"925F":["UL","1","ASLBolusCutoffDelayTime"],9260:["SQ","1","ASLSlabSequence"],9295:["FD","1","ChemicalShiftMinimumIntegrationLimitInppm"],9296:["FD","1","ChemicalShiftMaximumIntegrationLimitInppm"],9297:["CS","1","WaterReferenceAcquisition"],9298:["IS","1","EchoPeakPosition"],9301:["SQ","1","CTAcquisitionTypeSequence"],9302:["CS","1","AcquisitionType"],9303:["FD","1","TubeAngle"],9304:["SQ","1","CTAcquisitionDetailsSequence"],9305:["FD","1","RevolutionTime"],9306:["FD","1","SingleCollimationWidth"],9307:["FD","1","TotalCollimationWidth"],9308:["SQ","1","CTTableDynamicsSequence"],9309:["FD","1","TableSpeed"],9310:["FD","1","TableFeedPerRotation"],9311:["FD","1","SpiralPitchFactor"],9312:["SQ","1","CTGeometrySequence"],9313:["FD","3","DataCollectionCenterPatient"],9314:["SQ","1","CTReconstructionSequence"],9315:["CS","1","ReconstructionAlgorithm"],9316:["CS","1","ConvolutionKernelGroup"],9317:["FD","2","ReconstructionFieldOfView"],9318:["FD","3","ReconstructionTargetCenterPatient"],9319:["FD","1","ReconstructionAngle"],9320:["SH","1","ImageFilter"],9321:["SQ","1","CTExposureSequence"],9322:["FD","2","ReconstructionPixelSpacing"],9323:["CS","1-n","ExposureModulationType"],9324:["FD","1","EstimatedDoseSaving"],9325:["SQ","1","CTXRayDetailsSequence"],9326:["SQ","1","CTPositionSequence"],9327:["FD","1","TablePosition"],9328:["FD","1","ExposureTimeInms"],9329:["SQ","1","CTImageFrameTypeSequence"],9330:["FD","1","XRayTubeCurrentInmA"],9332:["FD","1","ExposureInmAs"],9333:["CS","1","ConstantVolumeFlag"],9334:["CS","1","FluoroscopyFlag"],9335:["FD","1","DistanceSourceToDataCollectionCenter"],9337:["US","1","ContrastBolusAgentNumber"],9338:["SQ","1","ContrastBolusIngredientCodeSequence"],9340:["SQ","1","ContrastAdministrationProfileSequence"],9341:["SQ","1","ContrastBolusUsageSequence"],9342:["CS","1","ContrastBolusAgentAdministered"],9343:["CS","1","ContrastBolusAgentDetected"],9344:["CS","1","ContrastBolusAgentPhase"],9345:["FD","1","CTDIvol"],9346:["SQ","1","CTDIPhantomTypeCodeSequence"],9351:["FL","1","CalciumScoringMassFactorPatient"],9352:["FL","3","CalciumScoringMassFactorDevice"],9353:["FL","1","EnergyWeightingFactor"],9360:["SQ","1","CTAdditionalXRaySourceSequence"],9361:["CS","1","MultienergyCTAcquisition"],9362:["SQ","1","MultienergyCTAcquisitionSequence"],9363:["SQ","1","MultienergyCTProcessingSequence"],9364:["SQ","1","MultienergyCTCharacteristicsSequence"],9365:["SQ","1","MultienergyCTXRaySourceSequence"],9366:["US","1","XRaySourceIndex"],9367:["UC","1","XRaySourceID"],9368:["CS","1","MultienergySourceTechnique"],9369:["DT","1","SourceStartDateTime"],"936A":["DT","1","SourceEndDateTime"],"936B":["US","1","SwitchingPhaseNumber"],"936C":["DS","1","SwitchingPhaseNominalDuration"],"936D":["DS","1","SwitchingPhaseTransitionDuration"],"936E":["DS","1","EffectiveBinEnergy"],"936F":["SQ","1","MultienergyCTXRayDetectorSequence"],9370:["US","1","XRayDetectorIndex"],9371:["UC","1","XRayDetectorID"],9372:["CS","1","MultienergyDetectorType"],9373:["ST","1","XRayDetectorLabel"],9374:["DS","1","NominalMaxEnergy"],9375:["DS","1","NominalMinEnergy"],9376:["US","1-n","ReferencedXRayDetectorIndex"],9377:["US","1-n","ReferencedXRaySourceIndex"],9378:["US","1-n","ReferencedPathIndex"],9379:["SQ","1","MultienergyCTPathSequence"],"937A":["US","1","MultienergyCTPathIndex"],"937B":["UT","1","MultienergyAcquisitionDescription"],"937C":["FD","1","MonoenergeticEnergyEquivalent"],"937D":["SQ","1","MaterialCodeSequence"],"937E":["CS","1","DecompositionMethod"],"937F":["UT","1","DecompositionDescription"],9380:["SQ","1","DecompositionAlgorithmIdentificationSequence"],9381:["SQ","1","DecompositionMaterialSequence"],9382:["SQ","1","MaterialAttenuationSequence"],9383:["DS","1","PhotonEnergy"],9384:["DS","1","XRayMassAttenuationCoefficient"],9401:["SQ","1","ProjectionPixelCalibrationSequence"],9402:["FL","1","DistanceSourceToIsocenter"],9403:["FL","1","DistanceObjectToTableTop"],9404:["FL","2","ObjectPixelSpacingInCenterOfBeam"],9405:["SQ","1","PositionerPositionSequence"],9406:["SQ","1","TablePositionSequence"],9407:["SQ","1","CollimatorShapeSequence"],9410:["CS","1","PlanesInAcquisition"],9412:["SQ","1","XAXRFFrameCharacteristicsSequence"],9417:["SQ","1","FrameAcquisitionSequence"],9420:["CS","1","XRayReceptorType"],9423:["LO","1","AcquisitionProtocolName"],9424:["LT","1","AcquisitionProtocolDescription"],9425:["CS","1","ContrastBolusIngredientOpaque"],9426:["FL","1","DistanceReceptorPlaneToDetectorHousing"],9427:["CS","1","IntensifierActiveShape"],9428:["FL","1-2","IntensifierActiveDimensions"],9429:["FL","2","PhysicalDetectorSize"],9430:["FL","2","PositionOfIsocenterProjection"],9432:["SQ","1","FieldOfViewSequence"],9433:["LO","1","FieldOfViewDescription"],9434:["SQ","1","ExposureControlSensingRegionsSequence"],9435:["CS","1","ExposureControlSensingRegionShape"],9436:["SS","1","ExposureControlSensingRegionLeftVerticalEdge"],9437:["SS","1","ExposureControlSensingRegionRightVerticalEdge"],9438:["SS","1","ExposureControlSensingRegionUpperHorizontalEdge"],9439:["SS","1","ExposureControlSensingRegionLowerHorizontalEdge"],9440:["SS","2","CenterOfCircularExposureControlSensingRegion"],9441:["US","1","RadiusOfCircularExposureControlSensingRegion"],9442:["SS","2-n","VerticesOfThePolygonalExposureControlSensingRegion"],9445:["","",""],9447:["FL","1","ColumnAngulationPatient"],9449:["FL","1","BeamAngle"],9451:["SQ","1","FrameDetectorParametersSequence"],9452:["FL","1","CalculatedAnatomyThickness"],9455:["SQ","1","CalibrationSequence"],9456:["SQ","1","ObjectThicknessSequence"],9457:["CS","1","PlaneIdentification"],9461:["FL","1-2","FieldOfViewDimensionsInFloat"],9462:["SQ","1","IsocenterReferenceSystemSequence"],9463:["FL","1","PositionerIsocenterPrimaryAngle"],9464:["FL","1","PositionerIsocenterSecondaryAngle"],9465:["FL","1","PositionerIsocenterDetectorRotationAngle"],9466:["FL","1","TableXPositionToIsocenter"],9467:["FL","1","TableYPositionToIsocenter"],9468:["FL","1","TableZPositionToIsocenter"],9469:["FL","1","TableHorizontalRotationAngle"],9470:["FL","1","TableHeadTiltAngle"],9471:["FL","1","TableCradleTiltAngle"],9472:["SQ","1","FrameDisplayShutterSequence"],9473:["FL","1","AcquiredImageAreaDoseProduct"],9474:["CS","1","CArmPositionerTabletopRelationship"],9476:["SQ","1","XRayGeometrySequence"],9477:["SQ","1","IrradiationEventIdentificationSequence"],9504:["SQ","1","XRay3DFrameTypeSequence"],9506:["SQ","1","ContributingSourcesSequence"],9507:["SQ","1","XRay3DAcquisitionSequence"],9508:["FL","1","PrimaryPositionerScanArc"],9509:["FL","1","SecondaryPositionerScanArc"],9510:["FL","1","PrimaryPositionerScanStartAngle"],9511:["FL","1","SecondaryPositionerScanStartAngle"],9514:["FL","1","PrimaryPositionerIncrement"],9515:["FL","1","SecondaryPositionerIncrement"],9516:["DT","1","StartAcquisitionDateTime"],9517:["DT","1","EndAcquisitionDateTime"],9518:["SS","1","PrimaryPositionerIncrementSign"],9519:["SS","1","SecondaryPositionerIncrementSign"],9524:["LO","1","ApplicationName"],9525:["LO","1","ApplicationVersion"],9526:["LO","1","ApplicationManufacturer"],9527:["CS","1","AlgorithmType"],9528:["LO","1","AlgorithmDescription"],9530:["SQ","1","XRay3DReconstructionSequence"],9531:["LO","1","ReconstructionDescription"],9538:["SQ","1","PerProjectionAcquisitionSequence"],9541:["SQ","1","DetectorPositionSequence"],9542:["SQ","1","XRayAcquisitionDoseSequence"],9543:["FD","1","XRaySourceIsocenterPrimaryAngle"],9544:["FD","1","XRaySourceIsocenterSecondaryAngle"],9545:["FD","1","BreastSupportIsocenterPrimaryAngle"],9546:["FD","1","BreastSupportIsocenterSecondaryAngle"],9547:["FD","1","BreastSupportXPositionToIsocenter"],9548:["FD","1","BreastSupportYPositionToIsocenter"],9549:["FD","1","BreastSupportZPositionToIsocenter"],9550:["FD","1","DetectorIsocenterPrimaryAngle"],9551:["FD","1","DetectorIsocenterSecondaryAngle"],9552:["FD","1","DetectorXPositionToIsocenter"],9553:["FD","1","DetectorYPositionToIsocenter"],9554:["FD","1","DetectorZPositionToIsocenter"],9555:["SQ","1","XRayGridSequence"],9556:["SQ","1","XRayFilterSequence"],9557:["FD","3","DetectorActiveAreaTLHCPosition"],9558:["FD","6","DetectorActiveAreaOrientation"],9559:["CS","1","PositionerPrimaryAngleDirection"],9601:["SQ","1","DiffusionBMatrixSequence"],9602:["FD","1","DiffusionBValueXX"],9603:["FD","1","DiffusionBValueXY"],9604:["FD","1","DiffusionBValueXZ"],9605:["FD","1","DiffusionBValueYY"],9606:["FD","1","DiffusionBValueYZ"],9607:["FD","1","DiffusionBValueZZ"],9621:["SQ","1","FunctionalMRSequence"],9622:["CS","1","FunctionalSettlingPhaseFramesPresent"],9623:["DT","1","FunctionalSyncPulse"],9624:["CS","1","SettlingPhaseFrame"],9701:["DT","1","DecayCorrectionDateTime"],9715:["FD","1","StartDensityThreshold"],9716:["FD","1","StartRelativeDensityDifferenceThreshold"],9717:["FD","1","StartCardiacTriggerCountThreshold"],9718:["FD","1","StartRespiratoryTriggerCountThreshold"],9719:["FD","1","TerminationCountsThreshold"],9720:["FD","1","TerminationDensityThreshold"],9721:["FD","1","TerminationRelativeDensityThreshold"],9722:["FD","1","TerminationTimeThreshold"],9723:["FD","1","TerminationCardiacTriggerCountThreshold"],9724:["FD","1","TerminationRespiratoryTriggerCountThreshold"],9725:["CS","1","DetectorGeometry"],9726:["FD","1","TransverseDetectorSeparation"],9727:["FD","1","AxialDetectorDimension"],9729:["US","1","RadiopharmaceuticalAgentNumber"],9732:["SQ","1","PETFrameAcquisitionSequence"],9733:["SQ","1","PETDetectorMotionDetailsSequence"],9734:["SQ","1","PETTableDynamicsSequence"],9735:["SQ","1","PETPositionSequence"],9736:["SQ","1","PETFrameCorrectionFactorsSequence"],9737:["SQ","1","RadiopharmaceuticalUsageSequence"],9738:["CS","1","AttenuationCorrectionSource"],9739:["US","1","NumberOfIterations"],9740:["US","1","NumberOfSubsets"],9749:["SQ","1","PETReconstructionSequence"],9751:["SQ","1","PETFrameTypeSequence"],9755:["CS","1","TimeOfFlightInformationUsed"],9756:["CS","1","ReconstructionType"],9758:["CS","1","DecayCorrected"],9759:["CS","1","AttenuationCorrected"],9760:["CS","1","ScatterCorrected"],9761:["CS","1","DeadTimeCorrected"],9762:["CS","1","GantryMotionCorrected"],9763:["CS","1","PatientMotionCorrected"],9764:["CS","1","CountLossNormalizationCorrected"],9765:["CS","1","RandomsCorrected"],9766:["CS","1","NonUniformRadialSamplingCorrected"],9767:["CS","1","SensitivityCalibrated"],9768:["CS","1","DetectorNormalizationCorrection"],9769:["CS","1","IterativeReconstructionMethod"],9770:["CS","1","AttenuationCorrectionTemporalRelationship"],9771:["SQ","1","PatientPhysiologicalStateSequence"],9772:["SQ","1","PatientPhysiologicalStateCodeSequence"],9801:["FD","1-n","DepthsOfFocus"],9803:["SQ","1","ExcludedIntervalsSequence"],9804:["DT","1","ExclusionStartDateTime"],9805:["FD","1","ExclusionDuration"],9806:["SQ","1","USImageDescriptionSequence"],9807:["SQ","1","ImageDataTypeSequence"],9808:["CS","1","DataType"],9809:["SQ","1","TransducerScanPatternCodeSequence"],"980B":["CS","1","AliasedDataType"],"980C":["CS","1","PositionMeasuringDeviceUsed"],"980D":["SQ","1","TransducerGeometryCodeSequence"],"980E":["SQ","1","TransducerBeamSteeringCodeSequence"],"980F":["SQ","1","TransducerApplicationCodeSequence"],9810:["xs","1","ZeroVelocityPixelValue"],9900:["LO","1","ReferenceLocationLabel"],9901:["UT","1","ReferenceLocationDescription"],9902:["SQ","1","ReferenceBasisCodeSequence"],9903:["SQ","1","ReferenceGeometryCodeSequence"],9904:["DS","1","OffsetDistance"],9905:["CS","1","OffsetDirection"],9906:["SQ","1","PotentialScheduledProtocolCodeSequence"],9907:["SQ","1","PotentialRequestedProcedureCodeSequence"],9908:["UC","1-n","PotentialReasonsForProcedure"],9909:["SQ","1","PotentialReasonsForProcedureCodeSequence"],"990A":["UC","1-n","PotentialDiagnosticTasks"],"990B":["SQ","1","ContraindicationsCodeSequence"],"990C":["SQ","1","ReferencedDefinedProtocolSequence"],"990D":["SQ","1","ReferencedPerformedProtocolSequence"],"990E":["SQ","1","PredecessorProtocolSequence"],"990F":["UT","1","ProtocolPlanningInformation"],9910:["UT","1","ProtocolDesignRationale"],9911:["SQ","1","PatientSpecificationSequence"],9912:["SQ","1","ModelSpecificationSequence"],9913:["SQ","1","ParametersSpecificationSequence"],9914:["SQ","1","InstructionSequence"],9915:["US","1","InstructionIndex"],9916:["LO","1","InstructionText"],9917:["UT","1","InstructionDescription"],9918:["CS","1","InstructionPerformedFlag"],9919:["DT","1","InstructionPerformedDateTime"],"991A":["UT","1","InstructionPerformanceComment"],"991B":["SQ","1","PatientPositioningInstructionSequence"],"991C":["SQ","1","PositioningMethodCodeSequence"],"991D":["SQ","1","PositioningLandmarkSequence"],"991E":["UI","1","TargetFrameOfReferenceUID"],"991F":["SQ","1","AcquisitionProtocolElementSpecificationSequence"],9920:["SQ","1","AcquisitionProtocolElementSequence"],9921:["US","1","ProtocolElementNumber"],9922:["LO","1","ProtocolElementName"],9923:["UT","1","ProtocolElementCharacteristicsSummary"],9924:["UT","1","ProtocolElementPurpose"],9930:["CS","1","AcquisitionMotion"],9931:["SQ","1","AcquisitionStartLocationSequence"],9932:["SQ","1","AcquisitionEndLocationSequence"],9933:["SQ","1","ReconstructionProtocolElementSpecificationSequence"],9934:["SQ","1","ReconstructionProtocolElementSequence"],9935:["SQ","1","StorageProtocolElementSpecificationSequence"],9936:["SQ","1","StorageProtocolElementSequence"],9937:["LO","1","RequestedSeriesDescription"],9938:["US","1-n","SourceAcquisitionProtocolElementNumber"],9939:["US","1-n","SourceAcquisitionBeamNumber"],"993A":["US","1-n","SourceReconstructionProtocolElementNumber"],"993B":["SQ","1","ReconstructionStartLocationSequence"],"993C":["SQ","1","ReconstructionEndLocationSequence"],"993D":["SQ","1","ReconstructionAlgorithmSequence"],"993E":["SQ","1","ReconstructionTargetCenterLocationSequence"],9941:["UT","1","ImageFilterDescription"],9942:["FD","1","CTDIvolNotificationTrigger"],9943:["FD","1","DLPNotificationTrigger"],9944:["CS","1","AutoKVPSelectionType"],9945:["FD","1","AutoKVPUpperBound"],9946:["FD","1","AutoKVPLowerBound"],9947:["CS","1","ProtocolDefinedPatientPosition"],A001:["SQ","1","ContributingEquipmentSequence"],A002:["DT","1","ContributionDateTime"],A003:["ST","1","ContributionDescription"]},"0020":{"0000":["UL","1","GenericGroupLength"],"000D":["UI","1","StudyInstanceUID"],"000E":["UI","1","SeriesInstanceUID"],"0010":["SH","1","StudyID"],"0011":["IS","1","SeriesNumber"],"0012":["IS","1","AcquisitionNumber"],"0013":["IS","1","InstanceNumber"],"0014":["IS","1","IsotopeNumber"],"0015":["IS","1","PhaseNumber"],"0016":["IS","1","IntervalNumber"],"0017":["IS","1","TimeSlotNumber"],"0018":["IS","1","AngleNumber"],"0019":["IS","1","ItemNumber"],"0020":["CS","2","PatientOrientation"],"0022":["IS","1","OverlayNumber"],"0024":["IS","1","CurveNumber"],"0026":["IS","1","LUTNumber"],"0030":["DS","3","ImagePosition"],"0032":["DS","3","ImagePositionPatient"],"0035":["DS","6","ImageOrientation"],"0037":["DS","6","ImageOrientationPatient"],"0050":["DS","1","Location"],"0052":["UI","1","FrameOfReferenceUID"],"0060":["CS","1","Laterality"],"0062":["CS","1","ImageLaterality"],"0070":["LO","1","ImageGeometryType"],"0080":["CS","1-n","MaskingImage"],"00AA":["IS","1","ReportNumber"],"0100":["IS","1","TemporalPositionIdentifier"],"0105":["IS","1","NumberOfTemporalPositions"],"0110":["DS","1","TemporalResolution"],"0200":["UI","1","SynchronizationFrameOfReferenceUID"],"0242":["UI","1","SOPInstanceUIDOfConcatenationSource"],1e3:["IS","1","SeriesInStudy"],1001:["IS","1","AcquisitionsInSeries"],1002:["IS","1","ImagesInAcquisition"],1003:["IS","1","ImagesInSeries"],1004:["IS","1","AcquisitionsInStudy"],1005:["IS","1","ImagesInStudy"],1020:["LO","1-n","Reference"],"103F":["LO","1","TargetPositionReferenceIndicator"],1040:["LO","1","PositionReferenceIndicator"],1041:["DS","1","SliceLocation"],1070:["IS","1-n","OtherStudyNumbers"],1200:["IS","1","NumberOfPatientRelatedStudies"],1202:["IS","1","NumberOfPatientRelatedSeries"],1204:["IS","1","NumberOfPatientRelatedInstances"],1206:["IS","1","NumberOfStudyRelatedSeries"],1208:["IS","1","NumberOfStudyRelatedInstances"],1209:["IS","1","NumberOfSeriesRelatedInstances"],3100:["CS","1-n","SourceImageIDs"],3401:["CS","1","ModifyingDeviceID"],3402:["CS","1","ModifiedImageID"],3403:["DA","1","ModifiedImageDate"],3404:["LO","1","ModifyingDeviceManufacturer"],3405:["TM","1","ModifiedImageTime"],3406:["LO","1","ModifiedImageDescription"],4e3:["LT","1","ImageComments"],5e3:["AT","1-n","OriginalImageIdentification"],5002:["LO","1-n","OriginalImageIdentificationNomenclature"],9056:["SH","1","StackID"],9057:["UL","1","InStackPositionNumber"],9071:["SQ","1","FrameAnatomySequence"],9072:["CS","1","FrameLaterality"],9111:["SQ","1","FrameContentSequence"],9113:["SQ","1","PlanePositionSequence"],9116:["SQ","1","PlaneOrientationSequence"],9128:["UL","1","TemporalPositionIndex"],9153:["FD","1","NominalCardiacTriggerDelayTime"],9154:["FL","1","NominalCardiacTriggerTimePriorToRPeak"],9155:["FL","1","ActualCardiacTriggerTimePriorToRPeak"],9156:["US","1","FrameAcquisitionNumber"],9157:["UL","1-n","DimensionIndexValues"],9158:["LT","1","FrameComments"],9161:["UI","1","ConcatenationUID"],9162:["US","1","InConcatenationNumber"],9163:["US","1","InConcatenationTotalNumber"],9164:["UI","1","DimensionOrganizationUID"],9165:["AT","1","DimensionIndexPointer"],9167:["AT","1","FunctionalGroupPointer"],9170:["SQ","1","UnassignedSharedConvertedAttributesSequence"],9171:["SQ","1","UnassignedPerFrameConvertedAttributesSequence"],9172:["SQ","1","ConversionSourceAttributesSequence"],9213:["LO","1","DimensionIndexPrivateCreator"],9221:["SQ","1","DimensionOrganizationSequence"],9222:["SQ","1","DimensionIndexSequence"],9228:["UL","1","ConcatenationFrameOffsetNumber"],9238:["LO","1","FunctionalGroupPrivateCreator"],9241:["FL","1","NominalPercentageOfCardiacPhase"],9245:["FL","1","NominalPercentageOfRespiratoryPhase"],9246:["FL","1","StartingRespiratoryAmplitude"],9247:["CS","1","StartingRespiratoryPhase"],9248:["FL","1","EndingRespiratoryAmplitude"],9249:["CS","1","EndingRespiratoryPhase"],9250:["CS","1","RespiratoryTriggerType"],9251:["FD","1","RRIntervalTimeNominal"],9252:["FD","1","ActualCardiacTriggerDelayTime"],9253:["SQ","1","RespiratorySynchronizationSequence"],9254:["FD","1","RespiratoryIntervalTime"],9255:["FD","1","NominalRespiratoryTriggerDelayTime"],9256:["FD","1","RespiratoryTriggerDelayThreshold"],9257:["FD","1","ActualRespiratoryTriggerDelayTime"],9301:["FD","3","ImagePositionVolume"],9302:["FD","6","ImageOrientationVolume"],9307:["CS","1","UltrasoundAcquisitionGeometry"],9308:["FD","3","ApexPosition"],9309:["FD","16","VolumeToTransducerMappingMatrix"],"930A":["FD","16","VolumeToTableMappingMatrix"],"930B":["CS","1","VolumeToTransducerRelationship"],"930C":["CS","1","PatientFrameOfReferenceSource"],"930D":["FD","1","TemporalPositionTimeOffset"],"930E":["SQ","1","PlanePositionVolumeSequence"],"930F":["SQ","1","PlaneOrientationVolumeSequence"],9310:["SQ","1","TemporalPositionSequence"],9311:["CS","1","DimensionOrganizationType"],9312:["UI","1","VolumeFrameOfReferenceUID"],9313:["UI","1","TableFrameOfReferenceUID"],9421:["LO","1","DimensionDescriptionLabel"],9450:["SQ","1","PatientOrientationInFrameSequence"],9453:["LO","1","FrameLabel"],9518:["US","1-n","AcquisitionIndex"],9529:["SQ","1","ContributingSOPInstancesReferenceSequence"],9536:["US","1","ReconstructionIndex"]},"0022":{"0000":["UL","1","GenericGroupLength"],"0001":["US","1","LightPathFilterPassThroughWavelength"],"0002":["US","2","LightPathFilterPassBand"],"0003":["US","1","ImagePathFilterPassThroughWavelength"],"0004":["US","2","ImagePathFilterPassBand"],"0005":["CS","1","PatientEyeMovementCommanded"],"0006":["SQ","1","PatientEyeMovementCommandCodeSequence"],"0007":["FL","1","SphericalLensPower"],"0008":["FL","1","CylinderLensPower"],"0009":["FL","1","CylinderAxis"],"000A":["FL","1","EmmetropicMagnification"],"000B":["FL","1","IntraOcularPressure"],"000C":["FL","1","HorizontalFieldOfView"],"000D":["CS","1","PupilDilated"],"000E":["FL","1","DegreeOfDilation"],"0010":["FL","1","StereoBaselineAngle"],"0011":["FL","1","StereoBaselineDisplacement"],"0012":["FL","1","StereoHorizontalPixelOffset"],"0013":["FL","1","StereoVerticalPixelOffset"],"0014":["FL","1","StereoRotation"],"0015":["SQ","1","AcquisitionDeviceTypeCodeSequence"],"0016":["SQ","1","IlluminationTypeCodeSequence"],"0017":["SQ","1","LightPathFilterTypeStackCodeSequence"],"0018":["SQ","1","ImagePathFilterTypeStackCodeSequence"],"0019":["SQ","1","LensesCodeSequence"],"001A":["SQ","1","ChannelDescriptionCodeSequence"],"001B":["SQ","1","RefractiveStateSequence"],"001C":["SQ","1","MydriaticAgentCodeSequence"],"001D":["SQ","1","RelativeImagePositionCodeSequence"],"001E":["FL","1","CameraAngleOfView"],"0020":["SQ","1","StereoPairsSequence"],"0021":["SQ","1","LeftImageSequence"],"0022":["SQ","1","RightImageSequence"],"0028":["CS","1","StereoPairsPresent"],"0030":["FL","1","AxialLengthOfTheEye"],"0031":["SQ","1","OphthalmicFrameLocationSequence"],"0032":["FL","2-2n","ReferenceCoordinates"],"0035":["FL","1","DepthSpatialResolution"],"0036":["FL","1","MaximumDepthDistortion"],"0037":["FL","1","AlongScanSpatialResolution"],"0038":["FL","1","MaximumAlongScanDistortion"],"0039":["CS","1","OphthalmicImageOrientation"],"0041":["FL","1","DepthOfTransverseImage"],"0042":["SQ","1","MydriaticAgentConcentrationUnitsSequence"],"0048":["FL","1","AcrossScanSpatialResolution"],"0049":["FL","1","MaximumAcrossScanDistortion"],"004E":["DS","1","MydriaticAgentConcentration"],"0055":["FL","1","IlluminationWaveLength"],"0056":["FL","1","IlluminationPower"],"0057":["FL","1","IlluminationBandwidth"],"0058":["SQ","1","MydriaticAgentSequence"],1007:["SQ","1","OphthalmicAxialMeasurementsRightEyeSequence"],1008:["SQ","1","OphthalmicAxialMeasurementsLeftEyeSequence"],1009:["CS","1","OphthalmicAxialMeasurementsDeviceType"],1010:["CS","1","OphthalmicAxialLengthMeasurementsType"],1012:["SQ","1","OphthalmicAxialLengthSequence"],1019:["FL","1","OphthalmicAxialLength"],1024:["SQ","1","LensStatusCodeSequence"],1025:["SQ","1","VitreousStatusCodeSequence"],1028:["SQ","1","IOLFormulaCodeSequence"],1029:["LO","1","IOLFormulaDetail"],1033:["FL","1","KeratometerIndex"],1035:["SQ","1","SourceOfOphthalmicAxialLengthCodeSequence"],1036:["SQ","1","SourceOfCornealSizeDataCodeSequence"],1037:["FL","1","TargetRefraction"],1039:["CS","1","RefractiveProcedureOccurred"],1040:["SQ","1","RefractiveSurgeryTypeCodeSequence"],1044:["SQ","1","OphthalmicUltrasoundMethodCodeSequence"],1045:["SQ","1","SurgicallyInducedAstigmatismSequence"],1046:["CS","1","TypeOfOpticalCorrection"],1047:["SQ","1","ToricIOLPowerSequence"],1048:["SQ","1","PredictedToricErrorSequence"],1049:["CS","1","PreSelectedForImplantation"],"104A":["SQ","1","ToricIOLPowerForExactEmmetropiaSequence"],"104B":["SQ","1","ToricIOLPowerForExactTargetRefractionSequence"],1050:["SQ","1","OphthalmicAxialLengthMeasurementsSequence"],1053:["FL","1","IOLPower"],1054:["FL","1","PredictedRefractiveError"],1059:["FL","1","OphthalmicAxialLengthVelocity"],1065:["LO","1","LensStatusDescription"],1066:["LO","1","VitreousStatusDescription"],1090:["SQ","1","IOLPowerSequence"],1092:["SQ","1","LensConstantSequence"],1093:["LO","1","IOLManufacturer"],1094:["LO","1","LensConstantDescription"],1095:["LO","1","ImplantName"],1096:["SQ","1","KeratometryMeasurementTypeCodeSequence"],1097:["LO","1","ImplantPartNumber"],1100:["SQ","1","ReferencedOphthalmicAxialMeasurementsSequence"],1101:["SQ","1","OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence"],1103:["SQ","1","RefractiveErrorBeforeRefractiveSurgeryCodeSequence"],1121:["FL","1","IOLPowerForExactEmmetropia"],1122:["FL","1","IOLPowerForExactTargetRefraction"],1125:["SQ","1","AnteriorChamberDepthDefinitionCodeSequence"],1127:["SQ","1","LensThicknessSequence"],1128:["SQ","1","AnteriorChamberDepthSequence"],"112A":["SQ","1","CalculationCommentSequence"],"112B":["CS","1","CalculationCommentType"],"112C":["LT","1","CalculationComment"],1130:["FL","1","LensThickness"],1131:["FL","1","AnteriorChamberDepth"],1132:["SQ","1","SourceOfLensThicknessDataCodeSequence"],1133:["SQ","1","SourceOfAnteriorChamberDepthDataCodeSequence"],1134:["SQ","1","SourceOfRefractiveMeasurementsSequence"],1135:["SQ","1","SourceOfRefractiveMeasurementsCodeSequence"],1140:["CS","1","OphthalmicAxialLengthMeasurementModified"],1150:["SQ","1","OphthalmicAxialLengthDataSourceCodeSequence"],1153:["SQ","1","OphthalmicAxialLengthAcquisitionMethodCodeSequence"],1155:["FL","1","SignalToNoiseRatio"],1159:["LO","1","OphthalmicAxialLengthDataSourceDescription"],1210:["SQ","1","OphthalmicAxialLengthMeasurementsTotalLengthSequence"],1211:["SQ","1","OphthalmicAxialLengthMeasurementsSegmentalLengthSequence"],1212:["SQ","1","OphthalmicAxialLengthMeasurementsLengthSummationSequence"],1220:["SQ","1","UltrasoundOphthalmicAxialLengthMeasurementsSequence"],1225:["SQ","1","OpticalOphthalmicAxialLengthMeasurementsSequence"],1230:["SQ","1","UltrasoundSelectedOphthalmicAxialLengthSequence"],1250:["SQ","1","OphthalmicAxialLengthSelectionMethodCodeSequence"],1255:["SQ","1","OpticalSelectedOphthalmicAxialLengthSequence"],1257:["SQ","1","SelectedSegmentalOphthalmicAxialLengthSequence"],1260:["SQ","1","SelectedTotalOphthalmicAxialLengthSequence"],1262:["SQ","1","OphthalmicAxialLengthQualityMetricSequence"],1265:["SQ","1","OphthalmicAxialLengthQualityMetricTypeCodeSequence"],1273:["LO","1","OphthalmicAxialLengthQualityMetricTypeDescription"],1300:["SQ","1","IntraocularLensCalculationsRightEyeSequence"],1310:["SQ","1","IntraocularLensCalculationsLeftEyeSequence"],1330:["SQ","1","ReferencedOphthalmicAxialLengthMeasurementQCImageSequence"],1415:["CS","1","OphthalmicMappingDeviceType"],1420:["SQ","1","AcquisitionMethodCodeSequence"],1423:["SQ","1","AcquisitionMethodAlgorithmSequence"],1436:["SQ","1","OphthalmicThicknessMapTypeCodeSequence"],1443:["SQ","1","OphthalmicThicknessMappingNormalsSequence"],1445:["SQ","1","RetinalThicknessDefinitionCodeSequence"],1450:["SQ","1","PixelValueMappingToCodedConceptSequence"],1452:["xs","1","MappedPixelValue"],1454:["LO","1","PixelValueMappingExplanation"],1458:["SQ","1","OphthalmicThicknessMapQualityThresholdSequence"],1460:["FL","1","OphthalmicThicknessMapThresholdQualityRating"],1463:["FL","2","AnatomicStructureReferencePoint"],1465:["SQ","1","RegistrationToLocalizerSequence"],1466:["CS","1","RegisteredLocalizerUnits"],1467:["FL","2","RegisteredLocalizerTopLeftHandCorner"],1468:["FL","2","RegisteredLocalizerBottomRightHandCorner"],1470:["SQ","1","OphthalmicThicknessMapQualityRatingSequence"],1472:["SQ","1","RelevantOPTAttributesSequence"],1512:["SQ","1","TransformationMethodCodeSequence"],1513:["SQ","1","TransformationAlgorithmSequence"],1515:["CS","1","OphthalmicAxialLengthMethod"],1517:["FL","1","OphthalmicFOV"],1518:["SQ","1","TwoDimensionalToThreeDimensionalMapSequence"],1525:["SQ","1","WideFieldOphthalmicPhotographyQualityRatingSequence"],1526:["SQ","1","WideFieldOphthalmicPhotographyQualityThresholdSequence"],1527:["FL","1","WideFieldOphthalmicPhotographyThresholdQualityRating"],1528:["FL","1","XCoordinatesCenterPixelViewAngle"],1529:["FL","1","YCoordinatesCenterPixelViewAngle"],1530:["UL","1","NumberOfMapPoints"],1531:["OF","1","TwoDimensionalToThreeDimensionalMapData"],1612:["SQ","1","DerivationAlgorithmSequence"],1615:["SQ","1","OphthalmicImageTypeCodeSequence"],1616:["LO","1","OphthalmicImageTypeDescription"],1618:["SQ","1","ScanPatternTypeCodeSequence"],1620:["SQ","1","ReferencedSurfaceMeshIdentificationSequence"],1622:["CS","1","OphthalmicVolumetricPropertiesFlag"],1624:["FL","1","OphthalmicAnatomicReferencePointXCoordinate"],1626:["FL","1","OphthalmicAnatomicReferencePointYCoordinate"],1628:["SQ","1","OphthalmicEnFaceImageQualityRatingSequence"],1630:["DS","1","QualityThreshold"],1640:["SQ","1","OCTBscanAnalysisAcquisitionParametersSequence"],1642:["UL","1","NumberOfBscansPerFrame"],1643:["FL","1","BscanSlabThickness"],1644:["FL","1","DistanceBetweenBscanSlabs"],1645:["FL","1","BscanCycleTime"],1646:["FL","1-n","BscanCycleTimeVector"],1649:["FL","1","AscanRate"],1650:["FL","1","BscanRate"],1658:["UL","1","SurfaceMeshZPixelOffset"]},"0024":{"0000":["UL","1","GenericGroupLength"],"0010":["FL","1","VisualFieldHorizontalExtent"],"0011":["FL","1","VisualFieldVerticalExtent"],"0012":["CS","1","VisualFieldShape"],"0016":["SQ","1","ScreeningTestModeCodeSequence"],"0018":["FL","1","MaximumStimulusLuminance"],"0020":["FL","1","BackgroundLuminance"],"0021":["SQ","1","StimulusColorCodeSequence"],"0024":["SQ","1","BackgroundIlluminationColorCodeSequence"],"0025":["FL","1","StimulusArea"],"0028":["FL","1","StimulusPresentationTime"],"0032":["SQ","1","FixationSequence"],"0033":["SQ","1","FixationMonitoringCodeSequence"],"0034":["SQ","1","VisualFieldCatchTrialSequence"],"0035":["US","1","FixationCheckedQuantity"],"0036":["US","1","PatientNotProperlyFixatedQuantity"],"0037":["CS","1","PresentedVisualStimuliDataFlag"],"0038":["US","1","NumberOfVisualStimuli"],"0039":["CS","1","ExcessiveFixationLossesDataFlag"],"0040":["CS","1","ExcessiveFixationLosses"],"0042":["US","1","StimuliRetestingQuantity"],"0044":["LT","1","CommentsOnPatientPerformanceOfVisualField"],"0045":["CS","1","FalseNegativesEstimateFlag"],"0046":["FL","1","FalseNegativesEstimate"],"0048":["US","1","NegativeCatchTrialsQuantity"],"0050":["US","1","FalseNegativesQuantity"],"0051":["CS","1","ExcessiveFalseNegativesDataFlag"],"0052":["CS","1","ExcessiveFalseNegatives"],"0053":["CS","1","FalsePositivesEstimateFlag"],"0054":["FL","1","FalsePositivesEstimate"],"0055":["CS","1","CatchTrialsDataFlag"],"0056":["US","1","PositiveCatchTrialsQuantity"],"0057":["CS","1","TestPointNormalsDataFlag"],"0058":["SQ","1","TestPointNormalsSequence"],"0059":["CS","1","GlobalDeviationProbabilityNormalsFlag"],"0060":["US","1","FalsePositivesQuantity"],"0061":["CS","1","ExcessiveFalsePositivesDataFlag"],"0062":["CS","1","ExcessiveFalsePositives"],"0063":["CS","1","VisualFieldTestNormalsFlag"],"0064":["SQ","1","ResultsNormalsSequence"],"0065":["SQ","1","AgeCorrectedSensitivityDeviationAlgorithmSequence"],"0066":["FL","1","GlobalDeviationFromNormal"],"0067":["SQ","1","GeneralizedDefectSensitivityDeviationAlgorithmSequence"],"0068":["FL","1","LocalizedDeviationFromNormal"],"0069":["LO","1","PatientReliabilityIndicator"],"0070":["FL","1","VisualFieldMeanSensitivity"],"0071":["FL","1","GlobalDeviationProbability"],"0072":["CS","1","LocalDeviationProbabilityNormalsFlag"],"0073":["FL","1","LocalizedDeviationProbability"],"0074":["CS","1","ShortTermFluctuationCalculated"],"0075":["FL","1","ShortTermFluctuation"],"0076":["CS","1","ShortTermFluctuationProbabilityCalculated"],"0077":["FL","1","ShortTermFluctuationProbability"],"0078":["CS","1","CorrectedLocalizedDeviationFromNormalCalculated"],"0079":["FL","1","CorrectedLocalizedDeviationFromNormal"],"0080":["CS","1","CorrectedLocalizedDeviationFromNormalProbabilityCalculated"],"0081":["FL","1","CorrectedLocalizedDeviationFromNormalProbability"],"0083":["SQ","1","GlobalDeviationProbabilitySequence"],"0085":["SQ","1","LocalizedDeviationProbabilitySequence"],"0086":["CS","1","FovealSensitivityMeasured"],"0087":["FL","1","FovealSensitivity"],"0088":["FL","1","VisualFieldTestDuration"],"0089":["SQ","1","VisualFieldTestPointSequence"],"0090":["FL","1","VisualFieldTestPointXCoordinate"],"0091":["FL","1","VisualFieldTestPointYCoordinate"],"0092":["FL","1","AgeCorrectedSensitivityDeviationValue"],"0093":["CS","1","StimulusResults"],"0094":["FL","1","SensitivityValue"],"0095":["CS","1","RetestStimulusSeen"],"0096":["FL","1","RetestSensitivityValue"],"0097":["SQ","1","VisualFieldTestPointNormalsSequence"],"0098":["FL","1","QuantifiedDefect"],"0100":["FL","1","AgeCorrectedSensitivityDeviationProbabilityValue"],"0102":["CS","1","GeneralizedDefectCorrectedSensitivityDeviationFlag"],"0103":["FL","1","GeneralizedDefectCorrectedSensitivityDeviationValue"],"0104":["FL","1","GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue"],"0105":["FL","1","MinimumSensitivityValue"],"0106":["CS","1","BlindSpotLocalized"],"0107":["FL","1","BlindSpotXCoordinate"],"0108":["FL","1","BlindSpotYCoordinate"],"0110":["SQ","1","VisualAcuityMeasurementSequence"],"0112":["SQ","1","RefractiveParametersUsedOnPatientSequence"],"0113":["CS","1","MeasurementLaterality"],"0114":["SQ","1","OphthalmicPatientClinicalInformationLeftEyeSequence"],"0115":["SQ","1","OphthalmicPatientClinicalInformationRightEyeSequence"],"0117":["CS","1","FovealPointNormativeDataFlag"],"0118":["FL","1","FovealPointProbabilityValue"],"0120":["CS","1","ScreeningBaselineMeasured"],"0122":["SQ","1","ScreeningBaselineMeasuredSequence"],"0124":["CS","1","ScreeningBaselineType"],"0126":["FL","1","ScreeningBaselineValue"],"0202":["LO","1","AlgorithmSource"],"0306":["LO","1","DataSetName"],"0307":["LO","1","DataSetVersion"],"0308":["LO","1","DataSetSource"],"0309":["LO","1","DataSetDescription"],"0317":["SQ","1","VisualFieldTestReliabilityGlobalIndexSequence"],"0320":["SQ","1","VisualFieldGlobalResultsIndexSequence"],"0325":["SQ","1","DataObservationSequence"],"0338":["CS","1","IndexNormalsFlag"],"0341":["FL","1","IndexProbability"],"0344":["SQ","1","IndexProbabilitySequence"]},"0028":{"0000":["UL","1","GenericGroupLength"],"0002":["US","1","SamplesPerPixel"],"0003":["US","1","SamplesPerPixelUsed"],"0004":["CS","1","PhotometricInterpretation"],"0005":["US","1","ImageDimensions"],"0006":["US","1","PlanarConfiguration"],"0008":["IS","1","NumberOfFrames"],"0009":["AT","1-n","FrameIncrementPointer"],"000A":["AT","1-n","FrameDimensionPointer"],"0010":["US","1","Rows"],"0011":["US","1","Columns"],"0012":["US","1","Planes"],"0014":["US","1","UltrasoundColorDataPresent"],"0020":["","",""],"0030":["DS","2","PixelSpacing"],"0031":["DS","2","ZoomFactor"],"0032":["DS","2","ZoomCenter"],"0034":["IS","2","PixelAspectRatio"],"0040":["CS","1","ImageFormat"],"0050":["LO","1-n","ManipulatedImage"],"0051":["CS","1-n","CorrectedImage"],"005F":["LO","1","CompressionRecognitionCode"],"0060":["CS","1","CompressionCode"],"0061":["SH","1","CompressionOriginator"],"0062":["LO","1","CompressionLabel"],"0063":["SH","1","CompressionDescription"],"0065":["CS","1-n","CompressionSequence"],"0066":["AT","1-n","CompressionStepPointers"],"0068":["US","1","RepeatInterval"],"0069":["US","1","BitsGrouped"],"0070":["US","1-n","PerimeterTable"],"0071":["xs","1","PerimeterValue"],"0080":["US","1","PredictorRows"],"0081":["US","1","PredictorColumns"],"0082":["US","1-n","PredictorConstants"],"0090":["CS","1","BlockedPixels"],"0091":["US","1","BlockRows"],"0092":["US","1","BlockColumns"],"0093":["US","1","RowOverlap"],"0094":["US","1","ColumnOverlap"],"0100":["US","1","BitsAllocated"],"0101":["US","1","BitsStored"],"0102":["US","1","HighBit"],"0103":["US","1","PixelRepresentation"],"0104":["xs","1","SmallestValidPixelValue"],"0105":["xs","1","LargestValidPixelValue"],"0106":["xs","1","SmallestImagePixelValue"],"0107":["xs","1","LargestImagePixelValue"],"0108":["xs","1","SmallestPixelValueInSeries"],"0109":["xs","1","LargestPixelValueInSeries"],"0110":["xs","1","SmallestImagePixelValueInPlane"],"0111":["xs","1","LargestImagePixelValueInPlane"],"0120":["xs","1","PixelPaddingValue"],"0121":["xs","1","PixelPaddingRangeLimit"],"0122":["FL","1","FloatPixelPaddingValue"],"0123":["FD","1","DoubleFloatPixelPaddingValue"],"0124":["FL","1","FloatPixelPaddingRangeLimit"],"0125":["FD","1","DoubleFloatPixelPaddingRangeLimit"],"0200":["US","1","ImageLocation"],"0300":["CS","1","QualityControlImage"],"0301":["CS","1","BurnedInAnnotation"],"0302":["CS","1","RecognizableVisualFeatures"],"0303":["CS","1","LongitudinalTemporalInformationModified"],"0304":["UI","1","ReferencedColorPaletteInstanceUID"],"0400":["LO","1","TransformLabel"],"0401":["LO","1","TransformVersionNumber"],"0402":["US","1","NumberOfTransformSteps"],"0403":["LO","1-n","SequenceOfCompressedData"],"0404":["AT","1-n","DetailsOfCoefficients"],"04x0":["US","1","RowsForNthOrderCoefficients"],"04x1":["US","1","ColumnsForNthOrderCoefficients"],"04x2":["LO","1-n","CoefficientCoding"],"04x3":["AT","1-n","CoefficientCodingPointers"],"0700":["LO","1","DCTLabel"],"0701":["CS","1-n","DataBlockDescription"],"0702":["AT","1-n","DataBlock"],"0710":["US","1","NormalizationFactorFormat"],"0720":["US","1","ZonalMapNumberFormat"],"0721":["AT","1-n","ZonalMapLocation"],"0722":["US","1","ZonalMapFormat"],"0730":["US","1","AdaptiveMapFormat"],"0740":["US","1","CodeNumberFormat"],"08x0":["CS","1-n","CodeLabel"],"08x2":["US","1","NumberOfTables"],"08x3":["AT","1-n","CodeTableLocation"],"08x4":["US","1","BitsForCodeWord"],"08x8":["AT","1-n","ImageDataLocation"],"0A02":["CS","1","PixelSpacingCalibrationType"],"0A04":["LO","1","PixelSpacingCalibrationDescription"],1040:["CS","1","PixelIntensityRelationship"],1041:["SS","1","PixelIntensityRelationshipSign"],1050:["DS","1-n","WindowCenter"],1051:["DS","1-n","WindowWidth"],1052:["DS","1","RescaleIntercept"],1053:["DS","1","RescaleSlope"],1054:["LO","1","RescaleType"],1055:["LO","1-n","WindowCenterWidthExplanation"],1056:["CS","1","VOILUTFunction"],1080:["CS","1","GrayScale"],1090:["CS","1","RecommendedViewingMode"],1100:["xs","3","GrayLookupTableDescriptor"],1101:["xs","3","RedPaletteColorLookupTableDescriptor"],1102:["xs","3","GreenPaletteColorLookupTableDescriptor"],1103:["xs","3","BluePaletteColorLookupTableDescriptor"],1104:["US","3","AlphaPaletteColorLookupTableDescriptor"],1111:["xs","4","LargeRedPaletteColorLookupTableDescriptor"],1112:["xs","4","LargeGreenPaletteColorLookupTableDescriptor"],1113:["xs","4","LargeBluePaletteColorLookupTableDescriptor"],1199:["UI","1","PaletteColorLookupTableUID"],1200:["xs","1-n or 1","GrayLookupTableData"],1201:["OW","1","RedPaletteColorLookupTableData"],1202:["OW","1","GreenPaletteColorLookupTableData"],1203:["OW","1","BluePaletteColorLookupTableData"],1204:["OW","1","AlphaPaletteColorLookupTableData"],1211:["OW","1","LargeRedPaletteColorLookupTableData"],1212:["OW","1","LargeGreenPaletteColorLookupTableData"],1213:["OW","1","LargeBluePaletteColorLookupTableData"],1214:["UI","1","LargePaletteColorLookupTableUID"],1221:["OW","1","SegmentedRedPaletteColorLookupTableData"],1222:["OW","1","SegmentedGreenPaletteColorLookupTableData"],1223:["OW","1","SegmentedBluePaletteColorLookupTableData"],1224:["OW","1","SegmentedAlphaPaletteColorLookupTableData"],1230:["SQ","1","StoredValueColorRangeSequence"],1231:["FD","1","MinimumStoredValueMapped"],1232:["FD","1","MaximumStoredValueMapped"],1300:["CS","1","BreastImplantPresent"],1350:["CS","1","PartialView"],1351:["ST","1","PartialViewDescription"],1352:["SQ","1","PartialViewCodeSequence"],"135A":["CS","1","SpatialLocationsPreserved"],1401:["SQ","1","DataFrameAssignmentSequence"],1402:["CS","1","DataPathAssignment"],1403:["US","1","BitsMappedToColorLookupTable"],1404:["SQ","1","BlendingLUT1Sequence"],1405:["CS","1","BlendingLUT1TransferFunction"],1406:["FD","1","BlendingWeightConstant"],1407:["US","3","BlendingLookupTableDescriptor"],1408:["OW","1","BlendingLookupTableData"],"140B":["SQ","1","EnhancedPaletteColorLookupTableSequence"],"140C":["SQ","1","BlendingLUT2Sequence"],"140D":["CS","1","BlendingLUT2TransferFunction"],"140E":["CS","1","DataPathID"],"140F":["CS","1","RGBLUTTransferFunction"],1410:["CS","1","AlphaLUTTransferFunction"],2e3:["OB","1","ICCProfile"],2002:["CS","1","ColorSpace"],2110:["CS","1","LossyImageCompression"],2112:["DS","1-n","LossyImageCompressionRatio"],2114:["CS","1-n","LossyImageCompressionMethod"],3e3:["SQ","1","ModalityLUTSequence"],3002:["xs","3","LUTDescriptor"],3003:["LO","1","LUTExplanation"],3004:["LO","1","ModalityLUTType"],3006:["xx","1-n or 1","LUTData"],3010:["SQ","1","VOILUTSequence"],3110:["SQ","1","SoftcopyVOILUTSequence"],4e3:["LT","1","ImagePresentationComments"],5e3:["SQ","1","BiPlaneAcquisitionSequence"],6010:["US","1","RepresentativeFrameNumber"],6020:["US","1-n","FrameNumbersOfInterest"],6022:["LO","1-n","FrameOfInterestDescription"],6023:["CS","1-n","FrameOfInterestType"],6030:["US","1-n","MaskPointers"],6040:["US","1-n","RWavePointer"],6100:["SQ","1","MaskSubtractionSequence"],6101:["CS","1","MaskOperation"],6102:["US","2-2n","ApplicableFrameRange"],6110:["US","1-n","MaskFrameNumbers"],6112:["US","1","ContrastFrameAveraging"],6114:["FL","2","MaskSubPixelShift"],6120:["SS","1","TIDOffset"],6190:["ST","1","MaskOperationExplanation"],7e3:["SQ","1","EquipmentAdministratorSequence"],7001:["US","1","NumberOfDisplaySubsystems"],7002:["US","1","CurrentConfigurationID"],7003:["US","1","DisplaySubsystemID"],7004:["SH","1","DisplaySubsystemName"],7005:["LO","1","DisplaySubsystemDescription"],7006:["CS","1","SystemStatus"],7007:["LO","1","SystemStatusComment"],7008:["SQ","1","TargetLuminanceCharacteristicsSequence"],7009:["US","1","LuminanceCharacteristicsID"],"700A":["SQ","1","DisplaySubsystemConfigurationSequence"],"700B":["US","1","ConfigurationID"],"700C":["SH","1","ConfigurationName"],"700D":["LO","1","ConfigurationDescription"],"700E":["US","1","ReferencedTargetLuminanceCharacteristicsID"],"700F":["SQ","1","QAResultsSequence"],7010:["SQ","1","DisplaySubsystemQAResultsSequence"],7011:["SQ","1","ConfigurationQAResultsSequence"],7012:["SQ","1","MeasurementEquipmentSequence"],7013:["CS","1-n","MeasurementFunctions"],7014:["CS","1","MeasurementEquipmentType"],7015:["SQ","1","VisualEvaluationResultSequence"],7016:["SQ","1","DisplayCalibrationResultSequence"],7017:["US","1","DDLValue"],7018:["FL","2","CIExyWhitePoint"],7019:["CS","1","DisplayFunctionType"],"701A":["FL","1","GammaValue"],"701B":["US","1","NumberOfLuminancePoints"],"701C":["SQ","1","LuminanceResponseSequence"],"701D":["FL","1","TargetMinimumLuminance"],"701E":["FL","1","TargetMaximumLuminance"],"701F":["FL","1","LuminanceValue"],7020:["LO","1","LuminanceResponseDescription"],7021:["CS","1","WhitePointFlag"],7022:["SQ","1","DisplayDeviceTypeCodeSequence"],7023:["SQ","1","DisplaySubsystemSequence"],7024:["SQ","1","LuminanceResultSequence"],7025:["CS","1","AmbientLightValueSource"],7026:["CS","1-n","MeasuredCharacteristics"],7027:["SQ","1","LuminanceUniformityResultSequence"],7028:["SQ","1","VisualEvaluationTestSequence"],7029:["CS","1","TestResult"],"702A":["LO","1","TestResultComment"],"702B":["CS","1","TestImageValidation"],"702C":["SQ","1","TestPatternCodeSequence"],"702D":["SQ","1","MeasurementPatternCodeSequence"],"702E":["SQ","1","VisualEvaluationMethodCodeSequence"],"7FE0":["UR","1","PixelDataProviderURL"],9001:["UL","1","DataPointRows"],9002:["UL","1","DataPointColumns"],9003:["CS","1","SignalDomainColumns"],9099:["US","1","LargestMonochromePixelValue"],9108:["CS","1","DataRepresentation"],9110:["SQ","1","PixelMeasuresSequence"],9132:["SQ","1","FrameVOILUTSequence"],9145:["SQ","1","PixelValueTransformationSequence"],9235:["CS","1","SignalDomainRows"],9411:["FL","1","DisplayFilterPercentage"],9415:["SQ","1","FramePixelShiftSequence"],9416:["US","1","SubtractionItemID"],9422:["SQ","1","PixelIntensityRelationshipLUTSequence"],9443:["SQ","1","FramePixelDataPropertiesSequence"],9444:["CS","1","GeometricalProperties"],9445:["FL","1","GeometricMaximumDistortion"],9446:["CS","1-n","ImageProcessingApplied"],9454:["CS","1","MaskSelectionMode"],9474:["CS","1","LUTFunction"],9478:["FL","1","MaskVisibilityPercentage"],9501:["SQ","1","PixelShiftSequence"],9502:["SQ","1","RegionPixelShiftSequence"],9503:["SS","2-2n","VerticesOfTheRegion"],9505:["SQ","1","MultiFramePresentationSequence"],9506:["US","2-2n","PixelShiftFrameRange"],9507:["US","2-2n","LUTFrameRange"],9520:["DS","16","ImageToEquipmentMappingMatrix"],9537:["CS","1","EquipmentCoordinateSystemIdentification"]},"0032":{"0000":["UL","1","GenericGroupLength"],"000A":["CS","1","StudyStatusID"],"000C":["CS","1","StudyPriorityID"],"0012":["LO","1","StudyIDIssuer"],"0032":["DA","1","StudyVerifiedDate"],"0033":["TM","1","StudyVerifiedTime"],"0034":["DA","1","StudyReadDate"],"0035":["TM","1","StudyReadTime"],1e3:["DA","1","ScheduledStudyStartDate"],1001:["TM","1","ScheduledStudyStartTime"],1010:["DA","1","ScheduledStudyStopDate"],1011:["TM","1","ScheduledStudyStopTime"],1020:["LO","1","ScheduledStudyLocation"],1021:["AE","1-n","ScheduledStudyLocationAETitle"],1030:["LO","1","ReasonForStudy"],1031:["SQ","1","RequestingPhysicianIdentificationSequence"],1032:["PN","1","RequestingPhysician"],1033:["LO","1","RequestingService"],1034:["SQ","1","RequestingServiceCodeSequence"],1040:["DA","1","StudyArrivalDate"],1041:["TM","1","StudyArrivalTime"],1050:["DA","1","StudyCompletionDate"],1051:["TM","1","StudyCompletionTime"],1055:["CS","1","StudyComponentStatusID"],1060:["LO","1","RequestedProcedureDescription"],1064:["SQ","1","RequestedProcedureCodeSequence"],1065:["SQ","1","RequestedLateralityCodeSequence"],1066:["UT","1","ReasonForVisit"],1067:["SQ","1","ReasonForVisitCodeSequence"],1070:["LO","1","RequestedContrastAgent"],4e3:["LT","1","StudyComments"]},"0034":{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","FlowIdentifierSequence"],"0002":["OB","1","FlowIdentifier"],"0003":["UI","1","FlowTransferSyntaxUID"],"0004":["UL","1","FlowRTPSamplingRate"],"0005":["OB","1","SourceIdentifier"],"0007":["OB","1","FrameOriginTimestamp"],"0008":["CS","1","IncludesImagingSubject"],"0009":["SQ","1","FrameUsefulnessGroupSequence"],"000A":["SQ","1","RealTimeBulkDataFlowSequence"],"000B":["SQ","1","CameraPositionGroupSequence"],"000C":["CS","1","IncludesInformation"],"000D":["SQ","1","TimeOfFrameGroupSequence"]},"0038":{"0000":["UL","1","GenericGroupLength"],"0004":["SQ","1","ReferencedPatientAliasSequence"],"0008":["CS","1","VisitStatusID"],"0010":["LO","1","AdmissionID"],"0011":["LO","1","IssuerOfAdmissionID"],"0014":["SQ","1","IssuerOfAdmissionIDSequence"],"0016":["LO","1","RouteOfAdmissions"],"001A":["DA","1","ScheduledAdmissionDate"],"001B":["TM","1","ScheduledAdmissionTime"],"001C":["DA","1","ScheduledDischargeDate"],"001D":["TM","1","ScheduledDischargeTime"],"001E":["LO","1","ScheduledPatientInstitutionResidence"],"0020":["DA","1","AdmittingDate"],"0021":["TM","1","AdmittingTime"],"0030":["DA","1","DischargeDate"],"0032":["TM","1","DischargeTime"],"0040":["LO","1","DischargeDiagnosisDescription"],"0044":["SQ","1","DischargeDiagnosisCodeSequence"],"0050":["LO","1","SpecialNeeds"],"0060":["LO","1","ServiceEpisodeID"],"0061":["LO","1","IssuerOfServiceEpisodeID"],"0062":["LO","1","ServiceEpisodeDescription"],"0064":["SQ","1","IssuerOfServiceEpisodeIDSequence"],"0100":["SQ","1","PertinentDocumentsSequence"],"0101":["SQ","1","PertinentResourcesSequence"],"0102":["LO","1","ResourceDescription"],"0300":["LO","1","CurrentPatientLocation"],"0400":["LO","1","PatientInstitutionResidence"],"0500":["LO","1","PatientState"],"0502":["SQ","1","PatientClinicalTrialParticipationSequence"],4e3:["LT","1","VisitComments"]},"003A":{"0000":["UL","1","GenericGroupLength"],"0004":["CS","1","WaveformOriginality"],"0005":["US","1","NumberOfWaveformChannels"],"0010":["UL","1","NumberOfWaveformSamples"],"001A":["DS","1","SamplingFrequency"],"0020":["SH","1","MultiplexGroupLabel"],"0200":["SQ","1","ChannelDefinitionSequence"],"0202":["IS","1","WaveformChannelNumber"],"0203":["SH","1","ChannelLabel"],"0205":["CS","1-n","ChannelStatus"],"0208":["SQ","1","ChannelSourceSequence"],"0209":["SQ","1","ChannelSourceModifiersSequence"],"020A":["SQ","1","SourceWaveformSequence"],"020C":["LO","1","ChannelDerivationDescription"],"0210":["DS","1","ChannelSensitivity"],"0211":["SQ","1","ChannelSensitivityUnitsSequence"],"0212":["DS","1","ChannelSensitivityCorrectionFactor"],"0213":["DS","1","ChannelBaseline"],"0214":["DS","1","ChannelTimeSkew"],"0215":["DS","1","ChannelSampleSkew"],"0218":["DS","1","ChannelOffset"],"021A":["US","1","WaveformBitsStored"],"0220":["DS","1","FilterLowFrequency"],"0221":["DS","1","FilterHighFrequency"],"0222":["DS","1","NotchFilterFrequency"],"0223":["DS","1","NotchFilterBandwidth"],"0230":["FL","1","WaveformDataDisplayScale"],"0231":["US","3","WaveformDisplayBackgroundCIELabValue"],"0240":["SQ","1","WaveformPresentationGroupSequence"],"0241":["US","1","PresentationGroupNumber"],"0242":["SQ","1","ChannelDisplaySequence"],"0244":["US","3","ChannelRecommendedDisplayCIELabValue"],"0245":["FL","1","ChannelPosition"],"0246":["CS","1","DisplayShadingFlag"],"0247":["FL","1","FractionalChannelDisplayScale"],"0248":["FL","1","AbsoluteChannelDisplayScale"],"0300":["SQ","1","MultiplexedAudioChannelsDescriptionCodeSequence"],"0301":["IS","1","ChannelIdentificationCode"],"0302":["CS","1","ChannelMode"],"0310":["UI","1","MultiplexGroupUID"],"0311":["DS","1","PowerlineFrequency"],"0312":["SQ","1","ChannelImpedanceSequence"],"0313":["DS","1","ImpedanceValue"],"0314":["DT","1","ImpedanceMeasurementDateTime"],"0315":["DS","1","ImpedanceMeasurementFrequency"],"0316":["CS","1","ImpedanceMeasurementCurrentType"]},"0040":{"0000":["UL","1","GenericGroupLength"],"0001":["AE","1-n","ScheduledStationAETitle"],"0002":["DA","1","ScheduledProcedureStepStartDate"],"0003":["TM","1","ScheduledProcedureStepStartTime"],"0004":["DA","1","ScheduledProcedureStepEndDate"],"0005":["TM","1","ScheduledProcedureStepEndTime"],"0006":["PN","1","ScheduledPerformingPhysicianName"],"0007":["LO","1","ScheduledProcedureStepDescription"],"0008":["SQ","1","ScheduledProtocolCodeSequence"],"0009":["SH","1","ScheduledProcedureStepID"],"000A":["SQ","1","StageCodeSequence"],"000B":["SQ","1","ScheduledPerformingPhysicianIdentificationSequence"],"0010":["SH","1-n","ScheduledStationName"],"0011":["SH","1","ScheduledProcedureStepLocation"],"0012":["LO","1","PreMedication"],"0020":["CS","1","ScheduledProcedureStepStatus"],"0026":["SQ","1","OrderPlacerIdentifierSequence"],"0027":["SQ","1","OrderFillerIdentifierSequence"],"0031":["UT","1","LocalNamespaceEntityID"],"0032":["UT","1","UniversalEntityID"],"0033":["CS","1","UniversalEntityIDType"],"0035":["CS","1","IdentifierTypeCode"],"0036":["SQ","1","AssigningFacilitySequence"],"0039":["SQ","1","AssigningJurisdictionCodeSequence"],"003A":["SQ","1","AssigningAgencyOrDepartmentCodeSequence"],"0100":["SQ","1","ScheduledProcedureStepSequence"],"0220":["SQ","1","ReferencedNonImageCompositeSOPInstanceSequence"],"0241":["AE","1","PerformedStationAETitle"],"0242":["SH","1","PerformedStationName"],"0243":["SH","1","PerformedLocation"],"0244":["DA","1","PerformedProcedureStepStartDate"],"0245":["TM","1","PerformedProcedureStepStartTime"],"0250":["DA","1","PerformedProcedureStepEndDate"],"0251":["TM","1","PerformedProcedureStepEndTime"],"0252":["CS","1","PerformedProcedureStepStatus"],"0253":["SH","1","PerformedProcedureStepID"],"0254":["LO","1","PerformedProcedureStepDescription"],"0255":["LO","1","PerformedProcedureTypeDescription"],"0260":["SQ","1","PerformedProtocolCodeSequence"],"0261":["CS","1","PerformedProtocolType"],"0270":["SQ","1","ScheduledStepAttributesSequence"],"0275":["SQ","1","RequestAttributesSequence"],"0280":["ST","1","CommentsOnThePerformedProcedureStep"],"0281":["SQ","1","PerformedProcedureStepDiscontinuationReasonCodeSequence"],"0293":["SQ","1","QuantitySequence"],"0294":["DS","1","Quantity"],"0295":["SQ","1","MeasuringUnitsSequence"],"0296":["SQ","1","BillingItemSequence"],"0300":["US","1","TotalTimeOfFluoroscopy"],"0301":["US","1","TotalNumberOfExposures"],"0302":["US","1","EntranceDose"],"0303":["US","1-2","ExposedArea"],"0306":["DS","1","DistanceSourceToEntrance"],"0307":["DS","1","DistanceSourceToSupport"],"030E":["SQ","1","ExposureDoseSequence"],"0310":["ST","1","CommentsOnRadiationDose"],"0312":["DS","1","XRayOutput"],"0314":["DS","1","HalfValueLayer"],"0316":["DS","1","OrganDose"],"0318":["CS","1","OrganExposed"],"0320":["SQ","1","BillingProcedureStepSequence"],"0321":["SQ","1","FilmConsumptionSequence"],"0324":["SQ","1","BillingSuppliesAndDevicesSequence"],"0330":["SQ","1","ReferencedProcedureStepSequence"],"0340":["SQ","1","PerformedSeriesSequence"],"0400":["LT","1","CommentsOnTheScheduledProcedureStep"],"0440":["SQ","1","ProtocolContextSequence"],"0441":["SQ","1","ContentItemModifierSequence"],"0500":["SQ","1","ScheduledSpecimenSequence"],"050A":["LO","1","SpecimenAccessionNumber"],"0512":["LO","1","ContainerIdentifier"],"0513":["SQ","1","IssuerOfTheContainerIdentifierSequence"],"0515":["SQ","1","AlternateContainerIdentifierSequence"],"0518":["SQ","1","ContainerTypeCodeSequence"],"051A":["LO","1","ContainerDescription"],"0520":["SQ","1","ContainerComponentSequence"],"0550":["SQ","1","SpecimenSequence"],"0551":["LO","1","SpecimenIdentifier"],"0552":["SQ","1","SpecimenDescriptionSequenceTrial"],"0553":["ST","1","SpecimenDescriptionTrial"],"0554":["UI","1","SpecimenUID"],"0555":["SQ","1","AcquisitionContextSequence"],"0556":["ST","1","AcquisitionContextDescription"],"0560":["SQ","1","SpecimenDescriptionSequence"],"0562":["SQ","1","IssuerOfTheSpecimenIdentifierSequence"],"059A":["SQ","1","SpecimenTypeCodeSequence"],"0600":["LO","1","SpecimenShortDescription"],"0602":["UT","1","SpecimenDetailedDescription"],"0610":["SQ","1","SpecimenPreparationSequence"],"0612":["SQ","1","SpecimenPreparationStepContentItemSequence"],"0620":["SQ","1","SpecimenLocalizationContentItemSequence"],"06FA":["LO","1","SlideIdentifier"],"0710":["SQ","1","WholeSlideMicroscopyImageFrameTypeSequence"],"071A":["SQ","1","ImageCenterPointCoordinatesSequence"],"072A":["DS","1","XOffsetInSlideCoordinateSystem"],"073A":["DS","1","YOffsetInSlideCoordinateSystem"],"074A":["DS","1","ZOffsetInSlideCoordinateSystem"],"08D8":["SQ","1","PixelSpacingSequence"],"08DA":["SQ","1","CoordinateSystemAxisCodeSequence"],"08EA":["SQ","1","MeasurementUnitsCodeSequence"],"09F8":["SQ","1","VitalStainCodeSequenceTrial"],1001:["SH","1","RequestedProcedureID"],1002:["LO","1","ReasonForTheRequestedProcedure"],1003:["SH","1","RequestedProcedurePriority"],1004:["LO","1","PatientTransportArrangements"],1005:["LO","1","RequestedProcedureLocation"],1006:["SH","1","PlacerOrderNumberProcedure"],1007:["SH","1","FillerOrderNumberProcedure"],1008:["LO","1","ConfidentialityCode"],1009:["SH","1","ReportingPriority"],"100A":["SQ","1","ReasonForRequestedProcedureCodeSequence"],1010:["PN","1-n","NamesOfIntendedRecipientsOfResults"],1011:["SQ","1","IntendedRecipientsOfResultsIdentificationSequence"],1012:["SQ","1","ReasonForPerformedProcedureCodeSequence"],1060:["LO","1","RequestedProcedureDescriptionTrial"],1101:["SQ","1","PersonIdentificationCodeSequence"],1102:["ST","1","PersonAddress"],1103:["LO","1-n","PersonTelephoneNumbers"],1104:["LT","1","PersonTelecomInformation"],1400:["LT","1","RequestedProcedureComments"],2001:["LO","1","ReasonForTheImagingServiceRequest"],2004:["DA","1","IssueDateOfImagingServiceRequest"],2005:["TM","1","IssueTimeOfImagingServiceRequest"],2006:["SH","1","PlacerOrderNumberImagingServiceRequestRetired"],2007:["SH","1","FillerOrderNumberImagingServiceRequestRetired"],2008:["PN","1","OrderEnteredBy"],2009:["SH","1","OrderEntererLocation"],2010:["SH","1","OrderCallbackPhoneNumber"],2011:["LT","1","OrderCallbackTelecomInformation"],2016:["LO","1","PlacerOrderNumberImagingServiceRequest"],2017:["LO","1","FillerOrderNumberImagingServiceRequest"],2400:["LT","1","ImagingServiceRequestComments"],3001:["LO","1","ConfidentialityConstraintOnPatientDataDescription"],4001:["CS","1","GeneralPurposeScheduledProcedureStepStatus"],4002:["CS","1","GeneralPurposePerformedProcedureStepStatus"],4003:["CS","1","GeneralPurposeScheduledProcedureStepPriority"],4004:["SQ","1","ScheduledProcessingApplicationsCodeSequence"],4005:["DT","1","ScheduledProcedureStepStartDateTime"],4006:["CS","1","MultipleCopiesFlag"],4007:["SQ","1","PerformedProcessingApplicationsCodeSequence"],4008:["DT","1","ScheduledProcedureStepExpirationDateTime"],4009:["SQ","1","HumanPerformerCodeSequence"],4010:["DT","1","ScheduledProcedureStepModificationDateTime"],4011:["DT","1","ExpectedCompletionDateTime"],4015:["SQ","1","ResultingGeneralPurposePerformedProcedureStepsSequence"],4016:["SQ","1","ReferencedGeneralPurposeScheduledProcedureStepSequence"],4018:["SQ","1","ScheduledWorkitemCodeSequence"],4019:["SQ","1","PerformedWorkitemCodeSequence"],4020:["CS","1","InputAvailabilityFlag"],4021:["SQ","1","InputInformationSequence"],4022:["SQ","1","RelevantInformationSequence"],4023:["UI","1","ReferencedGeneralPurposeScheduledProcedureStepTransactionUID"],4025:["SQ","1","ScheduledStationNameCodeSequence"],4026:["SQ","1","ScheduledStationClassCodeSequence"],4027:["SQ","1","ScheduledStationGeographicLocationCodeSequence"],4028:["SQ","1","PerformedStationNameCodeSequence"],4029:["SQ","1","PerformedStationClassCodeSequence"],4030:["SQ","1","PerformedStationGeographicLocationCodeSequence"],4031:["SQ","1","RequestedSubsequentWorkitemCodeSequence"],4032:["SQ","1","NonDICOMOutputCodeSequence"],4033:["SQ","1","OutputInformationSequence"],4034:["SQ","1","ScheduledHumanPerformersSequence"],4035:["SQ","1","ActualHumanPerformersSequence"],4036:["LO","1","HumanPerformerOrganization"],4037:["PN","1","HumanPerformerName"],4040:["CS","1","RawDataHandling"],4041:["CS","1","InputReadinessState"],4050:["DT","1","PerformedProcedureStepStartDateTime"],4051:["DT","1","PerformedProcedureStepEndDateTime"],4052:["DT","1","ProcedureStepCancellationDateTime"],4070:["SQ","1","OutputDestinationSequence"],4071:["SQ","1","DICOMStorageSequence"],4072:["SQ","1","STOWRSStorageSequence"],4073:["UR","1","StorageURL"],4074:["SQ","1","XDSStorageSequence"],8302:["DS","1","EntranceDoseInmGy"],8303:["CS","1","EntranceDoseDerivation"],9092:["SQ","1","ParametricMapFrameTypeSequence"],9094:["SQ","1","ReferencedImageRealWorldValueMappingSequence"],9096:["SQ","1","RealWorldValueMappingSequence"],9098:["SQ","1","PixelValueMappingCodeSequence"],9210:["SH","1","LUTLabel"],9211:["xs","1","RealWorldValueLastValueMapped"],9212:["FD","1-n","RealWorldValueLUTData"],9213:["FD","1","DoubleFloatRealWorldValueLastValueMapped"],9214:["FD","1","DoubleFloatRealWorldValueFirstValueMapped"],9216:["xs","1","RealWorldValueFirstValueMapped"],9220:["SQ","1","QuantityDefinitionSequence"],9224:["FD","1","RealWorldValueIntercept"],9225:["FD","1","RealWorldValueSlope"],A007:["CS","1","FindingsFlagTrial"],A010:["CS","1","RelationshipType"],A020:["SQ","1","FindingsSequenceTrial"],A021:["UI","1","FindingsGroupUIDTrial"],A022:["UI","1","ReferencedFindingsGroupUIDTrial"],A023:["DA","1","FindingsGroupRecordingDateTrial"],A024:["TM","1","FindingsGroupRecordingTimeTrial"],A026:["SQ","1","FindingsSourceCategoryCodeSequenceTrial"],A027:["LO","1","VerifyingOrganization"],A028:["SQ","1","DocumentingOrganizationIdentifierCodeSequenceTrial"],A030:["DT","1","VerificationDateTime"],A032:["DT","1","ObservationDateTime"],A033:["DT","1","ObservationStartDateTime"],A040:["CS","1","ValueType"],A043:["SQ","1","ConceptNameCodeSequence"],A047:["LO","1","MeasurementPrecisionDescriptionTrial"],A050:["CS","1","ContinuityOfContent"],A057:["CS","1-n","UrgencyOrPriorityAlertsTrial"],A060:["LO","1","SequencingIndicatorTrial"],A066:["SQ","1","DocumentIdentifierCodeSequenceTrial"],A067:["PN","1","DocumentAuthorTrial"],A068:["SQ","1","DocumentAuthorIdentifierCodeSequenceTrial"],A070:["SQ","1","IdentifierCodeSequenceTrial"],A073:["SQ","1","VerifyingObserverSequence"],A074:["OB","1","ObjectBinaryIdentifierTrial"],A075:["PN","1","VerifyingObserverName"],A076:["SQ","1","DocumentingObserverIdentifierCodeSequenceTrial"],A078:["SQ","1","AuthorObserverSequence"],A07A:["SQ","1","ParticipantSequence"],A07C:["SQ","1","CustodialOrganizationSequence"],A080:["CS","1","ParticipationType"],A082:["DT","1","ParticipationDateTime"],A084:["CS","1","ObserverType"],A085:["SQ","1","ProcedureIdentifierCodeSequenceTrial"],A088:["SQ","1","VerifyingObserverIdentificationCodeSequence"],A089:["OB","1","ObjectDirectoryBinaryIdentifierTrial"],A090:["SQ","1","EquivalentCDADocumentSequence"],A0B0:["US","2-2n","ReferencedWaveformChannels"],A110:["DA","1","DateOfDocumentOrVerbalTransactionTrial"],A112:["TM","1","TimeOfDocumentCreationOrVerbalTransactionTrial"],A120:["DT","1","DateTime"],A121:["DA","1","Date"],A122:["TM","1","Time"],A123:["PN","1","PersonName"],A124:["UI","1","UID"],A125:["CS","2","ReportStatusIDTrial"],A130:["CS","1","TemporalRangeType"],A132:["UL","1-n","ReferencedSamplePositions"],A136:["US","1-n","ReferencedFrameNumbers"],A138:["DS","1-n","ReferencedTimeOffsets"],A13A:["DT","1-n","ReferencedDateTime"],A160:["UT","1","TextValue"],A161:["FD","1-n","FloatingPointValue"],A162:["SL","1-n","RationalNumeratorValue"],A163:["UL","1-n","RationalDenominatorValue"],A167:["SQ","1","ObservationCategoryCodeSequenceTrial"],A168:["SQ","1","ConceptCodeSequence"],A16A:["ST","1","BibliographicCitationTrial"],A170:["SQ","1","PurposeOfReferenceCodeSequence"],A171:["UI","1","ObservationUID"],A172:["UI","1","ReferencedObservationUIDTrial"],A173:["CS","1","ReferencedObservationClassTrial"],A174:["CS","1","ReferencedObjectObservationClassTrial"],A180:["US","1","AnnotationGroupNumber"],A192:["DA","1","ObservationDateTrial"],A193:["TM","1","ObservationTimeTrial"],A194:["CS","1","MeasurementAutomationTrial"],A195:["SQ","1","ModifierCodeSequence"],A224:["ST","1","IdentificationDescriptionTrial"],A290:["CS","1","CoordinatesSetGeometricTypeTrial"],A296:["SQ","1","AlgorithmCodeSequenceTrial"],A297:["ST","1","AlgorithmDescriptionTrial"],A29A:["SL","2-2n","PixelCoordinatesSetTrial"],A300:["SQ","1","MeasuredValueSequence"],A301:["SQ","1","NumericValueQualifierCodeSequence"],A307:["PN","1","CurrentObserverTrial"],A30A:["DS","1-n","NumericValue"],A313:["SQ","1","ReferencedAccessionSequenceTrial"],A33A:["ST","1","ReportStatusCommentTrial"],A340:["SQ","1","ProcedureContextSequenceTrial"],A352:["PN","1","VerbalSourceTrial"],A353:["ST","1","AddressTrial"],A354:["LO","1","TelephoneNumberTrial"],A358:["SQ","1","VerbalSourceIdentifierCodeSequenceTrial"],A360:["SQ","1","PredecessorDocumentsSequence"],A370:["SQ","1","ReferencedRequestSequence"],A372:["SQ","1","PerformedProcedureCodeSequence"],A375:["SQ","1","CurrentRequestedProcedureEvidenceSequence"],A380:["SQ","1","ReportDetailSequenceTrial"],A385:["SQ","1","PertinentOtherEvidenceSequence"],A390:["SQ","1","HL7StructuredDocumentReferenceSequence"],A402:["UI","1","ObservationSubjectUIDTrial"],A403:["CS","1","ObservationSubjectClassTrial"],A404:["SQ","1","ObservationSubjectTypeCodeSequenceTrial"],A491:["CS","1","CompletionFlag"],A492:["LO","1","CompletionFlagDescription"],A493:["CS","1","VerificationFlag"],A494:["CS","1","ArchiveRequested"],A496:["CS","1","PreliminaryFlag"],A504:["SQ","1","ContentTemplateSequence"],A525:["SQ","1","IdenticalDocumentsSequence"],A600:["CS","1","ObservationSubjectContextFlagTrial"],A601:["CS","1","ObserverContextFlagTrial"],A603:["CS","1","ProcedureContextFlagTrial"],A730:["SQ","1","ContentSequence"],A731:["SQ","1","RelationshipSequenceTrial"],A732:["SQ","1","RelationshipTypeCodeSequenceTrial"],A744:["SQ","1","LanguageCodeSequenceTrial"],A801:["SQ","1","TabulatedValuesSequence"],A802:["UL","1","NumberOfTableRows"],A803:["UL","1","NumberOfTableColumns"],A804:["UL","1","TableRowNumber"],A805:["UL","1","TableColumnNumber"],A806:["SQ","1","TableRowDefinitionSequence"],A807:["SQ","1","TableColumnDefinitionSequence"],A808:["SQ","1","CellValuesSequence"],A992:["ST","1","UniformResourceLocatorTrial"],B020:["SQ","1","WaveformAnnotationSequence"],DB00:["CS","1","TemplateIdentifier"],DB06:["DT","1","TemplateVersion"],DB07:["DT","1","TemplateLocalVersion"],DB0B:["CS","1","TemplateExtensionFlag"],DB0C:["UI","1","TemplateExtensionOrganizationUID"],DB0D:["UI","1","TemplateExtensionCreatorUID"],DB73:["UL","1-n","ReferencedContentItemIdentifier"],E001:["ST","1","HL7InstanceIdentifier"],E004:["DT","1","HL7DocumentEffectiveTime"],E006:["SQ","1","HL7DocumentTypeCodeSequence"],E008:["SQ","1","DocumentClassCodeSequence"],E010:["UR","1","RetrieveURI"],E011:["UI","1","RetrieveLocationUID"],E020:["CS","1","TypeOfInstances"],E021:["SQ","1","DICOMRetrievalSequence"],E022:["SQ","1","DICOMMediaRetrievalSequence"],E023:["SQ","1","WADORetrievalSequence"],E024:["SQ","1","XDSRetrievalSequence"],E025:["SQ","1","WADORSRetrievalSequence"],E030:["UI","1","RepositoryUniqueID"],E031:["UI","1","HomeCommunityID"]},"0042":{"0000":["UL","1","GenericGroupLength"],"0010":["ST","1","DocumentTitle"],"0011":["OB","1","EncapsulatedDocument"],"0012":["LO","1","MIMETypeOfEncapsulatedDocument"],"0013":["SQ","1","SourceInstanceSequence"],"0014":["LO","1-n","ListOfMIMETypes"],"0015":["UL","1","EncapsulatedDocumentLength"]},"0044":{"0000":["UL","1","GenericGroupLength"],"0001":["ST","1","ProductPackageIdentifier"],"0002":["CS","1","SubstanceAdministrationApproval"],"0003":["LT","1","ApprovalStatusFurtherDescription"],"0004":["DT","1","ApprovalStatusDateTime"],"0007":["SQ","1","ProductTypeCodeSequence"],"0008":["LO","1-n","ProductName"],"0009":["LT","1","ProductDescription"],"000A":["LO","1","ProductLotIdentifier"],"000B":["DT","1","ProductExpirationDateTime"],"0010":["DT","1","SubstanceAdministrationDateTime"],"0011":["LO","1","SubstanceAdministrationNotes"],"0012":["LO","1","SubstanceAdministrationDeviceID"],"0013":["SQ","1","ProductParameterSequence"],"0019":["SQ","1","SubstanceAdministrationParameterSequence"],"0100":["SQ","1","ApprovalSequence"],"0101":["SQ","1","AssertionCodeSequence"],"0102":["UI","1","AssertionUID"],"0103":["SQ","1","AsserterIdentificationSequence"],"0104":["DT","1","AssertionDateTime"],"0105":["DT","1","AssertionExpirationDateTime"],"0106":["UT","1","AssertionComments"],"0107":["SQ","1","RelatedAssertionSequence"],"0108":["UI","1","ReferencedAssertionUID"],"0109":["SQ","1","ApprovalSubjectSequence"],"010A":["SQ","1","OrganizationalRoleCodeSequence"]},"0046":{"0000":["UL","1","GenericGroupLength"],"0012":["LO","1","LensDescription"],"0014":["SQ","1","RightLensSequence"],"0015":["SQ","1","LeftLensSequence"],"0016":["SQ","1","UnspecifiedLateralityLensSequence"],"0018":["SQ","1","CylinderSequence"],"0028":["SQ","1","PrismSequence"],"0030":["FD","1","HorizontalPrismPower"],"0032":["CS","1","HorizontalPrismBase"],"0034":["FD","1","VerticalPrismPower"],"0036":["CS","1","VerticalPrismBase"],"0038":["CS","1","LensSegmentType"],"0040":["FD","1","OpticalTransmittance"],"0042":["FD","1","ChannelWidth"],"0044":["FD","1","PupilSize"],"0046":["FD","1","CornealSize"],"0047":["SQ","1","CornealSizeSequence"],"0050":["SQ","1","AutorefractionRightEyeSequence"],"0052":["SQ","1","AutorefractionLeftEyeSequence"],"0060":["FD","1","DistancePupillaryDistance"],"0062":["FD","1","NearPupillaryDistance"],"0063":["FD","1","IntermediatePupillaryDistance"],"0064":["FD","1","OtherPupillaryDistance"],"0070":["SQ","1","KeratometryRightEyeSequence"],"0071":["SQ","1","KeratometryLeftEyeSequence"],"0074":["SQ","1","SteepKeratometricAxisSequence"],"0075":["FD","1","RadiusOfCurvature"],"0076":["FD","1","KeratometricPower"],"0077":["FD","1","KeratometricAxis"],"0080":["SQ","1","FlatKeratometricAxisSequence"],"0092":["CS","1","BackgroundColor"],"0094":["CS","1","Optotype"],"0095":["CS","1","OptotypePresentation"],"0097":["SQ","1","SubjectiveRefractionRightEyeSequence"],"0098":["SQ","1","SubjectiveRefractionLeftEyeSequence"],"0100":["SQ","1","AddNearSequence"],"0101":["SQ","1","AddIntermediateSequence"],"0102":["SQ","1","AddOtherSequence"],"0104":["FD","1","AddPower"],"0106":["FD","1","ViewingDistance"],"0110":["SQ","1","CorneaMeasurementsSequence"],"0111":["SQ","1","SourceOfCorneaMeasurementDataCodeSequence"],"0112":["SQ","1","SteepCornealAxisSequence"],"0113":["SQ","1","FlatCornealAxisSequence"],"0114":["FD","1","CornealPower"],"0115":["FD","1","CornealAxis"],"0116":["SQ","1","CorneaMeasurementMethodCodeSequence"],"0117":["FL","1","RefractiveIndexOfCornea"],"0118":["FL","1","RefractiveIndexOfAqueousHumor"],"0121":["SQ","1","VisualAcuityTypeCodeSequence"],"0122":["SQ","1","VisualAcuityRightEyeSequence"],"0123":["SQ","1","VisualAcuityLeftEyeSequence"],"0124":["SQ","1","VisualAcuityBothEyesOpenSequence"],"0125":["CS","1","ViewingDistanceType"],"0135":["SS","2","VisualAcuityModifiers"],"0137":["FD","1","DecimalVisualAcuity"],"0139":["LO","1","OptotypeDetailedDefinition"],"0145":["SQ","1","ReferencedRefractiveMeasurementsSequence"],"0146":["FD","1","SpherePower"],"0147":["FD","1","CylinderPower"],"0201":["CS","1","CornealTopographySurface"],"0202":["FL","2","CornealVertexLocation"],"0203":["FL","1","PupilCentroidXCoordinate"],"0204":["FL","1","PupilCentroidYCoordinate"],"0205":["FL","1","EquivalentPupilRadius"],"0207":["SQ","1","CornealTopographyMapTypeCodeSequence"],"0208":["IS","2-2n","VerticesOfTheOutlineOfPupil"],"0210":["SQ","1","CornealTopographyMappingNormalsSequence"],"0211":["SQ","1","MaximumCornealCurvatureSequence"],"0212":["FL","1","MaximumCornealCurvature"],"0213":["FL","2","MaximumCornealCurvatureLocation"],"0215":["SQ","1","MinimumKeratometricSequence"],"0218":["SQ","1","SimulatedKeratometricCylinderSequence"],"0220":["FL","1","AverageCornealPower"],"0224":["FL","1","CornealISValue"],"0227":["FL","1","AnalyzedArea"],"0230":["FL","1","SurfaceRegularityIndex"],"0232":["FL","1","SurfaceAsymmetryIndex"],"0234":["FL","1","CornealEccentricityIndex"],"0236":["FL","1","KeratoconusPredictionIndex"],"0238":["FL","1","DecimalPotentialVisualAcuity"],"0242":["CS","1","CornealTopographyMapQualityEvaluation"],"0244":["SQ","1","SourceImageCornealProcessedDataSequence"],"0247":["FL","3","CornealPointLocation"],"0248":["CS","1","CornealPointEstimated"],"0249":["FL","1","AxialPower"],"0250":["FL","1","TangentialPower"],"0251":["FL","1","RefractivePower"],"0252":["FL","1","RelativeElevation"],"0253":["FL","1","CornealWavefront"]},"0048":{"0000":["UL","1","GenericGroupLength"],"0001":["FL","1","ImagedVolumeWidth"],"0002":["FL","1","ImagedVolumeHeight"],"0003":["FL","1","ImagedVolumeDepth"],"0006":["UL","1","TotalPixelMatrixColumns"],"0007":["UL","1","TotalPixelMatrixRows"],"0008":["SQ","1","TotalPixelMatrixOriginSequence"],"0010":["CS","1","SpecimenLabelInImage"],"0011":["CS","1","FocusMethod"],"0012":["CS","1","ExtendedDepthOfField"],"0013":["US","1","NumberOfFocalPlanes"],"0014":["FL","1","DistanceBetweenFocalPlanes"],"0015":["US","3","RecommendedAbsentPixelCIELabValue"],"0100":["SQ","1","IlluminatorTypeCodeSequence"],"0102":["DS","6","ImageOrientationSlide"],"0105":["SQ","1","OpticalPathSequence"],"0106":["SH","1","OpticalPathIdentifier"],"0107":["ST","1","OpticalPathDescription"],"0108":["SQ","1","IlluminationColorCodeSequence"],"0110":["SQ","1","SpecimenReferenceSequence"],"0111":["DS","1","CondenserLensPower"],"0112":["DS","1","ObjectiveLensPower"],"0113":["DS","1","ObjectiveLensNumericalAperture"],"0120":["SQ","1","PaletteColorLookupTableSequence"],"0200":["SQ","1","ReferencedImageNavigationSequence"],"0201":["US","2","TopLeftHandCornerOfLocalizerArea"],"0202":["US","2","BottomRightHandCornerOfLocalizerArea"],"0207":["SQ","1","OpticalPathIdentificationSequence"],"021A":["SQ","1","PlanePositionSlideSequence"],"021E":["SL","1","ColumnPositionInTotalImagePixelMatrix"],"021F":["SL","1","RowPositionInTotalImagePixelMatrix"],"0301":["CS","1","PixelOriginInterpretation"],"0302":["UL","1","NumberOfOpticalPaths"],"0303":["UL","1","TotalPixelMatrixFocalPlanes"]},"0050":{"0000":["UL","1","GenericGroupLength"],"0004":["CS","1","CalibrationImage"],"0010":["SQ","1","DeviceSequence"],"0012":["SQ","1","ContainerComponentTypeCodeSequence"],"0013":["FD","1","ContainerComponentThickness"],"0014":["DS","1","DeviceLength"],"0015":["FD","1","ContainerComponentWidth"],"0016":["DS","1","DeviceDiameter"],"0017":["CS","1","DeviceDiameterUnits"],"0018":["DS","1","DeviceVolume"],"0019":["DS","1","InterMarkerDistance"],"001A":["CS","1","ContainerComponentMaterial"],"001B":["LO","1","ContainerComponentID"],"001C":["FD","1","ContainerComponentLength"],"001D":["FD","1","ContainerComponentDiameter"],"001E":["LO","1","ContainerComponentDescription"],"0020":["LO","1","DeviceDescription"],"0021":["ST","1","LongDeviceDescription"]},"0052":{"0000":["UL","1","GenericGroupLength"],"0001":["FL","1","ContrastBolusIngredientPercentByVolume"],"0002":["FD","1","OCTFocalDistance"],"0003":["FD","1","BeamSpotSize"],"0004":["FD","1","EffectiveRefractiveIndex"],"0006":["CS","1","OCTAcquisitionDomain"],"0007":["FD","1","OCTOpticalCenterWavelength"],"0008":["FD","1","AxialResolution"],"0009":["FD","1","RangingDepth"],"0011":["FD","1","ALineRate"],"0012":["US","1","ALinesPerFrame"],"0013":["FD","1","CatheterRotationalRate"],"0014":["FD","1","ALinePixelSpacing"],"0016":["SQ","1","ModeOfPercutaneousAccessSequence"],"0025":["SQ","1","IntravascularOCTFrameTypeSequence"],"0026":["CS","1","OCTZOffsetApplied"],"0027":["SQ","1","IntravascularFrameContentSequence"],"0028":["FD","1","IntravascularLongitudinalDistance"],"0029":["SQ","1","IntravascularOCTFrameContentSequence"],"0030":["SS","1","OCTZOffsetCorrection"],"0031":["CS","1","CatheterDirectionOfRotation"],"0033":["FD","1","SeamLineLocation"],"0034":["FD","1","FirstALineLocation"],"0036":["US","1","SeamLineIndex"],"0038":["US","1","NumberOfPaddedALines"],"0039":["CS","1","InterpolationType"],"003A":["CS","1","RefractiveIndexApplied"]},"0054":{"0000":["UL","1","GenericGroupLength"],"0010":["US","1-n","EnergyWindowVector"],"0011":["US","1","NumberOfEnergyWindows"],"0012":["SQ","1","EnergyWindowInformationSequence"],"0013":["SQ","1","EnergyWindowRangeSequence"],"0014":["DS","1","EnergyWindowLowerLimit"],"0015":["DS","1","EnergyWindowUpperLimit"],"0016":["SQ","1","RadiopharmaceuticalInformationSequence"],"0017":["IS","1","ResidualSyringeCounts"],"0018":["SH","1","EnergyWindowName"],"0020":["US","1-n","DetectorVector"],"0021":["US","1","NumberOfDetectors"],"0022":["SQ","1","DetectorInformationSequence"],"0030":["US","1-n","PhaseVector"],"0031":["US","1","NumberOfPhases"],"0032":["SQ","1","PhaseInformationSequence"],"0033":["US","1","NumberOfFramesInPhase"],"0036":["IS","1","PhaseDelay"],"0038":["IS","1","PauseBetweenFrames"],"0039":["CS","1","PhaseDescription"],"0050":["US","1-n","RotationVector"],"0051":["US","1","NumberOfRotations"],"0052":["SQ","1","RotationInformationSequence"],"0053":["US","1","NumberOfFramesInRotation"],"0060":["US","1-n","RRIntervalVector"],"0061":["US","1","NumberOfRRIntervals"],"0062":["SQ","1","GatedInformationSequence"],"0063":["SQ","1","DataInformationSequence"],"0070":["US","1-n","TimeSlotVector"],"0071":["US","1","NumberOfTimeSlots"],"0072":["SQ","1","TimeSlotInformationSequence"],"0073":["DS","1","TimeSlotTime"],"0080":["US","1-n","SliceVector"],"0081":["US","1","NumberOfSlices"],"0090":["US","1-n","AngularViewVector"],"0100":["US","1-n","TimeSliceVector"],"0101":["US","1","NumberOfTimeSlices"],"0200":["DS","1","StartAngle"],"0202":["CS","1","TypeOfDetectorMotion"],"0210":["IS","1-n","TriggerVector"],"0211":["US","1","NumberOfTriggersInPhase"],"0220":["SQ","1","ViewCodeSequence"],"0222":["SQ","1","ViewModifierCodeSequence"],"0300":["SQ","1","RadionuclideCodeSequence"],"0302":["SQ","1","AdministrationRouteCodeSequence"],"0304":["SQ","1","RadiopharmaceuticalCodeSequence"],"0306":["SQ","1","CalibrationDataSequence"],"0308":["US","1","EnergyWindowNumber"],"0400":["SH","1","ImageID"],"0410":["SQ","1","PatientOrientationCodeSequence"],"0412":["SQ","1","PatientOrientationModifierCodeSequence"],"0414":["SQ","1","PatientGantryRelationshipCodeSequence"],"0500":["CS","1","SliceProgressionDirection"],"0501":["CS","1","ScanProgressionDirection"],1e3:["CS","2","SeriesType"],1001:["CS","1","Units"],1002:["CS","1","CountsSource"],1004:["CS","1","ReprojectionMethod"],1006:["CS","1","SUVType"],1100:["CS","1","RandomsCorrectionMethod"],1101:["LO","1","AttenuationCorrectionMethod"],1102:["CS","1","DecayCorrection"],1103:["LO","1","ReconstructionMethod"],1104:["LO","1","DetectorLinesOfResponseUsed"],1105:["LO","1","ScatterCorrectionMethod"],1200:["DS","1","AxialAcceptance"],1201:["IS","2","AxialMash"],1202:["IS","1","TransverseMash"],1203:["DS","2","DetectorElementSize"],1210:["DS","1","CoincidenceWindowWidth"],1220:["CS","1-n","SecondaryCountsType"],1300:["DS","1","FrameReferenceTime"],1310:["IS","1","PrimaryPromptsCountsAccumulated"],1311:["IS","1-n","SecondaryCountsAccumulated"],1320:["DS","1","SliceSensitivityFactor"],1321:["DS","1","DecayFactor"],1322:["DS","1","DoseCalibrationFactor"],1323:["DS","1","ScatterFractionFactor"],1324:["DS","1","DeadTimeFactor"],1330:["US","1","ImageIndex"],1400:["CS","1-n","CountsIncluded"],1401:["CS","1","DeadTimeCorrectionFlag"]},"0060":{"0000":["UL","1","GenericGroupLength"],3e3:["SQ","1","HistogramSequence"],3002:["US","1","HistogramNumberOfBins"],3004:["xs","1","HistogramFirstBinValue"],3006:["xs","1","HistogramLastBinValue"],3008:["US","1","HistogramBinWidth"],3010:["LO","1","HistogramExplanation"],3020:["UL","1-n","HistogramData"]},"0062":{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","SegmentationType"],"0002":["SQ","1","SegmentSequence"],"0003":["SQ","1","SegmentedPropertyCategoryCodeSequence"],"0004":["US","1","SegmentNumber"],"0005":["LO","1","SegmentLabel"],"0006":["ST","1","SegmentDescription"],"0007":["SQ","1","SegmentationAlgorithmIdentificationSequence"],"0008":["CS","1","SegmentAlgorithmType"],"0009":["LO","1-n","SegmentAlgorithmName"],"000A":["SQ","1","SegmentIdentificationSequence"],"000B":["US","1-n","ReferencedSegmentNumber"],"000C":["US","1","RecommendedDisplayGrayscaleValue"],"000D":["US","3","RecommendedDisplayCIELabValue"],"000E":["US","1","MaximumFractionalValue"],"000F":["SQ","1","SegmentedPropertyTypeCodeSequence"],"0010":["CS","1","SegmentationFractionalType"],"0011":["SQ","1","SegmentedPropertyTypeModifierCodeSequence"],"0012":["SQ","1","UsedSegmentsSequence"],"0013":["CS","1","SegmentsOverlap"],"0020":["UT","1","TrackingID"],"0021":["UI","1","TrackingUID"]},"0064":{"0000":["UL","1","GenericGroupLength"],"0002":["SQ","1","DeformableRegistrationSequence"],"0003":["UI","1","SourceFrameOfReferenceUID"],"0005":["SQ","1","DeformableRegistrationGridSequence"],"0007":["UL","3","GridDimensions"],"0008":["FD","3","GridResolution"],"0009":["OF","1","VectorGridData"],"000F":["SQ","1","PreDeformationMatrixRegistrationSequence"],"0010":["SQ","1","PostDeformationMatrixRegistrationSequence"]},"0066":{"0000":["UL","1","GenericGroupLength"],"0001":["UL","1","NumberOfSurfaces"],"0002":["SQ","1","SurfaceSequence"],"0003":["UL","1","SurfaceNumber"],"0004":["LT","1","SurfaceComments"],"0009":["CS","1","SurfaceProcessing"],"000A":["FL","1","SurfaceProcessingRatio"],"000B":["LO","1","SurfaceProcessingDescription"],"000C":["FL","1","RecommendedPresentationOpacity"],"000D":["CS","1","RecommendedPresentationType"],"000E":["CS","1","FiniteVolume"],"0010":["CS","1","Manifold"],"0011":["SQ","1","SurfacePointsSequence"],"0012":["SQ","1","SurfacePointsNormalsSequence"],"0013":["SQ","1","SurfaceMeshPrimitivesSequence"],"0015":["UL","1","NumberOfSurfacePoints"],"0016":["OF","1","PointCoordinatesData"],"0017":["FL","3","PointPositionAccuracy"],"0018":["FL","1","MeanPointDistance"],"0019":["FL","1","MaximumPointDistance"],"001A":["FL","6","PointsBoundingBoxCoordinates"],"001B":["FL","3","AxisOfRotation"],"001C":["FL","3","CenterOfRotation"],"001E":["UL","1","NumberOfVectors"],"001F":["US","1","VectorDimensionality"],"0020":["FL","1-n","VectorAccuracy"],"0021":["OF","1","VectorCoordinateData"],"0022":["OD","1","DoublePointCoordinatesData"],"0023":["OW","1","TrianglePointIndexList"],"0024":["OW","1","EdgePointIndexList"],"0025":["OW","1","VertexPointIndexList"],"0026":["SQ","1","TriangleStripSequence"],"0027":["SQ","1","TriangleFanSequence"],"0028":["SQ","1","LineSequence"],"0029":["OW","1","PrimitivePointIndexList"],"002A":["UL","1","SurfaceCount"],"002B":["SQ","1","ReferencedSurfaceSequence"],"002C":["UL","1","ReferencedSurfaceNumber"],"002D":["SQ","1","SegmentSurfaceGenerationAlgorithmIdentificationSequence"],"002E":["SQ","1","SegmentSurfaceSourceInstanceSequence"],"002F":["SQ","1","AlgorithmFamilyCodeSequence"],"0030":["SQ","1","AlgorithmNameCodeSequence"],"0031":["LO","1","AlgorithmVersion"],"0032":["LT","1","AlgorithmParameters"],"0034":["SQ","1","FacetSequence"],"0035":["SQ","1","SurfaceProcessingAlgorithmIdentificationSequence"],"0036":["LO","1","AlgorithmName"],"0037":["FL","1","RecommendedPointRadius"],"0038":["FL","1","RecommendedLineThickness"],"0040":["OL","1","LongPrimitivePointIndexList"],"0041":["OL","1","LongTrianglePointIndexList"],"0042":["OL","1","LongEdgePointIndexList"],"0043":["OL","1","LongVertexPointIndexList"],"0101":["SQ","1","TrackSetSequence"],"0102":["SQ","1","TrackSequence"],"0103":["OW","1","RecommendedDisplayCIELabValueList"],"0104":["SQ","1","TrackingAlgorithmIdentificationSequence"],"0105":["UL","1","TrackSetNumber"],"0106":["LO","1","TrackSetLabel"],"0107":["UT","1","TrackSetDescription"],"0108":["SQ","1","TrackSetAnatomicalTypeCodeSequence"],"0121":["SQ","1","MeasurementsSequence"],"0124":["SQ","1","TrackSetStatisticsSequence"],"0125":["OF","1","FloatingPointValues"],"0129":["OL","1","TrackPointIndexList"],"0130":["SQ","1","TrackStatisticsSequence"],"0132":["SQ","1","MeasurementValuesSequence"],"0133":["SQ","1","DiffusionAcquisitionCodeSequence"],"0134":["SQ","1","DiffusionModelCodeSequence"]},"0068":{"0000":["UL","1","GenericGroupLength"],6210:["LO","1","ImplantSize"],6221:["LO","1","ImplantTemplateVersion"],6222:["SQ","1","ReplacedImplantTemplateSequence"],6223:["CS","1","ImplantType"],6224:["SQ","1","DerivationImplantTemplateSequence"],6225:["SQ","1","OriginalImplantTemplateSequence"],6226:["DT","1","EffectiveDateTime"],6230:["SQ","1","ImplantTargetAnatomySequence"],6260:["SQ","1","InformationFromManufacturerSequence"],6265:["SQ","1","NotificationFromManufacturerSequence"],6270:["DT","1","InformationIssueDateTime"],6280:["ST","1","InformationSummary"],"62A0":["SQ","1","ImplantRegulatoryDisapprovalCodeSequence"],"62A5":["FD","1","OverallTemplateSpatialTolerance"],"62C0":["SQ","1","HPGLDocumentSequence"],"62D0":["US","1","HPGLDocumentID"],"62D5":["LO","1","HPGLDocumentLabel"],"62E0":["SQ","1","ViewOrientationCodeSequence"],"62F0":["SQ","1","ViewOrientationModifierCodeSequence"],"62F2":["FD","1","HPGLDocumentScaling"],6300:["OB","1","HPGLDocument"],6310:["US","1","HPGLContourPenNumber"],6320:["SQ","1","HPGLPenSequence"],6330:["US","1","HPGLPenNumber"],6340:["LO","1","HPGLPenLabel"],6345:["ST","1","HPGLPenDescription"],6346:["FD","2","RecommendedRotationPoint"],6347:["FD","4","BoundingRectangle"],6350:["US","1-n","ImplantTemplate3DModelSurfaceNumber"],6360:["SQ","1","SurfaceModelDescriptionSequence"],6380:["LO","1","SurfaceModelLabel"],6390:["FD","1","SurfaceModelScalingFactor"],"63A0":["SQ","1","MaterialsCodeSequence"],"63A4":["SQ","1","CoatingMaterialsCodeSequence"],"63A8":["SQ","1","ImplantTypeCodeSequence"],"63AC":["SQ","1","FixationMethodCodeSequence"],"63B0":["SQ","1","MatingFeatureSetsSequence"],"63C0":["US","1","MatingFeatureSetID"],"63D0":["LO","1","MatingFeatureSetLabel"],"63E0":["SQ","1","MatingFeatureSequence"],"63F0":["US","1","MatingFeatureID"],6400:["SQ","1","MatingFeatureDegreeOfFreedomSequence"],6410:["US","1","DegreeOfFreedomID"],6420:["CS","1","DegreeOfFreedomType"],6430:["SQ","1","TwoDMatingFeatureCoordinatesSequence"],6440:["US","1","ReferencedHPGLDocumentID"],6450:["FD","2","TwoDMatingPoint"],6460:["FD","4","TwoDMatingAxes"],6470:["SQ","1","TwoDDegreeOfFreedomSequence"],6490:["FD","3","ThreeDDegreeOfFreedomAxis"],"64A0":["FD","2","RangeOfFreedom"],"64C0":["FD","3","ThreeDMatingPoint"],"64D0":["FD","9","ThreeDMatingAxes"],"64F0":["FD","3","TwoDDegreeOfFreedomAxis"],6500:["SQ","1","PlanningLandmarkPointSequence"],6510:["SQ","1","PlanningLandmarkLineSequence"],6520:["SQ","1","PlanningLandmarkPlaneSequence"],6530:["US","1","PlanningLandmarkID"],6540:["LO","1","PlanningLandmarkDescription"],6545:["SQ","1","PlanningLandmarkIdentificationCodeSequence"],6550:["SQ","1","TwoDPointCoordinatesSequence"],6560:["FD","2","TwoDPointCoordinates"],6590:["FD","3","ThreeDPointCoordinates"],"65A0":["SQ","1","TwoDLineCoordinatesSequence"],"65B0":["FD","4","TwoDLineCoordinates"],"65D0":["FD","6","ThreeDLineCoordinates"],"65E0":["SQ","1","TwoDPlaneCoordinatesSequence"],"65F0":["FD","4","TwoDPlaneIntersection"],6610:["FD","3","ThreeDPlaneOrigin"],6620:["FD","3","ThreeDPlaneNormal"],7001:["CS","1","ModelModification"],7002:["CS","1","ModelMirroring"],7003:["SQ","1","ModelUsageCodeSequence"],7004:["UI","1","ModelGroupUID"],7005:["UR","1","RelativeURIReferenceWithinEncapsulatedDocument"]},"006A":{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","AnnotationCoordinateType"],"0002":["SQ","1","AnnotationGroupSequence"],"0003":["UI","1","AnnotationGroupUID"],"0005":["LO","1","AnnotationGroupLabel"],"0006":["UT","1","AnnotationGroupDescription"],"0007":["CS","1","AnnotationGroupGenerationType"],"0008":["SQ","1","AnnotationGroupAlgorithmIdentificationSequence"],"0009":["SQ","1","AnnotationPropertyCategoryCodeSequence"],"000A":["SQ","1","AnnotationPropertyTypeCodeSequence"],"000B":["SQ","1","AnnotationPropertyTypeModifierCodeSequence"],"000C":["UL","1","NumberOfAnnotations"],"000D":["CS","1","AnnotationAppliesToAllOpticalPaths"],"000E":["SH","1-n","ReferencedOpticalPathIdentifier"],"000F":["CS","1","AnnotationAppliesToAllZPlanes"],"0010":["FD","1-n","CommonZCoordinateValue"],"0011":["OL","1","AnnotationIndexList"]},"0070":{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","GraphicAnnotationSequence"],"0002":["CS","1","GraphicLayer"],"0003":["CS","1","BoundingBoxAnnotationUnits"],"0004":["CS","1","AnchorPointAnnotationUnits"],"0005":["CS","1","GraphicAnnotationUnits"],"0006":["ST","1","UnformattedTextValue"],"0008":["SQ","1","TextObjectSequence"],"0009":["SQ","1","GraphicObjectSequence"],"0010":["FL","2","BoundingBoxTopLeftHandCorner"],"0011":["FL","2","BoundingBoxBottomRightHandCorner"],"0012":["CS","1","BoundingBoxTextHorizontalJustification"],"0014":["FL","2","AnchorPoint"],"0015":["CS","1","AnchorPointVisibility"],"0020":["US","1","GraphicDimensions"],"0021":["US","1","NumberOfGraphicPoints"],"0022":["FL","2-n","GraphicData"],"0023":["CS","1","GraphicType"],"0024":["CS","1","GraphicFilled"],"0040":["IS","1","ImageRotationRetired"],"0041":["CS","1","ImageHorizontalFlip"],"0042":["US","1","ImageRotation"],"0050":["US","2","DisplayedAreaTopLeftHandCornerTrial"],"0051":["US","2","DisplayedAreaBottomRightHandCornerTrial"],"0052":["SL","2","DisplayedAreaTopLeftHandCorner"],"0053":["SL","2","DisplayedAreaBottomRightHandCorner"],"005A":["SQ","1","DisplayedAreaSelectionSequence"],"0060":["SQ","1","GraphicLayerSequence"],"0062":["IS","1","GraphicLayerOrder"],"0066":["US","1","GraphicLayerRecommendedDisplayGrayscaleValue"],"0067":["US","3","GraphicLayerRecommendedDisplayRGBValue"],"0068":["LO","1","GraphicLayerDescription"],"0080":["CS","1","ContentLabel"],"0081":["LO","1","ContentDescription"],"0082":["DA","1","PresentationCreationDate"],"0083":["TM","1","PresentationCreationTime"],"0084":["PN","1","ContentCreatorName"],"0086":["SQ","1","ContentCreatorIdentificationCodeSequence"],"0087":["SQ","1","AlternateContentDescriptionSequence"],"0100":["CS","1","PresentationSizeMode"],"0101":["DS","2","PresentationPixelSpacing"],"0102":["IS","2","PresentationPixelAspectRatio"],"0103":["FL","1","PresentationPixelMagnificationRatio"],"0207":["LO","1","GraphicGroupLabel"],"0208":["ST","1","GraphicGroupDescription"],"0209":["SQ","1","CompoundGraphicSequence"],"0226":["UL","1","CompoundGraphicInstanceID"],"0227":["LO","1","FontName"],"0228":["CS","1","FontNameType"],"0229":["LO","1","CSSFontName"],"0230":["FD","1","RotationAngle"],"0231":["SQ","1","TextStyleSequence"],"0232":["SQ","1","LineStyleSequence"],"0233":["SQ","1","FillStyleSequence"],"0234":["SQ","1","GraphicGroupSequence"],"0241":["US","3","TextColorCIELabValue"],"0242":["CS","1","HorizontalAlignment"],"0243":["CS","1","VerticalAlignment"],"0244":["CS","1","ShadowStyle"],"0245":["FL","1","ShadowOffsetX"],"0246":["FL","1","ShadowOffsetY"],"0247":["US","3","ShadowColorCIELabValue"],"0248":["CS","1","Underlined"],"0249":["CS","1","Bold"],"0250":["CS","1","Italic"],"0251":["US","3","PatternOnColorCIELabValue"],"0252":["US","3","PatternOffColorCIELabValue"],"0253":["FL","1","LineThickness"],"0254":["CS","1","LineDashingStyle"],"0255":["UL","1","LinePattern"],"0256":["OB","1","FillPattern"],"0257":["CS","1","FillMode"],"0258":["FL","1","ShadowOpacity"],"0261":["FL","1","GapLength"],"0262":["FL","1","DiameterOfVisibility"],"0273":["FL","2","RotationPoint"],"0274":["CS","1","TickAlignment"],"0278":["CS","1","ShowTickLabel"],"0279":["CS","1","TickLabelAlignment"],"0282":["CS","1","CompoundGraphicUnits"],"0284":["FL","1","PatternOnOpacity"],"0285":["FL","1","PatternOffOpacity"],"0287":["SQ","1","MajorTicksSequence"],"0288":["FL","1","TickPosition"],"0289":["SH","1","TickLabel"],"0294":["CS","1","CompoundGraphicType"],"0295":["UL","1","GraphicGroupID"],"0306":["CS","1","ShapeType"],"0308":["SQ","1","RegistrationSequence"],"0309":["SQ","1","MatrixRegistrationSequence"],"030A":["SQ","1","MatrixSequence"],"030B":["FD","16","FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix"],"030C":["CS","1","FrameOfReferenceTransformationMatrixType"],"030D":["SQ","1","RegistrationTypeCodeSequence"],"030F":["ST","1","FiducialDescription"],"0310":["SH","1","FiducialIdentifier"],"0311":["SQ","1","FiducialIdentifierCodeSequence"],"0312":["FD","1","ContourUncertaintyRadius"],"0314":["SQ","1","UsedFiducialsSequence"],"0318":["SQ","1","GraphicCoordinatesDataSequence"],"031A":["UI","1","FiducialUID"],"031B":["UI","1","ReferencedFiducialUID"],"031C":["SQ","1","FiducialSetSequence"],"031E":["SQ","1","FiducialSequence"],"031F":["SQ","1","FiducialsPropertyCategoryCodeSequence"],"0401":["US","3","GraphicLayerRecommendedDisplayCIELabValue"],"0402":["SQ","1","BlendingSequence"],"0403":["FL","1","RelativeOpacity"],"0404":["SQ","1","ReferencedSpatialRegistrationSequence"],"0405":["CS","1","BlendingPosition"],1101:["UI","1","PresentationDisplayCollectionUID"],1102:["UI","1","PresentationSequenceCollectionUID"],1103:["US","1","PresentationSequencePositionIndex"],1104:["SQ","1","RenderedImageReferenceSequence"],1201:["SQ","1","VolumetricPresentationStateInputSequence"],1202:["CS","1","PresentationInputType"],1203:["US","1","InputSequencePositionIndex"],1204:["CS","1","Crop"],1205:["US","1-n","CroppingSpecificationIndex"],1206:["CS","1","CompositingMethod"],1207:["US","1","VolumetricPresentationInputNumber"],1208:["CS","1","ImageVolumeGeometry"],1209:["UI","1","VolumetricPresentationInputSetUID"],"120A":["SQ","1","VolumetricPresentationInputSetSequence"],"120B":["CS","1","GlobalCrop"],"120C":["US","1-n","GlobalCroppingSpecificationIndex"],"120D":["CS","1","RenderingMethod"],1301:["SQ","1","VolumeCroppingSequence"],1302:["CS","1","VolumeCroppingMethod"],1303:["FD","6","BoundingBoxCrop"],1304:["SQ","1","ObliqueCroppingPlaneSequence"],1305:["FD","4","Plane"],1306:["FD","3","PlaneNormal"],1309:["US","1","CroppingSpecificationNumber"],1501:["CS","1","MultiPlanarReconstructionStyle"],1502:["CS","1","MPRThicknessType"],1503:["FD","1","MPRSlabThickness"],1505:["FD","3","MPRTopLeftHandCorner"],1507:["FD","3","MPRViewWidthDirection"],1508:["FD","1","MPRViewWidth"],"150C":["UL","1","NumberOfVolumetricCurvePoints"],"150D":["OD","1","VolumetricCurvePoints"],1511:["FD","3","MPRViewHeightDirection"],1512:["FD","1","MPRViewHeight"],1602:["CS","1","RenderProjection"],1603:["FD","3","ViewpointPosition"],1604:["FD","3","ViewpointLookAtPoint"],1605:["FD","3","ViewpointUpDirection"],1606:["FD","6","RenderFieldOfView"],1607:["FD","1","SamplingStepSize"],1701:["CS","1","ShadingStyle"],1702:["FD","1","AmbientReflectionIntensity"],1703:["FD","3","LightDirection"],1704:["FD","1","DiffuseReflectionIntensity"],1705:["FD","1","SpecularReflectionIntensity"],1706:["FD","1","Shininess"],1801:["SQ","1","PresentationStateClassificationComponentSequence"],1802:["CS","1","ComponentType"],1803:["SQ","1","ComponentInputSequence"],1804:["US","1","VolumetricPresentationInputIndex"],1805:["SQ","1","PresentationStateCompositorComponentSequence"],1806:["SQ","1","WeightingTransferFunctionSequence"],1807:["US","3","WeightingLookupTableDescriptor"],1808:["OB","1","WeightingLookupTableData"],1901:["SQ","1","VolumetricAnnotationSequence"],1903:["SQ","1","ReferencedStructuredContextSequence"],1904:["UI","1","ReferencedContentItem"],1905:["SQ","1","VolumetricPresentationInputAnnotationSequence"],1907:["CS","1","AnnotationClipping"],"1A01":["CS","1","PresentationAnimationStyle"],"1A03":["FD","1","RecommendedAnimationRate"],"1A04":["SQ","1","AnimationCurveSequence"],"1A05":["FD","1","AnimationStepSize"],"1A06":["FD","1","SwivelRange"],"1A07":["OD","1","VolumetricCurveUpDirections"],"1A08":["SQ","1","VolumeStreamSequence"],"1A09":["LO","1","RGBATransferFunctionDescription"],"1B01":["SQ","1","AdvancedBlendingSequence"],"1B02":["US","1","BlendingInputNumber"],"1B03":["SQ","1","BlendingDisplayInputSequence"],"1B04":["SQ","1","BlendingDisplaySequence"],"1B06":["CS","1","BlendingMode"],"1B07":["CS","1","TimeSeriesBlending"],"1B08":["CS","1","GeometryForDisplay"],"1B11":["SQ","1","ThresholdSequence"],"1B12":["SQ","1","ThresholdValueSequence"],"1B13":["CS","1","ThresholdType"],"1B14":["FD","1","ThresholdValue"]},"0072":{"0000":["UL","1","GenericGroupLength"],"0002":["SH","1","HangingProtocolName"],"0004":["LO","1","HangingProtocolDescription"],"0006":["CS","1","HangingProtocolLevel"],"0008":["LO","1","HangingProtocolCreator"],"000A":["DT","1","HangingProtocolCreationDateTime"],"000C":["SQ","1","HangingProtocolDefinitionSequence"],"000E":["SQ","1","HangingProtocolUserIdentificationCodeSequence"],"0010":["LO","1","HangingProtocolUserGroupName"],"0012":["SQ","1","SourceHangingProtocolSequence"],"0014":["US","1","NumberOfPriorsReferenced"],"0020":["SQ","1","ImageSetsSequence"],"0022":["SQ","1","ImageSetSelectorSequence"],"0024":["CS","1","ImageSetSelectorUsageFlag"],"0026":["AT","1","SelectorAttribute"],"0028":["US","1","SelectorValueNumber"],"0030":["SQ","1","TimeBasedImageSetsSequence"],"0032":["US","1","ImageSetNumber"],"0034":["CS","1","ImageSetSelectorCategory"],"0038":["US","2","RelativeTime"],"003A":["CS","1","RelativeTimeUnits"],"003C":["SS","2","AbstractPriorValue"],"003E":["SQ","1","AbstractPriorCodeSequence"],"0040":["LO","1","ImageSetLabel"],"0050":["CS","1","SelectorAttributeVR"],"0052":["AT","1-n","SelectorSequencePointer"],"0054":["LO","1-n","SelectorSequencePointerPrivateCreator"],"0056":["LO","1","SelectorAttributePrivateCreator"],"005E":["AE","1-n","SelectorAEValue"],"005F":["AS","1-n","SelectorASValue"],"0060":["AT","1-n","SelectorATValue"],"0061":["DA","1-n","SelectorDAValue"],"0062":["CS","1-n","SelectorCSValue"],"0063":["DT","1-n","SelectorDTValue"],"0064":["IS","1-n","SelectorISValue"],"0065":["OB","1","SelectorOBValue"],"0066":["LO","1-n","SelectorLOValue"],"0067":["OF","1","SelectorOFValue"],"0068":["LT","1","SelectorLTValue"],"0069":["OW","1","SelectorOWValue"],"006A":["PN","1-n","SelectorPNValue"],"006B":["TM","1-n","SelectorTMValue"],"006C":["SH","1-n","SelectorSHValue"],"006D":["UN","1","SelectorUNValue"],"006E":["ST","1","SelectorSTValue"],"006F":["UC","1-n","SelectorUCValue"],"0070":["UT","1","SelectorUTValue"],"0071":["UR","1","SelectorURValue"],"0072":["DS","1-n","SelectorDSValue"],"0073":["OD","1","SelectorODValue"],"0074":["FD","1-n","SelectorFDValue"],"0075":["OL","1","SelectorOLValue"],"0076":["FL","1-n","SelectorFLValue"],"0078":["UL","1-n","SelectorULValue"],"007A":["US","1-n","SelectorUSValue"],"007C":["SL","1-n","SelectorSLValue"],"007E":["SS","1-n","SelectorSSValue"],"007F":["UI","1-n","SelectorUIValue"],"0080":["SQ","1","SelectorCodeSequenceValue"],"0081":["OV","1","SelectorOVValue"],"0082":["SV","1-n","SelectorSVValue"],"0083":["UV","1-n","SelectorUVValue"],"0100":["US","1","NumberOfScreens"],"0102":["SQ","1","NominalScreenDefinitionSequence"],"0104":["US","1","NumberOfVerticalPixels"],"0106":["US","1","NumberOfHorizontalPixels"],"0108":["FD","4","DisplayEnvironmentSpatialPosition"],"010A":["US","1","ScreenMinimumGrayscaleBitDepth"],"010C":["US","1","ScreenMinimumColorBitDepth"],"010E":["US","1","ApplicationMaximumRepaintTime"],"0200":["SQ","1","DisplaySetsSequence"],"0202":["US","1","DisplaySetNumber"],"0203":["LO","1","DisplaySetLabel"],"0204":["US","1","DisplaySetPresentationGroup"],"0206":["LO","1","DisplaySetPresentationGroupDescription"],"0208":["CS","1","PartialDataDisplayHandling"],"0210":["SQ","1","SynchronizedScrollingSequence"],"0212":["US","2-n","DisplaySetScrollingGroup"],"0214":["SQ","1","NavigationIndicatorSequence"],"0216":["US","1","NavigationDisplaySet"],"0218":["US","1-n","ReferenceDisplaySets"],"0300":["SQ","1","ImageBoxesSequence"],"0302":["US","1","ImageBoxNumber"],"0304":["CS","1","ImageBoxLayoutType"],"0306":["US","1","ImageBoxTileHorizontalDimension"],"0308":["US","1","ImageBoxTileVerticalDimension"],"0310":["CS","1","ImageBoxScrollDirection"],"0312":["CS","1","ImageBoxSmallScrollType"],"0314":["US","1","ImageBoxSmallScrollAmount"],"0316":["CS","1","ImageBoxLargeScrollType"],"0318":["US","1","ImageBoxLargeScrollAmount"],"0320":["US","1","ImageBoxOverlapPriority"],"0330":["FD","1","CineRelativeToRealTime"],"0400":["SQ","1","FilterOperationsSequence"],"0402":["CS","1","FilterByCategory"],"0404":["CS","1","FilterByAttributePresence"],"0406":["CS","1","FilterByOperator"],"0420":["US","3","StructuredDisplayBackgroundCIELabValue"],"0421":["US","3","EmptyImageBoxCIELabValue"],"0422":["SQ","1","StructuredDisplayImageBoxSequence"],"0424":["SQ","1","StructuredDisplayTextBoxSequence"],"0427":["SQ","1","ReferencedFirstFrameSequence"],"0430":["SQ","1","ImageBoxSynchronizationSequence"],"0432":["US","2-n","SynchronizedImageBoxList"],"0434":["CS","1","TypeOfSynchronization"],"0500":["CS","1","BlendingOperationType"],"0510":["CS","1","ReformattingOperationType"],"0512":["FD","1","ReformattingThickness"],"0514":["FD","1","ReformattingInterval"],"0516":["CS","1","ReformattingOperationInitialViewDirection"],"0520":["CS","1-n","ThreeDRenderingType"],"0600":["SQ","1","SortingOperationsSequence"],"0602":["CS","1","SortByCategory"],"0604":["CS","1","SortingDirection"],"0700":["CS","2","DisplaySetPatientOrientation"],"0702":["CS","1","VOIType"],"0704":["CS","1","PseudoColorType"],"0705":["SQ","1","PseudoColorPaletteInstanceReferenceSequence"],"0706":["CS","1","ShowGrayscaleInverted"],"0710":["CS","1","ShowImageTrueSizeFlag"],"0712":["CS","1","ShowGraphicAnnotationFlag"],"0714":["CS","1","ShowPatientDemographicsFlag"],"0716":["CS","1","ShowAcquisitionTechniquesFlag"],"0717":["CS","1","DisplaySetHorizontalJustification"],"0718":["CS","1","DisplaySetVerticalJustification"]},"0074":{"0000":["UL","1","GenericGroupLength"],"0120":["FD","1","ContinuationStartMeterset"],"0121":["FD","1","ContinuationEndMeterset"],1e3:["CS","1","ProcedureStepState"],1002:["SQ","1","ProcedureStepProgressInformationSequence"],1004:["DS","1","ProcedureStepProgress"],1006:["ST","1","ProcedureStepProgressDescription"],1007:["SQ","1","ProcedureStepProgressParametersSequence"],1008:["SQ","1","ProcedureStepCommunicationsURISequence"],"100A":["UR","1","ContactURI"],"100C":["LO","1","ContactDisplayName"],"100E":["SQ","1","ProcedureStepDiscontinuationReasonCodeSequence"],1020:["SQ","1","BeamTaskSequence"],1022:["CS","1","BeamTaskType"],1024:["IS","1","BeamOrderIndexTrial"],1025:["CS","1","AutosequenceFlag"],1026:["FD","1","TableTopVerticalAdjustedPosition"],1027:["FD","1","TableTopLongitudinalAdjustedPosition"],1028:["FD","1","TableTopLateralAdjustedPosition"],"102A":["FD","1","PatientSupportAdjustedAngle"],"102B":["FD","1","TableTopEccentricAdjustedAngle"],"102C":["FD","1","TableTopPitchAdjustedAngle"],"102D":["FD","1","TableTopRollAdjustedAngle"],1030:["SQ","1","DeliveryVerificationImageSequence"],1032:["CS","1","VerificationImageTiming"],1034:["CS","1","DoubleExposureFlag"],1036:["CS","1","DoubleExposureOrdering"],1038:["DS","1","DoubleExposureMetersetTrial"],"103A":["DS","4","DoubleExposureFieldDeltaTrial"],1040:["SQ","1","RelatedReferenceRTImageSequence"],1042:["SQ","1","GeneralMachineVerificationSequence"],1044:["SQ","1","ConventionalMachineVerificationSequence"],1046:["SQ","1","IonMachineVerificationSequence"],1048:["SQ","1","FailedAttributesSequence"],"104A":["SQ","1","OverriddenAttributesSequence"],"104C":["SQ","1","ConventionalControlPointVerificationSequence"],"104E":["SQ","1","IonControlPointVerificationSequence"],1050:["SQ","1","AttributeOccurrenceSequence"],1052:["AT","1","AttributeOccurrencePointer"],1054:["UL","1","AttributeItemSelector"],1056:["LO","1","AttributeOccurrencePrivateCreator"],1057:["IS","1-n","SelectorSequencePointerItems"],1200:["CS","1","ScheduledProcedureStepPriority"],1202:["LO","1","WorklistLabel"],1204:["LO","1","ProcedureStepLabel"],1210:["SQ","1","ScheduledProcessingParametersSequence"],1212:["SQ","1","PerformedProcessingParametersSequence"],1216:["SQ","1","UnifiedProcedureStepPerformedProcedureSequence"],1220:["SQ","1","RelatedProcedureStepSequence"],1222:["LO","1","ProcedureStepRelationshipType"],1224:["SQ","1","ReplacedProcedureStepSequence"],1230:["LO","1","DeletionLock"],1234:["AE","1","ReceivingAE"],1236:["AE","1","RequestingAE"],1238:["LT","1","ReasonForCancellation"],1242:["CS","1","SCPStatus"],1244:["CS","1","SubscriptionListStatus"],1246:["CS","1","UnifiedProcedureStepListStatus"],1324:["UL","1","BeamOrderIndex"],1338:["FD","1","DoubleExposureMeterset"],"133A":["FD","4","DoubleExposureFieldDelta"],1401:["SQ","1","BrachyTaskSequence"],1402:["DS","1","ContinuationStartTotalReferenceAirKerma"],1403:["DS","1","ContinuationEndTotalReferenceAirKerma"],1404:["IS","1","ContinuationPulseNumber"],1405:["SQ","1","ChannelDeliveryOrderSequence"],1406:["IS","1","ReferencedChannelNumber"],1407:["DS","1","StartCumulativeTimeWeight"],1408:["DS","1","EndCumulativeTimeWeight"],1409:["SQ","1","OmittedChannelSequence"],"140A":["CS","1","ReasonForChannelOmission"],"140B":["LO","1","ReasonForChannelOmissionDescription"],"140C":["IS","1","ChannelDeliveryOrderIndex"],"140D":["SQ","1","ChannelDeliveryContinuationSequence"],"140E":["SQ","1","OmittedApplicationSetupSequence"]},"0076":{"0000":["UL","1","GenericGroupLength"],"0001":["LO","1","ImplantAssemblyTemplateName"],"0003":["LO","1","ImplantAssemblyTemplateIssuer"],"0006":["LO","1","ImplantAssemblyTemplateVersion"],"0008":["SQ","1","ReplacedImplantAssemblyTemplateSequence"],"000A":["CS","1","ImplantAssemblyTemplateType"],"000C":["SQ","1","OriginalImplantAssemblyTemplateSequence"],"000E":["SQ","1","DerivationImplantAssemblyTemplateSequence"],"0010":["SQ","1","ImplantAssemblyTemplateTargetAnatomySequence"],"0020":["SQ","1","ProcedureTypeCodeSequence"],"0030":["LO","1","SurgicalTechnique"],"0032":["SQ","1","ComponentTypesSequence"],"0034":["SQ","1","ComponentTypeCodeSequence"],"0036":["CS","1","ExclusiveComponentType"],"0038":["CS","1","MandatoryComponentType"],"0040":["SQ","1","ComponentSequence"],"0055":["US","1","ComponentID"],"0060":["SQ","1","ComponentAssemblySequence"],"0070":["US","1","Component1ReferencedID"],"0080":["US","1","Component1ReferencedMatingFeatureSetID"],"0090":["US","1","Component1ReferencedMatingFeatureID"],"00A0":["US","1","Component2ReferencedID"],"00B0":["US","1","Component2ReferencedMatingFeatureSetID"],"00C0":["US","1","Component2ReferencedMatingFeatureID"]},"0078":{"0000":["UL","1","GenericGroupLength"],"0001":["LO","1","ImplantTemplateGroupName"],"0010":["ST","1","ImplantTemplateGroupDescription"],"0020":["LO","1","ImplantTemplateGroupIssuer"],"0024":["LO","1","ImplantTemplateGroupVersion"],"0026":["SQ","1","ReplacedImplantTemplateGroupSequence"],"0028":["SQ","1","ImplantTemplateGroupTargetAnatomySequence"],"002A":["SQ","1","ImplantTemplateGroupMembersSequence"],"002E":["US","1","ImplantTemplateGroupMemberID"],"0050":["FD","3","ThreeDImplantTemplateGroupMemberMatchingPoint"],"0060":["FD","9","ThreeDImplantTemplateGroupMemberMatchingAxes"],"0070":["SQ","1","ImplantTemplateGroupMemberMatching2DCoordinatesSequence"],"0090":["FD","2","TwoDImplantTemplateGroupMemberMatchingPoint"],"00A0":["FD","4","TwoDImplantTemplateGroupMemberMatchingAxes"],"00B0":["SQ","1","ImplantTemplateGroupVariationDimensionSequence"],"00B2":["LO","1","ImplantTemplateGroupVariationDimensionName"],"00B4":["SQ","1","ImplantTemplateGroupVariationDimensionRankSequence"],"00B6":["US","1","ReferencedImplantTemplateGroupMemberID"],"00B8":["US","1","ImplantTemplateGroupVariationDimensionRank"]},"0080":{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","SurfaceScanAcquisitionTypeCodeSequence"],"0002":["SQ","1","SurfaceScanModeCodeSequence"],"0003":["SQ","1","RegistrationMethodCodeSequence"],"0004":["FD","1","ShotDurationTime"],"0005":["FD","1","ShotOffsetTime"],"0006":["US","1-n","SurfacePointPresentationValueData"],"0007":["US","3-3n","SurfacePointColorCIELabValueData"],"0008":["SQ","1","UVMappingSequence"],"0009":["SH","1","TextureLabel"],"0010":["OF","1","UValueData"],"0011":["OF","1","VValueData"],"0012":["SQ","1","ReferencedTextureSequence"],"0013":["SQ","1","ReferencedSurfaceDataSequence"]},"0082":{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","AssessmentSummary"],"0003":["UT","1","AssessmentSummaryDescription"],"0004":["SQ","1","AssessedSOPInstanceSequence"],"0005":["SQ","1","ReferencedComparisonSOPInstanceSequence"],"0006":["UL","1","NumberOfAssessmentObservations"],"0007":["SQ","1","AssessmentObservationsSequence"],"0008":["CS","1","ObservationSignificance"],"000A":["UT","1","ObservationDescription"],"000C":["SQ","1","StructuredConstraintObservationSequence"],"0010":["SQ","1","AssessedAttributeValueSequence"],"0016":["LO","1","AssessmentSetID"],"0017":["SQ","1","AssessmentRequesterSequence"],"0018":["LO","1","SelectorAttributeName"],"0019":["LO","1","SelectorAttributeKeyword"],"0021":["SQ","1","AssessmentTypeCodeSequence"],"0022":["SQ","1","ObservationBasisCodeSequence"],"0023":["LO","1","AssessmentLabel"],"0032":["CS","1","ConstraintType"],"0033":["UT","1","SpecificationSelectionGuidance"],"0034":["SQ","1","ConstraintValueSequence"],"0035":["SQ","1","RecommendedDefaultValueSequence"],"0036":["CS","1","ConstraintViolationSignificance"],"0037":["UT","1","ConstraintViolationCondition"],"0038":["CS","1","ModifiableConstraintFlag"]},"0088":{"0000":["UL","1","GenericGroupLength"],"0130":["SH","1","StorageMediaFileSetID"],"0140":["UI","1","StorageMediaFileSetUID"],"0200":["SQ","1","IconImageSequence"],"0904":["LO","1","TopicTitle"],"0906":["ST","1","TopicSubject"],"0910":["LO","1","TopicAuthor"],"0912":["LO","1-32","TopicKeywords"]},"0100":{"0000":["UL","1","GenericGroupLength"],"0410":["CS","1","SOPInstanceStatus"],"0420":["DT","1","SOPAuthorizationDateTime"],"0424":["LT","1","SOPAuthorizationComment"],"0426":["LO","1","AuthorizationEquipmentCertificationNumber"]},"0400":{"0000":["UL","1","GenericGroupLength"],"0005":["US","1","MACIDNumber"],"0010":["UI","1","MACCalculationTransferSyntaxUID"],"0015":["CS","1","MACAlgorithm"],"0020":["AT","1-n","DataElementsSigned"],"0100":["UI","1","DigitalSignatureUID"],"0105":["DT","1","DigitalSignatureDateTime"],"0110":["CS","1","CertificateType"],"0115":["OB","1","CertificateOfSigner"],"0120":["OB","1","Signature"],"0305":["CS","1","CertifiedTimestampType"],"0310":["OB","1","CertifiedTimestamp"],"0315":["FL","1",""],"0401":["SQ","1","DigitalSignaturePurposeCodeSequence"],"0402":["SQ","1","ReferencedDigitalSignatureSequence"],"0403":["SQ","1","ReferencedSOPInstanceMACSequence"],"0404":["OB","1","MAC"],"0500":["SQ","1","EncryptedAttributesSequence"],"0510":["UI","1","EncryptedContentTransferSyntaxUID"],"0520":["OB","1","EncryptedContent"],"0550":["SQ","1","ModifiedAttributesSequence"],"0551":["SQ","1","NonconformingModifiedAttributesSequence"],"0552":["OB","1","NonconformingDataElementValue"],"0561":["SQ","1","OriginalAttributesSequence"],"0562":["DT","1","AttributeModificationDateTime"],"0563":["LO","1","ModifyingSystem"],"0564":["LO","1","SourceOfPreviousValues"],"0565":["CS","1","ReasonForTheAttributeModification"],"0600":["CS","1","InstanceOriginStatus"]},1e3:{"0000":["UL","1","GenericGroupLength"],"0010":["US","3","EscapeTriplet"],"0011":["US","3","RunLengthTriplet"],"0012":["US","1","HuffmanTableSize"],"0013":["US","3","HuffmanTableTriplet"],"0014":["US","1","ShiftTableSize"],"0015":["US","3","ShiftTableTriplet"]},1010:{"0000":["UL","1","GenericGroupLength"],"0004":["US","1-n","ZonalMap"]},2e3:{"0000":["UL","1","GenericGroupLength"],"0010":["IS","1","NumberOfCopies"],"001E":["SQ","1","PrinterConfigurationSequence"],"0020":["CS","1","PrintPriority"],"0030":["CS","1","MediumType"],"0040":["CS","1","FilmDestination"],"0050":["LO","1","FilmSessionLabel"],"0060":["IS","1","MemoryAllocation"],"0061":["IS","1","MaximumMemoryAllocation"],"0062":["CS","1","ColorImagePrintingFlag"],"0063":["CS","1","CollationFlag"],"0065":["CS","1","AnnotationFlag"],"0067":["CS","1","ImageOverlayFlag"],"0069":["CS","1","PresentationLUTFlag"],"006A":["CS","1","ImageBoxPresentationLUTFlag"],"00A0":["US","1","MemoryBitDepth"],"00A1":["US","1","PrintingBitDepth"],"00A2":["SQ","1","MediaInstalledSequence"],"00A4":["SQ","1","OtherMediaAvailableSequence"],"00A8":["SQ","1","SupportedImageDisplayFormatsSequence"],"0500":["SQ","1","ReferencedFilmBoxSequence"],"0510":["SQ","1","ReferencedStoredPrintSequence"]},2010:{"0000":["UL","1","GenericGroupLength"],"0010":["ST","1","ImageDisplayFormat"],"0030":["CS","1","AnnotationDisplayFormatID"],"0040":["CS","1","FilmOrientation"],"0050":["CS","1","FilmSizeID"],"0052":["CS","1","PrinterResolutionID"],"0054":["CS","1","DefaultPrinterResolutionID"],"0060":["CS","1","MagnificationType"],"0080":["CS","1","SmoothingType"],"00A6":["CS","1","DefaultMagnificationType"],"00A7":["CS","1-n","OtherMagnificationTypesAvailable"],"00A8":["CS","1","DefaultSmoothingType"],"00A9":["CS","1-n","OtherSmoothingTypesAvailable"],"0100":["CS","1","BorderDensity"],"0110":["CS","1","EmptyImageDensity"],"0120":["US","1","MinDensity"],"0130":["US","1","MaxDensity"],"0140":["CS","1","Trim"],"0150":["ST","1","ConfigurationInformation"],"0152":["LT","1","ConfigurationInformationDescription"],"0154":["IS","1","MaximumCollatedFilms"],"015E":["US","1","Illumination"],"0160":["US","1","ReflectedAmbientLight"],"0376":["DS","2","PrinterPixelSpacing"],"0500":["SQ","1","ReferencedFilmSessionSequence"],"0510":["SQ","1","ReferencedImageBoxSequence"],"0520":["SQ","1","ReferencedBasicAnnotationBoxSequence"]},2020:{"0000":["UL","1","GenericGroupLength"],"0010":["US","1","ImageBoxPosition"],"0020":["CS","1","Polarity"],"0030":["DS","1","RequestedImageSize"],"0040":["CS","1","RequestedDecimateCropBehavior"],"0050":["CS","1","RequestedResolutionID"],"00A0":["CS","1","RequestedImageSizeFlag"],"00A2":["CS","1","DecimateCropResult"],"0110":["SQ","1","BasicGrayscaleImageSequence"],"0111":["SQ","1","BasicColorImageSequence"],"0130":["SQ","1","ReferencedImageOverlayBoxSequence"],"0140":["SQ","1","ReferencedVOILUTBoxSequence"]},2030:{"0000":["UL","1","GenericGroupLength"],"0010":["US","1","AnnotationPosition"],"0020":["LO","1","TextString"]},2040:{"0000":["UL","1","GenericGroupLength"],"0010":["SQ","1","ReferencedOverlayPlaneSequence"],"0011":["US","1-99","ReferencedOverlayPlaneGroups"],"0020":["SQ","1","OverlayPixelDataSequence"],"0060":["CS","1","OverlayMagnificationType"],"0070":["CS","1","OverlaySmoothingType"],"0072":["CS","1","OverlayOrImageMagnification"],"0074":["US","1","MagnifyToNumberOfColumns"],"0080":["CS","1","OverlayForegroundDensity"],"0082":["CS","1","OverlayBackgroundDensity"],"0090":["CS","1","OverlayMode"],"0100":["CS","1","ThresholdDensity"],"0500":["SQ","1","ReferencedImageBoxSequenceRetired"]},2050:{"0000":["UL","1","GenericGroupLength"],"0010":["SQ","1","PresentationLUTSequence"],"0020":["CS","1","PresentationLUTShape"],"0500":["SQ","1","ReferencedPresentationLUTSequence"]},2100:{"0000":["UL","1","GenericGroupLength"],"0010":["SH","1","PrintJobID"],"0020":["CS","1","ExecutionStatus"],"0030":["CS","1","ExecutionStatusInfo"],"0040":["DA","1","CreationDate"],"0050":["TM","1","CreationTime"],"0070":["AE","1","Originator"],"0140":["AE","1","DestinationAE"],"0160":["SH","1","OwnerID"],"0170":["IS","1","NumberOfFilms"],"0500":["SQ","1","ReferencedPrintJobSequencePullStoredPrint"]},2110:{"0000":["UL","1","GenericGroupLength"],"0010":["CS","1","PrinterStatus"],"0020":["CS","1","PrinterStatusInfo"],"0030":["LO","1","PrinterName"],"0099":["SH","1","PrintQueueID"]},2120:{"0000":["UL","1","GenericGroupLength"],"0010":["CS","1","QueueStatus"],"0050":["SQ","1","PrintJobDescriptionSequence"],"0070":["SQ","1","ReferencedPrintJobSequence"]},2130:{"0000":["UL","1","GenericGroupLength"],"0010":["SQ","1","PrintManagementCapabilitiesSequence"],"0015":["SQ","1","PrinterCharacteristicsSequence"],"0030":["SQ","1","FilmBoxContentSequence"],"0040":["SQ","1","ImageBoxContentSequence"],"0050":["SQ","1","AnnotationContentSequence"],"0060":["SQ","1","ImageOverlayBoxContentSequence"],"0080":["SQ","1","PresentationLUTContentSequence"],"00A0":["SQ","1","ProposedStudySequence"],"00C0":["SQ","1","OriginalImageSequence"]},2200:{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","LabelUsingInformationExtractedFromInstances"],"0002":["UT","1","LabelText"],"0003":["CS","1","LabelStyleSelection"],"0004":["LT","1","MediaDisposition"],"0005":["LT","1","BarcodeValue"],"0006":["CS","1","BarcodeSymbology"],"0007":["CS","1","AllowMediaSplitting"],"0008":["CS","1","IncludeNonDICOMObjects"],"0009":["CS","1","IncludeDisplayApplication"],"000A":["CS","1","PreserveCompositeInstancesAfterMediaCreation"],"000B":["US","1","TotalNumberOfPiecesOfMediaCreated"],"000C":["LO","1","RequestedMediaApplicationProfile"],"000D":["SQ","1","ReferencedStorageMediaSequence"],"000E":["AT","1-n","FailureAttributes"],"000F":["CS","1","AllowLossyCompression"],"0020":["CS","1","RequestPriority"]},3002:{"0000":["UL","1","GenericGroupLength"],"0002":["SH","1","RTImageLabel"],"0003":["LO","1","RTImageName"],"0004":["ST","1","RTImageDescription"],"000A":["CS","1","ReportedValuesOrigin"],"000C":["CS","1","RTImagePlane"],"000D":["DS","3","XRayImageReceptorTranslation"],"000E":["DS","1","XRayImageReceptorAngle"],"0010":["DS","6","RTImageOrientation"],"0011":["DS","2","ImagePlanePixelSpacing"],"0012":["DS","2","RTImagePosition"],"0020":["SH","1","RadiationMachineName"],"0022":["DS","1","RadiationMachineSAD"],"0024":["DS","1","RadiationMachineSSD"],"0026":["DS","1","RTImageSID"],"0028":["DS","1","SourceToReferenceObjectDistance"],"0029":["IS","1","FractionNumber"],"0030":["SQ","1","ExposureSequence"],"0032":["DS","1","MetersetExposure"],"0034":["DS","4","DiaphragmPosition"],"0040":["SQ","1","FluenceMapSequence"],"0041":["CS","1","FluenceDataSource"],"0042":["DS","1","FluenceDataScale"],"0050":["SQ","1","PrimaryFluenceModeSequence"],"0051":["CS","1","FluenceMode"],"0052":["SH","1","FluenceModeID"]},3004:{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","DVHType"],"0002":["CS","1","DoseUnits"],"0004":["CS","1","DoseType"],"0005":["CS","1","SpatialTransformOfDose"],"0006":["LO","1","DoseComment"],"0008":["DS","3","NormalizationPoint"],"000A":["CS","1","DoseSummationType"],"000C":["DS","2-n","GridFrameOffsetVector"],"000E":["DS","1","DoseGridScaling"],"0010":["SQ","1","RTDoseROISequence"],"0012":["DS","1","DoseValue"],"0014":["CS","1-3","TissueHeterogeneityCorrection"],"0040":["DS","3","DVHNormalizationPoint"],"0042":["DS","1","DVHNormalizationDoseValue"],"0050":["SQ","1","DVHSequence"],"0052":["DS","1","DVHDoseScaling"],"0054":["CS","1","DVHVolumeUnits"],"0056":["IS","1","DVHNumberOfBins"],"0058":["DS","2-2n","DVHData"],"0060":["SQ","1","DVHReferencedROISequence"],"0062":["CS","1","DVHROIContributionType"],"0070":["DS","1","DVHMinimumDose"],"0072":["DS","1","DVHMaximumDose"],"0074":["DS","1","DVHMeanDose"]},3006:{"0000":["UL","1","GenericGroupLength"],"0002":["SH","1","StructureSetLabel"],"0004":["LO","1","StructureSetName"],"0006":["ST","1","StructureSetDescription"],"0008":["DA","1","StructureSetDate"],"0009":["TM","1","StructureSetTime"],"0010":["SQ","1","ReferencedFrameOfReferenceSequence"],"0012":["SQ","1","RTReferencedStudySequence"],"0014":["SQ","1","RTReferencedSeriesSequence"],"0016":["SQ","1","ContourImageSequence"],"0018":["SQ","1","PredecessorStructureSetSequence"],"0020":["SQ","1","StructureSetROISequence"],"0022":["IS","1","ROINumber"],"0024":["UI","1","ReferencedFrameOfReferenceUID"],"0026":["LO","1","ROIName"],"0028":["ST","1","ROIDescription"],"002A":["IS","3","ROIDisplayColor"],"002C":["DS","1","ROIVolume"],"0030":["SQ","1","RTRelatedROISequence"],"0033":["CS","1","RTROIRelationship"],"0036":["CS","1","ROIGenerationAlgorithm"],"0037":["SQ","1","ROIDerivationAlgorithmIdentificationSequence"],"0038":["LO","1","ROIGenerationDescription"],"0039":["SQ","1","ROIContourSequence"],"0040":["SQ","1","ContourSequence"],"0042":["CS","1","ContourGeometricType"],"0044":["DS","1","ContourSlabThickness"],"0045":["DS","3","ContourOffsetVector"],"0046":["IS","1","NumberOfContourPoints"],"0048":["IS","1","ContourNumber"],"0049":["IS","1-n","AttachedContours"],"004A":["SQ","1","SourcePixelPlanesCharacteristicsSequence"],"0050":["DS","3-3n","ContourData"],"0080":["SQ","1","RTROIObservationsSequence"],"0082":["IS","1","ObservationNumber"],"0084":["IS","1","ReferencedROINumber"],"0085":["SH","1","ROIObservationLabel"],"0086":["SQ","1","RTROIIdentificationCodeSequence"],"0088":["ST","1","ROIObservationDescription"],"00A0":["SQ","1","RelatedRTROIObservationsSequence"],"00A4":["CS","1","RTROIInterpretedType"],"00A6":["PN","1","ROIInterpreter"],"00B0":["SQ","1","ROIPhysicalPropertiesSequence"],"00B2":["CS","1","ROIPhysicalProperty"],"00B4":["DS","1","ROIPhysicalPropertyValue"],"00B6":["SQ","1","ROIElementalCompositionSequence"],"00B7":["US","1","ROIElementalCompositionAtomicNumber"],"00B8":["FL","1","ROIElementalCompositionAtomicMassFraction"],"00B9":["SQ","1","AdditionalRTROIIdentificationCodeSequence"],"00C0":["SQ","1","FrameOfReferenceRelationshipSequence"],"00C2":["UI","1","RelatedFrameOfReferenceUID"],"00C4":["CS","1","FrameOfReferenceTransformationType"],"00C6":["DS","16","FrameOfReferenceTransformationMatrix"],"00C8":["LO","1","FrameOfReferenceTransformationComment"],"00C9":["SQ","1","PatientLocationCoordinatesSequence"],"00CA":["SQ","1","PatientLocationCoordinatesCodeSequence"],"00CB":["SQ","1","PatientSupportPositionSequence"]},3008:{"0000":["UL","1","GenericGroupLength"],"0010":["SQ","1","MeasuredDoseReferenceSequence"],"0012":["ST","1","MeasuredDoseDescription"],"0014":["CS","1","MeasuredDoseType"],"0016":["DS","1","MeasuredDoseValue"],"0020":["SQ","1","TreatmentSessionBeamSequence"],"0021":["SQ","1","TreatmentSessionIonBeamSequence"],"0022":["IS","1","CurrentFractionNumber"],"0024":["DA","1","TreatmentControlPointDate"],"0025":["TM","1","TreatmentControlPointTime"],"002A":["CS","1","TreatmentTerminationStatus"],"002B":["SH","1","TreatmentTerminationCode"],"002C":["CS","1","TreatmentVerificationStatus"],"0030":["SQ","1","ReferencedTreatmentRecordSequence"],"0032":["DS","1","SpecifiedPrimaryMeterset"],"0033":["DS","1","SpecifiedSecondaryMeterset"],"0036":["DS","1","DeliveredPrimaryMeterset"],"0037":["DS","1","DeliveredSecondaryMeterset"],"003A":["DS","1","SpecifiedTreatmentTime"],"003B":["DS","1","DeliveredTreatmentTime"],"0040":["SQ","1","ControlPointDeliverySequence"],"0041":["SQ","1","IonControlPointDeliverySequence"],"0042":["DS","1","SpecifiedMeterset"],"0044":["DS","1","DeliveredMeterset"],"0045":["FL","1","MetersetRateSet"],"0046":["FL","1","MetersetRateDelivered"],"0047":["FL","1-n","ScanSpotMetersetsDelivered"],"0048":["DS","1","DoseRateDelivered"],"0050":["SQ","1","TreatmentSummaryCalculatedDoseReferenceSequence"],"0052":["DS","1","CumulativeDoseToDoseReference"],"0054":["DA","1","FirstTreatmentDate"],"0056":["DA","1","MostRecentTreatmentDate"],"005A":["IS","1","NumberOfFractionsDelivered"],"0060":["SQ","1","OverrideSequence"],"0061":["AT","1","ParameterSequencePointer"],"0062":["AT","1","OverrideParameterPointer"],"0063":["IS","1","ParameterItemIndex"],"0064":["IS","1","MeasuredDoseReferenceNumber"],"0065":["AT","1","ParameterPointer"],"0066":["ST","1","OverrideReason"],"0067":["US","1","ParameterValueNumber"],"0068":["SQ","1","CorrectedParameterSequence"],"006A":["FL","1","CorrectionValue"],"0070":["SQ","1","CalculatedDoseReferenceSequence"],"0072":["IS","1","CalculatedDoseReferenceNumber"],"0074":["ST","1","CalculatedDoseReferenceDescription"],"0076":["DS","1","CalculatedDoseReferenceDoseValue"],"0078":["DS","1","StartMeterset"],"007A":["DS","1","EndMeterset"],"0080":["SQ","1","ReferencedMeasuredDoseReferenceSequence"],"0082":["IS","1","ReferencedMeasuredDoseReferenceNumber"],"0090":["SQ","1","ReferencedCalculatedDoseReferenceSequence"],"0092":["IS","1","ReferencedCalculatedDoseReferenceNumber"],"00A0":["SQ","1","BeamLimitingDeviceLeafPairsSequence"],"00B0":["SQ","1","RecordedWedgeSequence"],"00C0":["SQ","1","RecordedCompensatorSequence"],"00D0":["SQ","1","RecordedBlockSequence"],"00D1":["SQ","1","RecordedBlockSlabSequence"],"00E0":["SQ","1","TreatmentSummaryMeasuredDoseReferenceSequence"],"00F0":["SQ","1","RecordedSnoutSequence"],"00F2":["SQ","1","RecordedRangeShifterSequence"],"00F4":["SQ","1","RecordedLateralSpreadingDeviceSequence"],"00F6":["SQ","1","RecordedRangeModulatorSequence"],"0100":["SQ","1","RecordedSourceSequence"],"0105":["LO","1","SourceSerialNumber"],"0110":["SQ","1","TreatmentSessionApplicationSetupSequence"],"0116":["CS","1","ApplicationSetupCheck"],"0120":["SQ","1","RecordedBrachyAccessoryDeviceSequence"],"0122":["IS","1","ReferencedBrachyAccessoryDeviceNumber"],"0130":["SQ","1","RecordedChannelSequence"],"0132":["DS","1","SpecifiedChannelTotalTime"],"0134":["DS","1","DeliveredChannelTotalTime"],"0136":["IS","1","SpecifiedNumberOfPulses"],"0138":["IS","1","DeliveredNumberOfPulses"],"013A":["DS","1","SpecifiedPulseRepetitionInterval"],"013C":["DS","1","DeliveredPulseRepetitionInterval"],"0140":["SQ","1","RecordedSourceApplicatorSequence"],"0142":["IS","1","ReferencedSourceApplicatorNumber"],"0150":["SQ","1","RecordedChannelShieldSequence"],"0152":["IS","1","ReferencedChannelShieldNumber"],"0160":["SQ","1","BrachyControlPointDeliveredSequence"],"0162":["DA","1","SafePositionExitDate"],"0164":["TM","1","SafePositionExitTime"],"0166":["DA","1","SafePositionReturnDate"],"0168":["TM","1","SafePositionReturnTime"],"0171":["SQ","1","PulseSpecificBrachyControlPointDeliveredSequence"],"0172":["US","1","PulseNumber"],"0173":["SQ","1","BrachyPulseControlPointDeliveredSequence"],"0200":["CS","1","CurrentTreatmentStatus"],"0202":["ST","1","TreatmentStatusComment"],"0220":["SQ","1","FractionGroupSummarySequence"],"0223":["IS","1","ReferencedFractionNumber"],"0224":["CS","1","FractionGroupType"],"0230":["CS","1","BeamStopperPosition"],"0240":["SQ","1","FractionStatusSummarySequence"],"0250":["DA","1","TreatmentDate"],"0251":["TM","1","TreatmentTime"]},"300A":{"0000":["UL","1","GenericGroupLength"],"0002":["SH","1","RTPlanLabel"],"0003":["LO","1","RTPlanName"],"0004":["ST","1","RTPlanDescription"],"0006":["DA","1","RTPlanDate"],"0007":["TM","1","RTPlanTime"],"0009":["LO","1-n","TreatmentProtocols"],"000A":["CS","1","PlanIntent"],"000B":["LO","1-n","TreatmentSites"],"000C":["CS","1","RTPlanGeometry"],"000E":["ST","1","PrescriptionDescription"],"0010":["SQ","1","DoseReferenceSequence"],"0012":["IS","1","DoseReferenceNumber"],"0013":["UI","1","DoseReferenceUID"],"0014":["CS","1","DoseReferenceStructureType"],"0015":["CS","1","NominalBeamEnergyUnit"],"0016":["LO","1","DoseReferenceDescription"],"0018":["DS","3","DoseReferencePointCoordinates"],"001A":["DS","1","NominalPriorDose"],"0020":["CS","1","DoseReferenceType"],"0021":["DS","1","ConstraintWeight"],"0022":["DS","1","DeliveryWarningDose"],"0023":["DS","1","DeliveryMaximumDose"],"0025":["DS","1","TargetMinimumDose"],"0026":["DS","1","TargetPrescriptionDose"],"0027":["DS","1","TargetMaximumDose"],"0028":["DS","1","TargetUnderdoseVolumeFraction"],"002A":["DS","1","OrganAtRiskFullVolumeDose"],"002B":["DS","1","OrganAtRiskLimitDose"],"002C":["DS","1","OrganAtRiskMaximumDose"],"002D":["DS","1","OrganAtRiskOverdoseVolumeFraction"],"0040":["SQ","1","ToleranceTableSequence"],"0042":["IS","1","ToleranceTableNumber"],"0043":["SH","1","ToleranceTableLabel"],"0044":["DS","1","GantryAngleTolerance"],"0046":["DS","1","BeamLimitingDeviceAngleTolerance"],"0048":["SQ","1","BeamLimitingDeviceToleranceSequence"],"004A":["DS","1","BeamLimitingDevicePositionTolerance"],"004B":["FL","1","SnoutPositionTolerance"],"004C":["DS","1","PatientSupportAngleTolerance"],"004E":["DS","1","TableTopEccentricAngleTolerance"],"004F":["FL","1","TableTopPitchAngleTolerance"],"0050":["FL","1","TableTopRollAngleTolerance"],"0051":["DS","1","TableTopVerticalPositionTolerance"],"0052":["DS","1","TableTopLongitudinalPositionTolerance"],"0053":["DS","1","TableTopLateralPositionTolerance"],"0055":["CS","1","RTPlanRelationship"],"0070":["SQ","1","FractionGroupSequence"],"0071":["IS","1","FractionGroupNumber"],"0072":["LO","1","FractionGroupDescription"],"0078":["IS","1","NumberOfFractionsPlanned"],"0079":["IS","1","NumberOfFractionPatternDigitsPerDay"],"007A":["IS","1","RepeatFractionCycleLength"],"007B":["LT","1","FractionPattern"],"0080":["IS","1","NumberOfBeams"],"0082":["DS","3","BeamDoseSpecificationPoint"],"0083":["UI","1","ReferencedDoseReferenceUID"],"0084":["DS","1","BeamDose"],"0086":["DS","1","BeamMeterset"],"0088":["FL","1","BeamDosePointDepth"],"0089":["FL","1","BeamDosePointEquivalentDepth"],"008A":["FL","1","BeamDosePointSSD"],"008B":["CS","1","BeamDoseMeaning"],"008C":["SQ","1","BeamDoseVerificationControlPointSequence"],"008D":["FL","1","AverageBeamDosePointDepth"],"008E":["FL","1","AverageBeamDosePointEquivalentDepth"],"008F":["FL","1","AverageBeamDosePointSSD"],"0090":["CS","1","BeamDoseType"],"0091":["DS","1","AlternateBeamDose"],"0092":["CS","1","AlternateBeamDoseType"],"0093":["CS","1","DepthValueAveragingFlag"],"0094":["DS","1","BeamDosePointSourceToExternalContourDistance"],"00A0":["IS","1","NumberOfBrachyApplicationSetups"],"00A2":["DS","3","BrachyApplicationSetupDoseSpecificationPoint"],"00A4":["DS","1","BrachyApplicationSetupDose"],"00B0":["SQ","1","BeamSequence"],"00B2":["SH","1","TreatmentMachineName"],"00B3":["CS","1","PrimaryDosimeterUnit"],"00B4":["DS","1","SourceAxisDistance"],"00B6":["SQ","1","BeamLimitingDeviceSequence"],"00B8":["CS","1","RTBeamLimitingDeviceType"],"00BA":["DS","1","SourceToBeamLimitingDeviceDistance"],"00BB":["FL","1","IsocenterToBeamLimitingDeviceDistance"],"00BC":["IS","1","NumberOfLeafJawPairs"],"00BE":["DS","3-n","LeafPositionBoundaries"],"00C0":["IS","1","BeamNumber"],"00C2":["LO","1","BeamName"],"00C3":["ST","1","BeamDescription"],"00C4":["CS","1","BeamType"],"00C5":["FD","1","BeamDeliveryDurationLimit"],"00C6":["CS","1","RadiationType"],"00C7":["CS","1","HighDoseTechniqueType"],"00C8":["IS","1","ReferenceImageNumber"],"00CA":["SQ","1","PlannedVerificationImageSequence"],"00CC":["LO","1-n","ImagingDeviceSpecificAcquisitionParameters"],"00CE":["CS","1","TreatmentDeliveryType"],"00D0":["IS","1","NumberOfWedges"],"00D1":["SQ","1","WedgeSequence"],"00D2":["IS","1","WedgeNumber"],"00D3":["CS","1","WedgeType"],"00D4":["SH","1","WedgeID"],"00D5":["IS","1","WedgeAngle"],"00D6":["DS","1","WedgeFactor"],"00D7":["FL","1","TotalWedgeTrayWaterEquivalentThickness"],"00D8":["DS","1","WedgeOrientation"],"00D9":["FL","1","IsocenterToWedgeTrayDistance"],"00DA":["DS","1","SourceToWedgeTrayDistance"],"00DB":["FL","1","WedgeThinEdgePosition"],"00DC":["SH","1","BolusID"],"00DD":["ST","1","BolusDescription"],"00DE":["DS","1","EffectiveWedgeAngle"],"00E0":["IS","1","NumberOfCompensators"],"00E1":["SH","1","MaterialID"],"00E2":["DS","1","TotalCompensatorTrayFactor"],"00E3":["SQ","1","CompensatorSequence"],"00E4":["IS","1","CompensatorNumber"],"00E5":["SH","1","CompensatorID"],"00E6":["DS","1","SourceToCompensatorTrayDistance"],"00E7":["IS","1","CompensatorRows"],"00E8":["IS","1","CompensatorColumns"],"00E9":["DS","2","CompensatorPixelSpacing"],"00EA":["DS","2","CompensatorPosition"],"00EB":["DS","1-n","CompensatorTransmissionData"],"00EC":["DS","1-n","CompensatorThicknessData"],"00ED":["IS","1","NumberOfBoli"],"00EE":["CS","1","CompensatorType"],"00EF":["SH","1","CompensatorTrayID"],"00F0":["IS","1","NumberOfBlocks"],"00F2":["DS","1","TotalBlockTrayFactor"],"00F3":["FL","1","TotalBlockTrayWaterEquivalentThickness"],"00F4":["SQ","1","BlockSequence"],"00F5":["SH","1","BlockTrayID"],"00F6":["DS","1","SourceToBlockTrayDistance"],"00F7":["FL","1","IsocenterToBlockTrayDistance"],"00F8":["CS","1","BlockType"],"00F9":["LO","1","AccessoryCode"],"00FA":["CS","1","BlockDivergence"],"00FB":["CS","1","BlockMountingPosition"],"00FC":["IS","1","BlockNumber"],"00FE":["LO","1","BlockName"],"0100":["DS","1","BlockThickness"],"0102":["DS","1","BlockTransmission"],"0104":["IS","1","BlockNumberOfPoints"],"0106":["DS","2-2n","BlockData"],"0107":["SQ","1","ApplicatorSequence"],"0108":["SH","1","ApplicatorID"],"0109":["CS","1","ApplicatorType"],"010A":["LO","1","ApplicatorDescription"],"010C":["DS","1","CumulativeDoseReferenceCoefficient"],"010E":["DS","1","FinalCumulativeMetersetWeight"],"0110":["IS","1","NumberOfControlPoints"],"0111":["SQ","1","ControlPointSequence"],"0112":["IS","1","ControlPointIndex"],"0114":["DS","1","NominalBeamEnergy"],"0115":["DS","1","DoseRateSet"],"0116":["SQ","1","WedgePositionSequence"],"0118":["CS","1","WedgePosition"],"011A":["SQ","1","BeamLimitingDevicePositionSequence"],"011C":["DS","2-2n","LeafJawPositions"],"011E":["DS","1","GantryAngle"],"011F":["CS","1","GantryRotationDirection"],"0120":["DS","1","BeamLimitingDeviceAngle"],"0121":["CS","1","BeamLimitingDeviceRotationDirection"],"0122":["DS","1","PatientSupportAngle"],"0123":["CS","1","PatientSupportRotationDirection"],"0124":["DS","1","TableTopEccentricAxisDistance"],"0125":["DS","1","TableTopEccentricAngle"],"0126":["CS","1","TableTopEccentricRotationDirection"],"0128":["DS","1","TableTopVerticalPosition"],"0129":["DS","1","TableTopLongitudinalPosition"],"012A":["DS","1","TableTopLateralPosition"],"012C":["DS","3","IsocenterPosition"],"012E":["DS","3","SurfaceEntryPoint"],"0130":["DS","1","SourceToSurfaceDistance"],"0131":["FL","1","AverageBeamDosePointSourceToExternalContourDistance"],"0132":["FL","1","SourceToExternalContourDistance"],"0133":["FL","3","ExternalContourEntryPoint"],"0134":["DS","1","CumulativeMetersetWeight"],"0140":["FL","1","TableTopPitchAngle"],"0142":["CS","1","TableTopPitchRotationDirection"],"0144":["FL","1","TableTopRollAngle"],"0146":["CS","1","TableTopRollRotationDirection"],"0148":["FL","1","HeadFixationAngle"],"014A":["FL","1","GantryPitchAngle"],"014C":["CS","1","GantryPitchRotationDirection"],"014E":["FL","1","GantryPitchAngleTolerance"],"0150":["CS","1","FixationEye"],"0151":["DS","1","ChairHeadFramePosition"],"0152":["DS","1","HeadFixationAngleTolerance"],"0153":["DS","1","ChairHeadFramePositionTolerance"],"0154":["DS","1","FixationLightAzimuthalAngleTolerance"],"0155":["DS","1","FixationLightPolarAngleTolerance"],"0180":["SQ","1","PatientSetupSequence"],"0182":["IS","1","PatientSetupNumber"],"0183":["LO","1","PatientSetupLabel"],"0184":["LO","1","PatientAdditionalPosition"],"0190":["SQ","1","FixationDeviceSequence"],"0192":["CS","1","FixationDeviceType"],"0194":["SH","1","FixationDeviceLabel"],"0196":["ST","1","FixationDeviceDescription"],"0198":["SH","1","FixationDevicePosition"],"0199":["FL","1","FixationDevicePitchAngle"],"019A":["FL","1","FixationDeviceRollAngle"],"01A0":["SQ","1","ShieldingDeviceSequence"],"01A2":["CS","1","ShieldingDeviceType"],"01A4":["SH","1","ShieldingDeviceLabel"],"01A6":["ST","1","ShieldingDeviceDescription"],"01A8":["SH","1","ShieldingDevicePosition"],"01B0":["CS","1","SetupTechnique"],"01B2":["ST","1","SetupTechniqueDescription"],"01B4":["SQ","1","SetupDeviceSequence"],"01B6":["CS","1","SetupDeviceType"],"01B8":["SH","1","SetupDeviceLabel"],"01BA":["ST","1","SetupDeviceDescription"],"01BC":["DS","1","SetupDeviceParameter"],"01D0":["ST","1","SetupReferenceDescription"],"01D2":["DS","1","TableTopVerticalSetupDisplacement"],"01D4":["DS","1","TableTopLongitudinalSetupDisplacement"],"01D6":["DS","1","TableTopLateralSetupDisplacement"],"0200":["CS","1","BrachyTreatmentTechnique"],"0202":["CS","1","BrachyTreatmentType"],"0206":["SQ","1","TreatmentMachineSequence"],"0210":["SQ","1","SourceSequence"],"0212":["IS","1","SourceNumber"],"0214":["CS","1","SourceType"],"0216":["LO","1","SourceManufacturer"],"0218":["DS","1","ActiveSourceDiameter"],"021A":["DS","1","ActiveSourceLength"],"021B":["SH","1","SourceModelID"],"021C":["LO","1","SourceDescription"],"0222":["DS","1","SourceEncapsulationNominalThickness"],"0224":["DS","1","SourceEncapsulationNominalTransmission"],"0226":["LO","1","SourceIsotopeName"],"0228":["DS","1","SourceIsotopeHalfLife"],"0229":["CS","1","SourceStrengthUnits"],"022A":["DS","1","ReferenceAirKermaRate"],"022B":["DS","1","SourceStrength"],"022C":["DA","1","SourceStrengthReferenceDate"],"022E":["TM","1","SourceStrengthReferenceTime"],"0230":["SQ","1","ApplicationSetupSequence"],"0232":["CS","1","ApplicationSetupType"],"0234":["IS","1","ApplicationSetupNumber"],"0236":["LO","1","ApplicationSetupName"],"0238":["LO","1","ApplicationSetupManufacturer"],"0240":["IS","1","TemplateNumber"],"0242":["SH","1","TemplateType"],"0244":["LO","1","TemplateName"],"0250":["DS","1","TotalReferenceAirKerma"],"0260":["SQ","1","BrachyAccessoryDeviceSequence"],"0262":["IS","1","BrachyAccessoryDeviceNumber"],"0263":["SH","1","BrachyAccessoryDeviceID"],"0264":["CS","1","BrachyAccessoryDeviceType"],"0266":["LO","1","BrachyAccessoryDeviceName"],"026A":["DS","1","BrachyAccessoryDeviceNominalThickness"],"026C":["DS","1","BrachyAccessoryDeviceNominalTransmission"],"0271":["DS","1","ChannelEffectiveLength"],"0272":["DS","1","ChannelInnerLength"],"0273":["SH","1","AfterloaderChannelID"],"0274":["DS","1","SourceApplicatorTipLength"],"0280":["SQ","1","ChannelSequence"],"0282":["IS","1","ChannelNumber"],"0284":["DS","1","ChannelLength"],"0286":["DS","1","ChannelTotalTime"],"0288":["CS","1","SourceMovementType"],"028A":["IS","1","NumberOfPulses"],"028C":["DS","1","PulseRepetitionInterval"],"0290":["IS","1","SourceApplicatorNumber"],"0291":["SH","1","SourceApplicatorID"],"0292":["CS","1","SourceApplicatorType"],"0294":["LO","1","SourceApplicatorName"],"0296":["DS","1","SourceApplicatorLength"],"0298":["LO","1","SourceApplicatorManufacturer"],"029C":["DS","1","SourceApplicatorWallNominalThickness"],"029E":["DS","1","SourceApplicatorWallNominalTransmission"],"02A0":["DS","1","SourceApplicatorStepSize"],"02A1":["IS","1","ApplicatorShapeReferencedROINumber"],"02A2":["IS","1","TransferTubeNumber"],"02A4":["DS","1","TransferTubeLength"],"02B0":["SQ","1","ChannelShieldSequence"],"02B2":["IS","1","ChannelShieldNumber"],"02B3":["SH","1","ChannelShieldID"],"02B4":["LO","1","ChannelShieldName"],"02B8":["DS","1","ChannelShieldNominalThickness"],"02BA":["DS","1","ChannelShieldNominalTransmission"],"02C8":["DS","1","FinalCumulativeTimeWeight"],"02D0":["SQ","1","BrachyControlPointSequence"],"02D2":["DS","1","ControlPointRelativePosition"],"02D4":["DS","3","ControlPoint3DPosition"],"02D6":["DS","1","CumulativeTimeWeight"],"02E0":["CS","1","CompensatorDivergence"],"02E1":["CS","1","CompensatorMountingPosition"],"02E2":["DS","1-n","SourceToCompensatorDistance"],"02E3":["FL","1","TotalCompensatorTrayWaterEquivalentThickness"],"02E4":["FL","1","IsocenterToCompensatorTrayDistance"],"02E5":["FL","1","CompensatorColumnOffset"],"02E6":["FL","1-n","IsocenterToCompensatorDistances"],"02E7":["FL","1","CompensatorRelativeStoppingPowerRatio"],"02E8":["FL","1","CompensatorMillingToolDiameter"],"02EA":["SQ","1","IonRangeCompensatorSequence"],"02EB":["LT","1","CompensatorDescription"],"0302":["IS","1","RadiationMassNumber"],"0304":["IS","1","RadiationAtomicNumber"],"0306":["SS","1","RadiationChargeState"],"0308":["CS","1","ScanMode"],"0309":["CS","1","ModulatedScanModeType"],"030A":["FL","2","VirtualSourceAxisDistances"],"030C":["SQ","1","SnoutSequence"],"030D":["FL","1","SnoutPosition"],"030F":["SH","1","SnoutID"],"0312":["IS","1","NumberOfRangeShifters"],"0314":["SQ","1","RangeShifterSequence"],"0316":["IS","1","RangeShifterNumber"],"0318":["SH","1","RangeShifterID"],"0320":["CS","1","RangeShifterType"],"0322":["LO","1","RangeShifterDescription"],"0330":["IS","1","NumberOfLateralSpreadingDevices"],"0332":["SQ","1","LateralSpreadingDeviceSequence"],"0334":["IS","1","LateralSpreadingDeviceNumber"],"0336":["SH","1","LateralSpreadingDeviceID"],"0338":["CS","1","LateralSpreadingDeviceType"],"033A":["LO","1","LateralSpreadingDeviceDescription"],"033C":["FL","1","LateralSpreadingDeviceWaterEquivalentThickness"],"0340":["IS","1","NumberOfRangeModulators"],"0342":["SQ","1","RangeModulatorSequence"],"0344":["IS","1","RangeModulatorNumber"],"0346":["SH","1","RangeModulatorID"],"0348":["CS","1","RangeModulatorType"],"034A":["LO","1","RangeModulatorDescription"],"034C":["SH","1","BeamCurrentModulationID"],"0350":["CS","1","PatientSupportType"],"0352":["SH","1","PatientSupportID"],"0354":["LO","1","PatientSupportAccessoryCode"],"0355":["LO","1","TrayAccessoryCode"],"0356":["FL","1","FixationLightAzimuthalAngle"],"0358":["FL","1","FixationLightPolarAngle"],"035A":["FL","1","MetersetRate"],"0360":["SQ","1","RangeShifterSettingsSequence"],"0362":["LO","1","RangeShifterSetting"],"0364":["FL","1","IsocenterToRangeShifterDistance"],"0366":["FL","1","RangeShifterWaterEquivalentThickness"],"0370":["SQ","1","LateralSpreadingDeviceSettingsSequence"],"0372":["LO","1","LateralSpreadingDeviceSetting"],"0374":["FL","1","IsocenterToLateralSpreadingDeviceDistance"],"0380":["SQ","1","RangeModulatorSettingsSequence"],"0382":["FL","1","RangeModulatorGatingStartValue"],"0384":["FL","1","RangeModulatorGatingStopValue"],"0386":["FL","1","RangeModulatorGatingStartWaterEquivalentThickness"],"0388":["FL","1","RangeModulatorGatingStopWaterEquivalentThickness"],"038A":["FL","1","IsocenterToRangeModulatorDistance"],"038F":["FL","1-n","ScanSpotTimeOffset"],"0390":["SH","1","ScanSpotTuneID"],"0391":["IS","1-n","ScanSpotPrescribedIndices"],"0392":["IS","1","NumberOfScanSpotPositions"],"0393":["CS","1","ScanSpotReordered"],"0394":["FL","1-n","ScanSpotPositionMap"],"0395":["CS","1","ScanSpotReorderingAllowed"],"0396":["FL","1-n","ScanSpotMetersetWeights"],"0398":["FL","2","ScanningSpotSize"],"0399":["FL","2-2n","ScanSpotSizesDelivered"],"039A":["IS","1","NumberOfPaintings"],"03A0":["SQ","1","IonToleranceTableSequence"],"03A2":["SQ","1","IonBeamSequence"],"03A4":["SQ","1","IonBeamLimitingDeviceSequence"],"03A6":["SQ","1","IonBlockSequence"],"03A8":["SQ","1","IonControlPointSequence"],"03AA":["SQ","1","IonWedgeSequence"],"03AC":["SQ","1","IonWedgePositionSequence"],"0401":["SQ","1","ReferencedSetupImageSequence"],"0402":["ST","1","SetupImageComment"],"0410":["SQ","1","MotionSynchronizationSequence"],"0412":["FL","3","ControlPointOrientation"],"0420":["SQ","1","GeneralAccessorySequence"],"0421":["SH","1","GeneralAccessoryID"],"0422":["ST","1","GeneralAccessoryDescription"],"0423":["CS","1","GeneralAccessoryType"],"0424":["IS","1","GeneralAccessoryNumber"],"0425":["FL","1","SourceToGeneralAccessoryDistance"],"0426":["DS","1","IsocenterToGeneralAccessoryDistance"],"0431":["SQ","1","ApplicatorGeometrySequence"],"0432":["CS","1","ApplicatorApertureShape"],"0433":["FL","1","ApplicatorOpening"],"0434":["FL","1","ApplicatorOpeningX"],"0435":["FL","1","ApplicatorOpeningY"],"0436":["FL","1","SourceToApplicatorMountingPositionDistance"],"0440":["IS","1","NumberOfBlockSlabItems"],"0441":["SQ","1","BlockSlabSequence"],"0442":["DS","1","BlockSlabThickness"],"0443":["US","1","BlockSlabNumber"],"0450":["SQ","1","DeviceMotionControlSequence"],"0451":["CS","1","DeviceMotionExecutionMode"],"0452":["CS","1","DeviceMotionObservationMode"],"0453":["SQ","1","DeviceMotionParameterCodeSequence"],"0501":["FL","1","DistalDepthFraction"],"0502":["FL","1","DistalDepth"],"0503":["FL","2","NominalRangeModulationFractions"],"0504":["FL","2","NominalRangeModulatedRegionDepths"],"0505":["SQ","1","DepthDoseParametersSequence"],"0506":["SQ","1","DeliveredDepthDoseParametersSequence"],"0507":["FL","1","DeliveredDistalDepthFraction"],"0508":["FL","1","DeliveredDistalDepth"],"0509":["FL","2","DeliveredNominalRangeModulationFractions"],"0510":["FL","2","DeliveredNominalRangeModulatedRegionDepths"],"0511":["CS","1","DeliveredReferenceDoseDefinition"],"0512":["CS","1","ReferenceDoseDefinition"],"0600":["US","1","RTControlPointIndex"],"0601":["US","1","RadiationGenerationModeIndex"],"0602":["US","1","ReferencedDefinedDeviceIndex"],"0603":["US","1","RadiationDoseIdentificationIndex"],"0604":["US","1","NumberOfRTControlPoints"],"0605":["US","1","ReferencedRadiationGenerationModeIndex"],"0606":["US","1","TreatmentPositionIndex"],"0607":["US","1","ReferencedDeviceIndex"],"0608":["LO","1","TreatmentPositionGroupLabel"],"0609":["UI","1","TreatmentPositionGroupUID"],"060A":["SQ","1","TreatmentPositionGroupSequence"],"060B":["US","1","ReferencedTreatmentPositionIndex"],"060C":["US","1","ReferencedRadiationDoseIdentificationIndex"],"060D":["FD","1","RTAccessoryHolderWaterEquivalentThickness"],"060E":["US","1","ReferencedRTAccessoryHolderDeviceIndex"],"060F":["CS","1","RTAccessoryHolderSlotExistenceFlag"],"0610":["SQ","1","RTAccessoryHolderSlotSequence"],"0611":["LO","1","RTAccessoryHolderSlotID"],"0612":["FD","1","RTAccessoryHolderSlotDistance"],"0613":["FD","1","RTAccessorySlotDistance"],"0614":["SQ","1","RTAccessoryHolderDefinitionSequence"],"0615":["LO","1","RTAccessoryDeviceSlotID"],"0616":["SQ","1","RTRadiationSequence"],"0617":["SQ","1","RadiationDoseSequence"],"0618":["SQ","1","RadiationDoseIdentificationSequence"],"0619":["LO","1","RadiationDoseIdentificationLabel"],"061A":["CS","1","ReferenceDoseType"],"061B":["CS","1","PrimaryDoseValueIndicator"],"061C":["SQ","1","DoseValuesSequence"],"061D":["CS","1-n","DoseValuePurpose"],"061E":["FD","3","ReferenceDosePointCoordinates"],"061F":["SQ","1","RadiationDoseValuesParametersSequence"],"0620":["SQ","1","MetersetToDoseMappingSequence"],"0621":["SQ","1","ExpectedInVivoMeasurementValuesSequence"],"0622":["US","1","ExpectedInVivoMeasurementValueIndex"],"0623":["LO","1","RadiationDoseInVivoMeasurementLabel"],"0624":["FD","2","RadiationDoseCentralAxisDisplacement"],"0625":["FD","1","RadiationDoseValue"],"0626":["FD","1","RadiationDoseSourceToSkinDistance"],"0627":["FD","3","RadiationDoseMeasurementPointCoordinates"],"0628":["FD","1","RadiationDoseSourceToExternalContourDistance"],"0629":["SQ","1","RTToleranceSetSequence"],"062A":["LO","1","RTToleranceSetLabel"],"062B":["SQ","1","AttributeToleranceValuesSequence"],"062C":["FD","1","ToleranceValue"],"062D":["SQ","1","PatientSupportPositionToleranceSequence"],"062E":["FD","1","TreatmentTimeLimit"],"062F":["SQ","1","CArmPhotonElectronControlPointSequence"],"0630":["SQ","1","ReferencedRTRadiationSequence"],"0631":["SQ","1","ReferencedRTInstanceSequence"],"0632":["SQ","1","ReferencedRTPatientSetupSequence"],"0634":["FD","1","SourceToPatientSurfaceDistance"],"0635":["SQ","1","TreatmentMachineSpecialModeCodeSequence"],"0636":["US","1","IntendedNumberOfFractions"],"0637":["CS","1","RTRadiationSetIntent"],"0638":["CS","1","RTRadiationPhysicalAndGeometricContentDetailFlag"],"0639":["CS","1","RTRecordFlag"],"063A":["SQ","1","TreatmentDeviceIdentificationSequence"],"063B":["SQ","1","ReferencedRTPhysicianIntentSequence"],"063C":["FD","1","CumulativeMeterset"],"063D":["FD","1","DeliveryRate"],"063E":["SQ","1","DeliveryRateUnitSequence"],"063F":["SQ","1","TreatmentPositionSequence"],"0640":["FD","1","RadiationSourceAxisDistance"],"0641":["US","1","NumberOfRTBeamLimitingDevices"],"0642":["FD","1","RTBeamLimitingDeviceProximalDistance"],"0643":["FD","1","RTBeamLimitingDeviceDistalDistance"],"0644":["SQ","1","ParallelRTBeamDelimiterDeviceOrientationLabelCodeSequence"],"0645":["FD","1","BeamModifierOrientationAngle"],"0646":["SQ","1","FixedRTBeamDelimiterDeviceSequence"],"0647":["SQ","1","ParallelRTBeamDelimiterDeviceSequence"],"0648":["US","1","NumberOfParallelRTBeamDelimiters"],"0649":["FD","2-n","ParallelRTBeamDelimiterBoundaries"],"064A":["FD","2-n","ParallelRTBeamDelimiterPositions"],"064B":["FD","2","RTBeamLimitingDeviceOffset"],"064C":["SQ","1","RTBeamDelimiterGeometrySequence"],"064D":["SQ","1","RTBeamLimitingDeviceDefinitionSequence"],"064E":["CS","1","ParallelRTBeamDelimiterOpeningMode"],"064F":["CS","1-n","ParallelRTBeamDelimiterLeafMountingSide"],"0650":["UI","1","PatientSetupUID"],"0651":["SQ","1","WedgeDefinitionSequence"],"0652":["FD","1","RadiationBeamWedgeAngle"],"0653":["FD","1","RadiationBeamWedgeThinEdgeDistance"],"0654":["FD","1","RadiationBeamEffectiveWedgeAngle"],"0655":["US","1","NumberOfWedgePositions"],"0656":["SQ","1","RTBeamLimitingDeviceOpeningSequence"],"0657":["US","1","NumberOfRTBeamLimitingDeviceOpenings"],"0658":["SQ","1","RadiationDosimeterUnitSequence"],"0659":["SQ","1","RTDeviceDistanceReferenceLocationCodeSequence"],"065A":["SQ","1","RadiationDeviceConfigurationAndCommissioningKeySequence"],"065B":["SQ","1","PatientSupportPositionParameterSequence"],"065C":["CS","1","PatientSupportPositionSpecificationMethod"],"065D":["SQ","1","PatientSupportPositionDeviceParameterSequence"],"065E":["US","1","DeviceOrderIndex"],"065F":["US","1","PatientSupportPositionParameterOrderIndex"],"0660":["SQ","1","PatientSupportPositionDeviceToleranceSequence"],"0661":["US","1","PatientSupportPositionToleranceOrderIndex"],"0662":["SQ","1","CompensatorDefinitionSequence"],"0663":["CS","1","CompensatorMapOrientation"],"0664":["OF","1","CompensatorProximalThicknessMap"],"0665":["OF","1","CompensatorDistalThicknessMap"],"0666":["FD","1","CompensatorBasePlaneOffset"],"0667":["SQ","1","CompensatorShapeFabricationCodeSequence"],"0668":["SQ","1","CompensatorShapeSequence"],"0669":["FD","1","RadiationBeamCompensatorMillingToolDiameter"],"066A":["SQ","1","BlockDefinitionSequence"],"066B":["OF","1","BlockEdgeData"],"066C":["CS","1","BlockOrientation"],"066D":["FD","1","RadiationBeamBlockThickness"],"066E":["FD","1","RadiationBeamBlockSlabThickness"],"066F":["SQ","1","BlockEdgeDataSequence"],"0670":["US","1","NumberOfRTAccessoryHolders"],"0671":["SQ","1","GeneralAccessoryDefinitionSequence"],"0672":["US","1","NumberOfGeneralAccessories"],"0673":["SQ","1","BolusDefinitionSequence"],"0674":["US","1","NumberOfBoluses"],"0675":["UI","1","EquipmentFrameOfReferenceUID"],"0676":["ST","1","EquipmentFrameOfReferenceDescription"],"0677":["SQ","1","EquipmentReferencePointCoordinatesSequence"],"0678":["SQ","1","EquipmentReferencePointCodeSequence"],"0679":["FD","1","RTBeamLimitingDeviceAngle"],"067A":["FD","1","SourceRollAngle"],"067B":["SQ","1","RadiationGenerationModeSequence"],"067C":["SH","1","RadiationGenerationModeLabel"],"067D":["ST","1","RadiationGenerationModeDescription"],"067E":["SQ","1","RadiationGenerationModeMachineCodeSequence"],"067F":["SQ","1","RadiationTypeCodeSequence"],"0680":["DS","1","NominalEnergy"],"0681":["DS","1","MinimumNominalEnergy"],"0682":["DS","1","MaximumNominalEnergy"],"0683":["SQ","1","RadiationFluenceModifierCodeSequence"],"0684":["SQ","1","EnergyUnitCodeSequence"],"0685":["US","1","NumberOfRadiationGenerationModes"],"0686":["SQ","1","PatientSupportDevicesSequence"],"0687":["US","1","NumberOfPatientSupportDevices"],"0688":["FD","1","RTBeamModifierDefinitionDistance"],"0689":["SQ","1","BeamAreaLimitSequence"],"068A":["SQ","1","ReferencedRTPrescriptionSequence"],"0700":["UI","1","TreatmentSessionUID"],"0701":["CS","1","RTRadiationUsage"],"0702":["SQ","1","ReferencedRTRadiationSetSequence"],"0703":["SQ","1","ReferencedRTRadiationRecordSequence"],"0704":["US","1","RTRadiationSetDeliveryNumber"],"0705":["US","1","ClinicalFractionNumber"],"0706":["CS","1","RTTreatmentFractionCompletionStatus"],"0707":["CS","1","RTRadiationSetUsage"],"0708":["CS","1","TreatmentDeliveryContinuationFlag"],"0709":["CS","1","TreatmentRecordContentOrigin"],"0714":["CS","1","RTTreatmentTerminationStatus"],"0715":["SQ","1","RTTreatmentTerminationReasonCodeSequence"],"0716":["SQ","1","MachineSpecificTreatmentTerminationCodeSequence"],"0722":["SQ","1","RTRadiationSalvageRecordControlPointSequence"],"0723":["CS","1","StartingMetersetValueKnownFlag"],"0730":["ST","1","TreatmentTerminationDescription"],"0731":["SQ","1","TreatmentToleranceViolationSequence"],"0732":["CS","1","TreatmentToleranceViolationCategory"],"0733":["SQ","1","TreatmentToleranceViolationAttributeSequence"],"0734":["ST","1","TreatmentToleranceViolationDescription"],"0735":["ST","1","TreatmentToleranceViolationIdentification"],"0736":["DT","1","TreatmentToleranceViolationDateTime"],"073A":["DT","1","RecordedRTControlPointDateTime"],"073B":["US","1","ReferencedRadiationRTControlPointIndex"],"073E":["SQ","1","AlternateValueSequence"],"073F":["SQ","1","ConfirmationSequence"],"0740":["SQ","1","InterlockSequence"],"0741":["DT","1","InterlockDateTime"],"0742":["ST","1","InterlockDescription"],"0743":["SQ","1","InterlockOriginatingDeviceSequence"],"0744":["SQ","1","InterlockCodeSequence"],"0745":["SQ","1","InterlockResolutionCodeSequence"],"0746":["SQ","1","InterlockResolutionUserSequence"],"0760":["DT","1","OverrideDateTime"],"0761":["SQ","1","TreatmentToleranceViolationTypeCodeSequence"],"0762":["SQ","1","TreatmentToleranceViolationCauseCodeSequence"],"0772":["SQ","1","MeasuredMetersetToDoseMappingSequence"],"0773":["US","1","ReferencedExpectedInVivoMeasurementValueIndex"],"0774":["SQ","1","DoseMeasurementDeviceCodeSequence"],"0780":["SQ","1","AdditionalParameterRecordingInstanceSequence"],"0782":["US","1",""],"0783":["ST","1","InterlockOriginDescription"],"0784":["SQ","1","RTPatientPositionScopeSequence"],"0785":["UI","1","ReferencedTreatmentPositionGroupUID"],"0786":["US","1","RadiationOrderIndex"],"0787":["SQ","1","OmittedRadiationSequence"],"0788":["SQ","1","ReasonForOmissionCodeSequence"],"0789":["SQ","1","RTDeliveryStartPatientPositionSequence"],"078A":["SQ","1","RTTreatmentPreparationPatientPositionSequence"],"078B":["SQ","1","ReferencedRTTreatmentPreparationSequence"],"078C":["SQ","1","ReferencedPatientSetupPhotoSequence"],"078D":["SQ","1","PatientTreatmentPreparationMethodCodeSequence"],"078E":["LT","1","PatientTreatmentPreparationProcedureParameterDescription"],"078F":["SQ","1","PatientTreatmentPreparationDeviceSequence"],"0790":["SQ","1","PatientTreatmentPreparationProcedureSequence"],"0791":["SQ","1","PatientTreatmentPreparationProcedureCodeSequence"],"0792":["LT","1","PatientTreatmentPreparationMethodDescription"],"0793":["SQ","1","PatientTreatmentPreparationProcedureParameterSequence"],"0794":["LT","1","PatientSetupPhotoDescription"],"0795":["US","1","PatientTreatmentPreparationProcedureIndex"],"0796":["US","1","ReferencedPatientSetupProcedureIndex"],"0797":["SQ","1","RTRadiationTaskSequence"],"0798":["SQ","1","RTPatientPositionDisplacementSequence"],"0799":["SQ","1","RTPatientPositionSequence"],"079A":["LO","1","DisplacementReferenceLabel"],"079B":["FD","16","DisplacementMatrix"],"079C":["SQ","1","PatientSupportDisplacementSequence"],"079D":["SQ","1","DisplacementReferenceLocationCodeSequence"],"079E":["CS","1","RTRadiationSetDeliveryUsage"]},"300C":{"0000":["UL","1","GenericGroupLength"],"0002":["SQ","1","ReferencedRTPlanSequence"],"0004":["SQ","1","ReferencedBeamSequence"],"0006":["IS","1","ReferencedBeamNumber"],"0007":["IS","1","ReferencedReferenceImageNumber"],"0008":["DS","1","StartCumulativeMetersetWeight"],"0009":["DS","1","EndCumulativeMetersetWeight"],"000A":["SQ","1","ReferencedBrachyApplicationSetupSequence"],"000C":["IS","1","ReferencedBrachyApplicationSetupNumber"],"000E":["IS","1","ReferencedSourceNumber"],"0020":["SQ","1","ReferencedFractionGroupSequence"],"0022":["IS","1","ReferencedFractionGroupNumber"],"0040":["SQ","1","ReferencedVerificationImageSequence"],"0042":["SQ","1","ReferencedReferenceImageSequence"],"0050":["SQ","1","ReferencedDoseReferenceSequence"],"0051":["IS","1","ReferencedDoseReferenceNumber"],"0055":["SQ","1","BrachyReferencedDoseReferenceSequence"],"0060":["SQ","1","ReferencedStructureSetSequence"],"006A":["IS","1","ReferencedPatientSetupNumber"],"0080":["SQ","1","ReferencedDoseSequence"],"00A0":["IS","1","ReferencedToleranceTableNumber"],"00B0":["SQ","1","ReferencedBolusSequence"],"00C0":["IS","1","ReferencedWedgeNumber"],"00D0":["IS","1","ReferencedCompensatorNumber"],"00E0":["IS","1","ReferencedBlockNumber"],"00F0":["IS","1","ReferencedControlPointIndex"],"00F2":["SQ","1","ReferencedControlPointSequence"],"00F4":["IS","1","ReferencedStartControlPointIndex"],"00F6":["IS","1","ReferencedStopControlPointIndex"],"0100":["IS","1","ReferencedRangeShifterNumber"],"0102":["IS","1","ReferencedLateralSpreadingDeviceNumber"],"0104":["IS","1","ReferencedRangeModulatorNumber"],"0111":["SQ","1","OmittedBeamTaskSequence"],"0112":["CS","1","ReasonForOmission"],"0113":["LO","1","ReasonForOmissionDescription"],"0114":["SQ","1","PrescriptionOverviewSequence"],"0115":["FL","1","TotalPrescriptionDose"],"0116":["SQ","1","PlanOverviewSequence"],"0117":["US","1","PlanOverviewIndex"],"0118":["US","1","ReferencedPlanOverviewIndex"],"0119":["US","1","NumberOfFractionsIncluded"],"0120":["SQ","1","DoseCalibrationConditionsSequence"],"0121":["FD","1","AbsorbedDoseToMetersetRatio"],"0122":["FD","2","DelineatedRadiationFieldSize"],"0123":["CS","1","DoseCalibrationConditionsVerifiedFlag"],"0124":["FD","1","CalibrationReferencePointDepth"],"0125":["SQ","1","GatingBeamHoldTransitionSequence"],"0126":["CS","1","BeamHoldTransition"],"0127":["DT","1","BeamHoldTransitionDateTime"],"0128":["SQ","1","BeamHoldOriginatingDeviceSequence"]},"300E":{"0000":["UL","1","GenericGroupLength"],"0002":["CS","1","ApprovalStatus"],"0004":["DA","1","ReviewDate"],"0005":["TM","1","ReviewTime"],"0008":["PN","1","ReviewerName"]},3010:{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","RadiobiologicalDoseEffectSequence"],"0002":["CS","1","RadiobiologicalDoseEffectFlag"],"0003":["SQ","1","EffectiveDoseCalculationMethodCategoryCodeSequence"],"0004":["SQ","1","EffectiveDoseCalculationMethodCodeSequence"],"0005":["LO","1","EffectiveDoseCalculationMethodDescription"],"0006":["UI","1","ConceptualVolumeUID"],"0007":["SQ","1","OriginatingSOPInstanceReferenceSequence"],"0008":["SQ","1","ConceptualVolumeConstituentSequence"],"0009":["SQ","1","EquivalentConceptualVolumeInstanceReferenceSequence"],"000A":["SQ","1","EquivalentConceptualVolumesSequence"],"000B":["UI","1","ReferencedConceptualVolumeUID"],"000C":["UT","1","ConceptualVolumeCombinationExpression"],"000D":["US","1","ConceptualVolumeConstituentIndex"],"000E":["CS","1","ConceptualVolumeCombinationFlag"],"000F":["ST","1","ConceptualVolumeCombinationDescription"],"0010":["CS","1","ConceptualVolumeSegmentationDefinedFlag"],"0011":["SQ","1","ConceptualVolumeSegmentationReferenceSequence"],"0012":["SQ","1","ConceptualVolumeConstituentSegmentationReferenceSequence"],"0013":["UI","1","ConstituentConceptualVolumeUID"],"0014":["SQ","1","DerivationConceptualVolumeSequence"],"0015":["UI","1","SourceConceptualVolumeUID"],"0016":["SQ","1","ConceptualVolumeDerivationAlgorithmSequence"],"0017":["ST","1","ConceptualVolumeDescription"],"0018":["SQ","1","SourceConceptualVolumeSequence"],"0019":["SQ","1","AuthorIdentificationSequence"],"001A":["LO","1","ManufacturerModelVersion"],"001B":["UC","1","DeviceAlternateIdentifier"],"001C":["CS","1","DeviceAlternateIdentifierType"],"001D":["LT","1","DeviceAlternateIdentifierFormat"],"001E":["LO","1","SegmentationCreationTemplateLabel"],"001F":["UI","1","SegmentationTemplateUID"],"0020":["US","1","ReferencedSegmentReferenceIndex"],"0021":["SQ","1","SegmentReferenceSequence"],"0022":["US","1","SegmentReferenceIndex"],"0023":["SQ","1","DirectSegmentReferenceSequence"],"0024":["SQ","1","CombinationSegmentReferenceSequence"],"0025":["SQ","1","ConceptualVolumeSequence"],"0026":["SQ","1","SegmentedRTAccessoryDeviceSequence"],"0027":["SQ","1","SegmentCharacteristicsSequence"],"0028":["SQ","1","RelatedSegmentCharacteristicsSequence"],"0029":["US","1","SegmentCharacteristicsPrecedence"],"002A":["SQ","1","RTSegmentAnnotationSequence"],"002B":["SQ","1","SegmentAnnotationCategoryCodeSequence"],"002C":["SQ","1","SegmentAnnotationTypeCodeSequence"],"002D":["LO","1","DeviceLabel"],"002E":["SQ","1","DeviceTypeCodeSequence"],"002F":["SQ","1","SegmentAnnotationTypeModifierCodeSequence"],"0030":["SQ","1","PatientEquipmentRelationshipCodeSequence"],"0031":["UI","1","ReferencedFiducialsUID"],"0032":["SQ","1","PatientTreatmentOrientationSequence"],"0033":["SH","1","UserContentLabel"],"0034":["LO","1","UserContentLongLabel"],"0035":["SH","1","EntityLabel"],"0036":["LO","1","EntityName"],"0037":["ST","1","EntityDescription"],"0038":["LO","1","EntityLongLabel"],"0039":["US","1","DeviceIndex"],"003A":["US","1","RTTreatmentPhaseIndex"],"003B":["UI","1","RTTreatmentPhaseUID"],"003C":["US","1","RTPrescriptionIndex"],"003D":["US","1","RTSegmentAnnotationIndex"],"003E":["US","1","BasisRTTreatmentPhaseIndex"],"003F":["US","1","RelatedRTTreatmentPhaseIndex"],"0040":["US","1","ReferencedRTTreatmentPhaseIndex"],"0041":["US","1","ReferencedRTPrescriptionIndex"],"0042":["US","1","ReferencedParentRTPrescriptionIndex"],"0043":["ST","1","ManufacturerDeviceIdentifier"],"0044":["SQ","1","InstanceLevelReferencedPerformedProcedureStepSequence"],"0045":["CS","1","RTTreatmentPhaseIntentPresenceFlag"],"0046":["CS","1","RadiotherapyTreatmentType"],"0047":["CS","1-n","TeletherapyRadiationType"],"0048":["CS","1-n","BrachytherapySourceType"],"0049":["SQ","1","ReferencedRTTreatmentPhaseSequence"],"004A":["SQ","1","ReferencedDirectSegmentInstanceSequence"],"004B":["SQ","1","IntendedRTTreatmentPhaseSequence"],"004C":["DA","1","IntendedPhaseStartDate"],"004D":["DA","1","IntendedPhaseEndDate"],"004E":["SQ","1","RTTreatmentPhaseIntervalSequence"],"004F":["CS","1","TemporalRelationshipIntervalAnchor"],"0050":["FD","1","MinimumNumberOfIntervalDays"],"0051":["FD","1","MaximumNumberOfIntervalDays"],"0052":["UI","1-n","PertinentSOPClassesInStudy"],"0053":["UI","1-n","PertinentSOPClassesInSeries"],"0054":["LO","1","RTPrescriptionLabel"],"0055":["SQ","1","RTPhysicianIntentPredecessorSequence"],"0056":["LO","1","RTTreatmentApproachLabel"],"0057":["SQ","1","RTPhysicianIntentSequence"],"0058":["US","1","RTPhysicianIntentIndex"],"0059":["CS","1","RTTreatmentIntentType"],"005A":["UT","1","RTPhysicianIntentNarrative"],"005B":["SQ","1","RTProtocolCodeSequence"],"005C":["ST","1","ReasonForSuperseding"],"005D":["SQ","1","RTDiagnosisCodeSequence"],"005E":["US","1","ReferencedRTPhysicianIntentIndex"],"005F":["SQ","1","RTPhysicianIntentInputInstanceSequence"],"0060":["SQ","1","RTAnatomicPrescriptionSequence"],"0061":["UT","1","PriorTreatmentDoseDescription"],"0062":["SQ","1","PriorTreatmentReferenceSequence"],"0063":["CS","1","DosimetricObjectiveEvaluationScope"],"0064":["SQ","1","TherapeuticRoleCategoryCodeSequence"],"0065":["SQ","1","TherapeuticRoleTypeCodeSequence"],"0066":["US","1","ConceptualVolumeOptimizationPrecedence"],"0067":["SQ","1","ConceptualVolumeCategoryCodeSequence"],"0068":["CS","1","ConceptualVolumeBlockingConstraint"],"0069":["SQ","1","ConceptualVolumeTypeCodeSequence"],"006A":["SQ","1","ConceptualVolumeTypeModifierCodeSequence"],"006B":["SQ","1","RTPrescriptionSequence"],"006C":["SQ","1","DosimetricObjectiveSequence"],"006D":["SQ","1","DosimetricObjectiveTypeCodeSequence"],"006E":["UI","1","DosimetricObjectiveUID"],"006F":["UI","1","ReferencedDosimetricObjectiveUID"],"0070":["SQ","1","DosimetricObjectiveParameterSequence"],"0071":["SQ","1","ReferencedDosimetricObjectivesSequence"],"0073":["CS","1","AbsoluteDosimetricObjectiveFlag"],"0074":["FD","1","DosimetricObjectiveWeight"],"0075":["CS","1","DosimetricObjectivePurpose"],"0076":["SQ","1","PlanningInputInformationSequence"],"0077":["LO","1","TreatmentSite"],"0078":["SQ","1","TreatmentSiteCodeSequence"],"0079":["SQ","1","FractionPatternSequence"],"007A":["UT","1","TreatmentTechniqueNotes"],"007B":["UT","1","PrescriptionNotes"],"007C":["IS","1","NumberOfIntervalFractions"],"007D":["US","1","NumberOfFractions"],"007E":["US","1","IntendedDeliveryDuration"],"007F":["UT","1","FractionationNotes"],"0080":["SQ","1","RTTreatmentTechniqueCodeSequence"],"0081":["SQ","1","PrescriptionNotesSequence"],"0082":["SQ","1","FractionBasedRelationshipSequence"],"0083":["CS","1","FractionBasedRelationshipIntervalAnchor"],"0084":["FD","1","MinimumHoursBetweenFractions"],"0085":["TM","1-n","IntendedFractionStartTime"],"0086":["LT","1","IntendedStartDayOfWeek"],"0087":["SQ","1","WeekdayFractionPatternSequence"],"0088":["SQ","1","DeliveryTimeStructureCodeSequence"],"0089":["SQ","1","TreatmentSiteModifierCodeSequence"],"0090":["CS","1","RoboticBaseLocationIndicator"],"0091":["SQ","1","RoboticPathNodeSetCodeSequence"],"0092":["UL","1","RoboticNodeIdentifier"],"0093":["FD","3","RTTreatmentSourceCoordinates"],"0094":["FD","1","RadiationSourceCoordinateSystemYawAngle"],"0095":["FD","1","RadiationSourceCoordinateSystemRollAngle"],"0096":["FD","1","RadiationSourceCoordinateSystemPitchAngle"],"0097":["SQ","1","RoboticPathControlPointSequence"],"0098":["SQ","1","TomotherapeuticControlPointSequence"],"0099":["FD","1-n","TomotherapeuticLeafOpenDurations"],"009A":["FD","1-n","TomotherapeuticLeafInitialClosedDurations"]},4e3:{"0000":["UL","1","GenericGroupLength"],"0010":["LT","1","Arbitrary"],4e3:["LT","1","TextComments"]},4008:{"0000":["UL","1","GenericGroupLength"],"0040":["SH","1","ResultsID"],"0042":["LO","1","ResultsIDIssuer"],"0050":["SQ","1","ReferencedInterpretationSequence"],"00FF":["CS","1","ReportProductionStatusTrial"],"0100":["DA","1","InterpretationRecordedDate"],"0101":["TM","1","InterpretationRecordedTime"],"0102":["PN","1","InterpretationRecorder"],"0103":["LO","1","ReferenceToRecordedSound"],"0108":["DA","1","InterpretationTranscriptionDate"],"0109":["TM","1","InterpretationTranscriptionTime"],"010A":["PN","1","InterpretationTranscriber"],"010B":["ST","1","InterpretationText"],"010C":["PN","1","InterpretationAuthor"],"0111":["SQ","1","InterpretationApproverSequence"],"0112":["DA","1","InterpretationApprovalDate"],"0113":["TM","1","InterpretationApprovalTime"],"0114":["PN","1","PhysicianApprovingInterpretation"],"0115":["LT","1","InterpretationDiagnosisDescription"],"0117":["SQ","1","InterpretationDiagnosisCodeSequence"],"0118":["SQ","1","ResultsDistributionListSequence"],"0119":["PN","1","DistributionName"],"011A":["LO","1","DistributionAddress"],"0200":["SH","1","InterpretationID"],"0202":["LO","1","InterpretationIDIssuer"],"0210":["CS","1","InterpretationTypeID"],"0212":["CS","1","InterpretationStatusID"],"0300":["ST","1","Impressions"],4e3:["ST","1","ResultsComments"]},4010:{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","LowEnergyDetectors"],"0002":["CS","1","HighEnergyDetectors"],"0004":["SQ","1","DetectorGeometrySequence"],1001:["SQ","1","ThreatROIVoxelSequence"],1004:["FL","3","ThreatROIBase"],1005:["FL","3","ThreatROIExtents"],1006:["OB","1","ThreatROIBitmap"],1007:["SH","1","RouteSegmentID"],1008:["CS","1","GantryType"],1009:["CS","1","OOIOwnerType"],"100A":["SQ","1","RouteSegmentSequence"],1010:["US","1","PotentialThreatObjectID"],1011:["SQ","1","ThreatSequence"],1012:["CS","1","ThreatCategory"],1013:["LT","1","ThreatCategoryDescription"],1014:["CS","1","ATDAbilityAssessment"],1015:["CS","1","ATDAssessmentFlag"],1016:["FL","1","ATDAssessmentProbability"],1017:["FL","1","Mass"],1018:["FL","1","Density"],1019:["FL","1","ZEffective"],"101A":["SH","1","BoardingPassID"],"101B":["FL","3","CenterOfMass"],"101C":["FL","3","CenterOfPTO"],"101D":["FL","6-n","BoundingPolygon"],"101E":["SH","1","RouteSegmentStartLocationID"],"101F":["SH","1","RouteSegmentEndLocationID"],1020:["CS","1","RouteSegmentLocationIDType"],1021:["CS","1-n","AbortReason"],1023:["FL","1","VolumeOfPTO"],1024:["CS","1","AbortFlag"],1025:["DT","1","RouteSegmentStartTime"],1026:["DT","1","RouteSegmentEndTime"],1027:["CS","1","TDRType"],1028:["CS","1","InternationalRouteSegment"],1029:["LO","1-n","ThreatDetectionAlgorithmAndVersion"],"102A":["SH","1","AssignedLocation"],"102B":["DT","1","AlarmDecisionTime"],1031:["CS","1","AlarmDecision"],1033:["US","1","NumberOfTotalObjects"],1034:["US","1","NumberOfAlarmObjects"],1037:["SQ","1","PTORepresentationSequence"],1038:["SQ","1","ATDAssessmentSequence"],1039:["CS","1","TIPType"],"103A":["CS","1","DICOSVersion"],1041:["DT","1","OOIOwnerCreationTime"],1042:["CS","1","OOIType"],1043:["FL","3","OOISize"],1044:["CS","1","AcquisitionStatus"],1045:["SQ","1","BasisMaterialsCodeSequence"],1046:["CS","1","PhantomType"],1047:["SQ","1","OOIOwnerSequence"],1048:["CS","1","ScanType"],1051:["LO","1","ItineraryID"],1052:["SH","1","ItineraryIDType"],1053:["LO","1","ItineraryIDAssigningAuthority"],1054:["SH","1","RouteID"],1055:["SH","1","RouteIDAssigningAuthority"],1056:["CS","1","InboundArrivalType"],1058:["SH","1","CarrierID"],1059:["CS","1","CarrierIDAssigningAuthority"],1060:["FL","3","SourceOrientation"],1061:["FL","3","SourcePosition"],1062:["FL","1","BeltHeight"],1064:["SQ","1","AlgorithmRoutingCodeSequence"],1067:["CS","1","TransportClassification"],1068:["LT","1","OOITypeDescriptor"],1069:["FL","1","TotalProcessingTime"],"106C":["OB","1","DetectorCalibrationData"],"106D":["CS","1","AdditionalScreeningPerformed"],"106E":["CS","1","AdditionalInspectionSelectionCriteria"],"106F":["SQ","1","AdditionalInspectionMethodSequence"],1070:["CS","1","AITDeviceType"],1071:["SQ","1","QRMeasurementsSequence"],1072:["SQ","1","TargetMaterialSequence"],1073:["FD","1","SNRThreshold"],1075:["DS","1","ImageScaleRepresentation"],1076:["SQ","1","ReferencedPTOSequence"],1077:["SQ","1","ReferencedTDRInstanceSequence"],1078:["ST","1","PTOLocationDescription"],1079:["SQ","1","AnomalyLocatorIndicatorSequence"],"107A":["FL","3","AnomalyLocatorIndicator"],"107B":["SQ","1","PTORegionSequence"],"107C":["CS","1","InspectionSelectionCriteria"],"107D":["SQ","1","SecondaryInspectionMethodSequence"],"107E":["DS","6","PRCSToRCSOrientation"]},"4FFE":{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","MACParametersSequence"]},5e3:{"0000":["UL","1","GenericGroupLength"],"0005":["US","1","CurveDimensions"],"0010":["US","1","NumberOfPoints"],"0020":["CS","1","TypeOfData"],"0022":["LO","1","CurveDescription"],"0030":["SH","1-n","AxisUnits"],"0040":["SH","1-n","AxisLabels"],"0103":["US","1","DataValueRepresentation"],"0104":["US","1-n","MinimumCoordinateValue"],"0105":["US","1-n","MaximumCoordinateValue"],"0106":["SH","1-n","CurveRange"],"0110":["US","1-n","CurveDataDescriptor"],"0112":["US","1-n","CoordinateStartValue"],"0114":["US","1-n","CoordinateStepValue"],1001:["CS","1","CurveActivationLayer"],2e3:["US","1","AudioType"],2002:["US","1","AudioSampleFormat"],2004:["US","1","NumberOfChannels"],2006:["UL","1","NumberOfSamples"],2008:["UL","1","SampleRate"],"200A":["UL","1","TotalTime"],"200C":["ox","1","AudioSampleData"],"200E":["LT","1","AudioComments"],2500:["LO","1","CurveLabel"],2600:["SQ","1","CurveReferencedOverlaySequence"],2610:["US","1","CurveReferencedOverlayGroup"],3e3:["ox","1","CurveData"]},5200:{"0000":["UL","1","GenericGroupLength"],9229:["SQ","1","SharedFunctionalGroupsSequence"],9230:["SQ","1","PerFrameFunctionalGroupsSequence"]},5400:{"0000":["UL","1","GenericGroupLength"],"0100":["SQ","1","WaveformSequence"],"0110":["ox","1","ChannelMinimumValue"],"0112":["ox","1","ChannelMaximumValue"],1004:["US","1","WaveformBitsAllocated"],1006:["CS","1","WaveformSampleInterpretation"],"100A":["ox","1","WaveformPaddingValue"],1010:["ox","1","WaveformData"]},5600:{"0000":["UL","1","GenericGroupLength"],"0010":["OF","1","FirstOrderPhaseCorrectionAngle"],"0020":["OF","1","SpectroscopyData"]},6e3:{"0000":["UL","1","GenericGroupLength"],"0010":["US","1","OverlayRows"],"0011":["US","1","OverlayColumns"],"0012":["US","1","OverlayPlanes"],"0015":["IS","1","NumberOfFramesInOverlay"],"0022":["LO","1","OverlayDescription"],"0040":["CS","1","OverlayType"],"0045":["LO","1","OverlaySubtype"],"0050":["SS","2","OverlayOrigin"],"0051":["US","1","ImageFrameOrigin"],"0052":["US","1","OverlayPlaneOrigin"],"0060":["CS","1","OverlayCompressionCode"],"0061":["SH","1","OverlayCompressionOriginator"],"0062":["SH","1","OverlayCompressionLabel"],"0063":["CS","1","OverlayCompressionDescription"],"0066":["AT","1-n","OverlayCompressionStepPointers"],"0068":["US","1","OverlayRepeatInterval"],"0069":["US","1","OverlayBitsGrouped"],"0100":["US","1","OverlayBitsAllocated"],"0102":["US","1","OverlayBitPosition"],"0110":["CS","1","OverlayFormat"],"0200":["US","1","OverlayLocation"],"0800":["CS","1-n","OverlayCodeLabel"],"0802":["US","1","OverlayNumberOfTables"],"0803":["AT","1-n","OverlayCodeTableLocation"],"0804":["US","1","OverlayBitsForCodeWord"],1001:["CS","1","OverlayActivationLayer"],1100:["US","1","OverlayDescriptorGray"],1101:["US","1","OverlayDescriptorRed"],1102:["US","1","OverlayDescriptorGreen"],1103:["US","1","OverlayDescriptorBlue"],1200:["US","1-n","OverlaysGray"],1201:["US","1-n","OverlaysRed"],1202:["US","1-n","OverlaysGreen"],1203:["US","1-n","OverlaysBlue"],1301:["IS","1","ROIArea"],1302:["DS","1","ROIMean"],1303:["DS","1","ROIStandardDeviation"],1500:["LO","1","OverlayLabel"],3e3:["ox","1","OverlayData"],4e3:["LT","1","OverlayComments"]},"7F00":{"0000":["UL","1","GenericGroupLength"],"0010":["ox","1","VariablePixelData"],"0011":["US","1","VariableNextDataGroup"],"0020":["OW","1","VariableCoefficientsSDVN"],"0030":["OW","1","VariableCoefficientsSDHN"],"0040":["OW","1","VariableCoefficientsSDDN"]},"7FE0":{"0000":["UL","1","GenericGroupLength"],"0001":["OV","1","ExtendedOffsetTable"],"0002":["OV","1","ExtendedOffsetTableLengths"],"0008":["OF","1","FloatPixelData"],"0009":["OD","1","DoubleFloatPixelData"],"0010":["ox","1","PixelData"],"0020":["OW","1","CoefficientsSDVN"],"0030":["OW","1","CoefficientsSDHN"],"0040":["OW","1","CoefficientsSDDN"]},FFFA:{"0000":["UL","1","GenericGroupLength"],FFFA:["SQ","1","DigitalSignaturesSequence"]},FFFC:{"0000":["UL","1","GenericGroupLength"],FFFC:["OB","1","DataSetTrailingPadding"]},FFFE:{"0000":["UL","1","GenericGroupLength"],E000:["NONE","1","Item"],E00D:["NONE","1","ItemDelimitationItem"],E0DD:["NONE","1","SequenceDelimitationItem"]}};function Y(e,t){W[e]=t}const X={"0000":"Command","0002":"Meta Element","0004":"File Set","0008":"Identifying","0009":"SPI Identifying","0010":"Patient","0012":"Clinical Trial","0018":"Acquisition","0019":"SPI Acquisition","0020":"Image","0021":"SPI Image","0022":"Ophtalmology","0028":"Image Presentation","0032":"Study","0038":"Visit","003A":"Waveform","0040":"Procedure","0042":"Encapsulated Document","0050":"Device Informations","0054":"Nuclear Medicine","0060":"Histogram","0070":"Presentation State","0072":"Hanging Protocol","0088":"Storage","0100":"Authorization","0400":"Digital Signature",1e3:"Code Table",1010:"Zonal Map",2e3:"Film Session",2010:"Film Box",2020:"Image Box",2030:"Annotation",2040:"Overlay Box",2050:"Presentation LUT",2100:"Print Job",2110:"Printer",2120:"Queue",2130:"Print Content",2200:"Media Creation",3002:"RT Image",3004:"RT Dose",3006:"RT StructureSet",3008:"RT Treatment","300A":"RT Plan","300C":"RT Relationship","300E":"RT Approval",4e3:"Text",4008:"Results","4FFE":"MAC Parameters",5e3:"Curve",5002:"Curve",5004:"Curve",5006:"Curve",5008:"Curve","500A":"Curve","500C":"Curve","500E":"Curve",5400:"Waveform Data",6e3:"Overlays",6002:"Overlays",6004:"Overlays",6008:"Overlays","600A":"Overlays","600C":"Overlays","600E":"Overlays",FFFC:"Generic","7FE0":"Pixel Data",FFFF:"Unknown"},j={OB:!0,OD:!0,OF:!0,OL:!0,OV:!0,OW:!0,SQ:!0,SV:!0,UC:!0,UN:!0,UR:!0,UT:!0,UV:!0,ox:!0};function Z(e){return void 0!==j[e]}const _={SH:!0,LO:!0,UC:!0,ST:!0,LT:!0,UT:!0,PN:!0};function K(e){return void 0!==_[e]}const J={AE:"string",AS:"string",AT:void 0,CS:"string",DA:"string",DS:"string",DT:"string",FL:"Float32",FD:"Float64",IS:"string",LO:"string",LT:"string",OB:"Uint8",OD:"Uint64",OF:"Uint32",OL:"Uint32",OV:"Uint64",OW:"Uint16",PN:"string",SH:"string",SL:"Int32",SQ:void 0,SS:"Int16",ST:"string",SV:"Int64",TM:"string",UC:"string",UI:"string",UL:"Uint32",UN:"Uint8",UR:"string",US:"Uint16",UT:"string",UV:"Uint64"},$={"1.2.840.10008.1.2":"Implicit VR Little Endian","1.2.840.10008.1.2.1":"Explicit VR Little Endian","1.2.840.10008.1.2.1.98":"Encapsulated Uncompressed Explicit VR Little Endian","1.2.840.10008.1.2.1.99":"Deflated Explicit VR Little Endian","1.2.840.10008.1.2.2":"Explicit VR Big Endian (Retired)","1.2.840.10008.1.2.4.50":"JPEG Baseline (Process 1)","1.2.840.10008.1.2.4.51":"JPEG Extended (Process 2 & 4)","1.2.840.10008.1.2.4.52":"JPEG Extended (Process 3 & 5) (Retired)","1.2.840.10008.1.2.4.53":"JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8) (Retired)","1.2.840.10008.1.2.4.54":"JPEG Spectral Selection, Non-Hierarchical (Process 7 & 9) (Retired)","1.2.840.10008.1.2.4.55":"JPEG Full Progression, Non-Hierarchical (Process 10 & 12) (Retired)","1.2.840.10008.1.2.4.56":"JPEG Full Progression, Non-Hierarchical (Process 11 & 13) (Retired)","1.2.840.10008.1.2.4.57":"JPEG Lossless, Non-Hierarchical (Process 14)","1.2.840.10008.1.2.4.58":"JPEG Lossless, Non-Hierarchical (Process 15) (Retired)","1.2.840.10008.1.2.4.59":"JPEG Extended, Hierarchical (Process 16 & 18) (Retired)","1.2.840.10008.1.2.4.60":"JPEG Extended, Hierarchical (Process 17 & 19) (Retired)","1.2.840.10008.1.2.4.61":"JPEG Spectral Selection, Hierarchical (Process 20 & 22) (Retired)","1.2.840.10008.1.2.4.62":"JPEG Spectral Selection, Hierarchical (Process 21 & 23) (Retired)","1.2.840.10008.1.2.4.63":"JPEG Full Progression, Hierarchical (Process 24 & 26) (Retired)","1.2.840.10008.1.2.4.64":"JPEG Full Progression, Hierarchical (Process 25 & 27) (Retired)","1.2.840.10008.1.2.4.65":"JPEG Lossless, Hierarchical (Process 28) (Retired)","1.2.840.10008.1.2.4.66":"JPEG Lossless, Hierarchical (Process 29) (Retired)","1.2.840.10008.1.2.4.70":"JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])","1.2.840.10008.1.2.4.80":"JPEG-LS Lossless Image Compression","1.2.840.10008.1.2.4.81":"JPEG-LS Lossy (Near-Lossless) Image Compression","1.2.840.10008.1.2.4.90":"JPEG 2000 Image Compression (Lossless Only)","1.2.840.10008.1.2.4.91":"JPEG 2000 Image Compression","1.2.840.10008.1.2.4.92":"JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)","1.2.840.10008.1.2.4.93":"JPEG 2000 Part 2 Multi-component Image Compression","1.2.840.10008.1.2.4.94":"JPIP Referenced","1.2.840.10008.1.2.4.95":"JPIP Referenced Deflate","1.2.840.10008.1.2.4.100":"MPEG2 Main Profile / Main Level","1.2.840.10008.1.2.4.101":"MPEG2 Main Profile / High Level","1.2.840.10008.1.2.4.102":"MPEG-4 AVC/H.264 High Profile / Level 4.1","1.2.840.10008.1.2.4.103":"MPEG-4 AVC/H.264 BD-compatible High Profile / Level 4.1","1.2.840.10008.1.2.4.104":"MPEG-4 AVC/H.264 High Profile / Level 4.2 For 2D Video","1.2.840.10008.1.2.4.105":"MPEG-4 AVC/H.264 High Profile / Level 4.2 For 3D Video","1.2.840.10008.1.2.4.106":"MPEG-4 AVC/H.264 Stereo High Profile / Level 4.2","1.2.840.10008.1.2.4.107":"HEVC/H.265 Main Profile / Level 5.1","1.2.840.10008.1.2.4.108":"HEVC/H.265 Main 10 Profile / Level 5.1","1.2.840.10008.1.2.5":"RLE Lossless","1.2.840.10008.1.2.6.1":"RFC 2557 MIME encapsulation (Retired)","1.2.840.10008.1.2.6.2":"XML Encoding (Retired)","1.2.840.10008.1.2.7.1":"SMPTE ST 2110-20 Uncompressed Progressive Active Video","1.2.840.10008.1.2.7.2":"SMPTE ST 2110-20 Uncompressed Interlaced Active Video","1.2.840.10008.1.2.7.3":"SMPTE ST 2110-30 PCM Digital Audio","1.2.840.10008.1.20":"Papyrus 3 Implicit VR Little Endian (Retired)"},ee="1.2.840.10008.1.2",te="1.2.840.10008.1.2.1",ne="1.2.840.10008.1.2.2",ie="1.2.840.10008.1.2.4.50",re="1.2.840.10008.1.2.4.51",oe="1.2.840.10008.1.2.4.57",ae="1.2.840.10008.1.2.4.70",se="1.2.840.10008.1.2.5";class le{#T;#L;constructor(e,t){if(!e||void 0===e)throw new Error("Cannot create tag with no group.");if(4!==e.length)throw new Error("Cannot create tag with badly sized group: "+e);if(!t||void 0===t)throw new Error("Cannot create tag with no element.");if(4!==t.length)throw new Error("Cannot create tag with badly sized element: "+t);this.#T=e,this.#L=t}getGroup(){return this.#T}getElement(){return this.#L}toString(){return this.getKey()+": "+this.getNameFromDictionary()}equals(e){return null!=e&&this.#T===e.getGroup()&&this.#L===e.getElement()}getKey(){return this.#T+this.#L}getGroupName(){return X[this.#T]}isWithVR(){return!("FFFE"===this.#T&&("E000"===this.#L||"E00D"===this.#L||"E0DD"===this.#L))}isPrivate(){return parseInt(this.#T,16)%2==1}#P(){let e;return void 0!==W[this.#T]&&void 0!==W[this.#T][this.#L]&&(e=W[this.#T][this.#L]),e}getVrFromDictionary(){let e;const t=this.#P();return void 0!==t&&(e=t[0]),e}getNameFromDictionary(){let e;const t=this.#P();return void 0!==t&&(e=t[2]),e}}function ce(e){if(!e||void 0===e)throw new Error("Cannot create tag with no key.");if(8!==e.length)throw new Error("Cannot create tag with badly sized key: "+e);return new le(e.substring(0,4),e.substring(4,8))}function ue(){return new le("FFFE","E000")}function de(e){return"FFFEE000"===e.getKey()}function he(e){return"FFFEE0DD"===e.getKey()}function Se(){return new le("7FE0","0010")}function ge(e){return"7FE00010"===e.getKey()}function me(e){if(null==e)return null;let t=null,n=null;const i=W,r=Object.keys(i);let o,a=null,s=!1;for(let o=0,l=r.length;o<l;++o){t=r[o],a=Object.keys(i[t]);for(let r=0,o=a.length;r<o;++r)if(n=a[r],i[t][n][2]===e){s=!0;break}if(s)break}return s&&(o=new le(t,n)),o}function pe(e){const t=e.byteLength,n=new Uint8Array(e.buffer,e.byteOffset,t),i=e.BYTES_PER_ELEMENT;let r;for(let e=0;e<t;e+=i)for(let t=e+i-1,o=e;t>o;t--,o++)r=n[o],n[o]=n[t],n[t]=r}class fe{#w;#O=!0;#A=function(){return new Int8Array(new Int16Array([1]).buffer)[0]>0}();#b;#x;constructor(e,t){this.#w=e,void 0!==t&&(this.#O=t),this.#b=this.#O!==this.#A,this.#x=new DataView(e)}readUint16(e){return this.#x.getUint16(e,this.#O)}readInt16(e){return this.#x.getInt16(e,this.#O)}readUint32(e){return this.#x.getUint32(e,this.#O)}readBigUint64(e){return this.#x.getBigUint64(e,this.#O)}readInt32(e){return this.#x.getInt32(e,this.#O)}readBigInt64(e){return this.#x.getBigInt64(e,this.#O)}readFloat32(e){return this.#x.getFloat32(e,this.#O)}readFloat64(e){return this.#x.getFloat64(e,this.#O)}readBinaryArray(e,t){const n=new Uint8Array(this.#w,e,t),i=8*n.length,r=new Uint8Array(i);let o=0,a=0;for(let e=0;e<i;++e)o=e%8,a=Math.floor(e/8),r[e]=255*!!(n[a]&1<<o);return r}readUint8Array(e,t){return new Uint8Array(this.#w,e,t)}readInt8Array(e,t){return new Int8Array(this.#w,e,t)}readUint16Array(e,t){const n=Uint16Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Uint16Array(this.#w,e,i),this.#b&&pe(r);else{r=new Uint16Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readUint16(t),t+=n}return r}readInt16Array(e,t){const n=Int16Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Int16Array(this.#w,e,i),this.#b&&pe(r);else{r=new Int16Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readInt16(t),t+=n}return r}readUint32Array(e,t){const n=Uint32Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Uint32Array(this.#w,e,i),this.#b&&pe(r);else{r=new Uint32Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readUint32(t),t+=n}return r}readUint64Array(e,t){const n=BigUint64Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new BigUint64Array(this.#w,e,i),this.#b&&pe(r);else{r=new BigUint64Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readBigUint64(t),t+=n}return r}readInt32Array(e,t){const n=Int32Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Int32Array(this.#w,e,i),this.#b&&pe(r);else{r=new Int32Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readInt32(t),t+=n}return r}readInt64Array(e,t){const n=BigInt64Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new BigInt64Array(this.#w,e,i),this.#b&&pe(r);else{r=new BigInt64Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readBigInt64(t),t+=n}return r}readFloat32Array(e,t){const n=Float32Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Float32Array(this.#w,e,i),this.#b&&pe(r);else{r=new Float32Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readFloat32(t),t+=n}return r}readFloat64Array(e,t){const n=Float64Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Float64Array(this.#w,e,i),this.#b&&pe(r);else{r=new Float64Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readFloat64(t),t+=n}return r}readHex(e){const t=this.readUint16(e).toString(16);return"0000".substring(0,4-t.length)+t.toUpperCase()}}function ye(){return new w([1,0,0,0,0,1,0,-1,0])}const De={Axial:"axial",Coronal:"coronal",Sagittal:"sagittal"};function Ce(e){const t=new T(e.get(0,0),e.get(1,0),e.get(2,0)),n=new T(e.get(0,1),e.get(1,1),e.get(2,1)),i=new T(e.get(0,2),e.get(1,2),e.get(2,2));return ve(t)+ve(n)+ve(i)}function ve(e){let t=new T(Math.abs(e.getX()),Math.abs(e.getY()),Math.abs(e.getZ())),n="";const i=e.getX()<0?"R":"L",r=e.getY()<0?"A":"P",o=e.getZ()<0?"I":"S",a=1e-4;for(let e=0;e<3;e++)if(t.getX()>a&&t.getX()>t.getY()&&t.getX()>t.getZ())n+=i,t=new T(0,t.getY(),t.getZ());else if(t.getY()>a&&t.getY()>t.getX()&&t.getY()>t.getZ())n+=r,t=new T(t.getX(),0,t.getZ());else{if(!(t.getZ()>a&&t.getZ()>t.getX()&&t.getZ()>t.getY()))break;n+=o,t=new T(t.getX(),t.getY(),0)}return n}function Ie(e){let t;if(void 0!==e&&6===e.length){const n=new T(e[0],e[1],e[2]),i=new T(e[3],e[4],e[5]),r=n.crossProduct(i);t=new w([n.getX(),i.getX(),r.getX(),n.getY(),i.getY(),r.getY(),n.getZ(),i.getZ(),r.getZ()])}return t}class Te{vr;value;tag;vl;undefinedLength;startOffset;endOffset;items;constructor(e){this.vr=e}}function Le(){return"0.33.1"}function Pe(e){return!(e.byteLength<132)&&"DICM"===new Uint8Array(e,128,4).reduce((function(e,t){return e+String.fromCharCode(t)}),"")}const we=String.fromCharCode("u200B");class Oe{decode(e){let t="";for(let n=0,i=e.length;n<i;++n)t+=String.fromCharCode(e[n]);return t}}function Ae(e){if(!e)return null;const t={L:"R",R:"L",A:"P",P:"A",H:"F",F:"H"};let n="";for(let i=0;i<e.length;i++){const r=t[e.substring(i,i+1)];r&&(n+=r)}return n}function be(e){let t;const n=Ie(e);return void 0!==n&&(t=function(e){let t;return["LPS","LAI","RPI","RAS"].includes(e)?t=De.Axial:["LSA","LIP","RSP","RIA"].includes(e)?t=De.Coronal:["PSL","PIR","ASR","AIL"].includes(e)&&(t=De.Sagittal),t}(Ce(n.asOneAndZeros()))),t}function xe(e){return e===ee}function Re(e){return e===ne}function Fe(e){return e===ie||e===re}function Ee(e){return e===oe||e===ae}function qe(e){return null!==e.match(/1.2.840.10008.1.2.4.9/)}function Ue(e){return e===se}function Me(e,t,n){let r=null;try{1===e||8===e?r=0===t?new Uint8Array(n):new Int8Array(n):16===e?r=0===t?new Uint16Array(n):new Int16Array(n):32===e&&(r=0===t?new Uint32Array(n):new Int32Array(n))}catch(e){if(e instanceof RangeError){const e=Math.floor(Math.log(n)/Math.log(2));i.error("Cannot allocate array of size: "+n+" (>2^"+e+").")}}return r}function Qe(e,t){return t?8:Z(e)?12:8}const Be="00280008",Ne="00280100",Ve="00280103",Ge="7FE00010";class ke{#R={};#F;#E=new Oe;#q=this.#E;#U(e){return this.#E.decode(e)}#M(e){return this.#q.decode(e)}getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}setDecoderCharacterSet(e){this.#q=new TextDecoder(e)}getDicomElements(){return this.#R}#Q(e,t){const n=e.readHex(t);t+=Uint16Array.BYTES_PER_ELEMENT;const i=e.readHex(t);return t+=Uint16Array.BYTES_PER_ELEMENT,{tag:new le(n,i),endOffset:t}}#B(e,t,n){const i={};let r=this.#N(e,t,n);if(t=r.endOffset,he(r.tag))return{data:i,endOffset:r.endOffset,isSeqDelim:!0};if(i[r.tag.getKey()]={tag:r.tag,vr:"NONE",vl:r.vl,undefinedLength:r.undefinedLength},r.undefinedLength){let o=!1;for(;!o;)r=this.#N(e,t,n),t=r.endOffset,o="FFFEE00D"===r.tag.getKey(),o||(i[r.tag.getKey()]=r)}else{const o=t;for(t-=r.vl;t<o;)r=this.#N(e,t,n),t=r.endOffset,i[r.tag.getKey()]=r}return{data:i,endOffset:t,isSeqDelim:!1}}#V(e,t,n){const i=[];let r=this.#N(e,t,n);const o=r.vl;t=r.endOffset;let a=!1;for(;!a;)r=this.#N(e,t,n),t=r.endOffset,a=he(r.tag),a||(r.vr="OB",i.push(r));return{data:i,endOffset:t,offsetTableVl:o}}#N(e,t,n){const r=this.#Q(e,t),o=r.tag;t=r.endOffset;let a=null,s=!1;o.isWithVR()?n?(a=o.getVrFromDictionary(),void 0===a&&(a="UN"),s=!0):(a=this.#U(e.readUint8Array(t,2)),t+=2*Uint8Array.BYTES_PER_ELEMENT,s=Z(a),s&&(t+=2*Uint8Array.BYTES_PER_ELEMENT)):(a="NONE",s=!0),function(e){return Object.keys(J).concat(["NONE","ox","xx","xs"]).includes(e)}(a)||(i.warn("Unknown VR: "+a+" (for tag "+o.getKey()+"), treating as 'UN'"),a="UN");let l=0;s?(l=e.readUint32(t),t+=Uint32Array.BYTES_PER_ELEMENT):(l=e.readUint16(t),t+=Uint16Array.BYTES_PER_ELEMENT);let c=!1;4294967295===l&&(c=!0,l=0),o.isPrivate()&&"UN"===a&&0===l&&(a="SQ");let u,d=t,h=d+l;if(ge(o)&&c){const i=this.#V(e,t,n);t=i.endOffset,d+=i.offsetTableVl,u=i.data,h=t,l=t-d}else if("SQ"===a){let i;if(u=[],c){let r=!1;for(;!r;)i=this.#B(e,t,n),r=i.isSeqDelim,t=i.endOffset,r||u.push(i.data);h=t,l=t-d}else if(0!==l){const r=t+l;for(;t<r;)i=this.#B(e,t,n),u.push(i.data),t=i.endOffset;h=t,l=t-d}}const S=new Te(a);return S.tag=o,S.vl=l,S.startOffset=d,S.endOffset=h,c&&(S.undefinedLength=c),u&&(S.items=u),S}#G(e,t,n,r){const o=e.tag,a=e.vl,s=e.vr,l=e.startOffset;let c=null;const u=J[s];if(ge(o))if(e.undefinedLength){c=[];for(let i=0;i<e.items.length;++i)c.push(this.#G(e.items[i],t,n,r));delete e.items}else if(r>8&&"OB"===s&&(i.warn("Reading DICOM pixel data with bitsAllocated>8 and OB VR, treating as OW"),e.vr="OW"),c=[],1===r)c.push(t.readBinaryArray(l,a));else if(8===r)0===n?c.push(t.readUint8Array(l,a)):c.push(t.readInt8Array(l,a));else{if(16!==r)throw new Error("Unsupported bits allocated: "+r);0===n?c.push(t.readUint16Array(l,a)):c.push(t.readInt16Array(l,a))}else if(void 0!==u)if("Uint8"===u)c=t.readUint8Array(l,a);else if("Uint16"===u)c=t.readUint16Array(l,a),"O"!==s[0]&&(c=Array.from(c));else if("Uint32"===u)c=t.readUint32Array(l,a),"O"!==s[0]&&(c=Array.from(c));else if("Uint64"===u)c=t.readUint64Array(l,a);else if("Int16"===u)c=Array.from(t.readInt16Array(l,a));else if("Int32"===u)c=Array.from(t.readInt32Array(l,a));else if("Int64"===u)c=t.readInt64Array(l,a);else if("Float32"===u)c=Array.from(t.readFloat32Array(l,a));else if("Float64"===u)c=Array.from(t.readFloat64Array(l,a));else{if("string"!==u)throw new Error("Unknown VR type: "+u);{const e=t.readUint8Array(l,a);c=K(s)?this.#M(e):this.#U(e),c=function(e){let t=e;const n=e.length-1;return e[n]===we&&(t=e.substring(0,n)),t=t.trim(),t}(c).split("\\")}}else if("xx"===s)c=Array.from(t.readUint16Array(l,a));else if("ox"===s)c=8===r?0===n?Array.from(t.readUint8Array(l,a)):Array.from(t.readInt8Array(l,a)):0===n?Array.from(t.readUint16Array(l,a)):Array.from(t.readInt16Array(l,a));else if("xs"===s)c=0===n?Array.from(t.readUint16Array(l,a)):Array.from(t.readInt16Array(l,a));else if("AT"===s){const e=t.readUint16Array(l,a);c=[];for(let t=0,n=e.length;t<n;t+=2){const n=e[t].toString(16),i=e[t+1].toString(16);let r="(";r+="0000".substring(0,4-n.length)+n.toUpperCase(),r+=",",r+="0000".substring(0,4-i.length)+i.toUpperCase(),r+=")",c.push(r)}}else if("SQ"===s){c=[];for(let i=0;i<e.items.length;++i){const o=e.items[i],a={},s=Object.keys(o);let l=r,u=n;for(let e=0;e<s.length;++e){let n=o[Ne];void 0!==n&&void 0!==n.value&&(l=n.value[0]),n=o[Ve],void 0!==n&&void 0!==n.value&&(u=n.value[0]);const i=o[s[e]];i.value=this.#G(i,t,u,l),delete i.tag,delete i.vl,delete i.startOffset,delete i.endOffset,a[s[e]]=i}c.push(a)}delete e.items}else"NONE"===s||i.warn("Unknown VR: "+s+" (for tag "+e.tag.getKey()+")"),c=[];return c}#k(e,t,n,i){const r=Object.keys(e);for(let o=0;o<r.length;++o){const a=e[r[o]];void 0===a.value&&(a.value=this.#G(a,t,n,i)),delete a.tag,delete a.vl,delete a.startOffset,delete a.endOffset}}parse(e){let t=0,n="",r=null;const o=new fe(e);let a=new fe(e);t=128;const s=this.#U(o.readUint8Array(t,4));if(t+=4*Uint8Array.BYTES_PER_ELEMENT,"DICM"===s){r=this.#N(o,t,!1),r.value=this.#G(r,o),t=r.endOffset,this.#R[r.tag.getKey()]=r;const e=t+r.value[0];for(;t<e;)r=this.#N(o,t,!1),t=r.endOffset,this.#R[r.tag.getKey()]=r;if(r=this.#R["00020010"],void 0===r)throw new Error("Not a valid DICOM file (no TransferSyntaxUID found)");r.value=this.#G(r,o),n=r.value[0]}else{i.warn("No DICM prefix, trying to guess tansfer syntax."),r=this.#N(a,0,!1);const e=function(e){const t="0008",n=e.tag.getGroup();if("0800"!==n&&n!==t)throw new Error("Not a valid DICOM file (no magic DICM word found and first element not in 0008 group)");const i=e.vr,r=i.charCodeAt(0),o=i.charCodeAt(1),a=!(r>=65&&r<=90&&o>=65&&o<=90);let s=null;if(n===t)s=a?ee:te;else{if(a)throw new Error("Not a valid DICOM file (no magic DICM word foundand implicit VR big endian detected)");s=ne}const l=new Te("UI");return l.tag=new le("0002","0010"),l.value=[s],l.vl=l.value[0].length,l.startOffset=e.startOffset,l.endOffset=l.startOffset+l.vl,l}(r);this.#R[e.tag.getKey()]=e,n=e.value[0],t=0}if(!function(e){return e===ee||e===te||e===ne||Fe(e)||Ee(e)||qe(e)||Ue(e)}(n))throw new Error("Unsupported DICOM transfer syntax: '"+n+"' ("+function(e){let t="Unknown";return void 0!==$[e]&&(t=$[e]),t}(n)+")");let l=!1;for(xe(n)&&(l=!0),Re(n)&&(a=new fe(e,!1));t<e.byteLength;){r=this.#N(a,t,l),t=r.endOffset;const e=r.tag.getKey();void 0===this.#R[e]?this.#R[e]=r:i.warn("Not saving duplicate tag: "+e)}if(isNaN(t))throw new Error("Problem while parsing, bad offset");e.byteLength!==t&&i.warn("Did not reach the end of the buffer: "+t+" != "+e.byteLength);let c=0,u=16;if(void 0!==this.#R[Ge]&&(r=this.#R[Ve],void 0!==r?(r.value=this.#G(r,a),c=r.value[0]):i.warn("Reading DICOM pixel data with default pixelRepresentation."),r=this.#R[Ne],void 0!==r?(r.value=this.#G(r,a),u=r.value[0]):i.warn("Reading DICOM pixel data with default bitsAllocated.")),void 0!==this.#F&&this.setDecoderCharacterSet(this.#F),r=this.#R["00080005"],void 0!==r){let e;r.value=this.#G(r,a),1===r.value.length?e=r.value[0]:(e=r.value[1],i.warn("Unsupported character set with code extensions: '"+e+"'.")),this.setDecoderCharacterSet(function(e){let t="utf-8";return"ISO_IR 100"===e?t="iso-8859-1":"ISO_IR 101"===e?t="iso-8859-2":"ISO_IR 109"===e?t="iso-8859-3":"ISO_IR 110"===e?t="iso-8859-4":"ISO_IR 144"===e?t="iso-8859-5":"ISO_IR 127"===e?t="iso-8859-6":"ISO_IR 126"===e?t="iso-8859-7":"ISO_IR 138"===e?t="iso-8859-8":"ISO_IR 148"===e?t="iso-8859-9":"ISO_IR 13"===e?t="shift-jis":"ISO_IR 166"===e?t="iso-8859-11":"ISO 2022 IR 87"===e?t="iso-2022-jp":"ISO 2022 IR 149"===e||"ISO 2022 IR 58"===e||("ISO_IR 192"===e?t="utf-8":"GB18030"===e?t="gb18030":"GB2312"===e?t="gb2312":"GBK"===e&&(t="chinese")),t}(e))}if(this.#k(this.#R,a,c,u),r=this.#R[Ge],void 0!==r&&r.undefinedLength){let e=1;void 0!==this.#R[Be]&&(e=Number(this.#R[Be].value[0]));const t=r.value;if(t.length>1&&t.length>e){const n=t.length/e,i=[];let o=0;for(let r=0;r<e;++r){o=r*n;let e=0;for(let i=0;i<n;++i)e+=t[o+i].length;const a=new t[0].constructor(e);let s=0;for(let e=0;e<n;++e)a.set(t[o+e],s),s+=t[o+e].length;i[r]=a}r.value=i}}}}class He{#H={};add(e,t){void 0===this.#H[e]&&(this.#H[e]=[]),this.#H[e].push(t)}remove(e,t){if(void 0===this.#H[e])return;let n=0;for(let i=0;i<this.#H[e].length;++i)this.#H[e][i]===t&&(++n,this.#H[e].splice(i,1));0===n&&i.debug("No callback found on remove listener for type "+e)}fireEvent=e=>{if(void 0===this.#H[e.type])return;const t=this.#H[e.type].slice();for(let n=0;n<t.length;++n)t[n](e)}}function ze(e,t,n,i,r,o,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);let l=t;a?(o*=-1,s?l-=(r-1)*i:i*=-1):s&&(l+=(r-1)*i,i*=-1);const c=o-r*i;let u=0,d=0;return{next:function(){if(u<n){const t={value:e(l),done:!1,index:l};return l+=i,++u,++d,d===r&&(d=0,l+=c),t}return{done:!0,index:l}}}}function We(e){const t=[];let n=e.next();for(;!n.done;)t.push(n.value),n=e.next();return t}function Ye(t,n,i,r){const o=t.getGeometry().getSize();let a=2;r&&void 0!==r&&(a=r.getColAbsMax(2).index);const s=n.getValues(),l=new e(s.map((function(e,t){return t===a||t>2?e:0})));let c=o.indexToOffset(l);void 0===i&&(i=!1);let u=null;u=i?function(e){return t.getRescaledValueAtOffset(e)}:function(e){return t.getValueAtOffset(e)};const d=o.get(0),h=o.get(1),S=o.get(2);let g=o.getDimSize(2);const m=t.getNumberOfComponents(),p=1===t.getPlanarConfiguration(),f=function(e,t,n,i,r,o,a,s){return 1===m?ze(e,t,n,i,r,o,a,s):3===m?function(e,t,n,i,r,o,a,s,l){const c=[];return l?(c.push(ze(e,t,n,i,r,o,a,s)),c.push(ze(e,t+n*i,n,i,r,o,a,s)),c.push(ze(e,t+2*n*i,n,i,r,o,a,s))):(i*=3,o*=3,c.push(ze(e,t,n,i,r,o,a,s)),c.push(ze(e,t+1,n,i,r,o,a,s)),c.push(ze(e,t+2,n,i,r,o,a,s))),{next:function(){const e=c[0].next(),t=c[1].next(),n=c[2].next();return e.done?{done:!0,index:n.index}:{value:[e.value,t.value,n.value],done:!1,index:[e.index,t.index,n.index]}}}}(e,3*t,n,i,r,o,a,s,p):void 0};let y=null;if(r&&void 0!==r){const e=r.getColAbsMax(0),t=r.getColAbsMax(2),n=!1,i=!1;let o=null;if(2===t.index)o=d*h,y=0===e.index?f(u,c,o,1,d,d,n,i):f(u,c,o,d,h,1,n,i);else if(0===t.index)o=S*h,y=1===e.index?f(u,c,o,d,h,g,n,i):f(u,c,o,g,S,d,n,i);else{if(1!==t.index)throw new Error("Unknown direction: "+t.index);o=S*d,y=0===e.index?f(u,c,o,1,d,g,n,i):f(u,c,o,g,S,1,n,i)}}else if(1===t.getNumberOfComponents())y=function(e,t,n,i){void 0===i&&(i=1);let r=t;return{next:function(){if(r<n){const t={value:e(r),done:!1,index:r};return r+=i,t}return{done:!0,index:n}}}}(u,c,c+g);else{if(3!==t.getNumberOfComponents())throw new Error("Unsupported number of components: "+t.getNumberOfComponents());c*=3,g*=3,y=function(e,t,n,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);let o=t,a=1;r?a=(n-t)/3:i*=3;let s=o+a,l=o+2*a;return{next:function(){if(o<n){const t={value:[e(o),e(s),e(l)],done:!1,index:[o,s,l]};return o+=i,s+=i,l+=i,t}return{done:!0,index:[n]}}}}(u,c,c+g,1,p)}return y}function Xe(e,t){let n=0,i=0;return{next:function(){if(n<t){i+1<e.length&&n>=e[i+1].index&&++i;const t={value:e[i].colour,done:!1,index:n};return++n,t}return{done:!0,index:t}}}}class je{#d;#z;constructor(e,t){this.#d=e,this.#z=t}getSlope(){return this.#d}getIntercept(){return this.#z}apply(e){return e*this.#d+this.#z}equals(e){return null!=e&&this.getSlope()===e.getSlope()&&this.getIntercept()===e.getIntercept()}isID(){return 1===this.getSlope()&&0===this.getIntercept()}}class Ze{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create size with no values.");if(0===e.length)throw new Error("Cannot create size with empty values.");if(!e.every((function(e){return!isNaN(e)&&0!==e})))throw new Error("Cannot create size with non number or zero values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}moreThanOne(e){return this.length()>=e+1&&1!==this.get(e)}canScroll3D(e){let t=2;return void 0!==e&&(t=e.getThirdColMajorDirection()),this.moreThanOne(t)}canScroll(e){let t=this.canScroll3D(e);for(let e=3;e<this.length();++e)t=t||this.moreThanOne(e);return t}getDimSize(e,t){if(e>this.length())return null;if(void 0===t)t=0;else if(t<0||t>e)throw new Error("Invalid start value for getDimSize");let n=1;for(let i=t;i<e;++i)n*=this.get(i);return n}getTotalSize(e){return this.getDimSize(this.length(),e)}equals(e){if(!e)return!1;const t=this.length();if(t!==e.length())return!1;for(let n=0;n<t;++n)if(this.get(n)!==e.get(n))return!1;return!0}isInBounds(e,t){if(!e)return!1;const n=this.length();if(n!==e.length())return!1;if(void 0===t){t=[];for(let e=0;e<n;++e)t.push(e)}else for(let e=0;e<n;++e)if(t[e]>n-1)throw new Error("Wrong input dir value: "+t[e]);for(let n=0;n<t.length;++n)if(i=e.get(t[n]),r=this.get(t[n]),!(i>=0&&i<r))return!1;var i,r;return!0}indexToOffset(e,t){if(e.length()<this.length())throw new Error("Incompatible index and size length");if(void 0===t)t=0;else if(t<0||t>this.length()-1)throw new Error("Invalid start value for indexToOffset");let n=0;for(let i=t;i<this.length();++i)n+=e.get(i)*this.getDimSize(i,t);return n}offsetToIndex(t){const n=new Array(this.length());let i=t,r=0;for(let e=this.length()-1;e>0;--e)r=this.getDimSize(e),n[e]=Math.floor(i/r),i-=n[e]*r;return n[0]=i,new e(n)}get2D(){return{x:this.get(0),y:this.get(1)}}}class _e{min;max;mean;stdDev;median;p25;p75;constructor(e,t,n,i){this.min=e,this.max=t,this.mean=n,this.stdDev=i}}function Ke(e,t){return function(e){return null!=e&&(e.includes("median")||e.includes("p25")||e.includes("p75"))}(t)?function(e){const t=Je(e);return e.sort((function(e,t){return e-t})),t.median=$e(e,.5),t.p25=$e(e,.25),t.p75=$e(e,.75),t}(e):Je(e)}function Je(e){let t=e[0],n=t,i=0,r=0,o=0;const a=e.length;for(let s=0;s<a;++s)o=e[s],o<t?t=o:o>n&&(n=o),i+=o,r+=o*o;const s=i/a;let l=r/a-s*s;l<0&&(l=0);const c=Math.sqrt(l);return new _e(t,n,s,c)}function $e(e,t){if(0===e.length)throw new Error("Empty array provided for percentile calculation.");if(t<0||t>1)throw new Error("Invalid ratio provided for percentile calculation: "+t);if(0===t)return e[0];if(1===t)return e[e.length-1];const n=(e.length-1)*t,i=Math.floor(n),r=e[i];return r+(e[i+1]-r)*(n-i)}function et(){return Math.random().toString(36).substring(2,15)}class tt{min;max;constructor(e,t){this.min=e,this.max=t}}class nt{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create spacing with no values.");if(0===e.length)throw new Error("Cannot create spacing with empty values.");if(!e.every((function(e){return!isNaN(e)&&0!==e})))throw new Error("Cannot create spacing with non number or zero values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}equals(e){if(!e)return!1;const t=this.length();if(t!==e.length())return!1;for(let n=0;n<t;++n)if(this.get(n)!==e.get(n))return!1;return!0}get2D(){return{x:this.get(0),y:this.get(1)}}}class it{#W;#Y;#X;#j={};#Z;#_=O();#K=!1;constructor(e,t,n,i,r){this.#W=[e],this.#Y=t,this.#X=n,void 0!==r&&(this.#Z=r,this.#j[r]=[e]),void 0!==i&&(this.#_=i)}getInitialTime(){return this.#Z}getCurrentTotalNumberOfSlices(){const e=Object.keys(this.#j);if(0===e.length)return this.#W.length;let t=0;for(let n=0;n<e.length;++n)t+=this.#j[e[n]].length;return t}hasSlicesAtTime(e){return void 0!==this.#j[e]}getCurrentNumberOfSlicesBeforeTime(e){const t=Object.keys(this.#j);if(0===t.length)return;let n=0;for(let i=0;i<t.length;++i){const r=t[i];if(parseInt(r,10)===e)break;n+=this.#j[r].length}return n}getOrigin(){return this.#W[0]}getOrigins(){return this.#W}includesOrigin(e,t){for(let n=0;n<this.#W.length;++n)if(this.#W[n].isSimilar(e,t))return!0;return!1}getSize(e){let t=this.#Y;if(e&&void 0!==e){let n=rt([this.#Y.get(0),this.#Y.get(1),this.#Y.get(2)],e);n=n.map(Math.abs),t=new Ze(n.concat(this.#Y.getValues().slice(3)))}return t}#J(){const e=function(e){if(e.length<=1)return;const t=[];for(let n=0;n<e.length-1;++n){const i=e[n],r=e[n+1],o=i.getDistance(r);if(0===o)throw new Error("Zero slice spacing "+i.toString()+" "+r.toString());t.push(o)}const n=Je(t),r=B(n.mean,4);return n.stdDev>L&&i.warn("Varying slice spacing, value: "+r+" (mean: "+n.mean+", min: "+n.min+", max: "+n.max+", stdDev: "+n.stdDev+")"),r}(this.#W);if(void 0!==e&&this.#X.get(2)!==e){i.trace("Using geometric spacing "+e+" instead of tag spacing "+this.#X.get(2));const t=this.#X.getValues();t[2]=e,this.#X=new nt(t)}}getSpacing(e){this.#K&&(this.#J(),this.#K=!1);let t=this.#X;if(e&&void 0!==e){let n=rt([this.#X.get(0),this.#X.get(1),this.#X.get(2)],e);n=n.map(Math.abs),t=new nt(n)}return t}getRealSpacing(){return this.getSpacing(this.#_.getInverse().asOneAndZeros())}getOrientation(){return this.#_}getSliceIndex(e,t){let n=this.#W;void 0!==t&&(n=this.#j[t]);const i=e.getClosest(n),r=n[i],o=e.minus(r);return new T(this.#_.get(0,2),this.#_.get(1,2),this.#_.get(2,2)).isCodirectional(o)?i+1:i}appendOrigin(e,t,n){const i=function(t){return t.equals(e)};if(void 0!==n){if(void 0!==this.#j[n].find(i))throw new Error("Cannot append same time origin twice");this.#j[n].splice(t,0,e)}if(void 0===n||n===this.#Z){if(void 0!==this.#W.find(i))throw new Error("Cannot append same origin twice");this.#K=!0,this.#W.splice(t,0,e);const n=this.#Y.getValues();n[2]+=1,this.#Y=new Ze(n)}}appendFrame(e,t){this.#j[t]=[e];const n=this.#Y.getValues(),i=this.#X.getValues();4===n.length?n[3]+=1:(n.push(2),i.push(1)),this.#Y=new Ze(n),this.#X=new nt(i)}toString(){return"Origin: "+this.getOrigin()+", Size: "+this.getSize()+", Spacing: "+this.getSpacing()+", Orientation: "+this.getOrientation()}equals(e){return null!==e&&this.getOrigin().equals(e.getOrigin())&&this.getSize().equals(e.getSize())&&this.getSpacing().equals(e.getSpacing())}isInBounds(e){return this.isIndexInBounds(this.worldToIndex(e))}isIndexInBounds(e,t){return this.getSize().isInBounds(e,t)}indexToWorld(e){const t=this.getSpacing(),n=new x(e.get(0)*t.get(0),e.get(1)*t.get(1),e.get(2)*t.get(2)),i=this.getOrientation().multiplyPoint3D(n),r=e.getValues(),o=this.getOrigin();return r[0]=o.getX()+i.getX(),r[1]=o.getY()+i.getY(),r[2]=o.getZ()+i.getZ(),new R(r)}pointToWorld(e){const t=this.getSpacing(),n=new x(e.getX()*t.get(0),e.getY()*t.get(1),e.getZ()*t.get(2)),i=this.getOrientation().multiplyPoint3D(n),r=this.getOrigin();return new x(r.getX()+i.getX(),r.getY()+i.getY(),r.getZ()+i.getZ())}worldToIndex(t){const n=this.getOrigin(),i=new x(t.get(0)-n.getX(),t.get(1)-n.getY(),t.get(2)-n.getZ()),r=this.getOrientation().getInverse().multiplyPoint3D(i),o=t.getValues(),a=this.getSpacing();return o[0]=Math.round(r.getX()/a.get(0)),o[1]=Math.round(r.getY()/a.get(1)),o[2]=Math.round(r.getZ()/a.get(2)),new e(o)}worldToPoint(e){const t=this.getOrigin(),n=new x(e.get(0)-t.getX(),e.get(1)-t.getY(),e.get(2)-t.getZ()),i=this.getOrientation().getInverse().multiplyPoint3D(n),r=e.getValues(),o=this.getSpacing();return r[0]=i.getX()/o.get(0),r[1]=i.getY()/o.get(1),r[2]=i.getZ()/o.get(2),new x(r[0],r[1],r[2])}}function rt(e,t){return t.getInverse().multiplyArray3D(e)}function ot(e,t){return t.multiplyArray3D(e)}function at(e){const t=e["00280010"];if(void 0===t)throw new Error("Missing DICOM image number of rows");if(0===t.value.length)throw new Error("Empty DICOM image number of rows");const n=e["00280011"];if(void 0===n)throw new Error("Missing DICOM image number of columns");if(0===n.value.length)throw new Error("Empty DICOM image number of columns");return[n.value[0],t.value[0]]}function st(e){if(void 0===e)return;if(1!==e.value.length)return;const t=e.value[0];let n=4,i=6;return 10===t.length&&(n=5,i=8),{year:parseInt(t.substring(0,4),10),monthIndex:t.length>=n+2?parseInt(t.substring(n,n+2),10)-1:0,day:t.length===i+2?parseInt(t.substring(i,i+2),10):0}}function lt(e){if(void 0===e)return;if(1!==e.value.length)return;const t=e.value[0],n=parseInt(t.substring(0,2),10),i=t.length>=4?parseInt(t.substring(2,4),10):0,r=t.length>=6?parseInt(t.substring(4,6),10):0,o=t.length>=8?t.substring(7,10):0;return{hours:n,minutes:i,seconds:r,milliseconds:0===o?0:parseInt(o,10)*Math.pow(10,3-o.length)}}function ct(e){return("0"+e).slice(-2)}function ut(e){if(void 0===e["00280030"])return null;const t=e["00280030"],n=[parseFloat(t.value[1]),parseFloat(t.value[0])];return void 0!==e["00180088"]&&n.push(parseFloat(e["00180088"].value[0])),new nt(n)}function dt(e,t,n){let i="";if(void 0===e)i+=" "+t+" is undefined,";else if(0===e.value.length)i+=" "+t+" is empty,";else if(void 0!==n)for(let r=0;r<n.length;++r)e.value.includes(n[r])||(i+=" "+t+" does not contain "+n[r]+" (value: "+e.value+"),");return i}class ht{getTime(e){}}class St{#$;#ee;getWarning(){return this.#$}checkElements(e){let t;this.#$=void 0,at(e);const n=e["00080060"];if(void 0!==n&&(t=n.value[0],"PT"===t)){const t=function(e){let t,n="";n+=dt(e["00280051"],"Corrected Image (00280051)",["ATTN","DECY"]),n+=dt(e["00541102"],"Decay Correction (00541102)",["START"]),n+=dt(e["00541001"],"Units (00541001)",["BQML"]);const r=e["00101030"],o=dt(r," PatientWeight (00101030)");0===o.length?t=r.value[0]:n+=o;const a=function(e){let t,n="";const r=st(e["00080021"]);let o,a,s;const l=e["00540016"];if(n+=dt(l,"RadiopharmaceuticalInformationSequence (00540016)"),void 0!==l){1!==l.value.length&&i.warn("Found more than 1 istopes in RadiopharmaceuticalInformation Sequence.");const e="RadionuclideTotalDose (00181074)",c=l.value[0]["00181074"];t=dt(c,e),0===t.length?o=c.value[0]:n+=t;const u="RadionuclideHalfLife (00181075)",d=l.value[0]["00181075"];t=dt(d,u),0===t.length?a=parseFloat(d.value[0]):n+=t;const h=l.value[0]["00181078"];let S,g;if(void 0===h)S=r,g=lt(l.value[0]["00181072"]);else{const e=function(e){if(void 0===e)return;if(1!==e.value.length)return;const t=e.value[0].split("&")[0];return{date:st({value:[t.substring(0,8)]}),time:t.length>=9?lt({value:[t.substring(8)]}):void 0}}(h);S=e.date,g=e.time}void 0===g&&(g={hours:0,minutes:0,seconds:0,milliseconds:0}),s=new Date(S.year,S.monthIndex,S.day,g.hours,g.minutes,g.seconds,g.milliseconds)}const c=lt(e["00080031"]);let u=new Date(r.year,r.monthIndex,r.day,c.hours,c.minutes,c.seconds,c.milliseconds);const d=e["00080022"],h=e["00080032"];if(void 0!==d&&void 0!==h){const t=st(d),r=lt(h),o=new Date(t.year,t.monthIndex,t.day,r.hours,r.minutes,r.seconds,r.milliseconds);if(u>o){const s="Series date/time is after Aquisition date/time (diff="+(u.getTime()-o.getTime()).toString()+"ms) ";i.debug(s);let l=0;const c="FrameReferenceTime (00541300)",d=e["00541300"];n+=dt(d,c),void 0!==d&&(l=d.value[0]);let h=0;const S="ActualFrameDuration (0018,1242)",g=e["00181242"];if(n+=dt(g,S),void 0!==g&&(h=g.value[0]),l>0&&h>0){h/=1e3,l/=1e3;const e=Math.log(2)/a,n=e*h,i=1/e*Math.log(n/(1-Math.exp(-n)))-l;u=new Date(t.year,t.monthIndex,t.day,r.hours,r.minutes,r.seconds+i,r.milliseconds)}}}let S;if(void 0!==u&&void 0!==s&&void 0!==o&&void 0!==a){const e=(u.getTime()-s.getTime())/1e3;S=o*Math.pow(2,-e/a)}return{value:S,warning:n}}(e);n+=a.warning;const s={};return 0!==n.length?s.warning="Cannot calculate PET SUV:"+n:s.value=1e3*t/a.value,s}(e);this.#ee=t.value,this.#$=t.warning}return this.#$}create(e,t,n){const o=at(e),a=[o[0],o[1],1],s=e["00280008"];if(void 0!==s){const e=parseInt(s.value[0],10);e>1&&a.push(e)}const l=new Ze(a),c=function(e){let t=1,n=1;const r=["00280030","00181164","00182010","00280034"];for(let i=0;i<r.length;++i){const o=e[r[i]];if(o&&2===o.value.length){t=parseFloat(o.value[0]),n=parseFloat(o.value[1]);break}}return 0===n&&(i.warn("Zero column spacing."),n=1),0===t&&(i.warn("Zero row spacing."),t=1),new nt([n,t,1])}(e),u=e["00020010"].value[0],d=qe(u),h=Fe(u),S=Ee(u),m=e["00200032"];let p=new Array(0,0,0);void 0!==m&&(p=[parseFloat(m.value[0]),parseFloat(m.value[1]),parseFloat(m.value[2])]);const f=function(e){const t=e["00200037"];let n;return void 0!==t&&(n=Ie(t.value.map((e=>parseFloat(e))))),n}(e),y=new x(p[0],p[1],p[2]),D=(new ht).getTime(e),C=new it(y,l,c,f,D);let v;const I=e["00080018"];void 0!==I&&(v=I.value[0]);let T=1;const L=e["00280002"];void 0!==L&&(T=L.value[0]);const P=l.getTotalSize()*T;if(P!==t.length){if(i.warn("Badly sized pixel buffer: "+t.length+" != "+P),!(P<t.length))throw new Error("Underestimated buffer size, can't fix it...");t=t.slice(0,l.getTotalSize())}const w=new Yt(C,t,[v]),O=e["00280004"];if(void 0!==O){let e=O.value[0].toUpperCase();(d||h||S)&&"MONOCHROME1"!==e&&"MONOCHROME2"!==e&&(e="RGB"),"RGB"===e&&1===T&&(e="PALETTE COLOR"),w.setPhotometricInterpretation(e)}const A=e["00280006"];void 0!==A&&w.setPlanarConfiguration(A.value[0]);let b=1;const R=e["00281053"];if(void 0!==R){const e=parseFloat(R.value[0]);isNaN(e)||(b=e)}let F=0;const E=e["00281052"];if(void 0!==E){const e=parseFloat(E.value[0]);isNaN(e)||(F=e)}const q={numberOfFiles:n},U=e["00080060"];void 0!==U&&(q.Modality=U.value[0]);let M=!1,Q=1;void 0!==this.#ee&&(M=!0,Q=this.#ee,i.info("Applying PET SUV calibration: "+Q),b*=Q,F*=Q);const B=new je(b,F);w.setRescaleSlopeAndIntercept(B);const N=function(t){let n;const i=e[t];return void 0!==i&&(n=i.value[0]),n};if(q.TransferSyntaxUID=N("00020010"),q.MediaStorageSOPClassUID=N("00020002"),q.SOPClassUID=N("00080016"),q.Modality=N("00080060"),q.ImageType=N("00080008"),q.SamplesPerPixel=N("00280002"),q.PhotometricInterpretation=N("00280004"),q.PixelRepresentation=N("00280103"),q.BitsAllocated=N("00280100"),q.BitsStored=N("00280101"),q.HighBit=N("00280102"),q.StudyDate=N("00080020"),q.StudyTime=N("00080030"),q.StudyInstanceUID=N("0020000D"),q.StudyID=N("00200010"),q.SeriesInstanceUID=N("0020000E"),q.SeriesNumber=N("00200011"),q.ReferringPhysicianName=N("00080090"),q.PatientName=N("00100010"),q.PatientID=N("00100020"),q.PatientBirthDate=N("00100030"),q.PatientSex=N("00100040"),q.Manufacturer=N("00080070"),q.ManufacturerModelName=N("00081090"),q.DeviceSerialNumber=N("00181000"),q.SoftwareVersions=N("00181020"),q.ImageOrientationPatient=N("00200037"),q.FrameOfReferenceUID=N("00200052"),q.IsSigned=1===q.PixelRepresentation,M)q.pixelUnit="SUV";else{const t=function(e){let t;const n=["00281054","00541001"];for(let i=0;i<n.length;++i){const r=e[n[i]];if(void 0!==r){t=r.value[0];break}}if(void 0===t){const n=e["00080060"];void 0!==n&&"CT"===n.value[0]&&(t="HU")}return t}(e);void 0!==t&&(q.pixelUnit=t)}const V={},G=e["00281050"],k=e["00281051"],H=e["00281055"];if(void 0!==G&&void 0!==k){let e;for(let t=0;t<G.value.length;++t){const n=parseFloat(G.value[t]);let o=parseFloat(k.value[t]);n&&o&&0!==o&&(e="",void 0!==H&&(e=H.value[t]),""===e&&(e="Default"+t),o*=Q,o<1&&(o=1),V[e]={wl:[new r(n*Q,o)],name:e}),0===o&&i.warn("Zero window width found in DICOM.")}}if(q.windowPresets=V,"PALETTE COLOR"===w.getPhotometricInterpretation()){const t=e["00281201"],n=e["00281202"],r=e["00281203"];let o,a,s;const l=e["00281101"];if(void 0!==l&&3===l.value.length)if(16===l.value[2]){let c=!1,u=l.value[0];0===u&&(u=65536);const d=t.vl;if(d!==2*u&&(c=!0,i.info("16bits lut but size is not double. desc: "+u+" vl: "+d)),8===parseInt(e["00280100"].value[0],10)&&(c=!0,i.info("Scaling 16bits color lut since bits allocated is 8.")),c){const e=function(e){return e>>8};o=t.value.map(e),a=n.value.map(e),s=r.value.map(e)}}else if(8===l.value[2]){i.info("Scaling 16bits color lut since the lut descriptor is 8.");let e=t.value.slice(0);o=Array.from(new Uint8Array(e.buffer)),e=n.value.slice(0),a=Array.from(new Uint8Array(e.buffer)),e=r.value.slice(0),s=Array.from(new Uint8Array(e.buffer))}g.palette={red:o,green:a,blue:s}}const z=e["00082144"];return void 0!==z&&(q.RecommendedDisplayFrameRate=parseInt(z.value[0],10)),w.setMeta(q),w}}class gt{#O=!0;#x;constructor(e,t){void 0!==t&&(this.#O=t),this.#x=new DataView(e)}writeUint8(e,t){return this.#x.setUint8(e,t),e+Uint8Array.BYTES_PER_ELEMENT}writeInt8(e,t){return this.#x.setInt8(e,t),e+Int8Array.BYTES_PER_ELEMENT}writeUint16(e,t){return this.#x.setUint16(e,t,this.#O),e+Uint16Array.BYTES_PER_ELEMENT}writeInt16(e,t){return this.#x.setInt16(e,t,this.#O),e+Int16Array.BYTES_PER_ELEMENT}writeUint32(e,t){return this.#x.setUint32(e,t,this.#O),e+Uint32Array.BYTES_PER_ELEMENT}writeUint64(e,t){return this.#x.setBigUint64(e,t,this.#O),e+BigUint64Array.BYTES_PER_ELEMENT}writeInt32(e,t){return this.#x.setInt32(e,t,this.#O),e+Int32Array.BYTES_PER_ELEMENT}writeInt64(e,t){return this.#x.setBigInt64(e,t,this.#O),e+BigInt64Array.BYTES_PER_ELEMENT}writeFloat32(e,t){return this.#x.setFloat32(e,t,this.#O),e+Float32Array.BYTES_PER_ELEMENT}writeFloat64(e,t){return this.#x.setFloat64(e,t,this.#O),e+Float64Array.BYTES_PER_ELEMENT}writeHex(e,t){const n=parseInt(t,16);return this.#x.setUint16(e,n,this.#O),e+Uint16Array.BYTES_PER_ELEMENT}writeBinaryArray(e,t){if(t.length%8!=0)throw new Error("Cannot write boolean array as binary.");let n=null,i=null;for(let r=0,o=t.length;r<o;r+=8){n=0;for(let e=0;e<8;++e)i=0===t[r+e]?0:1,n+=i<<e;e=this.writeUint8(e,n)}return e}writeUint8Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeUint8(e,t[n]);return e}writeInt8Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeInt8(e,t[n]);return e}writeUint16Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeUint16(e,t[n]);return e}writeInt16Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeInt16(e,t[n]);return e}writeUint32Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeUint32(e,t[n]);return e}writeUint64Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeUint64(e,t[n]);return e}writeInt32Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeInt32(e,t[n]);return e}writeInt64Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeInt64(e,t[n]);return e}writeFloat32Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeFloat32(e,t[n]);return e}writeFloat64Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeFloat64(e,t[n]);return e}}let mt=0;class pt{action;value;constructor(e){this.action=e}}const ft={copy:function(e){return e},remove:function(){return null},clear:function(e){return e.value=[],e},replace:function(e,t){return e.value=[t],e}};function yt(e){const t="1.2.826.0.1.3680043.9.7278.1.";let n="";if("ImplementationClassUID"===e)n=t+"0.33.1";else{const i="."+(new Date).toISOString().replace(/\D/g,"").substring(0,14);mt+=1;const r="."+mt;n=t;const o=29+r.length+i.length,a=Math.min(e.length,64-o);if(a>1){let t="";for(let n=0;n<a;++n)t+=e.charCodeAt(n);n+=t.substring(0,a)}n+=i+r}return n}function Dt(e){return e%2==0}function Ct(e){const t=J[e];return void 0!==t&&"string"===t}function vt(e,t){const n=new Uint8Array(e.length+1);return n.set(e),n.set(t,e.length),n}class It{encode(e){const t=new Uint8Array(e.length);for(let n=0,i=e.length;n<i;++n)t[n]=e.charCodeAt(n);return t}}const Tt="00080005",Lt="00280100";class Pt{#te=!1;#ne=!0;#ie={default:{action:"copy",value:null}};#re=this.#ie;#oe=[];#ae=new It;#se=this.#ae;setUseUnVrForPrivateSq(e){this.#te=e}setFixUnknownVR(e){this.#ne=e}setRules(e,t){if(this.#re=e,this.#oe=[],t){const t=Object.keys(e);for(const n of t){const t=e[n];if("replace"===t.action&&void 0!==t.value&&null!==t.value){let e,t=!1;if(8===n.length&&(t=void 0!==ce(n).getNameFromDictionary()),t)e=n;else{const t=me(n);void 0!==t&&(e=t.getKey())}void 0!==e&&this.#oe.push(e)}}}}#le(e){return this.#ae.encode(e)}#ce(e){return this.#se.encode(e)}useSpecialTextEncoder(){this.#se=new TextEncoder}getElementToWrite(e){const t=e.tag.getGroupName(),n=e.tag.getNameFromDictionary();let i;return i=void 0!==this.#re[e.tag.getKey()]?this.#re[e.tag.getKey()]:void 0!==n&&void 0!==this.#re[n]?this.#re[n]:void 0!==this.#re[t]?this.#re[t]:this.#re.default,ft[i.action](e,i.value)}#ue(e,t,n,i){let r=null;for(let o=0;o<n.length;++o){r=n[o];const a=Object.keys(r);if(0===a.length)continue;let s=!1;void 0!==r.FFFEE000.undefinedLength&&(s=r.FFFEE000.undefinedLength);const l=new Te("NONE");l.vl=s?4294967295:r.FFFEE000.vl,l.tag=ue(),l.value=[],t=this.#de(e,l,t,i);for(let n=0;n<a.length;++n)"FFFEE000"!==a[n]&&"FFFEE00D"!==a[n]&&(t=this.#de(e,r[a[n]],t,i));if(s){const n=new Te("NONE");n.vl=0,n.tag=new le("FFFE","E00D"),n.value=[],t=this.#de(e,n,t,i)}}return t}#he(e,t,n,r,o){const a=n;if("NONE"===t.vr);else if(r instanceof Uint8Array)n=r.length===8*t.vl?e.writeBinaryArray(n,r):e.writeUint8Array(n,r);else if(r instanceof Int8Array)n=e.writeInt8Array(n,r);else if(r instanceof Uint16Array)n=e.writeUint16Array(n,r);else if(r instanceof Int16Array)n=e.writeInt16Array(n,r);else if(r instanceof Uint32Array)n=e.writeUint32Array(n,r);else if(r instanceof Int32Array)n=e.writeInt32Array(n,r);else if(r instanceof BigUint64Array)n=e.writeUint64Array(n,r);else if(r instanceof BigInt64Array)n=e.writeInt64Array(n,r);else{const a=J[t.vr];if(void 0!==a)if("Uint8"===a)n=e.writeUint8Array(n,r);else if("Uint16"===a)n=e.writeUint16Array(n,r);else if("Int16"===a)n=e.writeInt16Array(n,r);else if("Uint32"===a)n=e.writeUint32Array(n,r);else if("Int32"===a)n=e.writeInt32Array(n,r);else if("Uint64"===a)n=e.writeUint64Array(n,r);else if("Int64"===a)n=e.writeInt64Array(n,r);else if("Float32"===a)n=e.writeFloat32Array(n,r);else if("Float64"===a)n=e.writeFloat64Array(n,r);else{if("string"!==a)throw new Error("Unknown VR type: "+a);n=e.writeUint8Array(n,r)}else if("SQ"===t.vr)n=this.#ue(e,n,r,o);else if("AT"===t.vr)for(let t=0;t<r.length;++t){const i=r[t]+"",o=i.substring(1,5),a=i.substring(6,10),s=[parseInt(o,16),parseInt(a,16)];n=e.writeUint16Array(n,s)}else"xs"===t.vr?n=r instanceof Int16Array?e.writeInt16Array(n,r):e.writeUint16Array(n,r):i.warn("Unknown VR: "+t.vr)}if("SQ"!==t.vr&&"NONE"!==t.vr){const e=n-a;if(e!==t.vl){let n="Offset difference and VL are not equal: "+e+" != "+t.vl;n+=" (",void 0!==t.tag&&(n+=t.tag+", "),n+="vr:"+t.vr+")",i.warn(n)}}return n}#Se(e,t,n,i,r){let o=!1;if(void 0!==t.undefinedLength&&(o=t.undefinedLength),o){const o={};o.FFFEE000={tag:ue(),vr:"NONE",vl:0,value:[]};for(let e=0;e<i.length;++e)o[e]={tag:ue(),vr:t.vr,vl:i[e].length,value:i[e]};n=this.#ue(e,n,[o],r)}else{let o=i[0];i.length>1&&(o=function(e){const t=e.length,n=e[0].length;if(void 0===n)return e;const i=t*n,r=new e[0].constructor(i);for(let i=0;i<t;i++){const t=i*n;r.set(e[i],t)}return r}(i)),n=this.#he(e,t,n,o,r)}return n}#de(e,t,n,r){const o=t.tag.isWithVR(),a=!(!r&&o)||Z(t.vr);n=e.writeHex(n,t.tag.getGroup()),n=e.writeHex(n,t.tag.getElement());let s=t.vr;this.#te&&t.tag.isPrivate()&&"SQ"===s&&(i.warn("Write element using VR=UN for private sequence."),s="UN"),o&&!r&&(n=e.writeUint8Array(n,this.#le(s)),a&&(n+=2));let l=!1;("SQ"===t.vr||ge(t.tag))&&void 0!==t.undefinedLength&&(l=t.undefinedLength);let c=!1;de(t.tag)&&void 0!==t.undefinedLength&&(c=t.undefinedLength);let u=t.vl;(l||c)&&(u=4294967295),n=a?e.writeUint32(n,u):e.writeUint16(n,u);let d=t.value;if(void 0===d&&(d=[]),n=ge(t.tag)?this.#Se(e,t,n,d,r):this.#he(e,t,n,d,r),l){const t=new Te("NONE");t.vl=0,t.tag=new le("FFFE","E0DD"),t.value=[],n=this.#de(e,t,n,r)}return n}getBuffer(e){const t=e["00020010"].value[0],n=xe(t),r=Re(t);if(void 0!==e[Tt]){const t=e[Tt].value[0];void 0!==t&&"ISO-IR 6"!==t&&(i.debug("Change charset to UTF, was: "+t),this.useSpecialTextEncoder(),e[Tt].value=["ISO_IR 192"])}let o;void 0!==e[Lt]&&(o=e[Lt].value[0]);let a=132,s=0;const l=[],c=[];let u,d,h=0;const S=new le("0002","0000"),g=new le("0002","0001"),m=new le("0002","0012"),p=new le("0002","0013"),f=this.#oe.slice(),y=Object.keys(e);for(let t=0,i=y.length;t<i;++t){const i=e[y[t]];if(i.tag=ce(y[t]),u=this.getElementToWrite(i),!(null===u||S.equals(u.tag)||g.equals(u.tag)||m.equals(u.tag)||p.equals(u.tag))){s=0;const e=f.indexOf(u.tag.getKey());-1!==e&&f.splice(e,1),this.#ne&&wt(u,!r),this.#ge(u,u.value,n,o),d=u.tag.getGroupName(),s+=Qe(u.vr,"Meta Element"!==d&&n),s+=u.vl,"Meta Element"===d?(l.push(u),h+=s):c.push(u),a+=s}}for(const e of f){const t=ce(e),i=new Te(t.getVrFromDictionary());let r;if(i.tag=t,void 0!==this.#re[e])r=this.#re[e].value;else{const e=t.getNameFromDictionary();r=this.#re[e].value}let o=Qe(i.vr,n);o+=this.#ge(i,[r],n),c.push(i),a+=o}const D=Ot("FileMetaInformationVersion");let C=Qe(D.vr,!1);C+=this.#ge(D,[0,1],!1),l.push(D),h+=C,a+=C;const v=Ot("ImplementationClassUID");let I=Qe(v.vr,!1);I+=this.#ge(v,[yt("ImplementationClassUID")],!1),l.push(v),h+=I,a+=I;const T=Ot("ImplementationVersionName");let L=Qe(T.vr,!1);L+=this.#ge(T,["DWV_0.33.1"],!1),l.push(T),h+=L,a+=L;const P=function(e,t){return function(e,t){let n=parseInt(e.getGroup(),16)-parseInt(t.getGroup(),16);return 0===n&&(n=parseInt(e.getElement(),16)-parseInt(t.getElement(),16)),n}(e.tag,t.tag)};l.sort(P),c.sort(P);const w=Ot("FileMetaInformationGroupLength");let O=Qe(w.vr,!1);O+=this.#ge(w,new Uint32Array([h]),!1),a+=O;const A=new ArrayBuffer(a),b=new gt(A),x=new gt(A,!r);let R=128;R=b.writeUint8Array(R,this.#le("DICM")),R=this.#de(b,w,R,!1);for(let e=0,t=l.length;e<t;++e)R=this.#de(b,l[e],R,!1);const F=132+O+h;R!==F&&i.warn("Bad size calculation... meta offset: "+R+", calculated size:"+F+" (diff:"+(R-F)+")");for(let e=0,t=c.length;e<t;++e)R=this.#de(x,c[e],R,n);return R!==a&&i.warn("Bad size calculation... final offset: "+R+", calculated size:"+a+" (diff:"+(R-a)+")"),A}#ge(e,t,n,i){let r=0;if("SQ"===e.vr){if(null!==t&&0!==t){const o=[];let a,s=!1;void 0!==e.undefinedLength&&(s=e.undefinedLength,delete e.undefinedLength);for(let e=0;e<t.length;++e){const l=t[e],c={};let u=0;if(null===l||0===l)continue;let d=i;const h=l[Lt];void 0!==h&&void 0!==h.value&&(d=h.value[0]);const S=Object.keys(l);for(let e=0,t=S.length;e<t;++e){const t=S[e],i=l[t];i.tag=ce(t),de(i.tag)||(u+=this.#ge(i,i.value,n,d),c[t]=i,u+=Qe(i.vr,n))}const g={tag:ue(),vr:"NONE",vl:u,value:[]};s&&(g.undefinedLength=s),a=g.tag.getKey(),c[a]=g,u+=Qe(g.vr,n),s&&(u+=Qe("NONE",n)),r+=u,o.push(c)}s&&(r+=Qe("NONE",n)),e.value=o,e.vl=r,s&&(e.undefinedLength=s)}}else{if(Ct(o=e.vr)||"OB"===o){const n=function(e){let t="";return Ct(e)&&(t="UI"===e?"\0":" "),t}(e.vr);if(Ct(e.vr)){let i;K(e.vr)?(t=this.#ce(t.join("\\")),i=this.#ce(n)):(t=this.#le(t.join("\\")),i=this.#le(n)),Dt(t.length)||(t=vt(t,i))}else"OB"===e.vr&&(t=function(e){if(null==e||void 0===e.length)throw new Error("Cannot pad undefined or null OB value.");if(0!==e.length&&void 0!==e[0].length){let t=0;for(let n=0;n<e.length;++n)t+=e[n].length;Dt(t)||(e[e.length-1]=vt(e[e.length-1],[0]))}else Dt(e.length)||(e=vt(e,[0]));return e}(t))}if(r=0,"AT"===e.vr)r=4*t.length;else if("xs"===e.vr)r=t.length*Uint16Array.BYTES_PER_ELEMENT;else if(function(e){const t=J[e];return void 0!==t&&"string"!==t}(e.vr)||"ox"===e.vr){if(ge(e.tag)&&Array.isArray(t)){r=0;for(let e=0;e<t.length;++e)r+=t[e].length}else r=t.length;const o=J[e.vr];if(ge(e.tag)||"ox"===e.vr)if(e.undefinedLength){const e=Qe("NONE",n);r+=e,r+=e*t.length,r+=e}else void 0!==i&&(1===i?r/=8:16===i&&(r*=Uint16Array.BYTES_PER_ELEMENT));else{if(void 0===o)throw new Error("Unsupported element: "+e.vr);{const e=function(e){let t;return"Uint8"===e?t=Uint8Array.BYTES_PER_ELEMENT:"Uint16"===e?t=Uint16Array.BYTES_PER_ELEMENT:"Int16"===e?t=Int16Array.BYTES_PER_ELEMENT:"Uint32"===e?t=Uint32Array.BYTES_PER_ELEMENT:"Int32"===e?t=Int32Array.BYTES_PER_ELEMENT:"Float32"===e?t=Float32Array.BYTES_PER_ELEMENT:"Float64"===e?t=Float64Array.BYTES_PER_ELEMENT:"Uint64"===e?t=BigUint64Array.BYTES_PER_ELEMENT:"Int64"===e&&(t=BigInt64Array.BYTES_PER_ELEMENT),t}(o);if(void 0===e)throw new Error("Unknown bytes per element for VR type: "+o);r*=e}}}else r=t.length;e.value=t,e.vl=r}var o;return r}}function wt(e,t){if("UN"===e.vr){const n=e.tag.getVrFromDictionary();if(void 0!==n&&e.vr!==n){e.vr=n;const r=J[e.vr];if(void 0!==r&&"Uint8"!==r&&"string"!==r){const n=function(e,t,n){let i;if(void 0===e.buffer)return i;const r=new fe(e.buffer,n),o=e.byteOffset,a=e.length,s=J[t];return"Uint16"===s?i=r.readUint16Array(o,a):"Uint32"===s?i=r.readUint32Array(o,a):"Uint64"===s?i=r.readUint64Array(o,a):"Int16"===s?i=Array.from(r.readInt16Array(o,a)):"Int32"===s?i=Array.from(r.readInt32Array(o,a)):"Int64"===s?i=r.readInt64Array(o,a):"Float32"===s?i=Array.from(r.readFloat32Array(o,a)):"Float64"===s&&(i=Array.from(r.readFloat64Array(o,a))),i}(e.value,e.vr,t);void 0!==n&&(e.value=n)}i.info("Element "+e.tag.getGroup()+" "+e.tag.getElement()+" VR changed from UN to "+e.vr)}}}function Ot(e){const t=me(e),n=new Te(t.getVrFromDictionary());return n.tag=t,n}function At(e){const t=Object.keys(e),n={};for(let r=0,o=t.length;r<o;++r){const o=me(t[r]);if(void 0===o)continue;const a=o.getVrFromDictionary();let s,l=!1;const c=e[t[r]];if("SQ"===a){const e=[];if(void 0!==c.undefinedLength&&(l=c.undefinedLength),void 0!==c.value&&null!==c.value)for(let t=0;t<c.value.length;++t)e.push(At(c.value[t]));else i.trace("Undefined or null simpleTag SQ value.");s=e}else s=Array.isArray(c)?c:[c];const u=new Te(a);u.tag=o,u.value=s,l&&(u.undefinedLength=l),n[o.getKey()]=u}return n}class bt{meaning;value;longValue;urnValue;schemeDesignator;constructor(e){this.meaning=e}}function xt(e){const t=new bt(e["00080104"].value[0]);if(e["00080100"])t.value=e["00080100"].value[0];else if(e["00080119"])t.longValue=e["00080119"].value[0];else{if(!e["00080120"])throw new Error("Invalid code with no value, no long value and no urn value.");t.urnValue=e["00080120"].value[0]}if(void 0!==t.value||void 0!==t.longValue){if(!e["00080102"])throw new Error("No coding sheme designator when code value or long value is present");t.schemeDesignator=e["00080102"].value[0]}return t}function Rt(e){const t={};return void 0!==e.value?t.CodeValue=e.value:void 0!==e.longValue?t.LongCodeValue=e.longValue:void 0!==e.urnValue&&(t.URNCodeValue=e.urnValue),void 0!==e.schemeDesignator&&(t.CodingSchemeDesignator=e.schemeDesignator),t.CodeMeaning=e.meaning,t}class Ft{number;label;algorithmType;algorithmName;displayValue;displayRGBValue;propertyTypeCode;propertyCategoryCode;trackingUid;trackingId;constructor(e,t,n){this.number=e,this.label=t,this.algorithmType=n}}function Et(e){const t=new Ft(e["00620004"].value[0],e["00620005"]?e["00620005"].value[0]:"n/a",e["00620008"].value[0]);if(e["00620009"]&&(t.algorithmName=e["00620009"].value[0]),void 0!==e["0062000C"])t.displayValue=e["006200C"].value[0];else if(void 0!==e["0062000D"]){const i=e["0062000D"].value,r=function(e){return function(e){function t(e){let t=null;return t=e<=.0031308?12.92*e:1.055*Math.pow(e,.416666667)-.055,Math.min(1,Math.max(0,t))}const n=e.x/100,i=e.y/100,r=e.z/100;return{r:Math.round(255*t(3.2406*n-1.5372*i-.4986*r)),g:Math.round(255*t(-.9689*n+1.8758*i+.0415*r)),b:Math.round(255*t(.0557*n-.204*i+1.057*r))}}(function(e){function t(e){let t=null;return t=e>.206896552?Math.pow(e,3):.128418549*e-.017712903,t}const n=C,i=(e.l+16)/116;return{x:n.x*t(i+e.a/500),y:n.y*t(i),z:n.z*t(i-e.b/200)}}(e))}({l:.001525902*(n={l:i[0],a:i[1],b:i[2]}).l,a:.003891051*n.a-128,b:.003891051*n.b-128});t.displayRGBValue=r}var n;if(void 0===e["00620003"])throw new Error("Missing Segmented Property Category Code Sequence.");if(t.propertyCategoryCode=xt(e["00620003"].value[0]),void 0===e["0062000F"])throw new Error("Missing Segmented Property Type Code Sequence.");return t.propertyTypeCode=xt(e["0062000F"].value[0]),void 0!==e["00620020"]&&(t.trackingId=e["00620020"].value[0],t.trackingUid=e["00620021"].value[0]),t}function qt(e){let t=e.algorithmType;void 0===t&&(t="MANUAL");const n={SegmentNumber:e.number,SegmentLabel:e.label,SegmentAlgorithmType:t};if("MANUAL"!==t&&void 0!==e.algorithmName&&(n.SegmentAlgorithmName=e.algorithmName),e.displayRGBValue){const t=D(v(e.displayRGBValue));n.RecommendedDisplayCIELabValue=[Math.round(t.l),Math.round(t.a),Math.round(t.b)]}else n.RecommendedDisplayGrayscaleValue=e.displayValue;return e.propertyCategoryCode&&(n.SegmentedPropertyCategoryCodeSequence={value:[Rt(e.propertyCategoryCode)]}),e.propertyTypeCode&&(n.SegmentedPropertyTypeCodeSequence={value:[Rt(e.propertyTypeCode)]}),e.trackingId&&(n.TrackingID=e.trackingId,n.TrackingUID=e.trackingUid),n}class Ut{dimIndex;imagePosPat;derivationImages;refSegmentNumber;imageOrientationPatient;spacing;constructor(e,t,n,i){this.dimIndex=e,this.imagePosPat=t,this.derivationImages=n,this.refSegmentNumber=i}}function Mt(e){const t=[];if(void 0!==e["00089124"]){const n=e["00089124"].value;for(let e=0;e<n.length;++e){const i=[];if(void 0!==n[e]["00082112"]){const t=n[e]["00082112"].value;for(let e=0;e<t.length;++e){const n={};void 0!==t[e]["00081150"]&&(n.referencedSOPClassUID=t[e]["00081150"].value[0]),void 0!==t[e]["00081155"]&&(n.referencedSOPInstanceUID=t[e]["00081155"].value[0]),i.push(n)}}t.push({sourceImages:i})}}const n=e["00209111"].value[0]["00209157"].value,r=e["0062000A"].value,o=parseInt(r[0]["0062000B"].value[0],0),a=e["00209113"].value[0]["00200032"].value;for(let e=0;e<a.length;++e)a[e]=parseFloat(a[e]);const s=new Ut(n,a,t,o);if(void 0!==e["00209116"]){const t=e["00209116"];if(0!==t.value.length){const e=t.value[0]["00200037"].value;void 0!==e&&(s.imageOrientationPatient=e)}}if(void 0!==e["00289110"]){const t=e["00289110"];if(0!==t.value.length){const e=ut(t.value[0]);void 0!==e&&(s.spacing=e)}else i.warn("No shared functional group pixel measure sequence items.")}return s}function Qt(e){const t={FrameContentSequence:{value:[{DimensionIndexValues:e.dimIndex}]},PlanePositionSequence:{value:[{ImagePositionPatient:e.imagePosPat}]},SegmentIdentificationSequence:{value:[{ReferencedSegmentNumber:e.refSegmentNumber}]}};if(void 0!==e.derivationImages){const n={CodeMeaning:"Source image for image processing operation",CodeValue:121322,CodingSchemeDesignator:"DCM"},i={CodeMeaning:"Segmentation",CodeValue:113076,CodingSchemeDesignator:"DCM"},r=[];for(const t of e.derivationImages){const e=[];for(const i of t.sourceImages)e.push({PurposeOfReferenceCodeSequence:{value:[n]},ReferencedSOPClassUID:i.referencedSOPClassUID,ReferencedSOPInstanceUID:i.referencedSOPInstanceUID});r.push({DerivationCodeSequence:{value:[i]},SourceImageSequence:{value:e}})}t.DerivationImageSequence={value:r}}return t}function Bt(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Nt(e,t){const n=e[t.tag];if(1===t.type||2===t.type){if(void 0===n)throw new Error("Missing or empty "+t.name)}else if(void 0===n)return;let i,r=!1;if(i=1===n.value.length?n.value[0]:n.value,Array.isArray(i))for(let e=0;e<t.enum.length;++e){if(!Array.isArray(t.enum[e]))throw new Error("Cannot compare array and non array tag value.");if(N(t.enum[e],i)){r=!0;break}}else r=t.enum.includes(i);if(!r)throw new Error("Unsupported "+t.name+" value: "+i)}function Vt(e,t,n){const i=e.getNumberOfComponents();let r,o;3===i?(r=function(t){return{r:e.getValueAtOffset(t),g:e.getValueAtOffset(t+1),b:e.getValueAtOffset(t+2)}},o=function(e,t){return void 0!==t.displayRGBValue&&e.r===t.displayRGBValue.r&&e.g===t.displayRGBValue.g&&e.b===t.displayRGBValue.b}):(r=function(t){return e.getValueAtOffset(t)},o=function(e,t){return e===t.displayValue});const a=e.getGeometry().getSize().getDimSize(2),s={};for(let e=0;e<a;++e){const l=r((n+e)*i);for(const n of t){const t=n.number-1;o(l,n)&&(void 0===s[t]&&(s[t]=new Uint8Array(a)),s[t][e]=1)}}return s}const Gt=[{name:"TransferSyntaxUID",tag:"00020010",type:"1",enum:[ee,te,ne]},{name:"MediaStorageSOPClassUID",tag:"00020002",type:"1",enum:["1.2.840.10008.5.1.4.1.1.66.4"]},{name:"SOPClassUID",tag:"00020002",type:"1",enum:["1.2.840.10008.5.1.4.1.1.66.4"]},{name:"Modality",tag:"00080060",type:"1",enum:["SEG"]},{name:"SegmentationType",tag:"00620001",type:"1",enum:["BINARY"]},{name:"DimensionOrganizationType",tag:"00209311",type:"3",enum:["3D"]},{name:"ImageType",tag:"00080008",type:"1",enum:[["DERIVED","PRIMARY"]]},{name:"SamplesPerPixel",tag:"00280002",type:"1",enum:[1]},{name:"PhotometricInterpretation",tag:"00280004",type:"1",enum:["MONOCHROME2"]},{name:"PixelRepresentation",tag:"00280103",type:"1",enum:[0]},{name:"BitsAllocated",tag:"00280100",type:"1",enum:[1]},{name:"BitsStored",tag:"00280101",type:"1",enum:[1]},{name:"HighBit",tag:"00280102",type:"1",enum:[0]}];function kt(){const e={};for(let t=0;t<Gt.length;++t){const n=Gt[t];e[n.name]=n.enum[0]}return e}class Ht{#$;getWarning(){return this.#$}checkElements(e){}create(t,n){for(let e=0;e<Gt.length;++e)Nt(t,Gt[e]);const r=at(t),o=new Ze([r[0],r[1],1]),a=o.getTotalSize();let s=1;const l=t["00280008"];if(void 0!==l&&(s=parseInt(l.value[0],10)),s!==n.length/a)throw new Error("Buffer and numberOfFrames meta are not equal."+s+" "+n.length/a);const c=function(e){const t=e["00209221"];if(void 0===t||1!==t.value.length)throw new Error("Unsupported dimension organization sequence length");const n=t.value[0]["00209164"].value[0],i=[],r=e["00209222"];if(void 0!==r){const e=r.value;if(2!==e.length)throw new Error("Unsupported dimension index sequence length");let t;for(let r=0;r<e.length;++r){const o=e[r]["00209164"].value[0];if(o!==n)throw new Error("Dimension Index Sequence contains a unknown Dimension Organization");t=e[r]["00209165"].value[0];const a={DimensionOrganizationUID:o,DimensionIndexPointer:t};void 0!==e[r]["00209421"]&&(a.DimensionDescriptionLabel=e[r]["00209421"].value[0]),i.push(a)}if("(0020,0032)"!==t)throw new Error("Unsupported non image position as last index")}return{organizations:{value:[{DimensionOrganizationUID:n}]},indices:{value:i}}}(t),u=t["00620002"];if(void 0===u)throw new Error("Missing or empty segmentation sequence");const d=[];let h,S,g=!1;for(let e=0;e<u.value.length;++e){const t=Et(u.value[e]);void 0!==t.displayRGBValue&&(g=!0),d.push(t)}const m=t[52009229];if(void 0!==m){const e=m.value[0];if(void 0!==e["00209116"]){const t=e["00209116"];0!==t.value.length?S=t.value[0]["00200037"].value:i.warn("No shared functional group plane orientation sequence items.")}if(void 0!==e["00289110"]){const t=e["00289110"];0!==t.value.length?h=ut(t.value[0]):i.warn("No shared functional group pixel measure sequence items.")}}const p=function(e,t){return e.some((function(e){return Bt(t,e)}))},f=function(e,t){return e.findIndex((function(e){return Bt(t,e)}))},y=t[52009230];if(void 0===y)throw new Error("Missing or empty per frame functional sequence");if(s!==y.value.length)throw new Error("perFrameFuncGroupSequence meta and numberOfFrames are not equal.");const D=[];for(let e=0;e<y.value.length;++e)D.push(Mt(y.value[e]));const C=[];for(let e=0;e<D.length;++e){if(p(C,D[e].imagePosPat)||C.push(D[e].imagePosPat),void 0!==D[e].imageOrientationPatient)if(void 0===S)S=D[e].imageOrientationPatient;else if(!N(S,D[e].imageOrientationPatient))throw new Error("Unsupported multi orientation dicom seg.");if(void 0!==D[e].spacing)if(void 0===h)h=D[e].spacing;else if(!h.equals(D[e].spacing))throw new Error("Unsupported multi resolution dicom seg.")}if(void 0===h)throw new Error("No spacing found for DICOM SEG");if(3!==h.length())throw new Error("Incomplete spacing found for DICOM SEG");if(void 0===S)throw new Error("No imageOrientationPatient found for DICOM SEG");if(6!==S.length)throw new Error("Incomplete imageOrientationPatient found for DICOM SEG");const v=new T(parseFloat(S[0]),parseFloat(S[1]),parseFloat(S[2])),I=new T(parseFloat(S[3]),parseFloat(S[4]),parseFloat(S[5])),P=v.crossProduct(I),O=new w([v.getX(),I.getX(),P.getX(),v.getY(),I.getY(),P.getY(),v.getZ(),I.getZ(),P.getZ()]);C.sort(function(e){const t=e.getInverse();return function(e,n){const i=t.multiplyArray3D(e),r=t.multiplyArray3D(n);return i[2]-r[2]}}(O));const A=function(e){return new x(e[0],e[1],e[2])},b=[];for(let e=0;e<C.length;++e)b.push(A(C[e]));const R=new it(b[0],o,h,O),F=function(e){let t=e>L;return t&&(t=e>.001,t?(t=e>.01,t||i.warn("Using larger+ real world epsilon in SEG pos pat adding")):i.warn("Using larger real world epsilon in SEG pos pat adding")),t},E=[];E.push(C[0]);let q=0;for(let t=1;t<C.length;++t){++q;let n=new e([0,0,q]),r=R.indexToWorld(n).get3D();const o=b[t];let a=o.getDistance(r);const s=a;for(;F(a);)if(i.debug("Adding intermediate pos pats for DICOM seg at "+r.toString()),E.push([r.getX(),r.getY(),r.getZ()]),++q,n=new e([0,0,q]),r=R.indexToWorld(n).get3D(),a=o.getDistance(r),a>s)throw new Error("Test distance is increasing when adding intermediate pos pats");E.push(C[t])}const U=E.length,M=new it(b[0],o,h,O),Q=["0"];for(let e=1;e<U;++e)M.appendOrigin(A(E[e]),e),Q.push(e.toString());const B=function(e){return function(t){return t.number===e}},V=g?3:1,G=new n.constructor(V*a*U);G.fill(0);let k=null,H=null;for(let e=0;e<D.length;++e){q=f(E,D[e].imagePosPat),H=a*e,k=a*q;const t=d.find(B(D[e].refSegmentNumber));for(let e=0;e<a;++e)if(0!==n[H+e]){const n=V*(k+e);g?(G[n]=t.displayRGBValue.r,G[n+1]=t.displayRGBValue.g,G[n+2]=t.displayRGBValue.b):G[n]=t.displayValue}}const z=new Yt(M,G,Q);g&&z.setPhotometricInterpretation("RGB");const W=kt(),Y=function(e){let n;const i=t[e];return void 0!==i&&(n=i.value[0]),n};W.StudyDate=Y("00080020"),W.StudyTime=Y("00080030"),W.StudyInstanceUID=Y("0020000D"),W.StudyID=Y("00200010"),W.SeriesDate=Y("00080021"),W.SeriesTime=Y("00080031"),W.SeriesInstanceUID=Y("0020000E"),W.SeriesNumber=Y("00200011"),W.ReferringPhysicianName=Y("00080090"),W.PatientName=Y("00100010"),W.PatientID=Y("00100020"),W.PatientBirthDate=Y("00100030"),W.PatientSex=Y("00100040"),W.Manufacturer=Y("00080070"),W.ManufacturerModelName=Y("00081090"),W.DeviceSerialNumber=Y("00181000"),W.SoftwareVersions=Y("00181020"),W.DimensionOrganizationSequence=c.organizations,W.DimensionIndexSequence=c.indices,W.custom={segments:d,frameInfos:D,SOPInstanceUID:t["00080018"].value[0]},W.numberOfFiles=U;const X=t["00200052"];X&&(W.FrameOfReferenceUID=X.value[0]);const j=t["00282110"];return j&&(W.LossyImageCompression=j.value[0]),z.setMeta(W),z}toDicom(e,t,n,r){const o=e.getMeta();void 0===t&&(t=o.segments);const a=e.getGeometry(),s=a.getSize();o.Rows=s.get(1),o.Columns=s.get(0);const l=new Date;var c;o.ContentDate=(c=l).getFullYear().toString()+ct((c.getMonth()+1).toString())+ct(c.getDate().toString()),o.ContentTime=function(e){return ct(e.getHours().toString())+ct(e.getMinutes().toString())+ct(e.getSeconds().toString())}(l),void 0!==n&&(o.StudyInstanceUID=n.getMeta().StudyInstanceUID);const u=[];for(const e of t)u.push(qt(e));var d,h;o.SegmentSequence={value:u},o.SharedFunctionalGroupsSequence={value:[{PlaneOrientationSequence:{value:[(h=a.getOrientation(),{ImageOrientationPatient:[h.get(0,0),h.get(1,0),h.get(2,0),h.get(0,1),h.get(1,1),h.get(2,1)]})]},PixelMeasuresSequence:{value:[(d=a.getSpacing(),{SpacingBetweenSlices:d.get(2),PixelSpacing:[d.get(1),d.get(0)]})]}}]};const S=function(e,t){const n=e.getGeometry().getSize(),i=n.getDimSize(2),r={};for(let o=0;o<n.get(2);++o){const n=Vt(e,t,o*i),a=Object.keys(n);for(const e of a)void 0===r[e]&&(r[e]={}),r[e][o]=n[e]}return r}(e,t),g=[],m=[],p=[];for(const i of t){const t=i.number,r=t-1;if(void 0===S[r])continue;const o=Object.keys(S[r]);for(let i=o.length-1;i>=0;--i){const a=Number.parseInt(o[i],10);m.push(S[r][a]);const s=e.getGeometry().getOrigins()[a],l=[s.getX(),s.getY(),s.getZ()],c={dimIndex:[t,o.length-i],imagePosPat:l,refSegmentNumber:t};if(void 0!==n){const e=n.getGeometry().worldToIndex(new R([s.getX(),s.getY(),s.getZ()]));c.derivationImages=[{sourceImages:[{referencedSOPInstanceUID:n.getImageUid(e),referencedSOPClassUID:n.getMeta().SOPClassUID}]}],p.push({ReferencedSOPInstanceUID:n.getImageUid(e),ReferencedSOPClassUID:n.getMeta().SOPClassUID})}g.push(c)}}o.NumberOfFrames=m.length.toString();const f=[];for(const e of g)f.push(Qt(e));if(o.PerFrameFunctionalGroupsSequence={value:f},void 0!==n){const e=[];e.push({ReferencedInstanceSequence:{value:p},SeriesInstanceUID:n.getMeta().SeriesInstanceUID}),o.ReferencedSeriesSequence={value:e}}void 0!==r&&function(e,t){const n=Object.keys(t);for(const r of n)void 0!==e[r]&&i.trace("Overwritting tag: "+r),e[r]=t[r]}(o,r);const y=At(o),D=s.getDimSize(2),C=m.length*D/8,v=new Te("OB");return v.tag=new le("7FE0","0010"),v.vl=C,v.value=m,y["7FE00010"]=v,y}}function zt(e){return(new St).create(e,e["7FE00010"].value[0],1)}function Wt(e){return(new Ht).create(e,e["7FE00010"].value[0])}class Yt{#me;#w;#pe;#t=new je(1,0);#fe=null;#ye=!0;#De=!0;#Ce="MONOCHROME2";#ve=0;#Ie;#Te={};#Le=null;#Pe=null;#we=null;#Oe=new He;constructor(e,t,n){this.#me=e,this.#w=t,this.#pe=n,this.#Ie=this.#w.length/this.#me.getSize().getTotalSize()}getImageUid(e){let t=this.#pe[0];return 1!==this.#pe.length&&void 0!==e&&(t=this.#pe[this.getSecondaryOffset(e)]),t}containsImageUids(e){return function(e,t){if(null===e||null===t||void 0===e||void 0===t)return!1;if(0===e.length||0===t.length||t.length>e.length)return!1;for(const n of t)if(!e.includes(n))return!1;return!0}(this.#pe,e)}getGeometry(){return this.#me}getBuffer(){return this.#w}canQuantify(){return 1===this.getNumberOfComponents()}canWindowLevel(){return this.isMonochrome()}isMonochrome(){return null!==this.getPhotometricInterpretation().match(/MONOCHROME/)}canScroll(e){const t=this.getGeometry().getSize();let n=1;return void 0!==this.#Te.numberOfFiles&&(n=this.#Te.numberOfFiles),t.canScroll(e)||1!==n}#Ae(){return this.#me.getSize().getTotalSize(2)}getSecondaryOffset(e){return this.#me.getSize().indexToOffset(e,2)}getRescaleSlopeAndIntercept(e){let t=this.#t;if(!this.isConstantRSI()){if(void 0===e)throw new Error("Cannot get non constant RSI with empty slice index.");const n=this.getSecondaryOffset(e);void 0!==this.#fe[n]?t=this.#fe[n]:i.warn("undefined non constant rsi at "+n)}return t}#be(e){return this.#fe[e]}setRescaleSlopeAndIntercept(e,t){if(this.#ye=this.#ye&&e.isID(),this.#De){if(!this.#t.equals(e))if(void 0===t)this.#t=e;else{this.#De=!1,this.#fe=[];for(let e=0,t=this.#Ae();e<t;++e)this.#fe.push(this.#t);this.#t=null,this.#fe.splice(t,0,e)}}else{if(void 0===t)throw new Error("Cannot store non constant RSI with empty slice index.");this.#fe.splice(t,0,e)}}isIdentityRSI(){return this.#ye}isConstantRSI(){return this.#De}getPhotometricInterpretation(){return this.#Ce}setPhotometricInterpretation(e){this.#Ce=e}getPlanarConfiguration(){return this.#ve}setPlanarConfiguration(e){this.#ve=e}getNumberOfComponents(){return this.#Ie}getMeta(){return this.#Te}setMeta(e){this.#Te=e}getValueAtOffset(e){return this.#w[e]}getOffsets(e){let t;if("number"==typeof e){if(1!==this.#Ie)throw new Error("Number of components is not 1 for getting single value.");t=[e]}else if(void 0!==e.r&&void 0!==e.g&&void 0!==e.b){if(3!==this.#Ie)throw new Error("Number of components is not 3 for getting RGB value.");t=[e.r,e.g,e.b]}const n=[];let i;for(let e=0;e<this.#w.length;e+=this.#Ie){i=!0;for(let n=0;n<this.#Ie;++n)if(this.#w[e+n]!==t[n]){i=!1;break}i&&n.push(e)}return n}hasValues(e){if(void 0===e||0===e.length)return[];const t=[];for(let n=0;n<e.length;++n)1===this.#Ie?t.push([e[n]]):3===this.#Ie&&t.push([e[n].r,e[n].g,e[n].b]);let n;1===this.#Ie?n=function(e,t){return e[0]===t[0]}:3===this.#Ie&&(n=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]});const i=function(e){return function(t){return n(t,e)}},r=new Array(e.length);r.fill(!1);const o=t.slice();let a,s;for(let e=0,n=this.#w.length;e<n;e+=this.#Ie){s=[];for(let n=0;n<o.length;++n){a=!0;for(let t=0;t<this.#Ie;++t)if(this.#w[e+t]!==o[n][t]){a=!1;break}a&&(r[t.findIndex(i(o[n]))]=!0,s.push(n))}for(let e=0;e<s.length;++e)o.splice(s[e],1);if(0===o.length)break}return r}clone(){const e=this.#w.slice(0),t=new Yt(this.getGeometry(),e,this.#pe);if(this.isConstantRSI())t.setRescaleSlopeAndIntercept(this.getRescaleSlopeAndIntercept());else for(let e=0;e<this.#Ae();++e)t.setRescaleSlopeAndIntercept(this.#be(e),e);return t.setPhotometricInterpretation(this.getPhotometricInterpretation()),t.setPlanarConfiguration(this.getPlanarConfiguration()),t.setMeta(this.getMeta()),t}#xe(e){let t=this.#w;if(this.#w=Me(8*this.#w.BYTES_PER_ELEMENT,this.#Te.IsSigned?1:0,e),null===this.#w)throw new Error("Cannot reallocate data for image.");this.#w.set(t),t=null}appendSlice(t){if(null===t)throw new Error("Cannot append null slice");const n=t.getGeometry().getSize();let i=this.#me.getSize();if(1!==n.get(2))throw new Error("Cannot append more than one slice");if(i.get(0)!==n.get(0))throw new Error("Cannot append a slice with different number of columns");if(i.get(1)!==n.get(1))throw new Error("Cannot append a slice with different number of rows");if(!this.#me.getOrientation().equals(t.getGeometry().getOrientation(),1e-4))throw new Error("Cannot append a slice with different orientation");if(this.#Ce!==t.getPhotometricInterpretation())throw new Error("Cannot append a slice with different photometric interpretation");for(const e in this.#Te)if("windowPresets"!==e&&"numberOfFiles"!==e&&"custom"!==e&&this.#Te[e]!==t.getMeta()[e])throw new Error("Cannot append a slice with different "+e+": "+this.#Te[e]+" != "+t.getMeta()[e]);const r=t.getDataRange(),o=this.getDataRange();this.#Le={min:Math.min(r.min,o.min),max:Math.max(r.max,o.max)};const a=t.getRescaledDataRange(),s=this.getRescaledDataRange();this.#Pe={min:Math.min(a.min,s.min),max:Math.max(a.max,s.max)};const l=t.getGeometry().getInitialTime();let c=!1;void 0===l||this.#me.hasSlicesAtTime(l)||(this.appendFrame(l,t.getGeometry().getOrigin()),i=this.#me.getSize(),c=!0);const u=function(t,n){const i=n.getInitialTime(),r=[];return r.push(0),r.push(0),r.push(t.getSliceIndex(n.getOrigin(),i)),void 0!==i&&r.push(i),new e(r)}(this.#me,t.getGeometry()),d=this.#Ie*i.getDimSize(2);if(void 0===this.#Te.numberOfFiles)throw new Error("Missing number of files for buffer manipulation.");const h=d*this.#Te.numberOfFiles;this.#w.length!==h&&this.#xe(h);const S=u.get(2);let g=S;void 0!==l&&(g+=this.#me.getCurrentNumberOfSlicesBeforeTime(l));const m=g*d,p=this.#me.getCurrentTotalNumberOfSlices()*d;m<p&&this.#w.set(this.#w.subarray(m,p),m+d),this.#w.set(t.getBuffer(),m),c||this.#me.appendOrigin(t.getGeometry().getOrigin(),S,l),this.setRescaleSlopeAndIntercept(t.getRescaleSlopeAndIntercept(),g);const f=this.#pe.length;if(this.#pe.splice(g,0,t.getImageUid()),void 0!==this.#Te.windowPresets){const e=this.#Te.windowPresets,n=t.getMeta().windowPresets,i=Object.keys(n);let r=null;for(let t=0;t<i.length;++t){r=i[t];const o=n[r],a=e[r];if(void 0!==a){if((void 0===a.perslice||!1===a.perslice)&&!a.wl[0].equals(o.wl[0])){a.perslice=!0;for(let e=0;e<f-1;++e)a.wl.push(a.wl[0])}void 0!==a.perslice&&!0===a.perslice&&e[r].wl.splice(g,0,o.wl[0])}else e[r]=n[r]}}this.#Re({type:"imagegeometrychange"})}appendFrameBuffer(e,t){const n=this.#me.getSize(),r=this.#Ie*n.getDimSize(2);if(void 0===this.#Te.numberOfFiles)throw new Error("Missing number of files for frame buffer manipulation.");const o=r*this.#Te.numberOfFiles;this.#w.length!==o&&this.#xe(o),t>=this.#Te.numberOfFiles?i.warn("Ignoring frame at index "+t+" (size: "+this.#Te.numberOfFiles+")"):(this.#w.set(e,r*t),this.appendFrame(t,new x(0,0,0)))}appendFrame(e,t){this.#me.appendFrame(t,e),this.#Re({type:"appendframe"})}getDataRange(){return this.#Le||(this.#Le=this.calculateDataRange()),this.#Le}getRescaledDataRange(){return this.#Pe||(this.#Pe=this.calculateRescaledDataRange()),this.#Pe}getHistogram(){if(!this.#we){const e=this.calculateHistogram();this.#Le=e.dataRange,this.#Pe=e.rescaledDataRange,this.#we=e.histogram}return this.#we}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};setAtOffsets(e,t){let n,i;if("number"==typeof t){if(1!==this.#Ie)throw new Error("Number of components is not 1 for setting single value.");n=[t]}else if(void 0!==t.r&&void 0!==t.g&&void 0!==t.b){if(3!==this.#Ie)throw new Error("Number of components is not 3 for setting RGB value.");n=[t.r,t.g,t.b]}for(let t=0,r=e.length;t<r;++t){i=e[t];for(let e=0;e<this.#Ie;++e)this.#w[i+e]=n[e]}this.#Re({type:"imagecontentchange"})}setAtOffsetsAndGetOriginals(e,t){const n=[];for(let i=0;i<e.length;++i){const r=e[i];let o=3*r[0],a={r:this.#w[o],g:this.#w[o+1],b:this.#w[o+2]};const s=[];s.push({index:0,colour:a});for(let e=0;e<r.length;++e){o=3*r[e];const n={r:this.#w[o],g:this.#w[o+1],b:this.#w[o+2]};a.r===n.r&&a.g===n.g&&a.b===n.b||(s.push({index:e,colour:n}),a=n),this.#w[o]=t.r,this.#w[o+1]=t.g,this.#w[o+2]=t.b}n.push(s)}return this.#Re({type:"imagecontentchange"}),n}setAtOffsetsWithIterator(e,t){for(let n=0;n<e.length;++n){const i=e[n];let r;Array.isArray(t)?r=Xe(t[n],i.length):void 0!==t.r&&void 0!==t.g&&void 0!==t.b&&(r=Xe([{index:0,colour:t}],i.length));let o=r.next();for(;!o.done;){const e=3*i[o.index];this.#w[e]=o.value.r,this.#w[e+1]=o.value.g,this.#w[e+2]=o.value.b,o=r.next()}}this.#Re({type:"imagecontentchange"})}getValue(t,n,i,r){const o=new e([t,n,i,r||0]);return this.getValueAtOffset(this.getGeometry().getSize().indexToOffset(o))}getValueAtIndex(e){return this.getValueAtOffset(this.getGeometry().getSize().indexToOffset(e))}getRescaledValue(t,n,i,r){void 0===r&&(r=0);let o=this.getValue(t,n,i,r);if(!this.isIdentityRSI())if(this.isConstantRSI())o=this.getRescaleSlopeAndIntercept().apply(o);else{const a=new e([t,n,i,r]);o=this.getRescaleSlopeAndIntercept(a).apply(o)}return o}getRescaledValueAtIndex(e){return this.getRescaledValueAtOffset(this.getGeometry().getSize().indexToOffset(e))}getRescaledValueAtOffset(e){let t=this.getValueAtOffset(e);if(!this.isIdentityRSI())if(this.isConstantRSI())t=this.getRescaleSlopeAndIntercept().apply(t);else{const n=this.getGeometry().getSize().offsetToIndex(e);t=this.getRescaleSlopeAndIntercept(n).apply(t)}return t}calculateDataRange(){let e=this.getValueAtOffset(0),t=e,n=0;const i=this.getGeometry().getSize();let r=i.getTotalSize();i.length()>=3&&(r=i.getDimSize(3));for(let i=0;i<r;++i)n=this.getValueAtOffset(i),n>t&&(t=n),n<e&&(e=n);return{min:e,max:t}}calculateRescaledDataRange(){if(this.isIdentityRSI())return this.getDataRange();if(this.isConstantRSI()){const e=this.getDataRange(),t=this.getRescaleSlopeAndIntercept().apply(e.min),n=this.getRescaleSlopeAndIntercept().apply(e.max);return{min:t<n?t:n,max:t>n?t:n}}{let e=this.getRescaledValueAtOffset(0),t=e,n=0;const i=this.getGeometry().getSize();let r=i.getTotalSize();3===i.length()&&(r=i.getDimSize(3));for(let i=0;i<r;++i)n=this.getRescaledValueAtOffset(i),n>t&&(t=n),n<e&&(e=n);return{min:e,max:t}}}calculateHistogram(){const e=this.getGeometry().getSize(),t=[];let n=this.getValueAtOffset(0),i=n,r=0,o=this.getRescaledValueAtOffset(0),a=o,s=0;for(let l=0,c=e.getTotalSize();l<c;++l)r=this.getValueAtOffset(l),r>i&&(i=r),r<n&&(n=r),s=this.getRescaledValueAtOffset(l),s>a&&(a=s),s<o&&(o=s),t[s]=(t[s]||0)+1;const l={min:n,max:i},c={min:o,max:a},u=[];for(let e=o;e<=a;++e)u.push([e,t[e]||0]);return{dataRange:l,rescaledDataRange:c,histogram:u}}convolute2D(e){if(9!==e.length)throw new Error("The convolution matrix does not have a length of 9; it has "+e.length);const t=this.clone(),n=t.getBuffer(),i=this.getGeometry().getSize(),r=i.getDimSize(2)*this.getNumberOfComponents();for(let t=0;t<i.get(2);++t)this.convoluteBuffer(e,n,t*r);return t}convoluteBuffer(e,t,n){const i=this.getGeometry().getSize(),r=i.get(0),o=i.get(1),a=this.getNumberOfComponents();let s=1,l=1;3===a&&(0===this.getPlanarConfiguration()?s=3:l=i.getDimSize(2));const c=[];c[0]=(-r-1)*s,c[1]=-r*s,c[2]=(1-r)*s,c[3]=-s,c[4]=0,c[5]=1*s,c[6]=(r-1)*s,c[7]=r*s,c[8]=(r+1)*s;const u=[];u[0]=c[4],u[1]=c[4],u[2]=c[5],u[3]=c[4],u[4]=c[4],u[5]=c[5],u[6]=c[7],u[7]=c[7],u[8]=c[8];const d=[];d[0]=c[1],d[1]=c[1],d[2]=c[2],d[3]=c[4],d[4]=c[4],d[5]=c[5],d[6]=c[7],d[7]=c[7],d[8]=c[8];const h=[];h[0]=c[1],h[1]=c[1],h[2]=c[2],h[3]=c[4],h[4]=c[4],h[5]=c[5],h[6]=c[4],h[7]=c[4],h[8]=c[5];const S=[];S[0]=c[3],S[1]=c[4],S[2]=c[5],S[3]=c[3],S[4]=c[4],S[5]=c[5],S[6]=c[6],S[7]=c[7],S[8]=c[8];const g=[];g[0]=c[0],g[1]=c[1],g[2]=c[2],g[3]=c[3],g[4]=c[4],g[5]=c[5],g[6]=c[3],g[7]=c[4],g[8]=c[5];const m=[];m[0]=c[3],m[1]=c[4],m[2]=c[4],m[3]=c[3],m[4]=c[4],m[5]=c[4],m[6]=c[6],m[7]=c[7],m[8]=c[7];const p=[];p[0]=c[0],p[1]=c[1],p[2]=c[1],p[3]=c[3],p[4]=c[4],p[5]=c[4],p[6]=c[6],p[7]=c[7],p[8]=c[7];const f=[];f[0]=c[0],f[1]=c[1],f[2]=c[1],f[3]=c[3],f[4]=c[4],f[5]=c[4],f[6]=c[3],f[7]=c[4],f[8]=c[4];let y=n,D=0,C=[];for(let n=0;n<a;++n){y+=n*l;for(let n=0;n<o;++n)for(let i=0;i<r;++i){C=c,0===i&&0===n?C=u:0===i&&n===o-1?C=h:i===r-1&&0===n?C=m:i===r-1&&n===o-1?C=f:0===i&&n!==o-1&&0!==n?C=d:i===r-1&&n!==o-1&&0!==n?C=p:0!==i&&i!==r-1&&0===n?C=S:0!==i&&i!==r-1&&n===o-1&&(C=g),D=0;for(let t=0;t<9;++t)D+=this.getValueAtOffset(y+C[t])*e[t];t[y]=D,y+=s}}}transform(e){const t=this.clone(),n=t.getBuffer();for(let i=0,r=n.length;i<r;++i)n[i]=e(t.getValueAtOffset(i));return t}compose(e,t){const n=this.clone(),i=n.getBuffer();for(let n=0,r=i.length;n<r;++n)i[n]=Math.floor(t(this.getValueAtOffset(n),e.getValueAtOffset(n)));return n}}class Xt{create(e,t){const n=new _t(t);"MONOCHROME1"===t.getPhotometricInterpretation()?n.setColourMap("invPlain"):"PALETTE COLOR"===t.getPhotometricInterpretation()&&(void 0!==g.palette?n.setColourMap("palette"):i.warn("Cannot find Palette lut"));let o={};if(void 0!==t.getMeta().windowPresets&&(o=t.getMeta().windowPresets),o.minmax={name:"minmax"},void 0!==s){const e=t.getMeta().Modality;for(const t in s[e]){const n=s[e][t];o[t]={wl:[new r(n.center,n.width)],name:t}}}return n.setWindowPresets(o),n.init(),n}}const jt=["wlchange","wlpresetadd","colourmapchange","positionchange","opacitychange","alphafuncchange"];function Zt(e,t){return(new Xt).create(e,t)}class _t{#Fe;#Ee;#De;#qe={minmax:{name:"minmax"}};#Ue=null;#Me;#Qe="plain";#Be=null;#_;#Oe=new He;constructor(t){this.#Fe=t,this.#Fe.addEventListener("appendframe",(()=>{const t=this.getCurrentIndex();if(3===t.length()){const n=t.getValues();n.push(0),this.setCurrentIndex(new e(n))}}))}getImage(){return this.#Fe}setImage(e){this.#Fe=e}getOrientation(){return this.#_}setOrientation(e){this.#_=e}init(){this.setInitialIndex()}setInitialIndex(){const t=this.#Fe.getGeometry().getSize(),n=new Array(t.length());n.fill(0),n[0]=Math.floor(t.get(0)/2),n[1]=Math.floor(t.get(1)/2),n[2]=Math.floor(t.get(2)/2),this.setCurrentIndex(new e(n),!0)}getPlaybackMilliseconds(e){return e||(e=10),Math.round(1e3/e)}#Ne=function(e,t){return 255};getAlphaFunction(){return this.#Ne}setAlphaFunction(e){this.#Ne=e,this.#Re({type:"alphafuncchange"})}#Ve(){if(this.#Ue&&void 0!==this.#qe[this.#Ue]&&void 0!==this.#qe[this.#Ue].perslice&&!0===this.#qe[this.#Ue].perslice){this.getCurrentIndex()||this.setInitialIndex();const e=this.getCurrentIndex(),t=this.#Fe.getSecondaryOffset(e),n=this.#qe[this.#Ue].wl[t];this.setWindowLevel(n,this.#Ue,!0)}if(void 0===this.#Me&&this.setWindowLevelPresetById(0,!0),void 0===this.#De||this.#Fe.isConstantRSI()!==this.#De){let e,t;this.#De=this.#Fe.isConstantRSI(),this.#De?(e=this.#Fe.getRescaleSlopeAndIntercept(),t=!0):(e=new je(1,0),t=!1);const i=new n(e,this.#Fe.getMeta().BitsStored);this.#Ee=new c(i,this.#Fe.getMeta().IsSigned,t)}const e=this.#Ee.getVoiLut();let t;if(void 0!==e&&(t=e.getWindowLevel()),void 0===e||!this.#Me.equals(t)){const e=new l(this.#Me);this.#Ee.setVoiLut(e)}return this.#Ee}getWindowPresets(){return this.#qe}getWindowPresetsNames(){return Object.keys(this.#qe)}setWindowPresets(e){this.#qe=e}addWindowPresets(e){const t=Object.keys(e);let n=null;for(let i=0;i<t.length;++i)if(n=t[i],void 0!==this.#qe[n]){if(void 0!==this.#qe[n].perslice&&!0===this.#qe[n].perslice)throw new Error("Cannot add perslice preset");this.#qe[n]=e[n]}else this.#qe[n]=e[n],this.#Re({type:"wlpresetadd",name:n})}getCurrentWindowPresetName(){return this.#Ue}getColourMap(){return this.#Qe}#Ge(){return g[this.#Qe]}setColourMap(e){if(!g[e])throw new Error("Unknown colour map: '"+e+"'");this.#Qe=e,this.#Re({type:"colourmapchange",value:[e]})}getCurrentPosition(){return this.#Be}getCurrentIndex(){const e=this.getCurrentPosition();return e?this.getImage().getGeometry().worldToIndex(e):null}isPositionInBounds(e){void 0===e&&(e=this.#Be);const t=this.#Fe.getGeometry(),n=t.worldToIndex(e),i=[this.getScrollIndex()];return 4===n.length()&&i.push(3),t.isIndexInBounds(n,i)}getOrigin(e){const t=this.#Fe.getGeometry();let n=0;return void 0!==e&&(n=t.worldToIndex(e).get(2)),t.getOrigins()[n]}setCurrentPosition(e,t){const n=this.#Fe.getGeometry(),i=n.worldToIndex(e),r=[this.getScrollIndex()];return 4===i.length()&&r.push(3),n.isIndexInBounds(i,r)?this.setCurrentIndex(i,t):(t||(this.#Be=e,this.#Re({type:"positionchange",value:[i.getValues(),e.getValues()],valid:!1})),!1)}setCurrentIndex(e,t){void 0===t&&(t=!1);const n=this.#Fe.getGeometry(),i=n.indexToWorld(e),r=[this.getScrollIndex()];if(4===e.length()&&r.push(3),!n.isIndexInBounds(e,r))return t||(this.#Be=i,this.#Re({type:"positionchange",value:[e.getValues(),i.getValues()],valid:!1})),!1;let o=null,a=null;if(this.getCurrentPosition()&&(a=this.getCurrentIndex()),a)if(a.canCompare(e))o=a.compare(e);else{o=[];const t=Math.min(a.length(),e.length());for(let n=0;n<t;++n)a.get(n)!==e.get(n)&&o.push(n);const n=Math.max(a.length(),e.length());for(let e=t;e<n;++e)o.push(e)}else{o=[];for(let t=0;t<e.length();++t)o.push(t)}if(this.#Be=i,!t){const t={type:"positionchange",value:[e.getValues(),i.getValues()],diffDims:o,data:{imageUid:this.#Fe.getImageUid(e)}};if(this.#Fe.canQuantify()){const n=this.#Fe.getRescaledValueAtIndex(e);t.value.push(n)}this.#Re(t)}return!0}setWindowLevel(e,t,n){if(void 0===t&&(t="manual"),"manual"!==t&&void 0===this.#qe[t])throw new Error("Unknown window level preset: '"+t+"'");void 0===n&&(n=!1);const i=!e.equals(this.#Me),r=this.#Ue!==t;(i||r)&&(this.#Me=e,this.#Ue=t,"manual"===t&&(void 0!==this.#qe[t]?this.#qe[t].wl[0]=e:this.addWindowPresets({manual:{wl:[e],name:"manual"}})),this.#Re({type:"wlchange",value:[e.center,e.width,t],wc:e.center,ww:e.width,skipGenerate:n}))}getWindowLevel(){return this.#Ve().getVoiLut().getWindowLevel()}setWindowLevelPreset(e,t){const n=this.getWindowPresets()[e];if(void 0===n)throw new Error("Unknown window level preset: '"+e+"'");"minmax"===e&&void 0===n.wl&&(n.wl=[this.getWindowLevelMinMax()]);let i=n.wl[0];if(void 0!==n.perslice&&!0===n.perslice){const e=this.#Fe.getSecondaryOffset(this.getCurrentIndex());i=n.wl[e]}this.setWindowLevel(i,e,t)}setWindowLevelPresetById(e,t){const n=Object.keys(this.getWindowPresets());this.setWindowLevelPreset(n[e],t)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};getWindowLevelMinMax(){const e=this.getImage().getRescaledDataRange(),t=e.min;let n=e.max-t;return n<1&&(i.warn("Zero or negative window width, defaulting to one."),n=1),new r(t+n/2,n)}setWindowLevelMinMax(){const e=this.getWindowLevelMinMax();this.setWindowLevel(e,"minmax")}generateImageData(e,t){void 0===t&&(this.getCurrentIndex()||this.setInitialIndex(),t=this.getCurrentIndex());const n=this.getImage(),r=!n.isConstantRSI(),o=Ye(n,t,r,this.getOrientation()),a=n.getPhotometricInterpretation();switch(a){case"MONOCHROME1":case"MONOCHROME2":!function(e,t,n,i,r){let o=0,a=0,s=t.next();for(;!s.done;)a=i.getValue(s.value),e.data[o]=r.red[a],e.data[o+1]=r.green[a],e.data[o+2]=r.blue[a],e.data[o+3]=n(s.value,s.index),o+=4,s=t.next()}(e,o,this.getAlphaFunction(),this.#Ve(),this.#Ge());break;case"PALETTE COLOR":!function(e,t,n,r,o){const a=function(e){return e>>8};o&&i.info("Scaling 16bits data to 8bits.");let s=0,l=0,c=t.next();for(;!c.done;)l=c.value,o?(e.data[s]=a(r.red[l]),e.data[s+1]=a(r.green[l]),e.data[s+2]=a(r.blue[l])):(e.data[s]=r.red[l],e.data[s+1]=r.green[l],e.data[s+2]=r.blue[l]),e.data[s+3]=n(l,c.index),s+=4,c=t.next()}(e,o,this.getAlphaFunction(),this.#Ge(),16===n.getMeta().BitsStored);break;case"RGB":!function(e,t,n){let i=0,r=t.next();for(;!r.done;)e.data[i]=r.value[0],e.data[i+1]=r.value[1],e.data[i+2]=r.value[2],e.data[i+3]=n(r.value,r.index),i+=4,r=t.next()}(e,o,this.getAlphaFunction());break;case"YBR_FULL":!function(e,t,n){let i=0,r=null,o=t.next();for(;!o.done;)a=o.value[0],s=o.value[1],r={r:a+1.402*((l=o.value[2])-128),g:a-.34414*(s-128)-.71414*(l-128),b:a+1.772*(s-128)},e.data[i]=r.r,e.data[i+1]=r.g,e.data[i+2]=r.b,e.data[i+3]=n(o.value,o.index),i+=4,o=t.next();var a,s,l}(e,o,this.getAlphaFunction());break;default:throw new Error("Unsupported photometric interpretation: "+a)}}getScrollIndex(){let e=null;const t=this.getOrientation();return e=void 0!==t?t.getThirdColMajorDirection():2,e}}class Kt{#X;#ke;#He;#ze;constructor(e,t,n){this.#X=e,this.#ke=t,this.#He=n,this.#ze=function(e,t){let n=e.asOneAndZeros().multiply(t);return e.asOneAndZeros().getAbs().equals(ye().getAbs())&&(n=n.getAbs()),n}(t,n)}getOffset3DFromPlaneOffset(e){const t=new T(e.x,e.y,0),n=this.getTargetDeOrientedVector3D(t);return new T(n.getX()*this.#X.get(0),n.getY()*this.#X.get(1),n.getZ()*this.#X.get(2))}getPlaneOffsetFromOffset3D(e){const t=new T(e.x/this.#X.get(0),e.y/this.#X.get(1),e.z/this.#X.get(2)),n=this.getTargetOrientedVector3D(t);return{x:n.getX(),y:n.getY()}}getTargetOrientedVector3D(e){let t=e;return void 0!==this.#ze&&(t=this.#ze.getInverse().multiplyVector3D(e)),t}getTargetDeOrientedVector3D(e){let t=e;return void 0!==this.#ze&&(t=this.#ze.multiplyVector3D(e)),t}getTargetDeOrientedPoint3D(e){let t=e;return void 0!==this.#ze&&(t=this.#ze.multiplyPoint3D(e)),t}getImageOrientedVector3D(e){let t=e;if(void 0!==this.#He){const n=ot([e.getX(),e.getY(),e.getZ()],this.#He);t=new T(n[0],n[1],n[2])}return t}getImageOrientedPoint3D(e){let t=e;if(void 0!==this.#He){const n=ot([e.getX(),e.getY(),e.getZ()],this.#He);t=new x(n[0],n[1],n[2])}return t}getImageDeOrientedVector3D(e){let t=e;if(void 0!==this.#He){const n=rt([e.getX(),e.getY(),e.getZ()],this.#He);t=new T(n[0],n[1],n[2])}return t}getImageDeOrientedPoint3D(e){let t=e;if(void 0!==this.#He){const n=rt([e.getX(),e.getY(),e.getZ()],this.#He);t=new x(n[0],n[1],n[2])}return t}getTargetOrientedPositiveXYZ(e){const t=rt([e.x,e.y,e.z],this.#ze);return{x:t[0],y:t[1],z:t[2]}}getScrollIndex(){let e=null;return e=void 0!==this.#He?this.#He.getThirdColMajorDirection():2,e}getNativeScrollIndex(){let e=null;return e=void 0!==this.#ke?this.#ke.getThirdColMajorDirection():2,e}}class Jt{#x;#We;#Ye;#Qe="plain";#Xe;#je=!1;constructor(e,t){if(void 0===e.getImage())throw new Error("View does not have an image, cannot setup controller");this.#x=e,this.#We=t,this.#Ye=new Kt(e.getImage().getGeometry().getRealSpacing(),e.getImage().getGeometry().getOrientation(),e.getOrientation()),"SEG"===e.getImage().getMeta().Modality&&(this.#je=!0)}#Oe=new He;getPlaneHelper(){return this.#Ye}isMask(){return this.#je}initialise(){this.setWindowLevelPresetById(0),this.setCurrentPosition(this.getPositionFromPlanePoint(new b(0,0)))}getModality(){return this.#x.getImage().getMeta().Modality}getWindowLevelPresetsNames(){return this.#x.getWindowPresetsNames()}addWindowLevelPresets(e){return this.#x.addWindowPresets(e)}setWindowLevelPreset(e){this.#x.setWindowLevelPreset(e)}setWindowLevelPresetById(e){this.#x.setWindowLevelPresetById(e)}isPlaying(){return void 0!==this.#Xe}getCurrentPosition(){return this.#x.getCurrentPosition()}getCurrentIndex(){return this.#x.getCurrentIndex()}getCurrentOrientedIndex(){let t=this.#x.getCurrentIndex();if(void 0!==this.#x.getOrientation()){const n=this.#Ye.getImageDeOrientedVector3D(new T(t.get(0),t.get(1),t.get(2)));t=new e([n.getX(),n.getY(),n.getZ()])}return t}getScrollIndex(){return this.#x.getScrollIndex()}getCurrentScrollIndexValue(){return this.#x.getCurrentIndex().get(this.#x.getScrollIndex())}getOrigin(e){return this.#x.getOrigin(e)}getCurrentScrollPosition(){const e=this.#x.getScrollIndex();return this.#x.getCurrentPosition().get(e)}generateImageData(e,t){this.#x.generateImageData(e,t)}setImage(e,t){this.#x.setImage(e),this.#We=t}get2DSpacing(){return this.#x.getImage().getGeometry().getSpacing(this.#x.getOrientation()).get2D()}getRescaledImageValue(e){const t=this.#x.getImage();if(!t.canQuantify())return;const n=t.getGeometry(),i=n.worldToIndex(e);let r;return n.isIndexInBounds(i)&&(r=t.getRescaledValueAtIndex(i)),r}getPixelUnit(){return this.#x.getImage().getMeta().pixelUnit}#Ze(e,t,n,i){const r=We(Ye(e,t,n,i)),o=e.getGeometry().getSize(i).getValues();o[2]=1;const a=new Ze(o),s=e.getGeometry().getSpacing(i).getValues();s[2]=1;const l=new nt(s),c=new x(0,0,0),u=new it(c,a,l);return new Yt(u,r)}getImageRegionValues(t,n){let i=this.#x.getImage();const r=this.#x.getOrientation();let o=this.getCurrentIndex(),a=!0;A(r)||(i=this.#Ze(i,o,a,r),o=new e([0,0,0]),a=!1);const s=function(e,t,n,i,r){if(1!==e.getNumberOfComponents())throw new Error("Unsupported number of components for region iterator: "+e.getNumberOfComponents());void 0===n&&(n=!1);let o=null;o=n?function(t){return e.getRescaledValueAtOffset(t)}:function(t){return e.getValueAtOffset(t)};const a=e.getGeometry().getSize();void 0===i&&(i=new b(0,0)),void 0===r&&(r=new b(a.get(0)-1,a.get(1)));const s=a.indexToOffset(t.getWithNew2D(i.getX(),i.getY())),l=a.indexToOffset(t.getWithNew2D(r.getX(),r.getY()-1)),c=Math.max(1,r.getX()-i.getX());return function(e,t,n,i,r,o){let a=t,s=0;return{next:function(){if(a<n){const t={value:e(a),done:!1,index:a};return s+=1,a+=1,s===r&&(s=0,a+=o),t}return{done:!0,index:n}}}}(o,s,l+1,0,c,a.get(0)-c)}(i,o,a,t,n);let l=[];return s&&(l=We(s)),l}getImageVariableRegionValues(t){let n=this.#x.getImage();const i=this.#x.getOrientation();let r=this.getCurrentIndex(),o=!0;A(i)||(n=this.#Ze(n,r,o,i),r=new e([0,0,0]),o=!1);const a=function(e,t,n,i){if(1!==e.getNumberOfComponents())throw new Error("Unsupported number of components for region iterator: "+e.getNumberOfComponents());void 0===n&&(n=!1);let r=null;r=n?function(t){return e.getRescaledValueAtOffset(t)}:function(t){return e.getValueAtOffset(t)};const o=e.getGeometry().getSize(),a=[];let s,l=null,c=null,u=null;for(let e=0;e<i.length;++e){s=i[e];const t=s[1][0]-s[0][0];0!==t&&(u=e,l||(l=s[0]),a.push([s[0][0],t,o.get(0)-s[1][0]]))}if(null!==u&&(c=i[u][1]),0!==a.length)return function(e,t,n,i,r){let o=t,a=0,s=0;return{next:function(){if(o<n){const t={value:e(o),done:!1,index:o};return s+=1,o+=1,s===r[a][1]&&(s=0,o+=r[a][2],a+=1,a<r.length&&(o+=r[a][0])),t}return{done:!0,index:n}}}}(r,o.indexToOffset(t.getWithNew2D(l[0],l[1])),o.indexToOffset(t.getWithNew2D(c[0],c[1]))+1,0,a)}(n,r,o,t);let s=[];return a&&(s=We(a)),s}canQuantifyImage(){return this.#x.getImage().canQuantify()}canWindowLevel(){return this.isMonochrome()}isMonochrome(){return this.#x.getImage().isMonochrome()}canScroll(){return this.#x.getImage().canScroll(this.#x.getOrientation())}getImageSize(){return this.#x.getImage().getGeometry().getSize(this.#x.getOrientation())}moreThanOne(e){return this.getImageSize().moreThanOne(e)}getImageWorldSize(){const e=this.#x.getImage().getGeometry(),t=e.getSize(this.#x.getOrientation()).get2D(),n=e.getSpacing(this.#x.getOrientation()).get2D();return{x:t.x*n.x,y:t.y*n.y}}getImageRescaledDataRange(){return this.#x.getImage().getRescaledDataRange()}equalImageMeta(e){const t=this.#x.getImage().getMeta(),n=Object.keys(e);for(let i=0;i<n.length;++i){const r=n[i];if(void 0===t[r])return!1;if(t[r]!==e[r])return!1}return!0}isPositionInBounds(e){return this.#x.isPositionInBounds(e)}setCurrentPosition(e,t){return this.#x.setCurrentPosition(e,t)}getPositionFromPlanePoint(e){const t=this.getCurrentScrollIndexValue(),n=new x(e.getX(),e.getY(),t),i=this.#Ye.getImageOrientedPoint3D(n),r=this.#x.getImage().getGeometry().pointToWorld(i);return this.getCurrentPosition().mergeWith3D(r)}getPlanePositionFromPosition(e){const t=this.#x.getImage().getGeometry().worldToPoint(e),n=this.#Ye.getImageDeOrientedPoint3D(t);return new b(n.getX(),n.getY())}setCurrentIndex(e,t){return this.#x.setCurrentIndex(e,t)}getPlanePositionFromPlanePoint(e){const t=this.getCurrentScrollIndexValue(),n=new x(e.getX(),e.getY(),t),i=this.#Ye.getTargetDeOrientedPoint3D(n),r=this.#x.getImage().getGeometry().getRealSpacing();return new x(i.getX()*r.get(0),i.getY()*r.get(1),i.getZ()*r.get(2))}getOffset3DFromPlaneOffset(e){return this.#Ye.getOffset3DFromPlaneOffset(e)}#_e(t){const n=this.getCurrentIndex(),i=new Array(n.length());i.fill(0),t<i.length?i[t]=1:console.warn("Cannot increment given index: ",t,i.length);const r=new e(i);return n.add(r)}#Ke(t){const n=this.getCurrentIndex(),i=new Array(n.length());i.fill(0),t<i.length?i[t]=-1:console.warn("Cannot decrement given index: ",t,i.length);const r=new e(i);return n.add(r)}#Je(){return this.#_e(this.getScrollIndex())}#$e(){return this.#Ke(this.getScrollIndex())}getIncrementPosition(e){return this.#x.getImage().getGeometry().indexToWorld(this.#_e(e))}getDecrementPosition(e){return this.#x.getImage().getGeometry().indexToWorld(this.#Ke(e))}getIncrementScrollPosition(){return this.#x.getImage().getGeometry().indexToWorld(this.#Je())}getDecrementScrollPosition(){return this.#x.getImage().getGeometry().indexToWorld(this.#$e())}incrementIndex(e,t){return this.setCurrentIndex(this.#_e(e),t)}decrementIndex(e,t){return this.setCurrentIndex(this.#Ke(e),t)}decrementScrollIndex(e){return this.setCurrentIndex(this.#$e(),e)}incrementScrollIndex(e){return this.setCurrentIndex(this.#Je(),e)}play(){if(this.canScroll())if(void 0===this.#Xe){const t=this.#x.getImage(),n=t.getMeta().RecommendedDisplayFrameRate,i=this.#x.getPlaybackMilliseconds(n),r=t.getGeometry().getSize().canScroll3D();this.#Xe=window.setInterval((()=>{let t=!1;if(t=r?this.incrementScrollIndex():this.incrementIndex(3),!t){const t=this.getCurrentIndex().getValues(),n=this.#x.getOrientation();r?t[n.getThirdColMajorDirection()]=0:t[3]=0;const i=new e(t),o=this.#x.getImage().getGeometry();this.setCurrentPosition(o.indexToWorld(i))}}),i)}else this.stop()}stop(){void 0!==this.#Xe&&(clearInterval(this.#Xe),this.#Xe=void 0)}getWindowLevel(){return this.#x.getWindowLevel()}getCurrentWindowPresetName(){return this.#x.getCurrentWindowPresetName()}setWindowLevel(e){this.#x.setWindowLevel(e)}getColourMap(){return this.#x.getColourMap()}setColourMap(e){this.#x.setColourMap(e)}setViewAlphaFunction(e){this.#x.setAlphaFunction(e)}bindImageAndLayer(e){const t=this.#x.getImage();t.addEventListener("imagecontentchange",e.onimagecontentchange),t.addEventListener("imagegeometrychange",e.onimagegeometrychange)}unbindImageAndLayer(e){const t=this.#x.getImage();t.removeEventListener("imagecontentchange",e.onimagecontentchange),t.removeEventListener("imagegeometrychange",e.onimagegeometrychange)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{e.dataid=this.#We,this.#Oe.fireEvent(e)}}const $t=["mousedown","mousemove","mouseup","mouseout","wheel","dblclick","touchstart","touchmove","touchend"],en={openRoiDialog(e,t){const n=prompt("Label",e.textExpr);null!==n&&(e.textExpr=n,t(e))}};function tn(e){let t=0,n=0;if(0!==e.length&&void 0!==e[0].target){let i=e[0].target.offsetParent;for(;i;)isNaN(i.offsetLeft)||(t+=i.offsetLeft),isNaN(i.offsetTop)||(n+=i.offsetTop),i=i.offsetParent}else i.debug("No touch target offset parent.");const r=[];for(let i=0;i<e.length;++i)r.push(new b(e[i].pageX-t,e[i].pageY-n));return r}function nn(e){let t=[];return void 0!==e.targetTouches&&0!==e.targetTouches.length?t=tn(e.targetTouches):void 0!==e.changedTouches&&0!==e.changedTouches.length&&(t=tn(e.changedTouches)),t}function rn(e){return new b(e.offsetX,e.offsetY)}function on(e,t){const n=document.createElement("canvas");n.width=e,n.height=t;const i=document.createElement("canvas");i.width=1,i.height=1;const r=n.getContext("2d"),o=i.getContext("2d");return r&&(r.fillRect(e-1,t-1,1,1),o.drawImage(n,e-1,t-1,1,1,0,0,1,1)),o&&0!==o.getImageData(0,0,1,1).data[3]}class an{#et;#tt=null;#nt=null;#it=null;#rt=null;#ot=!0;#at=null;#st;#lt;#ct=1;#ut={x:1,y:1};#dt={x:1,y:1};#ht={x:1,y:1,z:1};#St={x:0,y:0};#gt={x:0,y:0};#mt={x:0,y:0};#pt={x:0,y:0};#ft={x:0,y:0};#yt=null;#We;#Oe=new He;#Dt=!1;#Ct;#vt;constructor(e){this.#et=e,this.#et.className+=" viewLayer"}getDataId(){return this.#We}getScale(){return this.#ut}getAbsoluteZoomOffset(){return{x:this.#pt.x*this.#dt.x,y:this.#pt.y*this.#dt.y}}setImageSmoothing(e){this.#Dt=e}setView(e,t){this.#We=t,e.addEventListener("wlchange",this.#It),e.addEventListener("colourmapchange",this.#Tt),e.addEventListener("positionchange",this.#Lt),e.addEventListener("alphafuncchange",this.#Pt);for(let t=0;t<jt.length;++t)e.addEventListener(jt[t],this.#Re);this.#tt=new Jt(e,t),this.bindImage()}getViewController(){return this.#tt}getImageData(){return this.#at}onimageset=e=>{this.#We===e.dataid&&(this.#tt.setImage(e.value[0],this.#We),this.#wt(this.#tt.getImageSize().get2D()),this.#yt=!0)};bindImage(){this.#tt&&this.#tt.bindImageAndLayer(this)}unbindImage(){this.#tt&&this.#tt.unbindImageAndLayer(this)}onimagecontentchange=e=>{this.#We===e.dataid&&(this.#ot=this.#tt.isPositionInBounds(),this.#yt=!0,this.draw())};onimagegeometrychange=e=>{if(this.#We===e.dataid){const e=this.#tt.getImageSize().get2D();if(this.#st.x!==e.x||this.#st.y!==e.y){if(void 0!==this.#Ct&&void 0!==this.#vt){const e=this.#tt.getOrigin(),t=this.#vt.minus(e),n=this.#tt.getOrigin(this.#tt.getCurrentPosition()),i=this.#Ct.minus(n);this.setBaseOffset(t,i)}this.#wt(e),this.#yt=!0,this.draw()}}};getId(){return this.#et.id}removeFromDOM(){this.#et.remove()}getBaseSize(){return this.#st}getImageWorldSize(){return this.#tt.getImageWorldSize()}getOpacity(){return this.#ct}setOpacity(e){if(e===this.#ct)return;this.#ct=Math.min(Math.max(e,0),1);const t={type:"opacitychange",value:[this.#ct]};this.#Re(t)}addFlipOffsetX(){this.#ft.x+=this.#nt.width/this.#ut.x,this.#St.x+=this.#ft.x}addFlipOffsetY(){this.#ft.y+=this.#nt.height/this.#ut.y,this.#St.y+=this.#ft.y}flipScaleX(){this.#ht.x*=-1}flipScaleY(){this.#ht.y*=-1}flipScaleZ(){this.#ht.z*=-1}setScale(e,t){const n=this.#tt.getPlaneHelper(),i=n.getTargetOrientedPositiveXYZ({x:e.x*this.#ht.x,y:e.y*this.#ht.y,z:e.z*this.#ht.z}),r={x:this.#dt.x*i.x,y:this.#dt.y*i.y};if(1===Math.abs(e.x)&&1===Math.abs(e.y)&&1===Math.abs(e.z)){const e={x:this.#St.x-this.#pt.x,y:this.#St.y-this.#pt.y};this.#pt={x:0,y:0},this.#St=e}else if(void 0!==t){let e=n.getPlaneOffsetFromOffset3D({x:t.getX(),y:t.getY(),z:t.getZ()});e={x:e.x+this.#gt.x,y:e.y+this.#gt.y};const i=wn(this.#St,this.#ut,r,e),o={x:this.#pt.x+i.x-this.#St.x,y:this.#pt.y+i.y-this.#St.y};this.#pt=o,this.#St=i}this.#ut=r}initScale(e,t){const n=this.#tt.getPlaneHelper().getTargetOrientedPositiveXYZ({x:e.x*this.#ht.x,y:e.y*this.#ht.y,z:e.z*this.#ht.z}),i={x:this.#dt.x*n.x,y:this.#dt.y*n.y};this.#ut=i,this.#pt={x:t.x/this.#dt.x,y:t.y/this.#dt.y},this.#St={x:this.#St.x+this.#pt.x,y:this.#St.y+this.#pt.y}}setBaseOffset(e,t,n,i){const r=this.#tt.getPlaneHelper(),o=r.getNativeScrollIndex(),a=r.getPlaneOffsetFromOffset3D({x:0===o?e.getX():t.getX(),y:1===o?e.getY():t.getY(),z:2===o?e.getZ():t.getZ()}),s=this.#gt.x!==a.x||this.#gt.y!==a.y;return void 0!==n&&void 0!==i&&(this.#Ct=n,this.#vt=i),s&&(this.#St={x:this.#St.x-this.#gt.x+a.x,y:this.#St.y-this.#gt.y+a.y},this.#gt=a),s}setOffset(e){const t=this.#tt.getPlaneHelper().getPlaneOffsetFromOffset3D(e);this.#St={x:t.x+this.#mt.x+this.#gt.x+this.#pt.x+this.#ft.x,y:t.y+this.#mt.y+this.#gt.y+this.#pt.y+this.#ft.y}}displayToPlaneIndex(t){const n=this.displayToPlanePos(t);return new e([Math.floor(n.getX()),Math.floor(n.getY())])}displayToPlaneScale(e){return new b(e.getX()/this.#ut.x,e.getY()/this.#ut.y)}displayToPlanePos(e){const t=this.displayToPlaneScale(e);return new b(t.getX()+this.#St.x,t.getY()+this.#St.y)}planePosToDisplay(e){let t=(e.getX()-this.#St.x+this.#gt.x)*this.#ut.x,n=(e.getY()-this.#St.y+this.#gt.y)*this.#ut.y;return(t<0||t>=this.#nt.width)&&(t=void 0),(n<0||n>=this.#nt.height)&&(n=void 0),new b(t,n)}displayToMainPlanePos(e){const t=this.displayToPlanePos(e);return new b(t.getX()-this.#gt.x,t.getY()-this.#gt.y)}display(e){this.#et.style.display=e?"":"none"}isVisible(){return""===this.#et.style.display}draw(){if(!this.#ot)return;let e={type:"renderstart",layerid:this.getId(),dataid:this.getDataId()};this.#Re(e),this.#yt&&this.#Ot(),this.#rt.globalAlpha=this.#ct,this.clear(),this.#rt.setTransform(this.#ut.x,0,0,this.#ut.y,-1*this.#St.x*this.#ut.x,-1*this.#St.y*this.#ut.y),this.#rt.imageSmoothingEnabled=this.#Dt,this.#rt.drawImage(this.#it,0,0),e={type:"renderend",layerid:this.getId(),dataid:this.getDataId()},this.#Re(e)}initialise(e,t,n){this.#lt=t,this.#ct=Math.min(Math.max(n,0),1),this.#nt=document.createElement("canvas"),this.#et.appendChild(this.#nt),this.#nt.getContext?(this.#rt=this.#nt.getContext("2d"),this.#rt?(this.#it=document.createElement("canvas"),this.#wt(e),this.#yt=!0):alert("Error: failed to get the 2D context.")):alert("Error: no canvas.getContext method.")}#wt(e){if(!on(e.x,e.y))throw new Error("Cannot create canvas with size "+e.x+", "+e.y);this.#st=e,this.#it.width=this.#st.x,this.#it.height=this.#st.y,this.#rt.clearRect(0,0,this.#st.x,this.#st.y),this.#at=this.#rt.createImageData(this.#st.x,this.#st.y)}fitToContainer(e,t,n){let i=!1;if(this.#nt.width!==e.x||this.#nt.height!==e.y){if(!on(e.x,e.y))throw new Error("Cannot resize canvas "+e.x+", "+e.y);this.#nt.width=e.x,this.#nt.height=e.y,i=!0}const r={x:t*this.#lt.x,y:t*this.#lt.y},o={x:this.#ut.x*r.x/this.#dt.x,y:this.#ut.y*r.y/this.#dt.y};this.#ut.x===o.x&&this.#ut.y===o.y||(this.#dt=r,this.#ut=o,i=!0);const a={x:n.x/r.x,y:n.y/r.y},s={x:e.x/r.x,y:e.y/r.y},l={x:0!==this.#ft.x?s.x:0,y:0!==this.#ft.y?s.y:0};this.#mt.x===a.x&&this.#mt.y===a.y&&this.#ft.x===l.x&&this.#ft.y===l.y||(this.#St={x:this.#St.x+a.x-this.#mt.x+l.x-this.#ft.x,y:this.#St.y+a.y-this.#mt.y+l.y-this.#ft.y},this.#ft=l,this.#mt=a,i=!0),i&&this.draw()}bindInteraction(){this.#et.style.pointerEvents="auto";const e=$t;for(let t=0;t<e.length;++t){const n=e[t],i="wheel"!==n;this.#et.addEventListener(n,this.#Re,{passive:i})}}unbindInteraction(){this.#et.style.pointerEvents="none";const e=$t;for(let t=0;t<e.length;++t)this.#et.removeEventListener(e[t],this.#Re)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{e.srclayerid=this.getId(),e.dataid=this.#We,this.#Oe.fireEvent(e)};#Ot(){this.#tt.generateImageData(this.#at),this.#it.getContext("2d").putImageData(this.#at,0,0),this.#yt=!1}#It=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#yt=!0,this.draw())};#Tt=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#yt=!0,this.draw())};#Lt=e=>{if(void 0===e.skipGenerate||!0!==e.skipGenerate){let t=!0;if(void 0!==e.valid&&(t=e.valid),t){const t=[0,1,2],n=t.indexOf(this.#tt.getScrollIndex());t.splice(n,1),0===e.diffDims.filter((function(e){return-1===t.indexOf(e)})).length&&this.#ot||(this.#ot=!0,this.#yt=!0,this.draw())}else this.#ot&&(this.#ot=!1,this.clear())}};#Pt=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#yt=!0,this.draw())};setCurrentPosition(e,t){return this.#tt.setCurrentPosition(e)}clear(){this.#rt.save(),this.#rt.setTransform(1,0,0,1,0,0),this.#rt.clearRect(0,0,this.#nt.width,this.#nt.height),this.#rt.restore()}}var sn=o(944),ln=o.n(sn);class cn{#At=10;#bt="Verdana";#xt="#fff";#Rt="#ffff80";#Ft={x:1,y:1};#Et={x:1,y:1};#qt=2;#Ut={x:.25,y:.25};#Mt=.2;#Qt=3;getFontFamily(){return this.#bt}getFontSize(){return this.#At}getStrokeWidth(){return this.#qt}getTextColour(){return this.#xt}getLineColour(){return this.#Rt}setLineColour(e){this.#Rt=e}setBaseScale(e){this.#Ft=e}setZoomScale(e){this.#Et=e}getBaseScale(){return this.#Ft}getZoomScale(){return this.#Et}scale(e){return e/this.#Ft.x}applyZoomScale(e){return{x:2*e/this.#Et.x,y:2*e/this.#Et.y}}getShadowOffset(){return this.#Ut}getTagOpacity(){return this.#Mt}getTextPadding(){return this.#Qt}getFontStr(){return"normal "+this.getFontSize()+"px sans-serif"}getLineHeight(){return this.getFontSize()+this.getFontSize()/5}getScaledFontSize(){return this.scale(this.getFontSize())}getScaledStrokeWidth(){return this.scale(this.getStrokeWidth())}getShadowLineColour(){return y(this.getLineColour())}}function un(e){let t="shape";return e instanceof ln().Line?t=4===e.points().length?"line":6===e.points().length?"protractor":"roi":e instanceof ln().Rect?t="rectangle":e instanceof ln().Ellipse&&(t="ellipse"),t}class dn{#T;#Bt;#Nt;#Vt;#Gt;constructor(e,t,n,i){this.#T=e,this.#Bt=t,this.#Nt=n,this.#Vt=void 0!==i&&i,this.#Gt=e.getParent()}getName(){return"Draw-"+this.#Bt}execute(){this.#Gt.add(this.#T),this.#Nt.getKonvaLayer().draw(),this.#Vt||this.onExecute({type:"drawcreate",id:this.#T.id(),srclayerid:this.#Nt.getId(),dataid:this.#Nt.getDataId()})}undo(){this.#T.remove(),this.#Nt.getKonvaLayer().draw(),this.onUndo({type:"drawdelete",id:this.#T.id(),srclayerid:this.#Nt.getId(),dataid:this.#Nt.getDataId()})}onExecute(e){}onUndo(e){}}class hn{#T;#Bt;#kt;#Nt;constructor(e,t,n,i){this.#T=e,this.#Bt=t,this.#kt=n,this.#Nt=i}getName(){return"Move-"+this.#Bt}execute(){this.#T.move(this.#kt),this.#Nt.getKonvaLayer().draw(),this.onExecute({type:"drawmove",id:this.#T.id(),srclayerid:this.#Nt.getId(),dataid:this.#Nt.getDataId()})}undo(){const e={x:-this.#kt.x,y:-this.#kt.y};this.#T.move(e),this.#Nt.getKonvaLayer().draw(),this.onUndo({type:"drawmove",id:this.#T.id(),srclayerid:this.#Nt.getId(),dataid:this.#Nt.getDataId()})}onExecute(e){}onUndo(e){}}class Sn{#Bt;#Ht;#zt;#Wt;#Nt;#tt;#Yt;constructor(e,t,n,i,r,o,a){this.#Bt=e,this.#Ht=t,this.#zt=n,this.#Wt=i,this.#Nt=r,this.#tt=o,this.#Yt=a}getName(){return"Change-"+this.#Bt}execute(){this.#Ht.update(this.#Wt,this.#Yt,this.#tt),this.#Nt.getKonvaLayer().draw(),this.onExecute({type:"drawchange",id:this.#Wt.getParent().id(),srclayerid:this.#Nt.getId(),dataid:this.#Nt.getDataId()})}undo(){this.#Ht.update(this.#zt,this.#Yt,this.#tt),this.#Nt.getKonvaLayer().draw(),this.onUndo({type:"drawchange",id:this.#zt.getParent().id(),srclayerid:this.#Nt.getId(),dataid:this.#Nt.getDataId()})}onExecute(e){}onUndo(e){}}class gn{#T;#Bt;#Nt;#Gt;constructor(e,t,n){this.#T=e,this.#Bt=t,this.#Nt=n,this.#Gt=e.getParent()}getName(){return"Delete-"+this.#Bt}execute(){this.#T.remove(),this.#Nt.getKonvaLayer().draw(),this.onExecute({type:"drawdelete",id:this.#T.id(),srclayerid:this.#Nt.getId(),dataid:this.#Nt.getDataId()})}undo(){this.#Gt.add(this.#T),this.#Nt.getKonvaLayer().draw(),this.onUndo({type:"drawcreate",id:this.#T.id(),srclayerid:this.#Nt.getId(),dataid:this.#Nt.getDataId()})}onExecute(e){}onUndo(e){}}class mn{quantification;textExpr}class pn{id;position;type;color;meta}function fn(e){return"shape"===e.name()}function yn(e){return e.name().startsWith("shape-")}function Dn(e){return"label"===e.name()}function Cn(e){return"position-group"===e.name()}function vn(e){return function(t){return t.id()===e}}class In{#Xt;#jt;#Zt=null;constructor(e){this.#Xt=e,this.#jt=e.getKonvaLayer()}getCurrentPosGroup(){const e=this.#jt.getChildren((e=>e.id()===this.#Zt));let t;return 1===e.length?e[0]instanceof ln().Group&&(t=e[0]):0===e.length?(t=new(ln().Group),t.name("position-group"),t.id(this.#Zt),t.visible(!0),this.#jt.add(t)):i.warn("Unexpected number of draw position groups."),t}reset(){this.#jt=null}getGroup(e){const t=this.#jt.findOne("#"+e);return void 0===t&&i.warn("Cannot find node with id: "+e),t}activateDrawLayer(e,t){const n=[t];for(let t=3;t<e.length();++t)n.push(t);this.#Zt=e.toStringId(n);const i=this.#jt.getChildren(Cn);let r;for(let e=0,t=i.length;e<t;++e)r=!1,i[e].id()===this.#Zt&&(r=!0),i[e].visible(r);this.#jt.draw()}getDrawDisplayDetails(){const e=[],n=this.#jt.getChildren();for(let i=0,r=n.length;i<r;++i){const r=t(n[i].id()),o=n[i].getChildren();for(let t=0,n=o.length;t<n;++t){const n=o[t].getChildren(fn)[0],i=o[t].getChildren(Dn)[0].getChildren()[0];let a=n.className;if("Line"===a){const e=o[t].getChildren(yn);if(n.closed())a="Roi";else if(0!==e.length){const t=e[0].name();a=-1!==t.indexOf("triangle")?"Arrow":-1!==t.indexOf("arc")?"Protractor":"Ruler"}}"Rect"===a&&(a="Rectangle"),e.push({id:o[t].id(),position:r.toString(),type:a,color:n.stroke(),meta:i.meta})}}return e}getDrawStoreDetails(){const e={},t=this.#jt.getChildren(Cn);let n,r;for(let o=0,a=t.length;o<a;++o){n=t[o].getChildren();for(let t=0,o=n.length;t<o;++t){r=n[t];const o=r.find(".anchor");for(let e=0;e<o.length;++e)o[e].remove();const a=r.find(".text");1!==a.length&&i.warn("There should not be more than one text per shape."),e[r.id()]={meta:a[0].meta}}}return e}setDrawings(e,t,n,i){const r=ln().Node.create(e).getChildren(Cn);for(let e=0,o=r.length;e<o;++e){const o=r[e];let a=this.#jt.getChildren(vn(o.id()))[0];void 0===a&&(a=new(ln().Group)({id:o.id(),name:"position-group",visible:!1}),this.#jt.add(a));const s=o.getChildren();for(let e=0,r=s.length;e<r;++e){const e=s[0];a.add(e);const r=e.getChildren(fn)[0],o=new dn(e,r.className,this.#Xt);if(o.onExecute=n,o.onUndo=n,t){const n=t[e.id()],i=e.getChildren(Dn)[0].getText();i.meta=n.meta,i.setText(U(i.meta.textExpr,i.meta.quantification))}o.execute(),i(o)}}}updateDraw(e){const t=this.#jt.findOne("#"+e.id);if(void 0===t)return void i.warn("[updateDraw] Cannot find group with id: "+e.id);const n=t.getChildren(fn);for(let t=0;t<n.length;++t)n[t].stroke(e.color);const r=t.getChildren(yn);for(let t=0;t<r.length;++t)void 0!==r[t].stroke()?r[t].stroke(e.color):void 0!==r[t].fill()&&r[t].fill(e.color);const o=t.getChildren(Dn)[0],a=y(e.color),s=o.getChildren();for(let t=0;t<s.length;++t)if(s[t].fill(e.color),"Text"===s[t].className){const n=s[t];n.shadowColor(a),void 0!==e.meta&&(n.meta=e.meta,n.setText(U(n.meta.textExpr,n.meta.quantification)),o.setVisible(0!==n.meta.textExpr.length))}this.#jt.draw()}deleteDrawGroup(e,t,n){const i=e.getChildren(fn)[0];if(!(i instanceof ln().Shape))return;const r=un(i),o=new gn(e,r,this.#Xt);o.onExecute=t,o.onUndo=t,o.execute(),void 0!==n&&n(o)}deleteDraw(e,t,n){const i=this.getGroup(e);return void 0!==i&&(this.deleteDrawGroup(i,t,n),!0)}deleteDraws(e,t){const n=this.#jt.getChildren();for(const r of n)if(r instanceof ln().Group){const n=r.getChildren();for(;n.length;)n[0]instanceof ln().Group&&this.deleteDrawGroup(n[0],e,t)}else i.warn("Found non group in layer while deleting")}getNumberOfDraws(){const e=this.#jt.getChildren();let t=0;for(const n of e)n instanceof ln().Group&&(t+=n.getChildren().length);return t}}class Tn{#et;#_t=null;#st;#lt;#dt={x:1,y:1};#ht={x:1,y:1,z:1};#gt={x:0,y:0};#mt={x:0,y:0};#pt={x:0,y:0};#ft={x:0,y:0};#Kt;#Ye;#We;constructor(e){this.#et=e,this.#et.className+=" drawLayer"}getDataId(){return this.#We}#Oe=new He;getKonvaStage(){return this.#_t}getKonvaLayer(){return this.#_t.getLayers()[0]}getDrawController(){return this.#Kt}setPlaneHelper(e){this.#Ye=e}getId(){return this.#et.id}removeFromDOM(){this.#et.remove()}getBaseSize(){return this.#st}getOpacity(){return this.#_t.opacity()}setOpacity(e){this.#_t.opacity(Math.min(Math.max(e,0),1))}addFlipOffsetX(){const e=this.#_t.scale(),t=this.#_t.size();this.#ft.x+=t.width/e.x;const n=this.#_t.offset();n.x+=this.#ft.x,this.#_t.offset(n)}addFlipOffsetY(){const e=this.#_t.scale(),t=this.#_t.size();this.#ft.y+=t.height/e.y;const n=this.#_t.offset();n.y+=this.#ft.y,this.#_t.offset(n)}flipScaleX(){this.#ht.x*=-1}flipScaleY(){this.#ht.y*=-1}flipScaleZ(){this.#ht.z*=-1}setScale(e,t){const n=this.#Ye.getTargetOrientedPositiveXYZ({x:e.x*this.#ht.x,y:e.y*this.#ht.y,z:e.z*this.#ht.z}),i={x:this.#dt.x*n.x,y:this.#dt.y*n.y},r=this.#_t.offset();if(1===Math.abs(e.x)&&1===Math.abs(e.y)&&1===Math.abs(e.z)){const e={x:r.x-this.#pt.x,y:r.y-this.#pt.y};this.#pt={x:0,y:0},this.#_t.offset(e)}else if(void 0!==t){let e=this.#Ye.getPlaneOffsetFromOffset3D({x:t.getX(),y:t.getY(),z:t.getZ()});e={x:e.x+this.#gt.x,y:e.y+this.#gt.y};const n=wn(r,this.#_t.scale(),i,e),o={x:this.#pt.x+n.x-r.x,y:this.#pt.y+n.y-r.y};this.#pt=o,this.#_t.offset(n)}this.#_t.scale(i),this.#Jt(i)}setOffset(e){const t=this.#Ye.getPlaneOffsetFromOffset3D(e);this.#_t.offset({x:t.x+this.#mt.x+this.#gt.x+this.#pt.x+this.#ft.x,y:t.y+this.#mt.y+this.#gt.y+this.#pt.y+this.#ft.y})}setBaseOffset(e,t){const n=this.#Ye.getNativeScrollIndex(),i=this.#Ye.getPlaneOffsetFromOffset3D({x:0===n?e.getX():t.getX(),y:1===n?e.getY():t.getY(),z:2===n?e.getZ():t.getZ()}),r=this.#gt.x!==i.x||this.#gt.y!==i.y;if(r){const e=this.#_t.offset();this.#_t.offset({x:e.x-this.#gt.x+i.x,y:e.y-this.#gt.y+i.y}),this.#gt=i}return r}display(e){this.#et.style.display=e?"":"none"}isVisible(){return""===this.#et.style.display}draw(){this.#_t.draw()}initialise(e,t,n){this.#st=e,this.#lt=t,this.#We=n,this.#_t=new(ln().Stage)({container:this.#et,width:this.#st.x,height:this.#st.y,listening:!1}),this.#_t.getContent().setAttribute("style","");const i=new(ln().Layer)({listening:!1,visible:!0});this.#_t.add(i),this.#Kt=new In(this)}fitToContainer(e,t,n){this.#_t.width(e.x),this.#_t.height(e.y);const i={x:t*this.#lt.x,y:t*this.#lt.y},r={x:this.#_t.scale().x*i.x/this.#dt.x,y:this.#_t.scale().y*i.y/this.#dt.y};this.#_t.scale().x===r.x&&this.#_t.scale().y===r.y||(this.#dt=i,this.#_t.scale(r));const o={x:n.x/i.x,y:n.y/i.y},a={x:e.x/i.x,y:e.y/i.y},s={x:0!==this.#ft.x?a.x:0,y:0!==this.#ft.y?a.y:0};this.#mt.x===o.x&&this.#mt.y===o.y&&this.#ft.x===s.x&&this.#ft.y===s.y||(this.#_t.offset({x:this.#_t.offset().x+o.x-this.#mt.x+s.x-this.#ft.x,y:this.#_t.offset().y+o.y-this.#mt.y+s.y-this.#ft.y}),this.#ft=s,this.#mt=o)}isGroupVisible(e){const t=this.#Kt.getGroup(e);return void 0!==t&&t.isVisible()}toggleGroupVisibility(e){const t=this.#Kt.getGroup(e);return void 0!==t&&(t.visible(!t.isVisible()),this.draw(),!0)}deleteDraw(e,t){void 0!==this.#Kt&&this.#Kt.deleteDraw(e,this.#Re,t)}deleteDraws(e){void 0!==this.#Kt&&this.#Kt.deleteDraws(this.#Re,e)}getNumberOfDraws(){let e;return void 0!==this.#Kt&&(e=this.#Kt.getNumberOfDraws()),e}bindInteraction(){this.#_t.listening(!0),this.#et.style.pointerEvents="auto";const e=$t;for(let t=0;t<e.length;++t)this.#et.addEventListener(e[t],this.#Re)}unbindInteraction(){this.#_t.listening(!1),this.#et.style.pointerEvents="none";const e=$t;for(let t=0;t<e.length;++t)this.#et.removeEventListener(e[t],this.#Re)}setCurrentPosition(e,t){return this.getDrawController().activateDrawLayer(t,this.#Ye.getScrollIndex()),!0}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{e.srclayerid=this.getId(),e.dataid=this.#We,this.#Oe.fireEvent(e)};#Jt(e){const t=2/e.x,n=2/e.y,i=this.#_t.find("Label");for(let e=0;e<i.length;++e)i[e].scale({x:t,y:n})}}function Ln(e){const t=e.split("-layer-");return 2!==t.length&&i.warn("Not the expected layer div id format..."),{groupDivId:t[0],layerId:t[1]}}function Pn(e){let t=null;const n=e.target.closest(".layer");return n&&void 0!==n.id&&(t=Ln(n.id)),t}function wn(e,t,n,i){const r=(i.x-e.x)*t.x,o=(i.y-e.y)*t.y;return{x:i.x-r/n.x,y:i.y-o/n.y}}class On{#et;#$t=[];#ut={x:1,y:1,z:1};#Ft={x:1,y:1,z:1};#St={x:0,y:0,z:0};#en=void 0;#tn=void 0;#Oe=new He;#nn=!1;#in=[];#rn;#Be;#Dt=!1;constructor(e){this.#et=e}getShowCrosshair(){return this.#nn}setShowCrosshair(e){this.#nn=e,e?(this.addEventListener("offsetchange",this.#on),this.addEventListener("zoomchange",this.#on),this.#an()):(this.removeEventListener("offsetchange",this.#on),this.removeEventListener("zoomchange",this.#on),this.#sn())}setImageSmoothing(e){this.#Dt=e;for(const t of this.#$t)t instanceof an&&t.setImageSmoothing(e)}#on=e=>{this.#an()};getDivId(){return this.#et.id}getScale(){return this.#ut}getBaseScale(){return this.#Ft}getAddedScale(){return{x:this.#ut.x/this.#Ft.x,y:this.#ut.y/this.#Ft.y,z:this.#ut.z/this.#Ft.z}}getOffset(){return this.#St}getNumberOfLayers(){let e=0;return this.#$t.forEach((t=>{void 0!==t&&e++})),e}includes(e){if(void 0===e)return!1;for(const t of this.#$t)if(void 0!==t&&t.getId()===e)return!0;return!1}getNumberOfViewLayers(){let e=0;return this.#$t.forEach((t=>{void 0!==t&&t instanceof an&&e++})),e}getActiveViewLayer(){let e;if(void 0!==this.#en){const t=this.#$t[this.#en];t instanceof an&&(e=t)}else i.info("No active view layer to return");return e}getBaseViewLayer(){let e;return this.#$t[0]instanceof an&&(e=this.#$t[0]),e}getViewLayersByDataId(e){const t=[];for(const n of this.#$t)n instanceof an&&n.getDataId()===e&&t.push(n);return t}searchViewLayers(e){const t=[];for(const n of this.#$t)n instanceof an&&n.getViewController().equalImageMeta(e)&&t.push(n);return t}getViewDataIndices(){const e=[];for(const t of this.#$t)t instanceof an&&e.push(t.getDataId());return e}getActiveDrawLayer(){let e;if(void 0!==this.#tn){const t=this.#$t[this.#tn];t instanceof Tn&&(e=t)}else i.info("No active draw layer to return");return e}getDrawLayersByDataId(e){const t=[];for(const n of this.#$t)n instanceof Tn&&n.getDataId()===e&&t.push(n);return t}setActiveViewLayer(e){this.#$t[e]instanceof an?(this.#en=e,this.#Re({type:"activelayerchange",value:[this.#$t[e]]})):i.warn("No view layer to set as active with index: "+e)}setActiveViewLayerByDataId(e){let t;for(let n=0;n<this.#$t.length;++n)if(this.#$t[n]instanceof an&&this.#$t[n].getDataId()===e){t=n;break}void 0!==t?this.setActiveViewLayer(t):i.warn("No view layer to set as active with dataId: "+e)}setActiveDrawLayer(e){this.#$t[e]instanceof Tn?(this.#tn=e,this.#Re({type:"activelayerchange",value:[this.#$t[e]]})):i.warn("No draw layer to set as active with index: "+e)}setActiveDrawLayerByDataId(e){let t;for(let n=0;n<this.#$t.length;++n)if(this.#$t[n]instanceof Tn&&this.#$t[n].getDataId()===e){t=n;break}void 0!==t?this.setActiveDrawLayer(t):i.warn("No draw layer to set as active with dataId: "+e)}addViewLayer(){const e=this.#$t.length,t=this.#ln();this.#et.append(t);const n=new an(t);return n.setImageSmoothing(this.#Dt),this.#$t.push(n),this.setActiveViewLayer(e),this.#cn(n),n}addDrawLayer(){this.#tn=this.#$t.length;const e=this.#ln();this.#et.append(e);const t=new Tn(e);return this.#$t.push(t),this.#un(t),t}#cn(e){e.addEventListener("positionchange",this.updateLayersToPositionChange);for(const t of jt)e.addEventListener(t,this.#Re);e.addEventListener("renderstart",this.#Re),e.addEventListener("renderend",this.#Re)}#dn(e){e.removeEventListener("positionchange",this.updateLayersToPositionChange);for(const t of jt)e.removeEventListener(t,this.#Re);e.removeEventListener("renderstart",this.#Re),e.removeEventListener("renderend",this.#Re),e.unbindImage()}#un(e){e.addEventListener("drawcreate",this.#Re),e.addEventListener("drawdelete",this.#Re)}#hn(e){e.removeEventListener("drawcreate",this.#Re),e.removeEventListener("drawdelete",this.#Re)}#ln(){const e=document.createElement("div");return e.id=this.getDivId()+"-layer-"+this.#$t.length,e.className="layer",e.style.pointerEvents="none",e}empty(){this.#$t=[],this.#en=void 0,this.#tn=void 0,this.#sn();const e=this.#et.getElementsByClassName("layer");if(e)for(;e.length>0;)e[0].remove()}removeLayersByDataId(e){for(const t of this.#$t)void 0!==t&&t.getDataId()===e&&this.removeLayer(t)}removeLayer(e){const t=this.#$t.findIndex((t=>t===e));if(-1===t)throw new Error("Cannot find layer to remove");if(e instanceof an)this.#dn(e),this.#en===t&&(t-2>=0?this.setActiveViewLayer(t-2):this.#en=void 0);else{const n=e.getNumberOfDraws();if(void 0!==n){let t=0;e.addEventListener("drawdelete",(i=>{++t,t===n&&this.#hn(e)}))}e.deleteDraws(),void 0===n&&this.#hn(e),this.#tn===t&&(t-2>=0?this.setActiveDrawLayer(t-2):this.#tn=void 0)}this.#$t[t]=void 0,e.removeFromDOM()}#an(e){let t;void 0===e&&(e=this.#Be),this.#sn();for(const e of this.#$t)if(e instanceof an){t=e;break}if(void 0===t)return void i.warn("No layer to show crosshair");const n=t.getViewController().getPlanePositionFromPosition(e),r=t.planePosToDisplay(n);if(void 0!==r.getY()){const e=document.createElement("hr");e.id=this.getDivId()+"-scroll-crosshair-horizontal",e.className="horizontal",e.style.width=this.#et.offsetWidth+"px",e.style.left="0px",e.style.top=r.getY()+"px",this.#in.push(e),this.#et.appendChild(e)}if(void 0!==r.getX()){const e=document.createElement("hr");e.id=this.getDivId()+"-scroll-crosshair-vertical",e.className="vertical",e.style.width=this.#et.offsetHeight+"px",e.style.left=r.getX()+"px",e.style.top="0px",this.#in.push(e),this.#et.appendChild(e)}}#sn(){for(const e of this.#in)e.remove();this.#in=[]}showTooltip(e){this.removeTooltipDiv();const t=this.getActiveViewLayer(),n=t.getViewController(),i=t.displayToPlanePos(e),r=n.getPositionFromPlanePoint(i),o=n.getRescaledImageValue(r);if(void 0!==o){const t=document.createElement("span");t.id="scroll-tooltip",t.style.left=e.getX()+10+"px",t.style.top=e.getY()+10+"px";let i=B(o,3).toString();void 0!==n.getPixelUnit()&&(i+=" "+n.getPixelUnit()),t.appendChild(document.createTextNode(i)),this.#rn=t,this.#et.appendChild(t)}}removeTooltipDiv(){void 0!==this.#rn&&(this.#rn.remove(),this.#rn=void 0)}someViewLayer(e){let t=!1;for(const n of this.#$t)if(n instanceof an&&e(n)){t=!0;break}return t}isPositionInBounds(e){return this.someViewLayer((function(t){return t.getViewController().isPositionInBounds(e)}))}canScroll(){return this.someViewLayer((function(e){return e.getViewController().canScroll()}))}moreThanOne(e){return this.someViewLayer((function(t){return t.getViewController().moreThanOne(e)}))}updateLayersToPositionChange=t=>{for(const e of this.#$t)e instanceof an&&(e.removeEventListener("positionchange",this.updateLayersToPositionChange),e.removeEventListener("positionchange",this.#Re));const n=new e(t.value[0]),i=new R(t.value[1]);let r,o,a,s;this.#Be=i,this.#nn&&this.#an(i);for(const e of this.#$t){if(void 0===e)continue;let l=!1;if(e instanceof an){const t=e.getViewController(),n=t.getOrigin(),l=t.getOrigin(i);if(void 0===o)r=n,o=l,a=new T(0,0,0),s=new T(0,0,0);else if(t.isPositionInBounds(i)&&void 0!==l){const e=r.minus(n);a=new T(e.getX(),e.getY(),e.getZ());const t=o.minus(l);s=new T(t.getX(),t.getY(),t.getZ())}}void 0!==a&&void 0!==s&&(l=e.setBaseOffset(a,s,o,r)),e instanceof Tn&&(a=void 0,s=void 0);let c=!1;e.getId()!==t.srclayerid&&(c=e.setCurrentPosition(i,n)),!c&&l&&e.draw()}for(const e of this.#$t)e instanceof an&&(e.addEventListener("positionchange",this.updateLayersToPositionChange),e.addEventListener("positionchange",this.#Re))};getDivToWorldSizeRatio(){if(0===this.#et.offsetWidth&&0===this.#et.offsetHeight)throw new Error("Cannot fit to zero sized container.");const e=this.getMaxWorldSize();if(void 0!==e){if(0===this.#et.offsetHeight){const t=this.#et.offsetWidth/e.x,n=e.y*t;this.#et.style.height=n+"px"}return Math.min(this.#et.offsetWidth/e.x,this.#et.offsetHeight/e.y)}}fitToContainer(e){const t=this.getMaxWorldSize();if(void 0===t)return;const n={x:this.#et.offsetWidth,y:this.#et.offsetHeight},i={x:-.5*(n.x-Math.floor(t.x*e)),y:-.5*(n.y-Math.floor(t.y*e))};for(const t of this.#$t)void 0!==t&&t.fitToContainer(n,e,i);this.#nn&&this.#an()}getMaxWorldSize(){let e={x:0,y:0};for(const t of this.#$t)if(t instanceof an){const n=t.getImageWorldSize();n.x>e.x&&(e.x=n.x),n.y>e.y&&(e.y=n.y)}return 0===e.x&&0===e.y&&(e=void 0),e}flipScaleZ(){this.#Ft.z*=-1,this.setScale(this.#Ft)}addScale(e,t){const n={x:this.#ut.x*(1+e),y:this.#ut.y*(1+e),z:this.#ut.z*(1+e)};this.setScale(n,t)}setScale(e,t){this.#ut=e;for(const e of this.#$t)void 0!==e&&e.setScale(this.#ut,t);const n=[e.x,e.y,e.z];void 0!==t&&(n.push(t.getX()),n.push(t.getY()),n.push(t.getZ())),this.#Re({type:"zoomchange",value:n})}addTranslation(e){this.setOffset({x:this.#St.x-e.x,y:this.#St.y-e.y,z:this.#St.z-e.z})}setOffset(e){this.#St=e;for(const e of this.#$t)void 0!==e&&e.setOffset(this.#St);this.#Re({type:"offsetchange",value:[this.#St.x,this.#St.y,this.#St.z]})}reset(){this.setScale(this.#Ft),this.setOffset({x:0,y:0,z:0})}draw(){for(const e of this.#$t)void 0!==e&&e.draw()}display(e){for(const t of this.#$t)void 0!==t&&t.display(e)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}}const An={WindowLevelBinder:class{getEventType=function(){return"wlchange"};getCallback=function(e){return function(t){const n=e.getViewLayersByDataId(t.dataid);if(0!==n.length){const e=n[0].getViewController();if(2===t.value.length){const n=new r(t.value[0],t.value[1]);e.setWindowLevel(n)}3===t.value.length&&e.setWindowLevelPreset(t.value[2])}}}},PositionBinder:class{getEventType=function(){return"positionchange"};getCallback=function(e){return function(t){const n=t.value[1],i=e.getActiveViewLayer().getViewController(),r=i.getCurrentPosition(),o=r.length(),a=n.length;a!==o&&(a===o-1?n.push(r.get(o-1)):a===o+1&&n.pop()),i.setCurrentPosition(new R(n))}}},ZoomBinder:class{getEventType=function(){return"zoomchange"};getCallback=function(e){return function(t){const n={x:t.value[0],y:t.value[1],z:t.value[2]};let i;6===t.value.length&&(i=new x(t.value[3],t.value[4],t.value[5])),e.setScale(n,i),e.draw()}}},OffsetBinder:class{getEventType=function(){return"offsetchange"};getCallback=function(e){return function(t){e.setOffset({x:t.value[0],y:t.value[1],z:t.value[2]}),e.draw()}}},OpacityBinder:class{getEventType=function(){return"opacitychange"};getCallback=function(e){return function(t){if(void 0===t.dataid)return;const n=e.getViewLayersByDataId(t.dataid);0!==n.length&&(n[0].setOpacity(t.value),n[0].draw())}}},ColourMapBinder:class{getEventType=function(){return"colourmapchange"};getCallback=function(e){return function(t){const n=e.getViewLayersByDataId(t.dataid);0!==n.length&&n[0].getViewController().setColourMap(t.value[0])}}}};class bn{#Sn=[];#gn;#Dt=!1;#mn=[];#pn=null;getLayerGroup(e){return this.#Sn[e]}getNumberOfLayerGroups(){return this.#Sn.length}getActiveLayerGroup(){return this.getLayerGroup(this.#gn)}setActiveLayerGroup(e){void 0!==this.getLayerGroup(e)?this.#gn=e:i.warn("No layer group to set as active with index: "+e)}getViewLayersByDataId(e){let t=[];for(let n=0;n<this.#Sn.length;++n)t=t.concat(this.#Sn[n].getViewLayersByDataId(e));return t}getDrawLayersByDataId(e){let t=[];for(let n=0;n<this.#Sn.length;++n)t=t.concat(this.#Sn[n].getDrawLayersByDataId(e));return t}addLayerGroup(e){this.#gn=this.#Sn.length;const t=new On(e);t.setImageSmoothing(this.#Dt);const n=this.#pn&&0!==this.#pn.length;return n&&this.unbindLayerGroups(),this.#Sn.push(t),n&&this.bindLayerGroups(),t}getLayerGroupByDivId(e){return this.#Sn.find((function(t){return t.getDivId()===e}))}setBinders(e){if(null==e)throw new Error("Cannot set null or undefined binders");0!==this.#mn.length&&this.unbindLayerGroups(),this.#mn=e.slice(),this.bindLayerGroups()}empty(){this.unbindLayerGroups();for(let e=0;e<this.#Sn.length;++e)this.#Sn[e].empty();this.#Sn=[],this.#gn=void 0}removeLayersByDataId(e){for(const t of this.#Sn)t.removeLayersByDataId(e)}removeLayerGroup(e){const t=this.#Sn.findIndex((t=>t===e));if(-1===t)throw new Error("Cannot find layerGroup to remove");this.unbindLayerGroups(),e.empty(),this.#Sn.splice(t,1),this.#gn===t&&(this.#gn=void 0),this.bindLayerGroups()}reset(){for(let e=0;e<this.#Sn.length;++e)this.#Sn[e].reset()}draw(){for(let e=0;e<this.#Sn.length;++e)this.#Sn[e].draw()}fitToContainer(){let e;const t=[];for(let n=0;n<this.#Sn.length;++n){const i=this.#Sn[n].getDivToWorldSizeRatio();void 0!==i&&(t.push(n),(void 0===e||i<e)&&(e=i))}if(void 0!==e)for(let n=0;n<this.#Sn.length;++n)t.includes(n)&&this.#Sn[n].fitToContainer(e)}bindLayerGroups(){if(0!==this.#Sn.length&&1!==this.#Sn.length&&0!==this.#mn.length){this.#pn=new Array(this.#Sn.length);for(let e=0;e<this.#Sn.length;++e)for(let t=0;t<this.#mn.length;++t)this.#fn(e,this.#mn[t])}}unbindLayerGroups(){if(0!==this.#Sn.length&&1!==this.#Sn.length&&0!==this.#mn.length&&this.#pn){for(let e=0;e<this.#Sn.length;++e)for(let t=0;t<this.#mn.length;++t)this.#yn(e,this.#mn[t]);this.#pn=null}}setImageSmoothing(e){this.#Dt=e;for(let t=0;t<this.#Sn.length;++t)this.#Sn[t].setImageSmoothing(e)}#Dn(e,t){void 0===this.#pn[t]&&(this.#pn[t]=[]);let n=this.#pn[t].find((function(t){return t.binder===e}));return void 0===n&&(n={binder:e,callback:n=>{this.#yn(t,e),e.getCallback(this.#Sn[t])(n),this.#fn(t,e)}},this.#pn[t].push(n)),n.callback}#fn(e,t){for(let n=0;n<this.#Sn.length;++n)n!==e&&this.#Sn[e].addEventListener(t.getEventType(),this.#Dn(t,n))}#yn(e,t){for(let n=0;n<this.#Sn.length;++n)n!==e&&this.#Sn[e].removeEventListener(t.getEventType(),this.#Dn(t,n))}}class xn{toJSON(e){const t=e.getActiveLayerGroup(),n=t.getActiveViewLayer().getViewController(),i=n.getCurrentIndex(),r=t.getActiveDrawLayer(),o=r.getDrawController(),a=n.getWindowLevel();return JSON.stringify({version:"0.5","window-center":a.center,"window-width":a.width,position:i.getValues(),scale:e.getAddedScale(),offset:e.getOffset(),drawings:r.getKonvaLayer().toObject(),drawingsDetails:o.getDrawStoreDetails()})}fromJSON(e){const t=JSON.parse(e);let n=null;if("0.1"===t.version)n=this.#Cn(t);else if("0.2"===t.version)n=this.#vn(t);else if("0.3"===t.version)n=this.#In(t);else if("0.4"===t.version)n=this.#Tn(t);else{if("0.5"!==t.version)throw new Error("Unknown state file format version: '"+t.version+"'.");n=this.#Ln(t)}return n}apply(t,n){const i=t.getActiveLayerGroup().getActiveViewLayer().getViewController(),o=new r(n["window-center"],n["window-width"]);i.setWindowLevel(o),i.setCurrentIndex(new e(n.position));const a=t.getActiveLayerGroup().getBaseScale();let s=null,l=null;if(void 0!==n.scaleCenter){s={x:n.scale*a.x,y:n.scale*a.y,z:1};const e=n.scaleCenter.x-n.scaleCenter.x*n.scale,t=n.scaleCenter.y-n.scaleCenter.y*n.scale,i=e+n.translation.x*s.x,r=t+n.translation.y*s.y;l={x:-i/s.x,y:-r/s.y,z:0}}else s={x:n.scale.x*a.x,y:n.scale.y*a.y,z:a.z},l={x:n.offset.x,y:n.offset.y,z:0};t.getActiveLayerGroup().setScale(s),t.getActiveLayerGroup().setOffset(l),t.render(t.getDataIds()[0]),t.setDrawings(n.drawings,n.drawingsDetails)}#Cn(e){const t=function(e){const t=[],n={};let i,r;for(let o=0,a=e.length;o<a;++o){t[o]=[];for(let a=0,s=e[o].length;a<s;++a){i=e[o][a];const s=[];for(let e=0,t=i.length;e<t;++e){r=ln().Node.create(i[e]),r.visible(!0);let t={x:0,y:0};const o=r.getChildren((function(e){return"shape"===e.name()}))[0];if(o.stroke(I(o.stroke())),"line-group"===r.name()){r.name("ruler-group");const e=new(ln().Line)({points:[o.points()[0],o.points()[1],o.points()[0],o.points()[1]],name:"shape-tick0"});r.add(e);const t=new(ln().Line)({points:[o.points()[2],o.points()[3],o.points()[2],o.points()[3]],name:"shape-tick1"});r.add(t)}const a=r.getChildren((function(e){return"arc"===e.name()}));1===a.length&&a[0].name("shape-arc");const l=r.getChildren((function(e){return"text"===e.name()}));let c=new(ln().Text)({name:"text",text:""});1===l.length?(t.x=l[0].x(),t.y=l[0].y(),l[0].remove(),c=l[0]):0!==o.points().length&&(t={x:o.points()[0],y:o.points()[1]});const u=new(ln().Label)({x:t.x,y:t.y,name:"label"});u.add(c),u.add(new(ln().Tag)),r.add(u),s.push(JSON.stringify(r.toObject()));let d=c.text();const h=d.length;let S=null;"ruler-group"===r.name()?(S={length:{value:parseFloat(d.substring(0,h-2)),unit:d.substring(-2)}},d="{length}"):"ellipse-group"===r.name()||"rectangle-group"===r.name()?(S={surface:{value:parseFloat(d.substring(0,h-3)),unit:d.substring(-3)}},d="{surface}"):"protractor-group"!==r.name()&&"rectangle-group"!==r.name()||(S={angle:{value:parseFloat(d.substring(0,h-1)),unit:d.substring(-1)}},d="{angle}"),n[r.id()]={textExpr:d,longText:"",quant:S}}t[o].push(s)}}return{drawings:t,drawingsDetails:n}}(e.drawings);return e.drawings=Rn(t.drawings).toObject(),e.drawingsDetails=Fn(t.drawingsDetails),(e=En(e)).drawings=qn(e.drawings),e}#vn(e){return e.drawings=Rn(e.drawings).toObject(),e.drawingsDetails=Fn(function(e){const t={},n="string"==typeof e?JSON.parse(e):e;for(let e=0,i=n.length;e<i;++e)for(let i=0,r=n[e].length;i<r;++i)for(let r=0,o=n[e][i].length;r<o;++r){const o=n[e][i][r];t[o.id]={textExpr:o.textExpr,longText:o.longText,quant:o.quant}}return t}(e.drawingsDetails)),(e=En(e)).drawings=qn(e.drawings),e}#In(e){return e.drawingsDetails=Fn(e.drawingsDetails),(e=En(e)).drawings=qn(e.drawings),e}#Tn(e){return(e=En(e)).drawings=qn(e.drawings),e}#Ln(e){return e}}function Rn(t){let n,i,r;const o=new(ln().Layer)({listening:!1,visible:!0}),a="string"==typeof t?JSON.parse(t):t;for(let t=0,l=a.length;t<l;++t)for(let l=0,c=a[t].length;l<c;++l)if(i=a[t][l],0!==i.length){r=new(ln().Group)({id:(s=new e([1,1,t,l]),"slice-"+s.get(2)+"_frame-"+(4===s.length()?s.get(3):0)),name:"position-group",visible:!1});for(let e=0,t=i.length;e<t;++e)n=ln().Node.create(i[e]),n.draggable(!0),n.getChildren().forEach((function(e){e.draggable(!1)})),r.add(n);o.add(r)}var s;return o}function Fn(e){const t={},n=Object.keys(e);for(let i=0,r=n.length;i<r;++i){const r=e[n[i]];t[n[i]]={meta:{textExpr:r.textExpr,longText:r.longText,quantification:r.quant}}}return t}function En(e){const t=e.position;return e.position=[t.i,t.j,t.k],e}function qn(e){const t=e.children;for(let e=0,n=t.length;e<n;++e){const n=t[e],i=n.attrs.id.split("_"),r=parseInt(i[0].substring(6),10),o=parseInt(i[1].substring(6),10);let a="#2-";a+=0===r&&0!==o?o:r,n.attrs.id=a}return e}function Un(e){return new URL(e,window.location.origin)}function Mn(e){const t={};let n=null;if(e&&-1!==(n=e.indexOf("?"))){t.base=e.substring(0,n);let i=e.indexOf("#");-1===i&&(i=e.length);const r=e.substring(n+1,i);t.query=function(e){const t={};if(e){const n=e.split("&");for(let e=0;e<n.length;++e){const i=n[e].split("=");t[i[0]]?(t[i[0]]instanceof Array||(t[i[0]]=[t[i[0]]]),t[i[0]].push(i[1])):t[i[0]]=i[1]}}return t}(r)}return t}class Qn{#Pn=[];#wn=0;#Oe=new He;getStackSize(){return this.#Pn.length}getCurrentStackIndex(){return this.#wn}add(e){this.#Pn=this.#Pn.slice(0,this.#wn),this.#Pn.push(e),++this.#wn,this.#Re({type:"undoadd",command:e.getName()})}undo(){this.#wn>0&&(--this.#wn,this.#Pn[this.#wn].undo(),this.#Re({type:"undo",command:this.#Pn[this.#wn].getName()}))}redo(){this.#wn<this.#Pn.length&&(this.#Pn[this.#wn].execute(),this.#Re({type:"redo",command:this.#Pn[this.#wn].getName()}),++this.#wn)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}}class Bn{#On;#An=null;#pn=[];#bn={};constructor(e){this.#On=e}init(){for(const e in this.#On)this.#On[e].init();this.enableShortcuts(!0)}enableShortcuts(e){e?window.addEventListener("keydown",this.#xn("window","keydown"),!0):window.removeEventListener("keydown",this.#xn("window","keydown"),!0)}getToolList(){return this.#On}hasTool(e){return void 0!==this.getToolList()[e]}getSelectedTool(){return this.#An}getSelectedToolEventHandler(e){return this.getSelectedTool()[e]}setSelectedTool(e){if(!this.hasTool(e))throw new Error("Unknown tool: '"+e+"'");this.#An&&this.#An.activate(!1),this.#An=this.#On[e],this.#An.activate(!0)}setToolFeatures(e){this.getSelectedTool()&&this.getSelectedTool().setFeatures(e)}bindLayerGroup(e,t){const n=e.getDivId();e.addEventListener("activelayerchange",this.#Rn(n)),this.#Fn(n,t)}#Fn(e,t){void 0!==this.#bn[e]&&this.#En(this.#bn[e]),this.#bn[e]=t,this.#qn(t)}#Rn(e){return t=>{const n=t.value[0];this.#Fn(e,n)}}#qn(e){e.bindInteraction();const t=$t;for(let n=0;n<t.length;++n)e.addEventListener(t[n],this.#xn(e.getId(),t[n]))}#En(e){e.unbindInteraction();const t=$t;for(let n=0;n<t.length;++n)e.removeEventListener(t[n],this.#xn(e.getId(),t[n]))}#xn(e,t){if(void 0===this.#pn[e]&&(this.#pn[e]=[]),void 0===this.#pn[e][t]){const n=e=>{if(this.#An){const t=this.#An[e.type];t&&t(e)}};this.#pn[e][t]=n}return this.#pn[e][t]}}class Nn{#Un=[];#Mn=2;#Qn;constructor(e){this.#Qn=e}setNumberOfDimensions(e){this.#Mn=e}setNToLoad(e){for(let t=0;t<e;++t){this.#Un[t]=[];for(let e=0;e<this.#Mn;++e)this.#Un[t][e]=0}}onprogress=e=>{if(!e.lengthComputable)return;if(void 0===e.subindex)return;if(void 0===e.index)return;const t=100*e.loaded/e.total;this.#Un[e.index][e.subindex]=t;let n=null;n=void 0!==e.item?e.item:{loaded:this.#Bn(e.index),total:100,source:e.source},this.#Qn({lengthComputable:!0,loaded:this.#Nn(),total:100,item:n})};#Bn(e){let t=0;for(let n=0;n<this.#Mn;++n)t+=this.#Un[e][n];return t/this.#Mn}#Nn(){let e=0;const t=this.#Un.length;for(let n=0;n<t;++n)e+=this.#Bn(n);return Math.round(e/t)}getMonoProgressHandler(e,t){return n=>{n.index=e,n.subindex=t,this.onprogress(n)}}getUndefinedMonoProgressHandler(e){return t=>{t.subindex=e,this.onprogress(t)}}}class Vn{#Vn=null;#Gn=[];#kn=null;#Hn=0;#zn=0;#Wn;#F;getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}#Yn(e){this.#Vn=e,this.#Hn=0,this.#zn=0,this.#Wn=!1,this.#Xn(),this.#jn()}#Zn(e){this.#Gn.push(e)}#Xn(){this.#Gn=[]}#_n(e){this.#kn=e}#jn(){this.#kn=null}#Kn=e=>{this.#Hn++,this.#Hn===this.#Vn.length&&this.onload({source:this.#Vn})};#Jn=e=>{this.#zn++,this.#zn===this.#Vn.length&&this.onloadend({source:this.#Vn})};#$n(e,t){return n=>{n.source=t,e(n)}}load(e,t){this.onloadstart({source:e}),1===e.length&&(E(e[0],"DICOMDIR")||E(e[0],".dcmdir"))?this.#ei(e[0],t):this.#ti(e,t)}#ni(e,t,n){return i=>{const r=i.target.status;200!==r&&0!==r?(this.onerror({source:t,error:"GET "+i.target.responseURL+" "+i.target.status+" ("+i.target.statusText+")",target:i.target}),this.#Jn()):e.load(i.target.response,t,n)}}#ti(e,t){if(void 0===e||0===e.length)return;this.#Yn(e);const n=new Nn(this.onprogress);n.setNToLoad(e.length);const i=[];for(let e=0;e<ii.length;++e)i.push(new ii[e]);let r=e[0],o=null,a=!1;for(let s=0;s<i.length;++s)if(o=i[s],o.canLoadUrl(r,t)){a=!0,o.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),o.onprogress=n.getUndefinedMonoProgressHandler(1),o.onloaditem=this.onloaditem,o.onload=this.#Kn,o.onloadend=this.#Jn,o.onerror=this.onerror,o.onabort=this.onabort,this.#_n(o);break}if(!a)throw new Error("No loader found for url: "+r);let s=0;const l=()=>{s<this.#Gn.length-1&&!this.#Wn&&(++s,this.#Gn[s].send(null))};for(let i=0;i<e.length;++i){if(r=e[i],!o.canLoadUrl(r,t))throw new Error("Input url of different type: "+r);const a=new XMLHttpRequest;if(a.open("GET",r,!0),void 0!==t){if(void 0!==t.requestHeaders){const e=t.requestHeaders;for(let t=0;t<e.length;++t)void 0!==e[t].name&&void 0!==e[t].value&&a.setRequestHeader(e[t].name,e[t].value)}void 0!==t.withCredentials&&(a.withCredentials=t.withCredentials)}a.onprogress=this.#$n(n.getMonoProgressHandler(i,0),r),a.onload=this.#ni(o,r,i),a.onloadend=l;const s=this.#$n(this.onerror,r);a.onerror=e=>{this.#Jn(),s(e)};const c=this.#$n(this.onabort,r);a.onabort=e=>{this.#Jn(),c(e)},1===o.loadUrlAs()&&(a.responseType="arraybuffer"),this.#Zn(a)}let c=this.#Gn.length;void 0!==t&&void 0!==t.batchSize&&0!==c&&(c=Math.min(t.batchSize,this.#Gn.length));for(let e=0;e<c;++e)this.#Wn||(s=e,this.#Gn[s].send(null))}#ei(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=n=>{const r=n.target.status;if(200!==r&&0!==r)this.onerror({source:e,error:"GET "+n.target.responseURL+" "+n.target.status+" ("+n.target.statusText+")",target:n.target}),this.onloadend({});else{const r=function(e){const t=new ke;t.parse(e);const n=t.getDicomElements();if(void 0===n["00041220"]||void 0===n["00041220"].value)return void i.warn("No Directory Record Sequence found in DICOMDIR.");const r=n["00041220"].value;if(0===r.length)return void i.warn("The Directory Record Sequence of the DICOMDIR is empty.");const o=[];let a=null,s=null;for(let e=0;e<r.length;++e){if(void 0===r[e]["00041430"]||void 0===r[e]["00041430"].value)continue;const t=r[e]["00041430"].value[0];if("STUDY"===t)s=[],o.push(s);else if("SERIES"===t)a=[],s.push(a);else if("IMAGE"===t){if(void 0===r[e]["00041500"]||void 0===r[e]["00041500"].value)continue;const t=r[e]["00041500"].value;a.push(t.join("/"))}}return o}(n.target.response)[0][0],o=e.split("/").slice(0,-1).join("/"),a=[];for(let e=0;e<r.length;++e)a.push(o+"/"+r[e]);this.#ti(a,t)}},n.onerror=t=>{this.#$n(this.onerror,e)(t),this.onloadend({})},n.onabort=t=>{this.#$n(this.onabort,e)(t),this.onloadend({})},n.send(null)}abort(){this.#Wn=!0;for(let e=0;e<this.#Gn.length;++e)4!==this.#Gn[e].readyState&&this.#Gn[e].abort();this.#kn&&this.#kn.isLoading()&&this.#kn.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}class Gn{constructor(e){this.poolSize=e,this.taskQueue=[],this.freeThreads=[];for(let t=0;t<e;++t)this.freeThreads.push(new kn(this));this.runningThreads=[]}addWorkerTask(e){if(this.freeThreads.length===this.poolSize&&this.onworkstart({type:"work-start"}),this.freeThreads.length>0){const t=this.freeThreads.shift();this.runningThreads.push(t),t.run(e)}else this.taskQueue.push(e)}abort(){this.#ii(),this.onabort({type:"work-abort"}),this.onworkend({type:"work-end"})}onTaskEnd(e){if(this.taskQueue.length>0){const t=this.taskQueue.shift();e.run(t)}else{e.stop(),this.freeThreads.push(e);for(let t=0;t<this.runningThreads.length;++t)this.runningThreads[t].getId()===e.getId()&&this.runningThreads.splice(t,1);this.freeThreads.length===this.poolSize&&(this.onwork({type:"work"}),this.onworkend({type:"work-end"}))}}handleWorkerError=e=>{this.#ii(),this.onerror({error:e}),this.onworkend({type:"work-end"})};#ii(){this.taskQueue=[];for(let e=0;e<this.runningThreads.length;++e)this.runningThreads[e].stop();this.runningThreads=[]}onworkstart(e){}onworkitem(e){}onwork(e){}onworkend(e){}onerror(e){}onabort(e){}}class kn{constructor(e){this.parentPool=e,this.id=Math.random().toString(36).substring(2,15),this.runningTask=null,this.worker}getId(){return this.id}run(e){this.runningTask=e,void 0===this.worker&&(this.worker=new Worker(this.runningTask.script),this.worker.onmessage=this.onmessage,this.worker.onerror=this.onerror),this.worker.postMessage(this.runningTask.startMessage)}stop(){void 0!==this.worker&&(this.worker.terminate(),this.worker=void 0)}onmessage=e=>{e.itemNumber=this.runningTask.info.itemNumber,e.numberOfItems=this.runningTask.info.numberOfItems,e.index=this.runningTask.info.index,this.parentPool.onworkitem(e),this.parentPool.onTaskEnd(this)};onerror=e=>{e.itemNumber=this.runningTask.info.itemNumber,e.numberOfItems=this.runningTask.info.numberOfItems,e.index=this.runningTask.info.index,this.parentPool.handleWorkerError(e),this.stop()}}class Hn{constructor(e,t,n){this.script=e,this.startMessage=t,this.info=n}}const zn="undefined"!=typeof JpegImage,Wn="undefined"!=typeof jpeg&&void 0!==jpeg.lossless,Yn="undefined"!=typeof JpxImage,Xn={jpeg2000:"","jpeg-lossless":"","jpeg-baseline":"",rle:""};class jn{#ri;#oi=new Gn(10);#ai=!1;constructor(e,t){this.#ri=e}decode(e,t,n){this.#ai||(this.#ai=!0,this.#oi.onworkstart=this.ondecodestart,this.#oi.onworkitem=this.ondecodeditem,this.#oi.onwork=this.ondecoded,this.#oi.onworkend=this.ondecodeend,this.#oi.onerror=this.onerror,this.#oi.onabort=this.onabort);const i=new Hn(this.#ri,{buffer:e,meta:t},n);this.#oi.addWorkerTask(i)}abort(){this.#oi.abort()}ondecodestart(e){}ondecodeditem(e){}ondecoded(e){}ondecodeend(e){}onerror(e){}onabort(e){}}class Zn{#si;#li;constructor(e,t){this.#si=e,this.#li=t}#ci=0;decode(e,t,n){++this.#ci;let i=null,r=null;if("jpeg-lossless"===this.#si){if(!Wn)throw new Error("No JPEG Lossless decoder provided");const n=t.bitsAllocated/8,o=new Uint8Array(e);i=new jpeg.lossless.Decoder;const a=i.decode(o.buffer,0,o.buffer.byteLength,n);8===t.bitsAllocated?r=t.isSigned?new Int8Array(a.buffer):new Uint8Array(a.buffer):16===t.bitsAllocated&&(r=t.isSigned?new Int16Array(a.buffer):new Uint16Array(a.buffer))}else if("jpeg-baseline"===this.#si){if(!zn)throw new Error("No JPEG Baseline decoder provided");i=new JpegImage,i.parse(e),r=i.getData(i.width,i.height)}else if("jpeg2000"===this.#si){if(!Yn)throw new Error("No JPEG 2000 decoder provided");i=new JpxImage,i.parse(e),r=i.tiles[0].items}else"rle"===this.#si&&(i=new dwvdecoder.RleDecoder,r=i.decode(e,t.bitsAllocated,t.isSigned,t.sliceSize,t.samplesPerPixel,t.planarConfiguration));this.ondecodeditem({data:[r],index:n.index,numberOfItems:n.numberOfItems,itemNumber:n.itemNumber}),this.#ci===this.#li&&(this.ondecoded({}),this.ondecodeend({}))}abort(){this.onabort({}),this.ondecodeend({})}ondecodestart(e){}ondecodeditem(e){}ondecoded(e){}ondecodeend(e){}onerror(e){}onabort(e){}}class _n{#ai=!1;#ui=null;constructor(e,t){void 0!==Xn&&void 0!==Xn[e]?this.#ui=new jn(Xn[e],t):this.#ui=new Zn(e,t)}decode(e,t,n){this.#ai||(this.#ai=!0,this.#ui.ondecodestart=this.ondecodestart,this.#ui.ondecodeditem=this.ondecodeditem,this.#ui.ondecoded=this.ondecoded,this.#ui.ondecodeend=this.ondecodeend,this.#ui.onerror=this.onerror,this.#ui.onabort=this.onabort),this.#ui.decode(e,t,n)}abort(){this.#ui.abort()}ondecodestart(e){}ondecodeditem(e){}ondecoded(e){}ondecodeend(e){}onerror(e){}onabort(e){}}class Kn{#di;setOptions(e){this.#di=e}#ui=null;#hi=[];#Si=[];#gi=[];#mi=[];#pi(e){let t;const n=e["00080060"];return void 0!==n&&"SEG"===n.value[0]&&(t=new Ht),void 0===t&&(t=new St),t}#fi(e,t){const n=this.#hi[e].getDicomElements(),i=this.#mi[e];try{const r=i.create(n,this.#Si[e],this.#di.numberOfFiles);this.onloaditem({data:{image:r,info:n},source:t,warn:i.getWarning()})}catch(e){this.onerror({error:e,source:t}),this.onloadend({source:t})}}#yi(e){this.onprogress({lengthComputable:!0,loaded:e.itemNumber+1,total:e.numberOfItems,index:e.index,source:origin});const t=e.index,n=e.data[0];if(1!==e.numberOfItems){if(void 0===this.#gi[t]){this.#gi[t]=n.length;const r=e.numberOfItems*this.#gi[t];try{this.#Si[t]=new n.constructor(r)}catch(e){if(e instanceof RangeError){const e=Math.floor(Math.log(r)/Math.log(2));i.error("Cannot allocate "+n.constructor.name+" of size: "+r+" (>2^"+e+") for decompressed data.")}return this.#ui.abort(),this.onerror({error:e,source:origin}),void this.onloadend({source:origin})}}n.length!==this.#gi[t]&&i.warn("Unsupported varying decompressed data size: "+n.length+" != "+this.#gi[t]),this.#Si[t].set(n,this.#gi[t]*e.itemNumber)}else this.#Si[t]=n;0===e.itemNumber&&this.#fi(t,origin)}convert(e,t,n){this.onloadstart({source:t,index:n});const i=new ke;let r;void 0!==this.#di.defaultCharacterSet&&i.setDefaultCharacterSet(this.#di.defaultCharacterSet);try{i.parse(e),r=this.#pi(i.getDicomElements()),r.checkElements(i.getDicomElements())}catch(e){return this.onerror({error:e,source:t}),void this.onloadend({source:t})}const o=i.getDicomElements()["7FE00010"].value;i.getDicomElements()["7FE00010"].value=[];const a=function(e){let t=null;return qe(e)?t="jpeg2000":Fe(e)?t="jpeg-baseline":Ee(e)?t="jpeg-lossless":Ue(e)&&(t="rle"),t}(i.getDicomElements()["00020010"].value[0]),s=null!==a;if(this.#hi[n]=i,this.#Si[n]=o[0],this.#mi[n]=r,s){const e={bitsAllocated:i.getDicomElements()["00280100"].value[0],isSigned:1===i.getDicomElements()["00280103"].value[0]},t=i.getDicomElements()["00280011"],r=i.getDicomElements()["00280010"];void 0!==t&&void 0!==r&&(e.sliceSize=t.value[0]*r.value[0]);const s=i.getDicomElements()["00280002"];void 0!==s&&(e.samplesPerPixel=s.value[0]);const l=i.getDicomElements()["00280006"];void 0!==l&&(e.planarConfiguration=l.value[0]);const c=o.length;null===this.#ui&&(this.#ui=new _n(a,c),this.#ui.ondecodeditem=e=>{this.#yi(e),e.itemNumber+1===e.numberOfItems&&(this.onload(e),this.onloadend(e))},this.#ui.onerror=this.onerror,this.#ui.onabort=this.onabort);for(let t=0;t<c;++t)this.#ui.decode(o[t],e,{itemNumber:t,numberOfItems:c,index:n})}else this.onprogress({lengthComputable:!0,loaded:100,total:100,index:n,source:t}),this.#fi(n,t),this.onload({source:t}),this.onloadend({source:t})}abort(){this.#ui&&this.#ui.abort()}onloadstart(e){}onloaditem(e){}onprogress(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}class Jn{#Vn=null;#kn=null;#Hn=0;#zn=0;#F;getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}#Yn(e){this.#Vn=e,this.#Hn=0,this.#zn=0,this.#jn()}#_n(e){this.#kn=e}#jn(){this.#kn=null}#Kn=e=>{this.#Hn++,this.#Hn===this.#Vn.length&&this.onload({source:this.#Vn})};#Jn=e=>{this.#zn++,this.#zn===this.#Vn.length&&this.onloadend({source:this.#Vn})};load(e){if(void 0===e||0===e.length)return;this.#Yn(e),this.onloadstart({source:e});const t=new Nn(this.onprogress);t.setNToLoad(e.length),t.setNumberOfDimensions(1);const n=[];for(let e=0;e<ii.length;++e)n.push(new ii[e]);let i=e[0],r=null,o=!1;for(let a=0;a<n.length;++a)if(r=n[a],r.canLoadMemory(i)){o=!0,r.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),r.onprogress=t.getUndefinedMonoProgressHandler(0),r.onloaditem=this.onloaditem,r.onload=this.#Kn,r.onloadend=this.#Jn,r.onerror=this.onerror,r.onabort=this.onabort,this.#_n(r);break}if(!o)throw new Error("No loader found for data: "+i.filename);for(let t=0;t<e.length;++t){if(i=e[t],!r.canLoadMemory(i))throw new Error("Input data of different type: "+i.filename);r.load(i.data,i.filename,t)}}abort(){this.#kn&&this.#kn.isLoading()&&this.#kn.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}function $n(e){const t=e.data.length,n=new Uint8Array(t/4*3);let i=0;for(let r=0;r<t;r+=4)n[i]=e.data[r],n[i+1]=e.data[r+1],n[i+2]=e.data[r+2],i+=3;return n}function ei(e,t,n,i,r,o){const a=new Ze([e,t,1]),s=new nt([1,1,1]),l=new x(0,0,n),c=new it(l,a,s),u=new Yt(c,i,[o]);u.setPhotometricInterpretation("RGB");const d={BitsStored:8};return void 0!==r&&(d.numberOfFiles=r),u.setMeta(d),u}var ti=o(654),ni=o.n(ti);const ii=[class{#di={};#Di=!1;setOptions(e){this.#di=e}isLoading(){return this.#Di}#Ci=new Kn;load(e,t,n){this.#Di||(this.#Ci.setOptions(this.#di),this.#Ci.onloadstart=this.onloadstart,this.#Ci.onprogress=this.onprogress,this.#Ci.onloaditem=this.onloaditem,this.#Ci.onload=this.onload,this.#Ci.onloadend=e=>{this.#Di=!1,this.onloadend(e)},this.#Ci.onerror=e=>{e.source=t,this.onerror(e)},this.#Ci.onabort=this.onabort),this.#Di=!0,this.#Ci.convert(e,t,n)}abort(){this.#Di=!1,this.#Ci.abort()}canLoadFile(e){const t=M(e.name);return null===t||"dcm"===t}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"dicom"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n){const e="application/dicom";return F(n.value,e)&&"+"!==n.value[e.length]}}}const n=Un(e),i=M(n.pathname),r=null===i,o="dcm"===i,a=n.searchParams.get("contentType");return null!=a?"application/dicom"===a:r||o}canLoadMemory(e){const t=e["Content-Type"];if(void 0!==t&&t.startsWith("application/dicom"))return!0;if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return ri.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Di=!1;setOptions(e){}isLoading(){return this.#Di}load(e,t,n){this.#Di=!0,this.onloadstart({source:t});try{this.onprogress({lengthComputable:!0,loaded:100,total:100,index:n,source:t});const i={data:e,source:t};this.onloaditem(i),this.onload(i)}catch(e){this.onerror({error:e,source:t})}finally{this.#Di=!1,this.onloadend({source:t})}}abort(){this.#Di=!1,this.onabort({}),this.onloadend({})}canLoadFile(e){return"json"===M(e.name)}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"json"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return F(n.value,"application/json")||F(n.value,"application/dicom+json")}}return"json"===M(Un(e).pathname)}canLoadMemory(e){const t=e["Content-Type"];if(void 0!==t&&t.startsWith("application/json"))return!0;if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return ri.Text}loadUrlAs(){return 0}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Di=!1;setOptions(e){}isLoading(){return this.#Di}load(e,t,n){this.onloadstart({source:t}),this.#Di=!0;const i=new Jn;i.onprogress=e=>{e.loaded=50+e.loaded/2,e.index=n,this.onprogress(e)},i.onloaditem=this.onloaditem,i.onload=this.onload,i.onloadend=e=>{this.#Di=!1,this.onloadend(e)},i.onerror=this.onerror,i.onabort=this.onabort,i.load(function(e){const t=new Uint8Array(e),n=[];if(0===t.length)return n;const i=H(new Uint8Array([13,10,13,10]));let r=k(t,i,0);if(void 0===r)throw new Error("Can't find the end of the first multipart header");const o=G(t.slice(0,r)).split("\r\n");let a;for(let e=0;e<o.length;++e)if("-"===o[e][0]&&"-"===o[e][1]){a=o[e];break}if(void 0===a)throw new Error("Can't find the boundary between multi-parts");const s=H(Q(a)),l=a.length;let c=k(t,s,0);for(;void 0!==r;){const e={},o=G(t.slice(c+l,r)).split("\r\n");for(let t=0;t<o.length;++t){const n=o[t],i=n.indexOf(":");if(-1!==i){const t=n.substring(0,i).trim(),r=n.substring(i+1).trim();e[t]=r}}if(c=k(t,s,r),void 0===c)break;const a=r+4,u=c-2;e.data=a<u?t.slice(a,u).buffer:new Uint8Array,n.push(e),r=k(t,i,c+l)}return n}(e))}abort(){this.#Di=!1,this.onabort({}),this.onloadend({})}canLoadFile(e){return!1}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"multipart"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return F(n.value,"multipart/related")}}return!1}canLoadMemory(e){return!1}loadFileAs(){return ri.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#vi=!1;setOptions(e){}isLoading(){return!0}#Ii(e,t){let n=t;n&&"jpg"!==n||(n="jpeg");const i=new Blob([e],{type:"image/"+n});return window.URL.createObjectURL(i)}load(e,t,n){this.#vi=!1;const i=new Image;if(i.onload=()=>{try{if(!this.#vi){this.onprogress({lengthComputable:!0,loaded:100,total:100,index:n,source:t});const e=function(e,t,n){const i=e.width,r=e.height,o=document.createElement("canvas");o.width=i,o.height=r;const a=o.getContext("2d");a.drawImage(e,0,0);const s=a.getImageData(0,0,i,r),l={};"string"==typeof t?l.origin={value:t}:(l.fileName={value:t.name},l.fileType={value:t.type},l.fileLastModifiedDate={value:t.lastModified}),l.imageWidth={value:i},l.imageHeight={value:r};const c=n||0;return l.imageUid={value:c},{data:{image:ei(i,r,c,$n(s),1,c.toString()),info:l},source:t}}(i,t,n);this.onloaditem(e),this.onload(e)}}catch(e){this.onerror({error:e,source:t})}finally{this.onloadend({source:t})}},"string"==typeof e)i.src=e;else if("string"==typeof t){const n=t.split(".").pop().toLowerCase();i.src=this.#Ii(e,n)}}abort(){this.#vi=!0,this.onabort({}),this.onloadend({})}canLoadFile(e){return void 0!==e.type&&null!==e.type.match("image.*")}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"rawimage"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return F(n.value,"image/")}}const n=Un(e),i=M(n.pathname),r="jpeg"===i||"jpg"===i||"png"===i||"gif"===i,o=n.searchParams.get("contentType");return null!=o?"image/jpeg"===o||"image/png"===o||"image/gif"===o:r}canLoadMemory(e){if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return ri.DataURL}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{setOptions(e){}isLoading(){return!0}#Ii(e,t){const n=new Uint8Array(e);let i="";for(let e=0;e<n.byteLength;++e)i+=String.fromCharCode(n[e]);return"data:video/"+t+";base64,"+window.btoa(i)}load(e,t,n){const i=document.createElement("video");if("string"==typeof t){const n=t.split(".").pop().toLowerCase();i.src=this.#Ii(e,n)}else i.src=e;i.onloadedmetadata=e=>{try{!function(e,t,n,i,r,o,a){const s=e.videoWidth,l=e.videoHeight,c=Math.ceil(30*e.duration),u={};"string"==typeof o?u.origin={value:o}:(u.fileName={value:o.name},u.fileType={value:o.type},u.fileLastModifiedDate={value:o.lastModified}),u.imageWidth={value:s},u.imageHeight={value:l},u.numberOfFrames={value:c},u.imageUid={value:0};const d=document.createElement("canvas");d.width=s,d.height=l;const h=d.getContext("2d");e.addEventListener("seeked",(function d(p){(function(){i({lengthComputable:!0,loaded:S,total:c,index:a,source:o}),h.drawImage(e,0,0);const n=$n(h.getImageData(0,0,s,l));0===S?(g=ei(s,l,1,n,c,a.toString()),t({data:{image:g,info:u},source:o})):g.appendFrameBuffer(n,S),++S})(),m+=1/30,m<=p.target.duration?this.currentTime=m:(n({source:o}),r({source:o}),e.removeEventListener("seeked",d))}),!1);let S=0,g=null,m=0;e.currentTime=m}(e.target,this.onloaditem,this.onload,this.onprogress,this.onloadend,t,n)}catch(e){this.onerror({error:e,source:t}),this.onloadend({source:t})}}}abort(){this.onabort({}),this.onloadend({})}canLoadFile(e){return void 0!==e.type&&null!==e.type.match("video.*")}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"rawvideo"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return F(n.value,"video/")}}const n=M(Un(e).pathname);return"mp4"===n||"ogg"===n||"webm"===n}canLoadMemory(e){if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return ri.DataURL}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Di=!1;setOptions(e){}isLoading(){return this.#Di}#Ti="";#Li=[];#Pi=null;#wi(e,t,n){this.#Li.push({filename:this.#Ti,data:e});const i=100*this.#Li.length/this.#Pi.length;if(this.onprogress({lengthComputable:!0,loaded:i/2,total:100,index:n,item:{loaded:i,total:100,source:t}}),this.#Li.length<this.#Pi.length){const e=this.#Li.length;this.#Ti=this.#Pi[e].name,this.#Pi[e].async("arrayBuffer").then((e=>{this.#wi(e,t,n)}))}else{const e=new Jn;e.onprogress=e=>{e.loaded=50+e.loaded/2,e.index=n,this.onprogress(e)},e.onloaditem=this.onloaditem,e.onload=this.onload,e.onloadend=e=>{this.#Di=!1,this.onloadend(e)},e.onerror=this.onerror,e.onabort=this.onabort,e.load(this.#Li)}}load(e,t,n){this.onloadstart({source:t}),this.#Di=!0,ni().loadAsync(e).then((e=>{this.#Li=[],this.#Pi=e.file(/.*\.dcm/);const i=this.#Li.length;this.#Ti=this.#Pi[i].name,this.#Pi[i].async("arrayBuffer").then((e=>{this.#wi(e,t,n)}))}))}abort(){this.#Di=!1,this.onabort({}),this.onloadend({})}canLoadFile(e){return"zip"===M(e.name)}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"zip"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return F(n.value,"application/zip")}}return"zip"===M(Un(e).pathname)}canLoadMemory(e){const t=e["Content-Type"];if(void 0!==t&&t.startsWith("application/zip"))return!0;if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return ri.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}],ri={Text:0,ArrayBuffer:1,DataURL:2};class oi{#Vn=null;#Oi=[];#kn=null;#Hn=0;#zn=0;#F;getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}#Yn(e){this.#Vn=e,this.#Hn=0,this.#zn=0,this.#Ai(),this.#jn()}#bi(e){this.#Oi.push(e)}#Ai(){this.#Oi=[]}#_n(e){this.#kn=e}#jn(){this.#kn=null}#Kn=e=>{this.#Hn++,this.#Hn===this.#Vn.length&&this.onload({source:this.#Vn})};#Jn=e=>{this.#zn++,this.#zn===this.#Vn.length&&this.onloadend({source:this.#Vn})};#$n(e,t){return n=>{n.source=t,e(n)}}#ni(e,t,n){return i=>{e.load(i.target.result,t,n)}}load(e){if(void 0===e||0===e.length)return;this.#Yn(e),this.onloadstart({source:e});const t=new Nn(this.onprogress);t.setNToLoad(e.length);const n=[];for(let e=0;e<ii.length;++e)n.push(new ii[e]);let i=e[0],r=null,o=!1;for(let a=0;a<n.length;++a)if(r=n[a],r.canLoadFile(i)){o=!0,r.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),r.onprogress=t.getUndefinedMonoProgressHandler(1),r.onloaditem=this.onloaditem,r.onload=this.#Kn,r.onloadend=this.#Jn,r.onerror=this.onerror,r.onabort=this.onabort,this.#_n(r);break}if(!o)throw new Error("No loader found for file: "+i.name);for(let n=0;n<e.length;++n){if(i=e[n],!r.canLoadFile(i))throw new Error("Input file of different type: "+i);const o=new FileReader;this.#bi(o),o.onprogress=this.#$n(t.getMonoProgressHandler(n,0),i),o.onload=this.#ni(r,i,n);const a=this.#$n(this.onerror,i);o.onerror=e=>{this.#Jn(),a(e)};const s=this.#$n(this.onabort,i);o.onabort=e=>{this.#Jn(),s(e)},r.loadFileAs()===ri.Text?o.readAsText(i):r.loadFileAs()===ri.DataURL?o.readAsDataURL(i):r.loadFileAs()===ri.ArrayBuffer&&o.readAsArrayBuffer(i)}}abort(){for(let e=0;e<this.#Oi.length;++e)1===this.#Oi[e].readyState&&this.#Oi[e].abort();this.#kn&&this.#kn.isLoading()&&this.#kn.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}class ai{#F;#xi={};constructor(e){this.#F=e}loadFiles(e,t){"json"===e[0].name.split(".").pop().toLowerCase()?this.#Ri(e[0],t):this.#Fi(e,t)}loadURLs(e,t,n){"json"===e[0].split(".").pop().toLowerCase()?this.#Ei(e[0],t,n):this.#qi(e,t,n)}loadImageObject(e,t){const n=new Jn;this.#Ui(e,n,"image",t)}getLoadingDataIds(){return Object.keys(this.#xi)}abort(e){void 0!==this.#xi[e]&&(this.#xi[e].loader.abort(),delete this.#xi[e])}#Fi(e,t){const n=new oi;n.setDefaultCharacterSet(this.#F),this.#Ui(e,n,"image",t)}#qi(e,t,n){const i=new Vn;i.setDefaultCharacterSet(this.#F),this.#Ui(e,i,"image",t,n)}#Ri(e,t){const n=new oi;this.#Ui([e],n,"state",t)}#Ei(e,t,n){const i=new Vn;this.#Ui([e],i,"state",t,n)}#Ui(e,t,n,i,r){const o={loadtype:n,dataid:i};t.onloadstart=e=>{this.#xi[i]={loader:t,isFirstItem:!0},this.#$n(this.onloadstart,o)(e)},t.onprogress=this.#$n(this.onprogress,o),t.onloaditem=e=>{const t={loadtype:n,dataid:i};void 0!==this.#xi[i]&&(t.isfirstitem=this.#xi[i].isFirstItem),this.#$n(this.onloaditem,t)(e),void 0!==this.#xi[i]&&this.#xi[i].isFirstItem&&(this.#xi[i].isFirstItem=!1)},t.onload=this.#$n(this.onload,o),t.onloadend=e=>{delete this.#xi[i],this.#$n(this.onloadend,o)(e)},t.onerror=this.#$n(this.onerror,o),t.onabort=this.#$n(this.onabort,o);try{t.load(e,r)}catch(e){return this.onerror({error:e,dataid:i}),void this.onloadend({dataid:i})}}#$n(e,t){return function(n){const i=Object.keys(t);for(let e=0;e<i.length;++e){const r=i[e];n[r]=t[r]}e(n)}}onloadstart(e){}onprogress(e){}onload(e){}onloaditem(e){}onloadend(e){}onerror(e){}onabort(e){}}class si{image;meta;constructor(e,t){this.image=e,this.meta=t}}class li{#Mi={};#Qi=-1;#Oe=new He;getNextDataId(){return++this.#Qi,this.#Qi.toString()}getDataIds(){return Object.keys(this.#Mi)}reset(){this.#Mi={}}get(e){return this.#Mi[e]}getDataIdsFromSopUids(e){const t=[];if(void 0===e||0===e.length)return t;const n=Object.keys(this.#Mi);for(const i of n)this.#Mi[i].image.containsImageUids(e)&&t.push(i);return t}setImage(e,t){this.#Mi[e].image=t,this.#Re({type:"imageset",value:[t],dataid:e}),t.addEventListener("imagecontentchange",this.#Bi(e)),t.addEventListener("imagegeometrychange",this.#Bi(e))}addNew(e,t,n){if(void 0!==this.#Mi[e])throw new Error("Data id already used in storage: "+e);this.#Mi[e]=new si(t,n),t.addEventListener("imagecontentchange",this.#Bi(e)),t.addEventListener("imagegeometrychange",this.#Bi(e))}remove(e){void 0!==this.#Mi[e]&&(this.#Mi[e].image.removeEventListener("imagecontentchange",this.#Bi(e)),this.#Mi[e].image.removeEventListener("imagegeometrychange",this.#Bi(e)),this.#Re({type:"imageremove",dataid:e}),delete this.#Mi[e])}update(e,t,n){if(void 0===this.#Mi[e])throw new Error("Cannot find data to update: "+e);const i=this.#Mi[e];i.image.appendSlice(t);let r="";r=void 0!==n["00020010"]?"00200013":"imageUid",i.meta=function(e,t,n,i){const r={};if(!n)throw new Error("Cannot merge object with an undefined id key: "+n);if(!Object.prototype.hasOwnProperty.call(e,n))throw new Error("Id key not found in first object while merging: "+n+", obj: "+e);if(!Object.prototype.hasOwnProperty.call(t,n))throw new Error("Id key not found in second object while merging: "+n+", obj: "+t);let o=!1;if(Object.prototype.hasOwnProperty.call(e[n],"merged")&&e[n].merged&&(o=!0),!Object.prototype.hasOwnProperty.call(e[n],i))throw new Error("Id value not found in first object while merging: "+n+", valueKey: "+i+", ojb: "+e);if(!Object.prototype.hasOwnProperty.call(t[n],i))throw new Error("Id value not found in second object while merging: "+n+", valueKey: "+i+", ojb: "+t);let a=e[n][i];const s=t[n][i][0];if(r[n]=e[n],o){for(let e=0;e<a.length;++e)if(a[e]===s)throw new Error("The first object already contains id2: "+s+", id1: "+a);r[n][i].push(s)}else{if(a=a[0],a===s)throw new Error("Cannot merge object with same ids: "+a+", id2: "+s);r[n][i].push(s),r[n].merged=!0}const l=Object.keys(e),c=Object.keys(t).filter((function(e){return l.indexOf(e)<0})),u=l.concat(c);for(let l=0;l<u.length;++l){const c=u[l];if(c!==n){let n,l,u,d,h;if(Object.prototype.hasOwnProperty.call(e,c)&&(n=e[c],Object.prototype.hasOwnProperty.call(n,i)&&(l=n[i])),Object.prototype.hasOwnProperty.call(t,c)&&(u=t[c],Object.prototype.hasOwnProperty.call(u,i)&&(d=u[i])),void 0!==n?h=n:void 0!==u&&(h=u),!V(l,d))if(o){if(Array.isArray(l)){h[i]={};for(let e=0;e<a.length;++e)h[i][a[e]]=l}else h[i]=l;h[i][s]=d}else{const e={};e[a]=l,e[s]=d,h[i]=e}r[c]=h}}return r}(i.meta,n,r,"value")}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};#Bi(e){return t=>{t.dataid=e,this.#Re(t)}}}function ci(e){return function(t){return Number(t).toPrecision(e)}}function ui(e){let t="";for(let n=0;n<e;++n)0!==n&&(t+=", "),t+="{v"+n+"}";return t}function di(e,t){let n=e;for(let e=0;e<t.length;++e)n=n.replace("{v"+e+"}",t[e]);return n}class hi{#Ni;#We;#Vi;#Gi=[];#ki;#Hi=[];#zi;#Oe=new He;constructor(e,t,n){this.#Ni=e,this.#We=t,this.#Vi=n;const i=Object.keys(this.#Vi);for(let e=0;e<i.length;++e){const t=this.#Vi[i[e]];for(let e=0;e<t.length;++e){const n=t[e].event;void 0!==n&&(this.#Gi.includes(n)||this.#Gi.push(n))}}this.addAppListeners()}reset(){this.#Hi=[],this.#zi=void 0}addItemMeta(e){let t;if(void 0!==e["00020010"])t=void 0!==e["00080018"]?e["00080018"].value[0]:e.length,this.#Hi[t]=function(e,t){const n=[];let i;const r=e["00080060"];if(void 0===r)return n;i=r.value[0];const o=t[i]||t["*"];if(!o)return n;for(let t=0;t<o.length;++t){const i=JSON.parse(JSON.stringify(o[t])),r=i.tags;if(void 0!==r&&0!==r.length){const t=[];for(let n=0;n<r.length;++n)void 0!==e[r[n]]?t.push(e[r[n]].value):t.push("");void 0!==i.format&&null!==i.format||(i.format=ui(t.length)),i.value=di(i.format,t).trim()}n.push(i)}const a=e["00200020"];if(void 0!==a&&2===a.value.length){const e=a.value[0],t=a.value[1];n.push({pos:"cr",value:e,format:"{v0}"}),n.push({pos:"cl",value:Ae(e),format:"{v0}"}),n.push({pos:"bc",value:t,format:"{v0}"}),n.push({pos:"tc",value:Ae(t),format:"{v0}"})}return n}(e,this.#Vi);else{const n=Object.keys(e);for(let i=0;i<n.length;++i){const r=e[n[i]];if("imageUid"===n[i]){t=r.value;break}}this.#Hi[t]=function(e,t){const n=[],i=t.DOM;if(!i)return n;const r=Object.keys(e);for(let t=0;t<i.length;++t){const o=JSON.parse(JSON.stringify(i[t])),a=o.tags;if(void 0!==a&&0!==a.length){const t=[];for(let n=0;n<a.length;++n)for(let i=0;i<r.length;++i)a[n]===r[i]&&t.push(e[r[i]].value);void 0!==o.format&&null!==o.format||(o.format=ui(t.length)),o.value=di(o.format,t).trim()}n.push(o)}return n}(e,this.#Vi)}this.#zi=t}#Wi=e=>{e.dataid===this.#We&&void 0!==e.data&&void 0!==e.data.imageUid&&this.#zi!==e.data.imageUid&&(this.#zi=e.data.imageUid,this.#Yi(e))};#Yi=e=>{if(e.dataid!==this.#We)return;const t=this.#Hi[this.#zi];if(void 0!==t){for(let n=0;n<t.length;++n){let i;if(void 0!==t[n].tags)"positionchange"===e.type&&(i=t[n].value);else if(void 0!==t[n].event&&t[n].event===e.type){const r=t[n].format;let o=e.value;if(void 0!==t[n].precision){let e=null;e="round"===t[n].precision?Math.round:ci(t[n].precision),o=o.map(e)}i=di(r,o)}void 0!==i&&(t[n].value=i)}this.#Re({type:"valuechange",data:t})}else console.warn("No slice overlay data for: "+this.#zi)};isListening(){return this.#ki}addAppListeners(){this.#Ni.addEventListener("positionchange",this.#Wi);for(let e=0;e<this.#Gi.length;++e)this.#Ni.addEventListener(this.#Gi[e],this.#Yi);this.#ki=!0}removeAppListeners(){this.#Ni.removeEventListener("positionchange",this.#Wi);for(let e=0;e<this.#Gi.length;++e)this.#Ni.removeEventListener(this.#Gi[e],this.#Yi);this.#ki=!1}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re(e){this.#Oe.fireEvent(e)}}class Si{#Xi=0;getSum(){return this.#Xi}add(e){this.#Xi+=function(e){if(void 0===e.wheelDeltaY)return-e.deltaY;{const t=45;return e.wheelDeltaY>t?1:e.wheelDeltaY<-t?-1:-e.deltaY/60}}(e)}clear(){this.#Xi=0}isTick(){return Math.abs(this.#Xi)>=1}}class gi{#Ni;#ji=new Si;constructor(e){this.#Ni=e}wheel(e){this.#ji.add(e);const t=this.#ji.getSum()>=0;if(!this.#ji.isTick())return;this.#ji.clear(),e.preventDefault();const n=Pn(e),i=this.#Ni.getLayerGroupByDivId(n.groupDivId),r=i.getActiveViewLayer().getViewController();let o;i.canScroll()?o=t?r.getIncrementScrollPosition():r.getDecrementScrollPosition():i.moreThanOne(3)&&(o=t?r.getIncrementPosition(3):r.getDecrementPosition(3)),void 0!==o&&i.isPositionInBounds(o)&&r.setCurrentPosition(o)}}const mi={t(e){const t=e.split(".");if(2!==t.length)throw new Error("Unexpected translation key length.");if("unit"!==t[0])throw new Error("Unexpected translation key prefix.");return{mm:"mm",cm2:"cm²",degree:"°"}[t[1]]}};class pi{#Zi;#_i;constructor(e,t){this.#Zi=e,this.#_i=t}getBegin(){return this.#Zi}getEnd(){return this.#_i}equals(e){return null!==e&&this.getBegin().equals(e.getBegin())&&this.getEnd().equals(e.getEnd())}getDeltaX(){return this.getEnd().getX()-this.getBegin().getX()}getDeltaY(){return this.getEnd().getY()-this.getBegin().getY()}getLength(){return Math.sqrt(this.getDeltaX()*this.getDeltaX()+this.getDeltaY()*this.getDeltaY())}getWorldLength(e){let t=null;if(null!==e){const n=this.getDeltaX()*e.x,i=this.getDeltaY()*e.y;t=Math.sqrt(n*n+i*i)}return t}getMidpoint(){return new b((this.getBegin().getX()+this.getEnd().getX())/2,(this.getBegin().getY()+this.getEnd().getY())/2)}getSlope(){return this.getDeltaY()/this.getDeltaX()}getIntercept(){return(this.getEnd().getX()*this.getBegin().getY()-this.getBegin().getX()*this.getEnd().getY())/this.getDeltaX()}getInclination(){return 180-180*Math.atan2(this.getDeltaY(),this.getDeltaX())/Math.PI}quantify(e){const t={},n=e.get2DSpacing(),i=this.getWorldLength(n);return null!==i&&(t.length={value:i,unit:mi.t("unit.mm")}),t}}function fi(e,t){const n=e.getDeltaX(),i=e.getDeltaY(),r=t.getDeltaX(),o=t.getDeltaY(),a=n*r+i*o,s=n*o-i*r;return 360-(180-180*Math.atan2(s,a)/Math.PI)}function yi(e,t,n){let i=0,r=0,o=0,a=0;if(0!==e.getSlope()){const s=-1/e.getSlope(),l=t.getY()-s*t.getX(),c=n/(2*Math.sqrt(1+s*s));i=t.getX()-c,r=s*i+l,o=t.getX()+c,a=s*o+l}else i=t.getX(),r=t.getY()-n/2,o=t.getX(),a=t.getY()+n/2;return new pi(new b(i,r),new b(o,a))}function Di(e,t,n,i){const r=i.applyZoomScale(3),o={x:Math.abs(r.x),y:Math.abs(r.y)};return new(ln().Ellipse)({x:e,y:t,stroke:"#999",fill:"rgba(100,100,100,0.7",strokeWidth:i.getStrokeWidth(),strokeScaleEnabled:!1,radius:o,radiusX:o.x,radiusY:o.y,name:"anchor",id:n.toString(),dragOnTop:!1,draggable:!0,visible:!1})}class Ci{#Ni;constructor(e){this.#Ni=e}#Ki=null;#Ji=null;#$i=null;#Xt;#tt=null;#er=!1;#tr=null;setFactoryList(e){this.#Ki=e}setShape(e,t,n){if(this.#$i=e,this.#Xt=t,this.#tt=n,this.#$i){this.#nr();const e=this.#$i.getParent(),t=Object.keys(this.#Ki);this.#Ji=null;for(let n=0;n<t.length;++n){const i=new this.#Ki[t[n]];if(i.isFactoryGroup(e)){this.#Ji=i;break}}if(null===this.#Ji)throw new Error("Could not find a factory to update shape.");this.#ir()}}getShape(){return this.#$i}isActive(){return this.#er}setDrawEventCallback(e){this.#tr=e}enable(){this.#er=!0,this.#$i&&(this.#rr(!0),this.#$i.getLayer()&&this.#$i.getLayer().draw())}disable(){this.#er=!1,this.#$i&&(this.#rr(!1),this.#$i.getLayer()&&this.#$i.getLayer().draw())}reset(){this.#$i=void 0,this.#Xt=void 0,this.#tt=void 0}resetAnchors(){this.#nr(),this.#ir(),this.#rr(!0)}#or(e){this.#$i&&this.#$i.getParent()&&this.#$i.getParent().find(".anchor").forEach(e)}#rr(e){this.#or((function(t){t.visible(e)}))}setAnchorsActive(e){let t=null;t=e?e=>{this.#ar(e)}:e=>{this.#sr(e)},this.#or(t)}#nr(){this.#or((function(e){e.remove()}))}#ir(){if(!this.#$i||!this.#$i.getLayer())return;const e=this.#$i.getParent(),t=this.#Ji.getAnchors(this.#$i,this.#Ni.getStyle());for(let n=0;n<t.length;++n)this.#ar(t[n]),e.add(t[n])}#lr(e){const t=e.getParent(),n=e.id(),i=e.x(),r=e.y();return{getParent:function(){return t},id:function(){return n},x:function(){return i},y:function(){return r}}}#ar(e){let t=null;const n=un(this.#$i);e.on("dragstart.edit",(e=>{const n=e.target;n instanceof ln().Shape&&(t=this.#lr(n),e.cancelBubble=!0)})),e.on("dragmove.edit",(e=>{const t=e.target;t instanceof ln().Shape&&(function(e,t){const n=t.getParent();Ii(t,new b(-n.x(),-n.y()),new b(e.x-n.x(),e.y-n.y()))}(this.#Xt.getBaseSize(),t),this.#Ji.update(t,this.#Ni.getStyle(),this.#tt),t.getLayer()?t.getLayer().draw():i.warn("No layer to draw the anchor!"),e.cancelBubble=!0)})),e.on("dragend.edit",(e=>{const i=e.target;if(!(i instanceof ln().Shape))return;const r=this.#lr(i),o=new Sn(n,this.#Ji,t,r,this.#Xt,this.#tt,this.#Ni.getStyle());o.onExecute=this.#tr,o.onUndo=this.#tr,o.execute(),this.#Ni.addToUndoStack(o),t=r,e.cancelBubble=!0})),e.on("mousedown touchstart",(e=>{e.target.moveToTop()})),e.on("mouseover.edit",(e=>{const t=e.target;t instanceof ln().Shape&&(t.stroke("#ddd"),t.getLayer()?t.getLayer().draw():i.warn("No layer to draw the anchor!"))})),e.on("mouseout.edit",(e=>{const t=e.target;t instanceof ln().Shape&&(t.stroke("#999"),t.getLayer()?t.getLayer().draw():i.warn("No layer to draw the anchor!"))}))}#sr(e){e.off("dragstart.edit"),e.off("dragmove.edit"),e.off("dragend.edit"),e.off("mousedown touchstart"),e.off("mouseover.edit"),e.off("mouseout.edit")}}class vi{#cr;constructor(){this.createTrashIcon()}createTrashIcon(){this.#cr=new(ln().Group);const e=new(ln().Line)({points:[-10,-10,10,10],stroke:"red"}),t=new(ln().Line)({points:[10,-10,-10,10],stroke:"red"});this.#cr.width(20),this.#cr.height(20),this.#cr.add(e),this.#cr.add(t)}activate(e){const t=e.getKonvaStage(),n=t.scale(),i=e.getKonvaLayer(),r={x:1/n.x,y:1/n.y};this.#cr.x(t.offset().x+t.width()/(2*n.x)),this.#cr.y(t.offset().y+t.height()/(15*n.y)),this.#cr.scale(r),i.add(this.#cr),i.draw()}changeChildrenColourOnTrashHover(e,t,n){if(this.isOverTrash(e))return this.changeGroupChildrenColour(this.#cr,"orange"),void this.changeGroupChildrenColour(t,"red");this.changeGroupChildrenColour(this.#cr,"red"),this.changeGroupChildrenColour(t,n)}changeGroupChildrenColour(e,t){e.getChildren().forEach((function(e){e instanceof ln().Shape&&void 0!==e.stroke&&e.stroke(t)}))}remove(){this.#cr.remove()}isOverTrash(e){const t=this.#cr.width()*Math.abs(this.#cr.scaleX())/2,n=this.#cr.height()*Math.abs(this.#cr.scaleY())/2;return Math.abs(e.x-this.#cr.x())<t&&Math.abs(e.y-this.#cr.y())<n}}function Ii(e,t,n){let i=!1;return e.x()<t.getX()?(e.x(t.getX()),i=!0):e.x()>n.getX()&&(e.x(n.getX()),i=!0),e.y()<t.getY()?(e.y(t.getY()),i=!0):e.y()>n.getY()&&(e.y(n.getY()),i=!0),i}class Ti{#ur=[];getPoint(e){return this.#ur[e]}getLength(){return this.#ur.length}addPoint(e){this.#ur.push(e)}addPoints(e){this.#ur=this.#ur.concat(e)}}const Li={labelText:{arrow:{"*":""},circle:{"*":"{surface}"},ellipse:{"*":"{surface}"},freeHand:{"*":""},protractor:{"*":"{angle}"},rectangle:{"*":"{surface}"},roi:{"*":""},ruler:{"*":"{length}"}}};class Pi{getGroupName(){return"roi-group"}getNPoints(){}getTimeout(){return 100}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new Ti;i.addPoints(e);const r=[];for(let e=0;e<i.getLength();++e)r.push(i.getPoint(e).getX()),r.push(i.getPoint(e).getY());const o=new(ln().Line)({points:r,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape",closed:!0}),a=new(ln().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),name:"text"});let s="";if(void 0!==n){const e=n.getModality();s=void 0!==Li.labelText.roi[e]?Li.labelText.roi[e]:Li.labelText.roi["*"]}a.setText(s),a.meta={textExpr:s,quantification:{}};const l=new(ln().Label)({x:i.getPoint(0).getX(),y:i.getPoint(0).getY()+t.scale(10),scale:t.applyZoomScale(1),visible:0!==s.length,name:"label"});l.add(a),l.add(new(ln().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const c=new(ln().Group);return c.name(this.getGroupName()),c.add(l),c.add(o),c.visible(!0),c}getAnchors(e,t){const n=e.points(),i=[];for(let r=0;r<n.length;r+=2){const o=n[r]+e.x(),a=n[r+1]+e.y(),s=r.toString();i.push(Di(o,a,s,t))}return i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof ln().Line))return;const o=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(o instanceof ln().Label))return;const a=i.getChildren((function(t){return t.id()===e.id()}))[0];a.x(e.x()),a.y(e.y());const s=r.points(),l=parseInt(e.id(),10);s[l]=e.x()-r.x(),s[l+1]=e.y()-r.y(),r.points(s);const c=o.getText(),u=c.meta;c.setText(u.textExpr);const d={x:s[0]+r.x(),y:s[1]+r.y()+t.scale(10)};o.position(d)}}var wi=o(324),Oi=o.n(wi);class Ai{constructor(e,t){this.pointArray=e?e.slice():[],this.controlPointIndexArray=t?t.slice():[]}getPoint(e){return this.pointArray[e]}isControlPoint(e){const t=this.pointArray.indexOf(e);if(-1!==t)return-1!==this.controlPointIndexArray.indexOf(t);throw new Error("Error: isControlPoint called with not in list point.")}getLength(){return this.pointArray.length}addPoint(e){this.pointArray.push(e)}addControlPoint(e){const t=this.pointArray.indexOf(e);if(-1===t)throw new Error("Cannot mark a non registered point as control point.");this.controlPointIndexArray.push(t)}addPoints(e){this.pointArray=this.pointArray.concat(e)}appenPath(e){const t=this.pointArray.length;this.pointArray=this.pointArray.concat(e.pointArray);const n=[];for(let i=0;i<e.controlPointIndexArray.length;++i)n[i]=e.controlPointIndexArray[i]+t;this.controlPointIndexArray=this.controlPointIndexArray.concat(n)}}class bi{constructor(e,t){this.bucketCount=1<<e,this.mask=this.bucketCount-1,this.size=0,this.loc=0,this.cost=void 0!==t?t:function(e){return e},this.buckets=this.buildArray(this.bucketCount)}push(e){const t=this.getBucket(e);e.next=this.buckets[t],this.buckets[t]=e,this.size++}pop(){if(0===this.size)throw new Error("Cannot pop, bucketQueue is empty.");for(;null===this.buckets[this.loc];)this.loc=(this.loc+1)%this.bucketCount;const e=this.buckets[this.loc];return this.buckets[this.loc]=e.next,e.next=null,this.size--,e}remove(e){if(!e)return!1;const t=this.getBucket(e);let n=this.buckets[t];for(;null!==n&&(null===n.next||e.x!==n.next.x||e.y!==n.next.y);)n=n.next;return null!==n&&(n.next=n.next.next,this.size--,!0)}isEmpty(){return 0===this.size}getBucket(e){return this.cost(e)&this.mask}buildArray(e){const t=new Array(e);for(let e=0;e<t.length;e++)t[e]=null;return t}}const xi=2/(3*Math.PI);function Ri(e,t,n,i,r){const o=e[i][n],a=t[i][n];let s=Math.sqrt(o*o+a*a);s=Math.max(s,1e-100),r.x=o/s,r.y=a/s}class Fi{constructor(){this.width=-1,this.height=-1,this.curPoint=null,this.searchGranBits=8,this.searchGran=1<<this.searchGranBits,this.pointsPerPost=500,this.greyscale=null,this.laplace=null,this.gradient=null,this.gradX=null,this.gradY=null,this.parents=null,this.working=!1,this.trained=!1,this.trainingPoints=null,this.edgeWidth=2,this.trainingLength=32,this.edgeGran=256,this.edgeTraining=null,this.gradPointsNeeded=32,this.gradGran=1024,this.gradTraining=null,this.insideGran=256,this.insideTraining=null,this.outsideGran=256,this.outsideTraining=null}getTrainingIdx(e,t){return Math.round((e-1)*t)}getTrainedEdge(e){return this.edgeTraining[this.getTrainingIdx(this.edgeGran,e)]}getTrainedGrad(e){return this.gradTraining[this.getTrainingIdx(this.gradGran,e)]}getTrainedInside(e){return this.insideTraining[this.getTrainingIdx(this.insideGran,e)]}getTrainedOutside(e){return this.outsideTraining[this.getTrainingIdx(this.outsideGran,e)]}setWorking(e){this.working=e}setDimensions(e,t){this.width=e,this.height=t}setData(e){if(-1===this.width||-1===this.height)throw new Error("Dimensions have not been set.");this.greyscale=function(e,t,n){const i={data:[]};for(let r=0;r<n;r++){i.data[r]=[];for(let n=0;n<t;n++){const o=4*(r*t+n);i.data[r][n]=(e[o]+e[o+1]+e[o+2])/765}}return i.dx=function(e,t){return e+1===this.data[t].length&&e--,this.data[t][e+1]-this.data[t][e]},i.dy=function(e,t){return t+1===this.data.length&&t--,this.data[t][e]-this.data[t+1][e]},i.gradMagnitude=function(e,t){const n=this.dx(e,t),i=this.dy(e,t);return Math.sqrt(n*n+i*i)},i.laplace=function(e,t){let n=-16*this.data[t][e];return n+=this.data[t-2][e],n+=this.data[t-1][e-1]+2*this.data[t-1][e]+this.data[t-1][e+1],n+=this.data[t][e-2]+2*this.data[t][e-1]+2*this.data[t][e+1]+this.data[t][e+2],n+=this.data[t+1][e-1]+2*this.data[t+1][e]+this.data[t+1][e+1],n+=this.data[t+2][e],n},i}(e,this.width,this.height),this.laplace=function(e){const t=[];t[0]=[],t[1]=[];for(let n=1;n<e.data.length;n++)t[0][n]=1,t[1][n]=1;for(let n=2;n<e.data.length-2;n++){t[n]=[],t[n][0]=1,t[n][1]=1;for(let i=2;i<e.data[n].length-2;i++)t[n][i]=e.laplace(i,n)>.33?0:1;t[n][e.data[n].length-2]=1,t[n][e.data[n].length-1]=1}t[e.data.length-2]=[],t[e.data.length-1]=[];for(let n=1;n<e.data.length;n++)t[e.data.length-2][n]=1,t[e.data.length-1][n]=1;return t}(this.greyscale),this.gradient=function(e){const t=[];let n=0,i=0,r=0;for(r=0;r<e.data.length-1;r++){for(t[r]=[],i=0;i<e.data[r].length-1;i++)t[r][i]=e.gradMagnitude(i,r),n=Math.max(t[r][i],n);t[r][e.data[r].length-1]=t[r][e.data.length-2]}t[e.data.length-1]=[];for(let n=0;n<t[0].length;n++)t[e.data.length-1][n]=t[e.data.length-2][n];for(r=0;r<t.length;r++)for(i=0;i<t[r].length;i++)t[r][i]=1-t[r][i]/n;return t}(this.greyscale),this.gradX=function(e){const t=[];for(let n=0;n<e.data.length;n++){t[n]=[];for(let i=0;i<e.data[n].length-1;i++)t[n][i]=e.dx(i,n);t[n][e.data[n].length-1]=t[n][e.data[n].length-2]}return t}(this.greyscale),this.gradY=function(e){const t=[];for(let n=0;n<e.data.length-1;n++){t[n]=[];for(let i=0;i<e.data[n].length;i++)t[n][i]=e.dy(i,n)}t[e.data.length-1]=[];for(let n=0;n<e.data[0].length;n++)t[e.data.length-1][n]=t[e.data.length-2][n];return t}(this.greyscale);const t=function(e,t,n,i){const r={inside:[],outside:[]},o={x:-1,y:-1};for(let a=0;a<t.length;a++){r.inside[a]=[],r.outside[a]=[];for(let s=0;s<t[a].length;s++){Ri(t,n,s,a,o);let l=Math.round(s+e*o.y),c=Math.round(a-e*o.x),u=Math.round(s-e*o.y),d=Math.round(a+e*o.x);l=Math.max(Math.min(l,t[a].length-1),0),u=Math.max(Math.min(u,t[a].length-1),0),c=Math.max(Math.min(c,t.length-1),0),d=Math.max(Math.min(d,t.length-1),0),r.inside[a][s]=i.data[c][l],r.outside[a][s]=i.data[d][u]}}return r}(this.edgeWidth,this.gradX,this.gradY,this.greyscale);this.inside=t.inside,this.outside=t.outside,this.edgeTraining=[],this.gradTraining=[],this.insideTraining=[],this.outsideTraining=[]}findTrainingPoints(e){const t=[];if(null!==this.parents)for(let n=0;n<this.trainingLength&&e;n++)t.push(e),e=this.parents[e.y][e.x];return t}resetTraining(){this.trained=!1}doTraining(e){if(this.trainingPoints=this.findTrainingPoints(e),this.trainingPoints.length<8)return;const t=[];this.calculateTraining(t,this.edgeGran,this.greyscale,this.edgeTraining),this.calculateTraining(t,this.gradGran,this.gradient,this.gradTraining),this.calculateTraining(t,this.insideGran,this.inside,this.insideTraining),this.calculateTraining(t,this.outsideGran,this.outside,this.outsideTraining),this.trainingPoints.length<this.gradPointsNeeded&&this.addInStaticGrad(this.trainingPoints.length,this.gradPointsNeeded),this.trained=!0}calculateTraining(e,t,n,i){let r=0;for(e.length=t,r=0;r<t;r++)e[r]=0;let o=1;for(r=0;r<this.trainingPoints.length;r++){const i=this.trainingPoints[r],a=this.getTrainingIdx(t,n[i.y][i.x]);e[a]+=1,o=Math.max(o,e[a])}for(r=0;r<t;r++)e[r]=1-e[r]/o;!function(e,t){t[0]=.4*e[0]+.5*e[1]+.1*e[1],t[1]=.25*e[0]+.4*e[1]+.25*e[2]+.1*e[3];for(let n=2;n<e.length-2;n++)t[n]=.05*e[n-2]+.25*e[n-1]+.4*e[n]+.25*e[n+1]+.05*e[n+2];const n=e.length;t[n-2]=.25*e[n-1]+.4*e[n-2]+.25*e[n-3]+.1*e[n-4],t[n-1]=.4*e[n-1]+.5*e[n-2]+.1*e[n-3]}(e,i)}addInStaticGrad(e,t){for(let n=0;n<this.gradGran;n++)this.gradTraining[n]=Math.min(this.gradTraining[n],1-n*(t-e)/(t*this.gradGran))}gradDirection(e,t,n,i){return function(e,t,n,i,r,o){const a={x:-1,y:-1},s={x:-1,y:-1};Ri(e,t,n,i,a),Ri(e,t,r,o,s);let l=a.y*(r-n)-a.x*(o-i),c=s.y*(r-n)-s.x*(o-i);return l<0&&(l=-l,c=-c),n!==r&&i!==o&&(l*=Math.SQRT1_2,c*=Math.SQRT1_2),xi*(Math.acos(l)+Math.acos(c))}(this.gradX,this.gradY,e,t,n,i)}dist(e,t,n,i){let r=this.gradient[i][n];e!==n&&t!==i||(r*=Math.SQRT1_2);const o=this.laplace[i][n],a=this.gradDirection(e,t,n,i);return this.trained?.3*this.getTrainedGrad(r)+.3*o+.1*(a+this.getTrainedEdge(this.greyscale.data[t][e])+this.getTrainedInside(this.inside[t][e])+this.getTrainedOutside(this.outside[t][e])):.43*r+.43*o+.11*a}adj(e){const t=[],n=Math.max(e.x-1,0),i=Math.max(e.y-1,0),r=Math.min(e.x+1,this.greyscale.data[0].length-1),o=Math.min(e.y+1,this.greyscale.data.length-1);let a=0;for(let s=i;s<=o;s++)for(let i=n;i<=r;i++)i===e.x&&s===e.y||(t[a++]={x:i,y:s});return t}#dr=e=>Math.round(this.searchGran*this.cost[e.y][e.x]);setPoint(e){this.setWorking(!0),this.curPoint=e;let t=0,n=0;for(this.visited=[],n=0;n<this.height;n++)for(this.visited[n]=[],t=0;t<this.width;t++)this.visited[n][t]=!1;for(this.parents=[],n=0;n<this.height;n++)this.parents[n]=[];for(this.cost=[],n=0;n<this.height;n++)for(this.cost[n]=[],t=0;t<this.width;t++)this.cost[n][t]=Number.MAX_VALUE;this.cost[e.y][e.x]=0,this.pq=new bi(this.searchGranBits,this.#dr),this.pq.push(e)}doWork(){if(!this.working)return;this.timeout=null;let e=0;const t=[];for(;!this.pq.isEmpty()&&e<this.pointsPerPost;){const n=this.pq.pop();t.push(n),t.push(this.parents[n.y][n.x]),this.visited[n.y][n.x]=!0;const i=this.adj(n);for(let e=0;e<i.length;e++){const t=i[e],r=this.cost[n.y][n.x]+this.dist(n.x,n.y,t.x,t.y);r<this.cost[t.y][t.x]&&(this.cost[t.y][t.x]!==Number.MAX_VALUE&&this.pq.remove(t),this.cost[t.y][t.x]=r,this.parents[t.y][t.x]=n,this.pq.push(t))}e++}return t}}class Ei{#hr;#Sr;constructor(e,t){this.#hr=e,this.#Sr=t}getCenter(){return this.#hr}getRadius(){return this.#Sr}equals(e){return null!==e&&this.getCenter().equals(e.getCenter())&&this.getRadius()===e.getRadius()}getSurface(){return Math.PI*this.getRadius()*this.getRadius()}getWorldSurface(e){return function(e,t,n){let i=null;return null!==t&&null!==n&&(i=e*t*n),i}(this.getSurface(),e.x,e.y)}getRound(){const e=this.getCenter().getX(),t=this.getCenter().getY(),n=this.getRadius(),i=Math.pow(n,2),r=t+n,o=[];for(let a=t-n;a<r;++a){const n=i-Math.pow(a-t,2);if(Math.abs(n)<1e-7)continue;const r=Math.sqrt(n);r<.5||o.push([[Math.round(e-r),Math.round(a)],[Math.round(e+r),Math.round(a)]])}return o}quantify(e,t){const n={},i=e.get2DSpacing();n.radius={value:this.getRadius()*i.x,unit:mi.t("unit.mm")};const r=this.getWorldSurface(i);if(null!==r&&(n.surface={value:r/100,unit:mi.t("unit.cm2")}),e.canQuantifyImage()){const i=this.getRound();if(0!==i.length){const r=e.getImageVariableRegionValues(i),o=e.getPixelUnit(),a=Ke(r,t);n.min={value:a.min,unit:o},n.max={value:a.max,unit:o},n.mean={value:a.mean,unit:o},n.stdDev={value:a.stdDev,unit:o},void 0!==a.median&&(n.median={value:a.median,unit:o}),void 0!==a.p25&&(n.p25={value:a.p25,unit:o}),void 0!==a.p75&&(n.p75={value:a.p75,unit:o})}}return n}}class qi{#hr;#gr;#mr;constructor(e,t,n){this.#hr=e,this.#gr=t,this.#mr=n}getCenter(){return this.#hr}getA(){return this.#gr}getB(){return this.#mr}equals(e){return null!==e&&this.getCenter().equals(e.getCenter())&&this.getA()===e.getA()&&this.getB()===e.getB()}getSurface(){return Math.PI*this.getA()*this.getB()}getWorldSurface(e){return function(e,t,n){let i=null;return null!==t&&null!==n&&(i=e*t*n),i}(this.getSurface(),e.x,e.y)}getRound(){const e=this.getCenter().getX(),t=this.getCenter().getY(),n=this.getA(),i=this.getB(),r=n/i,o=Math.pow(i,2),a=t+i,s=[];for(let n=t-i;n<a;++n){const i=o-Math.pow(n-t,2);if(Math.abs(i)<1e-7)continue;const a=r*Math.sqrt(i);a<.5||s.push([[Math.round(e-a),Math.round(n)],[Math.round(e+a),Math.round(n)]])}return s}quantify(e,t){const n={},i=e.get2DSpacing();n.a={value:this.getA()*i.x,unit:mi.t("unit.mm")},n.b={value:this.getB()*i.y,unit:mi.t("unit.mm")};const r=this.getWorldSurface(i);if(null!==r&&(n.surface={value:r/100,unit:mi.t("unit.cm2")}),e.canQuantifyImage()){const i=this.getRound();if(0!==i.length){const r=e.getImageVariableRegionValues(i),o=e.getPixelUnit(),a=Ke(r,t);n.min={value:a.min,unit:o},n.max={value:a.max,unit:o},n.mean={value:a.mean,unit:o},n.stdDev={value:a.stdDev,unit:o},void 0!==a.median&&(n.median={value:a.median,unit:o}),void 0!==a.p25&&(n.p25={value:a.p25,unit:o}),void 0!==a.p75&&(n.p75={value:a.p75,unit:o})}}return n}}function Ui(t,n,i){const r=t.getValues(),o=r.slice(),a=[],s=n[0],l=n[1],c=s/l,u=Math.pow(l,2),d=i[0],h=i[1];for(let t=0;t<l;++t){const n=Math.round(c*Math.sqrt(u-Math.pow(t,2))),i=r[h]+t,s=r[h]-t;for(let t=0;t<n;++t){const n=r[d]+t,l=r[d]-t;o[d]=n,o[h]=i,a.push(new e(o.slice())),s!==i&&(o[h]=s,a.push(new e(o.slice()))),l!==n&&(o[d]=l,o[h]=i,a.push(new e(o.slice())),s!==i&&(o[h]=s,a.push(new e(o.slice()))))}}return a}class Mi{#Zi;#_i;constructor(e,t){this.#Zi=new b(Math.min(e.getX(),t.getX()),Math.min(e.getY(),t.getY())),this.#_i=new b(Math.max(e.getX(),t.getX()),Math.max(e.getY(),t.getY()))}getBegin(){return this.#Zi}getEnd(){return this.#_i}equals(e){return null!==e&&this.getBegin().equals(e.getBegin())&&this.getEnd().equals(e.getEnd())}getSurface(){const e=this.getBegin(),t=this.getEnd();return Math.abs(t.getX()-e.getX())*Math.abs(t.getY()-e.getY())}getWorldSurface(e){return function(e,t,n){let i=null;return null!==t&&null!==n&&(i=e*t*n),i}(this.getSurface(),e.x,e.y)}getRealWidth(){return this.getEnd().getX()-this.getBegin().getX()}getRealHeight(){return this.getEnd().getY()-this.getBegin().getY()}getWidth(){return Math.abs(this.getRealWidth())}getHeight(){return Math.abs(this.getRealHeight())}getRound(){return{min:new b(Math.round(this.getBegin().getX()),Math.round(this.getBegin().getY())),max:new b(Math.round(this.getEnd().getX()),Math.round(this.getEnd().getY()))}}quantify(e,t){const n={},i=e.get2DSpacing();n.width={value:this.getWidth()*i.x,unit:mi.t("unit.mm")},n.height={value:this.getHeight()*i.y,unit:mi.t("unit.mm")};const r=this.getWorldSurface(i);if(null!==r&&(n.surface={value:r/100,unit:mi.t("unit.cm2")}),e.canQuantifyImage()){const i=this.getRound(),r=e.getImageRegionValues(i.min,i.max),o=e.getPixelUnit(),a=Ke(r,t);n.min={value:a.min,unit:o},n.max={value:a.max,unit:o},n.mean={value:a.mean,unit:o},n.stdDev={value:a.stdDev,unit:o},void 0!==a.median&&(n.median={value:a.median,unit:o}),void 0!==a.p25&&(n.p25={value:a.p25,unit:o}),void 0!==a.p75&&(n.p75={value:a.p75,unit:o})}return n}}class Qi{#pr=0;#fr=0;getMin(){return this.#pr}setMin(e){this.#pr=e}getMax(){return this.#fr}setMax(e){this.#fr=e}getName(){return"Threshold"}#yr=null;setOriginalImage(e){this.#yr=e}getOriginalImage(){return this.#yr}update(){const e=this.getOriginalImage(),t=e.getDataRange().min;return e.transform((e=>e<this.getMin()||e>this.getMax()?t:e))}}class Bi{getName(){return"Sharpen"}#yr=null;setOriginalImage(e){this.#yr=e}getOriginalImage(){return this.#yr}update(){return this.getOriginalImage().convolute2D([0,-1,0,-1,5,-1,0,-1,0])}}class Ni{getName(){return"Sobel"}#yr=null;setOriginalImage(e){this.#yr=e}getOriginalImage(){return this.#yr}update(){const e=this.getOriginalImage(),t=e.convolute2D([1,0,-1,2,0,-2,1,0,-1]),n=e.convolute2D([1,2,1,0,0,0,-1,-2,-1]);return t.compose(n,(function(e,t){return Math.sqrt(e*e+t*t)}))}}class Vi{#Dr;#We;#Ni;constructor(e,t,n){this.#Dr=e,this.#We=t,this.#Ni=n}getName(){return"Filter-"+this.#Dr.getName()}execute(){this.#Ni.setImage(this.#We,this.#Dr.update()),this.#Ni.render(this.#We);const e={type:"filterrun",id:this.getName(),dataId:this.#We};this.onExecute(e)}undo(){this.#Ni.setImage(this.#We,this.#Dr.getOriginalImage()),this.#Ni.render(this.#We);const e={type:"filterundo",id:this.getName(),dataid:this.#We};this.onUndo(e)}onExecute(e){}onUndo(e){}}const Gi={},ki={WindowLevel:class{#Ni;#Cr=!1;#vr;#Ir;constructor(e){this.#Ni=e,this.#Ir=new gi(e)}#Tr(e){this.#Cr=!0,this.#vr=e}#Lr(e,t){if(!this.#Cr)return;const n=this.#Ni.getLayerGroupByDivId(t).getActiveViewLayer().getViewController(),i=e.getX()-this.#vr.getX(),o=this.#vr.getY()-e.getY(),a=n.getImageRescaledDataRange(),s=.01*(a.max-a.min),l=n.getWindowLevel().center,c=n.getWindowLevel().width,u=l+Math.round(o*s);let d=c+Math.round(i*s);var h;d=(h=d)<1?1:h;const S=new r(u,d);n.setWindowLevel(S),this.#vr=e}#Pr(){this.#Cr&&(this.#Cr=!1)}mousedown=e=>{const t=rn(e);this.#Tr(t)};mousemove=e=>{const t=rn(e),n=Pn(e);this.#Lr(t,n.groupDivId)};mouseup=e=>{this.#Pr()};mouseout=e=>{this.#Pr()};touchstart=e=>{const t=nn(e);this.#Tr(t[0])};touchmove=e=>{const t=nn(e),n=Pn(e);this.#Lr(t[0],n.groupDivId)};touchend=e=>{this.#Pr()};dblclick=e=>{const t=Pn(e),n=rn(e),i=this.#Ni.getLayerGroupByDivId(t.groupDivId).getActiveViewLayer(),o=i.displayToPlaneIndex(n),a=i.getViewController(),s=this.#Ni.getImage(i.getDataId()),l=new r(s.getRescaledValueAtIndex(a.getCurrentIndex().getWithNew2D(o.get(0),o.get(1))),a.getWindowLevel().width);a.setWindowLevel(l)};wheel=e=>{this.#Ir.wheel(e)};keydown=e=>{e.context="WindowLevel",this.#Ni.onKeydown(e)};activate(e){}init(){}setFeatures(e){}},Scroll:class{#Ni;#Cr=!1;#vr;#Ir;#wr;#Or=!1;#Ar;constructor(e){this.#Ni=e,this.#Ir=new gi(e)}#Tr(e,t){this.#br();const n=this.#Ni.getLayerGroupByDivId(t).getActiveViewLayer(),i=n.getViewController();i.isPlaying()&&i.stop(),this.#Cr=!0,this.#vr=e;const r=n.displayToPlanePos(e),o=i.getPositionFromPlanePoint(r);i.setCurrentPosition(o)}#Lr(e,t){if(!this.#Cr)return void(this.#Or&&this.#xr(e,t));const n=this.#Ni.getLayerGroupByDivId(t),i=n.getActiveViewLayer().getViewController();let r;const o=e.getY()-this.#vr.getY(),a=Math.abs(o)>15;a&&n.canScroll()&&(r=o>0?i.getDecrementScrollPosition():i.getIncrementScrollPosition());const s=e.getX()-this.#vr.getX(),l=Math.abs(s)>15;l&&n.moreThanOne(3)&&(r=s>0?i.getIncrementPosition(3):i.getDecrementPosition(3)),void 0!==r&&n.isPositionInBounds(r)&&i.setCurrentPosition(r),(l||a)&&(this.#vr=e)}#Pr(){this.#Cr&&(this.#Cr=!1)}mousedown=e=>{const t=rn(e),n=Pn(e);this.#Tr(t,n.groupDivId)};mousemove=e=>{const t=rn(e),n=Pn(e);this.#Lr(t,n.groupDivId)};mouseup=e=>{this.#Pr()};mouseout=e=>{this.#Pr(),this.#br()};touchstart=e=>{this.#wr=setTimeout((()=>{this.dblclick(e)}),500);const t=nn(e),n=Pn(e);this.#Tr(t[0],n.groupDivId)};touchmove=e=>{null!==this.#wr&&(clearTimeout(this.#wr),this.#wr=null);const t=nn(e),n=Pn(e);this.#Lr(t[0],n.groupDivId)};touchend=e=>{null!==this.#wr&&(clearTimeout(this.#wr),this.#wr=null),this.#Pr()};wheel=e=>{this.#Ir.wheel(e)};keydown=e=>{e.context="Scroll",this.#Ni.onKeydown(e)};dblclick=e=>{const t=Pn(e);this.#Ni.getLayerGroupByDivId(t.groupDivId).getActiveViewLayer().getViewController().play()};#xr(e,t){const n=this.#Ni.getLayerGroupByDivId(t);this.#Ar=t,n.showTooltip(e)}#br(){void 0!==this.#Ar&&(this.#Ni.getLayerGroupByDivId(this.#Ar).removeTooltipDiv(),this.#Ar=void 0)}activate(e){e||this.#br()}setFeatures(e){void 0!==e.displayTooltip&&(this.#Or=e.displayTooltip)}init(){}},ZoomAndPan:class{#Ni;#Cr=!1;#vr;#Rr;#Fr;#Er;constructor(e){this.#Ni=e}#Tr(e){this.#Cr=!0,this.#vr=e,this.#Rr=!1}#qr=e=>{this.#Cr=!0,this.#vr=e[0],this.#Rr=!1,this.#Fr=new pi(e[0],e[1]),this.#Er=this.#Fr.getMidpoint()};#Lr(e,t){if(!this.#Cr)return;this.#Rr=!0;const n=e.getX()-this.#vr.getX(),i=e.getY()-this.#vr.getY(),r=this.#Ni.getLayerGroupByDivId(t),o=r.getActiveViewLayer(),a=o.getViewController(),s=o.displayToPlaneScale(new b(n,i)),l=a.getOffset3DFromPlaneOffset({x:s.getX(),y:s.getY()});r.addTranslation({x:l.getX(),y:l.getY(),z:l.getZ()}),r.draw(),this.#vr=e}#Ur=(e,t)=>{if(!this.#Cr)return;this.#Rr=!0;const n=new pi(e[0],e[1]).getLength()/this.#Fr.getLength(),i=this.#Ni.getLayerGroupByDivId(t),r=i.getActiveViewLayer(),o=r.getViewController();if(1===n){const t=e[0].getY()-this.#vr.getY();if(Math.abs(t)<15)return;if(i.canScroll()){let e;e=t>0?o.getIncrementScrollPosition():o.getDecrementScrollPosition(),void 0!==e&&i.isPositionInBounds(e)&&o.setCurrentPosition(e)}}else{const e=(n-1)/10;if(Math.abs(e)%.1<=.05&&void 0!==this.#Er){const t=r.displayToMainPlanePos(this.#Er),n=o.getPlanePositionFromPlanePoint(t);i.addScale(e,n),i.draw()}}};#Mr(e,t){const n=this.#Ni.getLayerGroupByDivId(t).getActiveViewLayer(),i=n.getViewController(),r=n.displayToPlanePos(e),o=i.getPositionFromPlanePoint(r);i.setCurrentPosition(o)}#Pr(){this.#Cr&&(this.#Cr=!1)}mousedown=e=>{const t=rn(e);this.#Tr(t)};mousemove=e=>{const t=rn(e),n=Pn(e);this.#Lr(t,n.groupDivId)};mouseup=e=>{if(!this.#Rr){const t=rn(e),n=Pn(e);this.#Mr(t,n.groupDivId)}this.#Pr()};mouseout=e=>{this.#Pr()};touchstart=e=>{const t=nn(e);1===t.length?this.#Tr(t[0]):2===t.length&&this.#qr(t)};touchmove=e=>{const t=nn(e),n=Pn(e);1===t.length?this.#Lr(t[0],n.groupDivId):2===t.length&&this.#Ur(t,n.groupDivId)};touchend=e=>{if(!this.#Rr){const t=rn(e),n=Pn(e);this.#Mr(t,n.groupDivId)}this.#Pr()};wheel=e=>{e.preventDefault();const t=-e.deltaY/500,n=Pn(e),i=rn(e),r=this.#Ni.getLayerGroupByDivId(n.groupDivId),o=r.getActiveViewLayer(),a=o.getViewController(),s=o.displayToMainPlanePos(i),l=a.getPlanePositionFromPlanePoint(s);r.addScale(t,l),r.draw()};keydown=e=>{e.context="ZoomAndPan",this.#Ni.onKeydown(e)};activate(e){}init(){}setFeatures(e){}},Opacity:class{#Ni;#Cr=!1;#vr;#Ir;constructor(e){this.#Ni=e,this.#Ir=new gi(e)}#Tr(e){this.#Cr=!0,this.#vr=e}#Lr(e,t){if(!this.#Cr)return;const n=e.getX()-this.#vr.getX();if(Math.abs(n)>15){const i=this.#Ni.getLayerGroupByDivId(t).getActiveViewLayer(),r=i.getOpacity();i.setOpacity(r+n/200),i.draw(),this.#vr=e}}#Pr(){this.#Cr&&(this.#Cr=!1)}mousedown=e=>{const t=rn(e);this.#Tr(t)};mousemove=e=>{const t=rn(e),n=Pn(e);this.#Lr(t,n.groupDivId)};mouseup=e=>{this.#Pr()};mouseout=e=>{this.#Pr()};touchstart=e=>{const t=nn(e);this.#Tr(t[0])};touchmove=e=>{const t=nn(e),n=Pn(e);this.#Lr(t[0],n.groupDivId)};touchend=e=>{this.#Pr()};wheel=e=>{this.#Ir.wheel(e)};keydown=e=>{e.context="Opacity",this.#Ni.onKeydown(e)};activate(e){}init(){}setFeatures(e){}},Draw:class{#Ni;#Ir;#Qr;#cr;#Yt;#pn=[];constructor(e){this.#Ni=e,this.#Ir=new gi(e),this.#Qr=new Ci(e),this.#Qr.setDrawEventCallback(this.#Re),this.#Yt=e.getStyle(),this.#cr=new vi}#Br=!1;#Ki=null;#Ji=null;#Nr=null;#Vr;#ur=[];#Gr=null;#kr;#Hr;#zr="pointer";#Wr=!0;#Yr=!0;#H={};#Xr=!1;#jr(e,t){const n=this.#Ni.getLayerGroupByDivId(t),i=n.getActiveDrawLayer(),r=i.getKonvaStage(),o=r.getIntersection({x:e.getX(),y:e.getY()});this.#Yt.setZoomScale(r.scale()),o?this.#Zr(n,i,o):this.#_r(n,e)}#_r(e,t){this.#Qr.disable(),this.#Qr.reset(),this.#Kr();const n=e.getActiveViewLayer();this.#Gr=n.displayToPlanePos(t),this.#ur.push(this.#Gr)}#Kr(){this.#Br=!0,this.#Ji=new this.#Ki[this.#Vr],this.#ur=[]}#Jr(){this.#Br=!1,this.#ur=[]}#Zr(e,t,n){const i=n.getParent().find(".shape")[0];if(i&&i instanceof ln().Shape&&i!==this.#Qr.getShape()){this.#Qr.disable();const n=e.getActiveViewLayer().getViewController();this.#Qr.setShape(i,t,n),this.#Qr.enable()}}#$r(e,t){const n=this.#Ni.getLayerGroupByDivId(t),i=n.getActiveViewLayer().displayToPlanePos(e);(Math.abs(i.getX()-this.#Gr.getX())>0||Math.abs(i.getY()-this.#Gr.getY())>0)&&(this.#Xr&&this.#ur.pop(),this.#Gr=i,this.#Xr=!0,this.#ur.push(this.#Gr),this.#eo(this.#ur,n))}#to(e){if(0!==this.#ur.length){if(this.#ur.length===this.#Ji.getNPoints()){const t=this.#Ni.getLayerGroupByDivId(e);this.#no(this.#ur,t),this.#Jr()}this.#Xr=!1}else i.warn("Draw mouseup but no points...")}mousedown=e=>{if(this.#Br)return;const t=rn(e),n=Pn(e);this.#jr(t,n.groupDivId)};mousemove=e=>{if(!this.#Br)return;const t=rn(e),n=Pn(e);this.#$r(t,n.groupDivId)};mouseup=e=>{if(!this.#Br)return;const t=Pn(e);this.#to(t.groupDivId)};dblclick=e=>{if(void 0!==this.#Ji.getNPoints())return;if(!this.#Br)return;if(0===this.#ur.length)return void i.warn("Draw dblclick but no points...");const t=Pn(e),n=this.#Ni.getLayerGroupByDivId(t.groupDivId);this.#no(this.#ur,n),this.#Jr()};mouseout=e=>{if(!this.#Br)return;const t=Pn(e);this.#to(t.groupDivId)};touchstart=e=>{if(this.#Br)return;const t=nn(e),n=Pn(e);this.#jr(t[0],n.groupDivId)};touchmove=e=>{if(!this.#Br)return;const t=Pn(e),n=nn(e),i=this.#Ni.getLayerGroupByDivId(t.groupDivId),r=i.getActiveViewLayer().displayToPlanePos(n[0]);(Math.abs(r.getX()-this.#Gr.getX())>0||Math.abs(r.getY()-this.#Gr.getY())>0)&&(1!==this.#ur.length&&this.#ur.pop(),this.#Gr=r,this.#ur.push(this.#Gr),this.#ur.length<this.#Ji.getNPoints()&&(clearTimeout(this.timer),this.timer=setTimeout((()=>{this.#ur.push(this.#Gr)}),this.#Ji.getTimeout())),this.#eo(this.#ur,i))};touchend=e=>{this.dblclick(e)};wheel=e=>{this.#Wr&&this.#Ir.wheel(e)};keydown=e=>{if(this.#Br||(e.context="Draw",this.#Ni.onKeydown(e)),("Delete"===e.key||"Backspace"===e.key)&&this.#Qr.isActive()){const e=this.#Qr.getShape().getParent();if(!(e instanceof ln().Group))return;const t=e.getChildren(fn)[0];if(!(t instanceof ln().Shape))return;const n=this.#Ni.getActiveLayerGroup().getActiveDrawLayer();this.#io(n,e,t)}if("Escape"===e.key&&null!==this.#Nr){const e=this.#Nr.getLayer();this.#Nr.destroy(),this.#Nr=null,this.#Jr(),e.draw()}};#eo(e,t){this.#Nr&&(this.#Nr.destroy(),this.#Nr=null);const n=t.getActiveDrawLayer().getKonvaLayer(),i=t.getActiveViewLayer();if(this.#Yr){const e=["#ffff80","#ff80ff","#80ffff","#80ff80","8080ff","ff8080"],t=i.getId(),n=t.substring(t.length-1),r=e[parseInt(n,10)/2];void 0!==r&&this.#Yt.setLineColour(r)}const r=i.getViewController();this.#Nr=this.#Ji.create(e,this.#Yt,r),this.#Nr.getChildren(fn)[0].listening(!1),n.listening(!1),n.add(this.#Nr),n.draw()}#no(e,t){this.#Nr&&(this.#Nr.destroy(),this.#Nr=null);const n=t.getActiveDrawLayer(),i=n.getKonvaLayer(),r=n.getDrawController(),o=t.getActiveViewLayer().getViewController(),a=this.#Ji.create(e,this.#Yt,o);a.id(et()),r.getCurrentPosGroup().add(a),i.listening(!0),this.#ro(n,a),this.#oo(t,a)}#ro(e,t){const n=new dn(t,this.#Vr,e);n.onExecute=this.#Re,n.onUndo=this.#Re,n.execute(),this.#Ni.addToUndoStack(n)}#io(e,t,n){const i=un(n),r=new gn(t,i,e);r.onExecute=this.#Re,r.onUndo=this.#Re,r.execute(),this.#Ni.addToUndoStack(r)}#ao(e,t,n,i){const r=un(n),o=new hn(t,r,i,e);o.onExecute=this.#Re,o.onUndo=this.#Re,this.#Ni.addToUndoStack(o)}#so(e){const t=e.getDivId();return void 0===this.#pn[t]&&(this.#pn[t]=()=>{this.#lo(e)}),this.#pn[t]}activate(e){this.#Qr.disable(),this.#Qr.reset();const t=this.#Ni.getActiveLayerGroup();if(void 0===t)throw new Error("No active layerGroup to activate draw on");this.#co(e,t),e?(this.#Hr=document.body.style.cursor,this.#Ni.addEventListener("positionchange",this.#so(t))):(this.#uo(),this.#Hr=void 0,this.#Ni.removeEventListener("positionchange",this.#so(t)))}#lo(e){this.#co(!0,e)}#co(e,t){const n=t.getActiveDrawLayer();if(void 0===n)return;const i=n.getDrawController().getCurrentPosGroup().getChildren();e?i.forEach((e=>{this.#oo(t,e)})):i.forEach((e=>{this.#do(e)}));const r=n.getKonvaLayer();0!==i.length&&r.listening(!0),r.draw()}#do(e){this.#ho(e),e.draggable(!1),e.off("dragstart.draw"),e.off("dragmove.draw"),e.off("dragend.draw"),e.off("dblclick")}#So(e,t){const n=t.getActiveDrawLayer().getKonvaStage();return{x:n.offset().x+e.x/n.scale().x,y:n.offset().y+e.y/n.scale().y}}#uo(){void 0!==this.#Hr&&(document.body.style.cursor=this.#Hr),void 0!==this.#kr&&this.#kr.opacity(1)}#go(e){e.on("mouseover",(()=>{this.#kr=e,document.body.style.cursor=this.#zr,e.opacity(.75)})),e.on("mouseout",(()=>{this.#uo(),this.#kr=void 0}))}#ho(e){e.off("mouseover"),e.off("mouseout")}#mo(e){let t;const n=Object.keys(this.#Ki);for(let i=0;i<n.length&&(t=new this.#Ki[n[i]],!t.isFactoryGroup(e));++i);if(void 0===t)throw new Error("Cannot find factory to update quantification.");return t}#oo(e,t){this.#go(t);const n=e.getActiveDrawLayer(),i=n.getKonvaLayer();t.draggable(!0);let r={x:t.x(),y:t.y()};const o=t.getChildren(fn)[0];if(!(o instanceof ln().Shape))return;let a=null;t.on("dragstart.draw",(()=>{const e=t.getChildren(fn)[0];e instanceof ln().Shape&&(a=e.stroke(),this.#cr.activate(n),this.#Qr.setAnchorsActive(!1),i.draw())})),t.on("dragmove.draw",(r=>{const o=r.target;if(!(o instanceof ln().Group))return;!function(e,t){const n=t.getChildren(fn)[0],i=function(e){const t=e.find(".anchor");if(0===t.length)return;let n=t[0].x(),i=t[0].y();for(let e=0;e<t.length;++e)n=Math.min(n,t[e].x()),i=Math.min(i,t[e].y());return new b(n,i)}(t);if(void 0===i)return null;Ii(t,new b(-i.getX(),-i.getY()),new b(e.x-(i.getX()+Math.abs(n.width())),e.y-(i.getY()+Math.abs(n.height()))))}(n.getBaseSize(),o);const s=this.#mo(t);if(void 0!==s.updateQuantification){const t=e.getActiveViewLayer().getViewController();s.updateQuantification(o,t)}const l=rn(r.evt),c={x:l.getX(),y:l.getY()},u=this.#So(c,e);this.#cr.changeChildrenColourOnTrashHover(u,t,a),i.draw()})),t.on("dragend.draw",(s=>{const l=s.target;if(!(l instanceof ln().Group))return;if(this.#cr.remove(),void 0===s||void 0===s.evt)return;const c=l.x(),u=l.y(),d=rn(s.evt),h={x:d.getX(),y:d.getY()},S=this.#So(h,e);if(this.#cr.isOverTrash(S))l.x(r.x),l.y(r.y),this.#Qr.disable(),this.#Qr.reset(),this.#cr.changeGroupChildrenColour(t,a),this.#io(n,t,o),document.body.style.cursor=this.#Hr;else{const e={x:c-r.x,y:u-r.y};0===e.x&&0===e.y||(this.#ao(n,l,o,e),this.#Re({type:"drawmove",id:l.id(),srclayerid:n.getId(),dataid:n.getDataId()})),this.#Qr.setAnchorsActive(!0),this.#Qr.resetAnchors()}i.draw(),r={x:l.x(),y:l.y()}})),t.on("dblclick",(e=>{const t=e.currentTarget;if(!(t instanceof ln().Group))return;const r=t.findOne("Label");if(!(r instanceof ln().Label))return;if(void 0===r)throw new Error("Could not find the shape label.");const o=r.getText(),a=t.id();en.openRoiDialog(o.meta,(e=>{o.meta=e,o.setText(U(e.textExpr,e.quantification)),r.visible(0!==e.textExpr.length),this.#Re({type:"drawchange",id:a,srclayerid:n.getId(),dataid:n.getDataId()}),i.draw()}))}))}setOptions(e){this.#Ki=e,this.#Qr.setFactoryList(e)}getOptionsType(){return"factory"}setFeatures(e){if(void 0!==e.autoShapeColour&&(this.#Yr=e.autoShapeColour),void 0!==e.shapeColour&&(this.#Yt.setLineColour(e.shapeColour),this.#Yr=!1),void 0!==e.shapeName){if(!this.hasShape(e.shapeName))throw new Error("Unknown shape: '"+e.shapeName+"'");this.#Vr=e.shapeName}void 0!==e.mouseOverCursor&&(this.#zr=e.mouseOverCursor),void 0!==e.withScroll&&(this.#Wr=e.withScroll)}init(){}getEventNames(){return["drawcreate","drawchange","drawmove","drawdelete"]}addEventListener(e,t){void 0===this.#H[e]&&(this.#H[e]=[]),this.#H[e].push(t)}removeEventListener(e,t){if(void 0!==this.#H[e])for(let n=0;n<this.#H[e].length;++n)this.#H[e][n]===t&&this.#H[e].splice(n,1)}#Re=e=>{if(void 0!==this.#H[e.type])for(let t=0;t<this.#H[e.type].length;++t)this.#H[e.type][t](e)};hasShape(e){return void 0!==this.#Ki[e]}},Filter:class{#Ni;constructor(e){this.#Ni=e}#po=null;#fo=0;#Oe=new He;activate(e){for(const t in this.#po)e?(this.#po[t].addEventListener("filterrun",this.#Re),this.#po[t].addEventListener("filter-undo",this.#Re)):(this.#po[t].removeEventListener("filterrun",this.#Re),this.#po[t].removeEventListener("filter-undo",this.#Re))}setOptions(e){this.#po={};for(const t in e)this.#po[t]=new e[t](this.#Ni)}getOptionsType(){return"instance"}init(){for(const e in this.#po)this.#po[e].init()}keydown=e=>{e.context="Filter",this.#Ni.onKeydown(e)};getEventNames(){return["filterrun","filterundo"]}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};getSelectedFilter(){return this.#fo}setFeatures(e){if(void 0!==e.filterName){if(!this.hasFilter(e.filterName))throw new Error("Unknown filter: '"+e.filterName+"'");this.#fo&&this.#fo.activate(!1),this.#fo=this.#po[e.filterName],this.#fo.activate(!0)}if(void 0!==e.run&&e.run){let t={};void 0!==e.runArgs&&(t=e.runArgs),this.getSelectedFilter().run(t)}}getFilterList(){return this.#po}hasFilter(e){return this.#po[e]}},Floodfill:class{#Ni;constructor(e){this.#Ni=e}#yo=5;#Do=0;#Co=2e3;#vo=null;#Io=null;#To=10;#Lo=null;#Cr=!1;#Po=null;#wo=null;#Oo;#Ao=null;#bo=[];#xo=!1;#Ro;#Yt=new cn;#Oe=new He;setExtend(e){this.#xo=e}getExtend(){return this.#xo}#Fo=(e,t)=>{const n=this.#Ni.getLayerGroupByDivId(t).getActiveViewLayer().displayToPlaneIndex(e);return{x:n.get(0),y:n.get(1)}};#Eo(e,t,n){this.#bo=[];const i={data:this.#vo.data,width:this.#vo.width,height:this.#vo.height,bytes:4};this.#Io=Oi().floodFill(i,e.x,e.y,t),this.#Io=Oi().gaussBlurOnlyBorder(this.#Io,this.#yo);let r=Oi().traceContours(this.#Io);if(r=Oi().simplifyContours(r,this.#Do,this.#Co),r.length>0&&r[0].points[0].x){if(n)return r[0].points;for(let e=0,t=r[0].points.length;e<t;e++)this.#bo.push(new b(r[0].points[e].x,r[0].points[e].y));return this.#bo}return[]}#qo(e,t,n){if(this.#Ao=this.#Eo(e,t,!1),this.#Ao){const e=new Pi;this.#wo=e.create(this.#Ao,this.#Yt),this.#wo.id(et());const t=n.getActiveDrawLayer();return t.getDrawController().getCurrentPosGroup().add(this.#wo),this.#Po=new dn(this.#wo,"floodfill",t),this.#Po.onExecute=this.#Re,this.#Po.onUndo=this.#Re,this.#Po.execute(),this.#Ni.addToUndoStack(this.#Po),!0}return!1}extend(e,t,n){if(!this.#Oo)throw"'initialpoint' not found. User must click before use extend!";this.#wo&&this.#wo.destroy();const i=n.getActiveViewLayer().getViewController(),r=i.getCurrentIndex(),o=i.getImageSize(),a=this.#Lo||this.#To;for(let e=r.get(2),s=t||o.get(2);e<s&&this.#qo(this.#Oo,a,n);e++)i.incrementIndex(2);i.setCurrentPosition(r);for(let t=r.get(2),o=e||0;t>o&&this.#qo(this.#Oo,a,n);t--)i.decrementIndex(2);i.setCurrentPosition(r)}modifyThreshold(e,t){if(t||!this.#wo)throw"No shape found";t=this.#wo.getChildren((function(e){return"shape"===e.name()}))[0],clearTimeout(this.#Ro),this.#Ro=setTimeout((()=>{if(this.#Ao=this.#Eo(this.#Oo,e,!0),!this.#Ao)return!1;const n=[];for(let e=0,t=this.#Ao.length;e<t;++e)n.push(this.#Ao[e].x),n.push(this.#Ao[e].y);t.setPoints(n),t.getLayer().draw(),this.onThresholdChange(e)}),100)}onThresholdChange(e){}#Tr(e,t){const n=this.#Ni.getLayerGroupByDivId(t),r=n.getActiveViewLayer(),o=n.getActiveDrawLayer();this.#vo=r.getImageData(),this.#vo?(this.#Yt.setZoomScale(o.getKonvaLayer().getAbsoluteScale()),this.#Cr=!0,this.#Oo=this.#Fo(e,t),this.#qo(this.#Oo,this.#To,n),this.onThresholdChange(this.#To)):i.error("No image found")}#Lr(e,t){if(!this.#Cr)return;const n=this.#Fo(e,t);this.#Lo=Math.round(Math.sqrt(Math.pow(this.#Oo.x-n.x,2)+Math.pow(this.#Oo.y-n.y,2))/2),this.#Lo=this.#Lo<this.#To?this.#To:this.#Lo-this.#To,this.modifyThreshold(this.#Lo)}#Pr(){this.#Cr&&(this.#Cr=!1)}mousedown=e=>{const t=rn(e),n=Pn(e);this.#Tr(t,n.groupDivId)};mousemove=e=>{const t=rn(e),n=Pn(e);this.#Lr(t,n.groupDivId)};mouseup=e=>{this.#Pr()};mouseout=e=>{this.#Pr()};touchstart=e=>{const t=nn(e),n=Pn(e);this.#Tr(t[0],n.groupDivId)};touchmove=e=>{const t=nn(e),n=Pn(e);this.#Lr(t[0],n.groupDivId)};touchend=e=>{this.#Pr()};keydown=e=>{e.context="Floodfill",this.#Ni.onKeydown(e)};activate(e){e&&(this.#Yt.setBaseScale(this.#Ni.getBaseScale()),this.setFeatures({shapeColour:this.#Yt.getLineColour()}))}init(){}getEventNames(){return["drawcreate","drawchange","drawmove","drawdelete"]}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};setFeatures(e){void 0!==e.shapeColour&&this.#Yt.setLineColour(e.shapeColour)}},Livewire:class{#Ni;constructor(e){this.#Ni=e}#Cr=!1;#vr;#Po=null;#wo=null;#Yt=new cn;#Uo=new Ai;#Mo=new Ai;#bo=[];#Qo=5;#Oe=new He;#Bo(e){const t=e.get(1);for(let e=0;e<t;++e)this.#bo[e]=[]}#No(){this.#Uo=new Ai,this.#Mo=new Ai}#Vo=new Fi;#Tr(e,t){const n=this.#Ni.getLayerGroupByDivId(t),i=n.getActiveViewLayer(),r=i.getViewController().getImageSize(),o=i.displayToPlaneIndex(e);if(this.#Cr){const e=Math.abs(o.get(0)-this.#vr.getX()),t=Math.abs(o.get(1)-this.#vr.getY());if(e<this.#Qo&&t<this.#Qo)this.#Go();else{this.#Uo=this.#Mo,this.#Bo(r);const e={x:o.get(0),y:o.get(1)};this.#Vo.doTraining(e),this.#Uo.addControlPoint(this.#Mo.getPoint(0))}}else{this.#Cr=!0,this.#vr=new b(o.get(0),o.get(1)),this.#No(),this.#Bo(r),this.#wo=null;const e=n.getActiveDrawLayer();this.#Yt.setZoomScale(e.getKonvaLayer().getAbsoluteScale());const t={x:o.get(0),y:o.get(1)};this.#Vo.doTraining(t);const i=new b(o.get(0),o.get(1));this.#Uo.addPoint(i),this.#Uo.addControlPoint(i)}}#Lr(e,t){if(!this.#Cr)return;const n=this.#Ni.getLayerGroupByDivId(t),i=n.getActiveViewLayer().displayToPlaneIndex(e);let r={x:i.get(0),y:i.get(1)};this.#Vo.setPoint(r);let o=[],a=!1;for(;!this.#bo[r.y][r.x]&&!a;)if(o=this.#Vo.doWork(),0===o.length)a=!0;else for(let e=0;e<o.length-1;e+=2){const t=o[e],n=o[e+1];this.#bo[t.y][t.x]=n}for(this.#Mo=new Ai,a=!1;r&&!a;)this.#Mo.addPoint(new b(r.x,r.y)),this.#bo[r.y]&&this.#bo[r.y][r.x]?r=this.#bo[r.y][r.x]:a=!0;this.#Mo.appenPath(this.#Uo),this.#wo&&this.#wo.destroy();const s=new Pi;this.#wo=s.create(this.#Mo.pointArray,this.#Yt),this.#wo.id(et());const l=n.getActiveDrawLayer();l.getDrawController().getCurrentPosGroup().add(this.#wo),this.#Po=new dn(this.#wo,"livewire",l),this.#Po.execute()}#Go(){this.#Re({type:"drawcreate",id:this.#wo.id()}),this.#Po.onExecute=this.#Re,this.#Po.onUndo=this.#Re,this.#Ni.addToUndoStack(this.#Po),this.#Cr=!1}mousedown=e=>{const t=rn(e),n=Pn(e);this.#Tr(t,n.groupDivId)};mousemove=e=>{const t=rn(e),n=Pn(e);this.#Lr(t,n.groupDivId)};mouseup(e){}mouseout=e=>{};dblclick=e=>{this.#Go()};touchstart=e=>{const t=nn(e),n=Pn(e);this.#Tr(t[0],n.groupDivId)};touchmove=e=>{const t=nn(e),n=Pn(e);this.#Lr(t[0],n.groupDivId)};touchend=e=>{};keydown=e=>{e.context="Livewire",this.#Ni.onKeydown(e)};activate(e){if(e){const e=this.#Ni.getActiveLayerGroup().getActiveViewLayer(),t=e.getViewController().getImageSize();this.#Vo.setDimensions(t.get(0),t.get(1)),this.#Vo.setData(e.getImageData().data),this.#Yt.setBaseScale(this.#Ni.getBaseScale()),this.setFeatures({shapeColour:this.#Yt.getLineColour()})}}init(){}getEventNames(){return["drawcreate","drawchange","drawmove","drawdelete"]}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};setFeatures(e){void 0!==e.shapeColour&&this.#Yt.setLineColour(e.shapeColour)}}},Hi={draw:{ArrowFactory:class{getGroupName(){return"line-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new pi(e[0],e[1]),r=new(ln().Line)({points:[i.getBegin().getX(),i.getBegin().getY(),i.getEnd().getX(),i.getEnd().getY()],stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),o=t.applyZoomScale(10).x,a=yi(i,e[0],o),s=yi(i,e[1],o);r.hitFunc((function(e){e.beginPath(),e.moveTo(a.getBegin().getX(),a.getBegin().getY()),e.lineTo(a.getEnd().getX(),a.getEnd().getY()),e.lineTo(s.getEnd().getX(),s.getEnd().getY()),e.lineTo(s.getBegin().getX(),s.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}));const l=new b(i.getBegin().getX(),i.getBegin().getY()-10),c=new pi(i.getBegin(),l),u=fi(i,c),d=u*Math.PI/180,h=Math.abs(t.applyZoomScale(8).x),S=new(ln().RegularPolygon)({x:i.getBegin().getX()+h*Math.sin(d),y:i.getBegin().getY()+h*Math.cos(d),sides:3,radius:h,rotation:-u,fill:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape-triangle"}),g=new(ln().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let m="";const p=n.getModality();m=void 0!==Li.labelText.arrow[p]?Li.labelText.arrow[p]:Li.labelText.arrow["*"],g.setText(m),g.meta={textExpr:m,quantification:{}};const f=i.getBegin().getX()>i.getEnd().getX()?0:-1,y=i.getBegin().getY()>i.getEnd().getY()?-1:0,D=new(ln().Label)({x:i.getEnd().getX()+f*g.width(),y:i.getEnd().getY()+y*t.applyZoomScale(15).y,scale:t.applyZoomScale(1),visible:0!==m.length,name:"label"});D.add(g),D.add(new(ln().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const C=new(ln().Group);return C.name(this.getGroupName()),C.add(D),C.add(S),C.add(r),C.visible(!0),C}getAnchors(e,t){const n=e.points(),i=[];return i.push(Di(n[0]+e.x(),n[1]+e.y(),"begin",t)),i.push(Di(n[2]+e.x(),n[3]+e.y(),"end",t)),i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof ln().Line))return;const o=i.getChildren((function(e){return"shape-triangle"===e.name()}))[0];if(!(o instanceof ln().RegularPolygon))return;const a=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(a instanceof ln().Label))return;const s=i.getChildren((function(e){return"begin"===e.id()}))[0],l=i.getChildren((function(e){return"end"===e.id()}))[0];switch(e.id()){case"begin":s.x(e.x()),s.y(e.y());break;case"end":l.x(e.x()),l.y(e.y())}const c=s.x()-r.x(),u=s.y()-r.y(),d=l.x()-r.x(),h=l.y()-r.y();r.points([c,u,d,h]);const S=new b(s.x(),s.y()),g=new b(l.x(),l.y()),m=new pi(S,g),p=new b(c,u),f=new b(d,h),y=t.applyZoomScale(10).x,D=yi(m,p,y),C=yi(m,f,y);r.hitFunc((function(e){e.beginPath(),e.moveTo(D.getBegin().getX(),D.getBegin().getY()),e.lineTo(D.getEnd().getX(),D.getEnd().getY()),e.lineTo(C.getEnd().getX(),C.getEnd().getY()),e.lineTo(C.getBegin().getX(),C.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}));const v=new b(m.getBegin().getX(),m.getBegin().getY()-10),I=new pi(m.getBegin(),v),T=fi(m,I),L=T*Math.PI/180;o.x(m.getBegin().getX()+o.radius()*Math.sin(L)),o.y(m.getBegin().getY()+o.radius()*Math.cos(L)),o.rotation(-T);const P=a.getText();P.setText(P.meta.textExpr);const w=m.getBegin().getX()>m.getEnd().getX()?0:-1,O=m.getBegin().getY()>m.getEnd().getY()?-1:0,A={x:m.getEnd().getX()+w*P.width(),y:m.getEnd().getY()+O*t.applyZoomScale(15).y};a.position(A)}},CircleFactory:class{getGroupName(){return"circle-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}#ko(e){const t=Math.abs(e[0].getX()-e[1].getX()),n=Math.abs(e[0].getY()-e[1].getY()),i=Math.round(Math.sqrt(t*t+n*n));return new Ei(e[0],i)}#Ho(e,t){return new(ln().Circle)({x:e.getCenter().getX(),y:e.getCenter().getY(),radius:e.getRadius(),stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"})}#zo(e,t,n){const i=new(ln().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let r="";const o=n.getModality();r=void 0!==Li.labelText.circle[o]?Li.labelText.circle[o]:Li.labelText.circle["*"];const a=e.quantify(n,q(r));i.setText(U(r,a)),i.meta={textExpr:r,quantification:a};const s=new(ln().Label)({x:e.getCenter().getX()-e.getRadius(),y:e.getCenter().getY()+e.getRadius(),scale:t.applyZoomScale(1),visible:0!==r.length,name:"label"});return s.add(i),s.add(new(ln().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()})),s}create(e,t,n){const i=new(ln().Group);i.name(this.getGroupName()),i.visible(!0);const r=this.#ko(e),o=this.#Ho(r,t);i.add(o);const a=this.#zo(r,t,n);return i.add(a),i}getAnchors(e,t){const n=e.x(),i=e.y(),r=e.radius(),o=[];return o.push(Di(n-r,i,"left",t)),o.push(Di(n+r,i,"right",t)),o.push(Di(n,i+r,"bottom",t)),o.push(Di(n,i-r,"top",t)),o}update(e,t,n){const r=e.getParent();if(!(r instanceof ln().Group))return;const o=r.getChildren((function(e){return"shape"===e.name()}))[0];if(!(o instanceof ln().Circle))return;const a=r.getChildren((function(e){return"label"===e.name()}))[0],s=r.getChildren((function(e){return"left"===e.id()}))[0],l=r.getChildren((function(e){return"right"===e.id()}))[0],c=r.getChildren((function(e){return"bottom"===e.id()}))[0],u=r.getChildren((function(e){return"top"===e.id()}))[0];const d=o.x(),h=o.y();let S;switch(e.id()){case"left":S=d-e.x(),s.x(e.x()),s.y(l.y()),l.x(d+S),c.y(h+S),u.y(h-S);break;case"right":S=e.x()-d,l.x(e.x()),l.y(s.y()),s.x(d-S),c.y(h+S),u.y(h-S);break;case"bottom":S=e.y()-h,c.x(u.x()),c.y(e.y()),s.x(d-S),l.x(d+S),u.y(h-S);break;case"top":S=h-e.y(),u.x(c.x()),u.y(e.y()),s.x(d-S),l.x(d+S),c.y(h+S);break;default:i.error("Unhandled anchor id: "+e.id())}o.radius(Math.abs(S));const g=new b(r.x()+d,r.y()+h),m=(new Ei(g,S),{x:d-Math.abs(S),y:h+Math.abs(S)});a.position(m),this.#Wo(r,n)}updateQuantification(e,t){this.#Wo(e,t)}#Wo(e,t){const n=e.getChildren((function(e){return"shape"===e.name()}))[0];if(!(n instanceof ln().Circle))return;const i=e.getChildren((function(e){return"label"===e.name()}))[0];if(!(i instanceof ln().Label))return;const r=new b(e.x()+n.x(),e.y()+n.y()),o=new Ei(r,n.radius()),a=i.getText(),s=a.meta,l=o.quantify(t,q(s.textExpr));a.setText(U(s.textExpr,l)),s.quantification=l}#Yo(e,t){let n=0,i=0;void 0!==t&&(n=t.x(),i=t.y());const r=new(ln().Group);r.name("shadow");const o=e.getRound();for(let e=0;e<o.length;++e){const t=o[e],a=t[0][0],s=t[0][1],l=t[1][0],c=new(ln().Rect)({x:a-n,y:s-i,width:l-a,height:1,fill:"grey",strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow-element"});r.add(c)}return r}},EllipseFactory:class{getGroupName(){return"ellipse-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=Math.abs(e[0].getX()-e[1].getX()),r=Math.abs(e[0].getY()-e[1].getY()),o=new qi(e[0],i,r),a={x:o.getA(),y:o.getB()},s=new(ln().Ellipse)({x:o.getCenter().getX(),y:o.getCenter().getY(),radius:a,radiusX:a.x,radiusY:a.y,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),l=new(ln().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let c="";const u=n.getModality();c=void 0!==Li.labelText.ellipse[u]?Li.labelText.ellipse[u]:Li.labelText.ellipse["*"];const d=o.quantify(n,q(c));l.setText(U(c,d)),l.meta={textExpr:c,quantification:d};const h=new(ln().Label)({x:o.getCenter().getX()-o.getA(),y:o.getCenter().getY()+o.getB(),scale:t.applyZoomScale(1),visible:0!==c.length,name:"label"});h.add(l),h.add(new(ln().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const S=new(ln().Group);return S.name(this.getGroupName()),S.add(h),S.add(s),S.visible(!0),S}getAnchors(e,t){const n=e.x(),i=e.y(),r=e.radius(),o=[];return o.push(Di(n-r.x,i,"left",t)),o.push(Di(n+r.x,i,"right",t)),o.push(Di(n,i+r.y,"bottom",t)),o.push(Di(n,i-r.y,"top",t)),o}update(e,t,n){const r=e.getParent();if(!(r instanceof ln().Group))return;const o=r.getChildren((function(e){return"shape"===e.name()}))[0];if(!(o instanceof ln().Ellipse))return;const a=r.getChildren((function(e){return"label"===e.name()}))[0],s=r.getChildren((function(e){return"left"===e.id()}))[0],l=r.getChildren((function(e){return"right"===e.id()}))[0],c=r.getChildren((function(e){return"bottom"===e.id()}))[0],u=r.getChildren((function(e){return"top"===e.id()}))[0];const d={x:o.x(),y:o.y()};let h,S;switch(e.id()){case"left":h=d.x-e.x(),S=u.y()-d.y,s.x(e.x()),s.y(l.y()),l.x(d.x+h);break;case"right":h=e.x()-d.x,S=u.y()-d.y,l.x(e.x()),l.y(s.y()),s.x(d.x-h);break;case"bottom":h=d.x-s.x(),S=e.y()-d.y,c.x(u.x()),c.y(e.y()),u.y(d.y-S);break;case"top":h=d.x-s.x(),S=d.y-e.y(),u.x(c.x()),u.y(e.y()),c.y(d.y+S);break;default:i.error("Unhandled anchor id: "+e.id())}o.position(d);const g={x:Math.abs(h),y:Math.abs(S)};g&&o.radius(g);const m=new b(r.x()+d.x,r.y()+d.y),p=(new qi(m,g.x,g.y),{x:d.x-g.x,y:d.y+g.y});a.position(p),this.#Xo(r,n)}updateQuantification(e,t){this.#Xo(e,t)}#Xo(e,t){const n=e.getChildren((function(e){return"shape"===e.name()}))[0];if(!(n instanceof ln().Ellipse))return;const i=e.getChildren((function(e){return"label"===e.name()}))[0];if(!(i instanceof ln().Label))return;const r=new b(e.x()+n.x(),e.y()+n.y()),o=new qi(r,n.radius().x,n.radius().y),a=i.getText(),s=a.meta,l=o.quantify(t,q(s.textExpr));a.setText(U(s.textExpr,l)),s.quantification=l}#jo(e,t){let n=0,i=0;void 0!==t&&(n=t.x(),i=t.y());const r=new(ln().Group);r.name("shadow");const o=e.getRound();for(let e=0;e<o.length;++e){const t=o[e],a=t[0][0],s=t[0][1],l=t[1][0],c=new(ln().Rect)({x:a-n,y:s-i,width:l-a,height:1,fill:"grey",strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow-element"});r.add(c)}return r}},FreeHandFactory:class{getGroupName(){return"freeHand-group"}getNPoints(){}getTimeout(){return 25}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=[];for(let t=0;t<e.length;++t)i.push(e[t].getX()),i.push(e[t].getY());const r=new(ln().Line)({points:i,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape",tension:.5}),o=new(ln().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),name:"text"});let a="";const s=n.getModality();a=void 0!==Li.labelText.freeHand[s]?Li.labelText.freeHand[s]:Li.labelText.freeHand["*"],o.setText(a),o.meta={textExpr:a,quantification:{}};const l=new(ln().Label)({x:e[0].getX(),y:e[0].getY()+t.scale(10),scale:t.applyZoomScale(1),visible:0!==a.length,name:"label"});l.add(o),l.add(new(ln().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const c=new(ln().Group);return c.name(this.getGroupName()),c.add(l),c.add(r),c.visible(!0),c}getAnchors(e,t){const n=e.points(),i=[];for(let r=0;r<n.length;r+=2){const o=n[r]+e.x(),a=n[r+1]+e.y(),s=r.toString();i.push(Di(o,a,s,t))}return i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof ln().Line))return;const o=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(o instanceof ln().Label))return;const a=i.getChildren((function(t){return t.id()===e.id()}))[0];a.x(e.x()),a.y(e.y());const s=r.points(),l=parseInt(e.id(),10);s[l]=e.x()-r.x(),s[l+1]=e.y()-r.y(),r.points(s.concat());const c=o.getText(),u=c.meta;c.setText(u.textExpr);const d={x:s[0]+r.x(),y:s[1]+r.y()+t.scale(10)};o.position(d)}},ProtractorFactory:class{getGroupName(){return"protractor-group"}getNPoints(){return 3}getTimeout(){return 500}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new pi(e[0],e[1]),r=[];for(let t=0;t<e.length;++t)r.push(e[t].getX()),r.push(e[t].getY());const o=new(ln().Line)({points:r,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),a=new(ln().Group);if(a.name(this.getGroupName()),3===e.length){const r=new pi(e[1],e[2]);o.hitFunc((function(t){t.beginPath(),t.moveTo(e[0].getX(),e[0].getY()),t.lineTo(e[1].getX(),e[1].getY()),t.lineTo(e[2].getX(),e[2].getY()),t.closePath(),t.fillStrokeShape(o)}));let s=fi(i,r),l=i.getInclination();s>180&&(s=360-s,l+=s);const c=new(ln().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let u="";const d=n.getModality();u=void 0!==Li.labelText.protractor[d]?Li.labelText.protractor[d]:Li.labelText.protractor["*"];const h={angle:{value:s,unit:mi.t("unit.degree")}};c.setText(U(u,h)),c.meta={textExpr:u,quantification:h};const S=(i.getMidpoint().getX()+r.getMidpoint().getX())/2,g=(i.getMidpoint().getY()+r.getMidpoint().getY())/2,m=new(ln().Label)({x:S,y:g-t.applyZoomScale(15).y,scale:t.applyZoomScale(1),visible:0!==u.length,name:"label"});m.add(c),m.add(new(ln().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const p=33*Math.min(i.getLength(),r.getLength())/100,f=new(ln().Arc)({innerRadius:p,outerRadius:p,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,angle:s,rotation:-l,x:e[1].getX(),y:e[1].getY(),name:"shape-arc"});a.add(m),a.add(f)}return a.add(o),a.visible(!0),a}getAnchors(e,t){const n=e.points(),i=[];return i.push(Di(n[0]+e.x(),n[1]+e.y(),"begin",t)),i.push(Di(n[2]+e.x(),n[3]+e.y(),"mid",t)),i.push(Di(n[4]+e.x(),n[5]+e.y(),"end",t)),i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof ln().Line))return;const o=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(o instanceof ln().Label))return;const a=i.getChildren((function(e){return"shape-arc"===e.name()}))[0];if(!(a instanceof ln().Arc))return;const s=i.getChildren((function(e){return"begin"===e.id()}))[0],l=i.getChildren((function(e){return"mid"===e.id()}))[0],c=i.getChildren((function(e){return"end"===e.id()}))[0];switch(e.id()){case"begin":s.x(e.x()),s.y(e.y());break;case"mid":l.x(e.x()),l.y(e.y());break;case"end":c.x(e.x()),c.y(e.y())}const u=s.x()-r.x(),d=s.y()-r.y(),h=l.x()-r.x(),S=l.y()-r.y(),g=c.x()-r.x(),m=c.y()-r.y();r.points([u,d,h,S,g,m]),r.hitFunc((function(e){e.beginPath(),e.moveTo(u,d),e.lineTo(h,S),e.lineTo(g,m),e.closePath(),e.fillStrokeShape(r)}));const p=new b(s.x(),s.y()),f=new b(l.x(),l.y()),y=new b(c.x(),c.y()),D=new pi(p,f),C=new pi(f,y);let v=fi(D,C),I=D.getInclination();v>180&&(v=360-v,I+=v);const T=o.getText(),L=T.meta,P={angle:{value:v,unit:mi.t("unit.degree")}};T.setText(U(L.textExpr,P)),L.quantification=P;const w={x:(D.getMidpoint().getX()+C.getMidpoint().getX())/2,y:(D.getMidpoint().getY()+C.getMidpoint().getY())/2-t.applyZoomScale(15).y};o.position(w);const O=33*Math.min(D.getLength(),C.getLength())/100;a.innerRadius(O),a.outerRadius(O),a.angle(v),a.rotation(-I);const A={x:l.x(),y:l.y()};a.position(A)}},RectangleFactory:class{getGroupName(){return"rectangle-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new Mi(e[0],e[1]),r=new(ln().Rect)({x:i.getBegin().getX(),y:i.getBegin().getY(),width:i.getWidth(),height:i.getHeight(),stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),o=new(ln().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let a="";const s=n.getModality();a=void 0!==Li.labelText.rectangle[s]?Li.labelText.rectangle[s]:Li.labelText.rectangle["*"];const l=i.quantify(n,q(a));o.setText(U(a,l)),o.meta={textExpr:a,quantification:l};const c=new(ln().Label)({x:i.getBegin().getX(),y:i.getEnd().getY(),scale:t.applyZoomScale(1),visible:0!==a.length,name:"label"});c.add(o),c.add(new(ln().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const u=new(ln().Group);return u.name(this.getGroupName()),u.add(c),u.add(r),u.visible(!0),u}getAnchors(e,t){const n=e.x(),i=e.y(),r=e.width(),o=e.height(),a=[];return a.push(Di(n,i,"topLeft",t)),a.push(Di(n+r,i,"topRight",t)),a.push(Di(n+r,i+o,"bottomRight",t)),a.push(Di(n,i+o,"bottomLeft",t)),a}update(e,t,n){const r=e.getParent();if(!(r instanceof ln().Group))return;const o=r.getChildren((function(e){return"shape"===e.name()}))[0],a=r.getChildren((function(e){return"label"===e.name()}))[0],s=r.getChildren((function(e){return"topLeft"===e.id()}))[0],l=r.getChildren((function(e){return"topRight"===e.id()}))[0],c=r.getChildren((function(e){return"bottomRight"===e.id()}))[0],u=r.getChildren((function(e){return"bottomLeft"===e.id()}))[0];let d;switch(e.id()){case"topLeft":s.x(e.x()),s.y(e.y()),l.y(e.y()),u.x(e.x());break;case"topRight":l.x(e.x()),l.y(e.y()),s.y(e.y()),c.x(e.x());break;case"bottomRight":c.x(e.x()),c.y(e.y()),u.y(e.y()),l.x(e.x());break;case"bottomLeft":u.x(e.x()),u.y(e.y()),c.y(e.y()),s.x(e.x());break;default:i.error("Unhandled anchor id: "+e.id())}o.position(s.position());const h=l.x()-s.x(),S=u.y()-s.y();h&&S&&o.size({width:h,height:S});const g=new b(r.x()+s.x(),r.y()+s.y()),m=new b(r.x()+c.x(),r.y()+c.y()),p=new Mi(g,m);const f={x:p.getBegin().getX()-r.x(),y:p.getEnd().getY()-r.y()};a.position(f),this.#Zo(r,n)}updateQuantification(e,t){this.#Zo(e,t)}#Zo(e,t){const n=e.getChildren((function(e){return"shape"===e.name()}))[0],i=e.getChildren((function(e){return"label"===e.name()}))[0];if(!(i instanceof ln().Label))return;const r=new b(e.x()+n.x(),e.y()+n.y()),o=new b(r.getX()+n.width(),r.getY()+n.height()),a=new Mi(r,o),s=i.getText(),l=s.meta,c=a.quantify(t,q(l.textExpr));s.setText(U(l.textExpr,c)),l.quantification=c}#_o(e){const t=e.getRound(),n=t.max.getX()-t.min.getX(),i=t.max.getY()-t.min.getY();return new(ln().Rect)({x:t.min.getX(),y:t.min.getY(),width:n,height:i,fill:"grey",strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow"})}},RoiFactory:Pi,RulerFactory:class{getGroupName(){return"ruler-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new pi(e[0],e[1]),r=new(ln().Line)({points:[i.getBegin().getX(),i.getBegin().getY(),i.getEnd().getX(),i.getEnd().getY()],stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),o=t.applyZoomScale(10).x,a=yi(i,e[0],o),s=new(ln().Line)({points:[a.getBegin().getX(),a.getBegin().getY(),a.getEnd().getX(),a.getEnd().getY()],stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape-tick0"}),l=yi(i,e[1],o),c=new(ln().Line)({points:[l.getBegin().getX(),l.getBegin().getY(),l.getEnd().getX(),l.getEnd().getY()],stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape-tick1"});r.hitFunc((function(e){e.beginPath(),e.moveTo(a.getBegin().getX(),a.getBegin().getY()),e.lineTo(a.getEnd().getX(),a.getEnd().getY()),e.lineTo(l.getEnd().getX(),l.getEnd().getY()),e.lineTo(l.getBegin().getX(),l.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}));const u=new(ln().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let d="";const h=n.getModality();d=void 0!==Li.labelText.ruler[h]?Li.labelText.ruler[h]:Li.labelText.ruler["*"];const S=i.quantify(n);u.setText(U(d,S)),u.meta={textExpr:d,quantification:S};const g=i.getBegin().getX()>i.getEnd().getX()?0:-1,m=i.getBegin().getY()>i.getEnd().getY()?-1:0,p=new(ln().Label)({x:i.getEnd().getX()+g*t.applyZoomScale(u.width()).x,y:i.getEnd().getY()+m*t.applyZoomScale(15).y,scale:t.applyZoomScale(1),visible:0!==d.length,name:"label"});p.add(u),p.add(new(ln().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const f=new(ln().Group);return f.name(this.getGroupName()),f.add(p),f.add(s),f.add(c),f.add(r),f.visible(!0),f}getAnchors(e,t){const n=e.points(),i=[];return i.push(Di(n[0]+e.x(),n[1]+e.y(),"begin",t)),i.push(Di(n[2]+e.x(),n[3]+e.y(),"end",t)),i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof ln().Line))return;const o=i.getChildren((function(e){return"shape-tick0"===e.name()}))[0];if(!(o instanceof ln().Line))return;const a=i.getChildren((function(e){return"shape-tick1"===e.name()}))[0];if(!(a instanceof ln().Line))return;const s=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(s instanceof ln().Label))return;const l=i.getChildren((function(e){return"begin"===e.id()}))[0],c=i.getChildren((function(e){return"end"===e.id()}))[0];switch(e.id()){case"begin":l.x(e.x()),l.y(e.y());break;case"end":c.x(e.x()),c.y(e.y())}const u=l.x()-r.x(),d=l.y()-r.y(),h=c.x()-r.x(),S=c.y()-r.y();r.points([u,d,h,S]);const g=new b(l.x(),l.y()),m=new b(c.x(),c.y()),p=new pi(g,m),f=t.applyZoomScale(10).x,y=new b(u,d),D=new b(h,S),C=yi(p,y,f);o.points([C.getBegin().getX(),C.getBegin().getY(),C.getEnd().getX(),C.getEnd().getY()]);const v=yi(p,D,f);a.points([v.getBegin().getX(),v.getBegin().getY(),v.getEnd().getX(),v.getEnd().getY()]),r.hitFunc((function(e){e.beginPath(),e.moveTo(C.getBegin().getX(),C.getBegin().getY()),e.lineTo(C.getEnd().getX(),C.getEnd().getY()),e.lineTo(v.getEnd().getX(),v.getEnd().getY()),e.lineTo(v.getBegin().getX(),v.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}));const I=s.getText(),T=I.meta,L=p.quantify(n);I.setText(U(T.textExpr,L)),T.quantification=L;const P=p.getBegin().getX()>p.getEnd().getX()?0:-1,w=p.getBegin().getY()>p.getEnd().getY()?-1:0,O={x:p.getEnd().getX()+P*t.applyZoomScale(I.width()).x,y:p.getEnd().getY()+w*t.applyZoomScale(15).y};s.position(O)}}},filter:{Threshold:class{#Ni;constructor(e){this.#Ni=e}#Dr=new Qi;#Ko=!0;#Oe=new He;activate(e){e&&(this.#Ko=!0)}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run threshod filter on.");this.#Dr.setMin(e.min),this.#Dr.setMax(e.max),this.#Ko&&(this.#Dr.setOriginalImage(this.#Ni.getImage(e.dataId)),this.#Ko=!1);const t=new Vi(this.#Dr,e.dataId,this.#Ni);t.onExecute=this.#Re,t.onUndo=this.#Re,t.execute(),this.#Ni.addToUndoStack(t)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}},Sobel:class{#Ni;constructor(e){this.#Ni=e}#Oe=new He;activate(e){}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run sobel filter on.");const t=new Ni;t.setOriginalImage(this.#Ni.getImage(e.dataId));const n=new Vi(t,e.dataId,this.#Ni);n.onExecute=this.#Re,n.onUndo=this.#Re,n.execute(),this.#Ni.addToUndoStack(n)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}},Sharpen:class{#Ni;constructor(e){this.#Ni=e}#Oe=new He;activate(e){}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run sharpen filter on.");const t=new Bi;t.setOriginalImage(this.#Ni.getImage(e.dataId));const n=new Vi(t,e.dataId,this.#Ni);n.onExecute=this.#Re,n.onUndo=this.#Re,n.execute(),this.#Ni.addToUndoStack(n)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}}}};class zi{divId;orientation;colourMap;opacity;wlPresetName;windowCenter;windowWidth;constructor(e){this.divId=e}}class Wi{options;constructor(e){this.options=e}}class Yi{dataViewConfigs;tools;binders;viewOnFirstLoadItem;defaultCharacterSet;overlayConfig;rootDocument;constructor(e){this.dataViewConfigs=e}}class Xi{#di=null;#Jo=null;#$o=null;#ea=null;#ta=null;#na=null;#Yt=new cn;#ia={};#Oe=new He;getImage(e){let t;return void 0!==this.#Jo.get(e)&&(t=this.#Jo.get(e).image),t}setImage(e,t){this.#Jo.setImage(e,t)}addNewImage(e,t,n){const i=this.#Jo.getNextDataId();return this.#Re({type:"loadstart",loadtype:"image",source:n,dataid:i}),this.#Jo.addNew(i,e,t),this.#Re({type:"loaditem",loadtype:"image",data:t,source:n,dataid:i,isfirstitem:!0}),this.#di.viewOnFirstLoadItem&&this.render(i),this.#Re({type:"load",loadtype:"image",source:n,dataid:i}),this.#Re({type:"loadend",loadtype:"image",source:n,dataid:i}),i}getMetaData(e){let t;return void 0!==this.#Jo.get(e)&&(t=this.#Jo.get(e).meta),t}getDataIds(){return this.#Jo.getDataIds()}getDataIdsFromSopUids(e){return this.#Jo.getDataIdsFromSopUids(e)}canScroll(){return this.#ta.getActiveLayerGroup().getActiveViewLayer().getViewController().canScroll()}canWindowLevel(){return this.#ta.getActiveLayerGroup().getActiveViewLayer().getViewController().canWindowLevel()}getAddedScale(){return this.#ta.getActiveLayerGroup().getAddedScale()}getBaseScale(){return this.#ta.getActiveLayerGroup().getBaseScale()}getOffset(){return this.#ta.getActiveLayerGroup().getOffset()}getToolboxController(){return this.#$o}getActiveLayerGroup(){return this.#ta.getActiveLayerGroup()}setActiveLayerGroup(e){this.#ta.setActiveLayerGroup(e)}getViewLayersByDataId(e){return this.#ta.getViewLayersByDataId(e)}getDrawLayersByDataId(e){return this.#ta.getDrawLayersByDataId(e)}getLayerGroupByDivId(e){return this.#ta.getLayerGroupByDivId(e)}getNumberOfLayerGroups(){return this.#ta.getNumberOfLayerGroups()}getStyle(){return this.#Yt}addToUndoStack=e=>{null!==this.#na&&this.#na.add(e)};init(e){if(this.#di=e,void 0===this.#di.viewOnFirstLoadItem&&(this.#di.viewOnFirstLoadItem=!0),void 0===this.#di.dataViewConfigs&&(this.#di.dataViewConfigs={}),void 0===this.#di.rootDocument&&(this.#di.rootDocument=document),this.#na=new Qn,this.#na.addEventListener("undoadd",this.#Re),this.#na.addEventListener("undo",this.#Re),this.#na.addEventListener("redo",this.#Re),void 0!==this.#di.tools){const e={},t=Object.keys(this.#di.tools);for(let n=0;n<t.length;++n){const r=t[n];let o=ki[r];if(void 0===o&&(o=Gi[r]),void 0!==o){if(e[r]=new o(this),void 0!==e[r].addEventListener){const t=e[r].getEventNames();for(let n=0;n<t.length;++n)e[r].addEventListener(t[n],this.#Re)}const t=this.#di.tools[r];if(void 0!==t.options&&0!==t.options.length){let n,o="raw";if(void 0!==e[r].getOptionsType&&(o=e[r].getOptionsType()),"instance"===o||"factory"===o){n={};for(let e=0;e<t.options.length;++e){const a=t.options[e];let s=a;"factory"===o&&(s+="Factory");const l=r.charAt(0).toLowerCase()+r.slice(1);void 0!==Hi[l][s]?n[a]=Hi[l][s]:i.warn("Could not find option class for: "+a)}}else n=t.options;e[r].setOptions(n)}}else i.warn("Could not initialise unknown tool: "+r)}this.#$o=new Bn(e)}this.#ea=new ai(this.#di.defaultCharacterSet),this.#ea.onloadstart=this.#ra,this.#ea.onprogress=this.#oa,this.#ea.onloaditem=this.#aa,this.#ea.onload=this.#sa,this.#ea.onloadend=this.#la,this.#ea.onerror=this.#ca,this.#ea.onabort=this.#ua,this.#Jo=new li,this.#ta=new bn,void 0!==this.#di.binders&&this.#ta.setBinders(this.#di.binders)}reset(){this.#Jo.reset(),this.#ta.empty(),this.#ia={},this.#na&&(this.#na=new Qn,this.#na.addEventListener("undoadd",this.#Re),this.#na.addEventListener("undo",this.#Re),this.#na.addEventListener("redo",this.#Re))}resetLayout(){this.#ta.reset(),this.#ta.draw()}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}loadFiles=e=>{const t=this.#Jo.getNextDataId();0!==e.length?this.#ea.loadFiles(e,t):i.warn("Ignoring empty input file list.")};loadURLs=(e,t)=>{const n=this.#Jo.getNextDataId();0!==e.length?this.#ea.loadURLs(e,n,t):i.warn("Ignoring empty input url list.")};loadFromUri=(e,t)=>{const n=function(e){const t=Mn(e);return 0===Object.keys(t).length?null:t.query}(e),r=()=>{this.removeEventListener("loadend",r),this.loadURLs([n.state])};n&&void 0!==n.input&&(void 0!==n.state&&this.addEventListener("loadend",r),function(e,t,n){e.type&&"manifest"===e.type?function(e,t){let n="";"/"===e.input[0]&&(n=window.location.protocol+"//"+window.location.host),n+=e.input;const r=new XMLHttpRequest;r.open("GET",decodeURIComponent(n),!0),r.responseType="document",r.onload=function(n){t(function(e,t){const n=[],r=e.getElementsByTagName("wado_query")[0].getAttribute("wadoURL")+"?requestType=WADO&contentType=application/dicom&",o=e.getElementsByTagName("Patient");o.length>1&&i.warn("More than one patient, loading first one.");const a=o[0].getElementsByTagName("Study");a.length>1&&i.warn("More than one study, loading first one.");const s=a[0].getAttribute("StudyInstanceUID"),l=a[0].getElementsByTagName("Series");l.length>1&&i.warn("More than one series, loading first one.");const c=l[0].getAttribute("SeriesInstanceUID"),u=l[0].getElementsByTagName("Instance");let d=u.length;t<d&&(d=t);for(let e=0;e<d;++e){const t=r+"&studyUID="+s+"&seriesUID="+c+"&objectUID="+u[e].getAttribute("SOPInstanceUID");n.push(t)}return n}(n.target.responseXML,e.nslices))},r.onerror=function(e){i.warn("RequestError while receiving manifest: "+e.target.status)},r.send(null)}(e,t):t(function(e,t){const n=[];let i="key";t&&(i=t);const r=decodeURIComponent(e),o=Mn(r);if(0===Object.keys(o).length)n.push(r);else{const e=Object.keys(o.query);let t=null;for(let n=0;n<e.length;++n)if(o.query[e[n]]instanceof Array){t=e[n];break}if(t){const r=o.query[t];let a=o.base;""!==a&&"file"!==t&&(a+="?");let s,l=!1;for(let n=0;n<e.length;++n)e[n]!==t&&(l&&(a+="&"),a+=e[n]+"="+o.query[e[n]],l=!0);for(let e=0;e<r.length;++e)s=a,l&&(s+="&"),"key"===i&&(s+=t+"="),s+=r[e],n.push(s)}else n.push(r)}return n}(e.input,e.dwvReplaceMode),n)}(n,this.loadURLs,t))};loadImageObject=e=>{const t=this.#Jo.getNextDataId();this.#ea.loadImageObject(e,t)};abortAllLoads(){const e=this.#ea.getLoadingDataIds();for(const t of e)this.abortLoad(t)}abortLoad(e){this.#ea.abort(e),this.#Jo.remove(e),this.#ta.removeLayersByDataId(e)}fitToContainer(){this.#ta.fitToContainer()}initWLDisplay(){this.#ta.getActiveLayerGroup().getActiveViewLayer().getViewController().initialise()}setImageSmoothing(e){this.#ta.setImageSmoothing(e),this.#ta.draw()}getViewConfigs(e,t){if(null===this.#di.dataViewConfigs||void 0===this.#di.dataViewConfigs)throw new Error("No available data view configuration");let n=[];return void 0!==this.#di.dataViewConfigs[e]?n=this.#di.dataViewConfigs[e]:t||void 0===this.#di.dataViewConfigs["*"]||(n=this.#di.dataViewConfigs["*"]),n}getViewConfig(e,t,n){return this.getViewConfigs(e,n).find((function(e){return e.divId===t}))}getDataViewConfigs(){return this.#di.dataViewConfigs}setDataViewConfigs(e){this.#ta.empty(),this.#di.dataViewConfigs=e,this.#da(e)}addDataViewConfig(e,t){const n=this.#di.dataViewConfigs;if(void 0===n[e]&&(n[e]=[]),-1!==n[e].findIndex((function(e){return e.divId===t.divId})))throw new Error("Duplicate view config for data "+e+" and div "+t.divId);this.#di.dataViewConfigs[e].push(t),void 0===this.#ta.getLayerGroupByDivId(t.divId)&&this.#ha(t),this.render(e,[t])}removeDataViewConfig(e,t){const n=this.#di.dataViewConfigs;if(void 0===n[e])return;const i=n[e].findIndex((function(e){return e.divId===t}));if(-1!==i&&(n[e].splice(i,1),0===n[e].length&&delete n[e],void 0!==this.#Jo.get(e))){const n=this.#ta.getLayerGroupByDivId(t);if(void 0!==n){const t=n.getViewLayersByDataId(e);if(1!==t.length)throw new Error("Expected one view layer, got "+t.length);n.removeLayer(t[0]);const i=n.getDrawLayersByDataId(e);if(1!==i.length)throw new Error("Expected one draw layer, got "+i.length);n.removeLayer(i[0]),0===n.getNumberOfLayers()&&this.#ta.removeLayerGroup(n)}}}updateDataViewConfig(e,t,n){const i=this.#di.dataViewConfigs;if(void 0===i[e])throw new Error("No config for dataId: "+e);const r=i[e].findIndex((function(e){return e.divId===t}));if(-1===r)throw new Error("No config for dataId: "+e+" and divId: "+t);const o=i[e][r];for(const e in n)o[e]=n[e];const a=this.#ta.getLayerGroupByDivId(o.divId);if(void 0!==a){const t=a.getViewLayersByDataId(e);if(1!==t.length)throw new Error("Expected one view layer, got "+t.length);a.removeLayer(t[0]);const n=a.getDrawLayersByDataId(e);if(1!==n.length)throw new Error("Expected one draw layer, got "+n.length);a.removeLayer(n[0])}this.render(e,[o])}#da(e){const t=Object.keys(e),n=[];for(let i=0;i<t.length;++i){const r=e[t[i]];for(let e=0;e<r.length;++e){const t=r[e];n.includes(t.divId)||(this.#ha(t),n.push(t.divId))}}}#ha(e){const t=this.#di.rootDocument.getElementById(e.divId),n=this.#ta.addLayerGroup(t);this.#Sa(n)}setLayerGroupsBinders(e){const t=[];for(let n=0;n<e.length;++n)void 0!==An[e[n]]&&t.push(new An[e[n]]);this.#ta.setBinders(t)}render(e,t){if(null==e)throw new Error("Cannot render without data id");if(0===this.#ta.getNumberOfLayerGroups()&&this.#da(this.#di.dataViewConfigs),void 0===t&&(t=this.getViewConfigs(e)),0!==t.length)for(let n=0;n<t.length;++n){const i=t[n],r=this.#ta.getLayerGroupByDivId(i.divId);if(!r)throw new Error("No layer group for "+i.divId);void 0!==this.#Jo.get(e)&&0===r.getViewLayersByDataId(e).length&&this.#ga(e,i),r.draw()}else i.info("Not rendering data: "+e+" (no data view config)")}zoom(e,t,n){const i=this.#ta.getActiveLayerGroup(),r=i.getActiveViewLayer().getViewController().getCurrentScrollPosition(),o=new x(t,n,r);i.addScale(e,o),i.draw()}translate(e,t){const n=this.#ta.getActiveLayerGroup();n.addTranslation({x:e,y:t,z:0}),n.draw()}setOpacity(e){const t=this.#ta.getActiveLayerGroup().getActiveViewLayer();t.setOpacity(e),t.draw()}setDrawings(e,t){const n=this.#ta.getActiveLayerGroup(),i=n.getActiveViewLayer().getViewController(),r=n.getActiveDrawLayer().getDrawController();r.setDrawings(e,t,this.#Re,this.addToUndoStack),r.activateDrawLayer(i.getCurrentOrientedIndex(),i.getScrollIndex())}getJsonState(){return(new xn).toJSON(this)}applyJsonState(e){const t=new xn;t.apply(this,t.fromJSON(e))}onResize=()=>{this.fitToContainer()};onKeydown=e=>{this.#Re(e)};defaultOnKeydown=e=>{if(e.ctrlKey)if(e.shiftKey){const t=this.#ta.getActiveLayerGroup(),n=t.getActiveViewLayer().getViewController();"ArrowLeft"===e.key?n.moreThanOne(3)&&n.decrementIndex(3):"ArrowUp"===e.key?t.canScroll()&&n.incrementScrollIndex():"ArrowRight"===e.key?t.moreThanOne(3)&&n.incrementIndex(3):"ArrowDown"===e.key&&t.canScroll()&&n.decrementScrollIndex()}else if("y"===e.key)this.#na.redo();else if("z"===e.key)this.#na.undo();else if(" "===e.key)for(let e=0;e<this.#ta.getNumberOfLayerGroups();++e)this.#ta.getLayerGroup(e).setShowCrosshair(!this.#ta.getLayerGroup(e).getShowCrosshair())};resetDisplay(){this.resetLayout(),this.initWLDisplay()}resetZoom(){this.resetLayout()}setColourMap(e){this.#ta.getActiveLayerGroup().getActiveViewLayer().getViewController().setColourMap(e)}setWindowLevelPreset(e){this.#ta.getActiveLayerGroup().getActiveViewLayer().getViewController().setWindowLevelPreset(e)}setTool(e){for(let t=0;t<this.#ta.getNumberOfLayerGroups();++t){const n=this.#ta.getLayerGroup(t);let i=null;i="Draw"===e||"Livewire"===e||"Floodfill"===e?n.getActiveDrawLayer():n.getActiveViewLayer(),i&&this.#$o.bindLayerGroup(n,i)}this.#$o.setSelectedTool(e)}setToolFeatures(e){this.#$o.setToolFeatures(e)}undo(){this.#na.undo()}redo(){this.#na.redo()}getStackSize(){return this.#na.getStackSize()}getCurrentStackIndex(){return this.#na.getCurrentStackIndex()}getOverlayData(e){let t;return void 0!==this.#ia&&(t=this.#ia[e]),t}toggleOverlayListeners(e){const t=this.getOverlayData(e);void 0!==t&&(t.isListening()?t.removeAppListeners():t.addAppListeners())}#Re=e=>{this.#Oe.fireEvent(e)};#ra=e=>{void 0!==this.#di.overlayConfig&&(this.#ia[e.dataid]=new hi(this,e.dataid,this.#di.overlayConfig)),e.type="loadstart",this.#Re(e)};#oa=e=>{e.type="loadprogress",this.#Re(e)};#aa=e=>{void 0===e.data&&i.error("Missing loaditem event data."),void 0===e.loadtype&&i.error("Missing loaditem event load type.");const t=e.isfirstitem;let n=null;"image"===e.loadtype?(t?this.#Jo.addNew(e.dataid,e.data.image,e.data.info):this.#Jo.update(e.dataid,e.data.image,e.data.info),n=e.data.info):"state"===e.loadtype&&(this.applyJsonState(e.data),n="state"),this.#Re({type:"loaditem",data:n,source:e.source,loadtype:e.loadtype,dataid:e.dataid,isfirstitem:e.isfirstitem,warn:e.warn}),void 0!==this.#ia&&void 0!==this.#ia[e.dataid]&&this.#ia[e.dataid].addItemMeta(n),"image"===e.loadtype&&0!==this.getViewConfigs(e.dataid).length&&t&&this.#di.viewOnFirstLoadItem&&this.render(e.dataid)};#sa=e=>{e.type="load",this.#Re(e)};#la=e=>{e.type="loadend",this.#Re(e)};#ca=e=>{void 0===e.type&&(e.type="error"),this.#Re(e)};#ua=e=>{void 0===e.type&&(e.type="abort"),this.#Re(e)};#Sa(e){e.addEventListener("zoomchange",this.#Re),e.addEventListener("offsetchange",this.#Re),e.addEventListener("renderstart",this.#Re),e.addEventListener("renderend",this.#Re);for(let t=0;t<jt.length;++t)e.addEventListener(jt[t],this.#Re);this.#$o&&this.#$o.hasTool("Draw")&&(e.addEventListener("drawcreate",this.#Re),e.addEventListener("drawdelete",this.#Re)),e.addEventListener("wlchange",(e=>{const t=Ln(e.srclayerid).groupDivId,n=this.getViewConfig(e.dataid,t,!0);void 0!==n&&(n.windowCenter=void 0,n.windowWidth=void 0,n.wlPresetName=void 0,2===e.value.length&&(n.windowCenter=e.value[0],n.windowWidth=e.value[1]),3===e.value.length&&(n.wlPresetName=e.value[2]))})),e.addEventListener("opacitychange",(e=>{const t=Ln(e.srclayerid).groupDivId,n=this.getViewConfig(e.dataid,t,!0);void 0!==n&&(n.opacity=e.value[0])})),e.addEventListener("colourmapchange",(e=>{const t=Ln(e.srclayerid).groupDivId,n=this.getViewConfig(e.dataid,t,!0);void 0!==n&&(n.colourMap=e.value[0])}))}#ga(e,t){const n=this.#Jo.get(e);if(!n)throw new Error("Cannot initialise layer with missing data, id: "+e);const i=this.#ta.getLayerGroupByDivId(t.divId);if(!i)throw new Error("Cannot initialise layer with missing group, id: "+t.divId);const o=n.image.getGeometry();this.#ta.unbindLayerGroups();const a=(new Xt).create(n.meta,n.image),s=function(e,t){let n=O();return void 0!==t&&(n=e.asOneAndZeros().getInverse().multiply(t)),n.getAbs()}(o.getOrientation(),function(e){let t;return e===De.Axial?t=O():e===De.Coronal?t=ye():e===De.Sagittal&&(t=new w([0,0,-1,1,0,0,0,-1,0])),t}(t.orientation));a.setOrientation(s),"SEG"===n.image.getMeta().Modality&&a.setAlphaFunction((function(e){return 0===e[0]&&0===e[1]&&0===e[2]?0:255}));const l=0===i.getNumberOfLayers();let c=1;void 0!==t.opacity?c=t.opacity:l||(c=.5);const u=i.addViewLayer();u.setView(a,e);const d=o.getSize(s).get2D(),h=o.getSpacing(s).get2D();u.initialise(d,h,c);const S=u.getViewController();if(void 0!==t.wlPresetName)S.setWindowLevelPreset(t.wlPresetName);else if(void 0!==t.windowCenter&&void 0!==t.windowWidth){const e=new r(t.windowCenter,t.windowWidth);S.setWindowLevel(e)}let g;void 0!==t.colourMap?S.setColourMap(t.colourMap):l||("PT"===n.image.getMeta().Modality?S.setColourMap("hot"):S.setColourMap("rainbow")),this.#Jo.addEventListener("imageset",u.onimageset),this.#$o&&this.#$o.hasTool("Draw")&&(g=i.addDrawLayer(),g.initialise(d,h,e),g.setPlaneHelper(u.getViewController().getPlaneHelper()));const m=[S.getCurrentIndex().getValues(),S.getCurrentPosition().getValues()];i.updateLayersToPositionChange({value:m,srclayerid:u.getId()}),this.#ta.fitToContainer(),u.setOffset(i.getOffset());const p=this.#ma(o.getOrientation(),t.orientation);if(p.offset.x&&(u.addFlipOffsetX(),void 0!==g&&g.addFlipOffsetX()),p.offset.y&&(u.addFlipOffsetY(),void 0!==g&&g.addFlipOffsetY()),p.scale.x&&(u.flipScaleX(),void 0!==g&&g.flipScaleX()),p.scale.y&&(u.flipScaleY(),void 0!==g&&g.flipScaleY()),p.scale.z&&(u.flipScaleZ(),void 0!==g&&g.flipScaleZ()),l)u.setScale(i.getScale());else{const e=i.getBaseViewLayer();u.initScale(i.getScale(),e.getAbsoluteZoomOffset())}void 0!==g&&g.setScale(i.getScale()),this.#ta.bindLayerGroups(),this.#$o&&this.#$o.bindLayerGroup(i,u),l&&this.#$o&&this.#$o.init()}#ma(e,t){const n=Ce(e.asOneAndZeros());if(void 0===n)throw new Error("Unsupported undefined orientation code");const r=void 0===t,o=!r&&t===De.Axial,a=!r&&t===De.Coronal,s=!r&&t===De.Sagittal,l={x:!1,y:!1},c={x:!1,y:!1,z:!1};return"LPS"===n?(a||s)&&(c.z=!0,l.y=!0):"LAI"===n?r||o?l.y=!0:a?c.z=!0:s&&(c.z=!0,l.x=!0):"RPI"===n?r||o?l.x=!0:a?(c.z=!0,l.x=!0):s&&(c.z=!0):"RAS"===n?(l.x=!0,l.y=!0,(a||s)&&(c.z=!0)):"LSA"===n?(l.y=!0,r||a?c.z=!0:o?c.y=!0:s&&(l.x=!0,c.y=!0,c.z=!0)):"RSP"===n?r||a?(l.x=!0,l.y=!0,c.x=!0,c.z=!0):o?(l.x=!0,c.x=!0):s&&(l.y=!0,c.z=!0):"RIA"===n?(l.x=!0,r||a?c.x=!0:o?(l.y=!0,c.x=!0,c.y=!0):s&&(c.y=!0)):"PSL"===n?(c.z=!0,(r||s||a)&&(l.y=!0)):"PIR"===n?(c.z=!0,(o||a)&&(l.x=!0)):"ASR"===n?(l.x=!0,l.y=!0,(r||s||a)&&(c.z=!0)):"AIL"===n?r||s?(l.x=!0,c.z=!0):o?l.y=!0:a&&(c.z=!0):i.warn("Unsupported orientation code: "+n+", display could be incorrect"),{scale:c,offset:l}}}class ji{#Io;#pa;constructor(e){this.#Io=e;const t=e.getMeta();void 0===t.custom&&(t.custom={}),void 0===t.custom.segments&&(t.custom.segments=[]),this.#pa=t.custom.segments}#fa(e){return this.#pa.findIndex((function(t){return t.number===e}))}hasSegment(e){return-1!==this.#fa(e)}maskHasSegments(e){const t=[],n=[];for(let r=0;r<e.length;++r){const o=this.getSegment(e[r]);void 0!==o?void 0!==o.displayValue?t.push(o.displayValue):t.push(o.displayRGBValue):(i.warn("Unknown segment in maskHasSegments: "+e[r]),n.push(r))}const r=this.#Io.hasValues(t);for(let e=0;e<n.length;++e)r.splice(n[e],0,!1);return r}getSegment(e){let t;const n=this.#fa(e);return-1!==n&&(t=this.#pa[n]),t}addSegment(e){-1===this.#fa(e.number)?this.#pa.push(e):i.warn("Not adding segment, it is allready in the segments list: "+e.number)}removeSegment(e){const t=this.#fa(e);-1!==t?this.#pa.splice(t,1):i.warn("Cannot remove segment, it is not in the segments list: "+e)}updateSegment(e){const t=this.#fa(e.number);-1!==t?this.#pa[t]=e:i.warn("Cannot update segment, it is not in the segments list: "+e.number)}}class Zi{#Io;#ya;#Vt;#Da;constructor(e,t,n){this.#Io=e,this.#ya=t,this.#Vt=void 0!==n&&n,void 0!==t.displayRGBValue?this.#Da=e.getOffsets(t.displayRGBValue):this.#Da=e.getOffsets(t.displayValue)}getName(){return"Delete-segment"}isValid(){return 0!==this.#Da.length}execute(){void 0!==this.#ya.displayRGBValue?this.#Io.setAtOffsets(this.#Da,p):this.#Io.setAtOffsets(this.#Da,0),new ji(this.#Io).removeSegment(this.#ya.number),this.#Vt||this.onExecute({type:"masksegmentdelete",segmentnumber:this.#ya.number})}undo(){void 0!==this.#ya.displayRGBValue?this.#Io.setAtOffsets(this.#Da,this.#ya.displayRGBValue):this.#Io.setAtOffsets(this.#Da,this.#ya.displayValue),new ji(this.#Io).addSegment(this.#ya),this.onUndo({type:"masksegmentredraw",segmentnumber:this.#ya.number})}onExecute(e){}onUndo(e){}}class _i{#Io;#ya;#Ca;#va;#Vt;#Da;constructor(e,t,n,i){this.#Io=e,this.#ya=t,this.#Ca=n,this.#Vt=void 0!==i&&i,void 0!==t.displayRGBValue?this.#va=t.displayRGBValue:this.#va=t.displayValue,this.#Da=e.getOffsets(this.#va)}getName(){return"Change-segment-colour"}isValid(){return 0!==this.#Da.length}execute(){this.#Io.setAtOffsets(this.#Da,this.#Ca),"number"==typeof this.#Ca?this.#ya.displayValue=this.#Ca:this.#ya.displayRGBValue=this.#Ca,this.#Vt||this.onExecute({type:"changemasksegmentcolour",segmentnumber:this.#ya.number,value:[this.#Ca]})}undo(){this.#Io.setAtOffsets(this.#Da,this.#va),"number"==typeof this.#va?this.#ya.displayValue=this.#va:this.#ya.displayRGBValue=this.#va,this.onUndo({type:"changemasksegmentcolour",segmentnumber:this.#ya.number,value:[this.#va]})}onExecute(e){}onUndo(e){}}class Ki{#Ia=[];#Ta;#La(e){return this.#Ia.findIndex((function(t){return t.number===e}))}isHidden(e){return-1!==this.#La(e)}addToHidden(e){this.isHidden(e.number)?i.warn("Not hidding segment, it is allready in the hidden list: "+e.number):(this.#Ia.push(e),this.#Ta=void 0!==e.displayValue)}removeFromHidden(e){const t=this.#La(e);-1!==t?this.#Ia.splice(t,1):i.warn("Cannot remove segment, it is not in the hidden list: "+e)}getAlphaFunc(){const e=[];this.#Ta?e[0]=0:e[0]={r:0,g:0,b:0};for(const t of this.#Ia)this.#Ta?e.push(t.displayValue):e.push(t.displayRGBValue);let t;return t=this.#Ta?function(t){for(let n=0;n<e.length;++n)if(t===e[n])return 0;return 255}:function(t){for(let n=0;n<e.length;++n)if(t[0]===e[n].r&&t[1]===e[n].g&&t[2]===e[n].b)return 0;return 255},t}}class Ji{x;y}class $i{x;y;z}}(),a}()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("konva"),require("jszip"),require("magic-wand-tool")):"function"==typeof define&&define.amd?define(["konva","jszip","konmagic-wand-tool"],t):"object"==typeof exports?exports.dwv=t(require("konva"),require("jszip"),require("magic-wand-tool")):e.dwv=t(e.Konva,e.JSZip,e.MagicWand)}(this,(function(e,t,n){return function(){"use strict";var i={654:function(e){e.exports=t},944:function(t){t.exports=e},324:function(e){e.exports=n}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return i[e](n,n.exports,o),n.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};o.r(a),o.d(a,{Annotation:function(){return Bn},AnnotationFactory:function(){return jr},AnnotationList:function(){return Gn},App:function(){return Jr},AppOptions:function(){return Kr},BLACK:function(){return C},ChangeSegmentColourCommand:function(){return to},ColourMap:function(){return f},DataElement:function(){return ve},DeleteSegmentCommand:function(){return eo},DicomCode:function(){return Bt},DicomParser:function(){return je},DicomSRContent:function(){return Wr},DicomWriter:function(){return Ut},DrawController:function(){return Zn},DrawLayer:function(){return ti},Geometry:function(){return ct},Image:function(){return Cn},Index:function(){return s},LayerGroup:function(){return ai},MaskFactory:function(){return fn},MaskSegment:function(){return $t},MaskSegmentHelper:function(){return $r},MaskSegmentViewHelper:function(){return no},Matrix33:function(){return b},NumberRange:function(){return st},Orientation:function(){return Pe},OverlayData:function(){return Wi},PlaneHelper:function(){return Pn},Point:function(){return q},Point2D:function(){return F},Point3D:function(){return E},RGB:function(){return y},RescaleSlopeAndIntercept:function(){return et},Scalar2D:function(){return io},Scalar3D:function(){return ro},ScrollWheel:function(){return Yi},Size:function(){return tt},Spacing:function(){return lt},Tag:function(){return de},TagValueExtractor:function(){return It},ToolConfig:function(){return _r},ToolboxController:function(){return fi},Vector3D:function(){return w},View:function(){return Ln},ViewConfig:function(){return Zr},ViewController:function(){return wn},ViewLayer:function(){return jn},WindowLevel:function(){return u},WriterRule:function(){return wt},addTagsToDictionary:function(){return Z},buildMultipart:function(){return Y},createImage:function(){return Dn},createMaskImage:function(){return yn},createView:function(){return Tn},customUI:function(){return Hn},decoderScripts:function(){return wi},defaultPresets:function(){return d},defaults:function(){return bn},getDefaultDicomSegJson:function(){return pn},getDicomSRContentItem:function(){return Yr},getDwvVersion:function(){return xe},getElementsFromJSONTags:function(){return Vt},getEllipseIndices:function(){return cr},getLayerDetailsFromEvent:function(){return ii},getMousePoint:function(){return Xn},getOrientationName:function(){return Ue},getPixelDataTag:function(){return De},getReverseOrientation:function(){return qe},getSRContent:function(){return Xr},getTagFromKey:function(){return Se},getTouchPoints:function(){return Wn},getTypedArray:function(){return ke},getUID:function(){return At},hasDicomPrefix:function(){return Re},i18n:function(){return On},isEqualRgb:function(){return v},labToUintLab:function(){return I},logger:function(){return c},luts:function(){return D},precisionRound:function(){return G},srgbToCielab:function(){return L},toolList:function(){return mr}});class s{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create index with no values.");if(0===e.length)throw new Error("Cannot create index with empty values.");if(!e.every((function(e){return!isNaN(e)})))throw new Error("Cannot create index with non number values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}canCompare(e){return!!e&&this.length()===e.length()}equals(e){if(!this.canCompare(e))return!1;for(let t=0,n=this.length();t<n;++t)if(this.get(t)!==e.get(t))return!1;return!0}compare(e){if(!this.canCompare(e))return null;const t=[];for(let n=0,i=this.length();n<i;++n)this.get(n)!==e.get(n)&&t.push(n);return t}add(e){if(!this.canCompare(e))return null;const t=[];for(let n=0,i=this.length();n<i;++n)t.push(this.get(n)+e.get(n));return new s(t)}getWithNew2D(e,t){const n=[e,t];for(let e=2,t=this.length();e<t;++e)n.push(this.get(e));return new s(n)}toStringId(e){if(void 0===e){e=[];for(let t=0;t<this.length();++t)e.push(t)}for(let t=0;t<e.length;++t)if(e[t]>=this.length())throw new Error("Non valid dimension for toStringId.");let t="";for(let n=0;n<e.length;++n)0!==n&&(t+="_"),t+="#"+e[n]+"-"+this.get(e[n]);return t}}class l{#t;#n;#i;#r;constructor(e,t){if(this.#t=e,this.#n=e.isID(),this.#i=Math.pow(2,t),!this.#n){this.#r=new Float32Array(this.#i);for(let e=0;e<this.#i;++e)this.#r[e]=this.#t.apply(e)}}getRSI(){return this.#t}getLength(){return this.#i}getValue(e){return this.#n?e:this.#r[e]}}const c={levels:{TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4},level:3,trace:function(e){this.level<=this.levels.TRACE&&console.trace(e)},debug:function(e){this.level<=this.levels.DEBUG&&console.debug(e)},info:function(e){this.level<=this.levels.INFO&&console.info(e)},warn:function(e){this.level<=this.levels.WARN&&console.warn(e)},error:function(e){this.level<=this.levels.ERROR&&console.error(e)}};class u{center;width;constructor(e,t){t<1&&(c.warn("Using minimum window width since input is not valid: "+t),t=1),this.center=e,this.width=t}equals(e){return null!=e&&this.center===e.center&&this.width===e.width}}const d={CT:{mediastinum:new u(40,400),lung:new u(-500,1500),bone:new u(500,2e3),brain:new u(40,80),head:new u(90,350)}};class h{#o;#a=0;#s=0;#l=255;#c=null;#u=null;#d=null;#h=null;constructor(e){this.#o=e,this.#S()}getWindowLevel(){return this.#o}#S(){const e=this.#o.center,t=this.#o.width,n=e+this.#a;this.#c=n-.5-(t-1)/2,this.#u=n-.5+(t-1)/2,this.#d=(this.#l-this.#s)/(t-1),this.#h=(-(n-.5)/(t-1)+.5)*(this.#l-this.#s)+this.#s}setSignedOffset(e){this.#a=e,this.#S()}apply(e){return e<=this.#c?this.#s:e>this.#u?this.#l:e*this.#d+this.#h}}class S{#g;#m;#r;#p=0;#f=!0;constructor(e,t,n){if(this.#g=e,t){const e=this.#g.getLength();this.#p=e/2}else this.#p=0;this.#f=n}getVoiLut(){return this.#m}getModalityLut(){return this.#g}setVoiLut(e){if(this.#m=e,this.#m.setSignedOffset(this.#g.getRSI().getSlope()*this.#p),this.#f){const e=this.#g.getLength();this.#r=new Uint8ClampedArray(e);for(let t=0;t<e;++t)this.#r[t]=this.#m.apply(this.#g.getValue(t))}}getValue(e){return this.#f?this.#r[e+this.#p]:Math.floor(this.#m.apply(e+this.#p))}}function g(e){const t=[];for(let n=0;n<256;++n)t.push(e(n));return t}function m(e){return e}function p(e){return 255-e}class f{red;green;blue;constructor(e,t,n){this.red=e,this.green=t,this.blue=n}}const D={plain:{red:g(m),green:g(m),blue:g(m)},invPlain:{red:g(p),green:g(p),blue:g(p)},rainbow:{blue:[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,200,208,216,224,232,240,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,251,249,247,245,243,241,239,237,235,233,231,229,227,225,223,221,219,217,215,213,211,209,207,205,203,201,199,197,195,193,192,189,186,183,180,177,174,171,168,165,162,159,156,153,150,147,144,141,138,135,132,129,126,123,120,117,114,111,108,105,102,99,96,93,90,87,84,81,78,75,72,69,66,63,60,57,54,51,48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3],red:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,62,60,58,56,54,52,50,48,46,44,42,40,38,36,34,32,30,28,26,24,22,20,18,16,14,12,10,8,6,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]},hot:{red:g((function(e){const t=3*e;return t>255?255:t})),green:g((function(e){const t=256/3;let n=0;return e>=t&&(n=3*(e-t),n>255)?255:n})),blue:g((function(e){const t=256/3;let n=0;return e>=2*t&&(n=3*(e-2*t),n>255)?255:n}))},hot_iron:{red:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,255],blue:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255]},pet:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,128,126,124,122,120,118,116,114,112,110,108,106,104,102,100,98,96,94,92,90,88,86,84,82,80,78,76,74,72,70,68,66,64,63,61,59,57,55,53,51,49,47,45,43,41,39,37,35,33,31,29,27,25,23,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,255],blue:[0,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,252,248,244,240,236,232,228,224,220,216,212,208,204,200,196,192,188,184,180,176,172,168,164,160,156,152,148,144,140,136,132,128,124,120,116,112,108,104,100,96,92,88,84,80,76,72,68,64,60,56,52,48,44,40,36,32,28,24,20,16,12,8,4,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,255]},hot_metal_blue:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,9,12,15,18,21,24,26,29,32,35,38,41,44,47,50,52,55,57,59,62,64,66,69,71,74,76,78,81,83,85,88,90,93,96,99,102,105,108,111,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,166,169,172,175,178,181,184,187,190,194,198,201,205,209,213,217,221,224,228,232,236,240,244,247,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,9,11,13,15,17,19,21,23,24,26,28,30,32,34,36,38,40,41,43,45,47,49,51,53,55,56,58,60,62,64,66,68,70,72,73,75,77,79,81,83,85,87,88,90,92,94,96,98,100,102,104,105,107,109,111,113,115,117,119,120,122,124,126,128,130,132,134,136,137,139,141,143,145,147,149,151,152,154,156,158,160,162,164,166,168,169,171,173,175,177,179,181,183,184,186,188,190,192,194,196,198,200,201,203,205,207,209,211,213,215,216,218,220,222,224,226,228,229,231,233,235,237,239,240,242,244,246,248,250,251,253,255],blue:[0,2,4,6,8,10,12,14,16,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,184,186,188,190,192,194,196,198,200,197,194,191,188,185,182,179,176,174,171,168,165,162,159,156,153,150,144,138,132,126,121,115,109,103,97,91,85,79,74,68,62,56,50,47,44,41,38,35,32,29,26,24,21,18,15,12,9,6,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,9,12,15,18,21,24,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,176,179,182,185,188,191,194,197,200,203,206,210,213,216,219,223,226,229,232,236,239,242,245,249,252,255]},pet_20step:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,96,96,96,96,96,96,96,96,96,96,96,96,96,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,112,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,64,64,64,64,64,64,64,64,64,64,64,64,224,224,224,224,224,224,224,224,224,224,224,224,224,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192,192,192,192,192,176,176,176,176,176,176,176,176,176,176,176,176,176,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,112,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,96,96,96,96,96,96,96,96,96,96,96,96,96,144,144,144,144,144,144,144,144,144,144,144,144,144,192,192,192,192,192,192,192,192,192,192,192,192,192,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,208,208,208,208,208,208,208,208,208,208,208,208,208,176,176,176,176,176,176,176,176,176,176,176,176,176,144,144,144,144,144,144,144,144,144,144,144,144,96,96,96,96,96,96,96,96,96,96,96,96,96,48,48,48,48,48,48,48,48,48,48,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255],blue:[0,0,0,0,0,0,0,0,0,0,0,0,0,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,128,176,176,176,176,176,176,176,176,176,176,176,176,176,192,192,192,192,192,192,192,192,192,192,192,192,192,224,224,224,224,224,224,224,224,224,224,224,224,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,64,64,64,64,64,64,64,64,64,64,64,64,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,64,64,64,64,64,64,64,64,64,64,64,64,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255]}};class y{r;g;b;constructor(e,t,n){this.r=e,this.g=t,this.b=n}}const C={r:0,g:0,b:0};function v(e,t){return null!==e&&null!==t&&void 0!==e&&void 0!==t&&e.r===t.r&&e.g===t.g&&e.b===t.b}function I(e){return{l:655.35*e.l,a:257*e.a+32896,b:257*e.b+32896}}const T={x:95.0489,y:100,z:108.884};function L(e){return function(e){function t(e){let t=null;return t=e>.008856452?Math.pow(e,.333333333):7.787037037*e+.137931034,t}const n=T,i=t(e.y/n.y);return{l:116*i-16,a:500*(t(e.x/n.x)-i),b:200*(i-t(e.z/n.z))}}(function(e){function t(e){let t=null;return t=e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),t}const n=t(e.r/255),i=t(e.g/255),r=t(e.b/255);return{x:100*(.4124*n+.3576*i+.1805*r),y:100*(.2126*n+.7152*i+.0722*r),z:100*(.0193*n+.1192*i+.9505*r)}}(e))}function P(e){const t={Yellow:"#ffff00",Red:"#ff0000",White:"#ffffff",Green:"#008000",Blue:"#0000ff",Lime:"#00ff00",Fuchsia:"#ff00ff",Black:"#000000"};let n="#ffff00";return void 0!==t[e]&&(n=t[e]),n}class w{#D;#y;#C;constructor(e,t,n){this.#D=e,this.#y=t,this.#C=n}getX(){return this.#D}getY(){return this.#y}getZ(){return this.#C}equals(e){return null!==e&&this.#D===e.getX()&&this.#y===e.getY()&&this.#C===e.getZ()}toString(){return"("+this.#D+", "+this.#y+", "+this.#C+")"}norm(){return Math.sqrt(this.#D*this.#D+this.#y*this.#y+this.#C*this.#C)}crossProduct(e){return new w(this.#y*e.getZ()-e.getY()*this.#C,this.#C*e.getX()-e.getZ()*this.#D,this.#D*e.getY()-e.getX()*this.#y)}dotProduct(e){return this.#D*e.getX()+this.#y*e.getY()+this.#C*e.getZ()}isCodirectional(e){return this.dotProduct(e)>0}}Number.EPSILON;const O=1e-4;function A(e,t,n){return void 0===n&&(n=Number.EPSILON),Math.abs(e-t)<n}class b{#e;#v;constructor(e){this.#e=e}get(e,t){return this.#e[3*e+t]}getInverse(){return void 0===this.#v&&(this.#v=function(e){const t=e.get(0,0),n=e.get(0,1),i=e.get(0,2),r=e.get(1,0),o=e.get(1,1),a=e.get(1,2),s=e.get(2,0),l=e.get(2,1),u=e.get(2,2),d=o*u-a*l,h=a*s-r*u,S=r*l-o*s;let g=t*d+n*h+i*S;if(0!==g)return g=1/g,new b([g*d,g*(i*l-n*u),g*(n*a-i*o),g*h,g*(t*u-i*s),g*(i*r-t*a),g*S,g*(n*s-t*l),g*(t*o-n*r)]);c.warn("Cannot invert 3*3 matrix with zero determinant.")}(this)),this.#v}equals(e,t){for(let n=0;n<3;++n)for(let i=0;i<3;++i)if(!A(this.get(n,i),e.get(n,i),t))return!1;return!0}toString(){let e="[";for(let t=0;t<3;++t){0!==t&&(e+=", \n ");for(let n=0;n<3;++n)0!==n&&(e+=", "),e+=this.get(t,n)}return e+="]",e}multiply(e){const t=[];for(let n=0;n<3;++n)for(let i=0;i<3;++i){let r=0;for(let t=0;t<3;++t)r+=this.get(n,t)*e.get(t,i);t.push(r)}return new b(t)}getAbs(){const e=[];for(let t=0;t<3;++t)for(let n=0;n<3;++n)e.push(Math.abs(this.get(t,n)));return new b(e)}multiplyArray3D(e){if(3!==e.length)throw new Error("Cannot multiply 3x3 matrix with non 3D array: "+e.length);const t=[];for(let n=0;n<3;++n){let i=0;for(let t=0;t<3;++t)i+=this.get(n,t)*e[t];t.push(i)}return t}multiplyVector3D(e){const t=this.multiplyArray3D([e.getX(),e.getY(),e.getZ()]);return new w(t[0],t[1],t[2])}multiplyPoint3D(e){const t=this.multiplyArray3D([e.getX(),e.getY(),e.getZ()]);return new E(t[0],t[1],t[2])}multiplyIndex3D(e){const t=this.multiplyArray3D(e.getValues());return new s(t)}getRowAbsMax(e){const t=[Math.abs(this.get(e,0)),Math.abs(this.get(e,1)),Math.abs(this.get(e,2))],n=Math.max.apply(null,t),i=t.indexOf(n);return{value:this.get(e,i),index:i}}getColAbsMax(e){const t=[Math.abs(this.get(0,e)),Math.abs(this.get(1,e)),Math.abs(this.get(2,e))],n=Math.max.apply(null,t),i=t.indexOf(n);return{value:this.get(i,e),index:i}}asOneAndZeros(){const e=[];for(let t=0;t<3;++t){const n=this.getRowAbsMax(t),i=n.value>0?1:-1;for(let t=0;t<3;++t)t===n.index?e.push(1*i):e.push(0)}return new b(e)}getThirdColMajorDirection(){return this.getColAbsMax(2).index}}function x(){return new b([1,0,0,0,1,0,0,0,1])}function R(e){return e.equals(x())}class F{#D;#y;constructor(e,t){this.#D=e,this.#y=t}getX(){return this.#D}getY(){return this.#y}equals(e){return null!=e&&this.#D===e.getX()&&this.#y===e.getY()}toString(){return"("+this.#D+", "+this.#y+")"}getDistance(e){const t=this.#D-e.getX(),n=this.#y-e.getY();return Math.sqrt(t*t+n*n)}}class E{#D;#y;#C;constructor(e,t,n){this.#D=e,this.#y=t,this.#C=n}getX(){return this.#D}getY(){return this.#y}getZ(){return this.#C}equals(e){return null!==e&&this.#D===e.getX()&&this.#y===e.getY()&&this.#C===e.getZ()}isSimilar(e,t){return null!==e&&A(this.#D,e.getX(),t)&&A(this.#y,e.getY(),t)&&A(this.#C,e.getZ(),t)}toString(){return"("+this.#D+", "+this.#y+", "+this.#C+")"}getDistance(e){return Math.sqrt(this.#I(e))}#I(e){const t=this.#D-e.getX(),n=this.#y-e.getY(),i=this.#C-e.getZ();return t*t+n*n+i*i}getClosest(e){let t=0,n=this.#I(e[t]);for(let i=0;i<e.length;++i){const r=this.#I(e[i]);r<n&&(t=i,n=r)}return t}minus(e){return new w(this.#D-e.getX(),this.#y-e.getY(),this.#C-e.getZ())}}class q{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create point with no values.");if(0===e.length)throw new Error("Cannot create point with empty values.");if(!e.every((function(e){return!isNaN(e)})))throw new Error("Cannot create point with non number values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}canCompare(e){return!!e&&this.length()===e.length()}equals(e){if(!this.canCompare(e))return!1;for(let t=0,n=this.length();t<n;++t)if(this.get(t)!==e.get(t))return!1;return!0}compare(e){if(!this.canCompare(e))return null;const t=[];for(let n=0,i=this.length();n<i;++n)this.get(n)!==e.get(n)&&t.push(n);return t}get3D(){return new E(this.get(0),this.get(1),this.get(2))}add(e){if(!this.canCompare(e))return null;const t=[],n=this.getValues(),i=e.getValues();for(let e=0;e<n.length;++e)t.push(n[e]+i[e]);return new q(t)}mergeWith3D(e){const t=this.getValues();return t[0]=e.getX(),t[1]=e.getY(),t[2]=e.getZ(),new q(t)}}function U(e,t,n){if(null==e||null==t)return!1;const i=n>0?0|n:0;return e.substring(i,i+t.length)===t}function M(e,t){return null!=e&&null!=t&&e.substring(e.length-t.length)===t}function Q(e){const t=[];if(null==e)return t;const n=/{(\w+)}/g;let i=n.exec(e);for(;i;)t.push(i[1]),i=n.exec(e);return t}function V(e,t){let n="";if(null==e)return n;if(n=e,null==t)return n;const i=Q(e);for(let e=0;e<i.length;++e){const r=t[i[e]];if(null!=r&&null!==r.value&&void 0!==r.value){let t=r.value.toPrecision(4);null!==r.unit&&void 0!==r.unit&&0!==r.unit.length&&("degree"!==r.unit&&(t+=" "),t+=r.unit);const o="{"+i[e]+"}";n=n.replace(o,t)}}return n}function N(e){let t=null;if(null!=e&&"."!==e[0]){const n=e.toLowerCase().split(".");1!==n.length&&(t=n.pop(),/[a-z]/.test(t)&&!t.includes("/")||(t=null))}return t}function B(e){const t=new Uint8Array(e.length);for(let n=0,i=e.length;n<i;n++)t[n]=e.charCodeAt(n);return t}function G(e,t){const n=Math.pow(10,t),i=.01/n;return Math.round(e*n+i)/n}function k(e,t){return null!==e&&null!==t&&void 0!==e&&void 0!==t&&H(e.slice().sort(),t.slice().sort())}function H(e,t){return null!==e&&null!==t&&void 0!==e&&void 0!==t&&e.length===t.length&&e.every((function(e,n){return e===t[n]}))}function z(e){return String.fromCharCode.apply(String,e)}function W(e,t,n,i){(void 0===n||n<0||n>=e.length)&&(n=0),(void 0===i||i<=n||i>e.length)&&(i=e.length);for(let r=n;r<i;++r)if(t(e[r],r,e))return r}function X(e){return function(t,n,i){for(let t=0;t<e.length;++t)if(i[n+t]!==e[t])return!1;return!0}}function Y(e,t){const n="\r\n";let i=0;const r=[];for(let o=0;o<e.length;++o){let a="";0!==o&&(a+=n),a+="--"+t+n;const s=Object.keys(e[o]);for(let t=0;t<s.length;++t){const i=s[t];"data"!==i&&(a+=i+": "+e[o][i]+n)}a+=n;const l=B(a);r.push(l),i+=l.byteLength+e[o].data.byteLength}const o=B("\r\n--"+t+"--"+n),a=new Uint8Array(i+o.byteLength);let s=0;for(let t=0;t<e.length;++t)a.set(r[t],s),s+=r[t].byteLength,a.set(new Uint8Array(e[t].data),s),s+=e[t].data.byteLength;return a.set(o,s),a}const j={"0000":{"0000":["UL","1","CommandGroupLength"],"0001":["UL","1","CommandLengthToEnd"],"0002":["UI","1","AffectedSOPClassUID"],"0003":["UI","1","RequestedSOPClassUID"],"0010":["SH","1","CommandRecognitionCode"],"0100":["US","1","CommandField"],"0110":["US","1","MessageID"],"0120":["US","1","MessageIDBeingRespondedTo"],"0200":["AE","1","Initiator"],"0300":["AE","1","Receiver"],"0400":["AE","1","FindLocation"],"0600":["AE","1","MoveDestination"],"0700":["US","1","Priority"],"0800":["US","1","CommandDataSetType"],"0850":["US","1","NumberOfMatches"],"0860":["US","1","ResponseSequenceNumber"],"0900":["US","1","Status"],"0901":["AT","1-n","OffendingElement"],"0902":["LO","1","ErrorComment"],"0903":["US","1","ErrorID"],1e3:["UI","1","AffectedSOPInstanceUID"],1001:["UI","1","RequestedSOPInstanceUID"],1002:["US","1","EventTypeID"],1005:["AT","1-n","AttributeIdentifierList"],1008:["US","1","ActionTypeID"],1020:["US","1","NumberOfRemainingSuboperations"],1021:["US","1","NumberOfCompletedSuboperations"],1022:["US","1","NumberOfFailedSuboperations"],1023:["US","1","NumberOfWarningSuboperations"],1030:["AE","1","MoveOriginatorApplicationEntityTitle"],1031:["US","1","MoveOriginatorMessageID"],4e3:["LT","1","DialogReceiver"],4010:["LT","1","TerminalType"],5010:["SH","1","MessageSetID"],5020:["SH","1","EndMessageID"],5110:["LT","1","DisplayFormat"],5120:["LT","1","PagePositionID"],5130:["CS","1","TextFormatID"],5140:["CS","1","NormalReverse"],5150:["CS","1","AddGrayScale"],5160:["CS","1","Borders"],5170:["IS","1","Copies"],5180:["CS","1","CommandMagnificationType"],5190:["CS","1","Erase"],"51A0":["CS","1","Print"],"51B0":["US","1-n","Overlays"]},"0002":{"0000":["UL","1","FileMetaInformationGroupLength"],"0001":["OB","1","FileMetaInformationVersion"],"0002":["UI","1","MediaStorageSOPClassUID"],"0003":["UI","1","MediaStorageSOPInstanceUID"],"0010":["UI","1","TransferSyntaxUID"],"0012":["UI","1","ImplementationClassUID"],"0013":["SH","1","ImplementationVersionName"],"0016":["AE","1","SourceApplicationEntityTitle"],"0017":["AE","1","SendingApplicationEntityTitle"],"0018":["AE","1","ReceivingApplicationEntityTitle"],"0026":["UR","1","SourcePresentationAddress"],"0027":["UR","1","SendingPresentationAddress"],"0028":["UR","1","ReceivingPresentationAddress"],"0031":["OB","1","RTVMetaInformationVersion"],"0032":["UI","1","RTVCommunicationSOPClassUID"],"0033":["UI","1","RTVCommunicationSOPInstanceUID"],"0035":["OB","1","RTVSourceIdentifier"],"0036":["OB","1","RTVFlowIdentifier"],"0037":["UL","1","RTVFlowRTPSamplingRate"],"0038":["FD","1","RTVFlowActualFrameDuration"],"0100":["UI","1","PrivateInformationCreatorUID"],"0102":["OB","1","PrivateInformation"]},"0004":{"0000":["UL","1","GenericGroupLength"],1130:["CS","1","FileSetID"],1141:["CS","1-8","FileSetDescriptorFileID"],1142:["CS","1","SpecificCharacterSetOfFileSetDescriptorFile"],1200:["UL","1","OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity"],1202:["UL","1","OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity"],1212:["US","1","FileSetConsistencyFlag"],1220:["SQ","1","DirectoryRecordSequence"],1400:["UL","1","OffsetOfTheNextDirectoryRecord"],1410:["US","1","RecordInUseFlag"],1420:["UL","1","OffsetOfReferencedLowerLevelDirectoryEntity"],1430:["CS","1","DirectoryRecordType"],1432:["UI","1","PrivateRecordUID"],1500:["CS","1-8","ReferencedFileID"],1504:["UL","1","MRDRDirectoryRecordOffset"],1510:["UI","1","ReferencedSOPClassUIDInFile"],1511:["UI","1","ReferencedSOPInstanceUIDInFile"],1512:["UI","1","ReferencedTransferSyntaxUIDInFile"],"151A":["UI","1-n","ReferencedRelatedGeneralSOPClassUIDInFile"],1600:["UL","1","NumberOfReferences"]},"0008":{"0000":["UL","1","GenericGroupLength"],"0001":["UL","1","LengthToEnd"],"0005":["CS","1-n","SpecificCharacterSet"],"0006":["SQ","1","LanguageCodeSequence"],"0008":["CS","2-n","ImageType"],"0010":["SH","1","RecognitionCode"],"0012":["DA","1","InstanceCreationDate"],"0013":["TM","1","InstanceCreationTime"],"0014":["UI","1","InstanceCreatorUID"],"0015":["DT","1","InstanceCoercionDateTime"],"0016":["UI","1","SOPClassUID"],"0018":["UI","1","SOPInstanceUID"],"001A":["UI","1-n","RelatedGeneralSOPClassUID"],"001B":["UI","1","OriginalSpecializedSOPClassUID"],"0020":["DA","1","StudyDate"],"0021":["DA","1","SeriesDate"],"0022":["DA","1","AcquisitionDate"],"0023":["DA","1","ContentDate"],"0024":["DA","1","OverlayDate"],"0025":["DA","1","CurveDate"],"002A":["DT","1","AcquisitionDateTime"],"0030":["TM","1","StudyTime"],"0031":["TM","1","SeriesTime"],"0032":["TM","1","AcquisitionTime"],"0033":["TM","1","ContentTime"],"0034":["TM","1","OverlayTime"],"0035":["TM","1","CurveTime"],"0040":["US","1","DataSetType"],"0041":["LO","1","DataSetSubtype"],"0042":["CS","1","NuclearMedicineSeriesType"],"0050":["SH","1","AccessionNumber"],"0051":["SQ","1","IssuerOfAccessionNumberSequence"],"0052":["CS","1","QueryRetrieveLevel"],"0053":["CS","1","QueryRetrieveView"],"0054":["AE","1-n","RetrieveAETitle"],"0055":["AE","1","StationAETitle"],"0056":["CS","1","InstanceAvailability"],"0058":["UI","1-n","FailedSOPInstanceUIDList"],"0060":["CS","1","Modality"],"0061":["CS","1-n","ModalitiesInStudy"],"0062":["UI","1-n","SOPClassesInStudy"],"0063":["SQ","1","AnatomicRegionsInStudyCodeSequence"],"0064":["CS","1","ConversionType"],"0068":["CS","1","PresentationIntentType"],"0070":["LO","1","Manufacturer"],"0080":["LO","1","InstitutionName"],"0081":["ST","1","InstitutionAddress"],"0082":["SQ","1","InstitutionCodeSequence"],"0090":["PN","1","ReferringPhysicianName"],"0092":["ST","1","ReferringPhysicianAddress"],"0094":["SH","1-n","ReferringPhysicianTelephoneNumbers"],"0096":["SQ","1","ReferringPhysicianIdentificationSequence"],"009C":["PN","1-n","ConsultingPhysicianName"],"009D":["SQ","1","ConsultingPhysicianIdentificationSequence"],"0100":["SH","1","CodeValue"],"0101":["LO","1","ExtendedCodeValue"],"0102":["SH","1","CodingSchemeDesignator"],"0103":["SH","1","CodingSchemeVersion"],"0104":["LO","1","CodeMeaning"],"0105":["CS","1","MappingResource"],"0106":["DT","1","ContextGroupVersion"],"0107":["DT","1","ContextGroupLocalVersion"],"0108":["LT","1","ExtendedCodeMeaning"],"0109":["SQ","1","CodingSchemeResourcesSequence"],"010A":["CS","1","CodingSchemeURLType"],"010B":["CS","1","ContextGroupExtensionFlag"],"010C":["UI","1","CodingSchemeUID"],"010D":["UI","1","ContextGroupExtensionCreatorUID"],"010E":["UR","1","CodingSchemeURL"],"010F":["CS","1","ContextIdentifier"],"0110":["SQ","1","CodingSchemeIdentificationSequence"],"0112":["LO","1","CodingSchemeRegistry"],"0114":["ST","1","CodingSchemeExternalID"],"0115":["ST","1","CodingSchemeName"],"0116":["ST","1","CodingSchemeResponsibleOrganization"],"0117":["UI","1","ContextUID"],"0118":["UI","1","MappingResourceUID"],"0119":["UC","1","LongCodeValue"],"0120":["UR","1","URNCodeValue"],"0121":["SQ","1","EquivalentCodeSequence"],"0122":["LO","1","MappingResourceName"],"0123":["SQ","1","ContextGroupIdentificationSequence"],"0124":["SQ","1","MappingResourceIdentificationSequence"],"0201":["SH","1","TimezoneOffsetFromUTC"],"0202":["","",""],"0220":["SQ","1","ResponsibleGroupCodeSequence"],"0221":["CS","1","EquipmentModality"],"0222":["LO","1","ManufacturerRelatedModelGroup"],"0300":["SQ","1","PrivateDataElementCharacteristicsSequence"],"0301":["US","1","PrivateGroupReference"],"0302":["LO","1","PrivateCreatorReference"],"0303":["CS","1","BlockIdentifyingInformationStatus"],"0304":["US","1-n","NonidentifyingPrivateElements"],"0305":["SQ","1","DeidentificationActionSequence"],"0306":["US","1-n","IdentifyingPrivateElements"],"0307":["CS","1","DeidentificationAction"],"0308":["US","1","PrivateDataElement"],"0309":["UL","1-3","PrivateDataElementValueMultiplicity"],"030A":["CS","1","PrivateDataElementValueRepresentation"],"030B":["UL","1-2","PrivateDataElementNumberOfItems"],"030C":["UC","1","PrivateDataElementName"],"030D":["UC","1","PrivateDataElementKeyword"],"030E":["UT","1","PrivateDataElementDescription"],"030F":["UT","1","PrivateDataElementEncoding"],"0310":["SQ","1","PrivateDataElementDefinitionSequence"],1e3:["AE","1","NetworkID"],1010:["SH","1","StationName"],1030:["LO","1","StudyDescription"],1032:["SQ","1","ProcedureCodeSequence"],"103E":["LO","1","SeriesDescription"],"103F":["SQ","1","SeriesDescriptionCodeSequence"],1040:["LO","1","InstitutionalDepartmentName"],1041:["SQ","1","InstitutionalDepartmentTypeCodeSequence"],1048:["PN","1-n","PhysiciansOfRecord"],1049:["SQ","1","PhysiciansOfRecordIdentificationSequence"],1050:["PN","1-n","PerformingPhysicianName"],1052:["SQ","1","PerformingPhysicianIdentificationSequence"],1060:["PN","1-n","NameOfPhysiciansReadingStudy"],1062:["SQ","1","PhysiciansReadingStudyIdentificationSequence"],1070:["PN","1-n","OperatorsName"],1072:["SQ","1","OperatorIdentificationSequence"],1080:["LO","1-n","AdmittingDiagnosesDescription"],1084:["SQ","1","AdmittingDiagnosesCodeSequence"],1090:["LO","1","ManufacturerModelName"],1100:["SQ","1","ReferencedResultsSequence"],1110:["SQ","1","ReferencedStudySequence"],1111:["SQ","1","ReferencedPerformedProcedureStepSequence"],1115:["SQ","1","ReferencedSeriesSequence"],1120:["SQ","1","ReferencedPatientSequence"],1125:["SQ","1","ReferencedVisitSequence"],1130:["SQ","1","ReferencedOverlaySequence"],1134:["SQ","1","ReferencedStereometricInstanceSequence"],"113A":["SQ","1","ReferencedWaveformSequence"],1140:["SQ","1","ReferencedImageSequence"],1145:["SQ","1","ReferencedCurveSequence"],"114A":["SQ","1","ReferencedInstanceSequence"],"114B":["SQ","1","ReferencedRealWorldValueMappingInstanceSequence"],1150:["UI","1","ReferencedSOPClassUID"],1155:["UI","1","ReferencedSOPInstanceUID"],1156:["SQ","1","DefinitionSourceSequence"],"115A":["UI","1-n","SOPClassesSupported"],1160:["IS","1-n","ReferencedFrameNumber"],1161:["UL","1-n","SimpleFrameList"],1162:["UL","3-3n","CalculatedFrameList"],1163:["FD","2","TimeRange"],1164:["SQ","1","FrameExtractionSequence"],1167:["UI","1","MultiFrameSourceSOPInstanceUID"],1190:["UR","1","RetrieveURL"],1195:["UI","1","TransactionUID"],1196:["US","1","WarningReason"],1197:["US","1","FailureReason"],1198:["SQ","1","FailedSOPSequence"],1199:["SQ","1","ReferencedSOPSequence"],"119A":["SQ","1","OtherFailuresSequence"],1200:["SQ","1","StudiesContainingOtherReferencedInstancesSequence"],1250:["SQ","1","RelatedSeriesSequence"],2110:["CS","1","LossyImageCompressionRetired"],2111:["ST","1","DerivationDescription"],2112:["SQ","1","SourceImageSequence"],2120:["SH","1","StageName"],2122:["IS","1","StageNumber"],2124:["IS","1","NumberOfStages"],2127:["SH","1","ViewName"],2128:["IS","1","ViewNumber"],2129:["IS","1","NumberOfEventTimers"],"212A":["IS","1","NumberOfViewsInStage"],2130:["DS","1-n","EventElapsedTimes"],2132:["LO","1-n","EventTimerNames"],2133:["SQ","1","EventTimerSequence"],2134:["FD","1","EventTimeOffset"],2135:["SQ","1","EventCodeSequence"],2142:["IS","1","StartTrim"],2143:["IS","1","StopTrim"],2144:["IS","1","RecommendedDisplayFrameRate"],2200:["CS","1","TransducerPosition"],2204:["CS","1","TransducerOrientation"],2208:["CS","1","AnatomicStructure"],2218:["SQ","1","AnatomicRegionSequence"],2220:["SQ","1","AnatomicRegionModifierSequence"],2228:["SQ","1","PrimaryAnatomicStructureSequence"],2229:["SQ","1","AnatomicStructureSpaceOrRegionSequence"],2230:["SQ","1","PrimaryAnatomicStructureModifierSequence"],2240:["SQ","1","TransducerPositionSequence"],2242:["SQ","1","TransducerPositionModifierSequence"],2244:["SQ","1","TransducerOrientationSequence"],2246:["SQ","1","TransducerOrientationModifierSequence"],2251:["SQ","1","AnatomicStructureSpaceOrRegionCodeSequenceTrial"],2253:["SQ","1","AnatomicPortalOfEntranceCodeSequenceTrial"],2255:["SQ","1","AnatomicApproachDirectionCodeSequenceTrial"],2256:["ST","1","AnatomicPerspectiveDescriptionTrial"],2257:["SQ","1","AnatomicPerspectiveCodeSequenceTrial"],2258:["ST","1","AnatomicLocationOfExaminingInstrumentDescriptionTrial"],2259:["SQ","1","AnatomicLocationOfExaminingInstrumentCodeSequenceTrial"],"225A":["SQ","1","AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial"],"225C":["SQ","1","OnAxisBackgroundAnatomicStructureCodeSequenceTrial"],3001:["SQ","1","AlternateRepresentationSequence"],3002:["UI","1-n","AvailableTransferSyntaxUID"],3010:["UI","1-n","IrradiationEventUID"],3011:["SQ","1","SourceIrradiationEventSequence"],3012:["UI","1","RadiopharmaceuticalAdministrationEventUID"],4e3:["LT","1","IdentifyingComments"],9007:["CS","4","FrameType"],9092:["SQ","1","ReferencedImageEvidenceSequence"],9121:["SQ","1","ReferencedRawDataSequence"],9123:["UI","1","CreatorVersionUID"],9124:["SQ","1","DerivationImageSequence"],9154:["SQ","1","SourceImageEvidenceSequence"],9205:["CS","1","PixelPresentation"],9206:["CS","1","VolumetricProperties"],9207:["CS","1","VolumeBasedCalculationTechnique"],9208:["CS","1","ComplexImageComponent"],9209:["CS","1","AcquisitionContrast"],9215:["SQ","1","DerivationCodeSequence"],9237:["SQ","1","ReferencedPresentationStateSequence"],9410:["SQ","1","ReferencedOtherPlaneSequence"],9458:["SQ","1","FrameDisplaySequence"],9459:["FL","1","RecommendedDisplayFrameRateInFloat"],9460:["CS","1","SkipFrameRangeFlag"]},"0010":{"0000":["UL","1","GenericGroupLength"],"0010":["PN","1","PatientName"],"0020":["LO","1","PatientID"],"0021":["LO","1","IssuerOfPatientID"],"0022":["CS","1","TypeOfPatientID"],"0024":["SQ","1","IssuerOfPatientIDQualifiersSequence"],"0026":["SQ","1","SourcePatientGroupIdentificationSequence"],"0027":["SQ","1","GroupOfPatientsIdentificationSequence"],"0028":["US","3","SubjectRelativePositionInImage"],"0030":["DA","1","PatientBirthDate"],"0032":["TM","1","PatientBirthTime"],"0033":["LO","1","PatientBirthDateInAlternativeCalendar"],"0034":["LO","1","PatientDeathDateInAlternativeCalendar"],"0035":["CS","1","PatientAlternativeCalendar"],"0040":["CS","1","PatientSex"],"0050":["SQ","1","PatientInsurancePlanCodeSequence"],"0101":["SQ","1","PatientPrimaryLanguageCodeSequence"],"0102":["SQ","1","PatientPrimaryLanguageModifierCodeSequence"],"0200":["CS","1","QualityControlSubject"],"0201":["SQ","1","QualityControlSubjectTypeCodeSequence"],"0212":["UC","1","StrainDescription"],"0213":["LO","1","StrainNomenclature"],"0214":["LO","1","StrainStockNumber"],"0215":["SQ","1","StrainSourceRegistryCodeSequence"],"0216":["SQ","1","StrainStockSequence"],"0217":["LO","1","StrainSource"],"0218":["UT","1","StrainAdditionalInformation"],"0219":["SQ","1","StrainCodeSequence"],"0221":["SQ","1","GeneticModificationsSequence"],"0222":["UC","1","GeneticModificationsDescription"],"0223":["LO","1","GeneticModificationsNomenclature"],"0229":["SQ","1","GeneticModificationsCodeSequence"],1e3:["LO","1-n","OtherPatientIDs"],1001:["PN","1-n","OtherPatientNames"],1002:["SQ","1","OtherPatientIDsSequence"],1005:["PN","1","PatientBirthName"],1010:["AS","1","PatientAge"],1020:["DS","1","PatientSize"],1021:["SQ","1","PatientSizeCodeSequence"],1022:["DS","1","PatientBodyMassIndex"],1023:["DS","1","MeasuredAPDimension"],1024:["DS","1","MeasuredLateralDimension"],1030:["DS","1","PatientWeight"],1040:["LO","1","PatientAddress"],1050:["LO","1-n","InsurancePlanIdentification"],1060:["PN","1","PatientMotherBirthName"],1080:["LO","1","MilitaryRank"],1081:["LO","1","BranchOfService"],1090:["LO","1","MedicalRecordLocator"],1100:["SQ","1","ReferencedPatientPhotoSequence"],2e3:["LO","1-n","MedicalAlerts"],2110:["LO","1-n","Allergies"],2150:["LO","1","CountryOfResidence"],2152:["LO","1","RegionOfResidence"],2154:["SH","1-n","PatientTelephoneNumbers"],2155:["LT","1","PatientTelecomInformation"],2160:["SH","1","EthnicGroup"],2180:["SH","1","Occupation"],"21A0":["CS","1","SmokingStatus"],"21B0":["LT","1","AdditionalPatientHistory"],"21C0":["US","1","PregnancyStatus"],"21D0":["DA","1","LastMenstrualDate"],"21F0":["LO","1","PatientReligiousPreference"],2201:["LO","1","PatientSpeciesDescription"],2202:["SQ","1","PatientSpeciesCodeSequence"],2203:["CS","1","PatientSexNeutered"],2210:["CS","1","AnatomicalOrientationType"],2292:["LO","1","PatientBreedDescription"],2293:["SQ","1","PatientBreedCodeSequence"],2294:["SQ","1","BreedRegistrationSequence"],2295:["LO","1","BreedRegistrationNumber"],2296:["SQ","1","BreedRegistryCodeSequence"],2297:["PN","1","ResponsiblePerson"],2298:["CS","1","ResponsiblePersonRole"],2299:["LO","1","ResponsibleOrganization"],4e3:["LT","1","PatientComments"],9431:["FL","1","ExaminedBodyThickness"]},"0012":{"0000":["UL","1","GenericGroupLength"],"0010":["LO","1","ClinicalTrialSponsorName"],"0020":["LO","1","ClinicalTrialProtocolID"],"0021":["LO","1","ClinicalTrialProtocolName"],"0030":["LO","1","ClinicalTrialSiteID"],"0031":["LO","1","ClinicalTrialSiteName"],"0040":["LO","1","ClinicalTrialSubjectID"],"0042":["LO","1","ClinicalTrialSubjectReadingID"],"0050":["LO","1","ClinicalTrialTimePointID"],"0051":["ST","1","ClinicalTrialTimePointDescription"],"0052":["FD","1","LongitudinalTemporalOffsetFromEvent"],"0053":["CS","1","LongitudinalTemporalEventType"],"0060":["LO","1","ClinicalTrialCoordinatingCenterName"],"0062":["CS","1","PatientIdentityRemoved"],"0063":["LO","1-n","DeidentificationMethod"],"0064":["SQ","1","DeidentificationMethodCodeSequence"],"0071":["LO","1","ClinicalTrialSeriesID"],"0072":["LO","1","ClinicalTrialSeriesDescription"],"0081":["LO","1","ClinicalTrialProtocolEthicsCommitteeName"],"0082":["LO","1","ClinicalTrialProtocolEthicsCommitteeApprovalNumber"],"0083":["SQ","1","ConsentForClinicalTrialUseSequence"],"0084":["CS","1","DistributionType"],"0085":["CS","1","ConsentForDistributionFlag"],"0086":["DA","1","EthicsCommitteeApprovalEffectivenessStartDate"],"0087":["DA","1","EthicsCommitteeApprovalEffectivenessEndDate"]},"0014":{"0000":["UL","1","GenericGroupLength"],"0023":["ST","1","CADFileFormat"],"0024":["ST","1","ComponentReferenceSystem"],"0025":["ST","1","ComponentManufacturingProcedure"],"0028":["ST","1","ComponentManufacturer"],"0030":["DS","1-n","MaterialThickness"],"0032":["DS","1-n","MaterialPipeDiameter"],"0034":["DS","1-n","MaterialIsolationDiameter"],"0042":["ST","1","MaterialGrade"],"0044":["ST","1","MaterialPropertiesDescription"],"0045":["ST","1","MaterialPropertiesFileFormatRetired"],"0046":["LT","1","MaterialNotes"],"0050":["CS","1","ComponentShape"],"0052":["CS","1","CurvatureType"],"0054":["DS","1","OuterDiameter"],"0056":["DS","1","InnerDiameter"],"0100":["LO","1-n","ComponentWelderIDs"],"0101":["CS","1","SecondaryApprovalStatus"],"0102":["DA","1","SecondaryReviewDate"],"0103":["TM","1","SecondaryReviewTime"],"0104":["PN","1","SecondaryReviewerName"],"0105":["ST","1","RepairID"],"0106":["SQ","1","MultipleComponentApprovalSequence"],"0107":["CS","1-n","OtherApprovalStatus"],"0108":["CS","1-n","OtherSecondaryApprovalStatus"],1010:["ST","1","ActualEnvironmentalConditions"],1020:["DA","1","ExpiryDate"],1040:["ST","1","EnvironmentalConditions"],2002:["SQ","1","EvaluatorSequence"],2004:["IS","1","EvaluatorNumber"],2006:["PN","1","EvaluatorName"],2008:["IS","1","EvaluationAttempt"],2012:["SQ","1","IndicationSequence"],2014:["IS","1","IndicationNumber"],2016:["SH","1","IndicationLabel"],2018:["ST","1","IndicationDescription"],"201A":["CS","1-n","IndicationType"],"201C":["CS","1","IndicationDisposition"],"201E":["SQ","1","IndicationROISequence"],2030:["SQ","1","IndicationPhysicalPropertySequence"],2032:["SH","1","PropertyLabel"],2202:["IS","1","CoordinateSystemNumberOfAxes"],2204:["SQ","1","CoordinateSystemAxesSequence"],2206:["ST","1","CoordinateSystemAxisDescription"],2208:["CS","1","CoordinateSystemDataSetMapping"],"220A":["IS","1","CoordinateSystemAxisNumber"],"220C":["CS","1","CoordinateSystemAxisType"],"220E":["CS","1","CoordinateSystemAxisUnits"],2210:["OB","1","CoordinateSystemAxisValues"],2220:["SQ","1","CoordinateSystemTransformSequence"],2222:["ST","1","TransformDescription"],2224:["IS","1","TransformNumberOfAxes"],2226:["IS","1-n","TransformOrderOfAxes"],2228:["CS","1","TransformedAxisUnits"],"222A":["DS","1-n","CoordinateSystemTransformRotationAndScaleMatrix"],"222C":["DS","1-n","CoordinateSystemTransformTranslationMatrix"],3011:["DS","1","InternalDetectorFrameTime"],3012:["DS","1","NumberOfFramesIntegrated"],3020:["SQ","1","DetectorTemperatureSequence"],3022:["ST","1","SensorName"],3024:["DS","1","HorizontalOffsetOfSensor"],3026:["DS","1","VerticalOffsetOfSensor"],3028:["DS","1","SensorTemperature"],3040:["SQ","1","DarkCurrentSequence"],3050:["ox","1","DarkCurrentCounts"],3060:["SQ","1","GainCorrectionReferenceSequence"],3070:["ox","1","AirCounts"],3071:["DS","1","KVUsedInGainCalibration"],3072:["DS","1","MAUsedInGainCalibration"],3073:["DS","1","NumberOfFramesUsedForIntegration"],3074:["LO","1","FilterMaterialUsedInGainCalibration"],3075:["DS","1","FilterThicknessUsedInGainCalibration"],3076:["DA","1","DateOfGainCalibration"],3077:["TM","1","TimeOfGainCalibration"],3080:["OB","1","BadPixelImage"],3099:["LT","1","CalibrationNotes"],3100:["LT","1","LinearityCorrectionTechnique"],3101:["LT","1","BeamHardeningCorrectionTechnique"],4002:["SQ","1","PulserEquipmentSequence"],4004:["CS","1","PulserType"],4006:["LT","1","PulserNotes"],4008:["SQ","1","ReceiverEquipmentSequence"],"400A":["CS","1","AmplifierType"],"400C":["LT","1","ReceiverNotes"],"400E":["SQ","1","PreAmplifierEquipmentSequence"],"400F":["LT","1","PreAmplifierNotes"],4010:["SQ","1","TransmitTransducerSequence"],4011:["SQ","1","ReceiveTransducerSequence"],4012:["US","1","NumberOfElements"],4013:["CS","1","ElementShape"],4014:["DS","1","ElementDimensionA"],4015:["DS","1","ElementDimensionB"],4016:["DS","1","ElementPitchA"],4017:["DS","1","MeasuredBeamDimensionA"],4018:["DS","1","MeasuredBeamDimensionB"],4019:["DS","1","LocationOfMeasuredBeamDiameter"],"401A":["DS","1","NominalFrequency"],"401B":["DS","1","MeasuredCenterFrequency"],"401C":["DS","1","MeasuredBandwidth"],"401D":["DS","1","ElementPitchB"],4020:["SQ","1","PulserSettingsSequence"],4022:["DS","1","PulseWidth"],4024:["DS","1","ExcitationFrequency"],4026:["CS","1","ModulationType"],4028:["DS","1","Damping"],4030:["SQ","1","ReceiverSettingsSequence"],4031:["DS","1","AcquiredSoundpathLength"],4032:["CS","1","AcquisitionCompressionType"],4033:["IS","1","AcquisitionSampleSize"],4034:["DS","1","RectifierSmoothing"],4035:["SQ","1","DACSequence"],4036:["CS","1","DACType"],4038:["DS","1-n","DACGainPoints"],"403A":["DS","1-n","DACTimePoints"],"403C":["DS","1-n","DACAmplitude"],4040:["SQ","1","PreAmplifierSettingsSequence"],4050:["SQ","1","TransmitTransducerSettingsSequence"],4051:["SQ","1","ReceiveTransducerSettingsSequence"],4052:["DS","1","IncidentAngle"],4054:["ST","1","CouplingTechnique"],4056:["ST","1","CouplingMedium"],4057:["DS","1","CouplingVelocity"],4058:["DS","1","ProbeCenterLocationX"],4059:["DS","1","ProbeCenterLocationZ"],"405A":["DS","1","SoundPathLength"],"405C":["ST","1","DelayLawIdentifier"],4060:["SQ","1","GateSettingsSequence"],4062:["DS","1","GateThreshold"],4064:["DS","1","VelocityOfSound"],4070:["SQ","1","CalibrationSettingsSequence"],4072:["ST","1","CalibrationProcedure"],4074:["SH","1","ProcedureVersion"],4076:["DA","1","ProcedureCreationDate"],4078:["DA","1","ProcedureExpirationDate"],"407A":["DA","1","ProcedureLastModifiedDate"],"407C":["TM","1-n","CalibrationTime"],"407E":["DA","1-n","CalibrationDate"],4080:["SQ","1","ProbeDriveEquipmentSequence"],4081:["CS","1","DriveType"],4082:["LT","1","ProbeDriveNotes"],4083:["SQ","1","DriveProbeSequence"],4084:["DS","1","ProbeInductance"],4085:["DS","1","ProbeResistance"],4086:["SQ","1","ReceiveProbeSequence"],4087:["SQ","1","ProbeDriveSettingsSequence"],4088:["DS","1","BridgeResistors"],4089:["DS","1","ProbeOrientationAngle"],"408B":["DS","1","UserSelectedGainY"],"408C":["DS","1","UserSelectedPhase"],"408D":["DS","1","UserSelectedOffsetX"],"408E":["DS","1","UserSelectedOffsetY"],4091:["SQ","1","ChannelSettingsSequence"],4092:["DS","1","ChannelThreshold"],"409A":["SQ","1","ScannerSettingsSequence"],"409B":["ST","1","ScanProcedure"],"409C":["DS","1","TranslationRateX"],"409D":["DS","1","TranslationRateY"],"409F":["DS","1","ChannelOverlap"],"40A0":["LO","1-n","ImageQualityIndicatorType"],"40A1":["LO","1-n","ImageQualityIndicatorMaterial"],"40A2":["LO","1-n","ImageQualityIndicatorSize"],5002:["IS","1","LINACEnergy"],5004:["IS","1","LINACOutput"],5100:["US","1","ActiveAperture"],5101:["DS","1","TotalAperture"],5102:["DS","1","ApertureElevation"],5103:["DS","1","MainLobeAngle"],5104:["DS","1","MainRoofAngle"],5105:["CS","1","ConnectorType"],5106:["SH","1","WedgeModelNumber"],5107:["DS","1","WedgeAngleFloat"],5108:["DS","1","WedgeRoofAngle"],5109:["CS","1","WedgeElement1Position"],"510A":["DS","1","WedgeMaterialVelocity"],"510B":["SH","1","WedgeMaterial"],"510C":["DS","1","WedgeOffsetZ"],"510D":["DS","1","WedgeOriginOffsetX"],"510E":["DS","1","WedgeTimeDelay"],"510F":["SH","1","WedgeName"],5110:["SH","1","WedgeManufacturerName"],5111:["LO","1","WedgeDescription"],5112:["DS","1","NominalBeamAngle"],5113:["DS","1","WedgeOffsetX"],5114:["DS","1","WedgeOffsetY"],5115:["DS","1","WedgeTotalLength"],5116:["DS","1","WedgeInContactLength"],5117:["DS","1","WedgeFrontGap"],5118:["DS","1","WedgeTotalHeight"],5119:["DS","1","WedgeFrontHeight"],"511A":["DS","1","WedgeRearHeight"],"511B":["DS","1","WedgeTotalWidth"],"511C":["DS","1","WedgeInContactWidth"],"511D":["DS","1","WedgeChamferHeight"],"511E":["CS","1","WedgeCurve"],"511F":["DS","1","RadiusAlongWedge"]},"0016":{"0000":["UL","1","GenericGroupLength"],"0001":["DS","1","WhitePoint"],"0002":["DS","3","PrimaryChromaticities"],"0003":["UT","1","BatteryLevel"],"0004":["DS","1","ExposureTimeInSeconds"],"0005":["DS","1","FNumber"],"0006":["IS","1","OECFRows"],"0007":["IS","1","OECFColumns"],"0008":["UC","1-n","OECFColumnNames"],"0009":["DS","1-n","OECFValues"],"000A":["IS","1","SpatialFrequencyResponseRows"],"000B":["IS","1","SpatialFrequencyResponseColumns"],"000C":["UC","1-n","SpatialFrequencyResponseColumnNames"],"000D":["DS","1-n","SpatialFrequencyResponseValues"],"000E":["IS","1","ColorFilterArrayPatternRows"],"000F":["IS","1","ColorFilterArrayPatternColumns"],"0010":["DS","1-n","ColorFilterArrayPatternValues"],"0011":["US","1","FlashFiringStatus"],"0012":["US","1","FlashReturnStatus"],"0013":["US","1","FlashMode"],"0014":["US","1","FlashFunctionPresent"],"0015":["US","1","FlashRedEyeMode"],"0016":["US","1","ExposureProgram"],"0017":["UT","1","SpectralSensitivity"],"0018":["IS","1","PhotographicSensitivity"],"0019":["IS","1","SelfTimerMode"],"001A":["US","1","SensitivityType"],"001B":["IS","1","StandardOutputSensitivity"],"001C":["IS","1","RecommendedExposureIndex"],"001D":["IS","1","ISOSpeed"],"001E":["IS","1","ISOSpeedLatitudeyyy"],"001F":["IS","1","ISOSpeedLatitudezzz"],"0020":["UT","1","EXIFVersion"],"0021":["DS","1","ShutterSpeedValue"],"0022":["DS","1","ApertureValue"],"0023":["DS","1","BrightnessValue"],"0024":["DS","1","ExposureBiasValue"],"0025":["DS","1","MaxApertureValue"],"0026":["DS","1","SubjectDistance"],"0027":["US","1","MeteringMode"],"0028":["US","1","LightSource"],"0029":["DS","1","FocalLength"],"002A":["IS","2-4","SubjectArea"],"002B":["OB","1","MakerNote"],"0030":["DS","1","Temperature"],"0031":["DS","1","Humidity"],"0032":["DS","1","Pressure"],"0033":["DS","1","WaterDepth"],"0034":["DS","1","Acceleration"],"0035":["DS","1","CameraElevationAngle"],"0036":["DS","1-2","FlashEnergy"],"0037":["IS","2","SubjectLocation"],"0038":["DS","1","PhotographicExposureIndex"],"0039":["US","1","SensingMethod"],"003A":["US","1","FileSource"],"003B":["US","1","SceneType"],"0041":["US","1","CustomRendered"],"0042":["US","1","ExposureMode"],"0043":["US","1","WhiteBalance"],"0044":["DS","1","DigitalZoomRatio"],"0045":["IS","1","FocalLengthIn35mmFilm"],"0046":["US","1","SceneCaptureType"],"0047":["US","1","GainControl"],"0048":["US","1","Contrast"],"0049":["US","1","Saturation"],"004A":["US","1","Sharpness"],"004B":["OB","1","DeviceSettingDescription"],"004C":["US","1","SubjectDistanceRange"],"004D":["UT","1","CameraOwnerName"],"004E":["DS","4","LensSpecification"],"004F":["UT","1","LensMake"],"0050":["UT","1","LensModel"],"0051":["UT","1","LensSerialNumber"],"0061":["CS","1","InteroperabilityIndex"],"0062":["OB","1","InteroperabilityVersion"],"0070":["OB","1","GPSVersionID"],"0071":["CS","1","GPSLatitudeRef"],"0072":["DS","3","GPSLatitude"],"0073":["CS","1","GPSLongitudeRef"],"0074":["DS","3","GPSLongitude"],"0075":["US","1","GPSAltitudeRef"],"0076":["DS","1","GPSAltitude"],"0077":["DT","1","GPSTimeStamp"],"0078":["UT","1","GPSSatellites"],"0079":["CS","1","GPSStatus"],"007A":["CS","1","GPSMeasureMode"],"007B":["DS","1","GPSDOP"],"007C":["CS","1","GPSSpeedRef"],"007D":["DS","1","GPSSpeed"],"007E":["CS","1","GPSTrackRef"],"007F":["DS","1","GPSTrack"],"0080":["CS","1","GPSImgDirectionRef"],"0081":["DS","1","GPSImgDirection"],"0082":["UT","1","GPSMapDatum"],"0083":["CS","1","GPSDestLatitudeRef"],"0084":["DS","3","GPSDestLatitude"],"0085":["CS","1","GPSDestLongitudeRef"],"0086":["DS","3","GPSDestLongitude"],"0087":["CS","1","GPSDestBearingRef"],"0088":["DS","1","GPSDestBearing"],"0089":["CS","1","GPSDestDistanceRef"],"008A":["DS","1","GPSDestDistance"],"008B":["OB","1","GPSProcessingMethod"],"008C":["OB","1","GPSAreaInformation"],"008D":["DT","1","GPSDateStamp"],"008E":["IS","1","GPSDifferential"],1001:["CS","1","LightSourcePolarization"],1002:["DS","1","EmitterColorTemperature"],1003:["CS","1","ContactMethod"],1004:["CS","1-n","ImmersionMedia"],1005:["DS","1","OpticalMagnificationFactor"]},"0018":{"0000":["UL","1","GenericGroupLength"],"0010":["LO","1","ContrastBolusAgent"],"0012":["SQ","1","ContrastBolusAgentSequence"],"0013":["FL","1","ContrastBolusT1Relaxivity"],"0014":["SQ","1","ContrastBolusAdministrationRouteSequence"],"0015":["CS","1","BodyPartExamined"],"0020":["CS","1-n","ScanningSequence"],"0021":["CS","1-n","SequenceVariant"],"0022":["CS","1-n","ScanOptions"],"0023":["CS","1","MRAcquisitionType"],"0024":["SH","1","SequenceName"],"0025":["CS","1","AngioFlag"],"0026":["SQ","1","InterventionDrugInformationSequence"],"0027":["TM","1","InterventionDrugStopTime"],"0028":["DS","1","InterventionDrugDose"],"0029":["SQ","1","InterventionDrugCodeSequence"],"002A":["SQ","1","AdditionalDrugSequence"],"0030":["LO","1-n","Radionuclide"],"0031":["LO","1","Radiopharmaceutical"],"0032":["DS","1","EnergyWindowCenterline"],"0033":["DS","1-n","EnergyWindowTotalWidth"],"0034":["LO","1","InterventionDrugName"],"0035":["TM","1","InterventionDrugStartTime"],"0036":["SQ","1","InterventionSequence"],"0037":["CS","1","TherapyType"],"0038":["CS","1","InterventionStatus"],"0039":["CS","1","TherapyDescription"],"003A":["ST","1","InterventionDescription"],"0040":["IS","1","CineRate"],"0042":["CS","1","InitialCineRunState"],"0050":["DS","1","SliceThickness"],"0060":["DS","1","KVP"],"0061":["DS","1",""],"0070":["IS","1","CountsAccumulated"],"0071":["CS","1","AcquisitionTerminationCondition"],"0072":["DS","1","EffectiveDuration"],"0073":["CS","1","AcquisitionStartCondition"],"0074":["IS","1","AcquisitionStartConditionData"],"0075":["IS","1","AcquisitionTerminationConditionData"],"0080":["DS","1","RepetitionTime"],"0081":["DS","1","EchoTime"],"0082":["DS","1","InversionTime"],"0083":["DS","1","NumberOfAverages"],"0084":["DS","1","ImagingFrequency"],"0085":["SH","1","ImagedNucleus"],"0086":["IS","1-n","EchoNumbers"],"0087":["DS","1","MagneticFieldStrength"],"0088":["DS","1","SpacingBetweenSlices"],"0089":["IS","1","NumberOfPhaseEncodingSteps"],"0090":["DS","1","DataCollectionDiameter"],"0091":["IS","1","EchoTrainLength"],"0093":["DS","1","PercentSampling"],"0094":["DS","1","PercentPhaseFieldOfView"],"0095":["DS","1","PixelBandwidth"],1e3:["LO","1","DeviceSerialNumber"],1002:["UI","1","DeviceUID"],1003:["LO","1","DeviceID"],1004:["LO","1","PlateID"],1005:["LO","1","GeneratorID"],1006:["LO","1","GridID"],1007:["LO","1","CassetteID"],1008:["LO","1","GantryID"],1009:["UT","1","UniqueDeviceIdentifier"],"100A":["SQ","1","UDISequence"],"100B":["UI","1-n","ManufacturerDeviceClassUID"],1010:["LO","1","SecondaryCaptureDeviceID"],1011:["LO","1","HardcopyCreationDeviceID"],1012:["DA","1","DateOfSecondaryCapture"],1014:["TM","1","TimeOfSecondaryCapture"],1016:["LO","1","SecondaryCaptureDeviceManufacturer"],1017:["LO","1","HardcopyDeviceManufacturer"],1018:["LO","1","SecondaryCaptureDeviceManufacturerModelName"],1019:["LO","1-n","SecondaryCaptureDeviceSoftwareVersions"],"101A":["LO","1-n","HardcopyDeviceSoftwareVersion"],"101B":["LO","1","HardcopyDeviceManufacturerModelName"],1020:["LO","1-n","SoftwareVersions"],1022:["SH","1","VideoImageFormatAcquired"],1023:["LO","1","DigitalImageFormatAcquired"],1030:["LO","1","ProtocolName"],1040:["LO","1","ContrastBolusRoute"],1041:["DS","1","ContrastBolusVolume"],1042:["TM","1","ContrastBolusStartTime"],1043:["TM","1","ContrastBolusStopTime"],1044:["DS","1","ContrastBolusTotalDose"],1045:["IS","1","SyringeCounts"],1046:["DS","1-n","ContrastFlowRate"],1047:["DS","1-n","ContrastFlowDuration"],1048:["CS","1","ContrastBolusIngredient"],1049:["DS","1","ContrastBolusIngredientConcentration"],1050:["DS","1","SpatialResolution"],1060:["DS","1","TriggerTime"],1061:["LO","1","TriggerSourceOrType"],1062:["IS","1","NominalInterval"],1063:["DS","1","FrameTime"],1064:["LO","1","CardiacFramingType"],1065:["DS","1-n","FrameTimeVector"],1066:["DS","1","FrameDelay"],1067:["DS","1","ImageTriggerDelay"],1068:["DS","1","MultiplexGroupTimeOffset"],1069:["DS","1","TriggerTimeOffset"],"106A":["CS","1","SynchronizationTrigger"],"106C":["US","2","SynchronizationChannel"],"106E":["UL","1","TriggerSamplePosition"],1070:["LO","1","RadiopharmaceuticalRoute"],1071:["DS","1","RadiopharmaceuticalVolume"],1072:["TM","1","RadiopharmaceuticalStartTime"],1073:["TM","1","RadiopharmaceuticalStopTime"],1074:["DS","1","RadionuclideTotalDose"],1075:["DS","1","RadionuclideHalfLife"],1076:["DS","1","RadionuclidePositronFraction"],1077:["DS","1","RadiopharmaceuticalSpecificActivity"],1078:["DT","1","RadiopharmaceuticalStartDateTime"],1079:["DT","1","RadiopharmaceuticalStopDateTime"],1080:["CS","1","BeatRejectionFlag"],1081:["IS","1","LowRRValue"],1082:["IS","1","HighRRValue"],1083:["IS","1","IntervalsAcquired"],1084:["IS","1","IntervalsRejected"],1085:["LO","1","PVCRejection"],1086:["IS","1","SkipBeats"],1088:["IS","1","HeartRate"],1090:["IS","1","CardiacNumberOfImages"],1094:["IS","1","TriggerWindow"],1100:["DS","1","ReconstructionDiameter"],1110:["DS","1","DistanceSourceToDetector"],1111:["DS","1","DistanceSourceToPatient"],1114:["DS","1","EstimatedRadiographicMagnificationFactor"],1120:["DS","1","GantryDetectorTilt"],1121:["DS","1","GantryDetectorSlew"],1130:["DS","1","TableHeight"],1131:["DS","1","TableTraverse"],1134:["CS","1","TableMotion"],1135:["DS","1-n","TableVerticalIncrement"],1136:["DS","1-n","TableLateralIncrement"],1137:["DS","1-n","TableLongitudinalIncrement"],1138:["DS","1","TableAngle"],"113A":["CS","1","TableType"],1140:["CS","1","RotationDirection"],1141:["DS","1","AngularPosition"],1142:["DS","1-n","RadialPosition"],1143:["DS","1","ScanArc"],1144:["DS","1","AngularStep"],1145:["DS","1","CenterOfRotationOffset"],1146:["DS","1-n","RotationOffset"],1147:["CS","1","FieldOfViewShape"],1149:["IS","1-2","FieldOfViewDimensions"],1150:["IS","1","ExposureTime"],1151:["IS","1","XRayTubeCurrent"],1152:["IS","1","Exposure"],1153:["IS","1","ExposureInuAs"],1154:["DS","1","AveragePulseWidth"],1155:["CS","1","RadiationSetting"],1156:["CS","1","RectificationType"],"115A":["CS","1","RadiationMode"],"115E":["DS","1","ImageAndFluoroscopyAreaDoseProduct"],1160:["SH","1","FilterType"],1161:["LO","1-n","TypeOfFilters"],1162:["DS","1","IntensifierSize"],1164:["DS","2","ImagerPixelSpacing"],1166:["CS","1-n","Grid"],1170:["IS","1","GeneratorPower"],1180:["SH","1","CollimatorGridName"],1181:["CS","1","CollimatorType"],1182:["IS","1-2","FocalDistance"],1183:["DS","1-2","XFocusCenter"],1184:["DS","1-2","YFocusCenter"],1190:["DS","1-n","FocalSpots"],1191:["CS","1","AnodeTargetMaterial"],"11A0":["DS","1","BodyPartThickness"],"11A2":["DS","1","CompressionForce"],"11A3":["DS","1","CompressionPressure"],"11A4":["LO","1","PaddleDescription"],"11A5":["DS","1","CompressionContactArea"],"11B0":["LO","1","AcquisitionMode"],"11B1":["LO","1","DoseModeName"],"11B2":["CS","1","AcquiredSubtractionMaskFlag"],"11B3":["CS","1","FluoroscopyPersistenceFlag"],"11B4":["CS","1","FluoroscopyLastImageHoldPersistenceFlag"],"11B5":["IS","1","UpperLimitNumberOfPersistentFluoroscopyFrames"],"11B6":["CS","1","ContrastBolusAutoInjectionTriggerFlag"],"11B7":["FD","1","ContrastBolusInjectionDelay"],"11B8":["SQ","1","XAAcquisitionPhaseDetailsSequence"],"11B9":["FD","1","XAAcquisitionFrameRate"],"11BA":["SQ","1","XAPlaneDetailsSequence"],"11BB":["LO","1","AcquisitionFieldOfViewLabel"],"11BC":["SQ","1","XRayFilterDetailsSequence"],"11BD":["FD","1","XAAcquisitionDuration"],"11BE":["CS","1","ReconstructionPipelineType"],"11BF":["SQ","1","ImageFilterDetailsSequence"],"11C0":["CS","1","AppliedMaskSubtractionFlag"],"11C1":["SQ","1","RequestedSeriesDescriptionCodeSequence"],1200:["DA","1-n","DateOfLastCalibration"],1201:["TM","1-n","TimeOfLastCalibration"],1202:["DT","1","DateTimeOfLastCalibration"],1203:["DT","1","CalibrationDateTime"],1210:["SH","1-n","ConvolutionKernel"],1240:["IS","1-n","UpperLowerPixelValues"],1242:["IS","1","ActualFrameDuration"],1243:["IS","1","CountRate"],1244:["US","1","PreferredPlaybackSequencing"],1250:["SH","1","ReceiveCoilName"],1251:["SH","1","TransmitCoilName"],1260:["SH","1","PlateType"],1261:["LO","1","PhosphorType"],1271:["FD","1","WaterEquivalentDiameter"],1272:["SQ","1","WaterEquivalentDiameterCalculationMethodCodeSequence"],1300:["DS","1","ScanVelocity"],1301:["CS","1-n","WholeBodyTechnique"],1302:["IS","1","ScanLength"],1310:["US","4","AcquisitionMatrix"],1312:["CS","1","InPlanePhaseEncodingDirection"],1314:["DS","1","FlipAngle"],1315:["CS","1","VariableFlipAngleFlag"],1316:["DS","1","SAR"],1318:["DS","1","dBdt"],1320:["FL","1","B1rms"],1400:["LO","1","AcquisitionDeviceProcessingDescription"],1401:["LO","1","AcquisitionDeviceProcessingCode"],1402:["CS","1","CassetteOrientation"],1403:["CS","1","CassetteSize"],1404:["US","1","ExposuresOnPlate"],1405:["IS","1","RelativeXRayExposure"],1411:["DS","1","ExposureIndex"],1412:["DS","1","TargetExposureIndex"],1413:["DS","1","DeviationIndex"],1450:["DS","1","ColumnAngulation"],1460:["DS","1","TomoLayerHeight"],1470:["DS","1","TomoAngle"],1480:["DS","1","TomoTime"],1490:["CS","1","TomoType"],1491:["CS","1","TomoClass"],1495:["IS","1","NumberOfTomosynthesisSourceImages"],1500:["CS","1","PositionerMotion"],1508:["CS","1","PositionerType"],1510:["DS","1","PositionerPrimaryAngle"],1511:["DS","1","PositionerSecondaryAngle"],1520:["DS","1-n","PositionerPrimaryAngleIncrement"],1521:["DS","1-n","PositionerSecondaryAngleIncrement"],1530:["DS","1","DetectorPrimaryAngle"],1531:["DS","1","DetectorSecondaryAngle"],1600:["CS","1-3","ShutterShape"],1602:["IS","1","ShutterLeftVerticalEdge"],1604:["IS","1","ShutterRightVerticalEdge"],1606:["IS","1","ShutterUpperHorizontalEdge"],1608:["IS","1","ShutterLowerHorizontalEdge"],1610:["IS","2","CenterOfCircularShutter"],1612:["IS","1","RadiusOfCircularShutter"],1620:["IS","2-2n","VerticesOfThePolygonalShutter"],1622:["US","1","ShutterPresentationValue"],1623:["US","1","ShutterOverlayGroup"],1624:["US","3","ShutterPresentationColorCIELabValue"],1630:["CS","1","OutlineShapeType"],1631:["FD","1","OutlineLeftVerticalEdge"],1632:["FD","1","OutlineRightVerticalEdge"],1633:["FD","1","OutlineUpperHorizontalEdge"],1634:["FD","1","OutlineLowerHorizontalEdge"],1635:["FD","2","CenterOfCircularOutline"],1636:["FD","1","DiameterOfCircularOutline"],1637:["UL","1","NumberOfPolygonalVertices"],1638:["OF","1","VerticesOfThePolygonalOutline"],1700:["CS","1-3","CollimatorShape"],1702:["IS","1","CollimatorLeftVerticalEdge"],1704:["IS","1","CollimatorRightVerticalEdge"],1706:["IS","1","CollimatorUpperHorizontalEdge"],1708:["IS","1","CollimatorLowerHorizontalEdge"],1710:["IS","2","CenterOfCircularCollimator"],1712:["IS","1","RadiusOfCircularCollimator"],1720:["IS","2-2n","VerticesOfThePolygonalCollimator"],1800:["CS","1","AcquisitionTimeSynchronized"],1801:["SH","1","TimeSource"],1802:["CS","1","TimeDistributionProtocol"],1803:["LO","1","NTPSourceAddress"],2001:["IS","1-n","PageNumberVector"],2002:["SH","1-n","FrameLabelVector"],2003:["DS","1-n","FramePrimaryAngleVector"],2004:["DS","1-n","FrameSecondaryAngleVector"],2005:["DS","1-n","SliceLocationVector"],2006:["SH","1-n","DisplayWindowLabelVector"],2010:["DS","2","NominalScannedPixelSpacing"],2020:["CS","1","DigitizingDeviceTransportDirection"],2030:["DS","1","RotationOfScannedFilm"],2041:["SQ","1","BiopsyTargetSequence"],2042:["UI","1","TargetUID"],2043:["FL","2","LocalizingCursorPosition"],2044:["FL","3","CalculatedTargetPosition"],2045:["SH","1","TargetLabel"],2046:["FL","1","DisplayedZValue"],3100:["CS","1","IVUSAcquisition"],3101:["DS","1","IVUSPullbackRate"],3102:["DS","1","IVUSGatedRate"],3103:["IS","1","IVUSPullbackStartFrameNumber"],3104:["IS","1","IVUSPullbackStopFrameNumber"],3105:["IS","1-n","LesionNumber"],4e3:["LT","1","AcquisitionComments"],5e3:["SH","1-n","OutputPower"],5010:["LO","1-n","TransducerData"],5011:["SQ","1","TransducerIdentificationSequence"],5012:["DS","1","FocusDepth"],5020:["LO","1","ProcessingFunction"],5021:["LO","1","PostprocessingFunction"],5022:["DS","1","MechanicalIndex"],5024:["DS","1","BoneThermalIndex"],5026:["DS","1","CranialThermalIndex"],5027:["DS","1","SoftTissueThermalIndex"],5028:["DS","1","SoftTissueFocusThermalIndex"],5029:["DS","1","SoftTissueSurfaceThermalIndex"],5030:["DS","1","DynamicRange"],5040:["DS","1","TotalGain"],5050:["IS","1","DepthOfScanField"],5100:["CS","1","PatientPosition"],5101:["CS","1","ViewPosition"],5104:["SQ","1","ProjectionEponymousNameCodeSequence"],5210:["DS","6","ImageTransformationMatrix"],5212:["DS","3","ImageTranslationVector"],6e3:["DS","1","Sensitivity"],6011:["SQ","1","SequenceOfUltrasoundRegions"],6012:["US","1","RegionSpatialFormat"],6014:["US","1","RegionDataType"],6016:["UL","1","RegionFlags"],6018:["UL","1","RegionLocationMinX0"],"601A":["UL","1","RegionLocationMinY0"],"601C":["UL","1","RegionLocationMaxX1"],"601E":["UL","1","RegionLocationMaxY1"],6020:["SL","1","ReferencePixelX0"],6022:["SL","1","ReferencePixelY0"],6024:["US","1","PhysicalUnitsXDirection"],6026:["US","1","PhysicalUnitsYDirection"],6028:["FD","1","ReferencePixelPhysicalValueX"],"602A":["FD","1","ReferencePixelPhysicalValueY"],"602C":["FD","1","PhysicalDeltaX"],"602E":["FD","1","PhysicalDeltaY"],6030:["UL","1","TransducerFrequency"],6031:["CS","1","TransducerType"],6032:["UL","1","PulseRepetitionFrequency"],6034:["FD","1","DopplerCorrectionAngle"],6036:["FD","1","SteeringAngle"],6038:["UL","1","DopplerSampleVolumeXPositionRetired"],6039:["SL","1","DopplerSampleVolumeXPosition"],"603A":["UL","1","DopplerSampleVolumeYPositionRetired"],"603B":["SL","1","DopplerSampleVolumeYPosition"],"603C":["UL","1","TMLinePositionX0Retired"],"603D":["SL","1","TMLinePositionX0"],"603E":["UL","1","TMLinePositionY0Retired"],"603F":["SL","1","TMLinePositionY0"],6040:["UL","1","TMLinePositionX1Retired"],6041:["SL","1","TMLinePositionX1"],6042:["UL","1","TMLinePositionY1Retired"],6043:["SL","1","TMLinePositionY1"],6044:["US","1","PixelComponentOrganization"],6046:["UL","1","PixelComponentMask"],6048:["UL","1","PixelComponentRangeStart"],"604A":["UL","1","PixelComponentRangeStop"],"604C":["US","1","PixelComponentPhysicalUnits"],"604E":["US","1","PixelComponentDataType"],6050:["UL","1","NumberOfTableBreakPoints"],6052:["UL","1-n","TableOfXBreakPoints"],6054:["FD","1-n","TableOfYBreakPoints"],6056:["UL","1","NumberOfTableEntries"],6058:["UL","1-n","TableOfPixelValues"],"605A":["FL","1-n","TableOfParameterValues"],6060:["FL","1-n","RWaveTimeVector"],6070:["US","1","ActiveImageAreaOverlayGroup"],7e3:["CS","1","DetectorConditionsNominalFlag"],7001:["DS","1","DetectorTemperature"],7004:["CS","1","DetectorType"],7005:["CS","1","DetectorConfiguration"],7006:["LT","1","DetectorDescription"],7008:["LT","1","DetectorMode"],"700A":["SH","1","DetectorID"],"700C":["DA","1","DateOfLastDetectorCalibration"],"700E":["TM","1","TimeOfLastDetectorCalibration"],7010:["IS","1","ExposuresOnDetectorSinceLastCalibration"],7011:["IS","1","ExposuresOnDetectorSinceManufactured"],7012:["DS","1","DetectorTimeSinceLastExposure"],7014:["DS","1","DetectorActiveTime"],7016:["DS","1","DetectorActivationOffsetFromExposure"],"701A":["DS","2","DetectorBinning"],7020:["DS","2","DetectorElementPhysicalSize"],7022:["DS","2","DetectorElementSpacing"],7024:["CS","1","DetectorActiveShape"],7026:["DS","1-2","DetectorActiveDimensions"],7028:["DS","2","DetectorActiveOrigin"],"702A":["LO","1","DetectorManufacturerName"],"702B":["LO","1","DetectorManufacturerModelName"],7030:["DS","2","FieldOfViewOrigin"],7032:["DS","1","FieldOfViewRotation"],7034:["CS","1","FieldOfViewHorizontalFlip"],7036:["FL","2","PixelDataAreaOriginRelativeToFOV"],7038:["FL","1","PixelDataAreaRotationAngleRelativeToFOV"],7040:["LT","1","GridAbsorbingMaterial"],7041:["LT","1","GridSpacingMaterial"],7042:["DS","1","GridThickness"],7044:["DS","1","GridPitch"],7046:["IS","2","GridAspectRatio"],7048:["DS","1","GridPeriod"],"704C":["DS","1","GridFocalDistance"],7050:["CS","1-n","FilterMaterial"],7052:["DS","1-n","FilterThicknessMinimum"],7054:["DS","1-n","FilterThicknessMaximum"],7056:["FL","1-n","FilterBeamPathLengthMinimum"],7058:["FL","1-n","FilterBeamPathLengthMaximum"],7060:["CS","1","ExposureControlMode"],7062:["LT","1","ExposureControlModeDescription"],7064:["CS","1","ExposureStatus"],7065:["DS","1","PhototimerSetting"],8150:["DS","1","ExposureTimeInuS"],8151:["DS","1","XRayTubeCurrentInuA"],9004:["CS","1","ContentQualification"],9005:["SH","1","PulseSequenceName"],9006:["SQ","1","MRImagingModifierSequence"],9008:["CS","1","EchoPulseSequence"],9009:["CS","1","InversionRecovery"],9010:["CS","1","FlowCompensation"],9011:["CS","1","MultipleSpinEcho"],9012:["CS","1","MultiPlanarExcitation"],9014:["CS","1","PhaseContrast"],9015:["CS","1","TimeOfFlightContrast"],9016:["CS","1","Spoiling"],9017:["CS","1","SteadyStatePulseSequence"],9018:["CS","1","EchoPlanarPulseSequence"],9019:["FD","1","TagAngleFirstAxis"],9020:["CS","1","MagnetizationTransfer"],9021:["CS","1","T2Preparation"],9022:["CS","1","BloodSignalNulling"],9024:["CS","1","SaturationRecovery"],9025:["CS","1","SpectrallySelectedSuppression"],9026:["CS","1","SpectrallySelectedExcitation"],9027:["CS","1","SpatialPresaturation"],9028:["CS","1","Tagging"],9029:["CS","1","OversamplingPhase"],9030:["FD","1","TagSpacingFirstDimension"],9032:["CS","1","GeometryOfKSpaceTraversal"],9033:["CS","1","SegmentedKSpaceTraversal"],9034:["CS","1","RectilinearPhaseEncodeReordering"],9035:["FD","1","TagThickness"],9036:["CS","1","PartialFourierDirection"],9037:["CS","1","CardiacSynchronizationTechnique"],9041:["LO","1","ReceiveCoilManufacturerName"],9042:["SQ","1","MRReceiveCoilSequence"],9043:["CS","1","ReceiveCoilType"],9044:["CS","1","QuadratureReceiveCoil"],9045:["SQ","1","MultiCoilDefinitionSequence"],9046:["LO","1","MultiCoilConfiguration"],9047:["SH","1","MultiCoilElementName"],9048:["CS","1","MultiCoilElementUsed"],9049:["SQ","1","MRTransmitCoilSequence"],9050:["LO","1","TransmitCoilManufacturerName"],9051:["CS","1","TransmitCoilType"],9052:["FD","1-2","SpectralWidth"],9053:["FD","1-2","ChemicalShiftReference"],9054:["CS","1","VolumeLocalizationTechnique"],9058:["US","1","MRAcquisitionFrequencyEncodingSteps"],9059:["CS","1","Decoupling"],9060:["CS","1-2","DecoupledNucleus"],9061:["FD","1-2","DecouplingFrequency"],9062:["CS","1","DecouplingMethod"],9063:["FD","1-2","DecouplingChemicalShiftReference"],9064:["CS","1","KSpaceFiltering"],9065:["CS","1-2","TimeDomainFiltering"],9066:["US","1-2","NumberOfZeroFills"],9067:["CS","1","BaselineCorrection"],9069:["FD","1","ParallelReductionFactorInPlane"],9070:["FD","1","CardiacRRIntervalSpecified"],9073:["FD","1","AcquisitionDuration"],9074:["DT","1","FrameAcquisitionDateTime"],9075:["CS","1","DiffusionDirectionality"],9076:["SQ","1","DiffusionGradientDirectionSequence"],9077:["CS","1","ParallelAcquisition"],9078:["CS","1","ParallelAcquisitionTechnique"],9079:["FD","1-n","InversionTimes"],9080:["ST","1","MetaboliteMapDescription"],9081:["CS","1","PartialFourier"],9082:["FD","1","EffectiveEchoTime"],9083:["SQ","1","MetaboliteMapCodeSequence"],9084:["SQ","1","ChemicalShiftSequence"],9085:["CS","1","CardiacSignalSource"],9087:["FD","1","DiffusionBValue"],9089:["FD","3","DiffusionGradientOrientation"],9090:["FD","3","VelocityEncodingDirection"],9091:["FD","1","VelocityEncodingMinimumValue"],9092:["SQ","1","VelocityEncodingAcquisitionSequence"],9093:["US","1","NumberOfKSpaceTrajectories"],9094:["CS","1","CoverageOfKSpace"],9095:["UL","1","SpectroscopyAcquisitionPhaseRows"],9096:["FD","1","ParallelReductionFactorInPlaneRetired"],9098:["FD","1-2","TransmitterFrequency"],9100:["CS","1-2","ResonantNucleus"],9101:["CS","1","FrequencyCorrection"],9103:["SQ","1","MRSpectroscopyFOVGeometrySequence"],9104:["FD","1","SlabThickness"],9105:["FD","3","SlabOrientation"],9106:["FD","3","MidSlabPosition"],9107:["SQ","1","MRSpatialSaturationSequence"],9112:["SQ","1","MRTimingAndRelatedParametersSequence"],9114:["SQ","1","MREchoSequence"],9115:["SQ","1","MRModifierSequence"],9117:["SQ","1","MRDiffusionSequence"],9118:["SQ","1","CardiacSynchronizationSequence"],9119:["SQ","1","MRAveragesSequence"],9125:["SQ","1","MRFOVGeometrySequence"],9126:["SQ","1","VolumeLocalizationSequence"],9127:["UL","1","SpectroscopyAcquisitionDataColumns"],9147:["CS","1","DiffusionAnisotropyType"],9151:["DT","1","FrameReferenceDateTime"],9152:["SQ","1","MRMetaboliteMapSequence"],9155:["FD","1","ParallelReductionFactorOutOfPlane"],9159:["UL","1","SpectroscopyAcquisitionOutOfPlanePhaseSteps"],9166:["CS","1","BulkMotionStatus"],9168:["FD","1","ParallelReductionFactorSecondInPlane"],9169:["CS","1","CardiacBeatRejectionTechnique"],9170:["CS","1","RespiratoryMotionCompensationTechnique"],9171:["CS","1","RespiratorySignalSource"],9172:["CS","1","BulkMotionCompensationTechnique"],9173:["CS","1","BulkMotionSignalSource"],9174:["CS","1","ApplicableSafetyStandardAgency"],9175:["LO","1","ApplicableSafetyStandardDescription"],9176:["SQ","1","OperatingModeSequence"],9177:["CS","1","OperatingModeType"],9178:["CS","1","OperatingMode"],9179:["CS","1","SpecificAbsorptionRateDefinition"],9180:["CS","1","GradientOutputType"],9181:["FD","1","SpecificAbsorptionRateValue"],9182:["FD","1","GradientOutput"],9183:["CS","1","FlowCompensationDirection"],9184:["FD","1","TaggingDelay"],9185:["ST","1","RespiratoryMotionCompensationTechniqueDescription"],9186:["SH","1","RespiratorySignalSourceID"],9195:["FD","1","ChemicalShiftMinimumIntegrationLimitInHz"],9196:["FD","1","ChemicalShiftMaximumIntegrationLimitInHz"],9197:["SQ","1","MRVelocityEncodingSequence"],9198:["CS","1","FirstOrderPhaseCorrection"],9199:["CS","1","WaterReferencedPhaseCorrection"],9200:["CS","1","MRSpectroscopyAcquisitionType"],9214:["CS","1","RespiratoryCyclePosition"],9217:["FD","1","VelocityEncodingMaximumValue"],9218:["FD","1","TagSpacingSecondDimension"],9219:["SS","1","TagAngleSecondAxis"],9220:["FD","1","FrameAcquisitionDuration"],9226:["SQ","1","MRImageFrameTypeSequence"],9227:["SQ","1","MRSpectroscopyFrameTypeSequence"],9231:["US","1","MRAcquisitionPhaseEncodingStepsInPlane"],9232:["US","1","MRAcquisitionPhaseEncodingStepsOutOfPlane"],9234:["UL","1","SpectroscopyAcquisitionPhaseColumns"],9236:["CS","1","CardiacCyclePosition"],9239:["SQ","1","SpecificAbsorptionRateSequence"],9240:["US","1","RFEchoTrainLength"],9241:["US","1","GradientEchoTrainLength"],9250:["CS","1","ArterialSpinLabelingContrast"],9251:["SQ","1","MRArterialSpinLabelingSequence"],9252:["LO","1","ASLTechniqueDescription"],9253:["US","1","ASLSlabNumber"],9254:["FD","1","ASLSlabThickness"],9255:["FD","3","ASLSlabOrientation"],9256:["FD","3","ASLMidSlabPosition"],9257:["CS","1","ASLContext"],9258:["UL","1","ASLPulseTrainDuration"],9259:["CS","1","ASLCrusherFlag"],"925A":["FD","1","ASLCrusherFlowLimit"],"925B":["LO","1","ASLCrusherDescription"],"925C":["CS","1","ASLBolusCutoffFlag"],"925D":["SQ","1","ASLBolusCutoffTimingSequence"],"925E":["LO","1","ASLBolusCutoffTechnique"],"925F":["UL","1","ASLBolusCutoffDelayTime"],9260:["SQ","1","ASLSlabSequence"],9295:["FD","1","ChemicalShiftMinimumIntegrationLimitInppm"],9296:["FD","1","ChemicalShiftMaximumIntegrationLimitInppm"],9297:["CS","1","WaterReferenceAcquisition"],9298:["IS","1","EchoPeakPosition"],9301:["SQ","1","CTAcquisitionTypeSequence"],9302:["CS","1","AcquisitionType"],9303:["FD","1","TubeAngle"],9304:["SQ","1","CTAcquisitionDetailsSequence"],9305:["FD","1","RevolutionTime"],9306:["FD","1","SingleCollimationWidth"],9307:["FD","1","TotalCollimationWidth"],9308:["SQ","1","CTTableDynamicsSequence"],9309:["FD","1","TableSpeed"],9310:["FD","1","TableFeedPerRotation"],9311:["FD","1","SpiralPitchFactor"],9312:["SQ","1","CTGeometrySequence"],9313:["FD","3","DataCollectionCenterPatient"],9314:["SQ","1","CTReconstructionSequence"],9315:["CS","1","ReconstructionAlgorithm"],9316:["CS","1","ConvolutionKernelGroup"],9317:["FD","2","ReconstructionFieldOfView"],9318:["FD","3","ReconstructionTargetCenterPatient"],9319:["FD","1","ReconstructionAngle"],9320:["SH","1","ImageFilter"],9321:["SQ","1","CTExposureSequence"],9322:["FD","2","ReconstructionPixelSpacing"],9323:["CS","1-n","ExposureModulationType"],9324:["FD","1","EstimatedDoseSaving"],9325:["SQ","1","CTXRayDetailsSequence"],9326:["SQ","1","CTPositionSequence"],9327:["FD","1","TablePosition"],9328:["FD","1","ExposureTimeInms"],9329:["SQ","1","CTImageFrameTypeSequence"],9330:["FD","1","XRayTubeCurrentInmA"],9332:["FD","1","ExposureInmAs"],9333:["CS","1","ConstantVolumeFlag"],9334:["CS","1","FluoroscopyFlag"],9335:["FD","1","DistanceSourceToDataCollectionCenter"],9337:["US","1","ContrastBolusAgentNumber"],9338:["SQ","1","ContrastBolusIngredientCodeSequence"],9340:["SQ","1","ContrastAdministrationProfileSequence"],9341:["SQ","1","ContrastBolusUsageSequence"],9342:["CS","1","ContrastBolusAgentAdministered"],9343:["CS","1","ContrastBolusAgentDetected"],9344:["CS","1","ContrastBolusAgentPhase"],9345:["FD","1","CTDIvol"],9346:["SQ","1","CTDIPhantomTypeCodeSequence"],9351:["FL","1","CalciumScoringMassFactorPatient"],9352:["FL","3","CalciumScoringMassFactorDevice"],9353:["FL","1","EnergyWeightingFactor"],9360:["SQ","1","CTAdditionalXRaySourceSequence"],9361:["CS","1","MultienergyCTAcquisition"],9362:["SQ","1","MultienergyCTAcquisitionSequence"],9363:["SQ","1","MultienergyCTProcessingSequence"],9364:["SQ","1","MultienergyCTCharacteristicsSequence"],9365:["SQ","1","MultienergyCTXRaySourceSequence"],9366:["US","1","XRaySourceIndex"],9367:["UC","1","XRaySourceID"],9368:["CS","1","MultienergySourceTechnique"],9369:["DT","1","SourceStartDateTime"],"936A":["DT","1","SourceEndDateTime"],"936B":["US","1","SwitchingPhaseNumber"],"936C":["DS","1","SwitchingPhaseNominalDuration"],"936D":["DS","1","SwitchingPhaseTransitionDuration"],"936E":["DS","1","EffectiveBinEnergy"],"936F":["SQ","1","MultienergyCTXRayDetectorSequence"],9370:["US","1","XRayDetectorIndex"],9371:["UC","1","XRayDetectorID"],9372:["CS","1","MultienergyDetectorType"],9373:["ST","1","XRayDetectorLabel"],9374:["DS","1","NominalMaxEnergy"],9375:["DS","1","NominalMinEnergy"],9376:["US","1-n","ReferencedXRayDetectorIndex"],9377:["US","1-n","ReferencedXRaySourceIndex"],9378:["US","1-n","ReferencedPathIndex"],9379:["SQ","1","MultienergyCTPathSequence"],"937A":["US","1","MultienergyCTPathIndex"],"937B":["UT","1","MultienergyAcquisitionDescription"],"937C":["FD","1","MonoenergeticEnergyEquivalent"],"937D":["SQ","1","MaterialCodeSequence"],"937E":["CS","1","DecompositionMethod"],"937F":["UT","1","DecompositionDescription"],9380:["SQ","1","DecompositionAlgorithmIdentificationSequence"],9381:["SQ","1","DecompositionMaterialSequence"],9382:["SQ","1","MaterialAttenuationSequence"],9383:["DS","1","PhotonEnergy"],9384:["DS","1","XRayMassAttenuationCoefficient"],9401:["SQ","1","ProjectionPixelCalibrationSequence"],9402:["FL","1","DistanceSourceToIsocenter"],9403:["FL","1","DistanceObjectToTableTop"],9404:["FL","2","ObjectPixelSpacingInCenterOfBeam"],9405:["SQ","1","PositionerPositionSequence"],9406:["SQ","1","TablePositionSequence"],9407:["SQ","1","CollimatorShapeSequence"],9410:["CS","1","PlanesInAcquisition"],9412:["SQ","1","XAXRFFrameCharacteristicsSequence"],9417:["SQ","1","FrameAcquisitionSequence"],9420:["CS","1","XRayReceptorType"],9423:["LO","1","AcquisitionProtocolName"],9424:["LT","1","AcquisitionProtocolDescription"],9425:["CS","1","ContrastBolusIngredientOpaque"],9426:["FL","1","DistanceReceptorPlaneToDetectorHousing"],9427:["CS","1","IntensifierActiveShape"],9428:["FL","1-2","IntensifierActiveDimensions"],9429:["FL","2","PhysicalDetectorSize"],9430:["FL","2","PositionOfIsocenterProjection"],9432:["SQ","1","FieldOfViewSequence"],9433:["LO","1","FieldOfViewDescription"],9434:["SQ","1","ExposureControlSensingRegionsSequence"],9435:["CS","1","ExposureControlSensingRegionShape"],9436:["SS","1","ExposureControlSensingRegionLeftVerticalEdge"],9437:["SS","1","ExposureControlSensingRegionRightVerticalEdge"],9438:["SS","1","ExposureControlSensingRegionUpperHorizontalEdge"],9439:["SS","1","ExposureControlSensingRegionLowerHorizontalEdge"],9440:["SS","2","CenterOfCircularExposureControlSensingRegion"],9441:["US","1","RadiusOfCircularExposureControlSensingRegion"],9442:["SS","2-n","VerticesOfThePolygonalExposureControlSensingRegion"],9445:["","",""],9447:["FL","1","ColumnAngulationPatient"],9449:["FL","1","BeamAngle"],9451:["SQ","1","FrameDetectorParametersSequence"],9452:["FL","1","CalculatedAnatomyThickness"],9455:["SQ","1","CalibrationSequence"],9456:["SQ","1","ObjectThicknessSequence"],9457:["CS","1","PlaneIdentification"],9461:["FL","1-2","FieldOfViewDimensionsInFloat"],9462:["SQ","1","IsocenterReferenceSystemSequence"],9463:["FL","1","PositionerIsocenterPrimaryAngle"],9464:["FL","1","PositionerIsocenterSecondaryAngle"],9465:["FL","1","PositionerIsocenterDetectorRotationAngle"],9466:["FL","1","TableXPositionToIsocenter"],9467:["FL","1","TableYPositionToIsocenter"],9468:["FL","1","TableZPositionToIsocenter"],9469:["FL","1","TableHorizontalRotationAngle"],9470:["FL","1","TableHeadTiltAngle"],9471:["FL","1","TableCradleTiltAngle"],9472:["SQ","1","FrameDisplayShutterSequence"],9473:["FL","1","AcquiredImageAreaDoseProduct"],9474:["CS","1","CArmPositionerTabletopRelationship"],9476:["SQ","1","XRayGeometrySequence"],9477:["SQ","1","IrradiationEventIdentificationSequence"],9504:["SQ","1","XRay3DFrameTypeSequence"],9506:["SQ","1","ContributingSourcesSequence"],9507:["SQ","1","XRay3DAcquisitionSequence"],9508:["FL","1","PrimaryPositionerScanArc"],9509:["FL","1","SecondaryPositionerScanArc"],9510:["FL","1","PrimaryPositionerScanStartAngle"],9511:["FL","1","SecondaryPositionerScanStartAngle"],9514:["FL","1","PrimaryPositionerIncrement"],9515:["FL","1","SecondaryPositionerIncrement"],9516:["DT","1","StartAcquisitionDateTime"],9517:["DT","1","EndAcquisitionDateTime"],9518:["SS","1","PrimaryPositionerIncrementSign"],9519:["SS","1","SecondaryPositionerIncrementSign"],9524:["LO","1","ApplicationName"],9525:["LO","1","ApplicationVersion"],9526:["LO","1","ApplicationManufacturer"],9527:["CS","1","AlgorithmType"],9528:["LO","1","AlgorithmDescription"],9530:["SQ","1","XRay3DReconstructionSequence"],9531:["LO","1","ReconstructionDescription"],9538:["SQ","1","PerProjectionAcquisitionSequence"],9541:["SQ","1","DetectorPositionSequence"],9542:["SQ","1","XRayAcquisitionDoseSequence"],9543:["FD","1","XRaySourceIsocenterPrimaryAngle"],9544:["FD","1","XRaySourceIsocenterSecondaryAngle"],9545:["FD","1","BreastSupportIsocenterPrimaryAngle"],9546:["FD","1","BreastSupportIsocenterSecondaryAngle"],9547:["FD","1","BreastSupportXPositionToIsocenter"],9548:["FD","1","BreastSupportYPositionToIsocenter"],9549:["FD","1","BreastSupportZPositionToIsocenter"],9550:["FD","1","DetectorIsocenterPrimaryAngle"],9551:["FD","1","DetectorIsocenterSecondaryAngle"],9552:["FD","1","DetectorXPositionToIsocenter"],9553:["FD","1","DetectorYPositionToIsocenter"],9554:["FD","1","DetectorZPositionToIsocenter"],9555:["SQ","1","XRayGridSequence"],9556:["SQ","1","XRayFilterSequence"],9557:["FD","3","DetectorActiveAreaTLHCPosition"],9558:["FD","6","DetectorActiveAreaOrientation"],9559:["CS","1","PositionerPrimaryAngleDirection"],9601:["SQ","1","DiffusionBMatrixSequence"],9602:["FD","1","DiffusionBValueXX"],9603:["FD","1","DiffusionBValueXY"],9604:["FD","1","DiffusionBValueXZ"],9605:["FD","1","DiffusionBValueYY"],9606:["FD","1","DiffusionBValueYZ"],9607:["FD","1","DiffusionBValueZZ"],9621:["SQ","1","FunctionalMRSequence"],9622:["CS","1","FunctionalSettlingPhaseFramesPresent"],9623:["DT","1","FunctionalSyncPulse"],9624:["CS","1","SettlingPhaseFrame"],9701:["DT","1","DecayCorrectionDateTime"],9715:["FD","1","StartDensityThreshold"],9716:["FD","1","StartRelativeDensityDifferenceThreshold"],9717:["FD","1","StartCardiacTriggerCountThreshold"],9718:["FD","1","StartRespiratoryTriggerCountThreshold"],9719:["FD","1","TerminationCountsThreshold"],9720:["FD","1","TerminationDensityThreshold"],9721:["FD","1","TerminationRelativeDensityThreshold"],9722:["FD","1","TerminationTimeThreshold"],9723:["FD","1","TerminationCardiacTriggerCountThreshold"],9724:["FD","1","TerminationRespiratoryTriggerCountThreshold"],9725:["CS","1","DetectorGeometry"],9726:["FD","1","TransverseDetectorSeparation"],9727:["FD","1","AxialDetectorDimension"],9729:["US","1","RadiopharmaceuticalAgentNumber"],9732:["SQ","1","PETFrameAcquisitionSequence"],9733:["SQ","1","PETDetectorMotionDetailsSequence"],9734:["SQ","1","PETTableDynamicsSequence"],9735:["SQ","1","PETPositionSequence"],9736:["SQ","1","PETFrameCorrectionFactorsSequence"],9737:["SQ","1","RadiopharmaceuticalUsageSequence"],9738:["CS","1","AttenuationCorrectionSource"],9739:["US","1","NumberOfIterations"],9740:["US","1","NumberOfSubsets"],9749:["SQ","1","PETReconstructionSequence"],9751:["SQ","1","PETFrameTypeSequence"],9755:["CS","1","TimeOfFlightInformationUsed"],9756:["CS","1","ReconstructionType"],9758:["CS","1","DecayCorrected"],9759:["CS","1","AttenuationCorrected"],9760:["CS","1","ScatterCorrected"],9761:["CS","1","DeadTimeCorrected"],9762:["CS","1","GantryMotionCorrected"],9763:["CS","1","PatientMotionCorrected"],9764:["CS","1","CountLossNormalizationCorrected"],9765:["CS","1","RandomsCorrected"],9766:["CS","1","NonUniformRadialSamplingCorrected"],9767:["CS","1","SensitivityCalibrated"],9768:["CS","1","DetectorNormalizationCorrection"],9769:["CS","1","IterativeReconstructionMethod"],9770:["CS","1","AttenuationCorrectionTemporalRelationship"],9771:["SQ","1","PatientPhysiologicalStateSequence"],9772:["SQ","1","PatientPhysiologicalStateCodeSequence"],9801:["FD","1-n","DepthsOfFocus"],9803:["SQ","1","ExcludedIntervalsSequence"],9804:["DT","1","ExclusionStartDateTime"],9805:["FD","1","ExclusionDuration"],9806:["SQ","1","USImageDescriptionSequence"],9807:["SQ","1","ImageDataTypeSequence"],9808:["CS","1","DataType"],9809:["SQ","1","TransducerScanPatternCodeSequence"],"980B":["CS","1","AliasedDataType"],"980C":["CS","1","PositionMeasuringDeviceUsed"],"980D":["SQ","1","TransducerGeometryCodeSequence"],"980E":["SQ","1","TransducerBeamSteeringCodeSequence"],"980F":["SQ","1","TransducerApplicationCodeSequence"],9810:["xs","1","ZeroVelocityPixelValue"],9900:["LO","1","ReferenceLocationLabel"],9901:["UT","1","ReferenceLocationDescription"],9902:["SQ","1","ReferenceBasisCodeSequence"],9903:["SQ","1","ReferenceGeometryCodeSequence"],9904:["DS","1","OffsetDistance"],9905:["CS","1","OffsetDirection"],9906:["SQ","1","PotentialScheduledProtocolCodeSequence"],9907:["SQ","1","PotentialRequestedProcedureCodeSequence"],9908:["UC","1-n","PotentialReasonsForProcedure"],9909:["SQ","1","PotentialReasonsForProcedureCodeSequence"],"990A":["UC","1-n","PotentialDiagnosticTasks"],"990B":["SQ","1","ContraindicationsCodeSequence"],"990C":["SQ","1","ReferencedDefinedProtocolSequence"],"990D":["SQ","1","ReferencedPerformedProtocolSequence"],"990E":["SQ","1","PredecessorProtocolSequence"],"990F":["UT","1","ProtocolPlanningInformation"],9910:["UT","1","ProtocolDesignRationale"],9911:["SQ","1","PatientSpecificationSequence"],9912:["SQ","1","ModelSpecificationSequence"],9913:["SQ","1","ParametersSpecificationSequence"],9914:["SQ","1","InstructionSequence"],9915:["US","1","InstructionIndex"],9916:["LO","1","InstructionText"],9917:["UT","1","InstructionDescription"],9918:["CS","1","InstructionPerformedFlag"],9919:["DT","1","InstructionPerformedDateTime"],"991A":["UT","1","InstructionPerformanceComment"],"991B":["SQ","1","PatientPositioningInstructionSequence"],"991C":["SQ","1","PositioningMethodCodeSequence"],"991D":["SQ","1","PositioningLandmarkSequence"],"991E":["UI","1","TargetFrameOfReferenceUID"],"991F":["SQ","1","AcquisitionProtocolElementSpecificationSequence"],9920:["SQ","1","AcquisitionProtocolElementSequence"],9921:["US","1","ProtocolElementNumber"],9922:["LO","1","ProtocolElementName"],9923:["UT","1","ProtocolElementCharacteristicsSummary"],9924:["UT","1","ProtocolElementPurpose"],9930:["CS","1","AcquisitionMotion"],9931:["SQ","1","AcquisitionStartLocationSequence"],9932:["SQ","1","AcquisitionEndLocationSequence"],9933:["SQ","1","ReconstructionProtocolElementSpecificationSequence"],9934:["SQ","1","ReconstructionProtocolElementSequence"],9935:["SQ","1","StorageProtocolElementSpecificationSequence"],9936:["SQ","1","StorageProtocolElementSequence"],9937:["LO","1","RequestedSeriesDescription"],9938:["US","1-n","SourceAcquisitionProtocolElementNumber"],9939:["US","1-n","SourceAcquisitionBeamNumber"],"993A":["US","1-n","SourceReconstructionProtocolElementNumber"],"993B":["SQ","1","ReconstructionStartLocationSequence"],"993C":["SQ","1","ReconstructionEndLocationSequence"],"993D":["SQ","1","ReconstructionAlgorithmSequence"],"993E":["SQ","1","ReconstructionTargetCenterLocationSequence"],9941:["UT","1","ImageFilterDescription"],9942:["FD","1","CTDIvolNotificationTrigger"],9943:["FD","1","DLPNotificationTrigger"],9944:["CS","1","AutoKVPSelectionType"],9945:["FD","1","AutoKVPUpperBound"],9946:["FD","1","AutoKVPLowerBound"],9947:["CS","1","ProtocolDefinedPatientPosition"],A001:["SQ","1","ContributingEquipmentSequence"],A002:["DT","1","ContributionDateTime"],A003:["ST","1","ContributionDescription"]},"0020":{"0000":["UL","1","GenericGroupLength"],"000D":["UI","1","StudyInstanceUID"],"000E":["UI","1","SeriesInstanceUID"],"0010":["SH","1","StudyID"],"0011":["IS","1","SeriesNumber"],"0012":["IS","1","AcquisitionNumber"],"0013":["IS","1","InstanceNumber"],"0014":["IS","1","IsotopeNumber"],"0015":["IS","1","PhaseNumber"],"0016":["IS","1","IntervalNumber"],"0017":["IS","1","TimeSlotNumber"],"0018":["IS","1","AngleNumber"],"0019":["IS","1","ItemNumber"],"0020":["CS","2","PatientOrientation"],"0022":["IS","1","OverlayNumber"],"0024":["IS","1","CurveNumber"],"0026":["IS","1","LUTNumber"],"0030":["DS","3","ImagePosition"],"0032":["DS","3","ImagePositionPatient"],"0035":["DS","6","ImageOrientation"],"0037":["DS","6","ImageOrientationPatient"],"0050":["DS","1","Location"],"0052":["UI","1","FrameOfReferenceUID"],"0060":["CS","1","Laterality"],"0062":["CS","1","ImageLaterality"],"0070":["LO","1","ImageGeometryType"],"0080":["CS","1-n","MaskingImage"],"00AA":["IS","1","ReportNumber"],"0100":["IS","1","TemporalPositionIdentifier"],"0105":["IS","1","NumberOfTemporalPositions"],"0110":["DS","1","TemporalResolution"],"0200":["UI","1","SynchronizationFrameOfReferenceUID"],"0242":["UI","1","SOPInstanceUIDOfConcatenationSource"],1e3:["IS","1","SeriesInStudy"],1001:["IS","1","AcquisitionsInSeries"],1002:["IS","1","ImagesInAcquisition"],1003:["IS","1","ImagesInSeries"],1004:["IS","1","AcquisitionsInStudy"],1005:["IS","1","ImagesInStudy"],1020:["LO","1-n","Reference"],"103F":["LO","1","TargetPositionReferenceIndicator"],1040:["LO","1","PositionReferenceIndicator"],1041:["DS","1","SliceLocation"],1070:["IS","1-n","OtherStudyNumbers"],1200:["IS","1","NumberOfPatientRelatedStudies"],1202:["IS","1","NumberOfPatientRelatedSeries"],1204:["IS","1","NumberOfPatientRelatedInstances"],1206:["IS","1","NumberOfStudyRelatedSeries"],1208:["IS","1","NumberOfStudyRelatedInstances"],1209:["IS","1","NumberOfSeriesRelatedInstances"],3100:["CS","1-n","SourceImageIDs"],3401:["CS","1","ModifyingDeviceID"],3402:["CS","1","ModifiedImageID"],3403:["DA","1","ModifiedImageDate"],3404:["LO","1","ModifyingDeviceManufacturer"],3405:["TM","1","ModifiedImageTime"],3406:["LO","1","ModifiedImageDescription"],4e3:["LT","1","ImageComments"],5e3:["AT","1-n","OriginalImageIdentification"],5002:["LO","1-n","OriginalImageIdentificationNomenclature"],9056:["SH","1","StackID"],9057:["UL","1","InStackPositionNumber"],9071:["SQ","1","FrameAnatomySequence"],9072:["CS","1","FrameLaterality"],9111:["SQ","1","FrameContentSequence"],9113:["SQ","1","PlanePositionSequence"],9116:["SQ","1","PlaneOrientationSequence"],9128:["UL","1","TemporalPositionIndex"],9153:["FD","1","NominalCardiacTriggerDelayTime"],9154:["FL","1","NominalCardiacTriggerTimePriorToRPeak"],9155:["FL","1","ActualCardiacTriggerTimePriorToRPeak"],9156:["US","1","FrameAcquisitionNumber"],9157:["UL","1-n","DimensionIndexValues"],9158:["LT","1","FrameComments"],9161:["UI","1","ConcatenationUID"],9162:["US","1","InConcatenationNumber"],9163:["US","1","InConcatenationTotalNumber"],9164:["UI","1","DimensionOrganizationUID"],9165:["AT","1","DimensionIndexPointer"],9167:["AT","1","FunctionalGroupPointer"],9170:["SQ","1","UnassignedSharedConvertedAttributesSequence"],9171:["SQ","1","UnassignedPerFrameConvertedAttributesSequence"],9172:["SQ","1","ConversionSourceAttributesSequence"],9213:["LO","1","DimensionIndexPrivateCreator"],9221:["SQ","1","DimensionOrganizationSequence"],9222:["SQ","1","DimensionIndexSequence"],9228:["UL","1","ConcatenationFrameOffsetNumber"],9238:["LO","1","FunctionalGroupPrivateCreator"],9241:["FL","1","NominalPercentageOfCardiacPhase"],9245:["FL","1","NominalPercentageOfRespiratoryPhase"],9246:["FL","1","StartingRespiratoryAmplitude"],9247:["CS","1","StartingRespiratoryPhase"],9248:["FL","1","EndingRespiratoryAmplitude"],9249:["CS","1","EndingRespiratoryPhase"],9250:["CS","1","RespiratoryTriggerType"],9251:["FD","1","RRIntervalTimeNominal"],9252:["FD","1","ActualCardiacTriggerDelayTime"],9253:["SQ","1","RespiratorySynchronizationSequence"],9254:["FD","1","RespiratoryIntervalTime"],9255:["FD","1","NominalRespiratoryTriggerDelayTime"],9256:["FD","1","RespiratoryTriggerDelayThreshold"],9257:["FD","1","ActualRespiratoryTriggerDelayTime"],9301:["FD","3","ImagePositionVolume"],9302:["FD","6","ImageOrientationVolume"],9307:["CS","1","UltrasoundAcquisitionGeometry"],9308:["FD","3","ApexPosition"],9309:["FD","16","VolumeToTransducerMappingMatrix"],"930A":["FD","16","VolumeToTableMappingMatrix"],"930B":["CS","1","VolumeToTransducerRelationship"],"930C":["CS","1","PatientFrameOfReferenceSource"],"930D":["FD","1","TemporalPositionTimeOffset"],"930E":["SQ","1","PlanePositionVolumeSequence"],"930F":["SQ","1","PlaneOrientationVolumeSequence"],9310:["SQ","1","TemporalPositionSequence"],9311:["CS","1","DimensionOrganizationType"],9312:["UI","1","VolumeFrameOfReferenceUID"],9313:["UI","1","TableFrameOfReferenceUID"],9421:["LO","1","DimensionDescriptionLabel"],9450:["SQ","1","PatientOrientationInFrameSequence"],9453:["LO","1","FrameLabel"],9518:["US","1-n","AcquisitionIndex"],9529:["SQ","1","ContributingSOPInstancesReferenceSequence"],9536:["US","1","ReconstructionIndex"]},"0022":{"0000":["UL","1","GenericGroupLength"],"0001":["US","1","LightPathFilterPassThroughWavelength"],"0002":["US","2","LightPathFilterPassBand"],"0003":["US","1","ImagePathFilterPassThroughWavelength"],"0004":["US","2","ImagePathFilterPassBand"],"0005":["CS","1","PatientEyeMovementCommanded"],"0006":["SQ","1","PatientEyeMovementCommandCodeSequence"],"0007":["FL","1","SphericalLensPower"],"0008":["FL","1","CylinderLensPower"],"0009":["FL","1","CylinderAxis"],"000A":["FL","1","EmmetropicMagnification"],"000B":["FL","1","IntraOcularPressure"],"000C":["FL","1","HorizontalFieldOfView"],"000D":["CS","1","PupilDilated"],"000E":["FL","1","DegreeOfDilation"],"0010":["FL","1","StereoBaselineAngle"],"0011":["FL","1","StereoBaselineDisplacement"],"0012":["FL","1","StereoHorizontalPixelOffset"],"0013":["FL","1","StereoVerticalPixelOffset"],"0014":["FL","1","StereoRotation"],"0015":["SQ","1","AcquisitionDeviceTypeCodeSequence"],"0016":["SQ","1","IlluminationTypeCodeSequence"],"0017":["SQ","1","LightPathFilterTypeStackCodeSequence"],"0018":["SQ","1","ImagePathFilterTypeStackCodeSequence"],"0019":["SQ","1","LensesCodeSequence"],"001A":["SQ","1","ChannelDescriptionCodeSequence"],"001B":["SQ","1","RefractiveStateSequence"],"001C":["SQ","1","MydriaticAgentCodeSequence"],"001D":["SQ","1","RelativeImagePositionCodeSequence"],"001E":["FL","1","CameraAngleOfView"],"0020":["SQ","1","StereoPairsSequence"],"0021":["SQ","1","LeftImageSequence"],"0022":["SQ","1","RightImageSequence"],"0028":["CS","1","StereoPairsPresent"],"0030":["FL","1","AxialLengthOfTheEye"],"0031":["SQ","1","OphthalmicFrameLocationSequence"],"0032":["FL","2-2n","ReferenceCoordinates"],"0035":["FL","1","DepthSpatialResolution"],"0036":["FL","1","MaximumDepthDistortion"],"0037":["FL","1","AlongScanSpatialResolution"],"0038":["FL","1","MaximumAlongScanDistortion"],"0039":["CS","1","OphthalmicImageOrientation"],"0041":["FL","1","DepthOfTransverseImage"],"0042":["SQ","1","MydriaticAgentConcentrationUnitsSequence"],"0048":["FL","1","AcrossScanSpatialResolution"],"0049":["FL","1","MaximumAcrossScanDistortion"],"004E":["DS","1","MydriaticAgentConcentration"],"0055":["FL","1","IlluminationWaveLength"],"0056":["FL","1","IlluminationPower"],"0057":["FL","1","IlluminationBandwidth"],"0058":["SQ","1","MydriaticAgentSequence"],1007:["SQ","1","OphthalmicAxialMeasurementsRightEyeSequence"],1008:["SQ","1","OphthalmicAxialMeasurementsLeftEyeSequence"],1009:["CS","1","OphthalmicAxialMeasurementsDeviceType"],1010:["CS","1","OphthalmicAxialLengthMeasurementsType"],1012:["SQ","1","OphthalmicAxialLengthSequence"],1019:["FL","1","OphthalmicAxialLength"],1024:["SQ","1","LensStatusCodeSequence"],1025:["SQ","1","VitreousStatusCodeSequence"],1028:["SQ","1","IOLFormulaCodeSequence"],1029:["LO","1","IOLFormulaDetail"],1033:["FL","1","KeratometerIndex"],1035:["SQ","1","SourceOfOphthalmicAxialLengthCodeSequence"],1036:["SQ","1","SourceOfCornealSizeDataCodeSequence"],1037:["FL","1","TargetRefraction"],1039:["CS","1","RefractiveProcedureOccurred"],1040:["SQ","1","RefractiveSurgeryTypeCodeSequence"],1044:["SQ","1","OphthalmicUltrasoundMethodCodeSequence"],1045:["SQ","1","SurgicallyInducedAstigmatismSequence"],1046:["CS","1","TypeOfOpticalCorrection"],1047:["SQ","1","ToricIOLPowerSequence"],1048:["SQ","1","PredictedToricErrorSequence"],1049:["CS","1","PreSelectedForImplantation"],"104A":["SQ","1","ToricIOLPowerForExactEmmetropiaSequence"],"104B":["SQ","1","ToricIOLPowerForExactTargetRefractionSequence"],1050:["SQ","1","OphthalmicAxialLengthMeasurementsSequence"],1053:["FL","1","IOLPower"],1054:["FL","1","PredictedRefractiveError"],1059:["FL","1","OphthalmicAxialLengthVelocity"],1065:["LO","1","LensStatusDescription"],1066:["LO","1","VitreousStatusDescription"],1090:["SQ","1","IOLPowerSequence"],1092:["SQ","1","LensConstantSequence"],1093:["LO","1","IOLManufacturer"],1094:["LO","1","LensConstantDescription"],1095:["LO","1","ImplantName"],1096:["SQ","1","KeratometryMeasurementTypeCodeSequence"],1097:["LO","1","ImplantPartNumber"],1100:["SQ","1","ReferencedOphthalmicAxialMeasurementsSequence"],1101:["SQ","1","OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence"],1103:["SQ","1","RefractiveErrorBeforeRefractiveSurgeryCodeSequence"],1121:["FL","1","IOLPowerForExactEmmetropia"],1122:["FL","1","IOLPowerForExactTargetRefraction"],1125:["SQ","1","AnteriorChamberDepthDefinitionCodeSequence"],1127:["SQ","1","LensThicknessSequence"],1128:["SQ","1","AnteriorChamberDepthSequence"],"112A":["SQ","1","CalculationCommentSequence"],"112B":["CS","1","CalculationCommentType"],"112C":["LT","1","CalculationComment"],1130:["FL","1","LensThickness"],1131:["FL","1","AnteriorChamberDepth"],1132:["SQ","1","SourceOfLensThicknessDataCodeSequence"],1133:["SQ","1","SourceOfAnteriorChamberDepthDataCodeSequence"],1134:["SQ","1","SourceOfRefractiveMeasurementsSequence"],1135:["SQ","1","SourceOfRefractiveMeasurementsCodeSequence"],1140:["CS","1","OphthalmicAxialLengthMeasurementModified"],1150:["SQ","1","OphthalmicAxialLengthDataSourceCodeSequence"],1153:["SQ","1","OphthalmicAxialLengthAcquisitionMethodCodeSequence"],1155:["FL","1","SignalToNoiseRatio"],1159:["LO","1","OphthalmicAxialLengthDataSourceDescription"],1210:["SQ","1","OphthalmicAxialLengthMeasurementsTotalLengthSequence"],1211:["SQ","1","OphthalmicAxialLengthMeasurementsSegmentalLengthSequence"],1212:["SQ","1","OphthalmicAxialLengthMeasurementsLengthSummationSequence"],1220:["SQ","1","UltrasoundOphthalmicAxialLengthMeasurementsSequence"],1225:["SQ","1","OpticalOphthalmicAxialLengthMeasurementsSequence"],1230:["SQ","1","UltrasoundSelectedOphthalmicAxialLengthSequence"],1250:["SQ","1","OphthalmicAxialLengthSelectionMethodCodeSequence"],1255:["SQ","1","OpticalSelectedOphthalmicAxialLengthSequence"],1257:["SQ","1","SelectedSegmentalOphthalmicAxialLengthSequence"],1260:["SQ","1","SelectedTotalOphthalmicAxialLengthSequence"],1262:["SQ","1","OphthalmicAxialLengthQualityMetricSequence"],1265:["SQ","1","OphthalmicAxialLengthQualityMetricTypeCodeSequence"],1273:["LO","1","OphthalmicAxialLengthQualityMetricTypeDescription"],1300:["SQ","1","IntraocularLensCalculationsRightEyeSequence"],1310:["SQ","1","IntraocularLensCalculationsLeftEyeSequence"],1330:["SQ","1","ReferencedOphthalmicAxialLengthMeasurementQCImageSequence"],1415:["CS","1","OphthalmicMappingDeviceType"],1420:["SQ","1","AcquisitionMethodCodeSequence"],1423:["SQ","1","AcquisitionMethodAlgorithmSequence"],1436:["SQ","1","OphthalmicThicknessMapTypeCodeSequence"],1443:["SQ","1","OphthalmicThicknessMappingNormalsSequence"],1445:["SQ","1","RetinalThicknessDefinitionCodeSequence"],1450:["SQ","1","PixelValueMappingToCodedConceptSequence"],1452:["xs","1","MappedPixelValue"],1454:["LO","1","PixelValueMappingExplanation"],1458:["SQ","1","OphthalmicThicknessMapQualityThresholdSequence"],1460:["FL","1","OphthalmicThicknessMapThresholdQualityRating"],1463:["FL","2","AnatomicStructureReferencePoint"],1465:["SQ","1","RegistrationToLocalizerSequence"],1466:["CS","1","RegisteredLocalizerUnits"],1467:["FL","2","RegisteredLocalizerTopLeftHandCorner"],1468:["FL","2","RegisteredLocalizerBottomRightHandCorner"],1470:["SQ","1","OphthalmicThicknessMapQualityRatingSequence"],1472:["SQ","1","RelevantOPTAttributesSequence"],1512:["SQ","1","TransformationMethodCodeSequence"],1513:["SQ","1","TransformationAlgorithmSequence"],1515:["CS","1","OphthalmicAxialLengthMethod"],1517:["FL","1","OphthalmicFOV"],1518:["SQ","1","TwoDimensionalToThreeDimensionalMapSequence"],1525:["SQ","1","WideFieldOphthalmicPhotographyQualityRatingSequence"],1526:["SQ","1","WideFieldOphthalmicPhotographyQualityThresholdSequence"],1527:["FL","1","WideFieldOphthalmicPhotographyThresholdQualityRating"],1528:["FL","1","XCoordinatesCenterPixelViewAngle"],1529:["FL","1","YCoordinatesCenterPixelViewAngle"],1530:["UL","1","NumberOfMapPoints"],1531:["OF","1","TwoDimensionalToThreeDimensionalMapData"],1612:["SQ","1","DerivationAlgorithmSequence"],1615:["SQ","1","OphthalmicImageTypeCodeSequence"],1616:["LO","1","OphthalmicImageTypeDescription"],1618:["SQ","1","ScanPatternTypeCodeSequence"],1620:["SQ","1","ReferencedSurfaceMeshIdentificationSequence"],1622:["CS","1","OphthalmicVolumetricPropertiesFlag"],1624:["FL","1","OphthalmicAnatomicReferencePointXCoordinate"],1626:["FL","1","OphthalmicAnatomicReferencePointYCoordinate"],1628:["SQ","1","OphthalmicEnFaceImageQualityRatingSequence"],1630:["DS","1","QualityThreshold"],1640:["SQ","1","OCTBscanAnalysisAcquisitionParametersSequence"],1642:["UL","1","NumberOfBscansPerFrame"],1643:["FL","1","BscanSlabThickness"],1644:["FL","1","DistanceBetweenBscanSlabs"],1645:["FL","1","BscanCycleTime"],1646:["FL","1-n","BscanCycleTimeVector"],1649:["FL","1","AscanRate"],1650:["FL","1","BscanRate"],1658:["UL","1","SurfaceMeshZPixelOffset"]},"0024":{"0000":["UL","1","GenericGroupLength"],"0010":["FL","1","VisualFieldHorizontalExtent"],"0011":["FL","1","VisualFieldVerticalExtent"],"0012":["CS","1","VisualFieldShape"],"0016":["SQ","1","ScreeningTestModeCodeSequence"],"0018":["FL","1","MaximumStimulusLuminance"],"0020":["FL","1","BackgroundLuminance"],"0021":["SQ","1","StimulusColorCodeSequence"],"0024":["SQ","1","BackgroundIlluminationColorCodeSequence"],"0025":["FL","1","StimulusArea"],"0028":["FL","1","StimulusPresentationTime"],"0032":["SQ","1","FixationSequence"],"0033":["SQ","1","FixationMonitoringCodeSequence"],"0034":["SQ","1","VisualFieldCatchTrialSequence"],"0035":["US","1","FixationCheckedQuantity"],"0036":["US","1","PatientNotProperlyFixatedQuantity"],"0037":["CS","1","PresentedVisualStimuliDataFlag"],"0038":["US","1","NumberOfVisualStimuli"],"0039":["CS","1","ExcessiveFixationLossesDataFlag"],"0040":["CS","1","ExcessiveFixationLosses"],"0042":["US","1","StimuliRetestingQuantity"],"0044":["LT","1","CommentsOnPatientPerformanceOfVisualField"],"0045":["CS","1","FalseNegativesEstimateFlag"],"0046":["FL","1","FalseNegativesEstimate"],"0048":["US","1","NegativeCatchTrialsQuantity"],"0050":["US","1","FalseNegativesQuantity"],"0051":["CS","1","ExcessiveFalseNegativesDataFlag"],"0052":["CS","1","ExcessiveFalseNegatives"],"0053":["CS","1","FalsePositivesEstimateFlag"],"0054":["FL","1","FalsePositivesEstimate"],"0055":["CS","1","CatchTrialsDataFlag"],"0056":["US","1","PositiveCatchTrialsQuantity"],"0057":["CS","1","TestPointNormalsDataFlag"],"0058":["SQ","1","TestPointNormalsSequence"],"0059":["CS","1","GlobalDeviationProbabilityNormalsFlag"],"0060":["US","1","FalsePositivesQuantity"],"0061":["CS","1","ExcessiveFalsePositivesDataFlag"],"0062":["CS","1","ExcessiveFalsePositives"],"0063":["CS","1","VisualFieldTestNormalsFlag"],"0064":["SQ","1","ResultsNormalsSequence"],"0065":["SQ","1","AgeCorrectedSensitivityDeviationAlgorithmSequence"],"0066":["FL","1","GlobalDeviationFromNormal"],"0067":["SQ","1","GeneralizedDefectSensitivityDeviationAlgorithmSequence"],"0068":["FL","1","LocalizedDeviationFromNormal"],"0069":["LO","1","PatientReliabilityIndicator"],"0070":["FL","1","VisualFieldMeanSensitivity"],"0071":["FL","1","GlobalDeviationProbability"],"0072":["CS","1","LocalDeviationProbabilityNormalsFlag"],"0073":["FL","1","LocalizedDeviationProbability"],"0074":["CS","1","ShortTermFluctuationCalculated"],"0075":["FL","1","ShortTermFluctuation"],"0076":["CS","1","ShortTermFluctuationProbabilityCalculated"],"0077":["FL","1","ShortTermFluctuationProbability"],"0078":["CS","1","CorrectedLocalizedDeviationFromNormalCalculated"],"0079":["FL","1","CorrectedLocalizedDeviationFromNormal"],"0080":["CS","1","CorrectedLocalizedDeviationFromNormalProbabilityCalculated"],"0081":["FL","1","CorrectedLocalizedDeviationFromNormalProbability"],"0083":["SQ","1","GlobalDeviationProbabilitySequence"],"0085":["SQ","1","LocalizedDeviationProbabilitySequence"],"0086":["CS","1","FovealSensitivityMeasured"],"0087":["FL","1","FovealSensitivity"],"0088":["FL","1","VisualFieldTestDuration"],"0089":["SQ","1","VisualFieldTestPointSequence"],"0090":["FL","1","VisualFieldTestPointXCoordinate"],"0091":["FL","1","VisualFieldTestPointYCoordinate"],"0092":["FL","1","AgeCorrectedSensitivityDeviationValue"],"0093":["CS","1","StimulusResults"],"0094":["FL","1","SensitivityValue"],"0095":["CS","1","RetestStimulusSeen"],"0096":["FL","1","RetestSensitivityValue"],"0097":["SQ","1","VisualFieldTestPointNormalsSequence"],"0098":["FL","1","QuantifiedDefect"],"0100":["FL","1","AgeCorrectedSensitivityDeviationProbabilityValue"],"0102":["CS","1","GeneralizedDefectCorrectedSensitivityDeviationFlag"],"0103":["FL","1","GeneralizedDefectCorrectedSensitivityDeviationValue"],"0104":["FL","1","GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue"],"0105":["FL","1","MinimumSensitivityValue"],"0106":["CS","1","BlindSpotLocalized"],"0107":["FL","1","BlindSpotXCoordinate"],"0108":["FL","1","BlindSpotYCoordinate"],"0110":["SQ","1","VisualAcuityMeasurementSequence"],"0112":["SQ","1","RefractiveParametersUsedOnPatientSequence"],"0113":["CS","1","MeasurementLaterality"],"0114":["SQ","1","OphthalmicPatientClinicalInformationLeftEyeSequence"],"0115":["SQ","1","OphthalmicPatientClinicalInformationRightEyeSequence"],"0117":["CS","1","FovealPointNormativeDataFlag"],"0118":["FL","1","FovealPointProbabilityValue"],"0120":["CS","1","ScreeningBaselineMeasured"],"0122":["SQ","1","ScreeningBaselineMeasuredSequence"],"0124":["CS","1","ScreeningBaselineType"],"0126":["FL","1","ScreeningBaselineValue"],"0202":["LO","1","AlgorithmSource"],"0306":["LO","1","DataSetName"],"0307":["LO","1","DataSetVersion"],"0308":["LO","1","DataSetSource"],"0309":["LO","1","DataSetDescription"],"0317":["SQ","1","VisualFieldTestReliabilityGlobalIndexSequence"],"0320":["SQ","1","VisualFieldGlobalResultsIndexSequence"],"0325":["SQ","1","DataObservationSequence"],"0338":["CS","1","IndexNormalsFlag"],"0341":["FL","1","IndexProbability"],"0344":["SQ","1","IndexProbabilitySequence"]},"0028":{"0000":["UL","1","GenericGroupLength"],"0002":["US","1","SamplesPerPixel"],"0003":["US","1","SamplesPerPixelUsed"],"0004":["CS","1","PhotometricInterpretation"],"0005":["US","1","ImageDimensions"],"0006":["US","1","PlanarConfiguration"],"0008":["IS","1","NumberOfFrames"],"0009":["AT","1-n","FrameIncrementPointer"],"000A":["AT","1-n","FrameDimensionPointer"],"0010":["US","1","Rows"],"0011":["US","1","Columns"],"0012":["US","1","Planes"],"0014":["US","1","UltrasoundColorDataPresent"],"0020":["","",""],"0030":["DS","2","PixelSpacing"],"0031":["DS","2","ZoomFactor"],"0032":["DS","2","ZoomCenter"],"0034":["IS","2","PixelAspectRatio"],"0040":["CS","1","ImageFormat"],"0050":["LO","1-n","ManipulatedImage"],"0051":["CS","1-n","CorrectedImage"],"005F":["LO","1","CompressionRecognitionCode"],"0060":["CS","1","CompressionCode"],"0061":["SH","1","CompressionOriginator"],"0062":["LO","1","CompressionLabel"],"0063":["SH","1","CompressionDescription"],"0065":["CS","1-n","CompressionSequence"],"0066":["AT","1-n","CompressionStepPointers"],"0068":["US","1","RepeatInterval"],"0069":["US","1","BitsGrouped"],"0070":["US","1-n","PerimeterTable"],"0071":["xs","1","PerimeterValue"],"0080":["US","1","PredictorRows"],"0081":["US","1","PredictorColumns"],"0082":["US","1-n","PredictorConstants"],"0090":["CS","1","BlockedPixels"],"0091":["US","1","BlockRows"],"0092":["US","1","BlockColumns"],"0093":["US","1","RowOverlap"],"0094":["US","1","ColumnOverlap"],"0100":["US","1","BitsAllocated"],"0101":["US","1","BitsStored"],"0102":["US","1","HighBit"],"0103":["US","1","PixelRepresentation"],"0104":["xs","1","SmallestValidPixelValue"],"0105":["xs","1","LargestValidPixelValue"],"0106":["xs","1","SmallestImagePixelValue"],"0107":["xs","1","LargestImagePixelValue"],"0108":["xs","1","SmallestPixelValueInSeries"],"0109":["xs","1","LargestPixelValueInSeries"],"0110":["xs","1","SmallestImagePixelValueInPlane"],"0111":["xs","1","LargestImagePixelValueInPlane"],"0120":["xs","1","PixelPaddingValue"],"0121":["xs","1","PixelPaddingRangeLimit"],"0122":["FL","1","FloatPixelPaddingValue"],"0123":["FD","1","DoubleFloatPixelPaddingValue"],"0124":["FL","1","FloatPixelPaddingRangeLimit"],"0125":["FD","1","DoubleFloatPixelPaddingRangeLimit"],"0200":["US","1","ImageLocation"],"0300":["CS","1","QualityControlImage"],"0301":["CS","1","BurnedInAnnotation"],"0302":["CS","1","RecognizableVisualFeatures"],"0303":["CS","1","LongitudinalTemporalInformationModified"],"0304":["UI","1","ReferencedColorPaletteInstanceUID"],"0400":["LO","1","TransformLabel"],"0401":["LO","1","TransformVersionNumber"],"0402":["US","1","NumberOfTransformSteps"],"0403":["LO","1-n","SequenceOfCompressedData"],"0404":["AT","1-n","DetailsOfCoefficients"],"04x0":["US","1","RowsForNthOrderCoefficients"],"04x1":["US","1","ColumnsForNthOrderCoefficients"],"04x2":["LO","1-n","CoefficientCoding"],"04x3":["AT","1-n","CoefficientCodingPointers"],"0700":["LO","1","DCTLabel"],"0701":["CS","1-n","DataBlockDescription"],"0702":["AT","1-n","DataBlock"],"0710":["US","1","NormalizationFactorFormat"],"0720":["US","1","ZonalMapNumberFormat"],"0721":["AT","1-n","ZonalMapLocation"],"0722":["US","1","ZonalMapFormat"],"0730":["US","1","AdaptiveMapFormat"],"0740":["US","1","CodeNumberFormat"],"08x0":["CS","1-n","CodeLabel"],"08x2":["US","1","NumberOfTables"],"08x3":["AT","1-n","CodeTableLocation"],"08x4":["US","1","BitsForCodeWord"],"08x8":["AT","1-n","ImageDataLocation"],"0A02":["CS","1","PixelSpacingCalibrationType"],"0A04":["LO","1","PixelSpacingCalibrationDescription"],1040:["CS","1","PixelIntensityRelationship"],1041:["SS","1","PixelIntensityRelationshipSign"],1050:["DS","1-n","WindowCenter"],1051:["DS","1-n","WindowWidth"],1052:["DS","1","RescaleIntercept"],1053:["DS","1","RescaleSlope"],1054:["LO","1","RescaleType"],1055:["LO","1-n","WindowCenterWidthExplanation"],1056:["CS","1","VOILUTFunction"],1080:["CS","1","GrayScale"],1090:["CS","1","RecommendedViewingMode"],1100:["xs","3","GrayLookupTableDescriptor"],1101:["xs","3","RedPaletteColorLookupTableDescriptor"],1102:["xs","3","GreenPaletteColorLookupTableDescriptor"],1103:["xs","3","BluePaletteColorLookupTableDescriptor"],1104:["US","3","AlphaPaletteColorLookupTableDescriptor"],1111:["xs","4","LargeRedPaletteColorLookupTableDescriptor"],1112:["xs","4","LargeGreenPaletteColorLookupTableDescriptor"],1113:["xs","4","LargeBluePaletteColorLookupTableDescriptor"],1199:["UI","1","PaletteColorLookupTableUID"],1200:["xs","1-n or 1","GrayLookupTableData"],1201:["OW","1","RedPaletteColorLookupTableData"],1202:["OW","1","GreenPaletteColorLookupTableData"],1203:["OW","1","BluePaletteColorLookupTableData"],1204:["OW","1","AlphaPaletteColorLookupTableData"],1211:["OW","1","LargeRedPaletteColorLookupTableData"],1212:["OW","1","LargeGreenPaletteColorLookupTableData"],1213:["OW","1","LargeBluePaletteColorLookupTableData"],1214:["UI","1","LargePaletteColorLookupTableUID"],1221:["OW","1","SegmentedRedPaletteColorLookupTableData"],1222:["OW","1","SegmentedGreenPaletteColorLookupTableData"],1223:["OW","1","SegmentedBluePaletteColorLookupTableData"],1224:["OW","1","SegmentedAlphaPaletteColorLookupTableData"],1230:["SQ","1","StoredValueColorRangeSequence"],1231:["FD","1","MinimumStoredValueMapped"],1232:["FD","1","MaximumStoredValueMapped"],1300:["CS","1","BreastImplantPresent"],1350:["CS","1","PartialView"],1351:["ST","1","PartialViewDescription"],1352:["SQ","1","PartialViewCodeSequence"],"135A":["CS","1","SpatialLocationsPreserved"],1401:["SQ","1","DataFrameAssignmentSequence"],1402:["CS","1","DataPathAssignment"],1403:["US","1","BitsMappedToColorLookupTable"],1404:["SQ","1","BlendingLUT1Sequence"],1405:["CS","1","BlendingLUT1TransferFunction"],1406:["FD","1","BlendingWeightConstant"],1407:["US","3","BlendingLookupTableDescriptor"],1408:["OW","1","BlendingLookupTableData"],"140B":["SQ","1","EnhancedPaletteColorLookupTableSequence"],"140C":["SQ","1","BlendingLUT2Sequence"],"140D":["CS","1","BlendingLUT2TransferFunction"],"140E":["CS","1","DataPathID"],"140F":["CS","1","RGBLUTTransferFunction"],1410:["CS","1","AlphaLUTTransferFunction"],2e3:["OB","1","ICCProfile"],2002:["CS","1","ColorSpace"],2110:["CS","1","LossyImageCompression"],2112:["DS","1-n","LossyImageCompressionRatio"],2114:["CS","1-n","LossyImageCompressionMethod"],3e3:["SQ","1","ModalityLUTSequence"],3002:["xs","3","LUTDescriptor"],3003:["LO","1","LUTExplanation"],3004:["LO","1","ModalityLUTType"],3006:["xx","1-n or 1","LUTData"],3010:["SQ","1","VOILUTSequence"],3110:["SQ","1","SoftcopyVOILUTSequence"],4e3:["LT","1","ImagePresentationComments"],5e3:["SQ","1","BiPlaneAcquisitionSequence"],6010:["US","1","RepresentativeFrameNumber"],6020:["US","1-n","FrameNumbersOfInterest"],6022:["LO","1-n","FrameOfInterestDescription"],6023:["CS","1-n","FrameOfInterestType"],6030:["US","1-n","MaskPointers"],6040:["US","1-n","RWavePointer"],6100:["SQ","1","MaskSubtractionSequence"],6101:["CS","1","MaskOperation"],6102:["US","2-2n","ApplicableFrameRange"],6110:["US","1-n","MaskFrameNumbers"],6112:["US","1","ContrastFrameAveraging"],6114:["FL","2","MaskSubPixelShift"],6120:["SS","1","TIDOffset"],6190:["ST","1","MaskOperationExplanation"],7e3:["SQ","1","EquipmentAdministratorSequence"],7001:["US","1","NumberOfDisplaySubsystems"],7002:["US","1","CurrentConfigurationID"],7003:["US","1","DisplaySubsystemID"],7004:["SH","1","DisplaySubsystemName"],7005:["LO","1","DisplaySubsystemDescription"],7006:["CS","1","SystemStatus"],7007:["LO","1","SystemStatusComment"],7008:["SQ","1","TargetLuminanceCharacteristicsSequence"],7009:["US","1","LuminanceCharacteristicsID"],"700A":["SQ","1","DisplaySubsystemConfigurationSequence"],"700B":["US","1","ConfigurationID"],"700C":["SH","1","ConfigurationName"],"700D":["LO","1","ConfigurationDescription"],"700E":["US","1","ReferencedTargetLuminanceCharacteristicsID"],"700F":["SQ","1","QAResultsSequence"],7010:["SQ","1","DisplaySubsystemQAResultsSequence"],7011:["SQ","1","ConfigurationQAResultsSequence"],7012:["SQ","1","MeasurementEquipmentSequence"],7013:["CS","1-n","MeasurementFunctions"],7014:["CS","1","MeasurementEquipmentType"],7015:["SQ","1","VisualEvaluationResultSequence"],7016:["SQ","1","DisplayCalibrationResultSequence"],7017:["US","1","DDLValue"],7018:["FL","2","CIExyWhitePoint"],7019:["CS","1","DisplayFunctionType"],"701A":["FL","1","GammaValue"],"701B":["US","1","NumberOfLuminancePoints"],"701C":["SQ","1","LuminanceResponseSequence"],"701D":["FL","1","TargetMinimumLuminance"],"701E":["FL","1","TargetMaximumLuminance"],"701F":["FL","1","LuminanceValue"],7020:["LO","1","LuminanceResponseDescription"],7021:["CS","1","WhitePointFlag"],7022:["SQ","1","DisplayDeviceTypeCodeSequence"],7023:["SQ","1","DisplaySubsystemSequence"],7024:["SQ","1","LuminanceResultSequence"],7025:["CS","1","AmbientLightValueSource"],7026:["CS","1-n","MeasuredCharacteristics"],7027:["SQ","1","LuminanceUniformityResultSequence"],7028:["SQ","1","VisualEvaluationTestSequence"],7029:["CS","1","TestResult"],"702A":["LO","1","TestResultComment"],"702B":["CS","1","TestImageValidation"],"702C":["SQ","1","TestPatternCodeSequence"],"702D":["SQ","1","MeasurementPatternCodeSequence"],"702E":["SQ","1","VisualEvaluationMethodCodeSequence"],"7FE0":["UR","1","PixelDataProviderURL"],9001:["UL","1","DataPointRows"],9002:["UL","1","DataPointColumns"],9003:["CS","1","SignalDomainColumns"],9099:["US","1","LargestMonochromePixelValue"],9108:["CS","1","DataRepresentation"],9110:["SQ","1","PixelMeasuresSequence"],9132:["SQ","1","FrameVOILUTSequence"],9145:["SQ","1","PixelValueTransformationSequence"],9235:["CS","1","SignalDomainRows"],9411:["FL","1","DisplayFilterPercentage"],9415:["SQ","1","FramePixelShiftSequence"],9416:["US","1","SubtractionItemID"],9422:["SQ","1","PixelIntensityRelationshipLUTSequence"],9443:["SQ","1","FramePixelDataPropertiesSequence"],9444:["CS","1","GeometricalProperties"],9445:["FL","1","GeometricMaximumDistortion"],9446:["CS","1-n","ImageProcessingApplied"],9454:["CS","1","MaskSelectionMode"],9474:["CS","1","LUTFunction"],9478:["FL","1","MaskVisibilityPercentage"],9501:["SQ","1","PixelShiftSequence"],9502:["SQ","1","RegionPixelShiftSequence"],9503:["SS","2-2n","VerticesOfTheRegion"],9505:["SQ","1","MultiFramePresentationSequence"],9506:["US","2-2n","PixelShiftFrameRange"],9507:["US","2-2n","LUTFrameRange"],9520:["DS","16","ImageToEquipmentMappingMatrix"],9537:["CS","1","EquipmentCoordinateSystemIdentification"]},"0032":{"0000":["UL","1","GenericGroupLength"],"000A":["CS","1","StudyStatusID"],"000C":["CS","1","StudyPriorityID"],"0012":["LO","1","StudyIDIssuer"],"0032":["DA","1","StudyVerifiedDate"],"0033":["TM","1","StudyVerifiedTime"],"0034":["DA","1","StudyReadDate"],"0035":["TM","1","StudyReadTime"],1e3:["DA","1","ScheduledStudyStartDate"],1001:["TM","1","ScheduledStudyStartTime"],1010:["DA","1","ScheduledStudyStopDate"],1011:["TM","1","ScheduledStudyStopTime"],1020:["LO","1","ScheduledStudyLocation"],1021:["AE","1-n","ScheduledStudyLocationAETitle"],1030:["LO","1","ReasonForStudy"],1031:["SQ","1","RequestingPhysicianIdentificationSequence"],1032:["PN","1","RequestingPhysician"],1033:["LO","1","RequestingService"],1034:["SQ","1","RequestingServiceCodeSequence"],1040:["DA","1","StudyArrivalDate"],1041:["TM","1","StudyArrivalTime"],1050:["DA","1","StudyCompletionDate"],1051:["TM","1","StudyCompletionTime"],1055:["CS","1","StudyComponentStatusID"],1060:["LO","1","RequestedProcedureDescription"],1064:["SQ","1","RequestedProcedureCodeSequence"],1065:["SQ","1","RequestedLateralityCodeSequence"],1066:["UT","1","ReasonForVisit"],1067:["SQ","1","ReasonForVisitCodeSequence"],1070:["LO","1","RequestedContrastAgent"],4e3:["LT","1","StudyComments"]},"0034":{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","FlowIdentifierSequence"],"0002":["OB","1","FlowIdentifier"],"0003":["UI","1","FlowTransferSyntaxUID"],"0004":["UL","1","FlowRTPSamplingRate"],"0005":["OB","1","SourceIdentifier"],"0007":["OB","1","FrameOriginTimestamp"],"0008":["CS","1","IncludesImagingSubject"],"0009":["SQ","1","FrameUsefulnessGroupSequence"],"000A":["SQ","1","RealTimeBulkDataFlowSequence"],"000B":["SQ","1","CameraPositionGroupSequence"],"000C":["CS","1","IncludesInformation"],"000D":["SQ","1","TimeOfFrameGroupSequence"]},"0038":{"0000":["UL","1","GenericGroupLength"],"0004":["SQ","1","ReferencedPatientAliasSequence"],"0008":["CS","1","VisitStatusID"],"0010":["LO","1","AdmissionID"],"0011":["LO","1","IssuerOfAdmissionID"],"0014":["SQ","1","IssuerOfAdmissionIDSequence"],"0016":["LO","1","RouteOfAdmissions"],"001A":["DA","1","ScheduledAdmissionDate"],"001B":["TM","1","ScheduledAdmissionTime"],"001C":["DA","1","ScheduledDischargeDate"],"001D":["TM","1","ScheduledDischargeTime"],"001E":["LO","1","ScheduledPatientInstitutionResidence"],"0020":["DA","1","AdmittingDate"],"0021":["TM","1","AdmittingTime"],"0030":["DA","1","DischargeDate"],"0032":["TM","1","DischargeTime"],"0040":["LO","1","DischargeDiagnosisDescription"],"0044":["SQ","1","DischargeDiagnosisCodeSequence"],"0050":["LO","1","SpecialNeeds"],"0060":["LO","1","ServiceEpisodeID"],"0061":["LO","1","IssuerOfServiceEpisodeID"],"0062":["LO","1","ServiceEpisodeDescription"],"0064":["SQ","1","IssuerOfServiceEpisodeIDSequence"],"0100":["SQ","1","PertinentDocumentsSequence"],"0101":["SQ","1","PertinentResourcesSequence"],"0102":["LO","1","ResourceDescription"],"0300":["LO","1","CurrentPatientLocation"],"0400":["LO","1","PatientInstitutionResidence"],"0500":["LO","1","PatientState"],"0502":["SQ","1","PatientClinicalTrialParticipationSequence"],4e3:["LT","1","VisitComments"]},"003A":{"0000":["UL","1","GenericGroupLength"],"0004":["CS","1","WaveformOriginality"],"0005":["US","1","NumberOfWaveformChannels"],"0010":["UL","1","NumberOfWaveformSamples"],"001A":["DS","1","SamplingFrequency"],"0020":["SH","1","MultiplexGroupLabel"],"0200":["SQ","1","ChannelDefinitionSequence"],"0202":["IS","1","WaveformChannelNumber"],"0203":["SH","1","ChannelLabel"],"0205":["CS","1-n","ChannelStatus"],"0208":["SQ","1","ChannelSourceSequence"],"0209":["SQ","1","ChannelSourceModifiersSequence"],"020A":["SQ","1","SourceWaveformSequence"],"020C":["LO","1","ChannelDerivationDescription"],"0210":["DS","1","ChannelSensitivity"],"0211":["SQ","1","ChannelSensitivityUnitsSequence"],"0212":["DS","1","ChannelSensitivityCorrectionFactor"],"0213":["DS","1","ChannelBaseline"],"0214":["DS","1","ChannelTimeSkew"],"0215":["DS","1","ChannelSampleSkew"],"0218":["DS","1","ChannelOffset"],"021A":["US","1","WaveformBitsStored"],"0220":["DS","1","FilterLowFrequency"],"0221":["DS","1","FilterHighFrequency"],"0222":["DS","1","NotchFilterFrequency"],"0223":["DS","1","NotchFilterBandwidth"],"0230":["FL","1","WaveformDataDisplayScale"],"0231":["US","3","WaveformDisplayBackgroundCIELabValue"],"0240":["SQ","1","WaveformPresentationGroupSequence"],"0241":["US","1","PresentationGroupNumber"],"0242":["SQ","1","ChannelDisplaySequence"],"0244":["US","3","ChannelRecommendedDisplayCIELabValue"],"0245":["FL","1","ChannelPosition"],"0246":["CS","1","DisplayShadingFlag"],"0247":["FL","1","FractionalChannelDisplayScale"],"0248":["FL","1","AbsoluteChannelDisplayScale"],"0300":["SQ","1","MultiplexedAudioChannelsDescriptionCodeSequence"],"0301":["IS","1","ChannelIdentificationCode"],"0302":["CS","1","ChannelMode"],"0310":["UI","1","MultiplexGroupUID"],"0311":["DS","1","PowerlineFrequency"],"0312":["SQ","1","ChannelImpedanceSequence"],"0313":["DS","1","ImpedanceValue"],"0314":["DT","1","ImpedanceMeasurementDateTime"],"0315":["DS","1","ImpedanceMeasurementFrequency"],"0316":["CS","1","ImpedanceMeasurementCurrentType"]},"0040":{"0000":["UL","1","GenericGroupLength"],"0001":["AE","1-n","ScheduledStationAETitle"],"0002":["DA","1","ScheduledProcedureStepStartDate"],"0003":["TM","1","ScheduledProcedureStepStartTime"],"0004":["DA","1","ScheduledProcedureStepEndDate"],"0005":["TM","1","ScheduledProcedureStepEndTime"],"0006":["PN","1","ScheduledPerformingPhysicianName"],"0007":["LO","1","ScheduledProcedureStepDescription"],"0008":["SQ","1","ScheduledProtocolCodeSequence"],"0009":["SH","1","ScheduledProcedureStepID"],"000A":["SQ","1","StageCodeSequence"],"000B":["SQ","1","ScheduledPerformingPhysicianIdentificationSequence"],"0010":["SH","1-n","ScheduledStationName"],"0011":["SH","1","ScheduledProcedureStepLocation"],"0012":["LO","1","PreMedication"],"0020":["CS","1","ScheduledProcedureStepStatus"],"0026":["SQ","1","OrderPlacerIdentifierSequence"],"0027":["SQ","1","OrderFillerIdentifierSequence"],"0031":["UT","1","LocalNamespaceEntityID"],"0032":["UT","1","UniversalEntityID"],"0033":["CS","1","UniversalEntityIDType"],"0035":["CS","1","IdentifierTypeCode"],"0036":["SQ","1","AssigningFacilitySequence"],"0039":["SQ","1","AssigningJurisdictionCodeSequence"],"003A":["SQ","1","AssigningAgencyOrDepartmentCodeSequence"],"0100":["SQ","1","ScheduledProcedureStepSequence"],"0220":["SQ","1","ReferencedNonImageCompositeSOPInstanceSequence"],"0241":["AE","1","PerformedStationAETitle"],"0242":["SH","1","PerformedStationName"],"0243":["SH","1","PerformedLocation"],"0244":["DA","1","PerformedProcedureStepStartDate"],"0245":["TM","1","PerformedProcedureStepStartTime"],"0250":["DA","1","PerformedProcedureStepEndDate"],"0251":["TM","1","PerformedProcedureStepEndTime"],"0252":["CS","1","PerformedProcedureStepStatus"],"0253":["SH","1","PerformedProcedureStepID"],"0254":["LO","1","PerformedProcedureStepDescription"],"0255":["LO","1","PerformedProcedureTypeDescription"],"0260":["SQ","1","PerformedProtocolCodeSequence"],"0261":["CS","1","PerformedProtocolType"],"0270":["SQ","1","ScheduledStepAttributesSequence"],"0275":["SQ","1","RequestAttributesSequence"],"0280":["ST","1","CommentsOnThePerformedProcedureStep"],"0281":["SQ","1","PerformedProcedureStepDiscontinuationReasonCodeSequence"],"0293":["SQ","1","QuantitySequence"],"0294":["DS","1","Quantity"],"0295":["SQ","1","MeasuringUnitsSequence"],"0296":["SQ","1","BillingItemSequence"],"0300":["US","1","TotalTimeOfFluoroscopy"],"0301":["US","1","TotalNumberOfExposures"],"0302":["US","1","EntranceDose"],"0303":["US","1-2","ExposedArea"],"0306":["DS","1","DistanceSourceToEntrance"],"0307":["DS","1","DistanceSourceToSupport"],"030E":["SQ","1","ExposureDoseSequence"],"0310":["ST","1","CommentsOnRadiationDose"],"0312":["DS","1","XRayOutput"],"0314":["DS","1","HalfValueLayer"],"0316":["DS","1","OrganDose"],"0318":["CS","1","OrganExposed"],"0320":["SQ","1","BillingProcedureStepSequence"],"0321":["SQ","1","FilmConsumptionSequence"],"0324":["SQ","1","BillingSuppliesAndDevicesSequence"],"0330":["SQ","1","ReferencedProcedureStepSequence"],"0340":["SQ","1","PerformedSeriesSequence"],"0400":["LT","1","CommentsOnTheScheduledProcedureStep"],"0440":["SQ","1","ProtocolContextSequence"],"0441":["SQ","1","ContentItemModifierSequence"],"0500":["SQ","1","ScheduledSpecimenSequence"],"050A":["LO","1","SpecimenAccessionNumber"],"0512":["LO","1","ContainerIdentifier"],"0513":["SQ","1","IssuerOfTheContainerIdentifierSequence"],"0515":["SQ","1","AlternateContainerIdentifierSequence"],"0518":["SQ","1","ContainerTypeCodeSequence"],"051A":["LO","1","ContainerDescription"],"0520":["SQ","1","ContainerComponentSequence"],"0550":["SQ","1","SpecimenSequence"],"0551":["LO","1","SpecimenIdentifier"],"0552":["SQ","1","SpecimenDescriptionSequenceTrial"],"0553":["ST","1","SpecimenDescriptionTrial"],"0554":["UI","1","SpecimenUID"],"0555":["SQ","1","AcquisitionContextSequence"],"0556":["ST","1","AcquisitionContextDescription"],"0560":["SQ","1","SpecimenDescriptionSequence"],"0562":["SQ","1","IssuerOfTheSpecimenIdentifierSequence"],"059A":["SQ","1","SpecimenTypeCodeSequence"],"0600":["LO","1","SpecimenShortDescription"],"0602":["UT","1","SpecimenDetailedDescription"],"0610":["SQ","1","SpecimenPreparationSequence"],"0612":["SQ","1","SpecimenPreparationStepContentItemSequence"],"0620":["SQ","1","SpecimenLocalizationContentItemSequence"],"06FA":["LO","1","SlideIdentifier"],"0710":["SQ","1","WholeSlideMicroscopyImageFrameTypeSequence"],"071A":["SQ","1","ImageCenterPointCoordinatesSequence"],"072A":["DS","1","XOffsetInSlideCoordinateSystem"],"073A":["DS","1","YOffsetInSlideCoordinateSystem"],"074A":["DS","1","ZOffsetInSlideCoordinateSystem"],"08D8":["SQ","1","PixelSpacingSequence"],"08DA":["SQ","1","CoordinateSystemAxisCodeSequence"],"08EA":["SQ","1","MeasurementUnitsCodeSequence"],"09F8":["SQ","1","VitalStainCodeSequenceTrial"],1001:["SH","1","RequestedProcedureID"],1002:["LO","1","ReasonForTheRequestedProcedure"],1003:["SH","1","RequestedProcedurePriority"],1004:["LO","1","PatientTransportArrangements"],1005:["LO","1","RequestedProcedureLocation"],1006:["SH","1","PlacerOrderNumberProcedure"],1007:["SH","1","FillerOrderNumberProcedure"],1008:["LO","1","ConfidentialityCode"],1009:["SH","1","ReportingPriority"],"100A":["SQ","1","ReasonForRequestedProcedureCodeSequence"],1010:["PN","1-n","NamesOfIntendedRecipientsOfResults"],1011:["SQ","1","IntendedRecipientsOfResultsIdentificationSequence"],1012:["SQ","1","ReasonForPerformedProcedureCodeSequence"],1060:["LO","1","RequestedProcedureDescriptionTrial"],1101:["SQ","1","PersonIdentificationCodeSequence"],1102:["ST","1","PersonAddress"],1103:["LO","1-n","PersonTelephoneNumbers"],1104:["LT","1","PersonTelecomInformation"],1400:["LT","1","RequestedProcedureComments"],2001:["LO","1","ReasonForTheImagingServiceRequest"],2004:["DA","1","IssueDateOfImagingServiceRequest"],2005:["TM","1","IssueTimeOfImagingServiceRequest"],2006:["SH","1","PlacerOrderNumberImagingServiceRequestRetired"],2007:["SH","1","FillerOrderNumberImagingServiceRequestRetired"],2008:["PN","1","OrderEnteredBy"],2009:["SH","1","OrderEntererLocation"],2010:["SH","1","OrderCallbackPhoneNumber"],2011:["LT","1","OrderCallbackTelecomInformation"],2016:["LO","1","PlacerOrderNumberImagingServiceRequest"],2017:["LO","1","FillerOrderNumberImagingServiceRequest"],2400:["LT","1","ImagingServiceRequestComments"],3001:["LO","1","ConfidentialityConstraintOnPatientDataDescription"],4001:["CS","1","GeneralPurposeScheduledProcedureStepStatus"],4002:["CS","1","GeneralPurposePerformedProcedureStepStatus"],4003:["CS","1","GeneralPurposeScheduledProcedureStepPriority"],4004:["SQ","1","ScheduledProcessingApplicationsCodeSequence"],4005:["DT","1","ScheduledProcedureStepStartDateTime"],4006:["CS","1","MultipleCopiesFlag"],4007:["SQ","1","PerformedProcessingApplicationsCodeSequence"],4008:["DT","1","ScheduledProcedureStepExpirationDateTime"],4009:["SQ","1","HumanPerformerCodeSequence"],4010:["DT","1","ScheduledProcedureStepModificationDateTime"],4011:["DT","1","ExpectedCompletionDateTime"],4015:["SQ","1","ResultingGeneralPurposePerformedProcedureStepsSequence"],4016:["SQ","1","ReferencedGeneralPurposeScheduledProcedureStepSequence"],4018:["SQ","1","ScheduledWorkitemCodeSequence"],4019:["SQ","1","PerformedWorkitemCodeSequence"],4020:["CS","1","InputAvailabilityFlag"],4021:["SQ","1","InputInformationSequence"],4022:["SQ","1","RelevantInformationSequence"],4023:["UI","1","ReferencedGeneralPurposeScheduledProcedureStepTransactionUID"],4025:["SQ","1","ScheduledStationNameCodeSequence"],4026:["SQ","1","ScheduledStationClassCodeSequence"],4027:["SQ","1","ScheduledStationGeographicLocationCodeSequence"],4028:["SQ","1","PerformedStationNameCodeSequence"],4029:["SQ","1","PerformedStationClassCodeSequence"],4030:["SQ","1","PerformedStationGeographicLocationCodeSequence"],4031:["SQ","1","RequestedSubsequentWorkitemCodeSequence"],4032:["SQ","1","NonDICOMOutputCodeSequence"],4033:["SQ","1","OutputInformationSequence"],4034:["SQ","1","ScheduledHumanPerformersSequence"],4035:["SQ","1","ActualHumanPerformersSequence"],4036:["LO","1","HumanPerformerOrganization"],4037:["PN","1","HumanPerformerName"],4040:["CS","1","RawDataHandling"],4041:["CS","1","InputReadinessState"],4050:["DT","1","PerformedProcedureStepStartDateTime"],4051:["DT","1","PerformedProcedureStepEndDateTime"],4052:["DT","1","ProcedureStepCancellationDateTime"],4070:["SQ","1","OutputDestinationSequence"],4071:["SQ","1","DICOMStorageSequence"],4072:["SQ","1","STOWRSStorageSequence"],4073:["UR","1","StorageURL"],4074:["SQ","1","XDSStorageSequence"],8302:["DS","1","EntranceDoseInmGy"],8303:["CS","1","EntranceDoseDerivation"],9092:["SQ","1","ParametricMapFrameTypeSequence"],9094:["SQ","1","ReferencedImageRealWorldValueMappingSequence"],9096:["SQ","1","RealWorldValueMappingSequence"],9098:["SQ","1","PixelValueMappingCodeSequence"],9210:["SH","1","LUTLabel"],9211:["xs","1","RealWorldValueLastValueMapped"],9212:["FD","1-n","RealWorldValueLUTData"],9213:["FD","1","DoubleFloatRealWorldValueLastValueMapped"],9214:["FD","1","DoubleFloatRealWorldValueFirstValueMapped"],9216:["xs","1","RealWorldValueFirstValueMapped"],9220:["SQ","1","QuantityDefinitionSequence"],9224:["FD","1","RealWorldValueIntercept"],9225:["FD","1","RealWorldValueSlope"],A007:["CS","1","FindingsFlagTrial"],A010:["CS","1","RelationshipType"],A020:["SQ","1","FindingsSequenceTrial"],A021:["UI","1","FindingsGroupUIDTrial"],A022:["UI","1","ReferencedFindingsGroupUIDTrial"],A023:["DA","1","FindingsGroupRecordingDateTrial"],A024:["TM","1","FindingsGroupRecordingTimeTrial"],A026:["SQ","1","FindingsSourceCategoryCodeSequenceTrial"],A027:["LO","1","VerifyingOrganization"],A028:["SQ","1","DocumentingOrganizationIdentifierCodeSequenceTrial"],A030:["DT","1","VerificationDateTime"],A032:["DT","1","ObservationDateTime"],A033:["DT","1","ObservationStartDateTime"],A040:["CS","1","ValueType"],A043:["SQ","1","ConceptNameCodeSequence"],A047:["LO","1","MeasurementPrecisionDescriptionTrial"],A050:["CS","1","ContinuityOfContent"],A057:["CS","1-n","UrgencyOrPriorityAlertsTrial"],A060:["LO","1","SequencingIndicatorTrial"],A066:["SQ","1","DocumentIdentifierCodeSequenceTrial"],A067:["PN","1","DocumentAuthorTrial"],A068:["SQ","1","DocumentAuthorIdentifierCodeSequenceTrial"],A070:["SQ","1","IdentifierCodeSequenceTrial"],A073:["SQ","1","VerifyingObserverSequence"],A074:["OB","1","ObjectBinaryIdentifierTrial"],A075:["PN","1","VerifyingObserverName"],A076:["SQ","1","DocumentingObserverIdentifierCodeSequenceTrial"],A078:["SQ","1","AuthorObserverSequence"],A07A:["SQ","1","ParticipantSequence"],A07C:["SQ","1","CustodialOrganizationSequence"],A080:["CS","1","ParticipationType"],A082:["DT","1","ParticipationDateTime"],A084:["CS","1","ObserverType"],A085:["SQ","1","ProcedureIdentifierCodeSequenceTrial"],A088:["SQ","1","VerifyingObserverIdentificationCodeSequence"],A089:["OB","1","ObjectDirectoryBinaryIdentifierTrial"],A090:["SQ","1","EquivalentCDADocumentSequence"],A0B0:["US","2-2n","ReferencedWaveformChannels"],A110:["DA","1","DateOfDocumentOrVerbalTransactionTrial"],A112:["TM","1","TimeOfDocumentCreationOrVerbalTransactionTrial"],A120:["DT","1","DateTime"],A121:["DA","1","Date"],A122:["TM","1","Time"],A123:["PN","1","PersonName"],A124:["UI","1","UID"],A125:["CS","2","ReportStatusIDTrial"],A130:["CS","1","TemporalRangeType"],A132:["UL","1-n","ReferencedSamplePositions"],A136:["US","1-n","ReferencedFrameNumbers"],A138:["DS","1-n","ReferencedTimeOffsets"],A13A:["DT","1-n","ReferencedDateTime"],A160:["UT","1","TextValue"],A161:["FD","1-n","FloatingPointValue"],A162:["SL","1-n","RationalNumeratorValue"],A163:["UL","1-n","RationalDenominatorValue"],A167:["SQ","1","ObservationCategoryCodeSequenceTrial"],A168:["SQ","1","ConceptCodeSequence"],A16A:["ST","1","BibliographicCitationTrial"],A170:["SQ","1","PurposeOfReferenceCodeSequence"],A171:["UI","1","ObservationUID"],A172:["UI","1","ReferencedObservationUIDTrial"],A173:["CS","1","ReferencedObservationClassTrial"],A174:["CS","1","ReferencedObjectObservationClassTrial"],A180:["US","1","AnnotationGroupNumber"],A192:["DA","1","ObservationDateTrial"],A193:["TM","1","ObservationTimeTrial"],A194:["CS","1","MeasurementAutomationTrial"],A195:["SQ","1","ModifierCodeSequence"],A224:["ST","1","IdentificationDescriptionTrial"],A290:["CS","1","CoordinatesSetGeometricTypeTrial"],A296:["SQ","1","AlgorithmCodeSequenceTrial"],A297:["ST","1","AlgorithmDescriptionTrial"],A29A:["SL","2-2n","PixelCoordinatesSetTrial"],A300:["SQ","1","MeasuredValueSequence"],A301:["SQ","1","NumericValueQualifierCodeSequence"],A307:["PN","1","CurrentObserverTrial"],A30A:["DS","1-n","NumericValue"],A313:["SQ","1","ReferencedAccessionSequenceTrial"],A33A:["ST","1","ReportStatusCommentTrial"],A340:["SQ","1","ProcedureContextSequenceTrial"],A352:["PN","1","VerbalSourceTrial"],A353:["ST","1","AddressTrial"],A354:["LO","1","TelephoneNumberTrial"],A358:["SQ","1","VerbalSourceIdentifierCodeSequenceTrial"],A360:["SQ","1","PredecessorDocumentsSequence"],A370:["SQ","1","ReferencedRequestSequence"],A372:["SQ","1","PerformedProcedureCodeSequence"],A375:["SQ","1","CurrentRequestedProcedureEvidenceSequence"],A380:["SQ","1","ReportDetailSequenceTrial"],A385:["SQ","1","PertinentOtherEvidenceSequence"],A390:["SQ","1","HL7StructuredDocumentReferenceSequence"],A402:["UI","1","ObservationSubjectUIDTrial"],A403:["CS","1","ObservationSubjectClassTrial"],A404:["SQ","1","ObservationSubjectTypeCodeSequenceTrial"],A491:["CS","1","CompletionFlag"],A492:["LO","1","CompletionFlagDescription"],A493:["CS","1","VerificationFlag"],A494:["CS","1","ArchiveRequested"],A496:["CS","1","PreliminaryFlag"],A504:["SQ","1","ContentTemplateSequence"],A525:["SQ","1","IdenticalDocumentsSequence"],A600:["CS","1","ObservationSubjectContextFlagTrial"],A601:["CS","1","ObserverContextFlagTrial"],A603:["CS","1","ProcedureContextFlagTrial"],A730:["SQ","1","ContentSequence"],A731:["SQ","1","RelationshipSequenceTrial"],A732:["SQ","1","RelationshipTypeCodeSequenceTrial"],A744:["SQ","1","LanguageCodeSequenceTrial"],A801:["SQ","1","TabulatedValuesSequence"],A802:["UL","1","NumberOfTableRows"],A803:["UL","1","NumberOfTableColumns"],A804:["UL","1","TableRowNumber"],A805:["UL","1","TableColumnNumber"],A806:["SQ","1","TableRowDefinitionSequence"],A807:["SQ","1","TableColumnDefinitionSequence"],A808:["SQ","1","CellValuesSequence"],A992:["ST","1","UniformResourceLocatorTrial"],B020:["SQ","1","WaveformAnnotationSequence"],DB00:["CS","1","TemplateIdentifier"],DB06:["DT","1","TemplateVersion"],DB07:["DT","1","TemplateLocalVersion"],DB0B:["CS","1","TemplateExtensionFlag"],DB0C:["UI","1","TemplateExtensionOrganizationUID"],DB0D:["UI","1","TemplateExtensionCreatorUID"],DB73:["UL","1-n","ReferencedContentItemIdentifier"],E001:["ST","1","HL7InstanceIdentifier"],E004:["DT","1","HL7DocumentEffectiveTime"],E006:["SQ","1","HL7DocumentTypeCodeSequence"],E008:["SQ","1","DocumentClassCodeSequence"],E010:["UR","1","RetrieveURI"],E011:["UI","1","RetrieveLocationUID"],E020:["CS","1","TypeOfInstances"],E021:["SQ","1","DICOMRetrievalSequence"],E022:["SQ","1","DICOMMediaRetrievalSequence"],E023:["SQ","1","WADORetrievalSequence"],E024:["SQ","1","XDSRetrievalSequence"],E025:["SQ","1","WADORSRetrievalSequence"],E030:["UI","1","RepositoryUniqueID"],E031:["UI","1","HomeCommunityID"]},"0042":{"0000":["UL","1","GenericGroupLength"],"0010":["ST","1","DocumentTitle"],"0011":["OB","1","EncapsulatedDocument"],"0012":["LO","1","MIMETypeOfEncapsulatedDocument"],"0013":["SQ","1","SourceInstanceSequence"],"0014":["LO","1-n","ListOfMIMETypes"],"0015":["UL","1","EncapsulatedDocumentLength"]},"0044":{"0000":["UL","1","GenericGroupLength"],"0001":["ST","1","ProductPackageIdentifier"],"0002":["CS","1","SubstanceAdministrationApproval"],"0003":["LT","1","ApprovalStatusFurtherDescription"],"0004":["DT","1","ApprovalStatusDateTime"],"0007":["SQ","1","ProductTypeCodeSequence"],"0008":["LO","1-n","ProductName"],"0009":["LT","1","ProductDescription"],"000A":["LO","1","ProductLotIdentifier"],"000B":["DT","1","ProductExpirationDateTime"],"0010":["DT","1","SubstanceAdministrationDateTime"],"0011":["LO","1","SubstanceAdministrationNotes"],"0012":["LO","1","SubstanceAdministrationDeviceID"],"0013":["SQ","1","ProductParameterSequence"],"0019":["SQ","1","SubstanceAdministrationParameterSequence"],"0100":["SQ","1","ApprovalSequence"],"0101":["SQ","1","AssertionCodeSequence"],"0102":["UI","1","AssertionUID"],"0103":["SQ","1","AsserterIdentificationSequence"],"0104":["DT","1","AssertionDateTime"],"0105":["DT","1","AssertionExpirationDateTime"],"0106":["UT","1","AssertionComments"],"0107":["SQ","1","RelatedAssertionSequence"],"0108":["UI","1","ReferencedAssertionUID"],"0109":["SQ","1","ApprovalSubjectSequence"],"010A":["SQ","1","OrganizationalRoleCodeSequence"]},"0046":{"0000":["UL","1","GenericGroupLength"],"0012":["LO","1","LensDescription"],"0014":["SQ","1","RightLensSequence"],"0015":["SQ","1","LeftLensSequence"],"0016":["SQ","1","UnspecifiedLateralityLensSequence"],"0018":["SQ","1","CylinderSequence"],"0028":["SQ","1","PrismSequence"],"0030":["FD","1","HorizontalPrismPower"],"0032":["CS","1","HorizontalPrismBase"],"0034":["FD","1","VerticalPrismPower"],"0036":["CS","1","VerticalPrismBase"],"0038":["CS","1","LensSegmentType"],"0040":["FD","1","OpticalTransmittance"],"0042":["FD","1","ChannelWidth"],"0044":["FD","1","PupilSize"],"0046":["FD","1","CornealSize"],"0047":["SQ","1","CornealSizeSequence"],"0050":["SQ","1","AutorefractionRightEyeSequence"],"0052":["SQ","1","AutorefractionLeftEyeSequence"],"0060":["FD","1","DistancePupillaryDistance"],"0062":["FD","1","NearPupillaryDistance"],"0063":["FD","1","IntermediatePupillaryDistance"],"0064":["FD","1","OtherPupillaryDistance"],"0070":["SQ","1","KeratometryRightEyeSequence"],"0071":["SQ","1","KeratometryLeftEyeSequence"],"0074":["SQ","1","SteepKeratometricAxisSequence"],"0075":["FD","1","RadiusOfCurvature"],"0076":["FD","1","KeratometricPower"],"0077":["FD","1","KeratometricAxis"],"0080":["SQ","1","FlatKeratometricAxisSequence"],"0092":["CS","1","BackgroundColor"],"0094":["CS","1","Optotype"],"0095":["CS","1","OptotypePresentation"],"0097":["SQ","1","SubjectiveRefractionRightEyeSequence"],"0098":["SQ","1","SubjectiveRefractionLeftEyeSequence"],"0100":["SQ","1","AddNearSequence"],"0101":["SQ","1","AddIntermediateSequence"],"0102":["SQ","1","AddOtherSequence"],"0104":["FD","1","AddPower"],"0106":["FD","1","ViewingDistance"],"0110":["SQ","1","CorneaMeasurementsSequence"],"0111":["SQ","1","SourceOfCorneaMeasurementDataCodeSequence"],"0112":["SQ","1","SteepCornealAxisSequence"],"0113":["SQ","1","FlatCornealAxisSequence"],"0114":["FD","1","CornealPower"],"0115":["FD","1","CornealAxis"],"0116":["SQ","1","CorneaMeasurementMethodCodeSequence"],"0117":["FL","1","RefractiveIndexOfCornea"],"0118":["FL","1","RefractiveIndexOfAqueousHumor"],"0121":["SQ","1","VisualAcuityTypeCodeSequence"],"0122":["SQ","1","VisualAcuityRightEyeSequence"],"0123":["SQ","1","VisualAcuityLeftEyeSequence"],"0124":["SQ","1","VisualAcuityBothEyesOpenSequence"],"0125":["CS","1","ViewingDistanceType"],"0135":["SS","2","VisualAcuityModifiers"],"0137":["FD","1","DecimalVisualAcuity"],"0139":["LO","1","OptotypeDetailedDefinition"],"0145":["SQ","1","ReferencedRefractiveMeasurementsSequence"],"0146":["FD","1","SpherePower"],"0147":["FD","1","CylinderPower"],"0201":["CS","1","CornealTopographySurface"],"0202":["FL","2","CornealVertexLocation"],"0203":["FL","1","PupilCentroidXCoordinate"],"0204":["FL","1","PupilCentroidYCoordinate"],"0205":["FL","1","EquivalentPupilRadius"],"0207":["SQ","1","CornealTopographyMapTypeCodeSequence"],"0208":["IS","2-2n","VerticesOfTheOutlineOfPupil"],"0210":["SQ","1","CornealTopographyMappingNormalsSequence"],"0211":["SQ","1","MaximumCornealCurvatureSequence"],"0212":["FL","1","MaximumCornealCurvature"],"0213":["FL","2","MaximumCornealCurvatureLocation"],"0215":["SQ","1","MinimumKeratometricSequence"],"0218":["SQ","1","SimulatedKeratometricCylinderSequence"],"0220":["FL","1","AverageCornealPower"],"0224":["FL","1","CornealISValue"],"0227":["FL","1","AnalyzedArea"],"0230":["FL","1","SurfaceRegularityIndex"],"0232":["FL","1","SurfaceAsymmetryIndex"],"0234":["FL","1","CornealEccentricityIndex"],"0236":["FL","1","KeratoconusPredictionIndex"],"0238":["FL","1","DecimalPotentialVisualAcuity"],"0242":["CS","1","CornealTopographyMapQualityEvaluation"],"0244":["SQ","1","SourceImageCornealProcessedDataSequence"],"0247":["FL","3","CornealPointLocation"],"0248":["CS","1","CornealPointEstimated"],"0249":["FL","1","AxialPower"],"0250":["FL","1","TangentialPower"],"0251":["FL","1","RefractivePower"],"0252":["FL","1","RelativeElevation"],"0253":["FL","1","CornealWavefront"]},"0048":{"0000":["UL","1","GenericGroupLength"],"0001":["FL","1","ImagedVolumeWidth"],"0002":["FL","1","ImagedVolumeHeight"],"0003":["FL","1","ImagedVolumeDepth"],"0006":["UL","1","TotalPixelMatrixColumns"],"0007":["UL","1","TotalPixelMatrixRows"],"0008":["SQ","1","TotalPixelMatrixOriginSequence"],"0010":["CS","1","SpecimenLabelInImage"],"0011":["CS","1","FocusMethod"],"0012":["CS","1","ExtendedDepthOfField"],"0013":["US","1","NumberOfFocalPlanes"],"0014":["FL","1","DistanceBetweenFocalPlanes"],"0015":["US","3","RecommendedAbsentPixelCIELabValue"],"0100":["SQ","1","IlluminatorTypeCodeSequence"],"0102":["DS","6","ImageOrientationSlide"],"0105":["SQ","1","OpticalPathSequence"],"0106":["SH","1","OpticalPathIdentifier"],"0107":["ST","1","OpticalPathDescription"],"0108":["SQ","1","IlluminationColorCodeSequence"],"0110":["SQ","1","SpecimenReferenceSequence"],"0111":["DS","1","CondenserLensPower"],"0112":["DS","1","ObjectiveLensPower"],"0113":["DS","1","ObjectiveLensNumericalAperture"],"0120":["SQ","1","PaletteColorLookupTableSequence"],"0200":["SQ","1","ReferencedImageNavigationSequence"],"0201":["US","2","TopLeftHandCornerOfLocalizerArea"],"0202":["US","2","BottomRightHandCornerOfLocalizerArea"],"0207":["SQ","1","OpticalPathIdentificationSequence"],"021A":["SQ","1","PlanePositionSlideSequence"],"021E":["SL","1","ColumnPositionInTotalImagePixelMatrix"],"021F":["SL","1","RowPositionInTotalImagePixelMatrix"],"0301":["CS","1","PixelOriginInterpretation"],"0302":["UL","1","NumberOfOpticalPaths"],"0303":["UL","1","TotalPixelMatrixFocalPlanes"]},"0050":{"0000":["UL","1","GenericGroupLength"],"0004":["CS","1","CalibrationImage"],"0010":["SQ","1","DeviceSequence"],"0012":["SQ","1","ContainerComponentTypeCodeSequence"],"0013":["FD","1","ContainerComponentThickness"],"0014":["DS","1","DeviceLength"],"0015":["FD","1","ContainerComponentWidth"],"0016":["DS","1","DeviceDiameter"],"0017":["CS","1","DeviceDiameterUnits"],"0018":["DS","1","DeviceVolume"],"0019":["DS","1","InterMarkerDistance"],"001A":["CS","1","ContainerComponentMaterial"],"001B":["LO","1","ContainerComponentID"],"001C":["FD","1","ContainerComponentLength"],"001D":["FD","1","ContainerComponentDiameter"],"001E":["LO","1","ContainerComponentDescription"],"0020":["LO","1","DeviceDescription"],"0021":["ST","1","LongDeviceDescription"]},"0052":{"0000":["UL","1","GenericGroupLength"],"0001":["FL","1","ContrastBolusIngredientPercentByVolume"],"0002":["FD","1","OCTFocalDistance"],"0003":["FD","1","BeamSpotSize"],"0004":["FD","1","EffectiveRefractiveIndex"],"0006":["CS","1","OCTAcquisitionDomain"],"0007":["FD","1","OCTOpticalCenterWavelength"],"0008":["FD","1","AxialResolution"],"0009":["FD","1","RangingDepth"],"0011":["FD","1","ALineRate"],"0012":["US","1","ALinesPerFrame"],"0013":["FD","1","CatheterRotationalRate"],"0014":["FD","1","ALinePixelSpacing"],"0016":["SQ","1","ModeOfPercutaneousAccessSequence"],"0025":["SQ","1","IntravascularOCTFrameTypeSequence"],"0026":["CS","1","OCTZOffsetApplied"],"0027":["SQ","1","IntravascularFrameContentSequence"],"0028":["FD","1","IntravascularLongitudinalDistance"],"0029":["SQ","1","IntravascularOCTFrameContentSequence"],"0030":["SS","1","OCTZOffsetCorrection"],"0031":["CS","1","CatheterDirectionOfRotation"],"0033":["FD","1","SeamLineLocation"],"0034":["FD","1","FirstALineLocation"],"0036":["US","1","SeamLineIndex"],"0038":["US","1","NumberOfPaddedALines"],"0039":["CS","1","InterpolationType"],"003A":["CS","1","RefractiveIndexApplied"]},"0054":{"0000":["UL","1","GenericGroupLength"],"0010":["US","1-n","EnergyWindowVector"],"0011":["US","1","NumberOfEnergyWindows"],"0012":["SQ","1","EnergyWindowInformationSequence"],"0013":["SQ","1","EnergyWindowRangeSequence"],"0014":["DS","1","EnergyWindowLowerLimit"],"0015":["DS","1","EnergyWindowUpperLimit"],"0016":["SQ","1","RadiopharmaceuticalInformationSequence"],"0017":["IS","1","ResidualSyringeCounts"],"0018":["SH","1","EnergyWindowName"],"0020":["US","1-n","DetectorVector"],"0021":["US","1","NumberOfDetectors"],"0022":["SQ","1","DetectorInformationSequence"],"0030":["US","1-n","PhaseVector"],"0031":["US","1","NumberOfPhases"],"0032":["SQ","1","PhaseInformationSequence"],"0033":["US","1","NumberOfFramesInPhase"],"0036":["IS","1","PhaseDelay"],"0038":["IS","1","PauseBetweenFrames"],"0039":["CS","1","PhaseDescription"],"0050":["US","1-n","RotationVector"],"0051":["US","1","NumberOfRotations"],"0052":["SQ","1","RotationInformationSequence"],"0053":["US","1","NumberOfFramesInRotation"],"0060":["US","1-n","RRIntervalVector"],"0061":["US","1","NumberOfRRIntervals"],"0062":["SQ","1","GatedInformationSequence"],"0063":["SQ","1","DataInformationSequence"],"0070":["US","1-n","TimeSlotVector"],"0071":["US","1","NumberOfTimeSlots"],"0072":["SQ","1","TimeSlotInformationSequence"],"0073":["DS","1","TimeSlotTime"],"0080":["US","1-n","SliceVector"],"0081":["US","1","NumberOfSlices"],"0090":["US","1-n","AngularViewVector"],"0100":["US","1-n","TimeSliceVector"],"0101":["US","1","NumberOfTimeSlices"],"0200":["DS","1","StartAngle"],"0202":["CS","1","TypeOfDetectorMotion"],"0210":["IS","1-n","TriggerVector"],"0211":["US","1","NumberOfTriggersInPhase"],"0220":["SQ","1","ViewCodeSequence"],"0222":["SQ","1","ViewModifierCodeSequence"],"0300":["SQ","1","RadionuclideCodeSequence"],"0302":["SQ","1","AdministrationRouteCodeSequence"],"0304":["SQ","1","RadiopharmaceuticalCodeSequence"],"0306":["SQ","1","CalibrationDataSequence"],"0308":["US","1","EnergyWindowNumber"],"0400":["SH","1","ImageID"],"0410":["SQ","1","PatientOrientationCodeSequence"],"0412":["SQ","1","PatientOrientationModifierCodeSequence"],"0414":["SQ","1","PatientGantryRelationshipCodeSequence"],"0500":["CS","1","SliceProgressionDirection"],"0501":["CS","1","ScanProgressionDirection"],1e3:["CS","2","SeriesType"],1001:["CS","1","Units"],1002:["CS","1","CountsSource"],1004:["CS","1","ReprojectionMethod"],1006:["CS","1","SUVType"],1100:["CS","1","RandomsCorrectionMethod"],1101:["LO","1","AttenuationCorrectionMethod"],1102:["CS","1","DecayCorrection"],1103:["LO","1","ReconstructionMethod"],1104:["LO","1","DetectorLinesOfResponseUsed"],1105:["LO","1","ScatterCorrectionMethod"],1200:["DS","1","AxialAcceptance"],1201:["IS","2","AxialMash"],1202:["IS","1","TransverseMash"],1203:["DS","2","DetectorElementSize"],1210:["DS","1","CoincidenceWindowWidth"],1220:["CS","1-n","SecondaryCountsType"],1300:["DS","1","FrameReferenceTime"],1310:["IS","1","PrimaryPromptsCountsAccumulated"],1311:["IS","1-n","SecondaryCountsAccumulated"],1320:["DS","1","SliceSensitivityFactor"],1321:["DS","1","DecayFactor"],1322:["DS","1","DoseCalibrationFactor"],1323:["DS","1","ScatterFractionFactor"],1324:["DS","1","DeadTimeFactor"],1330:["US","1","ImageIndex"],1400:["CS","1-n","CountsIncluded"],1401:["CS","1","DeadTimeCorrectionFlag"]},"0060":{"0000":["UL","1","GenericGroupLength"],3e3:["SQ","1","HistogramSequence"],3002:["US","1","HistogramNumberOfBins"],3004:["xs","1","HistogramFirstBinValue"],3006:["xs","1","HistogramLastBinValue"],3008:["US","1","HistogramBinWidth"],3010:["LO","1","HistogramExplanation"],3020:["UL","1-n","HistogramData"]},"0062":{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","SegmentationType"],"0002":["SQ","1","SegmentSequence"],"0003":["SQ","1","SegmentedPropertyCategoryCodeSequence"],"0004":["US","1","SegmentNumber"],"0005":["LO","1","SegmentLabel"],"0006":["ST","1","SegmentDescription"],"0007":["SQ","1","SegmentationAlgorithmIdentificationSequence"],"0008":["CS","1","SegmentAlgorithmType"],"0009":["LO","1-n","SegmentAlgorithmName"],"000A":["SQ","1","SegmentIdentificationSequence"],"000B":["US","1-n","ReferencedSegmentNumber"],"000C":["US","1","RecommendedDisplayGrayscaleValue"],"000D":["US","3","RecommendedDisplayCIELabValue"],"000E":["US","1","MaximumFractionalValue"],"000F":["SQ","1","SegmentedPropertyTypeCodeSequence"],"0010":["CS","1","SegmentationFractionalType"],"0011":["SQ","1","SegmentedPropertyTypeModifierCodeSequence"],"0012":["SQ","1","UsedSegmentsSequence"],"0013":["CS","1","SegmentsOverlap"],"0020":["UT","1","TrackingID"],"0021":["UI","1","TrackingUID"]},"0064":{"0000":["UL","1","GenericGroupLength"],"0002":["SQ","1","DeformableRegistrationSequence"],"0003":["UI","1","SourceFrameOfReferenceUID"],"0005":["SQ","1","DeformableRegistrationGridSequence"],"0007":["UL","3","GridDimensions"],"0008":["FD","3","GridResolution"],"0009":["OF","1","VectorGridData"],"000F":["SQ","1","PreDeformationMatrixRegistrationSequence"],"0010":["SQ","1","PostDeformationMatrixRegistrationSequence"]},"0066":{"0000":["UL","1","GenericGroupLength"],"0001":["UL","1","NumberOfSurfaces"],"0002":["SQ","1","SurfaceSequence"],"0003":["UL","1","SurfaceNumber"],"0004":["LT","1","SurfaceComments"],"0009":["CS","1","SurfaceProcessing"],"000A":["FL","1","SurfaceProcessingRatio"],"000B":["LO","1","SurfaceProcessingDescription"],"000C":["FL","1","RecommendedPresentationOpacity"],"000D":["CS","1","RecommendedPresentationType"],"000E":["CS","1","FiniteVolume"],"0010":["CS","1","Manifold"],"0011":["SQ","1","SurfacePointsSequence"],"0012":["SQ","1","SurfacePointsNormalsSequence"],"0013":["SQ","1","SurfaceMeshPrimitivesSequence"],"0015":["UL","1","NumberOfSurfacePoints"],"0016":["OF","1","PointCoordinatesData"],"0017":["FL","3","PointPositionAccuracy"],"0018":["FL","1","MeanPointDistance"],"0019":["FL","1","MaximumPointDistance"],"001A":["FL","6","PointsBoundingBoxCoordinates"],"001B":["FL","3","AxisOfRotation"],"001C":["FL","3","CenterOfRotation"],"001E":["UL","1","NumberOfVectors"],"001F":["US","1","VectorDimensionality"],"0020":["FL","1-n","VectorAccuracy"],"0021":["OF","1","VectorCoordinateData"],"0022":["OD","1","DoublePointCoordinatesData"],"0023":["OW","1","TrianglePointIndexList"],"0024":["OW","1","EdgePointIndexList"],"0025":["OW","1","VertexPointIndexList"],"0026":["SQ","1","TriangleStripSequence"],"0027":["SQ","1","TriangleFanSequence"],"0028":["SQ","1","LineSequence"],"0029":["OW","1","PrimitivePointIndexList"],"002A":["UL","1","SurfaceCount"],"002B":["SQ","1","ReferencedSurfaceSequence"],"002C":["UL","1","ReferencedSurfaceNumber"],"002D":["SQ","1","SegmentSurfaceGenerationAlgorithmIdentificationSequence"],"002E":["SQ","1","SegmentSurfaceSourceInstanceSequence"],"002F":["SQ","1","AlgorithmFamilyCodeSequence"],"0030":["SQ","1","AlgorithmNameCodeSequence"],"0031":["LO","1","AlgorithmVersion"],"0032":["LT","1","AlgorithmParameters"],"0034":["SQ","1","FacetSequence"],"0035":["SQ","1","SurfaceProcessingAlgorithmIdentificationSequence"],"0036":["LO","1","AlgorithmName"],"0037":["FL","1","RecommendedPointRadius"],"0038":["FL","1","RecommendedLineThickness"],"0040":["OL","1","LongPrimitivePointIndexList"],"0041":["OL","1","LongTrianglePointIndexList"],"0042":["OL","1","LongEdgePointIndexList"],"0043":["OL","1","LongVertexPointIndexList"],"0101":["SQ","1","TrackSetSequence"],"0102":["SQ","1","TrackSequence"],"0103":["OW","1","RecommendedDisplayCIELabValueList"],"0104":["SQ","1","TrackingAlgorithmIdentificationSequence"],"0105":["UL","1","TrackSetNumber"],"0106":["LO","1","TrackSetLabel"],"0107":["UT","1","TrackSetDescription"],"0108":["SQ","1","TrackSetAnatomicalTypeCodeSequence"],"0121":["SQ","1","MeasurementsSequence"],"0124":["SQ","1","TrackSetStatisticsSequence"],"0125":["OF","1","FloatingPointValues"],"0129":["OL","1","TrackPointIndexList"],"0130":["SQ","1","TrackStatisticsSequence"],"0132":["SQ","1","MeasurementValuesSequence"],"0133":["SQ","1","DiffusionAcquisitionCodeSequence"],"0134":["SQ","1","DiffusionModelCodeSequence"]},"0068":{"0000":["UL","1","GenericGroupLength"],6210:["LO","1","ImplantSize"],6221:["LO","1","ImplantTemplateVersion"],6222:["SQ","1","ReplacedImplantTemplateSequence"],6223:["CS","1","ImplantType"],6224:["SQ","1","DerivationImplantTemplateSequence"],6225:["SQ","1","OriginalImplantTemplateSequence"],6226:["DT","1","EffectiveDateTime"],6230:["SQ","1","ImplantTargetAnatomySequence"],6260:["SQ","1","InformationFromManufacturerSequence"],6265:["SQ","1","NotificationFromManufacturerSequence"],6270:["DT","1","InformationIssueDateTime"],6280:["ST","1","InformationSummary"],"62A0":["SQ","1","ImplantRegulatoryDisapprovalCodeSequence"],"62A5":["FD","1","OverallTemplateSpatialTolerance"],"62C0":["SQ","1","HPGLDocumentSequence"],"62D0":["US","1","HPGLDocumentID"],"62D5":["LO","1","HPGLDocumentLabel"],"62E0":["SQ","1","ViewOrientationCodeSequence"],"62F0":["SQ","1","ViewOrientationModifierCodeSequence"],"62F2":["FD","1","HPGLDocumentScaling"],6300:["OB","1","HPGLDocument"],6310:["US","1","HPGLContourPenNumber"],6320:["SQ","1","HPGLPenSequence"],6330:["US","1","HPGLPenNumber"],6340:["LO","1","HPGLPenLabel"],6345:["ST","1","HPGLPenDescription"],6346:["FD","2","RecommendedRotationPoint"],6347:["FD","4","BoundingRectangle"],6350:["US","1-n","ImplantTemplate3DModelSurfaceNumber"],6360:["SQ","1","SurfaceModelDescriptionSequence"],6380:["LO","1","SurfaceModelLabel"],6390:["FD","1","SurfaceModelScalingFactor"],"63A0":["SQ","1","MaterialsCodeSequence"],"63A4":["SQ","1","CoatingMaterialsCodeSequence"],"63A8":["SQ","1","ImplantTypeCodeSequence"],"63AC":["SQ","1","FixationMethodCodeSequence"],"63B0":["SQ","1","MatingFeatureSetsSequence"],"63C0":["US","1","MatingFeatureSetID"],"63D0":["LO","1","MatingFeatureSetLabel"],"63E0":["SQ","1","MatingFeatureSequence"],"63F0":["US","1","MatingFeatureID"],6400:["SQ","1","MatingFeatureDegreeOfFreedomSequence"],6410:["US","1","DegreeOfFreedomID"],6420:["CS","1","DegreeOfFreedomType"],6430:["SQ","1","TwoDMatingFeatureCoordinatesSequence"],6440:["US","1","ReferencedHPGLDocumentID"],6450:["FD","2","TwoDMatingPoint"],6460:["FD","4","TwoDMatingAxes"],6470:["SQ","1","TwoDDegreeOfFreedomSequence"],6490:["FD","3","ThreeDDegreeOfFreedomAxis"],"64A0":["FD","2","RangeOfFreedom"],"64C0":["FD","3","ThreeDMatingPoint"],"64D0":["FD","9","ThreeDMatingAxes"],"64F0":["FD","3","TwoDDegreeOfFreedomAxis"],6500:["SQ","1","PlanningLandmarkPointSequence"],6510:["SQ","1","PlanningLandmarkLineSequence"],6520:["SQ","1","PlanningLandmarkPlaneSequence"],6530:["US","1","PlanningLandmarkID"],6540:["LO","1","PlanningLandmarkDescription"],6545:["SQ","1","PlanningLandmarkIdentificationCodeSequence"],6550:["SQ","1","TwoDPointCoordinatesSequence"],6560:["FD","2","TwoDPointCoordinates"],6590:["FD","3","ThreeDPointCoordinates"],"65A0":["SQ","1","TwoDLineCoordinatesSequence"],"65B0":["FD","4","TwoDLineCoordinates"],"65D0":["FD","6","ThreeDLineCoordinates"],"65E0":["SQ","1","TwoDPlaneCoordinatesSequence"],"65F0":["FD","4","TwoDPlaneIntersection"],6610:["FD","3","ThreeDPlaneOrigin"],6620:["FD","3","ThreeDPlaneNormal"],7001:["CS","1","ModelModification"],7002:["CS","1","ModelMirroring"],7003:["SQ","1","ModelUsageCodeSequence"],7004:["UI","1","ModelGroupUID"],7005:["UR","1","RelativeURIReferenceWithinEncapsulatedDocument"]},"006A":{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","AnnotationCoordinateType"],"0002":["SQ","1","AnnotationGroupSequence"],"0003":["UI","1","AnnotationGroupUID"],"0005":["LO","1","AnnotationGroupLabel"],"0006":["UT","1","AnnotationGroupDescription"],"0007":["CS","1","AnnotationGroupGenerationType"],"0008":["SQ","1","AnnotationGroupAlgorithmIdentificationSequence"],"0009":["SQ","1","AnnotationPropertyCategoryCodeSequence"],"000A":["SQ","1","AnnotationPropertyTypeCodeSequence"],"000B":["SQ","1","AnnotationPropertyTypeModifierCodeSequence"],"000C":["UL","1","NumberOfAnnotations"],"000D":["CS","1","AnnotationAppliesToAllOpticalPaths"],"000E":["SH","1-n","ReferencedOpticalPathIdentifier"],"000F":["CS","1","AnnotationAppliesToAllZPlanes"],"0010":["FD","1-n","CommonZCoordinateValue"],"0011":["OL","1","AnnotationIndexList"]},"0070":{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","GraphicAnnotationSequence"],"0002":["CS","1","GraphicLayer"],"0003":["CS","1","BoundingBoxAnnotationUnits"],"0004":["CS","1","AnchorPointAnnotationUnits"],"0005":["CS","1","GraphicAnnotationUnits"],"0006":["ST","1","UnformattedTextValue"],"0008":["SQ","1","TextObjectSequence"],"0009":["SQ","1","GraphicObjectSequence"],"0010":["FL","2","BoundingBoxTopLeftHandCorner"],"0011":["FL","2","BoundingBoxBottomRightHandCorner"],"0012":["CS","1","BoundingBoxTextHorizontalJustification"],"0014":["FL","2","AnchorPoint"],"0015":["CS","1","AnchorPointVisibility"],"0020":["US","1","GraphicDimensions"],"0021":["US","1","NumberOfGraphicPoints"],"0022":["FL","2-n","GraphicData"],"0023":["CS","1","GraphicType"],"0024":["CS","1","GraphicFilled"],"0040":["IS","1","ImageRotationRetired"],"0041":["CS","1","ImageHorizontalFlip"],"0042":["US","1","ImageRotation"],"0050":["US","2","DisplayedAreaTopLeftHandCornerTrial"],"0051":["US","2","DisplayedAreaBottomRightHandCornerTrial"],"0052":["SL","2","DisplayedAreaTopLeftHandCorner"],"0053":["SL","2","DisplayedAreaBottomRightHandCorner"],"005A":["SQ","1","DisplayedAreaSelectionSequence"],"0060":["SQ","1","GraphicLayerSequence"],"0062":["IS","1","GraphicLayerOrder"],"0066":["US","1","GraphicLayerRecommendedDisplayGrayscaleValue"],"0067":["US","3","GraphicLayerRecommendedDisplayRGBValue"],"0068":["LO","1","GraphicLayerDescription"],"0080":["CS","1","ContentLabel"],"0081":["LO","1","ContentDescription"],"0082":["DA","1","PresentationCreationDate"],"0083":["TM","1","PresentationCreationTime"],"0084":["PN","1","ContentCreatorName"],"0086":["SQ","1","ContentCreatorIdentificationCodeSequence"],"0087":["SQ","1","AlternateContentDescriptionSequence"],"0100":["CS","1","PresentationSizeMode"],"0101":["DS","2","PresentationPixelSpacing"],"0102":["IS","2","PresentationPixelAspectRatio"],"0103":["FL","1","PresentationPixelMagnificationRatio"],"0207":["LO","1","GraphicGroupLabel"],"0208":["ST","1","GraphicGroupDescription"],"0209":["SQ","1","CompoundGraphicSequence"],"0226":["UL","1","CompoundGraphicInstanceID"],"0227":["LO","1","FontName"],"0228":["CS","1","FontNameType"],"0229":["LO","1","CSSFontName"],"0230":["FD","1","RotationAngle"],"0231":["SQ","1","TextStyleSequence"],"0232":["SQ","1","LineStyleSequence"],"0233":["SQ","1","FillStyleSequence"],"0234":["SQ","1","GraphicGroupSequence"],"0241":["US","3","TextColorCIELabValue"],"0242":["CS","1","HorizontalAlignment"],"0243":["CS","1","VerticalAlignment"],"0244":["CS","1","ShadowStyle"],"0245":["FL","1","ShadowOffsetX"],"0246":["FL","1","ShadowOffsetY"],"0247":["US","3","ShadowColorCIELabValue"],"0248":["CS","1","Underlined"],"0249":["CS","1","Bold"],"0250":["CS","1","Italic"],"0251":["US","3","PatternOnColorCIELabValue"],"0252":["US","3","PatternOffColorCIELabValue"],"0253":["FL","1","LineThickness"],"0254":["CS","1","LineDashingStyle"],"0255":["UL","1","LinePattern"],"0256":["OB","1","FillPattern"],"0257":["CS","1","FillMode"],"0258":["FL","1","ShadowOpacity"],"0261":["FL","1","GapLength"],"0262":["FL","1","DiameterOfVisibility"],"0273":["FL","2","RotationPoint"],"0274":["CS","1","TickAlignment"],"0278":["CS","1","ShowTickLabel"],"0279":["CS","1","TickLabelAlignment"],"0282":["CS","1","CompoundGraphicUnits"],"0284":["FL","1","PatternOnOpacity"],"0285":["FL","1","PatternOffOpacity"],"0287":["SQ","1","MajorTicksSequence"],"0288":["FL","1","TickPosition"],"0289":["SH","1","TickLabel"],"0294":["CS","1","CompoundGraphicType"],"0295":["UL","1","GraphicGroupID"],"0306":["CS","1","ShapeType"],"0308":["SQ","1","RegistrationSequence"],"0309":["SQ","1","MatrixRegistrationSequence"],"030A":["SQ","1","MatrixSequence"],"030B":["FD","16","FrameOfReferenceToDisplayedCoordinateSystemTransformationMatrix"],"030C":["CS","1","FrameOfReferenceTransformationMatrixType"],"030D":["SQ","1","RegistrationTypeCodeSequence"],"030F":["ST","1","FiducialDescription"],"0310":["SH","1","FiducialIdentifier"],"0311":["SQ","1","FiducialIdentifierCodeSequence"],"0312":["FD","1","ContourUncertaintyRadius"],"0314":["SQ","1","UsedFiducialsSequence"],"0318":["SQ","1","GraphicCoordinatesDataSequence"],"031A":["UI","1","FiducialUID"],"031B":["UI","1","ReferencedFiducialUID"],"031C":["SQ","1","FiducialSetSequence"],"031E":["SQ","1","FiducialSequence"],"031F":["SQ","1","FiducialsPropertyCategoryCodeSequence"],"0401":["US","3","GraphicLayerRecommendedDisplayCIELabValue"],"0402":["SQ","1","BlendingSequence"],"0403":["FL","1","RelativeOpacity"],"0404":["SQ","1","ReferencedSpatialRegistrationSequence"],"0405":["CS","1","BlendingPosition"],1101:["UI","1","PresentationDisplayCollectionUID"],1102:["UI","1","PresentationSequenceCollectionUID"],1103:["US","1","PresentationSequencePositionIndex"],1104:["SQ","1","RenderedImageReferenceSequence"],1201:["SQ","1","VolumetricPresentationStateInputSequence"],1202:["CS","1","PresentationInputType"],1203:["US","1","InputSequencePositionIndex"],1204:["CS","1","Crop"],1205:["US","1-n","CroppingSpecificationIndex"],1206:["CS","1","CompositingMethod"],1207:["US","1","VolumetricPresentationInputNumber"],1208:["CS","1","ImageVolumeGeometry"],1209:["UI","1","VolumetricPresentationInputSetUID"],"120A":["SQ","1","VolumetricPresentationInputSetSequence"],"120B":["CS","1","GlobalCrop"],"120C":["US","1-n","GlobalCroppingSpecificationIndex"],"120D":["CS","1","RenderingMethod"],1301:["SQ","1","VolumeCroppingSequence"],1302:["CS","1","VolumeCroppingMethod"],1303:["FD","6","BoundingBoxCrop"],1304:["SQ","1","ObliqueCroppingPlaneSequence"],1305:["FD","4","Plane"],1306:["FD","3","PlaneNormal"],1309:["US","1","CroppingSpecificationNumber"],1501:["CS","1","MultiPlanarReconstructionStyle"],1502:["CS","1","MPRThicknessType"],1503:["FD","1","MPRSlabThickness"],1505:["FD","3","MPRTopLeftHandCorner"],1507:["FD","3","MPRViewWidthDirection"],1508:["FD","1","MPRViewWidth"],"150C":["UL","1","NumberOfVolumetricCurvePoints"],"150D":["OD","1","VolumetricCurvePoints"],1511:["FD","3","MPRViewHeightDirection"],1512:["FD","1","MPRViewHeight"],1602:["CS","1","RenderProjection"],1603:["FD","3","ViewpointPosition"],1604:["FD","3","ViewpointLookAtPoint"],1605:["FD","3","ViewpointUpDirection"],1606:["FD","6","RenderFieldOfView"],1607:["FD","1","SamplingStepSize"],1701:["CS","1","ShadingStyle"],1702:["FD","1","AmbientReflectionIntensity"],1703:["FD","3","LightDirection"],1704:["FD","1","DiffuseReflectionIntensity"],1705:["FD","1","SpecularReflectionIntensity"],1706:["FD","1","Shininess"],1801:["SQ","1","PresentationStateClassificationComponentSequence"],1802:["CS","1","ComponentType"],1803:["SQ","1","ComponentInputSequence"],1804:["US","1","VolumetricPresentationInputIndex"],1805:["SQ","1","PresentationStateCompositorComponentSequence"],1806:["SQ","1","WeightingTransferFunctionSequence"],1807:["US","3","WeightingLookupTableDescriptor"],1808:["OB","1","WeightingLookupTableData"],1901:["SQ","1","VolumetricAnnotationSequence"],1903:["SQ","1","ReferencedStructuredContextSequence"],1904:["UI","1","ReferencedContentItem"],1905:["SQ","1","VolumetricPresentationInputAnnotationSequence"],1907:["CS","1","AnnotationClipping"],"1A01":["CS","1","PresentationAnimationStyle"],"1A03":["FD","1","RecommendedAnimationRate"],"1A04":["SQ","1","AnimationCurveSequence"],"1A05":["FD","1","AnimationStepSize"],"1A06":["FD","1","SwivelRange"],"1A07":["OD","1","VolumetricCurveUpDirections"],"1A08":["SQ","1","VolumeStreamSequence"],"1A09":["LO","1","RGBATransferFunctionDescription"],"1B01":["SQ","1","AdvancedBlendingSequence"],"1B02":["US","1","BlendingInputNumber"],"1B03":["SQ","1","BlendingDisplayInputSequence"],"1B04":["SQ","1","BlendingDisplaySequence"],"1B06":["CS","1","BlendingMode"],"1B07":["CS","1","TimeSeriesBlending"],"1B08":["CS","1","GeometryForDisplay"],"1B11":["SQ","1","ThresholdSequence"],"1B12":["SQ","1","ThresholdValueSequence"],"1B13":["CS","1","ThresholdType"],"1B14":["FD","1","ThresholdValue"]},"0072":{"0000":["UL","1","GenericGroupLength"],"0002":["SH","1","HangingProtocolName"],"0004":["LO","1","HangingProtocolDescription"],"0006":["CS","1","HangingProtocolLevel"],"0008":["LO","1","HangingProtocolCreator"],"000A":["DT","1","HangingProtocolCreationDateTime"],"000C":["SQ","1","HangingProtocolDefinitionSequence"],"000E":["SQ","1","HangingProtocolUserIdentificationCodeSequence"],"0010":["LO","1","HangingProtocolUserGroupName"],"0012":["SQ","1","SourceHangingProtocolSequence"],"0014":["US","1","NumberOfPriorsReferenced"],"0020":["SQ","1","ImageSetsSequence"],"0022":["SQ","1","ImageSetSelectorSequence"],"0024":["CS","1","ImageSetSelectorUsageFlag"],"0026":["AT","1","SelectorAttribute"],"0028":["US","1","SelectorValueNumber"],"0030":["SQ","1","TimeBasedImageSetsSequence"],"0032":["US","1","ImageSetNumber"],"0034":["CS","1","ImageSetSelectorCategory"],"0038":["US","2","RelativeTime"],"003A":["CS","1","RelativeTimeUnits"],"003C":["SS","2","AbstractPriorValue"],"003E":["SQ","1","AbstractPriorCodeSequence"],"0040":["LO","1","ImageSetLabel"],"0050":["CS","1","SelectorAttributeVR"],"0052":["AT","1-n","SelectorSequencePointer"],"0054":["LO","1-n","SelectorSequencePointerPrivateCreator"],"0056":["LO","1","SelectorAttributePrivateCreator"],"005E":["AE","1-n","SelectorAEValue"],"005F":["AS","1-n","SelectorASValue"],"0060":["AT","1-n","SelectorATValue"],"0061":["DA","1-n","SelectorDAValue"],"0062":["CS","1-n","SelectorCSValue"],"0063":["DT","1-n","SelectorDTValue"],"0064":["IS","1-n","SelectorISValue"],"0065":["OB","1","SelectorOBValue"],"0066":["LO","1-n","SelectorLOValue"],"0067":["OF","1","SelectorOFValue"],"0068":["LT","1","SelectorLTValue"],"0069":["OW","1","SelectorOWValue"],"006A":["PN","1-n","SelectorPNValue"],"006B":["TM","1-n","SelectorTMValue"],"006C":["SH","1-n","SelectorSHValue"],"006D":["UN","1","SelectorUNValue"],"006E":["ST","1","SelectorSTValue"],"006F":["UC","1-n","SelectorUCValue"],"0070":["UT","1","SelectorUTValue"],"0071":["UR","1","SelectorURValue"],"0072":["DS","1-n","SelectorDSValue"],"0073":["OD","1","SelectorODValue"],"0074":["FD","1-n","SelectorFDValue"],"0075":["OL","1","SelectorOLValue"],"0076":["FL","1-n","SelectorFLValue"],"0078":["UL","1-n","SelectorULValue"],"007A":["US","1-n","SelectorUSValue"],"007C":["SL","1-n","SelectorSLValue"],"007E":["SS","1-n","SelectorSSValue"],"007F":["UI","1-n","SelectorUIValue"],"0080":["SQ","1","SelectorCodeSequenceValue"],"0081":["OV","1","SelectorOVValue"],"0082":["SV","1-n","SelectorSVValue"],"0083":["UV","1-n","SelectorUVValue"],"0100":["US","1","NumberOfScreens"],"0102":["SQ","1","NominalScreenDefinitionSequence"],"0104":["US","1","NumberOfVerticalPixels"],"0106":["US","1","NumberOfHorizontalPixels"],"0108":["FD","4","DisplayEnvironmentSpatialPosition"],"010A":["US","1","ScreenMinimumGrayscaleBitDepth"],"010C":["US","1","ScreenMinimumColorBitDepth"],"010E":["US","1","ApplicationMaximumRepaintTime"],"0200":["SQ","1","DisplaySetsSequence"],"0202":["US","1","DisplaySetNumber"],"0203":["LO","1","DisplaySetLabel"],"0204":["US","1","DisplaySetPresentationGroup"],"0206":["LO","1","DisplaySetPresentationGroupDescription"],"0208":["CS","1","PartialDataDisplayHandling"],"0210":["SQ","1","SynchronizedScrollingSequence"],"0212":["US","2-n","DisplaySetScrollingGroup"],"0214":["SQ","1","NavigationIndicatorSequence"],"0216":["US","1","NavigationDisplaySet"],"0218":["US","1-n","ReferenceDisplaySets"],"0300":["SQ","1","ImageBoxesSequence"],"0302":["US","1","ImageBoxNumber"],"0304":["CS","1","ImageBoxLayoutType"],"0306":["US","1","ImageBoxTileHorizontalDimension"],"0308":["US","1","ImageBoxTileVerticalDimension"],"0310":["CS","1","ImageBoxScrollDirection"],"0312":["CS","1","ImageBoxSmallScrollType"],"0314":["US","1","ImageBoxSmallScrollAmount"],"0316":["CS","1","ImageBoxLargeScrollType"],"0318":["US","1","ImageBoxLargeScrollAmount"],"0320":["US","1","ImageBoxOverlapPriority"],"0330":["FD","1","CineRelativeToRealTime"],"0400":["SQ","1","FilterOperationsSequence"],"0402":["CS","1","FilterByCategory"],"0404":["CS","1","FilterByAttributePresence"],"0406":["CS","1","FilterByOperator"],"0420":["US","3","StructuredDisplayBackgroundCIELabValue"],"0421":["US","3","EmptyImageBoxCIELabValue"],"0422":["SQ","1","StructuredDisplayImageBoxSequence"],"0424":["SQ","1","StructuredDisplayTextBoxSequence"],"0427":["SQ","1","ReferencedFirstFrameSequence"],"0430":["SQ","1","ImageBoxSynchronizationSequence"],"0432":["US","2-n","SynchronizedImageBoxList"],"0434":["CS","1","TypeOfSynchronization"],"0500":["CS","1","BlendingOperationType"],"0510":["CS","1","ReformattingOperationType"],"0512":["FD","1","ReformattingThickness"],"0514":["FD","1","ReformattingInterval"],"0516":["CS","1","ReformattingOperationInitialViewDirection"],"0520":["CS","1-n","ThreeDRenderingType"],"0600":["SQ","1","SortingOperationsSequence"],"0602":["CS","1","SortByCategory"],"0604":["CS","1","SortingDirection"],"0700":["CS","2","DisplaySetPatientOrientation"],"0702":["CS","1","VOIType"],"0704":["CS","1","PseudoColorType"],"0705":["SQ","1","PseudoColorPaletteInstanceReferenceSequence"],"0706":["CS","1","ShowGrayscaleInverted"],"0710":["CS","1","ShowImageTrueSizeFlag"],"0712":["CS","1","ShowGraphicAnnotationFlag"],"0714":["CS","1","ShowPatientDemographicsFlag"],"0716":["CS","1","ShowAcquisitionTechniquesFlag"],"0717":["CS","1","DisplaySetHorizontalJustification"],"0718":["CS","1","DisplaySetVerticalJustification"]},"0074":{"0000":["UL","1","GenericGroupLength"],"0120":["FD","1","ContinuationStartMeterset"],"0121":["FD","1","ContinuationEndMeterset"],1e3:["CS","1","ProcedureStepState"],1002:["SQ","1","ProcedureStepProgressInformationSequence"],1004:["DS","1","ProcedureStepProgress"],1006:["ST","1","ProcedureStepProgressDescription"],1007:["SQ","1","ProcedureStepProgressParametersSequence"],1008:["SQ","1","ProcedureStepCommunicationsURISequence"],"100A":["UR","1","ContactURI"],"100C":["LO","1","ContactDisplayName"],"100E":["SQ","1","ProcedureStepDiscontinuationReasonCodeSequence"],1020:["SQ","1","BeamTaskSequence"],1022:["CS","1","BeamTaskType"],1024:["IS","1","BeamOrderIndexTrial"],1025:["CS","1","AutosequenceFlag"],1026:["FD","1","TableTopVerticalAdjustedPosition"],1027:["FD","1","TableTopLongitudinalAdjustedPosition"],1028:["FD","1","TableTopLateralAdjustedPosition"],"102A":["FD","1","PatientSupportAdjustedAngle"],"102B":["FD","1","TableTopEccentricAdjustedAngle"],"102C":["FD","1","TableTopPitchAdjustedAngle"],"102D":["FD","1","TableTopRollAdjustedAngle"],1030:["SQ","1","DeliveryVerificationImageSequence"],1032:["CS","1","VerificationImageTiming"],1034:["CS","1","DoubleExposureFlag"],1036:["CS","1","DoubleExposureOrdering"],1038:["DS","1","DoubleExposureMetersetTrial"],"103A":["DS","4","DoubleExposureFieldDeltaTrial"],1040:["SQ","1","RelatedReferenceRTImageSequence"],1042:["SQ","1","GeneralMachineVerificationSequence"],1044:["SQ","1","ConventionalMachineVerificationSequence"],1046:["SQ","1","IonMachineVerificationSequence"],1048:["SQ","1","FailedAttributesSequence"],"104A":["SQ","1","OverriddenAttributesSequence"],"104C":["SQ","1","ConventionalControlPointVerificationSequence"],"104E":["SQ","1","IonControlPointVerificationSequence"],1050:["SQ","1","AttributeOccurrenceSequence"],1052:["AT","1","AttributeOccurrencePointer"],1054:["UL","1","AttributeItemSelector"],1056:["LO","1","AttributeOccurrencePrivateCreator"],1057:["IS","1-n","SelectorSequencePointerItems"],1200:["CS","1","ScheduledProcedureStepPriority"],1202:["LO","1","WorklistLabel"],1204:["LO","1","ProcedureStepLabel"],1210:["SQ","1","ScheduledProcessingParametersSequence"],1212:["SQ","1","PerformedProcessingParametersSequence"],1216:["SQ","1","UnifiedProcedureStepPerformedProcedureSequence"],1220:["SQ","1","RelatedProcedureStepSequence"],1222:["LO","1","ProcedureStepRelationshipType"],1224:["SQ","1","ReplacedProcedureStepSequence"],1230:["LO","1","DeletionLock"],1234:["AE","1","ReceivingAE"],1236:["AE","1","RequestingAE"],1238:["LT","1","ReasonForCancellation"],1242:["CS","1","SCPStatus"],1244:["CS","1","SubscriptionListStatus"],1246:["CS","1","UnifiedProcedureStepListStatus"],1324:["UL","1","BeamOrderIndex"],1338:["FD","1","DoubleExposureMeterset"],"133A":["FD","4","DoubleExposureFieldDelta"],1401:["SQ","1","BrachyTaskSequence"],1402:["DS","1","ContinuationStartTotalReferenceAirKerma"],1403:["DS","1","ContinuationEndTotalReferenceAirKerma"],1404:["IS","1","ContinuationPulseNumber"],1405:["SQ","1","ChannelDeliveryOrderSequence"],1406:["IS","1","ReferencedChannelNumber"],1407:["DS","1","StartCumulativeTimeWeight"],1408:["DS","1","EndCumulativeTimeWeight"],1409:["SQ","1","OmittedChannelSequence"],"140A":["CS","1","ReasonForChannelOmission"],"140B":["LO","1","ReasonForChannelOmissionDescription"],"140C":["IS","1","ChannelDeliveryOrderIndex"],"140D":["SQ","1","ChannelDeliveryContinuationSequence"],"140E":["SQ","1","OmittedApplicationSetupSequence"]},"0076":{"0000":["UL","1","GenericGroupLength"],"0001":["LO","1","ImplantAssemblyTemplateName"],"0003":["LO","1","ImplantAssemblyTemplateIssuer"],"0006":["LO","1","ImplantAssemblyTemplateVersion"],"0008":["SQ","1","ReplacedImplantAssemblyTemplateSequence"],"000A":["CS","1","ImplantAssemblyTemplateType"],"000C":["SQ","1","OriginalImplantAssemblyTemplateSequence"],"000E":["SQ","1","DerivationImplantAssemblyTemplateSequence"],"0010":["SQ","1","ImplantAssemblyTemplateTargetAnatomySequence"],"0020":["SQ","1","ProcedureTypeCodeSequence"],"0030":["LO","1","SurgicalTechnique"],"0032":["SQ","1","ComponentTypesSequence"],"0034":["SQ","1","ComponentTypeCodeSequence"],"0036":["CS","1","ExclusiveComponentType"],"0038":["CS","1","MandatoryComponentType"],"0040":["SQ","1","ComponentSequence"],"0055":["US","1","ComponentID"],"0060":["SQ","1","ComponentAssemblySequence"],"0070":["US","1","Component1ReferencedID"],"0080":["US","1","Component1ReferencedMatingFeatureSetID"],"0090":["US","1","Component1ReferencedMatingFeatureID"],"00A0":["US","1","Component2ReferencedID"],"00B0":["US","1","Component2ReferencedMatingFeatureSetID"],"00C0":["US","1","Component2ReferencedMatingFeatureID"]},"0078":{"0000":["UL","1","GenericGroupLength"],"0001":["LO","1","ImplantTemplateGroupName"],"0010":["ST","1","ImplantTemplateGroupDescription"],"0020":["LO","1","ImplantTemplateGroupIssuer"],"0024":["LO","1","ImplantTemplateGroupVersion"],"0026":["SQ","1","ReplacedImplantTemplateGroupSequence"],"0028":["SQ","1","ImplantTemplateGroupTargetAnatomySequence"],"002A":["SQ","1","ImplantTemplateGroupMembersSequence"],"002E":["US","1","ImplantTemplateGroupMemberID"],"0050":["FD","3","ThreeDImplantTemplateGroupMemberMatchingPoint"],"0060":["FD","9","ThreeDImplantTemplateGroupMemberMatchingAxes"],"0070":["SQ","1","ImplantTemplateGroupMemberMatching2DCoordinatesSequence"],"0090":["FD","2","TwoDImplantTemplateGroupMemberMatchingPoint"],"00A0":["FD","4","TwoDImplantTemplateGroupMemberMatchingAxes"],"00B0":["SQ","1","ImplantTemplateGroupVariationDimensionSequence"],"00B2":["LO","1","ImplantTemplateGroupVariationDimensionName"],"00B4":["SQ","1","ImplantTemplateGroupVariationDimensionRankSequence"],"00B6":["US","1","ReferencedImplantTemplateGroupMemberID"],"00B8":["US","1","ImplantTemplateGroupVariationDimensionRank"]},"0080":{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","SurfaceScanAcquisitionTypeCodeSequence"],"0002":["SQ","1","SurfaceScanModeCodeSequence"],"0003":["SQ","1","RegistrationMethodCodeSequence"],"0004":["FD","1","ShotDurationTime"],"0005":["FD","1","ShotOffsetTime"],"0006":["US","1-n","SurfacePointPresentationValueData"],"0007":["US","3-3n","SurfacePointColorCIELabValueData"],"0008":["SQ","1","UVMappingSequence"],"0009":["SH","1","TextureLabel"],"0010":["OF","1","UValueData"],"0011":["OF","1","VValueData"],"0012":["SQ","1","ReferencedTextureSequence"],"0013":["SQ","1","ReferencedSurfaceDataSequence"]},"0082":{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","AssessmentSummary"],"0003":["UT","1","AssessmentSummaryDescription"],"0004":["SQ","1","AssessedSOPInstanceSequence"],"0005":["SQ","1","ReferencedComparisonSOPInstanceSequence"],"0006":["UL","1","NumberOfAssessmentObservations"],"0007":["SQ","1","AssessmentObservationsSequence"],"0008":["CS","1","ObservationSignificance"],"000A":["UT","1","ObservationDescription"],"000C":["SQ","1","StructuredConstraintObservationSequence"],"0010":["SQ","1","AssessedAttributeValueSequence"],"0016":["LO","1","AssessmentSetID"],"0017":["SQ","1","AssessmentRequesterSequence"],"0018":["LO","1","SelectorAttributeName"],"0019":["LO","1","SelectorAttributeKeyword"],"0021":["SQ","1","AssessmentTypeCodeSequence"],"0022":["SQ","1","ObservationBasisCodeSequence"],"0023":["LO","1","AssessmentLabel"],"0032":["CS","1","ConstraintType"],"0033":["UT","1","SpecificationSelectionGuidance"],"0034":["SQ","1","ConstraintValueSequence"],"0035":["SQ","1","RecommendedDefaultValueSequence"],"0036":["CS","1","ConstraintViolationSignificance"],"0037":["UT","1","ConstraintViolationCondition"],"0038":["CS","1","ModifiableConstraintFlag"]},"0088":{"0000":["UL","1","GenericGroupLength"],"0130":["SH","1","StorageMediaFileSetID"],"0140":["UI","1","StorageMediaFileSetUID"],"0200":["SQ","1","IconImageSequence"],"0904":["LO","1","TopicTitle"],"0906":["ST","1","TopicSubject"],"0910":["LO","1","TopicAuthor"],"0912":["LO","1-32","TopicKeywords"]},"0100":{"0000":["UL","1","GenericGroupLength"],"0410":["CS","1","SOPInstanceStatus"],"0420":["DT","1","SOPAuthorizationDateTime"],"0424":["LT","1","SOPAuthorizationComment"],"0426":["LO","1","AuthorizationEquipmentCertificationNumber"]},"0400":{"0000":["UL","1","GenericGroupLength"],"0005":["US","1","MACIDNumber"],"0010":["UI","1","MACCalculationTransferSyntaxUID"],"0015":["CS","1","MACAlgorithm"],"0020":["AT","1-n","DataElementsSigned"],"0100":["UI","1","DigitalSignatureUID"],"0105":["DT","1","DigitalSignatureDateTime"],"0110":["CS","1","CertificateType"],"0115":["OB","1","CertificateOfSigner"],"0120":["OB","1","Signature"],"0305":["CS","1","CertifiedTimestampType"],"0310":["OB","1","CertifiedTimestamp"],"0315":["FL","1",""],"0401":["SQ","1","DigitalSignaturePurposeCodeSequence"],"0402":["SQ","1","ReferencedDigitalSignatureSequence"],"0403":["SQ","1","ReferencedSOPInstanceMACSequence"],"0404":["OB","1","MAC"],"0500":["SQ","1","EncryptedAttributesSequence"],"0510":["UI","1","EncryptedContentTransferSyntaxUID"],"0520":["OB","1","EncryptedContent"],"0550":["SQ","1","ModifiedAttributesSequence"],"0551":["SQ","1","NonconformingModifiedAttributesSequence"],"0552":["OB","1","NonconformingDataElementValue"],"0561":["SQ","1","OriginalAttributesSequence"],"0562":["DT","1","AttributeModificationDateTime"],"0563":["LO","1","ModifyingSystem"],"0564":["LO","1","SourceOfPreviousValues"],"0565":["CS","1","ReasonForTheAttributeModification"],"0600":["CS","1","InstanceOriginStatus"]},1e3:{"0000":["UL","1","GenericGroupLength"],"0010":["US","3","EscapeTriplet"],"0011":["US","3","RunLengthTriplet"],"0012":["US","1","HuffmanTableSize"],"0013":["US","3","HuffmanTableTriplet"],"0014":["US","1","ShiftTableSize"],"0015":["US","3","ShiftTableTriplet"]},1010:{"0000":["UL","1","GenericGroupLength"],"0004":["US","1-n","ZonalMap"]},2e3:{"0000":["UL","1","GenericGroupLength"],"0010":["IS","1","NumberOfCopies"],"001E":["SQ","1","PrinterConfigurationSequence"],"0020":["CS","1","PrintPriority"],"0030":["CS","1","MediumType"],"0040":["CS","1","FilmDestination"],"0050":["LO","1","FilmSessionLabel"],"0060":["IS","1","MemoryAllocation"],"0061":["IS","1","MaximumMemoryAllocation"],"0062":["CS","1","ColorImagePrintingFlag"],"0063":["CS","1","CollationFlag"],"0065":["CS","1","AnnotationFlag"],"0067":["CS","1","ImageOverlayFlag"],"0069":["CS","1","PresentationLUTFlag"],"006A":["CS","1","ImageBoxPresentationLUTFlag"],"00A0":["US","1","MemoryBitDepth"],"00A1":["US","1","PrintingBitDepth"],"00A2":["SQ","1","MediaInstalledSequence"],"00A4":["SQ","1","OtherMediaAvailableSequence"],"00A8":["SQ","1","SupportedImageDisplayFormatsSequence"],"0500":["SQ","1","ReferencedFilmBoxSequence"],"0510":["SQ","1","ReferencedStoredPrintSequence"]},2010:{"0000":["UL","1","GenericGroupLength"],"0010":["ST","1","ImageDisplayFormat"],"0030":["CS","1","AnnotationDisplayFormatID"],"0040":["CS","1","FilmOrientation"],"0050":["CS","1","FilmSizeID"],"0052":["CS","1","PrinterResolutionID"],"0054":["CS","1","DefaultPrinterResolutionID"],"0060":["CS","1","MagnificationType"],"0080":["CS","1","SmoothingType"],"00A6":["CS","1","DefaultMagnificationType"],"00A7":["CS","1-n","OtherMagnificationTypesAvailable"],"00A8":["CS","1","DefaultSmoothingType"],"00A9":["CS","1-n","OtherSmoothingTypesAvailable"],"0100":["CS","1","BorderDensity"],"0110":["CS","1","EmptyImageDensity"],"0120":["US","1","MinDensity"],"0130":["US","1","MaxDensity"],"0140":["CS","1","Trim"],"0150":["ST","1","ConfigurationInformation"],"0152":["LT","1","ConfigurationInformationDescription"],"0154":["IS","1","MaximumCollatedFilms"],"015E":["US","1","Illumination"],"0160":["US","1","ReflectedAmbientLight"],"0376":["DS","2","PrinterPixelSpacing"],"0500":["SQ","1","ReferencedFilmSessionSequence"],"0510":["SQ","1","ReferencedImageBoxSequence"],"0520":["SQ","1","ReferencedBasicAnnotationBoxSequence"]},2020:{"0000":["UL","1","GenericGroupLength"],"0010":["US","1","ImageBoxPosition"],"0020":["CS","1","Polarity"],"0030":["DS","1","RequestedImageSize"],"0040":["CS","1","RequestedDecimateCropBehavior"],"0050":["CS","1","RequestedResolutionID"],"00A0":["CS","1","RequestedImageSizeFlag"],"00A2":["CS","1","DecimateCropResult"],"0110":["SQ","1","BasicGrayscaleImageSequence"],"0111":["SQ","1","BasicColorImageSequence"],"0130":["SQ","1","ReferencedImageOverlayBoxSequence"],"0140":["SQ","1","ReferencedVOILUTBoxSequence"]},2030:{"0000":["UL","1","GenericGroupLength"],"0010":["US","1","AnnotationPosition"],"0020":["LO","1","TextString"]},2040:{"0000":["UL","1","GenericGroupLength"],"0010":["SQ","1","ReferencedOverlayPlaneSequence"],"0011":["US","1-99","ReferencedOverlayPlaneGroups"],"0020":["SQ","1","OverlayPixelDataSequence"],"0060":["CS","1","OverlayMagnificationType"],"0070":["CS","1","OverlaySmoothingType"],"0072":["CS","1","OverlayOrImageMagnification"],"0074":["US","1","MagnifyToNumberOfColumns"],"0080":["CS","1","OverlayForegroundDensity"],"0082":["CS","1","OverlayBackgroundDensity"],"0090":["CS","1","OverlayMode"],"0100":["CS","1","ThresholdDensity"],"0500":["SQ","1","ReferencedImageBoxSequenceRetired"]},2050:{"0000":["UL","1","GenericGroupLength"],"0010":["SQ","1","PresentationLUTSequence"],"0020":["CS","1","PresentationLUTShape"],"0500":["SQ","1","ReferencedPresentationLUTSequence"]},2100:{"0000":["UL","1","GenericGroupLength"],"0010":["SH","1","PrintJobID"],"0020":["CS","1","ExecutionStatus"],"0030":["CS","1","ExecutionStatusInfo"],"0040":["DA","1","CreationDate"],"0050":["TM","1","CreationTime"],"0070":["AE","1","Originator"],"0140":["AE","1","DestinationAE"],"0160":["SH","1","OwnerID"],"0170":["IS","1","NumberOfFilms"],"0500":["SQ","1","ReferencedPrintJobSequencePullStoredPrint"]},2110:{"0000":["UL","1","GenericGroupLength"],"0010":["CS","1","PrinterStatus"],"0020":["CS","1","PrinterStatusInfo"],"0030":["LO","1","PrinterName"],"0099":["SH","1","PrintQueueID"]},2120:{"0000":["UL","1","GenericGroupLength"],"0010":["CS","1","QueueStatus"],"0050":["SQ","1","PrintJobDescriptionSequence"],"0070":["SQ","1","ReferencedPrintJobSequence"]},2130:{"0000":["UL","1","GenericGroupLength"],"0010":["SQ","1","PrintManagementCapabilitiesSequence"],"0015":["SQ","1","PrinterCharacteristicsSequence"],"0030":["SQ","1","FilmBoxContentSequence"],"0040":["SQ","1","ImageBoxContentSequence"],"0050":["SQ","1","AnnotationContentSequence"],"0060":["SQ","1","ImageOverlayBoxContentSequence"],"0080":["SQ","1","PresentationLUTContentSequence"],"00A0":["SQ","1","ProposedStudySequence"],"00C0":["SQ","1","OriginalImageSequence"]},2200:{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","LabelUsingInformationExtractedFromInstances"],"0002":["UT","1","LabelText"],"0003":["CS","1","LabelStyleSelection"],"0004":["LT","1","MediaDisposition"],"0005":["LT","1","BarcodeValue"],"0006":["CS","1","BarcodeSymbology"],"0007":["CS","1","AllowMediaSplitting"],"0008":["CS","1","IncludeNonDICOMObjects"],"0009":["CS","1","IncludeDisplayApplication"],"000A":["CS","1","PreserveCompositeInstancesAfterMediaCreation"],"000B":["US","1","TotalNumberOfPiecesOfMediaCreated"],"000C":["LO","1","RequestedMediaApplicationProfile"],"000D":["SQ","1","ReferencedStorageMediaSequence"],"000E":["AT","1-n","FailureAttributes"],"000F":["CS","1","AllowLossyCompression"],"0020":["CS","1","RequestPriority"]},3002:{"0000":["UL","1","GenericGroupLength"],"0002":["SH","1","RTImageLabel"],"0003":["LO","1","RTImageName"],"0004":["ST","1","RTImageDescription"],"000A":["CS","1","ReportedValuesOrigin"],"000C":["CS","1","RTImagePlane"],"000D":["DS","3","XRayImageReceptorTranslation"],"000E":["DS","1","XRayImageReceptorAngle"],"0010":["DS","6","RTImageOrientation"],"0011":["DS","2","ImagePlanePixelSpacing"],"0012":["DS","2","RTImagePosition"],"0020":["SH","1","RadiationMachineName"],"0022":["DS","1","RadiationMachineSAD"],"0024":["DS","1","RadiationMachineSSD"],"0026":["DS","1","RTImageSID"],"0028":["DS","1","SourceToReferenceObjectDistance"],"0029":["IS","1","FractionNumber"],"0030":["SQ","1","ExposureSequence"],"0032":["DS","1","MetersetExposure"],"0034":["DS","4","DiaphragmPosition"],"0040":["SQ","1","FluenceMapSequence"],"0041":["CS","1","FluenceDataSource"],"0042":["DS","1","FluenceDataScale"],"0050":["SQ","1","PrimaryFluenceModeSequence"],"0051":["CS","1","FluenceMode"],"0052":["SH","1","FluenceModeID"]},3004:{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","DVHType"],"0002":["CS","1","DoseUnits"],"0004":["CS","1","DoseType"],"0005":["CS","1","SpatialTransformOfDose"],"0006":["LO","1","DoseComment"],"0008":["DS","3","NormalizationPoint"],"000A":["CS","1","DoseSummationType"],"000C":["DS","2-n","GridFrameOffsetVector"],"000E":["DS","1","DoseGridScaling"],"0010":["SQ","1","RTDoseROISequence"],"0012":["DS","1","DoseValue"],"0014":["CS","1-3","TissueHeterogeneityCorrection"],"0040":["DS","3","DVHNormalizationPoint"],"0042":["DS","1","DVHNormalizationDoseValue"],"0050":["SQ","1","DVHSequence"],"0052":["DS","1","DVHDoseScaling"],"0054":["CS","1","DVHVolumeUnits"],"0056":["IS","1","DVHNumberOfBins"],"0058":["DS","2-2n","DVHData"],"0060":["SQ","1","DVHReferencedROISequence"],"0062":["CS","1","DVHROIContributionType"],"0070":["DS","1","DVHMinimumDose"],"0072":["DS","1","DVHMaximumDose"],"0074":["DS","1","DVHMeanDose"]},3006:{"0000":["UL","1","GenericGroupLength"],"0002":["SH","1","StructureSetLabel"],"0004":["LO","1","StructureSetName"],"0006":["ST","1","StructureSetDescription"],"0008":["DA","1","StructureSetDate"],"0009":["TM","1","StructureSetTime"],"0010":["SQ","1","ReferencedFrameOfReferenceSequence"],"0012":["SQ","1","RTReferencedStudySequence"],"0014":["SQ","1","RTReferencedSeriesSequence"],"0016":["SQ","1","ContourImageSequence"],"0018":["SQ","1","PredecessorStructureSetSequence"],"0020":["SQ","1","StructureSetROISequence"],"0022":["IS","1","ROINumber"],"0024":["UI","1","ReferencedFrameOfReferenceUID"],"0026":["LO","1","ROIName"],"0028":["ST","1","ROIDescription"],"002A":["IS","3","ROIDisplayColor"],"002C":["DS","1","ROIVolume"],"0030":["SQ","1","RTRelatedROISequence"],"0033":["CS","1","RTROIRelationship"],"0036":["CS","1","ROIGenerationAlgorithm"],"0037":["SQ","1","ROIDerivationAlgorithmIdentificationSequence"],"0038":["LO","1","ROIGenerationDescription"],"0039":["SQ","1","ROIContourSequence"],"0040":["SQ","1","ContourSequence"],"0042":["CS","1","ContourGeometricType"],"0044":["DS","1","ContourSlabThickness"],"0045":["DS","3","ContourOffsetVector"],"0046":["IS","1","NumberOfContourPoints"],"0048":["IS","1","ContourNumber"],"0049":["IS","1-n","AttachedContours"],"004A":["SQ","1","SourcePixelPlanesCharacteristicsSequence"],"0050":["DS","3-3n","ContourData"],"0080":["SQ","1","RTROIObservationsSequence"],"0082":["IS","1","ObservationNumber"],"0084":["IS","1","ReferencedROINumber"],"0085":["SH","1","ROIObservationLabel"],"0086":["SQ","1","RTROIIdentificationCodeSequence"],"0088":["ST","1","ROIObservationDescription"],"00A0":["SQ","1","RelatedRTROIObservationsSequence"],"00A4":["CS","1","RTROIInterpretedType"],"00A6":["PN","1","ROIInterpreter"],"00B0":["SQ","1","ROIPhysicalPropertiesSequence"],"00B2":["CS","1","ROIPhysicalProperty"],"00B4":["DS","1","ROIPhysicalPropertyValue"],"00B6":["SQ","1","ROIElementalCompositionSequence"],"00B7":["US","1","ROIElementalCompositionAtomicNumber"],"00B8":["FL","1","ROIElementalCompositionAtomicMassFraction"],"00B9":["SQ","1","AdditionalRTROIIdentificationCodeSequence"],"00C0":["SQ","1","FrameOfReferenceRelationshipSequence"],"00C2":["UI","1","RelatedFrameOfReferenceUID"],"00C4":["CS","1","FrameOfReferenceTransformationType"],"00C6":["DS","16","FrameOfReferenceTransformationMatrix"],"00C8":["LO","1","FrameOfReferenceTransformationComment"],"00C9":["SQ","1","PatientLocationCoordinatesSequence"],"00CA":["SQ","1","PatientLocationCoordinatesCodeSequence"],"00CB":["SQ","1","PatientSupportPositionSequence"]},3008:{"0000":["UL","1","GenericGroupLength"],"0010":["SQ","1","MeasuredDoseReferenceSequence"],"0012":["ST","1","MeasuredDoseDescription"],"0014":["CS","1","MeasuredDoseType"],"0016":["DS","1","MeasuredDoseValue"],"0020":["SQ","1","TreatmentSessionBeamSequence"],"0021":["SQ","1","TreatmentSessionIonBeamSequence"],"0022":["IS","1","CurrentFractionNumber"],"0024":["DA","1","TreatmentControlPointDate"],"0025":["TM","1","TreatmentControlPointTime"],"002A":["CS","1","TreatmentTerminationStatus"],"002B":["SH","1","TreatmentTerminationCode"],"002C":["CS","1","TreatmentVerificationStatus"],"0030":["SQ","1","ReferencedTreatmentRecordSequence"],"0032":["DS","1","SpecifiedPrimaryMeterset"],"0033":["DS","1","SpecifiedSecondaryMeterset"],"0036":["DS","1","DeliveredPrimaryMeterset"],"0037":["DS","1","DeliveredSecondaryMeterset"],"003A":["DS","1","SpecifiedTreatmentTime"],"003B":["DS","1","DeliveredTreatmentTime"],"0040":["SQ","1","ControlPointDeliverySequence"],"0041":["SQ","1","IonControlPointDeliverySequence"],"0042":["DS","1","SpecifiedMeterset"],"0044":["DS","1","DeliveredMeterset"],"0045":["FL","1","MetersetRateSet"],"0046":["FL","1","MetersetRateDelivered"],"0047":["FL","1-n","ScanSpotMetersetsDelivered"],"0048":["DS","1","DoseRateDelivered"],"0050":["SQ","1","TreatmentSummaryCalculatedDoseReferenceSequence"],"0052":["DS","1","CumulativeDoseToDoseReference"],"0054":["DA","1","FirstTreatmentDate"],"0056":["DA","1","MostRecentTreatmentDate"],"005A":["IS","1","NumberOfFractionsDelivered"],"0060":["SQ","1","OverrideSequence"],"0061":["AT","1","ParameterSequencePointer"],"0062":["AT","1","OverrideParameterPointer"],"0063":["IS","1","ParameterItemIndex"],"0064":["IS","1","MeasuredDoseReferenceNumber"],"0065":["AT","1","ParameterPointer"],"0066":["ST","1","OverrideReason"],"0067":["US","1","ParameterValueNumber"],"0068":["SQ","1","CorrectedParameterSequence"],"006A":["FL","1","CorrectionValue"],"0070":["SQ","1","CalculatedDoseReferenceSequence"],"0072":["IS","1","CalculatedDoseReferenceNumber"],"0074":["ST","1","CalculatedDoseReferenceDescription"],"0076":["DS","1","CalculatedDoseReferenceDoseValue"],"0078":["DS","1","StartMeterset"],"007A":["DS","1","EndMeterset"],"0080":["SQ","1","ReferencedMeasuredDoseReferenceSequence"],"0082":["IS","1","ReferencedMeasuredDoseReferenceNumber"],"0090":["SQ","1","ReferencedCalculatedDoseReferenceSequence"],"0092":["IS","1","ReferencedCalculatedDoseReferenceNumber"],"00A0":["SQ","1","BeamLimitingDeviceLeafPairsSequence"],"00B0":["SQ","1","RecordedWedgeSequence"],"00C0":["SQ","1","RecordedCompensatorSequence"],"00D0":["SQ","1","RecordedBlockSequence"],"00D1":["SQ","1","RecordedBlockSlabSequence"],"00E0":["SQ","1","TreatmentSummaryMeasuredDoseReferenceSequence"],"00F0":["SQ","1","RecordedSnoutSequence"],"00F2":["SQ","1","RecordedRangeShifterSequence"],"00F4":["SQ","1","RecordedLateralSpreadingDeviceSequence"],"00F6":["SQ","1","RecordedRangeModulatorSequence"],"0100":["SQ","1","RecordedSourceSequence"],"0105":["LO","1","SourceSerialNumber"],"0110":["SQ","1","TreatmentSessionApplicationSetupSequence"],"0116":["CS","1","ApplicationSetupCheck"],"0120":["SQ","1","RecordedBrachyAccessoryDeviceSequence"],"0122":["IS","1","ReferencedBrachyAccessoryDeviceNumber"],"0130":["SQ","1","RecordedChannelSequence"],"0132":["DS","1","SpecifiedChannelTotalTime"],"0134":["DS","1","DeliveredChannelTotalTime"],"0136":["IS","1","SpecifiedNumberOfPulses"],"0138":["IS","1","DeliveredNumberOfPulses"],"013A":["DS","1","SpecifiedPulseRepetitionInterval"],"013C":["DS","1","DeliveredPulseRepetitionInterval"],"0140":["SQ","1","RecordedSourceApplicatorSequence"],"0142":["IS","1","ReferencedSourceApplicatorNumber"],"0150":["SQ","1","RecordedChannelShieldSequence"],"0152":["IS","1","ReferencedChannelShieldNumber"],"0160":["SQ","1","BrachyControlPointDeliveredSequence"],"0162":["DA","1","SafePositionExitDate"],"0164":["TM","1","SafePositionExitTime"],"0166":["DA","1","SafePositionReturnDate"],"0168":["TM","1","SafePositionReturnTime"],"0171":["SQ","1","PulseSpecificBrachyControlPointDeliveredSequence"],"0172":["US","1","PulseNumber"],"0173":["SQ","1","BrachyPulseControlPointDeliveredSequence"],"0200":["CS","1","CurrentTreatmentStatus"],"0202":["ST","1","TreatmentStatusComment"],"0220":["SQ","1","FractionGroupSummarySequence"],"0223":["IS","1","ReferencedFractionNumber"],"0224":["CS","1","FractionGroupType"],"0230":["CS","1","BeamStopperPosition"],"0240":["SQ","1","FractionStatusSummarySequence"],"0250":["DA","1","TreatmentDate"],"0251":["TM","1","TreatmentTime"]},"300A":{"0000":["UL","1","GenericGroupLength"],"0002":["SH","1","RTPlanLabel"],"0003":["LO","1","RTPlanName"],"0004":["ST","1","RTPlanDescription"],"0006":["DA","1","RTPlanDate"],"0007":["TM","1","RTPlanTime"],"0009":["LO","1-n","TreatmentProtocols"],"000A":["CS","1","PlanIntent"],"000B":["LO","1-n","TreatmentSites"],"000C":["CS","1","RTPlanGeometry"],"000E":["ST","1","PrescriptionDescription"],"0010":["SQ","1","DoseReferenceSequence"],"0012":["IS","1","DoseReferenceNumber"],"0013":["UI","1","DoseReferenceUID"],"0014":["CS","1","DoseReferenceStructureType"],"0015":["CS","1","NominalBeamEnergyUnit"],"0016":["LO","1","DoseReferenceDescription"],"0018":["DS","3","DoseReferencePointCoordinates"],"001A":["DS","1","NominalPriorDose"],"0020":["CS","1","DoseReferenceType"],"0021":["DS","1","ConstraintWeight"],"0022":["DS","1","DeliveryWarningDose"],"0023":["DS","1","DeliveryMaximumDose"],"0025":["DS","1","TargetMinimumDose"],"0026":["DS","1","TargetPrescriptionDose"],"0027":["DS","1","TargetMaximumDose"],"0028":["DS","1","TargetUnderdoseVolumeFraction"],"002A":["DS","1","OrganAtRiskFullVolumeDose"],"002B":["DS","1","OrganAtRiskLimitDose"],"002C":["DS","1","OrganAtRiskMaximumDose"],"002D":["DS","1","OrganAtRiskOverdoseVolumeFraction"],"0040":["SQ","1","ToleranceTableSequence"],"0042":["IS","1","ToleranceTableNumber"],"0043":["SH","1","ToleranceTableLabel"],"0044":["DS","1","GantryAngleTolerance"],"0046":["DS","1","BeamLimitingDeviceAngleTolerance"],"0048":["SQ","1","BeamLimitingDeviceToleranceSequence"],"004A":["DS","1","BeamLimitingDevicePositionTolerance"],"004B":["FL","1","SnoutPositionTolerance"],"004C":["DS","1","PatientSupportAngleTolerance"],"004E":["DS","1","TableTopEccentricAngleTolerance"],"004F":["FL","1","TableTopPitchAngleTolerance"],"0050":["FL","1","TableTopRollAngleTolerance"],"0051":["DS","1","TableTopVerticalPositionTolerance"],"0052":["DS","1","TableTopLongitudinalPositionTolerance"],"0053":["DS","1","TableTopLateralPositionTolerance"],"0055":["CS","1","RTPlanRelationship"],"0070":["SQ","1","FractionGroupSequence"],"0071":["IS","1","FractionGroupNumber"],"0072":["LO","1","FractionGroupDescription"],"0078":["IS","1","NumberOfFractionsPlanned"],"0079":["IS","1","NumberOfFractionPatternDigitsPerDay"],"007A":["IS","1","RepeatFractionCycleLength"],"007B":["LT","1","FractionPattern"],"0080":["IS","1","NumberOfBeams"],"0082":["DS","3","BeamDoseSpecificationPoint"],"0083":["UI","1","ReferencedDoseReferenceUID"],"0084":["DS","1","BeamDose"],"0086":["DS","1","BeamMeterset"],"0088":["FL","1","BeamDosePointDepth"],"0089":["FL","1","BeamDosePointEquivalentDepth"],"008A":["FL","1","BeamDosePointSSD"],"008B":["CS","1","BeamDoseMeaning"],"008C":["SQ","1","BeamDoseVerificationControlPointSequence"],"008D":["FL","1","AverageBeamDosePointDepth"],"008E":["FL","1","AverageBeamDosePointEquivalentDepth"],"008F":["FL","1","AverageBeamDosePointSSD"],"0090":["CS","1","BeamDoseType"],"0091":["DS","1","AlternateBeamDose"],"0092":["CS","1","AlternateBeamDoseType"],"0093":["CS","1","DepthValueAveragingFlag"],"0094":["DS","1","BeamDosePointSourceToExternalContourDistance"],"00A0":["IS","1","NumberOfBrachyApplicationSetups"],"00A2":["DS","3","BrachyApplicationSetupDoseSpecificationPoint"],"00A4":["DS","1","BrachyApplicationSetupDose"],"00B0":["SQ","1","BeamSequence"],"00B2":["SH","1","TreatmentMachineName"],"00B3":["CS","1","PrimaryDosimeterUnit"],"00B4":["DS","1","SourceAxisDistance"],"00B6":["SQ","1","BeamLimitingDeviceSequence"],"00B8":["CS","1","RTBeamLimitingDeviceType"],"00BA":["DS","1","SourceToBeamLimitingDeviceDistance"],"00BB":["FL","1","IsocenterToBeamLimitingDeviceDistance"],"00BC":["IS","1","NumberOfLeafJawPairs"],"00BE":["DS","3-n","LeafPositionBoundaries"],"00C0":["IS","1","BeamNumber"],"00C2":["LO","1","BeamName"],"00C3":["ST","1","BeamDescription"],"00C4":["CS","1","BeamType"],"00C5":["FD","1","BeamDeliveryDurationLimit"],"00C6":["CS","1","RadiationType"],"00C7":["CS","1","HighDoseTechniqueType"],"00C8":["IS","1","ReferenceImageNumber"],"00CA":["SQ","1","PlannedVerificationImageSequence"],"00CC":["LO","1-n","ImagingDeviceSpecificAcquisitionParameters"],"00CE":["CS","1","TreatmentDeliveryType"],"00D0":["IS","1","NumberOfWedges"],"00D1":["SQ","1","WedgeSequence"],"00D2":["IS","1","WedgeNumber"],"00D3":["CS","1","WedgeType"],"00D4":["SH","1","WedgeID"],"00D5":["IS","1","WedgeAngle"],"00D6":["DS","1","WedgeFactor"],"00D7":["FL","1","TotalWedgeTrayWaterEquivalentThickness"],"00D8":["DS","1","WedgeOrientation"],"00D9":["FL","1","IsocenterToWedgeTrayDistance"],"00DA":["DS","1","SourceToWedgeTrayDistance"],"00DB":["FL","1","WedgeThinEdgePosition"],"00DC":["SH","1","BolusID"],"00DD":["ST","1","BolusDescription"],"00DE":["DS","1","EffectiveWedgeAngle"],"00E0":["IS","1","NumberOfCompensators"],"00E1":["SH","1","MaterialID"],"00E2":["DS","1","TotalCompensatorTrayFactor"],"00E3":["SQ","1","CompensatorSequence"],"00E4":["IS","1","CompensatorNumber"],"00E5":["SH","1","CompensatorID"],"00E6":["DS","1","SourceToCompensatorTrayDistance"],"00E7":["IS","1","CompensatorRows"],"00E8":["IS","1","CompensatorColumns"],"00E9":["DS","2","CompensatorPixelSpacing"],"00EA":["DS","2","CompensatorPosition"],"00EB":["DS","1-n","CompensatorTransmissionData"],"00EC":["DS","1-n","CompensatorThicknessData"],"00ED":["IS","1","NumberOfBoli"],"00EE":["CS","1","CompensatorType"],"00EF":["SH","1","CompensatorTrayID"],"00F0":["IS","1","NumberOfBlocks"],"00F2":["DS","1","TotalBlockTrayFactor"],"00F3":["FL","1","TotalBlockTrayWaterEquivalentThickness"],"00F4":["SQ","1","BlockSequence"],"00F5":["SH","1","BlockTrayID"],"00F6":["DS","1","SourceToBlockTrayDistance"],"00F7":["FL","1","IsocenterToBlockTrayDistance"],"00F8":["CS","1","BlockType"],"00F9":["LO","1","AccessoryCode"],"00FA":["CS","1","BlockDivergence"],"00FB":["CS","1","BlockMountingPosition"],"00FC":["IS","1","BlockNumber"],"00FE":["LO","1","BlockName"],"0100":["DS","1","BlockThickness"],"0102":["DS","1","BlockTransmission"],"0104":["IS","1","BlockNumberOfPoints"],"0106":["DS","2-2n","BlockData"],"0107":["SQ","1","ApplicatorSequence"],"0108":["SH","1","ApplicatorID"],"0109":["CS","1","ApplicatorType"],"010A":["LO","1","ApplicatorDescription"],"010C":["DS","1","CumulativeDoseReferenceCoefficient"],"010E":["DS","1","FinalCumulativeMetersetWeight"],"0110":["IS","1","NumberOfControlPoints"],"0111":["SQ","1","ControlPointSequence"],"0112":["IS","1","ControlPointIndex"],"0114":["DS","1","NominalBeamEnergy"],"0115":["DS","1","DoseRateSet"],"0116":["SQ","1","WedgePositionSequence"],"0118":["CS","1","WedgePosition"],"011A":["SQ","1","BeamLimitingDevicePositionSequence"],"011C":["DS","2-2n","LeafJawPositions"],"011E":["DS","1","GantryAngle"],"011F":["CS","1","GantryRotationDirection"],"0120":["DS","1","BeamLimitingDeviceAngle"],"0121":["CS","1","BeamLimitingDeviceRotationDirection"],"0122":["DS","1","PatientSupportAngle"],"0123":["CS","1","PatientSupportRotationDirection"],"0124":["DS","1","TableTopEccentricAxisDistance"],"0125":["DS","1","TableTopEccentricAngle"],"0126":["CS","1","TableTopEccentricRotationDirection"],"0128":["DS","1","TableTopVerticalPosition"],"0129":["DS","1","TableTopLongitudinalPosition"],"012A":["DS","1","TableTopLateralPosition"],"012C":["DS","3","IsocenterPosition"],"012E":["DS","3","SurfaceEntryPoint"],"0130":["DS","1","SourceToSurfaceDistance"],"0131":["FL","1","AverageBeamDosePointSourceToExternalContourDistance"],"0132":["FL","1","SourceToExternalContourDistance"],"0133":["FL","3","ExternalContourEntryPoint"],"0134":["DS","1","CumulativeMetersetWeight"],"0140":["FL","1","TableTopPitchAngle"],"0142":["CS","1","TableTopPitchRotationDirection"],"0144":["FL","1","TableTopRollAngle"],"0146":["CS","1","TableTopRollRotationDirection"],"0148":["FL","1","HeadFixationAngle"],"014A":["FL","1","GantryPitchAngle"],"014C":["CS","1","GantryPitchRotationDirection"],"014E":["FL","1","GantryPitchAngleTolerance"],"0150":["CS","1","FixationEye"],"0151":["DS","1","ChairHeadFramePosition"],"0152":["DS","1","HeadFixationAngleTolerance"],"0153":["DS","1","ChairHeadFramePositionTolerance"],"0154":["DS","1","FixationLightAzimuthalAngleTolerance"],"0155":["DS","1","FixationLightPolarAngleTolerance"],"0180":["SQ","1","PatientSetupSequence"],"0182":["IS","1","PatientSetupNumber"],"0183":["LO","1","PatientSetupLabel"],"0184":["LO","1","PatientAdditionalPosition"],"0190":["SQ","1","FixationDeviceSequence"],"0192":["CS","1","FixationDeviceType"],"0194":["SH","1","FixationDeviceLabel"],"0196":["ST","1","FixationDeviceDescription"],"0198":["SH","1","FixationDevicePosition"],"0199":["FL","1","FixationDevicePitchAngle"],"019A":["FL","1","FixationDeviceRollAngle"],"01A0":["SQ","1","ShieldingDeviceSequence"],"01A2":["CS","1","ShieldingDeviceType"],"01A4":["SH","1","ShieldingDeviceLabel"],"01A6":["ST","1","ShieldingDeviceDescription"],"01A8":["SH","1","ShieldingDevicePosition"],"01B0":["CS","1","SetupTechnique"],"01B2":["ST","1","SetupTechniqueDescription"],"01B4":["SQ","1","SetupDeviceSequence"],"01B6":["CS","1","SetupDeviceType"],"01B8":["SH","1","SetupDeviceLabel"],"01BA":["ST","1","SetupDeviceDescription"],"01BC":["DS","1","SetupDeviceParameter"],"01D0":["ST","1","SetupReferenceDescription"],"01D2":["DS","1","TableTopVerticalSetupDisplacement"],"01D4":["DS","1","TableTopLongitudinalSetupDisplacement"],"01D6":["DS","1","TableTopLateralSetupDisplacement"],"0200":["CS","1","BrachyTreatmentTechnique"],"0202":["CS","1","BrachyTreatmentType"],"0206":["SQ","1","TreatmentMachineSequence"],"0210":["SQ","1","SourceSequence"],"0212":["IS","1","SourceNumber"],"0214":["CS","1","SourceType"],"0216":["LO","1","SourceManufacturer"],"0218":["DS","1","ActiveSourceDiameter"],"021A":["DS","1","ActiveSourceLength"],"021B":["SH","1","SourceModelID"],"021C":["LO","1","SourceDescription"],"0222":["DS","1","SourceEncapsulationNominalThickness"],"0224":["DS","1","SourceEncapsulationNominalTransmission"],"0226":["LO","1","SourceIsotopeName"],"0228":["DS","1","SourceIsotopeHalfLife"],"0229":["CS","1","SourceStrengthUnits"],"022A":["DS","1","ReferenceAirKermaRate"],"022B":["DS","1","SourceStrength"],"022C":["DA","1","SourceStrengthReferenceDate"],"022E":["TM","1","SourceStrengthReferenceTime"],"0230":["SQ","1","ApplicationSetupSequence"],"0232":["CS","1","ApplicationSetupType"],"0234":["IS","1","ApplicationSetupNumber"],"0236":["LO","1","ApplicationSetupName"],"0238":["LO","1","ApplicationSetupManufacturer"],"0240":["IS","1","TemplateNumber"],"0242":["SH","1","TemplateType"],"0244":["LO","1","TemplateName"],"0250":["DS","1","TotalReferenceAirKerma"],"0260":["SQ","1","BrachyAccessoryDeviceSequence"],"0262":["IS","1","BrachyAccessoryDeviceNumber"],"0263":["SH","1","BrachyAccessoryDeviceID"],"0264":["CS","1","BrachyAccessoryDeviceType"],"0266":["LO","1","BrachyAccessoryDeviceName"],"026A":["DS","1","BrachyAccessoryDeviceNominalThickness"],"026C":["DS","1","BrachyAccessoryDeviceNominalTransmission"],"0271":["DS","1","ChannelEffectiveLength"],"0272":["DS","1","ChannelInnerLength"],"0273":["SH","1","AfterloaderChannelID"],"0274":["DS","1","SourceApplicatorTipLength"],"0280":["SQ","1","ChannelSequence"],"0282":["IS","1","ChannelNumber"],"0284":["DS","1","ChannelLength"],"0286":["DS","1","ChannelTotalTime"],"0288":["CS","1","SourceMovementType"],"028A":["IS","1","NumberOfPulses"],"028C":["DS","1","PulseRepetitionInterval"],"0290":["IS","1","SourceApplicatorNumber"],"0291":["SH","1","SourceApplicatorID"],"0292":["CS","1","SourceApplicatorType"],"0294":["LO","1","SourceApplicatorName"],"0296":["DS","1","SourceApplicatorLength"],"0298":["LO","1","SourceApplicatorManufacturer"],"029C":["DS","1","SourceApplicatorWallNominalThickness"],"029E":["DS","1","SourceApplicatorWallNominalTransmission"],"02A0":["DS","1","SourceApplicatorStepSize"],"02A1":["IS","1","ApplicatorShapeReferencedROINumber"],"02A2":["IS","1","TransferTubeNumber"],"02A4":["DS","1","TransferTubeLength"],"02B0":["SQ","1","ChannelShieldSequence"],"02B2":["IS","1","ChannelShieldNumber"],"02B3":["SH","1","ChannelShieldID"],"02B4":["LO","1","ChannelShieldName"],"02B8":["DS","1","ChannelShieldNominalThickness"],"02BA":["DS","1","ChannelShieldNominalTransmission"],"02C8":["DS","1","FinalCumulativeTimeWeight"],"02D0":["SQ","1","BrachyControlPointSequence"],"02D2":["DS","1","ControlPointRelativePosition"],"02D4":["DS","3","ControlPoint3DPosition"],"02D6":["DS","1","CumulativeTimeWeight"],"02E0":["CS","1","CompensatorDivergence"],"02E1":["CS","1","CompensatorMountingPosition"],"02E2":["DS","1-n","SourceToCompensatorDistance"],"02E3":["FL","1","TotalCompensatorTrayWaterEquivalentThickness"],"02E4":["FL","1","IsocenterToCompensatorTrayDistance"],"02E5":["FL","1","CompensatorColumnOffset"],"02E6":["FL","1-n","IsocenterToCompensatorDistances"],"02E7":["FL","1","CompensatorRelativeStoppingPowerRatio"],"02E8":["FL","1","CompensatorMillingToolDiameter"],"02EA":["SQ","1","IonRangeCompensatorSequence"],"02EB":["LT","1","CompensatorDescription"],"0302":["IS","1","RadiationMassNumber"],"0304":["IS","1","RadiationAtomicNumber"],"0306":["SS","1","RadiationChargeState"],"0308":["CS","1","ScanMode"],"0309":["CS","1","ModulatedScanModeType"],"030A":["FL","2","VirtualSourceAxisDistances"],"030C":["SQ","1","SnoutSequence"],"030D":["FL","1","SnoutPosition"],"030F":["SH","1","SnoutID"],"0312":["IS","1","NumberOfRangeShifters"],"0314":["SQ","1","RangeShifterSequence"],"0316":["IS","1","RangeShifterNumber"],"0318":["SH","1","RangeShifterID"],"0320":["CS","1","RangeShifterType"],"0322":["LO","1","RangeShifterDescription"],"0330":["IS","1","NumberOfLateralSpreadingDevices"],"0332":["SQ","1","LateralSpreadingDeviceSequence"],"0334":["IS","1","LateralSpreadingDeviceNumber"],"0336":["SH","1","LateralSpreadingDeviceID"],"0338":["CS","1","LateralSpreadingDeviceType"],"033A":["LO","1","LateralSpreadingDeviceDescription"],"033C":["FL","1","LateralSpreadingDeviceWaterEquivalentThickness"],"0340":["IS","1","NumberOfRangeModulators"],"0342":["SQ","1","RangeModulatorSequence"],"0344":["IS","1","RangeModulatorNumber"],"0346":["SH","1","RangeModulatorID"],"0348":["CS","1","RangeModulatorType"],"034A":["LO","1","RangeModulatorDescription"],"034C":["SH","1","BeamCurrentModulationID"],"0350":["CS","1","PatientSupportType"],"0352":["SH","1","PatientSupportID"],"0354":["LO","1","PatientSupportAccessoryCode"],"0355":["LO","1","TrayAccessoryCode"],"0356":["FL","1","FixationLightAzimuthalAngle"],"0358":["FL","1","FixationLightPolarAngle"],"035A":["FL","1","MetersetRate"],"0360":["SQ","1","RangeShifterSettingsSequence"],"0362":["LO","1","RangeShifterSetting"],"0364":["FL","1","IsocenterToRangeShifterDistance"],"0366":["FL","1","RangeShifterWaterEquivalentThickness"],"0370":["SQ","1","LateralSpreadingDeviceSettingsSequence"],"0372":["LO","1","LateralSpreadingDeviceSetting"],"0374":["FL","1","IsocenterToLateralSpreadingDeviceDistance"],"0380":["SQ","1","RangeModulatorSettingsSequence"],"0382":["FL","1","RangeModulatorGatingStartValue"],"0384":["FL","1","RangeModulatorGatingStopValue"],"0386":["FL","1","RangeModulatorGatingStartWaterEquivalentThickness"],"0388":["FL","1","RangeModulatorGatingStopWaterEquivalentThickness"],"038A":["FL","1","IsocenterToRangeModulatorDistance"],"038F":["FL","1-n","ScanSpotTimeOffset"],"0390":["SH","1","ScanSpotTuneID"],"0391":["IS","1-n","ScanSpotPrescribedIndices"],"0392":["IS","1","NumberOfScanSpotPositions"],"0393":["CS","1","ScanSpotReordered"],"0394":["FL","1-n","ScanSpotPositionMap"],"0395":["CS","1","ScanSpotReorderingAllowed"],"0396":["FL","1-n","ScanSpotMetersetWeights"],"0398":["FL","2","ScanningSpotSize"],"0399":["FL","2-2n","ScanSpotSizesDelivered"],"039A":["IS","1","NumberOfPaintings"],"03A0":["SQ","1","IonToleranceTableSequence"],"03A2":["SQ","1","IonBeamSequence"],"03A4":["SQ","1","IonBeamLimitingDeviceSequence"],"03A6":["SQ","1","IonBlockSequence"],"03A8":["SQ","1","IonControlPointSequence"],"03AA":["SQ","1","IonWedgeSequence"],"03AC":["SQ","1","IonWedgePositionSequence"],"0401":["SQ","1","ReferencedSetupImageSequence"],"0402":["ST","1","SetupImageComment"],"0410":["SQ","1","MotionSynchronizationSequence"],"0412":["FL","3","ControlPointOrientation"],"0420":["SQ","1","GeneralAccessorySequence"],"0421":["SH","1","GeneralAccessoryID"],"0422":["ST","1","GeneralAccessoryDescription"],"0423":["CS","1","GeneralAccessoryType"],"0424":["IS","1","GeneralAccessoryNumber"],"0425":["FL","1","SourceToGeneralAccessoryDistance"],"0426":["DS","1","IsocenterToGeneralAccessoryDistance"],"0431":["SQ","1","ApplicatorGeometrySequence"],"0432":["CS","1","ApplicatorApertureShape"],"0433":["FL","1","ApplicatorOpening"],"0434":["FL","1","ApplicatorOpeningX"],"0435":["FL","1","ApplicatorOpeningY"],"0436":["FL","1","SourceToApplicatorMountingPositionDistance"],"0440":["IS","1","NumberOfBlockSlabItems"],"0441":["SQ","1","BlockSlabSequence"],"0442":["DS","1","BlockSlabThickness"],"0443":["US","1","BlockSlabNumber"],"0450":["SQ","1","DeviceMotionControlSequence"],"0451":["CS","1","DeviceMotionExecutionMode"],"0452":["CS","1","DeviceMotionObservationMode"],"0453":["SQ","1","DeviceMotionParameterCodeSequence"],"0501":["FL","1","DistalDepthFraction"],"0502":["FL","1","DistalDepth"],"0503":["FL","2","NominalRangeModulationFractions"],"0504":["FL","2","NominalRangeModulatedRegionDepths"],"0505":["SQ","1","DepthDoseParametersSequence"],"0506":["SQ","1","DeliveredDepthDoseParametersSequence"],"0507":["FL","1","DeliveredDistalDepthFraction"],"0508":["FL","1","DeliveredDistalDepth"],"0509":["FL","2","DeliveredNominalRangeModulationFractions"],"0510":["FL","2","DeliveredNominalRangeModulatedRegionDepths"],"0511":["CS","1","DeliveredReferenceDoseDefinition"],"0512":["CS","1","ReferenceDoseDefinition"],"0600":["US","1","RTControlPointIndex"],"0601":["US","1","RadiationGenerationModeIndex"],"0602":["US","1","ReferencedDefinedDeviceIndex"],"0603":["US","1","RadiationDoseIdentificationIndex"],"0604":["US","1","NumberOfRTControlPoints"],"0605":["US","1","ReferencedRadiationGenerationModeIndex"],"0606":["US","1","TreatmentPositionIndex"],"0607":["US","1","ReferencedDeviceIndex"],"0608":["LO","1","TreatmentPositionGroupLabel"],"0609":["UI","1","TreatmentPositionGroupUID"],"060A":["SQ","1","TreatmentPositionGroupSequence"],"060B":["US","1","ReferencedTreatmentPositionIndex"],"060C":["US","1","ReferencedRadiationDoseIdentificationIndex"],"060D":["FD","1","RTAccessoryHolderWaterEquivalentThickness"],"060E":["US","1","ReferencedRTAccessoryHolderDeviceIndex"],"060F":["CS","1","RTAccessoryHolderSlotExistenceFlag"],"0610":["SQ","1","RTAccessoryHolderSlotSequence"],"0611":["LO","1","RTAccessoryHolderSlotID"],"0612":["FD","1","RTAccessoryHolderSlotDistance"],"0613":["FD","1","RTAccessorySlotDistance"],"0614":["SQ","1","RTAccessoryHolderDefinitionSequence"],"0615":["LO","1","RTAccessoryDeviceSlotID"],"0616":["SQ","1","RTRadiationSequence"],"0617":["SQ","1","RadiationDoseSequence"],"0618":["SQ","1","RadiationDoseIdentificationSequence"],"0619":["LO","1","RadiationDoseIdentificationLabel"],"061A":["CS","1","ReferenceDoseType"],"061B":["CS","1","PrimaryDoseValueIndicator"],"061C":["SQ","1","DoseValuesSequence"],"061D":["CS","1-n","DoseValuePurpose"],"061E":["FD","3","ReferenceDosePointCoordinates"],"061F":["SQ","1","RadiationDoseValuesParametersSequence"],"0620":["SQ","1","MetersetToDoseMappingSequence"],"0621":["SQ","1","ExpectedInVivoMeasurementValuesSequence"],"0622":["US","1","ExpectedInVivoMeasurementValueIndex"],"0623":["LO","1","RadiationDoseInVivoMeasurementLabel"],"0624":["FD","2","RadiationDoseCentralAxisDisplacement"],"0625":["FD","1","RadiationDoseValue"],"0626":["FD","1","RadiationDoseSourceToSkinDistance"],"0627":["FD","3","RadiationDoseMeasurementPointCoordinates"],"0628":["FD","1","RadiationDoseSourceToExternalContourDistance"],"0629":["SQ","1","RTToleranceSetSequence"],"062A":["LO","1","RTToleranceSetLabel"],"062B":["SQ","1","AttributeToleranceValuesSequence"],"062C":["FD","1","ToleranceValue"],"062D":["SQ","1","PatientSupportPositionToleranceSequence"],"062E":["FD","1","TreatmentTimeLimit"],"062F":["SQ","1","CArmPhotonElectronControlPointSequence"],"0630":["SQ","1","ReferencedRTRadiationSequence"],"0631":["SQ","1","ReferencedRTInstanceSequence"],"0632":["SQ","1","ReferencedRTPatientSetupSequence"],"0634":["FD","1","SourceToPatientSurfaceDistance"],"0635":["SQ","1","TreatmentMachineSpecialModeCodeSequence"],"0636":["US","1","IntendedNumberOfFractions"],"0637":["CS","1","RTRadiationSetIntent"],"0638":["CS","1","RTRadiationPhysicalAndGeometricContentDetailFlag"],"0639":["CS","1","RTRecordFlag"],"063A":["SQ","1","TreatmentDeviceIdentificationSequence"],"063B":["SQ","1","ReferencedRTPhysicianIntentSequence"],"063C":["FD","1","CumulativeMeterset"],"063D":["FD","1","DeliveryRate"],"063E":["SQ","1","DeliveryRateUnitSequence"],"063F":["SQ","1","TreatmentPositionSequence"],"0640":["FD","1","RadiationSourceAxisDistance"],"0641":["US","1","NumberOfRTBeamLimitingDevices"],"0642":["FD","1","RTBeamLimitingDeviceProximalDistance"],"0643":["FD","1","RTBeamLimitingDeviceDistalDistance"],"0644":["SQ","1","ParallelRTBeamDelimiterDeviceOrientationLabelCodeSequence"],"0645":["FD","1","BeamModifierOrientationAngle"],"0646":["SQ","1","FixedRTBeamDelimiterDeviceSequence"],"0647":["SQ","1","ParallelRTBeamDelimiterDeviceSequence"],"0648":["US","1","NumberOfParallelRTBeamDelimiters"],"0649":["FD","2-n","ParallelRTBeamDelimiterBoundaries"],"064A":["FD","2-n","ParallelRTBeamDelimiterPositions"],"064B":["FD","2","RTBeamLimitingDeviceOffset"],"064C":["SQ","1","RTBeamDelimiterGeometrySequence"],"064D":["SQ","1","RTBeamLimitingDeviceDefinitionSequence"],"064E":["CS","1","ParallelRTBeamDelimiterOpeningMode"],"064F":["CS","1-n","ParallelRTBeamDelimiterLeafMountingSide"],"0650":["UI","1","PatientSetupUID"],"0651":["SQ","1","WedgeDefinitionSequence"],"0652":["FD","1","RadiationBeamWedgeAngle"],"0653":["FD","1","RadiationBeamWedgeThinEdgeDistance"],"0654":["FD","1","RadiationBeamEffectiveWedgeAngle"],"0655":["US","1","NumberOfWedgePositions"],"0656":["SQ","1","RTBeamLimitingDeviceOpeningSequence"],"0657":["US","1","NumberOfRTBeamLimitingDeviceOpenings"],"0658":["SQ","1","RadiationDosimeterUnitSequence"],"0659":["SQ","1","RTDeviceDistanceReferenceLocationCodeSequence"],"065A":["SQ","1","RadiationDeviceConfigurationAndCommissioningKeySequence"],"065B":["SQ","1","PatientSupportPositionParameterSequence"],"065C":["CS","1","PatientSupportPositionSpecificationMethod"],"065D":["SQ","1","PatientSupportPositionDeviceParameterSequence"],"065E":["US","1","DeviceOrderIndex"],"065F":["US","1","PatientSupportPositionParameterOrderIndex"],"0660":["SQ","1","PatientSupportPositionDeviceToleranceSequence"],"0661":["US","1","PatientSupportPositionToleranceOrderIndex"],"0662":["SQ","1","CompensatorDefinitionSequence"],"0663":["CS","1","CompensatorMapOrientation"],"0664":["OF","1","CompensatorProximalThicknessMap"],"0665":["OF","1","CompensatorDistalThicknessMap"],"0666":["FD","1","CompensatorBasePlaneOffset"],"0667":["SQ","1","CompensatorShapeFabricationCodeSequence"],"0668":["SQ","1","CompensatorShapeSequence"],"0669":["FD","1","RadiationBeamCompensatorMillingToolDiameter"],"066A":["SQ","1","BlockDefinitionSequence"],"066B":["OF","1","BlockEdgeData"],"066C":["CS","1","BlockOrientation"],"066D":["FD","1","RadiationBeamBlockThickness"],"066E":["FD","1","RadiationBeamBlockSlabThickness"],"066F":["SQ","1","BlockEdgeDataSequence"],"0670":["US","1","NumberOfRTAccessoryHolders"],"0671":["SQ","1","GeneralAccessoryDefinitionSequence"],"0672":["US","1","NumberOfGeneralAccessories"],"0673":["SQ","1","BolusDefinitionSequence"],"0674":["US","1","NumberOfBoluses"],"0675":["UI","1","EquipmentFrameOfReferenceUID"],"0676":["ST","1","EquipmentFrameOfReferenceDescription"],"0677":["SQ","1","EquipmentReferencePointCoordinatesSequence"],"0678":["SQ","1","EquipmentReferencePointCodeSequence"],"0679":["FD","1","RTBeamLimitingDeviceAngle"],"067A":["FD","1","SourceRollAngle"],"067B":["SQ","1","RadiationGenerationModeSequence"],"067C":["SH","1","RadiationGenerationModeLabel"],"067D":["ST","1","RadiationGenerationModeDescription"],"067E":["SQ","1","RadiationGenerationModeMachineCodeSequence"],"067F":["SQ","1","RadiationTypeCodeSequence"],"0680":["DS","1","NominalEnergy"],"0681":["DS","1","MinimumNominalEnergy"],"0682":["DS","1","MaximumNominalEnergy"],"0683":["SQ","1","RadiationFluenceModifierCodeSequence"],"0684":["SQ","1","EnergyUnitCodeSequence"],"0685":["US","1","NumberOfRadiationGenerationModes"],"0686":["SQ","1","PatientSupportDevicesSequence"],"0687":["US","1","NumberOfPatientSupportDevices"],"0688":["FD","1","RTBeamModifierDefinitionDistance"],"0689":["SQ","1","BeamAreaLimitSequence"],"068A":["SQ","1","ReferencedRTPrescriptionSequence"],"0700":["UI","1","TreatmentSessionUID"],"0701":["CS","1","RTRadiationUsage"],"0702":["SQ","1","ReferencedRTRadiationSetSequence"],"0703":["SQ","1","ReferencedRTRadiationRecordSequence"],"0704":["US","1","RTRadiationSetDeliveryNumber"],"0705":["US","1","ClinicalFractionNumber"],"0706":["CS","1","RTTreatmentFractionCompletionStatus"],"0707":["CS","1","RTRadiationSetUsage"],"0708":["CS","1","TreatmentDeliveryContinuationFlag"],"0709":["CS","1","TreatmentRecordContentOrigin"],"0714":["CS","1","RTTreatmentTerminationStatus"],"0715":["SQ","1","RTTreatmentTerminationReasonCodeSequence"],"0716":["SQ","1","MachineSpecificTreatmentTerminationCodeSequence"],"0722":["SQ","1","RTRadiationSalvageRecordControlPointSequence"],"0723":["CS","1","StartingMetersetValueKnownFlag"],"0730":["ST","1","TreatmentTerminationDescription"],"0731":["SQ","1","TreatmentToleranceViolationSequence"],"0732":["CS","1","TreatmentToleranceViolationCategory"],"0733":["SQ","1","TreatmentToleranceViolationAttributeSequence"],"0734":["ST","1","TreatmentToleranceViolationDescription"],"0735":["ST","1","TreatmentToleranceViolationIdentification"],"0736":["DT","1","TreatmentToleranceViolationDateTime"],"073A":["DT","1","RecordedRTControlPointDateTime"],"073B":["US","1","ReferencedRadiationRTControlPointIndex"],"073E":["SQ","1","AlternateValueSequence"],"073F":["SQ","1","ConfirmationSequence"],"0740":["SQ","1","InterlockSequence"],"0741":["DT","1","InterlockDateTime"],"0742":["ST","1","InterlockDescription"],"0743":["SQ","1","InterlockOriginatingDeviceSequence"],"0744":["SQ","1","InterlockCodeSequence"],"0745":["SQ","1","InterlockResolutionCodeSequence"],"0746":["SQ","1","InterlockResolutionUserSequence"],"0760":["DT","1","OverrideDateTime"],"0761":["SQ","1","TreatmentToleranceViolationTypeCodeSequence"],"0762":["SQ","1","TreatmentToleranceViolationCauseCodeSequence"],"0772":["SQ","1","MeasuredMetersetToDoseMappingSequence"],"0773":["US","1","ReferencedExpectedInVivoMeasurementValueIndex"],"0774":["SQ","1","DoseMeasurementDeviceCodeSequence"],"0780":["SQ","1","AdditionalParameterRecordingInstanceSequence"],"0782":["US","1",""],"0783":["ST","1","InterlockOriginDescription"],"0784":["SQ","1","RTPatientPositionScopeSequence"],"0785":["UI","1","ReferencedTreatmentPositionGroupUID"],"0786":["US","1","RadiationOrderIndex"],"0787":["SQ","1","OmittedRadiationSequence"],"0788":["SQ","1","ReasonForOmissionCodeSequence"],"0789":["SQ","1","RTDeliveryStartPatientPositionSequence"],"078A":["SQ","1","RTTreatmentPreparationPatientPositionSequence"],"078B":["SQ","1","ReferencedRTTreatmentPreparationSequence"],"078C":["SQ","1","ReferencedPatientSetupPhotoSequence"],"078D":["SQ","1","PatientTreatmentPreparationMethodCodeSequence"],"078E":["LT","1","PatientTreatmentPreparationProcedureParameterDescription"],"078F":["SQ","1","PatientTreatmentPreparationDeviceSequence"],"0790":["SQ","1","PatientTreatmentPreparationProcedureSequence"],"0791":["SQ","1","PatientTreatmentPreparationProcedureCodeSequence"],"0792":["LT","1","PatientTreatmentPreparationMethodDescription"],"0793":["SQ","1","PatientTreatmentPreparationProcedureParameterSequence"],"0794":["LT","1","PatientSetupPhotoDescription"],"0795":["US","1","PatientTreatmentPreparationProcedureIndex"],"0796":["US","1","ReferencedPatientSetupProcedureIndex"],"0797":["SQ","1","RTRadiationTaskSequence"],"0798":["SQ","1","RTPatientPositionDisplacementSequence"],"0799":["SQ","1","RTPatientPositionSequence"],"079A":["LO","1","DisplacementReferenceLabel"],"079B":["FD","16","DisplacementMatrix"],"079C":["SQ","1","PatientSupportDisplacementSequence"],"079D":["SQ","1","DisplacementReferenceLocationCodeSequence"],"079E":["CS","1","RTRadiationSetDeliveryUsage"]},"300C":{"0000":["UL","1","GenericGroupLength"],"0002":["SQ","1","ReferencedRTPlanSequence"],"0004":["SQ","1","ReferencedBeamSequence"],"0006":["IS","1","ReferencedBeamNumber"],"0007":["IS","1","ReferencedReferenceImageNumber"],"0008":["DS","1","StartCumulativeMetersetWeight"],"0009":["DS","1","EndCumulativeMetersetWeight"],"000A":["SQ","1","ReferencedBrachyApplicationSetupSequence"],"000C":["IS","1","ReferencedBrachyApplicationSetupNumber"],"000E":["IS","1","ReferencedSourceNumber"],"0020":["SQ","1","ReferencedFractionGroupSequence"],"0022":["IS","1","ReferencedFractionGroupNumber"],"0040":["SQ","1","ReferencedVerificationImageSequence"],"0042":["SQ","1","ReferencedReferenceImageSequence"],"0050":["SQ","1","ReferencedDoseReferenceSequence"],"0051":["IS","1","ReferencedDoseReferenceNumber"],"0055":["SQ","1","BrachyReferencedDoseReferenceSequence"],"0060":["SQ","1","ReferencedStructureSetSequence"],"006A":["IS","1","ReferencedPatientSetupNumber"],"0080":["SQ","1","ReferencedDoseSequence"],"00A0":["IS","1","ReferencedToleranceTableNumber"],"00B0":["SQ","1","ReferencedBolusSequence"],"00C0":["IS","1","ReferencedWedgeNumber"],"00D0":["IS","1","ReferencedCompensatorNumber"],"00E0":["IS","1","ReferencedBlockNumber"],"00F0":["IS","1","ReferencedControlPointIndex"],"00F2":["SQ","1","ReferencedControlPointSequence"],"00F4":["IS","1","ReferencedStartControlPointIndex"],"00F6":["IS","1","ReferencedStopControlPointIndex"],"0100":["IS","1","ReferencedRangeShifterNumber"],"0102":["IS","1","ReferencedLateralSpreadingDeviceNumber"],"0104":["IS","1","ReferencedRangeModulatorNumber"],"0111":["SQ","1","OmittedBeamTaskSequence"],"0112":["CS","1","ReasonForOmission"],"0113":["LO","1","ReasonForOmissionDescription"],"0114":["SQ","1","PrescriptionOverviewSequence"],"0115":["FL","1","TotalPrescriptionDose"],"0116":["SQ","1","PlanOverviewSequence"],"0117":["US","1","PlanOverviewIndex"],"0118":["US","1","ReferencedPlanOverviewIndex"],"0119":["US","1","NumberOfFractionsIncluded"],"0120":["SQ","1","DoseCalibrationConditionsSequence"],"0121":["FD","1","AbsorbedDoseToMetersetRatio"],"0122":["FD","2","DelineatedRadiationFieldSize"],"0123":["CS","1","DoseCalibrationConditionsVerifiedFlag"],"0124":["FD","1","CalibrationReferencePointDepth"],"0125":["SQ","1","GatingBeamHoldTransitionSequence"],"0126":["CS","1","BeamHoldTransition"],"0127":["DT","1","BeamHoldTransitionDateTime"],"0128":["SQ","1","BeamHoldOriginatingDeviceSequence"]},"300E":{"0000":["UL","1","GenericGroupLength"],"0002":["CS","1","ApprovalStatus"],"0004":["DA","1","ReviewDate"],"0005":["TM","1","ReviewTime"],"0008":["PN","1","ReviewerName"]},3010:{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","RadiobiologicalDoseEffectSequence"],"0002":["CS","1","RadiobiologicalDoseEffectFlag"],"0003":["SQ","1","EffectiveDoseCalculationMethodCategoryCodeSequence"],"0004":["SQ","1","EffectiveDoseCalculationMethodCodeSequence"],"0005":["LO","1","EffectiveDoseCalculationMethodDescription"],"0006":["UI","1","ConceptualVolumeUID"],"0007":["SQ","1","OriginatingSOPInstanceReferenceSequence"],"0008":["SQ","1","ConceptualVolumeConstituentSequence"],"0009":["SQ","1","EquivalentConceptualVolumeInstanceReferenceSequence"],"000A":["SQ","1","EquivalentConceptualVolumesSequence"],"000B":["UI","1","ReferencedConceptualVolumeUID"],"000C":["UT","1","ConceptualVolumeCombinationExpression"],"000D":["US","1","ConceptualVolumeConstituentIndex"],"000E":["CS","1","ConceptualVolumeCombinationFlag"],"000F":["ST","1","ConceptualVolumeCombinationDescription"],"0010":["CS","1","ConceptualVolumeSegmentationDefinedFlag"],"0011":["SQ","1","ConceptualVolumeSegmentationReferenceSequence"],"0012":["SQ","1","ConceptualVolumeConstituentSegmentationReferenceSequence"],"0013":["UI","1","ConstituentConceptualVolumeUID"],"0014":["SQ","1","DerivationConceptualVolumeSequence"],"0015":["UI","1","SourceConceptualVolumeUID"],"0016":["SQ","1","ConceptualVolumeDerivationAlgorithmSequence"],"0017":["ST","1","ConceptualVolumeDescription"],"0018":["SQ","1","SourceConceptualVolumeSequence"],"0019":["SQ","1","AuthorIdentificationSequence"],"001A":["LO","1","ManufacturerModelVersion"],"001B":["UC","1","DeviceAlternateIdentifier"],"001C":["CS","1","DeviceAlternateIdentifierType"],"001D":["LT","1","DeviceAlternateIdentifierFormat"],"001E":["LO","1","SegmentationCreationTemplateLabel"],"001F":["UI","1","SegmentationTemplateUID"],"0020":["US","1","ReferencedSegmentReferenceIndex"],"0021":["SQ","1","SegmentReferenceSequence"],"0022":["US","1","SegmentReferenceIndex"],"0023":["SQ","1","DirectSegmentReferenceSequence"],"0024":["SQ","1","CombinationSegmentReferenceSequence"],"0025":["SQ","1","ConceptualVolumeSequence"],"0026":["SQ","1","SegmentedRTAccessoryDeviceSequence"],"0027":["SQ","1","SegmentCharacteristicsSequence"],"0028":["SQ","1","RelatedSegmentCharacteristicsSequence"],"0029":["US","1","SegmentCharacteristicsPrecedence"],"002A":["SQ","1","RTSegmentAnnotationSequence"],"002B":["SQ","1","SegmentAnnotationCategoryCodeSequence"],"002C":["SQ","1","SegmentAnnotationTypeCodeSequence"],"002D":["LO","1","DeviceLabel"],"002E":["SQ","1","DeviceTypeCodeSequence"],"002F":["SQ","1","SegmentAnnotationTypeModifierCodeSequence"],"0030":["SQ","1","PatientEquipmentRelationshipCodeSequence"],"0031":["UI","1","ReferencedFiducialsUID"],"0032":["SQ","1","PatientTreatmentOrientationSequence"],"0033":["SH","1","UserContentLabel"],"0034":["LO","1","UserContentLongLabel"],"0035":["SH","1","EntityLabel"],"0036":["LO","1","EntityName"],"0037":["ST","1","EntityDescription"],"0038":["LO","1","EntityLongLabel"],"0039":["US","1","DeviceIndex"],"003A":["US","1","RTTreatmentPhaseIndex"],"003B":["UI","1","RTTreatmentPhaseUID"],"003C":["US","1","RTPrescriptionIndex"],"003D":["US","1","RTSegmentAnnotationIndex"],"003E":["US","1","BasisRTTreatmentPhaseIndex"],"003F":["US","1","RelatedRTTreatmentPhaseIndex"],"0040":["US","1","ReferencedRTTreatmentPhaseIndex"],"0041":["US","1","ReferencedRTPrescriptionIndex"],"0042":["US","1","ReferencedParentRTPrescriptionIndex"],"0043":["ST","1","ManufacturerDeviceIdentifier"],"0044":["SQ","1","InstanceLevelReferencedPerformedProcedureStepSequence"],"0045":["CS","1","RTTreatmentPhaseIntentPresenceFlag"],"0046":["CS","1","RadiotherapyTreatmentType"],"0047":["CS","1-n","TeletherapyRadiationType"],"0048":["CS","1-n","BrachytherapySourceType"],"0049":["SQ","1","ReferencedRTTreatmentPhaseSequence"],"004A":["SQ","1","ReferencedDirectSegmentInstanceSequence"],"004B":["SQ","1","IntendedRTTreatmentPhaseSequence"],"004C":["DA","1","IntendedPhaseStartDate"],"004D":["DA","1","IntendedPhaseEndDate"],"004E":["SQ","1","RTTreatmentPhaseIntervalSequence"],"004F":["CS","1","TemporalRelationshipIntervalAnchor"],"0050":["FD","1","MinimumNumberOfIntervalDays"],"0051":["FD","1","MaximumNumberOfIntervalDays"],"0052":["UI","1-n","PertinentSOPClassesInStudy"],"0053":["UI","1-n","PertinentSOPClassesInSeries"],"0054":["LO","1","RTPrescriptionLabel"],"0055":["SQ","1","RTPhysicianIntentPredecessorSequence"],"0056":["LO","1","RTTreatmentApproachLabel"],"0057":["SQ","1","RTPhysicianIntentSequence"],"0058":["US","1","RTPhysicianIntentIndex"],"0059":["CS","1","RTTreatmentIntentType"],"005A":["UT","1","RTPhysicianIntentNarrative"],"005B":["SQ","1","RTProtocolCodeSequence"],"005C":["ST","1","ReasonForSuperseding"],"005D":["SQ","1","RTDiagnosisCodeSequence"],"005E":["US","1","ReferencedRTPhysicianIntentIndex"],"005F":["SQ","1","RTPhysicianIntentInputInstanceSequence"],"0060":["SQ","1","RTAnatomicPrescriptionSequence"],"0061":["UT","1","PriorTreatmentDoseDescription"],"0062":["SQ","1","PriorTreatmentReferenceSequence"],"0063":["CS","1","DosimetricObjectiveEvaluationScope"],"0064":["SQ","1","TherapeuticRoleCategoryCodeSequence"],"0065":["SQ","1","TherapeuticRoleTypeCodeSequence"],"0066":["US","1","ConceptualVolumeOptimizationPrecedence"],"0067":["SQ","1","ConceptualVolumeCategoryCodeSequence"],"0068":["CS","1","ConceptualVolumeBlockingConstraint"],"0069":["SQ","1","ConceptualVolumeTypeCodeSequence"],"006A":["SQ","1","ConceptualVolumeTypeModifierCodeSequence"],"006B":["SQ","1","RTPrescriptionSequence"],"006C":["SQ","1","DosimetricObjectiveSequence"],"006D":["SQ","1","DosimetricObjectiveTypeCodeSequence"],"006E":["UI","1","DosimetricObjectiveUID"],"006F":["UI","1","ReferencedDosimetricObjectiveUID"],"0070":["SQ","1","DosimetricObjectiveParameterSequence"],"0071":["SQ","1","ReferencedDosimetricObjectivesSequence"],"0073":["CS","1","AbsoluteDosimetricObjectiveFlag"],"0074":["FD","1","DosimetricObjectiveWeight"],"0075":["CS","1","DosimetricObjectivePurpose"],"0076":["SQ","1","PlanningInputInformationSequence"],"0077":["LO","1","TreatmentSite"],"0078":["SQ","1","TreatmentSiteCodeSequence"],"0079":["SQ","1","FractionPatternSequence"],"007A":["UT","1","TreatmentTechniqueNotes"],"007B":["UT","1","PrescriptionNotes"],"007C":["IS","1","NumberOfIntervalFractions"],"007D":["US","1","NumberOfFractions"],"007E":["US","1","IntendedDeliveryDuration"],"007F":["UT","1","FractionationNotes"],"0080":["SQ","1","RTTreatmentTechniqueCodeSequence"],"0081":["SQ","1","PrescriptionNotesSequence"],"0082":["SQ","1","FractionBasedRelationshipSequence"],"0083":["CS","1","FractionBasedRelationshipIntervalAnchor"],"0084":["FD","1","MinimumHoursBetweenFractions"],"0085":["TM","1-n","IntendedFractionStartTime"],"0086":["LT","1","IntendedStartDayOfWeek"],"0087":["SQ","1","WeekdayFractionPatternSequence"],"0088":["SQ","1","DeliveryTimeStructureCodeSequence"],"0089":["SQ","1","TreatmentSiteModifierCodeSequence"],"0090":["CS","1","RoboticBaseLocationIndicator"],"0091":["SQ","1","RoboticPathNodeSetCodeSequence"],"0092":["UL","1","RoboticNodeIdentifier"],"0093":["FD","3","RTTreatmentSourceCoordinates"],"0094":["FD","1","RadiationSourceCoordinateSystemYawAngle"],"0095":["FD","1","RadiationSourceCoordinateSystemRollAngle"],"0096":["FD","1","RadiationSourceCoordinateSystemPitchAngle"],"0097":["SQ","1","RoboticPathControlPointSequence"],"0098":["SQ","1","TomotherapeuticControlPointSequence"],"0099":["FD","1-n","TomotherapeuticLeafOpenDurations"],"009A":["FD","1-n","TomotherapeuticLeafInitialClosedDurations"]},4e3:{"0000":["UL","1","GenericGroupLength"],"0010":["LT","1","Arbitrary"],4e3:["LT","1","TextComments"]},4008:{"0000":["UL","1","GenericGroupLength"],"0040":["SH","1","ResultsID"],"0042":["LO","1","ResultsIDIssuer"],"0050":["SQ","1","ReferencedInterpretationSequence"],"00FF":["CS","1","ReportProductionStatusTrial"],"0100":["DA","1","InterpretationRecordedDate"],"0101":["TM","1","InterpretationRecordedTime"],"0102":["PN","1","InterpretationRecorder"],"0103":["LO","1","ReferenceToRecordedSound"],"0108":["DA","1","InterpretationTranscriptionDate"],"0109":["TM","1","InterpretationTranscriptionTime"],"010A":["PN","1","InterpretationTranscriber"],"010B":["ST","1","InterpretationText"],"010C":["PN","1","InterpretationAuthor"],"0111":["SQ","1","InterpretationApproverSequence"],"0112":["DA","1","InterpretationApprovalDate"],"0113":["TM","1","InterpretationApprovalTime"],"0114":["PN","1","PhysicianApprovingInterpretation"],"0115":["LT","1","InterpretationDiagnosisDescription"],"0117":["SQ","1","InterpretationDiagnosisCodeSequence"],"0118":["SQ","1","ResultsDistributionListSequence"],"0119":["PN","1","DistributionName"],"011A":["LO","1","DistributionAddress"],"0200":["SH","1","InterpretationID"],"0202":["LO","1","InterpretationIDIssuer"],"0210":["CS","1","InterpretationTypeID"],"0212":["CS","1","InterpretationStatusID"],"0300":["ST","1","Impressions"],4e3:["ST","1","ResultsComments"]},4010:{"0000":["UL","1","GenericGroupLength"],"0001":["CS","1","LowEnergyDetectors"],"0002":["CS","1","HighEnergyDetectors"],"0004":["SQ","1","DetectorGeometrySequence"],1001:["SQ","1","ThreatROIVoxelSequence"],1004:["FL","3","ThreatROIBase"],1005:["FL","3","ThreatROIExtents"],1006:["OB","1","ThreatROIBitmap"],1007:["SH","1","RouteSegmentID"],1008:["CS","1","GantryType"],1009:["CS","1","OOIOwnerType"],"100A":["SQ","1","RouteSegmentSequence"],1010:["US","1","PotentialThreatObjectID"],1011:["SQ","1","ThreatSequence"],1012:["CS","1","ThreatCategory"],1013:["LT","1","ThreatCategoryDescription"],1014:["CS","1","ATDAbilityAssessment"],1015:["CS","1","ATDAssessmentFlag"],1016:["FL","1","ATDAssessmentProbability"],1017:["FL","1","Mass"],1018:["FL","1","Density"],1019:["FL","1","ZEffective"],"101A":["SH","1","BoardingPassID"],"101B":["FL","3","CenterOfMass"],"101C":["FL","3","CenterOfPTO"],"101D":["FL","6-n","BoundingPolygon"],"101E":["SH","1","RouteSegmentStartLocationID"],"101F":["SH","1","RouteSegmentEndLocationID"],1020:["CS","1","RouteSegmentLocationIDType"],1021:["CS","1-n","AbortReason"],1023:["FL","1","VolumeOfPTO"],1024:["CS","1","AbortFlag"],1025:["DT","1","RouteSegmentStartTime"],1026:["DT","1","RouteSegmentEndTime"],1027:["CS","1","TDRType"],1028:["CS","1","InternationalRouteSegment"],1029:["LO","1-n","ThreatDetectionAlgorithmAndVersion"],"102A":["SH","1","AssignedLocation"],"102B":["DT","1","AlarmDecisionTime"],1031:["CS","1","AlarmDecision"],1033:["US","1","NumberOfTotalObjects"],1034:["US","1","NumberOfAlarmObjects"],1037:["SQ","1","PTORepresentationSequence"],1038:["SQ","1","ATDAssessmentSequence"],1039:["CS","1","TIPType"],"103A":["CS","1","DICOSVersion"],1041:["DT","1","OOIOwnerCreationTime"],1042:["CS","1","OOIType"],1043:["FL","3","OOISize"],1044:["CS","1","AcquisitionStatus"],1045:["SQ","1","BasisMaterialsCodeSequence"],1046:["CS","1","PhantomType"],1047:["SQ","1","OOIOwnerSequence"],1048:["CS","1","ScanType"],1051:["LO","1","ItineraryID"],1052:["SH","1","ItineraryIDType"],1053:["LO","1","ItineraryIDAssigningAuthority"],1054:["SH","1","RouteID"],1055:["SH","1","RouteIDAssigningAuthority"],1056:["CS","1","InboundArrivalType"],1058:["SH","1","CarrierID"],1059:["CS","1","CarrierIDAssigningAuthority"],1060:["FL","3","SourceOrientation"],1061:["FL","3","SourcePosition"],1062:["FL","1","BeltHeight"],1064:["SQ","1","AlgorithmRoutingCodeSequence"],1067:["CS","1","TransportClassification"],1068:["LT","1","OOITypeDescriptor"],1069:["FL","1","TotalProcessingTime"],"106C":["OB","1","DetectorCalibrationData"],"106D":["CS","1","AdditionalScreeningPerformed"],"106E":["CS","1","AdditionalInspectionSelectionCriteria"],"106F":["SQ","1","AdditionalInspectionMethodSequence"],1070:["CS","1","AITDeviceType"],1071:["SQ","1","QRMeasurementsSequence"],1072:["SQ","1","TargetMaterialSequence"],1073:["FD","1","SNRThreshold"],1075:["DS","1","ImageScaleRepresentation"],1076:["SQ","1","ReferencedPTOSequence"],1077:["SQ","1","ReferencedTDRInstanceSequence"],1078:["ST","1","PTOLocationDescription"],1079:["SQ","1","AnomalyLocatorIndicatorSequence"],"107A":["FL","3","AnomalyLocatorIndicator"],"107B":["SQ","1","PTORegionSequence"],"107C":["CS","1","InspectionSelectionCriteria"],"107D":["SQ","1","SecondaryInspectionMethodSequence"],"107E":["DS","6","PRCSToRCSOrientation"]},"4FFE":{"0000":["UL","1","GenericGroupLength"],"0001":["SQ","1","MACParametersSequence"]},5e3:{"0000":["UL","1","GenericGroupLength"],"0005":["US","1","CurveDimensions"],"0010":["US","1","NumberOfPoints"],"0020":["CS","1","TypeOfData"],"0022":["LO","1","CurveDescription"],"0030":["SH","1-n","AxisUnits"],"0040":["SH","1-n","AxisLabels"],"0103":["US","1","DataValueRepresentation"],"0104":["US","1-n","MinimumCoordinateValue"],"0105":["US","1-n","MaximumCoordinateValue"],"0106":["SH","1-n","CurveRange"],"0110":["US","1-n","CurveDataDescriptor"],"0112":["US","1-n","CoordinateStartValue"],"0114":["US","1-n","CoordinateStepValue"],1001:["CS","1","CurveActivationLayer"],2e3:["US","1","AudioType"],2002:["US","1","AudioSampleFormat"],2004:["US","1","NumberOfChannels"],2006:["UL","1","NumberOfSamples"],2008:["UL","1","SampleRate"],"200A":["UL","1","TotalTime"],"200C":["ox","1","AudioSampleData"],"200E":["LT","1","AudioComments"],2500:["LO","1","CurveLabel"],2600:["SQ","1","CurveReferencedOverlaySequence"],2610:["US","1","CurveReferencedOverlayGroup"],3e3:["ox","1","CurveData"]},5200:{"0000":["UL","1","GenericGroupLength"],9229:["SQ","1","SharedFunctionalGroupsSequence"],9230:["SQ","1","PerFrameFunctionalGroupsSequence"]},5400:{"0000":["UL","1","GenericGroupLength"],"0100":["SQ","1","WaveformSequence"],"0110":["ox","1","ChannelMinimumValue"],"0112":["ox","1","ChannelMaximumValue"],1004:["US","1","WaveformBitsAllocated"],1006:["CS","1","WaveformSampleInterpretation"],"100A":["ox","1","WaveformPaddingValue"],1010:["ox","1","WaveformData"]},5600:{"0000":["UL","1","GenericGroupLength"],"0010":["OF","1","FirstOrderPhaseCorrectionAngle"],"0020":["OF","1","SpectroscopyData"]},6e3:{"0000":["UL","1","GenericGroupLength"],"0010":["US","1","OverlayRows"],"0011":["US","1","OverlayColumns"],"0012":["US","1","OverlayPlanes"],"0015":["IS","1","NumberOfFramesInOverlay"],"0022":["LO","1","OverlayDescription"],"0040":["CS","1","OverlayType"],"0045":["LO","1","OverlaySubtype"],"0050":["SS","2","OverlayOrigin"],"0051":["US","1","ImageFrameOrigin"],"0052":["US","1","OverlayPlaneOrigin"],"0060":["CS","1","OverlayCompressionCode"],"0061":["SH","1","OverlayCompressionOriginator"],"0062":["SH","1","OverlayCompressionLabel"],"0063":["CS","1","OverlayCompressionDescription"],"0066":["AT","1-n","OverlayCompressionStepPointers"],"0068":["US","1","OverlayRepeatInterval"],"0069":["US","1","OverlayBitsGrouped"],"0100":["US","1","OverlayBitsAllocated"],"0102":["US","1","OverlayBitPosition"],"0110":["CS","1","OverlayFormat"],"0200":["US","1","OverlayLocation"],"0800":["CS","1-n","OverlayCodeLabel"],"0802":["US","1","OverlayNumberOfTables"],"0803":["AT","1-n","OverlayCodeTableLocation"],"0804":["US","1","OverlayBitsForCodeWord"],1001:["CS","1","OverlayActivationLayer"],1100:["US","1","OverlayDescriptorGray"],1101:["US","1","OverlayDescriptorRed"],1102:["US","1","OverlayDescriptorGreen"],1103:["US","1","OverlayDescriptorBlue"],1200:["US","1-n","OverlaysGray"],1201:["US","1-n","OverlaysRed"],1202:["US","1-n","OverlaysGreen"],1203:["US","1-n","OverlaysBlue"],1301:["IS","1","ROIArea"],1302:["DS","1","ROIMean"],1303:["DS","1","ROIStandardDeviation"],1500:["LO","1","OverlayLabel"],3e3:["ox","1","OverlayData"],4e3:["LT","1","OverlayComments"]},"7F00":{"0000":["UL","1","GenericGroupLength"],"0010":["ox","1","VariablePixelData"],"0011":["US","1","VariableNextDataGroup"],"0020":["OW","1","VariableCoefficientsSDVN"],"0030":["OW","1","VariableCoefficientsSDHN"],"0040":["OW","1","VariableCoefficientsSDDN"]},"7FE0":{"0000":["UL","1","GenericGroupLength"],"0001":["OV","1","ExtendedOffsetTable"],"0002":["OV","1","ExtendedOffsetTableLengths"],"0008":["OF","1","FloatPixelData"],"0009":["OD","1","DoubleFloatPixelData"],"0010":["ox","1","PixelData"],"0020":["OW","1","CoefficientsSDVN"],"0030":["OW","1","CoefficientsSDHN"],"0040":["OW","1","CoefficientsSDDN"]},FFFA:{"0000":["UL","1","GenericGroupLength"],FFFA:["SQ","1","DigitalSignaturesSequence"]},FFFC:{"0000":["UL","1","GenericGroupLength"],FFFC:["OB","1","DataSetTrailingPadding"]},FFFE:{"0000":["UL","1","GenericGroupLength"],E000:["NONE","1","Item"],E00D:["NONE","1","ItemDelimitationItem"],E0DD:["NONE","1","SequenceDelimitationItem"]}};function Z(e,t){j[e]=t}const _={"0000":"Command","0002":"Meta Element","0004":"File Set","0008":"Identifying","0009":"SPI Identifying","0010":"Patient","0012":"Clinical Trial","0018":"Acquisition","0019":"SPI Acquisition","0020":"Image","0021":"SPI Image","0022":"Ophtalmology","0028":"Image Presentation","0032":"Study","0038":"Visit","003A":"Waveform","0040":"Procedure","0042":"Encapsulated Document","0050":"Device Informations","0054":"Nuclear Medicine","0060":"Histogram","0070":"Presentation State","0072":"Hanging Protocol","0088":"Storage","0100":"Authorization","0400":"Digital Signature",1e3:"Code Table",1010:"Zonal Map",2e3:"Film Session",2010:"Film Box",2020:"Image Box",2030:"Annotation",2040:"Overlay Box",2050:"Presentation LUT",2100:"Print Job",2110:"Printer",2120:"Queue",2130:"Print Content",2200:"Media Creation",3002:"RT Image",3004:"RT Dose",3006:"RT StructureSet",3008:"RT Treatment","300A":"RT Plan","300C":"RT Relationship","300E":"RT Approval",4e3:"Text",4008:"Results","4FFE":"MAC Parameters",5e3:"Curve",5002:"Curve",5004:"Curve",5006:"Curve",5008:"Curve","500A":"Curve","500C":"Curve","500E":"Curve",5400:"Waveform Data",6e3:"Overlays",6002:"Overlays",6004:"Overlays",6008:"Overlays","600A":"Overlays","600C":"Overlays","600E":"Overlays",FFFC:"Generic","7FE0":"Pixel Data",FFFF:"Unknown"},K={OB:!0,OD:!0,OF:!0,OL:!0,OV:!0,OW:!0,SQ:!0,SV:!0,UC:!0,UN:!0,UR:!0,UT:!0,UV:!0,ox:!0};function J(e){return void 0!==K[e]}const $={SH:!0,LO:!0,UC:!0,ST:!0,LT:!0,UT:!0,PN:!0};function ee(e){return void 0!==$[e]}const te={AE:"string",AS:"string",AT:void 0,CS:"string",DA:"string",DS:"string",DT:"string",FL:"Float32",FD:"Float64",IS:"string",LO:"string",LT:"string",OB:"Uint8",OD:"Uint64",OF:"Uint32",OL:"Uint32",OV:"Uint64",OW:"Uint16",PN:"string",SH:"string",SL:"Int32",SQ:void 0,SS:"Int16",ST:"string",SV:"Int64",TM:"string",UC:"string",UI:"string",UL:"Uint32",UN:"Uint8",UR:"string",US:"Uint16",UT:"string",UV:"Uint64"},ne={"1.2.840.10008.1.2":"Implicit VR Little Endian","1.2.840.10008.1.2.1":"Explicit VR Little Endian","1.2.840.10008.1.2.1.98":"Encapsulated Uncompressed Explicit VR Little Endian","1.2.840.10008.1.2.1.99":"Deflated Explicit VR Little Endian","1.2.840.10008.1.2.2":"Explicit VR Big Endian (Retired)","1.2.840.10008.1.2.4.50":"JPEG Baseline (Process 1)","1.2.840.10008.1.2.4.51":"JPEG Extended (Process 2 & 4)","1.2.840.10008.1.2.4.52":"JPEG Extended (Process 3 & 5) (Retired)","1.2.840.10008.1.2.4.53":"JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8) (Retired)","1.2.840.10008.1.2.4.54":"JPEG Spectral Selection, Non-Hierarchical (Process 7 & 9) (Retired)","1.2.840.10008.1.2.4.55":"JPEG Full Progression, Non-Hierarchical (Process 10 & 12) (Retired)","1.2.840.10008.1.2.4.56":"JPEG Full Progression, Non-Hierarchical (Process 11 & 13) (Retired)","1.2.840.10008.1.2.4.57":"JPEG Lossless, Non-Hierarchical (Process 14)","1.2.840.10008.1.2.4.58":"JPEG Lossless, Non-Hierarchical (Process 15) (Retired)","1.2.840.10008.1.2.4.59":"JPEG Extended, Hierarchical (Process 16 & 18) (Retired)","1.2.840.10008.1.2.4.60":"JPEG Extended, Hierarchical (Process 17 & 19) (Retired)","1.2.840.10008.1.2.4.61":"JPEG Spectral Selection, Hierarchical (Process 20 & 22) (Retired)","1.2.840.10008.1.2.4.62":"JPEG Spectral Selection, Hierarchical (Process 21 & 23) (Retired)","1.2.840.10008.1.2.4.63":"JPEG Full Progression, Hierarchical (Process 24 & 26) (Retired)","1.2.840.10008.1.2.4.64":"JPEG Full Progression, Hierarchical (Process 25 & 27) (Retired)","1.2.840.10008.1.2.4.65":"JPEG Lossless, Hierarchical (Process 28) (Retired)","1.2.840.10008.1.2.4.66":"JPEG Lossless, Hierarchical (Process 29) (Retired)","1.2.840.10008.1.2.4.70":"JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])","1.2.840.10008.1.2.4.80":"JPEG-LS Lossless Image Compression","1.2.840.10008.1.2.4.81":"JPEG-LS Lossy (Near-Lossless) Image Compression","1.2.840.10008.1.2.4.90":"JPEG 2000 Image Compression (Lossless Only)","1.2.840.10008.1.2.4.91":"JPEG 2000 Image Compression","1.2.840.10008.1.2.4.92":"JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only)","1.2.840.10008.1.2.4.93":"JPEG 2000 Part 2 Multi-component Image Compression","1.2.840.10008.1.2.4.94":"JPIP Referenced","1.2.840.10008.1.2.4.95":"JPIP Referenced Deflate","1.2.840.10008.1.2.4.100":"MPEG2 Main Profile / Main Level","1.2.840.10008.1.2.4.101":"MPEG2 Main Profile / High Level","1.2.840.10008.1.2.4.102":"MPEG-4 AVC/H.264 High Profile / Level 4.1","1.2.840.10008.1.2.4.103":"MPEG-4 AVC/H.264 BD-compatible High Profile / Level 4.1","1.2.840.10008.1.2.4.104":"MPEG-4 AVC/H.264 High Profile / Level 4.2 For 2D Video","1.2.840.10008.1.2.4.105":"MPEG-4 AVC/H.264 High Profile / Level 4.2 For 3D Video","1.2.840.10008.1.2.4.106":"MPEG-4 AVC/H.264 Stereo High Profile / Level 4.2","1.2.840.10008.1.2.4.107":"HEVC/H.265 Main Profile / Level 5.1","1.2.840.10008.1.2.4.108":"HEVC/H.265 Main 10 Profile / Level 5.1","1.2.840.10008.1.2.5":"RLE Lossless","1.2.840.10008.1.2.6.1":"RFC 2557 MIME encapsulation (Retired)","1.2.840.10008.1.2.6.2":"XML Encoding (Retired)","1.2.840.10008.1.2.7.1":"SMPTE ST 2110-20 Uncompressed Progressive Active Video","1.2.840.10008.1.2.7.2":"SMPTE ST 2110-20 Uncompressed Interlaced Active Video","1.2.840.10008.1.2.7.3":"SMPTE ST 2110-30 PCM Digital Audio","1.2.840.10008.1.20":"Papyrus 3 Implicit VR Little Endian (Retired)"},ie="1.2.840.10008.1.2",re="1.2.840.10008.1.2.1",oe="1.2.840.10008.1.2.2",ae="1.2.840.10008.1.2.4.50",se="1.2.840.10008.1.2.4.51",le="1.2.840.10008.1.2.4.57",ce="1.2.840.10008.1.2.4.70",ue="1.2.840.10008.1.2.5";class de{#T;#L;constructor(e,t){if(!e||void 0===e)throw new Error("Cannot create tag with no group.");if(4!==e.length)throw new Error("Cannot create tag with badly sized group: "+e);if(!t||void 0===t)throw new Error("Cannot create tag with no element.");if(4!==t.length)throw new Error("Cannot create tag with badly sized element: "+t);this.#T=e,this.#L=t}getGroup(){return this.#T}getElement(){return this.#L}toString(){return this.getKey()+": "+this.getNameFromDictionary()}equals(e){return null!=e&&this.#T===e.getGroup()&&this.#L===e.getElement()}getKey(){return this.#T+this.#L}getGroupName(){return _[this.#T]}isWithVR(){return!("FFFE"===this.#T&&("E000"===this.#L||"E00D"===this.#L||"E0DD"===this.#L))}isPrivate(){return parseInt(this.#T,16)%2==1}#P(){let e;return void 0!==j[this.#T]&&void 0!==j[this.#T][this.#L]&&(e=j[this.#T][this.#L]),e}getVrFromDictionary(){let e;const t=this.#P();return void 0!==t&&(e=t[0]),e}getNameFromDictionary(){let e;const t=this.#P();return void 0!==t&&(e=t[2]),e}}function he(e,t){let n=parseInt(e.getGroup(),16)-parseInt(t.getGroup(),16);return 0===n&&(n=parseInt(e.getElement(),16)-parseInt(t.getElement(),16)),n}function Se(e){if(!e||void 0===e)throw new Error("Cannot create tag with no key.");if(8!==e.length)throw new Error("Cannot create tag with badly sized key: "+e);return new de(e.substring(0,4),e.substring(4,8))}function ge(){return new de("FFFE","E000")}function me(e){return"FFFEE000"===e.getKey()}function pe(e){return"FFFEE00D"===e.getKey()}function fe(e){return"FFFEE0DD"===e.getKey()}function De(){return new de("7FE0","0010")}function ye(e){return"7FE00010"===e.getKey()}function Ce(e){if(null==e)return null;let t=null,n=null;const i=j,r=Object.keys(i);let o,a=null,s=!1;for(let o=0,l=r.length;o<l;++o){t=r[o],a=Object.keys(i[t]);for(let r=0,o=a.length;r<o;++r)if(n=a[r],i[t][n][2]===e){s=!0;break}if(s)break}return s&&(o=new de(t,n)),o}class ve{vr;value;tag;vl;undefinedLength;startOffset;endOffset;items;constructor(e){this.vr=e}}function Ie(e){const t=e.byteLength,n=new Uint8Array(e.buffer,e.byteOffset,t),i=e.BYTES_PER_ELEMENT;let r;for(let e=0;e<t;e+=i)for(let t=e+i-1,o=e;t>o;t--,o++)r=n[o],n[o]=n[t],n[t]=r}class Te{#w;#O=!0;#A=function(){return new Int8Array(new Int16Array([1]).buffer)[0]>0}();#b;#x;constructor(e,t){this.#w=e,void 0!==t&&(this.#O=t),this.#b=this.#O!==this.#A,this.#x=new DataView(e)}readUint16(e){return this.#x.getUint16(e,this.#O)}readInt16(e){return this.#x.getInt16(e,this.#O)}readUint32(e){return this.#x.getUint32(e,this.#O)}readBigUint64(e){return this.#x.getBigUint64(e,this.#O)}readInt32(e){return this.#x.getInt32(e,this.#O)}readBigInt64(e){return this.#x.getBigInt64(e,this.#O)}readFloat32(e){return this.#x.getFloat32(e,this.#O)}readFloat64(e){return this.#x.getFloat64(e,this.#O)}readBinaryArray(e,t){const n=new Uint8Array(this.#w,e,t),i=8*n.length,r=new Uint8Array(i);let o=0,a=0;for(let e=0;e<i;++e)o=e%8,a=Math.floor(e/8),r[e]=255*!!(n[a]&1<<o);return r}readUint8Array(e,t){return new Uint8Array(this.#w,e,t)}readInt8Array(e,t){return new Int8Array(this.#w,e,t)}readUint16Array(e,t){const n=Uint16Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Uint16Array(this.#w,e,i),this.#b&&Ie(r);else{r=new Uint16Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readUint16(t),t+=n}return r}readInt16Array(e,t){const n=Int16Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Int16Array(this.#w,e,i),this.#b&&Ie(r);else{r=new Int16Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readInt16(t),t+=n}return r}readUint32Array(e,t){const n=Uint32Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Uint32Array(this.#w,e,i),this.#b&&Ie(r);else{r=new Uint32Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readUint32(t),t+=n}return r}readUint64Array(e,t){const n=BigUint64Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new BigUint64Array(this.#w,e,i),this.#b&&Ie(r);else{r=new BigUint64Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readBigUint64(t),t+=n}return r}readInt32Array(e,t){const n=Int32Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Int32Array(this.#w,e,i),this.#b&&Ie(r);else{r=new Int32Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readInt32(t),t+=n}return r}readInt64Array(e,t){const n=BigInt64Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new BigInt64Array(this.#w,e,i),this.#b&&Ie(r);else{r=new BigInt64Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readBigInt64(t),t+=n}return r}readFloat32Array(e,t){const n=Float32Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Float32Array(this.#w,e,i),this.#b&&Ie(r);else{r=new Float32Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readFloat32(t),t+=n}return r}readFloat64Array(e,t){const n=Float64Array.BYTES_PER_ELEMENT,i=t/n;let r=null;if(e%n==0)r=new Float64Array(this.#w,e,i),this.#b&&Ie(r);else{r=new Float64Array(i);let t=e;for(let e=0;e<i;++e)r[e]=this.readFloat64(t),t+=n}return r}readHex(e){const t=this.readUint16(e).toString(16);return"0000".substring(0,4-t.length)+t.toUpperCase()}}function Le(){return new b([1,0,0,0,0,1,0,-1,0])}const Pe={Axial:"axial",Coronal:"coronal",Sagittal:"sagittal"};function we(e){let t;return e===Pe.Axial?t=x():e===Pe.Coronal?t=Le():e===Pe.Sagittal&&(t=new b([0,0,-1,1,0,0,0,-1,0])),t}function Oe(e){const t=new w(e.get(0,0),e.get(1,0),e.get(2,0)),n=new w(e.get(0,1),e.get(1,1),e.get(2,1)),i=new w(e.get(0,2),e.get(1,2),e.get(2,2));return Ae(t)+Ae(n)+Ae(i)}function Ae(e){let t=new w(Math.abs(e.getX()),Math.abs(e.getY()),Math.abs(e.getZ())),n="";const i=e.getX()<0?"R":"L",r=e.getY()<0?"A":"P",o=e.getZ()<0?"I":"S",a=1e-4;for(let e=0;e<3;e++)if(t.getX()>a&&t.getX()>t.getY()&&t.getX()>t.getZ())n+=i,t=new w(0,t.getY(),t.getZ());else if(t.getY()>a&&t.getY()>t.getX()&&t.getY()>t.getZ())n+=r,t=new w(t.getX(),0,t.getZ());else{if(!(t.getZ()>a&&t.getZ()>t.getX()&&t.getZ()>t.getY()))break;n+=o,t=new w(t.getX(),t.getY(),0)}return n}function be(e){let t;if(void 0!==e&&6===e.length){const n=new w(e[0],e[1],e[2]),i=new w(e[3],e[4],e[5]),r=n.crossProduct(i);t=new b([n.getX(),i.getX(),r.getX(),n.getY(),i.getY(),r.getY(),n.getZ(),i.getZ(),r.getZ()])}return t}function xe(){return"0.34.0-beta.1"}function Re(e){return!(e.byteLength<132)&&"DICM"===new Uint8Array(e,128,4).reduce((function(e,t){return e+String.fromCharCode(t)}),"")}const Fe=String.fromCharCode("u200B");class Ee{decode(e){let t="";for(let n=0,i=e.length;n<i;++n)t+=String.fromCharCode(e[n]);return t}}function qe(e){if(!e)return null;const t={L:"R",R:"L",A:"P",P:"A",H:"F",F:"H"};let n="";for(let i=0;i<e.length;i++){const r=t[e.substring(i,i+1)];r&&(n+=r)}return n}function Ue(e){let t;const n=be(e);return void 0!==n&&(t=function(e){let t;return["LPS","LAI","RPI","RAS"].includes(e)?t=Pe.Axial:["LSA","LIP","RSP","RIA"].includes(e)?t=Pe.Coronal:["PSL","PIR","ASR","AIL"].includes(e)&&(t=Pe.Sagittal),t}(Oe(n.asOneAndZeros()))),t}function Me(e){return e===ie}function Qe(e){return e===oe}function Ve(e){return e===ae||e===se}function Ne(e){return e===le||e===ce}function Be(e){return null!==e.match(/1.2.840.10008.1.2.4.9/)}function Ge(e){return e===ue}function ke(e,t,n){let i=null;try{1===e||8===e?i=0===t?new Uint8Array(n):new Int8Array(n):16===e?i=0===t?new Uint16Array(n):new Int16Array(n):32===e&&(i=0===t?new Uint32Array(n):new Int32Array(n))}catch(e){if(e instanceof RangeError){const e=Math.floor(Math.log(n)/Math.log(2));c.error("Cannot allocate array of size: "+n+" (>2^"+e+").")}}return i}function He(e,t){return t?8:J(e)?12:8}const ze="00280008",We="00280100",Xe="00280103",Ye="7FE00010";class je{#R={};#F;#E=new Ee;#q=this.#E;#U(e){return this.#E.decode(e)}#M(e){return this.#q.decode(e)}getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}setDecoderCharacterSet(e){this.#q=new TextDecoder(e)}getDicomElements(){return this.#R}#Q(e,t){const n=e.readHex(t);t+=Uint16Array.BYTES_PER_ELEMENT;const i=e.readHex(t);return t+=Uint16Array.BYTES_PER_ELEMENT,{tag:new de(n,i),endOffset:t}}#V(e,t,n){const i={};let r=this.#N(e,t,n);if(t=r.endOffset,fe(r.tag))return{data:i,endOffset:r.endOffset,isSeqDelim:!0};if(i[r.tag.getKey()]={tag:r.tag,vr:"NONE",vl:r.vl,undefinedLength:r.undefinedLength},r.undefinedLength){let o=!1;for(;!o;)r=this.#N(e,t,n),t=r.endOffset,o=pe(r.tag),o||(i[r.tag.getKey()]=r)}else{const o=t;for(t-=r.vl;t<o;)r=this.#N(e,t,n),t=r.endOffset,i[r.tag.getKey()]=r}return{data:i,endOffset:t,isSeqDelim:!1}}#B(e,t,n){const i=[];let r=this.#N(e,t,n);const o=r.vl;t=r.endOffset;let a=!1;for(;!a;)r=this.#N(e,t,n),t=r.endOffset,a=fe(r.tag),a||(r.vr="OB",i.push(r));return{data:i,endOffset:t,offsetTableVl:o}}#N(e,t,n){const i=this.#Q(e,t),r=i.tag;t=i.endOffset;let o=null,a=!1;r.isWithVR()?n?(o=r.getVrFromDictionary(),void 0===o&&(o="UN"),a=!0):(o=this.#U(e.readUint8Array(t,2)),t+=2*Uint8Array.BYTES_PER_ELEMENT,a=J(o),a&&(t+=2*Uint8Array.BYTES_PER_ELEMENT)):(o="NONE",a=!0),function(e){return Object.keys(te).concat(["NONE","ox","xx","xs"]).includes(e)}(o)||(c.warn("Unknown VR: "+o+" (for tag "+r.getKey()+"), treating as 'UN'"),o="UN");let s=0;a?(s=e.readUint32(t),t+=Uint32Array.BYTES_PER_ELEMENT):(s=e.readUint16(t),t+=Uint16Array.BYTES_PER_ELEMENT);let l=!1;4294967295===s&&(l=!0,s=0),r.isPrivate()&&"UN"===o&&0===s&&(o="SQ");let u,d=t,h=d+s;if(ye(r)&&l){const i=this.#B(e,t,n);t=i.endOffset,d+=i.offsetTableVl,u=i.data,h=t,s=t-d}else if("SQ"===o){let i;if(u=[],l){let r=!1;for(;!r;)i=this.#V(e,t,n),r=i.isSeqDelim,t=i.endOffset,r||u.push(i.data);h=t,s=t-d}else if(0!==s){const r=t+s;for(;t<r;)i=this.#V(e,t,n),u.push(i.data),t=i.endOffset;h=t,s=t-d}}const S=new ve(o);return S.tag=r,S.vl=s,S.startOffset=d,S.endOffset=h,l&&(S.undefinedLength=l),u&&(S.items=u),S}#G(e,t,n,i){const r=e.tag,o=e.vl,a=e.vr,s=e.startOffset;let l=null;const u=te[a];if(ye(r))if(e.undefinedLength){l=[];for(let r=0;r<e.items.length;++r)l.push(this.#G(e.items[r],t,n,i));delete e.items}else if(i>8&&"OB"===a&&(c.warn("Reading DICOM pixel data with bitsAllocated>8 and OB VR, treating as OW"),e.vr="OW"),l=[],1===i)l.push(t.readBinaryArray(s,o));else if(8===i)0===n?l.push(t.readUint8Array(s,o)):l.push(t.readInt8Array(s,o));else{if(16!==i)throw new Error("Unsupported bits allocated: "+i);0===n?l.push(t.readUint16Array(s,o)):l.push(t.readInt16Array(s,o))}else if(void 0!==u)if("Uint8"===u)l=t.readUint8Array(s,o);else if("Uint16"===u)l=t.readUint16Array(s,o),"O"!==a[0]&&(l=Array.from(l));else if("Uint32"===u)l=t.readUint32Array(s,o),"O"!==a[0]&&(l=Array.from(l));else if("Uint64"===u)l=t.readUint64Array(s,o);else if("Int16"===u)l=Array.from(t.readInt16Array(s,o));else if("Int32"===u)l=Array.from(t.readInt32Array(s,o));else if("Int64"===u)l=t.readInt64Array(s,o);else if("Float32"===u)l=Array.from(t.readFloat32Array(s,o));else if("Float64"===u)l=Array.from(t.readFloat64Array(s,o));else{if("string"!==u)throw new Error("Unknown VR type: "+u);{const e=t.readUint8Array(s,o);l=ee(a)?this.#M(e):this.#U(e),l=function(e){let t=e;const n=e.length-1;return e[n]===Fe&&(t=e.substring(0,n)),t=t.trim(),t}(l).split("\\")}}else if("xx"===a)l=Array.from(t.readUint16Array(s,o));else if("ox"===a)l=8===i?0===n?Array.from(t.readUint8Array(s,o)):Array.from(t.readInt8Array(s,o)):0===n?Array.from(t.readUint16Array(s,o)):Array.from(t.readInt16Array(s,o));else if("xs"===a)l=0===n?Array.from(t.readUint16Array(s,o)):Array.from(t.readInt16Array(s,o));else if("AT"===a){const e=t.readUint16Array(s,o);l=[];for(let t=0,n=e.length;t<n;t+=2){const n=e[t].toString(16),i=e[t+1].toString(16);let r="(";r+="0000".substring(0,4-n.length)+n.toUpperCase(),r+=",",r+="0000".substring(0,4-i.length)+i.toUpperCase(),r+=")",l.push(r)}}else if("SQ"===a){l=[];for(let r=0;r<e.items.length;++r){const o=e.items[r],a={},s=Object.keys(o);let c=i,u=n;for(let e=0;e<s.length;++e){let n=o[We];void 0!==n&&void 0!==n.value&&(c=n.value[0]),n=o[Xe],void 0!==n&&void 0!==n.value&&(u=n.value[0]);const i=o[s[e]];i.value=this.#G(i,t,u,c),delete i.tag,delete i.vl,delete i.startOffset,delete i.endOffset,a[s[e]]=i}l.push(a)}delete e.items}else"NONE"===a||c.warn("Unknown VR: "+a+" (for tag "+e.tag.getKey()+")"),l=[];return l}#k(e,t,n,i){const r=Object.keys(e);for(let o=0;o<r.length;++o){const a=e[r[o]];void 0===a.value&&(a.value=this.#G(a,t,n,i)),delete a.tag,delete a.vl,delete a.startOffset,delete a.endOffset}}parse(e){let t=0,n="",i=null;const r=new Te(e);let o=new Te(e);t=128;const a=this.#U(r.readUint8Array(t,4));if(t+=4*Uint8Array.BYTES_PER_ELEMENT,"DICM"===a){i=this.#N(r,t,!1),i.value=this.#G(i,r),t=i.endOffset,this.#R[i.tag.getKey()]=i;const e=t+i.value[0];for(;t<e;)i=this.#N(r,t,!1),t=i.endOffset,this.#R[i.tag.getKey()]=i;if(i=this.#R["00020010"],void 0===i)throw new Error("Not a valid DICOM file (no TransferSyntaxUID found)");i.value=this.#G(i,r),n=i.value[0]}else{c.warn("No DICM prefix, trying to guess tansfer syntax."),i=this.#N(o,0,!1);const e=function(e){const t="0008",n=e.tag.getGroup();if("0800"!==n&&n!==t)throw new Error("Not a valid DICOM file (no magic DICM word found and first element not in 0008 group)");const i=e.vr,r=i.charCodeAt(0),o=i.charCodeAt(1),a=!(r>=65&&r<=90&&o>=65&&o<=90);let s=null;if(n===t)s=a?ie:re;else{if(a)throw new Error("Not a valid DICOM file (no magic DICM word foundand implicit VR big endian detected)");s=oe}const l=new ve("UI");return l.tag=new de("0002","0010"),l.value=[s],l.vl=l.value[0].length,l.startOffset=e.startOffset,l.endOffset=l.startOffset+l.vl,l}(i);this.#R[e.tag.getKey()]=e,n=e.value[0],t=0}if(!function(e){return e===ie||e===re||e===oe||Ve(e)||Ne(e)||Be(e)||Ge(e)}(n))throw new Error("Unsupported DICOM transfer syntax: '"+n+"' ("+function(e){let t="Unknown";return void 0!==ne[e]&&(t=ne[e]),t}(n)+")");let s=!1;for(Me(n)&&(s=!0),Qe(n)&&(o=new Te(e,!1));t<e.byteLength;){i=this.#N(o,t,s),t=i.endOffset;const e=i.tag.getKey();void 0===this.#R[e]?this.#R[e]=i:c.warn("Not saving duplicate tag: "+e)}if(isNaN(t))throw new Error("Problem while parsing, bad offset");e.byteLength!==t&&c.warn("Did not reach the end of the buffer: "+t+" != "+e.byteLength);let l=0,u=16;if(void 0!==this.#R[Ye]&&(i=this.#R[Xe],void 0!==i?(i.value=this.#G(i,o),l=i.value[0]):c.warn("Reading DICOM pixel data with default pixelRepresentation."),i=this.#R[We],void 0!==i?(i.value=this.#G(i,o),u=i.value[0]):c.warn("Reading DICOM pixel data with default bitsAllocated.")),void 0!==this.#F&&this.setDecoderCharacterSet(this.#F),i=this.#R["00080005"],void 0!==i){let e;i.value=this.#G(i,o),1===i.value.length?e=i.value[0]:(e=i.value[1],c.warn("Unsupported character set with code extensions: '"+e+"'.")),this.setDecoderCharacterSet(function(e){let t="utf-8";return"ISO_IR 100"===e?t="iso-8859-1":"ISO_IR 101"===e?t="iso-8859-2":"ISO_IR 109"===e?t="iso-8859-3":"ISO_IR 110"===e?t="iso-8859-4":"ISO_IR 144"===e?t="iso-8859-5":"ISO_IR 127"===e?t="iso-8859-6":"ISO_IR 126"===e?t="iso-8859-7":"ISO_IR 138"===e?t="iso-8859-8":"ISO_IR 148"===e?t="iso-8859-9":"ISO_IR 13"===e?t="shift-jis":"ISO_IR 166"===e?t="iso-8859-11":"ISO 2022 IR 87"===e?t="iso-2022-jp":"ISO 2022 IR 149"===e||"ISO 2022 IR 58"===e||("ISO_IR 192"===e?t="utf-8":"GB18030"===e?t="gb18030":"GB2312"===e?t="gb2312":"GBK"===e&&(t="chinese")),t}(e))}if(this.#k(this.#R,o,l,u),i=this.#R[Ye],void 0!==i&&i.undefinedLength){let e=1;void 0!==this.#R[ze]&&(e=Number(this.#R[ze].value[0]));const t=i.value;if(t.length>1&&t.length>e){const n=t.length/e,r=[];let o=0;for(let i=0;i<e;++i){o=i*n;let e=0;for(let i=0;i<n;++i)e+=t[o+i].length;const a=new t[0].constructor(e);let s=0;for(let e=0;e<n;++e)a.set(t[o+e],s),s+=t[o+e].length;r[i]=a}i.value=r}}}}class Ze{#H={};add(e,t){void 0===this.#H[e]&&(this.#H[e]=[]),this.#H[e].push(t)}remove(e,t){if(void 0===this.#H[e])return;let n=0;for(let i=0;i<this.#H[e].length;++i)this.#H[e][i]===t&&(++n,this.#H[e].splice(i,1));0===n&&c.debug("No callback found on remove listener for type "+e)}fireEvent=e=>{if(void 0===this.#H[e.type])return;const t=this.#H[e.type].slice();for(let n=0;n<t.length;++n)t[n](e)}}function _e(e,t,n,i,r,o,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);let l=t;a?(o*=-1,s?l-=(r-1)*i:i*=-1):s&&(l+=(r-1)*i,i*=-1);const c=o-r*i;let u=0,d=0;return{next:function(){if(u<n){const t={value:e(l),done:!1,index:l};return l+=i,++u,++d,d===r&&(d=0,l+=c),t}return{done:!0,index:l}}}}function Ke(e){const t=[];let n=e.next();for(;!n.done;)t.push(n.value),n=e.next();return t}function Je(e,t,n,i){const r=e.getGeometry().getSize();let o=2;i&&void 0!==i&&(o=i.getColAbsMax(2).index);const a=t.getValues(),l=new s(a.map((function(e,t){return t===o||t>2?e:0})));let c=r.indexToOffset(l);void 0===n&&(n=!1);let u=null;u=n?function(t){return e.getRescaledValueAtOffset(t)}:function(t){return e.getValueAtOffset(t)};const d=r.get(0),h=r.get(1),S=r.get(2);let g=r.getDimSize(2);const m=e.getNumberOfComponents(),p=1===e.getPlanarConfiguration(),f=function(e,t,n,i,r,o,a,s){return 1===m?_e(e,t,n,i,r,o,a,s):3===m?function(e,t,n,i,r,o,a,s,l){const c=[];return l?(c.push(_e(e,t,n,i,r,o,a,s)),c.push(_e(e,t+n*i,n,i,r,o,a,s)),c.push(_e(e,t+2*n*i,n,i,r,o,a,s))):(i*=3,o*=3,c.push(_e(e,t,n,i,r,o,a,s)),c.push(_e(e,t+1,n,i,r,o,a,s)),c.push(_e(e,t+2,n,i,r,o,a,s))),{next:function(){const e=c[0].next(),t=c[1].next(),n=c[2].next();return e.done?{done:!0,index:n.index}:{value:[e.value,t.value,n.value],done:!1,index:[e.index,t.index,n.index]}}}}(e,3*t,n,i,r,o,a,s,p):void 0};let D=null;if(i&&void 0!==i){const e=i.getColAbsMax(0),t=i.getColAbsMax(2),n=!1,r=!1;let o=null;if(2===t.index)o=d*h,D=0===e.index?f(u,c,o,1,d,d,n,r):f(u,c,o,d,h,1,n,r);else if(0===t.index)o=S*h,D=1===e.index?f(u,c,o,d,h,g,n,r):f(u,c,o,g,S,d,n,r);else{if(1!==t.index)throw new Error("Unknown direction: "+t.index);o=S*d,D=0===e.index?f(u,c,o,1,d,g,n,r):f(u,c,o,g,S,1,n,r)}}else if(1===e.getNumberOfComponents())D=function(e,t,n,i){void 0===i&&(i=1);let r=t;return{next:function(){if(r<n){const t={value:e(r),done:!1,index:r};return r+=i,t}return{done:!0,index:n}}}}(u,c,c+g);else{if(3!==e.getNumberOfComponents())throw new Error("Unsupported number of components: "+e.getNumberOfComponents());c*=3,g*=3,D=function(e,t,n,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);let o=t,a=1;r?a=(n-t)/3:i*=3;let s=o+a,l=o+2*a;return{next:function(){if(o<n){const t={value:[e(o),e(s),e(l)],done:!1,index:[o,s,l]};return o+=i,s+=i,l+=i,t}return{done:!0,index:[n]}}}}(u,c,c+g,1,p)}return D}function $e(e,t){let n=0,i=0;return{next:function(){if(n<t){i+1<e.length&&n>=e[i+1].index&&++i;const t={value:e[i].colour,done:!1,index:n};return++n,t}return{done:!0,index:t}}}}class et{#d;#z;constructor(e,t){this.#d=e,this.#z=t}getSlope(){return this.#d}getIntercept(){return this.#z}apply(e){return e*this.#d+this.#z}equals(e){return null!=e&&this.getSlope()===e.getSlope()&&this.getIntercept()===e.getIntercept()}isID(){return 1===this.getSlope()&&0===this.getIntercept()}}class tt{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create size with no values.");if(0===e.length)throw new Error("Cannot create size with empty values.");if(!e.every((function(e){return!isNaN(e)&&0!==e})))throw new Error("Cannot create size with non number or zero values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}moreThanOne(e){return this.length()>=e+1&&1!==this.get(e)}canScroll3D(e){let t=2;return void 0!==e&&(t=e.getThirdColMajorDirection()),this.moreThanOne(t)}canScroll(e){let t=this.canScroll3D(e);for(let e=3;e<this.length();++e)t=t||this.moreThanOne(e);return t}getDimSize(e,t){if(e>this.length())return null;if(void 0===t)t=0;else if(t<0||t>e)throw new Error("Invalid start value for getDimSize");let n=1;for(let i=t;i<e;++i)n*=this.get(i);return n}getTotalSize(e){return this.getDimSize(this.length(),e)}equals(e){if(!e)return!1;const t=this.length();if(t!==e.length())return!1;for(let n=0;n<t;++n)if(this.get(n)!==e.get(n))return!1;return!0}isInBounds(e,t){if(!e)return!1;const n=this.length();if(n!==e.length())return!1;if(void 0===t){t=[];for(let e=0;e<n;++e)t.push(e)}else for(let e=0;e<n;++e)if(t[e]>n-1)throw new Error("Wrong input dir value: "+t[e]);for(let n=0;n<t.length;++n)if(i=e.get(t[n]),r=this.get(t[n]),!(i>=0&&i<r))return!1;var i,r;return!0}indexToOffset(e,t){if(e.length()<this.length())throw new Error("Incompatible index and size length");if(void 0===t)t=0;else if(t<0||t>this.length()-1)throw new Error("Invalid start value for indexToOffset");let n=0;for(let i=t;i<this.length();++i)n+=e.get(i)*this.getDimSize(i,t);return n}offsetToIndex(e){const t=new Array(this.length());let n=e,i=0;for(let e=this.length()-1;e>0;--e)i=this.getDimSize(e),t[e]=Math.floor(n/i),n-=t[e]*i;return t[0]=n,new s(t)}get2D(){return{x:this.get(0),y:this.get(1)}}}class nt{min;max;mean;stdDev;median;p25;p75;constructor(e,t,n,i){this.min=e,this.max=t,this.mean=n,this.stdDev=i}}function it(e,t){return function(e){return null!=e&&(e.includes("median")||e.includes("p25")||e.includes("p75"))}(t)?function(e){const t=rt(e);return e.sort((function(e,t){return e-t})),t.median=ot(e,.5),t.p25=ot(e,.25),t.p75=ot(e,.75),t}(e):rt(e)}function rt(e){let t=e[0],n=t,i=0,r=0,o=0;const a=e.length;for(let s=0;s<a;++s)o=e[s],o<t?t=o:o>n&&(n=o),i+=o,r+=o*o;const s=i/a;let l=r/a-s*s;l<0&&(l=0);const c=Math.sqrt(l);return new nt(t,n,s,c)}function ot(e,t){if(0===e.length)throw new Error("Empty array provided for percentile calculation.");if(t<0||t>1)throw new Error("Invalid ratio provided for percentile calculation: "+t);if(0===t)return e[0];if(1===t)return e[e.length-1];const n=(e.length-1)*t,i=Math.floor(n),r=e[i];return r+(e[i+1]-r)*(n-i)}function at(){return Math.random().toString(36).substring(2,15)}class st{min;max;constructor(e,t){this.min=e,this.max=t}}class lt{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create spacing with no values.");if(0===e.length)throw new Error("Cannot create spacing with empty values.");if(!e.every((function(e){return!isNaN(e)&&0!==e})))throw new Error("Cannot create spacing with non number or zero values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}equals(e){if(!e)return!1;const t=this.length();if(t!==e.length())return!1;for(let n=0;n<t;++n)if(this.get(n)!==e.get(n))return!1;return!0}get2D(){return{x:this.get(0),y:this.get(1)}}}class ct{#W;#X;#Y;#j={};#Z;#_=x();#K=!1;constructor(e,t,n,i,r){this.#W=[e],this.#X=t,this.#Y=n,void 0!==r&&(this.#Z=r,this.#j[r]=[e]),void 0!==i&&(this.#_=i)}getInitialTime(){return this.#Z}getCurrentTotalNumberOfSlices(){const e=Object.keys(this.#j);if(0===e.length)return this.#W.length;let t=0;for(let n=0;n<e.length;++n)t+=this.#j[e[n]].length;return t}hasSlicesAtTime(e){return void 0!==this.#j[e]}getCurrentNumberOfSlicesBeforeTime(e){const t=Object.keys(this.#j);if(0===t.length)return;let n=0;for(let i=0;i<t.length;++i){const r=t[i];if(parseInt(r,10)===e)break;n+=this.#j[r].length}return n}getOrigin(){return this.#W[0]}getOrigins(){return this.#W}includesOrigin(e,t){for(let n=0;n<this.#W.length;++n)if(this.#W[n].isSimilar(e,t))return!0;return!1}getSize(e){let t=this.#X;if(e&&void 0!==e){let n=ut([this.#X.get(0),this.#X.get(1),this.#X.get(2)],e);n=n.map(Math.abs),t=new tt(n.concat(this.#X.getValues().slice(3)))}return t}#J(){const e=function(e){if(e.length<=1)return;const t=[];for(let n=0;n<e.length-1;++n){const i=e[n],r=e[n+1],o=i.getDistance(r);if(0===o)throw new Error("Zero slice spacing "+i.toString()+" "+r.toString());t.push(o)}const n=rt(t),i=G(n.mean,4);return n.stdDev>O&&c.warn("Varying slice spacing, value: "+i+" (mean: "+n.mean+", min: "+n.min+", max: "+n.max+", stdDev: "+n.stdDev+")"),i}(this.#W);if(void 0!==e&&this.#Y.get(2)!==e){c.trace("Using geometric spacing "+e+" instead of tag spacing "+this.#Y.get(2));const t=this.#Y.getValues();t[2]=e,this.#Y=new lt(t)}}getSpacing(e){this.#K&&(this.#J(),this.#K=!1);let t=this.#Y;if(e&&void 0!==e){let n=ut([this.#Y.get(0),this.#Y.get(1),this.#Y.get(2)],e);n=n.map(Math.abs),t=new lt(n)}return t}getRealSpacing(){return this.getSpacing(this.#_.getInverse().asOneAndZeros())}getOrientation(){return this.#_}getSliceIndex(e,t){let n=this.#W;void 0!==t&&(n=this.#j[t]);const i=e.getClosest(n),r=n[i],o=e.minus(r);return new w(this.#_.get(0,2),this.#_.get(1,2),this.#_.get(2,2)).isCodirectional(o)?i+1:i}appendOrigin(e,t,n){const i=function(t){return t.equals(e)};if(void 0!==n){if(void 0!==this.#j[n].find(i))throw new Error("Cannot append same time origin twice");this.#j[n].splice(t,0,e)}if(void 0===n||n===this.#Z){if(void 0!==this.#W.find(i))throw new Error("Cannot append same origin twice");this.#K=!0,this.#W.splice(t,0,e);const n=this.#X.getValues();n[2]+=1,this.#X=new tt(n)}}appendFrame(e,t){this.#j[t]=[e];const n=this.#X.getValues(),i=this.#Y.getValues();4===n.length?n[3]+=1:(n.push(2),i.push(1)),this.#X=new tt(n),this.#Y=new lt(i)}toString(){return"Origin: "+this.getOrigin()+", Size: "+this.getSize()+", Spacing: "+this.getSpacing()+", Orientation: "+this.getOrientation()}equals(e){return null!==e&&this.getOrigin().equals(e.getOrigin())&&this.getSize().equals(e.getSize())&&this.getSpacing().equals(e.getSpacing())}isInBounds(e){return this.isIndexInBounds(this.worldToIndex(e))}isIndexInBounds(e,t){return this.getSize().isInBounds(e,t)}indexToWorld(e){const t=this.getSpacing(),n=new E(e.get(0)*t.get(0),e.get(1)*t.get(1),e.get(2)*t.get(2)),i=this.getOrientation().multiplyPoint3D(n),r=e.getValues(),o=this.getOrigin();return r[0]=o.getX()+i.getX(),r[1]=o.getY()+i.getY(),r[2]=o.getZ()+i.getZ(),new q(r)}pointToWorld(e){const t=this.getSpacing(),n=new E(e.getX()*t.get(0),e.getY()*t.get(1),e.getZ()*t.get(2)),i=this.getOrientation().multiplyPoint3D(n),r=this.getOrigin();return new E(r.getX()+i.getX(),r.getY()+i.getY(),r.getZ()+i.getZ())}worldToIndex(e){const t=this.getOrigin(),n=new E(e.get(0)-t.getX(),e.get(1)-t.getY(),e.get(2)-t.getZ()),i=this.getOrientation().getInverse().multiplyPoint3D(n),r=e.getValues(),o=this.getSpacing();return r[0]=Math.round(i.getX()/o.get(0)),r[1]=Math.round(i.getY()/o.get(1)),r[2]=Math.round(i.getZ()/o.get(2)),new s(r)}worldToPoint(e){const t=this.getOrigin(),n=new E(e.get(0)-t.getX(),e.get(1)-t.getY(),e.get(2)-t.getZ()),i=this.getOrientation().getInverse().multiplyPoint3D(n),r=e.getValues(),o=this.getSpacing();return r[0]=i.getX()/o.get(0),r[1]=i.getY()/o.get(1),r[2]=i.getZ()/o.get(2),new E(r[0],r[1],r[2])}}function ut(e,t){return t.getInverse().multiplyArray3D(e)}function dt(e,t){return t.multiplyArray3D(e)}function ht(e){return("0"+e).slice(-2)}function St(e){if(void 0===e)return;if(1!==e.value.length)return;const t=e.value[0];let n=4,i=6;return 10===t.length&&(n=5,i=8),{year:parseInt(t.substring(0,4),10),monthIndex:t.length>=n+2?parseInt(t.substring(n,n+2),10)-1:0,day:t.length===i+2?parseInt(t.substring(i,i+2),10):0}}function gt(e){if(void 0===e)return;if(1!==e.value.length)return;const t=e.value[0],n=parseInt(t.substring(0,2),10),i=t.length>=4?parseInt(t.substring(2,4),10):0,r=t.length>=6?parseInt(t.substring(4,6),10):0,o=t.length>=8?t.substring(7,10):0;return{hours:n,minutes:i,seconds:r,milliseconds:0===o?0:parseInt(o,10)*Math.pow(10,3-o.length)}}function mt(e){return{year:e.getFullYear().toString(),monthIndex:ht((e.getMonth()+1).toString()),day:ht(e.getDate().toString())}}function pt(e){return{hours:ht(e.getHours().toString()),minutes:ht(e.getMinutes().toString()),seconds:ht(e.getSeconds().toString())}}function ft(e){return e.year+e.monthIndex+e.day}function Dt(e){return e.hours+e.minutes+e.seconds}function yt(e){const t=e["00280010"];if(void 0===t)throw new Error("Missing DICOM image number of rows");if(0===t.value.length)throw new Error("Empty DICOM image number of rows");const n=e["00280011"];if(void 0===n)throw new Error("Missing DICOM image number of columns");if(0===n.value.length)throw new Error("Empty DICOM image number of columns");return[n.value[0],t.value[0]]}function Ct(e){if(void 0===e["00280030"])return null;const t=e["00280030"],n=[parseFloat(t.value[1]),parseFloat(t.value[0])];return void 0!==e["00180088"]&&n.push(parseFloat(e["00180088"].value[0])),new lt(n)}function vt(e,t,n){let i="";if(void 0===e)i+=" "+t+" is undefined,";else if(0===e.value.length)i+=" "+t+" is empty,";else if(void 0!==n)for(let r=0;r<n.length;++r)e.value.includes(n[r])||(i+=" "+t+" does not contain "+n[r]+" (value: "+e.value+"),");return i}class It{getTime(e){}}class Tt{#$;#ee;getWarning(){return this.#$}checkElements(e){let t;this.#$=void 0,yt(e);const n=e["00080060"];if(void 0!==n&&(t=n.value[0],"PT"===t)){const t=function(e){let t,n="";n+=vt(e["00280051"],"Corrected Image (00280051)",["ATTN","DECY"]),n+=vt(e["00541102"],"Decay Correction (00541102)",["START"]),n+=vt(e["00541001"],"Units (00541001)",["BQML"]);const i=e["00101030"],r=vt(i," PatientWeight (00101030)");0===r.length?t=i.value[0]:n+=r;const o=function(e){let t,n="";const i=St(e["00080021"]);let r,o,a;const s=e["00540016"];if(n+=vt(s,"RadiopharmaceuticalInformationSequence (00540016)"),void 0!==s){1!==s.value.length&&c.warn("Found more than 1 istopes in RadiopharmaceuticalInformation Sequence.");const e="RadionuclideTotalDose (00181074)",l=s.value[0]["00181074"];t=vt(l,e),0===t.length?r=l.value[0]:n+=t;const u="RadionuclideHalfLife (00181075)",d=s.value[0]["00181075"];t=vt(d,u),0===t.length?o=parseFloat(d.value[0]):n+=t;const h=s.value[0]["00181078"];let S,g;if(void 0===h)S=i,g=gt(s.value[0]["00181072"]);else{const e=function(e){if(void 0===e)return;if(1!==e.value.length)return;const t=e.value[0].split("&")[0],n=new ve("DA");n.value=[t.substring(0,8)];const i=St(n),r=new ve("TM");return r.value=[t.substring(8)],{date:i,time:t.length>=9?gt(r):void 0}}(h);S=e.date,g=e.time}void 0===g&&(g={hours:0,minutes:0,seconds:0,milliseconds:0}),a=new Date(S.year,S.monthIndex,S.day,g.hours,g.minutes,g.seconds,g.milliseconds)}const l=gt(e["00080031"]);let u=new Date(i.year,i.monthIndex,i.day,l.hours,l.minutes,l.seconds,l.milliseconds);const d=e["00080022"],h=e["00080032"];if(void 0!==d&&void 0!==h){const t=St(d),i=gt(h),r=new Date(t.year,t.monthIndex,t.day,i.hours,i.minutes,i.seconds,i.milliseconds);if(u>r){const a="Series date/time is after Aquisition date/time (diff="+(u.getTime()-r.getTime()).toString()+"ms) ";c.debug(a);let s=0;const l="FrameReferenceTime (00541300)",d=e["00541300"];n+=vt(d,l),void 0!==d&&(s=d.value[0]);let h=0;const S="ActualFrameDuration (0018,1242)",g=e["00181242"];if(n+=vt(g,S),void 0!==g&&(h=g.value[0]),s>0&&h>0){h/=1e3,s/=1e3;const e=Math.log(2)/o,n=e*h,r=1/e*Math.log(n/(1-Math.exp(-n)))-s;u=new Date(t.year,t.monthIndex,t.day,i.hours,i.minutes,i.seconds+r,i.milliseconds)}}}let S;if(void 0!==u&&void 0!==a&&void 0!==r&&void 0!==o){const e=(u.getTime()-a.getTime())/1e3;S=r*Math.pow(2,-e/o)}return{value:S,warning:n}}(e);n+=o.warning;const a={};return 0!==n.length?a.warning="Cannot calculate PET SUV:"+n:a.value=1e3*t/o.value,a}(e);this.#ee=t.value,this.#$=t.warning}return this.#$}create(e,t,n){const i=yt(e),r=[i[0],i[1],1],o=e["00280008"];if(void 0!==o){const e=parseInt(o.value[0],10);e>1&&r.push(e)}const a=new tt(r),s=function(e){let t=1,n=1;const i=["00280030","00181164","00182010","00280034"];for(let r=0;r<i.length;++r){const o=e[i[r]];if(o&&2===o.value.length){t=parseFloat(o.value[0]),n=parseFloat(o.value[1]);break}}return 0===n&&(c.warn("Zero column spacing."),n=1),0===t&&(c.warn("Zero row spacing."),t=1),new lt([n,t,1])}(e),l=e["00020010"].value[0],d=Be(l),h=Ve(l),S=Ne(l),g=e["00200032"];let m=new Array(0,0,0);void 0!==g&&(m=[parseFloat(g.value[0]),parseFloat(g.value[1]),parseFloat(g.value[2])]);const p=function(e){const t=e["00200037"];let n;return void 0!==t&&(n=be(t.value.map((e=>parseFloat(e))))),n}(e),f=new E(m[0],m[1],m[2]),y=(new It).getTime(e),C=new ct(f,a,s,p,y);let v;const I=e["00080018"];void 0!==I&&(v=I.value[0]);let T=1;const L=e["00280002"];void 0!==L&&(T=L.value[0]);const P=a.getTotalSize()*T;if(P!==t.length){if(c.warn("Badly sized pixel buffer: "+t.length+" != "+P),!(P<t.length))throw new Error("Underestimated buffer size, can't fix it...");t=t.slice(0,a.getTotalSize())}const w=new Cn(C,t,[v]),O=e["00280004"];if(void 0!==O){let e=O.value[0].toUpperCase();(d||h||S)&&"MONOCHROME1"!==e&&"MONOCHROME2"!==e&&(e="RGB"),"RGB"===e&&1===T&&(e="PALETTE COLOR"),w.setPhotometricInterpretation(e)}const A=e["00280006"];void 0!==A&&w.setPlanarConfiguration(A.value[0]);let b=1;const x=e["00281053"];if(void 0!==x){const e=parseFloat(x.value[0]);isNaN(e)||(b=e)}let R=0;const F=e["00281052"];if(void 0!==F){const e=parseFloat(F.value[0]);isNaN(e)||(R=e)}const q={numberOfFiles:n},U=e["00080060"];void 0!==U&&(q.Modality=U.value[0]);let M=!1,Q=1;void 0!==this.#ee&&(M=!0,Q=this.#ee,c.info("Applying PET SUV calibration: "+Q),b*=Q,R*=Q);const V=new et(b,R);w.setRescaleSlopeAndIntercept(V);const N=function(t){let n;const i=e[t];return void 0!==i&&(n=i.value[0]),n};if(q.TransferSyntaxUID=N("00020010"),q.MediaStorageSOPClassUID=N("00020002"),q.SOPClassUID=N("00080016"),q.Modality=N("00080060"),q.ImageType=N("00080008"),q.SamplesPerPixel=N("00280002"),q.PhotometricInterpretation=N("00280004"),q.PixelRepresentation=N("00280103"),q.BitsAllocated=N("00280100"),q.BitsStored=N("00280101"),q.HighBit=N("00280102"),q.StudyDate=N("00080020"),q.StudyTime=N("00080030"),q.StudyInstanceUID=N("0020000D"),q.StudyID=N("00200010"),q.SeriesInstanceUID=N("0020000E"),q.SeriesNumber=N("00200011"),q.ReferringPhysicianName=N("00080090"),q.PatientName=N("00100010"),q.PatientID=N("00100020"),q.PatientBirthDate=N("00100030"),q.PatientSex=N("00100040"),q.Manufacturer=N("00080070"),q.ManufacturerModelName=N("00081090"),q.DeviceSerialNumber=N("00181000"),q.SoftwareVersions=N("00181020"),q.ImageOrientationPatient=N("00200037"),q.FrameOfReferenceUID=N("00200052"),q.IsSigned=1===q.PixelRepresentation,M)q.pixelUnit="SUV";else{const t=function(e){let t;const n=["00281054","00541001"];for(let i=0;i<n.length;++i){const r=e[n[i]];if(void 0!==r){t=r.value[0];break}}if(void 0===t){const n=e["00080060"];void 0!==n&&"CT"===n.value[0]&&(t="HU")}return t}(e);void 0!==t&&(q.pixelUnit=t)}const B={},G=e["00281050"],k=e["00281051"],H=e["00281055"];if(void 0!==G&&void 0!==k){let e;for(let t=0;t<G.value.length;++t){const n=parseFloat(G.value[t]);let i=parseFloat(k.value[t]);n&&i&&0!==i&&(e="",void 0!==H&&(e=H.value[t]),""===e&&(e="Default"+t),i*=Q,i<1&&(i=1),B[e]={wl:[new u(n*Q,i)],name:e}),0===i&&c.warn("Zero window width found in DICOM.")}}if(q.windowPresets=B,"PALETTE COLOR"===w.getPhotometricInterpretation()){const t=e["00281201"],n=e["00281202"],i=e["00281203"];let r,o,a;const s=e["00281101"];if(void 0!==s&&3===s.value.length)if(16===s.value[2]){let l=!1,u=s.value[0];0===u&&(u=65536);const d=t.vl;if(d!==2*u&&(l=!0,c.info("16bits lut but size is not double. desc: "+u+" vl: "+d)),8===parseInt(e["00280100"].value[0],10)&&(l=!0,c.info("Scaling 16bits color lut since bits allocated is 8.")),l){const e=function(e){return e>>8};r=t.value.map(e),o=n.value.map(e),a=i.value.map(e)}}else if(8===s.value[2]){c.info("Scaling 16bits color lut since the lut descriptor is 8.");let e=t.value.slice(0);r=Array.from(new Uint8Array(e.buffer)),e=n.value.slice(0),o=Array.from(new Uint8Array(e.buffer)),e=i.value.slice(0),a=Array.from(new Uint8Array(e.buffer))}D.palette={red:r,green:o,blue:a}}const z=e["00082144"];return void 0!==z&&(q.RecommendedDisplayFrameRate=parseInt(z.value[0],10)),w.setMeta(q),w}}class Lt{#O=!0;#x;constructor(e,t){void 0!==t&&(this.#O=t),this.#x=new DataView(e)}writeUint8(e,t){return this.#x.setUint8(e,t),e+Uint8Array.BYTES_PER_ELEMENT}writeInt8(e,t){return this.#x.setInt8(e,t),e+Int8Array.BYTES_PER_ELEMENT}writeUint16(e,t){return this.#x.setUint16(e,t,this.#O),e+Uint16Array.BYTES_PER_ELEMENT}writeInt16(e,t){return this.#x.setInt16(e,t,this.#O),e+Int16Array.BYTES_PER_ELEMENT}writeUint32(e,t){return this.#x.setUint32(e,t,this.#O),e+Uint32Array.BYTES_PER_ELEMENT}writeUint64(e,t){return this.#x.setBigUint64(e,t,this.#O),e+BigUint64Array.BYTES_PER_ELEMENT}writeInt32(e,t){return this.#x.setInt32(e,t,this.#O),e+Int32Array.BYTES_PER_ELEMENT}writeInt64(e,t){return this.#x.setBigInt64(e,t,this.#O),e+BigInt64Array.BYTES_PER_ELEMENT}writeFloat32(e,t){return this.#x.setFloat32(e,t,this.#O),e+Float32Array.BYTES_PER_ELEMENT}writeFloat64(e,t){return this.#x.setFloat64(e,t,this.#O),e+Float64Array.BYTES_PER_ELEMENT}writeHex(e,t){const n=parseInt(t,16);return this.#x.setUint16(e,n,this.#O),e+Uint16Array.BYTES_PER_ELEMENT}writeBinaryArray(e,t){if(t.length%8!=0)throw new Error("Cannot write boolean array as binary.");let n=null,i=null;for(let r=0,o=t.length;r<o;r+=8){n=0;for(let e=0;e<8;++e)i=0===t[r+e]?0:1,n+=i<<e;e=this.writeUint8(e,n)}return e}writeUint8Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeUint8(e,t[n]);return e}writeInt8Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeInt8(e,t[n]);return e}writeUint16Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeUint16(e,t[n]);return e}writeInt16Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeInt16(e,t[n]);return e}writeUint32Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeUint32(e,t[n]);return e}writeUint64Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeUint64(e,t[n]);return e}writeInt32Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeInt32(e,t[n]);return e}writeInt64Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeInt64(e,t[n]);return e}writeFloat32Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeFloat32(e,t[n]);return e}writeFloat64Array(e,t){for(let n=0,i=t.length;n<i;++n)e=this.writeFloat64(e,t[n]);return e}}let Pt=0;class wt{action;value;constructor(e){this.action=e}}const Ot={copy:function(e){return e},remove:function(){return null},clear:function(e){return e.value=[],e},replace:function(e,t){return e.value=[t],e}};function At(e){const t="1.2.826.0.1.3680043.9.7278.1.";let n="";if("ImplementationClassUID"===e)n=t+"0.34.0-beta.1";else{const i="."+(new Date).toISOString().replace(/\D/g,"").substring(0,14);Pt+=1;const r="."+Pt;n=t;const o=29+r.length+i.length,a=Math.min(e.length,64-o);if(a>1){let t="";for(let n=0;n<a;++n)t+=e.charCodeAt(n);n+=t.substring(0,a)}n+=i+r}return n}function bt(e){return e%2==0}function xt(e){const t=te[e];return void 0!==t&&"string"===t}function Rt(e,t){const n=new Uint8Array(e.length+1);return n.set(e),n.set(t,e.length),n}class Ft{encode(e){const t=new Uint8Array(e.length);for(let n=0,i=e.length;n<i;++n)t[n]=e.charCodeAt(n);return t}}const Et="00080005",qt="00280100";class Ut{#te=!1;#ne=!0;#ie={default:{action:"copy",value:null}};#re=this.#ie;#oe=[];#ae=new Ft;#se=this.#ae;setUseUnVrForPrivateSq(e){this.#te=e}setFixUnknownVR(e){this.#ne=e}setRules(e,t){if(this.#re=e,this.#oe=[],t){const t=Object.keys(e);for(const n of t){const t=e[n];if("replace"===t.action&&void 0!==t.value&&null!==t.value){let e,t=!1;if(8===n.length&&(t=void 0!==Se(n).getNameFromDictionary()),t)e=n;else{const t=Ce(n);void 0!==t&&(e=t.getKey())}void 0!==e&&this.#oe.push(e)}}}}#le(e){return this.#ae.encode(e)}#ce(e){return this.#se.encode(e)}useSpecialTextEncoder(){this.#se=new TextEncoder}getElementToWrite(e){const t=e.tag.getGroupName(),n=e.tag.getNameFromDictionary();let i;return i=void 0!==this.#re[e.tag.getKey()]?this.#re[e.tag.getKey()]:void 0!==n&&void 0!==this.#re[n]?this.#re[n]:void 0!==this.#re[t]?this.#re[t]:this.#re.default,Ot[i.action](e,i.value)}#ue(e,t,n,i){let r;for(let o=0;o<n.length;++o){if(r=n[o],0===r.length)continue;let a=!1;const s=r.find((e=>me(e.tag)));void 0!==s&&void 0!==s.undefinedLength&&(a=s.undefinedLength);const l=new ve("NONE");l.vl=a?4294967295:s.vl,l.tag=ge(),l.value=[],t=this.#de(e,l,t,i);for(const n of r)me(n.tag)||pe(n.tag)||(t=this.#de(e,n,t,i));if(a){const n=new ve("NONE");n.vl=0,n.tag=new de("FFFE","E00D"),n.value=[],t=this.#de(e,n,t,i)}}return t}#he(e,t,n,i,r){const o=n;if("NONE"===t.vr);else if(i instanceof Uint8Array)n=i.length===8*t.vl?e.writeBinaryArray(n,i):e.writeUint8Array(n,i);else if(i instanceof Int8Array)n=e.writeInt8Array(n,i);else if(i instanceof Uint16Array)n=e.writeUint16Array(n,i);else if(i instanceof Int16Array)n=e.writeInt16Array(n,i);else if(i instanceof Uint32Array)n=e.writeUint32Array(n,i);else if(i instanceof Int32Array)n=e.writeInt32Array(n,i);else if(i instanceof BigUint64Array)n=e.writeUint64Array(n,i);else if(i instanceof BigInt64Array)n=e.writeInt64Array(n,i);else{const o=te[t.vr];if(void 0!==o)if("Uint8"===o)n=e.writeUint8Array(n,i);else if("Uint16"===o)n=e.writeUint16Array(n,i);else if("Int16"===o)n=e.writeInt16Array(n,i);else if("Uint32"===o)n=e.writeUint32Array(n,i);else if("Int32"===o)n=e.writeInt32Array(n,i);else if("Uint64"===o)n=e.writeUint64Array(n,i);else if("Int64"===o)n=e.writeInt64Array(n,i);else if("Float32"===o)n=e.writeFloat32Array(n,i);else if("Float64"===o)n=e.writeFloat64Array(n,i);else{if("string"!==o)throw new Error("Unknown VR type: "+o);n=e.writeUint8Array(n,i)}else if("SQ"===t.vr)n=this.#ue(e,n,i,r);else if("AT"===t.vr)for(let t=0;t<i.length;++t){const r=i[t]+"",o=r.substring(1,5),a=r.substring(6,10),s=[parseInt(o,16),parseInt(a,16)];n=e.writeUint16Array(n,s)}else"xs"===t.vr?n=i instanceof Int16Array?e.writeInt16Array(n,i):e.writeUint16Array(n,i):c.warn("Unknown VR: "+t.vr)}if("SQ"!==t.vr&&"NONE"!==t.vr){const e=n-o;if(e!==t.vl){let n="Offset difference and VL are not equal: "+e+" != "+t.vl;n+=" (",void 0!==t.tag&&(n+=t.tag+", "),n+="vr:"+t.vr+")",c.warn(n)}}return n}#Se(e,t,n,i,r){let o=!1;if(void 0!==t.undefinedLength&&(o=t.undefinedLength),o){const o={};o.FFFEE000={tag:ge(),vr:"NONE",vl:0,value:[]};for(let e=0;e<i.length;++e)o[e]={tag:ge(),vr:t.vr,vl:i[e].length,value:i[e]};n=this.#ue(e,n,[o],r)}else{let o=i[0];i.length>1&&(o=function(e){const t=e.length,n=e[0].length;if(void 0===n)return e;const i=t*n,r=new e[0].constructor(i);for(let i=0;i<t;i++){const t=i*n;r.set(e[i],t)}return r}(i)),n=this.#he(e,t,n,o,r)}return n}#de(e,t,n,i){const r=t.tag.isWithVR(),o=!(!i&&r)||J(t.vr);n=e.writeHex(n,t.tag.getGroup()),n=e.writeHex(n,t.tag.getElement());let a=t.vr;this.#te&&t.tag.isPrivate()&&"SQ"===a&&(c.warn("Write element using VR=UN for private sequence."),a="UN"),r&&!i&&(n=e.writeUint8Array(n,this.#le(a)),o&&(n+=2));let s=!1;("SQ"===t.vr||ye(t.tag))&&void 0!==t.undefinedLength&&(s=t.undefinedLength);let l=!1;me(t.tag)&&void 0!==t.undefinedLength&&(l=t.undefinedLength);let u=t.vl;(s||l)&&(u=4294967295),n=o?e.writeUint32(n,u):e.writeUint16(n,u);let d=t.value;if(void 0===d&&(d=[]),n=ye(t.tag)?this.#Se(e,t,n,d,i):this.#he(e,t,n,d,i),s){const t=new ve("NONE");t.vl=0,t.tag=new de("FFFE","E0DD"),t.value=[],n=this.#de(e,t,n,i)}return n}getBuffer(e){const t=e["00020010"].value[0],n=Me(t),i=Qe(t);if(void 0!==e[Et]){const t=e[Et].value[0];void 0!==t&&"ISO-IR 6"!==t&&(c.debug("Change charset to UTF, was: "+t),this.useSpecialTextEncoder(),e[Et].value=["ISO_IR 192"])}let r;void 0!==e[qt]&&(r=e[qt].value[0]);let o=132,a=0;const s=[],l=[];let u,d,h=0;const S=new de("0002","0000"),g=new de("0002","0001"),m=new de("0002","0012"),p=new de("0002","0013"),f=this.#oe.slice(),D=Object.keys(e);for(let t=0,c=D.length;t<c;++t){const c=e[D[t]];if(c.tag=Se(D[t]),u=this.getElementToWrite(c),!(null===u||S.equals(u.tag)||g.equals(u.tag)||m.equals(u.tag)||p.equals(u.tag))){a=0;const e=f.indexOf(u.tag.getKey());-1!==e&&f.splice(e,1),this.#ne&&Mt(u,!i),this.#ge(u,u.value,n,r),d=u.tag.getGroupName(),a+=He(u.vr,"Meta Element"!==d&&n),a+=u.vl,"Meta Element"===d?(s.push(u),h+=a):l.push(u),o+=a}}for(const e of f){const t=Se(e),i=new ve(t.getVrFromDictionary());let r;if(i.tag=t,void 0!==this.#re[e])r=this.#re[e].value;else{const e=t.getNameFromDictionary();r=this.#re[e].value}let a=He(i.vr,n);a+=this.#ge(i,[r],n),l.push(i),o+=a}const y=Qt("FileMetaInformationVersion");let C=He(y.vr,!1);C+=this.#ge(y,[0,1],!1),s.push(y),h+=C,o+=C;const v=Qt("ImplementationClassUID");let I=He(v.vr,!1);const T=At("ImplementationClassUID").replace("-beta",".99");I+=this.#ge(v,[T],!1),s.push(v),h+=I,o+=I;const L=Qt("ImplementationVersionName");let P=He(L.vr,!1);const w="DWV_"+"0.34.0-beta.1".replace("-beta",".99");P+=this.#ge(L,[w],!1),s.push(L),h+=P,o+=P;const O=function(e,t){return he(e.tag,t.tag)};s.sort(O),l.sort(O);const A=Qt("FileMetaInformationGroupLength");let b=He(A.vr,!1);b+=this.#ge(A,new Uint32Array([h]),!1),o+=b;const x=new ArrayBuffer(o),R=new Lt(x),F=new Lt(x,!i);let E=128;E=R.writeUint8Array(E,this.#le("DICM")),E=this.#de(R,A,E,!1);for(let e=0,t=s.length;e<t;++e)E=this.#de(R,s[e],E,!1);const q=132+b+h;E!==q&&c.warn("Bad size calculation... meta offset: "+E+", calculated size:"+q+" (diff:"+(E-q)+")");for(let e=0,t=l.length;e<t;++e)E=this.#de(F,l[e],E,n);return E!==o&&c.warn("Bad size calculation... final offset: "+E+", calculated size:"+o+" (diff:"+(E-o)+")"),x}#ge(e,t,n,i){let r=0;if("SQ"===e.vr){if(null!==t&&0!==t){const o=[];let a=!1;void 0!==e.undefinedLength&&(a=e.undefinedLength,delete e.undefinedLength);for(let e=0;e<t.length;++e){const s=t[e],l=[];let c=0;if(null===s||0===s)continue;let u=i;const d=s[qt];void 0!==d&&void 0!==d.value&&(u=d.value[0]);const h=Object.keys(s);for(let e=0,t=h.length;e<t;++e){const t=h[e],i=s[t];i.tag=Se(t),me(i.tag)||(c+=this.#ge(i,i.value,n,u),l.push(i),c+=He(i.vr,n))}const S={tag:ge(),vr:"NONE",vl:c,value:[]};a&&(S.undefinedLength=a),l.push(S),c+=He(S.vr,n),a&&(c+=He("NONE",n));const g=function(e,t){return he(e.tag,t.tag)};l.sort(g),r+=c,o.push(l)}a&&(r+=He("NONE",n)),e.value=o,e.vl=r,a&&(e.undefinedLength=a)}}else{if(xt(o=e.vr)||"OB"===o){const n=function(e){let t="";return xt(e)&&(t="UI"===e?"\0":" "),t}(e.vr);if(xt(e.vr)){let i;ee(e.vr)?(t=this.#ce(t.join("\\")),i=this.#ce(n)):(t=this.#le(t.join("\\")),i=this.#le(n)),bt(t.length)||(t=Rt(t,i))}else"OB"===e.vr&&(t=function(e){if(null==e||void 0===e.length)throw new Error("Cannot pad undefined or null OB value.");if(0!==e.length&&void 0!==e[0].length){let t=0;for(let n=0;n<e.length;++n)t+=e[n].length;bt(t)||(e[e.length-1]=Rt(e[e.length-1],[0]))}else bt(e.length)||(e=Rt(e,[0]));return e}(t))}if(r=0,"AT"===e.vr)r=4*t.length;else if("xs"===e.vr)r=t.length*Uint16Array.BYTES_PER_ELEMENT;else if(function(e){const t=te[e];return void 0!==t&&"string"!==t}(e.vr)||"ox"===e.vr){if(ye(e.tag)&&Array.isArray(t)){r=0;for(let e=0;e<t.length;++e)r+=t[e].length}else r=t.length;const o=te[e.vr];if(ye(e.tag)||"ox"===e.vr)if(e.undefinedLength){const e=He("NONE",n);r+=e,r+=e*t.length,r+=e}else void 0!==i&&(1===i?r/=8:16===i&&(r*=Uint16Array.BYTES_PER_ELEMENT));else{if(void 0===o)throw new Error("Unsupported element: "+e.vr);{const e=function(e){let t;return"Uint8"===e?t=Uint8Array.BYTES_PER_ELEMENT:"Uint16"===e?t=Uint16Array.BYTES_PER_ELEMENT:"Int16"===e?t=Int16Array.BYTES_PER_ELEMENT:"Uint32"===e?t=Uint32Array.BYTES_PER_ELEMENT:"Int32"===e?t=Int32Array.BYTES_PER_ELEMENT:"Float32"===e?t=Float32Array.BYTES_PER_ELEMENT:"Float64"===e?t=Float64Array.BYTES_PER_ELEMENT:"Uint64"===e?t=BigUint64Array.BYTES_PER_ELEMENT:"Int64"===e&&(t=BigInt64Array.BYTES_PER_ELEMENT),t}(o);if(void 0===e)throw new Error("Unknown bytes per element for VR type: "+o);r*=e}}}else r=t.length;e.value=t,e.vl=r}var o;return r}}function Mt(e,t){if("UN"===e.vr){const n=e.tag.getVrFromDictionary();if(void 0!==n&&e.vr!==n){e.vr=n;const i=te[e.vr];if(void 0!==i&&"Uint8"!==i&&"string"!==i){const n=function(e,t,n){let i;if(void 0===e.buffer)return i;const r=new Te(e.buffer,n),o=e.byteOffset,a=e.length,s=te[t];return"Uint16"===s?i=r.readUint16Array(o,a):"Uint32"===s?i=r.readUint32Array(o,a):"Uint64"===s?i=r.readUint64Array(o,a):"Int16"===s?i=Array.from(r.readInt16Array(o,a)):"Int32"===s?i=Array.from(r.readInt32Array(o,a)):"Int64"===s?i=r.readInt64Array(o,a):"Float32"===s?i=Array.from(r.readFloat32Array(o,a)):"Float64"===s&&(i=Array.from(r.readFloat64Array(o,a))),i}(e.value,e.vr,t);void 0!==n&&(e.value=n)}c.info("Element "+e.tag.getGroup()+" "+e.tag.getElement()+" VR changed from UN to "+e.vr)}}}function Qt(e){const t=Ce(e),n=new ve(t.getVrFromDictionary());return n.tag=t,n}function Vt(e){const t=Object.keys(e),n={};for(let i=0,r=t.length;i<r;++i){const r=Ce(t[i]);if(void 0===r)continue;const o=r.getVrFromDictionary();let a,s=!1;const l=e[t[i]];if("SQ"===o){const e=[];if(void 0!==l.undefinedLength&&(s=l.undefinedLength),void 0!==l.value&&null!==l.value)for(let t=0;t<l.value.length;++t)e.push(Vt(l.value[t]));else c.trace("Undefined or null simpleTag SQ value.");a=e}else a=Array.isArray(l)?l:[l];const u=new ve(o);u.tag=r,u.value=a,s&&(u.undefinedLength=s),n[r.getKey()]=u}return n}const Nt={CodeValue:"00080100",CodingSchemeDesignator:"00080102",CodeMeaning:"00080104",LongCodeValue:"00080119",URNCodeValue:"00080120"};class Bt{meaning;value;longValue;urnValue;schemeDesignator;constructor(e){this.meaning=e}toString(){return"("+this.value+", "+this.schemeDesignator+", '"+this.meaning+"')"}}function Gt(e){const t=new Bt(e[Nt.CodeMeaning].value[0]);if(void 0!==e[Nt.CodeValue])t.value=e[Nt.CodeValue].value[0];else if(void 0!==e[Nt.LongCodeValue])t.longValue=e[Nt.LongCodeValue].value[0];else{if(void 0===e[Nt.URNCodeValue])throw new Error("Invalid code with no value, no long value and no urn value.");t.urnValue=e[Nt.URNCodeValue].value[0]}if(void 0!==t.value||void 0!==t.longValue){if(void 0===e[Nt.CodingSchemeDesignator])throw new Error("No coding sheme designator when code value or long value is present");t.schemeDesignator=e[Nt.CodingSchemeDesignator].value[0]}return t}function kt(e){const t={};return void 0!==e.value?t.CodeValue=e.value:void 0!==e.longValue?t.LongCodeValue=e.longValue:void 0!==e.urnValue&&(t.URNCodeValue=e.urnValue),void 0!==e.schemeDesignator&&(t.CodingSchemeDesignator=e.schemeDesignator),t.CodeMeaning=e.meaning,t}const Ht={111030:"Image Region",112039:"Tracking Identifier",112040:"Tracking Unique Identifier",113076:"Segmentation",121322:"Source image for image processing operation",121324:"Source Image",125007:"Measurement Group",125309:"Short label"};function zt(e){const t=new Bt(Ht[e]);return t.schemeDesignator="DCM",t.value=e,t}function Wt(){return zt("125007")}const Xt="00620005",Yt="00620009",jt="0062000C",Zt="0062000D",_t="00620003",Kt="0062000F",Jt="00620020";class $t{number;label;algorithmType;algorithmName;displayValue;displayRGBValue;propertyTypeCode;propertyCategoryCode;trackingUid;trackingId;constructor(e,t,n){this.number=e,this.label=t,this.algorithmType=n}}function en(e){const t=new $t(e["00620004"].value[0],e[Xt]?e[Xt].value[0]:"n/a",e["00620008"].value[0]);if(void 0!==e[Yt]&&(t.algorithmName=e[Yt].value[0]),void 0!==e[jt])t.displayValue=e[jt].value[0];else if(void 0!==e[Zt]){const i=e[Zt].value,r=function(e){return function(e){function t(e){let t=null;return t=e<=.0031308?12.92*e:1.055*Math.pow(e,.416666667)-.055,Math.min(1,Math.max(0,t))}const n=e.x/100,i=e.y/100,r=e.z/100;return{r:Math.round(255*t(3.2406*n-1.5372*i-.4986*r)),g:Math.round(255*t(-.9689*n+1.8758*i+.0415*r)),b:Math.round(255*t(.0557*n-.204*i+1.057*r))}}(function(e){function t(e){let t=null;return t=e>.206896552?Math.pow(e,3):.128418549*e-.017712903,t}const n=T,i=(e.l+16)/116;return{x:n.x*t(i+e.a/500),y:n.y*t(i),z:n.z*t(i-e.b/200)}}(e))}({l:.001525902*(n={l:i[0],a:i[1],b:i[2]}).l,a:.003891051*n.a-128,b:.003891051*n.b-128});t.displayRGBValue=r}var n;if(void 0===e[_t])throw new Error("Missing Segmented Property Category Code Sequence.");if(t.propertyCategoryCode=Gt(e[_t].value[0]),void 0===e[Kt])throw new Error("Missing Segmented Property Type Code Sequence.");return t.propertyTypeCode=Gt(e[Kt].value[0]),void 0!==e[Jt]&&(t.trackingId=e[Jt].value[0],t.trackingUid=e["00620021"].value[0]),t}function tn(e){let t=e.algorithmType;void 0===t&&(t="MANUAL");const n={SegmentNumber:e.number,SegmentLabel:e.label,SegmentAlgorithmType:t};if("MANUAL"!==t&&void 0!==e.algorithmName&&(n.SegmentAlgorithmName=e.algorithmName),e.displayRGBValue){const t=I(L(e.displayRGBValue));n.RecommendedDisplayCIELabValue=[Math.round(t.l),Math.round(t.a),Math.round(t.b)]}else n.RecommendedDisplayGrayscaleValue=e.displayValue;return e.propertyCategoryCode&&(n.SegmentedPropertyCategoryCodeSequence={value:[kt(e.propertyCategoryCode)]}),e.propertyTypeCode&&(n.SegmentedPropertyTypeCodeSequence={value:[kt(e.propertyTypeCode)]}),e.trackingId&&(n.TrackingID=e.trackingId,n.TrackingUID=e.trackingUid),n}const nn="00089124",rn="00082112",on="00081150",an="00081155",sn="00209116",ln="00289110";class cn{dimIndex;imagePosPat;derivationImages;refSegmentNumber;imageOrientationPatient;spacing;constructor(e,t,n,i){this.dimIndex=e,this.imagePosPat=t,this.derivationImages=n,this.refSegmentNumber=i}}function un(e){const t=[];if(void 0!==e[nn]){const n=e[nn].value;for(let e=0;e<n.length;++e){const i=[];if(void 0!==n[e][rn]){const t=n[e][rn].value;for(let e=0;e<t.length;++e){const n={};void 0!==t[e][on]&&(n.referencedSOPClassUID=t[e][on].value[0]),void 0!==t[e][an]&&(n.referencedSOPInstanceUID=t[e][an].value[0]),i.push(n)}}t.push({sourceImages:i})}}const n=e["00209111"].value[0]["00209157"].value,i=e["0062000A"].value,r=parseInt(i[0]["0062000B"].value[0],0),o=e["00209113"].value[0]["00200032"].value;for(let e=0;e<o.length;++e)o[e]=parseFloat(o[e]);const a=new cn(n,o,t,r);if(void 0!==e[sn]){const t=e[sn];if(0!==t.value.length){const e=t.value[0]["00200037"].value;void 0!==e&&(a.imageOrientationPatient=e)}}if(void 0!==e[ln]){const t=e[ln];if(0!==t.value.length){const e=Ct(t.value[0]);void 0!==e&&(a.spacing=e)}else c.warn("No shared functional group pixel measure sequence items.")}return a}function dn(e){const t={FrameContentSequence:{value:[{DimensionIndexValues:e.dimIndex}]},PlanePositionSequence:{value:[{ImagePositionPatient:e.imagePosPat}]},SegmentIdentificationSequence:{value:[{ReferencedSegmentNumber:e.refSegmentNumber}]}};if(void 0!==e.derivationImages){const n=kt(zt("121322")),i=kt(zt("113076")),r=[];for(const t of e.derivationImages){const e=[];for(const i of t.sourceImages)e.push({PurposeOfReferenceCodeSequence:{value:[n]},ReferencedSOPClassUID:i.referencedSOPClassUID,ReferencedSOPInstanceUID:i.referencedSOPInstanceUID});r.push({DerivationCodeSequence:{value:[i]},SourceImageSequence:{value:e}})}t.DerivationImageSequence={value:r}}return t}function hn(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Sn(e,t){const n=e[t.tag];if(1===t.type||2===t.type){if(void 0===n)throw new Error("Missing or empty "+t.name)}else if(void 0===n)return;let i,r=!1;if(i=1===n.value.length?n.value[0]:n.value,Array.isArray(i))for(let e=0;e<t.enum.length;++e){if(!Array.isArray(t.enum[e]))throw new Error("Cannot compare array and non array tag value.");if(k(t.enum[e],i)){r=!0;break}}else r=t.enum.includes(i);if(!r)throw new Error("Unsupported "+t.name+" value: "+i)}function gn(e,t,n){const i=e.getNumberOfComponents();let r,o;3===i?(r=function(t){return{r:e.getValueAtOffset(t),g:e.getValueAtOffset(t+1),b:e.getValueAtOffset(t+2)}},o=function(e,t){return void 0!==t.displayRGBValue&&e.r===t.displayRGBValue.r&&e.g===t.displayRGBValue.g&&e.b===t.displayRGBValue.b}):(r=function(t){return e.getValueAtOffset(t)},o=function(e,t){return e===t.displayValue});const a=e.getGeometry().getSize().getDimSize(2),s={};for(let e=0;e<a;++e){const l=r((n+e)*i);for(const n of t){const t=n.number-1;o(l,n)&&(void 0===s[t]&&(s[t]=new Uint8Array(a)),s[t][e]=1)}}return s}const mn=[{name:"TransferSyntaxUID",tag:"00020010",type:"1",enum:[ie,re,oe]},{name:"MediaStorageSOPClassUID",tag:"00020002",type:"1",enum:["1.2.840.10008.5.1.4.1.1.66.4"]},{name:"SOPClassUID",tag:"00020002",type:"1",enum:["1.2.840.10008.5.1.4.1.1.66.4"]},{name:"Modality",tag:"00080060",type:"1",enum:["SEG"]},{name:"SegmentationType",tag:"00620001",type:"1",enum:["BINARY"]},{name:"DimensionOrganizationType",tag:"00209311",type:"3",enum:["3D"]},{name:"ImageType",tag:"00080008",type:"1",enum:[["DERIVED","PRIMARY"]]},{name:"SamplesPerPixel",tag:"00280002",type:"1",enum:[1]},{name:"PhotometricInterpretation",tag:"00280004",type:"1",enum:["MONOCHROME2"]},{name:"PixelRepresentation",tag:"00280103",type:"1",enum:[0]},{name:"BitsAllocated",tag:"00280100",type:"1",enum:[1]},{name:"BitsStored",tag:"00280101",type:"1",enum:[1]},{name:"HighBit",tag:"00280102",type:"1",enum:[0]}];function pn(){const e={};for(let t=0;t<mn.length;++t){const n=mn[t];e[n.name]=n.enum[0]}return e}class fn{#$;getWarning(){return this.#$}checkElements(e){}create(e,t){for(let t=0;t<mn.length;++t)Sn(e,mn[t]);const n=yt(e),i=new tt([n[0],n[1],1]),r=i.getTotalSize();let o=1;const a=e["00280008"];if(void 0!==a&&(o=parseInt(a.value[0],10)),o!==t.length/r)throw new Error("Buffer and numberOfFrames meta are not equal."+o+" "+t.length/r);const l=function(e){const t=e["00209221"];if(void 0===t||1!==t.value.length)throw new Error("Unsupported dimension organization sequence length");const n=t.value[0]["00209164"].value[0],i=[],r=e["00209222"];if(void 0!==r){const e=r.value;if(2!==e.length)throw new Error("Unsupported dimension index sequence length");let t;for(let r=0;r<e.length;++r){const o=e[r]["00209164"].value[0];if(o!==n)throw new Error("Dimension Index Sequence contains a unknown Dimension Organization");t=e[r]["00209165"].value[0];const a={DimensionOrganizationUID:o,DimensionIndexPointer:t};void 0!==e[r]["00209421"]&&(a.DimensionDescriptionLabel=e[r]["00209421"].value[0]),i.push(a)}if("(0020,0032)"!==t)throw new Error("Unsupported non image position as last index")}return{organizations:{value:[{DimensionOrganizationUID:n}]},indices:{value:i}}}(e),u=e["00620002"];if(void 0===u)throw new Error("Missing or empty segmentation sequence");const d=[];let h,S,g=!1;for(let e=0;e<u.value.length;++e){const t=en(u.value[e]);void 0!==t.displayRGBValue&&(g=!0),d.push(t)}const m=e[52009229];if(void 0!==m){const e=m.value[0];if(void 0!==e["00209116"]){const t=e["00209116"];0!==t.value.length?S=t.value[0]["00200037"].value:c.warn("No shared functional group plane orientation sequence items.")}if(void 0!==e["00289110"]){const t=e["00289110"];0!==t.value.length?h=Ct(t.value[0]):c.warn("No shared functional group pixel measure sequence items.")}}const p=function(e,t){return e.some((function(e){return hn(t,e)}))},f=function(e,t){return e.findIndex((function(e){return hn(t,e)}))},D=e[52009230];if(void 0===D)throw new Error("Missing or empty per frame functional sequence");if(o!==D.value.length)throw new Error("perFrameFuncGroupSequence meta and numberOfFrames are not equal.");const y=[];for(let e=0;e<D.value.length;++e)y.push(un(D.value[e]));const C=[];for(let e=0;e<y.length;++e){if(p(C,y[e].imagePosPat)||C.push(y[e].imagePosPat),void 0!==y[e].imageOrientationPatient)if(void 0===S)S=y[e].imageOrientationPatient;else if(!k(S,y[e].imageOrientationPatient))throw new Error("Unsupported multi orientation dicom seg.");if(void 0!==y[e].spacing)if(void 0===h)h=y[e].spacing;else if(!h.equals(y[e].spacing))throw new Error("Unsupported multi resolution dicom seg.")}if(void 0===h)throw new Error("No spacing found for DICOM SEG");if(3!==h.length())throw new Error("Incomplete spacing found for DICOM SEG");if(void 0===S)throw new Error("No imageOrientationPatient found for DICOM SEG");if(6!==S.length)throw new Error("Incomplete imageOrientationPatient found for DICOM SEG");const v=new w(parseFloat(S[0]),parseFloat(S[1]),parseFloat(S[2])),I=new w(parseFloat(S[3]),parseFloat(S[4]),parseFloat(S[5])),T=v.crossProduct(I),L=new b([v.getX(),I.getX(),T.getX(),v.getY(),I.getY(),T.getY(),v.getZ(),I.getZ(),T.getZ()]);C.sort(function(e){const t=e.getInverse();return function(e,n){const i=t.multiplyArray3D(e),r=t.multiplyArray3D(n);return i[2]-r[2]}}(L));const P=function(e){return new E(e[0],e[1],e[2])},A=[];for(let e=0;e<C.length;++e)A.push(P(C[e]));const x=new ct(A[0],i,h,L),R=function(e){let t=e>O;return t&&(t=e>.001,t?(t=e>.01,t||c.warn("Using larger+ real world epsilon in SEG pos pat adding")):c.warn("Using larger real world epsilon in SEG pos pat adding")),t},F=[];F.push(C[0]);let q=0;for(let e=1;e<C.length;++e){++q;let t=new s([0,0,q]),n=x.indexToWorld(t).get3D();const i=A[e];let r=i.getDistance(n);const o=r;for(;R(r);)if(c.debug("Adding intermediate pos pats for DICOM seg at "+n.toString()),F.push([n.getX(),n.getY(),n.getZ()]),++q,t=new s([0,0,q]),n=x.indexToWorld(t).get3D(),r=i.getDistance(n),r>o)throw new Error("Test distance is increasing when adding intermediate pos pats");F.push(C[e])}const U=F.length,M=new ct(A[0],i,h,L),Q=["0"];for(let e=1;e<U;++e)M.appendOrigin(P(F[e]),e),Q.push(e.toString());const V=function(e){return function(t){return t.number===e}},N=g?3:1,B=new t.constructor(N*r*U);B.fill(0);let G=null,H=null;for(let e=0;e<y.length;++e){q=f(F,y[e].imagePosPat),H=r*e,G=r*q;const n=d.find(V(y[e].refSegmentNumber));for(let e=0;e<r;++e)if(0!==t[H+e]){const t=N*(G+e);g?(B[t]=n.displayRGBValue.r,B[t+1]=n.displayRGBValue.g,B[t+2]=n.displayRGBValue.b):B[t]=n.displayValue}}const z=new Cn(M,B,Q);g&&z.setPhotometricInterpretation("RGB");const W=pn(),X=function(t){let n;const i=e[t];return void 0!==i&&(n=i.value[0]),n};W.StudyDate=X("00080020"),W.StudyTime=X("00080030"),W.StudyInstanceUID=X("0020000D"),W.StudyID=X("00200010"),W.SeriesDate=X("00080021"),W.SeriesTime=X("00080031"),W.SeriesInstanceUID=X("0020000E"),W.SeriesNumber=X("00200011"),W.ReferringPhysicianName=X("00080090"),W.PatientName=X("00100010"),W.PatientID=X("00100020"),W.PatientBirthDate=X("00100030"),W.PatientSex=X("00100040"),W.Manufacturer=X("00080070"),W.ManufacturerModelName=X("00081090"),W.DeviceSerialNumber=X("00181000"),W.SoftwareVersions=X("00181020"),W.DimensionOrganizationSequence=l.organizations,W.DimensionIndexSequence=l.indices,W.custom={segments:d,frameInfos:y,SOPInstanceUID:e["00080018"].value[0]},W.numberOfFiles=U;const Y=e["00200052"];Y&&(W.FrameOfReferenceUID=Y.value[0]);const j=e["00282110"];return j&&(W.LossyImageCompression=j.value[0]),z.setMeta(W),z}toDicom(e,t,n,i){const r=e.getMeta();void 0===t&&(t=r.segments);const o=e.getGeometry(),a=o.getSize();r.Rows=a.get(1),r.Columns=a.get(0);const s=new Date;r.ContentDate=ft(mt(s)),r.ContentTime=Dt(pt(s)),void 0!==n&&(r.StudyInstanceUID=n.getMeta().StudyInstanceUID);const l=[];for(const e of t)l.push(tn(e));var u,d;r.SegmentSequence={value:l},r.SharedFunctionalGroupsSequence={value:[{PlaneOrientationSequence:{value:[(d=o.getOrientation(),{ImageOrientationPatient:[d.get(0,0),d.get(1,0),d.get(2,0),d.get(0,1),d.get(1,1),d.get(2,1)]})]},PixelMeasuresSequence:{value:[(u=o.getSpacing(),{SpacingBetweenSlices:u.get(2),PixelSpacing:[u.get(1),u.get(0)]})]}}]};const h=function(e,t){const n=e.getGeometry().getSize(),i=n.getDimSize(2),r={};for(let o=0;o<n.get(2);++o){const n=gn(e,t,o*i),a=Object.keys(n);for(const e of a)void 0===r[e]&&(r[e]={}),r[e][o]=n[e]}return r}(e,t),S=[],g=[],m=[];for(const i of t){const t=i.number,r=t-1;if(void 0===h[r])continue;const o=Object.keys(h[r]);for(let i=o.length-1;i>=0;--i){const a=Number.parseInt(o[i],10);g.push(h[r][a]);const s=e.getGeometry().getOrigins()[a],l=[s.getX(),s.getY(),s.getZ()],c={dimIndex:[t,o.length-i],imagePosPat:l,refSegmentNumber:t};if(void 0!==n){const e=n.getGeometry().worldToIndex(new q([s.getX(),s.getY(),s.getZ()]));c.derivationImages=[{sourceImages:[{referencedSOPInstanceUID:n.getImageUid(e),referencedSOPClassUID:n.getMeta().SOPClassUID}]}],m.push({ReferencedSOPInstanceUID:n.getImageUid(e),ReferencedSOPClassUID:n.getMeta().SOPClassUID})}S.push(c)}}r.NumberOfFrames=g.length.toString();const p=[];for(const e of S)p.push(dn(e));if(r.PerFrameFunctionalGroupsSequence={value:p},void 0!==n){const e=[];e.push({ReferencedInstanceSequence:{value:m},SeriesInstanceUID:n.getMeta().SeriesInstanceUID}),r.ReferencedSeriesSequence={value:e}}void 0!==i&&function(e,t){const n=Object.keys(t);for(const i of n)void 0!==e[i]&&c.trace("Overwritting tag: "+i),e[i]=t[i]}(r,i);const f=Vt(r),D=a.getDimSize(2),y=g.length*D/8,C=new ve("OB");return C.tag=new de("7FE0","0010"),C.vl=y,C.value=g,f["7FE00010"]=C,f}}function Dn(e){return(new Tt).create(e,e["7FE00010"].value[0],1)}function yn(e){return(new fn).create(e,e["7FE00010"].value[0])}class Cn{#me;#w;#pe;#t=new et(1,0);#fe=null;#De=!0;#ye=!0;#Ce="MONOCHROME2";#ve=0;#Ie;#Te={};#Le=null;#Pe=null;#we=null;#Oe=new Ze;constructor(e,t,n){this.#me=e,this.#w=t,this.#pe=n,this.#Ie=this.#w.length/this.#me.getSize().getTotalSize()}getImageUid(e){let t=this.#pe[0];return 1!==this.#pe.length&&void 0!==e&&(t=this.#pe[this.getSecondaryOffset(e)]),t}getOriginForImageUid(e){let t;const n=this.#pe.indexOf(e);return-1!==n&&(t=this.getGeometry().getOrigins()[n]),t}containsImageUids(e){return function(e,t){if(null===e||null===t||void 0===e||void 0===t)return!1;if(0===e.length||0===t.length||t.length>e.length)return!1;for(const n of t)if(!e.includes(n))return!1;return!0}(this.#pe,e)}getGeometry(){return this.#me}getBuffer(){return this.#w}canQuantify(){return 1===this.getNumberOfComponents()}canWindowLevel(){return this.isMonochrome()}isMonochrome(){return null!==this.getPhotometricInterpretation().match(/MONOCHROME/)}canScroll(e){const t=this.getGeometry().getSize();let n=1;return void 0!==this.#Te.numberOfFiles&&(n=this.#Te.numberOfFiles),t.canScroll(e)||1!==n}#Ae(){return this.#me.getSize().getTotalSize(2)}getSecondaryOffset(e){return this.#me.getSize().indexToOffset(e,2)}getRescaleSlopeAndIntercept(e){let t=this.#t;if(!this.isConstantRSI()){if(void 0===e)throw new Error("Cannot get non constant RSI with empty slice index.");const n=this.getSecondaryOffset(e);void 0!==this.#fe[n]?t=this.#fe[n]:c.warn("undefined non constant rsi at "+n)}return t}#be(e){return this.#fe[e]}setRescaleSlopeAndIntercept(e,t){if(this.#De=this.#De&&e.isID(),this.#ye){if(!this.#t.equals(e))if(void 0===t)this.#t=e;else{this.#ye=!1,this.#fe=[];for(let e=0,t=this.#Ae();e<t;++e)this.#fe.push(this.#t);this.#t=null,this.#fe.splice(t,0,e)}}else{if(void 0===t)throw new Error("Cannot store non constant RSI with empty slice index.");this.#fe.splice(t,0,e)}}isIdentityRSI(){return this.#De}isConstantRSI(){return this.#ye}getPhotometricInterpretation(){return this.#Ce}setPhotometricInterpretation(e){this.#Ce=e}getPlanarConfiguration(){return this.#ve}setPlanarConfiguration(e){this.#ve=e}getNumberOfComponents(){return this.#Ie}getMeta(){return this.#Te}setMeta(e){this.#Te=e}getValueAtOffset(e){return this.#w[e]}getOffsets(e){let t;if("number"==typeof e){if(1!==this.#Ie)throw new Error("Number of components is not 1 for getting single value.");t=[e]}else if(void 0!==e.r&&void 0!==e.g&&void 0!==e.b){if(3!==this.#Ie)throw new Error("Number of components is not 3 for getting RGB value.");t=[e.r,e.g,e.b]}const n=[];let i;for(let e=0;e<this.#w.length;e+=this.#Ie){i=!0;for(let n=0;n<this.#Ie;++n)if(this.#w[e+n]!==t[n]){i=!1;break}i&&n.push(e)}return n}hasValues(e){if(void 0===e||0===e.length)return[];const t=[];for(let n=0;n<e.length;++n)1===this.#Ie?t.push([e[n]]):3===this.#Ie&&t.push([e[n].r,e[n].g,e[n].b]);let n;1===this.#Ie?n=function(e,t){return e[0]===t[0]}:3===this.#Ie&&(n=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]});const i=function(e){return function(t){return n(t,e)}},r=new Array(e.length);r.fill(!1);const o=t.slice();let a,s;for(let e=0,n=this.#w.length;e<n;e+=this.#Ie){s=[];for(let n=0;n<o.length;++n){a=!0;for(let t=0;t<this.#Ie;++t)if(this.#w[e+t]!==o[n][t]){a=!1;break}a&&(r[t.findIndex(i(o[n]))]=!0,s.push(n))}for(let e=0;e<s.length;++e)o.splice(s[e],1);if(0===o.length)break}return r}clone(){const e=this.#w.slice(0),t=new Cn(this.getGeometry(),e,this.#pe);if(this.isConstantRSI())t.setRescaleSlopeAndIntercept(this.getRescaleSlopeAndIntercept());else for(let e=0;e<this.#Ae();++e)t.setRescaleSlopeAndIntercept(this.#be(e),e);return t.setPhotometricInterpretation(this.getPhotometricInterpretation()),t.setPlanarConfiguration(this.getPlanarConfiguration()),t.setMeta(this.getMeta()),t}#xe(e){let t=this.#w;if(this.#w=ke(8*this.#w.BYTES_PER_ELEMENT,this.#Te.IsSigned?1:0,e),null===this.#w)throw new Error("Cannot reallocate data for image.");this.#w.set(t),t=null}appendSlice(e){if(null===e)throw new Error("Cannot append null slice");const t=e.getGeometry().getSize();let n=this.#me.getSize();if(1!==t.get(2))throw new Error("Cannot append more than one slice");if(n.get(0)!==t.get(0))throw new Error("Cannot append a slice with different number of columns");if(n.get(1)!==t.get(1))throw new Error("Cannot append a slice with different number of rows");if(!this.#me.getOrientation().equals(e.getGeometry().getOrientation(),1e-4))throw new Error("Cannot append a slice with different orientation");if(this.#Ce!==e.getPhotometricInterpretation())throw new Error("Cannot append a slice with different photometric interpretation");for(const t in this.#Te)if("windowPresets"!==t&&"numberOfFiles"!==t&&"custom"!==t&&this.#Te[t]!==e.getMeta()[t])throw new Error("Cannot append a slice with different "+t+": "+this.#Te[t]+" != "+e.getMeta()[t]);const i=e.getDataRange(),r=this.getDataRange();this.#Le={min:Math.min(i.min,r.min),max:Math.max(i.max,r.max)};const o=e.getRescaledDataRange(),a=this.getRescaledDataRange();this.#Pe={min:Math.min(o.min,a.min),max:Math.max(o.max,a.max)};const l=e.getGeometry().getInitialTime();let c=!1;void 0===l||this.#me.hasSlicesAtTime(l)||(this.appendFrame(l,e.getGeometry().getOrigin()),n=this.#me.getSize(),c=!0);const u=function(e,t){const n=t.getInitialTime(),i=[];return i.push(0),i.push(0),i.push(e.getSliceIndex(t.getOrigin(),n)),void 0!==n&&i.push(n),new s(i)}(this.#me,e.getGeometry()),d=this.#Ie*n.getDimSize(2);if(void 0===this.#Te.numberOfFiles)throw new Error("Missing number of files for buffer manipulation.");const h=d*this.#Te.numberOfFiles;this.#w.length!==h&&this.#xe(h);const S=u.get(2);let g=S;void 0!==l&&(g+=this.#me.getCurrentNumberOfSlicesBeforeTime(l));const m=g*d,p=this.#me.getCurrentTotalNumberOfSlices()*d;m<p&&this.#w.set(this.#w.subarray(m,p),m+d),this.#w.set(e.getBuffer(),m),c||this.#me.appendOrigin(e.getGeometry().getOrigin(),S,l),this.setRescaleSlopeAndIntercept(e.getRescaleSlopeAndIntercept(),g);const f=this.#pe.length;if(this.#pe.splice(g,0,e.getImageUid()),void 0!==this.#Te.windowPresets){const t=this.#Te.windowPresets,n=e.getMeta().windowPresets,i=Object.keys(n);let r=null;for(let e=0;e<i.length;++e){r=i[e];const o=n[r],a=t[r];if(void 0!==a){if((void 0===a.perslice||!1===a.perslice)&&!a.wl[0].equals(o.wl[0])){a.perslice=!0;for(let e=0;e<f-1;++e)a.wl.push(a.wl[0])}void 0!==a.perslice&&!0===a.perslice&&t[r].wl.splice(g,0,o.wl[0])}else t[r]=n[r]}}this.#Re({type:"imagegeometrychange"})}appendFrameBuffer(e,t){const n=this.#me.getSize(),i=this.#Ie*n.getDimSize(2);if(void 0===this.#Te.numberOfFiles)throw new Error("Missing number of files for frame buffer manipulation.");const r=i*this.#Te.numberOfFiles;this.#w.length!==r&&this.#xe(r),t>=this.#Te.numberOfFiles?c.warn("Ignoring frame at index "+t+" (size: "+this.#Te.numberOfFiles+")"):(this.#w.set(e,i*t),this.appendFrame(t,new E(0,0,0)))}appendFrame(e,t){this.#me.appendFrame(t,e),this.#Re({type:"appendframe"})}getDataRange(){return this.#Le||(this.#Le=this.calculateDataRange()),this.#Le}getRescaledDataRange(){return this.#Pe||(this.#Pe=this.calculateRescaledDataRange()),this.#Pe}getHistogram(){if(!this.#we){const e=this.calculateHistogram();this.#Le=e.dataRange,this.#Pe=e.rescaledDataRange,this.#we=e.histogram}return this.#we}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};setAtOffsets(e,t){let n,i;if("number"==typeof t){if(1!==this.#Ie)throw new Error("Number of components is not 1 for setting single value.");n=[t]}else if(void 0!==t.r&&void 0!==t.g&&void 0!==t.b){if(3!==this.#Ie)throw new Error("Number of components is not 3 for setting RGB value.");n=[t.r,t.g,t.b]}for(let t=0,r=e.length;t<r;++t){i=e[t];for(let e=0;e<this.#Ie;++e)this.#w[i+e]=n[e]}this.#Re({type:"imagecontentchange"})}setAtOffsetsAndGetOriginals(e,t){const n=[];for(let i=0;i<e.length;++i){const r=e[i];let o=3*r[0],a={r:this.#w[o],g:this.#w[o+1],b:this.#w[o+2]};const s=[];s.push({index:0,colour:a});for(let e=0;e<r.length;++e){o=3*r[e];const n={r:this.#w[o],g:this.#w[o+1],b:this.#w[o+2]};a.r===n.r&&a.g===n.g&&a.b===n.b||(s.push({index:e,colour:n}),a=n),this.#w[o]=t.r,this.#w[o+1]=t.g,this.#w[o+2]=t.b}n.push(s)}return this.#Re({type:"imagecontentchange"}),n}setAtOffsetsWithIterator(e,t){for(let n=0;n<e.length;++n){const i=e[n];let r;Array.isArray(t)?r=$e(t[n],i.length):void 0!==t.r&&void 0!==t.g&&void 0!==t.b&&(r=$e([{index:0,colour:t}],i.length));let o=r.next();for(;!o.done;){const e=3*i[o.index];this.#w[e]=o.value.r,this.#w[e+1]=o.value.g,this.#w[e+2]=o.value.b,o=r.next()}}this.#Re({type:"imagecontentchange"})}getValue(e,t,n,i){const r=new s([e,t,n,i||0]);return this.getValueAtOffset(this.getGeometry().getSize().indexToOffset(r))}getValueAtIndex(e){return this.getValueAtOffset(this.getGeometry().getSize().indexToOffset(e))}getRescaledValue(e,t,n,i){void 0===i&&(i=0);let r=this.getValue(e,t,n,i);if(!this.isIdentityRSI())if(this.isConstantRSI())r=this.getRescaleSlopeAndIntercept().apply(r);else{const o=new s([e,t,n,i]);r=this.getRescaleSlopeAndIntercept(o).apply(r)}return r}getRescaledValueAtIndex(e){return this.getRescaledValueAtOffset(this.getGeometry().getSize().indexToOffset(e))}getRescaledValueAtOffset(e){let t=this.getValueAtOffset(e);if(!this.isIdentityRSI())if(this.isConstantRSI())t=this.getRescaleSlopeAndIntercept().apply(t);else{const n=this.getGeometry().getSize().offsetToIndex(e);t=this.getRescaleSlopeAndIntercept(n).apply(t)}return t}calculateDataRange(){let e=this.getValueAtOffset(0),t=e,n=0;const i=this.getGeometry().getSize();let r=i.getTotalSize();i.length()>=3&&(r=i.getDimSize(3));for(let i=0;i<r;++i)n=this.getValueAtOffset(i),n>t&&(t=n),n<e&&(e=n);return{min:e,max:t}}calculateRescaledDataRange(){if(this.isIdentityRSI())return this.getDataRange();if(this.isConstantRSI()){const e=this.getDataRange(),t=this.getRescaleSlopeAndIntercept().apply(e.min),n=this.getRescaleSlopeAndIntercept().apply(e.max);return{min:t<n?t:n,max:t>n?t:n}}{let e=this.getRescaledValueAtOffset(0),t=e,n=0;const i=this.getGeometry().getSize();let r=i.getTotalSize();3===i.length()&&(r=i.getDimSize(3));for(let i=0;i<r;++i)n=this.getRescaledValueAtOffset(i),n>t&&(t=n),n<e&&(e=n);return{min:e,max:t}}}calculateHistogram(){const e=this.getGeometry().getSize(),t=[];let n=this.getValueAtOffset(0),i=n,r=0,o=this.getRescaledValueAtOffset(0),a=o,s=0;for(let l=0,c=e.getTotalSize();l<c;++l)r=this.getValueAtOffset(l),r>i&&(i=r),r<n&&(n=r),s=this.getRescaledValueAtOffset(l),s>a&&(a=s),s<o&&(o=s),t[s]=(t[s]||0)+1;const l={min:n,max:i},c={min:o,max:a},u=[];for(let e=o;e<=a;++e)u.push([e,t[e]||0]);return{dataRange:l,rescaledDataRange:c,histogram:u}}convolute2D(e){if(9!==e.length)throw new Error("The convolution matrix does not have a length of 9; it has "+e.length);const t=this.clone(),n=t.getBuffer(),i=this.getGeometry().getSize(),r=i.getDimSize(2)*this.getNumberOfComponents();for(let t=0;t<i.get(2);++t)this.convoluteBuffer(e,n,t*r);return t}convoluteBuffer(e,t,n){const i=this.getGeometry().getSize(),r=i.get(0),o=i.get(1),a=this.getNumberOfComponents();let s=1,l=1;3===a&&(0===this.getPlanarConfiguration()?s=3:l=i.getDimSize(2));const c=[];c[0]=(-r-1)*s,c[1]=-r*s,c[2]=(1-r)*s,c[3]=-s,c[4]=0,c[5]=1*s,c[6]=(r-1)*s,c[7]=r*s,c[8]=(r+1)*s;const u=[];u[0]=c[4],u[1]=c[4],u[2]=c[5],u[3]=c[4],u[4]=c[4],u[5]=c[5],u[6]=c[7],u[7]=c[7],u[8]=c[8];const d=[];d[0]=c[1],d[1]=c[1],d[2]=c[2],d[3]=c[4],d[4]=c[4],d[5]=c[5],d[6]=c[7],d[7]=c[7],d[8]=c[8];const h=[];h[0]=c[1],h[1]=c[1],h[2]=c[2],h[3]=c[4],h[4]=c[4],h[5]=c[5],h[6]=c[4],h[7]=c[4],h[8]=c[5];const S=[];S[0]=c[3],S[1]=c[4],S[2]=c[5],S[3]=c[3],S[4]=c[4],S[5]=c[5],S[6]=c[6],S[7]=c[7],S[8]=c[8];const g=[];g[0]=c[0],g[1]=c[1],g[2]=c[2],g[3]=c[3],g[4]=c[4],g[5]=c[5],g[6]=c[3],g[7]=c[4],g[8]=c[5];const m=[];m[0]=c[3],m[1]=c[4],m[2]=c[4],m[3]=c[3],m[4]=c[4],m[5]=c[4],m[6]=c[6],m[7]=c[7],m[8]=c[7];const p=[];p[0]=c[0],p[1]=c[1],p[2]=c[1],p[3]=c[3],p[4]=c[4],p[5]=c[4],p[6]=c[6],p[7]=c[7],p[8]=c[7];const f=[];f[0]=c[0],f[1]=c[1],f[2]=c[1],f[3]=c[3],f[4]=c[4],f[5]=c[4],f[6]=c[3],f[7]=c[4],f[8]=c[4];let D=n,y=0,C=[];for(let n=0;n<a;++n){D+=n*l;for(let n=0;n<o;++n)for(let i=0;i<r;++i){C=c,0===i&&0===n?C=u:0===i&&n===o-1?C=h:i===r-1&&0===n?C=m:i===r-1&&n===o-1?C=f:0===i&&n!==o-1&&0!==n?C=d:i===r-1&&n!==o-1&&0!==n?C=p:0!==i&&i!==r-1&&0===n?C=S:0!==i&&i!==r-1&&n===o-1&&(C=g),y=0;for(let t=0;t<9;++t)y+=this.getValueAtOffset(D+C[t])*e[t];t[D]=y,D+=s}}}transform(e){const t=this.clone(),n=t.getBuffer();for(let i=0,r=n.length;i<r;++i)n[i]=e(t.getValueAtOffset(i));return t}compose(e,t){const n=this.clone(),i=n.getBuffer();for(let n=0,r=i.length;n<r;++n)i[n]=Math.floor(t(this.getValueAtOffset(n),e.getValueAtOffset(n)));return n}}class vn{create(e,t){const n=new Ln(t);"MONOCHROME1"===t.getPhotometricInterpretation()?n.setColourMap("invPlain"):"PALETTE COLOR"===t.getPhotometricInterpretation()&&(void 0!==D.palette?n.setColourMap("palette"):c.warn("Cannot find Palette lut"));let i={};if(void 0!==t.getMeta().windowPresets&&(i=t.getMeta().windowPresets),i.minmax={name:"minmax"},void 0!==d){const e=t.getMeta().Modality;for(const t in d[e]){const n=d[e][t];i[t]={wl:[new u(n.center,n.width)],name:t}}}return n.setWindowPresets(i),n.init(),n}}const In=["wlchange","wlpresetadd","colourmapchange","positionchange","opacitychange","alphafuncchange"];function Tn(e,t){return(new vn).create(e,t)}class Ln{#Fe;#Ee;#ye;#qe={minmax:{name:"minmax"}};#Ue=null;#Me;#Qe="plain";#Ve=null;#_;#Oe=new Ze;constructor(e){this.#Fe=e,this.#Fe.addEventListener("appendframe",(()=>{const e=this.getCurrentIndex();if(3===e.length()){const t=e.getValues();t.push(0),this.setCurrentIndex(new s(t))}}))}getImage(){return this.#Fe}setImage(e){this.#Fe=e}getOrientation(){return this.#_}setOrientation(e){this.#_=e}init(){this.setInitialIndex()}setInitialIndex(){const e=this.#Fe.getGeometry().getSize(),t=new Array(e.length());t.fill(0),t[0]=Math.floor(e.get(0)/2),t[1]=Math.floor(e.get(1)/2),t[2]=Math.floor(e.get(2)/2),this.setCurrentIndex(new s(t),!0)}getPlaybackMilliseconds(e){return e||(e=10),Math.round(1e3/e)}#Ne=function(e,t){return 255};getAlphaFunction(){return this.#Ne}setAlphaFunction(e){this.#Ne=e,this.#Re({type:"alphafuncchange"})}#Be(){if(this.#Ue&&void 0!==this.#qe[this.#Ue]&&void 0!==this.#qe[this.#Ue].perslice&&!0===this.#qe[this.#Ue].perslice){this.getCurrentIndex()||this.setInitialIndex();const e=this.getCurrentIndex(),t=this.#Fe.getSecondaryOffset(e),n=this.#qe[this.#Ue].wl[t];this.setWindowLevel(n,this.#Ue,!0)}if(void 0===this.#Me&&this.setWindowLevelPresetById(0,!0),void 0===this.#ye||this.#Fe.isConstantRSI()!==this.#ye){let e,t;this.#ye=this.#Fe.isConstantRSI(),this.#ye?(e=this.#Fe.getRescaleSlopeAndIntercept(),t=!0):(e=new et(1,0),t=!1);const n=new l(e,this.#Fe.getMeta().BitsStored);this.#Ee=new S(n,this.#Fe.getMeta().IsSigned,t)}const e=this.#Ee.getVoiLut();let t;if(void 0!==e&&(t=e.getWindowLevel()),void 0===e||!this.#Me.equals(t)){const e=new h(this.#Me);this.#Ee.setVoiLut(e)}return this.#Ee}getWindowPresets(){return this.#qe}getWindowPresetsNames(){return Object.keys(this.#qe)}setWindowPresets(e){this.#qe=e}addWindowPresets(e){const t=Object.keys(e);let n=null;for(let i=0;i<t.length;++i)if(n=t[i],void 0!==this.#qe[n]){if(void 0!==this.#qe[n].perslice&&!0===this.#qe[n].perslice)throw new Error("Cannot add perslice preset");this.#qe[n]=e[n]}else this.#qe[n]=e[n],this.#Re({type:"wlpresetadd",name:n})}getCurrentWindowPresetName(){return this.#Ue}getColourMap(){return this.#Qe}#Ge(){return D[this.#Qe]}setColourMap(e){if(!D[e])throw new Error("Unknown colour map: '"+e+"'");this.#Qe=e,this.#Re({type:"colourmapchange",value:[e]})}getCurrentPosition(){return this.#Ve}getCurrentIndex(){const e=this.getCurrentPosition();return e?this.getImage().getGeometry().worldToIndex(e):null}getCurrentImageUid(){return this.#Fe.getImageUid(this.getCurrentIndex())}getOriginIndexForImageUid(e){let t;const n=this.getImage().getGeometry(),i=this.#Fe.getOriginForImageUid(e);if(void 0!==i){const e=new q([i.getX(),i.getY(),i.getZ()]);t=n.worldToIndex(e)}return t}isPositionInBounds(e){void 0===e&&(e=this.#Ve);const t=this.#Fe.getGeometry(),n=t.worldToIndex(e),i=[this.getScrollIndex()];return 4===n.length()&&i.push(3),t.isIndexInBounds(n,i)}getOrigin(e){const t=this.#Fe.getGeometry();let n=0;return void 0!==e&&(n=t.worldToIndex(e).get(2)),t.getOrigins()[n]}setCurrentPosition(e,t){const n=this.#Fe.getGeometry(),i=n.worldToIndex(e),r=[this.getScrollIndex()];return 4===i.length()&&r.push(3),n.isIndexInBounds(i,r)?this.setCurrentIndex(i,t):(t||(this.#Ve=e,this.#Re({type:"positionchange",value:[i.getValues(),e.getValues()],valid:!1})),!1)}setCurrentIndex(e,t){void 0===t&&(t=!1);const n=this.#Fe.getGeometry(),i=n.indexToWorld(e),r=[this.getScrollIndex()];if(4===e.length()&&r.push(3),!n.isIndexInBounds(e,r))return t||(this.#Ve=i,this.#Re({type:"positionchange",value:[e.getValues(),i.getValues()],valid:!1})),!1;let o=null,a=null;if(this.getCurrentPosition()&&(a=this.getCurrentIndex()),a)if(a.canCompare(e))o=a.compare(e);else{o=[];const t=Math.min(a.length(),e.length());for(let n=0;n<t;++n)a.get(n)!==e.get(n)&&o.push(n);const n=Math.max(a.length(),e.length());for(let e=t;e<n;++e)o.push(e)}else{o=[];for(let t=0;t<e.length();++t)o.push(t)}if(this.#Ve=i,!t){const t={type:"positionchange",value:[e.getValues(),i.getValues()],diffDims:o,data:{imageUid:this.#Fe.getImageUid(e)}};if(this.#Fe.canQuantify()){const n=this.#Fe.getRescaledValueAtIndex(e);t.value.push(n)}this.#Re(t)}return!0}setWindowLevel(e,t,n){if(void 0===t&&(t="manual"),"manual"!==t&&void 0===this.#qe[t])throw new Error("Unknown window level preset: '"+t+"'");void 0===n&&(n=!1);const i=!e.equals(this.#Me),r=this.#Ue!==t;(i||r)&&(this.#Me=e,this.#Ue=t,"manual"===t&&(void 0!==this.#qe[t]?this.#qe[t].wl[0]=e:this.addWindowPresets({manual:{wl:[e],name:"manual"}})),this.#Re({type:"wlchange",value:[e.center,e.width,t],wc:e.center,ww:e.width,skipGenerate:n}))}getWindowLevel(){return this.#Be().getVoiLut().getWindowLevel()}setWindowLevelPreset(e,t){const n=this.getWindowPresets()[e];if(void 0===n)throw new Error("Unknown window level preset: '"+e+"'");"minmax"===e&&void 0===n.wl&&(n.wl=[this.getWindowLevelMinMax()]);let i=n.wl[0];if(void 0!==n.perslice&&!0===n.perslice){const e=this.#Fe.getSecondaryOffset(this.getCurrentIndex());i=n.wl[e]}this.setWindowLevel(i,e,t)}setWindowLevelPresetById(e,t){const n=Object.keys(this.getWindowPresets());this.setWindowLevelPreset(n[e],t)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};getWindowLevelMinMax(){const e=this.getImage().getRescaledDataRange(),t=e.min;let n=e.max-t;return n<1&&(c.warn("Zero or negative window width, defaulting to one."),n=1),new u(t+n/2,n)}setWindowLevelMinMax(){const e=this.getWindowLevelMinMax();this.setWindowLevel(e,"minmax")}generateImageData(e,t){void 0===t&&(this.getCurrentIndex()||this.setInitialIndex(),t=this.getCurrentIndex());const n=this.getImage(),i=!n.isConstantRSI(),r=Je(n,t,i,this.getOrientation()),o=n.getPhotometricInterpretation();switch(o){case"MONOCHROME1":case"MONOCHROME2":!function(e,t,n,i,r){let o=0,a=0,s=t.next();for(;!s.done;)a=i.getValue(s.value),e.data[o]=r.red[a],e.data[o+1]=r.green[a],e.data[o+2]=r.blue[a],e.data[o+3]=n(s.value,s.index),o+=4,s=t.next()}(e,r,this.getAlphaFunction(),this.#Be(),this.#Ge());break;case"PALETTE COLOR":!function(e,t,n,i,r){const o=function(e){return e>>8};r&&c.info("Scaling 16bits data to 8bits.");let a=0,s=0,l=t.next();for(;!l.done;)s=l.value,r?(e.data[a]=o(i.red[s]),e.data[a+1]=o(i.green[s]),e.data[a+2]=o(i.blue[s])):(e.data[a]=i.red[s],e.data[a+1]=i.green[s],e.data[a+2]=i.blue[s]),e.data[a+3]=n(s,l.index),a+=4,l=t.next()}(e,r,this.getAlphaFunction(),this.#Ge(),16===n.getMeta().BitsStored);break;case"RGB":!function(e,t,n){let i=0,r=t.next();for(;!r.done;)e.data[i]=r.value[0],e.data[i+1]=r.value[1],e.data[i+2]=r.value[2],e.data[i+3]=n(r.value,r.index),i+=4,r=t.next()}(e,r,this.getAlphaFunction());break;case"YBR_FULL":!function(e,t,n){let i=0,r=null,o=t.next();for(;!o.done;)a=o.value[0],s=o.value[1],r={r:a+1.402*((l=o.value[2])-128),g:a-.34414*(s-128)-.71414*(l-128),b:a+1.772*(s-128)},e.data[i]=r.r,e.data[i+1]=r.g,e.data[i+2]=r.b,e.data[i+3]=n(o.value,o.index),i+=4,o=t.next();var a,s,l}(e,r,this.getAlphaFunction());break;default:throw new Error("Unsupported photometric interpretation: "+o)}}getScrollIndex(){let e=null;const t=this.getOrientation();return e=void 0!==t?t.getThirdColMajorDirection():2,e}}class Pn{#Y;#ke;#He;#ze;constructor(e,t,n){this.#Y=e,this.#ke=t,this.#He=n,this.#ze=function(e,t){let n=e.asOneAndZeros().multiply(t);return e.asOneAndZeros().getAbs().equals(Le().getAbs())&&(n=n.getAbs()),n}(t,n)}getOffset3DFromPlaneOffset(e){const t=new w(e.x,e.y,0),n=this.getTargetDeOrientedVector3D(t);return new w(n.getX()*this.#Y.get(0),n.getY()*this.#Y.get(1),n.getZ()*this.#Y.get(2))}getPlaneOffsetFromOffset3D(e){const t=new w(e.x/this.#Y.get(0),e.y/this.#Y.get(1),e.z/this.#Y.get(2)),n=this.getTargetOrientedVector3D(t);return{x:n.getX(),y:n.getY()}}getTargetOrientedVector3D(e){let t=e;return void 0!==this.#ze&&(t=this.#ze.getInverse().multiplyVector3D(e)),t}getTargetDeOrientedVector3D(e){let t=e;return void 0!==this.#ze&&(t=this.#ze.multiplyVector3D(e)),t}getTargetDeOrientedPoint3D(e){let t=e;return void 0!==this.#ze&&(t=this.#ze.multiplyPoint3D(e)),t}getImageOrientedVector3D(e){let t=e;if(void 0!==this.#He){const n=dt([e.getX(),e.getY(),e.getZ()],this.#He);t=new w(n[0],n[1],n[2])}return t}getImageOrientedPoint3D(e){let t=e;if(void 0!==this.#He){const n=dt([e.getX(),e.getY(),e.getZ()],this.#He);t=new E(n[0],n[1],n[2])}return t}getImageDeOrientedVector3D(e){let t=e;if(void 0!==this.#He){const n=ut([e.getX(),e.getY(),e.getZ()],this.#He);t=new w(n[0],n[1],n[2])}return t}getImageDeOrientedPoint3D(e){let t=e;if(void 0!==this.#He){const n=ut([e.getX(),e.getY(),e.getZ()],this.#He);t=new E(n[0],n[1],n[2])}return t}getTargetOrientedPositiveXYZ(e){const t=ut([e.x,e.y,e.z],this.#ze);return{x:t[0],y:t[1],z:t[2]}}getScrollIndex(){let e=null;return e=void 0!==this.#He?this.#He.getThirdColMajorDirection():2,e}getNativeScrollIndex(){let e=null;return e=void 0!==this.#ke?this.#ke.getThirdColMajorDirection():2,e}}class wn{#x;#We;#Xe;#Ye=!1;constructor(e){if(void 0===e.getImage())throw new Error("View does not have an image, cannot setup controller");this.#x=e,this.#We=new Pn(e.getImage().getGeometry().getRealSpacing(),e.getImage().getGeometry().getOrientation(),e.getOrientation()),"SEG"===e.getImage().getMeta().Modality&&(this.#Ye=!0)}getPlaneHelper(){return this.#We}isMask(){return this.#Ye}initialise(){this.setWindowLevelPresetById(0),this.setCurrentPosition(this.getPositionFromPlanePoint(new F(0,0)))}getModality(){return this.#x.getImage().getMeta().Modality}getWindowLevelPresetsNames(){return this.#x.getWindowPresetsNames()}addWindowLevelPresets(e){return this.#x.addWindowPresets(e)}setWindowLevelPreset(e){this.#x.setWindowLevelPreset(e)}setWindowLevelPresetById(e){this.#x.setWindowLevelPresetById(e)}isPlaying(){return void 0!==this.#Xe}getCurrentPosition(){return this.#x.getCurrentPosition()}getCurrentIndex(){return this.#x.getCurrentIndex()}getCurrentImageUid(){return this.#x.getCurrentImageUid()}getOriginIndexForImageUid(e){return this.#x.getOriginIndexForImageUid(e)}getCurrentOrientedIndex(){let e=this.#x.getCurrentIndex();if(void 0!==this.#x.getOrientation()){const t=this.#We.getImageDeOrientedVector3D(new w(e.get(0),e.get(1),e.get(2)));e=new s([t.getX(),t.getY(),t.getZ()])}return e}getScrollIndex(){return this.#x.getScrollIndex()}getCurrentScrollIndexValue(){return this.#x.getCurrentIndex().get(this.#x.getScrollIndex())}getOrigin(e){return this.#x.getOrigin(e)}getCurrentScrollPosition(){const e=this.#x.getScrollIndex();return this.#x.getCurrentPosition().get(e)}generateImageData(e,t){this.#x.generateImageData(e,t)}setImage(e){this.#x.setImage(e)}get2DSpacing(){return this.#x.getImage().getGeometry().getSpacing(this.#x.getOrientation()).get2D()}getRescaledImageValue(e){const t=this.#x.getImage();if(!t.canQuantify())return;const n=t.getGeometry(),i=n.worldToIndex(e);let r;return n.isIndexInBounds(i)&&(r=t.getRescaledValueAtIndex(i)),r}getPixelUnit(){return this.#x.getImage().getMeta().pixelUnit}getStudyInstanceUID(){return this.#x.getImage().getMeta().StudyInstanceUID}#je(e,t,n,i){const r=Ke(Je(e,t,n,i)),o=e.getGeometry().getSize(i).getValues();o[2]=1;const a=new tt(o),s=e.getGeometry().getSpacing(i).getValues();s[2]=1;const l=new lt(s),c=new E(0,0,0),u=new ct(c,a,l);return new Cn(u,r)}getImageRegionValues(e,t){let n=this.#x.getImage();const i=this.#x.getOrientation();let r=this.getCurrentIndex(),o=!0;R(i)||(n=this.#je(n,r,o,i),r=new s([0,0,0]),o=!1);const a=function(e,t,n,i,r){if(1!==e.getNumberOfComponents())throw new Error("Unsupported number of components for region iterator: "+e.getNumberOfComponents());void 0===n&&(n=!1);let o=null;o=n?function(t){return e.getRescaledValueAtOffset(t)}:function(t){return e.getValueAtOffset(t)};const a=e.getGeometry().getSize();void 0===i&&(i=new F(0,0)),void 0===r&&(r=new F(a.get(0)-1,a.get(1)));const s=a.indexToOffset(t.getWithNew2D(i.getX(),i.getY())),l=a.indexToOffset(t.getWithNew2D(r.getX(),r.getY()-1)),c=Math.max(1,r.getX()-i.getX());return function(e,t,n,i,r,o){let a=t,s=0;return{next:function(){if(a<n){const t={value:e(a),done:!1,index:a};return s+=1,a+=1,s===r&&(s=0,a+=o),t}return{done:!0,index:n}}}}(o,s,l+1,0,c,a.get(0)-c)}(n,r,o,e,t);let l=[];return a&&(l=Ke(a)),l}getImageVariableRegionValues(e){let t=this.#x.getImage();const n=this.#x.getOrientation();let i=this.getCurrentIndex(),r=!0;R(n)||(t=this.#je(t,i,r,n),i=new s([0,0,0]),r=!1);const o=function(e,t,n,i){if(1!==e.getNumberOfComponents())throw new Error("Unsupported number of components for region iterator: "+e.getNumberOfComponents());void 0===n&&(n=!1);let r=null;r=n?function(t){return e.getRescaledValueAtOffset(t)}:function(t){return e.getValueAtOffset(t)};const o=e.getGeometry().getSize(),a=[];let s,l=null,c=null,u=null;for(let e=0;e<i.length;++e){s=i[e];const t=s[1][0]-s[0][0];0!==t&&(u=e,l||(l=s[0]),a.push([s[0][0],t,o.get(0)-s[1][0]]))}if(null!==u&&(c=i[u][1]),0!==a.length)return function(e,t,n,i,r){let o=t,a=0,s=0;return{next:function(){if(o<n){const t={value:e(o),done:!1,index:o};return s+=1,o+=1,s===r[a][1]&&(s=0,o+=r[a][2],a+=1,a<r.length&&(o+=r[a][0])),t}return{done:!0,index:n}}}}(r,o.indexToOffset(t.getWithNew2D(l[0],l[1])),o.indexToOffset(t.getWithNew2D(c[0],c[1]))+1,0,a)}(t,i,r,e);let a=[];return o&&(a=Ke(o)),a}canQuantifyImage(){return this.#x.getImage().canQuantify()}canWindowLevel(){return this.isMonochrome()}isMonochrome(){return this.#x.getImage().isMonochrome()}canScroll(){return this.#x.getImage().canScroll(this.#x.getOrientation())}getImageSize(){return this.#x.getImage().getGeometry().getSize(this.#x.getOrientation())}moreThanOne(e){return this.getImageSize().moreThanOne(e)}getImageWorldSize(){const e=this.#x.getImage().getGeometry(),t=e.getSize(this.#x.getOrientation()).get2D(),n=e.getSpacing(this.#x.getOrientation()).get2D();return{x:t.x*n.x,y:t.y*n.y}}getImageRescaledDataRange(){return this.#x.getImage().getRescaledDataRange()}equalImageMeta(e){const t=this.#x.getImage().getMeta(),n=Object.keys(e);for(let i=0;i<n.length;++i){const r=n[i];if(void 0===t[r])return!1;if(t[r]!==e[r])return!1}return!0}isPositionInBounds(e){return this.#x.isPositionInBounds(e)}setCurrentPosition(e,t){return this.#x.setCurrentPosition(e,t)}getPositionFromPlanePoint(e){const t=this.getCurrentScrollIndexValue(),n=new E(e.getX(),e.getY(),t),i=this.#We.getImageOrientedPoint3D(n),r=this.#x.getImage().getGeometry().pointToWorld(i);return this.getCurrentPosition().mergeWith3D(r)}getPlanePositionFromPosition(e){const t=this.#x.getImage().getGeometry().worldToPoint(e),n=this.#We.getImageDeOrientedPoint3D(t);return new F(n.getX(),n.getY())}setCurrentIndex(e,t){return this.#x.setCurrentIndex(e,t)}getPlanePositionFromPlanePoint(e){const t=this.getCurrentScrollIndexValue(),n=new E(e.getX(),e.getY(),t),i=this.#We.getTargetDeOrientedPoint3D(n),r=this.#x.getImage().getGeometry().getRealSpacing();return new E(i.getX()*r.get(0),i.getY()*r.get(1),i.getZ()*r.get(2))}getOffset3DFromPlaneOffset(e){return this.#We.getOffset3DFromPlaneOffset(e)}#Ze(e){const t=this.getCurrentIndex(),n=new Array(t.length());n.fill(0),e<n.length?n[e]=1:console.warn("Cannot increment given index: ",e,n.length);const i=new s(n);return t.add(i)}#_e(e){const t=this.getCurrentIndex(),n=new Array(t.length());n.fill(0),e<n.length?n[e]=-1:console.warn("Cannot decrement given index: ",e,n.length);const i=new s(n);return t.add(i)}#Ke(){return this.#Ze(this.getScrollIndex())}#Je(){return this.#_e(this.getScrollIndex())}getIncrementPosition(e){return this.#x.getImage().getGeometry().indexToWorld(this.#Ze(e))}getDecrementPosition(e){return this.#x.getImage().getGeometry().indexToWorld(this.#_e(e))}getIncrementScrollPosition(){return this.#x.getImage().getGeometry().indexToWorld(this.#Ke())}getDecrementScrollPosition(){return this.#x.getImage().getGeometry().indexToWorld(this.#Je())}incrementIndex(e,t){return this.setCurrentIndex(this.#Ze(e),t)}decrementIndex(e,t){return this.setCurrentIndex(this.#_e(e),t)}decrementScrollIndex(e){return this.setCurrentIndex(this.#Je(),e)}incrementScrollIndex(e){return this.setCurrentIndex(this.#Ke(),e)}play(){if(this.canScroll())if(void 0===this.#Xe){const e=this.#x.getImage(),t=e.getMeta().RecommendedDisplayFrameRate,n=this.#x.getPlaybackMilliseconds(t),i=e.getGeometry().getSize().canScroll3D();this.#Xe=window.setInterval((()=>{let e=!1;if(e=i?this.incrementScrollIndex():this.incrementIndex(3),!e){const e=this.getCurrentIndex().getValues(),t=this.#x.getOrientation();i?e[t.getThirdColMajorDirection()]=0:e[3]=0;const n=new s(e),r=this.#x.getImage().getGeometry();this.setCurrentPosition(r.indexToWorld(n))}}),n)}else this.stop()}stop(){void 0!==this.#Xe&&(clearInterval(this.#Xe),this.#Xe=void 0)}getWindowLevel(){return this.#x.getWindowLevel()}getCurrentWindowPresetName(){return this.#x.getCurrentWindowPresetName()}setWindowLevel(e){this.#x.setWindowLevel(e)}getColourMap(){return this.#x.getColourMap()}setColourMap(e){this.#x.setColourMap(e)}setViewAlphaFunction(e){this.#x.setAlphaFunction(e)}bindImageAndLayer(e){const t=this.#x.getImage();t.addEventListener("imagecontentchange",e.onimagecontentchange),t.addEventListener("imagegeometrychange",e.onimagegeometrychange)}unbindImageAndLayer(e){const t=this.#x.getImage();t.removeEventListener("imagecontentchange",e.onimagecontentchange),t.removeEventListener("imagegeometrychange",e.onimagegeometrychange)}}const On={t(e){const t=e.split(".");if(2!==t.length)throw new Error("Unexpected translation key length.");if("unit"!==t[0])throw new Error("Unexpected translation key prefix.");return{mm:"mm",cm2:"cm²",degree:"°"}[t[1]]}};class An{#$e;#et;constructor(e,t){this.#$e=e,this.#et=t}getCenter(){return this.#$e}getRadius(){return this.#et}equals(e){return null!==e&&this.getCenter().equals(e.getCenter())&&this.getRadius()===e.getRadius()}getSurface(){return Math.PI*this.getRadius()*this.getRadius()}getWorldSurface(e){return function(e,t,n){let i=null;return null!==t&&null!==n&&(i=e*t*n),i}(this.getSurface(),e.x,e.y)}getRound(){const e=this.getCenter().getX(),t=this.getCenter().getY(),n=this.getRadius(),i=Math.pow(n,2),r=t+n,o=[];for(let a=t-n;a<r;++a){const n=i-Math.pow(a-t,2);if(Math.abs(n)<1e-7)continue;const r=Math.sqrt(n);r<.5||o.push([[Math.round(e-r),Math.round(a)],[Math.round(e+r),Math.round(a)]])}return o}quantify(e,t){const n={},i=e.get2DSpacing();n.radius={value:this.getRadius()*i.x,unit:On.t("unit.mm")};const r=this.getWorldSurface(i);if(null!==r&&(n.surface={value:r/100,unit:On.t("unit.cm2")}),e.canQuantifyImage()){const i=this.getRound();if(0!==i.length){const r=e.getImageVariableRegionValues(i),o=e.getPixelUnit(),a=it(r,t);n.min={value:a.min,unit:o},n.max={value:a.max,unit:o},n.mean={value:a.mean,unit:o},n.stdDev={value:a.stdDev,unit:o},void 0!==a.median&&(n.median={value:a.median,unit:o}),void 0!==a.p25&&(n.p25={value:a.p25,unit:o}),void 0!==a.p75&&(n.p75={value:a.p75,unit:o})}}return n}}const bn={labelText:{arrow:{"*":""},circle:{"*":"{surface}"},ellipse:{"*":"{surface}"},freeHand:{"*":""},protractor:{"*":"{angle}"},rectangle:{"*":"{surface}"},roi:{"*":""},ruler:{"*":"{length}"}}};class xn{#tt=10;#nt="Verdana";#it="#fff";#rt="#ffff80";#ot={x:1,y:1};#at={x:1,y:1};#st=2;#lt={x:.25,y:.25};#ct=.2;#ut=3;getFontFamily(){return this.#nt}getFontSize(){return this.#tt}getStrokeWidth(){return this.#st}getTextColour(){return this.#it}getLineColour(){return this.#rt}setLineColour(e){this.#rt=e}setBaseScale(e){this.#ot=e}setZoomScale(e){this.#at=e}getBaseScale(){return this.#ot}getZoomScale(){return this.#at}scale(e){return e/this.#ot.x}applyZoomScale(e){return{x:2*e/this.#at.x,y:2*e/this.#at.y}}getShadowOffset(){return this.#lt}getTagOpacity(){return this.#ct}getTextPadding(){return this.#ut}getFontStr(){return"normal "+this.getFontSize()+"px sans-serif"}getLineHeight(){return this.getFontSize()+this.getFontSize()/5}getScaledFontSize(){return this.scale(this.getFontSize())}getScaledStrokeWidth(){return this.scale(this.getStrokeWidth())}getShadowLineColour(){return e=this.getLineColour(),n=e,.001172549*(t={r:parseInt(n.substring(1,3),16),g:parseInt(n.substring(3,5),16),b:parseInt(n.substring(5,7),16)}).r+.002301961*t.g+447059e-9*t.b<.5?"#fff":"#000";var e,t,n}}var Rn=o(944),Fn=o.n(Rn);function En(e){return"label"===e.name()}function qn(e){return"shape"===e.name()}function Un(e){return"position-group"===e.name()}function Mn(e){return function(t){return t.id()===e}}function Qn(e,t,n,i){const r=i.applyZoomScale(3),o={x:Math.abs(r.x),y:Math.abs(r.y)};return new(Fn().Ellipse)({x:e,y:t,stroke:"#999",fill:"rgba(100,100,100,0.7",strokeWidth:i.getStrokeWidth(),strokeScaleEnabled:!1,radius:o,radiusX:o.x,radiusY:o.y,name:"anchor",id:n.toString(),dragOnTop:!1,draggable:!0,visible:!1})}function Vn(e,t,n){let i=!1;return e.x()<t.getX()?(e.x(t.getX()),i=!0):e.x()>n.getX()&&(e.x(n.getX()),i=!0),e.y()<t.getY()?(e.y(t.getY()),i=!0):e.y()>n.getY()&&(e.y(n.getY()),i=!0),i}class Nn{getGroupName(){return"circle-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}#dt(e){const t=Math.abs(e[0].getX()-e[1].getX()),n=Math.abs(e[0].getY()-e[1].getY()),i=Math.round(Math.sqrt(t*t+n*n));return new An(e[0],i)}setAnnotationMathShape(e,t){e.mathShape=this.#dt(t),e.setTextExpr(this.#ht()),e.updateQuantification()}updateAnnotationOnTranslation(e,t){const n=e.mathShape,i=n.getCenter(),r=new F(i.getX()+t.x,i.getY()+t.y);e.mathShape=new An(r,n.getRadius()),e.updateQuantification()}updateAnnotationOnAnchorMove(e,t){const n=e.mathShape.getCenter(),i=new F(t.x(),t.y()),r=n.getDistance(i);e.mathShape=new An(n,r),e.updateQuantification()}#ht(){return bn.labelText.circle}#St(e,t){const n=e.mathShape;return new(Fn().Circle)({x:n.getCenter().getX(),y:n.getCenter().getY(),radius:n.getRadius(),stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"})}#gt(e){const t=e.mathShape,n=t.getCenter(),i=t.getRadius();return new F(n.getX()-i,n.getY()+i)}#mt(e,t){const n=new(Fn().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"}),i=e.getText();n.setText(i);const r=this.#gt(e),o=new(Fn().Label)({x:r.getX(),y:r.getY(),scale:t.applyZoomScale(1),visible:0!==i.length,name:"label"});return o.add(n),o.add(new(Fn().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()})),o}createShapeGroup(e,t){const n=new(Fn().Group);return n.name(this.getGroupName()),n.visible(!0),n.id(e.id),n.add(this.#St(e,t)),n.add(this.#mt(e,t)),n}getAnchors(e,t){const n=e.x(),i=e.y(),r=e.radius(),o=[];return o.push(Qn(n-r,i,"left",t)),o.push(Qn(n+r,i,"right",t)),o.push(Qn(n,i+r,"bottom",t)),o.push(Qn(n,i-r,"top",t)),o}constrainAnchorMove(e){const t=e.getParent();if(!(t instanceof Fn().Group))return;const n=t.getChildren((function(e){return"left"===e.id()}))[0],i=t.getChildren((function(e){return"right"===e.id()}))[0],r=t.getChildren((function(e){return"bottom"===e.id()}))[0],o=t.getChildren((function(e){return"top"===e.id()}))[0];switch(e.id()){case"left":n.y(i.y());break;case"right":i.y(n.y());break;case"bottom":r.x(o.x());break;case"top":o.x(r.x());break;default:c.error("Unhandled anchor id: "+e.id())}}updateShapeGroupOnAnchorMove(e,t,n){const i=t.getParent();i instanceof Fn().Group&&(this.#pt(e,t,n),this.updateLabelContent(e,i,n),this.updateLabelPosition(e,i,n))}#pt(e,t,n){const i=e.mathShape,r=i.getCenter(),o=i.getRadius(),a=t.getParent();if(!(a instanceof Fn().Group))return;const s=a.getChildren((function(e){return"shape"===e.name()}))[0];if(!(s instanceof Fn().Circle))return;s.radius(o);const l=a.getChildren((function(e){return"left"===e.id()}))[0],u=a.getChildren((function(e){return"right"===e.id()}))[0],d=a.getChildren((function(e){return"bottom"===e.id()}))[0],h=a.getChildren((function(e){return"top"===e.id()}))[0],S=u.x()<l.x()?-1:1,g=h.y()<d.y()?1:-1;switch(t.id()){case"left":l.x(t.x()),u.x(r.getX()+S*o),d.y(r.getY()+o),h.y(r.getY()-o);break;case"right":u.x(t.x()),l.x(r.getX()-S*o),d.y(r.getY()+o),h.y(r.getY()-o);break;case"bottom":d.y(t.y()),l.x(r.getX()-o),u.x(r.getX()+o),h.y(r.getY()-g*o);break;case"top":h.y(t.y()),l.x(r.getX()-o),u.x(r.getX()+o),d.y(r.getY()+g*o);break;default:c.error("Unhandled anchor id: "+t.id())}}updateLabelPosition(e,t,n){const i=t.getChildren((function(e){return"label"===e.name()}))[0];if(!(i instanceof Fn().Label))return;const r=this.#gt(e);i.position({x:r.getX(),y:r.getY()})}updateLabelContent(e,t,n){const i=t.getChildren((function(e){return"label"===e.name()}))[0];i instanceof Fn().Label&&i.getText().setText(e.getText())}#ft(e,t){const n=e.mathShape;let i=0,r=0;void 0!==t&&(i=t.x(),r=t.y());const o=new(Fn().Group);o.name("shadow");const a=n.getRound();for(let e=0;e<a.length;++e){const t=a[e],n=t[0][0],s=t[0][1],l=t[1][0],c=new(Fn().Rect)({x:n-i,y:s-r,width:l-n,height:1,fill:"grey",strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow-element"});o.add(c)}return o}#Dt(e,t){const n=e.getChildren((function(e){return"shadow"===e.name()}))[0];void 0!==n&&(n.destroy(),e.add(this.#ft(t.mathShape,e)))}}class Bn{id;referenceSopUID;position;mathShape;colour;quantification;textExpr;#yt;constructor(e){this.#yt=e,this.referenceSopUID=e.getCurrentImageUid()}getOriginIndex(){return this.#yt.getOriginIndexForImageUid(this.referenceSopUID)}setTextExpr(e){const t=this.#yt.getModality();void 0!==e[t]?this.textExpr=e[t]:this.textExpr=e["*"]}getText(){return V(this.textExpr,this.quantification)}updateQuantification(){this.quantification=this.mathShape.quantify(this.#yt,Q(this.textExpr))}getFactory(){let e;return this.mathShape instanceof An&&(e=new Nn),e}}class Gn{#Ct;#Te={};#Oe=new Ze;constructor(e){this.#Ct=void 0!==e?e:[]}getList(){return this.#Ct}getLength(){return this.#Ct.length}add(e){this.#Ct.push(e),this.#Re({type:"addannotation",data:e})}update(e){const t=this.#Ct.findIndex((t=>t.id===e.id));-1!==t?(this.#Ct[t]=e,this.#Re({type:"updateannotation",data:e})):console.log("Cannot find annotation to update")}remove(e){const t=this.#Ct.findIndex((t=>t.id===e));if(-1!==t){const e=this.#Ct.splice(t,1)[0];this.#Re({type:"removeannotation",data:e})}else console.log("Cannot find annotation to remove")}find(e){return this.#Ct.find((t=>t.id===e))}hasMeta(e){return void 0!==this.#Te[e]}getMeta(e){return this.#Te[e]}setMeta(e,t){this.#Te[e]=t}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}}const kn=["mousedown","mousemove","mouseup","mouseout","wheel","dblclick","touchstart","touchmove","touchend"],Hn={openRoiDialog(e,t){const n=prompt("Label",e.textExpr);null!==n&&(e.textExpr=n,t(e))}};function zn(e){let t=0,n=0;if(0!==e.length&&void 0!==e[0].target){let i=e[0].target.offsetParent;for(;i;)isNaN(i.offsetLeft)||(t+=i.offsetLeft),isNaN(i.offsetTop)||(n+=i.offsetTop),i=i.offsetParent}else c.debug("No touch target offset parent.");const i=[];for(let r=0;r<e.length;++r)i.push(new F(e[r].pageX-t,e[r].pageY-n));return i}function Wn(e){let t=[];return void 0!==e.targetTouches&&0!==e.targetTouches.length?t=zn(e.targetTouches):void 0!==e.changedTouches&&0!==e.changedTouches.length&&(t=zn(e.changedTouches)),t}function Xn(e){return new F(e.offsetX,e.offsetY)}function Yn(e,t){const n=document.createElement("canvas");n.width=e,n.height=t;const i=document.createElement("canvas");i.width=1,i.height=1;const r=n.getContext("2d"),o=i.getContext("2d");return r&&(r.fillRect(e-1,t-1,1,1),o.drawImage(n,e-1,t-1,1,1,0,0,1,1)),o&&0!==o.getImageData(0,0,1,1).data[3]}class jn{#vt;#yt=null;#It=null;#Tt=null;#Lt=null;#Pt=!0;#wt=null;#Ot;#At;#bt=1;#xt={x:1,y:1};#Rt={x:1,y:1};#Ft={x:1,y:1,z:1};#Et={x:0,y:0};#qt={x:0,y:0};#Ut={x:0,y:0};#Mt={x:0,y:0};#Qt={x:0,y:0};#Vt=null;#Nt;#Oe=new Ze;#Bt=!1;#Gt;#kt;constructor(e){this.#vt=e,this.#vt.className+=" viewLayer"}getDataId(){return this.#Nt}getScale(){return this.#xt}getAbsoluteZoomOffset(){return{x:this.#Mt.x*this.#Rt.x,y:this.#Mt.y*this.#Rt.y}}setImageSmoothing(e){this.#Bt=e}setView(e,t){this.#Nt=t,e.addEventListener("wlchange",this.#Ht),e.addEventListener("colourmapchange",this.#zt),e.addEventListener("positionchange",this.#Wt),e.addEventListener("alphafuncchange",this.#Xt);for(let t=0;t<In.length;++t)e.addEventListener(In[t],this.#Re);this.#yt=new wn(e),this.bindImage()}getViewController(){return this.#yt}getImageData(){return this.#wt}onimageset=e=>{this.#Nt===e.dataid&&(this.#yt.setImage(e.value[0]),this.#Yt(this.#yt.getImageSize().get2D()),this.#Vt=!0)};bindImage(){this.#yt&&this.#yt.bindImageAndLayer(this)}unbindImage(){this.#yt&&this.#yt.unbindImageAndLayer(this)}onimagecontentchange=e=>{this.#Nt===e.dataid&&(this.#Pt=this.#yt.isPositionInBounds(),this.#Vt=!0,this.draw())};onimagegeometrychange=e=>{if(this.#Nt===e.dataid){const e=this.#yt.getImageSize().get2D();if(this.#Ot.x!==e.x||this.#Ot.y!==e.y){if(void 0!==this.#Gt&&void 0!==this.#kt){const e=this.#yt.getOrigin(),t=this.#kt.minus(e),n=this.#yt.getOrigin(this.#yt.getCurrentPosition()),i=this.#Gt.minus(n);this.setBaseOffset(t,i)}this.#Yt(e),this.#Vt=!0,this.draw()}}};getId(){return this.#vt.id}removeFromDOM(){this.#vt.remove()}getBaseSize(){return this.#Ot}getImageWorldSize(){return this.#yt.getImageWorldSize()}getOpacity(){return this.#bt}setOpacity(e){if(e===this.#bt)return;this.#bt=Math.min(Math.max(e,0),1);const t={type:"opacitychange",value:[this.#bt]};this.#Re(t)}addFlipOffsetX(){this.#Qt.x+=this.#It.width/this.#xt.x,this.#Et.x+=this.#Qt.x}addFlipOffsetY(){this.#Qt.y+=this.#It.height/this.#xt.y,this.#Et.y+=this.#Qt.y}flipScaleX(){this.#Ft.x*=-1}flipScaleY(){this.#Ft.y*=-1}flipScaleZ(){this.#Ft.z*=-1}setScale(e,t){const n=this.#yt.getPlaneHelper(),i=n.getTargetOrientedPositiveXYZ({x:e.x*this.#Ft.x,y:e.y*this.#Ft.y,z:e.z*this.#Ft.z}),r={x:this.#Rt.x*i.x,y:this.#Rt.y*i.y};if(1===Math.abs(e.x)&&1===Math.abs(e.y)&&1===Math.abs(e.z)){const e={x:this.#Et.x-this.#Mt.x,y:this.#Et.y-this.#Mt.y};this.#Mt={x:0,y:0},this.#Et=e}else if(void 0!==t){let e=n.getPlaneOffsetFromOffset3D({x:t.getX(),y:t.getY(),z:t.getZ()});e={x:e.x+this.#qt.x,y:e.y+this.#qt.y};const i=oi(this.#Et,this.#xt,r,e),o={x:this.#Mt.x+i.x-this.#Et.x,y:this.#Mt.y+i.y-this.#Et.y};this.#Mt=o,this.#Et=i}this.#xt=r}initScale(e,t){const n=this.#yt.getPlaneHelper().getTargetOrientedPositiveXYZ({x:e.x*this.#Ft.x,y:e.y*this.#Ft.y,z:e.z*this.#Ft.z}),i={x:this.#Rt.x*n.x,y:this.#Rt.y*n.y};this.#xt=i,this.#Mt={x:t.x/this.#Rt.x,y:t.y/this.#Rt.y},this.#Et={x:this.#Et.x+this.#Mt.x,y:this.#Et.y+this.#Mt.y}}setBaseOffset(e,t,n,i){const r=this.#yt.getPlaneHelper(),o=r.getNativeScrollIndex(),a=r.getPlaneOffsetFromOffset3D({x:0===o?e.getX():t.getX(),y:1===o?e.getY():t.getY(),z:2===o?e.getZ():t.getZ()}),s=this.#qt.x!==a.x||this.#qt.y!==a.y;return void 0!==n&&void 0!==i&&(this.#Gt=n,this.#kt=i),s&&(this.#Et={x:this.#Et.x-this.#qt.x+a.x,y:this.#Et.y-this.#qt.y+a.y},this.#qt=a),s}setOffset(e){const t=this.#yt.getPlaneHelper().getPlaneOffsetFromOffset3D(e);this.#Et={x:t.x+this.#Ut.x+this.#qt.x+this.#Mt.x+this.#Qt.x,y:t.y+this.#Ut.y+this.#qt.y+this.#Mt.y+this.#Qt.y}}displayToPlaneIndex(e){const t=this.displayToPlanePos(e);return new s([Math.floor(t.getX()),Math.floor(t.getY())])}displayToPlaneScale(e){return new F(e.getX()/this.#xt.x,e.getY()/this.#xt.y)}displayToPlanePos(e){const t=this.displayToPlaneScale(e);return new F(t.getX()+this.#Et.x,t.getY()+this.#Et.y)}planePosToDisplay(e){let t=(e.getX()-this.#Et.x+this.#qt.x)*this.#xt.x,n=(e.getY()-this.#Et.y+this.#qt.y)*this.#xt.y;return(t<0||t>=this.#It.width)&&(t=void 0),(n<0||n>=this.#It.height)&&(n=void 0),new F(t,n)}displayToMainPlanePos(e){const t=this.displayToPlanePos(e);return new F(t.getX()-this.#qt.x,t.getY()-this.#qt.y)}display(e){this.#vt.style.display=e?"":"none"}isVisible(){return""===this.#vt.style.display}draw(){if(!this.#Pt)return;let e={type:"renderstart",layerid:this.getId(),dataid:this.getDataId()};this.#Re(e),this.#Vt&&this.#jt(),this.#Lt.globalAlpha=this.#bt,this.clear(),this.#Lt.setTransform(this.#xt.x,0,0,this.#xt.y,-1*this.#Et.x*this.#xt.x,-1*this.#Et.y*this.#xt.y),this.#Lt.imageSmoothingEnabled=this.#Bt,this.#Lt.drawImage(this.#Tt,0,0),e={type:"renderend",layerid:this.getId(),dataid:this.getDataId()},this.#Re(e)}initialise(e,t,n){this.#At=t,this.#bt=Math.min(Math.max(n,0),1),this.#It=document.createElement("canvas"),this.#vt.appendChild(this.#It),this.#It.getContext?(this.#Lt=this.#It.getContext("2d"),this.#Lt?(this.#Tt=document.createElement("canvas"),this.#Yt(e),this.#Vt=!0):alert("Error: failed to get the 2D context.")):alert("Error: no canvas.getContext method.")}#Yt(e){if(!Yn(e.x,e.y))throw new Error("Cannot create canvas with size "+e.x+", "+e.y);this.#Ot=e,this.#Tt.width=this.#Ot.x,this.#Tt.height=this.#Ot.y,this.#Lt.clearRect(0,0,this.#Ot.x,this.#Ot.y),this.#wt=this.#Lt.createImageData(this.#Ot.x,this.#Ot.y)}fitToContainer(e,t,n){let i=!1;if(this.#It.width!==e.x||this.#It.height!==e.y){if(!Yn(e.x,e.y))throw new Error("Cannot resize canvas "+e.x+", "+e.y);this.#It.width=e.x,this.#It.height=e.y,i=!0}const r={x:t*this.#At.x,y:t*this.#At.y},o={x:this.#xt.x*r.x/this.#Rt.x,y:this.#xt.y*r.y/this.#Rt.y};this.#xt.x===o.x&&this.#xt.y===o.y||(this.#Rt=r,this.#xt=o,i=!0);const a={x:n.x/r.x,y:n.y/r.y},s={x:e.x/r.x,y:e.y/r.y},l={x:0!==this.#Qt.x?s.x:0,y:0!==this.#Qt.y?s.y:0};this.#Ut.x===a.x&&this.#Ut.y===a.y&&this.#Qt.x===l.x&&this.#Qt.y===l.y||(this.#Et={x:this.#Et.x+a.x-this.#Ut.x+l.x-this.#Qt.x,y:this.#Et.y+a.y-this.#Ut.y+l.y-this.#Qt.y},this.#Qt=l,this.#Ut=a,i=!0),i&&this.draw()}bindInteraction(){this.#vt.style.pointerEvents="auto";const e=kn;for(let t=0;t<e.length;++t){const n=e[t],i="wheel"!==n;this.#vt.addEventListener(n,this.#Re,{passive:i})}}unbindInteraction(){this.#vt.style.pointerEvents="none";const e=kn;for(let t=0;t<e.length;++t)this.#vt.removeEventListener(e[t],this.#Re)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{e.srclayerid=this.getId(),e.dataid=this.#Nt,this.#Oe.fireEvent(e)};#jt(){this.#yt.generateImageData(this.#wt),this.#Tt.getContext("2d").putImageData(this.#wt,0,0),this.#Vt=!1}#Ht=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#Vt=!0,this.draw())};#zt=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#Vt=!0,this.draw())};#Wt=e=>{if(void 0===e.skipGenerate||!0!==e.skipGenerate){let t=!0;if(void 0!==e.valid&&(t=e.valid),t){const t=[0,1,2],n=t.indexOf(this.#yt.getScrollIndex());t.splice(n,1),0===e.diffDims.filter((function(e){return-1===t.indexOf(e)})).length&&this.#Pt||(this.#Pt=!0,this.#Vt=!0,this.draw())}else this.#Pt&&(this.#Pt=!1,this.clear())}};#Xt=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#Vt=!0,this.draw())};setCurrentPosition(e,t){return this.#yt.setCurrentPosition(e)}clear(){this.#Lt.save(),this.#Lt.setTransform(1,0,0,1,0,0),this.#Lt.clearRect(0,0,this.#It.width,this.#It.height),this.#Lt.restore()}}class Zn{#Zt;getAnnotation(e){return this.#Zt.find(e)}getAnnotationList(){return this.#Zt}addAnnotation(e){this.#Zt.add(e)}updateAnnotation(e){this.#Zt.update(e)}removeAnnotation(e){this.#Zt.remove(e)}constructor(e){this.#Zt=void 0!==e?e:new Gn}hasAnnotationMeta(e){return this.#Zt.hasMeta(e)}setAnnotationMeta(e,t){this.#Zt.setMeta(e,t)}getDrawStoreDetails(){}}function _n(e){let t="shape";return e instanceof Fn().Line?t=4===e.points().length?"line":6===e.points().length?"protractor":"roi":e instanceof Fn().Rect?t="rectangle":e instanceof Fn().Ellipse&&(t="ellipse"),t}class Kn{#T;#_t;#Kt;#Jt;#$t;constructor(e,t,n,i){this.#T=e,this.#_t=t,this.#Kt=n,this.#Jt=void 0!==i&&i,this.#$t=e.getParent()}getName(){return"Draw-"+this.#_t}execute(){this.#$t.add(this.#T),this.#Kt.getKonvaLayer().draw(),this.#Jt||this.onExecute({type:"drawcreate",id:this.#T.id(),srclayerid:this.#Kt.getId(),dataid:this.#Kt.getDataId()})}undo(){this.#T.remove(),this.#Kt.getKonvaLayer().draw(),this.onUndo({type:"drawdelete",id:this.#T.id(),srclayerid:this.#Kt.getId(),dataid:this.#Kt.getDataId()})}onExecute(e){}onUndo(e){}}class Jn{#en;#_t;#tn;#Kt;#nn;constructor(e,t,n,i){this.#en=e,e instanceof Fn().Shape&&(this.#_t=_n(e)),e instanceof Fn().Label&&(this.#_t="Label"),this.#tn=t,this.#Kt=n,this.#nn=i}getName(){return"Move-"+this.#_t}execute(){if(this.#en instanceof Fn().Shape){const e=this.#en.getParent().getChildren();for(const t of e)(this.#nn||"label"!==t.name())&&t.move(this.#tn)}this.#en instanceof Fn().Label&&this.#en.move(this.#tn),this.#Kt.getKonvaLayer().draw(),this.onExecute({type:"drawmove",id:this.#en.id(),srclayerid:this.#Kt.getId(),dataid:this.#Kt.getDataId()})}undo(){const e={x:-this.#tn.x,y:-this.#tn.y};if(this.#en instanceof Fn().Shape){const t=this.#en.getParent().getChildren();for(const n of t)(this.#nn||"label"!==n.name())&&n.move(e)}this.#en instanceof Fn().Label&&this.#en.move(e),this.#Kt.getKonvaLayer().draw(),this.onUndo({type:"drawmove",id:this.#en.id(),srclayerid:this.#Kt.getId(),dataid:this.#Kt.getDataId()})}onExecute(e){}onUndo(e){}}class $n{#_t;#in;#rn;#on;#Kt;#an;#sn;constructor(e,t,n,i,r,o,a){this.#_t=e,this.#in=t,this.#rn=n,this.#on=i,this.#an=r,this.#Kt=o,this.#sn=a}getName(){return"Change-"+this.#_t}execute(){this.#in.updateAnnotationOnAnchorMove(this.#an,this.#on),this.#in.updateShapeGroupOnAnchorMove(this.#an,this.#on,this.#sn),this.#Kt.getKonvaLayer().draw(),this.onExecute({type:"drawchange",id:this.#on.getParent().id(),srclayerid:this.#Kt.getId(),dataid:this.#Kt.getDataId()})}undo(){this.#in.updateAnnotationOnAnchorMove(this.#an,this.#rn),this.#in.updateShapeGroupOnAnchorMove(this.#an,this.#rn,this.#sn),this.#Kt.getKonvaLayer().draw(),this.onUndo({type:"drawchange",id:this.#rn.getParent().id(),srclayerid:this.#Kt.getId(),dataid:this.#Kt.getDataId()})}onExecute(e){}onUndo(e){}}class ei{#T;#_t;#Kt;#$t;constructor(e,t,n){this.#T=e,this.#_t=t,this.#Kt=n,this.#$t=e.getParent()}getName(){return"Delete-"+this.#_t}execute(){this.#T.remove(),this.#Kt.getKonvaLayer().draw(),this.onExecute({type:"drawdelete",id:this.#T.id(),srclayerid:this.#Kt.getId(),dataid:this.#Kt.getDataId()})}undo(){this.#$t.add(this.#T),this.#Kt.getKonvaLayer().draw(),this.onUndo({type:"drawcreate",id:this.#T.id(),srclayerid:this.#Kt.getId(),dataid:this.#Kt.getDataId()})}onExecute(e){}onUndo(e){}}class ti{#vt;#ln=null;#Ot;#At;#Rt={x:1,y:1};#Ft={x:1,y:1,z:1};#qt={x:0,y:0};#Ut={x:0,y:0};#Mt={x:0,y:0};#Qt={x:0,y:0};#cn;#We;#Nt;#un=null;constructor(e){this.#vt=e,this.#vt.className+=" drawLayer"}getDataId(){return this.#Nt}#Oe=new Ze;getKonvaStage(){return this.#ln}getKonvaLayer(){return this.#ln.getLayers()[0]}getDrawController(){return this.#cn}setPlaneHelper(e){this.#We=e}getId(){return this.#vt.id}removeFromDOM(){this.#vt.remove()}getBaseSize(){return this.#Ot}getOpacity(){return this.#ln.opacity()}setOpacity(e){this.#ln.opacity(Math.min(Math.max(e,0),1))}addFlipOffsetX(){const e=this.#ln.scale(),t=this.#ln.size();this.#Qt.x+=t.width/e.x;const n=this.#ln.offset();n.x+=this.#Qt.x,this.#ln.offset(n)}addFlipOffsetY(){const e=this.#ln.scale(),t=this.#ln.size();this.#Qt.y+=t.height/e.y;const n=this.#ln.offset();n.y+=this.#Qt.y,this.#ln.offset(n)}flipScaleX(){this.#Ft.x*=-1}flipScaleY(){this.#Ft.y*=-1}flipScaleZ(){this.#Ft.z*=-1}setScale(e,t){const n=this.#We.getTargetOrientedPositiveXYZ({x:e.x*this.#Ft.x,y:e.y*this.#Ft.y,z:e.z*this.#Ft.z}),i={x:this.#Rt.x*n.x,y:this.#Rt.y*n.y},r=this.#ln.offset();if(1===Math.abs(e.x)&&1===Math.abs(e.y)&&1===Math.abs(e.z)){const e={x:r.x-this.#Mt.x,y:r.y-this.#Mt.y};this.#Mt={x:0,y:0},this.#ln.offset(e)}else if(void 0!==t){let e=this.#We.getPlaneOffsetFromOffset3D({x:t.getX(),y:t.getY(),z:t.getZ()});e={x:e.x+this.#qt.x,y:e.y+this.#qt.y};const n=oi(r,this.#ln.scale(),i,e),o={x:this.#Mt.x+n.x-r.x,y:this.#Mt.y+n.y-r.y};this.#Mt=o,this.#ln.offset(n)}this.#ln.scale(i),this.#dn(i)}setOffset(e){const t=this.#We.getPlaneOffsetFromOffset3D(e);this.#ln.offset({x:t.x+this.#Ut.x+this.#qt.x+this.#Mt.x+this.#Qt.x,y:t.y+this.#Ut.y+this.#qt.y+this.#Mt.y+this.#Qt.y})}setBaseOffset(e,t){const n=this.#We.getNativeScrollIndex(),i=this.#We.getPlaneOffsetFromOffset3D({x:0===n?e.getX():t.getX(),y:1===n?e.getY():t.getY(),z:2===n?e.getZ():t.getZ()}),r=this.#qt.x!==i.x||this.#qt.y!==i.y;if(r){const e=this.#ln.offset();this.#ln.offset({x:e.x-this.#qt.x+i.x,y:e.y-this.#qt.y+i.y}),this.#qt=i}return r}display(e){this.#vt.style.display=e?"":"none"}isVisible(){return""===this.#vt.style.display}draw(){this.#ln.draw()}initialise(e,t){this.#Ot=e,this.#At=t,this.#ln=new(Fn().Stage)({container:this.#vt,width:this.#Ot.x,height:this.#Ot.y,listening:!1}),this.#ln.getContent().setAttribute("style","");const n=new(Fn().Layer)({listening:!1,visible:!0});this.#ln.add(n)}setAnnotationList(e,t,n,i){this.#Nt=t,e.addEventListener("addannotation",(function(){})),e.addEventListener("removeannotation",(function(){})),this.#cn=new Zn(e),0!==e.getLength()&&this.#hn(e.getList(),n,i)}#hn(e,t,n){const i=this.getKonvaStage();for(const r of e){const e=r.getOriginIndex();if(void 0===e){console.log("Unknown reference origin for annotation: "+r.referenceSopUID);continue}const o=e.toStringId([2]);let a=this.getKonvaLayer().getChildren(Mn(o))[0];void 0===a&&(a=new(Fn().Group)({id:o,name:"position-group",visible:!1}),this.getKonvaLayer().add(a));const s=new xn;s.setZoomScale(i.scale());const l=r.getFactory().createShapeGroup(r,s);a.add(l);const c=l.getChildren(qn)[0],u=new Kn(l,c.className,this);u.onExecute=t,u.onUndo=t,u.execute(),n(u)}}fitToContainer(e,t,n){this.#ln.width(e.x),this.#ln.height(e.y);const i={x:t*this.#At.x,y:t*this.#At.y},r={x:this.#ln.scale().x*i.x/this.#Rt.x,y:this.#ln.scale().y*i.y/this.#Rt.y};this.#ln.scale().x===r.x&&this.#ln.scale().y===r.y||(this.#Rt=i,this.#ln.scale(r));const o={x:n.x/i.x,y:n.y/i.y},a={x:e.x/i.x,y:e.y/i.y},s={x:0!==this.#Qt.x?a.x:0,y:0!==this.#Qt.y?a.y:0};this.#Ut.x===o.x&&this.#Ut.y===o.y&&this.#Qt.x===s.x&&this.#Qt.y===s.y||(this.#ln.offset({x:this.#ln.offset().x+o.x-this.#Ut.x+s.x-this.#Qt.x,y:this.#ln.offset().y+o.y-this.#Ut.y+s.y-this.#Qt.y}),this.#Qt=s,this.#Ut=o)}isGroupVisible(e){const t=this.getGroup(e);return void 0!==t&&t.isVisible()}toggleGroupVisibility(e){const t=this.getGroup(e);return void 0!==t&&(t.visible(!t.isVisible()),this.draw(),!0)}#Sn(e,t,n){const i=e.getChildren(qn)[0];if(i instanceof Fn().Shape){const r=_n(i),o=new ei(e,r,this);o.onExecute=t,o.onUndo=t,o.execute(),void 0!==n&&n(o)}}deleteDraw(e,t){const n=this.getGroup(e);void 0!==n&&this.#Sn(n,this.#Re,t)}deleteDraws(e){const t=this.getKonvaLayer().getChildren();for(const n of t)if(n instanceof Fn().Group){const t=n.getChildren();for(;t.length;)t[0]instanceof Fn().Group&&this.#Sn(t[0],this.#Re,e)}else c.warn("Found non group in layer while deleting")}getNumberOfDraws(){const e=this.getKonvaLayer().getChildren();let t=0;for(const n of e)n instanceof Fn().Group&&(t+=n.getChildren().length);return t}bindInteraction(){this.#ln.listening(!0),this.#vt.style.pointerEvents="auto";const e=kn;for(let t=0;t<e.length;++t)this.#vt.addEventListener(e[t],this.#Re)}unbindInteraction(){this.#ln.listening(!1),this.#vt.style.pointerEvents="none";const e=kn;for(let t=0;t<e.length;++t)this.#vt.removeEventListener(e[t],this.#Re)}setCurrentPosition(e,t){return this.activateDrawLayer(t,this.#We.getScrollIndex()),!0}activateDrawLayer(e,t){const n=[t];for(let t=3;t<e.length();++t)n.push(t);this.#un=e.toStringId(n);const i=this.getKonvaLayer().getChildren(Un);let r;for(let e=0,t=i.length;e<t;++e)r=!1,i[e].id()===this.#un&&(r=!0),i[e].visible(r);this.getKonvaLayer().draw()}getCurrentPosGroup(){const e=this.getKonvaLayer().getChildren((e=>e.id()===this.#un));let t;return 1===e.length?e[0]instanceof Fn().Group&&(t=e[0]):0===e.length?(t=new(Fn().Group),t.name("position-group"),t.id(this.#un),t.visible(!0),this.getKonvaLayer().add(t)):c.warn("Unexpected number of draw position groups."),t}getNonCurrentPosGroup(){return this.getKonvaLayer().getChildren((e=>e.id()!==this.#un))}getGroup(e){const t=this.getKonvaLayer().findOne("#"+e);return void 0===t&&c.warn("Cannot find node with id: "+e),t}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{e.srclayerid=this.getId(),e.dataid=this.#Nt,this.#Oe.fireEvent(e)};#dn(e){const t=2/e.x,n=2/e.y,i=this.#ln.find("Label");for(let e=0;e<i.length;++e)i[e].scale({x:t,y:n})}}function ni(e){const t=e.split("-layer-");return 2!==t.length&&c.warn("Not the expected layer div id format..."),{groupDivId:t[0],layerId:t[1]}}function ii(e){let t=null;const n=e.target.closest(".layer");return n&&void 0!==n.id&&(t=ni(n.id)),t}function ri(e,t){let n=x();return void 0!==t&&(n=e.asOneAndZeros().getInverse().multiply(t)),n.getAbs()}function oi(e,t,n,i){const r=(i.x-e.x)*t.x,o=(i.y-e.y)*t.y;return{x:i.x-r/n.x,y:i.y-o/n.y}}class ai{#vt;#gn=[];#xt={x:1,y:1,z:1};#ot={x:1,y:1,z:1};#Et={x:0,y:0,z:0};#mn=void 0;#pn=void 0;#Oe=new Ze;#fn=!1;#Dn=[];#yn;#Ve;#Bt=!1;constructor(e){this.#vt=e}getShowCrosshair(){return this.#fn}setShowCrosshair(e){this.#fn=e,e?(this.addEventListener("offsetchange",this.#Cn),this.addEventListener("zoomchange",this.#Cn),this.#vn()):(this.removeEventListener("offsetchange",this.#Cn),this.removeEventListener("zoomchange",this.#Cn),this.#In())}setImageSmoothing(e){this.#Bt=e;for(const t of this.#gn)t instanceof jn&&t.setImageSmoothing(e)}#Cn=e=>{this.#vn()};getDivId(){return this.#vt.id}getScale(){return this.#xt}getBaseScale(){return this.#ot}getAddedScale(){return{x:this.#xt.x/this.#ot.x,y:this.#xt.y/this.#ot.y,z:this.#xt.z/this.#ot.z}}getOffset(){return this.#Et}getNumberOfLayers(){let e=0;return this.#gn.forEach((t=>{void 0!==t&&e++})),e}includes(e){if(void 0===e)return!1;for(const t of this.#gn)if(void 0!==t&&t.getId()===e)return!0;return!1}getNumberOfViewLayers(){let e=0;return this.#gn.forEach((t=>{void 0!==t&&t instanceof jn&&e++})),e}getActiveViewLayer(){let e;if(void 0!==this.#mn){const t=this.#gn[this.#mn];t instanceof jn&&(e=t)}else c.info("No active view layer to return");return e}getBaseViewLayer(){let e;return this.#gn[0]instanceof jn&&(e=this.#gn[0]),e}getViewLayersByDataId(e){const t=[];for(const n of this.#gn)n instanceof jn&&n.getDataId()===e&&t.push(n);return t}searchViewLayers(e){const t=[];for(const n of this.#gn)n instanceof jn&&n.getViewController().equalImageMeta(e)&&t.push(n);return t}getViewDataIndices(){const e=[];for(const t of this.#gn)t instanceof jn&&e.push(t.getDataId());return e}getActiveDrawLayer(){let e;if(void 0!==this.#pn){const t=this.#gn[this.#pn];t instanceof ti&&(e=t)}else c.info("No active draw layer to return");return e}getDrawLayersByDataId(e){const t=[];for(const n of this.#gn)n instanceof ti&&n.getDataId()===e&&t.push(n);return t}setActiveViewLayer(e){this.#gn[e]instanceof jn?(this.#mn=e,this.#Re({type:"activelayerchange",value:[this.#gn[e]]})):c.warn("No view layer to set as active with index: "+e)}setActiveViewLayerByDataId(e){let t;for(let n=0;n<this.#gn.length;++n)if(this.#gn[n]instanceof jn&&this.#gn[n].getDataId()===e){t=n;break}void 0!==t?this.setActiveViewLayer(t):c.warn("No view layer to set as active with dataId: "+e)}setActiveDrawLayer(e){this.#gn[e]instanceof ti?(this.#pn=e,this.#Re({type:"activelayerchange",value:[this.#gn[e]]})):c.warn("No draw layer to set as active with index: "+e)}setActiveDrawLayerByDataId(e){let t;for(let n=0;n<this.#gn.length;++n)if(this.#gn[n]instanceof ti&&this.#gn[n].getDataId()===e){t=n;break}void 0!==t?this.setActiveDrawLayer(t):c.warn("No draw layer to set as active with dataId: "+e)}addViewLayer(){const e=this.#gn.length,t=this.#Tn();this.#vt.append(t);const n=new jn(t);return n.setImageSmoothing(this.#Bt),this.#gn.push(n),this.setActiveViewLayer(e),this.#Ln(n),n}addDrawLayer(){this.#pn=this.#gn.length;const e=this.#Tn();this.#vt.append(e);const t=new ti(e);return this.#gn.push(t),this.#Pn(t),t}#Ln(e){e.addEventListener("positionchange",this.updateLayersToPositionChange);for(const t of In)e.addEventListener(t,this.#Re);e.addEventListener("renderstart",this.#Re),e.addEventListener("renderend",this.#Re)}#wn(e){e.removeEventListener("positionchange",this.updateLayersToPositionChange);for(const t of In)e.removeEventListener(t,this.#Re);e.removeEventListener("renderstart",this.#Re),e.removeEventListener("renderend",this.#Re),e.unbindImage()}#Pn(e){e.addEventListener("drawcreate",this.#Re),e.addEventListener("drawdelete",this.#Re)}#On(e){e.removeEventListener("drawcreate",this.#Re),e.removeEventListener("drawdelete",this.#Re)}#Tn(){const e=document.createElement("div");return e.id=this.getDivId()+"-layer-"+this.#gn.length,e.className="layer",e.style.pointerEvents="none",e}empty(){this.#gn=[],this.#mn=void 0,this.#pn=void 0,this.#In();const e=this.#vt.getElementsByClassName("layer");if(e)for(;e.length>0;)e[0].remove()}removeLayersByDataId(e){for(const t of this.#gn)void 0!==t&&t.getDataId()===e&&this.removeLayer(t)}removeLayer(e){const t=this.#gn.findIndex((t=>t===e));if(-1===t)throw new Error("Cannot find layer to remove");e instanceof jn?(this.#wn(e),this.#mn===t&&(this.#mn=void 0)):(this.#On(e),this.#pn===t&&(this.#pn=void 0)),this.#gn[t]=void 0,e.removeFromDOM()}#vn(e){let t;void 0===e&&(e=this.#Ve),this.#In();for(const e of this.#gn)if(e instanceof jn){t=e;break}if(void 0===t)return void c.warn("No layer to show crosshair");const n=t.getViewController().getPlanePositionFromPosition(e),i=t.planePosToDisplay(n);if(void 0!==i.getY()){const e=document.createElement("hr");e.id=this.getDivId()+"-scroll-crosshair-horizontal",e.className="horizontal",e.style.width=this.#vt.offsetWidth+"px",e.style.left="0px",e.style.top=i.getY()+"px",this.#Dn.push(e),this.#vt.appendChild(e)}if(void 0!==i.getX()){const e=document.createElement("hr");e.id=this.getDivId()+"-scroll-crosshair-vertical",e.className="vertical",e.style.width=this.#vt.offsetHeight+"px",e.style.left=i.getX()+"px",e.style.top="0px",this.#Dn.push(e),this.#vt.appendChild(e)}}#In(){for(const e of this.#Dn)e.remove();this.#Dn=[]}showTooltip(e){this.removeTooltipDiv();const t=this.getActiveViewLayer(),n=t.getViewController(),i=t.displayToPlanePos(e),r=n.getPositionFromPlanePoint(i),o=n.getRescaledImageValue(r);if(void 0!==o){const t=document.createElement("span");t.id="scroll-tooltip",t.style.left=e.getX()+10+"px",t.style.top=e.getY()+10+"px";let i=G(o,3).toString();void 0!==n.getPixelUnit()&&(i+=" "+n.getPixelUnit()),t.appendChild(document.createTextNode(i)),this.#yn=t,this.#vt.appendChild(t)}}removeTooltipDiv(){void 0!==this.#yn&&(this.#yn.remove(),this.#yn=void 0)}someViewLayer(e){let t=!1;for(const n of this.#gn)if(n instanceof jn&&e(n)){t=!0;break}return t}isPositionInBounds(e){return this.someViewLayer((function(t){return t.getViewController().isPositionInBounds(e)}))}canScroll(){return this.someViewLayer((function(e){return e.getViewController().canScroll()}))}moreThanOne(e){return this.someViewLayer((function(t){return t.getViewController().moreThanOne(e)}))}updateLayersToPositionChange=e=>{for(const e of this.#gn)e instanceof jn&&(e.removeEventListener("positionchange",this.updateLayersToPositionChange),e.removeEventListener("positionchange",this.#Re));const t=new s(e.value[0]),n=new q(e.value[1]);let i,r,o,a;this.#Ve=n,this.#fn&&this.#vn(n);for(const s of this.#gn){if(void 0===s)continue;let l=!1;if(s instanceof jn){const e=s.getViewController(),t=e.getOrigin(),l=e.getOrigin(n);if(void 0===r)i=t,r=l,o=new w(0,0,0),a=new w(0,0,0);else if(e.isPositionInBounds(n)&&void 0!==l){const e=i.minus(t);o=new w(e.getX(),e.getY(),e.getZ());const n=r.minus(l);a=new w(n.getX(),n.getY(),n.getZ())}}void 0!==o&&void 0!==a&&(l=s.setBaseOffset(o,a,r,i)),s instanceof ti&&(o=void 0,a=void 0);let c=!1;s.getId()!==e.srclayerid&&(c=s.setCurrentPosition(n,t)),!c&&l&&s.draw()}for(const e of this.#gn)e instanceof jn&&(e.addEventListener("positionchange",this.updateLayersToPositionChange),e.addEventListener("positionchange",this.#Re))};getDivToWorldSizeRatio(){if(0===this.#vt.offsetWidth&&0===this.#vt.offsetHeight)throw new Error("Cannot fit to zero sized container.");const e=this.getMaxWorldSize();if(void 0!==e){if(0===this.#vt.offsetHeight){const t=this.#vt.offsetWidth/e.x,n=e.y*t;this.#vt.style.height=n+"px"}return Math.min(this.#vt.offsetWidth/e.x,this.#vt.offsetHeight/e.y)}}fitToContainer(e){const t=this.getMaxWorldSize();if(void 0===t)return;const n={x:this.#vt.offsetWidth,y:this.#vt.offsetHeight},i={x:-.5*(n.x-Math.floor(t.x*e)),y:-.5*(n.y-Math.floor(t.y*e))};for(const t of this.#gn)void 0!==t&&t.fitToContainer(n,e,i);this.#fn&&this.#vn()}getMaxWorldSize(){let e={x:0,y:0};for(const t of this.#gn)if(t instanceof jn){const n=t.getImageWorldSize();n.x>e.x&&(e.x=n.x),n.y>e.y&&(e.y=n.y)}return 0===e.x&&0===e.y&&(e=void 0),e}flipScaleZ(){this.#ot.z*=-1,this.setScale(this.#ot)}addScale(e,t){const n={x:this.#xt.x*(1+e),y:this.#xt.y*(1+e),z:this.#xt.z*(1+e)};this.setScale(n,t)}setScale(e,t){this.#xt=e;for(const e of this.#gn)void 0!==e&&e.setScale(this.#xt,t);const n=[e.x,e.y,e.z];void 0!==t&&(n.push(t.getX()),n.push(t.getY()),n.push(t.getZ())),this.#Re({type:"zoomchange",value:n})}addTranslation(e){this.setOffset({x:this.#Et.x-e.x,y:this.#Et.y-e.y,z:this.#Et.z-e.z})}setOffset(e){this.#Et=e;for(const e of this.#gn)void 0!==e&&e.setOffset(this.#Et);this.#Re({type:"offsetchange",value:[this.#Et.x,this.#Et.y,this.#Et.z]})}reset(){this.setScale(this.#ot),this.setOffset({x:0,y:0,z:0})}draw(){for(const e of this.#gn)void 0!==e&&e.draw()}display(e){for(const t of this.#gn)void 0!==t&&t.display(e)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}}const si={WindowLevelBinder:class{getEventType=function(){return"wlchange"};getCallback=function(e){return function(t){const n=e.getViewLayersByDataId(t.dataid);if(0!==n.length){const e=n[0].getViewController();if(2===t.value.length){const n=new u(t.value[0],t.value[1]);e.setWindowLevel(n)}3===t.value.length&&e.setWindowLevelPreset(t.value[2])}}}},PositionBinder:class{getEventType=function(){return"positionchange"};getCallback=function(e){return function(t){const n=t.value[1],i=e.getActiveViewLayer().getViewController(),r=i.getCurrentPosition(),o=r.length(),a=n.length;a!==o&&(a===o-1?n.push(r.get(o-1)):a===o+1&&n.pop()),i.setCurrentPosition(new q(n))}}},ZoomBinder:class{getEventType=function(){return"zoomchange"};getCallback=function(e){return function(t){const n={x:t.value[0],y:t.value[1],z:t.value[2]};let i;6===t.value.length&&(i=new E(t.value[3],t.value[4],t.value[5])),e.setScale(n,i),e.draw()}}},OffsetBinder:class{getEventType=function(){return"offsetchange"};getCallback=function(e){return function(t){e.setOffset({x:t.value[0],y:t.value[1],z:t.value[2]}),e.draw()}}},OpacityBinder:class{getEventType=function(){return"opacitychange"};getCallback=function(e){return function(t){if(void 0===t.dataid)return;const n=e.getViewLayersByDataId(t.dataid);0!==n.length&&(n[0].setOpacity(t.value),n[0].draw())}}},ColourMapBinder:class{getEventType=function(){return"colourmapchange"};getCallback=function(e){return function(t){const n=e.getViewLayersByDataId(t.dataid);0!==n.length&&n[0].getViewController().setColourMap(t.value[0])}}}};class li{#An=[];#bn;#Bt=!1;#xn=[];#Rn=null;getLayerGroup(e){return this.#An[e]}getNumberOfLayerGroups(){return this.#An.length}getActiveLayerGroup(){return this.getLayerGroup(this.#bn)}setActiveLayerGroup(e){void 0!==this.getLayerGroup(e)?this.#bn=e:c.warn("No layer group to set as active with index: "+e)}getViewLayersByDataId(e){let t=[];for(let n=0;n<this.#An.length;++n)t=t.concat(this.#An[n].getViewLayersByDataId(e));return t}getDrawLayersByDataId(e){let t=[];for(let n=0;n<this.#An.length;++n)t=t.concat(this.#An[n].getDrawLayersByDataId(e));return t}addLayerGroup(e){this.#bn=this.#An.length;const t=new ai(e);t.setImageSmoothing(this.#Bt);const n=this.#Rn&&0!==this.#Rn.length;return n&&this.unbindLayerGroups(),this.#An.push(t),n&&this.bindLayerGroups(),t}getLayerGroupByDivId(e){return this.#An.find((function(t){return t.getDivId()===e}))}setBinders(e){if(null==e)throw new Error("Cannot set null or undefined binders");0!==this.#xn.length&&this.unbindLayerGroups(),this.#xn=e.slice(),this.bindLayerGroups()}empty(){this.unbindLayerGroups();for(let e=0;e<this.#An.length;++e)this.#An[e].empty();this.#An=[],this.#bn=void 0}removeLayersByDataId(e){for(const t of this.#An)t.removeLayersByDataId(e)}removeLayerGroup(e){const t=this.#An.findIndex((t=>t===e));if(-1===t)throw new Error("Cannot find layerGroup to remove");this.unbindLayerGroups(),e.empty(),this.#An.splice(t,1),this.#bn===t&&(this.#bn=void 0),this.bindLayerGroups()}reset(){for(let e=0;e<this.#An.length;++e)this.#An[e].reset()}draw(){for(let e=0;e<this.#An.length;++e)this.#An[e].draw()}fitToContainer(){let e;const t=[];for(let n=0;n<this.#An.length;++n){const i=this.#An[n].getDivToWorldSizeRatio();void 0!==i&&(t.push(n),(void 0===e||i<e)&&(e=i))}if(void 0!==e)for(let n=0;n<this.#An.length;++n)t.includes(n)&&this.#An[n].fitToContainer(e)}bindLayerGroups(){if(0!==this.#An.length&&1!==this.#An.length&&0!==this.#xn.length){this.#Rn=new Array(this.#An.length);for(let e=0;e<this.#An.length;++e)for(let t=0;t<this.#xn.length;++t)this.#Fn(e,this.#xn[t])}}unbindLayerGroups(){if(0!==this.#An.length&&1!==this.#An.length&&0!==this.#xn.length&&this.#Rn){for(let e=0;e<this.#An.length;++e)for(let t=0;t<this.#xn.length;++t)this.#En(e,this.#xn[t]);this.#Rn=null}}setImageSmoothing(e){this.#Bt=e;for(let t=0;t<this.#An.length;++t)this.#An[t].setImageSmoothing(e)}#qn(e,t){void 0===this.#Rn[t]&&(this.#Rn[t]=[]);let n=this.#Rn[t].find((function(t){return t.binder===e}));return void 0===n&&(n={binder:e,callback:n=>{this.#En(t,e),e.getCallback(this.#An[t])(n),this.#Fn(t,e)}},this.#Rn[t].push(n)),n.callback}#Fn(e,t){for(let n=0;n<this.#An.length;++n)n!==e&&this.#An[e].addEventListener(t.getEventType(),this.#qn(t,n))}#En(e,t){for(let n=0;n<this.#An.length;++n)n!==e&&this.#An[e].removeEventListener(t.getEventType(),this.#qn(t,n))}}class ci{toJSON(e){const t=e.getActiveLayerGroup(),n=t.getActiveViewLayer().getViewController(),i=n.getCurrentIndex(),r=t.getActiveDrawLayer(),o=r.getDrawController(),a=n.getWindowLevel();return JSON.stringify({version:"0.5","window-center":a.center,"window-width":a.width,position:i.getValues(),scale:e.getAddedScale(),offset:e.getOffset(),drawings:r.getKonvaLayer().toObject(),drawingsDetails:o.getDrawStoreDetails()})}fromJSON(e){const t=JSON.parse(e);let n=null;if("0.1"===t.version)n=this.#Un(t);else if("0.2"===t.version)n=this.#Mn(t);else if("0.3"===t.version)n=this.#Qn(t);else if("0.4"===t.version)n=this.#Vn(t);else{if("0.5"!==t.version)throw new Error("Unknown state file format version: '"+t.version+"'.");n=this.#Nn(t)}return n}apply(e,t){const n=e.getActiveLayerGroup().getActiveViewLayer().getViewController(),i=new u(t["window-center"],t["window-width"]);n.setWindowLevel(i),n.setCurrentIndex(new s(t.position));const r=e.getActiveLayerGroup().getBaseScale();let o=null,a=null;if(void 0!==t.scaleCenter){o={x:t.scale*r.x,y:t.scale*r.y,z:1};const e=t.scaleCenter.x-t.scaleCenter.x*t.scale,n=t.scaleCenter.y-t.scaleCenter.y*t.scale,i=e+t.translation.x*o.x,s=n+t.translation.y*o.y;a={x:-i/o.x,y:-s/o.y,z:0}}else o={x:t.scale.x*r.x,y:t.scale.y*r.y,z:r.z},a={x:t.offset.x,y:t.offset.y,z:0};e.getActiveLayerGroup().setScale(o),e.getActiveLayerGroup().setOffset(a),e.render(e.getDataIds()[0]),e.setDrawings(t.drawings,t.drawingsDetails)}#Un(e){const t=function(e){const t=[],n={};let i,r;for(let o=0,a=e.length;o<a;++o){t[o]=[];for(let a=0,s=e[o].length;a<s;++a){i=e[o][a];const s=[];for(let e=0,t=i.length;e<t;++e){r=Fn().Node.create(i[e]),r.visible(!0);let t={x:0,y:0};const o=r.getChildren((function(e){return"shape"===e.name()}))[0];if(o.stroke(P(o.stroke())),"line-group"===r.name()){r.name("ruler-group");const e=new(Fn().Line)({points:[o.points()[0],o.points()[1],o.points()[0],o.points()[1]],name:"shape-tick0"});r.add(e);const t=new(Fn().Line)({points:[o.points()[2],o.points()[3],o.points()[2],o.points()[3]],name:"shape-tick1"});r.add(t)}const a=r.getChildren((function(e){return"arc"===e.name()}));1===a.length&&a[0].name("shape-arc");const l=r.getChildren((function(e){return"text"===e.name()}));let c=new(Fn().Text)({name:"text",text:""});1===l.length?(t.x=l[0].x(),t.y=l[0].y(),l[0].remove(),c=l[0]):0!==o.points().length&&(t={x:o.points()[0],y:o.points()[1]});const u=new(Fn().Label)({x:t.x,y:t.y,name:"label"});u.add(c),u.add(new(Fn().Tag)),r.add(u),s.push(JSON.stringify(r.toObject()));let d=c.text();const h=d.length;let S=null;"ruler-group"===r.name()?(S={length:{value:parseFloat(d.substring(0,h-2)),unit:d.substring(-2)}},d="{length}"):"ellipse-group"===r.name()||"rectangle-group"===r.name()?(S={surface:{value:parseFloat(d.substring(0,h-3)),unit:d.substring(-3)}},d="{surface}"):"protractor-group"!==r.name()&&"rectangle-group"!==r.name()||(S={angle:{value:parseFloat(d.substring(0,h-1)),unit:d.substring(-1)}},d="{angle}"),n[r.id()]={textExpr:d,longText:"",quant:S}}t[o].push(s)}}return{drawings:t,drawingsDetails:n}}(e.drawings);return e.drawings=ui(t.drawings).toObject(),e.drawingsDetails=di(t.drawingsDetails),(e=hi(e)).drawings=Si(e.drawings),e}#Mn(e){return e.drawings=ui(e.drawings).toObject(),e.drawingsDetails=di(function(e){const t={},n="string"==typeof e?JSON.parse(e):e;for(let e=0,i=n.length;e<i;++e)for(let i=0,r=n[e].length;i<r;++i)for(let r=0,o=n[e][i].length;r<o;++r){const o=n[e][i][r];t[o.id]={textExpr:o.textExpr,longText:o.longText,quant:o.quant}}return t}(e.drawingsDetails)),(e=hi(e)).drawings=Si(e.drawings),e}#Qn(e){return e.drawingsDetails=di(e.drawingsDetails),(e=hi(e)).drawings=Si(e.drawings),e}#Vn(e){return(e=hi(e)).drawings=Si(e.drawings),e}#Nn(e){return e}}function ui(e){let t,n,i;const r=new(Fn().Layer)({listening:!1,visible:!0}),o="string"==typeof e?JSON.parse(e):e;for(let e=0,l=o.length;e<l;++e)for(let l=0,c=o[e].length;l<c;++l)if(n=o[e][l],0!==n.length){i=new(Fn().Group)({id:(a=new s([1,1,e,l]),"slice-"+a.get(2)+"_frame-"+(4===a.length()?a.get(3):0)),name:"position-group",visible:!1});for(let e=0,r=n.length;e<r;++e)t=Fn().Node.create(n[e]),t.draggable(!0),t.getChildren().forEach((function(e){e.draggable(!1)})),i.add(t);r.add(i)}var a;return r}function di(e){const t={},n=Object.keys(e);for(let i=0,r=n.length;i<r;++i){const r=e[n[i]];t[n[i]]={meta:{textExpr:r.textExpr,longText:r.longText,quantification:r.quant}}}return t}function hi(e){const t=e.position;return e.position=[t.i,t.j,t.k],e}function Si(e){const t=e.children;for(let e=0,n=t.length;e<n;++e){const n=t[e],i=n.attrs.id.split("_"),r=parseInt(i[0].substring(6),10),o=parseInt(i[1].substring(6),10);let a="#2-";a+=0===r&&0!==o?o:r,n.attrs.id=a}return e}function gi(e){return new URL(e,window.location.origin)}function mi(e){const t={};let n=null;if(e&&-1!==(n=e.indexOf("?"))){t.base=e.substring(0,n);let i=e.indexOf("#");-1===i&&(i=e.length);const r=e.substring(n+1,i);t.query=function(e){const t={};if(e){const n=e.split("&");for(let e=0;e<n.length;++e){const i=n[e].split("=");t[i[0]]?(t[i[0]]instanceof Array||(t[i[0]]=[t[i[0]]]),t[i[0]].push(i[1])):t[i[0]]=i[1]}}return t}(r)}return t}class pi{#Bn=[];#Gn=0;#Oe=new Ze;getStackSize(){return this.#Bn.length}getCurrentStackIndex(){return this.#Gn}add(e){this.#Bn=this.#Bn.slice(0,this.#Gn),this.#Bn.push(e),++this.#Gn,this.#Re({type:"undoadd",command:e.getName()})}undo(){this.#Gn>0&&(--this.#Gn,this.#Bn[this.#Gn].undo(),this.#Re({type:"undo",command:this.#Bn[this.#Gn].getName()}))}redo(){this.#Gn<this.#Bn.length&&(this.#Bn[this.#Gn].execute(),this.#Re({type:"redo",command:this.#Bn[this.#Gn].getName()}),++this.#Gn)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}}class fi{#kn;#Hn=null;#Rn=[];#zn={};constructor(e){this.#kn=e}init(){for(const e in this.#kn)this.#kn[e].init();this.enableShortcuts(!0)}enableShortcuts(e){e?window.addEventListener("keydown",this.#Wn("window","keydown"),!0):window.removeEventListener("keydown",this.#Wn("window","keydown"),!0)}getToolList(){return this.#kn}hasTool(e){return void 0!==this.getToolList()[e]}getSelectedTool(){return this.#Hn}getSelectedToolEventHandler(e){return this.getSelectedTool()[e]}setSelectedTool(e){if(!this.hasTool(e))throw new Error("Unknown tool: '"+e+"'");this.#Hn&&this.#Hn.activate(!1),this.#Hn=this.#kn[e],this.#Hn.activate(!0)}setToolFeatures(e){this.getSelectedTool()&&this.getSelectedTool().setFeatures(e)}bindLayerGroup(e,t){const n=e.getDivId();e.addEventListener("activelayerchange",this.#Xn(n)),this.#Yn(n,t)}#Yn(e,t){void 0!==this.#zn[e]&&this.#jn(this.#zn[e]),this.#zn[e]=t,this.#Zn(t)}#Xn(e){return t=>{const n=t.value[0];this.#Yn(e,n)}}#Zn(e){e.bindInteraction();const t=kn;for(let n=0;n<t.length;++n)e.addEventListener(t[n],this.#Wn(e.getId(),t[n]))}#jn(e){e.unbindInteraction();const t=kn;for(let n=0;n<t.length;++n)e.removeEventListener(t[n],this.#Wn(e.getId(),t[n]))}#Wn(e,t){if(void 0===this.#Rn[e]&&(this.#Rn[e]=[]),void 0===this.#Rn[e][t]){const n=e=>{if(this.#Hn){const t=this.#Hn[e.type];t&&t(e)}};this.#Rn[e][t]=n}return this.#Rn[e][t]}}class Di{#_n=[];#Kn=2;#Jn;constructor(e){this.#Jn=e}setNumberOfDimensions(e){this.#Kn=e}setNToLoad(e){for(let t=0;t<e;++t){this.#_n[t]=[];for(let e=0;e<this.#Kn;++e)this.#_n[t][e]=0}}onprogress=e=>{if(!e.lengthComputable)return;if(void 0===e.subindex)return;if(void 0===e.index)return;const t=100*e.loaded/e.total;this.#_n[e.index][e.subindex]=t;let n=null;n=void 0!==e.item?e.item:{loaded:this.#$n(e.index),total:100,source:e.source},this.#Jn({lengthComputable:!0,loaded:this.#ei(),total:100,item:n})};#$n(e){let t=0;for(let n=0;n<this.#Kn;++n)t+=this.#_n[e][n];return t/this.#Kn}#ei(){let e=0;const t=this.#_n.length;for(let n=0;n<t;++n)e+=this.#$n(n);return Math.round(e/t)}getMonoProgressHandler(e,t){return n=>{n.index=e,n.subindex=t,this.onprogress(n)}}getUndefinedMonoProgressHandler(e){return t=>{t.subindex=e,this.onprogress(t)}}}class yi{#ti=null;#ni=[];#ii=null;#ri=0;#oi=0;#ai;#F;getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}#si(e){this.#ti=e,this.#ri=0,this.#oi=0,this.#ai=!1,this.#li(),this.#ci()}#ui(e){this.#ni.push(e)}#li(){this.#ni=[]}#di(e){this.#ii=e}#ci(){this.#ii=null}#hi=e=>{this.#ri++,this.#ri===this.#ti.length&&this.onload({source:this.#ti})};#Si=e=>{this.#oi++,this.#oi===this.#ti.length&&this.onloadend({source:this.#ti})};#gi(e,t){return n=>{n.source=t,e(n)}}load(e,t){this.onloadstart({source:e}),1===e.length&&(M(e[0],"DICOMDIR")||M(e[0],".dcmdir"))?this.#mi(e[0],t):this.#pi(e,t)}#fi(e,t,n){return i=>{const r=i.target.status;200!==r&&0!==r?(this.onerror({source:t,error:"GET "+i.target.responseURL+" "+i.target.status+" ("+i.target.statusText+")",target:i.target}),this.#Si()):e.load(i.target.response,t,n)}}#pi(e,t){if(void 0===e||0===e.length)return;this.#si(e);const n=new Di(this.onprogress);n.setNToLoad(e.length);const i=[];for(let e=0;e<Vi.length;++e)i.push(new Vi[e]);let r=e[0],o=null,a=!1;for(let s=0;s<i.length;++s)if(o=i[s],o.canLoadUrl(r,t)){a=!0,o.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),o.onprogress=n.getUndefinedMonoProgressHandler(1),o.onloaditem=this.onloaditem,o.onload=this.#hi,o.onloadend=this.#Si,o.onerror=this.onerror,o.onabort=this.onabort,this.#di(o);break}if(!a)throw new Error("No loader found for url: "+r);let s=0;const l=()=>{s<this.#ni.length-1&&!this.#ai&&(++s,this.#ni[s].send(null))};for(let i=0;i<e.length;++i){if(r=e[i],!o.canLoadUrl(r,t))throw new Error("Input url of different type: "+r);const a=new XMLHttpRequest;if(a.open("GET",r,!0),void 0!==t){if(void 0!==t.requestHeaders){const e=t.requestHeaders;for(let t=0;t<e.length;++t)void 0!==e[t].name&&void 0!==e[t].value&&a.setRequestHeader(e[t].name,e[t].value)}void 0!==t.withCredentials&&(a.withCredentials=t.withCredentials)}a.onprogress=this.#gi(n.getMonoProgressHandler(i,0),r),a.onload=this.#fi(o,r,i),a.onloadend=l;const s=this.#gi(this.onerror,r);a.onerror=e=>{this.#Si(),s(e)};const c=this.#gi(this.onabort,r);a.onabort=e=>{this.#Si(),c(e)},1===o.loadUrlAs()&&(a.responseType="arraybuffer"),this.#ui(a)}let c=this.#ni.length;void 0!==t&&void 0!==t.batchSize&&0!==c&&(c=Math.min(t.batchSize,this.#ni.length));for(let e=0;e<c;++e)this.#ai||(s=e,this.#ni[s].send(null))}#mi(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=n=>{const i=n.target.status;if(200!==i&&0!==i)this.onerror({source:e,error:"GET "+n.target.responseURL+" "+n.target.status+" ("+n.target.statusText+")",target:n.target}),this.onloadend({});else{const i=function(e){const t=new je;t.parse(e);const n=t.getDicomElements();if(void 0===n["00041220"]||void 0===n["00041220"].value)return void c.warn("No Directory Record Sequence found in DICOMDIR.");const i=n["00041220"].value;if(0===i.length)return void c.warn("The Directory Record Sequence of the DICOMDIR is empty.");const r=[];let o=null,a=null;for(let e=0;e<i.length;++e){if(void 0===i[e]["00041430"]||void 0===i[e]["00041430"].value)continue;const t=i[e]["00041430"].value[0];if("STUDY"===t)a=[],r.push(a);else if("SERIES"===t)o=[],a.push(o);else if("IMAGE"===t){if(void 0===i[e]["00041500"]||void 0===i[e]["00041500"].value)continue;const t=i[e]["00041500"].value;o.push(t.join("/"))}}return r}(n.target.response)[0][0],r=e.split("/").slice(0,-1).join("/"),o=[];for(let e=0;e<i.length;++e)o.push(r+"/"+i[e]);this.#pi(o,t)}},n.onerror=t=>{this.#gi(this.onerror,e)(t),this.onloadend({})},n.onabort=t=>{this.#gi(this.onabort,e)(t),this.onloadend({})},n.send(null)}abort(){this.#ai=!0;for(let e=0;e<this.#ni.length;++e)4!==this.#ni[e].readyState&&this.#ni[e].abort();this.#ii&&this.#ii.isLoading()&&this.#ii.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}class Ci{constructor(e){this.poolSize=e,this.taskQueue=[],this.freeThreads=[];for(let t=0;t<e;++t)this.freeThreads.push(new vi(this));this.runningThreads=[]}addWorkerTask(e){if(this.freeThreads.length===this.poolSize&&this.onworkstart({type:"work-start"}),this.freeThreads.length>0){const t=this.freeThreads.shift();this.runningThreads.push(t),t.run(e)}else this.taskQueue.push(e)}abort(){this.#Di(),this.onabort({type:"work-abort"}),this.onworkend({type:"work-end"})}onTaskEnd(e){if(this.taskQueue.length>0){const t=this.taskQueue.shift();e.run(t)}else{e.stop(),this.freeThreads.push(e);for(let t=0;t<this.runningThreads.length;++t)this.runningThreads[t].getId()===e.getId()&&this.runningThreads.splice(t,1);this.freeThreads.length===this.poolSize&&(this.onwork({type:"work"}),this.onworkend({type:"work-end"}))}}handleWorkerError=e=>{this.#Di(),this.onerror({error:e}),this.onworkend({type:"work-end"})};#Di(){this.taskQueue=[];for(let e=0;e<this.runningThreads.length;++e)this.runningThreads[e].stop();this.runningThreads=[]}onworkstart(e){}onworkitem(e){}onwork(e){}onworkend(e){}onerror(e){}onabort(e){}}class vi{constructor(e){this.parentPool=e,this.id=Math.random().toString(36).substring(2,15),this.runningTask=null,this.worker}getId(){return this.id}run(e){this.runningTask=e,void 0===this.worker&&(this.worker=new Worker(this.runningTask.script),this.worker.onmessage=this.onmessage,this.worker.onerror=this.onerror),this.worker.postMessage(this.runningTask.startMessage)}stop(){void 0!==this.worker&&(this.worker.terminate(),this.worker=void 0)}onmessage=e=>{e.itemNumber=this.runningTask.info.itemNumber,e.numberOfItems=this.runningTask.info.numberOfItems,e.index=this.runningTask.info.index,this.parentPool.onworkitem(e),this.parentPool.onTaskEnd(this)};onerror=e=>{e.itemNumber=this.runningTask.info.itemNumber,e.numberOfItems=this.runningTask.info.numberOfItems,e.index=this.runningTask.info.index,this.parentPool.handleWorkerError(e),this.stop()}}class Ii{constructor(e,t,n){this.script=e,this.startMessage=t,this.info=n}}const Ti="undefined"!=typeof JpegImage,Li="undefined"!=typeof jpeg&&void 0!==jpeg.lossless,Pi="undefined"!=typeof JpxImage,wi={jpeg2000:"","jpeg-lossless":"","jpeg-baseline":"",rle:""};class Oi{#yi;#Ci=new Ci(10);#vi=!1;constructor(e,t){this.#yi=e}decode(e,t,n){this.#vi||(this.#vi=!0,this.#Ci.onworkstart=this.ondecodestart,this.#Ci.onworkitem=this.ondecodeditem,this.#Ci.onwork=this.ondecoded,this.#Ci.onworkend=this.ondecodeend,this.#Ci.onerror=this.onerror,this.#Ci.onabort=this.onabort);const i=new Ii(this.#yi,{buffer:e,meta:t},n);this.#Ci.addWorkerTask(i)}abort(){this.#Ci.abort()}ondecodestart(e){}ondecodeditem(e){}ondecoded(e){}ondecodeend(e){}onerror(e){}onabort(e){}}class Ai{#Ii;#Ti;constructor(e,t){this.#Ii=e,this.#Ti=t}#Li=0;decode(e,t,n){++this.#Li;let i=null,r=null;if("jpeg-lossless"===this.#Ii){if(!Li)throw new Error("No JPEG Lossless decoder provided");const n=t.bitsAllocated/8,o=new Uint8Array(e);i=new jpeg.lossless.Decoder;const a=i.decode(o.buffer,0,o.buffer.byteLength,n);8===t.bitsAllocated?r=t.isSigned?new Int8Array(a.buffer):new Uint8Array(a.buffer):16===t.bitsAllocated&&(r=t.isSigned?new Int16Array(a.buffer):new Uint16Array(a.buffer))}else if("jpeg-baseline"===this.#Ii){if(!Ti)throw new Error("No JPEG Baseline decoder provided");i=new JpegImage,i.parse(e),r=i.getData(i.width,i.height)}else if("jpeg2000"===this.#Ii){if(!Pi)throw new Error("No JPEG 2000 decoder provided");i=new JpxImage,i.parse(e),r=i.tiles[0].items}else"rle"===this.#Ii&&(i=new dwvdecoder.RleDecoder,r=i.decode(e,t.bitsAllocated,t.isSigned,t.sliceSize,t.samplesPerPixel,t.planarConfiguration));this.ondecodeditem({data:[r],index:n.index,numberOfItems:n.numberOfItems,itemNumber:n.itemNumber}),this.#Li===this.#Ti&&(this.ondecoded({}),this.ondecodeend({}))}abort(){this.onabort({}),this.ondecodeend({})}ondecodestart(e){}ondecodeditem(e){}ondecoded(e){}ondecodeend(e){}onerror(e){}onabort(e){}}class bi{#vi=!1;#Pi=null;constructor(e,t){void 0!==wi&&void 0!==wi[e]?this.#Pi=new Oi(wi[e],t):this.#Pi=new Ai(e,t)}decode(e,t,n){this.#vi||(this.#vi=!0,this.#Pi.ondecodestart=this.ondecodestart,this.#Pi.ondecodeditem=this.ondecodeditem,this.#Pi.ondecoded=this.ondecoded,this.#Pi.ondecodeend=this.ondecodeend,this.#Pi.onerror=this.onerror,this.#Pi.onabort=this.onabort),this.#Pi.decode(e,t,n)}abort(){this.#Pi.abort()}ondecodestart(e){}ondecodeditem(e){}ondecoded(e){}ondecodeend(e){}onerror(e){}onabort(e){}}class xi{meta;image;constructor(e,t){this.meta=e,this.image=t}}class Ri{#wi={};#Oi=-1;#Oe=new Ze;getNextDataId(){return++this.#Oi,this.#Oi.toString()}getDataIds(){return Object.keys(this.#wi)}reset(){this.#wi={}}get(e){return this.#wi[e]}getDataIdsFromSopUids(e){const t=[];if(void 0===e||0===e.length)return t;const n=Object.keys(this.#wi);for(const i of n)this.#wi[i].image.containsImageUids(e)&&t.push(i);return t}setImage(e,t){this.#wi[e].image=t,this.#Re({type:"imageset",value:[t],dataid:e}),t.addEventListener("imagecontentchange",this.#Ai(e)),t.addEventListener("imagegeometrychange",this.#Ai(e))}addNew(e,t){if(void 0!==this.#wi[e])throw new Error("Data id already used in storage: "+e);this.#wi[e]=t,void 0!==t.image&&(t.image.addEventListener("imagecontentchange",this.#Ai(e)),t.image.addEventListener("imagegeometrychange",this.#Ai(e)))}remove(e){if(void 0!==this.#wi[e]){const t=this.#wi[e].image;void 0!==t&&(t.removeEventListener("imagecontentchange",this.#Ai(e)),t.removeEventListener("imagegeometrychange",this.#Ai(e))),this.#Re({type:"imageremove",dataid:e}),delete this.#wi[e]}}update(e,t){if(void 0===this.#wi[e])throw new Error("Cannot find data to update: "+e);const n=this.#wi[e];void 0!==n.image&&void 0!==t.image&&n.image.appendSlice(t.image);let i="";i=void 0!==t.meta["00020010"]?"00200013":"imageUid",n.meta=function(e,t,n,i){const r={};if(!n)throw new Error("Cannot merge object with an undefined id key: "+n);if(!Object.prototype.hasOwnProperty.call(e,n))throw new Error("Id key not found in first object while merging: "+n+", obj: "+e);if(!Object.prototype.hasOwnProperty.call(t,n))throw new Error("Id key not found in second object while merging: "+n+", obj: "+t);let o=!1;if(Object.prototype.hasOwnProperty.call(e[n],"merged")&&e[n].merged&&(o=!0),!Object.prototype.hasOwnProperty.call(e[n],i))throw new Error("Id value not found in first object while merging: "+n+", valueKey: "+i+", ojb: "+e);if(!Object.prototype.hasOwnProperty.call(t[n],i))throw new Error("Id value not found in second object while merging: "+n+", valueKey: "+i+", ojb: "+t);let a=e[n][i];const s=t[n][i][0];if(r[n]=e[n],o){for(let e=0;e<a.length;++e)if(a[e]===s)throw new Error("The first object already contains id2: "+s+", id1: "+a);r[n][i].push(s)}else{if(a=a[0],a===s)throw new Error("Cannot merge object with same ids: "+a+", id2: "+s);r[n][i].push(s),r[n].merged=!0}const l=Object.keys(e),c=Object.keys(t).filter((function(e){return l.indexOf(e)<0})),u=l.concat(c);for(let l=0;l<u.length;++l){const c=u[l];if(c!==n){let n,l,u,d,h;if(Object.prototype.hasOwnProperty.call(e,c)&&(n=e[c],Object.prototype.hasOwnProperty.call(n,i)&&(l=n[i])),Object.prototype.hasOwnProperty.call(t,c)&&(u=t[c],Object.prototype.hasOwnProperty.call(u,i)&&(d=u[i])),void 0!==n?h=n:void 0!==u&&(h=u),!H(l,d))if(o){if(Array.isArray(l)){h[i]={};for(let e=0;e<a.length;++e)h[i][a[e]]=l}else h[i]=l;h[i][s]=d}else{const e={};e[a]=l,e[s]=d,h[i]=e}r[c]=h}}return r}(n.meta,t.meta,i,"value")}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};#Ai(e){return t=>{t.dataid=e,this.#Re(t)}}}class Fi{#bi;setOptions(e){this.#bi=e}#Pi=null;#xi=[];#Ri=[];#Fi=[];#Ei=[];#qi(e){let t;const n=e["00080060"];return void 0!==n&&"SEG"===n.value[0]&&(t=new fn),void 0===t&&void 0!==e["7FE00010"]&&(t=new Tt),t}#Ui(e,t){const n=this.#xi[e].getDicomElements(),i=this.#Ei[e];if(void 0!==i)try{const r=i.create(n,this.#Ri[e],this.#bi.numberOfFiles);this.onloaditem({data:new xi(n,r),source:t,warn:i.getWarning()})}catch(e){this.onerror({error:e,source:t}),this.onloadend({source:t})}}#Mi(e,t){this.onprogress({lengthComputable:!0,loaded:100,total:100,index:e,source:t}),this.#Ui(e,t),this.onload({source:t}),this.onloadend({source:t})}#Qi(e,t,n){const i=this.#xi[e],r={bitsAllocated:i.getDicomElements()["00280100"].value[0],isSigned:1===i.getDicomElements()["00280103"].value[0]},o=i.getDicomElements()["00280011"],a=i.getDicomElements()["00280010"];void 0!==o&&void 0!==a&&(r.sliceSize=o.value[0]*a.value[0]);const s=i.getDicomElements()["00280002"];void 0!==s&&(r.samplesPerPixel=s.value[0]);const l=i.getDicomElements()["00280006"];void 0!==l&&(r.planarConfiguration=l.value[0]);const c=t.length;null===this.#Pi&&(this.#Pi=new bi(n,c),this.#Pi.ondecodeditem=e=>{this.#Vi(e),e.itemNumber+1===e.numberOfItems&&(this.onload(e),this.onloadend(e))},this.#Pi.onerror=this.onerror,this.#Pi.onabort=this.onabort);for(let n=0;n<c;++n)this.#Pi.decode(t[n],r,{itemNumber:n,numberOfItems:c,index:e})}#Vi(e){this.onprogress({lengthComputable:!0,loaded:e.itemNumber+1,total:e.numberOfItems,index:e.index,source:origin});const t=e.index,n=e.data[0];if(1!==e.numberOfItems){if(void 0===this.#Fi[t]){this.#Fi[t]=n.length;const i=e.numberOfItems*this.#Fi[t];try{this.#Ri[t]=new n.constructor(i)}catch(e){if(e instanceof RangeError){const e=Math.floor(Math.log(i)/Math.log(2));c.error("Cannot allocate "+n.constructor.name+" of size: "+i+" (>2^"+e+") for decompressed data.")}return this.#Pi.abort(),this.onerror({error:e,source:origin}),void this.onloadend({source:origin})}}n.length!==this.#Fi[t]&&c.warn("Unsupported varying decompressed data size: "+n.length+" != "+this.#Fi[t]),this.#Ri[t].set(n,this.#Fi[t]*e.itemNumber)}else this.#Ri[t]=n;0===e.itemNumber&&this.#Ui(t,origin)}#Ni(e,t){const n=this.#xi[e];this.onloaditem({data:new xi(n.getDicomElements()),source:t}),this.onload({source:t}),this.onloadend({source:t})}#Bi(e,t){const n=this.#xi[e],i=n.getDicomElements()["7FE00010"].value;n.getDicomElements()["7FE00010"].value=[],this.#Ri[e]=i[0];const r=function(e){let t;return Be(e)?t="jpeg2000":Ve(e)?t="jpeg-baseline":Ne(e)?t="jpeg-lossless":Ge(e)&&(t="rle"),t}(n.getDicomElements()["00020010"].value[0]);void 0!==r?this.#Qi(e,i,r):this.#Mi(e,t)}convert(e,t,n){this.onloadstart({source:t,index:n});const i=new je;let r;void 0!==this.#bi.defaultCharacterSet&&i.setDefaultCharacterSet(this.#bi.defaultCharacterSet);try{i.parse(e),r=this.#qi(i.getDicomElements()),void 0!==r&&r.checkElements(i.getDicomElements())}catch(e){return this.onerror({error:e,source:t}),void this.onloadend({source:t})}this.#xi[n]=i,this.#Ei[n]=r,void 0===r?this.#Ni(n,t):this.#Bi(n,t)}abort(){this.#Pi&&this.#Pi.abort()}onloadstart(e){}onloaditem(e){}onprogress(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}class Ei{#ti=null;#ii=null;#ri=0;#oi=0;#F;getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}#si(e){this.#ti=e,this.#ri=0,this.#oi=0,this.#ci()}#di(e){this.#ii=e}#ci(){this.#ii=null}#hi=e=>{this.#ri++,this.#ri===this.#ti.length&&this.onload({source:this.#ti})};#Si=e=>{this.#oi++,this.#oi===this.#ti.length&&this.onloadend({source:this.#ti})};load(e){if(void 0===e||0===e.length)return;this.#si(e),this.onloadstart({source:e});const t=new Di(this.onprogress);t.setNToLoad(e.length),t.setNumberOfDimensions(1);const n=[];for(let e=0;e<Vi.length;++e)n.push(new Vi[e]);let i=e[0],r=null,o=!1;for(let a=0;a<n.length;++a)if(r=n[a],r.canLoadMemory(i)){o=!0,r.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),r.onprogress=t.getUndefinedMonoProgressHandler(0),r.onloaditem=this.onloaditem,r.onload=this.#hi,r.onloadend=this.#Si,r.onerror=this.onerror,r.onabort=this.onabort,this.#di(r);break}if(!o)throw new Error("No loader found for data: "+i.filename);for(let t=0;t<e.length;++t){if(i=e[t],!r.canLoadMemory(i))throw new Error("Input data of different type: "+i.filename);r.load(i.data,i.filename,t)}}abort(){this.#ii&&this.#ii.isLoading()&&this.#ii.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}function qi(e){const t=e.data.length,n=new Uint8Array(t/4*3);let i=0;for(let r=0;r<t;r+=4)n[i]=e.data[r],n[i+1]=e.data[r+1],n[i+2]=e.data[r+2],i+=3;return n}function Ui(e,t,n,i,r,o){const a=new tt([e,t,1]),s=new lt([1,1,1]),l=new E(0,0,n),c=new ct(l,a,s),u=new Cn(c,i,[o]);u.setPhotometricInterpretation("RGB");const d={BitsStored:8};return void 0!==r&&(d.numberOfFiles=r),u.setMeta(d),u}var Mi=o(654),Qi=o.n(Mi);const Vi=[class{#bi={};#Gi=!1;setOptions(e){this.#bi=e}isLoading(){return this.#Gi}#ki=new Fi;load(e,t,n){this.#Gi||(this.#ki.setOptions(this.#bi),this.#ki.onloadstart=this.onloadstart,this.#ki.onprogress=this.onprogress,this.#ki.onloaditem=this.onloaditem,this.#ki.onload=this.onload,this.#ki.onloadend=e=>{this.#Gi=!1,this.onloadend(e)},this.#ki.onerror=e=>{e.source=t,this.onerror(e)},this.#ki.onabort=this.onabort),this.#Gi=!0,this.#ki.convert(e,t,n)}abort(){this.#Gi=!1,this.#ki.abort()}canLoadFile(e){const t=N(e.name);return null===t||"dcm"===t}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"dicom"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n){const e="application/dicom";return U(n.value,e)&&"+"!==n.value[e.length]}}}const n=gi(e),i=N(n.pathname),r=null===i,o="dcm"===i,a=n.searchParams.get("contentType");return null!=a?"application/dicom"===a:r||o}canLoadMemory(e){const t=e["Content-Type"];if(void 0!==t&&t.startsWith("application/dicom"))return!0;if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return Ni.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Gi=!1;setOptions(e){}isLoading(){return this.#Gi}load(e,t,n){this.#Gi=!0,this.onloadstart({source:t});try{this.onprogress({lengthComputable:!0,loaded:100,total:100,index:n,source:t});const i={data:e,source:t};this.onloaditem(i),this.onload(i)}catch(e){this.onerror({error:e,source:t})}finally{this.#Gi=!1,this.onloadend({source:t})}}abort(){this.#Gi=!1,this.onabort({}),this.onloadend({})}canLoadFile(e){return"json"===N(e.name)}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"json"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return U(n.value,"application/json")||U(n.value,"application/dicom+json")}}return"json"===N(gi(e).pathname)}canLoadMemory(e){const t=e["Content-Type"];if(void 0!==t&&t.startsWith("application/json"))return!0;if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return Ni.Text}loadUrlAs(){return 0}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Gi=!1;setOptions(e){}isLoading(){return this.#Gi}load(e,t,n){this.onloadstart({source:t}),this.#Gi=!0;const i=new Ei;i.onprogress=e=>{e.loaded=50+e.loaded/2,e.index=n,this.onprogress(e)},i.onloaditem=this.onloaditem,i.onload=this.onload,i.onloadend=e=>{this.#Gi=!1,this.onloadend(e)},i.onerror=this.onerror,i.onabort=this.onabort,i.load(function(e){const t=new Uint8Array(e),n=[];if(0===t.length)return n;const i=X(new Uint8Array([13,10,13,10]));let r=W(t,i,0);if(void 0===r)throw new Error("Can't find the end of the first multipart header");const o=z(t.slice(0,r)).split("\r\n");let a;for(let e=0;e<o.length;++e)if("-"===o[e][0]&&"-"===o[e][1]){a=o[e];break}if(void 0===a)throw new Error("Can't find the boundary between multi-parts");const s=X(B(a)),l=a.length;let c=W(t,s,0);for(;void 0!==r;){const e={},o=z(t.slice(c+l,r)).split("\r\n");for(let t=0;t<o.length;++t){const n=o[t],i=n.indexOf(":");if(-1!==i){const t=n.substring(0,i).trim(),r=n.substring(i+1).trim();e[t]=r}}if(c=W(t,s,r),void 0===c)break;const a=r+4,u=c-2;e.data=a<u?t.slice(a,u).buffer:new Uint8Array,n.push(e),r=W(t,i,c+l)}return n}(e))}abort(){this.#Gi=!1,this.onabort({}),this.onloadend({})}canLoadFile(e){return!1}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"multipart"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return U(n.value,"multipart/related")}}return!1}canLoadMemory(e){return!1}loadFileAs(){return Ni.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Hi=!1;setOptions(e){}isLoading(){return!0}#zi(e,t){let n=t;n&&"jpg"!==n||(n="jpeg");const i=new Blob([e],{type:"image/"+n});return window.URL.createObjectURL(i)}load(e,t,n){this.#Hi=!1;const i=new Image;if(i.onload=()=>{try{if(!this.#Hi){this.onprogress({lengthComputable:!0,loaded:100,total:100,index:n,source:t});const e=function(e,t,n){const i=e.width,r=e.height,o=document.createElement("canvas");o.width=i,o.height=r;const a=o.getContext("2d");a.drawImage(e,0,0);const s=a.getImageData(0,0,i,r),l={};"string"==typeof t?l.origin={value:t}:(l.fileName={value:t.name},l.fileType={value:t.type},l.fileLastModifiedDate={value:t.lastModified}),l.imageWidth={value:i},l.imageHeight={value:r};const c=n||0;return l.imageUid={value:c},{data:{image:Ui(i,r,c,qi(s),1,c.toString()),info:l},source:t}}(i,t,n);this.onloaditem(e),this.onload(e)}}catch(e){this.onerror({error:e,source:t})}finally{this.onloadend({source:t})}},"string"==typeof e)i.src=e;else if("string"==typeof t){const n=t.split(".").pop().toLowerCase();i.src=this.#zi(e,n)}}abort(){this.#Hi=!0,this.onabort({}),this.onloadend({})}canLoadFile(e){return void 0!==e.type&&null!==e.type.match("image.*")}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"rawimage"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return U(n.value,"image/")}}const n=gi(e),i=N(n.pathname),r="jpeg"===i||"jpg"===i||"png"===i||"gif"===i,o=n.searchParams.get("contentType");return null!=o?"image/jpeg"===o||"image/png"===o||"image/gif"===o:r}canLoadMemory(e){if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return Ni.DataURL}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{setOptions(e){}isLoading(){return!0}#zi(e,t){const n=new Uint8Array(e);let i="";for(let e=0;e<n.byteLength;++e)i+=String.fromCharCode(n[e]);return"data:video/"+t+";base64,"+window.btoa(i)}load(e,t,n){const i=document.createElement("video");if("string"==typeof t){const n=t.split(".").pop().toLowerCase();i.src=this.#zi(e,n)}else i.src=e;i.onloadedmetadata=e=>{try{!function(e,t,n,i,r,o,a){const s=e.videoWidth,l=e.videoHeight,c=Math.ceil(30*e.duration),u={};"string"==typeof o?u.origin={value:o}:(u.fileName={value:o.name},u.fileType={value:o.type},u.fileLastModifiedDate={value:o.lastModified}),u.imageWidth={value:s},u.imageHeight={value:l},u.numberOfFrames={value:c},u.imageUid={value:0};const d=document.createElement("canvas");d.width=s,d.height=l;const h=d.getContext("2d");e.addEventListener("seeked",(function d(p){(function(){i({lengthComputable:!0,loaded:S,total:c,index:a,source:o}),h.drawImage(e,0,0);const n=qi(h.getImageData(0,0,s,l));0===S?(g=Ui(s,l,1,n,c,a.toString()),t({data:{image:g,info:u},source:o})):g.appendFrameBuffer(n,S),++S})(),m+=1/30,m<=p.target.duration?this.currentTime=m:(n({source:o}),r({source:o}),e.removeEventListener("seeked",d))}),!1);let S=0,g=null,m=0;e.currentTime=m}(e.target,this.onloaditem,this.onload,this.onprogress,this.onloadend,t,n)}catch(e){this.onerror({error:e,source:t}),this.onloadend({source:t})}}}abort(){this.onabort({}),this.onloadend({})}canLoadFile(e){return void 0!==e.type&&null!==e.type.match("video.*")}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"rawvideo"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return U(n.value,"video/")}}const n=N(gi(e).pathname);return"mp4"===n||"ogg"===n||"webm"===n}canLoadMemory(e){if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return Ni.DataURL}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Gi=!1;setOptions(e){}isLoading(){return this.#Gi}#Wi="";#Xi=[];#Yi=null;#ji(e,t,n){this.#Xi.push({filename:this.#Wi,data:e});const i=100*this.#Xi.length/this.#Yi.length;if(this.onprogress({lengthComputable:!0,loaded:i/2,total:100,index:n,item:{loaded:i,total:100,source:t}}),this.#Xi.length<this.#Yi.length){const e=this.#Xi.length;this.#Wi=this.#Yi[e].name,this.#Yi[e].async("arrayBuffer").then((e=>{this.#ji(e,t,n)}))}else{const e=new Ei;e.onprogress=e=>{e.loaded=50+e.loaded/2,e.index=n,this.onprogress(e)},e.onloaditem=this.onloaditem,e.onload=this.onload,e.onloadend=e=>{this.#Gi=!1,this.onloadend(e)},e.onerror=this.onerror,e.onabort=this.onabort,e.load(this.#Xi)}}load(e,t,n){this.onloadstart({source:t}),this.#Gi=!0,Qi().loadAsync(e).then((e=>{this.#Xi=[],this.#Yi=e.file(/.*\.dcm/);const i=this.#Xi.length;this.#Wi=this.#Yi[i].name,this.#Yi[i].async("arrayBuffer").then((e=>{this.#ji(e,t,n)}))}))}abort(){this.#Gi=!1,this.onabort({}),this.onloadend({})}canLoadFile(e){return"zip"===N(e.name)}canLoadUrl(e,t){if(void 0!==t){if(void 0!==t.forceLoader&&"zip"===t.forceLoader)return!0;if(void 0!==t.requestHeaders){const e=function(e){return"Accept"===e.name},n=t.requestHeaders.find(e);if(void 0!==n)return U(n.value,"application/zip")}}return"zip"===N(gi(e).pathname)}canLoadMemory(e){const t=e["Content-Type"];if(void 0!==t&&t.startsWith("application/zip"))return!0;if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return Ni.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}],Ni={Text:0,ArrayBuffer:1,DataURL:2};class Bi{#ti=null;#Zi=[];#ii=null;#ri=0;#oi=0;#F;getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}#si(e){this.#ti=e,this.#ri=0,this.#oi=0,this.#_i(),this.#ci()}#Ki(e){this.#Zi.push(e)}#_i(){this.#Zi=[]}#di(e){this.#ii=e}#ci(){this.#ii=null}#hi=e=>{this.#ri++,this.#ri===this.#ti.length&&this.onload({source:this.#ti})};#Si=e=>{this.#oi++,this.#oi===this.#ti.length&&this.onloadend({source:this.#ti})};#gi(e,t){return n=>{n.source=t,e(n)}}#fi(e,t,n){return i=>{e.load(i.target.result,t,n)}}load(e){if(void 0===e||0===e.length)return;this.#si(e),this.onloadstart({source:e});const t=new Di(this.onprogress);t.setNToLoad(e.length);const n=[];for(let e=0;e<Vi.length;++e)n.push(new Vi[e]);let i=e[0],r=null,o=!1;for(let a=0;a<n.length;++a)if(r=n[a],r.canLoadFile(i)){o=!0,r.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),r.onprogress=t.getUndefinedMonoProgressHandler(1),r.onloaditem=this.onloaditem,r.onload=this.#hi,r.onloadend=this.#Si,r.onerror=this.onerror,r.onabort=this.onabort,this.#di(r);break}if(!o)throw new Error("No loader found for file: "+i.name);for(let n=0;n<e.length;++n){if(i=e[n],!r.canLoadFile(i))throw new Error("Input file of different type: "+i);const o=new FileReader;this.#Ki(o),o.onprogress=this.#gi(t.getMonoProgressHandler(n,0),i),o.onload=this.#fi(r,i,n);const a=this.#gi(this.onerror,i);o.onerror=e=>{this.#Si(),a(e)};const s=this.#gi(this.onabort,i);o.onabort=e=>{this.#Si(),s(e)},r.loadFileAs()===Ni.Text?o.readAsText(i):r.loadFileAs()===Ni.DataURL?o.readAsDataURL(i):r.loadFileAs()===Ni.ArrayBuffer&&o.readAsArrayBuffer(i)}}abort(){for(let e=0;e<this.#Zi.length;++e)1===this.#Zi[e].readyState&&this.#Zi[e].abort();this.#ii&&this.#ii.isLoading()&&this.#ii.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}class Gi{#F;#Ji={};constructor(e){this.#F=e}loadFiles(e,t){"json"===e[0].name.split(".").pop().toLowerCase()?this.#$i(e[0],t):this.#er(e,t)}loadURLs(e,t,n){"json"===e[0].split(".").pop().toLowerCase()?this.#tr(e[0],t,n):this.#nr(e,t,n)}loadImageObject(e,t){const n=new Ei;this.#ir(e,n,"image",t)}getLoadingDataIds(){return Object.keys(this.#Ji)}abort(e){void 0!==this.#Ji[e]&&(this.#Ji[e].loader.abort(),delete this.#Ji[e])}#er(e,t){const n=new Bi;n.setDefaultCharacterSet(this.#F),this.#ir(e,n,"image",t)}#nr(e,t,n){const i=new yi;i.setDefaultCharacterSet(this.#F),this.#ir(e,i,"image",t,n)}#$i(e,t){const n=new Bi;this.#ir([e],n,"state",t)}#tr(e,t,n){const i=new yi;this.#ir([e],i,"state",t,n)}#ir(e,t,n,i,r){const o={loadtype:n,dataid:i};t.onloadstart=e=>{this.#Ji[i]={loader:t,isFirstItem:!0},this.#gi(this.onloadstart,o)(e)},t.onprogress=this.#gi(this.onprogress,o),t.onloaditem=e=>{const t={loadtype:n,dataid:i};void 0!==this.#Ji[i]&&(t.isfirstitem=this.#Ji[i].isFirstItem),this.#gi(this.onloaditem,t)(e),void 0!==this.#Ji[i]&&this.#Ji[i].isFirstItem&&(this.#Ji[i].isFirstItem=!1)},t.onload=this.#gi(this.onload,o),t.onloadend=e=>{delete this.#Ji[i],this.#gi(this.onloadend,o)(e)},t.onerror=this.#gi(this.onerror,o),t.onabort=this.#gi(this.onabort,o);try{t.load(e,r)}catch(e){return this.onerror({error:e,dataid:i}),void this.onloadend({dataid:i})}}#gi(e,t){return function(n){const i=Object.keys(t);for(let e=0;e<i.length;++e){const r=i[e];n[r]=t[r]}e(n)}}onloadstart(e){}onprogress(e){}onload(e){}onloaditem(e){}onloadend(e){}onerror(e){}onabort(e){}}function ki(e){return function(t){return Number(t).toPrecision(e)}}function Hi(e){let t="";for(let n=0;n<e;++n)0!==n&&(t+=", "),t+="{v"+n+"}";return t}function zi(e,t){let n=e;for(let e=0;e<t.length;++e)n=n.replace("{v"+e+"}",t[e]);return n}class Wi{#rr;#Nt;#or;#ar=[];#sr;#lr=[];#cr;#Oe=new Ze;constructor(e,t,n){this.#rr=e,this.#Nt=t,this.#or=n;const i=Object.keys(this.#or);for(let e=0;e<i.length;++e){const t=this.#or[i[e]];for(let e=0;e<t.length;++e){const n=t[e].event;void 0!==n&&(this.#ar.includes(n)||this.#ar.push(n))}}this.addAppListeners()}reset(){this.#lr=[],this.#cr=void 0}addItemMeta(e){let t;if(void 0!==e["00020010"])t=void 0!==e["00080018"]?e["00080018"].value[0]:e.length,this.#lr[t]=function(e,t){const n=[];let i;const r=e["00080060"];if(void 0===r)return n;i=r.value[0];const o=t[i]||t["*"];if(!o)return n;for(let t=0;t<o.length;++t){const i=JSON.parse(JSON.stringify(o[t])),r=i.tags;if(void 0!==r&&0!==r.length){const t=[];for(let n=0;n<r.length;++n)void 0!==e[r[n]]?t.push(e[r[n]].value):t.push("");void 0!==i.format&&null!==i.format||(i.format=Hi(t.length)),i.value=zi(i.format,t).trim()}n.push(i)}const a=e["00200020"];if(void 0!==a&&2===a.value.length){const e=a.value[0],t=a.value[1];n.push({pos:"cr",value:e,format:"{v0}"}),n.push({pos:"cl",value:qe(e),format:"{v0}"}),n.push({pos:"bc",value:t,format:"{v0}"}),n.push({pos:"tc",value:qe(t),format:"{v0}"})}return n}(e,this.#or);else{const n=Object.keys(e);for(let i=0;i<n.length;++i){const r=e[n[i]];if("imageUid"===n[i]){t=r.value;break}}this.#lr[t]=function(e,t){const n=[],i=t.DOM;if(!i)return n;const r=Object.keys(e);for(let t=0;t<i.length;++t){const o=JSON.parse(JSON.stringify(i[t])),a=o.tags;if(void 0!==a&&0!==a.length){const t=[];for(let n=0;n<a.length;++n)for(let i=0;i<r.length;++i)a[n]===r[i]&&t.push(e[r[i]].value);void 0!==o.format&&null!==o.format||(o.format=Hi(t.length)),o.value=zi(o.format,t).trim()}n.push(o)}return n}(e,this.#or)}this.#cr=t}#ur=e=>{e.dataid===this.#Nt&&void 0!==e.data&&void 0!==e.data.imageUid&&this.#cr!==e.data.imageUid&&(this.#cr=e.data.imageUid,this.#dr(e))};#dr=e=>{if(e.dataid!==this.#Nt)return;const t=this.#lr[this.#cr];if(void 0!==t){for(let n=0;n<t.length;++n){let i;if(void 0!==t[n].tags)"positionchange"===e.type&&(i=t[n].value);else if(void 0!==t[n].event&&t[n].event===e.type){const r=t[n].format;let o=e.value;if(void 0!==t[n].precision){let e=null;e="round"===t[n].precision?Math.round:ki(t[n].precision),o=o.map(e)}i=zi(r,o)}void 0!==i&&(t[n].value=i)}this.#Re({type:"valuechange",data:t})}else console.warn("No slice overlay data for: "+this.#cr)};isListening(){return this.#sr}addAppListeners(){this.#rr.addEventListener("positionchange",this.#ur);for(let e=0;e<this.#ar.length;++e)this.#rr.addEventListener(this.#ar[e],this.#dr);this.#sr=!0}removeAppListeners(){this.#rr.removeEventListener("positionchange",this.#ur);for(let e=0;e<this.#ar.length;++e)this.#rr.removeEventListener(this.#ar[e],this.#dr);this.#sr=!1}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re(e){this.#Oe.fireEvent(e)}}class Xi{#hr=0;getSum(){return this.#hr}add(e){this.#hr+=function(e){if(void 0===e.wheelDeltaY)return-e.deltaY;{const t=45;return e.wheelDeltaY>t?1:e.wheelDeltaY<-t?-1:-e.deltaY/60}}(e)}clear(){this.#hr=0}isTick(){return Math.abs(this.#hr)>=1}}class Yi{#rr;#Sr=new Xi;constructor(e){this.#rr=e}wheel(e){this.#Sr.add(e);const t=this.#Sr.getSum()>=0;if(!this.#Sr.isTick())return;this.#Sr.clear(),e.preventDefault();const n=ii(e),i=this.#rr.getLayerGroupByDivId(n.groupDivId),r=i.getActiveViewLayer().getViewController();let o;i.canScroll()?o=t?r.getIncrementScrollPosition():r.getDecrementScrollPosition():i.moreThanOne(3)&&(o=t?r.getIncrementPosition(3):r.getDecrementPosition(3)),void 0!==o&&i.isPositionInBounds(o)&&r.setCurrentPosition(o)}}class ji{#gr;#mr;constructor(e,t){this.#gr=e,this.#mr=t}getBegin(){return this.#gr}getEnd(){return this.#mr}equals(e){return null!==e&&this.getBegin().equals(e.getBegin())&&this.getEnd().equals(e.getEnd())}getDeltaX(){return this.getEnd().getX()-this.getBegin().getX()}getDeltaY(){return this.getEnd().getY()-this.getBegin().getY()}getLength(){return Math.sqrt(this.getDeltaX()*this.getDeltaX()+this.getDeltaY()*this.getDeltaY())}getWorldLength(e){let t=null;if(null!==e){const n=this.getDeltaX()*e.x,i=this.getDeltaY()*e.y;t=Math.sqrt(n*n+i*i)}return t}getMidpoint(){return new F((this.getBegin().getX()+this.getEnd().getX())/2,(this.getBegin().getY()+this.getEnd().getY())/2)}getSlope(){return this.getDeltaY()/this.getDeltaX()}getIntercept(){return(this.getEnd().getX()*this.getBegin().getY()-this.getBegin().getX()*this.getEnd().getY())/this.getDeltaX()}getInclination(){return 180-180*Math.atan2(this.getDeltaY(),this.getDeltaX())/Math.PI}quantify(e){const t={},n=e.get2DSpacing(),i=this.getWorldLength(n);return null!==i&&(t.length={value:i,unit:On.t("unit.mm")}),t}}function Zi(e,t){const n=e.getDeltaX(),i=e.getDeltaY(),r=t.getDeltaX(),o=t.getDeltaY(),a=n*r+i*o,s=n*o-i*r;return 360-(180-180*Math.atan2(s,a)/Math.PI)}function _i(e,t,n){let i=0,r=0,o=0,a=0;if(0!==e.getSlope()){const s=-1/e.getSlope(),l=t.getY()-s*t.getX(),c=n/(2*Math.sqrt(1+s*s));i=t.getX()-c,r=s*i+l,o=t.getX()+c,a=s*o+l}else i=t.getX(),r=t.getY()-n/2,o=t.getX(),a=t.getY()+n/2;return new ji(new F(i,r),new F(o,a))}class Ki{#rr;constructor(e){this.#rr=e}#pr=null;#fr=null;#en=null;#Dr;#an;#yr=!1;#Cr=null;setFactoryList(e){this.#pr=e}setShape(e,t,n){if(this.#en=e,this.#Dr=t,this.#an=n,this.#en){this.#vr();const e=this.#en.getParent(),t=Object.keys(this.#pr);this.#fr=null;for(let n=0;n<t.length;++n){const i=new this.#pr[t[n]];if(i.isFactoryGroup(e)){this.#fr=i;break}}if(null===this.#fr)throw new Error("Could not find a factory to update shape.");this.#Ir()}}getShape(){return this.#en}isActive(){return this.#yr}setDrawEventCallback(e){this.#Cr=e}enable(){this.#yr=!0,this.#en&&(this.#Tr(!0),this.#en.getLayer()&&this.#en.getLayer().draw())}disable(){this.#yr=!1,this.#en&&(this.#Tr(!1),this.#en.getLayer()&&this.#en.getLayer().draw())}reset(){this.#en=void 0,this.#Dr=void 0,this.#an=void 0}resetAnchors(){this.#vr(),this.#Ir(),this.#Tr(!0)}#Lr(e){this.#en&&this.#en.getParent()&&this.#en.getParent().find(".anchor").forEach(e)}#Tr(e){this.#Lr((function(t){t.visible(e)}))}setAnchorsActive(e){let t=null;t=e?e=>{this.#Pr(e)}:e=>{this.#wr(e)},this.#Lr(t)}#vr(){this.#Lr((function(e){e.remove()}))}#Ir(){if(!this.#en||!this.#en.getLayer())return;const e=this.#en.getParent(),t=this.#fr.getAnchors(this.#en,this.#rr.getStyle());for(let n=0;n<t.length;++n)this.#Pr(t[n]),e.add(t[n])}#Or(e){const t=e.getParent(),n=e.id(),i=e.x(),r=e.y();return{getParent:function(){return t},id:function(){return n},x:function(){return i},y:function(){return r}}}#Pr(e){let t=null;const n=_n(this.#en);e.on("dragstart.edit",(e=>{const n=e.target;n instanceof Fn().Shape&&(t=this.#Or(n),e.cancelBubble=!0)})),e.on("dragmove.edit",(e=>{const t=e.target;t instanceof Fn().Shape&&(function(e,t){const n=t.getParent();Vn(t,new F(-n.x(),-n.y()),new F(e.x-n.x(),e.y-n.y()))}(this.#Dr.getBaseSize(),t),void 0!==this.#fr.constrainAnchorMove&&this.#fr.constrainAnchorMove(t),this.#fr.updateAnnotationOnAnchorMove(this.#an,t),this.#fr.updateShapeGroupOnAnchorMove(this.#an,t,this.#rr.getStyle()),t.getLayer()?t.getLayer().draw():c.warn("No layer to draw the anchor!"),e.cancelBubble=!0)})),e.on("dragend.edit",(e=>{const i=e.target;if(!(i instanceof Fn().Shape))return;const r=this.#Or(i),o=new $n(n,this.#fr,t,r,this.#an,this.#Dr,this.#rr.getStyle());o.onExecute=this.#Cr,o.onUndo=this.#Cr,o.execute(),this.#rr.addToUndoStack(o),t=r,e.cancelBubble=!0})),e.on("mousedown touchstart",(e=>{e.target.moveToTop()})),e.on("mouseover.edit",(e=>{const t=e.target;t instanceof Fn().Shape&&(t.stroke("#ddd"),t.getLayer()?t.getLayer().draw():c.warn("No layer to draw the anchor!"))})),e.on("mouseout.edit",(e=>{const t=e.target;t instanceof Fn().Shape&&(t.stroke("#999"),t.getLayer()?t.getLayer().draw():c.warn("No layer to draw the anchor!"))}))}#wr(e){e.off("dragstart.edit"),e.off("dragmove.edit"),e.off("dragend.edit"),e.off("mousedown touchstart"),e.off("mouseover.edit"),e.off("mouseout.edit")}}class Ji{#Ar;constructor(){this.createTrashIcon()}createTrashIcon(){this.#Ar=new(Fn().Group);const e=new(Fn().Line)({points:[-10,-10,10,10],stroke:"red"}),t=new(Fn().Line)({points:[10,-10,-10,10],stroke:"red"});this.#Ar.width(20),this.#Ar.height(20),this.#Ar.add(e),this.#Ar.add(t)}activate(e){const t=e.getKonvaStage(),n=t.scale(),i=e.getKonvaLayer(),r={x:1/n.x,y:1/n.y};this.#Ar.x(t.offset().x+t.width()/(2*n.x)),this.#Ar.y(t.offset().y+t.height()/(15*n.y)),this.#Ar.scale(r),i.add(this.#Ar),i.draw()}changeChildrenColourOnTrashHover(e,t,n){if(this.isOverTrash(e))return this.changeGroupChildrenColour(this.#Ar,"orange"),void this.changeGroupChildrenColour(t,"red");this.changeGroupChildrenColour(this.#Ar,"red"),this.changeGroupChildrenColour(t,n)}changeGroupChildrenColour(e,t){e.getChildren().forEach((function(e){e instanceof Fn().Shape&&void 0!==e.stroke&&e.stroke(t)}))}remove(){this.#Ar.remove()}isOverTrash(e){const t=this.#Ar.width()*Math.abs(this.#Ar.scaleX())/2,n=this.#Ar.height()*Math.abs(this.#Ar.scaleY())/2;return Math.abs(e.x-this.#Ar.x())<t&&Math.abs(e.y-this.#Ar.y())<n}}class $i{#br=[];getPoint(e){return this.#br[e]}getLength(){return this.#br.length}addPoint(e){this.#br.push(e)}addPoints(e){this.#br=this.#br.concat(e)}}class er{getGroupName(){return"roi-group"}getNPoints(){}getTimeout(){return 100}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new $i;i.addPoints(e);const r=[];for(let e=0;e<i.getLength();++e)r.push(i.getPoint(e).getX()),r.push(i.getPoint(e).getY());const o=new(Fn().Line)({points:r,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape",closed:!0}),a=new(Fn().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),name:"text"});let s="";if(void 0!==n){const e=n.getModality();s=void 0!==bn.labelText.roi[e]?bn.labelText.roi[e]:bn.labelText.roi["*"]}a.setText(s),a.meta={textExpr:s,quantification:{}};const l=new(Fn().Label)({x:i.getPoint(0).getX(),y:i.getPoint(0).getY()+t.scale(10),scale:t.applyZoomScale(1),visible:0!==s.length,name:"label"});l.add(a),l.add(new(Fn().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const c=new(Fn().Group);return c.name(this.getGroupName()),c.add(l),c.add(o),c.visible(!0),c}getAnchors(e,t){const n=e.points(),i=[];for(let r=0;r<n.length;r+=2){const o=n[r]+e.x(),a=n[r+1]+e.y(),s=r.toString();i.push(Qn(o,a,s,t))}return i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof Fn().Line))return;const o=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(o instanceof Fn().Label))return;const a=i.getChildren((function(t){return t.id()===e.id()}))[0];a.x(e.x()),a.y(e.y());const s=r.points(),l=parseInt(e.id(),10);s[l]=e.x()-r.x(),s[l+1]=e.y()-r.y(),r.points(s);const c=o.getText(),u=c.meta;c.setText(u.textExpr);const d={x:s[0]+r.x(),y:s[1]+r.y()+t.scale(10)};o.position(d)}}var tr=o(324),nr=o.n(tr);class ir{constructor(e,t){this.pointArray=e?e.slice():[],this.controlPointIndexArray=t?t.slice():[]}getPoint(e){return this.pointArray[e]}isControlPoint(e){const t=this.pointArray.indexOf(e);if(-1!==t)return-1!==this.controlPointIndexArray.indexOf(t);throw new Error("Error: isControlPoint called with not in list point.")}getLength(){return this.pointArray.length}addPoint(e){this.pointArray.push(e)}addControlPoint(e){const t=this.pointArray.indexOf(e);if(-1===t)throw new Error("Cannot mark a non registered point as control point.");this.controlPointIndexArray.push(t)}addPoints(e){this.pointArray=this.pointArray.concat(e)}appenPath(e){const t=this.pointArray.length;this.pointArray=this.pointArray.concat(e.pointArray);const n=[];for(let i=0;i<e.controlPointIndexArray.length;++i)n[i]=e.controlPointIndexArray[i]+t;this.controlPointIndexArray=this.controlPointIndexArray.concat(n)}}class rr{constructor(e,t){this.bucketCount=1<<e,this.mask=this.bucketCount-1,this.size=0,this.loc=0,this.cost=void 0!==t?t:function(e){return e},this.buckets=this.buildArray(this.bucketCount)}push(e){const t=this.getBucket(e);e.next=this.buckets[t],this.buckets[t]=e,this.size++}pop(){if(0===this.size)throw new Error("Cannot pop, bucketQueue is empty.");for(;null===this.buckets[this.loc];)this.loc=(this.loc+1)%this.bucketCount;const e=this.buckets[this.loc];return this.buckets[this.loc]=e.next,e.next=null,this.size--,e}remove(e){if(!e)return!1;const t=this.getBucket(e);let n=this.buckets[t];for(;null!==n&&(null===n.next||e.x!==n.next.x||e.y!==n.next.y);)n=n.next;return null!==n&&(n.next=n.next.next,this.size--,!0)}isEmpty(){return 0===this.size}getBucket(e){return this.cost(e)&this.mask}buildArray(e){const t=new Array(e);for(let e=0;e<t.length;e++)t[e]=null;return t}}const or=2/(3*Math.PI);function ar(e,t,n,i,r){const o=e[i][n],a=t[i][n];let s=Math.sqrt(o*o+a*a);s=Math.max(s,1e-100),r.x=o/s,r.y=a/s}class sr{constructor(){this.width=-1,this.height=-1,this.curPoint=null,this.searchGranBits=8,this.searchGran=1<<this.searchGranBits,this.pointsPerPost=500,this.greyscale=null,this.laplace=null,this.gradient=null,this.gradX=null,this.gradY=null,this.parents=null,this.working=!1,this.trained=!1,this.trainingPoints=null,this.edgeWidth=2,this.trainingLength=32,this.edgeGran=256,this.edgeTraining=null,this.gradPointsNeeded=32,this.gradGran=1024,this.gradTraining=null,this.insideGran=256,this.insideTraining=null,this.outsideGran=256,this.outsideTraining=null}getTrainingIdx(e,t){return Math.round((e-1)*t)}getTrainedEdge(e){return this.edgeTraining[this.getTrainingIdx(this.edgeGran,e)]}getTrainedGrad(e){return this.gradTraining[this.getTrainingIdx(this.gradGran,e)]}getTrainedInside(e){return this.insideTraining[this.getTrainingIdx(this.insideGran,e)]}getTrainedOutside(e){return this.outsideTraining[this.getTrainingIdx(this.outsideGran,e)]}setWorking(e){this.working=e}setDimensions(e,t){this.width=e,this.height=t}setData(e){if(-1===this.width||-1===this.height)throw new Error("Dimensions have not been set.");this.greyscale=function(e,t,n){const i={data:[]};for(let r=0;r<n;r++){i.data[r]=[];for(let n=0;n<t;n++){const o=4*(r*t+n);i.data[r][n]=(e[o]+e[o+1]+e[o+2])/765}}return i.dx=function(e,t){return e+1===this.data[t].length&&e--,this.data[t][e+1]-this.data[t][e]},i.dy=function(e,t){return t+1===this.data.length&&t--,this.data[t][e]-this.data[t+1][e]},i.gradMagnitude=function(e,t){const n=this.dx(e,t),i=this.dy(e,t);return Math.sqrt(n*n+i*i)},i.laplace=function(e,t){let n=-16*this.data[t][e];return n+=this.data[t-2][e],n+=this.data[t-1][e-1]+2*this.data[t-1][e]+this.data[t-1][e+1],n+=this.data[t][e-2]+2*this.data[t][e-1]+2*this.data[t][e+1]+this.data[t][e+2],n+=this.data[t+1][e-1]+2*this.data[t+1][e]+this.data[t+1][e+1],n+=this.data[t+2][e],n},i}(e,this.width,this.height),this.laplace=function(e){const t=[];t[0]=[],t[1]=[];for(let n=1;n<e.data.length;n++)t[0][n]=1,t[1][n]=1;for(let n=2;n<e.data.length-2;n++){t[n]=[],t[n][0]=1,t[n][1]=1;for(let i=2;i<e.data[n].length-2;i++)t[n][i]=e.laplace(i,n)>.33?0:1;t[n][e.data[n].length-2]=1,t[n][e.data[n].length-1]=1}t[e.data.length-2]=[],t[e.data.length-1]=[];for(let n=1;n<e.data.length;n++)t[e.data.length-2][n]=1,t[e.data.length-1][n]=1;return t}(this.greyscale),this.gradient=function(e){const t=[];let n=0,i=0,r=0;for(r=0;r<e.data.length-1;r++){for(t[r]=[],i=0;i<e.data[r].length-1;i++)t[r][i]=e.gradMagnitude(i,r),n=Math.max(t[r][i],n);t[r][e.data[r].length-1]=t[r][e.data.length-2]}t[e.data.length-1]=[];for(let n=0;n<t[0].length;n++)t[e.data.length-1][n]=t[e.data.length-2][n];for(r=0;r<t.length;r++)for(i=0;i<t[r].length;i++)t[r][i]=1-t[r][i]/n;return t}(this.greyscale),this.gradX=function(e){const t=[];for(let n=0;n<e.data.length;n++){t[n]=[];for(let i=0;i<e.data[n].length-1;i++)t[n][i]=e.dx(i,n);t[n][e.data[n].length-1]=t[n][e.data[n].length-2]}return t}(this.greyscale),this.gradY=function(e){const t=[];for(let n=0;n<e.data.length-1;n++){t[n]=[];for(let i=0;i<e.data[n].length;i++)t[n][i]=e.dy(i,n)}t[e.data.length-1]=[];for(let n=0;n<e.data[0].length;n++)t[e.data.length-1][n]=t[e.data.length-2][n];return t}(this.greyscale);const t=function(e,t,n,i){const r={inside:[],outside:[]},o={x:-1,y:-1};for(let a=0;a<t.length;a++){r.inside[a]=[],r.outside[a]=[];for(let s=0;s<t[a].length;s++){ar(t,n,s,a,o);let l=Math.round(s+e*o.y),c=Math.round(a-e*o.x),u=Math.round(s-e*o.y),d=Math.round(a+e*o.x);l=Math.max(Math.min(l,t[a].length-1),0),u=Math.max(Math.min(u,t[a].length-1),0),c=Math.max(Math.min(c,t.length-1),0),d=Math.max(Math.min(d,t.length-1),0),r.inside[a][s]=i.data[c][l],r.outside[a][s]=i.data[d][u]}}return r}(this.edgeWidth,this.gradX,this.gradY,this.greyscale);this.inside=t.inside,this.outside=t.outside,this.edgeTraining=[],this.gradTraining=[],this.insideTraining=[],this.outsideTraining=[]}findTrainingPoints(e){const t=[];if(null!==this.parents)for(let n=0;n<this.trainingLength&&e;n++)t.push(e),e=this.parents[e.y][e.x];return t}resetTraining(){this.trained=!1}doTraining(e){if(this.trainingPoints=this.findTrainingPoints(e),this.trainingPoints.length<8)return;const t=[];this.calculateTraining(t,this.edgeGran,this.greyscale,this.edgeTraining),this.calculateTraining(t,this.gradGran,this.gradient,this.gradTraining),this.calculateTraining(t,this.insideGran,this.inside,this.insideTraining),this.calculateTraining(t,this.outsideGran,this.outside,this.outsideTraining),this.trainingPoints.length<this.gradPointsNeeded&&this.addInStaticGrad(this.trainingPoints.length,this.gradPointsNeeded),this.trained=!0}calculateTraining(e,t,n,i){let r=0;for(e.length=t,r=0;r<t;r++)e[r]=0;let o=1;for(r=0;r<this.trainingPoints.length;r++){const i=this.trainingPoints[r],a=this.getTrainingIdx(t,n[i.y][i.x]);e[a]+=1,o=Math.max(o,e[a])}for(r=0;r<t;r++)e[r]=1-e[r]/o;!function(e,t){t[0]=.4*e[0]+.5*e[1]+.1*e[1],t[1]=.25*e[0]+.4*e[1]+.25*e[2]+.1*e[3];for(let n=2;n<e.length-2;n++)t[n]=.05*e[n-2]+.25*e[n-1]+.4*e[n]+.25*e[n+1]+.05*e[n+2];const n=e.length;t[n-2]=.25*e[n-1]+.4*e[n-2]+.25*e[n-3]+.1*e[n-4],t[n-1]=.4*e[n-1]+.5*e[n-2]+.1*e[n-3]}(e,i)}addInStaticGrad(e,t){for(let n=0;n<this.gradGran;n++)this.gradTraining[n]=Math.min(this.gradTraining[n],1-n*(t-e)/(t*this.gradGran))}gradDirection(e,t,n,i){return function(e,t,n,i,r,o){const a={x:-1,y:-1},s={x:-1,y:-1};ar(e,t,n,i,a),ar(e,t,r,o,s);let l=a.y*(r-n)-a.x*(o-i),c=s.y*(r-n)-s.x*(o-i);return l<0&&(l=-l,c=-c),n!==r&&i!==o&&(l*=Math.SQRT1_2,c*=Math.SQRT1_2),or*(Math.acos(l)+Math.acos(c))}(this.gradX,this.gradY,e,t,n,i)}dist(e,t,n,i){let r=this.gradient[i][n];e!==n&&t!==i||(r*=Math.SQRT1_2);const o=this.laplace[i][n],a=this.gradDirection(e,t,n,i);return this.trained?.3*this.getTrainedGrad(r)+.3*o+.1*(a+this.getTrainedEdge(this.greyscale.data[t][e])+this.getTrainedInside(this.inside[t][e])+this.getTrainedOutside(this.outside[t][e])):.43*r+.43*o+.11*a}adj(e){const t=[],n=Math.max(e.x-1,0),i=Math.max(e.y-1,0),r=Math.min(e.x+1,this.greyscale.data[0].length-1),o=Math.min(e.y+1,this.greyscale.data.length-1);let a=0;for(let s=i;s<=o;s++)for(let i=n;i<=r;i++)i===e.x&&s===e.y||(t[a++]={x:i,y:s});return t}#xr=e=>Math.round(this.searchGran*this.cost[e.y][e.x]);setPoint(e){this.setWorking(!0),this.curPoint=e;let t=0,n=0;for(this.visited=[],n=0;n<this.height;n++)for(this.visited[n]=[],t=0;t<this.width;t++)this.visited[n][t]=!1;for(this.parents=[],n=0;n<this.height;n++)this.parents[n]=[];for(this.cost=[],n=0;n<this.height;n++)for(this.cost[n]=[],t=0;t<this.width;t++)this.cost[n][t]=Number.MAX_VALUE;this.cost[e.y][e.x]=0,this.pq=new rr(this.searchGranBits,this.#xr),this.pq.push(e)}doWork(){if(!this.working)return;this.timeout=null;let e=0;const t=[];for(;!this.pq.isEmpty()&&e<this.pointsPerPost;){const n=this.pq.pop();t.push(n),t.push(this.parents[n.y][n.x]),this.visited[n.y][n.x]=!0;const i=this.adj(n);for(let e=0;e<i.length;e++){const t=i[e],r=this.cost[n.y][n.x]+this.dist(n.x,n.y,t.x,t.y);r<this.cost[t.y][t.x]&&(this.cost[t.y][t.x]!==Number.MAX_VALUE&&this.pq.remove(t),this.cost[t.y][t.x]=r,this.parents[t.y][t.x]=n,this.pq.push(t))}e++}return t}}class lr{#$e;#Rr;#Fr;constructor(e,t,n){this.#$e=e,this.#Rr=t,this.#Fr=n}getCenter(){return this.#$e}getA(){return this.#Rr}getB(){return this.#Fr}equals(e){return null!==e&&this.getCenter().equals(e.getCenter())&&this.getA()===e.getA()&&this.getB()===e.getB()}getSurface(){return Math.PI*this.getA()*this.getB()}getWorldSurface(e){return function(e,t,n){let i=null;return null!==t&&null!==n&&(i=e*t*n),i}(this.getSurface(),e.x,e.y)}getRound(){const e=this.getCenter().getX(),t=this.getCenter().getY(),n=this.getA(),i=this.getB(),r=n/i,o=Math.pow(i,2),a=t+i,s=[];for(let n=t-i;n<a;++n){const i=o-Math.pow(n-t,2);if(Math.abs(i)<1e-7)continue;const a=r*Math.sqrt(i);a<.5||s.push([[Math.round(e-a),Math.round(n)],[Math.round(e+a),Math.round(n)]])}return s}quantify(e,t){const n={},i=e.get2DSpacing();n.a={value:this.getA()*i.x,unit:On.t("unit.mm")},n.b={value:this.getB()*i.y,unit:On.t("unit.mm")};const r=this.getWorldSurface(i);if(null!==r&&(n.surface={value:r/100,unit:On.t("unit.cm2")}),e.canQuantifyImage()){const i=this.getRound();if(0!==i.length){const r=e.getImageVariableRegionValues(i),o=e.getPixelUnit(),a=it(r,t);n.min={value:a.min,unit:o},n.max={value:a.max,unit:o},n.mean={value:a.mean,unit:o},n.stdDev={value:a.stdDev,unit:o},void 0!==a.median&&(n.median={value:a.median,unit:o}),void 0!==a.p25&&(n.p25={value:a.p25,unit:o}),void 0!==a.p75&&(n.p75={value:a.p75,unit:o})}}return n}}function cr(e,t,n){const i=e.getValues(),r=i.slice(),o=[],a=t[0],l=t[1],c=a/l,u=Math.pow(l,2),d=n[0],h=n[1];for(let e=0;e<l;++e){const t=Math.round(c*Math.sqrt(u-Math.pow(e,2))),n=i[h]+e,a=i[h]-e;for(let e=0;e<t;++e){const t=i[d]+e,l=i[d]-e;r[d]=t,r[h]=n,o.push(new s(r.slice())),a!==n&&(r[h]=a,o.push(new s(r.slice()))),l!==t&&(r[d]=l,r[h]=n,o.push(new s(r.slice())),a!==n&&(r[h]=a,o.push(new s(r.slice()))))}}return o}class ur{#gr;#mr;constructor(e,t){this.#gr=new F(Math.min(e.getX(),t.getX()),Math.min(e.getY(),t.getY())),this.#mr=new F(Math.max(e.getX(),t.getX()),Math.max(e.getY(),t.getY()))}getBegin(){return this.#gr}getEnd(){return this.#mr}equals(e){return null!==e&&this.getBegin().equals(e.getBegin())&&this.getEnd().equals(e.getEnd())}getSurface(){const e=this.getBegin(),t=this.getEnd();return Math.abs(t.getX()-e.getX())*Math.abs(t.getY()-e.getY())}getWorldSurface(e){return function(e,t,n){let i=null;return null!==t&&null!==n&&(i=e*t*n),i}(this.getSurface(),e.x,e.y)}getRealWidth(){return this.getEnd().getX()-this.getBegin().getX()}getRealHeight(){return this.getEnd().getY()-this.getBegin().getY()}getWidth(){return Math.abs(this.getRealWidth())}getHeight(){return Math.abs(this.getRealHeight())}getRound(){return{min:new F(Math.round(this.getBegin().getX()),Math.round(this.getBegin().getY())),max:new F(Math.round(this.getEnd().getX()),Math.round(this.getEnd().getY()))}}quantify(e,t){const n={},i=e.get2DSpacing();n.width={value:this.getWidth()*i.x,unit:On.t("unit.mm")},n.height={value:this.getHeight()*i.y,unit:On.t("unit.mm")};const r=this.getWorldSurface(i);if(null!==r&&(n.surface={value:r/100,unit:On.t("unit.cm2")}),e.canQuantifyImage()){const i=this.getRound(),r=e.getImageRegionValues(i.min,i.max),o=e.getPixelUnit(),a=it(r,t);n.min={value:a.min,unit:o},n.max={value:a.max,unit:o},n.mean={value:a.mean,unit:o},n.stdDev={value:a.stdDev,unit:o},void 0!==a.median&&(n.median={value:a.median,unit:o}),void 0!==a.p25&&(n.p25={value:a.p25,unit:o}),void 0!==a.p75&&(n.p75={value:a.p75,unit:o})}return n}}class dr{#Er=0;#qr=0;getMin(){return this.#Er}setMin(e){this.#Er=e}getMax(){return this.#qr}setMax(e){this.#qr=e}getName(){return"Threshold"}#Ur=null;setOriginalImage(e){this.#Ur=e}getOriginalImage(){return this.#Ur}update(){const e=this.getOriginalImage(),t=e.getDataRange().min;return e.transform((e=>e<this.getMin()||e>this.getMax()?t:e))}}class hr{getName(){return"Sharpen"}#Ur=null;setOriginalImage(e){this.#Ur=e}getOriginalImage(){return this.#Ur}update(){return this.getOriginalImage().convolute2D([0,-1,0,-1,5,-1,0,-1,0])}}class Sr{getName(){return"Sobel"}#Ur=null;setOriginalImage(e){this.#Ur=e}getOriginalImage(){return this.#Ur}update(){const e=this.getOriginalImage(),t=e.convolute2D([1,0,-1,2,0,-2,1,0,-1]),n=e.convolute2D([1,2,1,0,0,0,-1,-2,-1]);return t.compose(n,(function(e,t){return Math.sqrt(e*e+t*t)}))}}class gr{#Mr;#Nt;#rr;constructor(e,t,n){this.#Mr=e,this.#Nt=t,this.#rr=n}getName(){return"Filter-"+this.#Mr.getName()}execute(){this.#rr.setImage(this.#Nt,this.#Mr.update()),this.#rr.render(this.#Nt);const e={type:"filterrun",id:this.getName(),dataId:this.#Nt};this.onExecute(e)}undo(){this.#rr.setImage(this.#Nt,this.#Mr.getOriginalImage()),this.#rr.render(this.#Nt);const e={type:"filterundo",id:this.getName(),dataid:this.#Nt};this.onUndo(e)}onExecute(e){}onUndo(e){}}const mr={},pr={WindowLevel:class{#rr;#Qr=!1;#Vr;#Nr;constructor(e){this.#rr=e,this.#Nr=new Yi(e)}#Br(e){this.#Qr=!0,this.#Vr=e}#Gr(e,t){if(!this.#Qr)return;const n=this.#rr.getLayerGroupByDivId(t).getActiveViewLayer().getViewController(),i=e.getX()-this.#Vr.getX(),r=this.#Vr.getY()-e.getY(),o=n.getImageRescaledDataRange(),a=.01*(o.max-o.min),s=n.getWindowLevel().center,l=n.getWindowLevel().width,c=s+Math.round(r*a);let d=l+Math.round(i*a);var h;d=(h=d)<1?1:h;const S=new u(c,d);n.setWindowLevel(S),this.#Vr=e}#kr(){this.#Qr&&(this.#Qr=!1)}mousedown=e=>{const t=Xn(e);this.#Br(t)};mousemove=e=>{const t=Xn(e),n=ii(e);this.#Gr(t,n.groupDivId)};mouseup=e=>{this.#kr()};mouseout=e=>{this.#kr()};touchstart=e=>{const t=Wn(e);this.#Br(t[0])};touchmove=e=>{const t=Wn(e),n=ii(e);this.#Gr(t[0],n.groupDivId)};touchend=e=>{this.#kr()};dblclick=e=>{const t=ii(e),n=Xn(e),i=this.#rr.getLayerGroupByDivId(t.groupDivId).getActiveViewLayer(),r=i.displayToPlaneIndex(n),o=i.getViewController(),a=this.#rr.getImage(i.getDataId()),s=new u(a.getRescaledValueAtIndex(o.getCurrentIndex().getWithNew2D(r.get(0),r.get(1))),o.getWindowLevel().width);o.setWindowLevel(s)};wheel=e=>{this.#Nr.wheel(e)};keydown=e=>{e.context="WindowLevel",this.#rr.onKeydown(e)};activate(e){}init(){}setFeatures(e){}},Scroll:class{#rr;#Qr=!1;#Vr;#Nr;#Hr;#zr=!1;#Wr;constructor(e){this.#rr=e,this.#Nr=new Yi(e)}#Br(e,t){this.#Xr();const n=this.#rr.getLayerGroupByDivId(t).getActiveViewLayer(),i=n.getViewController();i.isPlaying()&&i.stop(),this.#Qr=!0,this.#Vr=e;const r=n.displayToPlanePos(e),o=i.getPositionFromPlanePoint(r);i.setCurrentPosition(o)}#Gr(e,t){if(!this.#Qr)return void(this.#zr&&this.#Yr(e,t));const n=this.#rr.getLayerGroupByDivId(t),i=n.getActiveViewLayer().getViewController();let r;const o=e.getY()-this.#Vr.getY(),a=Math.abs(o)>15;a&&n.canScroll()&&(r=o>0?i.getDecrementScrollPosition():i.getIncrementScrollPosition());const s=e.getX()-this.#Vr.getX(),l=Math.abs(s)>15;l&&n.moreThanOne(3)&&(r=s>0?i.getIncrementPosition(3):i.getDecrementPosition(3)),void 0!==r&&n.isPositionInBounds(r)&&i.setCurrentPosition(r),(l||a)&&(this.#Vr=e)}#kr(){this.#Qr&&(this.#Qr=!1)}mousedown=e=>{const t=Xn(e),n=ii(e);this.#Br(t,n.groupDivId)};mousemove=e=>{const t=Xn(e),n=ii(e);this.#Gr(t,n.groupDivId)};mouseup=e=>{this.#kr()};mouseout=e=>{this.#kr(),this.#Xr()};touchstart=e=>{this.#Hr=setTimeout((()=>{this.dblclick(e)}),500);const t=Wn(e),n=ii(e);this.#Br(t[0],n.groupDivId)};touchmove=e=>{null!==this.#Hr&&(clearTimeout(this.#Hr),this.#Hr=null);const t=Wn(e),n=ii(e);this.#Gr(t[0],n.groupDivId)};touchend=e=>{null!==this.#Hr&&(clearTimeout(this.#Hr),this.#Hr=null),this.#kr()};wheel=e=>{this.#Nr.wheel(e)};keydown=e=>{e.context="Scroll",this.#rr.onKeydown(e)};dblclick=e=>{const t=ii(e);this.#rr.getLayerGroupByDivId(t.groupDivId).getActiveViewLayer().getViewController().play()};#Yr(e,t){const n=this.#rr.getLayerGroupByDivId(t);this.#Wr=t,n.showTooltip(e)}#Xr(){void 0!==this.#Wr&&(this.#rr.getLayerGroupByDivId(this.#Wr).removeTooltipDiv(),this.#Wr=void 0)}activate(e){e||this.#Xr()}setFeatures(e){void 0!==e.displayTooltip&&(this.#zr=e.displayTooltip)}init(){}},ZoomAndPan:class{#rr;#Qr=!1;#Vr;#jr;#Zr;#_r;constructor(e){this.#rr=e}#Br(e){this.#Qr=!0,this.#Vr=e,this.#jr=!1}#Kr=e=>{this.#Qr=!0,this.#Vr=e[0],this.#jr=!1,this.#Zr=new ji(e[0],e[1]),this.#_r=this.#Zr.getMidpoint()};#Gr(e,t){if(!this.#Qr)return;this.#jr=!0;const n=e.getX()-this.#Vr.getX(),i=e.getY()-this.#Vr.getY(),r=this.#rr.getLayerGroupByDivId(t),o=r.getActiveViewLayer(),a=o.getViewController(),s=o.displayToPlaneScale(new F(n,i)),l=a.getOffset3DFromPlaneOffset({x:s.getX(),y:s.getY()});r.addTranslation({x:l.getX(),y:l.getY(),z:l.getZ()}),r.draw(),this.#Vr=e}#Jr=(e,t)=>{if(!this.#Qr)return;this.#jr=!0;const n=new ji(e[0],e[1]).getLength()/this.#Zr.getLength(),i=this.#rr.getLayerGroupByDivId(t),r=i.getActiveViewLayer(),o=r.getViewController();if(1===n){const t=e[0].getY()-this.#Vr.getY();if(Math.abs(t)<15)return;if(i.canScroll()){let e;e=t>0?o.getIncrementScrollPosition():o.getDecrementScrollPosition(),void 0!==e&&i.isPositionInBounds(e)&&o.setCurrentPosition(e)}}else{const e=(n-1)/10;if(Math.abs(e)%.1<=.05&&void 0!==this.#_r){const t=r.displayToMainPlanePos(this.#_r),n=o.getPlanePositionFromPlanePoint(t);i.addScale(e,n),i.draw()}}};#$r(e,t){const n=this.#rr.getLayerGroupByDivId(t).getActiveViewLayer(),i=n.getViewController(),r=n.displayToPlanePos(e),o=i.getPositionFromPlanePoint(r);i.setCurrentPosition(o)}#kr(){this.#Qr&&(this.#Qr=!1)}mousedown=e=>{const t=Xn(e);this.#Br(t)};mousemove=e=>{const t=Xn(e),n=ii(e);this.#Gr(t,n.groupDivId)};mouseup=e=>{if(!this.#jr){const t=Xn(e),n=ii(e);this.#$r(t,n.groupDivId)}this.#kr()};mouseout=e=>{this.#kr()};touchstart=e=>{const t=Wn(e);1===t.length?this.#Br(t[0]):2===t.length&&this.#Kr(t)};touchmove=e=>{const t=Wn(e),n=ii(e);1===t.length?this.#Gr(t[0],n.groupDivId):2===t.length&&this.#Jr(t,n.groupDivId)};touchend=e=>{if(!this.#jr){const t=Xn(e),n=ii(e);this.#$r(t,n.groupDivId)}this.#kr()};wheel=e=>{e.preventDefault();const t=-e.deltaY/500,n=ii(e),i=Xn(e),r=this.#rr.getLayerGroupByDivId(n.groupDivId),o=r.getActiveViewLayer(),a=o.getViewController(),s=o.displayToMainPlanePos(i),l=a.getPlanePositionFromPlanePoint(s);r.addScale(t,l),r.draw()};keydown=e=>{e.context="ZoomAndPan",this.#rr.onKeydown(e)};activate(e){}init(){}setFeatures(e){}},Opacity:class{#rr;#Qr=!1;#Vr;#Nr;constructor(e){this.#rr=e,this.#Nr=new Yi(e)}#Br(e){this.#Qr=!0,this.#Vr=e}#Gr(e,t){if(!this.#Qr)return;const n=e.getX()-this.#Vr.getX();if(Math.abs(n)>15){const i=this.#rr.getLayerGroupByDivId(t).getActiveViewLayer(),r=i.getOpacity();i.setOpacity(r+n/200),i.draw(),this.#Vr=e}}#kr(){this.#Qr&&(this.#Qr=!1)}mousedown=e=>{const t=Xn(e);this.#Br(t)};mousemove=e=>{const t=Xn(e),n=ii(e);this.#Gr(t,n.groupDivId)};mouseup=e=>{this.#kr()};mouseout=e=>{this.#kr()};touchstart=e=>{const t=Wn(e);this.#Br(t[0])};touchmove=e=>{const t=Wn(e),n=ii(e);this.#Gr(t[0],n.groupDivId)};touchend=e=>{this.#kr()};wheel=e=>{this.#Nr.wheel(e)};keydown=e=>{e.context="Opacity",this.#rr.onKeydown(e)};activate(e){}init(){}setFeatures(e){}},Draw:class{#rr;#Nr;#eo;#Ar;#sn;#Rn=[];constructor(e){this.#rr=e,this.#Nr=new Yi(e),this.#eo=new Ki(e),this.#eo.setDrawEventCallback(this.#Re),this.#sn=e.getStyle(),this.#Ar=new Ji}#to=!1;#pr=null;#fr=null;#no=null;#io;#br=[];#ro=null;#oo;#ao;#so="pointer";#lo=!0;#co=!0;#H={};#uo=!1;#do(e,t){const n=this.#rr.getLayerGroupByDivId(t),i=n.getActiveDrawLayer(),r=i.getKonvaStage(),o=r.getIntersection({x:e.getX(),y:e.getY()});this.#sn.setZoomScale(r.scale()),o?this.#ho(n,i,o):this.#So(n,e)}#So(e,t){this.#eo.disable(),this.#eo.reset(),this.#go();const n=e.getActiveViewLayer();this.#ro=n.displayToPlanePos(t),this.#br.push(this.#ro)}#go(){this.#to=!0,this.#fr=new this.#pr[this.#io],this.#br=[]}#mo(){this.#to=!1,this.#br=[]}#ho(e,t,n){const i=n.getParent(),r=i.find(".shape")[0];if(r&&r instanceof Fn().Shape&&r!==this.#eo.getShape()){this.#eo.disable();const n=e.getActiveDrawLayer().getDrawController();this.#eo.setShape(r,t,n.getAnnotation(i.id())),this.#eo.enable()}}#po(e,t){const n=this.#rr.getLayerGroupByDivId(t),i=n.getActiveViewLayer().displayToPlanePos(e);(Math.abs(i.getX()-this.#ro.getX())>0||Math.abs(i.getY()-this.#ro.getY())>0)&&(this.#uo&&this.#br.pop(),this.#ro=i,this.#uo=!0,this.#br.push(this.#ro),this.#fo(this.#br,n))}#Do(e){if(0!==this.#br.length){if(this.#br.length===this.#fr.getNPoints()){const t=this.#rr.getLayerGroupByDivId(e);this.#yo(this.#br,t),this.#mo()}this.#uo=!1}else c.warn("Draw mouseup but no points...")}mousedown=e=>{if(this.#to)return;const t=Xn(e),n=ii(e);this.#do(t,n.groupDivId)};mousemove=e=>{if(!this.#to)return;const t=Xn(e),n=ii(e);this.#po(t,n.groupDivId)};mouseup=e=>{if(!this.#to)return;const t=ii(e);this.#Do(t.groupDivId)};dblclick=e=>{if(void 0!==this.#fr.getNPoints())return;if(!this.#to)return;if(0===this.#br.length)return void c.warn("Draw dblclick but no points...");const t=ii(e),n=this.#rr.getLayerGroupByDivId(t.groupDivId);this.#yo(this.#br,n),this.#mo()};mouseout=e=>{if(!this.#to)return;const t=ii(e);this.#Do(t.groupDivId)};touchstart=e=>{if(this.#to)return;const t=Wn(e),n=ii(e);this.#do(t[0],n.groupDivId)};touchmove=e=>{if(!this.#to)return;const t=ii(e),n=Wn(e),i=this.#rr.getLayerGroupByDivId(t.groupDivId),r=i.getActiveViewLayer().displayToPlanePos(n[0]);(Math.abs(r.getX()-this.#ro.getX())>0||Math.abs(r.getY()-this.#ro.getY())>0)&&(1!==this.#br.length&&this.#br.pop(),this.#ro=r,this.#br.push(this.#ro),this.#br.length<this.#fr.getNPoints()&&(clearTimeout(this.timer),this.timer=setTimeout((()=>{this.#br.push(this.#ro)}),this.#fr.getTimeout())),this.#fo(this.#br,i))};touchend=e=>{this.dblclick(e)};wheel=e=>{this.#lo&&this.#Nr.wheel(e)};keydown=e=>{if(this.#to||(e.context="Draw",this.#rr.onKeydown(e)),("Delete"===e.key||"Backspace"===e.key)&&this.#eo.isActive()){const e=this.#eo.getShape().getParent();if(!(e instanceof Fn().Group))return;const t=e.getChildren(qn)[0];if(!(t instanceof Fn().Shape))return;const n=this.#rr.getActiveLayerGroup().getActiveDrawLayer();this.#Co(n,e,t)}if("Escape"===e.key&&null!==this.#no){const e=this.#no.getLayer();this.#no.destroy(),this.#no=null,this.#mo(),e.draw()}};#fo(e,t){this.#no&&(this.#no.destroy(),this.#no=null);const n=t.getActiveDrawLayer().getKonvaLayer(),i=t.getActiveViewLayer(),r=i.getViewController();if(this.#co){const e=["#ffff80","#ff80ff","#80ffff","#80ff80","8080ff","ff8080"],t=i.getId(),n=t.substring(t.length-1),r=e[parseInt(n,10)/2];void 0!==r&&this.#sn.setLineColour(r)}const o=new Bn(r);o.colour=this.#sn.getLineColour(),this.#fr.setAnnotationMathShape(o,e),this.#no=this.#fr.createShapeGroup(o,this.#sn),this.#no.getChildren(qn)[0].listening(!1),n.listening(!1),n.add(this.#no),n.draw()}#yo(e,t){this.#no&&(this.#no.destroy(),this.#no=null);const n=t.getActiveDrawLayer(),i=n.getKonvaLayer(),r=n.getDrawController(),o=t.getActiveViewLayer().getViewController(),a=new Bn(o);a.colour=this.#sn.getLineColour(),a.id=at(),r.addAnnotation(a),r.hasAnnotationMeta("StudyInstanceUID")||r.setAnnotationMeta("StudyInstanceUID",o.getStudyInstanceUID()),this.#fr.setAnnotationMathShape(a,e);const s=this.#fr.createShapeGroup(a,this.#sn);n.getCurrentPosGroup().add(s),i.listening(!0),this.#vo(n,s),this.#Io(t,s,a)}#vo(e,t){const n=new Kn(t,this.#io,e);n.onExecute=this.#Re,n.onUndo=this.#Re,n.execute(),this.#rr.addToUndoStack(n)}#Co(e,t,n){const i=_n(n),r=new ei(t,i,e);r.onExecute=this.#Re,r.onUndo=this.#Re,r.execute(),this.#rr.addToUndoStack(r)}#To(e,t,n,i){const r=new Jn(t,n,e,i);r.onExecute=this.#Re,r.onUndo=this.#Re,this.#rr.addToUndoStack(r)}#Lo(e){const t=e.getDivId();return void 0===this.#Rn[t]&&(this.#Rn[t]=()=>{this.#Po(e)}),this.#Rn[t]}activate(e){this.#eo.disable(),this.#eo.reset();const t=this.#rr.getActiveLayerGroup();if(void 0===t)throw new Error("No active layerGroup to activate draw on");this.#wo(e,t),e?(this.#ao=document.body.style.cursor,this.#rr.addEventListener("positionchange",this.#Lo(t))):(this.#Oo(),this.#ao=void 0,this.#rr.removeEventListener("positionchange",this.#Lo(t)))}#Po(e){this.#wo(!0,e)}#wo(e,t){const n=t.getActiveDrawLayer();if(void 0===n)return;const i=n.getDrawController(),r=n.getCurrentPosGroup().getChildren();e?r.forEach((e=>{if(e instanceof Fn().Group){const n=i.getAnnotation(e.id());this.#Io(t,e,n)}})):r.forEach((e=>{e instanceof Fn().Group&&this.#Ao(e)}));const o=n.getNonCurrentPosGroup();for(const e of o)e.getChildren().forEach((e=>{this.#Ao(e)}));const a=n.getKonvaLayer();0!==r.length&&a.listening(!0),a.draw()}#Ao(e){this.#bo(e);const t=e.getChildren(qn)[0];t instanceof Fn().Shape&&(t.draggable(!1),t.off("dragstart.draw"),t.off("dragmove.draw"),t.off("dragend.draw"),t.off("dblclick"));const n=e.getChildren(En)[0];n instanceof Fn().Label&&(n.draggable(!1),n.off("dragstart.draw"),n.off("dragend.draw"))}#xo(e,t){const n=t.getActiveDrawLayer().getKonvaStage();return{x:n.offset().x+e.x/n.scale().x,y:n.offset().y+e.y/n.scale().y}}#Oo(){void 0!==this.#ao&&(document.body.style.cursor=this.#ao),void 0!==this.#oo&&this.#oo.opacity(1)}#Ro(e){e.on("mouseover",(()=>{this.#oo=e,document.body.style.cursor=this.#so,e.opacity(.75)})),e.on("mouseout",(()=>{this.#Oo(),this.#oo=void 0}))}#bo(e){e.off("mouseover"),e.off("mouseout")}#Fo(e){let t;const n=Object.keys(this.#pr);for(let i=0;i<n.length&&(t=new this.#pr[n[i]],!t.isFactoryGroup(e));++i);if(void 0===t)throw new Error("Cannot find factory to update quantification.");return t}#Io(e,t,n){this.#Ro(t);const i=e.getActiveDrawLayer(),r=i.getKonvaLayer(),o=t.getChildren(qn)[0];if(!(o instanceof Fn().Shape))return;o.draggable(!0);const a=t.getChildren(En)[0];if(!(a instanceof Fn().Label))return;a.draggable(!0);let s,l,c,u=!0;o.on("dragstart.draw",(e=>{c=o.stroke(),s={x:o.x(),y:o.y()},l={x:e.target.x(),y:e.target.y()},this.#Ar.activate(i),this.#eo.setAnchorsActive(!1),r.draw()})),o.on("dragmove.draw",(o=>{const a={x:o.target.x()-l.x,y:o.target.y()-l.y},s=t.getChildren();for(const e of s)e===o.target||"label"===e.name()&&!u||e.move(a);l={x:o.target.x(),y:o.target.y()},function(e,t){const n=t.getChildren(qn)[0],i=function(e){const t=e.find(".anchor");if(0===t.length)return;let n=t[0].x(),i=t[0].y();for(let e=0;e<t.length;++e)n=Math.min(n,t[e].x()),i=Math.min(i,t[e].y());return new F(n,i)}(t);void 0===i||Vn(t,new F(-i.getX(),-i.getY()),new F(e.x-(i.getX()+Math.abs(n.width())),e.y-(i.getY()+Math.abs(n.height()))))}(i.getBaseSize(),t);const d=this.#Fo(t);d.updateAnnotationOnTranslation(n,a),d.updateLabelContent(n,t,this.#sn);const h=Xn(o.evt),S={x:h.getX(),y:h.getY()},g=this.#xo(S,e);this.#Ar.changeChildrenColourOnTrashHover(g,t,c),r.draw()})),o.on("dragend.draw",(n=>{if(this.#Ar.remove(),void 0===n||void 0===n.evt)return;const a=o.x(),l=o.y(),d=Xn(n.evt),h={x:d.getX(),y:d.getY()},S=this.#xo(h,e);if(this.#Ar.isOverTrash(S))t.x(s.x),t.y(s.y),this.#eo.disable(),this.#eo.reset(),this.#Ar.changeGroupChildrenColour(t,c),this.#Co(i,t,o),document.body.style.cursor=this.#ao;else{const e={x:a-s.x,y:l-s.y};0===e.x&&0===e.y||(this.#To(i,o,e,u),this.#Re({type:"drawmove",id:t.id(),srclayerid:i.getId(),dataid:i.getDataId()})),this.#eo.setAnchorsActive(!0),this.#eo.resetAnchors()}r.draw(),s={x:o.x(),y:o.y()}})),a.on("dragstart.draw",(()=>{u=!1,s={x:a.x(),y:a.y()}})),a.on("dragend.draw",(()=>{const e={x:a.x()-s.x,y:a.y()-s.y};0===e.x&&0===e.y||(this.#To(i,a,e,u),this.#Re({type:"drawmove",id:t.id(),srclayerid:i.getId(),dataid:i.getDataId()})),s={x:o.x(),y:o.y()}})),t.on("dblclick",(e=>{const t=e.currentTarget;if(!(t instanceof Fn().Group))return;const o=t.findOne("Label");if(!(o instanceof Fn().Label))return;if(void 0===o)throw new Error("Could not find the shape label.");const a=o.getText(),s=t.id();Hn.openRoiDialog(n,(e=>{const t=e.getText();a.setText(t),o.visible(0!==t.length),this.#Re({type:"drawchange",id:s,srclayerid:i.getId(),dataid:i.getDataId()}),r.draw()}))}))}setOptions(e){this.#pr=e,this.#eo.setFactoryList(e)}getOptionsType(){return"factory"}setFeatures(e){if(void 0!==e.autoShapeColour&&(this.#co=e.autoShapeColour),void 0!==e.shapeColour&&(this.#sn.setLineColour(e.shapeColour),this.#co=!1),void 0!==e.shapeName){if(!this.hasShape(e.shapeName))throw new Error("Unknown shape: '"+e.shapeName+"'");this.#io=e.shapeName}void 0!==e.mouseOverCursor&&(this.#so=e.mouseOverCursor),void 0!==e.withScroll&&(this.#lo=e.withScroll)}init(){}getEventNames(){return["drawcreate","drawchange","drawmove","drawdelete"]}addEventListener(e,t){void 0===this.#H[e]&&(this.#H[e]=[]),this.#H[e].push(t)}removeEventListener(e,t){if(void 0!==this.#H[e])for(let n=0;n<this.#H[e].length;++n)this.#H[e][n]===t&&this.#H[e].splice(n,1)}#Re=e=>{if(void 0!==this.#H[e.type])for(let t=0;t<this.#H[e.type].length;++t)this.#H[e.type][t](e)};hasShape(e){return void 0!==this.#pr[e]}},Filter:class{#rr;constructor(e){this.#rr=e}#Eo=null;#qo=0;#Oe=new Ze;activate(e){for(const t in this.#Eo)e?(this.#Eo[t].addEventListener("filterrun",this.#Re),this.#Eo[t].addEventListener("filter-undo",this.#Re)):(this.#Eo[t].removeEventListener("filterrun",this.#Re),this.#Eo[t].removeEventListener("filter-undo",this.#Re))}setOptions(e){this.#Eo={};for(const t in e)this.#Eo[t]=new e[t](this.#rr)}getOptionsType(){return"instance"}init(){for(const e in this.#Eo)this.#Eo[e].init()}keydown=e=>{e.context="Filter",this.#rr.onKeydown(e)};getEventNames(){return["filterrun","filterundo"]}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};getSelectedFilter(){return this.#qo}setFeatures(e){if(void 0!==e.filterName){if(!this.hasFilter(e.filterName))throw new Error("Unknown filter: '"+e.filterName+"'");this.#qo&&this.#qo.activate(!1),this.#qo=this.#Eo[e.filterName],this.#qo.activate(!0)}if(void 0!==e.run&&e.run){let t={};void 0!==e.runArgs&&(t=e.runArgs),this.getSelectedFilter().run(t)}}getFilterList(){return this.#Eo}hasFilter(e){return this.#Eo[e]}},Floodfill:class{#rr;constructor(e){this.#rr=e}#Uo=5;#Mo=0;#Qo=2e3;#Vo=null;#No=null;#Bo=10;#Go=null;#Qr=!1;#ko=null;#Ho=null;#zo;#Wo=null;#Xo=[];#Yo=!1;#jo;#sn=new xn;#Oe=new Ze;setExtend(e){this.#Yo=e}getExtend(){return this.#Yo}#Zo=(e,t)=>{const n=this.#rr.getLayerGroupByDivId(t).getActiveViewLayer().displayToPlaneIndex(e);return{x:n.get(0),y:n.get(1)}};#_o(e,t,n){this.#Xo=[];const i={data:this.#Vo.data,width:this.#Vo.width,height:this.#Vo.height,bytes:4};this.#No=nr().floodFill(i,e.x,e.y,t),this.#No=nr().gaussBlurOnlyBorder(this.#No,this.#Uo);let r=nr().traceContours(this.#No);if(r=nr().simplifyContours(r,this.#Mo,this.#Qo),r.length>0&&r[0].points[0].x){if(n)return r[0].points;for(let e=0,t=r[0].points.length;e<t;e++)this.#Xo.push(new F(r[0].points[e].x,r[0].points[e].y));return this.#Xo}return[]}#Ko(e,t,n){if(this.#Wo=this.#_o(e,t,!1),this.#Wo){const e=new er;this.#Ho=e.create(this.#Wo,this.#sn),this.#Ho.id(at());const t=n.getActiveDrawLayer();return t.getCurrentPosGroup().add(this.#Ho),this.#ko=new Kn(this.#Ho,"floodfill",t),this.#ko.onExecute=this.#Re,this.#ko.onUndo=this.#Re,this.#ko.execute(),this.#rr.addToUndoStack(this.#ko),!0}return!1}extend(e,t,n){if(!this.#zo)throw"'initialpoint' not found. User must click before use extend!";this.#Ho&&this.#Ho.destroy();const i=n.getActiveViewLayer().getViewController(),r=i.getCurrentIndex(),o=i.getImageSize(),a=this.#Go||this.#Bo;for(let e=r.get(2),s=t||o.get(2);e<s&&this.#Ko(this.#zo,a,n);e++)i.incrementIndex(2);i.setCurrentPosition(r);for(let t=r.get(2),o=e||0;t>o&&this.#Ko(this.#zo,a,n);t--)i.decrementIndex(2);i.setCurrentPosition(r)}modifyThreshold(e,t){if(t||!this.#Ho)throw"No shape found";t=this.#Ho.getChildren((function(e){return"shape"===e.name()}))[0],clearTimeout(this.#jo),this.#jo=setTimeout((()=>{if(this.#Wo=this.#_o(this.#zo,e,!0),!this.#Wo)return!1;const n=[];for(let e=0,t=this.#Wo.length;e<t;++e)n.push(this.#Wo[e].x),n.push(this.#Wo[e].y);t.setPoints(n),t.getLayer().draw(),this.onThresholdChange(e)}),100)}onThresholdChange(e){}#Br(e,t){const n=this.#rr.getLayerGroupByDivId(t),i=n.getActiveViewLayer(),r=n.getActiveDrawLayer();this.#Vo=i.getImageData(),this.#Vo?(this.#sn.setZoomScale(r.getKonvaLayer().getAbsoluteScale()),this.#Qr=!0,this.#zo=this.#Zo(e,t),this.#Ko(this.#zo,this.#Bo,n),this.onThresholdChange(this.#Bo)):c.error("No image found")}#Gr(e,t){if(!this.#Qr)return;const n=this.#Zo(e,t);this.#Go=Math.round(Math.sqrt(Math.pow(this.#zo.x-n.x,2)+Math.pow(this.#zo.y-n.y,2))/2),this.#Go=this.#Go<this.#Bo?this.#Bo:this.#Go-this.#Bo,this.modifyThreshold(this.#Go)}#kr(){this.#Qr&&(this.#Qr=!1)}mousedown=e=>{const t=Xn(e),n=ii(e);this.#Br(t,n.groupDivId)};mousemove=e=>{const t=Xn(e),n=ii(e);this.#Gr(t,n.groupDivId)};mouseup=e=>{this.#kr()};mouseout=e=>{this.#kr()};touchstart=e=>{const t=Wn(e),n=ii(e);this.#Br(t[0],n.groupDivId)};touchmove=e=>{const t=Wn(e),n=ii(e);this.#Gr(t[0],n.groupDivId)};touchend=e=>{this.#kr()};keydown=e=>{e.context="Floodfill",this.#rr.onKeydown(e)};activate(e){e&&(this.#sn.setBaseScale(this.#rr.getBaseScale()),this.setFeatures({shapeColour:this.#sn.getLineColour()}))}init(){}getEventNames(){return["drawcreate","drawchange","drawmove","drawdelete"]}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};setFeatures(e){void 0!==e.shapeColour&&this.#sn.setLineColour(e.shapeColour)}},Livewire:class{#rr;constructor(e){this.#rr=e}#Qr=!1;#Vr;#ko=null;#Ho=null;#sn=new xn;#Jo=new ir;#$o=new ir;#Xo=[];#ea=5;#Oe=new Ze;#ta(e){const t=e.get(1);for(let e=0;e<t;++e)this.#Xo[e]=[]}#na(){this.#Jo=new ir,this.#$o=new ir}#ia=new sr;#Br(e,t){const n=this.#rr.getLayerGroupByDivId(t),i=n.getActiveViewLayer(),r=i.getViewController().getImageSize(),o=i.displayToPlaneIndex(e);if(this.#Qr){const e=Math.abs(o.get(0)-this.#Vr.getX()),t=Math.abs(o.get(1)-this.#Vr.getY());if(e<this.#ea&&t<this.#ea)this.#ra();else{this.#Jo=this.#$o,this.#ta(r);const e={x:o.get(0),y:o.get(1)};this.#ia.doTraining(e),this.#Jo.addControlPoint(this.#$o.getPoint(0))}}else{this.#Qr=!0,this.#Vr=new F(o.get(0),o.get(1)),this.#na(),this.#ta(r),this.#Ho=null;const e=n.getActiveDrawLayer();this.#sn.setZoomScale(e.getKonvaLayer().getAbsoluteScale());const t={x:o.get(0),y:o.get(1)};this.#ia.doTraining(t);const i=new F(o.get(0),o.get(1));this.#Jo.addPoint(i),this.#Jo.addControlPoint(i)}}#Gr(e,t){if(!this.#Qr)return;const n=this.#rr.getLayerGroupByDivId(t),i=n.getActiveViewLayer().displayToPlaneIndex(e);let r={x:i.get(0),y:i.get(1)};this.#ia.setPoint(r);let o=[],a=!1;for(;!this.#Xo[r.y][r.x]&&!a;)if(o=this.#ia.doWork(),0===o.length)a=!0;else for(let e=0;e<o.length-1;e+=2){const t=o[e],n=o[e+1];this.#Xo[t.y][t.x]=n}for(this.#$o=new ir,a=!1;r&&!a;)this.#$o.addPoint(new F(r.x,r.y)),this.#Xo[r.y]&&this.#Xo[r.y][r.x]?r=this.#Xo[r.y][r.x]:a=!0;this.#$o.appenPath(this.#Jo),this.#Ho&&this.#Ho.destroy();const s=new er;this.#Ho=s.create(this.#$o.pointArray,this.#sn),this.#Ho.id(at());const l=n.getActiveDrawLayer();l.getCurrentPosGroup().add(this.#Ho),this.#ko=new Kn(this.#Ho,"livewire",l),this.#ko.execute()}#ra(){this.#Re({type:"drawcreate",id:this.#Ho.id()}),this.#ko.onExecute=this.#Re,this.#ko.onUndo=this.#Re,this.#rr.addToUndoStack(this.#ko),this.#Qr=!1}mousedown=e=>{const t=Xn(e),n=ii(e);this.#Br(t,n.groupDivId)};mousemove=e=>{const t=Xn(e),n=ii(e);this.#Gr(t,n.groupDivId)};mouseup(e){}mouseout=e=>{};dblclick=e=>{this.#ra()};touchstart=e=>{const t=Wn(e),n=ii(e);this.#Br(t[0],n.groupDivId)};touchmove=e=>{const t=Wn(e),n=ii(e);this.#Gr(t[0],n.groupDivId)};touchend=e=>{};keydown=e=>{e.context="Livewire",this.#rr.onKeydown(e)};activate(e){if(e){const e=this.#rr.getActiveLayerGroup().getActiveViewLayer(),t=e.getViewController().getImageSize();this.#ia.setDimensions(t.get(0),t.get(1)),this.#ia.setData(e.getImageData().data),this.#sn.setBaseScale(this.#rr.getBaseScale()),this.setFeatures({shapeColour:this.#sn.getLineColour()})}}init(){}getEventNames(){return["drawcreate","drawchange","drawmove","drawdelete"]}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)};setFeatures(e){void 0!==e.shapeColour&&this.#sn.setLineColour(e.shapeColour)}}},fr={draw:{ArrowFactory:class{getGroupName(){return"line-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new ji(e[0],e[1]),r=new(Fn().Line)({points:[i.getBegin().getX(),i.getBegin().getY(),i.getEnd().getX(),i.getEnd().getY()],stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),o=t.applyZoomScale(10).x,a=_i(i,e[0],o),s=_i(i,e[1],o);r.hitFunc((function(e){e.beginPath(),e.moveTo(a.getBegin().getX(),a.getBegin().getY()),e.lineTo(a.getEnd().getX(),a.getEnd().getY()),e.lineTo(s.getEnd().getX(),s.getEnd().getY()),e.lineTo(s.getBegin().getX(),s.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}));const l=new F(i.getBegin().getX(),i.getBegin().getY()-10),c=new ji(i.getBegin(),l),u=Zi(i,c),d=u*Math.PI/180,h=Math.abs(t.applyZoomScale(8).x),S=new(Fn().RegularPolygon)({x:i.getBegin().getX()+h*Math.sin(d),y:i.getBegin().getY()+h*Math.cos(d),sides:3,radius:h,rotation:-u,fill:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape-triangle"}),g=new(Fn().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let m="";const p=n.getModality();m=void 0!==bn.labelText.arrow[p]?bn.labelText.arrow[p]:bn.labelText.arrow["*"],g.setText(m),g.meta={textExpr:m,quantification:{}};const f=i.getBegin().getX()>i.getEnd().getX()?0:-1,D=i.getBegin().getY()>i.getEnd().getY()?-1:0,y=new(Fn().Label)({x:i.getEnd().getX()+f*g.width(),y:i.getEnd().getY()+D*t.applyZoomScale(15).y,scale:t.applyZoomScale(1),visible:0!==m.length,name:"label"});y.add(g),y.add(new(Fn().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const C=new(Fn().Group);return C.name(this.getGroupName()),C.add(y),C.add(S),C.add(r),C.visible(!0),C}getAnchors(e,t){const n=e.points(),i=[];return i.push(Qn(n[0]+e.x(),n[1]+e.y(),"begin",t)),i.push(Qn(n[2]+e.x(),n[3]+e.y(),"end",t)),i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof Fn().Line))return;const o=i.getChildren((function(e){return"shape-triangle"===e.name()}))[0];if(!(o instanceof Fn().RegularPolygon))return;const a=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(a instanceof Fn().Label))return;const s=i.getChildren((function(e){return"begin"===e.id()}))[0],l=i.getChildren((function(e){return"end"===e.id()}))[0];switch(e.id()){case"begin":s.x(e.x()),s.y(e.y());break;case"end":l.x(e.x()),l.y(e.y())}const c=s.x()-r.x(),u=s.y()-r.y(),d=l.x()-r.x(),h=l.y()-r.y();r.points([c,u,d,h]);const S=new F(s.x(),s.y()),g=new F(l.x(),l.y()),m=new ji(S,g),p=new F(c,u),f=new F(d,h),D=t.applyZoomScale(10).x,y=_i(m,p,D),C=_i(m,f,D);r.hitFunc((function(e){e.beginPath(),e.moveTo(y.getBegin().getX(),y.getBegin().getY()),e.lineTo(y.getEnd().getX(),y.getEnd().getY()),e.lineTo(C.getEnd().getX(),C.getEnd().getY()),e.lineTo(C.getBegin().getX(),C.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}));const v=new F(m.getBegin().getX(),m.getBegin().getY()-10),I=new ji(m.getBegin(),v),T=Zi(m,I),L=T*Math.PI/180;o.x(m.getBegin().getX()+o.radius()*Math.sin(L)),o.y(m.getBegin().getY()+o.radius()*Math.cos(L)),o.rotation(-T);const P=a.getText();P.setText(P.meta.textExpr);const w=m.getBegin().getX()>m.getEnd().getX()?0:-1,O=m.getBegin().getY()>m.getEnd().getY()?-1:0,A={x:m.getEnd().getX()+w*P.width(),y:m.getEnd().getY()+O*t.applyZoomScale(15).y};a.position(A)}},CircleFactory:Nn,EllipseFactory:class{getGroupName(){return"ellipse-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=Math.abs(e[0].getX()-e[1].getX()),r=Math.abs(e[0].getY()-e[1].getY()),o=new lr(e[0],i,r),a={x:o.getA(),y:o.getB()},s=new(Fn().Ellipse)({x:o.getCenter().getX(),y:o.getCenter().getY(),radius:a,radiusX:a.x,radiusY:a.y,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),l=new(Fn().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let c="";const u=n.getModality();c=void 0!==bn.labelText.ellipse[u]?bn.labelText.ellipse[u]:bn.labelText.ellipse["*"];const d=o.quantify(n,Q(c));l.setText(V(c,d)),l.meta={textExpr:c,quantification:d};const h=new(Fn().Label)({x:o.getCenter().getX()-o.getA(),y:o.getCenter().getY()+o.getB(),scale:t.applyZoomScale(1),visible:0!==c.length,name:"label"});h.add(l),h.add(new(Fn().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const S=new(Fn().Group);return S.name(this.getGroupName()),S.add(h),S.add(s),S.visible(!0),S}getAnchors(e,t){const n=e.x(),i=e.y(),r=e.radius(),o=[];return o.push(Qn(n-r.x,i,"left",t)),o.push(Qn(n+r.x,i,"right",t)),o.push(Qn(n,i+r.y,"bottom",t)),o.push(Qn(n,i-r.y,"top",t)),o}update(e,t,n){const i=e.getParent();if(!(i instanceof Fn().Group))return;const r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof Fn().Ellipse))return;const o=i.getChildren((function(e){return"label"===e.name()}))[0],a=i.getChildren((function(e){return"left"===e.id()}))[0],s=i.getChildren((function(e){return"right"===e.id()}))[0],l=i.getChildren((function(e){return"bottom"===e.id()}))[0],u=i.getChildren((function(e){return"top"===e.id()}))[0];const d={x:r.x(),y:r.y()};let h,S;switch(e.id()){case"left":h=d.x-e.x(),S=u.y()-d.y,a.x(e.x()),a.y(s.y()),s.x(d.x+h);break;case"right":h=e.x()-d.x,S=u.y()-d.y,s.x(e.x()),s.y(a.y()),a.x(d.x-h);break;case"bottom":h=d.x-a.x(),S=e.y()-d.y,l.x(u.x()),l.y(e.y()),u.y(d.y-S);break;case"top":h=d.x-a.x(),S=d.y-e.y(),u.x(l.x()),u.y(e.y()),l.y(d.y+S);break;default:c.error("Unhandled anchor id: "+e.id())}r.position(d);const g={x:Math.abs(h),y:Math.abs(S)};g&&r.radius(g);const m=new F(i.x()+d.x,i.y()+d.y),p=(new lr(m,g.x,g.y),{x:d.x-g.x,y:d.y+g.y});o.position(p),this.#oa(i,n)}updateQuantification(e,t){this.#oa(e,t)}#oa(e,t){const n=e.getChildren((function(e){return"shape"===e.name()}))[0];if(!(n instanceof Fn().Ellipse))return;const i=e.getChildren((function(e){return"label"===e.name()}))[0];if(!(i instanceof Fn().Label))return;const r=new F(e.x()+n.x(),e.y()+n.y()),o=new lr(r,n.radius().x,n.radius().y),a=i.getText(),s=a.meta,l=o.quantify(t,Q(s.textExpr));a.setText(V(s.textExpr,l)),s.quantification=l}#aa(e,t){let n=0,i=0;void 0!==t&&(n=t.x(),i=t.y());const r=new(Fn().Group);r.name("shadow");const o=e.getRound();for(let e=0;e<o.length;++e){const t=o[e],a=t[0][0],s=t[0][1],l=t[1][0],c=new(Fn().Rect)({x:a-n,y:s-i,width:l-a,height:1,fill:"grey",strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow-element"});r.add(c)}return r}},FreeHandFactory:class{getGroupName(){return"freeHand-group"}getNPoints(){}getTimeout(){return 25}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=[];for(let t=0;t<e.length;++t)i.push(e[t].getX()),i.push(e[t].getY());const r=new(Fn().Line)({points:i,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape",tension:.5}),o=new(Fn().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),name:"text"});let a="";const s=n.getModality();a=void 0!==bn.labelText.freeHand[s]?bn.labelText.freeHand[s]:bn.labelText.freeHand["*"],o.setText(a),o.meta={textExpr:a,quantification:{}};const l=new(Fn().Label)({x:e[0].getX(),y:e[0].getY()+t.scale(10),scale:t.applyZoomScale(1),visible:0!==a.length,name:"label"});l.add(o),l.add(new(Fn().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const c=new(Fn().Group);return c.name(this.getGroupName()),c.add(l),c.add(r),c.visible(!0),c}getAnchors(e,t){const n=e.points(),i=[];for(let r=0;r<n.length;r+=2){const o=n[r]+e.x(),a=n[r+1]+e.y(),s=r.toString();i.push(Qn(o,a,s,t))}return i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof Fn().Line))return;const o=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(o instanceof Fn().Label))return;const a=i.getChildren((function(t){return t.id()===e.id()}))[0];a.x(e.x()),a.y(e.y());const s=r.points(),l=parseInt(e.id(),10);s[l]=e.x()-r.x(),s[l+1]=e.y()-r.y(),r.points(s.concat());const c=o.getText(),u=c.meta;c.setText(u.textExpr);const d={x:s[0]+r.x(),y:s[1]+r.y()+t.scale(10)};o.position(d)}},ProtractorFactory:class{getGroupName(){return"protractor-group"}getNPoints(){return 3}getTimeout(){return 500}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new ji(e[0],e[1]),r=[];for(let t=0;t<e.length;++t)r.push(e[t].getX()),r.push(e[t].getY());const o=new(Fn().Line)({points:r,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),a=new(Fn().Group);if(a.name(this.getGroupName()),3===e.length){const r=new ji(e[1],e[2]);o.hitFunc((function(t){t.beginPath(),t.moveTo(e[0].getX(),e[0].getY()),t.lineTo(e[1].getX(),e[1].getY()),t.lineTo(e[2].getX(),e[2].getY()),t.closePath(),t.fillStrokeShape(o)}));let s=Zi(i,r),l=i.getInclination();s>180&&(s=360-s,l+=s);const c=new(Fn().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let u="";const d=n.getModality();u=void 0!==bn.labelText.protractor[d]?bn.labelText.protractor[d]:bn.labelText.protractor["*"];const h={angle:{value:s,unit:On.t("unit.degree")}};c.setText(V(u,h)),c.meta={textExpr:u,quantification:h};const S=(i.getMidpoint().getX()+r.getMidpoint().getX())/2,g=(i.getMidpoint().getY()+r.getMidpoint().getY())/2,m=new(Fn().Label)({x:S,y:g-t.applyZoomScale(15).y,scale:t.applyZoomScale(1),visible:0!==u.length,name:"label"});m.add(c),m.add(new(Fn().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const p=33*Math.min(i.getLength(),r.getLength())/100,f=new(Fn().Arc)({innerRadius:p,outerRadius:p,stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,angle:s,rotation:-l,x:e[1].getX(),y:e[1].getY(),name:"shape-arc"});a.add(m),a.add(f)}return a.add(o),a.visible(!0),a}getAnchors(e,t){const n=e.points(),i=[];return i.push(Qn(n[0]+e.x(),n[1]+e.y(),"begin",t)),i.push(Qn(n[2]+e.x(),n[3]+e.y(),"mid",t)),i.push(Qn(n[4]+e.x(),n[5]+e.y(),"end",t)),i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof Fn().Line))return;const o=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(o instanceof Fn().Label))return;const a=i.getChildren((function(e){return"shape-arc"===e.name()}))[0];if(!(a instanceof Fn().Arc))return;const s=i.getChildren((function(e){return"begin"===e.id()}))[0],l=i.getChildren((function(e){return"mid"===e.id()}))[0],c=i.getChildren((function(e){return"end"===e.id()}))[0];switch(e.id()){case"begin":s.x(e.x()),s.y(e.y());break;case"mid":l.x(e.x()),l.y(e.y());break;case"end":c.x(e.x()),c.y(e.y())}const u=s.x()-r.x(),d=s.y()-r.y(),h=l.x()-r.x(),S=l.y()-r.y(),g=c.x()-r.x(),m=c.y()-r.y();r.points([u,d,h,S,g,m]),r.hitFunc((function(e){e.beginPath(),e.moveTo(u,d),e.lineTo(h,S),e.lineTo(g,m),e.closePath(),e.fillStrokeShape(r)}));const p=new F(s.x(),s.y()),f=new F(l.x(),l.y()),D=new F(c.x(),c.y()),y=new ji(p,f),C=new ji(f,D);let v=Zi(y,C),I=y.getInclination();v>180&&(v=360-v,I+=v);const T=o.getText(),L=T.meta,P={angle:{value:v,unit:On.t("unit.degree")}};T.setText(V(L.textExpr,P)),L.quantification=P;const w={x:(y.getMidpoint().getX()+C.getMidpoint().getX())/2,y:(y.getMidpoint().getY()+C.getMidpoint().getY())/2-t.applyZoomScale(15).y};o.position(w);const O=33*Math.min(y.getLength(),C.getLength())/100;a.innerRadius(O),a.outerRadius(O),a.angle(v),a.rotation(-I);const A={x:l.x(),y:l.y()};a.position(A)}},RectangleFactory:class{getGroupName(){return"rectangle-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new ur(e[0],e[1]),r=new(Fn().Rect)({x:i.getBegin().getX(),y:i.getBegin().getY(),width:i.getWidth(),height:i.getHeight(),stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),o=new(Fn().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let a="";const s=n.getModality();a=void 0!==bn.labelText.rectangle[s]?bn.labelText.rectangle[s]:bn.labelText.rectangle["*"];const l=i.quantify(n,Q(a));o.setText(V(a,l)),o.meta={textExpr:a,quantification:l};const c=new(Fn().Label)({x:i.getBegin().getX(),y:i.getEnd().getY(),scale:t.applyZoomScale(1),visible:0!==a.length,name:"label"});c.add(o),c.add(new(Fn().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const u=new(Fn().Group);return u.name(this.getGroupName()),u.add(c),u.add(r),u.visible(!0),u}getAnchors(e,t){const n=e.x(),i=e.y(),r=e.width(),o=e.height(),a=[];return a.push(Qn(n,i,"topLeft",t)),a.push(Qn(n+r,i,"topRight",t)),a.push(Qn(n+r,i+o,"bottomRight",t)),a.push(Qn(n,i+o,"bottomLeft",t)),a}update(e,t,n){const i=e.getParent();if(!(i instanceof Fn().Group))return;const r=i.getChildren((function(e){return"shape"===e.name()}))[0],o=i.getChildren((function(e){return"label"===e.name()}))[0],a=i.getChildren((function(e){return"topLeft"===e.id()}))[0],s=i.getChildren((function(e){return"topRight"===e.id()}))[0],l=i.getChildren((function(e){return"bottomRight"===e.id()}))[0],u=i.getChildren((function(e){return"bottomLeft"===e.id()}))[0];let d;switch(e.id()){case"topLeft":a.x(e.x()),a.y(e.y()),s.y(e.y()),u.x(e.x());break;case"topRight":s.x(e.x()),s.y(e.y()),a.y(e.y()),l.x(e.x());break;case"bottomRight":l.x(e.x()),l.y(e.y()),u.y(e.y()),s.x(e.x());break;case"bottomLeft":u.x(e.x()),u.y(e.y()),l.y(e.y()),a.x(e.x());break;default:c.error("Unhandled anchor id: "+e.id())}r.position(a.position());const h=s.x()-a.x(),S=u.y()-a.y();h&&S&&r.size({width:h,height:S});const g=new F(i.x()+a.x(),i.y()+a.y()),m=new F(i.x()+l.x(),i.y()+l.y()),p=new ur(g,m);const f={x:p.getBegin().getX()-i.x(),y:p.getEnd().getY()-i.y()};o.position(f),this.#sa(i,n)}updateQuantification(e,t){this.#sa(e,t)}#sa(e,t){const n=e.getChildren((function(e){return"shape"===e.name()}))[0],i=e.getChildren((function(e){return"label"===e.name()}))[0];if(!(i instanceof Fn().Label))return;const r=new F(e.x()+n.x(),e.y()+n.y()),o=new F(r.getX()+n.width(),r.getY()+n.height()),a=new ur(r,o),s=i.getText(),l=s.meta,c=a.quantify(t,Q(l.textExpr));s.setText(V(l.textExpr,c)),l.quantification=c}#la(e){const t=e.getRound(),n=t.max.getX()-t.min.getX(),i=t.max.getY()-t.min.getY();return new(Fn().Rect)({x:t.min.getX(),y:t.min.getY(),width:n,height:i,fill:"grey",strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow"})}},RoiFactory:er,RulerFactory:class{getGroupName(){return"ruler-group"}getNPoints(){return 2}getTimeout(){return 0}isFactoryGroup(e){return this.getGroupName()===e.name()}create(e,t,n){const i=new ji(e[0],e[1]),r=new(Fn().Line)({points:[i.getBegin().getX(),i.getBegin().getY(),i.getEnd().getX(),i.getEnd().getY()],stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),o=t.applyZoomScale(10).x,a=_i(i,e[0],o),s=new(Fn().Line)({points:[a.getBegin().getX(),a.getBegin().getY(),a.getEnd().getX(),a.getEnd().getY()],stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape-tick0"}),l=_i(i,e[1],o),c=new(Fn().Line)({points:[l.getBegin().getX(),l.getBegin().getY(),l.getEnd().getX(),l.getEnd().getY()],stroke:t.getLineColour(),strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape-tick1"});r.hitFunc((function(e){e.beginPath(),e.moveTo(a.getBegin().getX(),a.getBegin().getY()),e.lineTo(a.getEnd().getX(),a.getEnd().getY()),e.lineTo(l.getEnd().getX(),l.getEnd().getY()),e.lineTo(l.getBegin().getX(),l.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}));const u=new(Fn().Text)({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:t.getLineColour(),padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"});let d="";const h=n.getModality();d=void 0!==bn.labelText.ruler[h]?bn.labelText.ruler[h]:bn.labelText.ruler["*"];const S=i.quantify(n);u.setText(V(d,S)),u.meta={textExpr:d,quantification:S};const g=i.getBegin().getX()>i.getEnd().getX()?0:-1,m=i.getBegin().getY()>i.getEnd().getY()?-1:0,p=new(Fn().Label)({x:i.getEnd().getX()+g*t.applyZoomScale(u.width()).x,y:i.getEnd().getY()+m*t.applyZoomScale(15).y,scale:t.applyZoomScale(1),visible:0!==d.length,name:"label"});p.add(u),p.add(new(Fn().Tag)({fill:t.getLineColour(),opacity:t.getTagOpacity()}));const f=new(Fn().Group);return f.name(this.getGroupName()),f.add(p),f.add(s),f.add(c),f.add(r),f.visible(!0),f}getAnchors(e,t){const n=e.points(),i=[];return i.push(Qn(n[0]+e.x(),n[1]+e.y(),"begin",t)),i.push(Qn(n[2]+e.x(),n[3]+e.y(),"end",t)),i}update(e,t,n){const i=e.getParent(),r=i.getChildren((function(e){return"shape"===e.name()}))[0];if(!(r instanceof Fn().Line))return;const o=i.getChildren((function(e){return"shape-tick0"===e.name()}))[0];if(!(o instanceof Fn().Line))return;const a=i.getChildren((function(e){return"shape-tick1"===e.name()}))[0];if(!(a instanceof Fn().Line))return;const s=i.getChildren((function(e){return"label"===e.name()}))[0];if(!(s instanceof Fn().Label))return;const l=i.getChildren((function(e){return"begin"===e.id()}))[0],c=i.getChildren((function(e){return"end"===e.id()}))[0];switch(e.id()){case"begin":l.x(e.x()),l.y(e.y());break;case"end":c.x(e.x()),c.y(e.y())}const u=l.x()-r.x(),d=l.y()-r.y(),h=c.x()-r.x(),S=c.y()-r.y();r.points([u,d,h,S]);const g=new F(l.x(),l.y()),m=new F(c.x(),c.y()),p=new ji(g,m),f=t.applyZoomScale(10).x,D=new F(u,d),y=new F(h,S),C=_i(p,D,f);o.points([C.getBegin().getX(),C.getBegin().getY(),C.getEnd().getX(),C.getEnd().getY()]);const v=_i(p,y,f);a.points([v.getBegin().getX(),v.getBegin().getY(),v.getEnd().getX(),v.getEnd().getY()]),r.hitFunc((function(e){e.beginPath(),e.moveTo(C.getBegin().getX(),C.getBegin().getY()),e.lineTo(C.getEnd().getX(),C.getEnd().getY()),e.lineTo(v.getEnd().getX(),v.getEnd().getY()),e.lineTo(v.getBegin().getX(),v.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}));const I=s.getText(),T=I.meta,L=p.quantify(n);I.setText(V(T.textExpr,L)),T.quantification=L;const P=p.getBegin().getX()>p.getEnd().getX()?0:-1,w=p.getBegin().getY()>p.getEnd().getY()?-1:0,O={x:p.getEnd().getX()+P*t.applyZoomScale(I.width()).x,y:p.getEnd().getY()+w*t.applyZoomScale(15).y};s.position(O)}}},filter:{Threshold:class{#rr;constructor(e){this.#rr=e}#Mr=new dr;#ca=!0;#Oe=new Ze;activate(e){e&&(this.#ca=!0)}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run threshod filter on.");this.#Mr.setMin(e.min),this.#Mr.setMax(e.max),this.#ca&&(this.#Mr.setOriginalImage(this.#rr.getImage(e.dataId)),this.#ca=!1);const t=new gr(this.#Mr,e.dataId,this.#rr);t.onExecute=this.#Re,t.onUndo=this.#Re,t.execute(),this.#rr.addToUndoStack(t)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}},Sobel:class{#rr;constructor(e){this.#rr=e}#Oe=new Ze;activate(e){}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run sobel filter on.");const t=new Sr;t.setOriginalImage(this.#rr.getImage(e.dataId));const n=new gr(t,e.dataId,this.#rr);n.onExecute=this.#Re,n.onUndo=this.#Re,n.execute(),this.#rr.addToUndoStack(n)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}},Sharpen:class{#rr;constructor(e){this.#rr=e}#Oe=new Ze;activate(e){}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run sharpen filter on.");const t=new hr;t.setOriginalImage(this.#rr.getImage(e.dataId));const n=new gr(t,e.dataId,this.#rr);n.onExecute=this.#Re,n.onUndo=this.#Re,n.execute(),this.#rr.addToUndoStack(n)}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}#Re=e=>{this.#Oe.fireEvent(e)}}}},Dr={NumericValue:"0040A30A",FloatingPointValue:"0040A161",RationalNumeratorValue:"0040A162",RationalDenominatorValue:"0040A163",MeasurementUnitsCodeSequence:"004008EA"};class yr{numericValue;floatingPointValue;rationalNumeratorValue;rationalDenominatorValue;measurementUnitsCode;toString(){return this.numericValue+" "+this.measurementUnitsCode.toString()}}function Cr(e){const t={};return void 0!==e.measurementUnitsCode&&(t.MeasurementUnitsCodeSequence={value:[kt(e.measurementUnitsCode)]}),void 0!==e.floatingPointValue&&(t.FloatingPointValue=e.floatingPointValue),void 0!==e.rationalNumeratorValue&&(t.RationalNumeratorValue=e.rationalNumeratorValue),void 0!==e.rationalDenominatorValue&&(t.RationalDenominatorValue=e.rationalDenominatorValue),void 0!==e.numericValue&&(t.NumericValue=e.numericValue),t}const vr={MeasuredValueSequence:"0040A300",NumericValueQualifierCodeSequence:"0040A301"};class Ir{measuredValue;numericValueQualifierCode;toString(){let e=this.measuredValue.toString();return void 0!==this.numericValueQualifierCode&&(e+=" "+this.numericValueQualifierCode.toString()),e}}function Tr(e){const t={};return void 0!==e.measuredValue&&(t.MeasuredValueSequence={value:[Cr(e.measuredValue)]}),void 0!==e.numericValueQualifierCode&&(t.NumericValueQualifierCodeSequence={value:[kt(e.numericValueQualifierCode)]}),t}const Lr={ReferencedSOPClassUID:"00081150",ReferencedSOPInstanceUID:"00081155"};class Pr{referencedSOPClassUID;referencedSOPInstanceUID;toString(){return this.referencedSOPInstanceUID+" (class: "+this.referencedSOPClassUID+")"}}function wr(e){const t=new Pr;return void 0!==e[Lr.ReferencedSOPClassUID]&&(t.referencedSOPClassUID=e[Lr.ReferencedSOPClassUID].value[0]),void 0!==e[Lr.ReferencedSOPInstanceUID]&&(t.referencedSOPInstanceUID=e[Lr.ReferencedSOPInstanceUID].value[0]),t}function Or(e){const t={};return void 0!==e.referencedSOPClassUID&&(t.ReferencedSOPClassUID=e.referencedSOPClassUID),void 0!==e.referencedSOPInstanceUID&&(t.ReferencedSOPInstanceUID=e.referencedSOPInstanceUID),t}const Ar={ReferencedFrameNumber:"00081160",ReferencedSOPSequence:"00081199",ReferencedSegmentNumber:"0062000B"};class br{referencedSOPSequence;referencedFrameNumber;referencedSegmentNumber;fiducialUID;toString(){return this.referencedSOPSequence.toString()}}function xr(e){const t={};return void 0!==e.referencedFrameNumber&&(t.ReferencedFrameNumber=e.referencedFrameNumber),void 0!==e.referencedSOPSequence&&(t.ReferencedSOPSequence={value:[Or(e.referencedSOPSequence)]}),void 0!==e.referencedSegmentNumber&&(t.ReferencedSegmentNumber=e.referencedSegmentNumber),t}const Rr={PixelOriginInterpretation:"00480301",GraphicData:"00700022",GraphicType:"00700023",FiducialUID:"0070031A"},Fr="CIRCLE";class Er{graphicData;graphicType;pixelOriginInterpretation;fiducialUID;toString(){return this.graphicType+" {"+this.graphicData+"}"}}function qr(e){const t={};return void 0!==e.pixelOriginInterpretation&&(t.PixelOriginInterpretation=e.pixelOriginInterpretation),void 0!==e.graphicData&&(t.GraphicData=e.graphicData),void 0!==e.graphicType&&(t.GraphicType=e.graphicType),void 0!==e.fiducialUID&&(t.FiducialUID=e.fiducialUID),t}function Ur(e){const t=new Er;if(e instanceof An){const n=e.getCenter(),i=new F(n.getX()+e.getRadius(),n.getY());t.graphicData=[n.getX().toString(),n.getY().toString(),i.getX().toString(),i.getY().toString()],t.graphicType=Fr}return t}function Mr(e){let t;if(e.graphicType===Fr){const n=new F(parseFloat(e.graphicData[0]),parseFloat(e.graphicData[1])),i=new F(parseFloat(e.graphicData[2]),parseFloat(e.graphicData[3])).getDistance(n);t=new An(n,i)}return t}const Qr={GraphicData:"00700022",GraphicType:"00700023",ReferencedFrameofReferenceUID:"30060024",FiducialUID:"0070031A"};class Vr{graphicData;graphicType;referencedFrameofReferenceUID;fiducialUID;toString(){return this.graphicType+"{"+this.graphicData+"}"}}function Nr(e){const t={};return void 0!==e.graphicData&&(t.GraphicData=e.graphicData),void 0!==e.graphicType&&(t.GraphicType=e.graphicType),void 0!==e.referencedFrameofReferenceUID&&(t.ReferencedFrameofReferenceUID=e.referencedFrameofReferenceUID),void 0!==e.fiducialUID&&(t.FiducialUID=e.fiducialUID),t}const Br={ReferencedSOPSequence:"00081199",RelationshipType:"0040A010",ValueType:"0040A040",ConceptNameCodeSequence:"0040A043",ConceptCodeSequence:"0040A168",ContentSequence:"0040A730",DateTime:"0040A120",Date:"0040A121",Time:"0040A122",UID:"0040A124",PersonName:"0040A123",TextValue:"0040A160",ContinuityOfContent:"0040A050"},Gr="HAS PROPERTIES",kr="SELECTED FROM",Hr={text:"TEXT",num:"NUM",code:"CODE",date:"DATE",time:"TIME",datetime:"DATETIME",uidref:"UIDREF",pname:"PNAME",composite:"COMPOSITE",image:"IMAGE",waveform:"WAVEFORM",scoord:"SCOORD",scoord3d:"SCOORD3D",tcoord:"TCOORD",container:"CONTAINER",table:"TABLE"},zr={TEXT:"TextValue",DATE:"Date",TIME:"Time",DATETIME:"DateTime",UIDREF:"UID",PNAME:"PersonName",CONTAINER:"ContinuityOfContent"};class Wr{valueType;conceptNameCode;relationshipType;contentSequence;value;constructor(e){this.valueType=e}toString(e){void 0===e&&(e="");let t="";if(void 0!==this.relationshipType&&(t+="("+this.relationshipType+") "),t+=this.valueType+": ",void 0!==this.conceptNameCode&&(t+=this.conceptNameCode.toString()),t+=" = "+this.value.toString(),void 0!==this.contentSequence)for(const n of this.contentSequence)t+="\n"+e+"- "+n.toString(e+" ");return t}}function Xr(e){let t="";void 0!==e[Br.ValueType]&&(t=e[Br.ValueType].value[0]);const n=new Wr(t);if(void 0!==e[Br.RelationshipType]&&(n.relationshipType=e[Br.RelationshipType].value[0]),void 0!==e[Br.ConceptNameCodeSequence]&&(n.conceptNameCode=Gt(e[Br.ConceptNameCodeSequence].value[0])),t===Hr.code)n.value=Gt(e[Br.ConceptCodeSequence].value[0]);else if(t===Hr.num)n.value=function(e){const t=new Ir;return void 0!==e[vr.MeasuredValueSequence]&&(t.measuredValue=function(e){const t=new yr;return void 0!==e[Dr.NumericValue]&&(t.numericValue=e[Dr.NumericValue].value[0]),void 0!==e[Dr.FloatingPointValue]&&(t.floatingPointValue=e[Dr.FloatingPointValue].value[0]),void 0!==e[Dr.RationalNumeratorValue]&&(t.rationalNumeratorValue=e[Dr.RationalNumeratorValue].value[0]),void 0!==e[Dr.RationalDenominatorValue]&&(t.rationalDenominatorValue=e[Dr.RationalDenominatorValue].value[0]),void 0!==e[Dr.MeasurementUnitsCodeSequence]&&(t.measurementUnitsCode=Gt(e[Dr.MeasurementUnitsCodeSequence].value[0])),t}(e[vr.MeasuredValueSequence].value[0])),void 0!==e[vr.NumericValueQualifierCodeSequence]&&(t.numericValueQualifierCode=Gt(e[vr.NumericValueQualifierCodeSequence].value[0])),t}(e);else if(t===Hr.image)n.value=function(e){const t=new br;return void 0!==e[Ar.ReferencedFrameNumber]&&(t.referencedFrameNumber=e[Ar.ReferencedFrameNumber].value[0]),void 0!==e[Ar.ReferencedSOPSequence]&&(t.referencedSOPSequence=wr(e[Ar.ReferencedSOPSequence].value[0])),void 0!==e[Ar.ReferencedSegmentNumber]&&(t.referencedSegmentNumber=e[Ar.ReferencedSegmentNumber].value[0]),t}(e);else if(t===Hr.composite)n.value=wr(e[Br.ReferencedSOPSequence].value[0]);else if(t===Hr.scoord)n.value=function(e){const t=new Er;return void 0!==e[Rr.GraphicData]&&(t.graphicData=e[Rr.GraphicData].value),void 0!==e[Rr.GraphicType]&&(t.graphicType=e[Rr.GraphicType].value[0]),void 0!==e[Rr.PixelOriginInterpretation]&&(t.pixelOriginInterpretation=e[Rr.PixelOriginInterpretation].value[0]),void 0!==e[Rr.FiducialUID]&&(t.fiducialUID=e[Rr.FiducialUID].value[0]),t}(e);else if(t===Hr.scoord3d)n.value=function(e){const t=new Vr;return void 0!==e[Qr.GraphicData]&&(t.graphicData=e[Qr.GraphicData].value),void 0!==e[Qr.GraphicType]&&(t.graphicType=e[Qr.GraphicType].value[0]),void 0!==e[Qr.ReferencedFrameofReferenceUID]&&(t.referencedFrameofReferenceUID=e[Qr.ReferencedFrameofReferenceUID].value[0]),void 0!==e[Qr.FiducialUID]&&(t.fiducialUID=e[Qr.FiducialUID].value[0]),t}(e);else{const i=zr[t];void 0!==i?n.value=e[Br[i]].value[0]:console.warn("Unsupported input ValueType: "+t)}if(void 0!==e[Br.ContentSequence]){n.contentSequence=[];for(const t of e[Br.ContentSequence].value)n.contentSequence.push(Xr(t))}return void 0===n.value&&console.log("valueType",t),n}function Yr(e){let t={};if(void 0!==e.relationshipType&&(t.RelationshipType=e.relationshipType),void 0!==e.valueType&&(t.ValueType=e.valueType),void 0!==e.conceptNameCode&&(t.ConceptNameCodeSequence={value:[kt(e.conceptNameCode)]}),"CODE"===e.valueType)t.ConceptCodeSequence={value:[kt(e.value)]};else if(e.valueType===Hr.num)t={...t,...Tr(e.value)};else if(e.valueType===Hr.image)t={...t,...xr(e.value)};else if(e.valueType===Hr.composite)t={...t,...Or(e.value)};else if(e.valueType===Hr.scoord)t={...t,...qr(e.value)};else if(e.valueType===Hr.scoord3d)t={...t,...Nr(e.value)};else{const n=zr[e.valueType];void 0!==n?t[n]=e.value:console.warn("Unsupported output ValueType: "+e.valueType)}if(void 0!==e.contentSequence){t.ContentSequence={value:[]};for(const n of e.contentSequence)t.ContentSequence.value.push(Yr(n))}return t}class jr{#$;getWarning(){return this.#$}checkElements(e){this.#$=void 0;const t=Xr(e);return void 0!==t.conceptNameCode?t.conceptNameCode.value!==Wt().value&&(this.#$="Not a measurement group"):this.#$="No root concept name code",this.#$}create(e,t){const n=Xr(e),i=[];for(const e of n.contentSequence)if(e.valueType===Hr.scoord){const n=new Bn(t);n.mathShape=Mr(e.value),n.id=at(),n.textExpr="";for(const t of e.contentSequence)t.valueType===Hr.image&&t.relationshipType===kr&&(n.referenceSopUID=t.value.referencedSOPSequence.referencedSOPInstanceUID),t.valueType===Hr.uidref&&t.relationshipType===Gr&&(n.id=t.value),t.valueType===Hr.text&&t.relationshipType===Gr&&(n.textExpr=t.value,n.updateQuantification());i.push(n)}const r=new Gn(i);return r.setMeta("StudyInstanceUID",e["0020000D"].value[0]),r}toDicom(e,t){let n={TransferSyntaxUID:"1.2.840.10008.1.2.1",SOPClassUID:"1.2.840.10008.5.1.4.1.1.88.71",SOPInstanceUID:"1.2.840.10008.5.1.4.1.1.88.71.0",MediaStorageSOPClassUID:"1.2.840.10008.5.1.4.1.1.88.71",MediaStorageSOPInstanceUID:"1.2.840.10008.5.1.4.1.1.88.71.0"};n.StudyInstanceUID=e.getMeta("StudyInstanceUID"),n.SeriesInstanceUID="1.2.3.4.5.6",n.Modality="SR",n.CompletionFlag="PARTIAL",n.VerificationFlag="UNVERIFIED";const i=new Date;n.ContentDate=ft(mt(i)),n.ContentTime=Dt(pt(i));const r=[];for(const t of e.getList()){const e=new Wr(Hr.image);e.relationshipType=kr,e.conceptNameCode=zt("121324");const n=new Pr;n.referencedSOPClassUID="",n.referencedSOPInstanceUID=t.referenceSopUID;const i=new br;i.referencedSOPSequence=n,e.value=i;const o=new Wr(Hr.uidref);o.relationshipType=Gr,o.conceptNameCode=zt("112039"),o.value=t.id;const a=new Wr(Hr.text);a.relationshipType=Gr,a.conceptNameCode=zt("125309"),a.value=t.textExpr;const s=new Wr(Hr.scoord);s.relationshipType="CONTAINS",s.conceptNameCode=zt("111030"),s.value=Ur(t.mathShape),s.contentSequence=[e,o,a],r.push(s)}if(0!==r.length){const e=new Wr(Hr.container);e.conceptNameCode=Wt(),e.contentSequence=r,n={...n,...Yr(e)}}return void 0!==t&&function(e,t){const n=Object.keys(t);for(const i of n)void 0!==e[i]&&c.trace("Overwritting tag: "+i),e[i]=t[i]}(n,t),Vt(n)}}class Zr{divId;orientation;colourMap;opacity;wlPresetName;windowCenter;windowWidth;constructor(e){this.divId=e}}class _r{options;constructor(e){this.options=e}}class Kr{dataViewConfigs;tools;binders;viewOnFirstLoadItem;defaultCharacterSet;overlayConfig;rootDocument;constructor(e){this.dataViewConfigs=e}}class Jr{#bi=null;#ua=null;#da=null;#ha=null;#Sa=null;#ga=null;#sn=new xn;#ma={};#Oe=new Ze;getImage(e){let t;return void 0!==this.#ua.get(e)&&(t=this.#ua.get(e).image),t}setImage(e,t){this.#ua.setImage(e,t)}addNewImage(e,t,n){const i=this.#ua.getNextDataId();return this.#Re({type:"loadstart",loadtype:"image",source:n,dataid:i}),this.#ua.addNew(i,new xi(t,e)),this.#Re({type:"loaditem",loadtype:"image",data:t,source:n,dataid:i,isfirstitem:!0}),this.#bi.viewOnFirstLoadItem&&this.render(i),this.#Re({type:"load",loadtype:"image",source:n,dataid:i}),this.#Re({type:"loadend",loadtype:"image",source:n,dataid:i}),i}getMetaData(e){let t;return void 0!==this.#ua.get(e)&&(t=this.#ua.get(e).meta),t}getDataIds(){return this.#ua.getDataIds()}getDataIdsFromSopUids(e){return this.#ua.getDataIdsFromSopUids(e)}canScroll(){return this.#Sa.getActiveLayerGroup().getActiveViewLayer().getViewController().canScroll()}canWindowLevel(){return this.#Sa.getActiveLayerGroup().getActiveViewLayer().getViewController().canWindowLevel()}getAddedScale(){return this.#Sa.getActiveLayerGroup().getAddedScale()}getBaseScale(){return this.#Sa.getActiveLayerGroup().getBaseScale()}getOffset(){return this.#Sa.getActiveLayerGroup().getOffset()}getToolboxController(){return this.#da}getActiveLayerGroup(){return this.#Sa.getActiveLayerGroup()}setActiveLayerGroup(e){this.#Sa.setActiveLayerGroup(e)}getViewLayersByDataId(e){return this.#Sa.getViewLayersByDataId(e)}getDrawLayersByDataId(e){return this.#Sa.getDrawLayersByDataId(e)}getLayerGroupByDivId(e){return this.#Sa.getLayerGroupByDivId(e)}getNumberOfLayerGroups(){return this.#Sa.getNumberOfLayerGroups()}getStyle(){return this.#sn}addToUndoStack=e=>{null!==this.#ga&&this.#ga.add(e)};init(e){if(this.#bi=e,void 0===this.#bi.viewOnFirstLoadItem&&(this.#bi.viewOnFirstLoadItem=!0),void 0===this.#bi.dataViewConfigs&&(this.#bi.dataViewConfigs={}),void 0===this.#bi.rootDocument&&(this.#bi.rootDocument=document),this.#ga=new pi,this.#ga.addEventListener("undoadd",this.#Re),this.#ga.addEventListener("undo",this.#Re),this.#ga.addEventListener("redo",this.#Re),void 0!==this.#bi.tools){const e={},t=Object.keys(this.#bi.tools);for(let n=0;n<t.length;++n){const i=t[n];let r=pr[i];if(void 0===r&&(r=mr[i]),void 0!==r){if(e[i]=new r(this),void 0!==e[i].addEventListener){const t=e[i].getEventNames();for(let n=0;n<t.length;++n)e[i].addEventListener(t[n],this.#Re)}const t=this.#bi.tools[i];if(void 0!==t.options&&0!==t.options.length){let n,r="raw";if(void 0!==e[i].getOptionsType&&(r=e[i].getOptionsType()),"instance"===r||"factory"===r){n={};for(let e=0;e<t.options.length;++e){const o=t.options[e];let a=o;"factory"===r&&(a+="Factory");const s=i.charAt(0).toLowerCase()+i.slice(1);void 0!==fr[s][a]?n[o]=fr[s][a]:c.warn("Could not find option class for: "+o)}}else n=t.options;e[i].setOptions(n)}}else c.warn("Could not initialise unknown tool: "+i)}this.#da=new fi(e)}this.#ha=new Gi(this.#bi.defaultCharacterSet),this.#ha.onloadstart=this.#pa,this.#ha.onprogress=this.#fa,this.#ha.onloaditem=this.#Da,this.#ha.onload=this.#ya,this.#ha.onloadend=this.#Ca,this.#ha.onerror=this.#va,this.#ha.onabort=this.#Ia,this.#ua=new Ri,this.#Sa=new li,void 0!==this.#bi.binders&&this.#Sa.setBinders(this.#bi.binders)}reset(){this.#Sa.empty(),this.#ma={},this.#ga&&(this.#ga=new pi,this.#ga.addEventListener("undoadd",this.#Re),this.#ga.addEventListener("undo",this.#Re),this.#ga.addEventListener("redo",this.#Re))}resetLayout(){this.#Sa.reset(),this.#Sa.draw()}addEventListener(e,t){this.#Oe.add(e,t)}removeEventListener(e,t){this.#Oe.remove(e,t)}loadFiles=e=>{const t=this.#ua.getNextDataId();0!==e.length?this.#ha.loadFiles(e,t):c.warn("Ignoring empty input file list.")};loadURLs=(e,t)=>{const n=this.#ua.getNextDataId();0!==e.length?this.#ha.loadURLs(e,n,t):c.warn("Ignoring empty input url list.")};loadFromUri=(e,t)=>{const n=function(e){const t=mi(e);return 0===Object.keys(t).length?null:t.query}(e),i=()=>{this.removeEventListener("loadend",i),this.loadURLs([n.state])};n&&void 0!==n.input&&(void 0!==n.state&&this.addEventListener("loadend",i),function(e,t,n){e.type&&"manifest"===e.type?function(e,t){let n="";"/"===e.input[0]&&(n=window.location.protocol+"//"+window.location.host),n+=e.input;const i=new XMLHttpRequest;i.open("GET",decodeURIComponent(n),!0),i.responseType="document",i.onload=function(n){t(function(e,t){const n=[],i=e.getElementsByTagName("wado_query")[0].getAttribute("wadoURL")+"?requestType=WADO&contentType=application/dicom&",r=e.getElementsByTagName("Patient");r.length>1&&c.warn("More than one patient, loading first one.");const o=r[0].getElementsByTagName("Study");o.length>1&&c.warn("More than one study, loading first one.");const a=o[0].getAttribute("StudyInstanceUID"),s=o[0].getElementsByTagName("Series");s.length>1&&c.warn("More than one series, loading first one.");const l=s[0].getAttribute("SeriesInstanceUID"),u=s[0].getElementsByTagName("Instance");let d=u.length;t<d&&(d=t);for(let e=0;e<d;++e){const t=i+"&studyUID="+a+"&seriesUID="+l+"&objectUID="+u[e].getAttribute("SOPInstanceUID");n.push(t)}return n}(n.target.responseXML,e.nslices))},i.onerror=function(e){c.warn("RequestError while receiving manifest: "+e.target.status)},i.send(null)}(e,t):t(function(e,t){const n=[];let i="key";t&&(i=t);const r=decodeURIComponent(e),o=mi(r);if(0===Object.keys(o).length)n.push(r);else{const e=Object.keys(o.query);let t=null;for(let n=0;n<e.length;++n)if(o.query[e[n]]instanceof Array){t=e[n];break}if(t){const r=o.query[t];let a=o.base;""!==a&&"file"!==t&&(a+="?");let s,l=!1;for(let n=0;n<e.length;++n)e[n]!==t&&(l&&(a+="&"),a+=e[n]+"="+o.query[e[n]],l=!0);for(let e=0;e<r.length;++e)s=a,l&&(s+="&"),"key"===i&&(s+=t+"="),s+=r[e],n.push(s)}else n.push(r)}return n}(e.input,e.dwvReplaceMode),n)}(n,this.loadURLs,t))};loadImageObject=e=>{const t=this.#ua.getNextDataId();this.#ha.loadImageObject(e,t)};abortAllLoads(){const e=this.#ha.getLoadingDataIds();for(const t of e)this.abortLoad(t)}abortLoad(e){this.#ha.abort(e),this.#ua.remove(e),this.#Sa.removeLayersByDataId(e)}fitToContainer(){this.#Sa.fitToContainer()}initWLDisplay(){this.#Sa.getActiveLayerGroup().getActiveViewLayer().getViewController().initialise()}setImageSmoothing(e){this.#Sa.setImageSmoothing(e),this.#Sa.draw()}getViewConfigs(e,t){if(null===this.#bi.dataViewConfigs||void 0===this.#bi.dataViewConfigs)throw new Error("No available data view configuration");let n=[];return void 0!==this.#bi.dataViewConfigs[e]?n=this.#bi.dataViewConfigs[e]:t||void 0===this.#bi.dataViewConfigs["*"]||(n=this.#bi.dataViewConfigs["*"]),n}getViewConfig(e,t,n){return this.getViewConfigs(e,n).find((function(e){return e.divId===t}))}getDataViewConfigs(){return this.#bi.dataViewConfigs}setDataViewConfigs(e){this.#Sa.empty(),this.#bi.dataViewConfigs=e,this.#Ta(e)}addDataViewConfig(e,t){const n=this.#bi.dataViewConfigs;if(void 0===n[e]&&(n[e]=[]),-1!==n[e].findIndex((function(e){return e.divId===t.divId})))throw new Error("Duplicate view config for data "+e+" and div "+t.divId);this.#bi.dataViewConfigs[e].push(t),void 0===this.#Sa.getLayerGroupByDivId(t.divId)&&this.#La(t),void 0!==this.#ua.get(e)&&this.render(e,[t])}removeDataViewConfig(e,t){const n=this.#bi.dataViewConfigs;if(void 0===n[e])return;const i=n[e].findIndex((function(e){return e.divId===t}));if(-1!==i&&(n[e].splice(i,1),0===n[e].length&&delete n[e],void 0!==this.#ua.get(e))){const n=this.#Sa.getLayerGroupByDivId(t);if(void 0!==n){const t=n.getViewLayersByDataId(e);1===t.length&&n.removeLayer(t[0]);const i=n.getDrawLayersByDataId(e);if(1===i.length&&n.removeLayer(i[0]),0===t.length&&0===i.length)throw new Error("Expected one layer, got none");0===n.getNumberOfLayers()&&this.#Sa.removeLayerGroup(n)}}}updateDataViewConfig(e,t,n){const i=this.#bi.dataViewConfigs;if(void 0===i[e])throw new Error("No config for dataId: "+e);const r=i[e].findIndex((function(e){return e.divId===t}));if(-1===r)throw new Error("No config for dataId: "+e+" and divId: "+t);const o=i[e][r];for(const e in n)o[e]=n[e];const a=this.#Sa.getLayerGroupByDivId(o.divId);if(void 0!==a){const t=a.getViewLayersByDataId(e);1===t.length&&a.removeLayer(t[0]);const n=a.getDrawLayersByDataId(e);if(1===n.length&&a.removeLayer(n[0]),0===t.length&&0===n.length)throw new Error("Expected one layer, got none")}void 0!==this.#ua.get(e)&&this.render(e,[o])}#Ta(e){const t=Object.keys(e),n=[];for(let i=0;i<t.length;++i){const r=e[t[i]];for(let e=0;e<r.length;++e){const t=r[e];n.includes(t.divId)||(this.#La(t),n.push(t.divId))}}}#La(e){const t=this.#bi.rootDocument.getElementById(e.divId),n=this.#Sa.addLayerGroup(t);this.#Pa(n)}setLayerGroupsBinders(e){const t=[];for(let n=0;n<e.length;++n)void 0!==si[e[n]]&&t.push(new si[e[n]]);this.#Sa.setBinders(t)}render(e,t){if(null==e)throw new Error("Cannot render without data id");const n=void 0!==this.getImage(e);let i=!1;if(n||void 0===(new jr).checkElements(this.#ua.get(e).meta)&&(i=!0),0===this.#Sa.getNumberOfLayerGroups()&&this.#Ta(this.#bi.dataViewConfigs),void 0===t&&(t=this.getViewConfigs(e)),0!==t.length)for(let r=0;r<t.length;++r){const o=t[r],a=this.#Sa.getLayerGroupByDivId(o.divId);if(!a)throw new Error("No layer group for "+o.divId);void 0!==this.#ua.get(e)&&0===a.getViewLayersByDataId(e).length&&(n?this.#wa(e,o):i&&this.addDrawLayer(e,o)),a.draw()}else c.info("Not rendering data: "+e+" (no data view config)")}zoom(e,t,n){const i=this.#Sa.getActiveLayerGroup(),r=i.getActiveViewLayer().getViewController().getCurrentScrollPosition(),o=new E(t,n,r);i.addScale(e,o),i.draw()}translate(e,t){const n=this.#Sa.getActiveLayerGroup();n.addTranslation({x:e,y:t,z:0}),n.draw()}setOpacity(e){const t=this.#Sa.getActiveLayerGroup().getActiveViewLayer();t.setOpacity(e),t.draw()}setDrawings(e,t){}getJsonState(){return(new ci).toJSON(this)}applyJsonState(e){const t=new ci;t.apply(this,t.fromJSON(e))}onResize=()=>{this.fitToContainer()};onKeydown=e=>{this.#Re(e)};defaultOnKeydown=e=>{if(e.ctrlKey)if(e.shiftKey){const t=this.#Sa.getActiveLayerGroup(),n=t.getActiveViewLayer().getViewController();"ArrowLeft"===e.key?n.moreThanOne(3)&&n.decrementIndex(3):"ArrowUp"===e.key?t.canScroll()&&n.incrementScrollIndex():"ArrowRight"===e.key?t.moreThanOne(3)&&n.incrementIndex(3):"ArrowDown"===e.key&&t.canScroll()&&n.decrementScrollIndex()}else if("y"===e.key)this.#ga.redo();else if("z"===e.key)this.#ga.undo();else if(" "===e.key)for(let e=0;e<this.#Sa.getNumberOfLayerGroups();++e)this.#Sa.getLayerGroup(e).setShowCrosshair(!this.#Sa.getLayerGroup(e).getShowCrosshair())};resetDisplay(){this.resetLayout(),this.initWLDisplay()}resetZoom(){this.resetLayout()}setColourMap(e){this.#Sa.getActiveLayerGroup().getActiveViewLayer().getViewController().setColourMap(e)}setWindowLevelPreset(e){this.#Sa.getActiveLayerGroup().getActiveViewLayer().getViewController().setWindowLevelPreset(e)}setTool(e){for(let t=0;t<this.#Sa.getNumberOfLayerGroups();++t){const n=this.#Sa.getLayerGroup(t);let i=null;if("Draw"===e||"Livewire"===e||"Floodfill"===e){if(void 0===n.getActiveDrawLayer()){const e=n.getActiveViewLayer(),t=this.getViewConfig(e.getDataId(),n.getDivId());this.addDrawLayer(void 0,t)}i=n.getActiveDrawLayer()}else i=n.getActiveViewLayer();i&&this.#da.bindLayerGroup(n,i)}this.#da.setSelectedTool(e)}setToolFeatures(e){this.#da.setToolFeatures(e)}undo(){this.#ga.undo()}redo(){this.#ga.redo()}getStackSize(){return this.#ga.getStackSize()}getCurrentStackIndex(){return this.#ga.getCurrentStackIndex()}getOverlayData(e){let t;return void 0!==this.#ma&&(t=this.#ma[e]),t}toggleOverlayListeners(e){const t=this.getOverlayData(e);void 0!==t&&(t.isListening()?t.removeAppListeners():t.addAppListeners())}#Re=e=>{this.#Oe.fireEvent(e)};#pa=e=>{void 0!==this.#bi.overlayConfig&&(this.#ma[e.dataid]=new Wi(this,e.dataid,this.#bi.overlayConfig)),e.type="loadstart",this.#Re(e)};#fa=e=>{e.type="loadprogress",this.#Re(e)};#Da=e=>{void 0===e.data&&c.error("Missing loaditem event data."),void 0===e.loadtype&&c.error("Missing loaditem event load type.");const t=e.isfirstitem;let n=null;"image"===e.loadtype?(t?this.#ua.addNew(e.dataid,e.data):this.#ua.update(e.dataid,e.data),n=e.data.meta):"state"===e.loadtype&&(this.applyJsonState(e.data),n="state"),this.#Re({type:"loaditem",data:n,source:e.source,loadtype:e.loadtype,dataid:e.dataid,isfirstitem:e.isfirstitem,warn:e.warn}),void 0!==this.#ma&&void 0!==this.#ma[e.dataid]&&this.#ma[e.dataid].addItemMeta(n),"image"===e.loadtype&&0!==this.getViewConfigs(e.dataid).length&&t&&this.#bi.viewOnFirstLoadItem&&this.render(e.dataid)};#ya=e=>{e.type="load",this.#Re(e)};#Ca=e=>{e.type="loadend",this.#Re(e)};#va=e=>{void 0===e.type&&(e.type="error"),this.#Re(e)};#Ia=e=>{void 0===e.type&&(e.type="abort"),this.#Re(e)};#Pa(e){e.addEventListener("zoomchange",this.#Re),e.addEventListener("offsetchange",this.#Re),e.addEventListener("renderstart",this.#Re),e.addEventListener("renderend",this.#Re);for(let t=0;t<In.length;++t)e.addEventListener(In[t],this.#Re);this.#da&&this.#da.hasTool("Draw")&&(e.addEventListener("drawcreate",this.#Re),e.addEventListener("drawdelete",this.#Re)),e.addEventListener("wlchange",(e=>{const t=ni(e.srclayerid).groupDivId,n=this.getViewConfig(e.dataid,t,!0);void 0!==n&&(n.windowCenter=void 0,n.windowWidth=void 0,n.wlPresetName=void 0,2===e.value.length&&(n.windowCenter=e.value[0],n.windowWidth=e.value[1]),3===e.value.length&&(n.wlPresetName=e.value[2]))})),e.addEventListener("opacitychange",(e=>{const t=ni(e.srclayerid).groupDivId,n=this.getViewConfig(e.dataid,t,!0);void 0!==n&&(n.opacity=e.value[0])})),e.addEventListener("colourmapchange",(e=>{const t=ni(e.srclayerid).groupDivId,n=this.getViewConfig(e.dataid,t,!0);void 0!==n&&(n.colourMap=e.value[0])}))}#wa(e,t){const n=this.#ua.get(e);if(!n)throw new Error("Cannot initialise layer with missing data, id: "+e);const i=this.#Sa.getLayerGroupByDivId(t.divId);if(!i)throw new Error("Cannot initialise layer with missing group, id: "+t.divId);const r=n.image.getGeometry();this.#Sa.unbindLayerGroups();const o=(new vn).create(n.meta,n.image),a=ri(r.getOrientation(),we(t.orientation));o.setOrientation(a),"SEG"===n.image.getMeta().Modality&&o.setAlphaFunction((function(e){return 0===e[0]&&0===e[1]&&0===e[2]?0:255}));const s=0===i.getNumberOfViewLayers();let l=1;void 0!==t.opacity?l=t.opacity:s||(l=.5);const c=i.addViewLayer();c.setView(o,e);const d=r.getSize(a).get2D(),h=r.getSpacing(a).get2D();c.initialise(d,h,l);const S=c.getViewController();if(void 0!==t.wlPresetName)S.setWindowLevelPreset(t.wlPresetName);else if(void 0!==t.windowCenter&&void 0!==t.windowWidth){const e=new u(t.windowCenter,t.windowWidth);S.setWindowLevel(e)}void 0!==t.colourMap?S.setColourMap(t.colourMap):s||("PT"===n.image.getMeta().Modality?S.setColourMap("hot"):S.setColourMap("rainbow")),this.#ua.addEventListener("imageset",c.onimageset);const g=[S.getCurrentIndex().getValues(),S.getCurrentPosition().getValues()];i.updateLayersToPositionChange({value:g,srclayerid:c.getId()}),this.#Sa.fitToContainer(),c.setOffset(i.getOffset());const m=this.#Oa(r.getOrientation(),t.orientation);if(this.#Aa(m,c),s)c.setScale(i.getScale());else{const e=i.getBaseViewLayer();c.initScale(i.getScale(),e.getAbsoluteZoomOffset())}this.#Sa.bindLayerGroups(),this.#da&&this.#da.bindLayerGroup(i,c),s&&this.#da&&this.#da.init()}addDrawLayer(e,t){const n=this.#Sa.getLayerGroupByDivId(t.divId);if(!n)throw new Error("Cannot initialise layer with missing group, id: "+t.divId);let i,r;if(void 0===e)i=n.getActiveViewLayer().getDataId();else{if(r=this.#ua.get(e),!r)throw new Error("Cannot initialise layer with missing data, id: "+e);const t=r.meta["0020000D"].value[0],o=n.searchViewLayers({StudyInstanceUID:t});if(0===o.length)return void console.warn("No loaded data that matches the measurement study UID");i=o[0].getDataId()}const o=this.#ua.get(i);if(!o)throw new Error("Cannot initialise layer with missing reference data, id: "+i);const a=o.image.getGeometry(),s=ri(a.getOrientation(),we(t.orientation)),l=a.getSize(s).get2D(),c=a.getSpacing(s).get2D(),u=n.addDrawLayer();u.initialise(l,c);const d=new Pn(a.getRealSpacing(),a.getOrientation(),s);u.setPlaneHelper(d),this.#Sa.fitToContainer();const h=this.#Oa(a.getOrientation(),t.orientation);if(this.#Aa(h,u),u.setScale(n.getScale()),void 0!==r){const t=new jr,o=n.getViewLayersByDataId(i)[0].getViewController(),a=t.create(r.meta,o);u.setAnnotationList(a,e,this.#Re,this.addToUndoStack),u.setCurrentPosition(o.getCurrentPosition(),o.getCurrentIndex())}else{const e=this.#ua.getNextDataId();u.setAnnotationList(new Gn,e)}}#Oa(e,t){const n=Oe(e.asOneAndZeros());if(void 0===n)throw new Error("Unsupported undefined orientation code");const i=void 0===t,r=!i&&t===Pe.Axial,o=!i&&t===Pe.Coronal,a=!i&&t===Pe.Sagittal,s={x:!1,y:!1},l={x:!1,y:!1,z:!1};return"LPS"===n?(o||a)&&(l.z=!0,s.y=!0):"LAI"===n?i||r?s.y=!0:o?l.z=!0:a&&(l.z=!0,s.x=!0):"RPI"===n?i||r?s.x=!0:o?(l.z=!0,s.x=!0):a&&(l.z=!0):"RAS"===n?(s.x=!0,s.y=!0,(o||a)&&(l.z=!0)):"LSA"===n?(s.y=!0,i||o?l.z=!0:r?l.y=!0:a&&(s.x=!0,l.y=!0,l.z=!0)):"RSP"===n?i||o?(s.x=!0,s.y=!0,l.x=!0,l.z=!0):r?(s.x=!0,l.x=!0):a&&(s.y=!0,l.z=!0):"RIA"===n?(s.x=!0,i||o?l.x=!0:r?(s.y=!0,l.x=!0,l.y=!0):a&&(l.y=!0)):"PSL"===n?(l.z=!0,(i||a||o)&&(s.y=!0)):"PIR"===n?(l.z=!0,(r||o)&&(s.x=!0)):"ASR"===n?(s.x=!0,s.y=!0,(i||a||o)&&(l.z=!0)):"AIL"===n?i||a?(s.x=!0,l.z=!0):r?s.y=!0:o&&(l.z=!0):c.warn("Unsupported orientation code: "+n+", display could be incorrect"),{scale:l,offset:s}}#Aa(e,t){e.offset.x&&t.addFlipOffsetX(),e.offset.y&&t.addFlipOffsetY(),e.scale.x&&t.flipScaleX(),e.scale.y&&t.flipScaleY(),e.scale.z&&t.flipScaleZ()}}class $r{#No;#ba;constructor(e){this.#No=e;const t=e.getMeta();void 0===t.custom&&(t.custom={}),void 0===t.custom.segments&&(t.custom.segments=[]),this.#ba=t.custom.segments}#xa(e){return this.#ba.findIndex((function(t){return t.number===e}))}hasSegment(e){return-1!==this.#xa(e)}maskHasSegments(e){const t=[],n=[];for(let i=0;i<e.length;++i){const r=this.getSegment(e[i]);void 0!==r?void 0!==r.displayValue?t.push(r.displayValue):t.push(r.displayRGBValue):(c.warn("Unknown segment in maskHasSegments: "+e[i]),n.push(i))}const i=this.#No.hasValues(t);for(let e=0;e<n.length;++e)i.splice(n[e],0,!1);return i}getSegment(e){let t;const n=this.#xa(e);return-1!==n&&(t=this.#ba[n]),t}addSegment(e){-1===this.#xa(e.number)?this.#ba.push(e):c.warn("Not adding segment, it is allready in the segments list: "+e.number)}removeSegment(e){const t=this.#xa(e);-1!==t?this.#ba.splice(t,1):c.warn("Cannot remove segment, it is not in the segments list: "+e)}updateSegment(e){const t=this.#xa(e.number);-1!==t?this.#ba[t]=e:c.warn("Cannot update segment, it is not in the segments list: "+e.number)}}class eo{#No;#Ra;#Jt;#Fa;constructor(e,t,n){this.#No=e,this.#Ra=t,this.#Jt=void 0!==n&&n,void 0!==t.displayRGBValue?this.#Fa=e.getOffsets(t.displayRGBValue):this.#Fa=e.getOffsets(t.displayValue)}getName(){return"Delete-segment"}isValid(){return this.#No.getMeta().custom.segments.some((e=>e.number===this.#Ra.number))}execute(){0!==this.#Fa.length&&(void 0!==this.#Ra.displayRGBValue?this.#No.setAtOffsets(this.#Fa,C):this.#No.setAtOffsets(this.#Fa,0)),new $r(this.#No).removeSegment(this.#Ra.number),this.#Jt||this.onExecute({type:"masksegmentdelete",segmentnumber:this.#Ra.number})}undo(){0!==this.#Fa.length&&(void 0!==this.#Ra.displayRGBValue?this.#No.setAtOffsets(this.#Fa,this.#Ra.displayRGBValue):this.#No.setAtOffsets(this.#Fa,this.#Ra.displayValue)),new $r(this.#No).addSegment(this.#Ra),this.onUndo({type:"masksegmentredraw",segmentnumber:this.#Ra.number})}onExecute(e){}onUndo(e){}}class to{#No;#Ra;#Ea;#qa;#Jt;#Fa;constructor(e,t,n,i){this.#No=e,this.#Ra=t,this.#Ea=n,this.#Jt=void 0!==i&&i,void 0!==t.displayRGBValue?this.#qa=t.displayRGBValue:this.#qa=t.displayValue,this.#Fa=e.getOffsets(this.#qa)}getName(){return"Change-segment-colour"}isValid(){return 0!==this.#Fa.length}execute(){this.#No.setAtOffsets(this.#Fa,this.#Ea),"number"==typeof this.#Ea?this.#Ra.displayValue=this.#Ea:this.#Ra.displayRGBValue=this.#Ea,this.#Jt||this.onExecute({type:"changemasksegmentcolour",segmentnumber:this.#Ra.number,value:[this.#Ea]})}undo(){this.#No.setAtOffsets(this.#Fa,this.#qa),"number"==typeof this.#qa?this.#Ra.displayValue=this.#qa:this.#Ra.displayRGBValue=this.#qa,this.onUndo({type:"changemasksegmentcolour",segmentnumber:this.#Ra.number,value:[this.#qa]})}onExecute(e){}onUndo(e){}}class no{#Ua=[];#Ma;#Qa(e){return this.#Ua.findIndex((function(t){return t.number===e}))}isHidden(e){return-1!==this.#Qa(e)}addToHidden(e){this.isHidden(e.number)?c.warn("Not hidding segment, it is allready in the hidden list: "+e.number):(this.#Ua.push(e),this.#Ma=void 0!==e.displayValue)}removeFromHidden(e){const t=this.#Qa(e);-1!==t?this.#Ua.splice(t,1):c.warn("Cannot remove segment, it is not in the hidden list: "+e)}getAlphaFunc(){const e=[];this.#Ma?e[0]=0:e[0]={r:0,g:0,b:0};for(const t of this.#Ua)this.#Ma?e.push(t.displayValue):e.push(t.displayRGBValue);let t;return t=this.#Ma?function(t){for(let n=0;n<e.length;++n)if(t===e[n])return 0;return 255}:function(t){for(let n=0;n<e.length;++n)if(t[0]===e[n].r&&t[1]===e[n].g&&t[2]===e[n].b)return 0;return 255},t}}class io{x;y}class ro{x;y;z}return a}()}));
2
2
  //# sourceMappingURL=dwv.min.js.map