dwv 0.35.0-beta.9 → 0.35.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/assets/workers/jpeg2000.worker.min.js +2 -0
- package/dist/assets/workers/jpeg2000.worker.min.js.map +1 -0
- package/dist/assets/workers/jpegbaseline.worker.min.js +2 -0
- package/dist/assets/workers/jpegbaseline.worker.min.js.map +1 -0
- package/dist/assets/workers/jpegloss.worker.min.js +2 -0
- package/dist/assets/workers/jpegloss.worker.min.js.map +1 -0
- package/dist/assets/workers/labeling.worker.min.js +2 -0
- package/dist/assets/workers/labeling.worker.min.js.map +1 -0
- package/dist/assets/workers/rle.worker.min.js +2 -0
- package/dist/assets/workers/rle.worker.min.js.map +1 -0
- package/dist/dwv.d.ts +394 -116
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/dist/dwv.node.min.js +2 -0
- package/dist/dwv.node.min.js.map +1 -0
- package/package.json +33 -23
- package/readme.md +1 -1
- package/decoders/dwv/decode-rle.js +0 -23
- package/decoders/dwv/rle.js +0 -129
- package/decoders/pdfjs/arithmetic_decoder.js +0 -185
- package/decoders/pdfjs/decode-jpeg2000.js +0 -18
- package/decoders/pdfjs/decode-jpegbaseline.js +0 -18
- package/decoders/pdfjs/jpg.js +0 -1072
- package/decoders/pdfjs/jpx.js +0 -2237
- package/decoders/pdfjs/readme.md +0 -14
- package/decoders/pdfjs/util.js +0 -1588
- package/decoders/rii-mango/decode-jpegloss.js +0 -34
- package/decoders/rii-mango/lossless-min.js +0 -1
- package/decoders/rii-mango/lossless.js +0 -1756
- package/decoders/rii-mango/readme.md +0 -11
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"konva";import*as t from"magic-wand-tool";import*as n from"jszip";var i={m:{},d:(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u:e=>"assets/workers/"+{112:"jpegloss.worker",326:"rle.worker",391:"labeling.worker",557:"jpeg2000.worker",968:"jpegbaseline.worker"}[e]+".min.js",o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),i.b=new URL("./",import.meta.url);class o{#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 o(t)}#t(e,t){const n=this.#e.slice();return e<n.length?n[e]+=t:console.warn("Cannot add to given dimension: ",e,n.length),new o(n)}next(e){return this.#t(e,1)}previous(e){return this.#t(e,-1)}getWithNew2D(e,t){const n=[e,t];for(let e=2,t=this.length();e<t;++e)n.push(this.get(e));return new o(n)}}class r{#n;#i;#o;#r;constructor(e,t){if(this.#n=e,this.#i=e.isID(),this.#o=Math.pow(2,t),!this.#i){this.#r=new Float32Array(this.#o);for(let e=0;e<this.#o;++e)this.#r[e]=this.#n.apply(e)}}getRSI(){return this.#n}getLength(){return this.#o}getValue(e){return this.#i?e:this.#r[e]}}class a{#a;#s;#r;#l=0;#c=!0;constructor(e,t,n){if(this.#a=e,t){const e=this.#a.getLength();this.#l=e/2}else this.#l=0;this.#c=n}getVoiLut(){return this.#s}getModalityLut(){return this.#a}setVoiLut(e){if(this.#s=e,this.#s.setSignedOffset(this.#a.getRSI().getSlope()*this.#l),this.#c){const e=this.#a.getLength();this.#r=new Uint8ClampedArray(e);for(let t=0;t<e;++t)this.#r[t]=this.#s.apply(this.#a.getValue(t))}}getValue(e){return this.#c?this.#r[e+this.#l]:Math.floor(this.#s.apply(e+this.#l))}}function s(e){const t=[];for(let n=0;n<256;++n)t.push(e(n));return t}function l(e){return e}function c(e){return 255-e}class u{red;green;blue;constructor(e,t,n){this.red=e,this.green=t,this.blue=n}}const d={plain:{red:s(l),green:s(l),blue:s(l)},invPlain:{red:s(c),green:s(c),blue:s(c)},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:s((function(e){const t=3*e;return t>255?255:t})),green:s((function(e){const t=256/3;let n=0;return e>=t&&(n=3*(e-t),n>255)?255:n})),blue:s((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]}},h={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)}},g={linear:"LINEAR",linear_exact:"LINEAR_EXACT",sigmoid:"SIGMOID"};class S{#u;#d;#h=0;#g=255;#S;#m;constructor(e,t,n){void 0===n&&(n=!1);let i=e,o=t;n||(i-=.5,o-=1),this.#u=i-o/2,this.#d=i+o/2,this.#S=(this.#g-this.#h)/o,this.#m=(-i/o+.5)*(this.#g-this.#h)+this.#h}getY(e){let t;return t=e<=this.#u?this.#h:e>this.#d?this.#g:e*this.#S+this.#m,t}}class m{#h=0;#g=255;#p;#f;constructor(e,t){this.#p=e,this.#f=t}getY(e){return(this.#g-this.#h)/(1+Math.exp(-4*(e-this.#p)/this.#f))+this.#h}}class p{#D;#v=0;#y;#C=g.linear;constructor(e,t){if(this.#D=e,void 0!==t){const e=[];for(const t in g)e.push(g[t]);e.includes(t)?this.#C=t:h.debug("Unknown VOI LUT function: "+t)}this.#I()}getWindowLevel(){return this.#D}#I(){const e=this.#D.center,t=this.#D.width,n=e+this.#v;this.#C===g.linear_exact?this.#y=new S(n,t,!0):this.#C===g.sigmoid?this.#y=new m(n,t):this.#y=new S(n,t)}setSignedOffset(e){this.#v=e,this.#I()}apply(e){return this.#y.getY(e)}}function f(e,t,n){if(void 0===e)return;let i=e.center;i=Math.min(i,t.max),i=Math.max(i,t.min);let o=1;void 0===n||n!==g.linear_exact&&n!==g.sigmoid||(o=0);let r=e.width;return r=Math.max(r,o),r=Math.min(r,t.max-t.min),new D(i,r)}class D{center;width;constructor(e,t){this.center=e,this.width=t}equals(e){return null!=e&&this.center===e.center&&this.width===e.width}}class v{r;g;b;constructor(e,t,n){this.r=e,this.g=t,this.b=n}}function y(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 C(e){return{r:parseInt(e.substring(1,3),16),g:parseInt(e.substring(3,5),16),b:parseInt(e.substring(5,7),16)}}function I(e){return"#"+((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}function T(e){return{l:655.35*e.l,a:257*e.a+32896,b:257*e.b+32896}}const L={x:95.0489,y:100,z:108.884};function P(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=L,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),o=t(e.b/255);return{x:100*(.4124*n+.3576*i+.1805*o),y:100*(.2126*n+.7152*i+.0722*o),z:100*(.0193*n+.1192*i+.9505*o)}}(e))}function w(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}const O={wlPresets:void 0,labelTexts:void 0,openRoiDialog:void 0,getTagTime:void 0,getTagPixelUnit:void 0},A={CT:{mediastinum:new D(40,400),lung:new D(-500,1500),bone:new D(500,2e3),brain:new D(40,80),head:new D(90,350)}};class b{create(e,t){const n=new X(t);"MONOCHROME1"===t.getPhotometricInterpretation()&&n.setColourMap("invPlain");let i={};void 0!==t.getMeta().windowPresets&&(i=t.getMeta().windowPresets),i.minmax={name:"minmax"};const o=t.getMeta().Modality;let r;r=void 0!==O.wlPresets&&void 0!==O.wlPresets[o]?O.wlPresets[o]:A[o];for(const e in r){const t=r[e];i[e]={wl:[new D(t.center,t.width)],name:e}}return n.setWindowPresets(i),n.init(),n}}class x{#T;#L;#P;constructor(e,t,n){this.#T=e,this.#L=t,this.#P=n}getX(){return this.#T}getY(){return this.#L}getZ(){return this.#P}equals(e){return null!==e&&this.#T===e.getX()&&this.#L===e.getY()&&this.#P===e.getZ()}toString(){return"("+this.#T+", "+this.#L+", "+this.#P+")"}norm(){return Math.sqrt(this.#T*this.#T+this.#L*this.#L+this.#P*this.#P)}crossProduct(e){return new x(this.#L*e.getZ()-e.getY()*this.#P,this.#P*e.getX()-e.getZ()*this.#T,this.#T*e.getY()-e.getX()*this.#L)}dotProduct(e){return this.#T*e.getX()+this.#L*e.getY()+this.#P*e.getZ()}isCodirectional(e){return this.dotProduct(e)>0}}class R{#T;#L;constructor(e,t){this.#T=e,this.#L=t}getX(){return this.#T}getY(){return this.#L}getValues(){return[this.#T,this.#L]}getCentroid(){return this}equals(e){return null!=e&&this.#T===e.getX()&&this.#L===e.getY()}toString(){return"("+this.#T+", "+this.#L+")"}getDistance(e){const t=this.#T-e.getX(),n=this.#L-e.getY();return Math.sqrt(t*t+n*n)}}class F{#T;#L;#P;constructor(e,t,n){this.#T=e,this.#L=t,this.#P=n}getX(){return this.#T}getY(){return this.#L}getZ(){return this.#P}getValues(){return[this.#T,this.#L,this.#P]}equals(e){return null!==e&&this.#T===e.getX()&&this.#L===e.getY()&&this.#P===e.getZ()}isSimilar(e,t){return null!==e&&U(this.#T,e.getX(),t)&&U(this.#L,e.getY(),t)&&U(this.#P,e.getZ(),t)}toString(){return"("+this.#T+", "+this.#L+", "+this.#P+")"}getDistance(e){return Math.sqrt(this.#w(e))}#w(e){const t=this.#T-e.getX(),n=this.#L-e.getY(),i=this.#P-e.getZ();return t*t+n*n+i*i}getClosest(e){let t=0,n=this.#w(e[t]);for(let i=0;i<e.length;++i){const o=this.#w(e[i]);o<n&&(t=i,n=o)}return t}minus(e){return new x(this.#T-e.getX(),this.#L-e.getY(),this.#P-e.getZ())}}class E{#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 F(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 E(t)}mergeWith3D(e){const t=this.getValues();return t[0]=e.getX(),t[1]=e.getY(),t[2]=e.getZ(),new E(t)}}Number.EPSILON;const q=1e-4;function U(e,t,n){return void 0===n&&(n=Number.EPSILON),Math.abs(e-t)<n}class M{#e;#O;constructor(e){this.#e=e}get(e,t){return this.#e[3*e+t]}getInverse(){return void 0===this.#O&&(this.#O=function(e){const t=e.get(0,0),n=e.get(0,1),i=e.get(0,2),o=e.get(1,0),r=e.get(1,1),a=e.get(1,2),s=e.get(2,0),l=e.get(2,1),c=e.get(2,2),u=r*c-a*l,d=a*s-o*c,g=o*l-r*s;let S=t*u+n*d+i*g;if(0!==S)return S=1/S,new M([S*u,S*(i*l-n*c),S*(n*a-i*r),S*d,S*(t*c-i*s),S*(i*o-t*a),S*g,S*(n*s-t*l),S*(t*r-n*o)]);h.warn("Cannot invert 3*3 matrix with zero determinant.")}(this)),this.#O}equals(e){for(let t=0;t<3;++t)for(let n=0;n<3;++n)if(this.get(t,n)!==e.get(t,n))return!1;return!0}isSimilar(e,t){for(let n=0;n<3;++n)for(let i=0;i<3;++i)if(!U(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 o=0;for(let t=0;t<3;++t)o+=this.get(n,t)*e.get(t,i);t.push(o)}return new M(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 M(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 x(t[0],t[1],t[2])}multiplyPoint3D(e){const t=this.multiplyArray3D([e.getX(),e.getY(),e.getZ()]);return new F(t[0],t[1],t[2])}multiplyIndex3D(e){const t=this.multiplyArray3D(e.getValues());return new o(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 M(e)}getThirdColMajorDirection(){return this.getColAbsMax(2).index}}function Q(){return new M([1,0,0,0,1,0,0,0,1])}function N(e){return e.equals(Q())}function V(e,t,n,i,o,r,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);let l=t;a?(r*=-1,s?l-=(o-1)*i:i*=-1):s&&(l+=(o-1)*i,i*=-1);const c=r-o*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===o&&(d=0,l+=c),t}return{done:!0,index:l}}}}function B(e){const t=[];let n=e.next();for(;!n.done;)t.push(n.value),n=e.next();return t}function G(e,t,n,i){const r=e.getGeometry().getSize();let a=2;i&&void 0!==i&&(a=i.getColAbsMax(2).index);const s=t.getValues(),l=new o(s.map((function(e,t){return t===a||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),g=r.get(2);let S=r.getDimSize(2);const m=e.getNumberOfComponents(),p=1===e.getPlanarConfiguration(),f=function(e,t,n,i,o,r,a,s){return 1===m?V(e,t,n,i,o,r,a,s):3===m?function(e,t,n,i,o,r,a,s,l){const c=[];return l?(c.push(V(e,t,n,i,o,r,a,s)),c.push(V(e,t+n*i,n,i,o,r,a,s)),c.push(V(e,t+2*n*i,n,i,o,r,a,s))):(i*=3,r*=3,c.push(V(e,t,n,i,o,r,a,s)),c.push(V(e,t+1,n,i,o,r,a,s)),c.push(V(e,t+2,n,i,o,r,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,o,r,a,s,p):void 0};let D=null;if(i&&void 0!==i){const e=i.getColAbsMax(0),t=i.getColAbsMax(2),n=!1,o=!1;let r=null;if(2===t.index)r=d*h,D=0===e.index?f(u,c,r,1,d,d,n,o):f(u,c,r,d,h,1,n,o);else if(0===t.index)r=g*h,D=1===e.index?f(u,c,r,d,h,S,n,o):f(u,c,r,S,g,d,n,o);else{if(1!==t.index)throw new Error("Unknown direction: "+t.index);r=g*d,D=0===e.index?f(u,c,r,1,d,S,n,o):f(u,c,r,S,g,1,n,o)}}else if(1===e.getNumberOfComponents())D=function(e,t,n,i){void 0===i&&(i=1);let o=t;return{next:function(){if(o<n){const t={value:e(o),done:!1,index:o};return o+=i,t}return{done:!0,index:n}}}}(u,c,c+S);else{if(3!==e.getNumberOfComponents())throw new Error("Unsupported number of components: "+e.getNumberOfComponents());c*=3,S*=3,D=function(e,t,n,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);let r=t,a=1;o?a=(n-t)/3:i*=3;let s=r+a,l=r+2*a;return{next:function(){if(r<n){const t={value:[e(r),e(s),e(l)],done:!1,index:[r,s,l]};return r+=i,s+=i,l+=i,t}return{done:!0,index:[n]}}}}(u,c,c+S,1,p)}return D}function k(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].value,done:!1,index:n};return++n,t}return{done:!0,index:t}}}}class H{#A={};add(e,t){void 0===this.#A[e]&&(this.#A[e]=[]),this.#A[e].push(t)}remove(e,t){if(void 0===this.#A[e])return;let n=0;for(let i=0;i<this.#A[e].length;++i)this.#A[e][i]===t&&(++n,this.#A[e].splice(i,1));0===n&&h.debug("No callback found on remove listener for type "+e)}fireEvent=e=>{if(void 0===this.#A[e.type])return;const t=this.#A[e.type].slice();for(let n=0;n<t.length;++n)t[n](e)}}class z{#S;#m;constructor(e,t){this.#S=e,this.#m=t}getSlope(){return this.#S}getIntercept(){return this.#m}apply(e){return e*this.#S+this.#m}equals(e){return null!=e&&this.getSlope()===e.getSlope()&&this.getIntercept()===e.getIntercept()}isID(){return 1===this.getSlope()&&0===this.getIntercept()}}const W=["wlchange","wlpresetadd","colourmapchange","positionchange","opacitychange","alphafuncchange"];function Y(e,t){return(new b).create(e,t)}class X{#b;#x;#R;#F={minmax:{name:"minmax"}};#E=null;#q;#U="plain";#M=null;#Q;#N=new H;constructor(e){this.#b=e,this.#b.addEventListener("appendframe",(()=>{const e=this.getCurrentIndex();if(3===e.length()){const t=e.getValues();t.push(0),this.setCurrentIndex(new o(t))}}))}getImage(){return this.#b}setImage(e){this.#b=e}getOrientation(){return this.#Q}setOrientation(e){this.#Q=e}init(){this.setInitialIndex()}setInitialIndex(){const e=this.#b.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 o(t),!0)}getPlaybackMilliseconds(e){return e||(e=10),Math.round(1e3/e)}#V=function(e,t){return 255};getAlphaFunction(){return this.#V}setAlphaFunction(e){this.#V=e,this.#B({type:"alphafuncchange"})}#G(){if(this.#E&&void 0!==this.#F[this.#E]&&void 0!==this.#F[this.#E].perslice&&!0===this.#F[this.#E].perslice){this.getCurrentIndex()||this.setInitialIndex();const e=this.getCurrentIndex(),t=this.#b.getSecondaryOffset(e),n=this.#F[this.#E].wl[t];void 0!==n&&this.setWindowLevel(n,this.#E,!0)}if(void 0===this.#q&&this.setWindowLevelPresetById(0,!0),void 0===this.#R||this.#b.isConstantRSI()!==this.#R){let e,t;this.#R=this.#b.isConstantRSI(),this.#R?(e=this.#b.getRescaleSlopeAndIntercept(),t=!0):(e=new z(1,0),t=!1);const n=new r(e,this.#b.getMeta().BitsStored);this.#x=new a(n,1===this.#b.getMeta().PixelRepresentation,t)}const e=this.#x.getVoiLut();let t;if(void 0!==e&&(t=e.getWindowLevel()),void 0===e||!this.#q.equals(t)){const e=new p(this.#q,this.#b.getMeta().VOILUTFunction);this.#x.setVoiLut(e)}return this.#x}getWindowPresets(){return this.#F}getWindowPresetsNames(){return Object.keys(this.#F)}setWindowPresets(e){this.#F=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.#F[n]){if(void 0!==this.#F[n].perslice&&!0===this.#F[n].perslice)throw new Error("Cannot add perslice preset");this.#F[n]=e[n]}else this.#F[n]=e[n],this.#B({type:"wlpresetadd",name:n})}getCurrentWindowPresetName(){return this.#E}getColourMap(){return this.#U}#k(){return d[this.#U]}setColourMap(e){if(!d[e])throw new Error("Unknown colour map: '"+e+"'");this.#U=e,this.#B({type:"colourmapchange",value:[e]})}getCurrentPosition(){return this.#M}getCurrentIndex(){const e=this.getCurrentPosition();return e?this.getImage().getGeometry().worldToIndex(e):null}getCurrentImageUid(){return this.#b.getImageUid(this.getCurrentIndex())}getOriginForImageUid(e){return this.#b.getOriginForImageUid(e)}includesImageUid(e){return this.#b.includesImageUid(e)}isPositionInBounds(e){void 0===e&&(e=this.#M);const t=this.#b.getGeometry(),n=t.worldToIndex(e),i=[this.getScrollDimIndex()];return 4===n.length()&&i.push(3),t.isIndexInBounds(n,i)}getOrigin(e){const t=this.#b.getGeometry();let n=0;return void 0!==e&&(n=t.worldToIndex(e).get(2)),t.getOrigins()[n]}setCurrentIndex(e,t){const n=this.#b.getGeometry().indexToWorld(e);return this.setCurrentPosition(n,t)}setCurrentPosition(e,t){void 0===t&&(t=!1);const n=this.#b.getGeometry(),i=n.worldToIndex(e),o=[this.getScrollDimIndex()];if(4===i.length()&&o.push(3),!n.isIndexInBounds(i,o))return this.#M=e,t||this.#B({type:"positionchange",value:[i.getValues(),e.getValues()],valid:!1}),!1;let r=null,a=null;if(this.getCurrentPosition()&&(a=this.getCurrentIndex()),a)if(a.canCompare(i))r=a.compare(i);else{r=[];const e=Math.min(a.length(),i.length());for(let t=0;t<e;++t)a.get(t)!==i.get(t)&&r.push(t);const t=Math.max(a.length(),i.length());for(let n=e;n<t;++n)r.push(n)}else{r=[];for(let e=0;e<i.length();++e)r.push(e)}if(this.#M=e,!t){const t={type:"positionchange",value:[i.getValues(),e.getValues()],diffDims:r,data:{imageUid:this.#b.getImageUid(i)}};if(this.#b.canQuantify()){const e=this.#b.getRescaledValueAtIndex(i);t.value.push(e)}this.#B(t)}return!0}setWindowLevel(e,t,n){if(void 0===t&&(t="manual"),"manual"!==t&&void 0===this.#F[t])throw new Error("Unknown window level preset: '"+t+"'");void 0===n&&(n=!1);const i=f(e,this.#b.getRescaledDataRange(),this.#b.getMeta().VOILUTFunction),o=!i.equals(this.#q),r=this.#E!==t;(o||r)&&(this.#q=i,this.#E=t,"manual"===t&&(void 0!==this.#F[t]?this.#F[t].wl[0]=i:this.addWindowPresets({manual:{wl:[i],name:"manual"}})),this.#B({type:"wlchange",value:[i.center,i.width,t],wc:i.center,ww:i.width,skipGenerate:n}))}getWindowLevel(){return this.#G().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.#b.getSecondaryOffset(this.getCurrentIndex());i=n.wl[e]}void 0!==i&&this.setWindowLevel(i,e,t)}setWindowLevelPresetById(e,t){const n=Object.keys(this.getWindowPresets());this.setWindowLevelPreset(n[e],t)}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)};getWindowLevelMinMax(){const e=this.getImage().getRescaledDataRange(),t=e.max-e.min,n=e.min+t/2;return f(new D(n,t),e,this.#b.getMeta().VOILUTFunction)}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(),o=G(n,t,i,this.getOrientation()),r=n.getPhotometricInterpretation();switch(r){case"MONOCHROME1":case"MONOCHROME2":!function(e,t,n,i,o){let r=0,a=0,s=t.next();for(;!s.done;)a=i.getValue(s.value),e.data[r]=o.red[a],e.data[r+1]=o.green[a],e.data[r+2]=o.blue[a],e.data[r+3]=n(s.value,s.index),r+=4,s=t.next()}(e,o,this.getAlphaFunction(),this.#G(),this.#k());break;case"PALETTE COLOR":!function(e,t,n,i,o){const r=function(e){return e>>8};o&&h.info("Scaling 16bits data to 8bits.");let a=0,s=0,l=t.next();for(;!l.done;)s=l.value,o?(e.data[a]=r(i.red[s]),e.data[a+1]=r(i.green[s]),e.data[a+2]=r(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,o,this.getAlphaFunction(),n.getPaletteColourMap(),16===n.getMeta().BitsStored);break;case"RGB":!function(e,t,n){let i=0,o=t.next();for(;!o.done;)e.data[i]=o.value[0],e.data[i+1]=o.value[1],e.data[i+2]=o.value[2],e.data[i+3]=n(o.value,o.index),i+=4,o=t.next()}(e,o,this.getAlphaFunction());break;case"YBR_FULL":!function(e,t,n){let i=0,o=null,r=t.next();for(;!r.done;)a=r.value[0],s=r.value[1],l=r.value[2],o={r:a+1.402*(l-128),g:a-.34414*(s-128)-.71414*(l-128),b:a+1.772*(s-128)},e.data[i]=o.r,e.data[i+1]=o.g,e.data[i+2]=o.b,e.data[i+3]=n(r.value,r.index),i+=4,r=t.next();var a,s,l}(e,o,this.getAlphaFunction());break;default:throw new Error("Unsupported photometric interpretation: "+r)}}getScrollDimIndex(){let e=null;const t=this.getOrientation();return e=void 0!==t?t.getThirdColMajorDirection():2,e}isAquisitionOrientation(){return N(this.#Q)}}function j(){return new M([1,0,0,0,0,1,0,-1,0])}const Z={Axial:"axial",Coronal:"coronal",Sagittal:"sagittal"};function _(e){let t;return e===Z.Axial?t=Q():e===Z.Coronal?t=j():e===Z.Sagittal&&(t=new M([0,0,-1,1,0,0,0,-1,0])),t}function K(e){const t=new x(e.get(0,0),e.get(1,0),e.get(2,0)),n=new x(e.get(0,1),e.get(1,1),e.get(2,1)),i=new x(e.get(0,2),e.get(1,2),e.get(2,2));return J(t)+J(n)+J(i)}function J(e){let t=new x(Math.abs(e.getX()),Math.abs(e.getY()),Math.abs(e.getZ())),n="";const i=e.getX()<0?"R":"L",o=e.getY()<0?"A":"P",r=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 x(0,t.getY(),t.getZ());else if(t.getY()>a&&t.getY()>t.getX()&&t.getY()>t.getZ())n+=o,t=new x(t.getX(),0,t.getZ());else{if(!(t.getZ()>a&&t.getZ()>t.getX()&&t.getZ()>t.getY()))break;n+=r,t=new x(t.getX(),t.getY(),0)}return n}function $(e){let t;const n=ee(e);return void 0!==n&&(t=function(e){let t;return["LPS","LAI","RPI","RAS","ALS","ARI","PLI","PRS"].includes(e)?t=Z.Axial:["LSA","LIP","RSP","RIA","ILA","IRP","SLP","SRA"].includes(e)?t=Z.Coronal:["PSL","PIR","ASR","AIL","IAR","IPL","SAL","SPR"].includes(e)&&(t=Z.Sagittal),t}(K(n.asOneAndZeros()))),t}function ee(e){let t;if(void 0!==e&&6===e.length){const n=new x(e[0],e[1],e[2]),i=new x(e[3],e[4],e[5]),o=n.crossProduct(i);t=new M([n.getX(),i.getX(),o.getX(),n.getY(),i.getY(),o.getY(),n.getZ(),i.getZ(),o.getZ()])}return t}function te(e,t){let n=Q();return void 0!==t&&(n=e.asOneAndZeros().getInverse().multiply(t)),n.getAbs()}const ne={t(e){let t=e;const n=e.split(".");return 2===n.length&&"unit"===n[0]&&(t={mm:"mm",cm2:"cm²",ml:"ml",degree:"°",pixel:"pixels"}[n[1]]),t}};function ie(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 oe(e,t){return null!=e&&null!=t&&e.substring(e.length-t.length)===t}function re(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 ae(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 se(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 le(e,t){const n=Math.pow(10,t),i=.01/n;return Math.round(e*n+i)/n}class ce{#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]),o=this.get(t[n]),!(i>=0&&i<o))return!1;var i,o;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){const o=this.get(i),r=e.get(i);if(r>=o||r<0)return-1;n+=r*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 o(t)}get2D(){return{x:this.get(0),y:this.get(1)}}}class ue{#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)}}}function de(e,t){if(void 0===t){t=[];for(let n=0;n<e.length;++n)t.push(n)}for(let n=0;n<t.length;++n)if(t[n]>=e.length)throw new Error("Non valid dimension for toStringId");let n="";for(let i=0;i<t.length;++i)0!==i&&(n+="_"),n+="#"+t[i]+"-"+e[t[i]];return n}function he(e,t){return null!==e&&null!==t&&void 0!==e&&void 0!==t&&ge(e.slice().sort(),t.slice().sort())}function ge(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 Se(e){return String.fromCharCode.apply(String,e)}function me(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 o=n;o<i;++o)if(t(e[o],o,e))return o}function pe(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 fe(e,t){const n="\r\n";let i=0;const o=[];for(let r=0;r<e.length;++r){let a="";0!==r&&(a+=n),a+="--"+t+n;const s=Object.keys(e[r]);for(let t=0;t<s.length;++t){const i=s[t];"data"!==i&&(a+=i+": "+e[r][i]+n)}a+=n;const l=se(a);o.push(l),i+=l.byteLength+e[r].data.byteLength}const r=se("\r\n--"+t+"--"+n),a=new Uint8Array(i+r.byteLength);let s=0;for(let t=0;t<e.length;++t)a.set(o[t],s),s+=o[t].byteLength,a.set(new Uint8Array(e[t].data),s),s+=e[t].data.byteLength;return a.set(r,s),a}const De={"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 ve(e,t){De[e]=t}const ye={"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"},Ce={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 Ie(e){return void 0!==Ce[e]}const Te={SH:!0,LO:!0,UC:!0,ST:!0,LT:!0,UT:!0,PN:!0};function Le(e){return void 0!==Te[e]}const Pe={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"},we={"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)"},Oe="1.2.840.10008.1.2",Ae="1.2.840.10008.1.2.1",be="1.2.840.10008.1.2.2";class xe{#H;#z;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.#H=e,this.#z=t}getGroup(){return this.#H}getElement(){return this.#z}toString(){return this.getKey()+": "+this.getNameFromDictionary()}equals(e){return null!=e&&this.#H===e.getGroup()&&this.#z===e.getElement()}getKey(){return this.#H+this.#z}getGroupName(){return ye[this.#H]}isWithVR(){return!("FFFE"===this.#H&&("E000"===this.#z||"E00D"===this.#z||"E0DD"===this.#z))}isPrivate(){return parseInt(this.#H,16)%2==1}#W(){let e;return void 0!==De[this.#H]&&void 0!==De[this.#H][this.#z]&&(e=De[this.#H][this.#z]),e}getVrFromDictionary(){let e;const t=this.#W();return void 0!==t&&(e=t[0]),e}getMultiplicityFromDictionary(){let e;const t=this.#W();return void 0!==t&&(e=parseInt(t[1],10)),e}getNameFromDictionary(){let e;const t=this.#W();return void 0!==t&&(e=t[2]),e}}function Re(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 Fe(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 xe(e.substring(0,4),e.substring(4,8))}function Ee(){return new xe("FFFE","E000")}function qe(e){return"FFFEE000"===e.getKey()}function Ue(e){return"FFFEE00D"===e.getKey()}function Me(e){return"FFFEE0DD"===e.getKey()}function Qe(){return new xe("7FE0","0010")}function Ne(e){return["7FE00010","7FE00009","7FE00008"].includes(e.getKey())}function Ve(e){const t=["7FE00010","7FE00009","7FE00008"];let n=!1;for(const i of t)if(void 0!==e[i]){n=!0;break}return n}function Be(e){if(null==e)return null;let t=null,n=null;const i=De,o=Object.keys(i);let r,a=null,s=!1;for(let r=0,l=o.length;r<l;++r){t=o[r],a=Object.keys(i[t]);for(let o=0,r=a.length;o<r;++o)if(n=a[o],i[t][n][2]===e){s=!0;break}if(s)break}return s&&(r=new xe(t,n)),r}function Ge(e){return function(t,n){const i=Fe(n);let o=i.getNameFromDictionary();void 0===o&&(o="x"+i.getKey());const r=e[n];for(const e in r)void 0===r[e]&&delete r[e];let a;if("SQ"===r.vr){a={value:[]};for(let e=0;e<r.value.length;++e){const t=r.value[e];a.value.push(Object.keys(t).reduce(Ge(t),{}))}}else a=1===r.value.length?r.value[0]:r.value;return t[o]=a,t}}function ke(e){const t=structuredClone(e);return Object.keys(t).reduce(Ge(t),{})}class He{vr;value;tag;vl;undefinedLength;startOffset;endOffset;items;constructor(e){this.vr=e}}function ze(e){return void 0!==e&&void 0!==e.value&&0!==e.value.length}function We(e,t){let n;return ze(e[t])&&(n=e[t].value[0]),n}function Ye(e,t){let n;return ze(e[t])&&(n=e[t].value),n}function Xe(e,t,n){let i="";if(void 0===e)i+=" "+t+" is undefined,";else if(void 0===e.value)i+=" "+t+" has undefined value,";else if(0===e.value.length)i+=" "+t+" is empty,";else if(void 0!==n)for(let o=0;o<n.length;++o)e.value.includes(n[o])||(i+=" "+t+" does not contain "+n[o]+" (value: "+e.value+"),");return i}function je(e){const t=e.byteLength,n=new Uint8Array(e.buffer,e.byteOffset,t),i=e.BYTES_PER_ELEMENT;let o;for(let e=0;e<t;e+=i)for(let t=e+i-1,r=e;t>r;t--,r++)o=n[r],n[r]=n[t],n[t]=o}class Ze{#Y;#X=!0;#j=function(){return new Int8Array(new Int16Array([1]).buffer)[0]>0}();#Z;#_;constructor(e,t){this.#Y=e,void 0!==t&&(this.#X=t),this.#Z=this.#X!==this.#j,this.#_=new DataView(e)}readUint16(e){return this.#_.getUint16(e,this.#X)}readInt16(e){return this.#_.getInt16(e,this.#X)}readUint32(e){return this.#_.getUint32(e,this.#X)}readBigUint64(e){return this.#_.getBigUint64(e,this.#X)}readInt32(e){return this.#_.getInt32(e,this.#X)}readBigInt64(e){return this.#_.getBigInt64(e,this.#X)}readFloat32(e){return this.#_.getFloat32(e,this.#X)}readFloat64(e){return this.#_.getFloat64(e,this.#X)}readBinaryArray(e,t,n){const i=new Uint8Array(this.#Y,e,t);let o;o=void 0!==n?n:8*i.length;const r=new Uint8Array(o);let a=0,s=0;for(let e=0;e<o;++e)a=e%8,s=Math.floor(e/8),r[e]=255*!!(i[s]&1<<a);return r}readUint8Array(e,t){return new Uint8Array(this.#Y,e,t)}readInt8Array(e,t){return new Int8Array(this.#Y,e,t)}readUint16Array(e,t){const n=Uint16Array.BYTES_PER_ELEMENT,i=t/n;let o=null;if(e%n==0)o=new Uint16Array(this.#Y,e,i),this.#Z&&je(o);else{o=new Uint16Array(i);let t=e;for(let e=0;e<i;++e)o[e]=this.readUint16(t),t+=n}return o}readInt16Array(e,t){const n=Int16Array.BYTES_PER_ELEMENT,i=t/n;let o=null;if(e%n==0)o=new Int16Array(this.#Y,e,i),this.#Z&&je(o);else{o=new Int16Array(i);let t=e;for(let e=0;e<i;++e)o[e]=this.readInt16(t),t+=n}return o}readUint32Array(e,t){const n=Uint32Array.BYTES_PER_ELEMENT,i=t/n;let o=null;if(e%n==0)o=new Uint32Array(this.#Y,e,i),this.#Z&&je(o);else{o=new Uint32Array(i);let t=e;for(let e=0;e<i;++e)o[e]=this.readUint32(t),t+=n}return o}readUint64Array(e,t){const n=BigUint64Array.BYTES_PER_ELEMENT,i=t/n;let o=null;if(e%n==0)o=new BigUint64Array(this.#Y,e,i),this.#Z&&je(o);else{o=new BigUint64Array(i);let t=e;for(let e=0;e<i;++e)o[e]=this.readBigUint64(t),t+=n}return o}readInt32Array(e,t){const n=Int32Array.BYTES_PER_ELEMENT,i=t/n;let o=null;if(e%n==0)o=new Int32Array(this.#Y,e,i),this.#Z&&je(o);else{o=new Int32Array(i);let t=e;for(let e=0;e<i;++e)o[e]=this.readInt32(t),t+=n}return o}readInt64Array(e,t){const n=BigInt64Array.BYTES_PER_ELEMENT,i=t/n;let o=null;if(e%n==0)o=new BigInt64Array(this.#Y,e,i),this.#Z&&je(o);else{o=new BigInt64Array(i);let t=e;for(let e=0;e<i;++e)o[e]=this.readBigInt64(t),t+=n}return o}readFloat32Array(e,t){const n=Float32Array.BYTES_PER_ELEMENT,i=t/n;let o=null;if(e%n==0)o=new Float32Array(this.#Y,e,i),this.#Z&&je(o);else{o=new Float32Array(i);let t=e;for(let e=0;e<i;++e)o[e]=this.readFloat32(t),t+=n}return o}readFloat64Array(e,t){const n=Float64Array.BYTES_PER_ELEMENT,i=t/n;let o=null;if(e%n==0)o=new Float64Array(this.#Y,e,i),this.#Z&&je(o);else{o=new Float64Array(i);let t=e;for(let e=0;e<i;++e)o[e]=this.readFloat64(t),t+=n}return o}readHex(e){const t=this.readUint16(e).toString(16);return"0000".substring(0,4-t.length)+t.toUpperCase()}}function _e(){return"0.35.1"}function Ke(e){const t=e.split("-");let n=[];for(const e of t)n=n.concat(e.split("."));return n}function Je(e,t){let n=0;const i=Ke(e),o=Ke(t);for(let e=0;e<3&&(n=parseInt(i[e],10)-parseInt(o[e],10),0===n);++e);if(0===n){const e=4,t=i[e],r=o[e];n=void 0===t&&void 0===r?0:void 0===t&&void 0!==r?1:void 0!==t&&void 0===r?-1:parseInt(t,10)-parseInt(r,10)}return n}function $e(e){return!(e.byteLength<132)&&"DICM"===new Uint8Array(e,128,4).reduce((function(e,t){return e+String.fromCharCode(t)}),"")}const et=String.fromCharCode("u200B");class tt{decode(e){let t="";for(let n=0,i=e.length;n<i;++n)t+=String.fromCharCode(e[n]);return t}}function nt(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 o=t[e.substring(i,i+1)];o&&(n+=o)}return n}function it(e){return e===Oe}function ot(e){return e===be}function rt(e){return"1.2.840.10008.1.2.4.50"===e||"1.2.840.10008.1.2.4.51"===e}function at(e){return"1.2.840.10008.1.2.4.57"===e||"1.2.840.10008.1.2.4.70"===e}function st(e){return null!==e.match(/1.2.840.10008.1.2.4.9/)}function lt(e){return"1.2.840.10008.1.2.5"===e}function ct(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));h.error("Cannot allocate array of size: "+n+" (>2^"+e+").")}}return i}function ut(e,t){return t?8:Ie(e)?12:8}const dt="00280100",ht="00280103";class gt{#K={};#J;#$=new tt;#ee=this.#$;#te(e){return this.#$.decode(e)}#ne(e){return this.#ee.decode(e)}getDefaultCharacterSet(){return this.#J}setDefaultCharacterSet(e){this.#J=e}setDecoderCharacterSet(e){this.#ee=new TextDecoder(e)}getDicomElements(){return this.#K}safeGet(e){return We(this.#K,e)}#ie(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 xe(n,i),endOffset:t}}#oe(e,t,n){const i={};let o=this.#re(e,t,n);if(t=o.endOffset,Me(o.tag))return{data:i,endOffset:o.endOffset,isSeqDelim:!0};if(i[o.tag.getKey()]={tag:o.tag,vr:"NONE",vl:o.vl,undefinedLength:o.undefinedLength},o.undefinedLength){let r=!1;for(;!r;)o=this.#re(e,t,n),t=o.endOffset,r=Ue(o.tag),r||(i[o.tag.getKey()]=o)}else{const r=t;for(t-=o.vl;t<r;)o=this.#re(e,t,n),t=o.endOffset,i[o.tag.getKey()]=o}return{data:i,endOffset:t,isSeqDelim:!1}}#ae(e,t,n){const i=[];let o=this.#re(e,t,n);const r=o.vl;t=o.endOffset;let a=!1;for(;!a;)o=this.#re(e,t,n),t=o.endOffset,a=Me(o.tag),a||(o.vr="OB",i.push(o));return{data:i,endOffset:t,offsetTableVl:r}}#re(e,t,n,i){const o=this.#ie(e,t),r=o.tag;if(void 0!==i&&r.equals(i)){const e=new He("");return e.tag=r,e}t=o.endOffset;let a=null,s=!1;r.isWithVR()?n?(a=r.getVrFromDictionary(),void 0===a&&(a="UN"),s=!0):(a=this.#te(e.readUint8Array(t,2)),t+=2*Uint8Array.BYTES_PER_ELEMENT,s=Ie(a),s&&(t+=2*Uint8Array.BYTES_PER_ELEMENT)):(a="NONE",s=!0),function(e){return Object.keys(Pe).concat(["NONE","ox","xx","xs"]).includes(e)}(a)||(h.warn("Unknown VR: "+a+" (for tag "+r.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),r.isPrivate()&&"UN"===a&&0===l&&(a="SQ");let u,d=t,g=d+l;if(Ne(r)&&c){const i=this.#ae(e,t,n);t=i.endOffset,d+=i.offsetTableVl,u=i.data,g=t,l=t-d}else if("SQ"===a){let i;if(u=[],c){let o=!1;for(;!o;)i=this.#oe(e,t,n),o=i.isSeqDelim,t=i.endOffset,o||u.push(i.data);g=t,l=t-d}else if(0!==l){const o=t+l;for(;t<o;)i=this.#oe(e,t,n),u.push(i.data),t=i.endOffset;g=t,l=t-d}}const S=new He(a);return S.tag=r,S.vl=l,S.startOffset=d,S.endOffset=g,c&&(S.undefinedLength=c),u&&(S.items=u),S}#se(e,t,n){const i=e.tag,o=e.vl,r=e.vr,a=e.startOffset;let s,l;void 0!==n&&(s=n.bitsAllocated,l=n.pixelRepresentation);let c=null;const u=Pe[r];if(Ne(i))if(e.undefinedLength){c=[];for(let i=0;i<e.items.length;++i)c.push(this.#se(e.items[i],t,n));delete e.items}else if(s>8&&"OB"===r&&(h.warn("Reading DICOM pixel data with bitsAllocated>8 and OB VR, treating as OW"),e.vr="OW"),c=[],1===s)c.push(t.readBinaryArray(a,o,n.imageBufferSize));else if(8===s)0===l?c.push(t.readUint8Array(a,o)):c.push(t.readInt8Array(a,o));else if(16===s)0===l?c.push(t.readUint16Array(a,o)):c.push(t.readInt16Array(a,o));else if(32===s)c.push(t.readFloat32Array(a,o));else{if(64!==s)throw new Error("Unsupported bits allocated: "+s);c.push(t.readFloat64Array(a,o))}else if(void 0!==u)if("Uint8"===u)c=t.readUint8Array(a,o);else if("Uint16"===u)c=t.readUint16Array(a,o),"O"!==r[0]&&(c=Array.from(c));else if("Uint32"===u)c=t.readUint32Array(a,o),"O"!==r[0]&&(c=Array.from(c));else if("Uint64"===u)c=t.readUint64Array(a,o);else if("Int16"===u)c=Array.from(t.readInt16Array(a,o));else if("Int32"===u)c=Array.from(t.readInt32Array(a,o));else if("Int64"===u)c=t.readInt64Array(a,o);else if("Float32"===u)c=Array.from(t.readFloat32Array(a,o));else if("Float64"===u)c=Array.from(t.readFloat64Array(a,o));else{if("string"!==u)throw new Error("Unknown VR type: "+u);{const e=t.readUint8Array(a,o);c=Le(r)?this.#ne(e):this.#te(e),c=function(e){let t=e;const n=e.length-1;return e[n]===et&&(t=e.substring(0,n)),t=t.trim(),t}(c).split("\\")}}else if("xx"===r)c=Array.from(t.readUint16Array(a,o));else if("ox"===r)c=8===s?0===l?Array.from(t.readUint8Array(a,o)):Array.from(t.readInt8Array(a,o)):0===l?Array.from(t.readUint16Array(a,o)):Array.from(t.readInt16Array(a,o));else if("xs"===r)c=0===l?Array.from(t.readUint16Array(a,o)):Array.from(t.readInt16Array(a,o));else if("AT"===r){const e=t.readUint16Array(a,o);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 o="(";o+="0000".substring(0,4-n.length)+n.toUpperCase(),o+=",",o+="0000".substring(0,4-i.length)+i.toUpperCase(),o+=")",c.push(o)}}else if("SQ"===r){c=[];for(let n=0;n<e.items.length;++n){const i=e.items[n],o={},r=Object.keys(i);let a=s,u=l;for(let e=0;e<r.length;++e){let n=i[dt];void 0!==n&&void 0!==n.value&&(a=n.value[0]),n=i[ht],void 0!==n&&void 0!==n.value&&(u=n.value[0]);const s={bitsAllocated:a,pixelRepresentation:u},l=i[r[e]];l.value=this.#se(l,t,s),delete l.tag,delete l.vl,delete l.startOffset,delete l.endOffset,o[r[e]]=l}c.push(o)}delete e.items}else"NONE"===r||h.warn("Unknown VR: "+r+" (for tag "+e.tag.getKey()+")"),c=[];return c}#le(e,t,n){const i=Object.keys(e);for(let o=0;o<i.length;++o){const r=e[i[o]];void 0===r.value&&(r.value=this.#se(r,t,n)),delete r.tag,delete r.vl,delete r.startOffset,delete r.endOffset}}parse(e,t){let n=0,i="",o=null;const r=new Ze(e);let a=new Ze(e);n=128;const s=this.#te(r.readUint8Array(n,4));if(n+=4*Uint8Array.BYTES_PER_ELEMENT,"DICM"===s){o=this.#re(r,n,!1),o.value=this.#se(o,r),n=o.endOffset,this.#K[o.tag.getKey()]=o;const e=n+o.value[0];for(;n<e;)o=this.#re(r,n,!1),n=o.endOffset,this.#K[o.tag.getKey()]=o;if(o=this.#K["00020010"],void 0===o)throw new Error("Not a valid DICOM file (no TransferSyntaxUID found)");o.value=this.#se(o,r),i=o.value[0]}else{h.warn("No DICM prefix, trying to guess tansfer syntax."),o=this.#re(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,o=i.charCodeAt(0),r=i.charCodeAt(1),a=!(o>=65&&o<=90&&r>=65&&r<=90);let s=null;if(n===t)s=a?Oe:Ae;else{if(a)throw new Error("Not a valid DICOM file (no magic DICM word foundand implicit VR big endian detected)");s=be}const l=new He("UI");return l.tag=new xe("0002","0010"),l.value=[s],l.vl=l.value[0].length,l.startOffset=e.startOffset,l.endOffset=l.startOffset+l.vl,l}(o);this.#K[e.tag.getKey()]=e,i=e.value[0],n=0}if(!function(e){return e===Oe||e===Ae||e===be||rt(e)||at(e)||st(e)||lt(e)}(i))throw new Error("Unsupported DICOM transfer syntax: '"+i+"' ("+function(e){let t="Unknown";return void 0!==we[e]&&(t=we[e]),t}(i)+")");let l=!1;it(i)&&(l=!0),ot(i)&&(a=new Ze(e,!1));let c,u=!1;for(;n<e.byteLength;){if(o=this.#re(a,n,l,t),void 0!==t&&o.tag.equals(t)){u=!0;break}n=o.endOffset;const e=o.tag.getKey();void 0===this.#K[e]?this.#K[e]=o:h.warn("Not saving duplicate tag: "+e)}if(isNaN(n))throw new Error("Problem while parsing, bad offset");if(u||e.byteLength===n||h.warn("Did not reach the end of the buffer: "+n+" != "+e.byteLength),Ve(this.#K)){let e=0;o=this.#K[ht],void 0!==o?(o.value=this.#se(o,a),e=o.value[0]):h.warn("Reading DICOM pixel data with default pixelRepresentation.");let t=16;o=this.#K[dt],void 0!==o?(o.value=this.#se(o,a),t=o.value[0]):h.warn("Reading DICOM pixel data with default bitsAllocated.");let n,i,r=1;o=this.#K["00280008"],void 0!==o&&(o.value=this.#se(o,a),r=parseInt(o.value[0],10)),c={pixelRepresentation:e,bitsAllocated:t,numberOfFrames:r},o=this.#K["00280010"],void 0!==o&&(o.value=this.#se(o,a),n=parseInt(o.value[0],10)),o=this.#K["00280011"],void 0!==o&&(o.value=this.#se(o,a),i=parseInt(o.value[0],10)),void 0!==n&&void 0!==i&&(c.imageBufferSize=n*i*r)}if(void 0!==this.#J&&this.setDecoderCharacterSet(this.#J),o=this.#K["00080005"],void 0!==o){let e;o.value=this.#se(o,a),1===o.value.length?e=o.value[0]:(e=o.value[1],h.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.#le(this.#K,a,c),o=this.#K["7FE00010"],void 0!==o&&o.undefinedLength){const e=c.numberOfFrames,t=o.value;if(t.length>1&&t.length>e){const n=t.length/e,i=[];let r=0;for(let o=0;o<e;++o){r=o*n;let e=0;for(let i=0;i<n;++i)e+=t[r+i].length;const a=new t[0].constructor(e);let s=0;for(let e=0;e<n;++e)a.set(t[r+e],s),s+=t[r+e].length;i[o]=a}o.value=i}}}}class St{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 mt(e,t){return function(e){return null!=e&&(e.includes("median")||e.includes("p25")||e.includes("p75"))}(t)?function(e){const t=pt(e);return e.sort((function(e,t){return e-t})),t.median=ft(e,.5),t.p25=ft(e,.25),t.p75=ft(e,.75),t}(e):pt(e)}function pt(e){let t=e[0],n=t,i=0,o=0,r=0;const a=e.length;for(let s=0;s<a;++s)r=e[s],r<t?t=r:r>n&&(n=r),i+=r,o+=r*r;const s=i/a;let l=o/a-s*s;l<0&&(l=0);const c=Math.sqrt(l);return new St(t,n,s,c)}function ft(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),o=e[i];return o+(e[i+1]-o)*(n-i)}class Dt{min;max;constructor(e,t){this.min=e,this.max=t}}class vt{#ce;#ue;#de;#he={};#ge;#Q=Q();#Se=!1;constructor(e,t,n,i,o){this.#ce=e,this.#ue=t,this.#de=n,void 0!==o&&(this.#ge=o,this.#he[o]=e),void 0!==i&&(this.#Q=i)}getInitialTime(){return this.#ge}getCurrentTotalNumberOfSlices(){const e=Object.keys(this.#he);if(0===e.length)return this.#ce.length;let t=0;for(let n=0;n<e.length;++n)t+=this.#he[e[n]].length;return t}hasSlicesAtTime(e){return void 0!==this.#he[e]}getCurrentNumberOfSlicesBeforeTime(e){const t=Object.keys(this.#he);if(0===t.length)return;let n=0;for(let i=0;i<t.length;++i){const o=t[i];if(parseInt(o,10)===e)break;n+=this.#he[o].length}return n}getOrigin(){return this.#ce[0]}getOrigins(){return this.#ce}includesOrigin(e,t){for(let n=0;n<this.#ce.length;++n)if(this.#ce[n].isSimilar(e,t))return!0;return!1}getSize(e){let t=this.#ue;if(e&&void 0!==e){let n=yt([this.#ue.get(0),this.#ue.get(1),this.#ue.get(2)],e);n=n.map(Math.abs),t=new ce(n.concat(this.#ue.getValues().slice(3)))}return t}#me(){const e=function(e){if(e.length<=1)return;const t=[];for(let n=0;n<e.length-1;++n){const i=e[n],o=e[n+1],r=i.getDistance(o);if(0===r)throw new Error("Zero slice spacing "+i.toString()+" "+o.toString());t.push(r)}const n=pt(t),i=le(n.mean,4);return n.stdDev>q&&h.warn("Varying slice spacing, value: "+i+" (mean: "+n.mean+", min: "+n.min+", max: "+n.max+", stdDev: "+n.stdDev+")"),i}(this.#ce);if(void 0!==e){1!==this.#de.get(2)&&this.#de.get(2)!==e&&h.debug("Using geometric spacing "+e+" instead of tag spacing "+this.#de.get(2));const t=this.#de.getValues();t[2]=e,this.#de=new ue(t)}}getSpacing(e){this.#Se&&(this.#me(),this.#Se=!1);let t=this.#de;if(e&&void 0!==e){let n=yt([this.#de.get(0),this.#de.get(1),this.#de.get(2)],e);n=n.map(Math.abs),t=new ue(n)}return t}getRealSpacing(){return this.getSpacing(this.#Q.getInverse().asOneAndZeros())}getOrientation(){return this.#Q}getSliceIndex(e,t){let n=this.#ce;void 0!==t&&(n=this.#he[t]);const i=e.getClosest(n),o=n[i],r=e.minus(o);return new x(this.#Q.get(0,2),this.#Q.get(1,2),this.#Q.get(2,2)).isCodirectional(r)?i+1:i}appendOrigin(e,t,n){const i=function(t){return t.equals(e)};if(void 0!==n){if(void 0!==this.#he[n].find(i))throw new Error("Cannot append same time origin twice");this.#he[n].splice(t,0,e)}if(void 0===n||n===this.#ge){if(void 0!==this.#ce.find(i))throw new Error("Cannot append same origin twice");this.#Se=!0,this.#ce.splice(t,0,e);const n=this.#ue.getValues();n[2]+=1,this.#ue=new ce(n)}}appendFrame(e,t){this.#he[t]=[e];const n=this.#ue.getValues(),i=this.#de.getValues();4===n.length?n[3]+=1:(n.push(2),i.push(1)),this.#ue=new ce(n),this.#de=new ue(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)}getRange(){const e=this.getSize().length(),t=new Array(e);t.fill(0);const n=new o(t),i=new o(this.getSize().getValues());return[this.indexToWorld(n),this.indexToWorld(i)]}indexToWorld(e){const t=this.getSpacing(),n=new F(e.get(0)*t.get(0),e.get(1)*t.get(1),e.get(2)*t.get(2)),i=this.getOrientation().multiplyPoint3D(n),o=e.getValues(),r=this.getOrigin();return o[0]=r.getX()+i.getX(),o[1]=r.getY()+i.getY(),o[2]=r.getZ()+i.getZ(),new E(o)}pointToWorld(e){const t=this.getSpacing(),n=new F(e.getX()*t.get(0),e.getY()*t.get(1),e.getZ()*t.get(2)),i=this.getOrientation().multiplyPoint3D(n),o=this.getOrigin();return new F(o.getX()+i.getX(),o.getY()+i.getY(),o.getZ()+i.getZ())}worldToIndex(e){const t=this.getOrigin(),n=new F(e.get(0)-t.getX(),e.get(1)-t.getY(),e.get(2)-t.getZ()),i=this.getOrientation().getInverse().multiplyPoint3D(n),r=e.getValues(),a=this.getSpacing();return r[0]=Math.floor(le(i.getX()/a.get(0),5)),r[1]=Math.floor(le(i.getY()/a.get(1),5)),r[2]=Math.floor(le(i.getZ()/a.get(2),5)),new o(r)}worldToPoint(e){const t=this.getOrigin(),n=new F(e.get(0)-t.getX(),e.get(1)-t.getY(),e.get(2)-t.getZ()),i=this.getOrientation().getInverse().multiplyPoint3D(n),o=e.getValues(),r=this.getSpacing();return o[0]=i.getX()/r.get(0),o[1]=i.getY()/r.get(1),o[2]=i.getZ()/r.get(2),new F(o[0],o[1],o[2])}}function yt(e,t){return t.getInverse().multiplyArray3D(e)}function Ct(e,t){return t.multiplyArray3D(e)}const It={TransferSyntax:"00020010",SOPClassUID:"00080016",Modality:"00080060",Rows:"00280010",Columns:"00280011",PixelSpacing:"00280030",ImagerPixelSpacing:"00181164",NominalScannedPixelSpacing:"00182010",PixelAspectRatio:"00280034",SpacingBetweenSlices:"00180088",RescaleType:"00281054",Units:"00541001",ImageOrientationPatient:"00200037",PhotometricInterpretation:"00280004",SamplesPerPixel:"00280002"};function Tt(e){let t;const n=We(e,It.Rows),i=We(e,It.Columns);return void 0!==n&&void 0!==i&&(t=[i,n]),t}function Lt(e){const t=Ye(e,It.PixelSpacing);if(void 0===t||2!==t.length)return;const n=[parseFloat(t[1]),parseFloat(t[0])],i=We(e,It.SpacingBetweenSlices);return void 0!==i&&n.push(parseFloat(i)),new ue(n)}function Pt(e){const t=We(e,It.PhotometricInterpretation),n=We(e,It.TransferSyntax);if(void 0!==t&&void 0!==n){let i=t.toUpperCase();(st(n)||rt(n)||at(n))&&!wt(i)&&(i="RGB");let o=We(e,It.SamplesPerPixel);return void 0===o&&(o=1),"RGB"===i&&1===o&&(i="PALETTE COLOR"),i}}function wt(e){return void 0!==e&&null!==e.match(/MONOCHROME/)}function Ot(e){return("0"+e).slice(-2)}function At(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 bt(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,o=t.length>=6?parseInt(t.substring(4,6),10):0,r=t.length>=8?t.substring(7,10):0;return{hours:n,minutes:i,seconds:o,milliseconds:0===r?0:parseInt(r,10)*Math.pow(10,3-r.length)}}function xt(e){return{year:e.getFullYear().toString(),monthIndex:Ot((e.getMonth()+1).toString()),day:Ot(e.getDate().toString())}}function Rt(e){return{hours:Ot(e.getHours().toString()),minutes:Ot(e.getMinutes().toString()),seconds:Ot(e.getSeconds().toString())}}function Ft(e){return e.year+e.monthIndex+e.day}function Et(e){return e.hours+e.minutes+e.seconds}const qt="00080016",Ut="00080060",Mt="00280002",Qt="00280100",Nt={PatientName:"00100010",PatientID:"00100020",PatientBirthDate:"00100030",PatientSex:"00100040",StudyDate:"00080020",StudyTime:"00080030",StudyInstanceUID:"0020000D",StudyID:"00200010",StudyDescription:"00081030",ReferringPhysicianName:"00080090",SeriesDate:"00080021",SeriesTime:"00080031",SeriesInstanceUID:"0020000E",SeriesNumber:"00200011",FrameOfReferenceUID:"00200052",Manufacturer:"00080070",ManufacturerModelName:"00081090",DeviceSerialNumber:"00181000",SoftwareVersions:"00181020",LossyImageCompression:"00282110"};class Vt{#pe;#fe;getWarning(){return this.#pe}checkElements(e){if(this.#pe=void 0,void 0===Tt(e))throw new Error("No image rows or columns in DICOM file");if(!Ve(e))throw new Error("No pixel data in DICOM file");const t=We(e,Ut);if(void 0!==t&&"PT"===t){const t=Pt(e);if(void 0!==(n=We(e,qt))&&/^1\.2\.840\.10008\.5\.1\.4\.1\.1\.7/.test(n)||!wt(t))return this.#pe;const i=function(e){let t="";const n={};let i;t+=Xe(e["00280051"],"Corrected Image (00280051)",["ATTN","DECY"]),t+=Xe(e["00541102"],"Decay Correction (00541102)",["START"]),t+=Xe(e["00541001"],"Units (00541001)",["BQML"]);const o=e["00101030"],r=Xe(o," PatientWeight (00101030)");if(0===r.length){const e=parseFloat(o.value[0]);isNaN(e)?t+=" PatientWeight is not a number":i=e}else t+=r;const a=function(e){let t,n="";const i=At(e["00080021"]);let o,r,a;const s=e["00540016"];if(n+=Xe(s,"RadiopharmaceuticalInformationSequence (00540016)"),void 0!==s){1!==s.value.length&&h.warn("Found more than 1 istopes in RadiopharmaceuticalInformation Sequence.");const e="RadionuclideTotalDose (00181074)",l=s.value[0]["00181074"];if(t=Xe(l,e),0===t.length){const e=parseFloat(l.value[0]);isNaN(e)?n+=" TotalDose is not a number":o=e}else n+=t;const c="RadionuclideHalfLife (00181075)",u=s.value[0]["00181075"];if(t=Xe(u,c),0===t.length){const e=parseFloat(u.value[0]);isNaN(e)?n+=" HalfLife is not a number":r=e}else n+=t;const d=s.value[0]["00181078"];let g,S;if(void 0===d)g=i,S=bt(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 He("DA");n.value=[t.substring(0,8)];const i=At(n),o=new He("TM");return o.value=[t.substring(8)],{date:i,time:t.length>=9?bt(o):void 0}}(d);g=e.date,S=e.time}void 0===S&&(S={hours:0,minutes:0,seconds:0,milliseconds:0}),a=new Date(g.year,g.monthIndex,g.day,S.hours,S.minutes,S.seconds,S.milliseconds)}const l=bt(e["00080031"]);let c=new Date(i.year,i.monthIndex,i.day,l.hours,l.minutes,l.seconds,l.milliseconds);const u=e["00080022"],d=e["00080032"];if(void 0!==u&&void 0!==d){const t=At(u),i=bt(d),o=new Date(t.year,t.monthIndex,t.day,i.hours,i.minutes,i.seconds,i.milliseconds);if(c>o){const a="Series date/time is after Aquisition date/time (diff="+(c.getTime()-o.getTime()).toString()+"ms) ";h.debug(a);let s=0;const l="FrameReferenceTime (00541300)",u=e["00541300"];n+=Xe(u,l),void 0!==u&&(s=u.value[0]);let d=0;const g="ActualFrameDuration (00181242)",S=e["00181242"];if(n+=Xe(S,g),void 0!==S&&(d=S.value[0]),s>0&&d>0){d/=1e3,s/=1e3;const e=Math.log(2)/r,n=e*d,o=1/e*Math.log(n/(1-Math.exp(-n)))-s;c=new Date(t.year,t.monthIndex,t.day,i.hours,i.minutes,i.seconds+o,i.milliseconds)}}}let g;if(void 0!==c&&void 0!==a&&void 0!==o&&void 0!==r){const e=(c.getTime()-a.getTime())/1e3;g=o*Math.pow(2,-e/r)}return{value:g,warning:n}}(e);return t+=a.warning,0!==t.length?n.warning="Cannot calculate PET SUV:"+t:n.value=1e3*i/a.value,n}(e);this.#fe=i.value,this.#pe=i.warning}var n;return this.#pe}create(e,t,n){const i=function(t){return We(e,t)},o=function(t){return Ye(e,t)},r=Tt(e),a=[r[0],r[1],1],s=i("00280008");if(void 0!==s){const e=parseInt(s,10);e>1&&a.push(e)}const l=new ce(a);let c=[1,1,1];const d=function(e){let t;const n=["PixelSpacing","ImagerPixelSpacing","NominalScannedPixelSpacing","PixelAspectRatio"];for(const i of n){const n=Ye(e,It[i]);if(void 0!==n&&2===n.length){t=[parseFloat(n[1]),parseFloat(n[0])];break}}return t}(e);void 0!==d&&(c=[d[0],d[1],1]);const g=new ue(c),S=o("00200032");let m=new Array(0,0,0);void 0!==S&&(m=[parseFloat(S[0]),parseFloat(S[1]),parseFloat(S[2])]);const p=function(e){const t=Ye(e,It.ImageOrientationPatient);let n;return void 0!==t&&(n=ee(t.map((e=>parseFloat(e))))),n}(e),f=new F(m[0],m[1],m[2]),v=(y=e,void 0!==O.getTagTime?O.getTagTime(y):void 0);var y;const C=new vt([f],l,g,p,v),I=i("00080018");let T=i(Mt);void 0===T&&(T=1);const L=l.getTotalSize()*T;if(L!==t.length){if(h.warn("Badly sized pixel buffer: "+t.length+" != "+L),!(L<t.length))throw new Error("Underestimated buffer size, can't fix it...");t=t.slice(0,l.getTotalSize())}const P=new Ti(C,t,[I]),w=Pt(e);void 0!==w&&P.setPhotometricInterpretation(w);const A=i("00280006");void 0!==A&&P.setPlanarConfiguration(A);let b=1;const x=i("00281053");if(void 0!==x){const e=parseFloat(x);isNaN(e)||(b=e)}let R=0;const E=i("00281052");if(void 0!==E){const e=parseFloat(E);isNaN(e)||(R=e)}let q=!1,U=1;void 0!==this.#fe&&(q=!0,U=this.#fe,h.info("Applying PET SUV calibration: "+U),b*=U,R*=U);const M=new z(b,R);if(P.setRescaleSlopeAndIntercept(M),"PALETTE COLOR"===P.getPhotometricInterpretation()){const t=function(e){let t;const n=Ye(e,"00281101");if(void 0!==n&&3===n.length){let i,o,r;const a=e["00281201"],s=e["00281202"],l=e["00281203"];if(16===n[2]){let t=!1,c=n[0];0===c&&(c=65536);const u=a.vl;if(u!==2*c&&(t=!0,h.info("16bits lut but size is not double. desc: "+c+" vl: "+u)),8===parseInt(We(e,Qt),10)&&(t=!0,h.info("Scaling 16bits color lut since bits allocated is 8.")),t){const e=function(e){return e>>8};i=a.value.map(e),o=s.value.map(e),r=l.value.map(e)}}else if(8===n[2]){h.info("Scaling 16bits color lut since the lut descriptor is 8.");let e=a.value.slice(0);i=Array.from(new Uint8Array(e.buffer)),e=s.value.slice(0),o=Array.from(new Uint8Array(e.buffer)),e=l.value.slice(0),r=Array.from(new Uint8Array(e.buffer))}t=new u(i,o,r)}return t}(e);void 0!==t&&P.setPaletteColourMap(t)}const Q={numberOfFiles:n};Q.TransferSyntaxUID=i("00020010"),Q.MediaStorageSOPClassUID=i("00020002"),Q.SOPClassUID=i(qt),Q.Modality=i(Ut),Q.ImageType=i("00080008"),Q.SamplesPerPixel=i(Mt),Q.PhotometricInterpretation=i("00280004"),Q.PixelRepresentation=i("00280103"),Q.BitsAllocated=i(Qt),Q.BitsStored=i("00280101"),Q.HighBit=i("00280102"),Q.ImageOrientationPatient=o("00200037");const N=Object.keys(Nt);for(const e of N)Q[e]=i(Nt[e]);if(q)Q.pixelUnit="SUV";else{const t=function(e){return void 0!==O.getTagPixelUnit?O.getTagPixelUnit(e):function(e){let t;const n=["RescaleType","Units"];for(const t of n)if(void 0!==We(e,It[t]))break;if(void 0===t){const n=We(e,It.Modality);void 0!==n&&"CT"===n&&(t="HU")}return t}(e)}(e);void 0!==t&&(Q.pixelUnit=t)}Q.lengthUnit=void 0===d?"unit.pixel":"unit.mm";const V=function(e,t){let n;const i=Ye(e,"00281050"),o=Ye(e,"00281051");if(void 0!==i&&void 0!==o){n={};const r=Ye(e,"00281055");let a;for(let e=0;e<i.length;++e){const s=parseFloat(i[e]);let l=parseFloat(o[e]);s&&l&&0!==l&&(a="",void 0!==r&&(a=r[e]),""===a&&(a="Default"+e),l*=t,l<1&&(l=1),n[a]={wl:[new D(s*t,l)],name:a}),0===l&&h.warn("Zero window width found in DICOM.")}}return n}(e,U);return void 0!==V&&(Q.windowPresets=V),Q.VOILUTFunction=i("00281056"),P.setMeta(Q),P}}class Bt{#X=!0;#_;constructor(e,t){void 0!==t&&(this.#X=t),this.#_=new DataView(e)}writeUint8(e,t){return this.#_.setUint8(e,t),e+Uint8Array.BYTES_PER_ELEMENT}writeInt8(e,t){return this.#_.setInt8(e,t),e+Int8Array.BYTES_PER_ELEMENT}writeUint16(e,t){return this.#_.setUint16(e,t,this.#X),e+Uint16Array.BYTES_PER_ELEMENT}writeInt16(e,t){return this.#_.setInt16(e,t,this.#X),e+Int16Array.BYTES_PER_ELEMENT}writeUint32(e,t){return this.#_.setUint32(e,t,this.#X),e+Uint32Array.BYTES_PER_ELEMENT}writeUint64(e,t){return this.#_.setBigUint64(e,t,this.#X),e+BigUint64Array.BYTES_PER_ELEMENT}writeInt32(e,t){return this.#_.setInt32(e,t,this.#X),e+Int32Array.BYTES_PER_ELEMENT}writeInt64(e,t){return this.#_.setBigInt64(e,t,this.#X),e+BigInt64Array.BYTES_PER_ELEMENT}writeFloat32(e,t){return this.#_.setFloat32(e,t,this.#X),e+Float32Array.BYTES_PER_ELEMENT}writeFloat64(e,t){return this.#_.setFloat64(e,t,this.#X),e+Float64Array.BYTES_PER_ELEMENT}writeHex(e,t){const n=parseInt(t,16);return this.#_.setUint16(e,n,this.#X),e+Uint16Array.BYTES_PER_ELEMENT}writeBinaryArray(e,t){if(t.length%8!=0)throw new Error("Cannot write boolean array as binary.");let n,i;for(let o=0,r=t.length;o<r;o+=8){n=0;for(let e=0;e<8;++e)i=0===t[o+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 Gt=0;class kt{action;value;constructor(e){this.action=e}}const Ht={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 zt(e){const t="."+(new Date).toISOString().replace(/\D/g,"").substring(0,14);Gt+=1;const n="."+Gt;let i="1.2.826.0.1.3680043.9.7278.1.";const o=29+n.length+t.length,r=Math.min(e.length,64-o);if(r>1){let t="";for(let n=0;n<r;++n)t+=e.charCodeAt(n);i+=t.substring(0,r)}return i+=t+n,i}function Wt(e){return e%2==0}function Yt(e){const t=Pe[e];return void 0!==t&&"string"===t}function Xt(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}class jt{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 Zt="00080005",_t="00280100";class Kt{#De=!1;#ve=!0;#ye={default:{action:"copy",value:null}};#Ce=this.#ye;#Ie=[];#Te=new jt;#Le=this.#Te;setUseUnVrForPrivateSq(e){this.#De=e}setFixUnknownVR(e){this.#ve=e}setRules(e,t){if(this.#Ce=e,this.#Ie=[],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!==Fe(n).getNameFromDictionary()),t)e=n;else{const t=Be(n);void 0!==t&&(e=t.getKey())}void 0!==e&&this.#Ie.push(e)}}}}#Pe(e){return this.#Te.encode(e)}#we(e){return this.#Le.encode(e)}useSpecialTextEncoder(){this.#Le=new TextEncoder}getElementToWrite(e){const t=e.tag.getGroupName(),n=e.tag.getNameFromDictionary();let i;return i=void 0!==this.#Ce[e.tag.getKey()]?this.#Ce[e.tag.getKey()]:void 0!==n&&void 0!==this.#Ce[n]?this.#Ce[n]:void 0!==this.#Ce[t]?this.#Ce[t]:this.#Ce.default,Ht[i.action](e,i.value)}#Oe(e,t,n,i,o){const r=function(e){return qe(e.tag)&&"NONE"===e.vr};for(const a of n){if(0===a.length)continue;let n=!1;const s=a.find((e=>r(e)));void 0!==s&&void 0!==s.undefinedLength&&(n=s.undefinedLength);const l=new He("NONE");l.vl=n?4294967295:s.vl,l.tag=Ee(),l.value=[],t=this.#Ae(e,l,t,i);for(const n of a)r(n)||Ue(n.tag)||(t=this.#Ae(e,n,t,i,o));if(n){const n=new He("NONE");n.vl=0,n.tag=new xe("FFFE","E00D"),n.value=[],t=this.#Ae(e,n,t,i)}}return t}#be(e,t,n,i,o,r){const a=n;if("NONE"===t.vr);else if(i instanceof Uint8Array)if(void 0!==r&&1===r){if(i.length%8!=0){h.debug("Padding binary pixel data");const e=8*Math.ceil(i.length/8),t=new Array(e-i.length);t.fill(0),i=Xt(i,t)}n=e.writeBinaryArray(n,i)}else n=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 r=Pe[t.vr];if(void 0!==r)if("Uint8"===r)n=e.writeUint8Array(n,i);else if("Uint16"===r)n=e.writeUint16Array(n,i);else if("Int16"===r)n=e.writeInt16Array(n,i);else if("Uint32"===r)n=e.writeUint32Array(n,i);else if("Int32"===r)n=e.writeInt32Array(n,i);else if("Uint64"===r)n=e.writeUint64Array(n,i);else if("Int64"===r)n=e.writeInt64Array(n,i);else if("Float32"===r)n=e.writeFloat32Array(n,i);else if("Float64"===r)n=e.writeFloat64Array(n,i);else{if("string"!==r)throw new Error("Unknown VR type: "+r);n=e.writeUint8Array(n,i)}else if("SQ"===t.vr)n=this.#Oe(e,n,i,o);else if("AT"===t.vr)for(const t of i){const i=t+"",o=i.substring(1,5),r=i.substring(6,10),a=[parseInt(o,16),parseInt(r,16)];n=e.writeUint16Array(n,a)}else"xs"===t.vr?n=i instanceof Int16Array?e.writeInt16Array(n,i):e.writeUint16Array(n,i):h.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+")",h.warn(n)}}return n}#xe(e,t,n,i,o,r){let a=!1;if(void 0!==t.undefinedLength&&(a=t.undefinedLength),a){const a=[];a.push({tag:Ee(),vr:"NONE",vl:0,value:[]});for(const e of i)a.push({tag:Ee(),vr:t.vr,vl:e.length,value:e});n=this.#Oe(e,n,[a],o,r)}else{let a=i[0];i.length>1&&(a=function(e){if(void 0===e[0].length)return e;let t=0;for(const n of e)t+=n.length;const n=new e[0].constructor(t);let i=0;for(const t of e)n.set(t,i),i+=t.length;return n}(i)),n=this.#be(e,t,n,a,o,r)}return n}#Ae(e,t,n,i,o){const r=t.tag.isWithVR(),a=!(!i&&r)||Ie(t.vr);n=e.writeHex(n,t.tag.getGroup()),n=e.writeHex(n,t.tag.getElement());let s=t.vr;this.#De&&t.tag.isPrivate()&&"SQ"===s&&(h.warn("Write element using VR=UN for private sequence."),s="UN"),r&&!i&&(n=e.writeUint8Array(n,this.#Pe(s)),a&&(n+=2));let l=!1;("SQ"===t.vr||Ne(t.tag))&&void 0!==t.undefinedLength&&(l=t.undefinedLength);let c=!1;qe(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=Ne(t.tag)?this.#xe(e,t,n,d,i,o):this.#be(e,t,n,d,i),l){const t=new He("NONE");t.vl=0,t.tag=new xe("FFFE","E0DD"),t.value=[],n=this.#Ae(e,t,n,i)}return n}getBuffer(e){const t=e["00020010"].value[0],n=it(t),i=ot(t);if(void 0!==e[Zt]){const t=e[Zt].value[0];void 0!==t&&"ISO-IR 6"!==t&&(h.debug("Change charset to UTF, was: "+t),this.useSpecialTextEncoder(),e[Zt].value=["ISO_IR 192"])}let o;void 0!==e[_t]&&(o=e[_t].value[0]);let r=132,a=0;const s=[],l=[];let c,u,d=0;const g=new xe("0002","0000"),S=new xe("0002","0001"),m=new xe("0002","0012"),p=new xe("0002","0013"),f=this.#Ie.slice(),D=Object.keys(e);for(const t of D){const h=e[t];if(h.tag=Fe(t),c=this.getElementToWrite(h),!(null===c||g.equals(c.tag)||S.equals(c.tag)||m.equals(c.tag)||p.equals(c.tag))){a=0;const e=f.indexOf(c.tag.getKey());-1!==e&&f.splice(e,1),this.#ve&&Jt(c,!i),this.#Re(c,c.value,n,o),u=c.tag.getGroupName(),a+=ut(c.vr,"Meta Element"!==u&&n),a+=c.vl,"Meta Element"===u?(s.push(c),d+=a):l.push(c),r+=a}}for(const e of f){const t=Fe(e),i=new He(t.getVrFromDictionary());let o;if(i.tag=t,void 0!==this.#Ce[e])o=this.#Ce[e].value;else{const e=t.getNameFromDictionary();o=this.#Ce[e].value}let a=ut(i.vr,n);a+=this.#Re(i,[o],n),l.push(i),r+=a}const v=$t("FileMetaInformationVersion");let y=ut(v.vr,!1);y+=this.#Re(v,[0,1],!1),s.push(v),d+=y,r+=y;const C=$t("ImplementationClassUID");let I=ut(C.vr,!1);const T="1.2.826.0.1.3680043.9.7278.1."+"0.35.1".replace("-beta",".99");I+=this.#Re(C,[T],!1),s.push(C),d+=I,r+=I;const L=$t("ImplementationVersionName");let P=ut(L.vr,!1);P+=this.#Re(L,["DWV_0.35.1"],!1),s.push(L),d+=P,r+=P;const w=function(e,t){return Re(e.tag,t.tag)};s.sort(w),l.sort(w);const O=$t("FileMetaInformationGroupLength");let A=ut(O.vr,!1);A+=this.#Re(O,new Uint32Array([d]),!1),r+=A;const b=new ArrayBuffer(r),x=new Bt(b),R=new Bt(b,!i);let F=128;F=x.writeUint8Array(F,this.#Pe("DICM")),F=this.#Ae(x,O,F,!1);for(const e of s)F=this.#Ae(x,e,F,!1);const E=132+A+d;F!==E&&h.warn("Bad size calculation... meta offset: "+F+", calculated size:"+E+" (diff:"+(F-E)+")");for(const e of l)F=this.#Ae(R,e,F,n,o);return F!==r&&h.warn("Bad size calculation... final offset: "+F+", calculated size:"+r+" (diff:"+(F-r)+")"),b}#Re(e,t,n,i){let o=0;if("SQ"===e.vr){if(null!==t&&0!==t){const r=[];let a=!1;void 0!==e.undefinedLength&&(a=e.undefinedLength,delete e.undefinedLength);for(const e of t){const t=e,s=[];let l=0;if(null===t||0===t)continue;let c=i;const u=t[_t];void 0!==u&&void 0!==u.value&&(c=u.value[0]);const d=Object.keys(t);for(const e of d){const i=t[e];i.tag=Fe(e),qe(i.tag)||(l+=this.#Re(i,i.value,n,c),s.push(i),l+=ut(i.vr,n))}const h={tag:Ee(),vr:"NONE",vl:l,value:[]};a&&(h.undefinedLength=a),s.push(h),l+=ut(h.vr,n),a&&(l+=ut("NONE",n));const g=function(e,t){return Re(e.tag,t.tag)};s.sort(g),o+=l,r.push(s)}a&&(o+=ut("NONE",n)),e.value=r,e.vl=o,a&&(e.undefinedLength=a)}}else{if(Yt(r=e.vr)||"OB"===r){const n=function(e){let t="";return Yt(e)&&(t="UI"===e?"\0":" "),t}(e.vr);if(Yt(e.vr)){let i;Le(e.vr)?(t=this.#we(t.join("\\")),i=this.#we(n)):(t=this.#Pe(t.join("\\")),i=this.#Pe(n)),Wt(t.length)||(t=Xt(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(const n of e)t+=n.length;Wt(t)||(e[e.length-1]=Xt(e[e.length-1],[0]))}else Wt(e.length)||(e=Xt(e,[0]));return e}(t))}if(o=0,"AT"===e.vr)o=4*t.length;else if("xs"===e.vr)o=t.length*Uint16Array.BYTES_PER_ELEMENT;else if(function(e){const t=Pe[e];return void 0!==t&&"string"!==t}(e.vr)||"ox"===e.vr){if(Ne(e.tag)&&Array.isArray(t)){o=0;for(const e of t)o+=e.length}else o=t.length;const r=Pe[e.vr];if(Ne(e.tag)||"ox"===e.vr)if(e.undefinedLength){const e=ut("NONE",n);o+=e,o+=e*t.length,o+=e}else void 0!==i&&(1===i?o=Math.ceil(o/8):16===i&&(o*=Uint16Array.BYTES_PER_ELEMENT));else{if(void 0===r)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}(r);if(void 0===e)throw new Error("Unknown bytes per element for VR type: "+r);o*=e}}}else o=t.length;e.value=t,e.vl=o}var r;return o}}function Jt(e,t){if("UN"===e.vr){const n=e.tag.getVrFromDictionary();if(void 0!==n&&e.vr!==n){e.vr=n;const i=Pe[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 o=new Ze(e.buffer,n),r=e.byteOffset,a=e.length,s=Pe[t];return"Uint16"===s?i=o.readUint16Array(r,a):"Uint32"===s?i=o.readUint32Array(r,a):"Uint64"===s?i=o.readUint64Array(r,a):"Int16"===s?i=Array.from(o.readInt16Array(r,a)):"Int32"===s?i=Array.from(o.readInt32Array(r,a)):"Int64"===s?i=o.readInt64Array(r,a):"Float32"===s?i=Array.from(o.readFloat32Array(r,a)):"Float64"===s&&(i=Array.from(o.readFloat64Array(r,a))),i}(e.value,e.vr,t);void 0!==n&&(e.value=n)}h.info("Element "+e.tag.getGroup()+" "+e.tag.getElement()+" VR changed from UN to "+e.vr)}}}function $t(e){const t=Be(e),n=new He(t.getVrFromDictionary());return n.tag=t,n}function en(e){const t=Object.keys(e),n={};for(const i of t){const t=Be(i);if(void 0===t)continue;const o=t.getVrFromDictionary();let r,a=!1;const s=e[i];if("SQ"===o){const e=[];if(void 0!==s.undefinedLength&&(a=s.undefinedLength),Array.isArray(s.value))for(const t of s.value)e.push(en(t));else h.debug("Non array simpleTag SQ value");r=e}else r=Array.isArray(s)?s:[s];const l=new He(o);l.tag=t,l.value=r,a&&(l.undefinedLength=a),n[t.getKey()]=l}return n}const tn="00080100",nn="00080102",on="00080119",rn="00080120";class an{meaning;value;longValue;urnValue;schemeDesignator;constructor(e){this.meaning=e}toString(){return"("+this.value+", "+this.schemeDesignator+", '"+this.meaning+"')"}}function sn(e,t){return void 0!==e&&void 0!==t&&e.schemeDesignator===t.schemeDesignator&&e.value===t.value}function ln(e){const t=new an(e["00080104"].value[0]);if(void 0!==e[tn])t.value=e[tn].value[0];else if(void 0!==e[on])t.longValue=e[on].value[0];else{if(void 0===e[rn])throw new Error("Invalid code with no value, no long value and no urn value.");t.urnValue=e[rn].value[0]}if(void 0!==t.value||void 0!==t.longValue){if(void 0===e[nn])throw new Error("No coding sheme designator when code value or long value is present");t.schemeDesignator=e[nn].value[0]}return t}function cn(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 un={value:"111017",meaning:"CAD Processing and Findings Summary"},dn={value:"111030",meaning:"Image Region"},hn={value:"111059",meaning:"Single Image Finding"},gn={value:"111099",meaning:"Selected region"},Sn={value:"111242",meaning:"All algorithms succeeded; with findings"},mn={value:"112000",meaning:"Chest CAD Report"},pn={value:"112020",meaning:"Response Evaluation"},fn={value:"112021",meaning:"Response Evaluation Method"},Dn={value:"112022",meaning:"RECIST"},vn={value:"112039",meaning:"Tracking Identifier"},yn={value:"112051",meaning:"Measurement of Response"},Cn={value:"112040",meaning:"Tracking Unique Identifier"},In={value:"112048",meaning:"Current Response"},Tn={value:"113076",meaning:"Segmentation"},Ln={value:"121055",meaning:"Path"},Pn={value:"121106",meaning:"Comment"},wn={value:"121322",meaning:"Source image for image processing operation"},On={value:"121324",meaning:"Source Image"},An={value:"122438",meaning:"Reference Points"},bn={value:"125007",meaning:"Measurement Group"},xn={value:"125309",meaning:"Short Label"},Rn={value:"126000",meaning:"Imaging Measurement Report"},Fn={value:"126010",meaning:"Imaging Measurements"},En={value:"128773",meaning:"Reference Geometry"},qn={1483009:"Angle",42798e3:"Area",103355008:"Width",103339001:"Long axis",103340004:"Short axis",131190003:"Radius",261665006:"Unknown",410668003:"Length",718499004:"Color"},Un={1:"No units",mm:"Millimeter",deg:"Degree - plane angle",cm2:"Square centimeter","cm2/ml":"Square centimeter per milliliter","/cm":"Per centimeter","g/ml":"Gram per milliliter","g/ml{SUVbw}":"Standardized Uptake Value body weight","mg/ml":"Milligram per milliliter","umol/ml":"Micromole per milliliter","Bq/ml":"Becquerels per milliliter","mg/min/ml":"Milligrams per minute per milliliter","umol/min/ml":"Micromole per minute per milliliter","ml/min/g":"Milliliter per minute per gram","ml/g":"Milliliter per gram","ml/min/ml":"Milliliter per minute per milliliter","ml/ml":"Milliliter per milliliter","%":"Percentage","[hnsf'U]":"Hounsfield unit","10*23/ml":"Electron density","{counts}":"Counts","{counts}/s":"Counts per second","{propcounts}":"Proportional to counts","{propcounts}/s":"Proportional to counts per second"};function Mn(e){const t=new an(e.meaning);return t.schemeDesignator="DCM",t.value=e.value,t}function Qn(e,t){let n,i;return"SCT"===t?n=qn[e]:"UCUM"===t&&(n=Un[e]),void 0!==n&&(i=new an(n),i.schemeDesignator=t,i.value=e),i}function Nn(){return Mn(Tn)}function Vn(){return Qn("718499004","SCT")}const Bn={angle:{key:"1483009",scheme:"SCT"},length:{key:"410668003",scheme:"SCT"},surface:{key:"42798000",scheme:"SCT"},height:{key:"121207",scheme:"DCM"},width:{key:"103355008",scheme:"SCT"},radius:{key:"131190003",scheme:"SCT"},a:{key:"103339001",scheme:"SCT"},b:{key:"103340004",scheme:"SCT"},min:{key:"113051",scheme:"DCM"},max:{key:"113048",scheme:"DCM"},mean:{key:"113049",scheme:"DCM"},stddev:{key:"113061",scheme:"DCM"}},Gn={"unit.mm":"mm","unit.cm2":"cm2","unit.degree":"deg",HU:"[hnsf'U]",MGML:"mg/ml",ED:"10*23/ml",PCT:"%",CNTS:"{counts}",NONE:"1",CM2:"cm2",CM2ML:"cm2/ml",PCNT:"%",CPS:"{counts}/s",BQML:"Bq/ml",MGMINML:"mg/min/ml",UMOLMINML:"umol/min/ml",MLMING:"ml/min/g",MLG:"ml/g","1CM":"/cm",UMOLML:"umol/ml",PROPCNTS:"{propcounts}",PROPCPS:"{propcounts}/s",MLMINML:"ml/min/ml",MLML:"ml/ml",GML:"g/ml",SUV:"g/ml{SUVbw}"};function kn(e){const t=Gn[e];let n;return void 0!==t?n=Qn(t,"UCUM"):void 0===t&&(n=Qn("1","UCUM")),n}const Hn="00620005",zn="00620009",Wn="0062000C",Yn="0062000D",Xn="00620003",jn="0062000F",Zn="00620020";class _n{number;label;algorithmType;algorithmName;displayValue;displayRGBValue;propertyTypeCode;propertyCategoryCode;trackingUid;trackingId;constructor(e,t,n){this.number=e,this.label=t,this.algorithmType=n}}function Kn(e){const t=new _n(e["00620004"].value[0],e[Hn]?e[Hn].value[0]:"n/a",e["00620008"].value[0]);if(void 0!==e[zn]&&(t.algorithmName=e[zn].value[0]),void 0!==e[Wn])t.displayValue=e[Wn].value[0];else if(void 0!==e[Yn]){const i=e[Yn].value,o=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,o=e.z/100;return{r:Math.round(255*t(3.2406*n-1.5372*i-.4986*o)),g:Math.round(255*t(-.9689*n+1.8758*i+.0415*o)),b:Math.round(255*t(.0557*n-.204*i+1.057*o))}}(function(e){function t(e){let t=null;return t=e>.206896552?Math.pow(e,3):.128418549*e-.017712903,t}const n=L,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=o}else h.warn("No recommended colour for segment, using default"),t.displayRGBValue=function(e){const t=[new v(0,0,0),new v(255,0,0),new v(0,255,0),new v(0,0,255),new v(255,255,0),new v(0,255,255),new v(255,0,255),new v(255,239,213),new v(0,0,205),new v(205,133,63),new v(210,180,140),new v(102,205,170),new v(0,0,128),new v(0,139,139),new v(46,139,87),new v(255,228,225)];let n;return n=e<t.length?t[e]:new v(255*Math.random(),255*Math.random(),255*Math.random()),n}(t.number);var n;if(void 0===e[Xn])throw new Error("Missing Segmented Property Category Code Sequence.");if(t.propertyCategoryCode=ln(e[Xn].value[0]),void 0===e[jn])throw new Error("Missing Segmented Property Type Code Sequence.");return t.propertyTypeCode=ln(e[jn].value[0]),void 0!==e[Zn]&&(t.trackingId=e[Zn].value[0],t.trackingUid=e["00620021"].value[0]),t}function Jn(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=T(P(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:[cn(e.propertyCategoryCode)]}),e.propertyTypeCode&&(n.SegmentedPropertyTypeCodeSequence={value:[cn(e.propertyTypeCode)]}),e.trackingId&&(n.TrackingID=e.trackingId,n.TrackingUID=e.trackingUid),n}const $n="00089124",ei="00082112",ti="00081150",ni="00081155",ii="00209116",oi="00289110";class ri{dimIndex;imagePosPat;derivationImages;refSegmentNumber;imageOrientationPatient;spacing;constructor(e,t,n,i){this.dimIndex=e,this.imagePosPat=t,this.derivationImages=n,this.refSegmentNumber=i}}function ai(e){const t=[];if(void 0!==e[$n]){const n=e[$n].value;for(let e=0;e<n.length;++e){const i=[];if(void 0!==n[e][ei]){const t=n[e][ei].value;for(let e=0;e<t.length;++e){const n={};void 0!==t[e][ti]&&(n.referencedSOPClassUID=t[e][ti].value[0]),void 0!==t[e][ni]&&(n.referencedSOPInstanceUID=t[e][ni].value[0]),i.push(n)}}t.push({sourceImages:i})}}const n=e["00209111"].value[0]["00209157"].value,i=e["0062000A"].value,o=parseInt(i[0]["0062000B"].value[0],0),r=e["00209113"].value[0]["00200032"].value;for(let e=0;e<r.length;++e)r[e]=parseFloat(r[e]);const a=new ri(n,r,t,o);if(void 0!==e[ii]){const t=e[ii];if(0!==t.value.length){const e=t.value[0]["00200037"].value;void 0!==e&&(a.imageOrientationPatient=e)}}if(void 0!==e[oi]){const t=e[oi];if(0!==t.value.length){const e=Lt(t.value[0]);void 0!==e&&(a.spacing=e)}else h.warn("No shared functional group pixel measure sequence items.")}return a}function si(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=cn(Mn(wn)),i=cn(Mn(Tn)),o=[];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});o.push({DerivationCodeSequence:{value:[i]},SourceImageSequence:{value:e}})}t.DerivationImageSequence={value:o}}return t}const li="00209116",ci="00289110",ui={PatientName:"00100010",PatientID:"00100020",PatientBirthDate:"00100030",PatientSex:"00100040",StudyDate:"00080020",StudyTime:"00080030",StudyInstanceUID:"0020000D",StudyID:"00200010",ReferringPhysicianName:"00080090",SeriesDate:"00080021",SeriesTime:"00080031",SeriesInstanceUID:"0020000E",SeriesNumber:"00200011",FrameOfReferenceUID:"00200052",Manufacturer:"00080070",ManufacturerModelName:"00081090",DeviceSerialNumber:"00181000",SoftwareVersions:"00181020",LossyImageCompression:"00282110"};function di(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,o=!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(he(t.enum[e],i)){o=!0;break}}else o=t.enum.includes(i);if(!o)throw new Error("Unsupported "+t.name+" value: "+i)}function hi(e,t,n){const i=e.getGeometry().getSize().getDimSize(2),o={};for(let r=0;r<i;++r){const a=n+r,s=e.getValueAtOffset(a);for(const e of t){const t=e.number-1;s===e.number&&(void 0===o[t]&&(o[t]=new Uint8Array(i)),o[t][r]=1)}}return o}const gi=[{name:"TransferSyntaxUID",tag:"00020010",type:"1",enum:[Oe,Ae,be]},{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 Si(){const e={};for(const t of gi)e[t.name]=t.enum[0];return e}class mi{#pe;getWarning(){return this.#pe}checkElements(e){}create(e,t,n){const i=function(t){return We(e,t)},o=function(t){return Ye(e,t)};for(const t of gi)di(e,t);const r=Tt(e),a=new ce([r[0],r[1],1]),s=a.getTotalSize();let l=i("00280008");if(l=void 0!==l?parseInt(l,10):1,l!==t.length/s)throw new Error("Buffer and numberOfFrames meta are not equal "+l+" "+t.length/s);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=[],o=e["00209222"];if(void 0!==o){const e=o.value;if(2!==e.length)throw new Error("Unsupported dimension index sequence length");let t;for(let o=0;o<e.length;++o){const r=e[o]["00209164"].value[0];if(r!==n)throw new Error("Dimension Index Sequence contains a unknown Dimension Organization");t=e[o]["00209165"].value[0];const a={DimensionOrganizationUID:r,DimensionIndexPointer:t};void 0!==e[o]["00209421"]&&(a.DimensionDescriptionLabel=e[o]["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),d=o("00620002");if(void 0===d)throw new Error("Missing or empty segmentation sequence");const g=[],S=[0],m=[0],p=[0];for(let e=0;e<d.length;++e){const t=Kn(d[e]);void 0!==t.displayRGBValue&&(S[t.number]=t.displayRGBValue.r,m[t.number]=t.displayRGBValue.g,p[t.number]=t.displayRGBValue.b),g.push(t)}let f,D,v,y=!1;S.length>1&&(y=!0,f=new u(S,m,p));const C=o("52009229");if(void 0!==C){const e=C[0];if(void 0!==e[li]){const t=e[li];0!==t.value.length?v=t.value[0]["00200037"].value:h.warn("No shared functional group plane orientation sequence items.")}if(void 0!==e[ci]){const t=e[ci];0!==t.value.length?D=Lt(t.value[0]):h.warn("No shared functional group pixel measure sequence items.")}}const I=function(e,t){return e.some((function(e){return n=t,i=e,JSON.stringify(n)===JSON.stringify(i);var n,i}))},T=function(e,t){return e.findIndex((function(e){return t.equals(e)}))},L=o("52009230");if(void 0===L)throw new Error("Missing or empty per frame functional sequence");if(l!==L.length)throw new Error("perFrameFuncGroupSequence meta and numberOfFrames are not equal.");const P=[];for(let e=0;e<L.length;++e)P.push(ai(L[e]));const w=[];for(let e=0;e<P.length;++e){if(I(w,P[e].imagePosPat)||w.push(P[e].imagePosPat),void 0!==P[e].imageOrientationPatient)if(void 0===v)v=P[e].imageOrientationPatient;else if(!he(v,P[e].imageOrientationPatient))throw new Error("Unsupported multi orientation dicom seg.");if(void 0!==P[e].spacing)if(void 0===D)D=P[e].spacing;else if(!D.equals(P[e].spacing))throw new Error("Unsupported multi resolution dicom seg.")}if(void 0===D)throw new Error("No spacing found for DICOM SEG");if(3!==D.length())throw new Error("Incomplete spacing found for DICOM SEG");if(void 0===v)throw new Error("No imageOrientationPatient found for DICOM SEG");const O=ee(v.map((e=>parseFloat(e))));if(void 0===O)throw new Error("Invalid imageOrientationPatient found for DICOM SEG");w.sort(function(e){const t=e.getInverse();return function(e,n){const i=t.multiplyArray3D(e),o=t.multiplyArray3D(n);return i[2]-o[2]}}(O));const A=function(e){return new F(e[0],e[1],e[2])},b=[];for(const e of w)b.push(A(e));let x;x=void 0!==n?this.#Fe(b,a,D,O,n.getGeometry().getOrigins()):this.#Ee(b,a,D,O);const R=x.getSize().get(2),E=function(e){return function(t){return t.number===e}},q=new t.constructor(s*R);q.fill(0);const U=x.getOrigins();let M,Q,N;for(let e=0;e<P.length;++e){if(M=T(U,A(P[e].imagePosPat)),-1===M)throw new Error("Cannot find frame origin in mask origins");Q=s*e,N=s*M;const n=g.find(E(P[e].refSegmentNumber));for(let e=0;e<s;++e)if(0!==t[Q+e]){q[N+e]=y?n.number:n.displayValue}}const V=[];for(let e=0;e<R;++e)V.push(e.toString());const B=new Ti(x,q,V);y&&(B.setPhotometricInterpretation("PALETTE COLOR"),B.setPaletteColourMap(f));const G=Si(),k=Object.keys(ui);for(const e of k)G[e]=i(ui[e]);return G.DimensionOrganizationSequence=c.organizations,G.DimensionIndexSequence=c.indices,G.custom={segments:g,frameInfos:P,SOPInstanceUID:i("00080018")},G.lengthUnit=n.getMeta().lengthUnit,G.numberOfFiles=R,B.setMeta(G),B}#Fe(e,t,n,i,o){const r=function(e,t){return e.findIndex((function(e){return t.isSimilar(e,1e-4)}))},a=[];a.push(e[0]);let s=r(o,e[0]);if(-1===s)throw new Error("No index for first frame origin");for(let t=1;t<e.length;++t){const n=e[t],i=r(o,n);if(-1===i)throw new Error("No index for frame origin "+t);if(i!==s+1)for(let e=s+1;e<i;++e)a.push(o[e]);a.push(n),s=i}const l=new vt([e[0]],t,n,i);for(let e=1;e<a.length;++e)l.appendOrigin(a[e],e);return l}#Ee(e,t,n,i){h.warn("Guessing image geometry for DICOM SEG");const r=new vt([e[0]],t,n,i),a=function(e){let t=e>q;return t&&(t=e>.001,t?(t=e>.01,t||h.warn("Using larger+ real world epsilon in SEG pos pat adding")):h.warn("Using larger real world epsilon in SEG pos pat adding")),t},s=[];s.push(e[0]);let l=0;for(let t=1;t<e.length;++t){++l;let n=new o([0,0,l]),i=r.indexToWorld(n).get3D();const c=e[t];let u=c.getDistance(i);const d=u;for(;a(u);)if(h.debug("Adding intermediate pos pats for DICOM seg at "+i.toString()),s.push(i),++l,n=new o([0,0,l]),i=r.indexToWorld(n).get3D(),u=c.getDistance(i),u>d)throw new Error("Test distance is increasing when adding intermediate pos pats");s.push(c)}const c=new vt([e[0]],t,n,i);for(let e=1;e<s.length;++e)c.appendOrigin(s[e],e);return c}toDicom(e,t,n,i){const o=e.getMeta();void 0===t&&(t=o.segments);const r=e.getGeometry(),a=r.getSize();o.Rows=a.get(1),o.Columns=a.get(0);const s=new Date;o.ContentDate=Ft(xt(s)),o.ContentTime=Et(Rt(s)),void 0!==n&&(o.StudyInstanceUID=n.getMeta().StudyInstanceUID);const l=[];for(const e of t)l.push(Jn(e));var c,u;o.SegmentSequence={value:l},o.SharedFunctionalGroupsSequence={value:[{PlaneOrientationSequence:{value:[(u=r.getOrientation(),{ImageOrientationPatient:[u.get(0,0),u.get(1,0),u.get(2,0),u.get(0,1),u.get(1,1),u.get(2,1)]})]},PixelMeasuresSequence:{value:[(c=r.getSpacing(),{SpacingBetweenSlices:c.get(2),PixelSpacing:[c.get(1),c.get(0)]})]}}]};const d=function(e,t){const n=e.getGeometry().getSize(),i=n.getDimSize(2),o={};for(let r=0;r<n.get(2);++r){const n=hi(e,t,r*i),a=Object.keys(n);for(const e of a)void 0===o[e]&&(o[e]={}),o[e][r]=n[e]}return o}(e,t),g=[],S=[],m=[];for(const i of t){const t=i.number,o=t-1;if(void 0===d[o])continue;const r=Object.keys(d[o]);for(let i=r.length-1;i>=0;--i){const a=Number.parseInt(r[i],10);S.push(d[o][a]);const s=e.getGeometry().getOrigins()[a],l=[s.getX(),s.getY(),s.getZ()],c={dimIndex:[t,r.length-i],imagePosPat:l,refSegmentNumber:t};if(void 0!==n){const e=n.getGeometry().worldToIndex(new E([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})}g.push(c)}}o.NumberOfFrames=S.length.toString();const p=[];for(const e of g)p.push(si(e));if(o.PerFrameFunctionalGroupsSequence={value:p},void 0!==n){const e=[];e.push({ReferencedInstanceSequence:{value:m},SeriesInstanceUID:n.getMeta().SeriesInstanceUID}),o.ReferencedSeriesSequence={value:e}}void 0!==i&&function(e,t){const n=Object.keys(t);for(const i of n)void 0!==e[i]&&h.debug("Overwritting tag: "+i),e[i]=t[i]}(o,i);const f=en(o),D=a.getDimSize(2),v=S.length*D/8,y=new He("OB");return y.tag=new xe("7FE0","0010"),y.vl=v,y.value=S,f["7FE00010"]=y,f}}class pi{poolSize;taskQueue;freeThreads;runningThreads;constructor(e){this.poolSize=e,this.taskQueue=[],this.freeThreads=[];for(let t=0;t<e;++t)this.freeThreads.push(new fi(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.#qe(),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.#qe(),this.onerror({error:e}),this.onworkend({type:"work-end"})};#qe(){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 fi{parentPool;id;runningTask;worker;constructor(e){this.parentPool=e,this.id=Math.random().toString(36).substring(2,15)}getId(){return this.id}run(e){this.runningTask=e,void 0===this.worker&&(this.worker=this.runningTask.getWorker(),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 Di{constructor(e,t){this.startMessage=e,this.info=t}getWorker(){}}class vi extends Di{constructor(e,t){super(e,t)}getWorker(){return new Worker(new URL("./"+i.u(391),i.b),{name:"labeling.worker",type:"module"})}}class yi{#Ue=new pi(1);constructor(){this.#Ue.onerror=e=>{console.error("Labeling failed!",e.error)}}run(e,t){this.#Ue.onworkitem=this.ondone;const n=new vi(function(e,t){const n=t.length(),i=Array(n).fill(0);for(let e=0;e<n;e++)i[e]=t.getDimSize(e);const o=Array(n).fill(0);for(let e=0;e<n;e++)o[e]=t.get(e);return{imageBuffer:e,unitVectors:i,sizes:o,totalSize:t.getTotalSize()}}(e,t),{});this.#Ue.addWorkerTask(n)}ondone(e){}}function Ci(e){return(new Vt).create(e,e["7FE00010"].value[0],1)}function Ii(e){return(new mi).create(e,e["7FE00010"].value[0])}class Ti{#Me;#Y;#Qe;#n=new z(1,0);#Ne=null;#Ve=!0;#R=!0;#Be="MONOCHROME2";#Ge;#ke=0;#He;#ze={};#We=null;#Ye=null;#Xe=null;#N=new H;#je;constructor(e,t,n){this.#Me=e,this.#Y=t,this.#Qe=n,this.#je=null,this.#He=this.#Y.length/this.#Me.getSize().getTotalSize()}getImageUid(e){let t=this.#Qe[0];return 1!==this.#Qe.length&&void 0!==e&&(t=this.#Qe[this.getSecondaryOffset(e)]),t}getOriginForImageUid(e){let t;const n=this.#Qe.indexOf(e);return-1!==n&&(t=this.getGeometry().getOrigins()[n]),t}includesImageUid(e){return this.#Qe.includes(e)}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.#Qe,e)}getGeometry(){return this.#Me}getBuffer(){return this.#Y}canQuantify(){return 1===this.getNumberOfComponents()}canWindowLevel(){return this.isMonochrome()}isMonochrome(){return wt(this.getPhotometricInterpretation())}canScroll(e){const t=this.getGeometry().getSize();let n=1;return void 0!==this.#ze.numberOfFiles&&(n=this.#ze.numberOfFiles),t.canScroll(e)||1!==n}#Ze(){return this.#Me.getSize().getTotalSize(2)}getSecondaryOffset(e){return this.#Me.getSize().indexToOffset(e,2)}getRescaleSlopeAndIntercept(e){let t=this.#n;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.#Ne[n]?t=this.#Ne[n]:h.warn("undefined non constant rsi at "+n)}return t}#_e(e){return this.#Ne[e]}setRescaleSlopeAndIntercept(e,t){if(this.#Ve=this.#Ve&&e.isID(),this.#R){if(!this.#n.equals(e))if(void 0===t)this.#n=e;else{this.#R=!1,this.#Ne=[];for(let e=0,t=this.#Ze();e<t;++e)this.#Ne.push(this.#n);this.#n=null,this.#Ne.splice(t,0,e)}}else{if(void 0===t)throw new Error("Cannot store non constant RSI with empty slice index.");this.#Ne.splice(t,0,e)}}isIdentityRSI(){return this.#Ve}isConstantRSI(){return this.#R}getPhotometricInterpretation(){return this.#Be}setPhotometricInterpretation(e){this.#Be=e}setPaletteColourMap(e){this.#Ge=e,this.#B({type:"imagecontentchange"})}getPaletteColourMap(){return this.#Ge}updatePaletteColourMap(e,t){this.#Ge.red[e]=t.r,this.#Ge.green[e]=t.g,this.#Ge.blue[e]=t.b,this.#B({type:"imagecontentchange"})}getPlanarConfiguration(){return this.#ke}setPlanarConfiguration(e){this.#ke=e}getNumberOfComponents(){return this.#He}getMeta(){return this.#ze}setMeta(e){this.#ze=e}getValueAtOffset(e){return this.#Y[e]}getOffsets(e){let t;if("number"==typeof e){if(1!==this.#He)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.#He)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.#Y.length;e+=this.#He){i=!0;for(let n=0;n<this.#He;++n)if(this.#Y[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.#He?t.push([e[n]]):3===this.#He&&t.push([e[n].r,e[n].g,e[n].b]);let n;1===this.#He?n=function(e,t){return e[0]===t[0]}:3===this.#He&&(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)}},o=new Array(e.length);o.fill(!1);const r=t.slice();let a,s;for(let e=0,n=this.#Y.length;e<n;e+=this.#He){s=[];for(let n=0;n<r.length;++n){a=!0;for(let t=0;t<this.#He;++t)if(this.#Y[e+t]!==r[n][t]){a=!1;break}a&&(o[t.findIndex(i(r[n]))]=!0,s.push(n))}for(let e=0;e<s.length;++e)r.splice(s[e],1);if(0===r.length)break}return o}clone(){const e=this.#Y.slice(0),t=new Ti(this.getGeometry(),e,this.#Qe);if(this.isConstantRSI())t.setRescaleSlopeAndIntercept(this.getRescaleSlopeAndIntercept());else for(let e=0;e<this.#Ze();++e)t.setRescaleSlopeAndIntercept(this.#_e(e),e);return t.setPhotometricInterpretation(this.getPhotometricInterpretation()),t.setPlanarConfiguration(this.getPlanarConfiguration()),t.setMeta(this.getMeta()),t}#Ke(e){let t=this.#Y;if(this.#Y=ct(8*this.#Y.BYTES_PER_ELEMENT,this.#ze.PixelRepresentation,e),null===this.#Y)throw new Error("Cannot reallocate data for image.");this.#Y.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().isSimilar(e.getGeometry().getOrientation(),q))throw new Error("Cannot append a slice with different orientation");if(this.#Be!==e.getPhotometricInterpretation())throw new Error("Cannot append a slice with different photometric interpretation");for(const t in this.#ze)if("windowPresets"!==t&&"numberOfFiles"!==t&&"custom"!==t&&"ImageOrientationPatient"!==t&&this.#ze[t]!==e.getMeta()[t])throw new Error("Cannot append a slice with different "+t+": "+this.#ze[t]+" != "+e.getMeta()[t]);const i=e.getDataRange(),r=this.getDataRange();this.#We={min:Math.min(i.min,r.min),max:Math.max(i.max,r.max)};const a=e.getRescaledDataRange(),s=this.getRescaledDataRange();this.#Ye={min:Math.min(a.min,s.min),max:Math.max(a.max,s.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 o(i)}(this.#Me,e.getGeometry()),d=this.#He*n.getDimSize(2);if(void 0===this.#ze.numberOfFiles)throw new Error("Missing number of files for buffer manipulation.");const h=d*this.#ze.numberOfFiles;this.#Y.length!==h&&this.#Ke(h);const g=u.get(2);let S=g;void 0!==l&&(S+=this.#Me.getCurrentNumberOfSlicesBeforeTime(l));const m=S*d,p=this.#Me.getCurrentTotalNumberOfSlices()*d;m<p&&this.#Y.set(this.#Y.subarray(m,p),m+d),this.#Y.set(e.getBuffer(),m),c||this.#Me.appendOrigin(e.getGeometry().getOrigin(),g,l),this.setRescaleSlopeAndIntercept(e.getRescaleSlopeAndIntercept(),S);const f=this.#Qe.length;if(this.#Qe.splice(S,0,e.getImageUid()),void 0!==this.#ze.windowPresets){const t=this.#ze.windowPresets,n=e.getMeta().windowPresets,i=Object.keys(n);let o=null;for(let e=0;e<i.length;++e){o=i[e];const r=n[o],a=t[o];if(void 0!==a){if((void 0===a.perslice||!1===a.perslice)&&!a.wl[0].equals(r.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[o].wl.splice(S,0,r.wl[0])}else t[o]=n[o]}}this.#B({type:"imagegeometrychange"})}appendFrameBuffer(e,t){const n=this.#Me.getSize(),i=this.#He*n.getDimSize(2);if(void 0===this.#ze.numberOfFiles)throw new Error("Missing number of files for frame buffer manipulation.");const o=i*this.#ze.numberOfFiles;this.#Y.length!==o&&this.#Ke(o),t>=this.#ze.numberOfFiles?h.warn("Ignoring frame at index "+t+" (size: "+this.#ze.numberOfFiles+")"):(this.#Y.set(e,i*t),this.appendFrame(t,new F(0,0,0)))}appendFrame(e,t){this.#Me.appendFrame(t,e),this.#B({type:"appendframe"})}getDataRange(){return this.#We||(this.#We=this.calculateDataRange()),this.#We}getRescaledDataRange(){return this.#Ye||(this.#Ye=this.calculateRescaledDataRange()),this.#Ye}getHistogram(){if(!this.#Xe){const e=this.calculateHistogram();this.#We=e.dataRange,this.#Ye=e.rescaledDataRange,this.#Xe=e.histogram}return this.#Xe}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)};setAtOffsets(e,t){let n,i;if("number"==typeof t){if(1!==this.#He)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.#He)throw new Error("Number of components is not 3 for setting RGB value.");n=[t.r,t.g,t.b]}for(let t=0,o=e.length;t<o;++t){i=e[t];for(let e=0;e<this.#He;++e)this.#Y[i+e]=n[e]}this.#B({type:"imagecontentchange"})}setAtOffsetsAndGetOriginals(e,t){const n=[];for(let i=0;i<e.length;++i){const o=e[i];let r=o[0],a=this.#Y[r];const s=[];s.push({index:0,value:a});for(let e=0;e<o.length;++e){r=o[e];const n=this.#Y[r];a!==n&&(s.push({index:e,value:n}),a=n),this.#Y[r]=t}n.push(s)}return this.#B({type:"imagecontentchange"}),n}setAtOffsetsWithIterator(e,t){const n=Array.isArray(t);for(let i=0;i<e.length;++i){const o=e[i];let r;r=k(n?t[i]:[{index:0,value:t}],o.length);let a=r.next();for(;!a.done;){const e=o[a.index];this.#Y[e]=a.value,a=r.next()}}this.#B({type:"imagecontentchange"})}getValue(e,t,n,i){const r=new o([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 a=new o([e,t,n,i]);r=this.getRescaleSlopeAndIntercept(a).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 o=i.getTotalSize();i.length()>=3&&(o=i.getDimSize(3));for(let i=0;i<o;++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 o=i.getTotalSize();3===i.length()&&(o=i.getDimSize(3));for(let i=0;i<o;++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,o=0,r=this.getRescaledValueAtOffset(0),a=r,s=0;for(let l=0,c=e.getTotalSize();l<c;++l)o=this.getValueAtOffset(l),o>i&&(i=o),o<n&&(n=o),s=this.getRescaledValueAtOffset(l),s>a&&(a=s),s<r&&(r=s),t[s]=(t[s]||0)+1;const l={min:n,max:i},c={min:r,max:a},u=[];for(let e=r;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(),o=i.getDimSize(2)*this.getNumberOfComponents();for(let t=0;t<i.get(2);++t)this.convoluteBuffer(e,n,t*o);return t}convoluteBuffer(e,t,n){const i=this.getGeometry().getSize(),o=i.get(0),r=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]=(-o-1)*s,c[1]=-o*s,c[2]=(1-o)*s,c[3]=-s,c[4]=0,c[5]=1*s,c[6]=(o-1)*s,c[7]=o*s,c[8]=(o+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 g=[];g[0]=c[3],g[1]=c[4],g[2]=c[5],g[3]=c[3],g[4]=c[4],g[5]=c[5],g[6]=c[6],g[7]=c[7],g[8]=c[8];const S=[];S[0]=c[0],S[1]=c[1],S[2]=c[2],S[3]=c[3],S[4]=c[4],S[5]=c[5],S[6]=c[3],S[7]=c[4],S[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,v=0,y=[];for(let n=0;n<a;++n){D+=n*l;for(let n=0;n<r;++n)for(let i=0;i<o;++i){y=c,0===i&&0===n?y=u:0===i&&n===r-1?y=h:i===o-1&&0===n?y=m:i===o-1&&n===r-1?y=f:0===i&&n!==r-1&&0!==n?y=d:i===o-1&&n!==r-1&&0!==n?y=p:0!==i&&i!==o-1&&0===n?y=g:0!==i&&i!==o-1&&n===r-1&&(y=S),v=0;for(let t=0;t<9;++t)v+=this.getValueAtOffset(D+y[t])*e[t];t[D]=v,D+=s}}}transform(e){const t=this.clone(),n=t.getBuffer();for(let i=0,o=n.length;i<o;++i)n[i]=e(t.getValueAtOffset(i));return t}compose(e,t){const n=this.clone(),i=n.getBuffer();for(let n=0,o=i.length;n<o;++n)i[n]=Math.floor(t(this.getValueAtOffset(n),e.getValueAtOffset(n)));return n}recalculateLabels(){if(null===this.#je){this.#je=new yi;const e=this.#Me.getSpacing(),t=this.getMeta().lengthUnit;let n=1,i="unit.pixel";"unit.mm"===t&&(n=e.get(0)*e.get(1)*e.get(2)*.001,i="unit.ml"),this.#je.ondone=e=>{const t=e.data.labels;for(const e of t)e.centroid=this.#Me.indexToWorld(new o(e.centroidIndex)),e.volume=e.count*n,e.unit=i;const r=t.sort(((e,t)=>t.volume-e.volume)).sort(((e,t)=>e.id-t.id));this.#B({type:"labelschanged",labels:r})}}this.#je.run(this.#Y,this.#Me.getSize())}}class Li{#Je;#de;#$e;#et;#tt;constructor(e,t){this.#Je=e,this.#de=e.getRealSpacing(),this.#$e=e.getOrientation(),this.#et=t,this.#tt=function(e,t){let n=e.asOneAndZeros().multiply(t);return e.asOneAndZeros().getAbs().isSimilar(j().getAbs())&&(n=n.getAbs()),n}(this.#$e,t)}getViewOrientation(){return this.#et}getTargetOrientation(){return this.#tt}getOffset3DFromPlaneOffset(e){const t=new x(e.x,e.y,0),n=this.getTargetDeOrientedVector3D(t);return new x(n.getX()*this.#de.get(0),n.getY()*this.#de.get(1),n.getZ()*this.#de.get(2))}getPlaneOffsetFromOffset3D(e){const t=new x(e.x/this.#de.get(0),e.y/this.#de.get(1),e.z/this.#de.get(2)),n=this.getTargetOrientedVector3D(t);return{x:n.getX(),y:n.getY()}}getTargetOrientedVector3D(e){let t=e;return void 0!==this.#tt&&(t=this.#tt.getInverse().multiplyVector3D(e)),t}getTargetDeOrientedVector3D(e){let t=e;return void 0!==this.#tt&&(t=this.#tt.multiplyVector3D(e)),t}getTargetDeOrientedPoint3D(e){let t=e;return void 0!==this.#tt&&(t=this.#tt.multiplyPoint3D(e)),t}getImageOrientedVector3D(e){let t=e;if(void 0!==this.#et){const n=Ct([e.getX(),e.getY(),e.getZ()],this.#et);t=new x(n[0],n[1],n[2])}return t}getImageOrientedPoint3D(e){let t=e;if(void 0!==this.#et){const n=Ct([e.getX(),e.getY(),e.getZ()],this.#et);t=new F(n[0],n[1],n[2])}return t}getImageDeOrientedVector3D(e){let t=e;if(void 0!==this.#et){const n=yt([e.getX(),e.getY(),e.getZ()],this.#et);t=new x(n[0],n[1],n[2])}return t}getImageDeOrientedPoint3D(e){let t=e;if(void 0!==this.#et){const n=yt([e.getX(),e.getY(),e.getZ()],this.#et);t=new F(n[0],n[1],n[2])}return t}getPositionFromPlanePoint(e,t){const n=new F(e.getX(),e.getY(),t),i=this.getImageOrientedPoint3D(n);return this.#Je.pointToWorld(i)}getPlanePointFromPosition(e){const t=this.#Je.worldToPoint(e);return this.getImageDeOrientedPoint3D(t)}getCosines(){return[(e=this.#tt).get(0,0),e.get(1,0),e.get(2,0),e.get(0,1),e.get(1,1),e.get(2,1)];var e}getPlanePoints(e){const t=this.worldToIndex(e),n=this.indexToWorld(t),i=this.getPlanePointFromPosition(n),o=this.getPositionFromPlanePoint(new R(0,0),i.getZ()),r=this.#Je.getOrigins(),a=r[o.getClosest(r)],s=o.getValues(),l=a.getValues(),c=this.getNativeScrollDimIndex();s[c]=l[c];const u=this.getCosines();return[new F(s[0],s[1],s[2]),new F(u[0],u[1],u[2]),new F(u[3],u[4],u[5])]}worldToIndex(e){return this.#Je.worldToIndex(e)}indexToWorld(e){return this.#Je.indexToWorld(e)}isAquisitionOrientation(){return N(this.#et)}getTargetOrientedPositiveXYZ(e){const t=yt([e.x,e.y,e.z],this.#tt);return{x:t[0],y:t[1],z:t[2]}}getScrollDimIndex(){let e=null;return e=void 0!==this.#et?this.#et.getThirdColMajorDirection():2,e}getNativeScrollDimIndex(){let e=null;return e=void 0!==this.#$e?this.#$e.getThirdColMajorDirection():2,e}}class Pi{#_;constructor(e){this.#_=e}getCurrentPosition(){return this.#_.getCurrentPosition()}setCurrentPosition(e,t){let n=!1;return void 0!==e&&(n=this.#_.setCurrentPosition(e,t)),n}}class wi{#nt;#Me;#it;constructor(e){this.#nt=new Pi(e),this.#Me=e.getImage().getGeometry(),this.#it=e.getScrollDimIndex()}getGeometry(){return this.#Me}getScrollDimIndex(){return this.#it}getMaximumDimValue(e){return this.#Me.getSize().get(e)-1}getMaximumScrollValue(){return this.getMaximumDimValue(this.#it)}getCurrentPosition(){return this.#nt.getCurrentPosition()}getCurrentPositionDimValue(e){return this.getCurrentIndex().get(e)}getCurrentPositionScrollValue(){return this.getCurrentPositionDimValue(this.#it)}getCurrentPositionAtDimValue(e,t){const n=this.getCurrentIndex().getValues();return n[e]=t,this.#Me.indexToWorld(new o(n))}getCurrentPositionAtScrollValue(e){return this.getCurrentPositionAtDimValue(this.#it,e)}getCurrentIndex(){return this.#Me.worldToIndex(this.getCurrentPosition())}setCurrentPosition(e,t){let n=!1;return void 0!==e&&(n=this.#nt.setCurrentPosition(e,t)),n}setCurrentPositionSafe(e,t){let n=!1;return this.isPositionInBounds(e)&&(n=this.setCurrentPosition(e,t)),n}merge(e){if(this.#it!==e.getScrollDimIndex())throw new Error("Cannot merge helper of a view with different orientation");this.#Me=function(e,t){const n=e.getOrientation();if(!n.isSimilar(t.getOrientation()))throw new Error("Cannot merge geometries with different orientation");const i=n.getInverse(),o=function(e,t){return e.map(((e,n)=>Math.min(e,t[n])))},r=new ue(o(e.getSpacing().getValues(),t.getSpacing().getValues())),a=function(e){return i.multiplyPoint3D(e.get3D())},s=e.getRange().map(a),l=t.getRange().map(a),c=o(s[0].getValues(),l[0].getValues()),u=(d=s[1].getValues(),h=l[1].getValues(),d.map(((e,t)=>Math.max(e,h[t]))));var d,h;const g=[];for(let e=0;e<c.length;++e)g.push(Math.round(Math.abs(u[e]-c[e])/r.get(e)));const S=new ce(g),m=[];for(let e=0;e<S.get(2);++e){const t=c.slice();t[2]=c[2]+e*r.get(2);const i=new F(t[0],t[1],t[2]);m.push(n.multiplyPoint3D(i))}return new vt(m,S,r,n)}(this.#Me,e.getGeometry())}isPositionInBounds(e){const t=this.#Me.worldToIndex(e),n=[this.#it];return 4===t.length()&&n.push(3),this.#Me.isIndexInBounds(t,n)}getIncrementPosition(e){const t=this.getCurrentIndex().next(e);return this.#Me.indexToWorld(t)}getDecrementPosition(e){const t=this.getCurrentIndex().previous(e);return this.#Me.indexToWorld(t)}incrementPosition(e){return this.setCurrentPositionSafe(this.getIncrementPosition(e))}decrementPosition(e){return this.setCurrentPositionSafe(this.getDecrementPosition(e))}incrementPositionAlongScroll(){return this.incrementPosition(this.#it)}decrementPositionAlongScroll(){return this.decrementPosition(this.#it)}}class Oi{#_;#ot;#rt;#at;#st=!1;constructor(e){if(void 0===e.getImage())throw new Error("View does not have an image, cannot setup controller");this.#_=e,this.#ot=new Li(e.getImage().getGeometry(),e.getOrientation()),this.#rt=new wi(e),"SEG"===e.getImage().getMeta().Modality&&(this.#st=!0)}getPlaneHelper(){return this.#ot}isMask(){return this.#st}initialise(){this.resetWindowLevel(),this.resetPosition()}resetWindowLevel(){this.setWindowLevelPresetById(0)}resetPosition(){this.setCurrentPosition(this.getPositionFromPlanePoint(new R(0,0)))}getModality(){return this.#_.getImage().getMeta().Modality}getSopClassUid(){return this.#_.getImage().getMeta().SOPClassUID}getWindowLevelPresetsNames(){return this.#_.getWindowPresetsNames()}addWindowLevelPresets(e){return this.#_.addWindowPresets(e)}setWindowLevelPreset(e){this.#_.setWindowLevelPreset(e)}setWindowLevelPresetById(e){this.#_.setWindowLevelPresetById(e)}isPlaying(){return void 0!==this.#at}getPositionHelper(){return this.#rt}getPositionHelperClone(){return new wi(this.#_)}getCurrentPosition(){return this.#rt.getCurrentPosition()}getCurrentIndex(){return this.#rt.getCurrentIndex()}getCurrentImageUid(){return this.#_.getCurrentImageUid()}getOriginForImageUid(e){return this.#_.getOriginForImageUid(e)}includesImageUid(e){return this.#_.includesImageUid(e)}getCurrentOrientedIndex(){let e=this.getCurrentIndex();if(void 0!==this.#_.getOrientation()){const t=this.#ot.getImageDeOrientedVector3D(new x(e.get(0),e.get(1),e.get(2)));e=new o([t.getX(),t.getY(),t.getZ()])}return e}getScrollDimIndex(){return this.#_.getScrollDimIndex()}getCurrentIndexScrollValue(){return this.getCurrentIndex().get(this.#_.getScrollDimIndex())}getOrigin(e){return this.#_.getOrigin(e)}isAquisitionOrientation(){return this.#_.isAquisitionOrientation()}getPlanePoints(e){return this.#ot.getPlanePoints(e)}getCurrentScrollPosition(){const e=this.#_.getScrollDimIndex();return this.#_.getCurrentPosition().get(e)}generateImageData(e,t){this.#_.generateImageData(e,t)}setImage(e){this.#_.setImage(e)}get2DSpacing(){return this.#_.getImage().getGeometry().getSpacing(this.#_.getOrientation()).get2D()}getRescaledImageValue(e){const t=this.#_.getImage();if(!t.canQuantify())return;const n=t.getGeometry(),i=n.worldToIndex(e);let o;return n.isIndexInBounds(i)&&(o=t.getRescaledValueAtIndex(i)),o}getPixelUnit(){return this.#_.getImage().getMeta().pixelUnit}getLengthUnit(){return this.#_.getImage().getMeta().lengthUnit}#lt(e,t,n,i){const o=B(G(e,t,n,i)),r=e.getGeometry().getSize(i).getValues();r[2]=1;const a=new ce(r),s=e.getGeometry().getSpacing(i).getValues();s[2]=1;const l=new ue(s),c=new F(0,0,0),u=new vt([c],a,l);return new Ti(u,o)}getImageRegionValues(e,t,n){let i=this.#_.getImage();const r=this.#_.getOrientation();let a=n,s=!0;N(r)||(i=this.#lt(i,a,s,r),a=new o([0,0,0]),s=!1);const l=function(e,t,n,i,o){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 a=e.getGeometry().getSize();void 0===i&&(i=new R(0,0)),void 0===o&&(o=new R(a.get(0)-1,a.get(1)));const s=a.indexToOffset(t.getWithNew2D(i.getX(),i.getY())),l=a.indexToOffset(t.getWithNew2D(o.getX(),o.getY()-1)),c=Math.max(1,o.getX()-i.getX());return function(e,t,n,i,o,r){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===o&&(s=0,a+=r),t}return{done:!0,index:n}}}}(r,s,l+1,0,c,a.get(0)-c)}(i,a,s,e,t);let c=[];return l&&(c=B(l)),c}getImageVariableRegionValues(e,t){let n=this.#_.getImage();const i=this.#_.getOrientation();let r=t,a=!0;N(i)||(n=this.#lt(n,r,a,i),r=new o([0,0,0]),a=!1);const s=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 o=null;o=n?function(t){return e.getRescaledValueAtOffset(t)}:function(t){return e.getValueAtOffset(t)};const r=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,r.get(0)-s[1][0]]))}if(null!==u&&(c=i[u][1]),0!==a.length)return function(e,t,n,i,o){let r=t,a=0,s=0;return{next:function(){if(r<n){const t={value:e(r),done:!1,index:r};return s+=1,r+=1,s===o[a][1]&&(s=0,r+=o[a][2],a+=1,a<o.length&&(r+=o[a][0])),t}return{done:!0,index:n}}}}(o,r.indexToOffset(t.getWithNew2D(l[0],l[1])),r.indexToOffset(t.getWithNew2D(c[0],c[1]))+1,0,a)}(n,r,a,e);let l=[];return s&&(l=B(s)),l}canQuantifyImage(){return this.#_.getImage().canQuantify()}canWindowLevel(){return this.isMonochrome()}isMonochrome(){return this.#_.getImage().isMonochrome()}canScroll(){return this.#_.getImage().canScroll(this.#_.getOrientation())}getImageSize(){return this.#_.getImage().getGeometry().getSize(this.#_.getOrientation())}moreThanOne(e){return this.getImageSize().moreThanOne(e)}getImageWorldSize(){const e=this.#_.getImage().getGeometry(),t=e.getSize(this.#_.getOrientation()).get2D(),n=e.getSpacing(this.#_.getOrientation()).get2D();return{x:t.x*n.x,y:t.y*n.y}}getImageRescaledDataRange(){return this.#_.getImage().getRescaledDataRange()}equalImageMeta(e){const t=this.#_.getImage().getMeta(),n=Object.keys(e);for(let i=0;i<n.length;++i){const o=n[i];if(void 0===t[o])return!1;if(t[o]!==e[o])return!1}return!0}isPositionInBounds(e){return this.#_.isPositionInBounds(e)}setCurrentPosition(e,t){return this.#_.setCurrentPosition(e,t)}getPositionFromPlanePoint(e,t){void 0===t&&(t=this.getCurrentIndexScrollValue());const n=new F(e.getX(),e.getY(),t),i=this.#ot.getImageOrientedPoint3D(n),o=this.#_.getImage().getGeometry().pointToWorld(i);return this.getCurrentPosition().mergeWith3D(o)}getPlanePositionFromPosition(e){const t=this.#_.getImage().getGeometry().worldToPoint(e),n=this.#ot.getImageDeOrientedPoint3D(t);return new R(n.getX(),n.getY())}getIndexFromPosition(e){return this.#_.getImage().getGeometry().worldToIndex(e)}setCurrentIndex(e,t){return this.#_.setCurrentIndex(e,t)}getPlanePositionFromPlanePoint(e){const t=this.getCurrentIndexScrollValue(),n=new F(e.getX(),e.getY(),t),i=this.#ot.getTargetDeOrientedPoint3D(n),o=this.#_.getImage().getGeometry().getRealSpacing();return new F(i.getX()*o.get(0),i.getY()*o.get(1),i.getZ()*o.get(2))}getOffset3DFromPlaneOffset(e){return this.#ot.getOffset3DFromPlaneOffset(e)}play(){if(this.canScroll())if(void 0===this.#at){const e=this.#_.getImage(),t=e.getMeta().RecommendedDisplayFrameRate,n=this.#_.getPlaybackMilliseconds(t),i=e.getGeometry().getSize().canScroll3D();this.#at=window.setInterval((()=>{let e=!1;if(e=i?this.#rt.incrementPositionAlongScroll():this.#rt.incrementPosition(3),!e){const e=this.getCurrentIndex().getValues(),t=this.#_.getOrientation();i?e[t.getThirdColMajorDirection()]=0:e[3]=0;const n=new o(e),r=this.#_.getImage().getGeometry();this.setCurrentPosition(r.indexToWorld(n))}}),n)}else this.stop()}stop(){void 0!==this.#at&&(clearInterval(this.#at),this.#at=void 0)}getWindowLevel(){return this.#_.getWindowLevel()}getCurrentWindowPresetName(){return this.#_.getCurrentWindowPresetName()}setWindowLevel(e){this.#_.setWindowLevel(e)}getColourMap(){return this.#_.getColourMap()}setColourMap(e){this.#_.setColourMap(e)}setViewAlphaFunction(e){this.#_.setAlphaFunction(e)}bindImageAndLayer(e){const t=this.#_.getImage();t.addEventListener("imagecontentchange",e.onimagecontentchange),t.addEventListener("imagegeometrychange",e.onimagegeometrychange)}unbindImageAndLayer(e){const t=this.#_.getImage();t.removeEventListener("imagecontentchange",e.onimagecontentchange),t.removeEventListener("imagegeometrychange",e.onimagegeometrychange)}}const Ai=["mousedown","mousemove","mouseup","mouseout","wheel","dblclick","touchstart","touchmove","touchend"];function bi(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 h.debug("No touch target offset parent.");const i=[];for(let o=0;o<e.length;++o)i.push(new R(e[o].pageX-t,e[o].pageY-n));return i}function xi(e){let t=[];return void 0!==e.targetTouches&&0!==e.targetTouches.length?t=bi(e.targetTouches):void 0!==e.changedTouches&&0!==e.changedTouches.length&&(t=bi(e.changedTouches)),t}function Ri(e){return new R(e.offsetX,e.offsetY)}function Fi(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 o=n.getContext("2d"),r=i.getContext("2d");return o&&(o.fillRect(e-1,t-1,1,1),r.drawImage(n,e-1,t-1,1,1,0,0,1,1)),r&&0!==r.getImageData(0,0,1,1).data[3]}class Ei{#ct;#ut=null;#dt=null;#ht=null;#gt=null;#St=!0;#mt=null;#pt;#ft;#Dt=1;#vt={x:1,y:1};#yt={x:1,y:1};#Ct={x:1,y:1,z:1};#It={x:0,y:0};#Tt={x:0,y:0};#Lt={x:0,y:0};#Pt={x:0,y:0};#wt={x:0,y:0};#Ot={x:0,y:0};#At=null;#bt;#N=new H;#xt=!1;#Rt;#Ft;constructor(e){this.#ct=e,this.#ct.className+=" viewLayer"}getDataId(){return this.#bt}getScale(){return this.#vt}getAbsoluteZoomOffset(){return{x:this.#Pt.x*this.#yt.x,y:this.#Pt.y*this.#yt.y}}setImageSmoothing(e){this.#xt=e}setView(e,t){this.#bt=t,e.addEventListener("wlchange",this.#Et),e.addEventListener("colourmapchange",this.#qt),e.addEventListener("positionchange",this.#Ut),e.addEventListener("alphafuncchange",this.#Mt);for(let t=0;t<W.length;++t)e.addEventListener(W[t],this.#B);this.#ut=new Oi(e),this.bindImage()}getViewController(){return this.#ut}getImageData(){return this.#mt}onimageset=e=>{this.#bt===e.dataid&&(this.#ut.setImage(e.value[0]),this.#Qt(this.#ut.getImageSize().get2D()),this.#At=!0)};bindImage(){this.#ut&&this.#ut.bindImageAndLayer(this)}unbindImage(){this.#ut&&this.#ut.unbindImageAndLayer(this)}onimagecontentchange=e=>{this.#bt===e.dataid&&(this.#St=this.#ut.isPositionInBounds(),this.#At=!0,this.draw())};onimagegeometrychange=e=>{if(this.#bt===e.dataid){const e=this.#ut.getImageSize().get2D();if(this.#pt.x!==e.x||this.#pt.y!==e.y){if(void 0!==this.#Rt&&void 0!==this.#Ft){const e=this.#ut.getOrigin(),t=this.#Ft.minus(e),n=this.#ut.getOrigin(this.#ut.getCurrentPosition()),i=this.#Rt.minus(n);this.setBaseOffset(t,i)}this.#Qt(e),this.#At=!0,this.draw()}}};getId(){return this.#ct.id}removeFromDOM(){this.#ct.remove()}getBaseSize(){return this.#pt}getImageWorldSize(){return this.#ut.getImageWorldSize()}getOpacity(){return this.#Dt}setOpacity(e){if(e===this.#Dt)return;this.#Dt=Math.min(Math.max(e,0),1);const t={type:"opacitychange",value:[this.#Dt]};this.#B(t)}addFlipOffsetX(){this.#Ot.x+=this.#dt.width/this.#vt.x,this.#It.x+=this.#Ot.x}addFlipOffsetY(){this.#Ot.y+=this.#dt.height/this.#vt.y,this.#It.y+=this.#Ot.y}flipScaleX(){this.#Ct.x*=-1}flipScaleY(){this.#Ct.y*=-1}flipScaleZ(){this.#Ct.z*=-1}setScale(e,t){const n=this.#ut.getPlaneHelper(),i=n.getTargetOrientedPositiveXYZ({x:e.x*this.#Ct.x,y:e.y*this.#Ct.y,z:e.z*this.#Ct.z}),o={x:this.#yt.x*i.x,y:this.#yt.y*i.y};if(1===Math.abs(e.x)&&1===Math.abs(e.y)&&1===Math.abs(e.z)){const e={x:this.#It.x-this.#Pt.x,y:this.#It.y-this.#Pt.y};this.#Pt={x:0,y:0},this.#It=e}else if(void 0!==t){let e=n.getPlaneOffsetFromOffset3D({x:t.getX(),y:t.getY(),z:t.getZ()});e={x:e.x+this.#Tt.x,y:e.y+this.#Tt.y};const i=Sr(this.#It,this.#vt,o,e),r={x:this.#Pt.x+i.x-this.#It.x,y:this.#Pt.y+i.y-this.#It.y};this.#Pt=r,this.#It=i}this.#vt=o}initScale(e,t){const n=this.#ut.getPlaneHelper().getTargetOrientedPositiveXYZ({x:e.x*this.#Ct.x,y:e.y*this.#Ct.y,z:e.z*this.#Ct.z}),i={x:this.#yt.x*n.x,y:this.#yt.y*n.y};this.#vt=i,this.#Pt={x:t.x/this.#yt.x,y:t.y/this.#yt.y},this.#It={x:this.#It.x+this.#Pt.x,y:this.#It.y+this.#Pt.y}}setBaseOffset(e,t,n,i){const o=this.#ut.getPlaneHelper(),r=o.getNativeScrollDimIndex(),a=o.getPlaneOffsetFromOffset3D({x:0===r?e.getX():t.getX(),y:1===r?e.getY():t.getY(),z:2===r?e.getZ():t.getZ()}),s=this.#Tt.x!==a.x||this.#Tt.y!==a.y;return void 0!==n&&void 0!==i&&(this.#Rt=n,this.#Ft=i),s&&(this.#It={x:this.#It.x-this.#Tt.x+a.x,y:this.#It.y-this.#Tt.y+a.y},this.#Tt=a),s}setOffset(e){const t=this.#ut.getPlaneHelper().getPlaneOffsetFromOffset3D(e);this.#It={x:this.#It.x-this.#wt.x+t.x,y:this.#It.y-this.#wt.y+t.y},this.#wt=t}displayToPlaneIndex(e){const t=this.displayToPlanePos(e);return new o([Math.floor(t.getX()),Math.floor(t.getY())])}displayToPlaneScale(e){return new R(e.getX()/this.#vt.x,e.getY()/this.#vt.y)}displayToPlanePos(e){const t=this.displayToPlaneScale(e);return new R(t.getX()+this.#It.x,t.getY()+this.#It.y)}planePosToDisplay(e){let t=(e.getX()-this.#It.x+this.#Tt.x)*this.#vt.x,n=(e.getY()-this.#It.y+this.#Tt.y)*this.#vt.y;return(t<0||t>=this.#dt.width)&&(t=void 0),(n<0||n>=this.#dt.height)&&(n=void 0),new R(t,n)}displayToMainPlanePos(e){const t=this.displayToPlanePos(e);return new R(t.getX()-this.#Tt.x,t.getY()-this.#Tt.y)}display(e){this.#ct.style.display=e?"":"none"}isVisible(){return""===this.#ct.style.display}draw(){if(!this.#St)return;let e={type:"renderstart",layerid:this.getId(),dataid:this.getDataId()};this.#B(e),this.#At&&this.#Nt(),this.#gt.globalAlpha=this.#Dt,this.clear(),this.#gt.setTransform(this.#vt.x,0,0,this.#vt.y,-1*this.#It.x*this.#vt.x,-1*this.#It.y*this.#vt.y),this.#gt.imageSmoothingEnabled=this.#xt,this.#gt.drawImage(this.#ht,0,0),e={type:"renderend",layerid:this.getId(),dataid:this.getDataId()},this.#B(e)}initialise(e,t,n){this.#ft=t,this.#Dt=Math.min(Math.max(n,0),1),this.#dt=document.createElement("canvas"),this.#ct.appendChild(this.#dt),this.#dt.getContext?(this.#gt=this.#dt.getContext("2d"),this.#gt?(this.#ht=document.createElement("canvas"),this.#Qt(e),this.#At=!0):alert("Error: failed to get the 2D context.")):alert("Error: no canvas.getContext method.")}#Qt(e){if(!Fi(e.x,e.y))throw new Error("Cannot create canvas with size "+e.x+", "+e.y);this.#pt=e,this.#ht.width=this.#pt.x,this.#ht.height=this.#pt.y,this.#gt.clearRect(0,0,this.#pt.x,this.#pt.y),this.#mt=this.#gt.createImageData(this.#pt.x,this.#pt.y)}fitToContainer(e,t,n){let i=!1;const o={x:t*this.#ft.x,y:t*this.#ft.y},r=o.x/this.#yt.x,a=o.y/this.#yt.y,s=e.x/(this.#dt.width*r),l=e.y/(this.#dt.height*a);if(this.#dt.width!==e.x||this.#dt.height!==e.y){if(!Fi(e.x,e.y))throw new Error("Cannot resize canvas "+e.x+", "+e.y);this.#dt.width=e.x,this.#dt.height=e.y,i=!0}const c={x:this.#vt.x*r,y:this.#vt.y*a};this.#vt.x===c.x&&this.#vt.y===c.y||(this.#yt=o,this.#vt=c,i=!0);const u={x:n.x/o.x,y:n.y/o.y},d={x:e.x/o.x,y:e.y/o.y},h={x:0!==this.#Ot.x?d.x:0,y:0!==this.#Ot.y?d.y:0};if(this.#Lt.x!==u.x||this.#Lt.y!==u.y||this.#Ot.x!==h.x||this.#Ot.y!==h.y){const e={x:this.#Pt.x*s,y:this.#Pt.y*l};this.#It={x:this.#It.x+u.x-this.#Lt.x+h.x-this.#Ot.x+e.x-this.#Pt.x,y:this.#It.y+u.y-this.#Lt.y+h.y-this.#Ot.y+e.y-this.#Pt.y},this.#Ot=h,this.#Lt=u,this.#Pt=e,i=!0}i&&this.draw()}bindInteraction(){this.#ct.style.pointerEvents="auto";const e=Ai;for(let t=0;t<e.length;++t){const n=e[t],i="wheel"!==n;this.#ct.addEventListener(n,this.#B,{passive:i})}}unbindInteraction(){this.#ct.style.pointerEvents="none";const e=Ai;for(let t=0;t<e.length;++t)this.#ct.removeEventListener(e[t],this.#B)}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{e.srclayerid=this.getId(),e.dataid=this.#bt,this.#N.fireEvent(e)};#Nt(){this.#ut.generateImageData(this.#mt),this.#ht.getContext("2d").putImageData(this.#mt,0,0),this.#At=!1}#Et=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#At=!0,this.draw())};#qt=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#At=!0,this.draw())};#Ut=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.#ut.getScrollDimIndex());t.splice(n,1),0===e.diffDims.filter((function(e){return-1===t.indexOf(e)})).length&&this.#St||(this.#St=!0,this.#At=!0,this.draw())}else this.#St&&(this.#St=!1,this.clear())}};#Mt=e=>{void 0!==e.skipGenerate&&!0===e.skipGenerate||(this.#At=!0,this.draw())};setCurrentPosition(e,t){return this.#ut.setCurrentPosition(e)}clear(){this.#gt.save(),this.#gt.setTransform(1,0,0,1,0,0),this.#gt.clearRect(0,0,this.#dt.width,this.#dt.height),this.#gt.restore()}}class qi{#Vt;#ze={};#N=new H;#Bt;#Gt;constructor(e){this.#Vt=void 0!==e?e:[],this.#Bt=!0}getList(){return this.#Vt}getLength(){return this.#Vt.length}isEditable(){return this.#Bt}setEditable(e){this.#Bt=e,this.#B({type:"annotationgroupeditablechange",data:e})}getColour(){return this.#Gt}setColour(e){this.#Gt=e}add(e){this.#Vt.push(e),this.#B({type:"annotationadd",data:e})}update(e,t,n){const i=this.#Vt.findIndex((t=>t.trackingUid===e.trackingUid));-1!==i?((t.includes("mathShape")||t.includes("textExpr"))&&e.updateQuantification(),this.#Vt[i]=e,this.#B({type:"annotationupdate",data:e,keys:t,propagate:n})):h.warn("Cannot find annotation to update")}remove(e){const t=this.#Vt.findIndex((t=>t.trackingUid===e));if(-1!==t){const e=this.#Vt.splice(t,1)[0];this.#B({type:"annotationremove",data:e})}else h.warn("Cannot find annotation to remove")}setViewController(e){for(const t of this.#Vt)t.setViewController(e),t.updateQuantification()}find(e){return this.#Vt.find((t=>t.trackingUid===e))}getMeta(){return this.#ze}hasMeta(e){return void 0!==this.#ze[e]}getMetaValue(e){return this.#ze[e]}setMetaValue(e,t){this.#ze[e]=t}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)}}const Ui=(Mi={default:()=>e.default},Qi={},i.d(Qi,Mi),Qi);var Mi,Qi;class Ni{#kt;#Ht;constructor(e,t){this.#kt=e,this.#Ht=t}getName(){return"AddAnnotation-"+this.#kt.trackingUid}execute(){this.#Ht.addAnnotation(this.#kt)}undo(){this.#Ht.removeAnnotation(this.#kt.trackingUid)}}class Vi{#kt;#Ht;constructor(e,t){this.#kt=e,this.#Ht=t}getName(){return"RemoveAnnotation-"+this.#kt.trackingUid}execute(){this.#Ht.removeAnnotation(this.#kt.trackingUid)}undo(){this.#Ht.addAnnotation(this.#kt)}}class Bi{#kt;#Ht;#zt;#Wt;constructor(e,t,n,i){this.#kt=e,this.#Ht=i,this.#zt=t,this.#Wt=n}getName(){return"UpdateAnnotation-"+this.#kt.trackingUid}execute(){const e=Object.keys(this.#Wt);for(const t of e)this.#kt[t]=this.#Wt[t];this.#Ht.updateAnnotation(this.#kt,e)}undo(){const e=Object.keys(this.#zt);for(const t of e)this.#kt[t]=this.#zt[t];this.#Ht.updateAnnotation(this.#kt,e)}}class Gi{#Yt;getAnnotation(e){return this.#Yt.find(e)}getAnnotationGroup(){return this.#Yt}isAnnotationGroupEditable(){return this.#Yt.isEditable()}setAnnotationGroupEditable(e){this.#Yt.setEditable(e)}addAnnotation(e){this.#Yt.add(e)}updateAnnotation(e,t,n){this.#Yt.update(e,t,n)}removeAnnotation(e){this.#Yt.remove(e)}removeAnnotationWithCommand(e,t){const n=this.getAnnotation(e);if(void 0===n)return void h.warn("Cannot create remove command for undefined annotation: "+e);const i=new Vi(n,this);t(i),i.execute()}updateAnnotationWithCommand(e,t,n,i){const o=this.getAnnotation(e);if(void 0===o)return void h.warn("Cannot create update command for undefined annotation: "+e);const r=new Bi(o,t,n,this);i(r),r.execute()}removeAllAnnotationsWithCommand(e){for(const t of this.#Yt.getList())this.removeAnnotationWithCommand(t.trackingUid,e)}constructor(e){this.#Yt=void 0!==e?e:new qi}hasAnnotationMeta(e){return this.#Yt.hasMeta(e)}setAnnotationMeta(e,t){this.#Yt.setMetaValue(e,t)}}const ki={arrow:{"*":""},circle:{"*":"{surface}"},ellipse:{"*":"{surface}"},protractor:{"*":"{angle}"},rectangle:{"*":"{surface}"},roi:{"*":""},ruler:{"*":"{length}"}};function Hi(e){return"label"===e.name()}function zi(e){return"shape"===e.name()}function Wi(e){return"position-group"===e.name()}function Yi(e){const t=e.getChildren(zi)[0];if(t instanceof Ui.default.Line)return t}function Xi(e,t){const n=e.getChildren((function(e){return e.id()==="anchor"+t}))[0];if(n instanceof Ui.default.Ellipse)return n}function ji(e){return function(t){return t.id()===e}}function Zi(e,t,n,i){const o=i.applyZoomScale(6),r={x:Math.abs(o.x),y:Math.abs(o.y)};return new Ui.default.Ellipse({x:e,y:t,stroke:"#999",fill:"rgba(100,100,100,0.7",strokeWidth:i.getStrokeWidth(),strokeScaleEnabled:!1,radius:r,radiusX:r.x,radiusY:r.y,name:"anchor",id:n.toString(),dragOnTop:!1,draggable:!0,visible:!1})}function _i(e){return parseInt(e.substring(6),10)}class Ki{#Xt=10;#jt="Verdana";#Zt="#fff";#_t="#ffff80";#Kt={x:1,y:1};#Jt={x:1,y:1};#$t=2;#en={x:.25,y:.25};#tn=.2;#nn=3;getFontFamily(){return this.#jt}getFontSize(){return this.#Xt}getStrokeWidth(){return this.#$t}getTextColour(){return this.#Zt}getLineColour(){return this.#_t}setLineColour(e){this.#_t=e}setBaseScale(e){this.#Kt=e}setZoomScale(e){this.#Jt=e}getBaseScale(){return this.#Kt}getZoomScale(){return this.#Jt}scale(e){return e/this.#Kt.x}applyZoomScale(e){return{x:e/this.#Jt.x,y:e/this.#Jt.y}}applyZoomRatio(e){return e*this.#Jt.x/this.#Jt.y}getShadowOffset(){return this.#en}getTagOpacity(){return this.#tn}getTextPadding(){return this.#nn}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 function(e){return.001172549*(t=C(e)).r+.002301961*t.g+447059e-9*t.b<.5;var t}(this.getLineColour())?"#fff":"#000"}}class Ji{#in;#on;constructor(e,t){this.#in=e,this.#on=t}getBegin(){return this.#in}getEnd(){return this.#on}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 R((this.getBegin().getX()+this.getEnd().getX())/2,(this.getBegin().getY()+this.getEnd().getY())/2)}getCentroid(){return this.getMidpoint()}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:e.getLengthUnit()}),t}}function $i(e,t){const n=e.getDeltaX(),i=e.getDeltaY(),o=t.getDeltaX(),r=t.getDeltaY(),a=n*o+i*r,s=n*r-i*o;return 360-(180-180*Math.atan2(s,a)/Math.PI)}function eo(e,t){const n=e.getDeltaX(),i=e.getDeltaY();return n*t.getDeltaX()+i*t.getDeltaY()==0}function to(e,t,n,i){void 0===i&&(i={x:1,y:1});const o=-i.x*i.x/(i.y*i.y*e.getSlope());return io(o,t.getY()-o*t.getX(),t,n,i)}function no(e,t,n,i){const o=io(e.getSlope(),e.getIntercept(),e.getBegin(),t,i);let r;return r=function(e,t){const n=Math.min(t.getBegin().getX(),t.getEnd().getX()),i=Math.max(t.getBegin().getX(),t.getEnd().getX()),o=Math.min(t.getBegin().getY(),t.getEnd().getY()),r=Math.max(t.getBegin().getY(),t.getEnd().getY());return e.getX()>=n&&e.getX()<=i&&e.getY()>=o&&e.getY()<=r}(o.getBegin(),e)?o.getBegin():o.getEnd(),to(e,r,n,i)}function io(e,t,n,i,o){void 0===o&&(o={x:1,y:1});let r=0,a=0,s=0,l=0;if(U(e,0,q))r=n.getX()-i/(2*o.x),a=n.getY(),s=n.getX()+i/(2*o.x),l=n.getY();else if(Math.abs(e)>1e6)r=n.getX(),a=n.getY()-i/(2*o.y),s=n.getX(),l=n.getY()+i/(2*o.y);else{const c=o.x*o.x,u=o.y*o.y,d=i/(2*Math.sqrt(c+u*e*e));r=n.getX()-d,a=e*r+t,s=n.getX()+d,l=e*s+t}return new Ji(new R(r,a),new R(s,l))}class oo{#in;#on;constructor(e,t){this.#in=new R(Math.min(e.getX(),t.getX()),Math.min(e.getY(),t.getY())),this.#on=new R(Math.max(e.getX(),t.getX()),Math.max(e.getY(),t.getY()))}getBegin(){return this.#in}getEnd(){return this.#on}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 R(Math.round(this.getBegin().getX()),Math.round(this.getBegin().getY())),max:new R(Math.round(this.getEnd().getX()),Math.round(this.getEnd().getY()))}}getCentroid(){return new R(this.getBegin().getX()+this.getWidth()/2,this.getBegin().getY()+this.getHeight()/2)}quantify(e,t,n){const i={},o=e.get2DSpacing(),r=e.getLengthUnit();i.width={value:this.getWidth()*o.x,unit:r},i.height={value:this.getHeight()*o.y,unit:r};const a=this.getWorldSurface(o);if(null!==a&&(i.surface="unit.mm"===r?{value:a/100,unit:"unit.cm2"}:{value:a,unit:r}),e.canQuantifyImage()){const o=this.getRound(),r=e.getImageRegionValues(o.min,o.max,t),a=e.getPixelUnit(),s=mt(r,n);i.min={value:s.min,unit:a},i.max={value:s.max,unit:a},i.mean={value:s.mean,unit:a},i.stdDev={value:s.stdDev,unit:a},void 0!==s.median&&(i.median={value:s.median,unit:a}),void 0!==s.p25&&(i.p25={value:s.p25,unit:a}),void 0!==s.p75&&(i.p75={value:s.p75,unit:a})}return i}}function ro(e,t,n){const i=e.getValues(),r=i.slice(),a=[],s=t[0],l=Math.floor(s/2),c=t[1],u=Math.floor(c/2),d=n[0],h=n[1];for(let e=0;e<c;++e){r[h]=i[h]-u+e;for(let e=0;e<s;++e)r[d]=i[d]-l+e,a.push(new o(r.slice()))}return a}class ao{#rn=[];constructor(e){void 0!==e&&(this.#rn=e)}getPoint(e){return this.#rn[e]}getPoints(){return this.#rn}getLength(){return this.#rn.length}addPoint(e){this.#rn.push(e)}addPoints(e){this.#rn=this.#rn.concat(e)}getCentroid(){let e,t=0,n=0,i=0;for(let e=0;e<this.#rn.length;++e){const o=this.#rn[e];let r;r=e===this.#rn.length-1?this.#rn[0]:this.#rn[e+1];const a=o.getX()*r.getY()-r.getX()*o.getY();t+=a,n+=(o.getX()+r.getX())*a,i+=(o.getY()+r.getY())*a}if(0!==t){const o=1/(3*t);e=new R(o*n,o*i)}return e}}class so{#rn;constructor(e){if(e.length>3)throw new Error("Too many points for a protractor");this.#rn=e.slice(0,3)}getPoint(e){return this.#rn[e]}getLength(){return this.#rn.length}getCentroid(){return this.#rn[1]}quantify(e,t){const n={};if(3===this.#rn.length){let e=$i(new Ji(this.#rn[0],this.#rn[1]),new Ji(this.#rn[1],this.#rn[2]));e>180&&(e=360-e),n.angle={value:e,unit:"unit.degree"}}return n}}class lo{#an;#sn;#ln;constructor(e,t,n){this.#an=e,this.#sn=t,this.#ln=n}getCenter(){return this.#an}getCentroid(){return this.#an}getA(){return this.#sn}getB(){return this.#ln}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(),o=n/i,r=Math.pow(i,2),a=t+i,s=[];for(let n=t-i;n<a;++n){const i=r-Math.pow(n-t,2);if(Math.abs(i)<1e-7)continue;const a=o*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,n){const i={},o=e.get2DSpacing(),r=e.getLengthUnit();i.a={value:this.getA()*o.x,unit:r},i.b={value:this.getB()*o.y,unit:r};const a=this.getWorldSurface(o);if(null!==a&&(i.surface="unit.mm"===r?{value:a/100,unit:"unit.cm2"}:{value:a,unit:r}),e.canQuantifyImage()){const o=this.getRound();if(0!==o.length){const r=e.getImageVariableRegionValues(o,t),a=e.getPixelUnit(),s=mt(r,n);i.min={value:s.min,unit:a},i.max={value:s.max,unit:a},i.mean={value:s.mean,unit:a},i.stdDev={value:s.stdDev,unit:a},void 0!==s.median&&(i.median={value:s.median,unit:a}),void 0!==s.p25&&(i.p25={value:s.p25,unit:a}),void 0!==s.p75&&(i.p75={value:s.p75,unit:a})}}return i}}function co(e,t,n){const i=e.getValues(),r=i.slice(),a=[],s=t[0],l=t[1],c=s/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,s=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,a.push(new o(r.slice())),s!==n&&(r[h]=s,a.push(new o(r.slice()))),l!==t&&(r[d]=l,r[h]=n,a.push(new o(r.slice())),s!==n&&(r[h]=s,a.push(new o(r.slice()))))}}return a}class uo{#an;#cn;constructor(e,t){this.#an=e,this.#cn=t}getCenter(){return this.#an}getCentroid(){return this.#an}getRadius(){return this.#cn}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),o=t+n,r=[];for(let a=t-n;a<o;++a){const n=i-Math.pow(a-t,2);if(Math.abs(n)<1e-7)continue;const o=Math.sqrt(n);o<.5||r.push([[Math.round(e-o),Math.round(a)],[Math.round(e+o),Math.round(a)]])}return r}quantify(e,t,n){const i={},o=e.get2DSpacing(),r=e.getLengthUnit();i.radius={value:this.getRadius()*o.x,unit:r};const a=this.getWorldSurface(o);if(null!==a&&(i.surface="unit.mm"===r?{value:a/100,unit:"unit.cm2"}:{value:a,unit:r}),e.canQuantifyImage()){const o=this.getRound();if(0!==o.length){const r=e.getImageVariableRegionValues(o,t),a=e.getPixelUnit(),s=mt(r,n);i.min={value:s.min,unit:a},i.max={value:s.max,unit:a},i.mean={value:s.mean,unit:a},i.stdDev={value:s.stdDev,unit:a},void 0!==s.median&&(i.median={value:s.median,unit:a}),void 0!==s.p25&&(i.p25={value:s.p25,unit:a}),void 0!==s.p75&&(i.p75={value:s.p75,unit:a})}}return i}}class ho{#un=0;getSum(){return this.#un}add(e){this.#un+=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.#un=0}isTick(){return Math.abs(this.#un)>=1}}class go{#dn;#hn=new ho;constructor(e){this.#dn=e}wheel(e){this.#hn.add(e);const t=this.#hn.getSum()>=0;if(!this.#hn.isTick())return;this.#hn.clear(),e.preventDefault();const n=gr(e),i=this.#dn.getLayerGroupByDivId(n.groupDivId),o=i.getPositionHelper();i.canScroll()?t?o.incrementPositionAlongScroll():o.decrementPositionAlongScroll():i.moreThanOne(3)&&(t?o.incrementPosition(3):o.decrementPosition(3))}}class So{#dn;#gn;constructor(e,t){this.#dn=e,this.#gn=t}#Sn=null;#mn=null;#pn;#kt;#fn=!1;setShape(e,t,n){if(this.#mn=e,this.#pn=t,this.#kt=n,this.#mn){if(this.#Dn(),this.#Sn=n.getFactory(),void 0===this.#Sn)throw new Error("Could not find a factory to update shape.");this.#vn()}}getShape(){return this.#mn}getAnnotation(){return this.#kt}isActive(){return this.#fn}enable(){this.#fn=!0,this.#mn&&(this.#yn(!0),this.#mn.getLayer()&&this.#mn.getLayer().draw())}disable(){this.#fn=!1,this.#mn&&(this.#yn(!1),this.#mn.getLayer()&&this.#mn.getLayer().draw())}reset(){this.#mn=void 0,this.#pn=void 0,this.#kt=void 0}resetAnchors(){this.#Dn(),this.#vn(),this.#yn(!0)}#Cn(e){this.#mn&&this.#mn.getParent()&&this.#mn.getParent().find(".anchor").forEach(e)}#yn(e){this.#Cn((function(t){t.visible(e)}))}setAnchorsActive(e){let t=null;t=e?e=>{this.#In(e)}:e=>{this.#Tn(e)},this.#Cn(t)}#Dn(){this.#Cn((function(e){e.remove()}))}#vn(){if(!this.#mn||!this.#mn.getLayer())return;const e=this.#mn.getParent(),t=this.#Sn.getAnchors(this.#mn,this.#dn.getStyle());for(let n=0;n<t.length;++n)this.#In(t[n]),e.add(t[n])}#In(e){let t;e.on("dragstart.edit",(e=>{e.cancelBubble=!0,t={mathShape:this.#kt.mathShape,referencePoints:this.#kt.referencePoints}})),e.on("dragmove.edit",(e=>{const t=e.target;t instanceof Ui.default.Shape&&(function(e,t){const n=t.getParent();!function(e,t,n){let i=!1;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)}(t,new R(-n.x(),-n.y()),new R(e.x-n.x(),e.y-n.y()))}(this.#pn.getBaseSize(),t),void 0!==this.#Sn.constrainAnchorMove&&this.#Sn.constrainAnchorMove(t),this.#Sn.updateAnnotationOnAnchorMove(this.#kt,t),this.#Sn.updateShapeGroupOnAnchorMove(this.#kt,t,this.#dn.getStyle()),t.getLayer()?t.getLayer().draw():h.warn("No layer to draw the anchor!"),e.cancelBubble=!0)})),e.on("dragend.edit",(e=>{const n={mathShape:this.#kt.mathShape,referencePoints:this.#kt.referencePoints},i=new Bi(this.#kt,t,n,this.#pn.getDrawController());this.#dn.addToUndoStack(i),this.#gn({type:"annotationupdate",data:this.#kt,dataid:this.#pn.getDataId(),keys:Object.keys(n)}),t={mathShape:n.mathShape,referencePoints:n.referencePoints},e.cancelBubble=!0})),e.on("mousedown touchstart",(e=>{e.target.moveToTop()})),e.on("mouseover.edit",(e=>{const t=e.target;t instanceof Ui.default.Shape&&(t.stroke("#ddd"),t.getLayer()?t.getLayer().draw():h.warn("No layer to draw the anchor!"))})),e.on("mouseout.edit",(e=>{const t=e.target;t instanceof Ui.default.Shape&&(t.stroke("#999"),t.getLayer()?t.getLayer().draw():h.warn("No layer to draw the anchor!"))}))}#Tn(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 mo{#Ln;constructor(){this.createTrashIcon()}createTrashIcon(){this.#Ln=new Ui.default.Group;const e=new Ui.default.Line({points:[-10,-10,10,10],stroke:"red"}),t=new Ui.default.Line({points:[10,-10,-10,10],stroke:"red"});this.#Ln.width(20),this.#Ln.height(20),this.#Ln.add(e),this.#Ln.add(t)}activate(e){const t=e.getKonvaStage(),n=t.scale(),i=e.getKonvaLayer(),o={x:1/n.x,y:1/n.y};this.#Ln.x(t.offset().x+t.width()/(2*n.x)),this.#Ln.y(t.offset().y+t.height()/(15*n.y)),this.#Ln.scale(o),i.add(this.#Ln),i.draw()}changeChildrenColourOnTrashHover(e,t,n){if(this.isOverTrash(e))return this.changeGroupChildrenColour(this.#Ln,"orange"),void this.changeGroupChildrenColour(t,"red");this.changeGroupChildrenColour(this.#Ln,"red"),this.changeGroupChildrenColour(t,n)}changeGroupChildrenColour(e,t){e.getChildren().forEach((function(e){e instanceof Ui.default.Shape&&void 0!==e.stroke&&e.stroke(t)}))}remove(){this.#Ln.remove()}isOverTrash(e){const t=this.#Ln.width()*Math.abs(this.#Ln.scaleX())/2,n=this.#Ln.height()*Math.abs(this.#Ln.scaleY())/2;return Math.abs(e.x-this.#Ln.x())<t&&Math.abs(e.y-this.#Ln.y())<n}}class po{#dn;#Pn;#Ln;#wn="pointer";#On;#An;#gn;constructor(e,t){this.#dn=e,this.#gn=t,this.#Pn=new So(e,t),this.#Ln=new mo}setEditorShape(e,t){const n=t.getDrawController();e&&e instanceof Ui.default.Shape&&e!==this.#Pn.getShape()&&n.isAnnotationGroupEditable()&&(this.#Pn.disable(),this.#Pn.setShape(e,t,t.getDrawController().getAnnotation(e.getParent().id())),this.#Pn.enable())}getEditorShapeGroup(){let e;if(!this.#Pn.isActive()||(e=this.#Pn.getShape().getParent(),e instanceof Ui.default.Group))return e}getEditorAnnotation(){let e;return this.#Pn.isActive()&&(e=this.#Pn.getAnnotation()),e}disableAndResetEditor(){this.#Pn.disable(),this.#Pn.reset()}#bn(e,t){const n=t.getKonvaStage();return{x:n.offset().x+e.x/n.scale().x,y:n.offset().y+e.y/n.scale().y}}storeMouseOverCursor(e){this.#wn=e}#xn(){this.#On=document.body.style.cursor,document.body.style.cursor=this.#wn,this.#An.opacity(.75)}onMouseOutShapeGroup(){void 0!==this.#On&&(document.body.style.cursor=this.#On,this.#On=void 0),void 0!==this.#An&&this.#An.opacity(1)}#Rn(e){e.on("mouseover",(()=>{this.#An=e,this.#xn()})),e.on("mouseout",(()=>{this.onMouseOutShapeGroup(),this.#An=void 0}))}#Fn(e){e.off("mouseover"),e.off("mouseout")}addShapeGroupListeners(e,t,n){this.#Rn(e),this.#En(e,t,n),this.#qn(e,t,n),e.on("dblclick",(()=>{const e=t.textExpr,i=t=>{const i=t.textExpr,o=new Bi(t,{textExpr:e},{textExpr:i},n.getDrawController());this.#dn.addToUndoStack(o),o.execute()};void 0!==O.openRoiDialog?O.openRoiDialog(t,i):function(e,t){const n=prompt("Label",e.textExpr);null!==n&&(e.textExpr=n,t(e))}(t,i)}))}#En(e,t,n){const i=n.getKonvaLayer(),o=e.getChildren(zi)[0];if(!(o instanceof Ui.default.Shape))return;let r,a,s,l;o.draggable(!0),o.on("dragstart.draw",(e=>{l=o.stroke(),r={x:o.x(),y:o.y()},a={x:e.target.x(),y:e.target.y()},s={mathShape:t.mathShape,referencePoints:t.referencePoints},this.#Ln.activate(n),this.#Pn.setAnchorsActive(!1),i.draw()})),o.on("dragmove.draw",(r=>{const s=function(e,t){return{min:new R(0,0),max:new R(e.x-Math.abs(t.width()),e.y-Math.abs(t.height()))}}(n.getBaseSize(),o);if(s&&!function(e,t,n){const i=e.getClientRect({relativeTo:e.getParent()});return i.x>t.getX()&&i.x<n.getX()&&i.y>t.getY()&&i.y<n.getY()}(o,s.min,s.max))return o.x(a.x),void o.y(a.y);const c={x:r.target.x()-a.x,y:r.target.y()-a.y},u=e.getChildren(),d=void 0===t.labelPosition;for(const e of u)e===r.target||"label"===e.name()&&!d||"connector"===e.name()||e.move(c);a={x:r.target.x(),y:r.target.y()};const h=t.getFactory();if(void 0===h)throw new Error("Cannot follow drag move without factory");h.updateAnnotationOnTranslation(t,c),h.updateLabelContent(t,e,this.#dn.getStyle()),h.updateConnector(e);const g=Ri(r.evt),S={x:g.getX(),y:g.getY()},m=this.#bn(S,n);this.#Ln.changeChildrenColourOnTrashHover(m,e,l),i.draw()})),o.on("dragend.draw",(a=>{if(this.#Ln.remove(),void 0===a||void 0===a.evt)return;const c=o.x(),u=o.y(),d=Ri(a.evt),h={x:d.getX(),y:d.getY()},g=this.#bn(h,n);if(this.#Ln.isOverTrash(g)){e.x(r.x),e.y(r.y),this.#Pn.disable(),this.#Pn.reset(),this.#Ln.changeGroupChildrenColour(e,l),t.mathShape=s.mathShape,t.referencePoints=s.referencePoints;const i=new Vi(t,n.getDrawController());this.#dn.addToUndoStack(i),i.execute(),this.onMouseOutShapeGroup()}else{const e={x:c-r.x,y:u-r.y};if(0!==e.x||0!==e.y){const e={mathShape:t.mathShape,referencePoints:t.referencePoints},i=new Bi(t,s,e,n.getDrawController());this.#dn.addToUndoStack(i),this.#gn({type:"annotationupdate",data:t,dataid:n.getDataId(),keys:Object.keys(e)}),s={mathShape:e.mathShape,referencePoints:e.referencePoints}}this.#Pn.setAnchorsActive(!0),this.#Pn.resetAnchors()}i.draw(),r={x:o.x(),y:o.y()}}))}#qn(e,t,n){const i=e.getChildren(Hi)[0];if(!(i instanceof Ui.default.Label))return;let o,r;i.draggable(!0),i.on("dragstart.draw",(()=>{o={x:i.x(),y:i.y()},r=t.labelPosition})),i.on("dragmove.draw",(()=>{const n=t.getFactory();if(void 0===n)throw new Error("Cannot udpate connector without factory");n.updateConnector(e)})),i.on("dragend.draw",(()=>{const e=i.x()-o.x,a=i.y()-o.y;if(0!==e||0!==a){const e=new R(i.x(),i.y());t.labelPosition=e;const o=new Bi(t,{labelPosition:r},{labelPosition:e},n.getDrawController());this.#dn.addToUndoStack(o),this.#gn({type:"annotationupdate",data:t,dataid:n.getDataId(),keys:["labelPosition"]}),r=e}o={x:i.x(),y:i.y()}}))}removeShapeListeners(e){this.#Fn(e),e.off("dblclick");const t=e.getChildren(zi)[0];t instanceof Ui.default.Shape&&(t.draggable(!1),t.off("dragstart.draw"),t.off("dragmove.draw"),t.off("dragend.draw"));const n=e.getChildren(Hi)[0];n instanceof Ui.default.Label&&(n.draggable(!1),n.off("dragstart.draw"),n.off("dragend.draw"))}}class fo{meta;image;annotationGroup;buffer;constructor(e){this.meta=e}}class Do{#Un={};#Mn=-1;#N=new H;getNextDataId(){return++this.#Mn,this.#Mn.toString()}getDataIds(){return Object.keys(this.#Un)}reset(){this.#Un={}}get(e){return this.#Un[e]}getDataIdsFromSopUids(e){const t=[];if(void 0===e||0===e.length)return t;const n=Object.keys(this.#Un);for(const i of n)void 0!==this.#Un[i].image&&this.#Un[i].image.containsImageUids(e)&&t.push(i);return t}getDataIdFromSeriesUid(e){let t;const n=Object.keys(this.#Un);for(const i of n){const n=this.#Un[i].image;if(void 0!==n&&e===n.getMeta().SeriesInstanceUID){t=i;break}}return t}setImage(e,t){this.#Un[e].image=t,this.#B({type:"dataimageset",value:[t],dataid:e}),t.addEventListener("imagecontentchange",this.#Qn(e)),t.addEventListener("imagegeometrychange",this.#Qn(e))}add(e,t){if(void 0!==this.#Un[e])throw new Error("Data id already used in storage: "+e);let n;if(this.#Un[e]=t,void 0!==t.meta["00080060"]&&(n=t.meta["00080060"].value[0]),"SEG"===n&&void 0===t.image){let e;const n=t.meta["00081115"];if(void 0!==n&&(e=n.value[0]["0020000E"].value[0]),void 0===e)throw new Error("Cannot create mask image: the DICOM seg does not have a referenced series UID");const i=this.getDataIdFromSeriesUid(e);if(void 0===i)throw new Error("Cannot create mask image: the DICOM seg referenced series is not loaded");const o=new mi;t.image=o.create(t.meta,t.buffer,this.#Un[i].image)}this.#B({type:"dataadd",dataid:e}),void 0!==t.image&&(t.image.addEventListener("imagecontentchange",this.#Qn(e)),t.image.addEventListener("imagegeometrychange",this.#Qn(e))),void 0!==t.annotationGroup&&(t.annotationGroup.addEventListener("annotationadd",this.#Qn(e)),t.annotationGroup.addEventListener("annotationupdate",this.#Qn(e)),t.annotationGroup.addEventListener("annotationremove",this.#Qn(e)))}remove(e){if(void 0!==this.#Un[e]){const t=this.#Un[e].image;void 0!==t&&(t.removeEventListener("imagecontentchange",this.#Qn(e)),t.removeEventListener("imagegeometrychange",this.#Qn(e)));const n=this.#Un[e].annotationGroup;void 0!==n&&(n.removeEventListener("annotationadd",this.#Qn(e)),n.removeEventListener("annotationupdate",this.#Qn(e)),n.removeEventListener("annotationremove",this.#Qn(e))),delete this.#Un[e],this.#B({type:"dataremove",dataid:e})}}update(e,t){if(void 0===this.#Un[e])throw new Error("Cannot find data to update: "+e);const n=this.#Un[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 o={};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 r=!1;if(Object.prototype.hasOwnProperty.call(e[n],"merged")&&e[n].merged&&(r=!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(o[n]=e[n],r){for(let e=0;e<a.length;++e)if(a[e]===s)throw new Error("The first object already contains id2: "+s+", id1: "+a);o[n][i].push(s)}else{if(a=a[0],a===s)throw new Error("Cannot merge object with same ids: "+a+", id2: "+s);o[n][i].push(s),o[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),!ge(l,d))if(r){if(Array.isArray(l)){h[i]={};for(let e=0;e<a.length;++e)h[i][a[e]]=l}else h[i]=l;void 0===h[i]&&(h[i]={}),h[i][s]=d}else{const e={};e[a]=l,e[s]=d,h[i]=e}o[c]=h}}return o}(n.meta,t.meta,i,"value"),this.#B({type:"dataupdate",dataid:e})}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)};#Qn(e){return t=>{t.dataid=e,this.#B(t)}}}const vo="No source image to create mask",yo="No source image to get offsets, ID: {0}",Co="No brush origins",Io="No mask defined when adding mask slices",To="No created mask image",Lo="No mask image for temporary draw command, ID: {0}",Po="No mask image to get offsets from",wo="No mask image for draw command, ID: {0}",Oo="No mask ID to apply mask index",Ao="No mask view layers",bo="No selected segment number",xo="Too many mask view layers: {0}",Ro="More mask layers than expected",Fo="Cannot display mask with no mask ID",Eo="Cannot draw with no mask data ID",qo="Cannot draw with no offsets",Uo="Cannot draw with no colour list",Mo="Cannot get mask layers with no mask ID",Qo="Cannot get mask view controller: no mask ID",No="Cannot get mask view controller: no mask layers",Vo="Cannot find source data for an existing mask, ID: {0}",Bo="Unsupported scroll index: {0}";function Go(e,...t){return e.replace(/{(\d+)}/g,((e,n)=>t[n]||""))}const ko="del",Ho="add";function zo(e,t,n,i){return co(e.worldToIndex(t),n,i)}class Wo{mask;dataId;offsetsLists;mode;segmentNumber;srclayerid;originalValuesLists;isSilent}class Yo{#Nn;#bt;#Vn;#Bn;#Gn;#kn;#Hn;#zn;#Wn;#Yn;constructor(e){this.#Nn=e.mask,this.#bt=e.dataId,this.#Vn=e.offsetsLists,this.#Bn=e.mode,this.#Gn=e.segmentNumber,this.#kn=e.srclayerid,void 0!==e.originalValuesLists&&(this.#Hn=e.originalValuesLists),this.#zn=e.isSilent??!1,this.#Wn=this.#Bn===ko?"brushremove":"brushdraw",this.#Yn="brushdraw"===this.#Wn?"brushremove":"brushdraw"}getOriginalValuesLists(){return this.#Hn}getExecuteEvent(){const e="brushdraw"===this.#Wn?this.#Gn:void 0;return new CustomEvent(this.#Wn,{detail:{segmentnumber:e,dataid:this.#bt,srclayerid:this.#kn}})}getName(){return"Draw-brush"}execute(){if(void 0===this.#Gn)return;let e=this.#Gn;"brushremove"===this.#Wn&&(e=0),void 0===this.#Hn?this.#Hn=this.#Nn.setAtOffsetsAndGetOriginals(this.#Vn,e):this.#Nn.setAtOffsetsWithIterator(this.#Vn,e),this.#zn||this.onExecute(this.getExecuteEvent())}undo(){void 0===this.#Hn?this.#Hn=this.#Nn.setAtOffsetsAndGetOriginals(this.#Vn,0):this.#Nn.setAtOffsetsWithIterator(this.#Vn,this.#Hn);const e="brushdraw"===this.#Yn?this.#Gn:void 0,t=new CustomEvent(this.#Yn,{detail:{segmentnumber:e,dataid:this.#bt,srclayerid:this.#kn}});this.onUndo(t)}onExecute(e){}onUndo(e){}}class Xo extends EventTarget{#dn;#Xn;constructor(e){super(),this.#dn=e,this.#Xn=new go(e)}#jn=!1;#Nn;#Zn;#_n=10;#Kn={min:1,max:20};#Jn=ko;#$n;#ei=0;#ti;#ni;#ii;#oi;#ri=[];#ai(e,t,n){const i=e.getSize().getValues();i[2]=1;const o=new ce(i),r=new vt([t],o,e.getSpacing(),e.getOrientation()),a=new Uint8Array(o.getDimSize(2));a.fill(0),++this.#ei;const s=[this.#ei.toString()],l=new Ti(r,a,s);return l.setMeta(n),l.setPhotometricInterpretation("PALETTE COLOR"),l.setPaletteColourMap(new u([0],[0],[0])),l}#si(e,t,n,i,r,a){const s=function(e,t){const n=t.sort((function(e,t){let n=0;const i=e.get(2),o=t.get(2);return void 0!==i&&void 0!==o&&(n=i-o),n}));const i=n[0].get(2);if(void 0===i)return[];const r=new o([0,0,i]),a=e.indexToWorld(r),s=n.at(-1).get(2);if(void 0===s)return[];const l=new o([0,0,s]),c=e.indexToWorld(l),u=e.getOrigins(),d=.1*e.getSpacing().get(2),g=a.get3D().getClosest(u),S=u[g],m=a.get3D().getDistance(S);m>d&&h.warn("Large distance between origin and origin for first index: "+m);const p=c.get3D().getClosest(u),f=u[p],D=c.get3D().getDistance(f);return D>d&&h.warn("Large distance between origin and origin for last index: "+D),[g,p]}(e,zo(e,n,r,i));if(void 0===s||0===s.length)throw new Error(Co);const l=e.getOrigins(),c=t.getOrigins(),u=c[0].getClosest(l),d=c.at(-1).getClosest(l),g=[];if(s[0]<u)for(let e=u-1;e>=s[0];--e)g.push(e);if(s[1]>d)for(let e=d+1;e<=s[1];++e)g.push(e);const S=[];for(const e of g)S.push(l[e]);if(void 0===this.#Nn)throw new Error(Io);const m=this.#Nn.getMeta();for(const e of S)m.numberOfFiles+=1,this.#Nn.appendSlice(this.#ai(t,e,a))}#li(e){const t=this.#ci().getId();if(void 0===this.#Zn)throw new Error(Oo);const n=this.#dn.getData(this.#Zn);if(!n)throw new Error(Go(Lo,this.#Zn));const i=new Wo;i.mask=n.image,i.dataId=this.#Zn,i.offsetsLists=[e],i.mode=this.#Jn,i.segmentNumber=this.#$n,i.srclayerid=t;const o=new Yo(i);o.execute(),this.#ii.push(e);const r=o.getOriginalValuesLists();void 0!==r&&this.#oi.push(r[0])}#ui(e,t){if(!t)throw new Error(Go(vo));const n=t.getGeometry(),i=n.worldToIndex(e).get(2);if(void 0===i)throw new Error("Z position is undefined");const r=new o([0,0,i]),a=Si(),s=function(){const e="1.2.826.0.1.3680043.9.7278.1681051091011101.1";return{indices:{value:[{DimensionOrganizationUID:e,DimensionDescriptionLabel:"ReferencedSegmentNumber",DimensionIndexPointer:"(0062,000B)",FunctionalGroupPointer:"(0062,000A)"},{DimensionOrganizationUID:e,DimensionDescriptionLabel:"ImagePositionPatient",DimensionIndexPointer:"(0020,0032)",FunctionalGroupPointer:"(0020,9113)"}]},organizations:{value:[{DimensionOrganizationUID:e}]}}}();a.DimensionOrganizationSequence=s.organizations,a.DimensionIndexSequence=s.indices,a.PixelRepresentation=0,a.numberOfFiles=1;const l=t.getMeta();a.PatientID=l.PatientID,a.StudyInstanceUID=l.StudyInstanceUID,a.SeriesInstanceUID=l.SeriesInstanceUID;const c=[{referencedSOPClassUID:l.SOPClassUID,referencedSOPInstanceUID:t.getImageUid(r)}],u=[];u.push({ReferencedInstanceSequence:{value:c},SeriesInstanceUID:l.SeriesInstanceUID}),a.ReferencedSeriesSequence={value:u},a.custom={frameInfos:[{dimIndex:[1,1],refSegmentNumber:1,imagePosPat:l.ImageOrientationPatient,derivationImages:[{sourceImages:c}]}]},a.lengthUnit=t.getMeta().lengthUnit,this.#Nn=this.#ai(n,n.getOrigins()[i],a);const d=en(a),h=new fo(d);return h.image=this.#Nn,this.#dn.addData(h)}#di(e){const t=this.#dn.getDataViewConfigs();let n;for(const i in t){const o=t[i].find((function(t){return t.divId===e}));if(void 0!==o){n=o.orientation;break}}return n}#hi(e){if(void 0===this.#Zn)throw new Error(Fo);const t=new ss(e);t.orientation=this.#di(e),this.#dn.addDataViewConfig(this.#Zn,t),this.#dn.render(this.#Zn)}#gi(e){let t;const n=e.custom.frameInfos;if(0===n.length)return t;const i=n[0].derivationImages;if(void 0===i)return t;if(0===i.length)return t;const o=i[0].sourceImages;return void 0===o?t:0!==o.length?o[0].referencedSOPInstanceUID:void 0}#Si(e){const t=e.getMeta(),n=this.#gi(t);let i=[];"undefined"!==n&&(i=this.#dn.getDataIdsFromSopUids([n]));let o="0";return i.length>0?o=i[0]:h.warn(Go(Vo,n)),o}#mi(e){if(void 0===this.#Zn)throw new Error(Mo);const t=e.getViewLayersByDataId(this.#Zn);if(0===t.length)throw new Error(Ao);return 1!==t.length&&h.warn(Go(xo,t.length)),t[0]}#pi(e){if(void 0===e)throw new Error(Oo);const t=this.#dn.getData(e);if(void 0===t)throw new Error(Po);return t.image}#fi(e){const t=gr(e),n=new R(e.offsetX,e.offsetY),i=this.#dn.getLayerGroupByDivId(t.groupDivId);if(void 0===i)throw new Error("No layergroup to get mask offsets");let o;if(this.#ti=i,o=void 0===this.#Zn?i.getBaseViewLayer():i.getViewLayersByDataId(this.#Zn)[0],void 0===o)return[];const r=o.getViewController(),a=r.getCurrentPosition();let s,l,c,u;if(r.equalImageMeta({Modality:"SEG"})){this.#Nn=this.#pi(this.#Zn);const e=this.#Si(this.#Nn),t=this.#dn.getData(e);if(!t)throw new Error(Go(yo,e));u=t.image;const a=i.getViewLayersByDataId(e)[0],d=a.getViewController(),h=a.displayToPlanePos(n);c=d.getPositionFromPlanePoint(h),s=o,l=r}else{const e=o.getDataId(),t=this.#dn.getData(e);if(!t)throw new Error(Go(yo,e));u=t.image;const d=o.displayToPlanePos(n);if(c=r.getPositionFromPlanePoint(d),this.#Zn=this.#ui(a,u),void 0===this.#Nn)throw new Error(To);const h=i.getDivId(),g=void 0!==h;g&&this.#hi(h),s=this.#mi(i),l=s.getViewController(),g&&l.setCurrentPosition(a)}const d=u.getGeometry(),h=this.#Nn.getMeta(),g=this.#Nn.getGeometry(),S=r.get2DSpacing(),m=[Math.round(this.#_n/S.x),Math.round(this.#_n/S.y)];let p;const f=r.getScrollDimIndex();switch(f){case 0:p=[1,2];break;case 1:p=[0,2];break;case 2:p=[0,1];break;default:throw new Error(Go(Bo,f))}this.#si(d,g,c,p,m,h);const D=s.displayToPlanePos(n);return function(e,t){const n=e.getSize(),i=[];for(const e of t){const t=n.indexToOffset(e);t>=0&&i.push(t)}return i.sort((function(e,t){return e-t}))}(g,zo(g,l.getPositionFromPlanePoint(D),m,p))}#Di(e){const t=gr(e),n=this.#dn.getLayerGroupByDivId(t.groupDivId);if(void 0===n)throw new Error("No layergroup to check black list");if(void 0===n.getActiveDrawLayer()){const e=n.getActiveViewLayer().getDataId(),t=this.#dn.getData(e).image.getMeta().SeriesInstanceUID;if(this.#ri.includes(t))return!0}return!1}mousedown=e=>{if(this.#Di(e))return;if(void 0===this.#$n)return void h.warn(bo);this.#jn=!0,this.#ni=new R(e.offsetX,e.offsetY),this.#ii=[],this.#oi=[],this.#vi(e);const t=this.#fi(e);t.length>0?this.#li(t):(this.#jn=!1,this.#yi(e))};#vi(e){if(2===e.button){this.#Jn=ko;const e=new CustomEvent("erasingactivated");this.dispatchEvent(e)}}#yi(e){if(2===e.button){this.#Jn=Ho;const e=new CustomEvent("erasingdeactivated");this.dispatchEvent(e)}}mousemove=e=>{if(!this.#jn)return;if(void 0===this.#ni)return;const t=new R(e.offsetX,e.offsetY),n=Math.abs(t.getX()-this.#ni.getX()),i=Math.abs(t.getY()-this.#ni.getY());if(n>this.#_n/2||i>this.#_n/2){const n=this.#fi(e);n.length>0&&this.#li(n),this.#ni=t}};mouseup=e=>{if(this.#jn){if(this.#jn=!1,this.#yi(e),void 0===this.#Zn)throw new Error(Eo);if(void 0===this.#ii)throw new Error(qo);if(void 0===this.#oi)throw new Error(Uo);this.#ii.reverse(),this.#oi.reverse();const t=this.#ci().getId(),n=this.#dn.getData(this.#Zn);if(!n)throw new Error(Go(wo,this.#Zn));const i=new Wo;i.mask=n.image,i.dataId=this.#Zn,i.offsetsLists=this.#ii,i.mode=this.#Jn,i.segmentNumber=this.#$n,i.srclayerid=t,i.originalValuesLists=this.#oi;const o=new Yo(i);o.onExecute=e=>{this.dispatchEvent(e)},o.onUndo=e=>{this.dispatchEvent(e),this.#Nn.recalculateLabels()},this.#dn.addToUndoStack(o),this.dispatchEvent(o.getExecuteEvent()),this.#Nn.recalculateLabels()}};mouseout=e=>{this.mouseup(e)};touchstart=e=>{this.mousedown(e)};touchmove=e=>{this.mousemove(e)};touchend=e=>{this.mouseup(e)};wheel=e=>{this.#Xn.wheel(e)};#ci(){if(void 0===this.#Zn)throw new Error(Qo);if(void 0===this.#ti)throw new Error("No current layer group");const e=this.#ti.getViewLayersByDataId(this.#Zn);if(0===e.length)throw new Error(No);return 1!==e.length&&h.warn(Ro),e[0]}keydown=e=>{e.context="Brush",this.#dn.onKeydown(e);const t=e.ctrlKey||e.altKey;!t&&"+"===e.key&&this.#_n+1<this.#Kn.max?(this.#_n+=1,h.debug("Brush size: "+this.#_n)):!t&&"-"===e.key&&this.#_n-1>=this.#Kn.min?(this.#_n-=1,h.debug("Brush size: "+this.#_n)):t||Number.isNaN(Number.parseInt(e.key,10))?t||"a"!==e.key?t||"d"!==e.key||(this.#Jn=ko,h.debug("Brush mode: "+this.#Jn)):(this.#Jn=Ho,h.debug("Brush mode: "+this.#Jn)):this.#Jn=Ho};activate(e){const t=function(e){let t=[];if(!e)return[];for(const n in e)if(e[n]){const i=e[n];if(Array.isArray(i)){const e=i.map((function(e){return e.divId}));t=[...t,...e]}}return[...new Set(t)]}(this.#dn.getDataViewConfigs());e?this.#Ci(t):this.#Ii(t)}#Ci(e){for(const t of e){const e=document.querySelector("#"+t);if(!e)return;e.addEventListener("contextmenu",(e=>{e.preventDefault(),e.stopPropagation()}))}}#Ii(e){for(const t of e){const e=document.querySelector("#"+t);if(!e)return;e.addEventListener("contextmenu",(e=>{}))}}setFeatures(e){void 0!==e.brushSizeRange&&(this.#Kn=e.brushSizeRange),void 0!==e.brushSize&&e.brushSize>=this.#Kn.min&&e.brushSize<this.#Kn.max&&(this.#_n=e.brushSize),void 0!==e.brushMode&&(this.#Jn=e.brushMode),e.createMask?this.#Zn=void 0:void 0!==e.maskDataId&&(this.#Zn=e.maskDataId),void 0!==e.selectedSegmentNumber&&(this.#$n=e.selectedSegmentNumber),void 0!==e.blacklist&&(this.#ri=e.blacklist)}init(){}getEventNames(){return["brushdraw","brushremove","erasingactivated","erasingdeactivated"]}getHelpKeys(){return{title:"tool.Brush.name",brief:"tool.Brush.brief",mouse:{mouse_click:"tool.Brush.mouse_click"},touch:{touch_click:"tool.Brush.touch_click"}}}}const jo=(e=>{var t={};return i.d(t,e),t})({default:()=>t.default});class Zo{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 _o{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 Ko=2/(3*Math.PI);function Jo(e,t,n,i,o){const r=e[i][n],a=t[i][n];let s=Math.sqrt(r*r+a*a);s=Math.max(s,1e-100),o.x=r/s,o.y=a/s}class $o{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 o=0;o<n;o++){i.data[o]=[];for(let n=0;n<t;n++){const r=4*(o*t+n);i.data[o][n]=(e[r]+e[r+1]+e[r+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,o=0;for(o=0;o<e.data.length-1;o++){for(t[o]=[],i=0;i<e.data[o].length-1;i++)t[o][i]=e.gradMagnitude(i,o),n=Math.max(t[o][i],n);t[o][e.data[o].length-1]=t[o][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(o=0;o<t.length;o++)for(i=0;i<t[o].length;i++)t[o][i]=1-t[o][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 o={inside:[],outside:[]},r={x:-1,y:-1};for(let a=0;a<t.length;a++){o.inside[a]=[],o.outside[a]=[];for(let s=0;s<t[a].length;s++){Jo(t,n,s,a,r);let l=Math.round(s+e*r.y),c=Math.round(a-e*r.x),u=Math.round(s-e*r.y),d=Math.round(a+e*r.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),o.inside[a][s]=i.data[c][l],o.outside[a][s]=i.data[d][u]}}return o}(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 o=0;for(e.length=t,o=0;o<t;o++)e[o]=0;let r=1;for(o=0;o<this.trainingPoints.length;o++){const i=this.trainingPoints[o],a=this.getTrainingIdx(t,n[i.y][i.x]);e[a]+=1,r=Math.max(r,e[a])}for(o=0;o<t;o++)e[o]=1-e[o]/r;!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,o,r){const a={x:-1,y:-1},s={x:-1,y:-1};Jo(e,t,n,i,a),Jo(e,t,o,r,s);let l=a.y*(o-n)-a.x*(r-i),c=s.y*(o-n)-s.x*(r-i);return l<0&&(l=-l,c=-c),n!==o&&i!==r&&(l*=Math.SQRT1_2,c*=Math.SQRT1_2),Ko*(Math.acos(l)+Math.acos(c))}(this.gradX,this.gradY,e,t,n,i)}dist(e,t,n,i){let o=this.gradient[i][n];e!==n&&t!==i||(o*=Math.SQRT1_2);const r=this.laplace[i][n],a=this.gradDirection(e,t,n,i);return this.trained?.3*this.getTrainedGrad(o)+.3*r+.1*(a+this.getTrainedEdge(this.greyscale.data[t][e])+this.getTrainedInside(this.inside[t][e])+this.getTrainedOutside(this.outside[t][e])):.43*o+.43*r+.11*a}adj(e){const t=[],n=Math.max(e.x-1,0),i=Math.max(e.y-1,0),o=Math.min(e.x+1,this.greyscale.data[0].length-1),r=Math.min(e.y+1,this.greyscale.data.length-1);let a=0;for(let s=i;s<=r;s++)for(let i=n;i<=o;i++)i===e.x&&s===e.y||(t[a++]={x:i,y:s});return t}#Ti=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 _o(this.searchGranBits,this.#Ti),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],o=this.cost[n.y][n.x]+this.dist(n.x,n.y,t.x,t.y);o<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]=o,this.parents[t.y][t.x]=n,this.pq.push(t))}e++}return t}}class er{#Li;constructor(e){this.#Li=e}getPosition(e){let t=e.labelPosition;return void 0===t&&(t=this.#Li(e)),t}create(e,t){const n=new Ui.default.Text({fontSize:t.getFontSize(),fontFamily:t.getFontFamily(),fill:e.colour,padding:t.getTextPadding(),shadowColor:t.getShadowLineColour(),shadowOffset:t.getShadowOffset(),name:"text"}),i=e.getText();n.setText(i);const o=t.applyZoomScale(1),r={x:2*o.x,y:2*o.y},a=this.getPosition(e),s=new Ui.default.Label({x:a.getX(),y:a.getY(),scale:r,visible:0!==i.length,name:"label"});return s.add(n),s.add(new Ui.default.Tag({fill:e.colour,opacity:t.getTagOpacity()})),s}updatePosition(e,t){const n=t.getChildren((function(e){return"label"===e.name()}))[0];if(!(n instanceof Ui.default.Label))return;const i=this.getPosition(e);n.position({x:i.getX(),y:i.getY()})}getLabelAnchorsPosition(e){const t=e.x(),n=e.y(),i=e.width()*e.scale().x,o=e.height()*e.scale().y;return[new R(t+i/2,n),new R(t,n+o/2),new R(t+i/2,n+o),new R(t+i,n+o/2)]}getClosestPoints(e,t){let n=e[0].getDistance(t[0]),i=e[0],o=t[0];for(const r of e)for(const e of t){const t=r.getDistance(e);t<n&&(n=t,i=r,o=e)}return[i,o]}getConnector(e,t,n){const i=this.getLabelAnchorsPosition(t),o=this.getClosestPoints(e,i);return new Ui.default.Line({points:[o[0].getX(),o[0].getY(),o[1].getX(),o[1].getY()],stroke:t.getText().fill(),strokeWidth:n.getStrokeWidth(),strokeScaleEnabled:!1,visible:t.visible(),dash:[10,7],name:"connector"})}updateConnector(e,t){const n=e.getChildren((function(e){return"label"===e.name()}))[0];if(!(n instanceof Ui.default.Label))return;const i=this.getLabelAnchorsPosition(n),o=this.getClosestPoints(t,i),r=e.getChildren((function(e){return"connector"===e.name()}))[0];r instanceof Ui.default.Line&&r.points([o[0].getX(),o[0].getY(),o[1].getX(),o[1].getY()])}updateContent(e,t){const n=t.getChildren((function(e){return"label"===e.name()}))[0];if(!(n instanceof Ui.default.Label))return;const i=e.getText();n.getText().setText(i),n.visible()&&n.visible(0!==i.length)}}class tr{#Pi=0;#wi=0;getMin(){return this.#Pi}setMin(e){this.#Pi=e}getMax(){return this.#wi}setMax(e){this.#wi=e}getName(){return"Threshold"}#Oi=null;setOriginalImage(e){this.#Oi=e}getOriginalImage(){return this.#Oi}update(){const e=this.getOriginalImage(),t=e.getDataRange().min;return e.transform((e=>e<this.getMin()||e>this.getMax()?t:e))}}class nr{getName(){return"Sharpen"}#Oi=null;setOriginalImage(e){this.#Oi=e}getOriginalImage(){return this.#Oi}update(){return this.getOriginalImage().convolute2D([0,-1,0,-1,5,-1,0,-1,0])}}class ir{getName(){return"Sobel"}#Oi=null;setOriginalImage(e){this.#Oi=e}getOriginalImage(){return this.#Oi}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 or{#Ai;#bt;#dn;constructor(e,t,n){this.#Ai=e,this.#bt=t,this.#dn=n}getName(){return"Filter-"+this.#Ai.getName()}execute(){this.#dn.setImage(this.#bt,this.#Ai.update()),this.#dn.render(this.#bt);const e={type:"filterrun",id:this.getName(),dataId:this.#bt};this.onExecute(e)}undo(){this.#dn.setImage(this.#bt,this.#Ai.getOriginalImage()),this.#dn.render(this.#bt);const e={type:"filterundo",id:this.getName(),dataid:this.#bt};this.onUndo(e)}onExecute(e){}onUndo(e){}}const rr={},ar={},sr={WindowLevel:class{#dn;#jn=!1;#ni;#Xn;#bi=!0;constructor(e){this.#dn=e,this.#Xn=new go(e)}#xi(e){let t;if(this.#bi)t=e.getActiveViewLayer();else{const n=function(e){return e.getViewController().isMonochrome()};t=e.getViewLayersFromActive(n)[0]}return t}#Ri(e,t){const n=this.#dn.getLayerGroupByDivId(t),i=this.#xi(n);void 0!==i&&i.getViewController().isMonochrome()&&(this.#jn=!0,this.#ni=e)}#Fi(e,t){if(!this.#jn)return;const n=this.#dn.getLayerGroupByDivId(t),i=this.#xi(n);if(void 0===i)return;const o=i.getViewController(),r=e.getX()-this.#ni.getX(),a=this.#ni.getY()-e.getY(),s=o.getImageRescaledDataRange(),l=.001*(s.max-s.min),c=o.getWindowLevel().center,u=o.getWindowLevel().width,d=new D(c+a*l,u+r*l);o.setWindowLevel(d),this.#ni=e}#Ei(){this.#jn&&(this.#jn=!1)}mousedown=e=>{const t=Ri(e),n=gr(e);this.#Ri(t,n.groupDivId)};mousemove=e=>{const t=Ri(e),n=gr(e);this.#Fi(t,n.groupDivId)};mouseup=e=>{this.#Ei()};mouseout=e=>{this.#Ei()};touchstart=e=>{const t=xi(e),n=gr(e);this.#Ri(t[0],n.groupDivId)};touchmove=e=>{const t=xi(e),n=gr(e);this.#Fi(t[0],n.groupDivId)};touchend=e=>{this.#Ei()};dblclick=e=>{const t=gr(e),n=Ri(e),i=this.#dn.getLayerGroupByDivId(t.groupDivId),o=this.#xi(i);if(void 0===o)return;const r=o.displayToPlaneIndex(n),a=o.getViewController();if(!a.isMonochrome())return;const s=this.#dn.getData(o.getDataId()).image,l=new D(s.getRescaledValueAtIndex(a.getCurrentIndex().getWithNew2D(r.get(0),r.get(1))),a.getWindowLevel().width);a.setWindowLevel(l)};wheel=e=>{this.#Xn.wheel(e)};keydown=e=>{e.context="WindowLevel",this.#dn.onKeydown(e)};activate(e){}init(){}setFeatures(e){void 0!==e.strictViewLayer&&(this.#bi=e.strictViewLayer)}},Scroll:class{#dn;#jn=!1;#ni;#Xn;#qi;#Ui=!1;#Mi;constructor(e){this.#dn=e,this.#Xn=new go(e)}#Qi(e){let t=e.getActiveViewLayer();if(void 0===t){const n=e.getActiveDrawLayer();if(void 0===n)return void h.warn("No draw layer to do scroll");t=e.getViewLayerById(n.getReferenceLayerId())}return t}#Ri(e,t){this.#Ni();const n=this.#dn.getLayerGroupByDivId(t),i=this.#Qi(n);if(void 0===i)return void h.warn("No view layer to start scroll");const o=i.getViewController();o.isPlaying()&&o.stop();const r=i.displayToPlanePos(e),a=o.getPositionFromPlanePoint(r);o.setCurrentPosition(a),this.#jn=!0,this.#ni=e}#Fi(e,t){if(!this.#jn)return void(this.#Ui&&this.#Vi(e,t));const n=this.#dn.getLayerGroupByDivId(t),i=n.getPositionHelper(),o=e.getY()-this.#ni.getY(),r=Math.abs(o)>15,a=e.getX()-this.#ni.getX(),s=Math.abs(a)>15;r&&n.canScroll()?o>0?i.decrementPositionAlongScroll():i.incrementPositionAlongScroll():s&&n.moreThanOne(3)&&(a>0?i.incrementPosition(3):i.decrementPosition(3)),(s||r)&&(this.#ni=e)}#Ei(){this.#jn&&(this.#jn=!1)}mousedown=e=>{const t=Ri(e),n=gr(e);this.#Ri(t,n.groupDivId)};mousemove=e=>{const t=Ri(e),n=gr(e);this.#Fi(t,n.groupDivId)};mouseup=e=>{this.#Ei()};mouseout=e=>{this.#Ei(),this.#Ni()};touchstart=e=>{this.#qi=setTimeout((()=>{this.dblclick(e)}),500);const t=xi(e),n=gr(e);this.#Ri(t[0],n.groupDivId)};touchmove=e=>{null!==this.#qi&&(clearTimeout(this.#qi),this.#qi=null);const t=xi(e),n=gr(e);this.#Fi(t[0],n.groupDivId)};touchend=e=>{null!==this.#qi&&(clearTimeout(this.#qi),this.#qi=null),this.#Ei()};wheel=e=>{this.#Xn.wheel(e)};keydown=e=>{e.context="Scroll",this.#dn.onKeydown(e)};dblclick=e=>{const t=gr(e),n=this.#dn.getLayerGroupByDivId(t.groupDivId).getActiveViewLayer();void 0!==n&&n.getViewController().play()};#Vi(e,t){const n=this.#dn.getLayerGroupByDivId(t);this.#Mi=t,n.showTooltip(e)}#Ni(){void 0!==this.#Mi&&(this.#dn.getLayerGroupByDivId(this.#Mi).removeTooltipDiv(),this.#Mi=void 0)}activate(e){e||this.#Ni()}setFeatures(e){void 0!==e.displayTooltip&&(this.#Ui=e.displayTooltip)}init(){}},ZoomAndPan:class{#dn;#jn=!1;#ni;#Bi;#Gi;#ki;constructor(e){this.#dn=e}#Qi(e){let t=e.getActiveViewLayer();if(void 0===t){const n=e.getActiveDrawLayer();if(void 0===n)return void h.warn("No draw layer to do zoom/pan");t=e.getViewLayerById(n.getReferenceLayerId())}return t}#Ri(e){this.#jn=!0,this.#ni=e,this.#Bi=!1}#Hi=e=>{this.#jn=!0,this.#ni=e[0],this.#Bi=!1,this.#Gi=new Ji(e[0],e[1]),this.#ki=this.#Gi.getMidpoint()};#Fi(e,t){if(!this.#jn)return;this.#Bi=!0;const n=e.getX()-this.#ni.getX(),i=e.getY()-this.#ni.getY(),o=this.#dn.getLayerGroupByDivId(t),r=this.#Qi(o);if(void 0===r)return void h.warn("No view layer to update zoom/pan");const a=r.getViewController(),s=r.displayToPlaneScale(new R(n,i)),l=a.getOffset3DFromPlaneOffset({x:s.getX(),y:s.getY()});o.addTranslation({x:l.getX(),y:l.getY(),z:l.getZ()}),o.draw(),this.#ni=e}#zi=(e,t)=>{if(!this.#jn)return;this.#Bi=!0;const n=new Ji(e[0],e[1]).getLength()/this.#Gi.getLength(),i=this.#dn.getLayerGroupByDivId(t),o=i.getPositionHelper();if(1===n){const t=e[0].getY()-this.#ni.getY();if(Math.abs(t)<15)return;i.canScroll()&&(t>0?o.incrementPositionAlongScroll():o.decrementPositionAlongScroll())}else{const e=(n-1)/10;if(Math.abs(e)%.1<=.05&&void 0!==this.#ki){const t=this.#Qi(i);if(void 0===t)return void h.warn("No view layer to do touch zoom/pan");const n=t.getViewController(),o=t.displayToMainPlanePos(this.#ki),r=n.getPlanePositionFromPlanePoint(o);i.addScale(e,r),i.draw()}}};#Wi(e,t){const n=this.#dn.getLayerGroupByDivId(t),i=this.#Qi(n);if(void 0===i)return void h.warn("No view layer to set current position");const o=i.getViewController(),r=i.displayToPlanePos(e),a=o.getPositionFromPlanePoint(r);o.setCurrentPosition(a)}#Ei(){this.#jn&&(this.#jn=!1)}mousedown=e=>{const t=Ri(e);this.#Ri(t)};mousemove=e=>{const t=Ri(e),n=gr(e);this.#Fi(t,n.groupDivId)};mouseup=e=>{if(!this.#Bi){const t=Ri(e),n=gr(e);this.#Wi(t,n.groupDivId)}this.#Ei()};mouseout=e=>{this.#Ei()};touchstart=e=>{const t=xi(e);1===t.length?this.#Ri(t[0]):2===t.length&&this.#Hi(t)};touchmove=e=>{const t=xi(e),n=gr(e);1===t.length?this.#Fi(t[0],n.groupDivId):2===t.length&&this.#zi(t,n.groupDivId)};touchend=e=>{if(!this.#Bi){const t=Ri(e),n=gr(e);this.#Wi(t,n.groupDivId)}this.#Ei()};wheel=e=>{e.preventDefault();const t=-e.deltaY/500,n=gr(e),i=Ri(e),o=this.#dn.getLayerGroupByDivId(n.groupDivId),r=this.#Qi(o);if(void 0===r)return void h.warn("No view layer to do wheel zoom/pan");const a=r.getViewController(),s=r.displayToMainPlanePos(i),l=a.getPlanePositionFromPlanePoint(s);o.addScale(t,l),o.draw()};keydown=e=>{e.context="ZoomAndPan",this.#dn.onKeydown(e)};activate(e){}init(){}setFeatures(e){}},Opacity:class{#dn;#jn=!1;#ni;#Xn;constructor(e){this.#dn=e,this.#Xn=new go(e)}#Ri(e){this.#jn=!0,this.#ni=e}#Fi(e,t){if(!this.#jn)return;const n=e.getX()-this.#ni.getX();if(Math.abs(n)>15){const i=this.#dn.getLayerGroupByDivId(t).getActiveLayer(),o=i.getOpacity();i.setOpacity(o+n/200),i.draw(),this.#ni=e}}#Ei(){this.#jn&&(this.#jn=!1)}mousedown=e=>{const t=Ri(e);this.#Ri(t)};mousemove=e=>{const t=Ri(e),n=gr(e);this.#Fi(t,n.groupDivId)};mouseup=e=>{this.#Ei()};mouseout=e=>{this.#Ei()};touchstart=e=>{const t=xi(e);this.#Ri(t[0])};touchmove=e=>{const t=xi(e),n=gr(e);this.#Fi(t[0],n.groupDivId)};touchend=e=>{this.#Ei()};wheel=e=>{this.#Xn.wheel(e)};keydown=e=>{e.context="Opacity",this.#dn.onKeydown(e)};activate(e){}init(){}setFeatures(e){}},Draw:class{#dn;#Xn;#Yi;#Xi=!1;#ji=null;#Sn=null;#Zi=null;#_i;#rn=[];#Ki=null;#Ji=!0;#$i;#eo;#to;#no;#io;#oo=!1;#A={};#ro=!1;#ao=[];constructor(e){this.#dn=e,this.#Xn=new go(e),this.#io=new po(e,this.#B),this.#Yi=e.getStyle()}#so(e){let t=!0;if(void 0!==this.#$i){const n=e.getActiveViewLayer().getDataId(),i=this.#dn.getData(n).image.getMeta();t=this.#$i(i)}return t}#lo(e){let t=!0;if(void 0!==this.#eo){const n=e.getDataId(),i=this.#dn.getData(n).annotationGroup.getMeta();t=this.#eo(i)}return t}#co(e){const t=e.getActiveViewLayer().getDataId(),n=this.#dn.createAnnotationData(t);if(void 0!==this.#to)for(const e of this.#to)n.annotationGroup.setMetaValue(e.concept,e.value);this.#dn.addAndRenderAnnotationData(n,e.getDivId(),t);const i=e.getActiveDrawLayer();return i.setShapeHandler(this.#io),e.setActiveLayerByDataId(i.getDataId()),i}#uo(e,t){const n=this.#dn.getLayerGroupByDivId(t);let i=n.getActiveDrawLayer();if(void 0===i){if(!this.#so(n))return void this.#B({type:"warn",message:"Cannot create draw layer, reference meta is invalid"});i=this.#co(n)}else if(!this.#lo(i))return void this.#B({type:"warn",message:"Cannot create draw, data meta is invalid"});const o=i.getDrawController().getAnnotationGroup(),r=i.getKonvaStage();if(this.#Yi.setZoomScale(r.scale()),o.isEditable()){const t=r.getIntersection({x:e.getX(),y:e.getY()});t?this.#do(i,t):this.#ho(n,e)}}#Qi(e){const t=e.getActiveDrawLayer();if(void 0!==t)return e.getViewLayerById(t.getReferenceLayerId());h.warn("No draw layer to do draw")}#ho(e,t){this.#io.disableAndResetEditor(),this.#go();const n=this.#Qi(e);void 0!==n?(this.#Ki=n.displayToPlanePos(t),this.#rn.push(this.#Ki)):h.warn("No view layer to start shape")}#go(){this.#Xi=!0,this.#Sn=new this.#ji[this.#_i],this.#rn=[]}#So(){this.#Xi=!1,this.#rn=[]}#do(e,t){let n=t.getParent();t instanceof Ui.default.Tag&&(n=n.getParent());const i=n.find(".shape")[0];i instanceof Ui.default.Shape&&(this.#B({type:"annotationselect",annotationid:n.id(),dataid:e.getDataId()}),this.#io.setEditorShape(i,e))}#mo(e,t){const n=this.#dn.getLayerGroupByDivId(t),i=this.#Qi(n);if(void 0===i)return void h.warn("No view layer to update shape");const o=i.displayToPlanePos(e);(Math.abs(o.getX()-this.#Ki.getX())>0||Math.abs(o.getY()-this.#Ki.getY())>0)&&(this.#ro&&this.#rn.pop(),this.#Ki=o,this.#ro=!0,this.#rn.push(this.#Ki),this.#po(this.#rn,n))}#fo(e){if(0!==this.#rn.length){if(this.#rn.length===this.#Sn.getNPoints()){const t=this.#dn.getLayerGroupByDivId(e);this.#Do(this.#rn,t),this.#So()}this.#ro=!1}else h.warn("Draw mouseup but no points...")}mousedown=e=>{if(this.#Xi)return;const t=Ri(e),n=gr(e);this.#uo(t,n.groupDivId)};mousemove=e=>{if(!this.#Xi)return;const t=Ri(e),n=gr(e);this.#mo(t,n.groupDivId)};mouseup=e=>{if(!this.#Xi)return;const t=gr(e);this.#fo(t.groupDivId)};dblclick=e=>{if(this.#Sn&&void 0!==this.#Sn.getNPoints())return;if(!this.#Xi)return;if(0===this.#rn.length)return void h.warn("Draw dblclick but no points...");const t=gr(e),n=this.#dn.getLayerGroupByDivId(t.groupDivId);this.#Do(this.#rn,n),this.#So()};touchstart=e=>{if(this.#Xi)return;const t=xi(e),n=gr(e);this.#uo(t[0],n.groupDivId)};touchmove=e=>{if(!this.#Xi)return;const t=gr(e),n=xi(e),i=this.#dn.getLayerGroupByDivId(t.groupDivId),o=this.#Qi(i);if(void 0===o)return void h.warn("No view layer to handle touch move");const r=o.displayToPlanePos(n[0]);(Math.abs(r.getX()-this.#Ki.getX())>0||Math.abs(r.getY()-this.#Ki.getY())>0)&&(1!==this.#rn.length&&this.#rn.pop(),this.#Ki=r,this.#rn.push(this.#Ki),this.#rn.length<this.#Sn.getNPoints()&&(clearTimeout(this.timer),this.timer=setTimeout((()=>{this.#rn.push(this.#Ki)}),this.#Sn.getTimeout())),this.#po(this.#rn,i))};touchend=e=>{this.dblclick(e)};wheel=e=>{this.#Ji&&this.#Xn.wheel(e)};keydown=e=>{this.#Xi||(e.context="Draw",this.#dn.onKeydown(e));const t=this.#io.getEditorAnnotation();if(("Delete"===e.key||"Backspace"===e.key)&&void 0!==t){const e=this.#dn.getActiveLayerGroup().getActiveDrawLayer();if(void 0===e)return void h.warn("No draw layer to handle key down");const n=e.getDrawController(),i=new Vi(t,n);this.#dn.addToUndoStack(i),i.execute(),this.#io.onMouseOutShapeGroup()}if("Escape"===e.key&&null!==this.#Zi){const e=this.#Zi.getLayer();this.#Zi.destroy(),this.#Zi=null,this.#So(),e.draw()}};#po(e,t){this.#Zi&&(this.#Zi.destroy(),this.#Zi=null);const n=t.getActiveDrawLayer();if(void 0===n)return void h.warn("No draw layer to handle new points");const i=n.getDrawController(),o=n.getKonvaLayer(),r=t.getViewLayerById(n.getReferenceLayerId());if(void 0===r)return void h.warn("No view layer to handle new points");const a=r.getViewController();if(this.#oo){const e=["#ffff80","#ff80ff","#80ffff","#80ff80","8080ff","ff8080"],t=n.getId(),i=t.substring(t.length-1),o=e[parseInt(i,10)-1];void 0!==o&&this.#Yi.setLineColour(o)}const s=new cr,l=i.getAnnotationGroup().getColour();s.colour=void 0!==l?l:this.#Yi.getLineColour(),s.init(a),this.#Sn.setAnnotationMathShape(s,e),this.#Zi=this.#Sn.createShapeGroup(s,this.#Yi),n.setLabelVisibility(this.#Zi),this.#Zi.getChildren(zi)[0].listening(!1),o.listening(!1),o.add(this.#Zi),o.draw()}#Do(e,t){this.#Zi&&(this.#Zi.destroy(),this.#Zi=null);const n=t.getActiveDrawLayer();if(void 0===n)return void h.warn("No draw layer to handle final points");const i=n.getKonvaLayer(),o=n.getDrawController(),r=t.getViewLayerById(n.getReferenceLayerId());if(void 0===r)return void h.warn("No view layer to handle final points");const a=r.getViewController(),s=new cr,l=o.getAnnotationGroup().getColour();if(s.colour=void 0!==l?l:this.#Yi.getLineColour(),s.init(a),void 0!==this.#no)for(const e of this.#no)s.addMetaItem(e.concept,e.value);this.#Sn.setAnnotationMathShape(s,e);const c=new Ni(s,o);this.#dn.addToUndoStack(c),c.execute(),i.listening(!0)}#vo(e){const t=e.getId();return void 0===this.#ao[t]&&(this.#ao[t]=()=>{e.activateCurrentPositionShapes(!0)}),this.#ao[t]}#yo(e,t){e.setShapeHandler(this.#io),e.activateCurrentPositionShapes(t),t?this.#dn.addEventListener("positionchange",this.#vo(e)):this.#dn.removeEventListener("positionchange",this.#vo(e))}activate(e){e||this.#io.onMouseOutShapeGroup();const t=this.#dn.getDrawLayers();for(const n of t)void 0!==n&&this.#yo(n,e);this.#dn.addEventListener("drawlayeradd",(t=>{const n=this.#dn.getDrawLayers((function(e){return e.getId()===t.layerid}));1===n.length&&this.#yo(n[0],e)}))}setOptions(e){this.#ji=e}getOptionsType(){return"factory"}setFeatures(e){if(void 0!==e.autoShapeColour&&(this.#oo=e.autoShapeColour),void 0!==e.shapeColour&&(this.#Yi.setLineColour(e.shapeColour),this.#oo=!1),void 0!==e.shapeName){if(!this.hasShape(e.shapeName))throw new Error("Unknown shape: '"+e.shapeName+"'");this.#_i=e.shapeName}void 0!==e.mouseOverCursor&&this.#io.storeMouseOverCursor(e.mouseOverCursor),void 0!==e.withScroll&&(this.#Ji=e.withScroll),void 0!==e.refMetaValidator&&(this.#$i=e.refMetaValidator),void 0!==e.drawMetaValidator&&(this.#eo=e.drawMetaValidator),void 0!==e.annotationGroupMeta&&(this.#to=e.annotationGroupMeta),void 0!==e.annotationMeta&&(this.#no=e.annotationMeta)}init(){}getEventNames(){return["annotationupdate","annotationselect","warn"]}addEventListener(e,t){void 0===this.#A[e]&&(this.#A[e]=[]),this.#A[e].push(t)}removeEventListener(e,t){if(void 0!==this.#A[e])for(let n=0;n<this.#A[e].length;++n)this.#A[e][n]===t&&this.#A[e].splice(n,1)}#B=e=>{if(void 0!==this.#A[e.type])for(let t=0;t<this.#A[e.type].length;++t)this.#A[e.type][t](e)};hasShape(e){return void 0!==this.#ji[e]}},Brush:Xo,Filter:class{#dn;constructor(e){this.#dn=e}#Co=null;#Io=0;#N=new H;activate(e){for(const t in this.#Co)e?(this.#Co[t].addEventListener("filterrun",this.#B),this.#Co[t].addEventListener("filterundo",this.#B)):(this.#Co[t].removeEventListener("filterrun",this.#B),this.#Co[t].removeEventListener("filterundo",this.#B))}setOptions(e){this.#Co={};for(const t in e)this.#Co[t]=new e[t](this.#dn)}getOptionsType(){return"instance"}init(){for(const e in this.#Co)this.#Co[e].init()}keydown=e=>{e.context="Filter",this.#dn.onKeydown(e)};getEventNames(){return["filterrun","filterundo"]}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)};getSelectedFilter(){return this.#Io}setFeatures(e){if(void 0!==e.filterName){if(!this.hasFilter(e.filterName))throw new Error("Unknown filter: '"+e.filterName+"'");this.#Io&&this.#Io.activate(!1),this.#Io=this.#Co[e.filterName],this.#Io.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.#Co}hasFilter(e){return this.#Co[e]}},Floodfill:class{#dn;constructor(e){this.#dn=e}#To=5;#Lo=0;#Po=2e3;#wo=null;#Nn=null;#Oo=10;#Ao=null;#jn=!1;#kt;#bo;#xo=null;#Ro=[];#Fo=!1;#Yi=new Ki;setExtend(e){this.#Fo=e}getExtend(){return this.#Fo}#Qi(e){const t=e.getActiveDrawLayer();if(void 0!==t)return e.getViewLayerById(t.getReferenceLayerId());h.warn("No draw layer to do floodfill")}#Eo=(e,t)=>{const n=this.#dn.getLayerGroupByDivId(t),i=this.#Qi(n);if(void 0===i)return void h.warn("No view layer to get index");const o=i.displayToPlaneIndex(e);return{x:o.get(0),y:o.get(1)}};#qo(e,t,n){this.#Ro=[];const i={data:this.#wo.data,width:this.#wo.width,height:this.#wo.height,bytes:4};this.#Nn=jo.default.floodFill(i,e.x,e.y,t),this.#Nn=jo.default.gaussBlurOnlyBorder(this.#Nn,this.#To);let o=jo.default.traceContours(this.#Nn);if(o=jo.default.simplifyContours(o,this.#Lo,this.#Po),o.length>0&&o[0].points[0].x){if(n)return o[0].points;for(let e=0,t=o[0].points.length;e<t;e++)this.#Ro.push(new R(o[0].points[e].x,o[0].points[e].y));return this.#Ro}return[]}#Uo(e,t,n){if(this.#xo=this.#qo(e,t,!1),0!==this.#xo.length){const e=n.getActiveDrawLayer();if(void 0===e)return h.warn("No draw layer to paint border"),!1;const t=e.getDrawController(),i=new ao(this.#xo);let o;if(void 0===this.#kt){this.#kt=new cr,this.#kt.colour=this.#Yi.getLineColour();const r=n.getViewLayerById(e.getReferenceLayerId());if(void 0===r)return h.warn("No view layer to paint border"),!1;const a=r.getViewController();this.#kt.init(a),this.#kt.mathShape=i,o=new Ni(this.#kt,t)}else{const e=this.#kt.mathShape;o=new Bi(this.#kt,{mathShape:e},{mathShape:i},t)}this.#dn.addToUndoStack(o),o.execute()}return 0!==this.#xo.length}extend(e,t,n){if(!this.#bo)throw"'initialpoint' not found. User must click before use extend!";const i=n.getPositionHelper(),o=this.#Qi(n);if(void 0===o)return void h.warn("No view layer to extend floodfill");const r=o.getViewController(),a=r.getCurrentIndex(),s=r.getImageSize(),l=this.#Ao||this.#Oo;for(let e=a.get(2),o=t||s.get(2);e<o&&this.#Uo(this.#bo,l,n);e++)i.incrementPositionAlongScroll();r.setCurrentIndex(a);for(let t=a.get(2),o=e||0;t>o&&this.#Uo(this.#bo,l,n);t--)i.decrementPositionAlongScroll();r.setCurrentIndex(a)}onThresholdChange(e){}#Ri(e,t){this.#kt=void 0;const n=this.#dn.getLayerGroupByDivId(t);let i,o=n.getActiveDrawLayer();if(void 0===o){i=n.getActiveViewLayer();const e=i.getDataId(),r=this.#dn.createAnnotationData(e);this.#dn.addAndRenderAnnotationData(r,t,e),o=n.getActiveDrawLayer(),n.setActiveLayerByDataId(o.getDataId())}else if(i=n.getViewLayerById(o.getReferenceLayerId()),void 0===i)return void h.warn("No view layer to start floodfill");this.#wo=i.getImageData(),this.#wo?(this.#Yi.setZoomScale(o.getKonvaLayer().getAbsoluteScale()),this.#jn=!0,this.#bo=this.#Eo(e,t),this.#Uo(this.#bo,this.#Oo,n),this.onThresholdChange(this.#Oo)):h.error("No image found")}#Fi(e,t){if(!this.#jn)return;const n=this.#Eo(e,t);this.#Ao=Math.round(Math.sqrt(Math.pow(this.#bo.x-n.x,2)+Math.pow(this.#bo.y-n.y,2))/2),this.#Ao=this.#Ao<this.#Oo?this.#Oo:this.#Ao-this.#Oo,this.#Uo(this.#bo,this.#Ao,this.#dn.getLayerGroupByDivId(t)),this.onThresholdChange(this.#Ao)}#Ei(){this.#jn&&(this.#jn=!1)}mousedown=e=>{const t=Ri(e),n=gr(e);this.#Ri(t,n.groupDivId)};mousemove=e=>{const t=Ri(e),n=gr(e);this.#Fi(t,n.groupDivId)};mouseup=e=>{this.#Ei()};mouseout=e=>{this.#Ei()};touchstart=e=>{const t=xi(e),n=gr(e);this.#Ri(t[0],n.groupDivId)};touchmove=e=>{const t=xi(e),n=gr(e);this.#Fi(t[0],n.groupDivId)};touchend=e=>{this.#Ei()};keydown=e=>{e.context="Floodfill",this.#dn.onKeydown(e)};activate(e){e&&(this.#Yi.setBaseScale(this.#dn.getBaseScale()),this.setFeatures({shapeColour:this.#Yi.getLineColour()}))}init(){}setFeatures(e){void 0!==e.shapeColour&&this.#Yi.setLineColour(e.shapeColour)}},Livewire:class{#dn;constructor(e){this.#dn=e}#jn=!1;#ni;#kt;#Yi=new Ki;#Mo=new Zo;#Qo=new Zo;#Ro=[];#No=5;#Vo(e){const t=e.get(1);for(let e=0;e<t;++e)this.#Ro[e]=[]}#Bo(){this.#Mo=new Zo,this.#Qo=new Zo}#Go=new $o;#Ri(e,t){const n=this.#dn.getLayerGroupByDivId(t);let i,o=n.getActiveDrawLayer();i=void 0===o?n.getActiveViewLayer():n.getViewLayerById(o.getReferenceLayerId());const r=i.getViewController().getImageSize();this.#Go.setDimensions(r.get(0),r.get(1)),this.#Go.setData(i.getImageData().data);const a=i.displayToPlaneIndex(e);if(this.#jn){const e=Math.abs(a.get(0)-this.#ni.getX()),t=Math.abs(a.get(1)-this.#ni.getY());if(e<this.#No&&t<this.#No)this.#ko();else{this.#Mo=this.#Qo,this.#Vo(r);const e={x:a.get(0),y:a.get(1)};this.#Go.doTraining(e),this.#Mo.addControlPoint(this.#Qo.getPoint(0))}}else{if(this.#kt=void 0,this.#jn=!0,this.#ni=new R(a.get(0),a.get(1)),this.#Bo(),this.#Vo(r),void 0===o){const e=i.getDataId(),r=this.#dn.createAnnotationData(e);this.#dn.addAndRenderAnnotationData(r,t,e),o=n.getActiveDrawLayer(),n.setActiveLayerByDataId(o.getDataId())}this.#Yi.setZoomScale(o.getKonvaLayer().getAbsoluteScale());const e={x:a.get(0),y:a.get(1)};this.#Go.doTraining(e);const s=new R(a.get(0),a.get(1));this.#Mo.addPoint(s),this.#Mo.addControlPoint(s)}}#Fi(e,t){if(!this.#jn)return;const n=this.#dn.getLayerGroupByDivId(t),i=n.getActiveDrawLayer();if(void 0===i)return void h.warn("No draw layer to update livewire");const o=n.getViewLayerById(i.getReferenceLayerId());if(void 0===o)return void h.warn("No view layer to update livewire");const r=o.displayToPlaneIndex(e);let a={x:r.get(0),y:r.get(1)};this.#Go.setPoint(a);let s=[],l=!1;for(;!this.#Ro[a.y][a.x]&&!l;)if(s=this.#Go.doWork(),0===s.length)l=!0;else for(let e=0;e<s.length-1;e+=2){const t=s[e],n=s[e+1];this.#Ro[t.y][t.x]=n}for(this.#Qo=new Zo,l=!1;a&&!l;)this.#Qo.addPoint(new R(a.x,a.y)),this.#Ro[a.y]&&this.#Ro[a.y][a.x]?a=this.#Ro[a.y][a.x]:l=!0;this.#Qo.appenPath(this.#Mo);const c=i.getDrawController(),u=new ao(this.#Qo.pointArray);let d;if(void 0===this.#kt){this.#kt=new cr,this.#kt.colour=this.#Yi.getLineColour();const e=o.getViewController();this.#kt.init(e),this.#kt.mathShape=u,d=new Ni(this.#kt,c)}else{const e=this.#kt.mathShape;d=new Bi(this.#kt,{mathShape:e},{mathShape:u},c)}this.#dn.addToUndoStack(d),d.execute()}#ko(){this.#jn=!1}mousedown=e=>{const t=Ri(e),n=gr(e);this.#Ri(t,n.groupDivId)};mousemove=e=>{const t=Ri(e),n=gr(e);this.#Fi(t,n.groupDivId)};mouseup(e){}mouseout=e=>{};dblclick=e=>{this.#ko()};touchstart=e=>{const t=xi(e),n=gr(e);this.#Ri(t[0],n.groupDivId)};touchmove=e=>{const t=xi(e),n=gr(e);this.#Fi(t[0],n.groupDivId)};touchend=e=>{};keydown=e=>{e.context="Livewire",this.#dn.onKeydown(e)};activate(e){e&&(this.#Yi.setBaseScale(this.#dn.getBaseScale()),this.setFeatures({shapeColour:this.#Yi.getLineColour()}))}init(){}setFeatures(e){void 0!==e.shapeColour&&this.#Yi.setLineColour(e.shapeColour)}}},lr={draw:{ArrowFactory:class{#Ho="arrow";#zo=new er(this.#Wo);static supports(e){return e instanceof R}getName(){return this.#Ho}getGroupName(){return this.#Ho+"-group"}getNPoints(){return 2}getTimeout(){return 0}setAnnotationMathShape(e,t){e.mathShape=this.#Yo(t),e.referencePoints=[t[1]],e.setTextExpr(this.#Xo()),e.updateQuantification()}createShapeGroup(e,t){const n=new Ui.default.Group;n.name(this.getGroupName()),n.visible(!0),n.id(e.trackingUid);const i=this.#jo(e,t);n.add(i);const o=this.#Zo(e,t);for(const e of o)n.add(e);const r=this.#zo.create(e,t);n.add(r);const a=this.#_o(i);return n.add(this.#zo.getConnector(a,r,t)),n}#_o(e){const t=e.points(),n=e.x(),i=e.y(),o=(t[0]+t[2])/2+n,r=(t[1]+t[3])/2+i;return[new R(o,r)]}#Ko(e){const t=e.points(),n=e.x(),i=e.y();return[new R(t[0]+n,t[1]+i),new R(t[2]+n,t[3]+i)]}getAnchors(e,t){const n=this.#Ko(e),i=[];for(let e=0;e<n.length;++e)i.push(Zi(n[e].getX(),n[e].getY(),"anchor"+e,t));return i}constrainAnchorMove(e){}updateShapeGroupOnAnchorMove(e,t,n){const i=t.getParent();i instanceof Ui.default.Group&&(this.#Jo(e,t,n),this.updateLabelContent(e,i,n),void 0===e.labelPosition&&this.#zo.updatePosition(e,i),this.updateConnector(i))}updateAnnotationOnAnchorMove(e,t){const n=t.getParent();if(!(n instanceof Ui.default.Group))return;const i=this.#$o(n),o=Xi(n,0),r=Xi(n,1),a=new R(o.x()-i.x(),o.y()-i.y()),s=new R(r.x()-i.x(),r.y()-i.y());e.mathShape=a,e.referencePoints=[s],e.updateQuantification()}updateAnnotationOnTranslation(e,t){const n=e.mathShape,i=e.referencePoints[0],o=new Ji(n,i),r=o.getBegin(),a=new R(r.getX()+t.x,r.getY()+t.y),s=o.getEnd(),l=new R(s.getX()+t.x,s.getY()+t.y);e.mathShape=a,e.referencePoints=[l],e.updateQuantification()}updateLabelContent(e,t,n){this.#zo.updateContent(e,t)}updateConnector(e){const t=this.#$o(e),n=this.#_o(t);this.#zo.updateConnector(e,n)}#Yo(e){return e[0]}#Xo(){return void 0!==O.labelTexts&&void 0!==O.labelTexts[this.#Ho]?O.labelTexts[this.#Ho]:ki[this.#Ho]}#jo(e,t){const n=e.mathShape;if(void 0===e.referencePoints||0===e.referencePoints.length)throw new Error("No reference point for arrow");const i=e.referencePoints[0],o=new Ji(n,i),r=new Ui.default.Line({points:[n.getX(),n.getY(),i.getX(),i.getY()],stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),a=to(o,n,20,t.getZoomScale()),s=to(o,i,20,t.getZoomScale());return 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)})),r}#$o(e){return Yi(e)}#Zo(e,t){const n=e.mathShape,i=e.referencePoints[0],o=new Ji(n,i),r=no(o,40,20,t.getZoomScale());return[new Ui.default.Line({points:[o.getBegin().getX(),o.getBegin().getY(),r.getBegin().getX(),r.getBegin().getY(),r.getEnd().getX(),r.getEnd().getY()],fill:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,closed:!0,name:"shape-triangle"})]}#Wo(e){return e.mathShape}#Jo(e,t,n){const i=e.mathShape,o=e.referencePoints[0],r=new Ji(i,o),a=t.getParent();if(!(a instanceof Ui.default.Group))return;const s=this.#$o(a);s.position({x:0,y:0}),s.points([i.getX(),i.getY(),o.getX(),o.getY()]);const l=a.getChildren((function(e){return"shape-triangle"===e.name()}))[0];if(!(l instanceof Ui.default.Line))return;const c=Xi(a,0),u=Xi(a,1);switch(t.id()){case"anchor0":c.x(t.x()),c.y(t.y());break;case"anchor1":u.x(t.x()),u.y(t.y());break;default:h.error("Unhandled anchor id: "+t.id())}const d=no(r,40,20,n.getZoomScale());l.position({x:0,y:0}),l.points([r.getBegin().getX(),r.getBegin().getY(),d.getBegin().getX(),d.getBegin().getY(),d.getEnd().getX(),d.getEnd().getY()]);const g=to(r,i,20,n.getZoomScale()),S=to(r,o,20,n.getZoomScale());s.hitFunc((function(e){e.beginPath(),e.moveTo(g.getBegin().getX(),g.getBegin().getY()),e.lineTo(g.getEnd().getX(),g.getEnd().getY()),e.lineTo(S.getEnd().getX(),S.getEnd().getY()),e.lineTo(S.getBegin().getX(),S.getBegin().getY()),e.closePath(),e.fillStrokeShape(s)}))}#er(e,t){}#tr(e,t){}},CircleFactory:class{#Ho="circle";#zo=new er(this.#Wo);static supports(e){return e instanceof uo}getName(){return this.#Ho}getGroupName(){return this.#Ho+"-group"}getNPoints(){return 2}getTimeout(){return 0}setAnnotationMathShape(e,t){e.mathShape=this.#Yo(t),e.setTextExpr(this.#Xo()),e.updateQuantification()}createShapeGroup(e,t){const n=new Ui.default.Group;n.name(this.getGroupName()),n.visible(!0),n.id(e.trackingUid);const i=this.#jo(e,t);n.add(this.#jo(e,t));const o=this.#zo.create(e,t);n.add(this.#zo.create(e,t));const r=this.#_o(i);return n.add(this.#zo.getConnector(r,o,t)),n}#_o(e){const t=e.x(),n=e.y(),i=e.radius()*Math.sqrt(2)/2;return[new R(t-i,n-i),new R(t+i,n-i),new R(t-i,n+i),new R(t+i,n+i)]}#Ko(e){const t=e.x(),n=e.y(),i=e.radius();return[new R(t-i,n),new R(t+i,n),new R(t,n+i),new R(t,n-i)]}getAnchors(e,t){const n=this.#Ko(e),i=[];for(let e=0;e<n.length;++e)i.push(Zi(n[e].getX(),n[e].getY(),"anchor"+e,t));return i}constrainAnchorMove(e){const t=e.getParent();if(!(t instanceof Ui.default.Group))return;const n=Xi(t,0),i=Xi(t,1),o=Xi(t,2),r=Xi(t,3);switch(e.id()){case"anchor0":n.y(i.y());break;case"anchor1":i.y(n.y());break;case"anchor2":o.x(r.x());break;case"anchor3":r.x(o.x());break;default:h.error("Unhandled anchor id: "+e.id())}}updateShapeGroupOnAnchorMove(e,t,n){const i=t.getParent();i instanceof Ui.default.Group&&(this.#Jo(e,t,n),this.updateLabelContent(e,i,n),void 0===e.labelPosition&&this.#zo.updatePosition(e,i),this.updateConnector(i))}updateAnnotationOnAnchorMove(e,t){const n=e.mathShape,i=new R(n.getCenter().getX(),n.getCenter().getY()),o=new R(t.x(),t.y()),r=i.getDistance(o);e.mathShape=new uo(i,r),e.updateQuantification()}updateAnnotationOnTranslation(e,t){const n=e.mathShape,i=n.getCenter(),o=new R(i.getX()+t.x,i.getY()+t.y);e.mathShape=new uo(o,n.getRadius()),e.updateQuantification()}updateLabelContent(e,t,n){this.#zo.updateContent(e,t)}updateConnector(e){const t=this.#$o(e),n=this.#_o(t);this.#zo.updateConnector(e,n)}#Yo(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 uo(e[0],i)}#Xo(){return void 0!==O.labelTexts&&void 0!==O.labelTexts[this.#Ho]?O.labelTexts[this.#Ho]:ki[this.#Ho]}#jo(e,t){const n=e.mathShape;return new Ui.default.Circle({x:n.getCenter().getX(),y:n.getCenter().getY(),radius:n.getRadius(),stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"})}#$o(e){const t=e.getChildren(zi)[0];if(t instanceof Ui.default.Circle)return t}#Wo(e){const t=e.mathShape,n=t.getCenter(),i=t.getRadius();return new R(n.getX()-i,n.getY()+i)}#Jo(e,t,n){const i=e.mathShape,o=i.getCenter(),r=i.getRadius(),a=t.getParent();if(!(a instanceof Ui.default.Group))return;this.#$o(a).radius(r);const s=Xi(a,0),l=Xi(a,1),c=Xi(a,2),u=Xi(a,3),d=l.x()<s.x()?-1:1,g=u.y()<c.y()?1:-1;switch(t.id()){case"anchor0":s.x(t.x()),l.x(o.getX()+d*r),c.y(o.getY()+r),u.y(o.getY()-r);break;case"anchor1":l.x(t.x()),s.x(o.getX()-d*r),c.y(o.getY()+r),u.y(o.getY()-r);break;case"anchor2":c.y(t.y()),s.x(o.getX()-r),l.x(o.getX()+r),u.y(o.getY()-g*r);break;case"anchor3":u.y(t.y()),s.x(o.getX()-r),l.x(o.getX()+r),c.y(o.getY()+g*r);break;default:h.error("Unhandled anchor id: "+t.id())}}#er(e,t){const n=e.mathShape;let i=0,o=0;void 0!==t&&(i=t.x(),o=t.y());const r=new Ui.default.Group;r.name("shadow");const a=n.getRound();for(let t=0;t<a.length;++t){const n=a[t],s=n[0][0],l=n[0][1],c=n[1][0],u=new Ui.default.Rect({x:s-i,y:l-o,width:c-s,height:1,fill:e.colour,strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow-element"});r.add(u)}return r}#tr(e,t){const n=t.getChildren((function(e){return"shadow"===e.name()}))[0];if(void 0!==n){n.destroy();const i=this.#er(e,t);t.add(i),i.moveToBottom()}}},EllipseFactory:class{#Ho="ellipse";#zo=new er(this.#Wo);static supports(e){return e instanceof lo}getName(){return this.#Ho}getGroupName(){return this.#Ho+"-group"}getNPoints(){return 2}getTimeout(){return 0}setAnnotationMathShape(e,t){e.mathShape=this.#Yo(t),e.setTextExpr(this.#Xo()),e.updateQuantification()}createShapeGroup(e,t){const n=new Ui.default.Group;n.name(this.getGroupName()),n.visible(!0),n.id(e.trackingUid);const i=this.#jo(e,t);n.add(this.#jo(e,t));const o=this.#zo.create(e,t);n.add(this.#zo.create(e,t));const r=this.#_o(i);return n.add(this.#zo.getConnector(r,o,t)),n}#_o(e){const t=e.x(),n=e.y(),i=e.radiusX()*Math.sqrt(2)/2,o=e.radiusY()*Math.sqrt(2)/2;return[new R(t-i,n-o),new R(t+i,n-o),new R(t-i,n+o),new R(t+i,n+o)]}#Ko(e){const t=e.x(),n=e.y(),i=e.radius();return[new R(t-i.x,n),new R(t+i.x,n),new R(t,n+i.y),new R(t,n-i.y)]}getAnchors(e,t){const n=this.#Ko(e),i=[];for(let e=0;e<n.length;++e)i.push(Zi(n[e].getX(),n[e].getY(),"anchor"+e,t));return i}constrainAnchorMove(e){const t=e.getParent();if(!(t instanceof Ui.default.Group))return;const n=Xi(t,0),i=Xi(t,1),o=Xi(t,2),r=Xi(t,3);switch(e.id()){case"anchor0":n.y(i.y());break;case"anchor1":i.y(n.y());break;case"anchor2":o.x(r.x());break;case"anchor3":r.x(o.x());break;default:h.error("Unhandled anchor id: "+e.id())}}updateShapeGroupOnAnchorMove(e,t,n){const i=t.getParent();i instanceof Ui.default.Group&&(this.#Jo(e,t,n),this.updateLabelContent(e,i,n),void 0===e.labelPosition&&this.#zo.updatePosition(e,i),this.updateConnector(i))}updateAnnotationOnAnchorMove(e,t){const n=e.mathShape,i=n.getCenter();let o=n.getA(),r=n.getB();switch(t.id()){case"anchor0":o=i.getX()-t.x();break;case"anchor1":o=t.x()-i.getX();break;case"anchor2":r=t.y()-i.getY();break;case"anchor3":r=i.getY()-t.y();break;default:h.error("Unhandled anchor id: "+t.id())}e.mathShape=new lo(i,Math.abs(o),Math.abs(r)),e.updateQuantification()}updateAnnotationOnTranslation(e,t){const n=e.mathShape,i=n.getCenter(),o=new R(i.getX()+t.x,i.getY()+t.y);e.mathShape=new lo(o,n.getA(),n.getB()),e.updateQuantification()}updateLabelContent(e,t,n){this.#zo.updateContent(e,t)}updateConnector(e){const t=this.#$o(e),n=this.#_o(t);this.#zo.updateConnector(e,n)}#Yo(e){const t=Math.abs(e[0].getX()-e[1].getX()),n=Math.abs(e[0].getY()-e[1].getY());return new lo(e[0],t,n)}#Xo(){return void 0!==O.labelTexts&&void 0!==O.labelTexts[this.#Ho]?O.labelTexts[this.#Ho]:ki[this.#Ho]}#jo(e,t){const n=e.mathShape,i=n.getCenter(),o={x:n.getA(),y:n.getB()};return new Ui.default.Ellipse({x:i.getX(),y:i.getY(),radius:o,radiusX:o.x,radiusY:o.y,stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"})}#$o(e){const t=e.getChildren(zi)[0];if(t instanceof Ui.default.Ellipse)return t}#Wo(e){const t=e.mathShape,n=t.getCenter();return new R(n.getX()-t.getA(),n.getY()+t.getB())}#Jo(e,t,n){const i=e.mathShape,o=i.getCenter(),r=i.getA(),a=i.getB(),s=t.getParent();if(!(s instanceof Ui.default.Group))return;this.#$o(s).radius({x:r,y:a});const l=Xi(s,0),c=Xi(s,1),u=Xi(s,2),d=Xi(s,3),g=c.x()<l.x()?-1:1,S=d.y()<u.y()?1:-1;switch(t.id()){case"anchor0":l.x(t.x()),c.x(o.getX()+g*r),u.y(o.getY()+a),d.y(o.getY()-a);break;case"anchor1":c.x(t.x()),l.x(o.getX()-g*r),u.y(o.getY()+a),d.y(o.getY()-a);break;case"anchor2":u.y(t.y()),l.x(o.getX()-r),c.x(o.getX()+r),d.y(o.getY()-S*a);break;case"anchor3":d.y(t.y()),l.x(o.getX()-r),c.x(o.getX()+r),u.y(o.getY()+S*a);break;default:h.error("Unhandled anchor id: "+t.id())}}#er(e,t){const n=e.mathShape;let i=0,o=0;void 0!==t&&(i=t.x(),o=t.y());const r=new Ui.default.Group;r.name("shadow");const a=n.getRound();for(let t=0;t<a.length;++t){const n=a[t],s=n[0][0],l=n[0][1],c=n[1][0],u=new Ui.default.Rect({x:s-i,y:l-o,width:c-s,height:1,fill:e.colour,strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow-element"});r.add(u)}return r}#tr(e,t){const n=t.getChildren((function(e){return"shadow"===e.name()}))[0];if(void 0!==n){n.destroy();const i=this.#er(e,t);t.add(i),i.moveToBottom()}}},ProtractorFactory:class{#Ho="protractor";#zo=new er(this.#Wo);static supports(e){return e instanceof so}getName(){return this.#Ho}getGroupName(){return this.#Ho+"-group"}getNPoints(){return 3}getTimeout(){return 500}setAnnotationMathShape(e,t){e.mathShape=this.#Yo(t),e.setTextExpr(this.#Xo()),e.updateQuantification()}createShapeGroup(e,t){const n=e.mathShape,i=new Ui.default.Group;i.name(this.getGroupName()),i.visible(!0),i.id(e.trackingUid);const o=this.#jo(e,t);if(i.add(this.#jo(e,t)),n.getLength()===this.getNPoints()){const n=this.#Zo(e,t);for(const e of n)i.add(e);const r=this.#zo.create(e,t);i.add(this.#zo.create(e,t));const a=this.#_o(o);i.add(this.#zo.getConnector(a,r,t))}return i}#_o(e){const t=e.points(),n=e.x(),i=e.y();return[new R(t[2]+n,t[3]+i)]}#Ko(e){const t=e.points(),n=e.x(),i=e.y();return[new R(t[0]+n,t[1]+i),new R(t[2]+n,t[3]+i),new R(t[4]+n,t[5]+i)]}getAnchors(e,t){const n=this.#Ko(e),i=[];for(let e=0;e<n.length;++e)i.push(Zi(n[e].getX(),n[e].getY(),"anchor"+e,t));return i}constrainAnchorMove(e){}updateShapeGroupOnAnchorMove(e,t,n){const i=t.getParent();i instanceof Ui.default.Group&&(this.#Jo(e,t,n),this.updateLabelContent(e,i,n),void 0===e.labelPosition&&this.#zo.updatePosition(e,i),this.updateConnector(i))}updateAnnotationOnAnchorMove(e,t){const n=t.getParent();if(!(n instanceof Ui.default.Group))return;const i=this.#$o(n),o=Xi(n,0),r=Xi(n,1),a=Xi(n,2),s=new R(o.x()-i.x(),o.y()-i.y()),l=new R(r.x()-i.x(),r.y()-i.y()),c=new R(a.x()-i.x(),a.y()-i.y());e.mathShape=new so([s,l,c]),e.updateQuantification()}updateAnnotationOnTranslation(e,t){const n=e.mathShape,i=[];for(let e=0;e<3;++e)i.push(new R(n.getPoint(e).getX()+t.x,n.getPoint(e).getY()+t.y));e.mathShape=new so(i),e.updateQuantification()}updateLabelContent(e,t,n){this.#zo.updateContent(e,t)}updateConnector(e){const t=this.#$o(e),n=this.#_o(t);this.#zo.updateConnector(e,n)}#Yo(e){return new so(e)}#Xo(){return void 0!==O.labelTexts&&void 0!==O.labelTexts[this.#Ho]?O.labelTexts[this.#Ho]:ki[this.#Ho]}#jo(e,t){const n=e.mathShape,i=[];for(let e=0;e<n.getLength();++e)i.push(n.getPoint(e).getX()),i.push(n.getPoint(e).getY());const o=new Ui.default.Line({points:i,stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"});return n.getLength()===this.getNPoints()&&o.hitFunc((function(e){e.beginPath(),e.moveTo(n.getPoint(0).getX(),n.getPoint(0).getY()),e.lineTo(n.getPoint(1).getX(),n.getPoint(1).getY()),e.lineTo(n.getPoint(2).getX(),n.getPoint(2).getY()),e.closePath(),e.fillStrokeShape(o)})),o}#$o(e){return Yi(e)}#Zo(e,t){const n=e.mathShape,i=new Ji(n.getPoint(0),n.getPoint(1)),o=new Ji(n.getPoint(1),n.getPoint(2));let r=$i(i,o),a=i.getInclination();r>180&&(r=360-r,a+=r);const s=33*Math.min(i.getLength(),o.getLength())/100;return[new Ui.default.Arc({innerRadius:s,outerRadius:s,stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,angle:r,rotation:-a,x:n.getPoint(1).getX(),y:n.getPoint(1).getY(),name:"shape-arc"})]}#Wo(e){const t=e.mathShape,n=new Ji(t.getPoint(0),t.getPoint(1)),i=new Ji(t.getPoint(1),t.getPoint(2)),o=(n.getMidpoint().getX()+i.getMidpoint().getX())/2,r=(n.getMidpoint().getY()+i.getMidpoint().getY())/2;return new R(o,r)}#Jo(e,t,n){const i=e.mathShape,o=new Ji(i.getPoint(0),i.getPoint(1)),r=new Ji(i.getPoint(1),i.getPoint(2)),a=t.getParent();if(!(a instanceof Ui.default.Group))return;const s=this.#$o(a);s.position({x:0,y:0}),s.points([i.getPoint(0).getX(),i.getPoint(0).getY(),i.getPoint(1).getX(),i.getPoint(1).getY(),i.getPoint(2).getX(),i.getPoint(2).getY()]);const l=a.getChildren((function(e){return"shape-arc"===e.name()}))[0];if(!(l instanceof Ui.default.Arc))return;const c=Xi(a,0),u=Xi(a,1),d=Xi(a,2);switch(t.id()){case"anchor0":c.x(t.x()),c.y(t.y());break;case"anchor1":u.x(t.x()),u.y(t.y());break;case"anchor2":d.x(t.x()),d.y(t.y())}let h=$i(o,r),g=o.getInclination();h>180&&(h=360-h,g+=h);const S=33*Math.min(o.getLength(),r.getLength())/100;l.innerRadius(S),l.outerRadius(S),l.angle(h),l.rotation(-g);const m={x:u.x(),y:u.y()};l.position(m),s.hitFunc((function(e){e.beginPath(),e.moveTo(i.getPoint(0).getX(),i.getPoint(0).getY()),e.lineTo(i.getPoint(1).getX(),i.getPoint(1).getY()),e.lineTo(i.getPoint(2).getX(),i.getPoint(2).getY()),e.closePath(),e.fillStrokeShape(s)}))}#er(e,t){}#tr(e,t){}},RectangleFactory:class{#Ho="rectangle";#zo=new er(this.#Wo);static supports(e){return e instanceof oo}getName(){return this.#Ho}getGroupName(){return this.#Ho+"-group"}getNPoints(){return 2}getTimeout(){return 0}setAnnotationMathShape(e,t){e.mathShape=this.#Yo(t),e.setTextExpr(this.#Xo()),e.updateQuantification()}createShapeGroup(e,t){const n=new Ui.default.Group;n.name(this.getGroupName()),n.visible(!0),n.id(e.trackingUid);const i=this.#jo(e,t);n.add(i);const o=this.#zo.create(e,t);n.add(o);const r=this.#_o(i);return n.add(this.#zo.getConnector(r,o,t)),n}#_o(e){const t=e.x(),n=e.y(),i=e.width(),o=e.height();return[new R(t+i/2,n),new R(t,n+o/2),new R(t+i/2,n+o),new R(t+i,n+o/2)]}#Ko(e){const t=e.x(),n=e.y(),i=e.width(),o=e.height();return[new R(t,n),new R(t+i,n),new R(t+i,n+o),new R(t,n+o)]}getAnchors(e,t){const n=this.#Ko(e),i=[];for(let e=0;e<n.length;++e)i.push(Zi(n[e].getX(),n[e].getY(),"anchor"+e,t));return i}constrainAnchorMove(e){}updateShapeGroupOnAnchorMove(e,t,n){const i=t.getParent();i instanceof Ui.default.Group&&(this.#Jo(e,t,n),this.updateLabelContent(e,i,n),void 0===e.labelPosition&&this.#zo.updatePosition(e,i),this.updateConnector(i))}updateAnnotationOnAnchorMove(e,t){const n=t.getParent();if(!(n instanceof Ui.default.Group))return;const i=Xi(n,0),o=Xi(n,2),r=new R(i.x(),i.y()),a=new R(o.x(),o.y());e.mathShape=new oo(r,a),e.updateQuantification()}updateAnnotationOnTranslation(e,t){const n=e.mathShape,i=n.getBegin(),o=new R(i.getX()+t.x,i.getY()+t.y),r=n.getEnd(),a=new R(r.getX()+t.x,r.getY()+t.y);e.mathShape=new oo(o,a),e.updateQuantification()}updateLabelContent(e,t,n){this.#zo.updateContent(e,t)}updateConnector(e){const t=this.#$o(e),n=this.#_o(t);this.#zo.updateConnector(e,n)}#Yo(e){return new oo(e[0],e[1])}#Xo(){return void 0!==O.labelTexts&&void 0!==O.labelTexts[this.#Ho]?O.labelTexts[this.#Ho]:ki[this.#Ho]}#jo(e,t){const n=e.mathShape;return new Ui.default.Rect({x:n.getBegin().getX(),y:n.getBegin().getY(),width:n.getWidth(),height:n.getHeight(),stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"})}#$o(e){const t=e.getChildren(zi)[0];if(t instanceof Ui.default.Rect)return t}#Wo(e){const t=e.mathShape;return new R(t.getBegin().getX(),t.getEnd().getY())}#Jo(e,t,n){const i=e.mathShape,o=i.getBegin(),r=t.getParent();if(!(r instanceof Ui.default.Group))return;const a=this.#$o(r);a.position({x:o.getX(),y:o.getY()}),a.size({width:i.getWidth(),height:i.getHeight()});const s=Xi(r,0),l=Xi(r,1),c=Xi(r,2),u=Xi(r,3);switch(t.id()){case"anchor0":s.x(t.x()),s.y(t.y()),l.y(t.y()),u.x(t.x());break;case"anchor1":l.x(t.x()),l.y(t.y()),s.y(t.y()),c.x(t.x());break;case"anchor2":c.x(t.x()),c.y(t.y()),u.y(t.y()),l.x(t.x());break;case"anchor3":u.x(t.x()),u.y(t.y()),c.y(t.y()),s.x(t.x());break;default:h.error("Unhandled anchor id: "+t.id())}}#er(e,t){const n=e.mathShape.getRound(),i=n.max.getX()-n.min.getX(),o=n.max.getY()-n.min.getY();return new Ui.default.Rect({x:n.min.getX(),y:n.min.getY(),width:i,height:o,fill:e.colour,strokeWidth:0,strokeScaleEnabled:!1,opacity:.3,name:"shadow"})}#tr(e,t){const n=t.getChildren((function(e){return"shadow"===e.name()}))[0];if(void 0!==n){n.destroy();const i=this.#er(e);t.add(i),i.moveToBottom()}}},RoiFactory:class{#Ho="roi";#zo=new er(this.#Wo);static supports(e){return e instanceof ao}getName(){return this.#Ho}getGroupName(){return this.#Ho+"-group"}getNPoints(){}getTimeout(){return 100}setAnnotationMathShape(e,t){e.mathShape=this.#Yo(t),e.setTextExpr(this.#Xo()),e.updateQuantification()}createShapeGroup(e,t){const n=new Ui.default.Group;n.name(this.getGroupName()),n.visible(!0),n.id(e.trackingUid);const i=this.#jo(e,t);n.add(this.#jo(e,t));const o=this.#zo.create(e,t);n.add(this.#zo.create(e,t));const r=this.#_o(i);return n.add(this.#zo.getConnector(r,o,t)),n}#Ko(e){const t=e.points(),n=e.x(),i=e.y(),o=[];for(let e=0;e<t.length;e+=2)o.push(new R(t[e]+n,t[e+1]+i));return o}#_o(e){const t=e.points(),n=e.x(),i=e.y(),o=[];for(let e=0;e<t.length;e+=2){const r=(e+2)%t.length,a=(t[e]+t[r])/2+n,s=(t[e+1]+t[r+1])/2+i;o.push(new R(a,s))}return o}getAnchors(e,t){const n=this.#Ko(e),i=[];for(let e=0;e<n.length;++e)i.push(Zi(n[e].getX(),n[e].getY(),"anchor"+e,t));return i}constrainAnchorMove(e){}updateShapeGroupOnAnchorMove(e,t,n){const i=t.getParent();i instanceof Ui.default.Group&&(this.#Jo(e,t,n),this.updateLabelContent(e,i,n),void 0===e.labelPosition&&this.#zo.updatePosition(e,i),this.updateConnector(i))}updateAnnotationOnAnchorMove(e,t){const n=t.getParent();if(!(n instanceof Ui.default.Group))return;const i=this.#$o(n),o=e.mathShape.getPoints().slice(),r=new R(t.x()-i.x(),t.y()-i.y());o[_i(t.id())]=r,e.mathShape=new ao(o),e.updateQuantification()}updateAnnotationOnTranslation(e,t){const n=e.mathShape,i=[];for(let e=0;e<n.getLength();++e)i.push(new R(n.getPoint(e).getX()+t.x,n.getPoint(e).getY()+t.y));e.mathShape=new ao(i),e.updateQuantification()}updateLabelContent(e,t,n){this.#zo.updateContent(e,t)}updateConnector(e){const t=this.#$o(e),n=this.#_o(t);this.#zo.updateConnector(e,n)}#Yo(e){return new ao(e)}#Xo(){return void 0!==O.labelTexts&&void 0!==O.labelTexts[this.#Ho]?O.labelTexts[this.#Ho]:ki[this.#Ho]}#jo(e,t){const n=e.mathShape,i=[];for(let e=0;e<n.getLength();++e)i.push(n.getPoint(e).getX()),i.push(n.getPoint(e).getY());return new Ui.default.Line({points:i,stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape",closed:!0})}#$o(e){return Yi(e)}#Wo(e){const t=e.mathShape;return new R(t.getPoint(0).getX(),t.getPoint(0).getY())}#Jo(e,t,n){const i=t.getParent();if(!(i instanceof Ui.default.Group))return;const o=this.#$o(i),r=o.points(),a=2*_i(t.id());r[a]=t.x()-o.x(),r[a+1]=t.y()-o.y(),o.points(r);const s=i.getChildren((function(e){return e.id()===t.id()}))[0];s.x(t.x()),s.y(t.y())}#er(e,t){}#tr(e,t){}},RulerFactory:class{#Ho="ruler";#zo=new er(this.#Wo);static supports(e){return e instanceof Ji}getName(){return this.#Ho}getGroupName(){return this.#Ho+"-group"}getNPoints(){return 2}getTimeout(){return 0}setAnnotationMathShape(e,t){e.mathShape=this.#Yo(t),e.setTextExpr(this.#Xo()),e.updateQuantification()}createShapeGroup(e,t){const n=new Ui.default.Group;n.name(this.getGroupName()),n.visible(!0),n.id(e.trackingUid);const i=this.#jo(e,t);n.add(this.#jo(e,t));const o=this.#Zo(e,t);for(const e of o)n.add(e);const r=this.#zo.create(e,t);n.add(this.#zo.create(e,t));const a=this.#_o(i);return n.add(this.#zo.getConnector(a,r,t)),n}#_o(e){const t=e.points(),n=e.x(),i=e.y(),o=(t[0]+t[2])/2+n,r=(t[1]+t[3])/2+i;return[new R(o,r)]}#Ko(e){const t=e.points(),n=e.x(),i=e.y();return[new R(t[0]+n,t[1]+i),new R(t[2]+n,t[3]+i)]}getAnchors(e,t){const n=this.#Ko(e),i=[];for(let e=0;e<n.length;++e)i.push(Zi(n[e].getX(),n[e].getY(),"anchor"+e,t));return i}constrainAnchorMove(e){}updateShapeGroupOnAnchorMove(e,t,n){const i=t.getParent();i instanceof Ui.default.Group&&(this.#Jo(e,t,n),this.updateLabelContent(e,i,n),void 0===e.labelPosition&&this.#zo.updatePosition(e,i),this.updateConnector(i))}updateAnnotationOnAnchorMove(e,t){const n=t.getParent();if(!(n instanceof Ui.default.Group))return;const i=this.#$o(n),o=Xi(n,0),r=Xi(n,1),a=new R(o.x()-i.x(),o.y()-i.y()),s=new R(r.x()-i.x(),r.y()-i.y());e.mathShape=new Ji(a,s),e.updateQuantification()}updateAnnotationOnTranslation(e,t){const n=e.mathShape,i=n.getBegin(),o=new R(i.getX()+t.x,i.getY()+t.y),r=n.getEnd(),a=new R(r.getX()+t.x,r.getY()+t.y);e.mathShape=new Ji(o,a),e.updateQuantification()}updateLabelContent(e,t,n){this.#zo.updateContent(e,t)}updateConnector(e){const t=this.#$o(e),n=this.#_o(t);this.#zo.updateConnector(e,n)}#Yo(e){return new Ji(e[0],e[1])}#Xo(){return void 0!==O.labelTexts&&void 0!==O.labelTexts[this.#Ho]?O.labelTexts[this.#Ho]:ki[this.#Ho]}#jo(e,t){const n=e.mathShape,i=new Ui.default.Line({points:[n.getBegin().getX(),n.getBegin().getY(),n.getEnd().getX(),n.getEnd().getY()],stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape"}),o=to(n,n.getBegin(),20,t.getZoomScale()),r=to(n,n.getEnd(),20,t.getZoomScale());return i.hitFunc((function(e){e.beginPath(),e.moveTo(o.getBegin().getX(),o.getBegin().getY()),e.lineTo(o.getEnd().getX(),o.getEnd().getY()),e.lineTo(r.getEnd().getX(),r.getEnd().getY()),e.lineTo(r.getBegin().getX(),r.getBegin().getY()),e.closePath(),e.fillStrokeShape(i)})),i}#$o(e){return Yi(e)}#Zo(e,t){const n=e.mathShape,i=to(n,n.getBegin(),20,t.getZoomScale()),o=new Ui.default.Line({points:[i.getBegin().getX(),i.getBegin().getY(),i.getEnd().getX(),i.getEnd().getY()],stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape-tick0"}),r=to(n,n.getEnd(),20,t.getZoomScale());return[o,new Ui.default.Line({points:[r.getBegin().getX(),r.getBegin().getY(),r.getEnd().getX(),r.getEnd().getY()],stroke:e.colour,strokeWidth:t.getStrokeWidth(),strokeScaleEnabled:!1,name:"shape-tick1"})]}#Wo(e){const t=e.mathShape,n=t.getBegin(),i=t.getEnd();let o=n;return n.getY()<i.getY()&&(o=i),o}#Jo(e,t,n){const i=e.mathShape,o=t.getParent();if(!(o instanceof Ui.default.Group))return;const r=this.#$o(o);r.position({x:0,y:0}),r.points([i.getBegin().getX(),i.getBegin().getY(),i.getEnd().getX(),i.getEnd().getY()]);const a=o.getChildren((function(e){return"shape-tick0"===e.name()}))[0];if(!(a instanceof Ui.default.Line))return;const s=o.getChildren((function(e){return"shape-tick1"===e.name()}))[0];if(!(s instanceof Ui.default.Line))return;const l=Xi(o,0),c=Xi(o,1);switch(t.id()){case"anchor0":l.x(t.x()),l.y(t.y());break;case"anchor1":c.x(t.x()),c.y(t.y());break;default:h.error("Unhandled anchor id: "+t.id())}const u=to(i,i.getBegin(),20,n.getZoomScale());a.position({x:0,y:0}),a.points([u.getBegin().getX(),u.getBegin().getY(),u.getEnd().getX(),u.getEnd().getY()]);const d=to(i,i.getEnd(),20,n.getZoomScale());s.position({x:0,y:0}),s.points([d.getBegin().getX(),d.getBegin().getY(),d.getEnd().getX(),d.getEnd().getY()]),r.hitFunc((function(e){e.beginPath(),e.moveTo(u.getBegin().getX(),u.getBegin().getY()),e.lineTo(u.getEnd().getX(),u.getEnd().getY()),e.lineTo(d.getEnd().getX(),d.getEnd().getY()),e.lineTo(d.getBegin().getX(),d.getBegin().getY()),e.closePath(),e.fillStrokeShape(r)}))}#er(e,t){}#tr(e,t){}}},filter:{Threshold:class{#dn;constructor(e){this.#dn=e}#Ai=new tr;#nr=!0;#N=new H;activate(e){e&&(this.#nr=!0)}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run threshod filter on.");if(this.#Ai.setMin(e.min),this.#Ai.setMax(e.max),this.#nr){const t=this.#dn.getData(e.dataId).image;this.#Ai.setOriginalImage(t),this.#nr=!1}const t=new or(this.#Ai,e.dataId,this.#dn);t.onExecute=this.#B,t.onUndo=this.#B,t.execute(),this.#dn.addToUndoStack(t)}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)}},Sobel:class{#dn;constructor(e){this.#dn=e}#N=new H;activate(e){}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run sobel filter on.");const t=new ir,n=this.#dn.getData(e.dataId).image;t.setOriginalImage(n);const i=new or(t,e.dataId,this.#dn);i.onExecute=this.#B,i.onUndo=this.#B,i.execute(),this.#dn.addToUndoStack(i)}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)}},Sharpen:class{#dn;constructor(e){this.#dn=e}#N=new H;activate(e){}init(){}run(e){if(void 0===e.dataId)throw new Error("No dataId to run sharpen filter on.");const t=new nr,n=this.#dn.getData(e.dataId).image;t.setOriginalImage(n);const i=new or(t,e.dataId,this.#dn);i.onExecute=this.#B,i.onUndo=this.#B,i.execute(),this.#dn.addToUndoStack(i)}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)}}}};class cr{trackingId;trackingUid;referencedSopInstanceUID;referencedSopClassUID;referencedFrameNumber;mathShape;referencePoints;colour="#ffff80";quantification;textExpr="";labelPosition;planeOrigin;planePoints;#ut;#ze={};constructor(){this.trackingId=Math.random().toString(36).substring(2,15),this.trackingUid=zt("TrackingUniqueIdentifier")}getMetaConceptIds(){return Object.keys(this.#ze)}getMetaItem(e){return this.#ze[e]}addMetaItem(e,t){const n=e.value;void 0!==this.#ze[n]&&h.warn("Overwriting annotation meta with id="+n),this.#ze[e.value]={concept:e,value:t}}removeMetaItem(e){void 0!==this.#ze[e]&&delete this.#ze[e]}getOrientationName(){let e;return void 0!==this.planePoints&&(e=$(this.planePoints[1].getValues().concat(this.planePoints[2].getValues()))),e}init(e){if(void 0!==this.referencedSopInstanceUID)return void h.debug("Cannot initialise annotation twice");this.#ut=e;const t=e.getCurrentPosition();this.referencedSopInstanceUID=e.getCurrentImageUid(),this.referencedSopClassUID=e.getSopClassUid(),t.length()>3&&(this.referencedFrameNumber=t.get(3)),this.planeOrigin=e.getOriginForImageUid(this.referencedSopInstanceUID),e.isAquisitionOrientation()||(this.planePoints=e.getPlanePoints(t))}canView(){return void 0!==this.#ut}isCompatibleView(e){let t=!1;if(void 0===this.planePoints)e.isAquisitionOrientation()&&(t=!0);else{const n=e.getCosines(),i=new F(n[0],n[1],n[2]),o=new F(n[3],n[4],n[5]);i.equals(this.planePoints[1])&&o.equals(this.planePoints[2])&&(t=!0)}return t}setViewController(e){e.includesImageUid(this.referencedSopInstanceUID)?this.isCompatibleView(e.getPlaneHelper())&&(this.#ut=e,this.planeOrigin=e.getOriginForImageUid(this.referencedSopInstanceUID)):h.warn("Cannot view annotation with reference UID: "+this.referencedSopInstanceUID)}#ir(){let e;if(void 0!==this.#ut){let t=this.planeOrigin;void 0!==this.planePoints&&(t=this.planePoints[0]);const n=[t.getX(),t.getY(),t.getZ()];void 0!==this.referencedFrameNumber&&n.push(this.referencedFrameNumber);const i=new E(n);e=this.#ut.getIndexFromPosition(i)}return e}getCentroid(){let e;if(void 0!==this.#ut&&void 0!==this.mathShape.getCentroid&&void 0!==this.mathShape.getCentroid()){const t=this.#ir(),n=this.#ut.getScrollDimIndex(),i=t.getValues()[n],o=this.mathShape.getCentroid();if(e=this.#ut.getPositionFromPlanePoint(o,i),void 0!==this.referencedFrameNumber){const t=e.getValues();t[3]=this.referencedFrameNumber,e=new E(t)}}return e}setTextExpr(e){if(void 0!==this.#ut){const t=this.#ut.getModality();void 0!==e[t]?this.textExpr=e[t]:this.textExpr=e["*"]}else h.warn("Cannot set text expr without a view controller")}getText(){return function(e,t){let n="";if(null==e)return n;if(n=e,null==t)return n;const i=re(e);for(let e=0;e<i.length;++e){const o=t[i[e]];if(null!=o&&null!==o.value&&void 0!==o.value){let t=o.value.toPrecision(4);null!==o.unit&&void 0!==o.unit&&0!==o.unit.length&&("unit.degree"!==o.unit&&(t+=" "),t+=ne.t(o.unit));const r="{"+i[e]+"}";n=n.replace(r,t)}}return n}(this.textExpr,this.quantification)}updateQuantification(){void 0!==this.#ut&&void 0!==this.mathShape.quantify&&(this.quantification=this.mathShape.quantify(this.#ut,this.#ir(),re(this.textExpr)))}getFactory(){let e;if(void 0===this.mathShape)return e;if(void 0!==ar.draw)for(const t in ar.draw){const n=ar.draw[t];if(n.supports(this.mathShape)){e=new n;break}}if(void 0===e)for(const t in lr.draw){const n=lr.draw[t];if(n.supports(this.mathShape)){e=new n;break}}return void 0===e&&h.warn("No shape factory found for math shape"),e}}class ur{#ct;#or=null;#pt;#ft;#yt={x:1,y:1};#Ct={x:1,y:1,z:1};#Tt={x:0,y:0};#Lt={x:0,y:0};#Pt={x:0,y:0};#wt={x:0,y:0};#Ot={x:0,y:0};#Ht;#ot;#bt;#rr;#ar;#io;#sr=!0;constructor(e){this.#ct=e,this.#ct.className+=" drawLayer"}setShapeHandler(e){this.#io=e}getDataId(){return this.#bt}getReferenceLayerId(){return this.#rr}#N=new H;getKonvaStage(){return this.#or}getKonvaLayer(){return this.#or.getLayers()[0]}getDrawController(){return this.#Ht}setPlaneHelper(e){this.#ot=e}getId(){return this.#ct.id}removeFromDOM(){this.#ct.remove()}getBaseSize(){return this.#pt}getOpacity(){return this.#or.opacity()}setOpacity(e){this.#or.opacity(Math.min(Math.max(e,0),1))}addFlipOffsetX(){const e=this.#or.scale(),t=this.#or.size();this.#Ot.x+=t.width/e.x;const n=this.#or.offset();n.x+=this.#Ot.x,this.#or.offset(n)}addFlipOffsetY(){const e=this.#or.scale(),t=this.#or.size();this.#Ot.y+=t.height/e.y;const n=this.#or.offset();n.y+=this.#Ot.y,this.#or.offset(n)}flipScaleX(){this.#Ct.x*=-1}flipScaleY(){this.#Ct.y*=-1}flipScaleZ(){this.#Ct.z*=-1}setScale(e,t){const n=this.#ot.getTargetOrientedPositiveXYZ({x:e.x*this.#Ct.x,y:e.y*this.#Ct.y,z:e.z*this.#Ct.z}),i={x:this.#yt.x*n.x,y:this.#yt.y*n.y},o=this.#or.offset();if(1===Math.abs(e.x)&&1===Math.abs(e.y)&&1===Math.abs(e.z)){const e={x:o.x-this.#Pt.x,y:o.y-this.#Pt.y};this.#Pt={x:0,y:0},this.#or.offset(e)}else if(void 0!==t){let e=this.#ot.getPlaneOffsetFromOffset3D({x:t.getX(),y:t.getY(),z:t.getZ()});e={x:e.x+this.#Tt.x,y:e.y+this.#Tt.y};const n=Sr(o,this.#or.scale(),i,e),r={x:this.#Pt.x+n.x-o.x,y:this.#Pt.y+n.y-o.y};this.#Pt=r,this.#or.offset(n)}this.#or.scale(i),this.#lr(i)}initScale(e,t){const n=this.#ot.getTargetOrientedPositiveXYZ({x:e.x*this.#Ct.x,y:e.y*this.#Ct.y,z:e.z*this.#Ct.z}),i={x:this.#yt.x*n.x,y:this.#yt.y*n.y};this.#or.scale(i),this.#Pt={x:t.x/this.#yt.x,y:t.y/this.#yt.y};const o=this.#or.offset();this.#or.offset({x:o.x+this.#Pt.x,y:o.y+this.#Pt.y})}setOffset(e){const t=this.#ot.getPlaneOffsetFromOffset3D(e),n=this.#or.offset();this.#or.offset({x:n.x-this.#wt.x+t.x,y:n.y-this.#wt.y+t.y}),this.#wt=t}setBaseOffset(e,t){const n=this.#ot.getNativeScrollDimIndex(),i=this.#ot.getPlaneOffsetFromOffset3D({x:0===n?e.getX():t.getX(),y:1===n?e.getY():t.getY(),z:2===n?e.getZ():t.getZ()}),o=this.#Tt.x!==i.x||this.#Tt.y!==i.y;if(o){const e=this.#or.offset();this.#or.offset({x:e.x-this.#Tt.x+i.x,y:e.y-this.#Tt.y+i.y}),this.#Tt=i}return o}display(e){this.#ct.style.display=e?"":"none"}isVisible(){return""===this.#ct.style.display}draw(){this.#or.draw()}initialise(e,t,n){this.#pt=e,this.#ft=t,this.#rr=n,this.#or=new Ui.default.Stage({container:this.#ct,width:this.#pt.x,height:this.#pt.y,listening:!1}),this.#or.getContent().setAttribute("style","");const i=new Ui.default.Layer({listening:!1,visible:!0});this.#or.add(i)}setAnnotationGroup(e,t,n){if(this.#bt=t,e.addEventListener("annotationadd",(e=>{this.#cr(e.data,!0),this.getKonvaLayer().draw()})),e.addEventListener("annotationupdate",(e=>{this.#ur(e.data),this.getKonvaLayer().draw()})),e.addEventListener("annotationremove",(e=>{this.#dr(e.data),this.getKonvaLayer().draw()})),e.addEventListener("annotationgroupeditablechange",(e=>{this.activateCurrentPositionShapes(e.data)})),this.#Ht=new Gi(e),0!==e.getLength())for(const t of e.getList())this.#cr(t,!1),n(new Ni(t,this.getDrawController()))}activateCurrentPositionShapes(e){const t=this.getKonvaLayer();if(this.#or.listening(!1),void 0!==this.#io){this.#io.disableAndResetEditor();const e=t.getChildren();for(const t of e)t instanceof Ui.default.Group&&t.getChildren().forEach((e=>{e instanceof Ui.default.Group&&this.#io.removeShapeListeners(e)}))}const n=this.getDrawController();if(e&&n.getAnnotationGroup().isEditable()){this.#or.listening(!0);const e=this.#hr().getChildren();0!==e.length&&t.listening(!0),void 0!==this.#io&&e.forEach((e=>{if(e instanceof Ui.default.Group){const t=n.getAnnotation(e.id());this.#io.addShapeGroupListeners(e,t,this)}}))}t.draw()}#gr(e){let t,n;return void 0!==e.planePoints?t=e.planePoints:void 0!==e.planeOrigin&&(t=[e.planeOrigin]),void 0!==t&&(n=this.#Sr(t,e.referencedFrameNumber)),n}#Sr(e,t){let n="";for(const t of e)0!==n.length&&(n+="-"),n+=de([le(t.getX(),2),le(t.getY(),2),le(t.getZ(),2)]);return void 0!==t&&(n+="-"+t),n}#mr(e){let t;const n=this.#gr(e),i=this.getKonvaLayer().getChildren(ji(n));if(0!==i.length){const n=i[0];if(!(n instanceof Ui.default.Group))return;const o=n.getChildren(ji(e.trackingUid));0!==o.length&&o[0]instanceof Ui.default.Group&&(t=o[0])}return t}#cr(e,t){if(!e.canView()||!e.isCompatibleView(this.#ot))return;const n=this.#gr(e);let i=this.getKonvaLayer().getChildren(ji(n))[0];if(void 0===i&&(i=new Ui.default.Group({id:n,name:"position-group",visible:t}),this.getKonvaLayer().add(i)),!(i instanceof Ui.default.Group))return;const o=new Ki,r=this.getKonvaStage();o.setZoomScale(r.scale());const a=e.getFactory();if(void 0===a)throw new Error("Cannot add an annotation draw without factory");const s=a.createShapeGroup(e,o);i.add(s),t&&void 0!==this.#io&&this.#io.addShapeGroupListeners(s,e,this),this.setLabelVisibility(s)}#dr(e){const t=this.#mr(e);return t instanceof Ui.default.Group?(t.remove(),!0):(h.debug("No shape group to remove"),!1)}#ur(e){this.#dr(e)&&this.#cr(e,!0)}fitToContainer(e,t,n){const i={x:t*this.#ft.x,y:t*this.#ft.y},o=i.x/this.#yt.x,r=i.y/this.#yt.y,a=e.x/(this.#or.width()*o),s=e.y/(this.#or.height()*r);this.#or.width()===e.x&&this.#or.height()===e.y||(this.#or.width(e.x),this.#or.height(e.y));const l={x:this.#or.scale().x*o,y:this.#or.scale().y*r};this.#or.scale().x===l.x&&this.#or.scale().y===l.y||(this.#yt=i,this.#or.scale(l),this.#lr(l));const c={x:n.x/i.x,y:n.y/i.y},u={x:e.x/i.x,y:e.y/i.y},d={x:0!==this.#Ot.x?u.x:0,y:0!==this.#Ot.y?u.y:0};if(this.#Lt.x!==c.x||this.#Lt.y!==c.y||this.#Ot.x!==d.x||this.#Ot.y!==d.y){const e={x:this.#Pt.x*a,y:this.#Pt.y*s};this.#or.offset({x:this.#or.offset().x+c.x-this.#Lt.x+d.x-this.#Ot.x+e.x-this.#Pt.x,y:this.#or.offset().y+c.y-this.#Lt.y+d.y-this.#Ot.y+e.y-this.#Pt.y}),this.#Ot=d,this.#Lt=c,this.#Pt=e}}isAnnotationVisible(e){const t=this.#pr(e);return void 0!==t&&t.isVisible()}setAnnotationVisibility(e,t){const n=this.#pr(e);return void 0!==n&&(void 0===t&&(t=!n.isVisible()),n.visible(t),this.draw(),!0)}setLabelsVisibility(e){this.#sr=e;const t=this.getKonvaLayer().getChildren();for(const n of t)if(n instanceof Ui.default.Group){const t=n.getChildren();for(const n of t)n instanceof Ui.default.Group&&this.#fr(n,e)}}#fr(e,t){const n=e.getChildren(Hi)[0];if(n instanceof Ui.default.Label&&(void 0===t&&(t=!n.isVisible()),void 0!==n.getText()&&0!==n.getText().text().length)){n.visible(t);const i=e.getChildren((e=>"Line"===e.className&&"connector"===e.name()))[0];i&&i.visible(t)}}setLabelVisibility(e){this.#fr(e,this.#sr)}deleteDraw(e,t){}deleteDraws(e){}getNumberOfDraws(){const e=this.getKonvaLayer().getChildren();let t=0;for(const n of e)n instanceof Ui.default.Group&&(t+=n.getChildren().length);return t}bindInteraction(){this.#or.listening(!0),this.#ct.style.pointerEvents="auto";const e=Ai;for(let t=0;t<e.length;++t)this.#ct.addEventListener(e[t],this.#B)}unbindInteraction(){this.#or.listening(!1),this.#ct.style.pointerEvents="none";const e=Ai;for(let t=0;t<e.length;++t)this.#ct.removeEventListener(e[t],this.#B)}setCurrentPosition(e,t){void 0===t&&(t=this.#ot.worldToIndex(e));const n=this.#ot.getPlanePoints(e);let i,o;i=this.#ot.isAquisitionOrientation()?[n[0]]:n,e.length()>3&&(o=e.get(3));const r=this.#Sr(i,o);return this.#Dr(r),this.#B({type:"positionchange",value:[t.getValues(),e.getValues()],valid:!0}),!0}#Dr(e){this.#ar=e;const t=this.getKonvaLayer().getChildren(Wi);let n;for(let i=0,o=t.length;i<o;++i)n=!1,void 0!==e&&t[i].id()===e&&(n=!0),t[i].visible(n);this.getKonvaLayer().draw()}#hr(){if(void 0===this.#ar)return;const e=this.getKonvaLayer().getChildren((e=>e.id()===this.#ar));let t;return 1===e.length?e[0]instanceof Ui.default.Group&&(t=e[0]):0===e.length?(t=new Ui.default.Group,t.name("position-group"),t.id(this.#ar),t.visible(!0),this.getKonvaLayer().add(t)):h.warn("Unexpected number of draw position groups"),t}#pr(e){return this.getKonvaLayer().findOne("#"+e)}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{e.srclayerid=this.getId(),e.dataid=this.#bt,this.#N.fireEvent(e)};#lr(e){const t=2/e.x,n=2/e.y,i=this.#or.find("Label");for(let e=0;e<i.length;++e)i[e].scale({x:t,y:n})}}function dr(e){const t=[0,0,0],n=e.split("#");for(const e of n){const n=e.split("-");t[n[0]]=n[1]}return t}function hr(e){const t=e.split("-layer-");return 2!==t.length&&h.warn("Not the expected layer div id format..."),{groupDivId:t[0],layerIndex:t[1],layerId:e}}function gr(e){let t=null;const n=e.target.closest(".layer");return n&&void 0!==n.id&&(t=hr(n.id)),t}function Sr(e,t,n,i){const o=(i.x-e.x)*t.x,r=(i.y-e.y)*t.y;return{x:i.x-o/n.x,y:i.y-r/n.y}}class mr{#ct;#vr=[];#vt={x:1,y:1,z:1};#Kt={x:1,y:1,z:1};#It={x:0,y:0,z:0};#yr=void 0;#N=new H;#Cr=!1;#Ir=[];#Tr;#M;#xt=!1;#rt;getPositionHelper(){if(void 0===this.#rt)for(const e of this.#vr)if(e instanceof Ei){const t=e.getViewController().getPositionHelperClone();void 0===this.#rt?this.#rt=t:this.#rt.merge(t)}return this.#rt}constructor(e){this.#ct=e}getShowCrosshair(){return this.#Cr}setShowCrosshair(e){this.#Cr=e,e?(this.addEventListener("offsetchange",this.#Lr),this.addEventListener("zoomchange",this.#Lr),this.#Pr()):(this.removeEventListener("offsetchange",this.#Lr),this.removeEventListener("zoomchange",this.#Lr),this.#wr())}setImageSmoothing(e){this.#xt=e;for(const t of this.#vr)t instanceof Ei&&t.setImageSmoothing(e)}#Lr=e=>{this.#Pr()};getDivId(){let e;return null!==this.#ct&&(e=this.#ct.id),e}getScale(){return this.#vt}getBaseScale(){return this.#Kt}getAddedScale(){return{x:this.#vt.x/this.#Kt.x,y:this.#vt.y/this.#Kt.y,z:this.#vt.z/this.#Kt.z}}getOffset(){return this.#It}getNumberOfLayers(){let e=0;return this.#vr.forEach((t=>{void 0!==t&&e++})),e}includes(e){if(void 0===e)return!1;for(const t of this.#vr)if(void 0!==t&&t.getId()===e)return!0;return!1}getViewLayers(e){void 0===e&&(e=function(){return!0});const t=[];for(const n of this.#vr)n instanceof Ei&&e(n)&&t.push(n);return t}getViewLayersFromActive(e){void 0===e&&(e=function(){return!0});let t=0;void 0!==this.#yr&&(t=this.#yr);const n=[];for(let e=t;e>=0;e--)n.push(e);for(let e=this.#vr.length-1;e>t;e--)n.push(e);const i=[];for(const t of n){const n=this.#vr[t];n instanceof Ei&&e(n)&&i.push(n)}return i}someViewLayer(e){let t=!1;for(const n of this.#vr)if(n instanceof Ei&&e(n)){t=!0;break}return t}getDrawLayers(e){void 0===e&&(e=function(){return!0});const t=[];for(const n of this.#vr)n instanceof ur&&e(n)&&t.push(n);return t}getNumberOfViewLayers(){let e=0;return this.#vr.forEach((t=>{void 0!==t&&t instanceof Ei&&e++})),e}getActiveLayer(){let e;return void 0!==this.#yr&&(e=this.#vr[this.#yr]),e}getActiveViewLayer(){let e;const t=this.getActiveLayer();return void 0!==t&&t instanceof Ei&&(e=t),e}getBaseViewLayer(){let e;for(const t of this.#vr)if(t instanceof Ei){e=t;break}if(void 0!==e)return e;h.warn("No layer found")}getViewLayerById(e){const t=this.getViewLayers((function(t){return t.getId()===e}));let n;return 1===t.length&&(n=t[0]),n}getViewLayersByDataId(e){return this.getViewLayers((function(t){return t.getDataId()===e}))}searchViewLayers(e){const t=structuredClone(e);let n;void 0!==t.SOPInstanceUID&&(n=t.SOPInstanceUID,delete t.SOPInstanceUID);const i=void 0!==n,o=0!==Object.keys(t).length,r=[];for(const e of this.#vr)if(e instanceof Ei){let a=!1;o&&(a=e.getViewController().equalImageMeta(t));let s=!1;i&&(s=e.getViewController().includesImageUid(n));let l=!1;o&&i?l=a&&s:o?l=a:i&&(l=s),l&&r.push(e)}return r}getViewDataIndices(){const e=[];for(const t of this.#vr)t instanceof Ei&&e.push(t.getDataId());return e}getActiveDrawLayer(){let e;const t=this.getActiveLayer();return void 0!==t&&t instanceof ur&&(e=t),e}getDrawLayerById(e){const t=this.getDrawLayers((function(t){return t.getId()===e}));let n;return 1===t.length&&(n=t[0]),n}getDrawLayersByDataId(e){return this.getDrawLayers((function(t){return t.getDataId()===e}))}setActiveLayer(e){this.#yr=e,this.#B({type:"activelayerchange",value:[this.#vr[e]]})}setActiveLayerById(e){let t;for(let n=0;n<this.#vr.length;++n)if(void 0!==this.#vr[n]&&this.#vr[n].getId()===e){t=n;break}void 0!==t?this.setActiveLayer(t):h.warn("No layer to set as active with id: "+e)}setActiveLayerByDataId(e){let t;for(let n=0;n<this.#vr.length;++n)if(void 0!==this.#vr[n]&&this.#vr[n].getDataId()===e){t=n;break}void 0!==t?this.setActiveLayer(t):h.warn("No layer to set as active with dataId: "+e)}addViewLayer(){const e=this.#vr.length,t=this.#Or();this.#ct.append(t);const n=new Ei(t);return n.setImageSmoothing(this.#xt),this.#vr.push(n),this.setActiveLayer(e),this.#Ar(n),this.#rt=void 0,n}addDrawLayer(){this.#yr=this.#vr.length;const e=this.#Or();this.#ct.append(e);const t=new ur(e);return this.#vr.push(t),this.#br(t),t}#Ar(e){e.addEventListener("positionchange",this.updateLayersToPositionChange);for(const t of W)e.addEventListener(t,this.#B);e.addEventListener("renderstart",this.#B),e.addEventListener("renderend",this.#B)}#xr(e){e.removeEventListener("positionchange",this.updateLayersToPositionChange);for(const t of W)e.removeEventListener(t,this.#B);e.removeEventListener("renderstart",this.#B),e.removeEventListener("renderend",this.#B),e.unbindImage()}#br(e){e.addEventListener("positionchange",this.updateLayersToPositionChange),e.addEventListener("positionchange",this.#B)}#Rr(e){e.removeEventListener("positionchange",this.updateLayersToPositionChange),e.removeEventListener("positionchange",this.#B)}#Or(){const e=document.createElement("div");return e.id=this.getDivId()+"-layer-"+this.#vr.length,e.className="layer",e.style.pointerEvents="none",e}empty(){for(const e of this.#vr)void 0!==e&&this.removeLayer(e);this.#vr=[],this.#wr()}removeLayersByDataId(e){for(const t of this.#vr)void 0!==t&&t.getDataId()===e&&this.removeLayer(t)}removeLayer(e){const t=this.#vr.findIndex((t=>t===e));if(-1===t)throw new Error("Cannot find layer to remove");this.#yr===t&&(this.#yr=void 0),e instanceof Ei?this.#xr(e):this.#Rr(e),this.#vr[t]=void 0,this.#rt=void 0,e.removeFromDOM(),this.#B({type:"layerremove",layerid:e.getId(),layergroupid:this.getDivId()})}#Pr(e){let t;void 0===e&&(e=this.#M),this.#wr();for(const e of this.#vr)if(e instanceof Ei){t=e;break}if(void 0===t)return void h.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.#ct.offsetWidth+"px",e.style.left="0px",e.style.top=i.getY()+"px",this.#Ir.push(e),this.#ct.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.#ct.offsetHeight+"px",e.style.left=i.getX()+"px",e.style.top="0px",this.#Ir.push(e),this.#ct.appendChild(e)}}#wr(){for(const e of this.#Ir)e.remove();this.#Ir=[]}showTooltip(e){this.removeTooltipDiv();const t=this.getBaseViewLayer(),n=t.getViewController(),i=t.displayToPlanePos(e),o=n.getPositionFromPlanePoint(i),r=n.getRescaledImageValue(o);if(void 0!==r){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=le(r,3).toString();void 0!==n.getPixelUnit()&&(i+=" "+n.getPixelUnit()),t.appendChild(document.createTextNode(i)),this.#Tr=t,this.#ct.appendChild(t)}}removeTooltipDiv(){void 0!==this.#Tr&&(this.#Tr.remove(),this.#Tr=void 0)}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.#vr)void 0!==e&&(e.removeEventListener("positionchange",this.updateLayersToPositionChange),e.removeEventListener("positionchange",this.#B));const t=new o(e.value[0]),n=new E(e.value[1]);this.#M=n,this.#Cr&&this.#Pr(n);const i={};let r,a;for(const o of this.#vr){if(void 0===o)continue;let s=!1;if(o instanceof Ei){const e=o.getViewController(),t=e.getOrigin(),l=e.getOrigin(n);let c,u;if(void 0===a)r=t,a=l,c=new x(0,0,0),u=new x(0,0,0);else if(e.isPositionInBounds(n)&&void 0!==l){const e=r.minus(t);c=new x(e.getX(),e.getY(),e.getZ());const n=a.minus(l);u=new x(n.getX(),n.getY(),n.getZ())}void 0!==c&&void 0!==u&&(s=o.setBaseOffset(c,u,a,r),i[o.getId()]={scroll:c,plane:u})}if(o instanceof ur){const e=i[o.getReferenceLayerId()];void 0!==e&&(s=o.setBaseOffset(e.scroll,e.plane))}let l=!1;o.getId()!==e.srclayerid&&(l=o.setCurrentPosition(n,t)),!l&&s&&o.draw()}for(const e of this.#vr)void 0!==e&&(e.addEventListener("positionchange",this.updateLayersToPositionChange),e.addEventListener("positionchange",this.#B))};getDivToWorldSizeRatio(){if(0===this.#ct.offsetWidth&&0===this.#ct.offsetHeight)throw new Error("Cannot fit to zero sized container with id '"+this.#ct.id+"'.");const e=this.getMaxWorldSize();if(void 0!==e){if(0===this.#ct.offsetHeight){const t=this.#ct.offsetWidth/e.x,n=e.y*t;this.#ct.style.height=n+"px"}return Math.min(this.#ct.offsetWidth/e.x,this.#ct.offsetHeight/e.y)}}fitToContainer(e){const t=this.getMaxWorldSize();if(void 0===t)return;const n={x:this.#ct.offsetWidth,y:this.#ct.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.#vr)void 0!==t&&t.fitToContainer(n,e,i);this.#Cr&&this.#Pr()}getMaxWorldSize(){let e={x:0,y:0};for(const t of this.#vr)if(t instanceof Ei){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.#Kt.z*=-1,this.setScale(this.#Kt)}addScale(e,t){const n={x:this.#vt.x*(1+e),y:this.#vt.y*(1+e),z:this.#vt.z*(1+e)};this.setScale(n,t)}setScale(e,t){this.#vt=e;for(const e of this.#vr)void 0!==e&&e.setScale(this.#vt,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.#B({type:"zoomchange",value:n})}addTranslation(e){this.setOffset({x:this.#It.x-e.x,y:this.#It.y-e.y,z:this.#It.z-e.z})}setOffset(e){this.#It=e;for(const e of this.#vr)void 0!==e&&e.setOffset(this.#It);this.#B({type:"offsetchange",value:[this.#It.x,this.#It.y,this.#It.z]})}reset(){this.setScale(this.#Kt),this.setOffset({x:0,y:0,z:0})}resetZoomPan(){this.setScale(this.#Kt),this.setOffset({x:0,y:0,z:0})}resetViews(){let e=!0;for(const t of this.#vr)if(void 0!==t&&t instanceof Ei){const n=t.getViewController();e&&(n.resetPosition(),e=!1),n.resetWindowLevel()}}draw(){for(const e of this.#vr)void 0!==e&&e.draw()}display(e){for(const t of this.#vr)void 0!==t&&t.display(e)}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B=e=>{this.#N.fireEvent(e)}}const pr={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 D(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.getBaseViewLayer().getViewController(),o=i.getCurrentPosition(),r=o.length(),a=n.length;a!==r&&(a===r-1?n.push(o.get(r-1)):a===r+1&&n.pop()),i.setCurrentPosition(new E(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 F(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),i=e.getBaseViewLayer();0!==n.length&&i!==n[0]&&(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 fr{#Fr=[];#Er;#xt=!1;#qr=[];#ao=null;getLayerGroup(e){return this.#Fr[e]}getNumberOfLayerGroups(){return this.#Fr.length}getActiveLayerGroup(){return this.getLayerGroup(this.#Er)}setActiveLayerGroup(e){void 0!==this.getLayerGroup(e)?this.#Er=e:h.warn("No layer group to set as active with index: "+e)}getViewLayersByDataId(e){let t=[];for(const n of this.#Fr)t=t.concat(n.getViewLayersByDataId(e));return t}getViewLayers(e){let t=[];for(const n of this.#Fr)t=t.concat(n.getViewLayers(e));return t}getDrawLayersByDataId(e){let t=[];for(const n of this.#Fr)t=t.concat(n.getDrawLayersByDataId(e));return t}getDrawLayers(e){let t=[];for(const n of this.#Fr)t=t.concat(n.getDrawLayers(e));return t}addLayerGroup(e){this.#Er=this.#Fr.length;const t=new mr(e);t.setImageSmoothing(this.#xt);const n=this.#ao&&0!==this.#ao.length;return n&&this.unbindLayerGroups(),this.#Fr.push(t),n&&this.bindLayerGroups(),t}getLayerGroupByDivId(e){return this.#Fr.find((function(t){return t.getDivId()===e}))}setBinders(e){if(null==e)throw new Error("Cannot set null or undefined binders");0!==this.#qr.length&&this.unbindLayerGroups(),this.#qr=e.slice(),this.bindLayerGroups()}empty(){this.unbindLayerGroups();for(const e of this.#Fr)e.empty();this.#Fr=[],this.#Er=void 0}removeLayersByDataId(e){for(const t of this.#Fr)t.removeLayersByDataId(e)}removeLayerGroup(e){const t=this.#Fr.findIndex((t=>t===e));if(-1===t)throw new Error("Cannot find layerGroup to remove");this.unbindLayerGroups(),e.empty(),this.#Fr.splice(t,1),this.#Er===t&&(this.#Er=void 0),this.bindLayerGroups()}reset(){for(const e of this.#Fr)e.reset()}resetZoomPan(){for(const e of this.#Fr)e.resetZoomPan()}resetViews(){for(const e of this.#Fr)e.resetViews()}draw(){for(const e of this.#Fr)e.draw()}fitToContainer(){let e;const t=[];for(let n=0;n<this.#Fr.length;++n){const i=this.#Fr[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.#Fr.length;++n)t.includes(n)&&this.#Fr[n].fitToContainer(e)}bindLayerGroups(){if(0!==this.#Fr.length&&1!==this.#Fr.length&&0!==this.#qr.length){this.#ao=new Array(this.#Fr.length);for(let e=0;e<this.#Fr.length;++e)for(let t=0;t<this.#qr.length;++t)this.#Ur(e,this.#qr[t])}}unbindLayerGroups(){if(0!==this.#Fr.length&&1!==this.#Fr.length&&0!==this.#qr.length&&this.#ao){for(let e=0;e<this.#Fr.length;++e)for(let t=0;t<this.#qr.length;++t)this.#Mr(e,this.#qr[t]);this.#ao=null}}setImageSmoothing(e){this.#xt=e;for(const t of this.#Fr)t.setImageSmoothing(e)}#Qr(e,t){void 0===this.#ao[t]&&(this.#ao[t]=[]);let n=this.#ao[t].find((function(t){return t.binder===e}));return void 0===n&&(n={binder:e,callback:n=>{this.#Mr(t,e),e.getCallback(this.#Fr[t])(n),this.#Ur(t,e)}},this.#ao[t].push(n)),n.callback}#Ur(e,t){for(let n=0;n<this.#Fr.length;++n)n!==e&&this.#Fr[e].addEventListener(t.getEventType(),this.#Qr(t,n))}#Mr(e,t){for(let n=0;n<this.#Fr.length;++n)n!==e&&this.#Fr[e].removeEventListener(t.getEventType(),this.#Qr(t,n))}}class Dr{#bt;constructor(e){this.#bt=e}fromJSON(e){const t=JSON.parse(e);let n=null;if("0.1"===t.version)n=this.#Nr(t);else if("0.2"===t.version)n=this.#Vr(t);else if("0.3"===t.version)n=this.#Br(t);else if("0.4"===t.version)n=this.#Gr(t);else{if("0.5"!==t.version)throw new Error("Unknown state file format version: '"+t.version+"'.");n=this.#kr(t)}return n}apply(e,t){const n=e.getActiveLayerGroup().getBaseViewLayer().getViewController(),i=new D(t["window-center"],t["window-width"]);n.setWindowLevel(i);const o=e.getActiveLayerGroup().getBaseScale();let r=null,a=null;if(void 0!==t.scaleCenter){r={x:t.scale*o.x,y:t.scale*o.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*r.x,s=n+t.translation.y*r.y;a={x:-i/r.x,y:-s/r.y,z:0}}else r={x:t.scale.x*o.x,y:t.scale.y*o.y,z:o.z},a={x:t.offset.x,y:t.offset.y,z:0};e.getActiveLayerGroup().setScale(r),e.getActiveLayerGroup().setOffset(a),e.setDrawings(t.drawings,t.drawingsDetails,this.#bt)}#Nr(e){const t=function(e){const t=[],n={};let i,o;for(let r=0,a=e.length;r<a;++r){t[r]=[];for(let a=0,s=e[r].length;a<s;++a){i=e[r][a];const s=[];for(let e=0,t=i.length;e<t;++e){o=Ui.default.Node.create(i[e]),o.visible(!0);let t={x:0,y:0};const r=o.getChildren((function(e){return"shape"===e.name()}))[0];if(r.stroke(w(r.stroke())),"line-group"===o.name()){o.name("ruler-group");const e=new Ui.default.Line({points:[r.points()[0],r.points()[1],r.points()[0],r.points()[1]],name:"shape-tick0"});o.add(e);const t=new Ui.default.Line({points:[r.points()[2],r.points()[3],r.points()[2],r.points()[3]],name:"shape-tick1"});o.add(t)}const a=o.getChildren((function(e){return"arc"===e.name()}));1===a.length&&a[0].name("shape-arc");const l=o.getChildren((function(e){return"text"===e.name()}));let c=new Ui.default.Text({name:"text",text:""});1===l.length?(t.x=l[0].x(),t.y=l[0].y(),l[0].remove(),c=l[0]):0!==r.points().length&&(t={x:r.points()[0],y:r.points()[1]});const u=new Ui.default.Label({x:t.x,y:t.y,name:"label"});u.add(c),u.add(new Ui.default.Tag),o.add(u),s.push(JSON.stringify(o.toObject()));let d=c.text();const h=d.length;let g=null;"ruler-group"===o.name()?(g={length:{value:parseFloat(d.substring(0,h-2)),unit:d.substring(-2)}},d="{length}"):"ellipse-group"===o.name()||"rectangle-group"===o.name()?(g={surface:{value:parseFloat(d.substring(0,h-3)),unit:d.substring(-3)}},d="{surface}"):"protractor-group"!==o.name()&&"rectangle-group"!==o.name()||(g={angle:{value:parseFloat(d.substring(0,h-1)),unit:d.substring(-1)}},d="{angle}"),n[o.id()]={textExpr:d,longText:"",quant:g}}t[r].push(s)}}return{drawings:t,drawingsDetails:n}}(e.drawings);return e.drawings=vr(t.drawings).toObject(),e.drawingsDetails=yr(t.drawingsDetails),(e=Cr(e)).drawings=Ir(e.drawings),e}#Vr(e){return e.drawings=vr(e.drawings).toObject(),e.drawingsDetails=yr(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,o=n[e].length;i<o;++i)for(let o=0,r=n[e][i].length;o<r;++o){const r=n[e][i][o];t[r.id]={textExpr:r.textExpr,longText:r.longText,quant:r.quant}}return t}(e.drawingsDetails)),(e=Cr(e)).drawings=Ir(e.drawings),e}#Br(e){return e.drawingsDetails=yr(e.drawingsDetails),(e=Cr(e)).drawings=Ir(e.drawings),e}#Gr(e){return(e=Cr(e)).drawings=Ir(e.drawings),e}#kr(e){return e}}function vr(e){let t,n,i;const r=new Ui.default.Layer({listening:!1,visible:!0}),a="string"==typeof e?JSON.parse(e):e;for(let e=0,l=a.length;e<l;++e)for(let l=0,c=a[e].length;l<c;++l)if(n=a[e][l],0!==n.length){i=new Ui.default.Group({id:(s=new o([1,1,e,l]),"slice-"+s.get(2)+"_frame-"+(4===s.length()?s.get(3):0)),name:"position-group",visible:!1});for(let e=0,o=n.length;e<o;++e)t=Ui.default.Node.create(n[e]),t.draggable(!0),t.getChildren().forEach((function(e){e.draggable(!1)})),i.add(t);r.add(i)}var s;return r}function yr(e){const t={},n=Object.keys(e);for(let i=0,o=n.length;i<o;++i){const o=e[n[i]];t[n[i]]={meta:{textExpr:o.textExpr,longText:o.longText,quantification:o.quant}}}return t}function Cr(e){const t=e.position;return e.position=[t.i,t.j,t.k],e}function Ir(e){const t=e.children;for(let e=0,n=t.length;e<n;++e){const n=t[e],i=n.attrs.id.split("_"),o=parseInt(i[0].substring(6),10),r=parseInt(i[1].substring(6),10);let a="#2-";a+=0===o&&0!==r?r:o,n.attrs.id=a}return e}function Tr(e){let t;return"null"!==window.location.origin&&(t=window.location.origin),new URL(e,t)}function Lr(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 o=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}(o)}return t}class Pr extends EventTarget{#Hr=[];#zr=0;getStackSize(){return this.#Hr.length}getCurrentStackIndex(){return this.#zr}getCurrentCommand(){return this.#Hr[this.#zr-1]}add(e){this.#Hr=this.#Hr.slice(0,this.#zr),this.#Hr.push(e),++this.#zr,this.dispatchEvent(new Event("undoadd"))}remove(e){let t=!1;const n=this.#Hr.findIndex((function(t){return t.getName()===e}));return-1!==n&&(t=!0,this.dispatchEvent(new CustomEvent("undoremove",{detail:{commandName:e}})),this.#Hr.splice(n,1),--this.#zr),t}undo(){this.#zr>0&&(this.dispatchEvent(new Event("undo")),--this.#zr,this.#Hr[this.#zr].undo())}redo(){this.#zr<this.#Hr.length&&(this.#Hr[this.#zr].execute(),++this.#zr,this.dispatchEvent(new Event("redo")))}}class wr{#Wr;#Yr=null;#ao=[];#Xr={};constructor(e){this.#Wr=e}init(){for(const e in this.#Wr)this.#Wr[e].init();this.enableShortcuts(!0)}enableShortcuts(e){e?window.addEventListener("keydown",this.#jr("window","keydown"),!0):window.removeEventListener("keydown",this.#jr("window","keydown"),!0)}getToolList(){return this.#Wr}hasTool(e){return void 0!==this.getToolList()[e]}getSelectedTool(){return this.#Yr}getSelectedToolEventHandler(e){return this.getSelectedTool()[e]}setSelectedTool(e){if(!this.hasTool(e))throw new Error("Unknown tool: '"+e+"'");this.#Yr&&this.#Yr.activate(!1),this.#Yr=this.#Wr[e],this.#Yr.activate(!0)}setToolFeatures(e){this.getSelectedTool()&&this.getSelectedTool().setFeatures(e)}bindLayerGroup(e,t){const n=e.getDivId();e.addEventListener("activelayerchange",this.#Zr(n)),this.#_r(n,t)}#_r(e,t){void 0!==this.#Xr[e]&&this.#Kr(this.#Xr[e]),this.#Xr[e]=t,this.#Jr(t)}#Zr(e){return t=>{const n=t.value[0];void 0!==n&&this.#_r(e,n)}}#Jr(e){e.bindInteraction();const t=Ai;for(let n=0;n<t.length;++n)e.addEventListener(t[n],this.#jr(e.getId(),t[n]))}#Kr(e){e.unbindInteraction();const t=Ai;for(let n=0;n<t.length;++n)e.removeEventListener(t[n],this.#jr(e.getId(),t[n]))}#jr(e,t){if(void 0===this.#ao[e]&&(this.#ao[e]=[]),void 0===this.#ao[e][t]){const n=e=>{if(this.#Yr){const t=this.#Yr[e.type];t&&t(e)}};this.#ao[e][t]=n}return this.#ao[e][t]}}class Or{#$r=[];#ea=2;#ta;constructor(e){this.#ta=e}setNumberOfDimensions(e){this.#ea=e}setNToLoad(e){for(let t=0;t<e;++t){this.#$r[t]=[];for(let e=0;e<this.#ea;++e)this.#$r[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.#$r[e.index][e.subindex]=t;let n=null;n=void 0!==e.item?e.item:{loaded:this.#na(e.index),total:100,source:e.source},this.#ta({lengthComputable:!0,loaded:this.#ia(),total:100,item:n})};#na(e){let t=0;for(let n=0;n<this.#ea;++n)t+=this.#$r[e][n];return t/this.#ea}#ia(){let e=0;const t=this.#$r.length;for(let n=0;n<t;++n)e+=this.#na(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 Ar{#oa=null;#ra=[];#aa=null;#sa=0;#la=0;#ca;#J;getDefaultCharacterSet(){return this.#J}setDefaultCharacterSet(e){this.#J=e}#ua(e){this.#oa=e,this.#sa=0,this.#la=0,this.#ca=!1,this.#da(),this.#ha()}#ga(e){this.#ra.push(e)}#da(){this.#ra=[]}#Sa(e){this.#aa=e}#ha(){this.#aa=null}#ma=e=>{this.#sa++,this.#sa===this.#oa.length&&this.onload({source:this.#oa})};#pa=e=>{this.#la++,this.#la===this.#oa.length&&this.onloadend({source:this.#oa})};#fa(e,t){return n=>{n.source=t,e(n)}}load(e,t){this.onloadstart({source:e}),1===e.length&&(oe(e[0],"DICOMDIR")||oe(e[0],".dcmdir"))?this.#Da(e[0],t):this.#va(e,t)}#ya(e,t,n){return i=>{const o=i.target.status;200!==o&&0!==o?(this.onerror({source:t,error:"GET "+i.target.responseURL+" "+i.target.status+" ("+i.target.statusText+")",target:i.target}),this.#pa()):e.load(i.target.response,t,n)}}#va(e,t){if(void 0===e||0===e.length)return;this.#ua(e);const n=new Or(this.onprogress);n.setNToLoad(e.length);const i=[];for(let e=0;e<$a.length;++e)i.push(new $a[e]);let o=e[0],r=null,a=!1;for(let s=0;s<i.length;++s)if(r=i[s],r.canLoadUrl(o,t)){a=!0,r.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),r.onprogress=n.getUndefinedMonoProgressHandler(1),r.onloaditem=this.onloaditem,r.onload=this.#ma,r.onloadend=this.#pa,r.onerror=this.onerror,r.onabort=this.onabort,this.#Sa(r);break}if(!a)throw new Error("No loader found for url: "+o);let s=0;const l=()=>{s<this.#ra.length-1&&!this.#ca&&(++s,this.#ra[s].send(null))};for(let i=0;i<e.length;++i){if(o=e[i],!r.canLoadUrl(o,t))throw new Error("Input url of different type: "+o);const a=new XMLHttpRequest;if(a.open("GET",o,!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.#fa(n.getMonoProgressHandler(i,0),o),a.onload=this.#ya(r,o,i),a.onloadend=l;const s=this.#fa(this.onerror,o);a.onerror=e=>{this.#pa(),s(e)};const c=this.#fa(this.ontimeout,o);a.ontimeout=e=>{this.#pa(),c(e)};const u=this.#fa(this.onabort,o);a.onabort=e=>{this.#pa(),u(e)},1===r.loadUrlAs()&&(a.responseType="arraybuffer"),this.#ga(a)}let c=this.#ra.length;void 0!==t&&void 0!==t.batchSize&&0!==c&&(c=Math.min(t.batchSize,this.#ra.length));for(let e=0;e<c;++e)this.#ca||(s=e,this.#ra[s].send(null))}#Da(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 gt;return t.parse(e),function(e){const t=e["00041220"];if(void 0===t||void 0===t.value)return void h.warn("No Directory Record Sequence found in DICOMDIR.");const n=t.value;if(0===n.length)return void h.warn("The Directory Record Sequence of the DICOMDIR is empty.");const i=[];let o=null,r=null;for(let e=0;e<n.length;++e){const t=n[e]["00041430"];if(void 0===t||void 0===t.value)continue;const a=t.value[0];if("STUDY"===a)r=[],i.push(r);else if("SERIES"===a)o=[],r.push(o);else if("IMAGE"===a){const t=n[e]["00041500"];if(void 0===t||void 0===t.value)continue;const i=t.value;o.push(i.join("/"))}}return i}(t.getDicomElements())}(n.target.response)[0][0],o=e.split("/").slice(0,-1).join("/"),r=[];for(let e=0;e<i.length;++e)r.push(o+"/"+i[e]);this.#va(r,t)}},n.onerror=t=>{this.#fa(this.onerror,e)(t),this.onloadend({})},n.onabort=t=>{this.#fa(this.onabort,e)(t),this.onloadend({})},n.send(null)}abort(){this.#ca=!0;for(let e=0;e<this.#ra.length;++e)4!==this.#ra[e].readyState&&this.#ra[e].abort();this.#aa&&this.#aa.isLoading()&&this.#aa.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}ontimeout(e){}onabort(e){}}class br extends Di{constructor(e,t){super(e,t)}getWorker(){return new Worker(new URL("./"+i.u(968),i.b),{name:"jpegbaseline.worker",type:"module"})}}class xr extends Di{constructor(e,t){super(e,t)}getWorker(){return new Worker(new URL("./"+i.u(112),i.b),{name:"jpegloss.worker",type:"module"})}}class Rr extends Di{constructor(e,t){super(e,t)}getWorker(){return new Worker(new URL("./"+i.u(557),i.b),{name:"jpeg2000.worker",type:"module"})}}class Fr extends Di{constructor(e,t){super(e,t)}getWorker(){return new Worker(new URL("./"+i.u(326),i.b),{name:"rle.worker",type:"module"})}}class Er{#Ca;#Ia;#Ta=!1;constructor(e){this.#Ca=e,this.#Ia=new pi(10)}decode(e,t,n){this.#Ta||(this.#Ta=!0,this.#Ia.onworkstart=this.ondecodestart,this.#Ia.onworkitem=this.ondecodeditem,this.#Ia.onwork=this.ondecoded,this.#Ia.onworkend=this.ondecodeend,this.#Ia.onerror=this.onerror,this.#Ia.onabort=this.onabort);const i={buffer:e,meta:t};let o;"jpeg-baseline"===this.#Ca?o=new br(i,n):"jpeg-lossless"===this.#Ca?o=new xr(i,n):"jpeg2000"===this.#Ca?o=new Rr(i,n):"rle"===this.#Ca&&(o=new Fr(i,n)),void 0!==o&&this.#Ia.addWorkerTask(o)}abort(){this.#Ia.abort()}ondecodestart(e){}ondecodeditem(e){}ondecoded(e){}ondecodeend(e){}onerror(e){}onabort(e){}}const qr="0040A30A",Ur="0040A161",Mr="0040A162",Qr="0040A163",Nr="004008EA";class Vr{numericValue;floatingPointValue;rationalNumeratorValue;rationalDenominatorValue;measurementUnitsCode;toString(){return this.numericValue+" "+this.measurementUnitsCode.toString()}}function Br(e){const t={};return void 0!==e.measurementUnitsCode&&(t.MeasurementUnitsCodeSequence={value:[cn(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 Gr="0040A300",kr="0040A301";class Hr{measuredValue;numericValueQualifierCode;toString(){let e="";return void 0!==this.measuredValue&&(e+=this.measuredValue.toString()),void 0!==this.numericValueQualifierCode&&(e+=" "+this.numericValueQualifierCode.toString()),e}}function zr(e){const t={};return void 0!==e.measuredValue&&(t.MeasuredValueSequence={value:[Br(e.measuredValue)]}),void 0!==e.numericValueQualifierCode&&(t.NumericValueQualifierCodeSequence={value:[cn(e.numericValueQualifierCode)]}),t}const Wr="00081150",Yr="00081155";class Xr{referencedSOPClassUID;referencedSOPInstanceUID;toString(){return this.referencedSOPInstanceUID+" (class: "+this.referencedSOPClassUID+")"}}function jr(e){const t=new Xr;return void 0!==e[Wr]&&(t.referencedSOPClassUID=e[Wr].value[0]),void 0!==e[Yr]&&(t.referencedSOPInstanceUID=e[Yr].value[0]),t}function Zr(e){const t={};return void 0!==e.referencedSOPClassUID&&(t.ReferencedSOPClassUID=e.referencedSOPClassUID),void 0!==e.referencedSOPInstanceUID&&(t.ReferencedSOPInstanceUID=e.referencedSOPInstanceUID),t}const _r="00081160",Kr="00081199",Jr="0062000B";class $r{referencedSOPSequence;referencedFrameNumber;referencedSegmentNumber;toString(){let e=this.referencedSOPSequence.toString();return void 0!==this.referencedFrameNumber&&(e+=", frame: "+this.referencedFrameNumber),e}}function ea(e){const t={};return void 0!==e.referencedFrameNumber&&(t.ReferencedFrameNumber=e.referencedFrameNumber),void 0!==e.referencedSOPSequence&&(t.ReferencedSOPSequence={value:[Zr(e.referencedSOPSequence)]}),void 0!==e.referencedSegmentNumber&&(t.ReferencedSegmentNumber=e.referencedSegmentNumber),t}const ta="00480301",na="00700022",ia="00700023",oa="0070031A",ra="POINT",aa="MULTIPOINT",sa="POLYLINE",la="CIRCLE",ca="ELLIPSE";class ua{graphicData;graphicType;pixelOriginInterpretation;fiducialUID;toString(){return this.graphicType+" {"+this.graphicData+"}"}}function da(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 ha(e){const t=new ua;if(e instanceof R)t.graphicData=[e.getX().toString(),e.getY().toString()],t.graphicType=ra;else if(e instanceof Ji)t.graphicData=[e.getBegin().getX().toString(),e.getBegin().getY().toString(),e.getEnd().getX().toString(),e.getEnd().getY().toString()],t.graphicType=sa;else if(e instanceof so){t.graphicData=[];for(let n=0;n<3;++n)t.graphicData.push(e.getPoint(n).getX().toString()),t.graphicData.push(e.getPoint(n).getY().toString());t.graphicType=sa}else if(e instanceof ao){t.graphicData=[];for(let n=0;n<e.getLength();++n)t.graphicData.push(e.getPoint(n).getX().toString()),t.graphicData.push(e.getPoint(n).getY().toString());const n=e.getPoint(0);t.graphicData.push(n.getX().toString()),t.graphicData.push(n.getY().toString()),t.graphicType=sa}else if(e instanceof uo){const n=e.getCenter(),i=new R(n.getX()+e.getRadius(),n.getY());t.graphicData=[n.getX().toString(),n.getY().toString(),i.getX().toString(),i.getY().toString()],t.graphicType=la}else if(e instanceof lo){const n=e.getCenter(),i=e.getA(),o=e.getB();t.graphicData=[(n.getX()-i).toString(),n.getY().toString(),(n.getX()+i).toString(),n.getY().toString(),n.getX().toString(),(n.getY()-o).toString(),n.getX().toString(),(n.getY()+o).toString()],t.graphicType=ca}else if(e instanceof oo){const n=e.getBegin(),i=e.getEnd();t.graphicData=[n.getX().toString(),n.getY().toString(),n.getX().toString(),i.getY().toString(),i.getX().toString(),i.getY().toString(),i.getX().toString(),n.getY().toString(),n.getX().toString(),n.getY().toString()],t.graphicType=sa}return t}function ga(e){if(void 0===e.graphicData)return;const t=e.graphicData.length;if(0===t)throw new Error("No coordinates in scoord data");if(t%2!=0)throw new Error("Expecting even number of coordinates in scoord data");const n=[];for(let i=0;i<t;i+=2)n.push(new R(parseFloat(e.graphicData[i]),parseFloat(e.graphicData[i+1])));let i=!1;const o=n.length;if(o>2){const e=n[0],t=n[o-1];i=e.equals(t)}let r;if(e.graphicType===ra)n.length>1&&h.warn("Expecting 1 point for point, got "+o),r=n[0];else if(e.graphicType===la){if(n.length<2)throw new Error("Expecting 2 points for circles, got "+o);n.length>2&&h.warn("Expecting 2 points for circles, got "+o);const e=n[0],t=n[1].getDistance(e);r=new uo(e,t)}else if(e.graphicType===ca){if(n.length<4)throw new Error("Expecting 4 points for ellipses, got "+o);n.length>4&&h.warn("Expecting 4 points for ellipses, got "+o);const e=n[0].getDistance(n[1])/2,t=n[2].getDistance(n[3])/2,i=new R(n[0].getX()+e,n[0].getY());r=new lo(i,e,t)}else if(e.graphicType===sa)if(i)if(5===n.length){const e=new Ji(n[0],n[1]),t=new Ji(n[1],n[2]),i=new Ji(n[2],n[3]),o=new Ji(n[3],n[4]);r=eo(e,t)&&eo(t,i)&&eo(i,o)?new oo(n[0],n[2]):new ao(n.slice(0,-1))}else r=new ao(n.slice(0,-1));else 2===n.length?r=new Ji(n[0],n[1]):3===n.length&&(r=new so([n[0],n[1],n[2]]));return r}const Sa="00700022",ma="00700023",pa="30060024",fa="0070031A";class Da{graphicData;graphicType;referencedFrameofReferenceUID;fiducialUID;toString(){return this.graphicType+" {"+this.graphicData+"}"}}function va(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 ya={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",ContentTemplateSequence:"0040A504",MappingResource:"00080105",TemplateIdentifier:"0040DB00"},Ca="CONTAINS",Ia="HAS PROPERTIES",Ta="HAS OBS CONTEXT",La="INFERRED FROM",Pa="SELECTED FROM",wa="HAS CONCEPT MOD",Oa="TEXT",Aa="NUM",ba="CODE",xa="UIDREF",Ra="COMPOSITE",Fa="IMAGE",Ea="SCOORD",qa="SCOORD3D",Ua="CONTAINER",Ma="SEPARATE",Qa={TEXT:"TextValue",DATE:"Date",TIME:"Time",DATETIME:"DateTime",UIDREF:"UID",PNAME:"PersonName",CONTAINER:"ContinuityOfContent"};function Na(e){let t;const n=We(e,ya.ContentTemplateSequence);if(void 0!==n){const e=We(n,ya.MappingResource),i=We(n,ya.TemplateIdentifier);void 0!==e&&void 0!==i&&(t=e+"-"+i)}return t}class Va{valueType;conceptNameCode;relationshipType;contentSequence=[];value;constructor(e){this.valueType=e}toString(e){void 0===e&&(e="");let t="";void 0!==this.relationshipType&&(t+="("+this.relationshipType+") "),t+=this.valueType+": ",void 0!==this.conceptNameCode&&(t+=this.conceptNameCode.toString()),t+=" = "+this.value.toString();for(const n of this.contentSequence)t+="\n"+e+"- "+n.toString(e+" ");return t}hasHeader(e,t,n){return this.valueType===e&&sn(this.conceptNameCode,t)&&this.relationshipType===n}}function Ba(e){let t=We(e,ya.ValueType);void 0===t&&(t="");const n=new Va(t);n.relationshipType=We(e,ya.RelationshipType);const i=We(e,ya.ConceptNameCodeSequence);if(void 0!==i&&(n.conceptNameCode=ln(i)),t===ba)n.value=ln(We(e,ya.ConceptCodeSequence));else if(t===Aa)n.value=function(e){const t=new Hr;return void 0!==e[Gr]&&(t.measuredValue=function(e){const t=new Vr;return void 0!==e[qr]&&(t.numericValue=parseFloat(e[qr].value[0])),void 0!==e[Ur]&&(t.floatingPointValue=parseFloat(e[Ur].value[0])),void 0!==e[Mr]&&(t.rationalNumeratorValue=parseInt(e[Mr].value[0],10)),void 0!==e[Qr]&&(t.rationalDenominatorValue=parseInt(e[Qr].value[0],10)),void 0!==e[Nr]&&(t.measurementUnitsCode=ln(e[Nr].value[0])),t}(e[Gr].value[0])),void 0!==e[kr]&&(t.numericValueQualifierCode=ln(e[kr].value[0])),t}(e);else if(t===Fa)n.value=function(e){const t=new $r;return void 0!==e[_r]&&(t.referencedFrameNumber=e[_r].value[0]),void 0!==e[Kr]&&(t.referencedSOPSequence=jr(e[Kr].value[0])),void 0!==e[Jr]&&(t.referencedSegmentNumber=e[Jr].value[0]),t}(e);else if(t===Ra)n.value=jr(We(e,ya.ReferencedSOPSequence));else if(t===Ea)n.value=function(e){const t=new ua;return void 0!==e[na]&&(t.graphicData=e[na].value),void 0!==e[ia]&&(t.graphicType=e[ia].value[0]),void 0!==e[ta]&&(t.pixelOriginInterpretation=e[ta].value[0]),void 0!==e[oa]&&(t.fiducialUID=e[oa].value[0]),t}(e);else if(t===qa)n.value=function(e){const t=new Da;return void 0!==e[Sa]&&(t.graphicData=e[Sa].value),void 0!==e[ma]&&(t.graphicType=e[ma].value[0]),void 0!==e[pa]&&(t.referencedFrameofReferenceUID=e[pa].value[0]),void 0!==e[fa]&&(t.fiducialUID=e[fa].value[0]),t}(e);else{const i=Qa[t];void 0!==i?n.value=We(e,ya[i]):console.warn("Unsupported input ValueType: "+t)}const o=Ye(e,ya.ContentSequence);if(void 0!==o)for(const e of o)n.contentSequence.push(Ba(e));return n}function Ga(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:[cn(e.conceptNameCode)]}),"CODE"===e.valueType)t.ConceptCodeSequence={value:[cn(e.value)]};else if(e.valueType===Aa)t={...t,...zr(e.value)};else if(e.valueType===Fa)t={...t,...ea(e.value)};else if(e.valueType===Ra)t={...t,...Zr(e.value)};else if(e.valueType===Ea)t={...t,...da(e.value)};else if(e.valueType===qa)t={...t,...va(e.value)};else{const n=Qa[e.valueType];void 0!==n?t[n]=e.value:console.warn("Unsupported output ValueType: "+e.valueType)}if(0!==e.contentSequence.length){t.ContentSequence={value:[]};for(const n of e.contentSequence)t.ContentSequence.value.push(Ga(n))}return t}function ka(e,t,n,i){const o=function(e){const t=Bn[e];let n;return void 0!==t&&(n=Qn(t.key,t.scheme)),n}(e);if(void 0===o)return;let r=Ca;void 0!==i&&(r=i);const a=new Va(Aa);a.relationshipType=r,a.conceptNameCode=o;const s=new Vr;s.numericValue=t,s.measurementUnitsCode=kn(n);const l=new Hr;return l.measuredValue=s,a.value=l,a}function Ha(e,t){const n=Object.keys(t);for(const i of n)void 0!==e[i]&&h.debug("Overwritting tag: "+i),e[i]=t[i]}class za{current;measure}class Wa{annotationGroups;responseEvaluations;comment}class Ya{#pe;getWarning(){return this.#pe}#La(e){const t=function(e){let t;return e.startsWith("1.2.826.0.1.3680043.9.7278.1")&&(t=e.substring(29).replace(".99","-beta")),t}(We(e,"00020012")),n=void 0!==t&&function(e){const t=Je(e,"0.34.0"),n=Je(e,"0.35.0-beta.21");return t>=0&&n<=0}(t),i=Na(e);let o;const r=Ba(e);return void 0!==r.conceptNameCode&&(o=r.conceptNameCode.value),n&&void 0===i&&o===bn.value}#Pa(e){const t="DCMR-1500"===Na(e);let n;const i=Ba(e);void 0!==i.conceptNameCode&&(n=i.conceptNameCode.value);let o=!1;if(t&&n===Rn.value){const e=i.contentSequence.find(this.#wa);if(void 0!==e){const t=e.contentSequence.find(this.#Oa);if(void 0!==t){const e=t.contentSequence.find(this.#Aa),n=t.contentSequence.find(this.#ba);void 0===e&&void 0===n||(o=!0)}}}return o}#xa(e){return"DCMR-4100"===Na(e)}checkElements(e){return this.#pe=void 0,this.#La(e)||this.#Pa(e)||this.#xa(e)||(this.#pe="Not a dwv supported annotation"),this.#pe}#Ra(e,t){t.valueType===Fa&&t.relationshipType===Pa&&(e.referencedSopClassUID=t.value.referencedSOPSequence.referencedSOPClassUID,e.referencedSopInstanceUID=t.value.referencedSOPSequence.referencedSOPInstanceUID,void 0!==t.value.referencedFrameNumber&&(e.referencedFrameNumber=parseInt(t.value.referencedFrameNumber,10)))}#Fa(e,t){t.hasHeader(xa,Mn(vn),Ia)&&(e.trackingId=t.value,e.trackingUid=t.value)}#Ea(e,t){t.hasHeader(Oa,Mn(vn),Ta)&&(e.trackingId=t.value),t.hasHeader(xa,Mn(Cn),Ta)&&(e.trackingUid=t.value)}#qa(e,t,n){void 0===n&&(n=!1);let i=wa;if(n&&(i=Ia),t.hasHeader(Oa,Mn(xn),i)){e.textExpr=t.value;const n=t.contentSequence.find((function(e){return e.hasHeader(Ea,Mn(An),Ia)}));void 0!==n&&(e.labelPosition=new R(n.value.graphicData[0],n.value.graphicData[1]))}if(t.hasHeader(Oa,Vn(),i)&&(e.colour=t.value),t.hasHeader(Ea,Mn(An),i)&&t.value.graphicType===aa){const n=[];for(let e=0;e<t.value.graphicData.length;e+=2)n.push(new R(t.value.graphicData[e],t.value.graphicData[e+1]));e.referencePoints=n}if(t.hasHeader(qa,Mn(En),Ca)&&t.value.graphicType===aa){const n=t.value.graphicData,i=[],o=Math.floor(n.length/3);for(let e=0;e<o;++e){const t=3*e;i.push(new F(n[t],n[t+1],n[t+2]))}e.planePoints=i}this.#Ua(e,t),this.#Ma(e,t)}#Ua(e,t,n){let i;if(void 0===n&&(i=Ca),t.valueType===Aa&&t.relationshipType===i){const n=function(e){let t;for(const n in Bn){const i=Bn[n];if(i.scheme===e.schemeDesignator&&i.key===e.value){t=n;break}}return t}(t.conceptNameCode);if(void 0!==n){const i=t.value.measuredValue,o=function(e){let t;for(const n in Gn){const i=Gn[n];if("UCUM"===e.schemeDesignator&&i===e.value){t=n;break}}return t}(i.measurementUnitsCode);void 0===e.quantification&&(e.quantification={}),e.quantification[n]={value:i.numericValue,unit:o}}}}#Ma(e,t){t.valueType!==ba&&t.valueType!==Oa||t.relationshipType!==Ca||e.addMetaItem(t.conceptNameCode,t.value)}#wa(e){return e.hasHeader(Ua,Mn(Fn),Ca)}#Oa(e){return e.hasHeader(Ua,Mn(bn),Ca)}#Qa(e){return e.hasHeader(ba,Mn(hn),La)}#Na(e){return e.hasHeader(Ua,Mn(pn),Ia)}#Va(e){return e.hasHeader(Oa,Mn(Pn),Ca)}#Ba(e){return e.hasHeader(ba,Mn(In),Ca)}#Ga(e){return e.hasHeader(Aa,Mn(yn),Ca)}#ka(e){return e.hasHeader(ba,Mn(un),Ca)}#Aa(e){return e.hasHeader(Ea,Mn(dn),Ca)}#Ha(e){return void 0!==e.contentSequence.find(this.#Aa)}#za(e){let t;const n=e.contentSequence.find(this.#Aa);if(void 0!==n){t=new cr,t.mathShape=ga(n.value);const i=n.contentSequence.find((function(e){return e.valueType===Fa&&e.relationshipType===Pa}));void 0!==i&&this.#Ra(t,i);for(const n of e.contentSequence)this.#Ea(t,n),this.#qa(t,n)}return t}#ba(e){let t;return e.valueType===Aa&&e.relationshipType===Ca&&(t=e.contentSequence.find((function(e){return e.valueType===Ea&&e.relationshipType===La}))),void 0!==t}#Wa(e){let t;return e.valueType===Aa&&e.relationshipType===Ia&&(t=e.contentSequence.find((function(e){return e.valueType===Ea&&e.relationshipType===La}))),void 0!==t}#Ya(e){return void 0!==e.contentSequence.find(this.#ba)}#Xa(e){let t;const n=e.contentSequence.find(this.#ba);if(void 0!==n){t=new cr;const e=n.contentSequence.find((function(e){return e.valueType===Ea&&e.relationshipType===La}));t.mathShape=ga(e.value),t.mathShape instanceof R&&e.value.graphicData.length>=4&&(t.referencePoints=[new R(e.value.graphicData[2],e.value.graphicData[3])]);const i=e.contentSequence.find((function(e){return e.valueType===Fa&&e.relationshipType===Pa}));void 0!==i&&this.#Ra(t,i)}if(void 0!==t)for(const i of e.contentSequence)this.#Ea(t,i),this.#Ua(t,n),this.#Ma(t,i);return t}#ja(e){let t;const n=e.contentSequence.find(this.#Wa);if(void 0!==n){t=new cr;const e=n.contentSequence.find((function(e){return e.valueType===Ea&&e.relationshipType===La}));t.mathShape=ga(e.value),t.mathShape instanceof R&&e.value.graphicData.length>=4&&(t.referencePoints=[new R(e.value.graphicData[2],e.value.graphicData[3])]);const i=e.contentSequence.find((function(e){return e.valueType===Fa&&e.relationshipType===Pa}));void 0!==i&&this.#Ra(t,i)}if(void 0!==t)for(const i of e.contentSequence)this.#Ea(t,i),this.#Ua(t,n,Ia),this.#Ma(t,i);return t}#Za(e){if(0===e.contentSequence.length)return;const t=e.contentSequence[0];let n=!1,i=!1;this.#Oa(t)&&(n=this.#Ha(t),i=this.#Ya(t));const o=[];let r,a=!1;for(const t of e.contentSequence)if(this.#Oa(t)){let e;a=!0,n?e=this.#za(t):i&&(e=this.#Xa(t)),void 0!==e&&o.push(e)}return a?0!==o.length?r=new qi(o):h.warn("No valid measurement groups in TID 1500 SR"):h.warn("No measurement groups in TID 1500 SR"),r}#_a(e){const t=[];let n=!1;for(const i of e.contentSequence)if(this.#Qa(i)){n=!0;const e=this.#ja(i);void 0!==e&&t.push(e)}const i=[];return n?0!==t.length?i.push(new qi(t)):h.warn("No valid measurement groups in TID 4100 SR"):h.warn("No image findings in TID 4100 SR"),i}#Ka(e){const t=new cr;t.mathShape=ga(e.value);for(const n of e.contentSequence)this.#Ra(t,n),this.#Fa(t,n),this.#qa(t,n,!0);return t}#Ja(e){let t;e.valueType===Ua&&sn(e.conceptNameCode,Mn(Rn))||h.warn("Not the expected TID 1500 SR content header");const n=e.contentSequence.find(this.#wa);return void 0!==n?t=this.#Za(n):h.warn("No imaging measurements in TID 1500 SR"),t}#$a(e){return e.valueType===Ua&&sn(e.conceptNameCode,Mn(mn))||h.warn("Not the expected TID 4100 SR content header"),e.contentSequence.find(this.#ka)}#es(e){e.valueType===Ua&&sn(e.conceptNameCode,Mn(bn))||console.warn("Not the expected dwv034 content header");const t=[];for(const n of e.contentSequence)n.valueType===Ea&&t.push(this.#Ka(n));return new qi(t)}#ts(e,t){const n=function(e){return We(t,e)};e.setMetaValue("StudyInstanceUID",n("0020000D")),e.setMetaValue("StudyID",n("00200010")),e.setMetaValue("SeriesInstanceUID",n("0020000E")),e.setMetaValue("SeriesNumber",n("00200011")),e.setMetaValue("Modality",n("00080060")),e.setMetaValue("PatientName",n("00100010")),e.setMetaValue("PatientID",n("00100020")),e.setMetaValue("PatientBirthDate",n("00100030")),e.setMetaValue("PatientSex",n("00100040"));const i="0040A375",o=t[i];if(void 0!==o){const t=ke({[i]:o});e.setMetaValue("CurrentRequestedProcedureEvidenceSequence",t.CurrentRequestedProcedureEvidenceSequence)}}create(e){const t=Ba(e);let n,i;if(this.#Pa(e)?(i="TID 1500 SR",n=this.#Ja(t)):this.#La(e)&&(h.warn("DWV v0.34 annotation"),i="DWV v0.34 SR",n=this.#es(t)),this.#xa(e)){i="TID 4100 SR";const t=this.createCADReport(e);void 0!==t&&(n=t.annotationGroups[0])}if(void 0===n)throw new Error("Cannot create annotation group from "+i);return this.#ts(n,e),n}createCADReport(e){const t=Ba(e),n=this.#$a(t);if(void 0===n)return void h.warn("No CAD processing and Findings Summary in TID 4100 SR");let i=[];if(this.#xa(e)&&(i=this.#_a(n)),void 0===i)throw new Error("Cannot create annotation groups from TID 4100 SR");for(const t of i)this.#ts(t,e);const o=[];let r;for(const e of n.contentSequence)if(this.#Na(e)){const t=this.#ns(e);void 0!==t&&o.push(t)}else this.#Va(e)&&(r=e.value);const a=new Wa;return a.annotationGroups=i,a.responseEvaluations=o,a.comment=r,a}#is(e){const t=new Va(Fa);t.relationshipType=Pa,t.conceptNameCode=Mn(On);const n=new Xr;n.referencedSOPClassUID=e.referencedSopClassUID,n.referencedSOPInstanceUID=e.referencedSopInstanceUID;const i=new $r;return i.referencedSOPSequence=n,void 0!==e.referencedFrameNumber&&(i.referencedFrameNumber=e.referencedFrameNumber.toString()),t.value=i,t}#os(e){const t=[],n=new Va(Oa);n.relationshipType=Ta,n.conceptNameCode=Mn(vn),n.value=e.trackingId,t.push(n);const i=new Va(xa);if(i.relationshipType=Ta,i.conceptNameCode=Mn(Cn),i.value=e.trackingUid,t.push(i),void 0!==e.textExpr&&0!==e.textExpr.length){const n=new Va(Oa);if(n.relationshipType=wa,n.conceptNameCode=Mn(xn),n.value=e.textExpr,void 0!==e.labelPosition){const t=new Va(Ea);t.relationshipType=Ia,t.conceptNameCode=Mn(An);const i=new ua;i.graphicType=ra;const o=[e.labelPosition.getX().toString(),e.labelPosition.getY().toString()];i.graphicData=o,t.value=i;const r=this.#is(e);t.contentSequence=[r],n.contentSequence=[t]}t.push(n)}const o=new Va(Oa);if(o.relationshipType=wa,o.conceptNameCode=Vn(),o.value=e.colour,t.push(o),void 0!==e.referencePoints){const n=new Va(Ea);n.relationshipType=wa,n.conceptNameCode=Mn(An);const i=new ua;i.graphicType=aa;const o=[];for(const t of e.referencePoints)o.push(t.getX().toString()),o.push(t.getY().toString());i.graphicData=o,n.value=i;const r=this.#is(e);n.contentSequence=[r],t.push(n)}if(void 0!==e.planePoints){const n=new Va(qa);n.relationshipType=Ca,n.conceptNameCode=Mn(En);const i=new Da;i.graphicType=aa;const o=[];for(const t of e.planePoints)o.push(t.getX().toString()),o.push(t.getY().toString()),o.push(t.getZ().toString());i.graphicData=o,n.value=i;const r=this.#is(e);n.contentSequence=[r],t.push(n)}if(void 0!==e.quantification)for(const n in e.quantification){const i=ka(n,le(e.quantification[n].value,12),e.quantification[n].unit);void 0!==i&&t.push(i)}const r=e.getMetaConceptIds();for(const n of r){const i=e.getMetaItem(n);let o=Oa;i.value instanceof an&&(o=ba);const r=new Va(o);r.relationshipType=Ca,r.conceptNameCode=i.concept,r.value=i.value,t.push(r)}return t}#rs(e){const t=new Va(Ua);t.relationshipType=Ca,t.conceptNameCode=Mn(bn),t.value=Ma;const n=new Va(Ea);n.relationshipType=Ca,n.conceptNameCode=Mn(dn),n.value=ha(e.mathShape);const i=this.#is(e);return n.contentSequence=[i],t.contentSequence=[n].concat(this.#os(e)),t}#as(e){let t;if(0!==e.getList().length){const n=new Va(Ua);n.conceptNameCode=Mn(Fn),n.relationshipType=Ca,n.value=Ma;const i=[];for(const t of e.getList())i.push(this.#rs(t));n.contentSequence=i,t=new Va(Ua),t.conceptNameCode=Mn(Rn),t.value=Ma,t.contentSequence=[n]}return t}toDicom(e,t){let n=e.getMeta();n.TransferSyntaxUID="1.2.840.10008.1.2.1",n.SOPClassUID="1.2.840.10008.5.1.4.1.1.88.34",n.MediaStorageSOPClassUID="1.2.840.10008.5.1.4.1.1.88.34",n.CompletionFlag="PARTIAL",n.VerificationFlag="UNVERIFIED";const i=new Date;n.ContentDate=Ft(xt(i)),n.ContentTime=Et(Rt(i));const o=n.CurrentRequestedProcedureEvidenceSequence.value[0].ReferencedSeriesSequence.value[0];let r=o.ReferencedSOPSequence;void 0===r&&(o.ReferencedSOPSequence={value:[]},r=o.ReferencedSOPSequence);const a=r.value;for(const t of e.getList()){const e={ReferencedSOPInstanceUID:t.referencedSopInstanceUID,ReferencedSOPClassUID:t.referencedSopClassUID},n=function(t){return t.ReferencedSOPInstanceUID===e.ReferencedSOPInstanceUID&&t.ReferencedSOPClassUID===e.ReferencedSOPClassUID};void 0===a.find(n)&&a.push(e)}n.ContentTemplateSequence={value:[{MappingResource:"DCMR",TemplateIdentifier:"1500"}]};const s=this.#as(e);if(void 0===s)throw new Error("No annotation group SR content");return n={...n,...Ga(s)},void 0!==t&&Ha(n,t),en(n)}#ss(e){const t=new Va(ba);t.relationshipType=La,t.conceptNameCode=Mn(hn),t.value=Mn(gn),t.contentSequence=[];const n=new Va(Oa);n.relationshipType=Ta,n.conceptNameCode=Mn(vn),n.value=e.trackingId,t.contentSequence.push(n);const i=new Va(xa);if(i.relationshipType=Ta,i.conceptNameCode=Mn(Cn),i.value=e.trackingUid,t.contentSequence.push(i),void 0!==e.quantification)for(const n in e.quantification){const i=ka(n,le(e.quantification[n].value,12),e.quantification[n].unit,Ia);if(void 0!==i){const n=new Va(Ea);n.relationshipType=La,n.conceptNameCode=Mn(Ln),n.value=ha(e.mathShape);const o=this.#is(e);n.contentSequence=[o],i.contentSequence=[n],t.contentSequence.push(i)}}const o=e.getMetaConceptIds();for(const n of o){const i=e.getMetaItem(n);let o=Oa;i.value instanceof an&&(o=ba);const r=new Va(o);r.relationshipType=Ca,r.conceptNameCode=i.concept,r.value=i.value,t.contentSequence.push(r)}return t}#ls(e,t){if(0!==e.getList().length)for(const n of e.getList())t.push(this.#ss(n))}#cs(e){const t=new Va(Ua);t.relationshipType=Ia,t.conceptNameCode=Mn(pn),t.value=Ma,t.contentSequence=[];const n=new Va(ba);if(n.relationshipType=Ta,n.conceptNameCode=Mn(fn),n.value=Mn(Dn),t.contentSequence.push(n),void 0!==e){if(void 0!==e.current){const n=new Va(ba);n.relationshipType=Ca,n.conceptNameCode=Mn(In),n.value=e.current,t.contentSequence.push(n)}if(void 0!==e.measure){const n=new Va(Aa);n.relationshipType=Ca,n.conceptNameCode=Mn(yn);const i=new Vr;i.numericValue=e.measure,i.measurementUnitsCode=kn("unit.mm");const o=new Hr;o.measuredValue=i,n.value=o,t.contentSequence.push(n)}}return t}#ns(e){let t,n,i;for(const i of e.contentSequence)this.#Ba(i)?t=i.value:this.#Ga(i)&&(n=i.value.measuredValue.numericValue);return void 0!==t&&(i=new za,i.current=t,void 0!==n&&(i.measure=n)),i}toDicomCADReport(e,t){let n=e.annotationGroups[0].getMeta();n.TransferSyntaxUID="1.2.840.10008.1.2.1",n.SOPClassUID="1.2.840.10008.5.1.4.1.1.88.34",n.MediaStorageSOPClassUID="1.2.840.10008.5.1.4.1.1.88.34",n.CompletionFlag="PARTIAL",n.VerificationFlag="UNVERIFIED";const i=new Date;n.ContentDate=Ft(xt(i)),n.ContentTime=Et(Rt(i));const o=n.CurrentRequestedProcedureEvidenceSequence.value[0].ReferencedSeriesSequence.value[0];let r=o.ReferencedSOPSequence;void 0===r&&(o.ReferencedSOPSequence={value:[]},r=o.ReferencedSOPSequence);const a=r.value;for(const t of e.annotationGroups)for(const e of t.getList()){const t={ReferencedSOPInstanceUID:e.referencedSopInstanceUID,ReferencedSOPClassUID:e.referencedSopClassUID},n=function(e){return e.ReferencedSOPInstanceUID===t.ReferencedSOPInstanceUID&&e.ReferencedSOPClassUID===t.ReferencedSOPClassUID};void 0===a.find(n)&&a.push(t)}n.ContentTemplateSequence={value:[{MappingResource:"DCMR",TemplateIdentifier:"4100"}]};const s=new Va(ba);s.relationshipType=Ca,s.conceptNameCode=Mn(un),s.value=Mn(Sn),s.contentSequence=[];for(const t of e.responseEvaluations){const e=this.#cs(t);s.contentSequence.push(e)}for(const t of e.annotationGroups)this.#ls(t,s.contentSequence);if(void 0!==e.comment){const t=new Va(Oa);t.relationshipType=Ca,t.conceptNameCode=Mn(Pn),t.value=e.comment,s.contentSequence.push(t)}const l=new Va(Ua);if(l.conceptNameCode=Mn(mn),l.value=Ma,l.contentSequence.push(s),void 0===l)throw new Error("No annotation group SR content");return n={...n,...Ga(l)},void 0!==t&&Ha(n,t),en(n)}}class Xa{#us;setOptions(e){this.#us=e}#ds=null;#hs=[];#gs=[];#Ss=[];#ms=[];#ps(e){let t;const n=e["00080060"];if(void 0!==n){const e=n.value[0];"SEG"===e?t=new mi:"SR"===e&&(t=new Ya)}return void 0===t&&(t=new Vt),t}#fs(e,t){const n=this.#hs[e].getDicomElements(),i=this.#ms[e];if(void 0===i)return!1;try{const o=new fo(n);i instanceof Ya?void 0===i.checkElements(n)&&(o.annotationGroup=i.create(n)):i instanceof mi?o.buffer=this.#Ss[e]:o.image=i.create(n,this.#Ss[e],this.#us.numberOfFiles),this.onloaditem({data:o,source:t,warn:i.getWarning()})}catch(e){return this.onerror({error:e,source:t}),this.onloadend({source:t}),!1}return!0}#Ds(e,t){this.#fs(e,t)&&this.onload({source:t}),this.onloadend({source:t})}#vs(e,t){this.onprogress({lengthComputable:!0,loaded:100,total:100,index:e,source:t}),this.#Ds(e,t)}#ys(e,t,n){const i=this.#hs[e],o={bitsAllocated:i.getDicomElements()["00280100"].value[0],isSigned:1===i.getDicomElements()["00280103"].value[0]},r=i.getDicomElements()["00280011"],a=i.getDicomElements()["00280010"];void 0!==r&&void 0!==a&&(o.sliceSize=r.value[0]*a.value[0]);const s=i.getDicomElements()["00280002"];void 0!==s&&(o.samplesPerPixel=s.value[0]);const l=i.getDicomElements()["00280006"];void 0!==l&&(o.planarConfiguration=l.value[0]);const c=t.length;null===this.#ds&&(this.#ds=new Er(n),this.#ds.ondecodeditem=e=>{this.#Cs(e),e.itemNumber+1===e.numberOfItems&&(this.onload(e),this.onloadend(e))},this.#ds.onerror=this.onerror,this.#ds.onabort=this.onabort);for(let n=0;n<c;++n)this.#ds.decode(t[n],o,{itemNumber:n,numberOfItems:c,index:e})}#Cs(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.#gs[t]){this.#gs[t]=n.length;const i=e.numberOfItems*this.#gs[t];try{this.#Ss[t]=new n.constructor(i)}catch(e){if(e instanceof RangeError){const e=Math.floor(Math.log(i)/Math.log(2));h.error("Cannot allocate "+n.constructor.name+" of size: "+i+" (>2^"+e+") for decompressed data.")}return this.#ds.abort(),this.onerror({error:e,source:origin}),void this.onloadend({source:origin})}}n.length!==this.#gs[t]&&h.warn("Unsupported varying decompressed data size: "+n.length+" != "+this.#gs[t]),this.#Ss[t].set(n,this.#gs[t]*e.itemNumber)}else this.#Ss[t]=n;0===e.itemNumber&&this.#fs(t,origin)}#Is(e,t){this.#Ds(e,t)}#Ts(e,t){const n=this.#hs[e].getDicomElements();let i=n["7FE00010"];void 0===i&&(i=n["7FE00008"]),void 0===i&&(i=n["7FE00009"]);const o=i.value;this.#Ss[e]=o[0];const r=function(e){let t;return st(e)?t="jpeg2000":rt(e)?t="jpeg-baseline":at(e)?t="jpeg-lossless":lt(e)&&(t="rle"),t}(n["00020010"].value[0]);void 0!==r?this.#ys(e,o,r):this.#vs(e,t)}convert(e,t,n){this.onloadstart({source:t,index:n});const i=new gt;let o;void 0!==this.#us.defaultCharacterSet&&i.setDefaultCharacterSet(this.#us.defaultCharacterSet);try{i.parse(e),o=this.#ps(i.getDicomElements()),o.checkElements(i.getDicomElements())}catch(e){return this.onerror({error:e,source:t}),void this.onloadend({source:t})}this.#hs[n]=i,this.#ms[n]=o,o instanceof Ya?this.#Is(n,t):this.#Ts(n,t)}abort(){this.#ds&&this.#ds.abort()}onloadstart(e){}onloaditem(e){}onprogress(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}class ja{#oa=null;#aa=null;#sa=0;#la=0;#J;getDefaultCharacterSet(){return this.#J}setDefaultCharacterSet(e){this.#J=e}#ua(e){this.#oa=e,this.#sa=0,this.#la=0,this.#ha()}#Sa(e){this.#aa=e}#ha(){this.#aa=null}#ma=e=>{this.#sa++,this.#sa===this.#oa.length&&this.onload({source:this.#oa})};#pa=e=>{this.#la++,this.#la===this.#oa.length&&this.onloadend({source:this.#oa})};load(e){if(void 0===e||0===e.length)return;this.#ua(e),this.onloadstart({source:e});const t=new Or(this.onprogress);t.setNToLoad(e.length),t.setNumberOfDimensions(1);const n=[];for(let e=0;e<$a.length;++e)n.push(new $a[e]);let i=e[0],o=null,r=!1;for(let a=0;a<n.length;++a)if(o=n[a],o.canLoadMemory(i)){r=!0,o.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),o.onprogress=t.getUndefinedMonoProgressHandler(0),o.onloaditem=this.onloaditem,o.onload=this.#ma,o.onloadend=this.#pa,o.onerror=this.onerror,o.onabort=this.onabort,this.#Sa(o);break}if(!r)throw new Error("No loader found for data: "+i.filename);for(let t=0;t<e.length;++t){if(i=e[t],!o.canLoadMemory(i))throw new Error("Input data of different type: "+i.filename);o.load(i.data,i.filename,t)}}abort(){this.#aa&&this.#aa.isLoading()&&this.#aa.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}function Za(e){return parseInt(e,36).toString()}function _a(e){const t=e.data.length,n=new Uint8Array(t/4*3);let i=0;for(let o=0;o<t;o+=4)n[i]=e.data[o],n[i+1]=e.data[o+1],n[i+2]=e.data[o+2],i+=3;return n}function Ka(e,t,n,i,o,r){const a=new ce([e,t,1]),s=new ue([1,1,1]),l=new F(0,0,n),c=new vt([l],a,s),u=new Ti(c,i,[r]);u.setPhotometricInterpretation("RGB");const d={BitsStored:8};return void 0!==o&&(d.numberOfFiles=o),u.setMeta(d),u}const Ja=(e=>{var t={};return i.d(t,e),t})({default:()=>n.default}),$a=[class{#us={};#Ls=!1;setOptions(e){this.#us=e}isLoading(){return this.#Ls}#Ps=new Xa;load(e,t,n){this.#Ls||(this.#Ps.setOptions(this.#us),this.#Ps.onloadstart=this.onloadstart,this.#Ps.onprogress=this.onprogress,this.#Ps.onloaditem=this.onloaditem,this.#Ps.onload=this.onload,this.#Ps.onloadend=e=>{this.#Ls=!1,this.onloadend(e)},this.#Ps.onerror=e=>{e.source=t,this.onerror(e)},this.#Ps.onabort=this.onabort),this.#Ls=!0,this.#Ps.convert(e,t,n)}abort(){this.#Ls=!1,this.#Ps.abort()}canLoadFile(e){const t=ae(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 ie(n.value,e)&&"+"!==n.value[e.length]}}}const n=Tr(e),i=ae(n.pathname),o=null===i,r="dcm"===i,a=n.searchParams.get("contentType");return null!=a?"application/dicom"===a:o||r}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 es.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Ls=!1;setOptions(e){}isLoading(){return this.#Ls}load(e,t,n){this.#Ls=!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.#Ls=!1,this.onloadend({source:t})}}abort(){this.#Ls=!1,this.onabort({}),this.onloadend({})}canLoadFile(e){return"json"===ae(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 ie(n.value,"application/json")||ie(n.value,"application/dicom+json")}}return"json"===ae(Tr(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 es.Text}loadUrlAs(){return 0}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Ls=!1;setOptions(e){}isLoading(){return this.#Ls}load(e,t,n){this.onloadstart({source:t}),this.#Ls=!0;const i=new ja;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.#Ls=!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=pe(new Uint8Array([13,10,13,10]));let o=me(t,i,0);if(void 0===o)throw new Error("Can't find the end of the first multipart header");const r=Se(t.slice(0,o)).split("\r\n");let a;for(let e=0;e<r.length;++e)if("-"===r[e][0]&&"-"===r[e][1]){a=r[e];break}if(void 0===a)throw new Error("Can't find the boundary between multi-parts");const s=pe(se(a)),l=a.length;let c=me(t,s,0);for(;void 0!==o;){const e={},r=Se(t.slice(c+l,o)).split("\r\n");for(let t=0;t<r.length;++t){const n=r[t],i=n.indexOf(":");if(-1!==i){const t=n.substring(0,i).trim(),o=n.substring(i+1).trim();e[t]=o}}if(c=me(t,s,o),void 0===c)break;const a=o+4,u=c-2;e.data=a<u?t.slice(a,u).buffer:new Uint8Array,n.push(e),o=me(t,i,c+l)}return n}(e))}abort(){this.#Ls=!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 ie(n.value,"multipart/related")}}return!1}canLoadMemory(e){return!1}loadFileAs(){return es.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#ws=!1;setOptions(e){}isLoading(){return!0}#Os(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.#ws=!1;const i=new Image;if(i.onload=()=>{try{if(!this.#ws){this.onprogress({lengthComputable:!0,loaded:100,total:100,index:n,source:t});const e=function(e,t,n){const i=e.width,o=e.height,r=document.createElement("canvas");r.width=i,r.height=o;const a=r.getContext("2d");a.drawImage(e,0,0);const s=a.getImageData(0,0,i,o),l={};let c;"string"==typeof t?(l.origin={value:t},c=Za(t)):(l.fileName={value:t.name},c=Za(t.name),l.fileType={value:t.type},l.fileLastModifiedDate={value:t.lastModified}),l.imageWidth={value:i},l.imageHeight={value:o};const u=n||0;l.imageUid={value:u},l.seriesUid={value:c};const d=Ka(i,o,u,_a(s),1,u.toString()),h=d.getMeta();return h.SeriesInstanceUID=c,d.setMeta(h),{data:{image:d,meta: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.#Os(e,n)}}abort(){this.#ws=!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 ie(n.value,"image/")}}const n=Tr(e),i=ae(n.pathname),o="jpeg"===i||"jpg"===i||"png"===i||"gif"===i,r=n.searchParams.get("contentType");return null!=r?"image/jpeg"===r||"image/png"===r||"image/gif"===r:o}canLoadMemory(e){if(void 0!==e.filename){const t=new File(["from memory"],e.filename);return this.canLoadFile(t)}return!1}loadFileAs(){return es.DataURL}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{setOptions(e){}isLoading(){return!0}#Os(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.#Os(e,n)}else i.src=e;i.onloadedmetadata=e=>{try{!function(e,t,n,i,o,r,a){const s=e.videoWidth,l=e.videoHeight,c=Math.ceil(30*e.duration),u={};let d;"string"==typeof r?(u.origin={value:r},d=Za(r)):(u.fileName={value:r.name},d=Za(r.name),u.fileType={value:r.type},u.fileLastModifiedDate={value:r.lastModified}),u.imageWidth={value:s},u.imageHeight={value:l},u.numberOfFrames={value:c},u.imageUid={value:0},u.seriesUid={value:d};const h=document.createElement("canvas");h.width=s,h.height=l;const g=h.getContext("2d");e.addEventListener("seeked",(function h(f){(function(){i({lengthComputable:!0,loaded:S,total:c,index:a,source:r}),g.drawImage(e,0,0);const n=_a(g.getImageData(0,0,s,l));if(0===S){m=Ka(s,l,1,n,c,a.toString());const e=m.getMeta();e.SeriesInstanceUID=d,m.setMeta(e),t({data:{image:m,meta:u},source:r})}else m.appendFrameBuffer(n,S);++S})(),p+=1/30,p<=f.target.duration?this.currentTime=p:(n({source:r}),o({source:r}),e.removeEventListener("seeked",h))}),!1);let S=0,m=null,p=0;e.currentTime=p}(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 ie(n.value,"video/")}}const n=ae(Tr(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 es.DataURL}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}},class{#Ls=!1;setOptions(e){}isLoading(){return this.#Ls}#As="";#bs=[];#xs=null;#Rs(e,t,n){this.#bs.push({filename:this.#As,data:e});const i=100*this.#bs.length/this.#xs.length;if(this.onprogress({lengthComputable:!0,loaded:i/2,total:100,index:n,item:{loaded:i,total:100,source:t}}),this.#bs.length<this.#xs.length){const e=this.#bs.length;this.#As=this.#xs[e].name,this.#xs[e].async("arrayBuffer").then((e=>{this.#Rs(e,t,n)}))}else{const e=new ja;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.#Ls=!1,this.onloadend(e)},e.onerror=this.onerror,e.onabort=this.onabort,e.load(this.#bs)}}load(e,t,n){this.onloadstart({source:t}),this.#Ls=!0,Ja.default.loadAsync(e).then((e=>{this.#bs=[],this.#xs=e.file(/.*\.dcm/);const i=this.#bs.length;this.#As=this.#xs[i].name,this.#xs[i].async("arrayBuffer").then((e=>{this.#Rs(e,t,n)}))}))}abort(){this.#Ls=!1,this.onabort({}),this.onloadend({})}canLoadFile(e){return"zip"===ae(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 ie(n.value,"application/zip")}}return"zip"===ae(Tr(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 es.ArrayBuffer}loadUrlAs(){return 1}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}],es={Text:0,ArrayBuffer:1,DataURL:2};class ts{#oa=null;#Fs=[];#aa=null;#sa=0;#la=0;#J;getDefaultCharacterSet(){return this.#J}setDefaultCharacterSet(e){this.#J=e}#ua(e){this.#oa=e,this.#sa=0,this.#la=0,this.#Es(),this.#ha()}#qs(e){this.#Fs.push(e)}#Es(){this.#Fs=[]}#Sa(e){this.#aa=e}#ha(){this.#aa=null}#ma=e=>{this.#sa++,this.#sa===this.#oa.length&&this.onload({source:this.#oa})};#pa=e=>{this.#la++,this.#la===this.#oa.length&&this.onloadend({source:this.#oa})};#fa(e,t){return n=>{n.source=t,e(n)}}#ya(e,t,n){return i=>{e.load(i.target.result,t,n)}}load(e){if(void 0===e||0===e.length)return;this.#ua(e),this.onloadstart({source:e});const t=new Or(this.onprogress);t.setNToLoad(e.length);const n=[];for(let e=0;e<$a.length;++e)n.push(new $a[e]);let i=e[0],o=null,r=!1;for(let a=0;a<n.length;++a)if(o=n[a],o.canLoadFile(i)){r=!0,o.setOptions({numberOfFiles:e.length,defaultCharacterSet:this.getDefaultCharacterSet()}),o.onprogress=t.getUndefinedMonoProgressHandler(1),o.onloaditem=this.onloaditem,o.onload=this.#ma,o.onloadend=this.#pa,o.onerror=this.onerror,o.onabort=this.onabort,this.#Sa(o);break}if(!r)throw new Error("No loader found for file: "+i.name);for(let n=0;n<e.length;++n){if(i=e[n],!o.canLoadFile(i))throw new Error("Input file of different type: "+i);const r=new FileReader;this.#qs(r),r.onprogress=this.#fa(t.getMonoProgressHandler(n,0),i),r.onload=this.#ya(o,i,n);const a=this.#fa(this.onerror,i);r.onerror=e=>{this.#pa(),a(e)};const s=this.#fa(this.onabort,i);r.onabort=e=>{this.#pa(),s(e)},o.loadFileAs()===es.Text?r.readAsText(i):o.loadFileAs()===es.DataURL?r.readAsDataURL(i):o.loadFileAs()===es.ArrayBuffer&&r.readAsArrayBuffer(i)}}abort(){for(let e=0;e<this.#Fs.length;++e)1===this.#Fs[e].readyState&&this.#Fs[e].abort();this.#aa&&this.#aa.isLoading()&&this.#aa.abort()}onloadstart(e){}onprogress(e){}onloaditem(e){}onload(e){}onloadend(e){}onerror(e){}onabort(e){}}class ns{#J;#Us={};constructor(e){this.#J=e}loadFiles(e,t){"json"===e[0].name.split(".").pop().toLowerCase()?this.#Ms(e[0],t):this.#Qs(e,t)}loadURLs(e,t,n){"json"===e[0].split(".").pop().toLowerCase()?this.#Ns(e[0],t,n):this.#Vs(e,t,n)}loadImageObject(e,t){const n=new ja;this.#Bs(e,n,"image",t)}getLoadingDataIds(){return Object.keys(this.#Us)}abort(e){void 0!==this.#Us[e]&&(this.#Us[e].loader.abort(),delete this.#Us[e])}#Qs(e,t){const n=new ts;n.setDefaultCharacterSet(this.#J),this.#Bs(e,n,"image",t)}#Vs(e,t,n){const i=new Ar;i.setDefaultCharacterSet(this.#J),this.#Bs(e,i,"image",t,n)}#Ms(e,t){const n=new ts;this.#Bs([e],n,"state",t)}#Ns(e,t,n){const i=new Ar;this.#Bs([e],i,"state",t,n)}#Bs(e,t,n,i,o){const r={loadtype:n,dataid:i};t.onloadstart=e=>{this.#Us[i]={loader:t,isFirstItem:!0},this.#fa(this.onloadstart,r)(e)},t.onprogress=this.#fa(this.onprogress,r),t.onloaditem=e=>{const t={loadtype:n,dataid:i};void 0!==this.#Us[i]&&(t.isfirstitem=this.#Us[i].isFirstItem),this.#fa(this.onloaditem,t)(e),void 0!==this.#Us[i]&&this.#Us[i].isFirstItem&&(this.#Us[i].isFirstItem=!1)},t.onload=this.#fa(this.onload,r),t.onloadend=e=>{delete this.#Us[i],this.#fa(this.onloadend,r)(e)},t.onerror=this.#fa(this.onerror,r),t.onabort=this.#fa(this.onabort,r),void 0!==t.ontimeout&&(t.ontimeout=this.#fa(this.ontimeout,r));try{t.load(e,o)}catch(e){return this.onerror({error:e,dataid:i}),void this.onloadend({dataid:i})}}#fa(e,t){return function(n){const i=Object.keys(t);for(let e=0;e<i.length;++e){const o=i[e];n[o]=t[o]}e(n)}}onloadstart(e){}onprogress(e){}onload(e){}onloaditem(e){}onloadend(e){}onerror(e){}ontimeout(e){}onabort(e){}}function is(e){return function(t){return Number(t).toPrecision(e)}}function os(e){let t="";for(let n=0;n<e;++n)0!==n&&(t+=", "),t+="{v"+n+"}";return t}function rs(e,t){let n=e;for(let e=0;e<t.length;++e)n=n.replace("{v"+e+"}",t[e]);return n}class as{#dn;#bt;#Gs;#ks=[];#Hs;#zs=[];#Ws;#N=new H;constructor(e,t,n){this.#dn=e,this.#bt=t,this.#Gs=n;const i=Object.keys(this.#Gs);for(let e=0;e<i.length;++e){const t=this.#Gs[i[e]];for(let e=0;e<t.length;++e){const n=t[e].event;void 0!==n&&(this.#ks.includes(n)||this.#ks.push(n))}}this.addAppListeners()}reset(){this.#zs=[],this.#Ws=void 0}addItemMeta(e){let t;if(void 0!==e["00020010"])t=void 0!==e["00080018"]?e["00080018"].value[0]:e.length,this.#zs[t]=function(e,t){const n=[];let i;const o=e["00080060"];if(void 0===o)return n;i=o.value[0];const r=t[i]||t["*"];if(!r)return n;for(let t=0;t<r.length;++t){const i=JSON.parse(JSON.stringify(r[t])),o=i.tags;if(void 0!==o&&0!==o.length){const t=[];for(let n=0;n<o.length;++n)void 0!==e[o[n]]?t.push(e[o[n]].value):t.push("");void 0!==i.format&&null!==i.format||(i.format=os(t.length)),i.value=rs(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:nt(e),format:"{v0}"}),n.push({pos:"bc",value:t,format:"{v0}"}),n.push({pos:"tc",value:nt(t),format:"{v0}"})}return n}(e,this.#Gs);else{const n=Object.keys(e);for(let i=0;i<n.length;++i){const o=e[n[i]];if("imageUid"===n[i]){t=o.value;break}}this.#zs[t]=function(e,t){const n=[],i=t.DOM;if(!i)return n;const o=Object.keys(e);for(let t=0;t<i.length;++t){const r=JSON.parse(JSON.stringify(i[t])),a=r.tags;if(void 0!==a&&0!==a.length){const t=[];for(let n=0;n<a.length;++n)for(let i=0;i<o.length;++i)a[n]===o[i]&&t.push(e[o[i]].value);void 0!==r.format&&null!==r.format||(r.format=os(t.length)),r.value=rs(r.format,t).trim()}n.push(r)}return n}(e,this.#Gs)}this.#Ws=t}#Ys=e=>{e.dataid===this.#bt&&void 0!==e.data&&void 0!==e.data.imageUid&&this.#Ws!==e.data.imageUid&&(this.#Ws=e.data.imageUid,this.#Xs(e))};#Xs=e=>{if(e.dataid!==this.#bt)return;const t=this.#zs[this.#Ws];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 o=t[n].format;let r=e.value;if(void 0!==t[n].precision){let e=null;e="round"===t[n].precision?Math.round:is(t[n].precision),r=r.map(e)}i=rs(o,r)}void 0!==i&&(t[n].value=i)}this.#B({type:"valuechange",data:t})}else console.warn("No slice overlay data for: "+this.#Ws)};isListening(){return this.#Hs}addAppListeners(){this.#dn.addEventListener("positionchange",this.#Ys);for(let e=0;e<this.#ks.length;++e)this.#dn.addEventListener(this.#ks[e],this.#Xs);this.#Hs=!0}removeAppListeners(){this.#dn.removeEventListener("positionchange",this.#Ys);for(let e=0;e<this.#ks.length;++e)this.#dn.removeEventListener(this.#ks[e],this.#Xs);this.#Hs=!1}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}#B(e){this.#N.fireEvent(e)}}class ss{divId;orientation;colourMap;opacity;wlPresetName;windowCenter;windowWidth;constructor(e){this.divId=e}}class ls{options;constructor(e){this.options=e}}class cs{dataViewConfigs;tools;binders;viewOnFirstLoadItem;defaultCharacterSet;overlayConfig;rootDocument;constructor(e){this.dataViewConfigs=e}}class us{#us=null;#js=null;#Zs=null;#_s=null;#Ks=null;#Js=null;#Yi=new Ki;#$s={};#N=new H;getData(e){return this.#js.get(e)}getImage(e){let t;return void 0!==this.getData(e)&&(t=this.getData(e).image),t}setImage(e,t){this.#js.setImage(e,t)}addData(e){const t=this.#js.getNextDataId();return this.#js.add(t,e),t}getMetaData(e){let t;return void 0!==this.#js.get(e)&&(t=this.#js.get(e).meta),t}getDataIds(){return this.#js.getDataIds()}getDataIdsFromSopUids(e){return this.#js.getDataIdsFromSopUids(e)}canScroll(){return this.#Ks.getActiveLayerGroup().getActiveViewLayer().getViewController().canScroll()}canWindowLevel(){return this.#Ks.getActiveLayerGroup().getActiveViewLayer().getViewController().canWindowLevel()}getAddedScale(){return this.#Ks.getActiveLayerGroup().getAddedScale()}getBaseScale(){return this.#Ks.getActiveLayerGroup().getBaseScale()}getOffset(){return this.#Ks.getActiveLayerGroup().getOffset()}getToolboxController(){return this.#Zs}getActiveLayerGroup(){return this.#Ks.getActiveLayerGroup()}setActiveLayerGroup(e){this.#Ks.setActiveLayerGroup(e)}getViewLayersByDataId(e){return this.#Ks.getViewLayersByDataId(e)}getViewLayers(e){return this.#Ks.getViewLayers(e)}getDrawLayersByDataId(e){return this.#Ks.getDrawLayersByDataId(e)}getDrawLayers(e){return this.#Ks.getDrawLayers(e)}getLayerGroupByDivId(e){return this.#Ks.getLayerGroupByDivId(e)}getNumberOfLayerGroups(){return this.#Ks.getNumberOfLayerGroups()}getStyle(){return this.#Yi}addToUndoStack=e=>{null!==this.#Js&&this.#Js.add(e)};removeFromUndoStack=e=>{let t=!1;return null!==this.#Js&&(t=this.#Js.remove(e)),t};init(e){if(this.#us=e,void 0===this.#us.viewOnFirstLoadItem&&(this.#us.viewOnFirstLoadItem=!0),void 0===this.#us.dataViewConfigs&&(this.#us.dataViewConfigs={}),void 0===this.#us.rootDocument&&(this.#us.rootDocument=document),this.#Js=new Pr,this.#Js.addEventListener("undoadd",this.#B),this.#Js.addEventListener("undo",this.#B),this.#Js.addEventListener("redo",this.#B),void 0!==this.#us.tools){const e={},t=Object.keys(this.#us.tools);for(let n=0;n<t.length;++n){const i=t[n];let o=sr[i];if(void 0===o&&(o=rr[i]),void 0!==o){if(e[i]=new o(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.#B)}const t=this.#us.tools[i];if(void 0!==t.options&&0!==t.options.length){let n,o="raw";if(void 0!==e[i].getOptionsType&&(o=e[i].getOptionsType()),"instance"===o||"factory"===o){n={};for(let e=0;e<t.options.length;++e){const r=t.options[e];let a=r;"factory"===o&&(a+="Factory");const s=i.charAt(0).toLowerCase()+i.slice(1);let l,c=ar[s];void 0!==c&&(l=c[a]),void 0===l&&(c=lr[s],void 0!==c&&(l=c[a])),void 0!==l?n[r]=l:h.warn("Could not find option class for: "+r)}}else n=t.options;e[i].setOptions(n)}}else h.warn("Could not initialise unknown tool: "+i)}this.#Zs=new wr(e)}this.#_s=new ns(this.#us.defaultCharacterSet),this.#_s.onloadstart=this.#el,this.#_s.onprogress=this.#tl,this.#_s.onloaditem=this.#nl,this.#_s.onload=this.#il,this.#_s.onloadend=this.#ol,this.#_s.onerror=this.#rl,this.#_s.ontimeout=this.#al,this.#_s.onabort=this.#sl,this.#js=new Do,this.#js.addEventListener("dataadd",this.#B),this.#js.addEventListener("dataremove",this.#B),this.#js.addEventListener("dataimageset",this.#B),this.#js.addEventListener("dataupdate",this.#B),this.#js.addEventListener("imagecontentchange",this.#B),this.#js.addEventListener("imagegeometrychange",this.#B),this.#js.addEventListener("annotationadd",this.#B),this.#js.addEventListener("annotationupdate",this.#B),this.#js.addEventListener("annotationremove",this.#B),this.#js.addEventListener("annotationgroupeditablechange",this.#B),this.#Ks=new fr,void 0!==this.#us.binders&&this.#Ks.setBinders(this.#us.binders)}reset(){this.#Ks.empty(),this.#$s={},this.#Js&&(this.#Js=new Pr,this.#Js.addEventListener("undoadd",this.#B),this.#Js.addEventListener("undo",this.#B),this.#Js.addEventListener("redo",this.#B))}resetLayout(){this.#Ks.reset(),this.#Ks.draw()}resetZoomPan(){this.#Ks.resetZoomPan(),this.#Ks.draw()}resetViews(){this.#Ks.resetViews()}addEventListener(e,t){this.#N.add(e,t)}removeEventListener(e,t){this.#N.remove(e,t)}loadFiles=e=>{if(0===e.length)return h.warn("Ignoring empty input file list."),"-1";const t=this.#js.getNextDataId();return this.#_s.loadFiles(e,t),t};loadURLs=(e,t)=>{if(0===e.length)return h.warn("Ignoring empty input url list."),"-1";const n=this.#js.getNextDataId();return this.#_s.loadURLs(e,n,t),n};loadFromUri=(e,t)=>{const n=function(e){const t=Lr(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&",o=e.getElementsByTagName("Patient");o.length>1&&h.warn("More than one patient, loading first one.");const r=o[0].getElementsByTagName("Study");r.length>1&&h.warn("More than one study, loading first one.");const a=r[0].getAttribute("StudyInstanceUID"),s=r[0].getElementsByTagName("Series");s.length>1&&h.warn("More than one series, loading first one.");const l=s[0].getAttribute("SeriesInstanceUID"),c=s[0].getElementsByTagName("Instance");let u=c.length;t<u&&(u=t);for(let e=0;e<u;++e){const t=i+"&studyUID="+a+"&seriesUID="+l+"&objectUID="+c[e].getAttribute("SOPInstanceUID");n.push(t)}return n}(n.target.responseXML,e.nslices))},i.onerror=function(e){h.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 o=decodeURIComponent(e),r=Lr(o);if(0===Object.keys(r).length)n.push(o);else{const e=Object.keys(r.query);let t=null;for(let n=0;n<e.length;++n)if(r.query[e[n]]instanceof Array){t=e[n];break}if(t){const o=r.query[t];let a=r.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]+"="+r.query[e[n]],l=!0);for(let e=0;e<o.length;++e)s=a,l&&(s+="&"),"key"===i&&(s+=t+"="),s+=o[e],n.push(s)}else n.push(o)}return n}(e.input,e.dwvReplaceMode),n)}(n,this.loadURLs,t))};loadImageObject=e=>{const t=this.#js.getNextDataId();return this.#_s.loadImageObject(e,t),t};abortAllLoads(){const e=this.#_s.getLoadingDataIds();for(const t of e)this.abortLoad(t)}abortLoad(e){this.#_s.abort(e),this.#js.remove(e),this.#Ks.removeLayersByDataId(e)}fitToContainer(){this.#Ks.fitToContainer()}initWLDisplay(){this.#Ks.getActiveLayerGroup().getActiveViewLayer().getViewController().initialise()}setImageSmoothing(e){this.#Ks.setImageSmoothing(e),this.#Ks.draw()}getViewConfigs(e,t){if(void 0===t&&(t=!1),null===this.#us.dataViewConfigs||void 0===this.#us.dataViewConfigs)throw new Error("No available data view configuration");let n=[];return void 0!==this.#us.dataViewConfigs[e]?n=this.#us.dataViewConfigs[e]:t||void 0===this.#us.dataViewConfigs["*"]||(n=this.#us.dataViewConfigs["*"]),n}getViewConfig(e,t,n){return this.getViewConfigs(e,n).find((function(e){return e.divId===t}))}getDataViewConfigs(){return this.#us.dataViewConfigs}setDataViewConfigs(e){this.#Ks.empty(),this.#us.dataViewConfigs=e,this.#ll(e)}addDataViewConfig(e,t){const n=this.#us.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.#us.dataViewConfigs[e].push(t),void 0===this.#Ks.getLayerGroupByDivId(t.divId)&&this.#cl(t),void 0!==this.#js.get(e)&&this.render(e,[t])}removeDataViewConfig(e,t){const n=this.#us.dataViewConfigs;if(void 0===n[e])return;const i=n[e].findIndex((function(e){return e.divId===t}));if(-1===i)return;n[e].splice(i,1),0===n[e].length&&delete n[e];const o=this.#Ks.getLayerGroupByDivId(t);if(void 0!==o){const t=o.getViewLayersByDataId(e);1===t.length&&o.removeLayer(t[0]);const n=o.getDrawLayersByDataId(e);1===n.length&&o.removeLayer(n[0]),0===o.getNumberOfLayers()&&this.#Ks.removeLayerGroup(o)}}updateDataViewConfig(e,t,n){const i=this.#us.dataViewConfigs;if(void 0===i[e])throw new Error("No config for dataId: "+e);const o=i[e].findIndex((function(e){return e.divId===t}));if(-1===o)throw new Error("No config for dataId: "+e+" and divId: "+t);const r=i[e][o];for(const e in n)r[e]=n[e];const a=this.#Ks.getLayerGroupByDivId(r.divId);if(void 0!==a){const t=a.getViewLayersByDataId(e);1===t.length&&a.removeLayer(t[0]);const n=a.getDrawLayersByDataId(e);1===n.length&&a.removeLayer(n[0])}void 0!==this.#js.get(e)&&this.render(e,[r])}#ll(e){const t=Object.keys(e),n=[];for(let i=0;i<t.length;++i){const o=e[t[i]];for(let e=0;e<o.length;++e){const t=o[e];n.includes(t.divId)||(this.#cl(t),n.push(t.divId))}}}#cl(e){const t=this.#us.rootDocument.getElementById(e.divId),n=this.#Ks.addLayerGroup(t);this.#ul(n)}setLayerGroupsBinders(e){const t=[];for(let n=0;n<e.length;++n)void 0!==pr[e[n]]&&t.push(new pr[e[n]]);this.#Ks.setBinders(t)}render(e,t){if(null==e)throw new Error("Cannot render without data id");const n=void 0!==this.getData(e).image,i=void 0!==this.getData(e).annotationGroup;if(0===this.#Ks.getNumberOfLayerGroups()&&this.#ll(this.#us.dataViewConfigs),void 0===t&&(t=this.getViewConfigs(e)),0!==t.length)for(let o=0;o<t.length;++o){const r=t[o],a=this.#Ks.getLayerGroupByDivId(r.divId);if(!a)throw new Error("No layer group for "+r.divId);void 0!==this.#js.get(e)&&(n&&0===a.getViewLayersByDataId(e).length?this.#dl(e,r):i&&0===a.getDrawLayersByDataId(e).length&&this.addDrawLayer(e,r)),a.draw()}else h.info("Not rendering data: "+e+" (no data view config)")}zoom(e,t,n){const i=this.#Ks.getActiveLayerGroup(),o=i.getBaseViewLayer().getViewController().getCurrentScrollPosition(),r=new F(t,n,o);i.addScale(e,r),i.draw()}translate(e,t){const n=this.#Ks.getActiveLayerGroup();n.addTranslation({x:e,y:t,z:0}),n.draw()}setOpacity(e){const t=this.#Ks.getActiveLayerGroup().getActiveViewLayer();t.setOpacity(e),t.draw()}setDrawings(e,t,n){const i=this.#Ks.getActiveLayerGroup().getBaseViewLayer(),r=i.getDataId(),a=this.getData(r),s=i.getViewController(),l=function(e,t,n){const i=[],r=Ui.default.Node.create(e).getChildren(Wi);for(let e=0,a=r.length;e<a;++e){const a=r[e],s=a.getChildren();for(let e=0,r=s.length;e<r;++e){const e=new cr,r=new o(dr(a.id()));e.referencedSopInstanceUID=n.getImageUid(r);const l=s[0];e.trackingId=l.id(),e.trackingUid=l.id();const c=l.getChildren(zi)[0];if(e.colour=c.stroke(),"line-group"===l.name()){const t=c.points();e.mathShape=new R(t[0],t[1]),e.referencePoints=[new R(t[2],t[3])]}else if("ruler-group"===l.name()){const t=c.points();e.mathShape=new Ji(new R(t[0],t[1]),new R(t[2],t[3]))}else if("rectangle-group"===l.name())e.mathShape=new oo(new R(c.x(),c.y()),new R(c.x()+c.width(),c.y()+c.height()));else if("roi-group"===l.name()){const t=c.points(),n=[];for(let e=0;e<t.length;e+=2)n.push(new R(t[e],t[e+1]));e.mathShape=new ao(n)}else if("freeHand-group"===l.name()){h.warn("Converting freehand into ROI shape");const t=c.points(),n=[];for(let e=0;e<t.length;e+=2)n.push(new R(t[e],t[e+1]));e.mathShape=new ao(n)}else if("protractor-group"===l.name()){const t=c.points();e.mathShape=new so([new R(t[0],t[1]),new R(t[2],t[3]),new R(t[4],t[5])])}else if("ellipse-group"===l.name()){const t=c.absolutePosition();e.mathShape=new lo(new R(t.x,t.y),c.radiusX(),c.radiusY())}else if("circle-group"===l.name()){const t=c.absolutePosition();e.mathShape=new uo(new R(t.x,t.y),c.radius())}if(t){const n=t[l.id()];e.textExpr=n.meta.textExpr,e.quantification=n.meta.quantification}i.push(e)}}return i}(e,t,a.image),c=this.createAnnotationData(r);for(const e of l)e.setViewController(s),c.annotationGroup.add(e);this.#js.add(n,c),this.render(n)}applyJsonState(e,t){const n=new Dr(t);n.apply(this,n.fromJSON(e))}onResize=()=>{this.fitToContainer()};onKeydown=e=>{this.#B(e)};defaultOnKeydown=e=>{if(e.ctrlKey)if(e.shiftKey){const t=this.#Ks.getActiveLayerGroup(),n=t.getPositionHelper();"ArrowLeft"===e.key?t.moreThanOne(3)&&n.decrementPosition(3):"ArrowUp"===e.key?t.canScroll()&&n.incrementPositionAlongScroll():"ArrowRight"===e.key?t.moreThanOne(3)&&n.incrementPosition(3):"ArrowDown"===e.key&&t.canScroll()&&n.decrementPositionAlongScroll()}else if("y"===e.key)this.#Js.redo();else if("z"===e.key)this.#Js.undo();else if(" "===e.key)for(let e=0;e<this.#Ks.getNumberOfLayerGroups();++e)this.#Ks.getLayerGroup(e).setShowCrosshair(!this.#Ks.getLayerGroup(e).getShowCrosshair())};resetDisplay(){this.resetLayout(),this.initWLDisplay()}resetZoom(){this.resetLayout()}setColourMap(e){this.#Ks.getActiveLayerGroup().getActiveViewLayer().getViewController().setColourMap(e)}setWindowLevelPreset(e){this.#Ks.getActiveLayerGroup().getActiveViewLayer().getViewController().setWindowLevelPreset(e)}setTool(e){for(let e=0;e<this.#Ks.getNumberOfLayerGroups();++e){const t=this.#Ks.getLayerGroup(e),n=t.getActiveLayer();void 0!==n&&this.#Zs.bindLayerGroup(t,n)}this.#Zs.setSelectedTool(e)}setToolFeatures(e){this.#Zs.setToolFeatures(e)}undo(){this.#Js.undo()}redo(){this.#Js.redo()}getStackSize(){return this.#Js.getStackSize()}getCurrentStackIndex(){return this.#Js.getCurrentStackIndex()}getOverlayData(e){let t;return void 0!==this.#$s&&(t=this.#$s[e]),t}toggleOverlayListeners(e){const t=this.getOverlayData(e);void 0!==t&&(t.isListening()?t.removeAppListeners():t.addAppListeners())}createAnnotationData(e){const t=this.getData(e).image.getMeta(),n=new fo({});n.annotationGroup=new qi,n.annotationGroup.setMetaValue("Modality","SR");const i=["PatientName","PatientID","PatientBirthDate","PatientSex","StudyDate","StudyTime","StudyInstanceUID","StudyID","StudyDescription"];for(const e of i)n.annotationGroup.setMetaValue(e,t[e]);return n.annotationGroup.setMetaValue("CurrentRequestedProcedureEvidenceSequence",{value:[{ReferencedSeriesSequence:{value:[{SeriesInstanceUID:t.SeriesInstanceUID}]},StudyInstanceUID:t.StudyInstanceUID}]}),n}addAndRenderAnnotationData(e,t,n){const i=this.addData(e),o=this.getViewConfigs(n).find((e=>e.divId===t));if(void 0===o)throw new Error("No reference data view config for draw");const r=new ss(t);r.orientation=o.orientation,this.addDataViewConfig(i,r),this.render(i)}#B=e=>{let t=!0;void 0!==e.propagate&&(t=e.propagate,delete e.propagate),t&&this.#N.fireEvent(e)};#el=e=>{void 0!==this.#us.overlayConfig&&(this.#$s[e.dataid]=new as(this,e.dataid,this.#us.overlayConfig)),e.type="loadstart",this.#B(e)};#tl=e=>{e.type="loadprogress",this.#B(e)};#nl=e=>{let t;void 0===e.data&&h.error("Missing loaditem event data."),void 0===e.loadtype&&h.error("Missing loaditem event load type."),"image"===e.loadtype?t=e.data.meta:"state"===e.loadtype&&(t="state"),this.#B({type:"loaditem",data:t,source:e.source,loadtype:e.loadtype,dataid:e.dataid,isfirstitem:e.isfirstitem,warn:e.warn});const n=e.isfirstitem;"image"===e.loadtype?n?this.#js.add(e.dataid,e.data):this.#js.update(e.dataid,e.data):"state"===e.loadtype&&this.applyJsonState(e.data,e.dataid),void 0!==this.#$s&&void 0!==this.#$s[e.dataid]&&this.#$s[e.dataid].addItemMeta(t),"image"===e.loadtype&&0!==this.getViewConfigs(e.dataid).length&&n&&this.#us.viewOnFirstLoadItem&&this.render(e.dataid)};#il=e=>{e.type="load",this.#B(e)};#ol=e=>{e.type="loadend",this.#B(e)};#rl=e=>{void 0===e.type&&(e.type="error"),this.#B(e)};#al=e=>{void 0===e.type&&(e.type="timeout"),this.#B(e)};#sl=e=>{void 0===e.type&&(e.type="abort"),this.#B(e)};#ul(e){e.addEventListener("zoomchange",this.#B),e.addEventListener("offsetchange",this.#B),e.addEventListener("layerremove",this.#B),e.addEventListener("renderstart",this.#B),e.addEventListener("renderend",this.#B);for(let t=0;t<W.length;++t)e.addEventListener(W[t],this.#B);e.addEventListener("wlchange",(e=>{const t=hr(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,3===e.value.length&&(n.windowCenter=e.value[0],n.windowWidth=e.value[1],n.wlPresetName=e.value[2]))})),e.addEventListener("opacitychange",(e=>{const t=hr(e.srclayerid).groupDivId,n=this.getViewConfig(e.dataid,t,!0);void 0!==n&&(n.opacity=e.value[0])})),e.addEventListener("colourmapchange",(e=>{const t=hr(e.srclayerid).groupDivId,n=this.getViewConfig(e.dataid,t,!0);void 0!==n&&(n.colourMap=e.value[0])}))}#dl(e,t){const n=this.#js.get(e);if(!n)throw new Error("Cannot initialise layer with missing data, id: "+e);const i=this.#Ks.getLayerGroupByDivId(t.divId);if(!i)throw new Error("Cannot initialise layer with missing group, id: "+t.divId);const o=n.image.getGeometry();this.#Ks.unbindLayerGroups();const r=(new b).create(n.meta,n.image),a=te(o.getOrientation(),_(t.orientation));r.setOrientation(a),"SEG"===n.image.getMeta().Modality&&r.setAlphaFunction((function(e){return 0===e?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(r,e);const u=o.getSize(a).get2D(),d=o.getSpacing(a).get2D();c.initialise(u,d,l);const h=c.getViewController();if(void 0!==t.wlPresetName)h.setWindowLevelPreset(t.wlPresetName);else if(void 0!==t.windowCenter&&void 0!==t.windowWidth){const e=new D(t.windowCenter,t.windowWidth);h.setWindowLevel(e)}void 0!==t.colourMap?h.setColourMap(t.colourMap):s||("PT"===n.image.getMeta().Modality?h.setColourMap("hot"):h.setColourMap("rainbow")),this.#js.addEventListener("dataimageset",c.onimageset);const g=[h.getCurrentIndex().getValues(),h.getCurrentPosition().getValues()];i.updateLayersToPositionChange({value:g,srclayerid:c.getId()}),this.#Ks.fitToContainer(),c.setOffset(i.getOffset());const S=this.#hl(o.getOrientation(),t.orientation);if(this.#gl(S,c),s)c.setScale(i.getScale());else{const e=i.getBaseViewLayer();c.initScale(i.getScale(),e.getAbsoluteZoomOffset())}this.#Ks.bindLayerGroups(),this.#Zs&&this.#Zs.bindLayerGroup(i,c),this.#B({type:"viewlayeradd",layerid:c.getId(),layergroupid:i.getDivId(),dataid:e}),s&&this.#Zs&&this.#Zs.init()}#Sl(e,t){let n;const i=e.getMetaValue("CurrentRequestedProcedureEvidenceSequence");if(void 0!==i){const e=i.value[0],o=e?.ReferencedSeriesSequence,r=o?.value[0],a=r?.SeriesInstanceUID,s={SeriesInstanceUID:a},l=t.searchViewLayers(s);0!==l.length&&(n=l[0])}const o=e.getMetaValue("ReferencedSeriesSequence");if(void 0!==o){const e=o.value[0],i=e?.SeriesInstanceUID,r={SeriesInstanceUID:i},a=t.searchViewLayers(r);0!==a.length&&(n=a[0])}if(void 0===n)for(const i of e.getList()){const e={SOPInstanceUID:i.referencedSopInstanceUID,SOPClassUID:i.referencedSopClassUID},o=t.searchViewLayers(e);if(0!==o.length){n=o[0];break}}return n}addDrawLayer(e,t){const n=this.#Ks.getLayerGroupByDivId(t.divId);if(!n)throw new Error("Cannot initialise layer with missing group, id: "+t.divId);const i=this.#js.get(e);if(!i)throw new Error("Cannot initialise layer with missing data, id: "+e);const o=i.annotationGroup,r=this.#Sl(o,n);if(void 0===r)return void console.warn("No loaded data that matches the measurements reference series UID");const a=r.getDataId();this.#Ks.unbindLayerGroups();const s=r.getViewController();i.annotationGroup.setViewController(s);const l=this.#js.get(a);if(!l)throw new Error("Cannot initialise layer without reference data, id: "+a);const c=l.image.getGeometry(),u=te(c.getOrientation(),_(t.orientation)),d=c.getSize(u).get2D(),h=c.getSpacing(u).get2D(),g=n.addDrawLayer();g.initialise(d,h,r.getId());const S=new Li(c,u);g.setPlaneHelper(S);const m=[s.getCurrentIndex().getValues(),s.getCurrentPosition().getValues()];n.updateLayersToPositionChange({value:m,srclayerid:g.getId()}),this.#Ks.fitToContainer(),g.setOffset(n.getOffset());const p=this.#hl(c.getOrientation(),t.orientation);this.#gl(p,g),g.initScale(n.getScale(),r.getAbsoluteZoomOffset()),g.setAnnotationGroup(i.annotationGroup,e,this.addToUndoStack),g.setCurrentPosition(s.getCurrentPosition(),s.getCurrentIndex()),this.#Ks.bindLayerGroups(),this.#Zs&&this.#Zs.bindLayerGroup(n,g),this.#B({type:"drawlayeradd",layerid:g.getId(),layergroupid:n.getDivId(),dataid:e})}#hl(e,t){const n=K(e.asOneAndZeros());if(void 0===n)throw new Error("Unsupported undefined orientation code");const i=void 0===t,o=!i&&t===Z.Axial,r=!i&&t===Z.Coronal,a=!i&&t===Z.Sagittal,s={x:!1,y:!1},l={x:!1,y:!1,z:!1};return"LPS"===n?(r||a)&&(l.z=!0,s.y=!0):"LAI"===n?i||o?s.y=!0:r?l.z=!0:a&&(l.z=!0,s.x=!0):"RPI"===n?i||o?s.x=!0:r?(l.z=!0,s.x=!0):a&&(l.z=!0):"RAS"===n?(s.x=!0,s.y=!0,(r||a)&&(l.z=!0)):"LSA"===n?(s.y=!0,i||r?l.z=!0:o?l.y=!0:a&&(s.x=!0,l.y=!0,l.z=!0)):"RSP"===n?i||r?(s.x=!0,s.y=!0,l.x=!0,l.z=!0):o?(s.x=!0,l.x=!0):a&&(s.y=!0,l.z=!0):"RIA"===n?(s.x=!0,i||r?l.x=!0:o?(s.y=!0,l.x=!0,l.y=!0):a&&(l.y=!0)):"PSL"===n?(l.z=!0,(i||a||r)&&(s.y=!0)):"PIR"===n?(l.z=!0,(o||r)&&(s.x=!0)):"ASR"===n?(s.x=!0,s.y=!0,(i||a||r)&&(l.z=!0)):"AIL"===n?i||a?(s.x=!0,l.z=!0):o?s.y=!0:r&&(l.z=!0):"LIP"!==n&&h.warn("Unsupported orientation code: "+n+", display could be incorrect"),{scale:l,offset:s}}#gl(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 ds{#Nn;#ml;constructor(e){this.#Nn=e;const t=e.getMeta();void 0===t.custom&&(t.custom={}),void 0===t.custom.segments&&(t.custom.segments=[]),this.#ml=t.custom.segments}#pl(e){return this.#ml.findIndex((function(t){return t.number===e}))}hasSegment(e){return-1!==this.#pl(e)}getNumberOfSegments(){return this.#ml.length}maskHasSegments(e){const t=[],n=[];for(let i=0;i<e.length;++i){const o=this.getSegment(e[i]);void 0!==o?void 0!==o.displayValue?t.push(o.displayValue):t.push(o.number):(h.warn("Unknown segment in maskHasSegments: "+e[i]),n.push(i))}const i=this.#Nn.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.#pl(e);return-1!==n&&(t=this.#ml[n]),t}addSegment(e){-1===this.#pl(e.number)?(this.#ml.push(e),void 0!==e.displayRGBValue&&this.#Nn.updatePaletteColourMap(e.number,e.displayRGBValue)):h.warn("Not adding segment, it is allready in the segments list: "+e.number)}removeSegment(e){const t=this.#pl(e);-1!==t?this.#ml.splice(t,1):h.warn("Cannot remove segment, it is not in the segments list: "+e)}updateSegment(e){const t=this.#pl(e.number);-1!==t?this.#ml[t]=e:h.warn("Cannot update segment, it is not in the segments list: "+e.number)}}class hs{#Nn;#fl;#zn;#Dl;constructor(e,t,n){this.#Nn=e,this.#fl=t,this.#zn=void 0!==n&&n,void 0!==t.displayRGBValue?this.#Dl=e.getOffsets(t.number):this.#Dl=e.getOffsets(t.displayValue)}getName(){return"Delete-segment"}isValid(){return this.#Nn.getMeta().custom.segments.some((e=>e.number===this.#fl.number))}execute(){0!==this.#Dl.length&&this.#Nn.setAtOffsets(this.#Dl,0),new ds(this.#Nn).removeSegment(this.#fl.number),this.#zn||this.onExecute({type:"masksegmentdelete",segmentnumber:this.#fl.number})}undo(){0!==this.#Dl.length&&(void 0!==this.#fl.displayRGBValue?this.#Nn.setAtOffsets(this.#Dl,this.#fl.number):this.#Nn.setAtOffsets(this.#Dl,this.#fl.displayValue)),new ds(this.#Nn).addSegment(this.#fl),this.onUndo({type:"masksegmentredraw",segmentnumber:this.#fl.number})}onExecute(e){}onUndo(e){}}class gs{#Nn;#fl;#vl;#yl;#zn;#Dl;constructor(e,t,n,i){this.#Nn=e,this.#fl=t,this.#vl=n,this.#zn=void 0!==i&&i,void 0!==t.displayRGBValue?this.#yl=t.displayRGBValue:(this.#yl=t.displayValue,this.#Dl=e.getOffsets(this.#yl))}getName(){return"Change-segment-colour"}isValid(){let e=!0;return void 0!==this.#Dl&&(e=0!==this.#Dl.length),e}execute(){"number"==typeof this.#vl?(this.#Nn.setAtOffsets(this.#Dl,this.#vl),this.#fl.displayValue=this.#vl):(this.#Nn.updatePaletteColourMap(this.#fl.number,this.#vl),this.#fl.displayRGBValue=this.#vl),this.#zn||this.onExecute({type:"changemasksegmentcolour",segmentnumber:this.#fl.number,value:[this.#vl]})}undo(){"number"==typeof this.#yl?(this.#Nn.setAtOffsets(this.#Dl,this.#yl),this.#fl.displayValue=this.#yl):(this.#Nn.updatePaletteColourMap(this.#fl.number,this.#yl),this.#fl.displayRGBValue=this.#yl),this.onUndo({type:"changemasksegmentcolour",segmentnumber:this.#fl.number,value:[this.#yl]})}onExecute(e){}onUndo(e){}}class Ss{#Cl=[];#Il(e){return this.#Cl.indexOf(e)}isHidden(e){return-1!==this.#Il(e)}addToHidden(e){this.isHidden(e)?h.warn("Not hidding segment, it is allready in the hidden list: "+e):this.#Cl.push(e)}removeFromHidden(e){const t=this.#Il(e);-1!==t?this.#Cl.splice(t,1):h.warn("Cannot remove segment, it is not in the hidden list: "+e)}getAlphaFunc(){return e=>Array.isArray(e)||0!==e&&!this.#Cl.includes(e)?255:0}}class ms{x;y}class ps{x;y;z}export{cr as Annotation,qi as AnnotationGroup,Ya as AnnotationGroupFactory,us as App,cs as AppOptions,Wa as CADReport,gs as ChangeSegmentColourCommand,uo as Circle,u as ColourMap,He as DataElement,hs as DeleteSegmentCommand,an as DicomCode,fo as DicomData,gt as DicomParser,Va as DicomSRContent,Kt as DicomWriter,Gi as DrawController,ur as DrawLayer,po as DrawShapeHandler,lo as Ellipse,vt as Geometry,Ti as Image,o as Index,mr as LayerGroup,mi as MaskFactory,_n as MaskSegment,ds as MaskSegmentHelper,Ss as MaskSegmentViewHelper,M as Matrix33,Dt as NumberRange,Z as Orientation,as as OverlayData,Li as PlaneHelper,E as Point,R as Point2D,F as Point3D,wi as PositionHelper,so as Protractor,v as RGB,ao as ROI,oo as Rectangle,z as RescaleSlopeAndIntercept,za as ResponseEvaluation,ms as Scalar2D,ps as Scalar3D,go as ScrollWheel,ce as Size,ue as Spacing,xe as Tag,ls as ToolConfig,wr as ToolboxController,x as Vector3D,X as View,ss as ViewConfig,Oi as ViewController,Ei as ViewLayer,D as WindowLevel,kt as WriterRule,ve as addTagsToDictionary,fe as buildMultipart,Ci as createImage,Ii as createMaskImage,Y as createView,O as custom,ke as getAsSimpleElements,Si as getDefaultDicomSegJson,Ga as getDicomSRContentItem,_e as getDwvVersion,en as getElementsFromJSONTags,co as getEllipseIndices,gr as getLayerDetailsFromEvent,Ri as getMousePoint,$ as getOrientationName,Qe as getPixelDataTag,ro as getRectangleIndices,nt as getReverseOrientation,Ba as getSRContent,Nn as getSegmentationCode,Fe as getTagFromKey,xi as getTouchPoints,ct as getTypedArray,zt as getUID,$e as hasDicomPrefix,C as hexToRgb,ne as i18n,y as isEqualRgb,T as labToUintLab,h as logger,d as luts,le as precisionRound,I as rgbToHex,P as srgbToCielab,rr as toolList,ar as toolOptions};
|
|
2
|
+
//# sourceMappingURL=dwv.node.min.js.map
|