@openneuro/app 4.6.1 → 4.6.2
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/.scss-lint.yml +0 -1
- package/Dockerfile +1 -1
- package/package.json +7 -6
- package/src/index.html +0 -1
- package/src/scripts/dataset/dataset-query.jsx +10 -7
- package/src/scripts/dataset/draft-container.tsx +7 -0
- package/src/scripts/dataset/files/file-display.jsx +21 -32
- package/src/scripts/dataset/files/viewers/__tests__/__snapshots__/file-viewer-json.spec.jsx.snap +52 -84
- package/src/scripts/dataset/files/viewers/file-viewer-json.jsx +8 -14
- package/src/scripts/dataset/files/viewers/file-viewer-nifti.jsx +19 -13
- package/src/scripts/dataset/snapshot-container.tsx +239 -226
- package/src/scripts/errors/404page.tsx +3 -0
- package/src/assets/papaya.js +0 -2101
- package/src/scripts/common/partials/papaya.jsx +0 -97
package/src/assets/papaya.js
DELETED
|
@@ -1,2101 +0,0 @@
|
|
|
1
|
-
var PAPAYA_BUILD_NUM="1407",papayaLoadableImages=[];
|
|
2
|
-
(function(c,a){function d(c){var a=c.length,b=r.type(c);return r.isWindow(c)?!1:1===c.nodeType&&a?!0:"array"===b||"function"!==b&&(0===a||"number"===typeof a&&0<a&&a-1 in c)}function f(c){var a=Y[c]={};r.each(c.match(ia)||[],function(c,b){a[b]=!0});return a}function b(c,b,e,d){if(r.acceptData(c)){var g=r.expando,l="string"===typeof b,h=c.nodeType,f=h?r.cache:c,n=h?c[g]:c[g]&&g;if(n&&f[n]&&(d||f[n].data)||!l||e!==a){n||(h?c[g]=n=ma.pop()||r.guid++:n=g);f[n]||(f[n]={},h||(f[n].toJSON=r.noop));if("object"===
|
|
3
|
-
typeof b||"function"===typeof b)d?f[n]=r.extend(f[n],b):f[n].data=r.extend(f[n].data,b);c=f[n];d||(c.data||(c.data={}),c=c.data);e!==a&&(c[r.camelCase(b)]=e);l?(e=c[b],null==e&&(e=c[r.camelCase(b)])):e=c;return e}}}function e(c,a,b){if(r.acceptData(c)){var e,d,g,l=c.nodeType,f=l?r.cache:c,n=l?c[r.expando]:r.expando;if(f[n]){if(a&&(g=b?f[n]:f[n].data)){r.isArray(a)?a=a.concat(r.map(a,r.camelCase)):a in g?a=[a]:(a=r.camelCase(a),a=a in g?[a]:a.split(" "));e=0;for(d=a.length;e<d;e++)delete g[a[e]];if(!(b?
|
|
4
|
-
h:r.isEmptyObject)(g))return}if(!b&&(delete f[n].data,!h(f[n])))return;l?r.cleanData([c],!0):r.support.deleteExpando||f!=f.window?delete f[n]:f[n]=null}}}function g(c,b,e){if(e===a&&1===c.nodeType)if(e="data-"+b.replace(gb,"-$1").toLowerCase(),e=c.getAttribute(e),"string"===typeof e){try{e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Qb.test(e)?r.parseJSON(e):e}catch(d){}r.data(c,b,e)}else e=a;return e}function h(c){for(var a in c)if(("data"!==a||!r.isEmptyObject(c[a]))&&"toJSON"!==a)return!1;
|
|
5
|
-
return!0}function m(){return!0}function k(){return!1}function p(c,a){do c=c[a];while(c&&1!==c.nodeType);return c}function t(c,a,b){a=a||0;if(r.isFunction(a))return r.grep(c,function(c,e){return!!a.call(c,e,c)===b});if(a.nodeType)return r.grep(c,function(c){return c===a===b});if("string"===typeof a){var e=r.grep(c,function(c){return 1===c.nodeType});if(Ea.test(a))return r.filter(a,e,!b);a=r.filter(a,e)}return r.grep(c,function(c){return 0<=r.inArray(c,a)===b})}function w(c){var a=pa.split("|");c=c.createDocumentFragment();
|
|
6
|
-
if(c.createElement)for(;a.length;)c.createElement(a.pop());return c}function B(c,a){return c.getElementsByTagName(a)[0]||c.appendChild(c.ownerDocument.createElement(a))}function A(c){var a=c.getAttributeNode("type");c.type=(a&&a.specified)+"/"+c.type;return c}function x(c){var a=sa.exec(c.type);a?c.type=a[1]:c.removeAttribute("type");return c}function G(c,a){for(var b,e=0;null!=(b=c[e]);e++)r._data(b,"globalEval",!a||r._data(a[e],"globalEval"))}function F(c,a){if(1===a.nodeType&&r.hasData(c)){var b,
|
|
7
|
-
e,d;e=r._data(c);var g=r._data(a,e),l=e.events;if(l)for(b in delete g.handle,g.events={},l)for(e=0,d=l[b].length;e<d;e++)r.event.add(a,b,l[b][e]);g.data&&(g.data=r.extend({},g.data))}}function z(c,b){var e,d,g=0,l=typeof c.getElementsByTagName!==ea?c.getElementsByTagName(b||"*"):typeof c.querySelectorAll!==ea?c.querySelectorAll(b||"*"):a;if(!l)for(l=[],e=c.childNodes||c;null!=(d=e[g]);g++)!b||r.nodeName(d,b)?l.push(d):r.merge(l,z(d,b));return b===a||b&&r.nodeName(c,b)?r.merge([c],l):l}function L(c){vb.test(c.type)&&
|
|
8
|
-
(c.defaultChecked=c.checked)}function l(c,a){if(a in c)return a;for(var b=a.charAt(0).toUpperCase()+a.slice(1),e=a,d=mc.length;d--;)if(a=mc[d]+b,a in c)return a;return e}function J(c,a){c=a||c;return"none"===r.css(c,"display")||!r.contains(c.ownerDocument,c)}function K(c,a){for(var b,e,d,g=[],l=0,h=c.length;l<h;l++)e=c[l],e.style&&(g[l]=r._data(e,"olddisplay"),b=e.style.display,a?(g[l]||"none"!==b||(e.style.display=""),""===e.style.display&&J(e)&&(g[l]=r._data(e,"olddisplay",u(e.nodeName)))):g[l]||
|
|
9
|
-
(d=J(e),(b&&"none"!==b||!d)&&r._data(e,"olddisplay",d?b:r.css(e,"display"))));for(l=0;l<h;l++)e=c[l],!e.style||a&&"none"!==e.style.display&&""!==e.style.display||(e.style.display=a?g[l]||"":"none");return c}function E(c,a,b){return(c=Ac.exec(a))?Math.max(0,c[1]-(b||0))+(c[2]||"px"):a}function y(c,a,b,e,d){a=b===(e?"border":"content")?4:"width"===a?1:0;for(var g=0;4>a;a+=2)"margin"===b&&(g+=r.css(c,b+ya[a],!0,d)),e?("content"===b&&(g-=r.css(c,"padding"+ya[a],!0,d)),"margin"!==b&&(g-=r.css(c,"border"+
|
|
10
|
-
ya[a]+"Width",!0,d))):(g+=r.css(c,"padding"+ya[a],!0,d),"padding"!==b&&(g+=r.css(c,"border"+ya[a]+"Width",!0,d)));return g}function D(c,a,b){var e=!0,d="width"===a?c.offsetWidth:c.offsetHeight,g=ja(c),l=r.support.boxSizing&&"border-box"===r.css(c,"boxSizing",!1,g);if(0>=d||null==d){d=Oa(c,a,g);if(0>d||null==d)d=c.style[a];if(wb.test(d))return d;e=l&&(r.support.boxSizingReliable||d===c.style[a]);d=parseFloat(d)||0}return d+y(c,a,b||(l?"border":"content"),e,g)+"px"}function u(c){var a=S,b=xb[c];b||
|
|
11
|
-
(b=n(c,a),"none"!==b&&b||(wa=(wa||r("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(a.documentElement),a=(wa[0].contentWindow||wa[0].contentDocument).document,a.write("<!doctype html><html><body>"),a.close(),b=n(c,a),wa.detach()),xb[c]=b);return b}function n(c,a){var b=r(a.createElement(c)).appendTo(a.body),e=r.css(b[0],"display");b.remove();return e}function q(c,a,b,e){var d;if(r.isArray(a))r.each(a,function(a,d){b||Bc.test(c)?e(c,d):q(c+"["+
|
|
12
|
-
("object"===typeof d?a:"")+"]",d,b,e)});else if(b||"object"!==r.type(a))e(c,a);else for(d in a)q(c+"["+d+"]",a[d],b,e)}function I(c){return function(a,b){"string"!==typeof a&&(b=a,a="*");var e,d=0,g=a.toLowerCase().match(ia)||[];if(r.isFunction(b))for(;e=g[d++];)"+"===e[0]?(e=e.slice(1)||"*",(c[e]=c[e]||[]).unshift(b)):(c[e]=c[e]||[]).push(b)}}function H(c,a,b,e){function d(h){var f;g[h]=!0;r.each(c[h]||[],function(c,h){var n=h(a,b,e);if("string"===typeof n&&!l&&!g[n])return a.dataTypes.unshift(n),
|
|
13
|
-
d(n),!1;if(l)return!(f=n)});return f}var g={},l=c===Rb;return d(a.dataTypes[0])||!g["*"]&&d("*")}function v(c,b){var e,d,g=r.ajaxSettings.flatOptions||{};for(d in b)b[d]!==a&&((g[d]?c:e||(e={}))[d]=b[d]);e&&r.extend(!0,c,e);return c}function C(){try{return new c.XMLHttpRequest}catch(a){}}function P(){setTimeout(function(){ib=a});return ib=r.now()}function M(c,a){r.each(a,function(a,b){for(var e=(Za[a]||[]).concat(Za["*"]),d=0,g=e.length;d<g&&!e[d].call(c,a,b);d++);})}function R(c,a,b){var e,d=0,g=
|
|
14
|
-
yb.length,l=r.Deferred().always(function(){delete h.elem}),h=function(){if(e)return!1;for(var a=ib||P(),a=Math.max(0,f.startTime+f.duration-a),b=1-(a/f.duration||0),d=0,g=f.tweens.length;d<g;d++)f.tweens[d].run(b);l.notifyWith(c,[f,b,a]);if(1>b&&g)return a;l.resolveWith(c,[f]);return!1},f=l.promise({elem:c,props:r.extend({},a),opts:r.extend(!0,{specialEasing:{}},b),originalProperties:a,originalOptions:b,startTime:ib||P(),duration:b.duration,tweens:[],createTween:function(a,b){var e=r.Tween(c,f.opts,
|
|
15
|
-
a,b,f.opts.specialEasing[a]||f.opts.easing);f.tweens.push(e);return e},stop:function(a){var b=0,d=a?f.tweens.length:0;if(e)return this;for(e=!0;b<d;b++)f.tweens[b].run(1);a?l.resolveWith(c,[f,a]):l.rejectWith(c,[f,a]);return this}});b=f.props;for(T(b,f.opts.specialEasing);d<g;d++)if(a=yb[d].call(f,c,b,f.opts))return a;M(f,b);r.isFunction(f.opts.start)&&f.opts.start.call(c,f);r.fx.timer(r.extend(h,{elem:c,anim:f,queue:f.opts.queue}));return f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}
|
|
16
|
-
function T(c,a){var b,e,d,g,l;for(d in c)if(e=r.camelCase(d),g=a[e],b=c[d],r.isArray(b)&&(g=b[1],b=c[d]=b[0]),d!==e&&(c[e]=b,delete c[d]),(l=r.cssHooks[e])&&"expand"in l)for(d in b=l.expand(b),delete c[e],b)d in c||(c[d]=b[d],a[d]=g);else a[e]=g}function O(c,a,b,e,d){return new O.prototype.init(c,a,b,e,d)}function Q(c,a){var b,e={height:c},d=0;for(a=a?1:0;4>d;d+=2-a)b=ya[d],e["margin"+b]=e["padding"+b]=c;a&&(e.opacity=e.width=c);return e}function U(c){return r.isWindow(c)?c:9===c.nodeType?c.defaultView||
|
|
17
|
-
c.parentWindow:!1}var ua,N,ea=typeof a,S=c.document,W=c.location,qa=c.jQuery,za=c.$,Pa={},ma=[],Aa=ma.concat,ga=ma.push,na=ma.slice,Qa=ma.indexOf,Sb=Pa.toString,Z=Pa.hasOwnProperty,da="1.9.1".trim,r=function(c,a){return new r.fn.init(c,a,N)},zb=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ia=/\S+/g,$a=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,Ra=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,Fa=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Tb=/^[\],:{}\s]*$/,Ga=/(?:^|:|,)(?:\s*\[)+/g,Ab=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,Ub=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
|
|
18
|
-
ra=/^-ms-/,jb=/-([\da-z])/gi,xa=function(c,a){return a.toUpperCase()},ka=function(c){if(S.addEventListener||"load"===c.type||"complete"===S.readyState)pb(),r.ready()},pb=function(){S.addEventListener?(S.removeEventListener("DOMContentLoaded",ka,!1),c.removeEventListener("load",ka,!1)):(S.detachEvent("onreadystatechange",ka),c.detachEvent("onload",ka))};r.fn=r.prototype={jquery:"1.9.1",constructor:r,init:function(c,b,e){var d;if(!c)return this;if("string"===typeof c){d="<"===c.charAt(0)&&">"===c.charAt(c.length-
|
|
19
|
-
1)&&3<=c.length?[null,c,null]:Ra.exec(c);if(!d||!d[1]&&b)return!b||b.jquery?(b||e).find(c):this.constructor(b).find(c);if(d[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(d[1],b&&b.nodeType?b.ownerDocument||b:S,!0)),Fa.test(d[1])&&r.isPlainObject(b))for(d in b)if(r.isFunction(this[d]))this[d](b[d]);else this.attr(d,b[d])}else{if((b=S.getElementById(d[2]))&&b.parentNode){if(b.id!==d[2])return e.find(c);this.length=1;this[0]=b}this.context=S;this.selector=c}return this}if(c.nodeType)return this.context=
|
|
20
|
-
this[0]=c,this.length=1,this;if(r.isFunction(c))return e.ready(c);c.selector!==a&&(this.selector=c.selector,this.context=c.context);return r.makeArray(c,this)},selector:"",length:0,size:function(){return this.length},toArray:function(){return na.call(this)},get:function(c){return null==c?this.toArray():0>c?this[this.length+c]:this[c]},pushStack:function(c){c=r.merge(this.constructor(),c);c.prevObject=this;c.context=this.context;return c},each:function(c,a){return r.each(this,c,a)},ready:function(c){r.ready.promise().done(c);
|
|
21
|
-
return this},slice:function(){return this.pushStack(na.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(c){var a=this.length;c=+c+(0>c?a:0);return this.pushStack(0<=c&&c<a?[this[c]]:[])},map:function(c){return this.pushStack(r.map(this,function(a,b){return c.call(a,b,a)}))},end:function(){return this.prevObject||this.constructor(null)},push:ga,sort:[].sort,splice:[].splice};r.fn.init.prototype=r.fn;r.extend=r.fn.extend=function(){var c,b,
|
|
22
|
-
e,d,g,l=arguments[0]||{},h=1,f=arguments.length,n=!1;"boolean"===typeof l&&(n=l,l=arguments[1]||{},h=2);"object"===typeof l||r.isFunction(l)||(l={});f===h&&(l=this,--h);for(;h<f;h++)if(null!=(g=arguments[h]))for(d in g)c=l[d],e=g[d],l!==e&&(n&&e&&(r.isPlainObject(e)||(b=r.isArray(e)))?(b?(b=!1,c=c&&r.isArray(c)?c:[]):c=c&&r.isPlainObject(c)?c:{},l[d]=r.extend(n,c,e)):e!==a&&(l[d]=e));return l};r.extend({noConflict:function(a){c.$===r&&(c.$=za);a&&c.jQuery===r&&(c.jQuery=qa);return r},isReady:!1,readyWait:1,
|
|
23
|
-
holdReady:function(c){c?r.readyWait++:r.ready(!0)},ready:function(c){if(!0===c?!--r.readyWait:!r.isReady){if(!S.body)return setTimeout(r.ready);r.isReady=!0;!0!==c&&0<--r.readyWait||(ua.resolveWith(S,[r]),r.fn.trigger&&r(S).trigger("ready").off("ready"))}},isFunction:function(c){return"function"===r.type(c)},isArray:Array.isArray||function(c){return"array"===r.type(c)},isWindow:function(c){return null!=c&&c==c.window},isNumeric:function(c){return!isNaN(parseFloat(c))&&isFinite(c)},type:function(c){return null==
|
|
24
|
-
c?String(c):"object"===typeof c||"function"===typeof c?Pa[Sb.call(c)]||"object":typeof c},isPlainObject:function(c){if(!c||"object"!==r.type(c)||c.nodeType||r.isWindow(c))return!1;try{if(c.constructor&&!Z.call(c,"constructor")&&!Z.call(c.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}for(var e in c);return e===a||Z.call(c,e)},isEmptyObject:function(c){for(var a in c)return!1;return!0},error:function(c){throw Error(c);},parseHTML:function(c,a,b){if(!c||"string"!==typeof c)return null;
|
|
25
|
-
"boolean"===typeof a&&(b=a,a=!1);a=a||S;var e=Fa.exec(c);b=!b&&[];if(e)return[a.createElement(e[1])];e=r.buildFragment([c],a,b);b&&r(b).remove();return r.merge([],e.childNodes)},parseJSON:function(a){if(c.JSON&&c.JSON.parse)return c.JSON.parse(a);if(null===a)return a;if("string"===typeof a&&(a=r.trim(a))&&Tb.test(a.replace(Ab,"@").replace(Ub,"]").replace(Ga,"")))return(new Function("return "+a))();r.error("Invalid JSON: "+a)},parseXML:function(b){var e,d;if(!b||"string"!==typeof b)return null;try{c.DOMParser?
|
|
26
|
-
(d=new DOMParser,e=d.parseFromString(b,"text/xml")):(e=new ActiveXObject("Microsoft.XMLDOM"),e.async="false",e.loadXML(b))}catch(g){e=a}e&&e.documentElement&&!e.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b);return e},noop:function(){},globalEval:function(a){a&&r.trim(a)&&(c.execScript||function(a){c.eval.call(c,a)})(a)},camelCase:function(c){return c.replace(ra,"ms-").replace(jb,xa)},nodeName:function(c,a){return c.nodeName&&c.nodeName.toLowerCase()===a.toLowerCase()},each:function(c,
|
|
27
|
-
a,b){var e,g=0,l=c.length;e=d(c);if(b)if(e)for(;g<l&&(e=a.apply(c[g],b),!1!==e);g++);else for(g in c){if(e=a.apply(c[g],b),!1===e)break}else if(e)for(;g<l&&(e=a.call(c[g],g,c[g]),!1!==e);g++);else for(g in c)if(e=a.call(c[g],g,c[g]),!1===e)break;return c},trim:da&&!da.call("\ufeff\u00a0")?function(c){return null==c?"":da.call(c)}:function(c){return null==c?"":(c+"").replace($a,"")},makeArray:function(c,a){var b=a||[];null!=c&&(d(Object(c))?r.merge(b,"string"===typeof c?[c]:c):ga.call(b,c));return b},
|
|
28
|
-
inArray:function(c,a,b){var e;if(a){if(Qa)return Qa.call(a,c,b);e=a.length;for(b=b?0>b?Math.max(0,e+b):b:0;b<e;b++)if(b in a&&a[b]===c)return b}return-1},merge:function(c,b){var e=b.length,d=c.length,g=0;if("number"===typeof e)for(;g<e;g++)c[d++]=b[g];else for(;b[g]!==a;)c[d++]=b[g++];c.length=d;return c},grep:function(c,a,b){var e,d=[],g=0,l=c.length;for(b=!!b;g<l;g++)e=!!a(c[g],g),b!==e&&d.push(c[g]);return d},map:function(c,a,b){var e,g=0,l=c.length,h=[];if(d(c))for(;g<l;g++)e=a(c[g],g,b),null!=
|
|
29
|
-
e&&(h[h.length]=e);else for(g in c)e=a(c[g],g,b),null!=e&&(h[h.length]=e);return Aa.apply([],h)},guid:1,proxy:function(c,b){var e,d;"string"===typeof b&&(d=c[b],b=c,c=d);if(!r.isFunction(c))return a;e=na.call(arguments,2);d=function(){return c.apply(b||this,e.concat(na.call(arguments)))};d.guid=c.guid=c.guid||r.guid++;return d},access:function(c,b,e,d,g,l,h){var f=0,n=c.length,m=null==e;if("object"===r.type(e))for(f in g=!0,e)r.access(c,b,f,e[f],!0,l,h);else if(d!==a&&(g=!0,r.isFunction(d)||(h=!0),
|
|
30
|
-
m&&(h?(b.call(c,d),b=null):(m=b,b=function(c,a,b){return m.call(r(c),b)})),b))for(;f<n;f++)b(c[f],e,h?d:d.call(c[f],f,b(c[f],e)));return g?c:m?b.call(c):n?b(c[0],e):l},now:function(){return(new Date).getTime()}});r.ready.promise=function(a){if(!ua)if(ua=r.Deferred(),"complete"===S.readyState)setTimeout(r.ready);else if(S.addEventListener)S.addEventListener("DOMContentLoaded",ka,!1),c.addEventListener("load",ka,!1);else{S.attachEvent("onreadystatechange",ka);c.attachEvent("onload",ka);var b=!1;try{b=
|
|
31
|
-
null==c.frameElement&&S.documentElement}catch(e){}b&&b.doScroll&&function Da(){if(!r.isReady){try{b.doScroll("left")}catch(c){return setTimeout(Da,50)}pb();r.ready()}}()}return ua.promise(a)};r.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(c,a){Pa["[object "+a+"]"]=a.toLowerCase()});N=r(S);var Y={};r.Callbacks=function(c){c="string"===typeof c?Y[c]||f(c):r.extend({},c);var b,e,d,g,l,h,n=[],m=!c.once&&[],u=function(a){e=c.memory&&a;d=!0;l=h||0;h=0;g=n.length;
|
|
32
|
-
for(b=!0;n&&l<g;l++)if(!1===n[l].apply(a[0],a[1])&&c.stopOnFalse){e=!1;break}b=!1;n&&(m?m.length&&u(m.shift()):e?n=[]:k.disable())},k={add:function(){if(n){var a=n.length;(function Sa(a){r.each(a,function(a,b){var e=r.type(b);"function"===e?c.unique&&k.has(b)||n.push(b):b&&b.length&&"string"!==e&&Sa(b)})})(arguments);b?g=n.length:e&&(h=a,u(e))}return this},remove:function(){n&&r.each(arguments,function(c,a){for(var e;-1<(e=r.inArray(a,n,e));)n.splice(e,1),b&&(e<=g&&g--,e<=l&&l--)});return this},has:function(c){return c?
|
|
33
|
-
-1<r.inArray(c,n):!(!n||!n.length)},empty:function(){n=[];return this},disable:function(){n=m=e=a;return this},disabled:function(){return!n},lock:function(){m=a;e||k.disable();return this},locked:function(){return!m},fireWith:function(c,a){a=a||[];a=[c,a.slice?a.slice():a];!n||d&&!m||(b?m.push(a):u(a));return this},fire:function(){k.fireWith(this,arguments);return this},fired:function(){return!!d}};return k};r.extend({Deferred:function(c){var a=[["resolve","done",r.Callbacks("once memory"),"resolved"],
|
|
34
|
-
["reject","fail",r.Callbacks("once memory"),"rejected"],["notify","progress",r.Callbacks("memory")]],b="pending",e={state:function(){return b},always:function(){d.done(arguments).fail(arguments);return this},then:function(){var c=arguments;return r.Deferred(function(b){r.each(a,function(a,g){var l=g[0],h=r.isFunction(c[a])&&c[a];d[g[1]](function(){var c=h&&h.apply(this,arguments);if(c&&r.isFunction(c.promise))c.promise().done(b.resolve).fail(b.reject).progress(b.notify);else b[l+"With"](this===e?
|
|
35
|
-
b.promise():this,h?[c]:arguments)})});c=null}).promise()},promise:function(c){return null!=c?r.extend(c,e):e}},d={};e.pipe=e.then;r.each(a,function(c,g){var l=g[2],h=g[3];e[g[1]]=l.add;h&&l.add(function(){b=h},a[c^1][2].disable,a[2][2].lock);d[g[0]]=function(){d[g[0]+"With"](this===d?e:this,arguments);return this};d[g[0]+"With"]=l.fireWith});e.promise(d);c&&c.call(d,d);return d},when:function(c){var a=0,b=na.call(arguments),e=b.length,d=1!==e||c&&r.isFunction(c.promise)?e:0,g=1===d?c:r.Deferred(),
|
|
36
|
-
l=function(c,a,b){return function(e){a[c]=this;b[c]=1<arguments.length?na.call(arguments):e;b===h?g.notifyWith(a,b):--d||g.resolveWith(a,b)}},h,f,n;if(1<e)for(h=Array(e),f=Array(e),n=Array(e);a<e;a++)b[a]&&r.isFunction(b[a].promise)?b[a].promise().done(l(a,n,b)).fail(g.reject).progress(l(a,f,h)):--d;d||g.resolveWith(n,b);return g.promise()}});r.support=function(){var a,b,e,d,g,l,h,f=S.createElement("div");f.setAttribute("className","t");f.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
|
37
|
-
b=f.getElementsByTagName("*");e=f.getElementsByTagName("a")[0];if(!b||!e||!b.length)return{};d=S.createElement("select");g=d.appendChild(S.createElement("option"));b=f.getElementsByTagName("input")[0];e.style.cssText="top:1px;float:left;opacity:.5";a={getSetAttribute:"t"!==f.className,leadingWhitespace:3===f.firstChild.nodeType,tbody:!f.getElementsByTagName("tbody").length,htmlSerialize:!!f.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:"/a"===e.getAttribute("href"),
|
|
38
|
-
opacity:/^0.5/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:!!b.value,optSelected:g.selected,enctype:!!S.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==S.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===S.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1};b.checked=!0;a.noCloneChecked=b.cloneNode(!0).checked;d.disabled=!0;a.optDisabled=!g.disabled;try{delete f.test}catch(n){a.deleteExpando=
|
|
39
|
-
!1}b=S.createElement("input");b.setAttribute("value","");a.input=""===b.getAttribute("value");b.value="t";b.setAttribute("type","radio");a.radioValue="t"===b.value;b.setAttribute("checked","t");b.setAttribute("name","t");e=S.createDocumentFragment();e.appendChild(b);a.appendChecked=b.checked;a.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked;f.attachEvent&&(f.attachEvent("onclick",function(){a.noCloneEvent=!1}),f.cloneNode(!0).click());for(h in{submit:!0,change:!0,focusin:!0})f.setAttribute(e=
|
|
40
|
-
"on"+h,"t"),a[h+"Bubbles"]=e in c||!1===f.attributes[e].expando;f.style.backgroundClip="content-box";f.cloneNode(!0).style.backgroundClip="";a.clearCloneStyle="content-box"===f.style.backgroundClip;r(function(){var b,e,d=S.getElementsByTagName("body")[0];d&&(b=S.createElement("div"),b.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",d.appendChild(b).appendChild(f),f.innerHTML="<table><tr><td></td><td>t</td></tr></table>",e=f.getElementsByTagName("td"),
|
|
41
|
-
e[0].style.cssText="padding:0;margin:0;border:0;display:none",l=0===e[0].offsetHeight,e[0].style.display="",e[1].style.display="none",a.reliableHiddenOffsets=l&&0===e[0].offsetHeight,f.innerHTML="",f.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",a.boxSizing=4===f.offsetWidth,a.doesNotIncludeMarginInBodyOffset=1!==d.offsetTop,c.getComputedStyle&&(a.pixelPosition="1%"!==
|
|
42
|
-
(c.getComputedStyle(f,null)||{}).top,a.boxSizingReliable="4px"===(c.getComputedStyle(f,null)||{width:"4px"}).width,e=f.appendChild(S.createElement("div")),e.style.cssText=f.style.cssText="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",e.style.marginRight=e.style.width="0",f.style.width="1px",a.reliableMarginRight=!parseFloat((c.getComputedStyle(e,null)||{}).marginRight)),typeof f.style.zoom!==ea&&(f.innerHTML="",f.style.cssText=
|
|
43
|
-
"padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;width:1px;padding:1px;display:inline;zoom:1",a.inlineBlockNeedsLayout=3===f.offsetWidth,f.style.display="block",f.innerHTML="<div></div>",f.firstChild.style.width="5px",a.shrinkWrapBlocks=3!==f.offsetWidth,a.inlineBlockNeedsLayout&&(d.style.zoom=1)),d.removeChild(b),f=null)});b=d=e=g=e=b=null;return a}();var Qb=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,gb=/([A-Z])/g;r.extend({cache:{},
|
|
44
|
-
expando:"jQuery"+("1.9.1"+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(c){c=c.nodeType?r.cache[c[r.expando]]:c[r.expando];return!!c&&!h(c)},data:function(c,a,e){return b(c,a,e)},removeData:function(c,a){return e(c,a)},_data:function(c,a,e){return b(c,a,e,!0)},_removeData:function(c,a){return e(c,a,!0)},acceptData:function(c){if(c.nodeType&&1!==c.nodeType&&9!==c.nodeType)return!1;var a=c.nodeName&&r.noData[c.nodeName.toLowerCase()];
|
|
45
|
-
return!a||!0!==a&&c.getAttribute("classid")===a}});r.fn.extend({data:function(c,b){var e,d,l=this[0],f=0,h=null;if(c===a){if(this.length&&(h=r.data(l),1===l.nodeType&&!r._data(l,"parsedAttrs"))){for(e=l.attributes;f<e.length;f++)d=e[f].name,d.indexOf("data-")||(d=r.camelCase(d.slice(5)),g(l,d,h[d]));r._data(l,"parsedAttrs",!0)}return h}return"object"===typeof c?this.each(function(){r.data(this,c)}):r.access(this,function(b){if(b===a)return l?g(l,c,r.data(l,c)):null;this.each(function(){r.data(this,
|
|
46
|
-
c,b)})},null,b,1<arguments.length,null,!0)},removeData:function(c){return this.each(function(){r.removeData(this,c)})}});r.extend({queue:function(c,a,b){var e;if(c)return a=(a||"fx")+"queue",e=r._data(c,a),b&&(!e||r.isArray(b)?e=r._data(c,a,r.makeArray(b)):e.push(b)),e||[]},dequeue:function(c,a){a=a||"fx";var b=r.queue(c,a),e=b.length,d=b.shift(),g=r._queueHooks(c,a),l=function(){r.dequeue(c,a)};"inprogress"===d&&(d=b.shift(),e--);if(g.cur=d)"fx"===a&&b.unshift("inprogress"),delete g.stop,d.call(c,
|
|
47
|
-
l,g);!e&&g&&g.empty.fire()},_queueHooks:function(c,a){var b=a+"queueHooks";return r._data(c,b)||r._data(c,b,{empty:r.Callbacks("once memory").add(function(){r._removeData(c,a+"queue");r._removeData(c,b)})})}});r.fn.extend({queue:function(c,b){var e=2;"string"!==typeof c&&(b=c,c="fx",e--);return arguments.length<e?r.queue(this[0],c):b===a?this:this.each(function(){var a=r.queue(this,c,b);r._queueHooks(this,c);"fx"===c&&"inprogress"!==a[0]&&r.dequeue(this,c)})},dequeue:function(c){return this.each(function(){r.dequeue(this,
|
|
48
|
-
c)})},delay:function(c,a){c=r.fx?r.fx.speeds[c]||c:c;return this.queue(a||"fx",function(a,b){var e=setTimeout(a,c);b.stop=function(){clearTimeout(e)}})},clearQueue:function(c){return this.queue(c||"fx",[])},promise:function(c,b){var e,d=1,g=r.Deferred(),l=this,f=this.length,h=function(){--d||g.resolveWith(l,[l])};"string"!==typeof c&&(b=c,c=a);for(c=c||"fx";f--;)(e=r._data(l[f],c+"queueHooks"))&&e.empty&&(d++,e.empty.add(h));h();return g.promise(b)}});var ab,Vb,Ha=/[\t\r\n]/g,Ia=/\r/g,Cc=/^(?:input|select|textarea|button|object)$/i,
|
|
49
|
-
oc=/^(?:a|area)$/i,Ta=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Cb=/^(?:checked|selected)$/i,ha=r.support.getSetAttribute,Ja=r.support.input;r.fn.extend({attr:function(c,a){return r.access(this,r.attr,c,a,1<arguments.length)},removeAttr:function(c){return this.each(function(){r.removeAttr(this,c)})},prop:function(c,a){return r.access(this,r.prop,c,a,1<arguments.length)},removeProp:function(c){c=r.propFix[c]||c;return this.each(function(){try{this[c]=
|
|
50
|
-
a,delete this[c]}catch(b){}})},addClass:function(c){var a,b,e,d,g,l=0,f=this.length;a="string"===typeof c&&c;if(r.isFunction(c))return this.each(function(a){r(this).addClass(c.call(this,a,this.className))});if(a)for(a=(c||"").match(ia)||[];l<f;l++)if(b=this[l],e=1===b.nodeType&&(b.className?(" "+b.className+" ").replace(Ha," "):" ")){for(g=0;d=a[g++];)0>e.indexOf(" "+d+" ")&&(e+=d+" ");b.className=r.trim(e)}return this},removeClass:function(c){var a,b,e,d,g,l=0,f=this.length;a=0===arguments.length||
|
|
51
|
-
"string"===typeof c&&c;if(r.isFunction(c))return this.each(function(a){r(this).removeClass(c.call(this,a,this.className))});if(a)for(a=(c||"").match(ia)||[];l<f;l++)if(b=this[l],e=1===b.nodeType&&(b.className?(" "+b.className+" ").replace(Ha," "):"")){for(g=0;d=a[g++];)for(;0<=e.indexOf(" "+d+" ");)e=e.replace(" "+d+" "," ");b.className=c?r.trim(e):""}return this},toggleClass:function(c,a){var b=typeof c,e="boolean"===typeof a;return r.isFunction(c)?this.each(function(b){r(this).toggleClass(c.call(this,
|
|
52
|
-
b,this.className,a),a)}):this.each(function(){if("string"===b)for(var d,g=0,l=r(this),f=a,h=c.match(ia)||[];d=h[g++];)f=e?f:!l.hasClass(d),l[f?"addClass":"removeClass"](d);else if(b===ea||"boolean"===b)this.className&&r._data(this,"__className__",this.className),this.className=this.className||!1===c?"":r._data(this,"__className__")||""})},hasClass:function(c){c=" "+c+" ";for(var a=0,b=this.length;a<b;a++)if(1===this[a].nodeType&&0<=(" "+this[a].className+" ").replace(Ha," ").indexOf(c))return!0;return!1},
|
|
53
|
-
val:function(c){var b,e,d,g=this[0];if(arguments.length)return d=r.isFunction(c),this.each(function(b){var g=r(this);1===this.nodeType&&(b=d?c.call(this,b,g.val()):c,null==b?b="":"number"===typeof b?b+="":r.isArray(b)&&(b=r.map(b,function(c){return null==c?"":c+""})),e=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&e.set(this,b,"value")!==a||(this.value=b))});if(g){if((e=r.valHooks[g.type]||r.valHooks[g.nodeName.toLowerCase()])&&"get"in e&&(b=e.get(g,"value"))!==a)return b;
|
|
54
|
-
b=g.value;return"string"===typeof b?b.replace(Ia,""):null==b?"":b}}});r.extend({valHooks:{option:{get:function(c){var a=c.attributes.value;return!a||a.specified?c.value:c.text}},select:{get:function(c){for(var a,b=c.options,e=c.selectedIndex,d=(c="select-one"===c.type||0>e)?null:[],g=c?e+1:b.length,l=0>e?g:c?e:0;l<g;l++)if(a=b[l],!(!a.selected&&l!==e||(r.support.optDisabled?a.disabled:null!==a.getAttribute("disabled"))||a.parentNode.disabled&&r.nodeName(a.parentNode,"optgroup"))){a=r(a).val();if(c)return a;
|
|
55
|
-
d.push(a)}return d},set:function(c,a){var b=r.makeArray(a);r(c).find("option").each(function(){this.selected=0<=r.inArray(r(this).val(),b)});b.length||(c.selectedIndex=-1);return b}}},attr:function(c,b,e){var d,g,l;g=c.nodeType;if(c&&3!==g&&8!==g&&2!==g){if(typeof c.getAttribute===ea)return r.prop(c,b,e);if(g=1!==g||!r.isXMLDoc(c))b=b.toLowerCase(),d=r.attrHooks[b]||(Ta.test(b)?Vb:ab);if(e!==a)if(null===e)r.removeAttr(c,b);else{if(d&&g&&"set"in d&&(l=d.set(c,e,b))!==a)return l;c.setAttribute(b,e+
|
|
56
|
-
"");return e}else{if(d&&g&&"get"in d&&null!==(l=d.get(c,b)))return l;typeof c.getAttribute!==ea&&(l=c.getAttribute(b));return null==l?a:l}}},removeAttr:function(c,a){var b,e,d=0,g=a&&a.match(ia);if(g&&1===c.nodeType)for(;b=g[d++];)e=r.propFix[b]||b,Ta.test(b)?!ha&&Cb.test(b)?c[r.camelCase("default-"+b)]=c[e]=!1:c[e]=!1:r.attr(c,b,""),c.removeAttribute(ha?b:e)},attrHooks:{type:{set:function(c,a){if(!r.support.radioValue&&"radio"===a&&r.nodeName(c,"input")){var b=c.value;c.setAttribute("type",a);b&&
|
|
57
|
-
(c.value=b);return a}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(c,b,e){var d,g,l;l=c.nodeType;if(c&&3!==l&&8!==l&&2!==l){if(l=1!==l||!r.isXMLDoc(c))b=r.propFix[b]||b,g=r.propHooks[b];return e!==a?g&&"set"in g&&(d=g.set(c,e,b))!==a?d:c[b]=e:g&&"get"in g&&
|
|
58
|
-
null!==(d=g.get(c,b))?d:c[b]}},propHooks:{tabIndex:{get:function(c){var b=c.getAttributeNode("tabindex");return b&&b.specified?parseInt(b.value,10):Cc.test(c.nodeName)||oc.test(c.nodeName)&&c.href?0:a}}}});Vb={get:function(c,b){var e=r.prop(c,b),d="boolean"===typeof e&&c.getAttribute(b);return(e="boolean"===typeof e?Ja&&ha?null!=d:Cb.test(b)?c[r.camelCase("default-"+b)]:!!d:c.getAttributeNode(b))&&!1!==e.value?b.toLowerCase():a},set:function(c,a,b){!1===a?r.removeAttr(c,b):Ja&&ha||!Cb.test(b)?c.setAttribute(!ha&&
|
|
59
|
-
r.propFix[b]||b,b):c[r.camelCase("default-"+b)]=c[b]=!0;return b}};Ja&&ha||(r.attrHooks.value={get:function(c,b){var e=c.getAttributeNode(b);return r.nodeName(c,"input")?c.defaultValue:e&&e.specified?e.value:a},set:function(c,a,b){if(r.nodeName(c,"input"))c.defaultValue=a;else return ab&&ab.set(c,a,b)}});ha||(ab=r.valHooks.button={get:function(c,b){var e=c.getAttributeNode(b);return e&&("id"===b||"name"===b||"coords"===b?""!==e.value:e.specified)?e.value:a},set:function(c,b,e){var d=c.getAttributeNode(e);
|
|
60
|
-
d||c.setAttributeNode(d=c.ownerDocument.createAttribute(e));d.value=b+="";return"value"===e||b===c.getAttribute(e)?b:a}},r.attrHooks.contenteditable={get:ab.get,set:function(c,a,b){ab.set(c,""===a?!1:a,b)}},r.each(["width","height"],function(c,a){r.attrHooks[a]=r.extend(r.attrHooks[a],{set:function(c,b){if(""===b)return c.setAttribute(a,"auto"),b}})}));r.support.hrefNormalized||(r.each(["href","src","width","height"],function(c,b){r.attrHooks[b]=r.extend(r.attrHooks[b],{get:function(c){c=c.getAttribute(b,
|
|
61
|
-
2);return null==c?a:c}})}),r.each(["href","src"],function(c,a){r.propHooks[a]={get:function(c){return c.getAttribute(a,4)}}}));r.support.style||(r.attrHooks.style={get:function(c){return c.style.cssText||a},set:function(c,a){return c.style.cssText=a+""}});r.support.optSelected||(r.propHooks.selected=r.extend(r.propHooks.selected,{get:function(c){if(c=c.parentNode)c.selectedIndex,c.parentNode&&c.parentNode.selectedIndex;return null}}));r.support.enctype||(r.propFix.enctype="encoding");r.support.checkOn||
|
|
62
|
-
r.each(["radio","checkbox"],function(){r.valHooks[this]={get:function(c){return null===c.getAttribute("value")?"on":c.value}}});r.each(["radio","checkbox"],function(){r.valHooks[this]=r.extend(r.valHooks[this],{set:function(c,a){if(r.isArray(a))return c.checked=0<=r.inArray(r(c).val(),a)}})});var Wb=/^(?:input|select|textarea)$/i,Xb=/^key/,X=/^(?:mouse|contextmenu)|click/,Db=/^(?:focusinfocus|focusoutblur)$/,Yb=/^([^.]*)(?:\.(.+)|)$/;r.event={global:{},add:function(c,b,e,d,g){var l,f,h,n,m,u,k,C,
|
|
63
|
-
O;if(h=r._data(c)){e.handler&&(n=e,e=n.handler,g=n.selector);e.guid||(e.guid=r.guid++);(f=h.events)||(f=h.events={});(m=h.handle)||(m=h.handle=function(c){return typeof r===ea||c&&r.event.triggered===c.type?a:r.event.dispatch.apply(m.elem,arguments)},m.elem=c);b=(b||"").match(ia)||[""];for(h=b.length;h--;)l=Yb.exec(b[h])||[],C=u=l[1],O=(l[2]||"").split(".").sort(),l=r.event.special[C]||{},C=(g?l.delegateType:l.bindType)||C,l=r.event.special[C]||{},u=r.extend({type:C,origType:u,data:d,handler:e,guid:e.guid,
|
|
64
|
-
selector:g,needsContext:g&&r.expr.match.needsContext.test(g),namespace:O.join(".")},n),(k=f[C])||(k=f[C]=[],k.delegateCount=0,l.setup&&!1!==l.setup.call(c,d,O,m)||(c.addEventListener?c.addEventListener(C,m,!1):c.attachEvent&&c.attachEvent("on"+C,m))),l.add&&(l.add.call(c,u),u.handler.guid||(u.handler.guid=e.guid)),g?k.splice(k.delegateCount++,0,u):k.push(u),r.event.global[C]=!0;c=null}},remove:function(c,a,b,e,d){var g,l,f,h,n,m,u,k,C,O,q,z=r.hasData(c)&&r._data(c);if(z&&(m=z.events)){a=(a||"").match(ia)||
|
|
65
|
-
[""];for(n=a.length;n--;)if(f=Yb.exec(a[n])||[],C=q=f[1],O=(f[2]||"").split(".").sort(),C){u=r.event.special[C]||{};C=(e?u.delegateType:u.bindType)||C;k=m[C]||[];f=f[2]&&new RegExp("(^|\\.)"+O.join("\\.(?:.*\\.|)")+"(\\.|$)");for(h=g=k.length;g--;)l=k[g],!d&&q!==l.origType||b&&b.guid!==l.guid||f&&!f.test(l.namespace)||e&&e!==l.selector&&("**"!==e||!l.selector)||(k.splice(g,1),l.selector&&k.delegateCount--,u.remove&&u.remove.call(c,l));h&&!k.length&&(u.teardown&&!1!==u.teardown.call(c,O,z.handle)||
|
|
66
|
-
r.removeEvent(c,C,z.handle),delete m[C])}else for(C in m)r.event.remove(c,C+a[n],b,e,!0);r.isEmptyObject(m)&&(delete z.handle,r._removeData(c,"events"))}},trigger:function(b,e,d,g){var l,f,h,n,m,u,k=[d||S],C=Z.call(b,"type")?b.type:b;m=Z.call(b,"namespace")?b.namespace.split("."):[];h=l=d=d||S;if(3!==d.nodeType&&8!==d.nodeType&&!Db.test(C+r.event.triggered)&&(0<=C.indexOf(".")&&(m=C.split("."),C=m.shift(),m.sort()),f=0>C.indexOf(":")&&"on"+C,b=b[r.expando]?b:new r.Event(C,"object"===typeof b&&b),
|
|
67
|
-
b.isTrigger=!0,b.namespace=m.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=a,b.target||(b.target=d),e=null==e?[b]:r.makeArray(e,[b]),m=r.event.special[C]||{},g||!m.trigger||!1!==m.trigger.apply(d,e))){if(!g&&!m.noBubble&&!r.isWindow(d)){n=m.delegateType||C;Db.test(n+C)||(h=h.parentNode);for(;h;h=h.parentNode)k.push(h),l=h;l===(d.ownerDocument||S)&&k.push(l.defaultView||l.parentWindow||c)}for(u=0;(h=k[u++])&&!b.isPropagationStopped();)b.type=
|
|
68
|
-
1<u?n:m.bindType||C,(l=(r._data(h,"events")||{})[b.type]&&r._data(h,"handle"))&&l.apply(h,e),(l=f&&h[f])&&r.acceptData(h)&&l.apply&&!1===l.apply(h,e)&&b.preventDefault();b.type=C;if(!(g||b.isDefaultPrevented()||m._default&&!1!==m._default.apply(d.ownerDocument,e)||"click"===C&&r.nodeName(d,"a"))&&r.acceptData(d)&&f&&d[C]&&!r.isWindow(d)){(l=d[f])&&(d[f]=null);r.event.triggered=C;try{d[C]()}catch(O){}r.event.triggered=a;l&&(d[f]=l)}return b.result}},dispatch:function(c){c=r.event.fix(c);var b,e,d,
|
|
69
|
-
g,l=[],f=na.call(arguments);b=(r._data(this,"events")||{})[c.type]||[];var h=r.event.special[c.type]||{};f[0]=c;c.delegateTarget=this;if(!h.preDispatch||!1!==h.preDispatch.call(this,c)){l=r.event.handlers.call(this,c,b);for(b=0;(d=l[b++])&&!c.isPropagationStopped();)for(c.currentTarget=d.elem,g=0;(e=d.handlers[g++])&&!c.isImmediatePropagationStopped();)if(!c.namespace_re||c.namespace_re.test(e.namespace))c.handleObj=e,c.data=e.data,e=((r.event.special[e.origType]||{}).handle||e.handler).apply(d.elem,
|
|
70
|
-
f),e!==a&&!1===(c.result=e)&&(c.preventDefault(),c.stopPropagation());h.postDispatch&&h.postDispatch.call(this,c);return c.result}},handlers:function(c,b){var e,d,g,l,f=[],h=b.delegateCount,n=c.target;if(h&&n.nodeType&&(!c.button||"click"!==c.type))for(;n!=this;n=n.parentNode||this)if(1===n.nodeType&&(!0!==n.disabled||"click"!==c.type)){g=[];for(l=0;l<h;l++)d=b[l],e=d.selector+" ",g[e]===a&&(g[e]=d.needsContext?0<=r(e,this).index(n):r.find(e,this,null,[n]).length),g[e]&&g.push(d);g.length&&f.push({elem:n,
|
|
71
|
-
handlers:g})}h<b.length&&f.push({elem:this,handlers:b.slice(h)});return f},fix:function(c){if(c[r.expando])return c;var a,b,e;a=c.type;var d=c,g=this.fixHooks[a];g||(this.fixHooks[a]=g=X.test(a)?this.mouseHooks:Xb.test(a)?this.keyHooks:{});e=g.props?this.props.concat(g.props):this.props;c=new r.Event(d);for(a=e.length;a--;)b=e[a],c[b]=d[b];c.target||(c.target=d.srcElement||S);3===c.target.nodeType&&(c.target=c.target.parentNode);c.metaKey=!!c.metaKey;return g.filter?g.filter(c,d):c},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
|
|
72
|
-
fixHooks:{},keyHooks:{props:["char","charCode","key","keyCode"],filter:function(c,a){null==c.which&&(c.which=null!=a.charCode?a.charCode:a.keyCode);return c}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(c,b){var e,d,g=b.button,l=b.fromElement;null==c.pageX&&null!=b.clientX&&(e=c.target.ownerDocument||S,d=e.documentElement,e=e.body,c.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||
|
|
73
|
-
e&&e.clientLeft||0),c.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0));!c.relatedTarget&&l&&(c.relatedTarget=l===c.target?b.toElement:l);c.which||g===a||(c.which=g&1?1:g&2?3:g&4?2:0);return c}},special:{load:{noBubble:!0},click:{trigger:function(){if(r.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1}},focus:{trigger:function(){if(this!==S.activeElement&&this.focus)try{return this.focus(),!1}catch(c){}},delegateType:"focusin"},
|
|
74
|
-
blur:{trigger:function(){if(this===S.activeElement&&this.blur)return this.blur(),!1},delegateType:"focusout"},beforeunload:{postDispatch:function(c){c.result!==a&&(c.originalEvent.returnValue=c.result)}}},simulate:function(c,a,b,e){c=r.extend(new r.Event,b,{type:c,isSimulated:!0,originalEvent:{}});e?r.event.trigger(c,null,a):r.event.dispatch.call(a,c);c.isDefaultPrevented()&&b.preventDefault()}};r.removeEvent=S.removeEventListener?function(c,a,b){c.removeEventListener&&c.removeEventListener(a,b,!1)}:
|
|
75
|
-
function(c,a,b){a="on"+a;c.detachEvent&&(typeof c[a]===ea&&(c[a]=null),c.detachEvent(a,b))};r.Event=function(c,a){if(!(this instanceof r.Event))return new r.Event(c,a);c&&c.type?(this.originalEvent=c,this.type=c.type,this.isDefaultPrevented=c.defaultPrevented||!1===c.returnValue||c.getPreventDefault&&c.getPreventDefault()?m:k):this.type=c;a&&r.extend(this,a);this.timeStamp=c&&c.timeStamp||r.now();this[r.expando]=!0};r.Event.prototype={isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k,
|
|
76
|
-
preventDefault:function(){var c=this.originalEvent;this.isDefaultPrevented=m;c&&(c.preventDefault?c.preventDefault():c.returnValue=!1)},stopPropagation:function(){var c=this.originalEvent;this.isPropagationStopped=m;c&&(c.stopPropagation&&c.stopPropagation(),c.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=m;this.stopPropagation()}};r.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(c,a){r.event.special[c]={delegateType:a,bindType:a,handle:function(c){var b,
|
|
77
|
-
e=c.relatedTarget,d=c.handleObj;if(!e||e!==this&&!r.contains(this,e))c.type=d.origType,b=d.handler.apply(this,arguments),c.type=a;return b}}});r.support.submitBubbles||(r.event.special.submit={setup:function(){if(r.nodeName(this,"form"))return!1;r.event.add(this,"click._submit keypress._submit",function(c){c=c.target;(c=r.nodeName(c,"input")||r.nodeName(c,"button")?c.form:a)&&!r._data(c,"submitBubbles")&&(r.event.add(c,"submit._submit",function(c){c._submit_bubble=!0}),r._data(c,"submitBubbles",!0))})},
|
|
78
|
-
postDispatch:function(c){c._submit_bubble&&(delete c._submit_bubble,this.parentNode&&!c.isTrigger&&r.event.simulate("submit",this.parentNode,c,!0))},teardown:function(){if(r.nodeName(this,"form"))return!1;r.event.remove(this,"._submit")}});r.support.changeBubbles||(r.event.special.change={setup:function(){if(Wb.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type)r.event.add(this,"propertychange._change",function(c){"checked"===c.originalEvent.propertyName&&(this._just_changed=!0)}),
|
|
79
|
-
r.event.add(this,"click._change",function(c){this._just_changed&&!c.isTrigger&&(this._just_changed=!1);r.event.simulate("change",this,c,!0)});return!1}r.event.add(this,"beforeactivate._change",function(c){c=c.target;Wb.test(c.nodeName)&&!r._data(c,"changeBubbles")&&(r.event.add(c,"change._change",function(c){!this.parentNode||c.isSimulated||c.isTrigger||r.event.simulate("change",this.parentNode,c,!0)}),r._data(c,"changeBubbles",!0))})},handle:function(c){var a=c.target;if(this!==a||c.isSimulated||
|
|
80
|
-
c.isTrigger||"radio"!==a.type&&"checkbox"!==a.type)return c.handleObj.handler.apply(this,arguments)},teardown:function(){r.event.remove(this,"._change");return!Wb.test(this.nodeName)}});r.support.focusinBubbles||r.each({focus:"focusin",blur:"focusout"},function(c,a){var b=0,e=function(c){r.event.simulate(a,c.target,r.event.fix(c),!0)};r.event.special[a]={setup:function(){0===b++&&S.addEventListener(c,e,!0)},teardown:function(){0===--b&&S.removeEventListener(c,e,!0)}}});r.fn.extend({on:function(c,
|
|
81
|
-
b,e,d,g){var l,f;if("object"===typeof c){"string"!==typeof b&&(e=e||b,b=a);for(l in c)this.on(l,b,e,c[l],g);return this}null==e&&null==d?(d=b,e=b=a):null==d&&("string"===typeof b?(d=e,e=a):(d=e,e=b,b=a));if(!1===d)d=k;else if(!d)return this;1===g&&(f=d,d=function(c){r().off(c);return f.apply(this,arguments)},d.guid=f.guid||(f.guid=r.guid++));return this.each(function(){r.event.add(this,c,d,e,b)})},one:function(c,a,b,e){return this.on(c,a,b,e,1)},off:function(c,b,e){var d;if(c&&c.preventDefault&&c.handleObj)return d=
|
|
82
|
-
c.handleObj,r(c.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"===typeof c){for(d in c)this.off(d,b,c[d]);return this}if(!1===b||"function"===typeof b)e=b,b=a;!1===e&&(e=k);return this.each(function(){r.event.remove(this,c,e,b)})},bind:function(c,a,b){return this.on(c,null,a,b)},unbind:function(c,a){return this.off(c,null,a)},delegate:function(c,a,b,e){return this.on(a,c,b,e)},undelegate:function(c,a,b){return 1===arguments.length?this.off(c,
|
|
83
|
-
"**"):this.off(a,c||"**",b)},trigger:function(c,a){return this.each(function(){r.event.trigger(c,a,this)})},triggerHandler:function(c,a){var b=this[0];if(b)return r.event.trigger(c,a,b,!0)}});(function(c,a){function b(c){return ha.test(c+"")}function e(){var c,a=[];return c=function(b,e){a.push(b+=" ")>A.cacheLength&&delete c[a.shift()];return c[b]=e}}function d(c){c[R]=!0;return c}function g(c){var a=D.createElement("div");try{return c(a)}catch(b){return!1}finally{}}function l(c,a,b,e){var d,g,f,
|
|
84
|
-
h,n;(a?a.ownerDocument||a:N)!==D&&M(a);a=a||D;b=b||[];if(!c||"string"!==typeof c)return b;if(1!==(h=a.nodeType)&&9!==h)return[];if(!y&&!e){if(d=Ub.exec(c))if(f=d[1])if(9===h)if((g=a.getElementById(f))&&g.parentNode){if(g.id===f)return b.push(g),b}else return b;else{if(a.ownerDocument&&(g=a.ownerDocument.getElementById(f))&&E(a,g)&&g.id===f)return b.push(g),b}else{if(d[2])return ma.apply(b,Aa.call(a.getElementsByTagName(c),0)),b;if((f=d[3])&&U.getByClassName&&a.getElementsByClassName)return ma.apply(b,
|
|
85
|
-
Aa.call(a.getElementsByClassName(f),0)),b}if(U.qsa&&!L.test(c)){d=!0;g=R;f=a;n=9===h&&c;if(1===h&&"object"!==a.nodeName.toLowerCase()){h=u(c);(d=a.getAttribute("id"))?g=d.replace(ka,"\\$&"):a.setAttribute("id",g);g="[id='"+g+"'] ";for(f=h.length;f--;)h[f]=g+k(h[f]);f=ca.test(c)&&a.parentNode||a;n=h.join(",")}if(n)try{return ma.apply(b,Aa.call(f.querySelectorAll(n),0)),b}catch(m){}finally{d||a.removeAttribute("id")}}}var C;a:{c=c.replace(Qa,"$1");g=u(c);if(!e&&1===g.length){d=g[0]=g[0].slice(0);if(2<
|
|
86
|
-
d.length&&"ID"===(C=d[0]).type&&9===a.nodeType&&!y&&A.relative[d[1].type]){a=A.find.ID(C.matches[0].replace(fa,ia),a)[0];if(!a){C=b;break a}c=c.slice(d.shift().value.length)}for(h=X.needsContext.test(c)?0:d.length;h--;){C=d[h];if(A.relative[f=C.type])break;if(f=A.find[f])if(e=f(C.matches[0].replace(fa,ia),ca.test(d[0].type)&&a.parentNode||a)){d.splice(h,1);c=e.length&&k(d);if(!c){ma.apply(b,Aa.call(e,0));C=b;break a}break}}}H(c,g)(e,a,y,b,ca.test(c));C=b}return C}function f(c,a){var b=a&&c,e=b&&(~a.sourceIndex||
|
|
87
|
-
-2147483648)-(~c.sourceIndex||-2147483648);if(e)return e;if(b)for(;b=b.nextSibling;)if(b===a)return-1;return c?1:-1}function h(c){return function(a){return"input"===a.nodeName.toLowerCase()&&a.type===c}}function n(c){return function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&a.type===c}}function m(c){return d(function(a){a=+a;return d(function(b,e){for(var d,g=c([],b.length,a),l=g.length;l--;)b[d=g[l]]&&(b[d]=!(e[d]=b[d]))})})}function u(c,a){var b,e,d,g,f,h,n;if(f=K[c+" "])return a?
|
|
88
|
-
0:f.slice(0);f=c;h=[];for(n=A.preFilter;f;){if(!b||(e=V.exec(f)))e&&(f=f.slice(e[0].length)||f),h.push(d=[]);b=!1;if(e=Sb.exec(f))b=e.shift(),d.push({value:b,type:e[0].replace(Qa," ")}),f=f.slice(b.length);for(g in A.filter)!(e=X[g].exec(f))||n[g]&&!(e=n[g](e))||(b=e.shift(),d.push({value:b,type:g,matches:e}),f=f.slice(b.length));if(!b)break}return a?f.length:f?l.error(c):K(c,h).slice(0)}function k(c){for(var a=0,b=c.length,e="";a<b;a++)e+=c[a].value;return e}function C(c,a,b){var e=a.dir,d=b&&"parentNode"===
|
|
89
|
-
e,g=qa++;return a.first?function(a,b,g){for(;a=a[e];)if(1===a.nodeType||d)return c(a,b,g)}:function(a,b,l){var f,h,n,m=T+" "+g;if(l)for(;a=a[e];){if((1===a.nodeType||d)&&c(a,b,l))return!0}else for(;a=a[e];)if(1===a.nodeType||d)if(n=a[R]||(a[R]={}),(h=n[e])&&h[0]===m){if(!0===(f=h[1])||f===B)return!0===f}else if(h=n[e]=[m],h[1]=c(a,b,l)||B,!0===h[1])return!0}}function O(c){return 1<c.length?function(a,b,e){for(var d=c.length;d--;)if(!c[d](a,b,e))return!1;return!0}:c[0]}function q(c,a,b,e,d){for(var g,
|
|
90
|
-
l=[],f=0,h=c.length,n=null!=a;f<h;f++)if(g=c[f])if(!b||b(g,e,d))l.push(g),n&&a.push(f);return l}function z(c,a,b,e,g,f){e&&!e[R]&&(e=z(e));g&&!g[R]&&(g=z(g,f));return d(function(d,f,h,n){var m,u,k=[],C=[],O=f.length,z;if(!(z=d)){z=a||"*";for(var v=h.nodeType?[h]:h,x=[],t=0,p=v.length;t<p;t++)l(z,v[t],x);z=x}z=!c||!d&&a?z:q(z,k,c,h,n);v=b?g||(d?c:O||e)?[]:f:z;b&&b(z,v,h,n);if(e)for(m=q(v,C),e(m,[],h,n),h=m.length;h--;)if(u=m[h])v[C[h]]=!(z[C[h]]=u);if(d){if(g||c){if(g){m=[];for(h=v.length;h--;)(u=
|
|
91
|
-
v[h])&&m.push(z[h]=u);g(null,v=[],m,n)}for(h=v.length;h--;)(u=v[h])&&-1<(m=g?ga.call(d,u):k[h])&&(d[m]=!(f[m]=u))}}else v=q(v===f?v.splice(O,v.length):v),g?g(null,f,v,n):ma.apply(f,v)})}function v(c){var a,b,e,d=c.length,g=A.relative[c[0].type];b=g||A.relative[" "];for(var l=g?1:0,f=C(function(c){return c===a},b,!0),h=C(function(c){return-1<ga.call(a,c)},b,!0),n=[function(c,b,e){return!g&&(e||b!==G)||((a=b).nodeType?f(c,b,e):h(c,b,e))}];l<d;l++)if(b=A.relative[c[l].type])n=[C(O(n),b)];else{b=A.filter[c[l].type].apply(null,
|
|
92
|
-
c[l].matches);if(b[R]){for(e=++l;e<d&&!A.relative[c[e].type];e++);return z(1<l&&O(n),1<l&&k(c.slice(0,l-1)).replace(Qa,"$1"),b,l<e&&v(c.slice(l,e)),e<d&&v(c=c.slice(e)),e<d&&k(c))}n.push(b)}return O(n)}function x(c,a){var b=0,e=0<a.length,g=0<c.length,f=function(d,f,h,n,m){var u,k,C=[],O=0,z="0",v=d&&[],x=null!=m,t=G,p=d||g&&A.find.TAG("*",m&&f.parentNode||f),w=T+=null==t?1:Math.random()||.1;x&&(G=f!==D&&f,B=b);for(;null!=(m=p[z]);z++){if(g&&m){for(u=0;k=c[u++];)if(k(m,f,h)){n.push(m);break}x&&(T=
|
|
93
|
-
w,B=++b)}e&&((m=!k&&m)&&O--,d&&v.push(m))}O+=z;if(e&&z!==O){for(u=0;k=a[u++];)k(v,C,f,h);if(d){if(0<O)for(;z--;)v[z]||C[z]||(C[z]=Pa.call(n));C=q(C)}ma.apply(n,C);x&&!d&&0<C.length&&1<O+a.length&&l.uniqueSort(n)}x&&(T=w,G=t);return v};return e?d(f):f}function t(){}var p,B,A,w,I,H,P,G,M,D,Q,y,L,J,S,E,F,R="sizzle"+-new Date,N=c.document,U={},T=0,qa=0,ua=e(),K=e(),ea=e(),W=typeof a,za=[],Pa=za.pop,ma=za.push,Aa=za.slice,ga=za.indexOf||function(c){for(var a=0,b=this.length;a<b;a++)if(this[a]===c)return a;
|
|
94
|
-
return-1},za="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w","w#"),Z="\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)[\\x20\\t\\r\\n\\f]*(?:([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+za+")|)|)[\\x20\\t\\r\\n\\f]*\\]",na=":((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+Z.replace(3,8)+")*)|.*)\\)|)",Qa=/^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g,V=/^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/,Sb=/^[\x20\t\r\n\f]*([\x20\t\r\n\f>+~])[\x20\t\r\n\f]*/,
|
|
95
|
-
da=new RegExp(na),Y=new RegExp("^"+za+"$"),X={ID:/^#((?:\\.|[\w-]|[^\x00-\xa0])+)/,CLASS:/^\.((?:\\.|[\w-]|[^\x00-\xa0])+)/,NAME:/^\[name=['"]?((?:\\.|[\w-]|[^\x00-\xa0])+)['"]?\]/,TAG:new RegExp("^("+"(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w","w*")+")"),ATTR:new RegExp("^"+Z),PSEUDO:new RegExp("^"+na),CHILD:/^:(only|first|last|nth|nth-last)-(child|of-type)(?:\([\x20\t\r\n\f]*(even|odd|(([+-]|)(\d*)n|)[\x20\t\r\n\f]*(?:([+-]|)[\x20\t\r\n\f]*(\d+)|))[\x20\t\r\n\f]*\)|)/i,needsContext:/^[\x20\t\r\n\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\([\x20\t\r\n\f]*((?:-\d)?\d*)[\x20\t\r\n\f]*\)|)(?=[^-]|$)/i},
|
|
96
|
-
ca=/[\x20\t\r\n\f]*[+~]/,ha=/^[^{]+\{\s*\[native code/,Ub=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ja=/^(?:input|select|textarea|button)$/i,ra=/^h\d$/i,ka=/'|\\/g,la=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,fa=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,ia=function(c,a){var b="0x"+a-65536;return b!==b?a:0>b?String.fromCharCode(b+65536):String.fromCharCode(b>>10|55296,b&1023|56320)};try{Aa.call(N.documentElement.childNodes,0)[0].nodeType}catch(pa){Aa=function(c){for(var a,b=[];a=this[c++];)b.push(a);
|
|
97
|
-
return b}}I=l.isXML=function(c){return(c=c&&(c.ownerDocument||c).documentElement)?"HTML"!==c.nodeName:!1};M=l.setDocument=function(c){var e=c?c.ownerDocument||c:N;if(e===D||9!==e.nodeType||!e.documentElement)return D;D=e;Q=e.documentElement;y=I(e);U.tagNameNoComments=g(function(c){c.appendChild(e.createComment(""));return!c.getElementsByTagName("*").length});U.attributes=g(function(c){c.innerHTML="<select></select>";c=typeof c.lastChild.getAttribute("multiple");return"boolean"!==c&&"string"!==c});
|
|
98
|
-
U.getByClassName=g(function(c){c.innerHTML="<div class='hidden e'></div><div class='hidden'></div>";if(!c.getElementsByClassName||!c.getElementsByClassName("e").length)return!1;c.lastChild.className="e";return 2===c.getElementsByClassName("e").length});U.getByName=g(function(c){c.id=R+0;c.innerHTML="<a name='"+R+"'></a><div name='"+R+"'></div>";Q.insertBefore(c,Q.firstChild);var a=e.getElementsByName&&e.getElementsByName(R).length===2+e.getElementsByName(R+0).length;U.getIdNotName=!e.getElementById(R);
|
|
99
|
-
Q.removeChild(c);return a});A.attrHandle=g(function(c){c.innerHTML="<a href='#'></a>";return c.firstChild&&typeof c.firstChild.getAttribute!==W&&"#"===c.firstChild.getAttribute("href")})?{}:{href:function(c){return c.getAttribute("href",2)},type:function(c){return c.getAttribute("type")}};U.getIdNotName?(A.find.ID=function(c,a){if(typeof a.getElementById!==W&&!y){var b=a.getElementById(c);return b&&b.parentNode?[b]:[]}},A.filter.ID=function(c){var a=c.replace(fa,ia);return function(c){return c.getAttribute("id")===
|
|
100
|
-
a}}):(A.find.ID=function(c,b){if(typeof b.getElementById!==W&&!y){var e=b.getElementById(c);return e?e.id===c||typeof e.getAttributeNode!==W&&e.getAttributeNode("id").value===c?[e]:a:[]}},A.filter.ID=function(c){var a=c.replace(fa,ia);return function(c){return(c=typeof c.getAttributeNode!==W&&c.getAttributeNode("id"))&&c.value===a}});A.find.TAG=U.tagNameNoComments?function(c,a){if(typeof a.getElementsByTagName!==W)return a.getElementsByTagName(c)}:function(c,a){var b,e=[],d=0,g=a.getElementsByTagName(c);
|
|
101
|
-
if("*"===c){for(;b=g[d++];)1===b.nodeType&&e.push(b);return e}return g};A.find.NAME=U.getByName&&function(c,a){if(typeof a.getElementsByName!==W)return a.getElementsByName(name)};A.find.CLASS=U.getByClassName&&function(c,a){if(typeof a.getElementsByClassName!==W&&!y)return a.getElementsByClassName(c)};J=[];L=[":focus"];if(U.qsa=b(e.querySelectorAll))g(function(c){c.innerHTML="<select><option selected=''></option></select>";c.querySelectorAll("[selected]").length||L.push("\\[[\\x20\\t\\r\\n\\f]*(?:checked|disabled|ismap|multiple|readonly|selected|value)");
|
|
102
|
-
c.querySelectorAll(":checked").length||L.push(":checked")}),g(function(c){c.innerHTML="<input type='hidden' i=''/>";c.querySelectorAll("[i^='']").length&&L.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:\"\"|'')");c.querySelectorAll(":enabled").length||L.push(":enabled",":disabled");c.querySelectorAll("*,:x");L.push(",.*:")});(U.matchesSelector=b(S=Q.matchesSelector||Q.mozMatchesSelector||Q.webkitMatchesSelector||Q.oMatchesSelector||Q.msMatchesSelector))&&g(function(c){U.disconnectedMatch=S.call(c,"div");S.call(c,
|
|
103
|
-
"[s!='']:x");J.push("!=",na)});L=new RegExp(L.join("|"));J=new RegExp(J.join("|"));E=b(Q.contains)||Q.compareDocumentPosition?function(c,a){var b=9===c.nodeType?c.documentElement:c,e=a&&a.parentNode;return c===e||!!(e&&1===e.nodeType&&(b.contains?b.contains(e):c.compareDocumentPosition&&c.compareDocumentPosition(e)&16))}:function(c,a){if(a)for(;a=a.parentNode;)if(a===c)return!0;return!1};F=Q.compareDocumentPosition?function(c,a){var b;return c===a?(P=!0,0):(b=a.compareDocumentPosition&&c.compareDocumentPosition&&
|
|
104
|
-
c.compareDocumentPosition(a))?b&1||c.parentNode&&11===c.parentNode.nodeType?c===e||E(N,c)?-1:a===e||E(N,a)?1:0:b&4?-1:1:c.compareDocumentPosition?-1:1}:function(c,a){var b,d=0;b=c.parentNode;var g=a.parentNode,l=[c],h=[a];if(c===a)return P=!0,0;if(!b||!g)return c===e?-1:a===e?1:b?-1:g?1:0;if(b===g)return f(c,a);for(b=c;b=b.parentNode;)l.unshift(b);for(b=a;b=b.parentNode;)h.unshift(b);for(;l[d]===h[d];)d++;return d?f(l[d],h[d]):l[d]===N?-1:h[d]===N?1:0};P=!1;[0,0].sort(F);U.detectDuplicates=P;return D};
|
|
105
|
-
l.matches=function(c,a){return l(c,null,null,a)};l.matchesSelector=function(c,a){(c.ownerDocument||c)!==D&&M(c);a=a.replace(la,"='$1']");if(!(!U.matchesSelector||y||J&&J.test(a)||L.test(a)))try{var b=S.call(c,a);if(b||U.disconnectedMatch||c.document&&11!==c.document.nodeType)return b}catch(e){}return 0<l(a,D,null,[c]).length};l.contains=function(c,a){(c.ownerDocument||c)!==D&&M(c);return E(c,a)};l.attr=function(c,a){var b;(c.ownerDocument||c)!==D&&M(c);y||(a=a.toLowerCase());return(b=A.attrHandle[a])?
|
|
106
|
-
b(c):y||U.attributes?c.getAttribute(a):((b=c.getAttributeNode(a))||c.getAttribute(a))&&!0===c[a]?a:b&&b.specified?b.value:null};l.error=function(c){throw Error("Syntax error, unrecognized expression: "+c);};l.uniqueSort=function(c){var a,b=[],e=1,d=0;P=!U.detectDuplicates;c.sort(F);if(P){for(;a=c[e];e++)a===c[e-1]&&(d=b.push(e));for(;d--;)c.splice(b[d],1)}return c};w=l.getText=function(c){var a,b="",e=0;a=c.nodeType;if(!a)for(;a=c[e];e++)b+=w(a);else if(1===a||9===a||11===a){if("string"===typeof c.textContent)return c.textContent;
|
|
107
|
-
for(c=c.firstChild;c;c=c.nextSibling)b+=w(c)}else if(3===a||4===a)return c.nodeValue;return b};A=l.selectors={cacheLength:50,createPseudo:d,match:X,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(c){c[1]=c[1].replace(fa,ia);c[3]=(c[4]||c[5]||"").replace(fa,ia);"~="===c[2]&&(c[3]=" "+c[3]+" ");return c.slice(0,4)},CHILD:function(c){c[1]=c[1].toLowerCase();"nth"===c[1].slice(0,3)?(c[3]||
|
|
108
|
-
l.error(c[0]),c[4]=+(c[4]?c[5]+(c[6]||1):2*("even"===c[3]||"odd"===c[3])),c[5]=+(c[7]+c[8]||"odd"===c[3])):c[3]&&l.error(c[0]);return c},PSEUDO:function(c){var a,b=!c[5]&&c[2];if(X.CHILD.test(c[0]))return null;c[4]?c[2]=c[4]:b&&da.test(b)&&(a=u(b,!0))&&(a=b.indexOf(")",b.length-a)-b.length)&&(c[0]=c[0].slice(0,a),c[2]=b.slice(0,a));return c.slice(0,3)}},filter:{TAG:function(c){if("*"===c)return function(){return!0};c=c.replace(fa,ia).toLowerCase();return function(a){return a.nodeName&&a.nodeName.toLowerCase()===
|
|
109
|
-
c}},CLASS:function(c){var a=ua[c+" "];return a||(a=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+c+"([\\x20\\t\\r\\n\\f]|$)"))&&ua(c,function(c){return a.test(c.className||typeof c.getAttribute!==W&&c.getAttribute("class")||"")})},ATTR:function(c,a,b){return function(e){e=l.attr(e,c);if(null==e)return"!="===a;if(!a)return!0;e+="";return"="===a?e===b:"!="===a?e!==b:"^="===a?b&&0===e.indexOf(b):"*="===a?b&&-1<e.indexOf(b):"$="===a?b&&e.slice(-b.length)===b:"~="===a?-1<(" "+e+" ").indexOf(b):"|="===a?e===b||
|
|
110
|
-
e.slice(0,b.length+1)===b+"-":!1}},CHILD:function(c,a,b,e,d){var g="nth"!==c.slice(0,3),l="last"!==c.slice(-4),f="of-type"===a;return 1===e&&0===d?function(c){return!!c.parentNode}:function(a,b,h){var n,m,u,k,C;b=g!==l?"nextSibling":"previousSibling";var O=a.parentNode,z=f&&a.nodeName.toLowerCase();h=!h&&!f;if(O){if(g){for(;b;){for(m=a;m=m[b];)if(f?m.nodeName.toLowerCase()===z:1===m.nodeType)return!1;C=b="only"===c&&!C&&"nextSibling"}return!0}C=[l?O.firstChild:O.lastChild];if(l&&h)for(h=O[R]||(O[R]=
|
|
111
|
-
{}),n=h[c]||[],k=n[0]===T&&n[1],u=n[0]===T&&n[2],m=k&&O.childNodes[k];m=++k&&m&&m[b]||(u=k=0)||C.pop();){if(1===m.nodeType&&++u&&m===a){h[c]=[T,k,u];break}}else if(h&&(n=(a[R]||(a[R]={}))[c])&&n[0]===T)u=n[1];else for(;(m=++k&&m&&m[b]||(u=k=0)||C.pop())&&((f?m.nodeName.toLowerCase()!==z:1!==m.nodeType)||!++u||(h&&((m[R]||(m[R]={}))[c]=[T,u]),m!==a)););u-=d;return u===e||0===u%e&&0<=u/e}}},PSEUDO:function(c,a){var b,e=A.pseudos[c]||A.setFilters[c.toLowerCase()]||l.error("unsupported pseudo: "+c);return e[R]?
|
|
112
|
-
e(a):1<e.length?(b=[c,c,"",a],A.setFilters.hasOwnProperty(c.toLowerCase())?d(function(c,b){for(var d,g=e(c,a),l=g.length;l--;)d=ga.call(c,g[l]),c[d]=!(b[d]=g[l])}):function(c){return e(c,0,b)}):e}},pseudos:{not:d(function(c){var a=[],b=[],e=H(c.replace(Qa,"$1"));return e[R]?d(function(c,a,b,d){d=e(c,null,d,[]);for(var g=c.length;g--;)if(b=d[g])c[g]=!(a[g]=b)}):function(c,d,g){a[0]=c;e(a,null,g,b);return!b.pop()}}),has:d(function(c){return function(a){return 0<l(c,a).length}}),contains:d(function(c){return function(a){return-1<
|
|
113
|
-
(a.textContent||a.innerText||w(a)).indexOf(c)}}),lang:d(function(c){Y.test(c||"")||l.error("unsupported lang: "+c);c=c.replace(fa,ia).toLowerCase();return function(a){var b;do if(b=y?a.getAttribute("xml:lang")||a.getAttribute("lang"):a.lang)return b=b.toLowerCase(),b===c||0===b.indexOf(c+"-");while((a=a.parentNode)&&1===a.nodeType);return!1}}),target:function(a){var b=c.location&&c.location.hash;return b&&b.slice(1)===a.id},root:function(c){return c===Q},focus:function(c){return c===D.activeElement&&
|
|
114
|
-
(!D.hasFocus||D.hasFocus())&&!!(c.type||c.href||~c.tabIndex)},enabled:function(c){return!1===c.disabled},disabled:function(c){return!0===c.disabled},checked:function(c){var a=c.nodeName.toLowerCase();return"input"===a&&!!c.checked||"option"===a&&!!c.selected},selected:function(c){c.parentNode&&c.parentNode.selectedIndex;return!0===c.selected},empty:function(c){for(c=c.firstChild;c;c=c.nextSibling)if("@"<c.nodeName||3===c.nodeType||4===c.nodeType)return!1;return!0},parent:function(c){return!A.pseudos.empty(c)},
|
|
115
|
-
header:function(c){return ra.test(c.nodeName)},input:function(c){return ja.test(c.nodeName)},button:function(c){var a=c.nodeName.toLowerCase();return"input"===a&&"button"===c.type||"button"===a},text:function(c){var a;return"input"===c.nodeName.toLowerCase()&&"text"===c.type&&(null==(a=c.getAttribute("type"))||a.toLowerCase()===c.type)},first:m(function(){return[0]}),last:m(function(c,a){return[a-1]}),eq:m(function(c,a,b){return[0>b?b+a:b]}),even:m(function(c,a){for(var b=0;b<a;b+=2)c.push(b);return c}),
|
|
116
|
-
odd:m(function(c,a){for(var b=1;b<a;b+=2)c.push(b);return c}),lt:m(function(c,a,b){for(a=0>b?b+a:b;0<=--a;)c.push(a);return c}),gt:m(function(c,a,b){for(b=0>b?b+a:b;++b<a;)c.push(b);return c})}};for(p in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})A.pseudos[p]=h(p);for(p in{submit:!0,reset:!0})A.pseudos[p]=n(p);H=l.compile=function(c,a){var b,e=[],d=[],g=ea[c+" "];if(!g){a||(a=u(c));for(b=a.length;b--;)g=v(a[b]),g[R]?e.push(g):d.push(g);g=ea(c,x(d,e))}return g};A.pseudos.nth=A.pseudos.eq;A.filters=
|
|
117
|
-
t.prototype=A.pseudos;A.setFilters=new t;M();l.attr=r.attr;r.find=l;r.expr=l.selectors;r.expr[":"]=r.expr.pseudos;r.unique=l.uniqueSort;r.text=l.getText;r.isXMLDoc=l.isXML;r.contains=l.contains})(c);var rb=/Until$/,bb=/^(?:parents|prev(?:Until|All))/,Ea=/^.[^:#\[\.,]*$/,sb=r.expr.match.needsContext,cb={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({find:function(c){var a,b,e,d=this.length;if("string"!==typeof c)return e=this,this.pushStack(r(c).filter(function(){for(a=0;a<d;a++)if(r.contains(e[a],
|
|
118
|
-
this))return!0}));b=[];for(a=0;a<d;a++)r.find(c,this[a],b);b=this.pushStack(1<d?r.unique(b):b);b.selector=(this.selector?this.selector+" ":"")+c;return b},has:function(c){var a,b=r(c,this),e=b.length;return this.filter(function(){for(a=0;a<e;a++)if(r.contains(this,b[a]))return!0})},not:function(c){return this.pushStack(t(this,c,!1))},filter:function(c){return this.pushStack(t(this,c,!0))},is:function(c){return!!c&&("string"===typeof c?sb.test(c)?0<=r(c,this.context).index(this[0]):0<r.filter(c,this).length:
|
|
119
|
-
0<this.filter(c).length)},closest:function(c,a){for(var b,e=0,d=this.length,g=[],l=sb.test(c)||"string"!==typeof c?r(c,a||this.context):0;e<d;e++)for(b=this[e];b&&b.ownerDocument&&b!==a&&11!==b.nodeType;){if(l?-1<l.index(b):r.find.matchesSelector(b,c)){g.push(b);break}b=b.parentNode}return this.pushStack(1<g.length?r.unique(g):g)},index:function(c){return c?"string"===typeof c?r.inArray(this[0],r(c)):r.inArray(c.jquery?c[0]:c,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(c,
|
|
120
|
-
a){var b="string"===typeof c?r(c,a):r.makeArray(c&&c.nodeType?[c]:c),b=r.merge(this.get(),b);return this.pushStack(r.unique(b))},addBack:function(c){return this.add(null==c?this.prevObject:this.prevObject.filter(c))}});r.fn.andSelf=r.fn.addBack;r.each({parent:function(c){return(c=c.parentNode)&&11!==c.nodeType?c:null},parents:function(c){return r.dir(c,"parentNode")},parentsUntil:function(c,a,b){return r.dir(c,"parentNode",b)},next:function(c){return p(c,"nextSibling")},prev:function(c){return p(c,
|
|
121
|
-
"previousSibling")},nextAll:function(c){return r.dir(c,"nextSibling")},prevAll:function(c){return r.dir(c,"previousSibling")},nextUntil:function(c,a,b){return r.dir(c,"nextSibling",b)},prevUntil:function(c,a,b){return r.dir(c,"previousSibling",b)},siblings:function(c){return r.sibling((c.parentNode||{}).firstChild,c)},children:function(c){return r.sibling(c.firstChild)},contents:function(c){return r.nodeName(c,"iframe")?c.contentDocument||c.contentWindow.document:r.merge([],c.childNodes)}},function(c,
|
|
122
|
-
a){r.fn[c]=function(b,e){var d=r.map(this,a,b);rb.test(c)||(e=b);e&&"string"===typeof e&&(d=r.filter(e,d));d=1<this.length&&!cb[c]?r.unique(d):d;1<this.length&&bb.test(c)&&(d=d.reverse());return this.pushStack(d)}});r.extend({filter:function(c,a,b){b&&(c=":not("+c+")");return 1===a.length?r.find.matchesSelector(a[0],c)?[a[0]]:[]:r.find.matches(c,a)},dir:function(c,b,e){var d=[];for(c=c[b];c&&9!==c.nodeType&&(e===a||1!==c.nodeType||!r(c).is(e));)1===c.nodeType&&d.push(c),c=c[b];return d},sibling:function(c,
|
|
123
|
-
a){for(var b=[];c;c=c.nextSibling)1===c.nodeType&&c!==a&&b.push(c);return b}});var pa="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",la=/ jQuery\d+="(?:null|\d+)"/g,Ma=new RegExp("<(?:"+pa+")[\\s/>]","i"),va=/^\s+/,Jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Kb=/<([\w:]+)/,Zb=/<tbody/i,Jc=/<|&#?\w+;/,Kc=/<(?:script|style|link)/i,vb=/^(?:checkbox|radio)$/i,
|
|
124
|
-
rc=/checked\s*(?:[^=]|=\s*.checked.)/i,V=/^$|\/(?:java|ecma)script/i,sa=/^true\/(.*)/,Lb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,fa={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:r.support.htmlSerialize?
|
|
125
|
-
[0,"",""]:[1,"X<div>","</div>"]},Mb=w(S).appendChild(S.createElement("div"));fa.optgroup=fa.option;fa.tbody=fa.tfoot=fa.colgroup=fa.caption=fa.thead;fa.th=fa.td;r.fn.extend({text:function(c){return r.access(this,function(c){return c===a?r.text(this):this.empty().append((this[0]&&this[0].ownerDocument||S).createTextNode(c))},null,c,arguments.length)},wrapAll:function(c){if(r.isFunction(c))return this.each(function(a){r(this).wrapAll(c.call(this,a))});if(this[0]){var a=r(c,this[0].ownerDocument).eq(0).clone(!0);
|
|
126
|
-
this[0].parentNode&&a.insertBefore(this[0]);a.map(function(){for(var c=this;c.firstChild&&1===c.firstChild.nodeType;)c=c.firstChild;return c}).append(this)}return this},wrapInner:function(c){return r.isFunction(c)?this.each(function(a){r(this).wrapInner(c.call(this,a))}):this.each(function(){var a=r(this),b=a.contents();b.length?b.wrapAll(c):a.append(c)})},wrap:function(c){var a=r.isFunction(c);return this.each(function(b){r(this).wrapAll(a?c.call(this,b):c)})},unwrap:function(){return this.parent().each(function(){r.nodeName(this,
|
|
127
|
-
"body")||r(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(c){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.appendChild(c)})},prepend:function(){return this.domManip(arguments,!0,function(c){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.insertBefore(c,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(c){this.parentNode&&this.parentNode.insertBefore(c,this)})},after:function(){return this.domManip(arguments,
|
|
128
|
-
!1,function(c){this.parentNode&&this.parentNode.insertBefore(c,this.nextSibling)})},remove:function(c,a){for(var b,e=0;null!=(b=this[e]);e++)if(!c||0<r.filter(c,[b]).length)a||1!==b.nodeType||r.cleanData(z(b)),b.parentNode&&(a&&r.contains(b.ownerDocument,b)&&G(z(b,"script")),b.parentNode.removeChild(b));return this},empty:function(){for(var c,a=0;null!=(c=this[a]);a++){for(1===c.nodeType&&r.cleanData(z(c,!1));c.firstChild;)c.removeChild(c.firstChild);c.options&&r.nodeName(c,"select")&&(c.options.length=
|
|
129
|
-
0)}return this},clone:function(c,a){c=null==c?!1:c;a=null==a?c:a;return this.map(function(){return r.clone(this,c,a)})},html:function(c){return r.access(this,function(c){var b=this[0]||{},e=0,d=this.length;if(c===a)return 1===b.nodeType?b.innerHTML.replace(la,""):a;if(!("string"!==typeof c||Kc.test(c)||!r.support.htmlSerialize&&Ma.test(c)||!r.support.leadingWhitespace&&va.test(c)||fa[(Kb.exec(c)||["",""])[1].toLowerCase()])){c=c.replace(Jb,"<$1></$2>");try{for(;e<d;e++)b=this[e]||{},1===b.nodeType&&
|
|
130
|
-
(r.cleanData(z(b,!1)),b.innerHTML=c);b=0}catch(g){}}b&&this.empty().append(c)},null,c,arguments.length)},replaceWith:function(c){r.isFunction(c)||"string"===typeof c||(c=r(c).not(this).detach());return this.domManip([c],!0,function(c){var a=this.nextSibling,b=this.parentNode;b&&(r(this).remove(),b.insertBefore(c,a))})},detach:function(c){return this.remove(c,!0)},domManip:function(c,b,e){c=Aa.apply([],c);var d,g,l,f,h=0,n=this.length,m=this,u=n-1,k=c[0],C=r.isFunction(k);if(C||!(1>=n||"string"!==
|
|
131
|
-
typeof k||r.support.checkClone)&&rc.test(k))return this.each(function(d){var g=m.eq(d);C&&(c[0]=k.call(this,d,b?g.html():a));g.domManip(c,b,e)});if(n&&(f=r.buildFragment(c,this[0].ownerDocument,!1,this),d=f.firstChild,1===f.childNodes.length&&(f=d),d)){b=b&&r.nodeName(d,"tr");l=r.map(z(f,"script"),A);for(g=l.length;h<n;h++)d=f,h!==u&&(d=r.clone(d,!0,!0),g&&r.merge(l,z(d,"script"))),e.call(b&&r.nodeName(this[h],"table")?B(this[h],"tbody"):this[h],d,h);if(g)for(f=l[l.length-1].ownerDocument,r.map(l,
|
|
132
|
-
x),h=0;h<g;h++)d=l[h],V.test(d.type||"")&&!r._data(d,"globalEval")&&r.contains(f,d)&&(d.src?r.ajax({url:d.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):r.globalEval((d.text||d.textContent||d.innerHTML||"").replace(Lb,"")));f=d=null}return this}});r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(c,a){r.fn[c]=function(c){for(var b=0,e=[],d=r(c),g=d.length-1;b<=g;b++)c=b===g?this:this.clone(!0),r(d[b])[a](c),
|
|
133
|
-
ga.apply(e,c.get());return this.pushStack(e)}});r.extend({clone:function(c,a,b){var e,d,g,l,f,h=r.contains(c.ownerDocument,c);r.support.html5Clone||r.isXMLDoc(c)||!Ma.test("<"+c.nodeName+">")?g=c.cloneNode(!0):(Mb.innerHTML=c.outerHTML,Mb.removeChild(g=Mb.firstChild));if(!(r.support.noCloneEvent&&r.support.noCloneChecked||1!==c.nodeType&&11!==c.nodeType||r.isXMLDoc(c)))for(e=z(g),f=z(c),l=0;null!=(d=f[l]);++l)if(e[l]){var n=e[l],m=void 0,u=void 0,k=void 0;if(1===n.nodeType){m=n.nodeName.toLowerCase();
|
|
134
|
-
if(!r.support.noCloneEvent&&n[r.expando]){k=r._data(n);for(u in k.events)r.removeEvent(n,u,k.handle);n.removeAttribute(r.expando)}if("script"===m&&n.text!==d.text)A(n).text=d.text,x(n);else if("object"===m)n.parentNode&&(n.outerHTML=d.outerHTML),r.support.html5Clone&&d.innerHTML&&!r.trim(n.innerHTML)&&(n.innerHTML=d.innerHTML);else if("input"===m&&vb.test(d.type))n.defaultChecked=n.checked=d.checked,n.value!==d.value&&(n.value=d.value);else if("option"===m)n.defaultSelected=n.selected=d.defaultSelected;
|
|
135
|
-
else if("input"===m||"textarea"===m)n.defaultValue=d.defaultValue}}if(a)if(b)for(f=f||z(c),e=e||z(g),l=0;null!=(d=f[l]);l++)F(d,e[l]);else F(c,g);e=z(g,"script");0<e.length&&G(e,!h&&z(c,"script"));return g},buildFragment:function(c,a,b,e){for(var d,g,l,f,h,n,m=c.length,u=w(a),k=[],C=0;C<m;C++)if((g=c[C])||0===g)if("object"===r.type(g))r.merge(k,g.nodeType?[g]:g);else if(Jc.test(g)){l=l||u.appendChild(a.createElement("div"));f=(Kb.exec(g)||["",""])[1].toLowerCase();n=fa[f]||fa._default;l.innerHTML=
|
|
136
|
-
n[1]+g.replace(Jb,"<$1></$2>")+n[2];for(d=n[0];d--;)l=l.lastChild;!r.support.leadingWhitespace&&va.test(g)&&k.push(a.createTextNode(va.exec(g)[0]));if(!r.support.tbody)for(d=(g="table"!==f||Zb.test(g)?"<table>"!==n[1]||Zb.test(g)?0:l:l.firstChild)&&g.childNodes.length;d--;)r.nodeName(h=g.childNodes[d],"tbody")&&!h.childNodes.length&&g.removeChild(h);r.merge(k,l.childNodes);for(l.textContent="";l.firstChild;)l.removeChild(l.firstChild);l=u.lastChild}else k.push(a.createTextNode(g));l&&u.removeChild(l);
|
|
137
|
-
r.support.appendChecked||r.grep(z(k,"input"),L);for(C=0;g=k[C++];)if(!e||-1===r.inArray(g,e))if(c=r.contains(g.ownerDocument,g),l=z(u.appendChild(g),"script"),c&&G(l),b)for(d=0;g=l[d++];)V.test(g.type||"")&&b.push(g);return u},cleanData:function(c,a){for(var b,e,d,g,l=0,f=r.expando,h=r.cache,n=r.support.deleteExpando,m=r.event.special;null!=(b=c[l]);l++)if(a||r.acceptData(b))if(g=(d=b[f])&&h[d]){if(g.events)for(e in g.events)m[e]?r.event.remove(b,e):r.removeEvent(b,e,g.handle);h[d]&&(delete h[d],
|
|
138
|
-
n?delete b[f]:typeof b.removeAttribute!==ea?b.removeAttribute(f):b[f]=null,ma.push(d))}}});var wa,ja,Oa,tb=/alpha\([^)]*\)/i,Lc=/opacity\s*=\s*([^)]*)/,$b=/^(top|right|bottom|left)$/,Wa=/^(none|table(?!-c[ea]).+)/,ca=/^margin/,Ac=new RegExp("^("+zb+")(.*)$","i"),wb=new RegExp("^("+zb+")(?!px)[a-z%]+$","i"),db=new RegExp("^([+-])=("+zb+")","i"),xb={BODY:"block"},ac={position:"absolute",visibility:"hidden",display:"block"},sc={letterSpacing:0,fontWeight:400},ya=["Top","Right","Bottom","Left"],mc=["Webkit",
|
|
139
|
-
"O","Moz","ms"];r.fn.extend({css:function(c,b){return r.access(this,function(c,b,e){var d,g={},l=0;if(r.isArray(b)){d=ja(c);for(e=b.length;l<e;l++)g[b[l]]=r.css(c,b[l],!1,d);return g}return e!==a?r.style(c,b,e):r.css(c,b)},c,b,1<arguments.length)},show:function(){return K(this,!0)},hide:function(){return K(this)},toggle:function(c){var a="boolean"===typeof c;return this.each(function(){(a?c:J(this))?r(this).show():r(this).hide()})}});r.extend({cssHooks:{opacity:{get:function(c,a){if(a){var b=Oa(c,
|
|
140
|
-
"opacity");return""===b?"1":b}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":r.support.cssFloat?"cssFloat":"styleFloat"},style:function(c,b,e,d){if(c&&3!==c.nodeType&&8!==c.nodeType&&c.style){var g,f,h,n=r.camelCase(b),m=c.style;b=r.cssProps[n]||(r.cssProps[n]=l(m,n));h=r.cssHooks[b]||r.cssHooks[n];if(e!==a){if(f=typeof e,"string"===f&&(g=db.exec(e))&&(e=(g[1]+1)*g[2]+parseFloat(r.css(c,b)),f="number"),
|
|
141
|
-
!(null==e||"number"===f&&isNaN(e)||("number"!==f||r.cssNumber[n]||(e+="px"),r.support.clearCloneStyle||""!==e||0!==b.indexOf("background")||(m[b]="inherit"),h&&"set"in h&&(e=h.set(c,e,d))===a)))try{m[b]=e}catch(u){}}else return h&&"get"in h&&(g=h.get(c,!1,d))!==a?g:m[b]}},css:function(c,b,e,d){var g,f;f=r.camelCase(b);b=r.cssProps[f]||(r.cssProps[f]=l(c.style,f));(f=r.cssHooks[b]||r.cssHooks[f])&&"get"in f&&(g=f.get(c,!0,e));g===a&&(g=Oa(c,b,d));"normal"===g&&b in sc&&(g=sc[b]);return""===e||e?(c=
|
|
142
|
-
parseFloat(g),!0===e||r.isNumeric(c)?c||0:g):g},swap:function(c,a,b,e){var d,g={};for(d in a)g[d]=c.style[d],c.style[d]=a[d];b=b.apply(c,e||[]);for(d in a)c.style[d]=g[d];return b}});c.getComputedStyle?(ja=function(a){return c.getComputedStyle(a,null)},Oa=function(c,b,e){var d,g=(e=e||ja(c))?e.getPropertyValue(b)||e[b]:a,l=c.style;e&&(""!==g||r.contains(c.ownerDocument,c)||(g=r.style(c,b)),wb.test(g)&&ca.test(b)&&(c=l.width,b=l.minWidth,d=l.maxWidth,l.minWidth=l.maxWidth=l.width=g,g=e.width,l.width=
|
|
143
|
-
c,l.minWidth=b,l.maxWidth=d));return g}):S.documentElement.currentStyle&&(ja=function(c){return c.currentStyle},Oa=function(c,b,e){var d,g,l=(e=e||ja(c))?e[b]:a,f=c.style;null==l&&f&&f[b]&&(l=f[b]);if(wb.test(l)&&!$b.test(b)){e=f.left;if(g=(d=c.runtimeStyle)&&d.left)d.left=c.currentStyle.left;f.left="fontSize"===b?"1em":l;l=f.pixelLeft+"px";f.left=e;g&&(d.left=g)}return""===l?"auto":l});r.each(["height","width"],function(c,a){r.cssHooks[a]={get:function(c,b,e){if(b)return 0===c.offsetWidth&&Wa.test(r.css(c,
|
|
144
|
-
"display"))?r.swap(c,ac,function(){return D(c,a,e)}):D(c,a,e)},set:function(c,b,e){var d=e&&ja(c);return E(c,b,e?y(c,a,e,r.support.boxSizing&&"border-box"===r.css(c,"boxSizing",!1,d),d):0)}}});r.support.opacity||(r.cssHooks.opacity={get:function(c,a){return Lc.test((a&&c.currentStyle?c.currentStyle.filter:c.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":a?"1":""},set:function(c,a){var b=c.style,e=c.currentStyle,d=r.isNumeric(a)?"alpha(opacity="+100*a+")":"",g=e&&e.filter||b.filter||"";b.zoom=1;if((1<=
|
|
145
|
-
a||""===a)&&""===r.trim(g.replace(tb,""))&&b.removeAttribute&&(b.removeAttribute("filter"),""===a||e&&!e.filter))return;b.filter=tb.test(g)?g.replace(tb,d):g+" "+d}});r(function(){r.support.reliableMarginRight||(r.cssHooks.marginRight={get:function(c,a){if(a)return r.swap(c,{display:"inline-block"},Oa,[c,"marginRight"])}});!r.support.pixelPosition&&r.fn.position&&r.each(["top","left"],function(c,a){r.cssHooks[a]={get:function(c,b){if(b)return b=Oa(c,a),wb.test(b)?r(c).position()[a]+"px":b}}})});r.expr&&
|
|
146
|
-
r.expr.filters&&(r.expr.filters.hidden=function(c){return 0>=c.offsetWidth&&0>=c.offsetHeight||!r.support.reliableHiddenOffsets&&"none"===(c.style&&c.style.display||r.css(c,"display"))},r.expr.filters.visible=function(c){return!r.expr.filters.hidden(c)});r.each({margin:"",padding:"",border:"Width"},function(c,a){r.cssHooks[c+a]={expand:function(b){var e=0,d={};for(b="string"===typeof b?b.split(" "):[b];4>e;e++)d[c+ya[e]+a]=b[e]||b[e-2]||b[0];return d}};ca.test(c)||(r.cssHooks[c+a].set=E)});var Mc=
|
|
147
|
-
/%20/g,Bc=/\[\]$/,tc=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,Nc=/^(?:input|select|textarea|keygen)/i;r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var c=r.prop(this,"elements");return c?r.makeArray(c):this}).filter(function(){var c=this.type;return this.name&&!r(this).is(":disabled")&&Nc.test(this.nodeName)&&!bc.test(c)&&(this.checked||!vb.test(c))}).map(function(c,a){var b=r(this).val();return null==b?null:
|
|
148
|
-
r.isArray(b)?r.map(b,function(c){return{name:a.name,value:c.replace(tc,"\r\n")}}):{name:a.name,value:b.replace(tc,"\r\n")}}).get()}});r.param=function(c,b){var e,d=[],g=function(c,a){a=r.isFunction(a)?a():null==a?"":a;d[d.length]=encodeURIComponent(c)+"="+encodeURIComponent(a)};b===a&&(b=r.ajaxSettings&&r.ajaxSettings.traditional);if(r.isArray(c)||c.jquery&&!r.isPlainObject(c))r.each(c,function(){g(this.name,this.value)});else for(e in c)q(e,c[e],b,g);return d.join("&").replace(Mc,"+")};r.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),
|
|
149
|
-
function(c,a){r.fn[a]=function(c,b){return 0<arguments.length?this.on(a,null,c,b):this.trigger(a)}});r.fn.hover=function(c,a){return this.mouseenter(c).mouseleave(a||c)};var Xa,Ba,eb=r.now(),Ya=/\?/,cc=/#.*$/,dc=/([?&])_=[^&]*/,uc=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,ec=/^(?:GET|HEAD)$/,Oc=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ub=r.fn.load,fc={},Rb={},vc="*/".concat("*");try{Ba=W.href}catch(Wc){Ba=S.createElement("a"),Ba.href="",Ba=Ba.href}Xa=Nb.exec(Ba.toLowerCase())||[];r.fn.load=
|
|
150
|
-
function(c,b,e){if("string"!==typeof c&&ub)return ub.apply(this,arguments);var d,g,l,f=this,h=c.indexOf(" ");0<=h&&(d=c.slice(h,c.length),c=c.slice(0,h));r.isFunction(b)?(e=b,b=a):b&&"object"===typeof b&&(l="POST");0<f.length&&r.ajax({url:c,type:l,dataType:"html",data:b}).done(function(c){g=arguments;f.html(d?r("<div>").append(r.parseHTML(c)).find(d):c)}).complete(e&&function(c,a){f.each(e,g||[c.responseText,a,c])});return this};r.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
|
|
151
|
-
function(c,a){r.fn[a]=function(c){return this.on(a,c)}});r.each(["get","post"],function(c,b){r[b]=function(c,e,d,g){r.isFunction(e)&&(g=g||d,d=e,e=a);return r.ajax({url:c,type:b,dataType:g,data:e,success:d})}});r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ba,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Xa[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":vc,text:"text/plain",html:"text/html",
|
|
152
|
-
xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":c.String,"text html":!0,"text json":r.parseJSON,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(c,a){return a?v(v(c,r.ajaxSettings),a):v(r.ajaxSettings,c)},ajaxPrefilter:I(fc),ajaxTransport:I(Rb),ajax:function(c,b){function e(c,b,d,g){var u,x,t,A,w=b;if(2!==p){p=2;h&&clearTimeout(h);
|
|
153
|
-
m=a;f=g||"";B.readyState=0<c?4:0;if(d){A=k;g=B;var I,P,H,G,M=A.contents,D=A.dataTypes,Q=A.responseFields;for(G in Q)G in d&&(g[Q[G]]=d[G]);for(;"*"===D[0];)D.shift(),P===a&&(P=A.mimeType||g.getResponseHeader("Content-Type"));if(P)for(G in M)if(M[G]&&M[G].test(P)){D.unshift(G);break}if(D[0]in d)H=D[0];else{for(G in d){if(!D[0]||A.converters[G+" "+D[0]]){H=G;break}I||(I=G)}H=H||I}H?(H!==D[0]&&D.unshift(H),A=d[H]):A=void 0}if(200<=c&&300>c||304===c)if(k.ifModified&&((d=B.getResponseHeader("Last-Modified"))&&
|
|
154
|
-
(r.lastModified[l]=d),(d=B.getResponseHeader("etag"))&&(r.etag[l]=d)),204===c)u=!0,w="nocontent";else if(304===c)u=!0,w="notmodified";else{a:{x=k;t=A;var y,L,w={};I=0;P=x.dataTypes.slice();H=P[0];x.dataFilter&&(t=x.dataFilter(t,x.dataType));if(P[1])for(L in x.converters)w[L.toLowerCase()]=x.converters[L];for(;d=P[++I];)if("*"!==d){if("*"!==H&&H!==d){L=w[H+" "+d]||w["* "+d];if(!L)for(y in w)if(u=y.split(" "),u[1]===d&&(L=w[H+" "+u[0]]||w["* "+u[0]])){!0===L?L=w[y]:!0!==w[y]&&(d=u[0],P.splice(I--,0,
|
|
155
|
-
d));break}if(!0!==L)if(L&&x["throws"])t=L(t);else try{t=L(t)}catch(J){u={state:"parsererror",error:L?J:"No conversion from "+H+" to "+d};break a}}H=d}u={state:"success",data:t}}w=u.state;x=u.data;t=u.error;u=!t}else if(t=w,c||!w)w="error",0>c&&(c=0);B.status=c;B.statusText=(b||w)+"";u?z.resolveWith(C,[x,w,B]):z.rejectWith(C,[B,w,t]);B.statusCode(v);v=a;n&&O.trigger(u?"ajaxSuccess":"ajaxError",[B,k,u?x:t]);q.fireWith(C,[B,w]);n&&(O.trigger("ajaxComplete",[B,k]),--r.active||r.event.trigger("ajaxStop"))}}
|
|
156
|
-
"object"===typeof c&&(b=c,c=a);b=b||{};var d,g,l,f,h,n,m,u,k=r.ajaxSetup({},b),C=k.context||k,O=k.context&&(C.nodeType||C.jquery)?r(C):r.event,z=r.Deferred(),q=r.Callbacks("once memory"),v=k.statusCode||{},x={},t={},p=0,A="canceled",B={readyState:0,getResponseHeader:function(c){var a;if(2===p){if(!u)for(u={};a=uc.exec(f);)u[a[1].toLowerCase()]=a[2];a=u[c.toLowerCase()]}return null==a?null:a},getAllResponseHeaders:function(){return 2===p?f:null},setRequestHeader:function(c,a){var b=c.toLowerCase();
|
|
157
|
-
p||(c=t[b]=t[b]||c,x[c]=a);return this},overrideMimeType:function(c){p||(k.mimeType=c);return this},statusCode:function(c){var a;if(c)if(2>p)for(a in c)v[a]=[v[a],c[a]];else B.always(c[B.status]);return this},abort:function(c){c=c||A;m&&m.abort(c);e(0,c);return this}};z.promise(B).complete=q.add;B.success=B.done;B.error=B.fail;k.url=((c||k.url||Ba)+"").replace(cc,"").replace(Oc,Xa[1]+"//");k.type=b.method||b.type||k.method||k.type;k.dataTypes=r.trim(k.dataType||"*").toLowerCase().match(ia)||[""];
|
|
158
|
-
null==k.crossDomain&&(d=Nb.exec(k.url.toLowerCase()),k.crossDomain=!(!d||d[1]===Xa[1]&&d[2]===Xa[2]&&(d[3]||("http:"===d[1]?80:443))==(Xa[3]||("http:"===Xa[1]?80:443))));k.data&&k.processData&&"string"!==typeof k.data&&(k.data=r.param(k.data,k.traditional));H(fc,k,b,B);if(2===p)return B;(n=k.global)&&0===r.active++&&r.event.trigger("ajaxStart");k.type=k.type.toUpperCase();k.hasContent=!ec.test(k.type);l=k.url;k.hasContent||(k.data&&(l=k.url+=(Ya.test(l)?"&":"?")+k.data,delete k.data),!1===k.cache&&
|
|
159
|
-
(k.url=dc.test(l)?l.replace(dc,"$1_="+eb++):l+(Ya.test(l)?"&":"?")+"_="+eb++));k.ifModified&&(r.lastModified[l]&&B.setRequestHeader("If-Modified-Since",r.lastModified[l]),r.etag[l]&&B.setRequestHeader("If-None-Match",r.etag[l]));(k.data&&k.hasContent&&!1!==k.contentType||b.contentType)&&B.setRequestHeader("Content-Type",k.contentType);B.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+vc+"; q=0.01":""):k.accepts["*"]);for(g in k.headers)B.setRequestHeader(g,
|
|
160
|
-
k.headers[g]);if(k.beforeSend&&(!1===k.beforeSend.call(C,B,k)||2===p))return B.abort();A="abort";for(g in{success:1,error:1,complete:1})B[g](k[g]);if(m=H(Rb,k,b,B)){B.readyState=1;n&&O.trigger("ajaxSend",[B,k]);k.async&&0<k.timeout&&(h=setTimeout(function(){B.abort("timeout")},k.timeout));try{p=1,m.send(x,e)}catch(w){if(2>p)e(-1,w);else throw w;}}else e(-1,"No Transport");return B},getScript:function(c,b){return r.get(c,a,b,"script")},getJSON:function(c,a,b){return r.get(c,a,b,"json")}});r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
|
|
161
|
-
contents:{script:/(?:java|ecma)script/},converters:{"text script":function(c){r.globalEval(c);return c}}});r.ajaxPrefilter("script",function(c){c.cache===a&&(c.cache=!1);c.crossDomain&&(c.type="GET",c.global=!1)});r.ajaxTransport("script",function(c){if(c.crossDomain){var b,e=S.head||r("head")[0]||S.documentElement;return{send:function(a,d){b=S.createElement("script");b.async=!0;c.scriptCharset&&(b.charset=c.scriptCharset);b.src=c.url;b.onload=b.onreadystatechange=function(c,a){if(a||!b.readyState||
|
|
162
|
-
/loaded|complete/.test(b.readyState))b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,a||d(200,"success")};e.insertBefore(b,e.firstChild)},abort:function(){if(b)b.onload(a,!0)}}}});var gc=[],Ca=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var c=gc.pop()||r.expando+"_"+eb++;this[c]=!0;return c}});r.ajaxPrefilter("json jsonp",function(b,e,d){var g,l,f,h=!1!==b.jsonp&&(Ca.test(b.url)?"url":"string"===typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&
|
|
163
|
-
Ca.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return g=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ca,"$1"+g):!1!==b.jsonp&&(b.url+=(Ya.test(b.url)?"&":"?")+b.jsonp+"="+g),b.converters["script json"]=function(){f||r.error(g+" was not called");return f[0]},b.dataTypes[0]="json",l=c[g],c[g]=function(){f=arguments},d.always(function(){c[g]=l;b[g]&&(b.jsonpCallback=e.jsonpCallback,gc.push(g));f&&r.isFunction(l)&&l(f[0]);f=l=a}),"script"});
|
|
164
|
-
var ob,fb,wc=0,hc=c.ActiveXObject&&function(){for(var c in ob)ob[c](a,!0)};r.ajaxSettings.xhr=c.ActiveXObject?function(){var a;if(!(a=!this.isLocal&&C()))a:{try{a=new c.ActiveXObject("Microsoft.XMLHTTP");break a}catch(b){}a=void 0}return a}:C;fb=r.ajaxSettings.xhr();r.support.cors=!!fb&&"withCredentials"in fb;(fb=r.support.ajax=!!fb)&&r.ajaxTransport(function(b){if(!b.crossDomain||r.support.cors){var e;return{send:function(d,g){var l,f,h=b.xhr();b.username?h.open(b.type,b.url,b.async,b.username,b.password):
|
|
165
|
-
h.open(b.type,b.url,b.async);if(b.xhrFields)for(f in b.xhrFields)h[f]=b.xhrFields[f];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType);b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");try{for(f in d)h.setRequestHeader(f,d[f])}catch(n){}h.send(b.hasContent&&b.data||null);e=function(c,d){var f,n,m,u;try{if(e&&(d||4===h.readyState))if(e=a,l&&(h.onreadystatechange=r.noop,hc&&delete ob[l]),d)4!==h.readyState&&h.abort();else{u={};f=h.status;n=h.getAllResponseHeaders();
|
|
166
|
-
"string"===typeof h.responseText&&(u.text=h.responseText);try{m=h.statusText}catch(k){m=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=u.text?200:404}}catch(C){d||g(-1,C)}u&&g(f,m,u,n)};b.async?4===h.readyState?setTimeout(e):(l=++wc,hc&&(ob||(ob={},r(c).unload(hc)),ob[l]=e),h.onreadystatechange=e):e()},abort:function(){e&&e(a,!0)}}}});var ib,Ob,Pb=/^(?:toggle|show|hide)$/,xc=new RegExp("^(?:([+-])=|)("+zb+")([a-z%]*)$","i"),Pc=/queueHooks$/,yb=[function(c,a,b){var e,d,g,l,f,h,n=this,m=c.style,
|
|
167
|
-
k={},C=[],O=c.nodeType&&J(c);b.queue||(f=r._queueHooks(c,"fx"),null==f.unqueued&&(f.unqueued=0,h=f.empty.fire,f.empty.fire=function(){f.unqueued||h()}),f.unqueued++,n.always(function(){n.always(function(){f.unqueued--;r.queue(c,"fx").length||f.empty.fire()})}));1===c.nodeType&&("height"in a||"width"in a)&&(b.overflow=[m.overflow,m.overflowX,m.overflowY],"inline"===r.css(c,"display")&&"none"===r.css(c,"float")&&(r.support.inlineBlockNeedsLayout&&"inline"!==u(c.nodeName)?m.zoom=1:m.display="inline-block"));
|
|
168
|
-
b.overflow&&(m.overflow="hidden",r.support.shrinkWrapBlocks||n.always(function(){m.overflow=b.overflow[0];m.overflowX=b.overflow[1];m.overflowY=b.overflow[2]}));for(d in a)g=a[d],Pb.exec(g)&&(delete a[d],e=e||"toggle"===g,g!==(O?"hide":"show")&&C.push(d));if(a=C.length)for(g=r._data(c,"fxshow")||r._data(c,"fxshow",{}),("hidden"in g)&&(O=g.hidden),e&&(g.hidden=!O),O?r(c).show():n.done(function(){r(c).hide()}),n.done(function(){var a;r._removeData(c,"fxshow");for(a in k)r.style(c,a,k[a])}),d=0;d<a;d++)e=
|
|
169
|
-
C[d],l=n.createTween(e,O?g[e]:0),k[e]=g[e]||r.style(c,e),e in g||(g[e]=l.start,O&&(l.end=l.start,l.start="width"===e||"height"===e?1:0))}],Za={"*":[function(c,a){var b,e,d=this.createTween(c,a),g=xc.exec(a),l=d.cur(),f=+l||0,h=1,n=20;if(g){b=+g[2];e=g[3]||(r.cssNumber[c]?"":"px");if("px"!==e&&f){f=r.css(d.elem,c,!0)||b||1;do h=h||".5",f/=h,r.style(d.elem,c,f+e);while(h!==(h=d.cur()/l)&&1!==h&&--n)}d.unit=e;d.start=f;d.end=g[1]?f+(g[1]+1)*b:b}return d}]};r.Animation=r.extend(R,{tweener:function(c,
|
|
170
|
-
a){r.isFunction(c)?(a=c,c=["*"]):c=c.split(" ");for(var b,e=0,d=c.length;e<d;e++)b=c[e],Za[b]=Za[b]||[],Za[b].unshift(a)},prefilter:function(c,a){a?yb.unshift(c):yb.push(c)}});r.Tween=O;O.prototype={constructor:O,init:function(c,a,b,e,d,g){this.elem=c;this.prop=b;this.easing=d||"swing";this.options=a;this.start=this.now=this.cur();this.end=e;this.unit=g||(r.cssNumber[b]?"":"px")},cur:function(){var c=O.propHooks[this.prop];return c&&c.get?c.get(this):O.propHooks._default.get(this)},run:function(c){var a,
|
|
171
|
-
b=O.propHooks[this.prop];this.pos=this.options.duration?a=r.easing[this.easing](c,this.options.duration*c,0,1,this.options.duration):a=c;this.now=(this.end-this.start)*a+this.start;this.options.step&&this.options.step.call(this.elem,this.now,this);b&&b.set?b.set(this):O.propHooks._default.set(this);return this}};O.prototype.init.prototype=O.prototype;O.propHooks={_default:{get:function(c){return null==c.elem[c.prop]||c.elem.style&&null!=c.elem.style[c.prop]?(c=r.css(c.elem,c.prop,""))&&"auto"!==c?
|
|
172
|
-
c:0:c.elem[c.prop]},set:function(c){if(r.fx.step[c.prop])r.fx.step[c.prop](c);else c.elem.style&&(null!=c.elem.style[r.cssProps[c.prop]]||r.cssHooks[c.prop])?r.style(c.elem,c.prop,c.now+c.unit):c.elem[c.prop]=c.now}}};O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(c){c.elem.nodeType&&c.elem.parentNode&&(c.elem[c.prop]=c.now)}};r.each(["toggle","show","hide"],function(c,a){var b=r.fn[a];r.fn[a]=function(c,e,d){return null==c||"boolean"===typeof c?b.apply(this,arguments):this.animate(Q(a,
|
|
173
|
-
!0),c,e,d)}});r.fn.extend({fadeTo:function(c,a,b,e){return this.filter(J).css("opacity",0).show().end().animate({opacity:a},c,b,e)},animate:function(c,a,b,e){var d=r.isEmptyObject(c),g=r.speed(a,b,e),l=function(){var a=R(this,r.extend({},c),g);l.finish=function(){a.stop(!0)};(d||r._data(this,"finish"))&&a.stop(!0)};l.finish=l;return d||!1===g.queue?this.each(l):this.queue(g.queue,l)},stop:function(c,b,e){var d=function(c){var a=c.stop;delete c.stop;a(e)};"string"!==typeof c&&(e=b,b=c,c=a);b&&!1!==
|
|
174
|
-
c&&this.queue(c||"fx",[]);return this.each(function(){var a=!0,b=null!=c&&c+"queueHooks",g=r.timers,l=r._data(this);if(b)l[b]&&l[b].stop&&d(l[b]);else for(b in l)l[b]&&l[b].stop&&Pc.test(b)&&d(l[b]);for(b=g.length;b--;)g[b].elem!==this||null!=c&&g[b].queue!==c||(g[b].anim.stop(e),a=!1,g.splice(b,1));!a&&e||r.dequeue(this,c)})},finish:function(c){!1!==c&&(c=c||"fx");return this.each(function(){var a,b=r._data(this),e=b[c+"queue"];a=b[c+"queueHooks"];var d=r.timers,g=e?e.length:0;b.finish=!0;r.queue(this,
|
|
175
|
-
c,[]);a&&a.cur&&a.cur.finish&&a.cur.finish.call(this);for(a=d.length;a--;)d[a].elem===this&&d[a].queue===c&&(d[a].anim.stop(!0),d.splice(a,1));for(a=0;a<g;a++)e[a]&&e[a].finish&&e[a].finish.call(this);delete b.finish})}});r.each({slideDown:Q("show"),slideUp:Q("hide"),slideToggle:Q("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(c,a){r.fn[c]=function(c,b,e){return this.animate(a,c,b,e)}});r.speed=function(c,a,b){var e=c&&"object"===typeof c?r.extend({},
|
|
176
|
-
c):{complete:b||!b&&a||r.isFunction(c)&&c,duration:c,easing:b&&a||a&&!r.isFunction(a)&&a};e.duration=r.fx.off?0:"number"===typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default;if(null==e.queue||!0===e.queue)e.queue="fx";e.old=e.complete;e.complete=function(){r.isFunction(e.old)&&e.old.call(this);e.queue&&r.dequeue(this,e.queue)};return e};r.easing={linear:function(c){return c},swing:function(c){return.5-Math.cos(c*Math.PI)/2}};r.timers=[];r.fx=O.prototype.init;
|
|
177
|
-
r.fx.tick=function(){var c,b=r.timers,e=0;for(ib=r.now();e<b.length;e++)c=b[e],c()||b[e]!==c||b.splice(e--,1);b.length||r.fx.stop();ib=a};r.fx.timer=function(c){c()&&r.timers.push(c)&&r.fx.start()};r.fx.interval=13;r.fx.start=function(){Ob||(Ob=setInterval(r.fx.tick,r.fx.interval))};r.fx.stop=function(){clearInterval(Ob);Ob=null};r.fx.speeds={slow:600,fast:200,_default:400};r.fx.step={};r.expr&&r.expr.filters&&(r.expr.filters.animated=function(c){return r.grep(r.timers,function(a){return c===a.elem}).length});
|
|
178
|
-
r.fn.offset=function(c){if(arguments.length)return c===a?this:this.each(function(a){r.offset.setOffset(this,c,a)});var b,e,d={top:0,left:0},g=(e=this[0])&&e.ownerDocument;if(g){b=g.documentElement;if(!r.contains(b,e))return d;typeof e.getBoundingClientRect!==ea&&(d=e.getBoundingClientRect());e=U(g);return{top:d.top+(e.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(e.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}}};r.offset={setOffset:function(c,a,b){var e=r.css(c,"position");"static"===e&&
|
|
179
|
-
(c.style.position="relative");var d=r(c),g=d.offset(),l=r.css(c,"top"),f=r.css(c,"left"),h={},n={};("absolute"===e||"fixed"===e)&&-1<r.inArray("auto",[l,f])?(n=d.position(),e=n.top,f=n.left):(e=parseFloat(l)||0,f=parseFloat(f)||0);r.isFunction(a)&&(a=a.call(c,b,g));null!=a.top&&(h.top=a.top-g.top+e);null!=a.left&&(h.left=a.left-g.left+f);"using"in a?a.using.call(c,h):d.css(h)}};r.fn.extend({position:function(){if(this[0]){var c,a,b={top:0,left:0},e=this[0];"fixed"===r.css(e,"position")?a=e.getBoundingClientRect():
|
|
180
|
-
(c=this.offsetParent(),a=this.offset(),r.nodeName(c[0],"html")||(b=c.offset()),b.top+=r.css(c[0],"borderTopWidth",!0),b.left+=r.css(c[0],"borderLeftWidth",!0));return{top:a.top-b.top-r.css(e,"marginTop",!0),left:a.left-b.left-r.css(e,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||S.documentElement;c&&!r.nodeName(c,"html")&&"static"===r.css(c,"position");)c=c.offsetParent;return c||S.documentElement})}});r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},
|
|
181
|
-
function(c,b){var e=/Y/.test(b);r.fn[c]=function(d){return r.access(this,function(c,d,g){var l=U(c);if(g===a)return l?b in l?l[b]:l.document.documentElement[d]:c[d];l?l.scrollTo(e?r(l).scrollLeft():g,e?g:r(l).scrollTop()):c[d]=g},c,d,arguments.length,null)}});r.each({Height:"height",Width:"width"},function(c,b){r.each({padding:"inner"+c,content:b,"":"outer"+c},function(e,d){r.fn[d]=function(d,g){var l=arguments.length&&(e||"boolean"!==typeof d),f=e||(!0===d||!0===g?"margin":"border");return r.access(this,
|
|
182
|
-
function(b,e,d){return r.isWindow(b)?b.document.documentElement["client"+c]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+c],e["scroll"+c],b.body["offset"+c],e["offset"+c],e["client"+c])):d===a?r.css(b,e,f):r.style(b,e,d,f)},b,l?d:a,l,null)}})});c.jQuery=c.$=r;"function"===typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return r})})(window);
|
|
183
|
-
(function(c){"object"===typeof exports&&"undefined"!==typeof module?module.exports=c():"function"===typeof define&&define.amd?define([],c):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).daikon=c()})(function(){return function a(d,f,b){function e(h,k){if(!f[h]){if(!d[h]){var p="function"==typeof require&&require;if(!k&&p)return p(h,!0);if(g)return g(h,!0);p=Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p;}p=f[h]={exports:{}};
|
|
184
|
-
d[h][0].call(p.exports,function(a){var b=d[h][1][a];return e(b?b:a)},p,p.exports,a,d,f,b)}return f[h].exports}for(var g="function"==typeof require&&require,h=0;h<b.length;h++)e(b[h]);return e}({1:[function(a,d,f){var b={Unkown:0,Grayscale:1,AdobeRGB:2,RGB:3,CYMK:4};a=function(){function a(){}function d(a,b){for(var e=0,g=[],f,h,m=16;0<m&&!a[m-1];)m--;g.push({children:[],index:0});var k=g[0],p;for(f=0;f<m;f++){for(h=0;h<a[f];h++){k=g.pop();for(k.children[k.index]=b[e];0<k.index;)k=g.pop();k.index++;
|
|
185
|
-
for(g.push(k);g.length<=f;)g.push(p={children:[],index:0}),k.children[k.index]=p.children,k=p;e++}f+1<m&&(g.push(p={children:[],index:0}),k.children[k.index]=p.children,k=p)}return g[0].children}function f(a,b,e,d,g,h,m,k,L){function l(){if(0<C)return C--,v>>C&1;v=a[b++];if(255==v){var e=a[b++];if(e)throw"unexpected marker: "+(v<<8|e).toString(16);}C=7;return v>>>7}function J(a){for(var b;null!==(b=l());){a=a[b];if("number"===typeof a)return a;if("object"!==typeof a)throw"invalid huffman sequence";
|
|
186
|
-
}return null}function K(a){for(var b=0;0<a;){var e=l();if(null===e)return;b=b<<1|e;a--}return b}function E(a){var b=K(a);return b>=1<<a-1?b:b+(-1<<a)+1}function y(a,b){var e=J(a.huffmanTableDC),e=0===e?0:E(e);a.blockData[b]=a.pred+=e;for(e=1;64>e;){var d=J(a.huffmanTableAC),g=d&15,d=d>>4;if(0===g){if(15>d)break;e+=16}else e+=d,a.blockData[b+p[e]]=E(g),e++}}function D(a,b){var e=J(a.huffmanTableDC),e=0===e?0:E(e)<<L;a.blockData[b]=a.pred+=e}function u(a,b){a.blockData[b]|=l()<<L}function n(a,b){if(0<
|
|
187
|
-
P)P--;else for(var e=h;e<=m;){var d=J(a.huffmanTableAC),g=d&15,d=d>>4;if(0===g){if(15>d){P=K(d)+(1<<d)-1;break}e+=16}else e+=d,a.blockData[b+p[e]]=E(g)*(1<<L),e++}}function q(a,b){for(var e=h,d=0;e<=m;){var g=p[e];switch(M){case 0:d=J(a.huffmanTableAC);g=d&15;d>>=4;if(0===g)15>d?(P=K(d)+(1<<d),M=4):(d=16,M=1);else{if(1!==g)throw"invalid ACn encoding";R=E(g);M=d?2:3}continue;case 1:case 2:a.blockData[b+g]?a.blockData[b+g]+=l()<<L:(d--,0===d&&(M=2==M?3:0));break;case 3:a.blockData[b+g]?a.blockData[b+
|
|
188
|
-
g]+=l()<<L:(a.blockData[b+g]=R<<L,M=0);break;case 4:a.blockData[b+g]&&(a.blockData[b+g]+=l()<<L)}e++}4===M&&(P--,0===P&&(M=0))}var I=e.mcusPerLine,H=b,v=0,C=0,P=0,M=0,R,T=d.length,O,Q,U,ua,N;k=e.progressive?0===h?0===k?D:u:0===k?n:q:y;var ea=0;e=1==T?d[0].blocksPerLine*d[0].blocksPerColumn:I*e.mcusPerColumn;g||(g=e);for(var S,W;ea<e;){for(Q=0;Q<T;Q++)d[Q].pred=0;P=0;if(1==T)for(O=d[0],N=0;N<g;N++)k(O,64*((O.blocksPerLine+1)*(ea/O.blocksPerLine|0)+ea%O.blocksPerLine)),ea++;else for(N=0;N<g;N++){for(Q=
|
|
189
|
-
0;Q<T;Q++)for(O=d[Q],S=O.h,W=O.v,U=0;U<W;U++)for(ua=0;ua<S;ua++)k(O,64*((O.blocksPerLine+1)*((ea/I|0)*O.v+U)+(ea%I*O.h+ua)));ea++}C=0;O=a[b]<<8|a[b+1];if(65280>=O)throw"marker was not found";if(65488<=O&&65495>=O)b+=2;else break}return b-H}function m(a,b){for(var e=b.blocksPerLine,d=b.blocksPerColumn,g=new Int32Array(64),f=0;f<d;f++)for(var h=0;h<e;h++){for(var m=b,k=64*((b.blocksPerLine+1)*f+h),l=g,p=m.quantizationTable,K=void 0,E=void 0,y=void 0,D=void 0,u=void 0,n=void 0,q=void 0,I=void 0,H=void 0,
|
|
190
|
-
v=void 0,v=0;64>v;v++)l[v]=m.blockData[k+v]*p[v];for(v=0;8>v;++v)p=8*v,0===l[1+p]&&0===l[2+p]&&0===l[3+p]&&0===l[4+p]&&0===l[5+p]&&0===l[6+p]&&0===l[7+p]?(H=5793*l[0+p]+512>>10,l[0+p]=H,l[1+p]=H,l[2+p]=H,l[3+p]=H,l[4+p]=H,l[5+p]=H,l[6+p]=H,l[7+p]=H):(K=5793*l[0+p]+128>>8,E=5793*l[4+p]+128>>8,y=l[2+p],D=l[6+p],u=2896*(l[1+p]-l[7+p])+128>>8,I=2896*(l[1+p]+l[7+p])+128>>8,n=l[3+p]<<4,q=l[5+p]<<4,H=K-E+1>>1,K=K+E+1>>1,E=H,H=3784*y+1567*D+128>>8,y=1567*y-3784*D+128>>8,D=H,H=u-q+1>>1,u=u+q+1>>1,q=H,H=I+
|
|
191
|
-
n+1>>1,n=I-n+1>>1,I=H,H=K-D+1>>1,K=K+D+1>>1,D=H,H=E-y+1>>1,E=E+y+1>>1,y=H,H=2276*u+3406*I+2048>>12,u=3406*u-2276*I+2048>>12,I=H,H=799*n+4017*q+2048>>12,n=4017*n-799*q+2048>>12,q=H,l[0+p]=K+I,l[7+p]=K-I,l[1+p]=E+q,l[6+p]=E-q,l[2+p]=y+n,l[5+p]=y-n,l[3+p]=D+u,l[4+p]=D-u);for(v=0;8>v;++v)p=v,0===l[8+p]&&0===l[16+p]&&0===l[24+p]&&0===l[32+p]&&0===l[40+p]&&0===l[48+p]&&0===l[56+p]?(H=5793*l[v+0]+8192>>14,l[0+p]=H,l[8+p]=H,l[16+p]=H,l[24+p]=H,l[32+p]=H,l[40+p]=H,l[48+p]=H,l[56+p]=H):(K=5793*l[0+p]+2048>>
|
|
192
|
-
12,E=5793*l[32+p]+2048>>12,y=l[16+p],D=l[48+p],u=2896*(l[8+p]-l[56+p])+2048>>12,I=2896*(l[8+p]+l[56+p])+2048>>12,n=l[24+p],q=l[40+p],H=K-E+1>>1,K=K+E+1>>1,E=H,H=3784*y+1567*D+2048>>12,y=1567*y-3784*D+2048>>12,D=H,H=u-q+1>>1,u=u+q+1>>1,q=H,H=I+n+1>>1,n=I-n+1>>1,I=H,H=K-D+1>>1,K=K+D+1>>1,D=H,H=E-y+1>>1,E=E+y+1>>1,y=H,H=2276*u+3406*I+2048>>12,u=3406*u-2276*I+2048>>12,I=H,H=799*n+4017*q+2048>>12,n=4017*n-799*q+2048>>12,q=H,l[0+p]=K+I,l[56+p]=K-I,l[8+p]=E+q,l[48+p]=E-q,l[16+p]=y+n,l[40+p]=y-n,l[24+p]=
|
|
193
|
-
D+u,l[32+p]=D-u);for(v=0;64>v;++v)K=k+v,E=l[v],E=E<=-2056/m.bitConversion?0:E>=2024/m.bitConversion?255/m.bitConversion:E+2056/m.bitConversion>>4,m.blockData[K]=E}return b.blockData}function k(a){return 0>=a?0:255<=a?255:a|0}var p=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);a.prototype={load:function(a){var b=function(a){this.parse(a);if(this.onload)this.onload()}.bind(this);
|
|
194
|
-
if(-1<a.indexOf("data:")){var e=a.indexOf("base64,")+7;a=atob(a.substring(e));for(var e=new Uint8Array(a.length),d=a.length-1;0<=d;d--)e[d]=a.charCodeAt(d);b(a)}else{var g=new XMLHttpRequest;g.open("GET",a,!0);g.responseType="arraybuffer";g.onload=function(){var a=new Uint8Array(g.response);b(a)}.bind(this);g.send(null)}},parse:function(a){function e(){var b=a[x]<<8|a[x+1];x+=2;return b}function k(){var b=e(),b=a.subarray(x,x+b-2);x+=b.length;return b}function A(a){for(var b=Math.ceil(a.samplesPerLine/
|
|
195
|
-
8/a.maxH),e=Math.ceil(a.scanLines/8/a.maxV),d=0;d<a.components.length;d++){v=a.components[d];var g=Math.ceil(Math.ceil(a.samplesPerLine/8)*v.h/a.maxH),l=Math.ceil(Math.ceil(a.scanLines/8)*v.v/a.maxV);v.blockData=new Int16Array(64*e*v.v*(b*v.h+1));v.blocksPerLine=g;v.blocksPerColumn=l}a.mcusPerLine=b;a.mcusPerColumn=e}var x=0,G=null,F=null,z,L,l=[],J=[],K=[],E=e();if(65496!=E)throw"SOI not found";for(E=e();65497!=E;){var y,D;switch(E){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:y=
|
|
196
|
-
k();65504===E&&74===y[0]&&70===y[1]&&73===y[2]&&70===y[3]&&0===y[4]&&(G={version:{major:y[5],minor:y[6]},densityUnits:y[7],xDensity:y[8]<<8|y[9],yDensity:y[10]<<8|y[11],thumbWidth:y[12],thumbHeight:y[13],thumbData:y.subarray(14,14+3*y[12]*y[13])});65518===E&&65===y[0]&&100===y[1]&&111===y[2]&&98===y[3]&&101===y[4]&&0===y[5]&&(F={version:y[6],flags0:y[7]<<8|y[8],flags1:y[9]<<8|y[10],transformCode:y[11]});break;case 65499:for(E=e()+x-2;x<E;){var u=a[x++],n=new Int32Array(64);if(0===u>>4)for(y=0;64>
|
|
197
|
-
y;y++)n[p[y]]=a[x++];else if(1===u>>4)for(y=0;64>y;y++)n[p[y]]=e();else throw"DQT: invalid table spec";l[u&15]=n}break;case 65472:case 65473:case 65474:if(z)throw"Only single frame JPEGs supported";e();z={};z.extended=65473===E;z.progressive=65474===E;z.precision=a[x++];z.scanLines=e();z.samplesPerLine=e();z.components=[];z.componentIds={};y=a[x++];for(var q=n=0,E=0;E<y;E++){u=a[x];D=a[x+1]>>4;var I=a[x+1]&15;n<D&&(n=D);q<I&&(q=I);var H=a[x+2];D=z.components.push({h:D,v:I,quantizationTable:l[H],quantizationTableId:H,
|
|
198
|
-
bitConversion:255/((1<<z.precision)-1)});z.componentIds[u]=D-1;x+=3}z.maxH=n;z.maxV=q;A(z);break;case 65476:u=e();for(E=2;E<u;){n=a[x++];q=new Uint8Array(16);for(y=D=0;16>y;y++,x++)D+=q[y]=a[x];I=new Uint8Array(D);for(y=0;y<D;y++,x++)I[y]=a[x];E+=17+D;(0===n>>4?K:J)[n&15]=d(q,I)}break;case 65501:e();L=e();break;case 65498:e();u=a[x++];y=[];for(var v,E=0;E<u;E++)n=z.componentIds[a[x++]],v=z.components[n],n=a[x++],v.huffmanTableDC=K[n>>4],v.huffmanTableAC=J[n&15],y.push(v);E=a[x++];u=a[x++];n=a[x++];
|
|
199
|
-
E=f(a,x,z,y,L,E,u,n>>4,n&15);x+=E;break;default:if(255==a[x-3]&&192<=a[x-2]&&254>=a[x-2]){x-=3;break}throw"unknown JPEG marker "+E.toString(16);}E=e()}this.width=z.samplesPerLine;this.height=z.scanLines;this.jfif=G;this.adobe=F;this.components=[];switch(z.components.length){case 1:this.colorspace=b.Grayscale;break;case 3:this.colorspace=this.adobe?b.AdobeRGB:b.RGB;break;case 4:this.colorspace=b.CYMK;break;default:this.colorspace=b.Unknown}for(E=0;E<z.components.length;E++)v=z.components[E],v.quantizationTable||
|
|
200
|
-
null===v.quantizationTableId||(v.quantizationTable=l[v.quantizationTableId]),this.components.push({output:m(z,v),scaleX:v.h/z.maxH,scaleY:v.v/z.maxV,blocksPerLine:v.blocksPerLine,blocksPerColumn:v.blocksPerColumn,bitConversion:v.bitConversion})},getData16:function(a,b){if(1!==this.components.length)throw"Unsupported color mode";var e=this.width/a,d=this.height/b,g,f,h,m,k,l=0,p=this.components.length,K=new Uint16Array(a*b*p),E=new Uint16Array((this.components[0].blocksPerLine<<3)*this.components[0].blocksPerColumn*
|
|
201
|
-
8);for(k=0;k<p;k++){g=this.components[k];f=g.blocksPerLine;h=g.blocksPerColumn;for(var y=f<<3,D,u=0,n=0;n<h;n++)for(var q=n<<3,I=0;I<f;I++){var H=64*((g.blocksPerLine+1)*n+I),l=0,v=I<<3;for(m=0;8>m;m++)for(u=(q+m)*y,D=0;8>D;D++)E[u+v+D]=g.output[H+l++]}f=g.scaleX*e;g=g.scaleY*d;l=k;for(m=0;m<b;m++)for(h=0;h<a;h++)u=0|m*g,D=0|h*f,D=u*y+D,K[l]=E[D],l+=p}return K},getData:function(a,b){var e=this.width/a,d=this.height/b,g,f,h,m,p,l=0,J,K=this.components.length,E=a*b*K,y=new Uint8Array(E);J=new Uint8Array((this.components[0].blocksPerLine<<
|
|
202
|
-
3)*this.components[0].blocksPerColumn*8);for(p=0;p<K;p++){g=this.components[p];f=g.blocksPerLine;h=g.blocksPerColumn;for(var D=f<<3,u,n=0,q=0;q<h;q++)for(var I=q<<3,H=0;H<f;H++){var v=64*((g.blocksPerLine+1)*q+H),l=0,C=H<<3;for(m=0;8>m;m++)for(n=(I+m)*D,u=0;8>u;u++)J[n+C+u]=g.output[v+l++]*g.bitConversion}f=g.scaleX*e;g=g.scaleY*d;l=p;for(m=0;m<b;m++)for(h=0;h<a;h++)n=0|m*g,u=0|h*f,u=n*D+u,y[l]=J[u],l+=K}switch(K){case 1:case 2:break;case 3:p=!0;this.adobe&&this.adobe.transformCode?p=!0:"undefined"!==
|
|
203
|
-
typeof this.colorTransform&&(p=!!this.colorTransform);if(p)for(p=0;p<E;p+=K)e=y[p],d=y[p+1],J=y[p+2],l=k(e-179.456+1.402*J),J=k(e+135.459-.344*d-.714*J),e=k(e-226.816+1.772*d),y[p]=l,y[p+1]=J,y[p+2]=e;break;case 4:if(!this.adobe)throw"Unsupported color mode (4 components)";p=!1;this.adobe&&this.adobe.transformCode?p=!0:"undefined"!==typeof this.colorTransform&&(p=!!this.colorTransform);if(p)for(p=0;p<E;p+=K)e=y[p],d=y[p+1],J=y[p+2],l=k(434.456-e-1.402*J),J=k(119.541-e+.344*d+.714*J),e=k(481.816-e-
|
|
204
|
-
1.772*d),y[p]=l,y[p+1]=J,y[p+2]=e;break;default:throw"Unsupported color mode";}return y},copyToImageData:function(a){var b=a.width,e=a.height,d=b*e*4;a=a.data;var b=this.getData16(b,e),g=e=0,f,h,m,p,l;switch(this.components.length){case 1:for(;g<d;)m=b[e++],a[g++]=m,a[g++]=m,a[g++]=m,a[g++]=255;break;case 3:for(;g<d;)p=b[e++],l=b[e++],m=b[e++],a[g++]=p,a[g++]=l,a[g++]=m,a[g++]=255;break;case 4:for(;g<d;)p=b[e++],l=b[e++],m=b[e++],f=b[e++],f=255-f,h=f/255,p=k(f-p*h),l=k(f-l*h),m=k(f-m*h),a[g++]=p,
|
|
205
|
-
a[g++]=l,a[g++]=m,a[g++]=255;break;default:throw"Unsupported color mode";}}};return a}();"undefined"!==typeof d&&d.exports&&(d.exports={JpegImage:a})},{}],2:[function(a,d,f){function b(a){t.verbosity>=t.VERBOSITY_LEVELS.warnings&&console.log("Warning: "+a)}function e(a,b,e){Object.defineProperty(a,b,{value:e,enumerable:!0,configurable:!0,writable:!1});return e}function g(a){for(var b=1,e=0;a>b;)b<<=1,e++;return e}function h(a,b){return a[b]<<8|a[b+1]}function m(a,b){return(a[b]<<24|a[b+1]<<16|a[b+
|
|
206
|
-
2]<<8|a[b+3])>>>0}a=function(){function a(){this.failOnCorruptedImage=!1}function e(a,b,d){a=d.xcb_;d=d.ycb_;var g=1<<a,l=1<<d,f=b.tbx0>>a,h=b.tby0>>d,n=b.tbx1+g-1>>a,m=b.tby1+l-1>>d,u=b.resolution.precinctParameters,k=[],q=[],z,p,x,t;for(p=h;p<m;p++)for(z=f;z<n;z++)if(x={cbx:z,cby:p,tbx0:g*z,tby0:l*p,tbx1:g*(z+1),tby1:l*(p+1)},x.tbx0_=Math.max(b.tbx0,x.tbx0),x.tby0_=Math.max(b.tby0,x.tby0),x.tbx1_=Math.min(b.tbx1,x.tbx1),x.tby1_=Math.min(b.tby1,x.tby1),t=Math.floor((x.tbx0_-b.tbx0)/u.precinctWidthInSubband)+
|
|
207
|
-
Math.floor((x.tby0_-b.tby0)/u.precinctHeightInSubband)*u.numprecinctswide,x.precinctNumber=t,x.subbandType=b.type,x.Lblock=3,!(x.tbx1_<=x.tbx0_||x.tby1_<=x.tby0_)){k.push(x);var A=q[t];void 0!==A?(z<A.cbxMin?A.cbxMin=z:z>A.cbxMax&&(A.cbxMax=z),p<A.cbyMin?A.cbxMin=p:p>A.cbyMax&&(A.cbyMax=p)):q[t]=A={cbxMin:z,cbyMin:p,cbxMax:z,cbyMax:p};x.precinct=A}b.codeblockParameters={codeblockWidth:a,codeblockHeight:d,numcodeblockwide:n-f+1,numcodeblockhigh:m-h+1};b.codeblocks=k;b.precincts=q}function d(a,b,e){var g=
|
|
208
|
-
[];a=a.subbands;for(var l=0,f=a.length;l<f;l++)for(var h=a[l].codeblocks,n=0,m=h.length;n<m;n++){var u=h[n];u.precinctNumber===b&&g.push(u)}return{layerNumber:e,codeblocks:g}}function f(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,g=a.SIZ.Csiz,l=0;for(a=0;a<g;a++)l=Math.max(l,b.components[a].codingStyleParameters.decompositionLevelsCount);var h=0,n=0,m=0,u=0;this.nextPacket=function(){for(;h<e;h++){for(;n<=l;n++){for(;m<g;m++){var a=b.components[m];if(!(n>a.codingStyleParameters.decompositionLevelsCount)){for(var a=
|
|
209
|
-
a.resolutions[n],f=a.precinctParameters.numprecincts;u<f;)return a=d(a,u,h),u++,a;u=0}}m=0}n=0}}}function p(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,g=a.SIZ.Csiz,l=0;for(a=0;a<g;a++)l=Math.max(l,b.components[a].codingStyleParameters.decompositionLevelsCount);var f=0,h=0,n=0,m=0;this.nextPacket=function(){for(;f<=l;f++){for(;h<e;h++){for(;n<g;n++){var a=b.components[n];if(!(f>a.codingStyleParameters.decompositionLevelsCount)){for(var a=a.resolutions[f],u=a.precinctParameters.numprecincts;m<
|
|
210
|
-
u;)return a=d(a,m,h),m++,a;m=0}}n=0}h=0}}}function z(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,g=a.SIZ.Csiz,l,f,h,n,m=0;for(h=0;h<g;h++)m=Math.max(m,b.components[h].codingStyleParameters.decompositionLevelsCount);var u=new Int32Array(m+1);for(f=0;f<=m;++f){for(h=a=0;h<g;++h){var k=b.components[h].resolutions;f<k.length&&(a=Math.max(a,k[f].precinctParameters.numprecincts))}u[f]=a}n=h=f=l=0;this.nextPacket=function(){for(;f<=m;f++){for(;n<u[f];n++){for(;h<g;h++){var a=
|
|
211
|
-
b.components[h];if(!(f>a.codingStyleParameters.decompositionLevelsCount||(a=a.resolutions[f],n>=a.precinctParameters.numprecincts))){for(;l<e;)return a=d(a,n,l),l++,a;l=0}}h=0}n=0}}}function w(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,g=a.SIZ.Csiz,l=K(b),f=0,h=0,n=0,m=0,u=0;this.nextPacket=function(){for(;u<l.maxNumHigh;u++){for(;m<l.maxNumWide;m++){for(;n<g;n++){for(var a=b.components[n],k=a.codingStyleParameters.decompositionLevelsCount;h<=k;h++){var q=a.resolutions[h],
|
|
212
|
-
z=J(m,u,l.components[n].resolutions[h],l,q);if(null!==z){for(;f<e;)return a=d(q,z,f),f++,a;f=0}}h=0}n=0}m=0}}}function l(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,g=a.SIZ.Csiz,l=K(b),f=0,h=0,n=0,m=0,u=0;this.nextPacket=function(){for(;n<g;++n){for(var a=b.components[n],k=l.components[n],q=a.codingStyleParameters.decompositionLevelsCount;u<k.maxNumHigh;u++){for(;m<k.maxNumWide;m++){for(;h<=q;h++){var z=a.resolutions[h],p=J(m,u,k.resolutions[h],k,z);if(null!==
|
|
213
|
-
p){for(;f<e;)return a=d(z,p,f),f++,a;f=0}}h=0}m=0}u=0}}}function J(a,b,e,d,g){a*=d.minWidth;b*=d.minHeight;return 0!==a%e.width||0!==b%e.height?null:a/e.height+b/e.width*g.precinctParameters.numprecinctswide}function K(a){for(var b=a.components.length,e=Number.MAX_VALUE,d=Number.MAX_VALUE,g=0,l=0,f=Array(b),h=0;h<b;h++){for(var n=a.components[h],m=n.codingStyleParameters.decompositionLevelsCount,u=Array(m+1),k=Number.MAX_VALUE,q=Number.MAX_VALUE,z=0,p=0,x=1;0<=m;--m){var t=n.resolutions[m],A=x*t.precinctParameters.precinctWidth,
|
|
214
|
-
B=x*t.precinctParameters.precinctHeight,k=Math.min(k,A),q=Math.min(q,B),z=Math.max(z,t.precinctParameters.numprecinctswide),p=Math.max(p,t.precinctParameters.numprecinctshigh);u[m]={width:A,height:B};x<<=1}e=Math.min(e,k);d=Math.min(d,q);g=Math.max(g,z);l=Math.max(l,p);f[h]={resolutions:u,minWidth:k,minHeight:q,maxNumWide:z,maxNumHigh:p}}return{components:f,minWidth:e,minHeight:d,maxNumWide:g,maxNumHigh:l}}function E(a,b,e,d){function l(a){for(;k<a;){if(e+n>=b.length)throw Error("Unexpected EOF");
|
|
215
|
-
var d=b[e+n];n++;q?(m=m<<7|d,k+=7,q=!1):(m=m<<8|d,k+=8);255===d&&(q=!0)}k-=a;return m>>>k&(1<<a)-1}function f(a){return 255===b[e+n-1]&&b[e+n]===a?(n+=1,!0):255===b[e+n]&&b[e+n+1]===a?(n+=2,!0):!1}function h(){if(0===l(1))return 1;if(0===l(1))return 2;var a=l(2);if(3>a)return a+3;a=l(5);if(31>a)return a+6;a=l(7);return a+37}var n=0,m,k=0,q=!1,z=a.COD.sopMarkerUsed,p=a.COD.ephMarkerUsed;for(a=a.tiles[a.currentTile.index].packetsIterator;n<d;)try{k=0;q&&(n++,q=!1);z&&f(145)&&(n+=4);var x=a.nextPacket();
|
|
216
|
-
if(void 0===x)return;if(l(1)){for(var t=x.layerNumber,A=[],B,w=0,I=x.codeblocks.length;w<I;w++){B=x.codeblocks[w];var H=B.precinct,G=B.cbx-H.cbxMin,y=B.cby-H.cbyMin,L=!1,E=!1,J;if(void 0!==B.included)L=!!l(1);else{var H=B.precinct,r,F;if(void 0!==H.inclusionTree)r=H.inclusionTree;else{var K=H.cbxMax-H.cbxMin+1,$a=H.cbyMax-H.cbyMin+1;r=new u(K,$a);F=new D(K,$a);H.inclusionTree=r;H.zeroBitPlanesTree=F}for(r.reset(G,y,t);;){if(n>=b.length)return;if(r.isAboveThreshold())break;if(r.isKnown())r.nextLevel();
|
|
217
|
-
else if(l(1))if(r.setKnown(),r.isLeaf()){L=E=B.included=!0;break}else r.nextLevel();else r.incrementValue()}}if(L){if(E){F=H.zeroBitPlanesTree;for(F.reset(G,y);;){if(n>=b.length)return;if(l(1)){if(J=!F.nextLevel())break}else F.incrementValue()}B.zeroBitPlanes=F.value}for(var Ra=h();l(1);)B.Lblock++;var Fa=g(Ra),Tb=l((Ra<1<<Fa?Fa-1:Fa)+B.Lblock);A.push({codeblock:B,codingpasses:Ra,dataLength:Tb})}}k=0;q&&(n++,q=!1);for(p&&f(146);0<A.length;){var Ga=A.shift();B=Ga.codeblock;void 0===B.data&&(B.data=
|
|
218
|
-
[]);B.data.push({data:b,start:e+n,end:e+n+Ga.dataLength,codingpasses:Ga.codingpasses});n+=Ga.dataLength}}}catch(Ab){return}return n}var y={LL:0,LH:1,HL:1,HH:2};a.prototype={parse:function(a){if(65359===h(a,0))this.parseCodestream(a,0,a.length);else for(var e=0,d=a.length;e<d;){var g=8,l=m(a,e),f=m(a,e+4),e=e+g;1===l&&(l=4294967296*m(a,e)+m(a,e+4),e+=8,g+=8);0===l&&(l=d-e+g);if(l<g)throw Error("JPX Error: Invalid box field size");g=l-g;l=!0;switch(f){case 1785737832:l=!1;break;case 1668246642:f=a[e];
|
|
219
|
-
if(1===f)switch(f=m(a,e+3),f){case 16:case 17:case 18:break;default:b("Unknown colorspace "+f)}else 2===f&&t.verbosity>=t.VERBOSITY_LEVELS.infos&&console.log("Info: ICC profile not supported");break;case 1785737827:this.parseCodestream(a,e,e+g);break;case 1783636E3:218793738!==m(a,e)&&b("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var n=String.fromCharCode(f>>24&255,f>>16&255,f>>8&255,f&255);b("Unsupported header type "+
|
|
220
|
-
f+" ("+n+")")}l&&(e+=g)}},parseImageProperties:function(a){for(var b=a.getByte();0<=b;){var e=b,b=a.getByte();if(65361===(e<<8|b)){a.skip(4);var b=a.getInt32()>>>0,e=a.getInt32()>>>0,d=a.getInt32()>>>0,g=a.getInt32()>>>0;a.skip(16);a=a.getUint16();this.width=b-d;this.height=e-g;this.componentsCount=a;this.bitsPerComponent=8;return}}throw Error("JPX Error: No size marker found in JPX stream");},parseCodestream:function(a,d,g){var u={};try{for(var q=!1,x=d;x+1<g;){var O=h(a,x),x=x+2,t=0,B,D,J,K,S,W;
|
|
221
|
-
switch(O){case 65359:u.mainHeader=!0;break;case 65497:break;case 65361:var t=h(a,x),qa={};qa.Xsiz=m(a,x+4);qa.Ysiz=m(a,x+8);qa.XOsiz=m(a,x+12);qa.YOsiz=m(a,x+16);qa.XTsiz=m(a,x+20);qa.YTsiz=m(a,x+24);qa.XTOsiz=m(a,x+28);qa.YTOsiz=m(a,x+32);var za=h(a,x+36);qa.Csiz=za;var Pa=[];B=x+38;for(var ma=0;ma<za;ma++){var Aa={precision:(a[B]&127)+1,isSigned:!!(a[B]&128),XRsiz:a[B+1],YRsiz:a[B+1]},ga=Aa,na=qa;ga.x0=Math.ceil(na.XOsiz/ga.XRsiz);ga.x1=Math.ceil(na.Xsiz/ga.XRsiz);ga.y0=Math.ceil(na.YOsiz/ga.YRsiz);
|
|
222
|
-
ga.y1=Math.ceil(na.Ysiz/ga.YRsiz);ga.width=ga.x1-ga.x0;ga.height=ga.y1-ga.y0;Pa.push(Aa)}u.SIZ=qa;u.components=Pa;for(var Qa=u,Sb=Pa,Z=Qa.SIZ,da=void 0,r=[],zb=Math.ceil((Z.Xsiz-Z.XTOsiz)/Z.XTsiz),ia=Math.ceil((Z.Ysiz-Z.YTOsiz)/Z.YTsiz),$a=0;$a<ia;$a++)for(var Ra=0;Ra<zb;Ra++)da={},da.tx0=Math.max(Z.XTOsiz+Ra*Z.XTsiz,Z.XOsiz),da.ty0=Math.max(Z.YTOsiz+$a*Z.YTsiz,Z.YOsiz),da.tx1=Math.min(Z.XTOsiz+(Ra+1)*Z.XTsiz,Z.Xsiz),da.ty1=Math.min(Z.YTOsiz+($a+1)*Z.YTsiz,Z.Ysiz),da.width=da.tx1-da.tx0,da.height=
|
|
223
|
-
da.ty1-da.ty0,da.components=[],r.push(da);Qa.tiles=r;for(var Fa=0,Tb=Z.Csiz;Fa<Tb;Fa++)for(var Ga=Sb[Fa],Ab=0,Ub=r.length;Ab<Ub;Ab++){var ra={},da=r[Ab];ra.tcx0=Math.ceil(da.tx0/Ga.XRsiz);ra.tcy0=Math.ceil(da.ty0/Ga.YRsiz);ra.tcx1=Math.ceil(da.tx1/Ga.XRsiz);ra.tcy1=Math.ceil(da.ty1/Ga.YRsiz);ra.width=ra.tcx1-ra.tcx0;ra.height=ra.tcy1-ra.tcy0;da.components[Fa]=ra}u.QCC=[];u.COC=[];break;case 65372:var t=h(a,x),jb={};B=x+2;D=a[B++];switch(D&31){case 0:K=8;S=!0;break;case 1:K=16;S=!1;break;case 2:K=
|
|
224
|
-
16;S=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+D);}jb.noQuantization=8===K;jb.scalarExpounded=S;jb.guardBits=D>>5;for(J=[];B<t+x;){var xa={};8===K?(xa.epsilon=a[B++]>>3,xa.mu=0):(xa.epsilon=a[B]>>3,xa.mu=(a[B]&7)<<8|a[B+1],B+=2);J.push(xa)}jb.SPqcds=J;u.mainHeader?u.QCD=jb:(u.currentTile.QCD=jb,u.currentTile.QCC=[]);break;case 65373:var t=h(a,x),ka={};B=x+2;var pb;257>u.SIZ.Csiz?pb=a[B++]:(pb=h(a,B),B+=2);D=a[B++];switch(D&31){case 0:K=8;S=!0;break;case 1:K=16;S=!1;break;case 2:K=
|
|
225
|
-
16;S=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+D);}ka.noQuantization=8===K;ka.scalarExpounded=S;ka.guardBits=D>>5;for(J=[];B<t+x;)xa={},8===K?(xa.epsilon=a[B++]>>3,xa.mu=0):(xa.epsilon=a[B]>>3,xa.mu=(a[B]&7)<<8|a[B+1],B+=2),J.push(xa);ka.SPqcds=J;u.mainHeader?u.QCC[pb]=ka:u.currentTile.QCC[pb]=ka;break;case 65362:var t=h(a,x),Y={};B=x+2;var Qb=a[B++];Y.entropyCoderWithCustomPrecincts=!!(Qb&1);Y.sopMarkerUsed=!!(Qb&2);Y.ephMarkerUsed=!!(Qb&4);Y.progressionOrder=a[B++];Y.layersCount=
|
|
226
|
-
h(a,B);B+=2;Y.multipleComponentTransform=a[B++];Y.decompositionLevelsCount=a[B++];Y.xcb=(a[B++]&15)+2;Y.ycb=(a[B++]&15)+2;var gb=a[B++];Y.selectiveArithmeticCodingBypass=!!(gb&1);Y.resetContextProbabilities=!!(gb&2);Y.terminationOnEachCodingPass=!!(gb&4);Y.verticalyStripe=!!(gb&8);Y.predictableTermination=!!(gb&16);Y.segmentationSymbolUsed=!!(gb&32);Y.reversibleTransformation=a[B++];if(Y.entropyCoderWithCustomPrecincts){for(var ab=[];B<t+x;){var Vb=a[B++];ab.push({PPx:Vb&15,PPy:Vb>>4})}Y.precinctsSizes=
|
|
227
|
-
ab}var Ha=[];Y.selectiveArithmeticCodingBypass&&Ha.push("selectiveArithmeticCodingBypass");Y.resetContextProbabilities&&Ha.push("resetContextProbabilities");Y.terminationOnEachCodingPass&&Ha.push("terminationOnEachCodingPass");Y.verticalyStripe&&Ha.push("verticalyStripe");Y.predictableTermination&&Ha.push("predictableTermination");if(0<Ha.length)throw q=!0,Error("JPX Error: Unsupported COD options ("+Ha.join(", ")+")");u.mainHeader?u.COD=Y:(u.currentTile.COD=Y,u.currentTile.COC=[]);break;case 65424:t=
|
|
228
|
-
h(a,x);W={};W.index=h(a,x+2);W.length=m(a,x+4);W.dataEnd=W.length+x-2;W.partIndex=a[x+8];W.partsCount=a[x+9];u.mainHeader=!1;0===W.partIndex&&(W.COD=u.COD,W.COC=u.COC.slice(0),W.QCD=u.QCD,W.QCC=u.QCC.slice(0));u.currentTile=W;break;case 65427:W=u.currentTile;if(0===W.partIndex){for(var Ia=u,Cc=Ia.SIZ.Csiz,oc=Ia.tiles[W.index],Ta=0;Ta<Cc;Ta++){var Cb=oc.components[Ta];Cb.quantizationParameters=void 0!==Ia.currentTile.QCC[Ta]?Ia.currentTile.QCC[Ta]:Ia.currentTile.QCD;Cb.codingStyleParameters=void 0!==
|
|
229
|
-
Ia.currentTile.COC[Ta]?Ia.currentTile.COC[Ta]:Ia.currentTile.COD}oc.codingStyleDefaultParameters=Ia.currentTile.COD;for(var ha=u,Ja=ha.tiles[ha.currentTile.index],Wb=ha.SIZ.Csiz,Xb=0;Xb<Wb;Xb++){for(var X=Ja.components[Xb],Db=X.codingStyleParameters.decompositionLevelsCount,Yb=[],rb=[],bb=0;bb<=Db;bb++){var Ea,sb=bb,cb=X.codingStyleParameters,pa={};cb.entropyCoderWithCustomPrecincts?(pa.PPx=cb.precinctsSizes[sb].PPx,pa.PPy=cb.precinctsSizes[sb].PPy):(pa.PPx=15,pa.PPy=15);pa.xcb_=0<sb?Math.min(cb.xcb,
|
|
230
|
-
pa.PPx-1):Math.min(cb.xcb,pa.PPx);pa.ycb_=0<sb?Math.min(cb.ycb,pa.PPy-1):Math.min(cb.ycb,pa.PPy);Ea=pa;var la={},Ma=1<<Db-bb;la.trx0=Math.ceil(X.tcx0/Ma);la.try0=Math.ceil(X.tcy0/Ma);la.trx1=Math.ceil(X.tcx1/Ma);la.try1=Math.ceil(X.tcy1/Ma);la.resLevel=bb;var va=la,Jb=1<<Ea.PPx,Kb=1<<Ea.PPy,Zb=0===va.resLevel,Jc=1<<Ea.PPx+(Zb?0:-1),Kc=1<<Ea.PPy+(Zb?0:-1),vb=va.trx1>va.trx0?Math.ceil(va.trx1/Jb)-Math.floor(va.trx0/Jb):0,rc=va.try1>va.try0?Math.ceil(va.try1/Kb)-Math.floor(va.try0/Kb):0;va.precinctParameters=
|
|
231
|
-
{precinctWidth:Jb,precinctHeight:Kb,numprecinctswide:vb,numprecinctshigh:rc,numprecincts:vb*rc,precinctWidthInSubband:Jc,precinctHeightInSubband:Kc};Yb.push(la);var V;if(0===bb)V={type:"LL"},V.tbx0=Math.ceil(X.tcx0/Ma),V.tby0=Math.ceil(X.tcy0/Ma),V.tbx1=Math.ceil(X.tcx1/Ma),V.tby1=Math.ceil(X.tcy1/Ma),V.resolution=la,e(ha,V,Ea),rb.push(V),la.subbands=[V];else{var sa=1<<Db-bb+1,Lb=[];V={type:"HL"};V.tbx0=Math.ceil(X.tcx0/sa-.5);V.tby0=Math.ceil(X.tcy0/sa);V.tbx1=Math.ceil(X.tcx1/sa-.5);V.tby1=Math.ceil(X.tcy1/
|
|
232
|
-
sa);V.resolution=la;e(ha,V,Ea);rb.push(V);Lb.push(V);V={type:"LH"};V.tbx0=Math.ceil(X.tcx0/sa);V.tby0=Math.ceil(X.tcy0/sa-.5);V.tbx1=Math.ceil(X.tcx1/sa);V.tby1=Math.ceil(X.tcy1/sa-.5);V.resolution=la;e(ha,V,Ea);rb.push(V);Lb.push(V);V={type:"HH"};V.tbx0=Math.ceil(X.tcx0/sa-.5);V.tby0=Math.ceil(X.tcy0/sa-.5);V.tbx1=Math.ceil(X.tcx1/sa-.5);V.tby1=Math.ceil(X.tcy1/sa-.5);V.resolution=la;e(ha,V,Ea);rb.push(V);Lb.push(V);la.subbands=Lb}}X.resolutions=Yb;X.subbands=rb}var fa=Ja.codingStyleDefaultParameters.progressionOrder;
|
|
233
|
-
switch(fa){case 0:Ja.packetsIterator=new f(ha);break;case 1:Ja.packetsIterator=new p(ha);break;case 2:Ja.packetsIterator=new z(ha);break;case 3:Ja.packetsIterator=new w(ha);break;case 4:Ja.packetsIterator=new l(ha);break;default:throw Error("JPX Error: Unsupported progression order "+fa);}}t=W.dataEnd-x;E(u,a,x,t);break;case 65365:case 65367:case 65368:case 65380:t=h(a,x);break;case 65363:throw Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");default:throw Error("JPX Error: Unknown codestream code: "+
|
|
234
|
-
O.toString(16));}x+=t}}catch(Mb){if(q||this.failOnCorruptedImage)throw Mb;b("Trying to recover from "+Mb.message)}for(var wa=u.components,ja=u.SIZ.Csiz,Oa=[],tb=0,Lc=u.tiles.length;tb<Lc;tb++){var $b=u.tiles[tb],Wa=[],ca;for(ca=0;ca<ja;ca++){for(var Ac=Wa,wb=ca,db=$b.components[ca],xb=db.codingStyleParameters,ac=db.quantizationParameters,sc=xb.decompositionLevelsCount,ya=ac.SPqcds,mc=ac.scalarExpounded,Mc=ac.guardBits,Bc=xb.segmentationSymbolUsed,tc=u.components[ca].precision,bc=xb.reversibleTransformation,
|
|
235
|
-
Nc=bc?new H:new I,Xa=[],Ba=0,eb=0;eb<=sc;eb++){for(var Ya=db.resolutions[eb],cc=Ya.trx1-Ya.trx0,dc=Ya.try1-Ya.try0,uc=new Float32Array(cc*dc),ec=0,Oc=Ya.subbands.length;ec<Oc;ec++){var Nb,ub;mc?(Nb=ya[Ba].mu,ub=ya[Ba].epsilon,Ba++):(Nb=ya[0].mu,ub=ya[0].epsilon+(0<eb?1-eb:0));for(var fc=Ya.subbands[ec],Rb=y[fc.type],vc=bc?1:Math.pow(2,tc+Rb-ub)*(1+Nb/2048),Wc=uc,gc=cc,Ca=fc,ob=vc,fb=Mc+ub-1,wc=bc,hc=Bc,ib=Ca.tbx0,Ob=Ca.tby0,Pb=Ca.tbx1-Ca.tbx0,xc=Ca.codeblocks,Pc="H"===Ca.type.charAt(0)?1:0,yb="H"===
|
|
236
|
-
Ca.type.charAt(1)?gc:0,Za=0,Xc=xc.length;Za<Xc;++Za){var Na=xc[Za],ic=Na.tbx1_-Na.tbx0_,yc=Na.tby1_-Na.tby0_;if(0!==ic&&0!==yc&&void 0!==Na.data){var Da,jc;Da=new n(ic,yc,Na.subbandType,Na.zeroBitPlanes,fb);jc=2;var kc=Na.data,lc=0,zc=0,ta,nc,hb;ta=0;for(nc=kc.length;ta<nc;ta++)hb=kc[ta],lc+=hb.end-hb.start,zc+=hb.codingpasses;var Qc=new Int16Array(lc),Sa=0;ta=0;for(nc=kc.length;ta<nc;ta++){hb=kc[ta];var Rc=hb.data.subarray(hb.start,hb.end);Qc.set(Rc,Sa);Sa+=Rc.length}var Yc=new k(Qc,0,lc);Da.setDecoder(Yc);
|
|
237
|
-
for(ta=0;ta<zc;ta++){switch(jc){case 0:Da.runSignificancePropogationPass();break;case 1:Da.runMagnitudeRefinementPass();break;case 2:Da.runCleanupPass(),hc&&Da.checkSegmentationSymbol()}jc=(jc+1)%3}var Bb=Na.tbx0_-ib+(Na.tby0_-Ob)*Pb,Zc=Da.coefficentsSign,bd=Da.coefficentsMagnitude,cd=Da.bitsDecoded,dd=wc?0:.5,Gc,kb,Hc,Sa=0,ed="LL"!==Ca.type;for(ta=0;ta<yc;ta++){var $c=2*(Bb/Pb|0)*(gc-Pb)+Pc+yb;for(Gc=0;Gc<ic;Gc++)kb=bd[Sa],0!==kb&&(kb=(kb+dd)*ob,0!==Zc[Sa]&&(kb=-kb),Hc=cd[Sa],Wc[ed?$c+(Bb<<1):Bb]=
|
|
238
|
-
wc&&Hc>=fb?kb:kb*(1<<fb-Hc)),Bb++,Sa++;Bb+=Pb-ic}}}}Xa.push({width:cc,height:dc,items:uc})}var Ic=Nc.calculate(Xa,db.tcx0,db.tcy0);Ac[wb]={left:db.tcx0,top:db.tcy0,width:Ic.width,height:Ic.height,items:Ic.items}}var Hb=Wa[0],Dc=wa[0].isSigned,Ka=Dc?new Int16Array(Hb.items.length*ja):new Uint16Array(Hb.items.length*ja),fd={left:Hb.left,top:Hb.top,width:Hb.width,height:Hb.height,items:Ka},oa,lb,La,pc,Ec,ba=0,aa,Ua,Eb,Gb,Fb,mb,Va,nb,qc,Ib;if($b.codingStyleDefaultParameters.multipleComponentTransform){var Vc=
|
|
239
|
-
4===ja,Fc=Wa[0].items,Sc=Wa[1].items,Uc=Wa[2].items,gd=Vc?Wa[3].items:null;oa=wa[0].precision-8;lb=(128<<oa)+.5;La=255*(1<<oa);Ec=.5*La;pc=-Ec;var hd=$b.components[0],Tc=ja-3;Ua=Fc.length;if(hd.codingStyleParameters.reversibleTransformation)for(aa=0;aa<Ua;aa++,ba+=Tc)Eb=Fc[aa]+lb,Gb=Sc[aa],Fb=Uc[aa],Va=Eb-(Fb+Gb>>2),mb=Va+Fb,nb=Va+Gb,Ka[ba++]=0>=mb?0:mb>=La?255:mb>>oa,Ka[ba++]=0>=Va?0:Va>=La?255:Va>>oa,Ka[ba++]=0>=nb?0:nb>=La?255:nb>>oa;else for(aa=0;aa<Ua;aa++,ba+=Tc)Eb=Fc[aa]+lb,Gb=Sc[aa],Fb=Uc[aa],
|
|
240
|
-
mb=Eb+1.402*Fb,Va=Eb-.34413*Gb-.71414*Fb,nb=Eb+1.772*Gb,Ka[ba++]=0>=mb?0:mb>=La?255:mb>>oa,Ka[ba++]=0>=Va?0:Va>=La?255:Va>>oa,Ka[ba++]=0>=nb?0:nb>=La?255:nb>>oa;if(Vc)for(aa=0,ba=3;aa<Ua;aa++,ba+=4)qc=gd[aa],Ka[ba]=qc<=pc?0:qc>=Ec?255:qc+lb>>oa}else for(ca=0;ca<ja;ca++)if(8===wa[ca].precision){var qb=Wa[ca].items;oa=wa[ca].precision-8;lb=(128<<oa)+.5;La=127.5*(1<<oa);pc=-La;ba=ca;aa=0;for(Ua=qb.length;aa<Ua;aa++)Ib=qb[aa],Ka[ba]=Ib<=pc?0:Ib>=La?255:Ib+lb>>oa,ba+=ja}else if(Dc=wa[ca].isSigned,qb=Wa[ca].items,
|
|
241
|
-
Dc)for(ba=ca,aa=0,Ua=qb.length;aa<Ua;aa++)Ka[ba]=qb[aa],ba+=ja;else{oa=wa[ca].precision-8;lb=(128<<oa)+.5;var ad=Math.pow(2,wa[ca].precision)-1,ba=ca;aa=0;for(Ua=qb.length;aa<Ua;aa++)Ib=qb[aa],Ka[ba]=Math.max(Math.min(Ib+lb,ad),0),ba+=ja}Oa.push(fd)}this.tiles=Oa;this.width=u.SIZ.Xsiz-u.SIZ.XOsiz;this.height=u.SIZ.Ysiz-u.SIZ.YOsiz;this.componentsCount=u.SIZ.Csiz}};var D=function(){function a(b,e){var d=g(Math.max(b,e))+1;this.levels=[];for(var l=0;l<d;l++)this.levels.push({width:b,height:e,items:[]}),
|
|
242
|
-
b=Math.ceil(b/2),e=Math.ceil(e/2)}a.prototype={reset:function(a,b){for(var e=0,d=0,g;e<this.levels.length;){g=this.levels[e];var l=a+b*g.width;if(void 0!==g.items[l]){d=g.items[l];break}g.index=l;a>>=1;b>>=1;e++}e--;g=this.levels[e];g.items[g.index]=d;this.currentLevel=e;delete this.value},incrementValue:function(){var a=this.levels[this.currentLevel];a.items[a.index]++},nextLevel:function(){var a=this.currentLevel,b=this.levels[a],e=b.items[b.index];a--;if(0>a)return this.value=e,!1;this.currentLevel=
|
|
243
|
-
a;b=this.levels[a];b.items[b.index]=e;return!0}};return a}(),u=function(){function a(b,e){var d=g(Math.max(b,e))+1;this.levels=[];for(var l=0;l<d;l++){for(var f=new Uint8Array(b*e),h=new Uint8Array(b*e),n=0,m=f.length;n<m;n++)f[n]=0,h[n]=0;this.levels.push({width:b,height:e,items:f,status:h});b=Math.ceil(b/2);e=Math.ceil(e/2)}}a.prototype={reset:function(a,b,e){this.currentStopValue=e;for(e=0;e<this.levels.length;){var d=this.levels[e];d.index=a+b*d.width;a>>=1;b>>=1;e++}this.currentLevel=this.levels.length-
|
|
244
|
-
1;this.minValue=this.levels[this.currentLevel].items[0]},incrementValue:function(){var a=this.levels[this.currentLevel];a.items[a.index]+=1;a.items[a.index]>this.minValue&&(this.minValue=a.items[a.index])},nextLevel:function(){var a=this.currentLevel;a--;if(0>a)return!1;this.currentLevel=a;a=this.levels[a];a.items[a.index]<this.minValue?a.items[a.index]=this.minValue:a.items[a.index]>this.minValue&&(this.minValue=a.items[a.index]);return!0},isLeaf:function(){return 0===this.currentLevel},isAboveThreshold:function(){var a=
|
|
245
|
-
this.levels[this.currentLevel];return a.items[a.index]>this.currentStopValue},isKnown:function(){var a=this.levels[this.currentLevel];return 0<a.status[a.index]},setKnown:function(){var a=this.levels[this.currentLevel];a.status[a.index]=1}};return a}(),n=function(){function a(g,l,f,h,n){this.width=g;this.height=l;this.contextLabelTable="HH"===f?d:"HL"===f?e:b;g*=l;this.neighborsSignificance=new Uint8Array(g);this.coefficentsSign=new Uint8Array(g);this.coefficentsMagnitude=14<n?new Uint32Array(g):
|
|
246
|
-
6<n?new Uint16Array(g):new Uint8Array(g);this.processingFlags=new Uint8Array(g);n=new Uint8Array(g);if(0!==h)for(l=0;l<g;l++)n[l]=h;this.bitsDecoded=n;this.reset()}var b=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),e=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,
|
|
247
|
-
8,8]),d=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);a.prototype={setDecoder:function(a){this.decoder=a},reset:function(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6},setNeighborsSignificance:function(a,b,e){var d=this.neighborsSignificance,g=this.width,l=this.height,f=0<b;b=b+1<g;var h;0<a&&(h=e-g,f&&(d[h-1]+=16),b&&(d[h+1]+=16),
|
|
248
|
-
d[h]+=4);a+1<l&&(h=e+g,f&&(d[h-1]+=16),b&&(d[h+1]+=16),d[h]+=4);f&&(d[e-1]+=1);b&&(d[e+1]+=1);d[e]|=128},runSignificancePropogationPass:function(){for(var a=this.decoder,b=this.width,e=this.height,d=this.coefficentsMagnitude,g=this.coefficentsSign,l=this.neighborsSignificance,f=this.processingFlags,h=this.contexts,n=this.contextLabelTable,m=this.bitsDecoded,u=0;u<e;u+=4)for(var k=0;k<b;k++)for(var q=u*b+k,z=0;4>z;z++,q+=b){var C=u+z;if(C>=e)break;f[q]&=-2;if(!d[q]&&l[q]){if(a.readBit(h,n[l[q]])){var p=
|
|
249
|
-
this.decodeSignBit(C,k,q);g[q]=p;d[q]=1;this.setNeighborsSignificance(C,k,q);f[q]|=2}m[q]++;f[q]|=1}}},decodeSignBit:function(a,b,e){var d=this.width,g=this.height,l=this.coefficentsMagnitude,f=this.coefficentsSign,h;h=0<b&&0!==l[e-1];b+1<d&&0!==l[e+1]?(b=f[e+1],h?(h=f[e-1],b=1-b-h):b=1-b-b):h?(h=f[e-1],b=1-h-h):b=0;var n=3*b;h=0<a&&0!==l[e-d];a+1<g&&0!==l[e+d]?(b=f[e+d],h?(h=f[e-d],b=1-b-h+n):b=1-b-b+n):h?(h=f[e-d],b=1-h-h+n):b=n;return a=0<=b?this.decoder.readBit(this.contexts,9+b):this.decoder.readBit(this.contexts,
|
|
250
|
-
9-b)^1},runMagnitudeRefinementPass:function(){for(var a=this.decoder,b=this.width,e=this.coefficentsMagnitude,d=this.neighborsSignificance,g=this.contexts,l=this.bitsDecoded,f=this.processingFlags,h=b*this.height,n=4*b,m=0,u;m<h;m=u){u=Math.min(h,m+n);for(var k=0;k<b;k++)for(var q=m+k;q<u;q+=b)if(e[q]&&0===(f[q]&1)){var z=16;0!==(f[q]&2)&&(f[q]^=2,z=0===(d[q]&127)?15:14);z=a.readBit(g,z);e[q]=e[q]<<1|z;l[q]++;f[q]|=1}}},runCleanupPass:function(){for(var a=this.decoder,b=this.width,e=this.height,d=
|
|
251
|
-
this.neighborsSignificance,g=this.coefficentsMagnitude,l=this.coefficentsSign,f=this.contexts,h=this.contextLabelTable,n=this.bitsDecoded,m=this.processingFlags,u=2*b,k=3*b,q,z=0;z<e;z=q){q=Math.min(z+4,e);for(var C=z*b,p=z+3<e,x=0;x<b;x++){var v=C+x,B=0,t=v,A=z,w;if(p&&0===m[v]&&0===m[v+b]&&0===m[v+u]&&0===m[v+k]&&0===d[v]&&0===d[v+b]&&0===d[v+u]&&0===d[v+k]){if(!a.readBit(f,18)){n[v]++;n[v+b]++;n[v+u]++;n[v+k]++;continue}B=a.readBit(f,17)<<1|a.readBit(f,17);0!==B&&(A=z+B,t+=B*b);w=this.decodeSignBit(A,
|
|
252
|
-
x,t);l[t]=w;g[t]=1;this.setNeighborsSignificance(A,x,t);m[t]|=2;t=v;for(v=z;v<=A;v++,t+=b)n[t]++;B++}for(A=z+B;A<q;A++,t+=b)g[t]||0!==(m[t]&1)||(1===a.readBit(f,h[d[t]])&&(w=this.decodeSignBit(A,x,t),l[t]=w,g[t]=1,this.setNeighborsSignificance(A,x,t),m[t]|=2),n[t]++)}}},checkSegmentationSymbol:function(){var a=this.decoder,b=this.contexts;if(10!==(a.readBit(b,17)<<3|a.readBit(b,17)<<2|a.readBit(b,17)<<1|a.readBit(b,17)))throw Error("JPX Error: Invalid segmentation symbol");}};return a}(),q=function(){function a(){}
|
|
253
|
-
a.prototype.calculate=function(a,b,e){for(var d=a[0],g=1,l=a.length;g<l;g++)d=this.iterate(d,a[g],b,e);return d};a.prototype.extend=function(a,b,e){var d=b-1,g=b+1,l=b+e-2;b+=e;a[d--]=a[g++];a[b++]=a[l--];a[d--]=a[g++];a[b++]=a[l--];a[d--]=a[g++];a[b++]=a[l--];a[d]=a[g];a[b]=a[l]};a.prototype.iterate=function(a,b,e,d){var g=a.width,l=a.height,f=a.items,h=b.width,n=b.height;b=b.items;var m,u,k,q;for(m=k=0;m<l;m++)for(q=2*m*h,u=0;u<g;u++,k++,q+=2)b[q]=f[k];a.items=null;a=new Float32Array(h+8);if(1===
|
|
254
|
-
h){if(0!==(e&1))for(k=q=0;q<n;q++,k+=h)b[k]*=.5}else for(k=q=0;q<n;q++,k+=h)a.set(b.subarray(k,k+h),4),this.extend(a,4,h),this.filter(a,4,h),b.set(a.subarray(4,4+h),k);e=16;g=[];for(m=0;m<e;m++)g.push(new Float32Array(n+8));m=0;a=4+n;if(1===n){if(0!==(d&1))for(d=0;d<h;d++)b[d]*=.5}else for(d=0;d<h;d++){if(0===m){e=Math.min(h-d,e);k=d;for(q=4;q<a;k+=h,q++)for(l=0;l<e;l++)g[l][q]=b[k+l];m=e}m--;k=g[m];this.extend(k,4,n);this.filter(k,4,n);if(0===m)for(k=d-e+1,q=4;q<a;k+=h,q++)for(l=0;l<e;l++)b[k+l]=
|
|
255
|
-
g[l][q]}return{width:h,height:n,items:b}};return a}(),I=function(){function a(){q.call(this)}a.prototype=Object.create(q.prototype);a.prototype.filter=function(a,b,e){e>>=1;b|=0;var d,g,l,f;d=b-3;for(g=e+4;g--;d+=2)a[d]*=.8128930661159609;d=b-2;l=.443506852043971*a[d-1];for(g=e+3;g--;d+=2)if(f=.443506852043971*a[d+1],a[d]=1.230174104914001*a[d]-l-f,g--)d+=2,l=.443506852043971*a[d+1],a[d]=1.230174104914001*a[d]-l-f;else break;d=b-1;l=.882911075530934*a[d-1];for(g=e+2;g--;d+=2)if(f=.882911075530934*
|
|
256
|
-
a[d+1],a[d]-=l+f,g--)d+=2,l=.882911075530934*a[d+1],a[d]-=l+f;else break;d=b;l=-.052980118572961*a[d-1];for(g=e+1;g--;d+=2)if(f=-.052980118572961*a[d+1],a[d]-=l+f,g--)d+=2,l=-.052980118572961*a[d+1],a[d]-=l+f;else break;if(0!==e)for(d=b+1,l=-1.586134342059924*a[d-1],g=e;g--;d+=2)if(f=-1.586134342059924*a[d+1],a[d]-=l+f,g--)d+=2,l=-1.586134342059924*a[d+1],a[d]-=l+f;else break};return a}(),H=function(){function a(){q.call(this)}a.prototype=Object.create(q.prototype);a.prototype.filter=function(a,b,
|
|
257
|
-
e){e>>=1;b|=0;var d,g;d=b;for(g=e+1;g--;d+=2)a[d]-=a[d-1]+a[d+1]+2>>2;d=b+1;for(g=e;g--;d+=2)a[d]+=a[d-1]+a[d+1]>>1};return a}();return a}();"use strict";var k=function(){function a(b,e,d){this.data=b;this.bp=e;this.dataEnd=d;this.chigh=b[e];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}var b=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,
|
|
258
|
-
nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,
|
|
259
|
-
nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},
|
|
260
|
-
{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,
|
|
261
|
-
nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];a.prototype={byteIn:function(){var a=this.data,b=this.bp;255===a[b]?143<a[b+1]?(this.clow+=65280,this.ct=8):(b++,this.clow+=a[b]<<9,this.ct=7,this.bp=b):(b++,this.clow+=b<this.dataEnd?a[b]<<8:65280,this.ct=8,this.bp=b);65535<this.clow&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(a,e){var d=a[e]>>1,g=a[e]&
|
|
262
|
-
1,d=b[d],f=d.qe,l=this.a-f;if(this.chigh<f)l<f?(l=f,f=g,d=d.nmps):(l=f,f=1^g,1===d.switchFlag&&(g=f),d=d.nlps);else{this.chigh-=f;if(0!==(l&32768))return this.a=l,g;l<f?(f=1^g,1===d.switchFlag&&(g=f),d=d.nlps):(f=g,d=d.nmps)}do 0===this.ct&&this.byteIn(),l<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(l&32768));this.a=l;a[e]=d<<1|g;return f}};return a}();"use strict";var p="undefined"===typeof window?this:window;p.PDFJS||(p.PDFJS={});var t=t||
|
|
263
|
-
{};t.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5};t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,
|
|
264
|
-
setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,
|
|
265
|
-
beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,
|
|
266
|
-
paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"};t.UnsupportedManager=function(){var a=[];return{listen:function(b){a.push(b)},notify:function(e){b('Unsupported feature "'+e+'"');for(var d=0,g=a.length;d<g;d++)a[d](e)}}}();t.isValidUrl=function(a,b){if(!a)return!1;var e=/^[a-z][a-z0-9+\-.]*(?=:)/i.exec(a);
|
|
267
|
-
if(!e)return b;e=e[0].toLowerCase();switch(e){case "http":case "https":case "ftp":case "mailto":case "tel":return!0;default:return!1}};t.shadow=e;t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};f=function(){function a(b,e){this.name="PasswordException";this.message=b;this.code=e}a.prototype=Error();return a.constructor=a}();t.PasswordException=f;f=function(){function a(b,e){this.name="UnknownErrorException";this.message=b;this.details=e}a.prototype=Error();return a.constructor=a}();t.UnknownErrorException=
|
|
268
|
-
f;f=function(){function a(b){this.name="InvalidPDFException";this.message=b}a.prototype=Error();return a.constructor=a}();t.InvalidPDFException=f;f=function(){function a(b){this.name="MissingPDFException";this.message=b}a.prototype=Error();return a.constructor=a}();t.MissingPDFException=f;f=function(){function a(b,e){this.name="UnexpectedResponseException";this.message=b;this.status=e}a.prototype=Error();return a.constructor=a}();t.UnexpectedResponseException=f;(function(){function a(b){this.message=
|
|
269
|
-
b}a.prototype=Error();a.prototype.name="NotImplementedException";return a.constructor=a})();(function(){function a(b,e){this.begin=b;this.end=e;this.message="Missing data ["+b+", "+e+")"}a.prototype=Error();a.prototype.name="MissingDataException";return a.constructor=a})();(function(){function a(b){this.message=b}a.prototype=Error();a.prototype.name="XRefParseException";return a.constructor=a})();Object.defineProperty(t,"isLittleEndian",{configurable:!0,get:function(){var a=t,b=new Uint8Array(2);
|
|
270
|
-
b[0]=1;b=new Uint16Array(b.buffer);return e(a,"isLittleEndian",1===b[0])}});Object.defineProperty(t,"hasCanvasTypedArrays",{configurable:!0,get:function(){var a=t,b=document.createElement("canvas");b.width=b.height=1;b=b.getContext("2d").createImageData(1,1);return e(a,"hasCanvasTypedArrays","undefined"!==typeof b.data.buffer)}});(function(){function a(d,g){this.buffer=d;this.byteLength=d.length;for(var f=this.length=void 0===g?this.byteLength>>2:g;e<f;)Object.defineProperty(a.prototype,e,b(e)),e++}
|
|
271
|
-
function b(a){return{get:function(){var b=this.buffer,e=a<<2;return(b[e]|b[e+1]<<8|b[e+2]<<16|b[e+3]<<24)>>>0},set:function(b){var e=this.buffer,d=a<<2;e[d]=b&255;e[d+1]=b>>8&255;e[d+2]=b>>16&255;e[d+3]=b>>>24&255}}}a.prototype=Object.create(null);var e=0;return a})();var w=t.Util=function(){function a(){}var b=["rgb(",0,",",0,",",0,")"];a.makeCssRgb=function(a,e,d){b[1]=a;b[3]=e;b[5]=d;return b.join("")};a.transform=function(a,b){return[a[0]*b[0]+a[2]*b[1],a[1]*b[0]+a[3]*b[1],a[0]*b[2]+a[2]*b[3],
|
|
272
|
-
a[1]*b[2]+a[3]*b[3],a[0]*b[4]+a[2]*b[5]+a[4],a[1]*b[4]+a[3]*b[5]+a[5]]};a.applyTransform=function(a,b){return[a[0]*b[0]+a[1]*b[2]+b[4],a[0]*b[1]+a[1]*b[3]+b[5]]};a.applyInverseTransform=function(a,b){var e=b[0]*b[3]-b[1]*b[2];return[(a[0]*b[3]-a[1]*b[2]+b[2]*b[5]-b[4]*b[3])/e,(-a[0]*b[1]+a[1]*b[0]+b[4]*b[1]-b[5]*b[0])/e]};a.getAxialAlignedBoundingBox=function(b,e){var d=a.applyTransform(b,e),g=a.applyTransform(b.slice(2,4),e),f=a.applyTransform([b[0],b[3]],e),l=a.applyTransform([b[2],b[1]],e);return[Math.min(d[0],
|
|
273
|
-
g[0],f[0],l[0]),Math.min(d[1],g[1],f[1],l[1]),Math.max(d[0],g[0],f[0],l[0]),Math.max(d[1],g[1],f[1],l[1])]};a.inverseTransform=function(a){var b=a[0]*a[3]-a[1]*a[2];return[a[3]/b,-a[1]/b,-a[2]/b,a[0]/b,(a[2]*a[5]-a[4]*a[3])/b,(a[4]*a[1]-a[5]*a[0])/b]};a.apply3dTransform=function(a,b){return[a[0]*b[0]+a[1]*b[1]+a[2]*b[2],a[3]*b[0]+a[4]*b[1]+a[5]*b[2],a[6]*b[0]+a[7]*b[1]+a[8]*b[2]]};a.singularValueDecompose2dScale=function(a){var b=[a[0],a[2],a[1],a[3]],e=a[0]*b[0]+a[1]*b[2],d=a[2]*b[1]+a[3]*b[3],g=
|
|
274
|
-
(e+d)/2;a=Math.sqrt((e+d)*(e+d)-4*(e*d-(a[2]*b[0]+a[3]*b[2])*(a[0]*b[1]+a[1]*b[3])))/2;b=g-a||1;return[Math.sqrt(g+a||1),Math.sqrt(b)]};a.normalizeRect=function(a){var b=a.slice(0);a[0]>a[2]&&(b[0]=a[2],b[2]=a[0]);a[1]>a[3]&&(b[1]=a[3],b[3]=a[1]);return b};a.intersect=function(b,e){function d(a,b){return a-b}var g=[b[0],b[2],e[0],e[2]].sort(d),f=[b[1],b[3],e[1],e[3]].sort(d),l=[];b=a.normalizeRect(b);e=a.normalizeRect(e);if(g[0]===b[0]&&g[1]===e[0]||g[0]===e[0]&&g[1]===b[0])l[0]=g[1],l[2]=g[2];else return!1;
|
|
275
|
-
if(f[0]===b[1]&&f[1]===e[1]||f[0]===e[1]&&f[1]===b[1])l[1]=f[1],l[3]=f[2];else return!1;return l};a.sign=function(a){return 0>a?-1:1};a.appendToArray=function(a,b){Array.prototype.push.apply(a,b)};a.prependToArray=function(a,b){Array.prototype.unshift.apply(a,b)};a.extendObj=function(a,b){for(var e in b)a[e]=b[e]};a.getInheritableProperty=function(a,b){for(;a&&!a.has(b);)a=a.get("Parent");return a?a.get(b):null};a.inherit=function(a,b,e){a.prototype=Object.create(b.prototype);a.prototype.constructor=
|
|
276
|
-
a;for(var d in e)a.prototype[d]=e[d]};a.loadScript=function(a,b){var e=document.createElement("script"),d=!1;e.setAttribute("src",a);b&&(e.onload=function(){d||b();d=!0});document.getElementsByTagName("head")[0].appendChild(e)};return a}();t.PageViewport=function(){function a(b,e,d,g,f,h){this.viewBox=b;this.scale=e;this.rotation=d;this.offsetX=g;this.offsetY=f;var l=(b[2]+b[0])/2,m=(b[3]+b[1])/2,k,p,t;d%=360;switch(0>d?d+360:d){case 180:d=-1;p=k=0;t=1;break;case 90:d=0;p=k=1;t=0;break;case 270:d=
|
|
277
|
-
0;p=k=-1;t=0;break;default:d=1,p=k=0,t=-1}h&&(p=-p,t=-t);0===d?(g=Math.abs(m-b[1])*e+g,f=Math.abs(l-b[0])*e+f,h=Math.abs(b[3]-b[1])*e,b=Math.abs(b[2]-b[0])*e):(g=Math.abs(l-b[0])*e+g,f=Math.abs(m-b[1])*e+f,h=Math.abs(b[2]-b[0])*e,b=Math.abs(b[3]-b[1])*e);this.transform=[d*e,k*e,p*e,t*e,g-d*e*l-p*e*m,f-k*e*l-t*e*m];this.width=h;this.height=b;this.fontScale=e}a.prototype={clone:function(b){b=b||{};var e="scale"in b?b.scale:this.scale,d="rotation"in b?b.rotation:this.rotation;return new a(this.viewBox.slice(),
|
|
278
|
-
e,d,this.offsetX,this.offsetY,b.dontFlip)},convertToViewportPoint:function(a,b){return w.applyTransform([a,b],this.transform)},convertToViewportRectangle:function(a){var b=w.applyTransform([a[0],a[1]],this.transform);a=w.applyTransform([a[2],a[3]],this.transform);return[b[0],b[1],a[0],a[1]]},convertToPdfPoint:function(a,b){return w.applyInverseTransform([a,b],this.transform)}};return a}();t.createPromiseCapability=function(){var a={};a.promise=new Promise(function(b,e){a.resolve=b;a.reject=e});return a};
|
|
279
|
-
(function(){function a(b){this._status=0;this._handlers=[];try{b.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}}if(p.Promise)"function"!==typeof p.Promise.all&&(p.Promise.all=function(a){var b=0,e=[],d,g,l=new p.Promise(function(a,b){d=a;g=b});a.forEach(function(a,l){b++;a.then(function(a){e[l]=a;b--;0===b&&d(e)},g)});0===b&&d(e);return l}),"function"!==typeof p.Promise.resolve&&(p.Promise.resolve=function(a){return new p.Promise(function(b){b(a)})}),"function"!==
|
|
280
|
-
typeof p.Promise.reject&&(p.Promise.reject=function(a){return new p.Promise(function(b,e){e(a)})}),"function"!==typeof p.Promise.prototype.catch2&&(p.Promise.prototype.catch2=function(a){return p.Promise.prototype.then(void 0,a)});else{var e={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(a){0!==a._status&&(this.handlers=this.handlers.concat(a._handlers),a._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var a=
|
|
281
|
-
Date.now()+1;0<this.handlers.length;){var b=this.handlers.shift(),e=b.thisPromise._status,d=b.thisPromise._value;try{1===e?"function"===typeof b.onResolve&&(d=b.onResolve(d)):"function"===typeof b.onReject&&(d=b.onReject(d),e=1,b.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(b.thisPromise))}catch(g){e=2,d=g}b.nextPromise._updateStatus(e,d);if(Date.now()>=a)break}0<this.handlers.length?setTimeout(this.runHandlers.bind(this),0):this.running=!1},addUnhandledRejection:function(a){this.unhandledRejections.push({promise:a,
|
|
282
|
-
time:Date.now()});this.scheduleRejectionCheck()},removeUnhandeledRejection:function(a){a._unhandledRejection=!1;for(var b=0;b<this.unhandledRejections.length;b++)this.unhandledRejections[b].promise===a&&(this.unhandledRejections.splice(b),b--)},scheduleRejectionCheck:function(){this.pendingRejectionCheck||(this.pendingRejectionCheck=!0,setTimeout(function(){this.pendingRejectionCheck=!1;for(var a=Date.now(),e=0;e<this.unhandledRejections.length;e++)if(500<a-this.unhandledRejections[e].time){var d=
|
|
283
|
-
this.unhandledRejections[e].promise._value,g="Unhandled rejection: "+d;d.stack&&(g+="\n"+d.stack);b(g);this.unhandledRejections.splice(e);e--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),500))}};a.all=function(b){function e(a){2!==f._status&&(h=[],g(a))}var d,g,f=new a(function(a,b){d=a;g=b}),l=b.length,h=[];if(0===l)return d(h),f;for(var m=0,k=b.length;m<k;++m){var p=b[m],t=function(a){return function(b){2!==f._status&&(h[a]=b,l--,0===l&&d(h))}}(m);a.isPromise(p)?p.then(t,
|
|
284
|
-
e):t(p)}return f};a.isPromise=function(a){return a&&"function"===typeof a.then};a.resolve=function(b){return new a(function(a){a(b)})};a.reject=function(b){return new a(function(a,e){e(b)})};a.prototype={_status:null,_value:null,_handlers:null,_unhandledRejection:null,_updateStatus:function(b,d){1!==this._status&&2!==this._status&&(1===b&&a.isPromise(d)?d.then(this._updateStatus.bind(this,1),this._updateStatus.bind(this,2)):(this._status=b,this._value=d,2===b&&0===this._handlers.length&&(this._unhandledRejection=
|
|
285
|
-
!0,e.addUnhandledRejection(this)),e.scheduleHandlers(this)))},_resolve:function(a){this._updateStatus(1,a)},_reject:function(a){this._updateStatus(2,a)},then:function(b,d){var g=new a(function(a,b){this.resolve=a;this.reject=b});this._handlers.push({thisPromise:this,onResolve:b,onReject:d,nextPromise:g});e.scheduleHandlers(this);return g},catch2:function(a){return this.then(void 0,a)}};p.Promise=a}})();(function(){function a(){this.started={};this.times=[];this.enabled=!0}a.prototype={time:function(a){this.enabled&&
|
|
286
|
-
(a in this.started&&b("Timer is already running for "+a),this.started[a]=Date.now())},timeEnd:function(a){this.enabled&&(a in this.started||b("Timer has not been started for "+a),this.times.push({name:a,start:this.started[a],end:Date.now()}),delete this.started[a])},toString:function(){var a,b,e=this.times,d="",g=0;a=0;for(b=e.length;a<b;++a){var f=e[a].name;f.length>g&&(g=f.length)}a=0;for(b=e.length;a<b;++a){for(var l=e[a],f=l.end-l.start,l=l.name;l.length<g;)l+=" ";d+=l+" "+f+"ms\n"}return d}};
|
|
287
|
-
return a})();t.createBlob=function(a,b){if("undefined"!==typeof Blob)return new Blob([a],{type:b});var e=new MozBlobBuilder;e.append(a);return e.getBlob(b)};t.createObjectURL=function(){return function(a,b){if(!t.disableCreateObjectURL&&"undefined"!==typeof URL&&URL.createObjectURL){var e=t.createBlob(a,b);return URL.createObjectURL(e)}for(var e="data:"+b+";base64,",d=0,g=a.length;d<g;d+=3)var f=a[d]&255,h=a[d+1]&255,l=a[d+2]&255,e=e+("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[f>>
|
|
288
|
-
2]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[(f&3)<<4|h>>4]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[d+1<g?(h&15)<<2|l>>6:64]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[d+2<g?l&63:64]);return e}}();"undefined"!==typeof d&&d.exports&&(d.exports=a)},{}],3:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.ComponentSpec=b.lossless.ComponentSpec||function(){this.vSamp=this.quantTableSel=this.hSamp=0};"undefined"!==
|
|
289
|
-
typeof d&&d.exports&&(d.exports=b.lossless.ComponentSpec)},{}],4:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||function(a,b,d){this.buffer=new DataView(a,b,d);this.index=0};b.lossless.DataStream.prototype.get16=function(){var a=this.buffer.getUint16(this.index,!1);this.index+=2;return a};b.lossless.DataStream.prototype.get8=function(){var a=this.buffer.getUint8(this.index);this.index+=1;return a};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.DataStream)},
|
|
290
|
-
{}],5:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.HuffmanTable=b.lossless.HuffmanTable||("undefined"!==typeof a?a("./huffman-table.js"):null);b.lossless.QuantizationTable=b.lossless.QuantizationTable||("undefined"!==typeof a?a("./quantization-table.js"):null);b.lossless.ScanHeader=b.lossless.ScanHeader||("undefined"!==typeof a?a("./scan-header.js"):null);b.lossless.FrameHeader=b.lossless.FrameHeader||
|
|
291
|
-
("undefined"!==typeof a?a("./frame-header.js"):null);b.lossless.Utils=b.lossless.Utils||("undefined"!==typeof a?a("./utils.js"):null);b.lossless.Decoder=b.lossless.Decoder||function(a,d){this.buffer=a;this.frame=new b.lossless.FrameHeader;this.huffTable=new b.lossless.HuffmanTable;this.quantTable=new b.lossless.QuantizationTable;this.scan=new b.lossless.ScanHeader;this.DU=b.lossless.Utils.createArray(10,4,64);this.HuffTab=b.lossless.Utils.createArray(4,2,12800);this.IDCT_Source=[];this.nBlock=[];
|
|
292
|
-
this.acTab=b.lossless.Utils.createArray(10,1);this.dcTab=b.lossless.Utils.createArray(10,1);this.qTab=b.lossless.Utils.createArray(10,1);this.numBytes=this.yLoc=this.xLoc=this.yDim=this.xDim=this.selection=this.restartInterval=this.numComp=this.markerIndex=this.marker=0;this.outputData=null;this.restarting=!1;this.mask=0;"undefined"!==typeof d&&(this.numBytes=d)};b.lossless.Decoder.IDCT_P=[0,5,40,16,45,2,7,42,21,56,8,61,18,47,1,4,41,23,58,13,32,24,37,10,63,17,44,3,6,43,20,57,15,34,29,48,53,26,39,
|
|
293
|
-
9,60,19,46,22,59,12,33,31,50,55,25,36,11,62,14,35,28,49,52,27,38,30,51,54];b.lossless.Decoder.TABLE=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63];b.lossless.Decoder.MAX_HUFFMAN_SUBTREE=50;b.lossless.Decoder.MSB=2147483648;b.lossless.Decoder.RESTART_MARKER_BEGIN=65488;b.lossless.Decoder.RESTART_MARKER_END=65495;b.lossless.Decoder.prototype.decompress=function(a,
|
|
294
|
-
b,d){return this.decode(a,b,d).buffer};b.lossless.Decoder.prototype.decode=function(a,d,f,m){var k=0,p=[],t=[],w=[];"undefined"!==typeof a&&(this.buffer=a);"undefined"!==typeof m&&(this.numBytes=m);this.stream=new b.lossless.DataStream(this.buffer,d,f);this.buffer=null;this.yLoc=this.xLoc=0;a=this.stream.get16();if(65496!==a)throw Error("Not a JPEG file");for(a=this.stream.get16();4092!==a>>4||65476===a;){switch(a){case 65476:this.huffTable.read(this.stream,this.HuffTab);break;case 65484:throw Error("Program doesn't support arithmetic coding. (format throw new IOException)");
|
|
295
|
-
case 65499:this.quantTable.read(this.stream,b.lossless.Decoder.TABLE);break;case 65501:this.restartInterval=this.readNumber();break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:this.readApp();break;case 65534:this.readComment();break;default:if(255!==a>>8)throw Error("ERROR: format throw new IOException! (decode)");}a=this.stream.get16()}if(65472>a||65479<a)throw Error("ERROR: could not handle arithmetic code!");
|
|
296
|
-
this.frame.read(this.stream);a=this.stream.get16();do{for(;65498!==a;){switch(a){case 65476:this.huffTable.read(this.stream,this.HuffTab);break;case 65484:throw Error("Program doesn't support arithmetic coding. (format throw new IOException)");case 65499:this.quantTable.read(this.stream,b.lossless.Decoder.TABLE);break;case 65501:this.restartInterval=this.readNumber();break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:this.readApp();
|
|
297
|
-
break;case 65534:this.readComment();break;default:if(255!==a>>8)throw Error("ERROR: format throw new IOException! (Parser.decode)");}a=this.stream.get16()}this.precision=this.frame.precision;this.components=this.frame.components;this.numBytes||(this.numBytes=parseInt(Math.ceil(this.precision/8)));this.mask=1==this.numBytes?255:65535;this.scan.read(this.stream);this.numComp=this.scan.numComp;this.selection=this.scan.selection;1===this.numBytes?3===this.numComp?(this.getter=this.getValueRGB,this.setter=
|
|
298
|
-
this.setValueRGB,this.output=this.outputRGB):(this.getter=this.getValue8,this.setter=this.setValue8,this.output=this.outputSingle):(this.getter=this.getValue16,this.setter=this.setValue16,this.output=this.outputSingle);switch(this.selection){case 2:this.selector=this.select2;break;case 3:this.selector=this.select3;break;case 4:this.selector=this.select4;break;case 5:this.selector=this.select5;break;case 6:this.selector=this.select6;break;case 7:this.selector=this.select7;break;default:this.selector=
|
|
299
|
-
this.select1}this.scanComps=this.scan.components;this.quantTables=this.quantTable.quantTables;for(d=0;d<this.numComp;d+=1)f=this.scanComps[d].scanCompSel,this.qTab[d]=this.quantTables[this.components[f].quantTableSel],this.nBlock[d]=this.components[f].vSamp*this.components[f].hSamp,this.dcTab[d]=this.HuffTab[this.scanComps[d].dcTabSel][0],this.acTab[d]=this.HuffTab[this.scanComps[d].acTabSel][1];this.xDim=this.frame.dimX;this.yDim=this.frame.dimY;this.outputData=new DataView(new ArrayBuffer(this.xDim*
|
|
300
|
-
this.yDim*this.numBytes*this.numComp));for(k+=1;;){t[0]=0;for(d=w[0]=0;10>d;d+=1)p[d]=1<<this.precision-1;if(0===this.restartInterval){for(a=this.decodeUnit(p,t,w);0===a&&this.xLoc<this.xDim&&this.yLoc<this.yDim;)this.output(p),a=this.decodeUnit(p,t,w);break}for(d=0;d<this.restartInterval&&(this.restarting=0==d,a=this.decodeUnit(p,t,w),this.output(p),0===a);d+=1);0===a&&(0!==this.markerIndex?(a=65280|this.marker,this.markerIndex=0):a=this.stream.get16());if(!(a>=b.lossless.Decoder.RESTART_MARKER_BEGIN&&
|
|
301
|
-
a<=b.lossless.Decoder.RESTART_MARKER_END))break}65500===a&&1===k&&(this.readNumber(),a=this.stream.get16())}while(65497!==a&&this.xLoc<this.xDim&&this.yLoc<this.yDim&&0===k);return this.outputData};b.lossless.Decoder.prototype.decodeUnit=function(a,b,d){return 1==this.numComp?this.decodeSingle(a,b,d):3==this.numComp?this.decodeRGB(a,b,d):-1};b.lossless.Decoder.prototype.select1=function(a){return this.getPreviousX(a)};b.lossless.Decoder.prototype.select2=function(a){return this.getPreviousY(a)};b.lossless.Decoder.prototype.select3=
|
|
302
|
-
function(a){return this.getPreviousXY(a)};b.lossless.Decoder.prototype.select4=function(a){return this.getPreviousX(a)+this.getPreviousY(a)-this.getPreviousXY(a)};b.lossless.Decoder.prototype.select5=function(a){return this.getPreviousX(a)+(this.getPreviousY(a)-this.getPreviousXY(a)>>1)};b.lossless.Decoder.prototype.select6=function(a){return this.getPreviousY(a)+(this.getPreviousX(a)-this.getPreviousXY(a)>>1)};b.lossless.Decoder.prototype.select7=function(a){return(this.getPreviousX(a)+this.getPreviousY(a))/
|
|
303
|
-
2};b.lossless.Decoder.prototype.decodeRGB=function(a,d,f){var m,k,p,t,w,B,A;a[0]=this.selector(0);a[1]=this.selector(1);a[2]=this.selector(2);for(w=0;w<this.numComp;w+=1)for(t=this.qTab[w],k=this.acTab[w],p=this.dcTab[w],B=0;B<this.nBlock[w];B+=1){for(m=0;m<this.IDCT_Source.length;m+=1)this.IDCT_Source[m]=0;m=this.getHuffmanValue(p,d,f);if(65280<=m)return m;a[w]=this.IDCT_Source[0]=a[w]+this.getn(f,m,d,f);this.IDCT_Source[0]*=t[0];for(A=1;64>A;A+=1){m=this.getHuffmanValue(k,d,f);if(65280<=m)return m;
|
|
304
|
-
A+=m>>4;if(0===(m&15)){if(0===m>>4)break}else this.IDCT_Source[b.lossless.Decoder.IDCT_P[A]]=this.getn(f,m&15,d,f)*t[A]}}return 0};b.lossless.Decoder.prototype.decodeSingle=function(a,d,f){var m,k,p;this.restarting?(this.restarting=!1,a[0]=1<<this.frame.precision-1):a[0]=this.selector();for(k=0;k<this.nBlock[0];k+=1){m=this.getHuffmanValue(this.dcTab[0],d,f);if(65280<=m)return m;m=this.getn(a,m,d,f);p=m>>8;if(p>=b.lossless.Decoder.RESTART_MARKER_BEGIN&&p<=b.lossless.Decoder.RESTART_MARKER_END)return p;
|
|
305
|
-
a[0]+=m}return 0};b.lossless.Decoder.prototype.getHuffmanValue=function(a,d,f){var m,k;8>f[0]?(d[0]<<=8,k=this.stream.get8(),255===k&&(this.marker=this.stream.get8(),0!==this.marker&&(this.markerIndex=9)),d[0]|=k):f[0]-=8;m=a[d[0]>>f[0]];if(0!==(m&b.lossless.Decoder.MSB)){if(0!==this.markerIndex)return this.markerIndex=0,65280|this.marker;d[0]&=65535>>16-f[0];d[0]<<=8;k=this.stream.get8();255===k&&(this.marker=this.stream.get8(),0!==this.marker&&(this.markerIndex=9));d[0]|=k;m=a[256*(m&255)+(d[0]>>
|
|
306
|
-
f[0])];f[0]+=8}f[0]+=8-(m>>8);if(0>f[0])throw Error("index="+f[0]+" temp="+d[0]+" code="+m+" in HuffmanValue()");if(f[0]<this.markerIndex)return this.markerIndex=0,65280|this.marker;d[0]&=65535>>16-f[0];return m&255};b.lossless.Decoder.prototype.getn=function(a,b,d,f){if(0===b)return 0;if(16===b)return 0<=a[0]?-32768:32768;f[0]-=b;if(0<=f[0]){if(f[0]<this.markerIndex&&!this.isLastPixel())return this.markerIndex=0,(65280|this.marker)<<8}else{d[0]<<=8;a=this.stream.get8();255===a&&(this.marker=this.stream.get8(),
|
|
307
|
-
0!==this.marker&&(this.markerIndex=9));d[0]|=a;f[0]+=8;if(0>f[0]){if(0!==this.markerIndex)return this.markerIndex=0,(65280|this.marker)<<8;d[0]<<=8;a=this.stream.get8();255===a&&(this.marker=this.stream.get8(),0!==this.marker&&(this.markerIndex=9));d[0]|=a;f[0]+=8}if(0>f[0])throw Error("index="+f[0]+" in getn()");if(f[0]<this.markerIndex)return this.markerIndex=0,(65280|this.marker)<<8}a=d[0]>>f[0];d[0]&=65535>>16-f[0];a<1<<b-1&&(a+=(-1<<b)+1);return a};b.lossless.Decoder.prototype.getPreviousX=function(a){return 0<
|
|
308
|
-
this.xLoc?this.getter(this.yLoc*this.xDim+this.xLoc-1,a):0<this.yLoc?this.getPreviousY(a):1<<this.frame.precision-1};b.lossless.Decoder.prototype.getPreviousXY=function(a){return 0<this.xLoc&&0<this.yLoc?this.getter((this.yLoc-1)*this.xDim+this.xLoc-1,a):this.getPreviousY(a)};b.lossless.Decoder.prototype.getPreviousY=function(a){return 0<this.yLoc?this.getter((this.yLoc-1)*this.xDim+this.xLoc,a):this.getPreviousX(a)};b.lossless.Decoder.prototype.isLastPixel=function(){return this.xLoc===this.xDim-
|
|
309
|
-
1&&this.yLoc===this.yDim-1};b.lossless.Decoder.prototype.outputSingle=function(a){this.xLoc<this.xDim&&this.yLoc<this.yDim&&(this.setter(this.yLoc*this.xDim+this.xLoc,this.mask&a[0]),this.xLoc+=1,this.xLoc>=this.xDim&&(this.yLoc+=1,this.xLoc=0))};b.lossless.Decoder.prototype.outputRGB=function(a){var b=this.yLoc*this.xDim+this.xLoc;this.xLoc<this.xDim&&this.yLoc<this.yDim&&(this.setter(b,a[0],0),this.setter(b,a[1],1),this.setter(b,a[2],2),this.xLoc+=1,this.xLoc>=this.xDim&&(this.yLoc+=1,this.xLoc=
|
|
310
|
-
0))};b.lossless.Decoder.prototype.setValue16=function(a,b){this.outputData.setInt16(2*a,b,!0)};b.lossless.Decoder.prototype.getValue16=function(a){return this.outputData.getInt16(2*a,!0)&this.mask};b.lossless.Decoder.prototype.setValue8=function(a,b){this.outputData.setInt8(a,b)};b.lossless.Decoder.prototype.getValue8=function(a){return this.outputData.getInt8(a)&this.mask};b.lossless.Decoder.prototype.setValueRGB=function(a,b,d){this.outputData.setUint8(3*a+d,b)};b.lossless.Decoder.prototype.getValueRGB=
|
|
311
|
-
function(a,b){return this.outputData.getUint8(3*a+b)};b.lossless.Decoder.prototype.readApp=function(){for(var a=0,b=this.stream.get16(),a=a+2;a<b;)this.stream.get8(),a+=1;return b};b.lossless.Decoder.prototype.readComment=function(){var a="",b=0,d;d=this.stream.get16();for(b+=2;b<d;)a+=this.stream.get8(),b+=1;return a};b.lossless.Decoder.prototype.readNumber=function(){if(4!==this.stream.get16())throw Error("ERROR: Define number format throw new IOException [Ld!=4]");return this.stream.get16()};"undefined"!==
|
|
312
|
-
typeof d&&d.exports&&(d.exports=b.lossless.Decoder)},{"./data-stream.js":4,"./frame-header.js":6,"./huffman-table.js":7,"./quantization-table.js":9,"./scan-header.js":11,"./utils.js":12}],6:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.ComponentSpec=b.lossless.ComponentSpec||("undefined"!==typeof a?a("./component-spec.js"):null);b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.FrameHeader=b.lossless.FrameHeader||function(){this.components=
|
|
313
|
-
[];this.precision=this.numComp=this.dimY=this.dimX=0};b.lossless.FrameHeader.prototype.read=function(a){var d=0,f,m,k,p;f=a.get16();d+=2;this.precision=a.get8();d+=1;this.dimY=a.get16();d+=2;this.dimX=a.get16();d+=2;this.numComp=a.get8();d+=1;for(m=1;m<=this.numComp;m+=1){if(d>f)throw Error("ERROR: frame format error");k=a.get8();d+=1;if(d>=f)throw Error("ERROR: frame format error [c>=Lf]");p=a.get8();d+=1;this.components[k]||(this.components[k]=new b.lossless.ComponentSpec);this.components[k].hSamp=
|
|
314
|
-
p>>4;this.components[k].vSamp=p&15;this.components[k].quantTableSel=a.get8();d+=1}if(d!==f)throw Error("ERROR: frame format error [Lf!=count]");return 1};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.FrameHeader)},{"./component-spec.js":3,"./data-stream.js":4}],7:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.Utils=b.lossless.Utils||("undefined"!==typeof a?a("./utils.js"):
|
|
315
|
-
null);b.lossless.HuffmanTable=b.lossless.HuffmanTable||function(){this.l=b.lossless.Utils.createArray(4,2,16);this.th=[];this.v=b.lossless.Utils.createArray(4,2,16,200);this.tc=b.lossless.Utils.createArray(4,2);this.tc[0][0]=0;this.tc[1][0]=0;this.tc[2][0]=0;this.tc[3][0]=0;this.tc[0][1]=0;this.tc[1][1]=0;this.tc[2][1]=0;this.tc[3][1]=0;this.th[0]=0;this.th[1]=0;this.th[2]=0;this.th[3]=0};b.lossless.HuffmanTable.MSB=2147483648;b.lossless.HuffmanTable.prototype.read=function(a,b){var d=0,f,k,p,t,w;
|
|
316
|
-
f=a.get16();for(d+=2;d<f;){k=a.get8();d+=1;p=k&15;if(3<p)throw Error("ERROR: Huffman table ID > 3");k>>=4;if(2<k)throw Error("ERROR: Huffman table [Table class > 2 ]");this.th[p]=1;this.tc[p][k]=1;for(t=0;16>t;t+=1)this.l[p][k][t]=a.get8(),d+=1;for(t=0;16>t;t+=1)for(w=0;w<this.l[p][k][t];w+=1){if(d>f)throw Error("ERROR: Huffman table format error [count>Lh]");this.v[p][k][t][w]=a.get8();d+=1}}if(d!==f)throw Error("ERROR: Huffman table format error [count!=Lf]");for(t=0;4>t;t+=1)for(w=0;2>w;w+=1)0!==
|
|
317
|
-
this.tc[t][w]&&this.buildHuffTable(b[t][w],this.l[t][w],this.v[t][w]);return 1};b.lossless.HuffmanTable.prototype.buildHuffTable=function(a,d,f){var m,k,p,t,w;for(p=k=0;8>p;p+=1)for(t=0;t<d[p];t+=1)for(w=0;w<256>>p+1;w+=1)a[k]=f[p][t]|p+1<<8,k+=1;for(p=1;256>k;p+=1,k+=1)a[k]=p|b.lossless.HuffmanTable.MSB;m=1;k=0;for(p=8;16>p;p+=1)for(t=0;t<d[p];t+=1){for(w=0;w<256>>p-7;w+=1)a[256*m+k]=f[p][t]|p+1<<8,k+=1;if(256<=k){if(256<k)throw Error("ERROR: Huffman table error(1)!");k=0;m+=1}}};"undefined"!==typeof d&&
|
|
318
|
-
d.exports&&(d.exports=b.lossless.HuffmanTable)},{"./data-stream.js":4,"./utils.js":12}],8:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.ComponentSpec=b.lossless.ComponentSpec||("undefined"!==typeof a?a("./component-spec.js"):null);b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.Decoder=b.lossless.Decoder||("undefined"!==typeof a?a("./decoder.js"):null);b.lossless.FrameHeader=b.lossless.FrameHeader||("undefined"!==typeof a?
|
|
319
|
-
a("./frame-header.js"):null);b.lossless.HuffmanTable=b.lossless.HuffmanTable||("undefined"!==typeof a?a("./huffman-table.js"):null);b.lossless.QuantizationTable=b.lossless.QuantizationTable||("undefined"!==typeof a?a("./quantization-table.js"):null);b.lossless.ScanComponent=b.lossless.ScanComponent||("undefined"!==typeof a?a("./scan-component.js"):null);b.lossless.ScanHeader=b.lossless.ScanHeader||("undefined"!==typeof a?a("./scan-header.js"):null);b.lossless.Utils=b.lossless.Utils||("undefined"!==
|
|
320
|
-
typeof a?a("./utils.js"):null);"undefined"!==typeof d&&d.exports&&(d.exports=b)},{"./component-spec.js":3,"./data-stream.js":4,"./decoder.js":5,"./frame-header.js":6,"./huffman-table.js":7,"./quantization-table.js":9,"./scan-component.js":10,"./scan-header.js":11,"./utils.js":12}],9:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.Utils=b.lossless.Utils||("undefined"!==typeof a?a("./utils.js"):
|
|
321
|
-
null);b.lossless.QuantizationTable=b.lossless.QuantizationTable||function(){this.precision=[];this.tq=[];this.quantTables=b.lossless.Utils.createArray(4,64);this.tq[0]=0;this.tq[1]=0;this.tq[2]=0;this.tq[3]=0};b.lossless.QuantizationTable.enhanceQuantizationTable=function(a,b){var d;for(d=0;8>d;d+=1)a[b[0+d]]*=90,a[b[32+d]]*=90,a[b[16+d]]*=118,a[b[48+d]]*=49,a[b[40+d]]*=71,a[b[8+d]]*=126,a[b[56+d]]*=25,a[b[24+d]]*=106;for(d=0;8>d;d+=1)a[b[0+8*d]]*=90,a[b[4+8*d]]*=90,a[b[2+8*d]]*=118,a[b[6+8*d]]*=
|
|
322
|
-
49,a[b[5+8*d]]*=71,a[b[1+8*d]]*=126,a[b[7+8*d]]*=25,a[b[3+8*d]]*=106;for(d=0;64>d;d+=1)a[d]>>=6};b.lossless.QuantizationTable.prototype.read=function(a,d){var f=0,m,k,p;m=a.get16();for(f+=2;f<m;){k=a.get8();f+=1;p=k&15;if(3<p)throw Error("ERROR: Quantization table ID > 3");this.precision[p]=k>>4;if(0===this.precision[p])this.precision[p]=8;else if(1===this.precision[p])this.precision[p]=16;else throw Error("ERROR: Quantization table precision error");this.tq[p]=1;if(8===this.precision[p])for(k=0;64>
|
|
323
|
-
k;k+=1){if(f>m)throw Error("ERROR: Quantization table format error");this.quantTables[p][k]=a.get8();f+=1}else for(k=0;64>k;k+=1){if(f>m)throw Error("ERROR: Quantization table format error");this.quantTables[p][k]=a.get16();f+=2}b.lossless.QuantizationTable.enhanceQuantizationTable(this.quantTables[p],d)}if(f!==m)throw Error("ERROR: Quantization table error [count!=Lq]");return 1};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.QuantizationTable)},{"./data-stream.js":4,"./utils.js":12}],
|
|
324
|
-
10:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.ScanComponent=b.lossless.ScanComponent||function(){this.scanCompSel=this.dcTabSel=this.acTabSel=0};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.ScanComponent)},{}],11:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.ScanComponent=b.lossless.ScanComponent||("undefined"!==typeof a?a("./scan-component.js"):null);
|
|
325
|
-
b.lossless.ScanHeader=b.lossless.ScanHeader||function(){this.spectralEnd=this.selection=this.numComp=this.al=this.ah=0;this.components=[]};b.lossless.ScanHeader.prototype.read=function(a){var d=0,f,m,k;f=a.get16();d+=2;this.numComp=a.get8();d+=1;for(m=0;m<this.numComp;m+=1){this.components[m]=new b.lossless.ScanComponent;if(d>f)throw Error("ERROR: scan header format error");this.components[m].scanCompSel=a.get8();d+=1;k=a.get8();d+=1;this.components[m].dcTabSel=k>>4;this.components[m].acTabSel=k&
|
|
326
|
-
15}this.selection=a.get8();d+=1;this.spectralEnd=a.get8();d+=1;k=a.get8();this.ah=k>>4;this.al=k&15;if(d+1!==f)throw Error("ERROR: scan header format error [count!=Ns]");return 1};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.ScanHeader)},{"./data-stream.js":4,"./scan-component.js":10}],12:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.Utils=b.lossless.Utils||{};b.lossless.Utils.createArray=function(a){var d=Array(a||0),f=a;if(1<arguments.length)for(var m=Array.prototype.slice.call(arguments,
|
|
327
|
-
1);f--;)d[a-1-f]=b.lossless.Utils.createArray.apply(this,m);return d};b.lossless.Utils.makeCRCTable=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b};b.lossless.Utils.crc32=function(a){for(var d=b.lossless.Utils.crcTable||(b.lossless.Utils.crcTable=b.lossless.Utils.makeCRCTable()),f=-1,m=0;m<a.byteLength;m++)f=f>>>8^d[(f^a.getUint8(m))&255];return(f^-1)>>>0};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.Utils)},{}],13:[function(a,
|
|
328
|
-
d,f){f=a("./lib/utils/common").assign;var b=a("./lib/deflate"),e=a("./lib/inflate");a=a("./lib/zlib/constants");var g={};f(g,b,e,a);d.exports=g},{"./lib/deflate":14,"./lib/inflate":15,"./lib/utils/common":16,"./lib/zlib/constants":19}],14:[function(a,d,f){function b(a,b){var d=new t(b);d.push(a,!0);if(d.err)throw d.msg;return d.result}var e=a("./zlib/deflate.js"),g=a("./utils/common"),h=a("./utils/strings"),m=a("./zlib/messages"),k=a("./zlib/zstream"),p=Object.prototype.toString,t=function(a){a=this.options=
|
|
329
|
-
g.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new k;this.strm.avail_out=0;var b=e.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(0!==b)throw Error(m[b]);a.header&&e.deflateSetHeader(this.strm,a.header)};t.prototype.push=function(a,b){var d=this.strm,
|
|
330
|
-
f=this.options.chunkSize,m,k;if(this.ended)return!1;k=b===~~b?b:!0===b?4:0;"string"===typeof a?d.input=h.string2buf(a):"[object ArrayBuffer]"===p.call(a)?d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new g.Buf8(f),d.next_out=0,d.avail_out=f);m=e.deflate(d,k);if(1!==m&&0!==m)return this.onEnd(m),this.ended=!0,!1;if(0===d.avail_out||0===d.avail_in&&(4===k||2===k))if("string"===this.options.to)this.onData(h.buf2binstring(g.shrinkBuf(d.output,
|
|
331
|
-
d.next_out)));else this.onData(g.shrinkBuf(d.output,d.next_out))}while((0<d.avail_in||0===d.avail_out)&&1!==m);if(4===k)return m=e.deflateEnd(this.strm),this.onEnd(m),this.ended=!0,0===m;2===k&&(this.onEnd(0),d.avail_out=0);return!0};t.prototype.onData=function(a){this.chunks.push(a)};t.prototype.onEnd=function(a){0===a&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Deflate=t;f.deflate=b;f.deflateRaw=
|
|
332
|
-
function(a,d){d=d||{};d.raw=!0;return b(a,d)};f.gzip=function(a,d){d=d||{};d.gzip=!0;return b(a,d)}},{"./utils/common":16,"./utils/strings":17,"./zlib/deflate.js":21,"./zlib/messages":26,"./zlib/zstream":28}],15:[function(a,d,f){function b(a,b){var d=new B(b);d.push(a,!0);if(d.err)throw d.msg;return d.result}var e=a("./zlib/inflate.js"),g=a("./utils/common"),h=a("./utils/strings"),m=a("./zlib/constants"),k=a("./zlib/messages"),p=a("./zlib/zstream"),t=a("./zlib/gzheader"),w=Object.prototype.toString,
|
|
333
|
-
B=function(a){var b=this.options=g.assign({chunkSize:16384,windowBits:0,to:""},a||{});b.raw&&0<=b.windowBits&&16>b.windowBits&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15));!(0<=b.windowBits&&16>b.windowBits)||a&&a.windowBits||(b.windowBits+=32);15<b.windowBits&&48>b.windowBits&&0===(b.windowBits&15)&&(b.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new p;this.strm.avail_out=0;a=e.inflateInit2(this.strm,b.windowBits);if(a!==m.Z_OK)throw Error(k[a]);
|
|
334
|
-
this.header=new t;e.inflateGetHeader(this.strm,this.header)};B.prototype.push=function(a,b){var d=this.strm,f=this.options.chunkSize,k,p,l,t,B,E=!1;if(this.ended)return!1;p=b===~~b?b:!0===b?m.Z_FINISH:m.Z_NO_FLUSH;"string"===typeof a?d.input=h.binstring2buf(a):"[object ArrayBuffer]"===w.call(a)?d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new g.Buf8(f),d.next_out=0,d.avail_out=f);k=e.inflate(d,m.Z_NO_FLUSH);k===m.Z_BUF_ERROR&&!0===E&&(k=m.Z_OK,
|
|
335
|
-
E=!1);if(k!==m.Z_STREAM_END&&k!==m.Z_OK)return this.onEnd(k),this.ended=!0,!1;if(d.next_out&&(0===d.avail_out||k===m.Z_STREAM_END||0===d.avail_in&&(p===m.Z_FINISH||p===m.Z_SYNC_FLUSH)))if("string"===this.options.to)l=h.utf8border(d.output,d.next_out),t=d.next_out-l,B=h.buf2string(d.output,l),d.next_out=t,d.avail_out=f-t,t&&g.arraySet(d.output,d.output,l,t,0),this.onData(B);else this.onData(g.shrinkBuf(d.output,d.next_out));0===d.avail_in&&0===d.avail_out&&(E=!0)}while((0<d.avail_in||0===d.avail_out)&&
|
|
336
|
-
k!==m.Z_STREAM_END);k===m.Z_STREAM_END&&(p=m.Z_FINISH);if(p===m.Z_FINISH)return k=e.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===m.Z_OK;p===m.Z_SYNC_FLUSH&&(this.onEnd(m.Z_OK),d.avail_out=0);return!0};B.prototype.onData=function(a){this.chunks.push(a)};B.prototype.onEnd=function(a){a===m.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Inflate=B;f.inflate=b;f.inflateRaw=function(a,d){d=d||
|
|
337
|
-
{};d.raw=!0;return b(a,d)};f.ungzip=b},{"./utils/common":16,"./utils/strings":17,"./zlib/constants":19,"./zlib/gzheader":22,"./zlib/inflate.js":24,"./zlib/messages":26,"./zlib/zstream":28}],16:[function(a,d,f){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;f.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!==typeof d)throw new TypeError(d+"must be non-object");for(var e in d)d.hasOwnProperty(e)&&
|
|
338
|
-
(a[e]=d[e])}}return a};f.shrinkBuf=function(a,b){if(a.length===b)return a;if(a.subarray)return a.subarray(0,b);a.length=b;return a};var b={arraySet:function(a,b,d,e,f){if(b.subarray&&a.subarray)a.set(b.subarray(d,d+e),f);else for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){var b,d,e,f,t;b=e=0;for(d=a.length;b<d;b++)e+=a[b].length;t=new Uint8Array(e);b=e=0;for(d=a.length;b<d;b++)f=a[b],t.set(f,e),e+=f.length;return t}},e={arraySet:function(a,b,d,e,f){for(var t=0;t<e;t++)a[f+t]=b[d+t]},
|
|
339
|
-
flattenChunks:function(a){return[].concat.apply([],a)}};f.setTyped=function(a){a?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,b)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(a)},{}],17:[function(a,d,f){function b(a,b){if(65537>b&&(a.subarray&&h||!a.subarray&&g))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var d="",f=0;f<b;f++)d+=String.fromCharCode(a[f]);return d}var e=a("./common"),g=!0,h=!0;try{String.fromCharCode.apply(null,[0])}catch(m){g=
|
|
340
|
-
!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(k){h=!1}var p=new e.Buf8(256);for(a=0;256>a;a++)p[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;p[254]=p[254]=1;f.string2buf=function(a){var b,d,g,f,h,m=a.length,k=0;for(f=0;f<m;f++)d=a.charCodeAt(f),55296===(d&64512)&&f+1<m&&(g=a.charCodeAt(f+1),56320===(g&64512)&&(d=65536+(d-55296<<10)+(g-56320),f++)),k+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(k);for(f=h=0;h<k;f++)d=a.charCodeAt(f),55296===(d&64512)&&f+1<m&&(g=a.charCodeAt(f+1),
|
|
341
|
-
56320===(g&64512)&&(d=65536+(d-55296<<10)+(g-56320),f++)),128>d?b[h++]=d:(2048>d?b[h++]=192|d>>>6:(65536>d?b[h++]=224|d>>>12:(b[h++]=240|d>>>18,b[h++]=128|d>>>12&63),b[h++]=128|d>>>6&63),b[h++]=128|d&63);return b};f.buf2binstring=function(a){return b(a,a.length)};f.binstring2buf=function(a){for(var b=new e.Buf8(a.length),d=0,g=b.length;d<g;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,d){var e,g,f,h,m=d||a.length,k=Array(2*m);for(e=g=0;e<m;)if(f=a[e++],128>f)k[g++]=f;else if(h=p[f],4<
|
|
342
|
-
h)k[g++]=65533,e+=h-1;else{for(f&=2===h?31:3===h?15:7;1<h&&e<m;)f=f<<6|a[e++]&63,h--;1<h?k[g++]=65533:65536>f?k[g++]=f:(f-=65536,k[g++]=55296|f>>10&1023,k[g++]=56320|f&1023)}return b(k,g)};f.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(a[d]&192);)d--;return 0>d||0===d?b:d+p[a[d]]>b?d:b}},{"./common":16}],18:[function(a,d,f){d.exports=function(a,d,g,f){var m=a&65535|0;a=a>>>16&65535|0;for(var k=0;0!==g;){k=2E3<g?2E3:g;g-=k;do m=m+d[f++]|0,a=a+m|0;while(--k);
|
|
343
|
-
m%=65521;a%=65521}return m|a<<16|0}},{}],19:[function(a,d,f){d.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],20:[function(a,d,f){var b=function(){for(var a,
|
|
344
|
-
b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b}();d.exports=function(a,d,f,m){f=m+f;for(a^=-1;m<f;m++)a=a>>>8^b[(a^d[m])&255];return a^-1}},{}],21:[function(a,d,f){function b(a,b){a.msg=y[b];return b}function e(a){for(var b=a.length;0<=--b;)a[b]=0}function g(a){var b=a.state,d=b.pending;d>a.avail_out&&(d=a.avail_out);0!==d&&(l.arraySet(a.output,b.pending_buf,b.pending_out,d,a.next_out),a.next_out+=d,b.pending_out+=d,a.total_out+=d,a.avail_out-=d,b.pending-=
|
|
345
|
-
d,0===b.pending&&(b.pending_out=0))}function h(a,b){J._tr_flush_block(a,0<=a.block_start?a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;g(a.strm)}function m(a,b){a.pending_buf[a.pending++]=b}function k(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function p(a,b){var d=a.max_chain_length,e=a.strstart,g,f=a.prev_length,l=a.nice_match,h=a.strstart>a.w_size-262?a.strstart-(a.w_size-262):0,m=a.window,k=a.w_mask,p=a.prev,O=a.strstart+258,z=m[e+f-1],t=
|
|
346
|
-
m[e+f];a.prev_length>=a.good_match&&(d>>=2);l>a.lookahead&&(l=a.lookahead);do if(g=b,m[g+f]===t&&m[g+f-1]===z&&m[g]===m[e]&&m[++g]===m[e+1]){e+=2;for(g++;m[++e]===m[++g]&&m[++e]===m[++g]&&m[++e]===m[++g]&&m[++e]===m[++g]&&m[++e]===m[++g]&&m[++e]===m[++g]&&m[++e]===m[++g]&&m[++e]===m[++g]&&e<O;);g=258-(O-e);e=O-258;if(g>f){a.match_start=b;f=g;if(g>=l)break;z=m[e+f-1];t=m[e+f]}}while((b=p[b&k])>h&&0!==--d);return f<=a.lookahead?f:a.lookahead}function t(a){var b=a.w_size,d,e,g,f;do{f=a.window_size-a.lookahead-
|
|
347
|
-
a.strstart;if(a.strstart>=b+(b-262)){l.arraySet(a.window,a.window,b,b,0);a.match_start-=b;a.strstart-=b;a.block_start-=b;d=e=a.hash_size;do g=a.head[--d],a.head[d]=g>=b?g-b:0;while(--e);d=e=b;do g=a.prev[--d],a.prev[d]=g>=b?g-b:0;while(--e);f+=b}if(0===a.strm.avail_in)break;d=a.strm;e=a.window;g=a.strstart+a.lookahead;var h=d.avail_in;h>f&&(h=f);0===h?e=0:(d.avail_in-=h,l.arraySet(e,d.input,d.next_in,h,g),1===d.state.wrap?d.adler=K(d.adler,e,h,g):2===d.state.wrap&&(d.adler=E(d.adler,e,h,g)),d.next_in+=
|
|
348
|
-
h,d.total_in+=h,e=h);a.lookahead+=e;if(3<=a.lookahead+a.insert)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+1])&a.hash_mask;a.insert&&!(a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+3-1])&a.hash_mask,a.prev[f&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=f,f++,a.insert--,3>a.lookahead+a.insert););}while(262>a.lookahead&&0!==a.strm.avail_in)}function w(a,b){for(var d;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&
|
|
349
|
-
(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);0!==d&&a.strstart-d<=a.w_size-262&&(a.match_length=p(a,d));if(3<=a.match_length)if(d=J._tr_tally(a,a.strstart-a.match_start,a.match_length-3),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&3<=a.lookahead){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],
|
|
350
|
-
a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=J._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=2>a.strstart?a.strstart:2;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function B(a,b){for(var d,e;;){if(262>a.lookahead){t(a);
|
|
351
|
-
if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);a.prev_length=a.match_length;a.prev_match=a.match_start;a.match_length=2;0!==d&&a.prev_length<a.max_lazy_match&&a.strstart-d<=a.w_size-262&&(a.match_length=p(a,d),5>=a.match_length&&(1===a.strategy||3===a.match_length&&4096<a.strstart-a.match_start)&&(a.match_length=2));if(3<=
|
|
352
|
-
a.prev_length&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-3;d=J._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-3);a.lookahead-=a.prev_length-1;a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);a.match_available=0;a.match_length=2;a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return 1}else if(a.match_available){if((d=J._tr_tally(a,
|
|
353
|
-
0,a.window[a.strstart-1]))&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return 1}else a.match_available=1,a.strstart++,a.lookahead--}a.match_available&&(J._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0);a.insert=2>a.strstart?a.strstart:2;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function A(a,b){for(var d,e,g,f=a.window;;){if(258>=a.lookahead){t(a);if(258>=a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.match_length=
|
|
354
|
-
0;if(3<=a.lookahead&&0<a.strstart&&(e=a.strstart-1,d=f[e],d===f[++e]&&d===f[++e]&&d===f[++e])){for(g=a.strstart+258;d===f[++e]&&d===f[++e]&&d===f[++e]&&d===f[++e]&&d===f[++e]&&d===f[++e]&&d===f[++e]&&d===f[++e]&&e<g;);a.match_length=258-(g-e);a.match_length>a.lookahead&&(a.match_length=a.lookahead)}3<=a.match_length?(d=J._tr_tally(a,1,a.match_length-3),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(d=J._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++);if(d&&
|
|
355
|
-
(h(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function x(a,b){for(var d;;){if(0===a.lookahead&&(t(a),0===a.lookahead)){if(0===b)return 1;break}a.match_length=0;d=J._tr_tally(a,0,a.window[a.strstart]);a.lookahead--;a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function G(){this.strm=
|
|
356
|
-
null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=8;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=
|
|
357
|
-
this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new l.Buf16(1146);this.dyn_dtree=new l.Buf16(122);this.bl_tree=new l.Buf16(78);e(this.dyn_ltree);e(this.dyn_dtree);e(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new l.Buf16(16);this.heap=new l.Buf16(573);e(this.heap);this.heap_max=this.heap_len=0;this.depth=new l.Buf16(573);e(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.d_buf=this.last_lit=
|
|
358
|
-
this.lit_bufsize=this.l_buf=0}function F(a){var d;if(!a||!a.state)return b(a,-2);a.total_in=a.total_out=0;a.data_type=2;d=a.state;d.pending=0;d.pending_out=0;0>d.wrap&&(d.wrap=-d.wrap);d.status=d.wrap?42:113;a.adler=2===d.wrap?0:1;d.last_flush=0;J._tr_init(d);return 0}function z(a){var b=F(a);0===b&&(a=a.state,a.window_size=2*a.w_size,e(a.head),a.max_lazy_match=D[a.level].max_lazy,a.good_match=D[a.level].good_length,a.nice_match=D[a.level].nice_length,a.max_chain_length=D[a.level].max_chain,a.strstart=
|
|
359
|
-
0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0);return b}function L(a,d,e,g,f,h){if(!a)return-2;var m=1;-1===d&&(d=6);0>g?(m=0,g=-g):15<g&&(m=2,g-=16);if(1>f||9<f||8!==e||8>g||15<g||0>d||9<d||0>h||4<h)return b(a,-2);8===g&&(g=9);var k=new G;a.state=k;k.strm=a;k.wrap=m;k.gzhead=null;k.w_bits=g;k.w_size=1<<k.w_bits;k.w_mask=k.w_size-1;k.hash_bits=f+7;k.hash_size=1<<k.hash_bits;k.hash_mask=k.hash_size-1;k.hash_shift=~~((k.hash_bits+3-1)/3);k.window=
|
|
360
|
-
new l.Buf8(2*k.w_size);k.head=new l.Buf16(k.hash_size);k.prev=new l.Buf16(k.w_size);k.lit_bufsize=1<<f+6;k.pending_buf_size=4*k.lit_bufsize;k.pending_buf=new l.Buf8(k.pending_buf_size);k.d_buf=k.lit_bufsize>>1;k.l_buf=3*k.lit_bufsize;k.level=d;k.strategy=h;k.method=e;return z(a)}var l=a("../utils/common"),J=a("./trees"),K=a("./adler32"),E=a("./crc32"),y=a("./messages");a=function(a,b,d,e,g){this.good_length=a;this.max_lazy=b;this.nice_length=d;this.max_chain=e;this.func=g};var D;D=[new a(0,0,0,0,
|
|
361
|
-
function(a,b){var d=65535;for(d>a.pending_buf_size-5&&(d=a.pending_buf_size-5);;){if(1>=a.lookahead){t(a);if(0===a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.strstart+=a.lookahead;a.lookahead=0;var e=a.block_start+d;if(0===a.strstart||a.strstart>=e)if(a.lookahead=a.strstart-e,a.strstart=e,h(a,!1),0===a.strm.avail_out)return 1;if(a.strstart-a.block_start>=a.w_size-262&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=0;if(4===b)return h(a,!0),0===a.strm.avail_out?3:4;a.strstart>a.block_start&&
|
|
362
|
-
h(a,!1);return 1}),new a(4,4,8,4,w),new a(4,5,16,8,w),new a(4,6,32,32,w),new a(4,4,16,16,B),new a(8,16,32,32,B),new a(8,16,128,128,B),new a(8,32,128,256,B),new a(32,128,258,1024,B),new a(32,258,258,4096,B)];f.deflateInit=function(a,b){return L(a,b,8,15,8,0)};f.deflateInit2=L;f.deflateReset=z;f.deflateResetKeep=F;f.deflateSetHeader=function(a,b){if(!a||!a.state||2!==a.state.wrap)return-2;a.state.gzhead=b;return 0};f.deflate=function(a,d){var f,l,h,p;if(!a||!a.state||5<d||0>d)return a?b(a,-2):-2;l=
|
|
363
|
-
a.state;if(!a.output||!a.input&&0!==a.avail_in||666===l.status&&4!==d)return b(a,0===a.avail_out?-5:-2);l.strm=a;f=l.last_flush;l.last_flush=d;42===l.status&&(2===l.wrap?(a.adler=0,m(l,31),m(l,139),m(l,8),l.gzhead?(m(l,(l.gzhead.text?1:0)+(l.gzhead.hcrc?2:0)+(l.gzhead.extra?4:0)+(l.gzhead.name?8:0)+(l.gzhead.comment?16:0)),m(l,l.gzhead.time&255),m(l,l.gzhead.time>>8&255),m(l,l.gzhead.time>>16&255),m(l,l.gzhead.time>>24&255),m(l,9===l.level?2:2<=l.strategy||2>l.level?4:0),m(l,l.gzhead.os&255),l.gzhead.extra&&
|
|
364
|
-
l.gzhead.extra.length&&(m(l,l.gzhead.extra.length&255),m(l,l.gzhead.extra.length>>8&255)),l.gzhead.hcrc&&(a.adler=E(a.adler,l.pending_buf,l.pending,0)),l.gzindex=0,l.status=69):(m(l,0),m(l,0),m(l,0),m(l,0),m(l,0),m(l,9===l.level?2:2<=l.strategy||2>l.level?4:0),m(l,3),l.status=113)):(h=8+(l.w_bits-8<<4)<<8,p=-1,p=2<=l.strategy||2>l.level?0:6>l.level?1:6===l.level?2:3,h|=p<<6,0!==l.strstart&&(h|=32),l.status=113,k(l,h+(31-h%31)),0!==l.strstart&&(k(l,a.adler>>>16),k(l,a.adler&65535)),a.adler=1));if(69===
|
|
365
|
-
l.status)if(l.gzhead.extra){for(h=l.pending;l.gzindex<(l.gzhead.extra.length&65535)&&(l.pending!==l.pending_buf_size||(l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending!==l.pending_buf_size));)m(l,l.gzhead.extra[l.gzindex]&255),l.gzindex++;l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h));l.gzindex===l.gzhead.extra.length&&(l.gzindex=0,l.status=73)}else l.status=73;if(73===l.status)if(l.gzhead.name){h=l.pending;do{if(l.pending===
|
|
366
|
-
l.pending_buf_size&&(l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending===l.pending_buf_size)){p=1;break}p=l.gzindex<l.gzhead.name.length?l.gzhead.name.charCodeAt(l.gzindex++)&255:0;m(l,p)}while(0!==p);l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h));0===p&&(l.gzindex=0,l.status=91)}else l.status=91;if(91===l.status)if(l.gzhead.comment){h=l.pending;do{if(l.pending===l.pending_buf_size&&(l.gzhead.hcrc&&l.pending>h&&(a.adler=
|
|
367
|
-
E(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending===l.pending_buf_size)){p=1;break}p=l.gzindex<l.gzhead.comment.length?l.gzhead.comment.charCodeAt(l.gzindex++)&255:0;m(l,p)}while(0!==p);l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h));0===p&&(l.status=103)}else l.status=103;103===l.status&&(l.gzhead.hcrc?(l.pending+2>l.pending_buf_size&&g(a),l.pending+2<=l.pending_buf_size&&(m(l,a.adler&255),m(l,a.adler>>8&255),a.adler=0,l.status=113)):l.status=113);if(0!==
|
|
368
|
-
l.pending){if(g(a),0===a.avail_out)return l.last_flush=-1,0}else if(0===a.avail_in&&(d<<1)-(4<d?9:0)<=(f<<1)-(4<f?9:0)&&4!==d)return b(a,-5);if(666===l.status&&0!==a.avail_in)return b(a,-5);if(0!==a.avail_in||0!==l.lookahead||0!==d&&666!==l.status){f=2===l.strategy?x(l,d):3===l.strategy?A(l,d):D[l.level].func(l,d);if(3===f||4===f)l.status=666;if(1===f||3===f)return 0===a.avail_out&&(l.last_flush=-1),0;if(2===f&&(1===d?J._tr_align(l):5!==d&&(J._tr_stored_block(l,0,0,!1),3===d&&(e(l.head),0===l.lookahead&&
|
|
369
|
-
(l.strstart=0,l.block_start=0,l.insert=0))),g(a),0===a.avail_out))return l.last_flush=-1,0}if(4!==d)return 0;if(0>=l.wrap)return 1;2===l.wrap?(m(l,a.adler&255),m(l,a.adler>>8&255),m(l,a.adler>>16&255),m(l,a.adler>>24&255),m(l,a.total_in&255),m(l,a.total_in>>8&255),m(l,a.total_in>>16&255),m(l,a.total_in>>24&255)):(k(l,a.adler>>>16),k(l,a.adler&65535));g(a);0<l.wrap&&(l.wrap=-l.wrap);return 0!==l.pending?0:1};f.deflateEnd=function(a){var d;if(!a||!a.state)return-2;d=a.state.status;if(42!==d&&69!==d&&
|
|
370
|
-
73!==d&&91!==d&&103!==d&&113!==d&&666!==d)return b(a,-2);a.state=null;return 113===d?b(a,-3):0};f.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":16,"./adler32":18,"./crc32":20,"./messages":26,"./trees":27}],22:[function(a,d,f){d.exports=function(){this.os=this.xflags=this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=0;this.done=!1}},{}],23:[function(a,d,f){d.exports=function(a,d){var g,f,m,k,p,t,w,B,A,x,G,F,z,L,l,J,K,E,y,D,u,n,q,I;g=a.state;
|
|
371
|
-
f=a.next_in;q=a.input;m=f+(a.avail_in-5);k=a.next_out;I=a.output;p=k-(d-a.avail_out);t=k+(a.avail_out-257);w=g.dmax;B=g.wsize;A=g.whave;x=g.wnext;G=g.window;F=g.hold;z=g.bits;L=g.lencode;l=g.distcode;J=(1<<g.lenbits)-1;K=(1<<g.distbits)-1;a:do b:for(15>z&&(F+=q[f++]<<z,z+=8,F+=q[f++]<<z,z+=8),E=L[F&J];;){y=E>>>24;F>>>=y;z-=y;y=E>>>16&255;if(0===y)I[k++]=E&65535;else if(y&16){D=E&65535;if(y&=15)z<y&&(F+=q[f++]<<z,z+=8),D+=F&(1<<y)-1,F>>>=y,z-=y;15>z&&(F+=q[f++]<<z,z+=8,F+=q[f++]<<z,z+=8);E=l[F&K];
|
|
372
|
-
c:for(;;){y=E>>>24;F>>>=y;z-=y;y=E>>>16&255;if(y&16){E&=65535;y&=15;z<y&&(F+=q[f++]<<z,z+=8,z<y&&(F+=q[f++]<<z,z+=8));E+=F&(1<<y)-1;if(E>w){a.msg="invalid distance too far back";g.mode=30;break a}F>>>=y;z-=y;y=k-p;if(E>y){y=E-y;if(y>A&&g.sane){a.msg="invalid distance too far back";g.mode=30;break a}u=0;n=G;if(0===x){if(u+=B-y,y<D){D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}}else if(x<y){if(u+=B+x-y,y-=x,y<D){D-=y;do I[k++]=G[u++];while(--y);u=0;if(x<D){y=x;D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=
|
|
373
|
-
I}}}else if(u+=x-y,y<D){D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}for(;2<D;)I[k++]=n[u++],I[k++]=n[u++],I[k++]=n[u++],D-=3;D&&(I[k++]=n[u++],1<D&&(I[k++]=n[u++]))}else{u=k-E;do I[k++]=I[u++],I[k++]=I[u++],I[k++]=I[u++],D-=3;while(2<D);D&&(I[k++]=I[u++],1<D&&(I[k++]=I[u++]))}}else if(0===(y&64)){E=l[(E&65535)+(F&(1<<y)-1)];continue c}else{a.msg="invalid distance code";g.mode=30;break a}break}}else if(0===(y&64)){E=L[(E&65535)+(F&(1<<y)-1)];continue b}else{y&32?g.mode=12:(a.msg="invalid literal/length code",
|
|
374
|
-
g.mode=30);break a}break}while(f<m&&k<t);D=z>>3;f-=D;z-=D<<3;a.next_in=f;a.next_out=k;a.avail_in=f<m?5+(m-f):5-(f-m);a.avail_out=k<t?257+(t-k):257-(k-t);g.hold=F&(1<<z)-1;g.bits=z}},{}],24:[function(a,d,f){function b(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}function e(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=
|
|
375
|
-
this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new p.Buf16(320);this.work=new p.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(a){var b;if(!a||!a.state)return-2;b=a.state;a.total_in=a.total_out=b.total=0;a.msg="";b.wrap&&(a.adler=b.wrap&1);b.mode=1;b.last=0;b.havedict=0;b.dmax=32768;b.head=null;b.hold=0;b.bits=0;b.lencode=b.lendyn=new p.Buf32(852);b.distcode=b.distdyn=
|
|
376
|
-
new p.Buf32(592);b.sane=1;b.back=-1;return 0}function h(a){var b;if(!a||!a.state)return-2;b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return g(a)}function m(a,b){var d,e;if(!a||!a.state)return-2;e=a.state;0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15));if(b&&(8>b||15<b))return-2;null!==e.window&&e.wbits!==b&&(e.window=null);e.wrap=d;e.wbits=b;return h(a)}function k(a,b){var d;if(!a)return-2;d=new e;a.state=d;d.window=null;d=m(a,b);0!==d&&(a.state=null);return d}var p=a("../utils/common"),t=a("./adler32"),w=
|
|
377
|
-
a("./crc32"),B=a("./inffast"),A=a("./inftrees"),x=!0,G,F;f.inflateReset=h;f.inflateReset2=m;f.inflateResetKeep=g;f.inflateInit=function(a){return k(a,15)};f.inflateInit2=k;f.inflate=function(a,d){var e,g,f,h,m,k,u,n,q,I,H,v,C,P,M=0,R,T,O,Q=new p.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return-2;e=a.state;12===e.mode&&(e.mode=13);m=a.next_out;f=a.output;u=a.avail_out;h=a.next_in;g=a.input;k=a.avail_in;n=e.hold;q=e.bits;I=k;H=u;
|
|
378
|
-
O=0;a:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;16>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}if(e.wrap&2&&35615===n){e.check=0;Q[0]=n&255;Q[1]=n>>>8&255;e.check=w(e.check,Q,2,0);q=n=0;e.mode=2;break}e.flags=0;e.head&&(e.head.done=!1);if(!(e.wrap&1)||(((n&255)<<8)+(n>>8))%31){a.msg="incorrect header check";e.mode=30;break}if(8!==(n&15)){a.msg="unknown compression method";e.mode=30;break}n>>>=4;q-=4;C=(n&15)+8;if(0===e.wbits)e.wbits=C;else if(C>e.wbits){a.msg="invalid window size";
|
|
379
|
-
e.mode=30;break}e.dmax=1<<C;a.adler=e.check=1;e.mode=n&512?10:12;q=n=0;break;case 2:for(;16>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.flags=n;if(8!==(e.flags&255)){a.msg="unknown compression method";e.mode=30;break}if(e.flags&57344){a.msg="unknown header flags set";e.mode=30;break}e.head&&(e.head.text=n>>8&1);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0;e.mode=3;case 3:for(;32>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.head&&(e.head.time=n);e.flags&512&&(Q[0]=n&255,
|
|
380
|
-
Q[1]=n>>>8&255,Q[2]=n>>>16&255,Q[3]=n>>>24&255,e.check=w(e.check,Q,4,0));q=n=0;e.mode=4;case 4:for(;16>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.head&&(e.head.xflags=n&255,e.head.os=n>>8);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0;e.mode=5;case 5:if(e.flags&1024){for(;16>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.length=n;e.head&&(e.head.extra_len=n);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0}else e.head&&(e.head.extra=null);e.mode=6;
|
|
381
|
-
case 6:if(e.flags&1024&&(v=e.length,v>k&&(v=k),v&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=Array(e.head.extra_len)),p.arraySet(e.head.extra,g,h,v,C)),e.flags&512&&(e.check=w(e.check,g,v,h)),k-=v,h+=v,e.length-=v),e.length))break a;e.length=0;e.mode=7;case 7:if(e.flags&2048){if(0===k)break a;v=0;do C=g[h+v++],e.head&&C&&65536>e.length&&(e.head.name+=String.fromCharCode(C));while(C&&v<k);e.flags&512&&(e.check=w(e.check,g,v,h));k-=v;h+=v;if(C)break a}else e.head&&(e.head.name=
|
|
382
|
-
null);e.length=0;e.mode=8;case 8:if(e.flags&4096){if(0===k)break a;v=0;do C=g[h+v++],e.head&&C&&65536>e.length&&(e.head.comment+=String.fromCharCode(C));while(C&&v<k);e.flags&512&&(e.check=w(e.check,g,v,h));k-=v;h+=v;if(C)break a}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(e.flags&512){for(;16>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}if(n!==(e.check&65535)){a.msg="header crc mismatch";e.mode=30;break}q=n=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0);a.adler=e.check=0;e.mode=12;break;
|
|
383
|
-
case 10:for(;32>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}a.adler=e.check=b(n);q=n=0;e.mode=11;case 11:if(0===e.havedict)return a.next_out=m,a.avail_out=u,a.next_in=h,a.avail_in=k,e.hold=n,e.bits=q,2;a.adler=e.check=1;e.mode=12;case 12:if(5===d||6===d)break a;case 13:if(e.last){n>>>=q&7;q-=q&7;e.mode=27;break}for(;3>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.last=n&1;n>>>=1;--q;switch(n&3){case 0:e.mode=14;break;case 1:v=e;if(x){C=void 0;G=new p.Buf32(512);F=new p.Buf32(32);for(C=0;144>C;)v.lens[C++]=
|
|
384
|
-
8;for(;256>C;)v.lens[C++]=9;for(;280>C;)v.lens[C++]=7;for(;288>C;)v.lens[C++]=8;A(1,v.lens,0,288,G,0,v.work,{bits:9});for(C=0;32>C;)v.lens[C++]=5;A(2,v.lens,0,32,F,0,v.work,{bits:5});x=!1}v.lencode=G;v.lenbits=9;v.distcode=F;v.distbits=5;e.mode=20;if(6===d){n>>>=2;q-=2;break a}break;case 2:e.mode=17;break;case 3:a.msg="invalid block type",e.mode=30}n>>>=2;q-=2;break;case 14:n>>>=q&7;for(q-=q&7;32>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}if((n&65535)!==(n>>>16^65535)){a.msg="invalid stored block lengths";
|
|
385
|
-
e.mode=30;break}e.length=n&65535;q=n=0;e.mode=15;if(6===d)break a;case 15:e.mode=16;case 16:if(v=e.length){v>k&&(v=k);v>u&&(v=u);if(0===v)break a;p.arraySet(f,g,h,v,m);k-=v;h+=v;u-=v;m+=v;e.length-=v;break}e.mode=12;break;case 17:for(;14>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.nlen=(n&31)+257;n>>>=5;q-=5;e.ndist=(n&31)+1;n>>>=5;q-=5;e.ncode=(n&15)+4;n>>>=4;q-=4;if(286<e.nlen||30<e.ndist){a.msg="too many length or distance symbols";e.mode=30;break}e.have=0;e.mode=18;case 18:for(;e.have<e.ncode;){for(;3>
|
|
386
|
-
q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.lens[U[e.have++]]=n&7;n>>>=3;q-=3}for(;19>e.have;)e.lens[U[e.have++]]=0;e.lencode=e.lendyn;e.lenbits=7;v={bits:e.lenbits};O=A(0,e.lens,0,19,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid code lengths set";e.mode=30;break}e.have=0;e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;;){M=e.lencode[n&(1<<e.lenbits)-1];v=M>>>24;M&=65535;if(v<=q)break;if(0===k)break a;k--;n+=g[h++]<<q;q+=8}if(16>M)n>>>=v,q-=v,e.lens[e.have++]=M;else{if(16===M){for(C=
|
|
387
|
-
v+2;q<C;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}n>>>=v;q-=v;if(0===e.have){a.msg="invalid bit length repeat";e.mode=30;break}C=e.lens[e.have-1];v=3+(n&3);n>>>=2;q-=2}else if(17===M){for(C=v+3;q<C;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}n>>>=v;q-=v;C=0;v=3+(n&7);n>>>=3;q-=3}else{for(C=v+7;q<C;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}n>>>=v;q-=v;C=0;v=11+(n&127);n>>>=7;q-=7}if(e.have+v>e.nlen+e.ndist){a.msg="invalid bit length repeat";e.mode=30;break}for(;v--;)e.lens[e.have++]=C}}if(30===e.mode)break;
|
|
388
|
-
if(0===e.lens[256]){a.msg="invalid code -- missing end-of-block";e.mode=30;break}e.lenbits=9;v={bits:e.lenbits};O=A(1,e.lens,0,e.nlen,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid literal/lengths set";e.mode=30;break}e.distbits=6;e.distcode=e.distdyn;v={bits:e.distbits};O=A(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,v);e.distbits=v.bits;if(O){a.msg="invalid distances set";e.mode=30;break}e.mode=20;if(6===d)break a;case 20:e.mode=21;case 21:if(6<=k&&258<=u){a.next_out=m;a.avail_out=
|
|
389
|
-
u;a.next_in=h;a.avail_in=k;e.hold=n;e.bits=q;B(a,H);m=a.next_out;f=a.output;u=a.avail_out;h=a.next_in;g=a.input;k=a.avail_in;n=e.hold;q=e.bits;12===e.mode&&(e.back=-1);break}for(e.back=0;;){M=e.lencode[n&(1<<e.lenbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=q)break;if(0===k)break a;k--;n+=g[h++]<<q;q+=8}if(C&&0===(C&240)){P=v;R=C;for(T=M;;){M=e.lencode[T+((n&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=q)break;if(0===k)break a;k--;n+=g[h++]<<q;q+=8}n>>>=P;q-=P;e.back+=P}n>>>=v;q-=v;e.back+=
|
|
390
|
-
v;e.length=M;if(0===C){e.mode=26;break}if(C&32){e.back=-1;e.mode=12;break}if(C&64){a.msg="invalid literal/length code";e.mode=30;break}e.extra=C&15;e.mode=22;case 22:if(e.extra){for(C=e.extra;q<C;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.length+=n&(1<<e.extra)-1;n>>>=e.extra;q-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=23;case 23:for(;;){M=e.distcode[n&(1<<e.distbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=q)break;if(0===k)break a;k--;n+=g[h++]<<q;q+=8}if(0===(C&240)){P=v;R=C;for(T=M;;){M=e.distcode[T+
|
|
391
|
-
((n&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=q)break;if(0===k)break a;k--;n+=g[h++]<<q;q+=8}n>>>=P;q-=P;e.back+=P}n>>>=v;q-=v;e.back+=v;if(C&64){a.msg="invalid distance code";e.mode=30;break}e.offset=M;e.extra=C&15;e.mode=24;case 24:if(e.extra){for(C=e.extra;q<C;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}e.offset+=n&(1<<e.extra)-1;n>>>=e.extra;q-=e.extra;e.back+=e.extra}if(e.offset>e.dmax){a.msg="invalid distance too far back";e.mode=30;break}e.mode=25;case 25:if(0===u)break a;v=H-u;
|
|
392
|
-
if(e.offset>v){v=e.offset-v;if(v>e.whave&&e.sane){a.msg="invalid distance too far back";e.mode=30;break}v>e.wnext?(v-=e.wnext,C=e.wsize-v):C=e.wnext-v;v>e.length&&(v=e.length);P=e.window}else P=f,C=m-e.offset,v=e.length;v>u&&(v=u);u-=v;e.length-=v;do f[m++]=P[C++];while(--v);0===e.length&&(e.mode=21);break;case 26:if(0===u)break a;f[m++]=e.length;u--;e.mode=21;break;case 27:if(e.wrap){for(;32>q;){if(0===k)break a;k--;n|=g[h++]<<q;q+=8}H-=u;a.total_out+=H;e.total+=H;H&&(a.adler=e.check=e.flags?w(e.check,
|
|
393
|
-
f,H,m-H):t(e.check,f,H,m-H));H=u;if((e.flags?n:b(n))!==e.check){a.msg="incorrect data check";e.mode=30;break}q=n=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;32>q;){if(0===k)break a;k--;n+=g[h++]<<q;q+=8}if(n!==(e.total&4294967295)){a.msg="incorrect length check";e.mode=30;break}q=n=0}e.mode=29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=m;a.avail_out=u;a.next_in=h;a.avail_in=k;e.hold=n;e.bits=q;if(e.wsize||H!==a.avail_out&&30>e.mode&&(27>e.mode||4!==d))g=
|
|
394
|
-
a.output,h=a.next_out,m=H-a.avail_out,u=a.state,null===u.window&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new p.Buf8(u.wsize)),m>=u.wsize?(p.arraySet(u.window,g,h-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(k=u.wsize-u.wnext,k>m&&(k=m),p.arraySet(u.window,g,h-m,k,u.wnext),(m-=k)?(p.arraySet(u.window,g,h-m,m,0),u.wnext=m,u.whave=u.wsize):(u.wnext+=k,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=k)));I-=a.avail_in;H-=a.avail_out;a.total_in+=I;a.total_out+=H;e.total+=H;e.wrap&&
|
|
395
|
-
H&&(a.adler=e.check=e.flags?w(e.check,f,H,a.next_out-H):t(e.check,f,H,a.next_out-H));a.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0);(0===I&&0===H||4===d)&&0===O&&(O=-5);return O};f.inflateEnd=function(a){if(!a||!a.state)return-2;var b=a.state;b.window&&(b.window=null);a.state=null;return 0};f.inflateGetHeader=function(a,b){var e;if(!a||!a.state)return-2;e=a.state;if(0===(e.wrap&2))return-2;e.head=b;b.done=!1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},
|
|
396
|
-
{"../utils/common":16,"./adler32":18,"./crc32":20,"./inffast":23,"./inftrees":25}],25:[function(a,d,f){var b=a("../utils/common"),e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],m=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,
|
|
397
|
-
24,25,25,26,26,27,27,28,28,29,29,64,64];d.exports=function(a,d,f,w,B,A,x,G){for(var F=G.bits,z=0,L=0,l=0,J=0,K=0,E=0,y=0,D=0,u=0,n=0,q,I,H=null,v=0,C,P=new b.Buf16(16),E=new b.Buf16(16),M=null,R=0,T,O,Q,z=0;15>=z;z++)P[z]=0;for(L=0;L<w;L++)P[d[f+L]]++;K=F;for(J=15;1<=J&&0===P[J];J--);K>J&&(K=J);if(0===J)return B[A++]=20971520,B[A++]=20971520,G.bits=1,0;for(l=1;l<J&&0===P[l];l++);K<l&&(K=l);for(z=D=1;15>=z;z++)if(D<<=1,D-=P[z],0>D)return-1;if(0<D&&(0===a||1!==J))return-1;E[1]=0;for(z=1;15>z;z++)E[z+
|
|
398
|
-
1]=E[z]+P[z];for(L=0;L<w;L++)0!==d[f+L]&&(x[E[d[f+L]]++]=L);0===a?(H=M=x,C=19):1===a?(H=e,v-=257,M=g,R-=257,C=256):(H=h,M=m,C=-1);L=n=0;z=l;F=A;E=K;y=0;I=-1;u=1<<K;w=u-1;if(1===a&&852<u||2===a&&592<u)return 1;for(var U=0;;){U++;T=z-y;x[L]<C?(O=0,Q=x[L]):x[L]>C?(O=M[R+x[L]],Q=H[v+x[L]]):(O=96,Q=0);D=1<<z-y;l=q=1<<E;do q-=D,B[F+(n>>y)+q]=T<<24|O<<16|Q|0;while(0!==q);for(D=1<<z-1;n&D;)D>>=1;0!==D?(n&=D-1,n+=D):n=0;L++;if(0===--P[z]){if(z===J)break;z=d[f+x[L]]}if(z>K&&(n&w)!==I){0===y&&(y=K);F+=l;E=z-
|
|
399
|
-
y;for(D=1<<E;E+y<J;){D-=P[E+y];if(0>=D)break;E++;D<<=1}u+=1<<E;if(1===a&&852<u||2===a&&592<u)return 1;I=n&w;B[I]=K<<24|E<<16|F-A|0}}0!==n&&(B[F+n]=z-y<<24|4194304);G.bits=K;return 0}},{"../utils/common":16}],26:[function(a,d,f){d.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],27:[function(a,d,f){function b(a){for(var b=a.length;0<=--b;)a[b]=0}function e(a,b){a.pending_buf[a.pending++]=
|
|
400
|
-
b&255;a.pending_buf[a.pending++]=b>>>8&255}function g(a,b,d){a.bi_valid>16-d?(a.bi_buf|=b<<a.bi_valid&65535,e(a,a.bi_buf),a.bi_buf=b>>16-a.bi_valid,a.bi_valid+=d-16):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=d)}function h(a,b,e){g(a,e[2*b],e[2*b+1])}function m(a,b){var e=0;do e|=a&1,a>>>=1,e<<=1;while(0<--b);return e>>>1}function k(a,b,e){var d=Array(16),g=0,f;for(f=1;15>=f;f++)d[f]=g=g+e[f-1]<<1;for(e=0;e<=b;e++)g=a[2*e+1],0!==g&&(a[2*e]=m(d[g]++,g))}function p(a){var b;for(b=0;286>b;b++)a.dyn_ltree[2*
|
|
401
|
-
b]=0;for(b=0;30>b;b++)a.dyn_dtree[2*b]=0;for(b=0;19>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[512]=1;a.opt_len=a.static_len=0;a.last_lit=a.matches=0}function t(a){8<a.bi_valid?e(a,a.bi_buf):0<a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf);a.bi_buf=0;a.bi_valid=0}function w(a,b,e,d){var g=2*b,f=2*e;return a[g]<a[f]||a[g]===a[f]&&d[b]<=d[e]}function B(a,b,e){for(var d=a.heap[e],g=e<<1;g<=a.heap_len;){g<a.heap_len&&w(b,a.heap[g+1],a.heap[g],a.depth)&&g++;if(w(b,d,a.heap[g],a.depth))break;a.heap[e]=a.heap[g];
|
|
402
|
-
e=g;g<<=1}a.heap[e]=d}function A(a,b,e){var d,f,l=0,m,k;if(0!==a.last_lit){do d=a.pending_buf[a.d_buf+2*l]<<8|a.pending_buf[a.d_buf+2*l+1],f=a.pending_buf[a.l_buf+l],l++,0===d?h(a,f,b):(m=q[f],h(a,m+256+1,b),k=J[m],0!==k&&(f-=I[m],g(a,f,k)),d--,m=256>d?n[d]:n[256+(d>>>7)],h(a,m,e),k=K[m],0!==k&&(d-=H[m],g(a,d,k)));while(l<a.last_lit)}h(a,256,b)}function x(a,b){var e=b.dyn_tree,d=b.stat_desc.static_tree,g=b.stat_desc.has_stree,f=b.stat_desc.elems,l,h=-1,m;a.heap_len=0;a.heap_max=573;for(l=0;l<f;l++)0!==
|
|
403
|
-
e[2*l]?(a.heap[++a.heap_len]=h=l,a.depth[l]=0):e[2*l+1]=0;for(;2>a.heap_len;)m=a.heap[++a.heap_len]=2>h?++h:0,e[2*m]=1,a.depth[m]=0,a.opt_len--,g&&(a.static_len-=d[2*m+1]);b.max_code=h;for(l=a.heap_len>>1;1<=l;l--)B(a,e,l);m=f;do l=a.heap[1],a.heap[1]=a.heap[a.heap_len--],B(a,e,1),d=a.heap[1],a.heap[--a.heap_max]=l,a.heap[--a.heap_max]=d,e[2*m]=e[2*l]+e[2*d],a.depth[m]=(a.depth[l]>=a.depth[d]?a.depth[l]:a.depth[d])+1,e[2*l+1]=e[2*d+1]=m,a.heap[1]=m++,B(a,e,1);while(2<=a.heap_len);a.heap[--a.heap_max]=
|
|
404
|
-
a.heap[1];l=b.dyn_tree;m=b.max_code;for(var n=b.stat_desc.static_tree,u=b.stat_desc.has_stree,p=b.stat_desc.extra_bits,q=b.stat_desc.extra_base,C=b.stat_desc.max_length,t,z,v=0,f=0;15>=f;f++)a.bl_count[f]=0;l[2*a.heap[a.heap_max]+1]=0;for(d=a.heap_max+1;573>d;d++)g=a.heap[d],f=l[2*l[2*g+1]+1]+1,f>C&&(f=C,v++),l[2*g+1]=f,g>m||(a.bl_count[f]++,t=0,g>=q&&(t=p[g-q]),z=l[2*g],a.opt_len+=z*(f+t),u&&(a.static_len+=z*(n[2*g+1]+t)));if(0!==v){do{for(f=C-1;0===a.bl_count[f];)f--;a.bl_count[f]--;a.bl_count[f+
|
|
405
|
-
1]+=2;a.bl_count[C]--;v-=2}while(0<v);for(f=C;0!==f;f--)for(g=a.bl_count[f];0!==g;)n=a.heap[--d],n>m||(l[2*n+1]!==f&&(a.opt_len+=(f-l[2*n+1])*l[2*n],l[2*n+1]=f),g--)}k(e,h,a.bl_count)}function G(a,b,e){var d,g=-1,f,l=b[1],h=0,m=7,n=4;0===l&&(m=138,n=3);b[2*(e+1)+1]=65535;for(d=0;d<=e;d++)f=l,l=b[2*(d+1)+1],++h<m&&f===l||(h<n?a.bl_tree[2*f]+=h:0!==f?(f!==g&&a.bl_tree[2*f]++,a.bl_tree[32]++):10>=h?a.bl_tree[34]++:a.bl_tree[36]++,h=0,g=f,0===l?(m=138,n=3):f===l?(m=6,n=3):(m=7,n=4))}function F(a,b,e){var d,
|
|
406
|
-
f=-1,l,m=b[1],n=0,k=7,u=4;0===m&&(k=138,u=3);for(d=0;d<=e;d++)if(l=m,m=b[2*(d+1)+1],!(++n<k&&l===m)){if(n<u){do h(a,l,a.bl_tree);while(0!==--n)}else 0!==l?(l!==f&&(h(a,l,a.bl_tree),n--),h(a,16,a.bl_tree),g(a,n-3,2)):10>=n?(h(a,17,a.bl_tree),g(a,n-3,3)):(h(a,18,a.bl_tree),g(a,n-11,7));n=0;f=l;0===m?(k=138,u=3):l===m?(k=6,u=3):(k=7,u=4)}}function z(a){var b=4093624447,e;for(e=0;31>=e;e++,b>>>=1)if(b&1&&0!==a.dyn_ltree[2*e])return 0;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return 1;
|
|
407
|
-
for(e=32;256>e;e++)if(0!==a.dyn_ltree[2*e])return 1;return 0}function L(a,b,d,f){g(a,0+(f?1:0),3);t(a);e(a,d);e(a,~d);l.arraySet(a.pending_buf,a.window,b,d,a.pending);a.pending+=d}var l=a("../utils/common"),J=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],K=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],D=Array(576);b(D);var u=Array(60);b(u);var n=Array(512);b(n);var q=
|
|
408
|
-
Array(256);b(q);var I=Array(29);b(I);var H=Array(30);b(H);var v=function(a,b,e,d,g){this.static_tree=a;this.extra_bits=b;this.extra_base=e;this.elems=d;this.max_length=g;this.has_stree=a&&a.length},C,P,M,R=function(a,b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b},T=!1;f._tr_init=function(a){if(!T){var b,e,d,g=Array(16);for(d=e=0;28>d;d++)for(I[d]=e,b=0;b<1<<J[d];b++)q[e++]=d;q[e-1]=d;for(d=e=0;16>d;d++)for(H[d]=e,b=0;b<1<<K[d];b++)n[e++]=d;for(e>>=7;30>d;d++)for(H[d]=e<<7,b=0;b<1<<K[d]-7;b++)n[256+
|
|
409
|
-
e++]=d;for(b=0;15>=b;b++)g[b]=0;for(b=0;143>=b;)D[2*b+1]=8,b++,g[8]++;for(;255>=b;)D[2*b+1]=9,b++,g[9]++;for(;279>=b;)D[2*b+1]=7,b++,g[7]++;for(;287>=b;)D[2*b+1]=8,b++,g[8]++;k(D,287,g);for(b=0;30>b;b++)u[2*b+1]=5,u[2*b]=m(b,5);C=new v(D,J,257,286,15);P=new v(u,K,0,30,15);M=new v([],E,0,19,7);T=!0}a.l_desc=new R(a.dyn_ltree,C);a.d_desc=new R(a.dyn_dtree,P);a.bl_desc=new R(a.bl_tree,M);a.bi_buf=0;a.bi_valid=0;p(a)};f._tr_stored_block=L;f._tr_flush_block=function(a,b,e,d){var f,l,h=0;if(0<a.level){2===
|
|
410
|
-
a.strm.data_type&&(a.strm.data_type=z(a));x(a,a.l_desc);x(a,a.d_desc);G(a,a.dyn_ltree,a.l_desc.max_code);G(a,a.dyn_dtree,a.d_desc.max_code);x(a,a.bl_desc);for(h=18;3<=h&&0===a.bl_tree[2*y[h]+1];h--);a.opt_len+=3*(h+1)+14;f=a.opt_len+3+7>>>3;l=a.static_len+3+7>>>3;l<=f&&(f=l)}else f=l=e+5;if(e+4<=f&&-1!==b)L(a,b,e,d);else if(4===a.strategy||l===f)g(a,2+(d?1:0),3),A(a,D,u);else{g(a,4+(d?1:0),3);b=a.l_desc.max_code+1;e=a.d_desc.max_code+1;h+=1;g(a,b-257,5);g(a,e-1,5);g(a,h-4,4);for(f=0;f<h;f++)g(a,a.bl_tree[2*
|
|
411
|
-
y[f]+1],3);F(a,a.dyn_ltree,b-1);F(a,a.dyn_dtree,e-1);A(a,a.dyn_ltree,a.dyn_dtree)}p(a);d&&t(a)};f._tr_tally=function(a,b,e){a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255;a.pending_buf[a.d_buf+2*a.last_lit+1]=b&255;a.pending_buf[a.l_buf+a.last_lit]=e&255;a.last_lit++;0===b?a.dyn_ltree[2*e]++:(a.matches++,b--,a.dyn_ltree[2*(q[e]+256+1)]++,a.dyn_dtree[2*(256>b?n[b]:n[256+(b>>>7)])]++);return a.last_lit===a.lit_bufsize-1};f._tr_align=function(a){g(a,2,3);h(a,256,D);16===a.bi_valid?(e(a,a.bi_buf),a.bi_buf=
|
|
412
|
-
0,a.bi_valid=0):8<=a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf&255,a.bi_buf>>=8,a.bi_valid-=8)}},{"../utils/common":16}],28:[function(a,d,f){d.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},{}],29:[function(a,d,f){var b=b||{};b.CompressionUtils=b.CompressionUtils||{};b.CompressionUtils.JPEG_MAGIC_NUMBER=[255,216];b.CompressionUtils.JPEG2000_MAGIC_NUMBER=
|
|
413
|
-
[255,79,255,81];b.CompressionUtils.isHeaderJPEG=function(a){return a?a.getUint8(0)!==b.CompressionUtils.JPEG_MAGIC_NUMBER[0]||a.getUint8(1)!==b.CompressionUtils.JPEG_MAGIC_NUMBER[1]?!1:!0:!1};b.CompressionUtils.isHeaderJPEG2000=function(a){var d;if(a){for(d=0;d<b.CompressionUtils.JPEG2000_MAGIC_NUMBER.length;d+=1)if(a.getUint8(d)!==b.CompressionUtils.JPEG2000_MAGIC_NUMBER[d])return!1;return!0}return!1};"undefined"!==typeof d&&d.exports&&(d.exports=b.CompressionUtils)},{}],30:[function(a,d,f){var b=
|
|
414
|
-
b||{};b.Dictionary=b.Dictionary||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Dictionary.dictPrivate={"0207":{"101F":["FE","ElscintDataScale"]}};b.Dictionary.dict={"0002":{"0001":["OB","FileMetaInformationVersion"],"0002":["UI","MediaStoredSOPClassUID"],"0003":["UI","MediaStoredSOPInstanceUID"],"0010":["UI","TransferSyntaxUID"],"0012":["UI","ImplementationClassUID"],"0013":["SH","ImplementationVersionName"],"0016":["AE","SourceApplicationEntityTitle"],"0100":["UI","PrivateInformationCreatorUID"],
|
|
415
|
-
"0102":["OB","PrivateInformation"]},"0004":{1130:["CS","FilesetID"],1141:["CS","FilesetDescriptorFileFileID"],1142:["CS","FilesetDescriptorFileFormat"],1200:["UL","RootDirectoryEntitysFirstDirectoryRecordOffset"],1202:["UL","RootDirectoryEntitysLastDirectoryRecordOffset"],1212:["US","File-setConsistenceFlag"],1220:["SQ","DirectoryRecordSequence"],1400:["UL","NextDirectoryRecordOffset"],1410:["US","RecordInuseFlag"],1420:["UL","ReferencedLowerlevelDirectoryEntityOffset"],1430:["CS","DirectoryRecordType"],
|
|
416
|
-
1432:["UI","PrivateRecordUID"],1500:["CS","ReferencedFileID"],1510:["UI","ReferencedSOPClassUIDInFile"],1511:["UI","ReferencedSOPInstanceUIDInFile"],1600:["UL","NumberOfReferences"]},"0008":{"0001":["UL","LengthToEnd"],"0005":["CS","SpecificCharacterSet"],"0006":["SQ","LanguageCodeSequence"],"0008":["CS","ImageType"],"0010":["SH","RecognitionCode"],"0012":["DA","InstanceCreationDate"],"0013":["TM","InstanceCreationTime"],"0014":["UI","InstanceCreatorUID"],"0016":["UI","SOPClassUID"],"0018":["UI",
|
|
417
|
-
"SOPInstanceUID"],"001A":["UI","RelatedGeneralSOPClassUID"],"001B":["UI","OriginalSpecializedSOPClassUID"],"0020":["DA","StudyDate"],"0021":["DA","SeriesDate"],"0022":["DA","AcquisitionDate"],"0023":["DA","ContentDate"],"0024":["DA","OverlayDate"],"0025":["DA","CurveDate"],"002A":["DT","AcquisitionDateTime"],"0030":["TM","StudyTime"],"0031":["TM","SeriesTime"],"0032":["TM","AcquisitionTime"],"0033":["TM","ContentTime"],"0034":["TM","OverlayTime"],"0035":["TM","CurveTime"],"0040":["US","DataSetType"],
|
|
418
|
-
"0041":["LO","DataSetSubtype"],"0042":["CS","NuclearMedicineSeriesType"],"0050":["SH","AccessionNumber"],"0051":["SQ","IssuerOfAccessionNumberSequence"],"0052":["CS","QueryRetrieveLevel"],"0054":["AE","RetrieveAETitle"],"0056":["CS","InstanceAvailability"],"0058":["UI","FailedSOPInstanceUIDList"],"0060":["CS","Modality"],"0061":["CS","ModalitiesInStudy"],"0062":["UI","SOPClassesInStudy"],"0064":["CS","ConversionType"],"0068":["CS","PresentationIntentType"],"0070":["LO","Manufacturer"],"0080":["LO",
|
|
419
|
-
"InstitutionName"],"0081":["ST","InstitutionAddress"],"0082":["SQ","InstitutionCodeSequence"],"0090":["PN","ReferringPhysicianName"],"0092":["ST","ReferringPhysicianAddress"],"0094":["SH","ReferringPhysicianTelephoneNumbers"],"0096":["SQ","ReferringPhysicianIdentificationSequence"],"0100":["SH","CodeValue"],"0102":["SH","CodingSchemeDesignator"],"0103":["SH","CodingSchemeVersion"],"0104":["LO","CodeMeaning"],"0105":["CS","MappingResource"],"0106":["DT","ContextGroupVersion"],"0107":["DT","ContextGroupLocalVersion"],
|
|
420
|
-
"010B":["CS","ContextGroupExtensionFlag"],"010C":["UI","CodingSchemeUID"],"010D":["UI","ContextGroupExtensionCreatorUID"],"010F":["CS","ContextIdentifier"],"0110":["SQ","CodingSchemeIdentificationSequence"],"0112":["LO","CodingSchemeRegistry"],"0114":["ST","CodingSchemeExternalID"],"0115":["ST","CodingSchemeName"],"0116":["ST","CodingSchemeResponsibleOrganization"],"0117":["UI","ContextUID"],"0201":["SH","TimezoneOffsetFromUTC"],1E3:["AE","NetworkID"],1010:["SH","StationName"],1030:["LO","StudyDescription"],
|
|
421
|
-
1032:["SQ","ProcedureCodeSequence"],"103E":["LO","SeriesDescription"],"103F":["SQ","SeriesDescriptionCodeSequence"],1040:["LO","InstitutionalDepartmentName"],1048:["PN","PhysiciansOfRecord"],1049:["SQ","PhysiciansOfRecordIdentificationSequence"],1050:["PN","PerformingPhysicianName"],1052:["SQ","PerformingPhysicianIdentificationSequence"],1060:["PN","NameOfPhysiciansReadingStudy"],1062:["SQ","PhysiciansReadingStudyIdentificationSequence"],1070:["PN","OperatorsName"],1072:["SQ","OperatorIdentificationSequence"],
|
|
422
|
-
1080:["LO","AdmittingDiagnosesDescription"],1084:["SQ","AdmittingDiagnosesCodeSequence"],1090:["LO","ManufacturerModelName"],1100:["SQ","ReferencedResultsSequence"],1110:["SQ","ReferencedStudySequence"],1111:["SQ","ReferencedPerformedProcedureStepSequence"],1115:["SQ","ReferencedSeriesSequence"],1120:["SQ","ReferencedPatientSequence"],1125:["SQ","ReferencedVisitSequence"],1130:["SQ","ReferencedOverlaySequence"],1134:["SQ","ReferencedStereometricInstanceSequence"],"113A":["SQ","ReferencedWaveformSequence"],
|
|
423
|
-
1140:["SQ","ReferencedImageSequence"],1145:["SQ","ReferencedCurveSequence"],"114A":["SQ","ReferencedInstanceSequence"],"114B":["SQ","ReferencedRealWorldValueMappingInstanceSequence"],1150:["UI","ReferencedSOPClassUID"],1155:["UI","ReferencedSOPInstanceUID"],"115A":["UI","SOPClassesSupported"],1160:["IS","ReferencedFrameNumber"],1161:["UL","SimpleFrameList"],1162:["UL","CalculatedFrameList"],1163:["FD","TimeRange"],1164:["SQ","FrameExtractionSequence"],1167:["UI","MultiFrameSourceSOPInstanceUID"],
|
|
424
|
-
1195:["UI","TransactionUID"],1197:["US","FailureReason"],1198:["SQ","FailedSOPSequence"],1199:["SQ","ReferencedSOPSequence"],1200:["SQ","StudiesContainingOtherReferencedInstancesSequence"],1250:["SQ","RelatedSeriesSequence"],2110:["CS","LossyImageCompressionRetired"],2111:["ST","DerivationDescription"],2112:["SQ","SourceImageSequence"],2120:["SH","StageName"],2122:["IS","StageNumber"],2124:["IS","NumberOfStages"],2127:["SH","ViewName"],2128:["IS","ViewNumber"],2129:["IS","NumberOfEventTimers"],"212A":["IS",
|
|
425
|
-
"NumberOfViewsInStage"],2130:["DS","EventElapsedTimes"],2132:["LO","EventTimerNames"],2133:["SQ","EventTimerSequence"],2134:["FD","EventTimeOffset"],2135:["SQ","EventCodeSequence"],2142:["IS","StartTrim"],2143:["IS","StopTrim"],2144:["IS","RecommendedDisplayFrameRate"],2200:["CS","TransducerPosition"],2204:["CS","TransducerOrientation"],2208:["CS","AnatomicStructure"],2218:["SQ","AnatomicRegionSequence"],2220:["SQ","AnatomicRegionModifierSequence"],2228:["SQ","PrimaryAnatomicStructureSequence"],2229:["SQ",
|
|
426
|
-
"AnatomicStructureSpaceOrRegionSequence"],2230:["SQ","PrimaryAnatomicStructureModifierSequence"],2240:["SQ","TransducerPositionSequence"],2242:["SQ","TransducerPositionModifierSequence"],2244:["SQ","TransducerOrientationSequence"],2246:["SQ","TransducerOrientationModifierSequence"],2251:["SQ","AnatomicStructureSpaceOrRegionCodeSequenceTrial"],2253:["SQ","AnatomicPortalOfEntranceCodeSequenceTrial"],2255:["SQ","AnatomicApproachDirectionCodeSequenceTrial"],2256:["ST","AnatomicPerspectiveDescriptionTrial"],
|
|
427
|
-
2257:["SQ","AnatomicPerspectiveCodeSequenceTrial"],2258:["ST","AnatomicLocationOfExaminingInstrumentDescriptionTrial"],2259:["SQ","AnatomicLocationOfExaminingInstrumentCodeSequenceTrial"],"225A":["SQ","AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial"],"225C":["SQ","OnAxisBackgroundAnatomicStructureCodeSequenceTrial"],3001:["SQ","AlternateRepresentationSequence"],3010:["UI","IrradiationEventUID"],4E3:["LT","IdentifyingComments"],9007:["CS","FrameType"],9092:["SQ","ReferencedImageEvidenceSequence"],
|
|
428
|
-
9121:["SQ","ReferencedRawDataSequence"],9123:["UI","CreatorVersionUID"],9124:["SQ","DerivationImageSequence"],9154:["SQ","SourceImageEvidenceSequence"],9205:["CS","PixelPresentation"],9206:["CS","VolumetricProperties"],9207:["CS","VolumeBasedCalculationTechnique"],9208:["CS","ComplexImageComponent"],9209:["CS","AcquisitionContrast"],9215:["SQ","DerivationCodeSequence"],9237:["SQ","ReferencedPresentationStateSequence"],9410:["SQ","ReferencedOtherPlaneSequence"],9458:["SQ","FrameDisplaySequence"],9459:["FL",
|
|
429
|
-
"RecommendedDisplayFrameRateInFloat"],9460:["CS","SkipFrameRangeFlag"]},"0010":{"0010":["PN","PatientName"],"0020":["LO","PatientID"],"0021":["LO","IssuerOfPatientID"],"0022":["CS","TypeOfPatientID"],"0024":["SQ","IssuerOfPatientIDQualifiersSequence"],"0030":["DA","PatientBirthDate"],"0032":["TM","PatientBirthTime"],"0040":["CS","PatientSex"],"0050":["SQ","PatientInsurancePlanCodeSequence"],"0101":["SQ","PatientPrimaryLanguageCodeSequence"],"0102":["SQ","PatientPrimaryLanguageModifierCodeSequence"],
|
|
430
|
-
1E3:["LO","OtherPatientIDs"],1001:["PN","OtherPatientNames"],1002:["SQ","OtherPatientIDsSequence"],1005:["PN","PatientBirthName"],1010:["AS","PatientAge"],1020:["DS","PatientSize"],1021:["SQ","PatientSizeCodeSequence"],1030:["DS","PatientWeight"],1040:["LO","PatientAddress"],1050:["LO","InsurancePlanIdentification"],1060:["PN","PatientMotherBirthName"],1080:["LO","MilitaryRank"],1081:["LO","BranchOfService"],1090:["LO","MedicalRecordLocator"],2E3:["LO","MedicalAlerts"],2110:["LO","Allergies"],2150:["LO",
|
|
431
|
-
"CountryOfResidence"],2152:["LO","RegionOfResidence"],2154:["SH","PatientTelephoneNumbers"],2160:["SH","EthnicGroup"],2180:["SH","Occupation"],"21A0":["CS","SmokingStatus"],"21B0":["LT","AdditionalPatientHistory"],"21C0":["US","PregnancyStatus"],"21D0":["DA","LastMenstrualDate"],"21F0":["LO","PatientReligiousPreference"],2201:["LO","PatientSpeciesDescription"],2202:["SQ","PatientSpeciesCodeSequence"],2203:["CS","PatientSexNeutered"],2210:["CS","AnatomicalOrientationType"],2292:["LO","PatientBreedDescription"],
|
|
432
|
-
2293:["SQ","PatientBreedCodeSequence"],2294:["SQ","BreedRegistrationSequence"],2295:["LO","BreedRegistrationNumber"],2296:["SQ","BreedRegistryCodeSequence"],2297:["PN","ResponsiblePerson"],2298:["CS","ResponsiblePersonRole"],2299:["LO","ResponsibleOrganization"],4E3:["LT","PatientComments"],9431:["FL","ExaminedBodyThickness"]},"0012":{"0010":["LO","ClinicalTrialSponsorName"],"0020":["LO","ClinicalTrialProtocolID"],"0021":["LO","ClinicalTrialProtocolName"],"0030":["LO","ClinicalTrialSiteID"],"0031":["LO",
|
|
433
|
-
"ClinicalTrialSiteName"],"0040":["LO","ClinicalTrialSubjectID"],"0042":["LO","ClinicalTrialSubjectReadingID"],"0050":["LO","ClinicalTrialTimePointID"],"0051":["ST","ClinicalTrialTimePointDescription"],"0060":["LO","ClinicalTrialCoordinatingCenterName"],"0062":["CS","PatientIdentityRemoved"],"0063":["LO","DeidentificationMethod"],"0064":["SQ","DeidentificationMethodCodeSequence"],"0071":["LO","ClinicalTrialSeriesID"],"0072":["LO","ClinicalTrialSeriesDescription"],"0081":["LO","ClinicalTrialProtocolEthicsCommitteeName"],
|
|
434
|
-
"0082":["LO","ClinicalTrialProtocolEthicsCommitteeApprovalNumber"],"0083":["SQ","ConsentForClinicalTrialUseSequence"],"0084":["CS","DistributionType"],"0085":["CS","ConsentForDistributionFlag"]},"0014":{"0023":["ST","CADFileFormat"],"0024":["ST","ComponentReferenceSystem"],"0025":["ST","ComponentManufacturingProcedure"],"0028":["ST","ComponentManufacturer"],"0030":["DS","MaterialThickness"],"0032":["DS","MaterialPipeDiameter"],"0034":["DS","MaterialIsolationDiameter"],"0042":["ST","MaterialGrade"],
|
|
435
|
-
"0044":["ST","MaterialPropertiesFileID"],"0045":["ST","MaterialPropertiesFileFormat"],"0046":["LT","MaterialNotes"],"0050":["CS","ComponentShape"],"0052":["CS","CurvatureType"],"0054":["DS","OuterDiameter"],"0056":["DS","InnerDiameter"],1010:["ST","ActualEnvironmentalConditions"],1020:["DA","ExpiryDate"],1040:["ST","EnvironmentalConditions"],2002:["SQ","EvaluatorSequence"],2004:["IS","EvaluatorNumber"],2006:["PN","EvaluatorName"],2008:["IS","EvaluationAttempt"],2012:["SQ","IndicationSequence"],2014:["IS",
|
|
436
|
-
"IndicationNumber "],2016:["SH","IndicationLabel"],2018:["ST","IndicationDescription"],"201A":["CS","IndicationType"],"201C":["CS","IndicationDisposition"],"201E":["SQ","IndicationROISequence"],2030:["SQ","IndicationPhysicalPropertySequence"],2032:["SH","PropertyLabel"],2202:["IS","CoordinateSystemNumberOfAxes "],2204:["SQ","CoordinateSystemAxesSequence"],2206:["ST","CoordinateSystemAxisDescription"],2208:["CS","CoordinateSystemDataSetMapping"],"220A":["IS","CoordinateSystemAxisNumber"],"220C":["CS",
|
|
437
|
-
"CoordinateSystemAxisType"],"220E":["CS","CoordinateSystemAxisUnits"],2210:["OB","CoordinateSystemAxisValues"],2220:["SQ","CoordinateSystemTransformSequence"],2222:["ST","TransformDescription"],2224:["IS","TransformNumberOfAxes"],2226:["IS","TransformOrderOfAxes"],2228:["CS","TransformedAxisUnits"],"222A":["DS","CoordinateSystemTransformRotationAndScaleMatrix"],"222C":["DS","CoordinateSystemTransformTranslationMatrix"],3011:["DS","InternalDetectorFrameTime"],3012:["DS","NumberOfFramesIntegrated"],
|
|
438
|
-
3020:["SQ","DetectorTemperatureSequence"],3022:["DS","SensorName"],3024:["DS","HorizontalOffsetOfSensor"],3026:["DS","VerticalOffsetOfSensor"],3028:["DS","SensorTemperature"],3040:["SQ","DarkCurrentSequence"],3050:["OB","DarkCurrentCounts"],3060:["SQ","GainCorrectionReferenceSequence"],3070:["OB","AirCounts"],3071:["DS","KVUsedInGainCalibration"],3072:["DS","MAUsedInGainCalibration"],3073:["DS","NumberOfFramesUsedForIntegration"],3074:["LO","FilterMaterialUsedInGainCalibration"],3075:["DS","FilterThicknessUsedInGainCalibration"],
|
|
439
|
-
3076:["DA","DateOfGainCalibration"],3077:["TM","TimeOfGainCalibration"],3080:["OB","BadPixelImage"],3099:["LT","CalibrationNotes"],4002:["SQ","PulserEquipmentSequence"],4004:["CS","PulserType"],4006:["LT","PulserNotes"],4008:["SQ","ReceiverEquipmentSequence"],"400A":["CS","AmplifierType"],"400C":["LT","ReceiverNotes"],"400E":["SQ","PreAmplifierEquipmentSequence"],"400F":["LT","PreAmplifierNotes"],4010:["SQ","TransmitTransducerSequence"],4011:["SQ","ReceiveTransducerSequence"],4012:["US","NumberOfElements"],
|
|
440
|
-
4013:["CS","ElementShape"],4014:["DS","ElementDimensionA"],4015:["DS","ElementDimensionB"],4016:["DS","ElementPitch"],4017:["DS","MeasuredBeamDimensionA"],4018:["DS","MeasuredBeamDimensionB"],4019:["DS","LocationOfMeasuredBeamDiameter"],"401A":["DS","NominalFrequency"],"401B":["DS","MeasuredCenterFrequency"],"401C":["DS","MeasuredBandwidth"],4020:["SQ","PulserSettingsSequence"],4022:["DS","PulseWidth"],4024:["DS","ExcitationFrequency"],4026:["CS","ModulationType"],4028:["DS","Damping"],4030:["SQ",
|
|
441
|
-
"ReceiverSettingsSequence"],4031:["DS","AcquiredSoundpathLength"],4032:["CS","AcquisitionCompressionType"],4033:["IS","AcquisitionSampleSize"],4034:["DS","RectifierSmoothing"],4035:["SQ","DACSequence"],4036:["CS","DACType"],4038:["DS","DACGainPoints"],"403A":["DS","DACTimePoints"],"403C":["DS","DACAmplitude"],4040:["SQ","PreAmplifierSettingsSequence"],4050:["SQ","TransmitTransducerSettingsSequence"],4051:["SQ","ReceiveTransducerSettingsSequence"],4052:["DS","IncidentAngle"],4054:["ST","CouplingTechnique"],
|
|
442
|
-
4056:["ST","CouplingMedium"],4057:["DS","CouplingVelocity"],4058:["DS","CrystalCenterLocationX"],4059:["DS","CrystalCenterLocationZ"],"405A":["DS","SoundPathLength"],"405C":["ST","DelayLawIdentifier"],4060:["SQ","GateSettingsSequence"],4062:["DS","GateThreshold"],4064:["DS","VelocityOfSound"],4070:["SQ","CalibrationSettingsSequence"],4072:["ST","CalibrationProcedure"],4074:["SH","ProcedureVersion"],4076:["DA","ProcedureCreationDate"],4078:["DA","ProcedureExpirationDate"],"407A":["DA","ProcedureLastModifiedDate"],
|
|
443
|
-
"407C":["TM","CalibrationTime"],"407E":["DA","CalibrationDate"],5002:["IS","LINACEnergy"],5004:["IS","LINACOutput"]},"0018":{"0010":["LO","ContrastBolusAgent"],"0012":["SQ","ContrastBolusAgentSequence"],"0014":["SQ","ContrastBolusAdministrationRouteSequence"],"0015":["CS","BodyPartExamined"],"0020":["CS","ScanningSequence"],"0021":["CS","SequenceVariant"],"0022":["CS","ScanOptions"],"0023":["CS","MRAcquisitionType"],"0024":["SH","SequenceName"],"0025":["CS","AngioFlag"],"0026":["SQ","InterventionDrugInformationSequence"],
|
|
444
|
-
"0027":["TM","InterventionDrugStopTime"],"0028":["DS","InterventionDrugDose"],"0029":["SQ","InterventionDrugCodeSequence"],"002A":["SQ","AdditionalDrugSequence"],"0030":["LO","Radionuclide"],"0031":["LO","Radiopharmaceutical"],"0032":["DS","EnergyWindowCenterline"],"0033":["DS","EnergyWindowTotalWidth"],"0034":["LO","InterventionDrugName"],"0035":["TM","InterventionDrugStartTime"],"0036":["SQ","InterventionSequence"],"0037":["CS","TherapyType"],"0038":["CS","InterventionStatus"],"0039":["CS","TherapyDescription"],
|
|
445
|
-
"003A":["ST","InterventionDescription"],"0040":["IS","CineRate"],"0042":["CS","InitialCineRunState"],"0050":["DS","SliceThickness"],"0060":["DS","KVP"],"0070":["IS","CountsAccumulated"],"0071":["CS","AcquisitionTerminationCondition"],"0072":["DS","EffectiveDuration"],"0073":["CS","AcquisitionStartCondition"],"0074":["IS","AcquisitionStartConditionData"],"0075":["IS","AcquisitionTerminationConditionData"],"0080":["DS","RepetitionTime"],"0081":["DS","EchoTime"],"0082":["DS","InversionTime"],"0083":["DS",
|
|
446
|
-
"NumberOfAverages"],"0084":["DS","ImagingFrequency"],"0085":["SH","ImagedNucleus"],"0086":["IS","EchoNumbers"],"0087":["DS","MagneticFieldStrength"],"0088":["DS","SpacingBetweenSlices"],"0089":["IS","NumberOfPhaseEncodingSteps"],"0090":["DS","DataCollectionDiameter"],"0091":["IS","EchoTrainLength"],"0093":["DS","PercentSampling"],"0094":["DS","PercentPhaseFieldOfView"],"0095":["DS","PixelBandwidth"],1E3:["LO","DeviceSerialNumber"],1002:["UI","DeviceUID"],1003:["LO","DeviceID"],1004:["LO","PlateID"],
|
|
447
|
-
1005:["LO","GeneratorID"],1006:["LO","GridID"],1007:["LO","CassetteID"],1008:["LO","GantryID"],1010:["LO","SecondaryCaptureDeviceID"],1011:["LO","HardcopyCreationDeviceID"],1012:["DA","DateOfSecondaryCapture"],1014:["TM","TimeOfSecondaryCapture"],1016:["LO","SecondaryCaptureDeviceManufacturer"],1017:["LO","HardcopyDeviceManufacturer"],1018:["LO","SecondaryCaptureDeviceManufacturerModelName"],1019:["LO","SecondaryCaptureDeviceSoftwareVersions"],"101A":["LO","HardcopyDeviceSoftwareVersion"],"101B":["LO",
|
|
448
|
-
"HardcopyDeviceManufacturerModelName"],1020:["LO","SoftwareVersions"],1022:["SH","VideoImageFormatAcquired"],1023:["LO","DigitalImageFormatAcquired"],1030:["LO","ProtocolName"],1040:["LO","ContrastBolusRoute"],1041:["DS","ContrastBolusVolume"],1042:["TM","ContrastBolusStartTime"],1043:["TM","ContrastBolusStopTime"],1044:["DS","ContrastBolusTotalDose"],1045:["IS","SyringeCounts"],1046:["DS","ContrastFlowRate"],1047:["DS","ContrastFlowDuration"],1048:["CS","ContrastBolusIngredient"],1049:["DS","ContrastBolusIngredientConcentration"],
|
|
449
|
-
1050:["DS","SpatialResolution"],1060:["DS","TriggerTime"],1061:["LO","TriggerSourceOrType"],1062:["IS","NominalInterval"],1063:["DS","FrameTime"],1064:["LO","CardiacFramingType"],1065:["DS","FrameTimeVector"],1066:["DS","FrameDelay"],1067:["DS","ImageTriggerDelay"],1068:["DS","MultiplexGroupTimeOffset"],1069:["DS","TriggerTimeOffset"],"106A":["CS","SynchronizationTrigger"],"106C":["US","SynchronizationChannel"],"106E":["UL","TriggerSamplePosition"],1070:["LO","RadiopharmaceuticalRoute"],1071:["DS",
|
|
450
|
-
"RadiopharmaceuticalVolume"],1072:["TM","RadiopharmaceuticalStartTime"],1073:["TM","RadiopharmaceuticalStopTime"],1074:["DS","RadionuclideTotalDose"],1075:["DS","RadionuclideHalfLife"],1076:["DS","RadionuclidePositronFraction"],1077:["DS","RadiopharmaceuticalSpecificActivity"],1078:["DT","RadiopharmaceuticalStartDateTime"],1079:["DT","RadiopharmaceuticalStopDateTime"],1080:["CS","BeatRejectionFlag"],1081:["IS","LowRRValue"],1082:["IS","HighRRValue"],1083:["IS","IntervalsAcquired"],1084:["IS","IntervalsRejected"],
|
|
451
|
-
1085:["LO","PVCRejection"],1086:["IS","SkipBeats"],1088:["IS","HeartRate"],1090:["IS","CardiacNumberOfImages"],1094:["IS","TriggerWindow"],1100:["DS","ReconstructionDiameter"],1110:["DS","DistanceSourceToDetector"],1111:["DS","DistanceSourceToPatient"],1114:["DS","EstimatedRadiographicMagnificationFactor"],1120:["DS","GantryDetectorTilt"],1121:["DS","GantryDetectorSlew"],1130:["DS","TableHeight"],1131:["DS","TableTraverse"],1134:["CS","TableMotion"],1135:["DS","TableVerticalIncrement"],1136:["DS",
|
|
452
|
-
"TableLateralIncrement"],1137:["DS","TableLongitudinalIncrement"],1138:["DS","TableAngle"],"113A":["CS","TableType"],1140:["CS","RotationDirection"],1141:["DS","AngularPosition"],1142:["DS","RadialPosition"],1143:["DS","ScanArc"],1144:["DS","AngularStep"],1145:["DS","CenterOfRotationOffset"],1146:["DS","RotationOffset"],1147:["CS","FieldOfViewShape"],1149:["IS","FieldOfViewDimensions"],1150:["IS","ExposureTime"],1151:["IS","XRayTubeCurrent"],1152:["IS","Exposure"],1153:["IS","ExposureInuAs"],1154:["DS",
|
|
453
|
-
"AveragePulseWidth"],1155:["CS","RadiationSetting"],1156:["CS","RectificationType"],"115A":["CS","RadiationMode"],"115E":["DS","ImageAndFluoroscopyAreaDoseProduct"],1160:["SH","FilterType"],1161:["LO","TypeOfFilters"],1162:["DS","IntensifierSize"],1164:["DS","ImagerPixelSpacing"],1166:["CS","Grid"],1170:["IS","GeneratorPower"],1180:["SH","CollimatorGridName"],1181:["CS","CollimatorType"],1182:["IS","FocalDistance"],1183:["DS","XFocusCenter"],1184:["DS","YFocusCenter"],1190:["DS","FocalSpots"],1191:["CS",
|
|
454
|
-
"AnodeTargetMaterial"],"11A0":["DS","BodyPartThickness"],"11A2":["DS","CompressionForce"],1200:["DA","DateOfLastCalibration"],1201:["TM","TimeOfLastCalibration"],1210:["SH","ConvolutionKernel"],1240:["IS","UpperLowerPixelValues"],1242:["IS","ActualFrameDuration"],1243:["IS","CountRate"],1244:["US","PreferredPlaybackSequencing"],1250:["SH","ReceiveCoilName"],1251:["SH","TransmitCoilName"],1260:["SH","PlateType"],1261:["LO","PhosphorType"],1300:["DS","ScanVelocity"],1301:["CS","WholeBodyTechnique"],
|
|
455
|
-
1302:["IS","ScanLength"],1310:["US","AcquisitionMatrix"],1312:["CS","InPlanePhaseEncodingDirection"],1314:["DS","FlipAngle"],1315:["CS","VariableFlipAngleFlag"],1316:["DS","SAR"],1318:["DS","dBdt"],1400:["LO","AcquisitionDeviceProcessingDescription"],1401:["LO","AcquisitionDeviceProcessingCode"],1402:["CS","CassetteOrientation"],1403:["CS","CassetteSize"],1404:["US","ExposuresOnPlate"],1405:["IS","RelativeXRayExposure"],1411:["DS","ExposureIndex"],1412:["DS","TargetExposureIndex"],1413:["DS","DeviationIndex"],
|
|
456
|
-
1450:["DS","ColumnAngulation"],1460:["DS","TomoLayerHeight"],1470:["DS","TomoAngle"],1480:["DS","TomoTime"],1490:["CS","TomoType"],1491:["CS","TomoClass"],1495:["IS","NumberOfTomosynthesisSourceImages"],1500:["CS","PositionerMotion"],1508:["CS","PositionerType"],1510:["DS","PositionerPrimaryAngle"],1511:["DS","PositionerSecondaryAngle"],1520:["DS","PositionerPrimaryAngleIncrement"],1521:["DS","PositionerSecondaryAngleIncrement"],1530:["DS","DetectorPrimaryAngle"],1531:["DS","DetectorSecondaryAngle"],
|
|
457
|
-
1600:["CS","ShutterShape"],1602:["IS","ShutterLeftVerticalEdge"],1604:["IS","ShutterRightVerticalEdge"],1606:["IS","ShutterUpperHorizontalEdge"],1608:["IS","ShutterLowerHorizontalEdge"],1610:["IS","CenterOfCircularShutter"],1612:["IS","RadiusOfCircularShutter"],1620:["IS","VerticesOfThePolygonalShutter"],1622:["US","ShutterPresentationValue"],1623:["US","ShutterOverlayGroup"],1624:["US","ShutterPresentationColorCIELabValue"],1700:["CS","CollimatorShape"],1702:["IS","CollimatorLeftVerticalEdge"],1704:["IS",
|
|
458
|
-
"CollimatorRightVerticalEdge"],1706:["IS","CollimatorUpperHorizontalEdge"],1708:["IS","CollimatorLowerHorizontalEdge"],1710:["IS","CenterOfCircularCollimator"],1712:["IS","RadiusOfCircularCollimator"],1720:["IS","VerticesOfThePolygonalCollimator"],1800:["CS","AcquisitionTimeSynchronized"],1801:["SH","TimeSource"],1802:["CS","TimeDistributionProtocol"],1803:["LO","NTPSourceAddress"],2001:["IS","PageNumberVector"],2002:["SH","FrameLabelVector"],2003:["DS","FramePrimaryAngleVector"],2004:["DS","FrameSecondaryAngleVector"],
|
|
459
|
-
2005:["DS","SliceLocationVector"],2006:["SH","DisplayWindowLabelVector"],2010:["DS","NominalScannedPixelSpacing"],2020:["CS","DigitizingDeviceTransportDirection"],2030:["DS","RotationOfScannedFilm"],3100:["CS","IVUSAcquisition"],3101:["DS","IVUSPullbackRate"],3102:["DS","IVUSGatedRate"],3103:["IS","IVUSPullbackStartFrameNumber"],3104:["IS","IVUSPullbackStopFrameNumber"],3105:["IS","LesionNumber"],4E3:["LT","AcquisitionComments"],5E3:["SH","OutputPower"],5010:["LO","TransducerData"],5012:["DS","FocusDepth"],
|
|
460
|
-
5020:["LO","ProcessingFunction"],5021:["LO","PostprocessingFunction"],5022:["DS","MechanicalIndex"],5024:["DS","BoneThermalIndex"],5026:["DS","CranialThermalIndex"],5027:["DS","SoftTissueThermalIndex"],5028:["DS","SoftTissueFocusThermalIndex"],5029:["DS","SoftTissueSurfaceThermalIndex"],5030:["DS","DynamicRange"],5040:["DS","TotalGain"],5050:["IS","DepthOfScanField"],5100:["CS","PatientPosition"],5101:["CS","ViewPosition"],5104:["SQ","ProjectionEponymousNameCodeSequence"],5210:["DS","ImageTransformationMatrix"],
|
|
461
|
-
5212:["DS","ImageTranslationVector"],6E3:["DS","Sensitivity"],6011:["SQ","SequenceOfUltrasoundRegions"],6012:["US","RegionSpatialFormat"],6014:["US","RegionDataType"],6016:["UL","RegionFlags"],6018:["UL","RegionLocationMinX0"],"601A":["UL","RegionLocationMinY0"],"601C":["UL","RegionLocationMaxX1"],"601E":["UL","RegionLocationMaxY1"],6020:["SL","ReferencePixelX0"],6022:["SL","ReferencePixelY0"],6024:["US","PhysicalUnitsXDirection"],6026:["US","PhysicalUnitsYDirection"],6028:["FD","ReferencePixelPhysicalValueX"],
|
|
462
|
-
"602A":["FD","ReferencePixelPhysicalValueY"],"602C":["FD","PhysicalDeltaX"],"602E":["FD","PhysicalDeltaY"],6030:["UL","TransducerFrequency"],6031:["CS","TransducerType"],6032:["UL","PulseRepetitionFrequency"],6034:["FD","DopplerCorrectionAngle"],6036:["FD","SteeringAngle"],6038:["UL","DopplerSampleVolumeXPositionRetired"],6039:["SL","DopplerSampleVolumeXPosition"],"603A":["UL","DopplerSampleVolumeYPositionRetired"],"603B":["SL","DopplerSampleVolumeYPosition"],"603C":["UL","TMLinePositionX0Retired"],
|
|
463
|
-
"603D":["SL","TMLinePositionX0"],"603E":["UL","TMLinePositionY0Retired"],"603F":["SL","TMLinePositionY0"],6040:["UL","TMLinePositionX1Retired"],6041:["SL","TMLinePositionX1"],6042:["UL","TMLinePositionY1Retired"],6043:["SL","TMLinePositionY1"],6044:["US","PixelComponentOrganization"],6046:["UL","PixelComponentMask"],6048:["UL","PixelComponentRangeStart"],"604A":["UL","PixelComponentRangeStop"],"604C":["US","PixelComponentPhysicalUnits"],"604E":["US","PixelComponentDataType"],6050:["UL","NumberOfTableBreakPoints"],
|
|
464
|
-
6052:["UL","TableOfXBreakPoints"],6054:["FD","TableOfYBreakPoints"],6056:["UL","NumberOfTableEntries"],6058:["UL","TableOfPixelValues"],"605A":["FL","TableOfParameterValues"],6060:["FL","RWaveTimeVector"],7E3:["CS","DetectorConditionsNominalFlag"],7001:["DS","DetectorTemperature"],7004:["CS","DetectorType"],7005:["CS","DetectorConfiguration"],7006:["LT","DetectorDescription"],7008:["LT","DetectorMode"],"700A":["SH","DetectorID"],"700C":["DA","DateOfLastDetectorCalibration"],"700E":["TM","TimeOfLastDetectorCalibration"],
|
|
465
|
-
7010:["IS","ExposuresOnDetectorSinceLastCalibration"],7011:["IS","ExposuresOnDetectorSinceManufactured"],7012:["DS","DetectorTimeSinceLastExposure"],7014:["DS","DetectorActiveTime"],7016:["DS","DetectorActivationOffsetFromExposure"],"701A":["DS","DetectorBinning"],7020:["DS","DetectorElementPhysicalSize"],7022:["DS","DetectorElementSpacing"],7024:["CS","DetectorActiveShape"],7026:["DS","DetectorActiveDimensions"],7028:["DS","DetectorActiveOrigin"],"702A":["LO","DetectorManufacturerName"],"702B":["LO",
|
|
466
|
-
"DetectorManufacturerModelName"],7030:["DS","FieldOfViewOrigin"],7032:["DS","FieldOfViewRotation"],7034:["CS","FieldOfViewHorizontalFlip"],7036:["FL","PixelDataAreaOriginRelativeToFOV"],7038:["FL","PixelDataAreaRotationAngleRelativeToFOV"],7040:["LT","GridAbsorbingMaterial"],7041:["LT","GridSpacingMaterial"],7042:["DS","GridThickness"],7044:["DS","GridPitch"],7046:["IS","GridAspectRatio"],7048:["DS","GridPeriod"],"704C":["DS","GridFocalDistance"],7050:["CS","FilterMaterial"],7052:["DS","FilterThicknessMinimum"],
|
|
467
|
-
7054:["DS","FilterThicknessMaximum"],7056:["FL","FilterBeamPathLengthMinimum"],7058:["FL","FilterBeamPathLengthMaximum"],7060:["CS","ExposureControlMode"],7062:["LT","ExposureControlModeDescription"],7064:["CS","ExposureStatus"],7065:["DS","PhototimerSetting"],8150:["DS","ExposureTimeInuS"],8151:["DS","XRayTubeCurrentInuA"],9004:["CS","ContentQualification"],9005:["SH","PulseSequenceName"],9006:["SQ","MRImagingModifierSequence"],9008:["CS","EchoPulseSequence"],9009:["CS","InversionRecovery"],9010:["CS",
|
|
468
|
-
"FlowCompensation"],9011:["CS","MultipleSpinEcho"],9012:["CS","MultiPlanarExcitation"],9014:["CS","PhaseContrast"],9015:["CS","TimeOfFlightContrast"],9016:["CS","Spoiling"],9017:["CS","SteadyStatePulseSequence"],9018:["CS","EchoPlanarPulseSequence"],9019:["FD","TagAngleFirstAxis"],9020:["CS","MagnetizationTransfer"],9021:["CS","T2Preparation"],9022:["CS","BloodSignalNulling"],9024:["CS","SaturationRecovery"],9025:["CS","SpectrallySelectedSuppression"],9026:["CS","SpectrallySelectedExcitation"],9027:["CS",
|
|
469
|
-
"SpatialPresaturation"],9028:["CS","Tagging"],9029:["CS","OversamplingPhase"],9030:["FD","TagSpacingFirstDimension"],9032:["CS","GeometryOfKSpaceTraversal"],9033:["CS","SegmentedKSpaceTraversal"],9034:["CS","RectilinearPhaseEncodeReordering"],9035:["FD","TagThickness"],9036:["CS","PartialFourierDirection"],9037:["CS","CardiacSynchronizationTechnique"],9041:["LO","ReceiveCoilManufacturerName"],9042:["SQ","MRReceiveCoilSequence"],9043:["CS","ReceiveCoilType"],9044:["CS","QuadratureReceiveCoil"],9045:["SQ",
|
|
470
|
-
"MultiCoilDefinitionSequence"],9046:["LO","MultiCoilConfiguration"],9047:["SH","MultiCoilElementName"],9048:["CS","MultiCoilElementUsed"],9049:["SQ","MRTransmitCoilSequence"],9050:["LO","TransmitCoilManufacturerName"],9051:["CS","TransmitCoilType"],9052:["FD","SpectralWidth"],9053:["FD","ChemicalShiftReference"],9054:["CS","VolumeLocalizationTechnique"],9058:["US","MRAcquisitionFrequencyEncodingSteps"],9059:["CS","Decoupling"],9060:["CS","DecoupledNucleus"],9061:["FD","DecouplingFrequency"],9062:["CS",
|
|
471
|
-
"DecouplingMethod"],9063:["FD","DecouplingChemicalShiftReference"],9064:["CS","KSpaceFiltering"],9065:["CS","TimeDomainFiltering"],9066:["US","NumberOfZeroFills"],9067:["CS","BaselineCorrection"],9069:["FD","ParallelReductionFactorInPlane"],9070:["FD","CardiacRRIntervalSpecified"],9073:["FD","AcquisitionDuration"],9074:["DT","FrameAcquisitionDateTime"],9075:["CS","DiffusionDirectionality"],9076:["SQ","DiffusionGradientDirectionSequence"],9077:["CS","ParallelAcquisition"],9078:["CS","ParallelAcquisitionTechnique"],
|
|
472
|
-
9079:["FD","InversionTimes"],9080:["ST","MetaboliteMapDescription"],9081:["CS","PartialFourier"],9082:["FD","EffectiveEchoTime"],9083:["SQ","MetaboliteMapCodeSequence"],9084:["SQ","ChemicalShiftSequence"],9085:["CS","CardiacSignalSource"],9087:["FD","DiffusionBValue"],9089:["FD","DiffusionGradientOrientation"],9090:["FD","VelocityEncodingDirection"],9091:["FD","VelocityEncodingMinimumValue"],9092:["SQ","VelocityEncodingAcquisitionSequence"],9093:["US","NumberOfKSpaceTrajectories"],9094:["CS","CoverageOfKSpace"],
|
|
473
|
-
9095:["UL","SpectroscopyAcquisitionPhaseRows"],9096:["FD","ParallelReductionFactorInPlaneRetired"],9098:["FD","TransmitterFrequency"],9100:["CS","ResonantNucleus"],9101:["CS","FrequencyCorrection"],9103:["SQ","MRSpectroscopyFOVGeometrySequence"],9104:["FD","SlabThickness"],9105:["FD","SlabOrientation"],9106:["FD","MidSlabPosition"],9107:["SQ","MRSpatialSaturationSequence"],9112:["SQ","MRTimingAndRelatedParametersSequence"],9114:["SQ","MREchoSequence"],9115:["SQ","MRModifierSequence"],9117:["SQ","MRDiffusionSequence"],
|
|
474
|
-
9118:["SQ","CardiacSynchronizationSequence"],9119:["SQ","MRAveragesSequence"],9125:["SQ","MRFOVGeometrySequence"],9126:["SQ","VolumeLocalizationSequence"],9127:["UL","SpectroscopyAcquisitionDataColumns"],9147:["CS","DiffusionAnisotropyType"],9151:["DT","FrameReferenceDateTime"],9152:["SQ","MRMetaboliteMapSequence"],9155:["FD","ParallelReductionFactorOutOfPlane"],9159:["UL","SpectroscopyAcquisitionOutOfPlanePhaseSteps"],9166:["CS","BulkMotionStatus"],9168:["FD","ParallelReductionFactorSecondInPlane"],
|
|
475
|
-
9169:["CS","CardiacBeatRejectionTechnique"],9170:["CS","RespiratoryMotionCompensationTechnique"],9171:["CS","RespiratorySignalSource"],9172:["CS","BulkMotionCompensationTechnique"],9173:["CS","BulkMotionSignalSource"],9174:["CS","ApplicableSafetyStandardAgency"],9175:["LO","ApplicableSafetyStandardDescription"],9176:["SQ","OperatingModeSequence"],9177:["CS","OperatingModeType"],9178:["CS","OperatingMode"],9179:["CS","SpecificAbsorptionRateDefinition"],9180:["CS","GradientOutputType"],9181:["FD","SpecificAbsorptionRateValue"],
|
|
476
|
-
9182:["FD","GradientOutput"],9183:["CS","FlowCompensationDirection"],9184:["FD","TaggingDelay"],9185:["ST","RespiratoryMotionCompensationTechniqueDescription"],9186:["SH","RespiratorySignalSourceID"],9195:["FD","ChemicalShiftMinimumIntegrationLimitInHz"],9196:["FD","ChemicalShiftMaximumIntegrationLimitInHz"],9197:["SQ","MRVelocityEncodingSequence"],9198:["CS","FirstOrderPhaseCorrection"],9199:["CS","WaterReferencedPhaseCorrection"],9200:["CS","MRSpectroscopyAcquisitionType"],9214:["CS","RespiratoryCyclePosition"],
|
|
477
|
-
9217:["FD","VelocityEncodingMaximumValue"],9218:["FD","TagSpacingSecondDimension"],9219:["SS","TagAngleSecondAxis"],9220:["FD","FrameAcquisitionDuration"],9226:["SQ","MRImageFrameTypeSequence"],9227:["SQ","MRSpectroscopyFrameTypeSequence"],9231:["US","MRAcquisitionPhaseEncodingStepsInPlane"],9232:["US","MRAcquisitionPhaseEncodingStepsOutOfPlane"],9234:["UL","SpectroscopyAcquisitionPhaseColumns"],9236:["CS","CardiacCyclePosition"],9239:["SQ","SpecificAbsorptionRateSequence"],9240:["US","RFEchoTrainLength"],
|
|
478
|
-
9241:["US","GradientEchoTrainLength"],9250:["CS","ArterialSpinLabelingContrast"],9251:["SQ","MRArterialSpinLabelingSequence"],9252:["LO","ASLTechniqueDescription"],9253:["US","ASLSlabNumber"],9254:["FD ","ASLSlabThickness"],9255:["FD ","ASLSlabOrientation"],9256:["FD ","ASLMidSlabPosition"],9257:["CS","ASLContext"],9258:["UL","ASLPulseTrainDuration"],9259:["CS","ASLCrusherFlag"],"925A":["FD","ASLCrusherFlow"],"925B":["LO","ASLCrusherDescription"],"925C":["CS","ASLBolusCutoffFlag"],"925D":["SQ","ASLBolusCutoffTimingSequence"],
|
|
479
|
-
"925E":["LO","ASLBolusCutoffTechnique"],"925F":["UL","ASLBolusCutoffDelayTime"],9260:["SQ","ASLSlabSequence"],9295:["FD","ChemicalShiftMinimumIntegrationLimitInppm"],9296:["FD","ChemicalShiftMaximumIntegrationLimitInppm"],9301:["SQ","CTAcquisitionTypeSequence"],9302:["CS","AcquisitionType"],9303:["FD","TubeAngle"],9304:["SQ","CTAcquisitionDetailsSequence"],9305:["FD","RevolutionTime"],9306:["FD","SingleCollimationWidth"],9307:["FD","TotalCollimationWidth"],9308:["SQ","CTTableDynamicsSequence"],9309:["FD",
|
|
480
|
-
"TableSpeed"],9310:["FD","TableFeedPerRotation"],9311:["FD","SpiralPitchFactor"],9312:["SQ","CTGeometrySequence"],9313:["FD","DataCollectionCenterPatient"],9314:["SQ","CTReconstructionSequence"],9315:["CS","ReconstructionAlgorithm"],9316:["CS","ConvolutionKernelGroup"],9317:["FD","ReconstructionFieldOfView"],9318:["FD","ReconstructionTargetCenterPatient"],9319:["FD","ReconstructionAngle"],9320:["SH","ImageFilter"],9321:["SQ","CTExposureSequence"],9322:["FD","ReconstructionPixelSpacing"],9323:["CS",
|
|
481
|
-
"ExposureModulationType"],9324:["FD","EstimatedDoseSaving"],9325:["SQ","CTXRayDetailsSequence"],9326:["SQ","CTPositionSequence"],9327:["FD","TablePosition"],9328:["FD","ExposureTimeInms"],9329:["SQ","CTImageFrameTypeSequence"],9330:["FD","XRayTubeCurrentInmA"],9332:["FD","ExposureInmAs"],9333:["CS","ConstantVolumeFlag"],9334:["CS","FluoroscopyFlag"],9335:["FD","DistanceSourceToDataCollectionCenter"],9337:["US","ContrastBolusAgentNumber"],9338:["SQ","ContrastBolusIngredientCodeSequence"],9340:["SQ",
|
|
482
|
-
"ContrastAdministrationProfileSequence"],9341:["SQ","ContrastBolusUsageSequence"],9342:["CS","ContrastBolusAgentAdministered"],9343:["CS","ContrastBolusAgentDetected"],9344:["CS","ContrastBolusAgentPhase"],9345:["FD","CTDIvol"],9346:["SQ","CTDIPhantomTypeCodeSequence"],9351:["FL","CalciumScoringMassFactorPatient"],9352:["FL","CalciumScoringMassFactorDevice"],9353:["FL","EnergyWeightingFactor"],9360:["SQ","CTAdditionalXRaySourceSequence"],9401:["SQ","ProjectionPixelCalibrationSequence"],9402:["FL",
|
|
483
|
-
"DistanceSourceToIsocenter"],9403:["FL","DistanceObjectToTableTop"],9404:["FL","ObjectPixelSpacingInCenterOfBeam"],9405:["SQ","PositionerPositionSequence"],9406:["SQ","TablePositionSequence"],9407:["SQ","CollimatorShapeSequence"],9410:["CS","PlanesInAcquisition"],9412:["SQ","XAXRFFrameCharacteristicsSequence"],9417:["SQ","FrameAcquisitionSequence"],9420:["CS","XRayReceptorType"],9423:["LO","AcquisitionProtocolName"],9424:["LT","AcquisitionProtocolDescription"],9425:["CS","ContrastBolusIngredientOpaque"],
|
|
484
|
-
9426:["FL","DistanceReceptorPlaneToDetectorHousing"],9427:["CS","IntensifierActiveShape"],9428:["FL","IntensifierActiveDimensions"],9429:["FL","PhysicalDetectorSize"],9430:["FL","PositionOfIsocenterProjection"],9432:["SQ","FieldOfViewSequence"],9433:["LO","FieldOfViewDescription"],9434:["SQ","ExposureControlSensingRegionsSequence"],9435:["CS","ExposureControlSensingRegionShape"],9436:["SS","ExposureControlSensingRegionLeftVerticalEdge"],9437:["SS","ExposureControlSensingRegionRightVerticalEdge"],
|
|
485
|
-
9438:["SS","ExposureControlSensingRegionUpperHorizontalEdge"],9439:["SS","ExposureControlSensingRegionLowerHorizontalEdge"],9440:["SS","CenterOfCircularExposureControlSensingRegion"],9441:["US","RadiusOfCircularExposureControlSensingRegion"],9442:["SS","VerticesOfThePolygonalExposureControlSensingRegion"],9447:["FL","ColumnAngulationPatient"],9449:["FL","BeamAngle"],9451:["SQ","FrameDetectorParametersSequence"],9452:["FL","CalculatedAnatomyThickness"],9455:["SQ","CalibrationSequence"],9456:["SQ",
|
|
486
|
-
"ObjectThicknessSequence"],9457:["CS","PlaneIdentification"],9461:["FL","FieldOfViewDimensionsInFloat"],9462:["SQ","IsocenterReferenceSystemSequence"],9463:["FL","PositionerIsocenterPrimaryAngle"],9464:["FL","PositionerIsocenterSecondaryAngle"],9465:["FL","PositionerIsocenterDetectorRotationAngle"],9466:["FL","TableXPositionToIsocenter"],9467:["FL","TableYPositionToIsocenter"],9468:["FL","TableZPositionToIsocenter"],9469:["FL","TableHorizontalRotationAngle"],9470:["FL","TableHeadTiltAngle"],9471:["FL",
|
|
487
|
-
"TableCradleTiltAngle"],9472:["SQ","FrameDisplayShutterSequence"],9473:["FL","AcquiredImageAreaDoseProduct"],9474:["CS","CArmPositionerTabletopRelationship"],9476:["SQ","XRayGeometrySequence"],9477:["SQ","IrradiationEventIdentificationSequence"],9504:["SQ","XRay3DFrameTypeSequence"],9506:["SQ","ContributingSourcesSequence"],9507:["SQ","XRay3DAcquisitionSequence"],9508:["FL","PrimaryPositionerScanArc"],9509:["FL","SecondaryPositionerScanArc"],9510:["FL ","PrimaryPositionerScanStartAngle"],9511:["FL",
|
|
488
|
-
"SecondaryPositionerScanStartAngle"],9514:["FL","PrimaryPositionerIncrement"],9515:["FL","SecondaryPositionerIncrement"],9516:["DT","StartAcquisitionDateTime"],9517:["DT","EndAcquisitionDateTime"],9524:["LO","ApplicationName"],9525:["LO","ApplicationVersion"],9526:["LO","ApplicationManufacturer"],9527:["CS","AlgorithmType"],9528:["LO","AlgorithmDescription"],9530:["SQ","XRay3DReconstructionSequence"],9531:["LO","ReconstructionDescription"],9538:["SQ","PerProjectionAcquisitionSequence"],9601:["SQ",
|
|
489
|
-
"DiffusionBMatrixSequence"],9602:["FD","DiffusionBValueXX"],9603:["FD","DiffusionBValueXY"],9604:["FD","DiffusionBValueXZ"],9605:["FD","DiffusionBValueYY"],9606:["FD","DiffusionBValueYZ"],9607:["FD","DiffusionBValueZZ"],9701:["DT","DecayCorrectionDateTime"],9715:["FD","StartDensityThreshold"],9716:["FD","StartRelativeDensityDifferenceThreshold"],9717:["FD","StartCardiacTriggerCountThreshold"],9718:["FD","StartRespiratoryTriggerCountThreshold"],9719:["FD","TerminationCountsThreshold"],9720:["FD","TerminationDensityThreshold"],
|
|
490
|
-
9721:["FD","TerminationRelativeDensityThreshold"],9722:["FD","TerminationTimeThreshold"],9723:["FD","TerminationCardiacTriggerCountThreshold"],9724:["FD","TerminationRespiratoryTriggerCountThreshold"],9725:["CS","DetectorGeometry"],9726:["FD","TransverseDetectorSeparation"],9727:["FD","AxialDetectorDimension"],9729:["US","RadiopharmaceuticalAgentNumber"],9732:["SQ","PETFrameAcquisitionSequence"],9733:["SQ","PETDetectorMotionDetailsSequence"],9734:["SQ","PETTableDynamicsSequence"],9735:["SQ","PETPositionSequence"],
|
|
491
|
-
9736:["SQ","PETFrameCorrectionFactorsSequence"],9737:["SQ","RadiopharmaceuticalUsageSequence"],9738:["CS","AttenuationCorrectionSource"],9739:["US","NumberOfIterations"],9740:["US","NumberOfSubsets"],9749:["SQ","PETReconstructionSequence"],9751:["SQ","PETFrameTypeSequence"],9755:["CS","TimeOfFlightInformationUsed"],9756:["CS","ReconstructionType"],9758:["CS","DecayCorrected"],9759:["CS","AttenuationCorrected"],9760:["CS","ScatterCorrected"],9761:["CS","DeadTimeCorrected"],9762:["CS","GantryMotionCorrected"],
|
|
492
|
-
9763:["CS","PatientMotionCorrected"],9764:["CS","CountLossNormalizationCorrected"],9765:["CS","RandomsCorrected"],9766:["CS","NonUniformRadialSamplingCorrected"],9767:["CS","SensitivityCalibrated"],9768:["CS","DetectorNormalizationCorrection"],9769:["CS","IterativeReconstructionMethod"],9770:["CS","AttenuationCorrectionTemporalRelationship"],9771:["SQ","PatientPhysiologicalStateSequence"],9772:["SQ","PatientPhysiologicalStateCodeSequence"],9801:["FD","DepthsOfFocus"],9803:["SQ","ExcludedIntervalsSequence"],
|
|
493
|
-
9804:["DT","ExclusionStartDatetime"],9805:["FD","ExclusionDuration"],9806:["SQ","USImageDescriptionSequence"],9807:["SQ","ImageDataTypeSequence"],9808:["CS","DataType"],9809:["SQ","TransducerScanPatternCodeSequence"],"980B":["CS","AliasedDataType"],"980C":["CS","PositionMeasuringDeviceUsed"],"980D":["SQ","TransducerGeometryCodeSequence"],"980E":["SQ","TransducerBeamSteeringCodeSequence"],"980F":["SQ","TransducerApplicationCodeSequence"],A001:["SQ","ContributingEquipmentSequence"],A002:["DT","ContributionDateTime"],
|
|
494
|
-
A003:["ST","ContributionDescription"]},"0020":{"000D":["UI","StudyInstanceUID"],"000E":["UI","SeriesInstanceUID"],"0010":["SH","StudyID"],"0011":["IS","SeriesNumber"],"0012":["IS","AcquisitionNumber"],"0013":["IS","InstanceNumber"],"0014":["IS","IsotopeNumber"],"0015":["IS","PhaseNumber"],"0016":["IS","IntervalNumber"],"0017":["IS","TimeSlotNumber"],"0018":["IS","AngleNumber"],"0019":["IS","ItemNumber"],"0020":["CS","PatientOrientation"],"0022":["IS","OverlayNumber"],"0024":["IS","CurveNumber"],"0026":["IS",
|
|
495
|
-
"LUTNumber"],"0030":["DS","ImagePosition"],"0032":["DS","ImagePositionPatient"],"0035":["DS","ImageOrientation"],"0037":["DS","ImageOrientationPatient"],"0050":["DS","Location"],"0052":["UI","FrameOfReferenceUID"],"0060":["CS","Laterality"],"0062":["CS","ImageLaterality"],"0070":["LO","ImageGeometryType"],"0080":["CS","MaskingImage"],"00AA":["IS","ReportNumber"],"0100":["IS","TemporalPositionIdentifier"],"0105":["IS","NumberOfTemporalPositions"],"0110":["DS","TemporalResolution"],"0200":["UI","SynchronizationFrameOfReferenceUID"],
|
|
496
|
-
"0242":["UI","SOPInstanceUIDOfConcatenationSource"],1E3:["IS","SeriesInStudy"],1001:["IS","AcquisitionsInSeries"],1002:["IS","ImagesInAcquisition"],1003:["IS","ImagesInSeries"],1004:["IS","AcquisitionsInStudy"],1005:["IS","ImagesInStudy"],1020:["LO","Reference"],1040:["LO","PositionReferenceIndicator"],1041:["DS","SliceLocation"],1070:["IS","OtherStudyNumbers"],1200:["IS","NumberOfPatientRelatedStudies"],1202:["IS","NumberOfPatientRelatedSeries"],1204:["IS","NumberOfPatientRelatedInstances"],1206:["IS",
|
|
497
|
-
"NumberOfStudyRelatedSeries"],1208:["IS","NumberOfStudyRelatedInstances"],1209:["IS","NumberOfSeriesRelatedInstances"],3401:["CS","ModifyingDeviceID"],3402:["CS","ModifiedImageID"],3403:["DA","ModifiedImageDate"],3404:["LO","ModifyingDeviceManufacturer"],3405:["TM","ModifiedImageTime"],3406:["LO","ModifiedImageDescription"],4E3:["LT","ImageComments"],5E3:["AT","OriginalImageIdentification"],5002:["LO","OriginalImageIdentificationNomenclature"],9056:["SH","StackID"],9057:["UL","InStackPositionNumber"],
|
|
498
|
-
9071:["SQ","FrameAnatomySequence"],9072:["CS","FrameLaterality"],9111:["SQ","FrameContentSequence"],9113:["SQ","PlanePositionSequence"],9116:["SQ","PlaneOrientationSequence"],9128:["UL","TemporalPositionIndex"],9153:["FD","NominalCardiacTriggerDelayTime"],9154:["FL","NominalCardiacTriggerTimePriorToRPeak"],9155:["FL","ActualCardiacTriggerTimePriorToRPeak"],9156:["US","FrameAcquisitionNumber"],9157:["UL","DimensionIndexValues"],9158:["LT","FrameComments"],9161:["UI","ConcatenationUID"],9162:["US",
|
|
499
|
-
"InConcatenationNumber"],9163:["US","InConcatenationTotalNumber"],9164:["UI","DimensionOrganizationUID"],9165:["AT","DimensionIndexPointer"],9167:["AT","FunctionalGroupPointer"],9213:["LO","DimensionIndexPrivateCreator"],9221:["SQ","DimensionOrganizationSequence"],9222:["SQ","DimensionIndexSequence"],9228:["UL","ConcatenationFrameOffsetNumber"],9238:["LO","FunctionalGroupPrivateCreator"],9241:["FL","NominalPercentageOfCardiacPhase"],9245:["FL","NominalPercentageOfRespiratoryPhase"],9246:["FL","StartingRespiratoryAmplitude"],
|
|
500
|
-
9247:["CS","StartingRespiratoryPhase"],9248:["FL","EndingRespiratoryAmplitude"],9249:["CS","EndingRespiratoryPhase"],9250:["CS","RespiratoryTriggerType"],9251:["FD","RRIntervalTimeNominal"],9252:["FD","ActualCardiacTriggerDelayTime"],9253:["SQ","RespiratorySynchronizationSequence"],9254:["FD","RespiratoryIntervalTime"],9255:["FD","NominalRespiratoryTriggerDelayTime"],9256:["FD","RespiratoryTriggerDelayThreshold"],9257:["FD","ActualRespiratoryTriggerDelayTime"],9301:["FD","ImagePositionVolume"],9302:["FD",
|
|
501
|
-
"ImageOrientationVolume"],9307:["CS","UltrasoundAcquisitionGeometry"],9308:["FD","ApexPosition"],9309:["FD","VolumeToTransducerMappingMatrix"],"930A":["FD","VolumeToTableMappingMatrix"],"930C":["CS","PatientFrameOfReferenceSource"],"930D":["FD","TemporalPositionTimeOffset"],"930E":["SQ","PlanePositionVolumeSequence"],"930F":["SQ","PlaneOrientationVolumeSequence"],9310:["SQ","TemporalPositionSequence"],9311:["CS","DimensionOrganizationType"],9312:["UI","VolumeFrameOfReferenceUID"],9313:["UI","TableFrameOfReferenceUID"],
|
|
502
|
-
9421:["LO","DimensionDescriptionLabel"],9450:["SQ","PatientOrientationInFrameSequence"],9453:["LO","FrameLabel"],9518:["US","AcquisitionIndex"],9529:["SQ","ContributingSOPInstancesReferenceSequence"],9536:["US","ReconstructionIndex"]},"0022":{"0001":["US","LightPathFilterPassThroughWavelength"],"0002":["US","LightPathFilterPassBand"],"0003":["US","ImagePathFilterPassThroughWavelength"],"0004":["US","ImagePathFilterPassBand"],"0005":["CS","PatientEyeMovementCommanded"],"0006":["SQ","PatientEyeMovementCommandCodeSequence"],
|
|
503
|
-
"0007":["FL","SphericalLensPower"],"0008":["FL","CylinderLensPower"],"0009":["FL","CylinderAxis"],"000A":["FL","EmmetropicMagnification"],"000B":["FL","IntraOcularPressure"],"000C":["FL","HorizontalFieldOfView"],"000D":["CS","PupilDilated"],"000E":["FL","DegreeOfDilation"],"0010":["FL","StereoBaselineAngle"],"0011":["FL","StereoBaselineDisplacement"],"0012":["FL","StereoHorizontalPixelOffset"],"0013":["FL","StereoVerticalPixelOffset"],"0014":["FL","StereoRotation"],"0015":["SQ","AcquisitionDeviceTypeCodeSequence"],
|
|
504
|
-
"0016":["SQ","IlluminationTypeCodeSequence"],"0017":["SQ","LightPathFilterTypeStackCodeSequence"],"0018":["SQ","ImagePathFilterTypeStackCodeSequence"],"0019":["SQ","LensesCodeSequence"],"001A":["SQ","ChannelDescriptionCodeSequence"],"001B":["SQ","RefractiveStateSequence"],"001C":["SQ","MydriaticAgentCodeSequence"],"001D":["SQ","RelativeImagePositionCodeSequence"],"001E":["FL","CameraAngleOfView"],"0020":["SQ","StereoPairsSequence"],"0021":["SQ","LeftImageSequence"],"0022":["SQ","RightImageSequence"],
|
|
505
|
-
"0030":["FL","AxialLengthOfTheEye"],"0031":["SQ","OphthalmicFrameLocationSequence"],"0032":["FL","ReferenceCoordinates"],"0035":["FL","DepthSpatialResolution"],"0036":["FL","MaximumDepthDistortion"],"0037":["FL","AlongScanSpatialResolution"],"0038":["FL","MaximumAlongScanDistortion"],"0039":["CS","OphthalmicImageOrientation"],"0041":["FL","DepthOfTransverseImage"],"0042":["SQ","MydriaticAgentConcentrationUnitsSequence"],"0048":["FL","AcrossScanSpatialResolution"],"0049":["FL","MaximumAcrossScanDistortion"],
|
|
506
|
-
"004E":["DS","MydriaticAgentConcentration"],"0055":["FL","IlluminationWaveLength"],"0056":["FL","IlluminationPower"],"0057":["FL","IlluminationBandwidth"],"0058":["SQ","MydriaticAgentSequence"],1007:["SQ","OphthalmicAxialMeasurementsRightEyeSequence"],1008:["SQ","OphthalmicAxialMeasurementsLeftEyeSequence"],1010:["CS","OphthalmicAxialLengthMeasurementsType"],1019:["FL","OphthalmicAxialLength"],1024:["SQ","LensStatusCodeSequence"],1025:["SQ","VitreousStatusCodeSequence"],1028:["SQ","IOLFormulaCodeSequence"],
|
|
507
|
-
1029:["LO","IOLFormulaDetail"],1033:["FL","KeratometerIndex"],1035:["SQ","SourceOfOphthalmicAxialLengthCodeSequence"],1037:["FL","TargetRefraction"],1039:["CS","RefractiveProcedureOccurred"],1040:["SQ","RefractiveSurgeryTypeCodeSequence"],1044:["SQ","OphthalmicUltrasoundAxialMeasurementsTypeCodeSequence"],1050:["SQ","OphthalmicAxialLengthMeasurementsSequence"],1053:["FL","IOLPower"],1054:["FL","PredictedRefractiveError"],1059:["FL","OphthalmicAxialLengthVelocity"],1065:["LO","LensStatusDescription"],
|
|
508
|
-
1066:["LO","VitreousStatusDescription"],1090:["SQ","IOLPowerSequence"],1092:["SQ","LensConstantSequence"],1093:["LO","IOLManufacturer"],1094:["LO","LensConstantDescription"],1096:["SQ","KeratometryMeasurementTypeCodeSequence"],1100:["SQ","ReferencedOphthalmicAxialMeasurementsSequence"],1101:["SQ","OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence"],1103:["SQ","RefractiveErrorBeforeRefractiveSurgeryCodeSequence"],1121:["FL","IOLPowerForExactEmmetropia"],1122:["FL","IOLPowerForExactTargetRefraction"],
|
|
509
|
-
1125:["SQ","AnteriorChamberDepthDefinitionCodeSequence"],1130:["FL","LensThickness"],1131:["FL","AnteriorChamberDepth"],1132:["SQ","SourceOfLensThicknessDataCodeSequence"],1133:["SQ","SourceOfAnteriorChamberDepthDataCodeSequence"],1135:["SQ","SourceOfRefractiveErrorDataCodeSequence"],1140:["CS","OphthalmicAxialLengthMeasurementModified"],1150:["SQ","OphthalmicAxialLengthDataSourceCodeSequence"],1153:["SQ","OphthalmicAxialLengthAcquisitionMethodCodeSequence"],1155:["FL","SignalToNoiseRatio"],1159:["LO",
|
|
510
|
-
"OphthalmicAxialLengthDataSourceDescription"],1210:["SQ","OphthalmicAxialLengthMeasurementsTotalLengthSequence"],1211:["SQ","OphthalmicAxialLengthMeasurementsSegmentalLengthSequence"],1212:["SQ","OphthalmicAxialLengthMeasurementsLengthSummationSequence"],1220:["SQ","UltrasoundOphthalmicAxialLengthMeasurementsSequence"],1225:["SQ","OpticalOphthalmicAxialLengthMeasurementsSequence"],1230:["SQ","UltrasoundSelectedOphthalmicAxialLengthSequence"],1250:["SQ","OphthalmicAxialLengthSelectionMethodCodeSequence"],
|
|
511
|
-
1255:["SQ","OpticalSelectedOphthalmicAxialLengthSequence"],1257:["SQ","SelectedSegmentalOphthalmicAxialLengthSequence"],1260:["SQ","SelectedTotalOphthalmicAxialLengthSequence"],1262:["SQ","OphthalmicAxialLengthQualityMetricSequence"],1273:["LO","OphthalmicAxialLengthQualityMetricTypeDescription"],1300:["SQ","IntraocularLensCalculationsRightEyeSequence"],1310:["SQ","IntraocularLensCalculationsLeftEyeSequence"],1330:["SQ","ReferencedOphthalmicAxialLengthMeasurementQCImageSequence"]},"0024":{"0010":["FL",
|
|
512
|
-
"VisualFieldHorizontalExtent"],"0011":["FL","VisualFieldVerticalExtent"],"0012":["CS","VisualFieldShape"],"0016":["SQ","ScreeningTestModeCodeSequence"],"0018":["FL","MaximumStimulusLuminance"],"0020":["FL","BackgroundLuminance"],"0021":["SQ","StimulusColorCodeSequence"],"0024":["SQ","BackgroundIlluminationColorCodeSequence"],"0025":["FL","StimulusArea"],"0028":["FL","StimulusPresentationTime"],"0032":["SQ","FixationSequence"],"0033":["SQ","FixationMonitoringCodeSequence"],"0034":["SQ","VisualFieldCatchTrialSequence"],
|
|
513
|
-
"0035":["US","FixationCheckedQuantity"],"0036":["US","PatientNotProperlyFixatedQuantity"],"0037":["CS","PresentedVisualStimuliDataFlag"],"0038":["US","NumberOfVisualStimuli"],"0039":["CS","ExcessiveFixationLossesDataFlag"],"0040":["CS","ExcessiveFixationLosses"],"0042":["US","StimuliRetestingQuantity"],"0044":["LT","CommentsOnPatientPerformanceOfVisualField"],"0045":["CS","FalseNegativesEstimateFlag"],"0046":["FL","FalseNegativesEstimate"],"0048":["US","NegativeCatchTrialsQuantity"],"0050":["US",
|
|
514
|
-
"FalseNegativesQuantity"],"0051":["CS","ExcessiveFalseNegativesDataFlag"],"0052":["CS","ExcessiveFalseNegatives"],"0053":["CS","FalsePositivesEstimateFlag"],"0054":["FL","FalsePositivesEstimate"],"0055":["CS","CatchTrialsDataFlag"],"0056":["US","PositiveCatchTrialsQuantity"],"0057":["CS","TestPointNormalsDataFlag"],"0058":["SQ","TestPointNormalsSequence"],"0059":["CS","GlobalDeviationProbabilityNormalsFlag"],"0060":["US","FalsePositivesQuantity"],"0061":["CS","ExcessiveFalsePositivesDataFlag"],"0062":["CS",
|
|
515
|
-
"ExcessiveFalsePositives"],"0063":["CS","VisualFieldTestNormalsFlag"],"0064":["SQ","ResultsNormalsSequence"],"0065":["SQ","AgeCorrectedSensitivityDeviationAlgorithmSequence"],"0066":["FL","GlobalDeviationFromNormal"],"0067":["SQ","GeneralizedDefectSensitivityDeviationAlgorithmSequence"],"0068":["FL","LocalizedDeviationfromNormal"],"0069":["LO","PatientReliabilityIndicator"],"0070":["FL","VisualFieldMeanSensitivity"],"0071":["FL","GlobalDeviationProbability"],"0072":["CS","LocalDeviationProbabilityNormalsFlag"],
|
|
516
|
-
"0073":["FL","LocalizedDeviationProbability"],"0074":["CS","ShortTermFluctuationCalculated"],"0075":["FL","ShortTermFluctuation"],"0076":["CS","ShortTermFluctuationProbabilityCalculated"],"0077":["FL","ShortTermFluctuationProbability"],"0078":["CS","CorrectedLocalizedDeviationFromNormalCalculated"],"0079":["FL","CorrectedLocalizedDeviationFromNormal"],"0080":["CS","CorrectedLocalizedDeviationFromNormalProbabilityCalculated"],"0081":["FL","CorrectedLocalizedDeviationFromNormalProbability"],"0083":["SQ",
|
|
517
|
-
"GlobalDeviationProbabilitySequence"],"0085":["SQ","LocalizedDeviationProbabilitySequence"],"0086":["CS","FovealSensitivityMeasured"],"0087":["FL","FovealSensitivity"],"0088":["FL","VisualFieldTestDuration"],"0089":["SQ","VisualFieldTestPointSequence"],"0090":["FL","VisualFieldTestPointXCoordinate"],"0091":["FL","VisualFieldTestPointYCoordinate"],"0092":["FL","AgeCorrectedSensitivityDeviationValue"],"0093":["CS","StimulusResults"],"0094":["FL","SensitivityValue"],"0095":["CS","RetestStimulusSeen"],
|
|
518
|
-
"0096":["FL","RetestSensitivityValue"],"0097":["SQ","VisualFieldTestPointNormalsSequence"],"0098":["FL","QuantifiedDefect"],"0100":["FL","AgeCorrectedSensitivityDeviationProbabilityValue"],"0102":["CS","GeneralizedDefectCorrectedSensitivityDeviationFlag "],"0103":["FL","GeneralizedDefectCorrectedSensitivityDeviationValue "],"0104":["FL","GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue"],"0105":["FL ","MinimumSensitivityValue"],"0106":["CS","BlindSpotLocalized"],"0107":["FL","BlindSpotXCoordinate"],
|
|
519
|
-
"0108":["FL","BlindSpotYCoordinate "],"0110":["SQ","VisualAcuityMeasurementSequence"],"0112":["SQ","RefractiveParametersUsedOnPatientSequence"],"0113":["CS","MeasurementLaterality"],"0114":["SQ","OphthalmicPatientClinicalInformationLeftEyeSequence"],"0115":["SQ","OphthalmicPatientClinicalInformationRightEyeSequence"],"0117":["CS","FovealPointNormativeDataFlag"],"0118":["FL","FovealPointProbabilityValue"],"0120":["CS","ScreeningBaselineMeasured"],"0122":["SQ","ScreeningBaselineMeasuredSequence"],"0124":["CS",
|
|
520
|
-
"ScreeningBaselineType"],"0126":["FL","ScreeningBaselineValue"],"0202":["LO","AlgorithmSource"],"0306":["LO","DataSetName"],"0307":["LO","DataSetVersion"],"0308":["LO","DataSetSource"],"0309":["LO","DataSetDescription"],"0317":["SQ","VisualFieldTestReliabilityGlobalIndexSequence"],"0320":["SQ","VisualFieldGlobalResultsIndexSequence"],"0325":["SQ","DataObservationSequence"],"0338":["CS","IndexNormalsFlag"],"0341":["FL","IndexProbability"],"0344":["SQ","IndexProbabilitySequence"]},"0028":{"0002":["US",
|
|
521
|
-
"SamplesPerPixel"],"0003":["US","SamplesPerPixelUsed"],"0004":["CS","PhotometricInterpretation"],"0005":["US","ImageDimensions"],"0006":["US","PlanarConfiguration"],"0008":["IS","NumberOfFrames"],"0009":["AT","FrameIncrementPointer"],"000A":["AT","FrameDimensionPointer"],"0010":["US","Rows"],"0011":["US","Columns"],"0012":["US","Planes"],"0014":["US","UltrasoundColorDataPresent"],"0030":["DS","PixelSpacing"],"0031":["DS","ZoomFactor"],"0032":["DS","ZoomCenter"],"0034":["IS","PixelAspectRatio"],"0040":["CS",
|
|
522
|
-
"ImageFormat"],"0050":["LO","ManipulatedImage"],"0051":["CS","CorrectedImage"],"005F":["LO","CompressionRecognitionCode"],"0060":["CS","CompressionCode"],"0061":["SH","CompressionOriginator"],"0062":["LO","CompressionLabel"],"0063":["SH","CompressionDescription"],"0065":["CS","CompressionSequence"],"0066":["AT","CompressionStepPointers"],"0068":["US","RepeatInterval"],"0069":["US","BitsGrouped"],"0070":["US","PerimeterTable"],"0071":["SS","PerimeterValue"],"0080":["US","PredictorRows"],"0081":["US",
|
|
523
|
-
"PredictorColumns"],"0082":["US","PredictorConstants"],"0090":["CS","BlockedPixels"],"0091":["US","BlockRows"],"0092":["US","BlockColumns"],"0093":["US","RowOverlap"],"0094":["US","ColumnOverlap"],"0100":["US","BitsAllocated"],"0101":["US","BitsStored"],"0102":["US","HighBit"],"0103":["US","PixelRepresentation"],"0104":["SS","SmallestValidPixelValue"],"0105":["SS","LargestValidPixelValue"],"0106":["SS","SmallestImagePixelValue"],"0107":["SS","LargestImagePixelValue"],"0108":["SS","SmallestPixelValueInSeries"],
|
|
524
|
-
"0109":["SS","LargestPixelValueInSeries"],"0110":["SS","SmallestImagePixelValueInPlane"],"0111":["SS","LargestImagePixelValueInPlane"],"0120":["SS","PixelPaddingValue"],"0121":["SS","PixelPaddingRangeLimit"],"0200":["US","ImageLocation"],"0300":["CS","QualityControlImage"],"0301":["CS","BurnedInAnnotation"],"0302":["CS","RecognizableVisualFeatures"],"0303":["CS","LongitudinalTemporalInformationModified"],"0400":["LO","TransformLabel"],"0401":["LO","TransformVersionNumber"],"0402":["US","NumberOfTransformSteps"],
|
|
525
|
-
"0403":["LO","SequenceOfCompressedData"],"0404":["AT","DetailsOfCoefficients"],"0700":["LO","DCTLabel"],"0701":["CS","DataBlockDescription"],"0702":["AT","DataBlock"],"0710":["US","NormalizationFactorFormat"],"0720":["US","ZonalMapNumberFormat"],"0721":["AT","ZonalMapLocation"],"0722":["US","ZonalMapFormat"],"0730":["US","AdaptiveMapFormat"],"0740":["US","CodeNumberFormat"],"0A02":["CS","PixelSpacingCalibrationType"],"0A04":["LO","PixelSpacingCalibrationDescription"],1040:["CS","PixelIntensityRelationship"],
|
|
526
|
-
1041:["SS","PixelIntensityRelationshipSign"],1050:["DS","WindowCenter"],1051:["DS","WindowWidth"],1052:["DS","RescaleIntercept"],1053:["DS","RescaleSlope"],1054:["LO","RescaleType"],1055:["LO","WindowCenterWidthExplanation"],1056:["CS","VOILUTFunction"],1080:["CS","GrayScale"],1090:["CS","RecommendedViewingMode"],1100:["SS","GrayLookupTableDescriptor"],1101:["SS","RedPaletteColorLookupTableDescriptor"],1102:["SS","GreenPaletteColorLookupTableDescriptor"],1103:["SS","BluePaletteColorLookupTableDescriptor"],
|
|
527
|
-
1104:["US","AlphaPaletteColorLookupTableDescriptor"],1111:["SS","LargeRedPaletteColorLookupTableDescriptor"],1112:["SS","LargeGreenPaletteColorLookupTableDescriptor"],1113:["SS","LargeBluePaletteColorLookupTableDescriptor"],1199:["UI","PaletteColorLookupTableUID"],1200:["OW","GrayLookupTableData"],1201:["OW","RedPaletteColorLookupTableData"],1202:["OW","GreenPaletteColorLookupTableData"],1203:["OW","BluePaletteColorLookupTableData"],1204:["OW","AlphaPaletteColorLookupTableData"],1211:["OW","LargeRedPaletteColorLookupTableData"],
|
|
528
|
-
1212:["OW","LargeGreenPaletteColorLookupTableData"],1213:["OW","LargeBluePaletteColorLookupTableData"],1214:["UI","LargePaletteColorLookupTableUID"],1221:["OW","SegmentedRedPaletteColorLookupTableData"],1222:["OW","SegmentedGreenPaletteColorLookupTableData"],1223:["OW","SegmentedBluePaletteColorLookupTableData"],1300:["CS","BreastImplantPresent"],1350:["CS","PartialView"],1351:["ST","PartialViewDescription"],1352:["SQ","PartialViewCodeSequence"],"135A":["CS","SpatialLocationsPreserved"],1401:["SQ",
|
|
529
|
-
"DataFrameAssignmentSequence"],1402:["CS","DataPathAssignment"],1403:["US","BitsMappedToColorLookupTable"],1404:["SQ","BlendingLUT1Sequence"],1405:["CS","BlendingLUT1TransferFunction"],1406:["FD","BlendingWeightConstant"],1407:["US","BlendingLookupTableDescriptor"],1408:["OW","BlendingLookupTableData"],"140B":["SQ","EnhancedPaletteColorLookupTableSequence"],"140C":["SQ","BlendingLUT2Sequence"],"140D":["CS","BlendingLUT2TransferFunction"],"140E":["CS","DataPathID"],"140F":["CS","RGBLUTTransferFunction"],
|
|
530
|
-
1410:["CS","AlphaLUTTransferFunction"],2E3:["OB","ICCProfile"],2110:["CS","LossyImageCompression"],2112:["DS","LossyImageCompressionRatio"],2114:["CS","LossyImageCompressionMethod"],3E3:["SQ","ModalityLUTSequence"],3002:["SS","LUTDescriptor"],3003:["LO","LUTExplanation"],3004:["LO","ModalityLUTType"],3006:["OW","LUTData"],3010:["SQ","VOILUTSequence"],3110:["SQ","SoftcopyVOILUTSequence"],4E3:["LT","ImagePresentationComments"],5E3:["SQ","BiPlaneAcquisitionSequence"],6010:["US","RepresentativeFrameNumber"],
|
|
531
|
-
6020:["US","FrameNumbersOfInterest"],6022:["LO","FrameOfInterestDescription"],6023:["CS","FrameOfInterestType"],6030:["US","MaskPointers"],6040:["US","RWavePointer"],6100:["SQ","MaskSubtractionSequence"],6101:["CS","MaskOperation"],6102:["US","ApplicableFrameRange"],6110:["US","MaskFrameNumbers"],6112:["US","ContrastFrameAveraging"],6114:["FL","MaskSubPixelShift"],6120:["SS","TIDOffset"],6190:["ST","MaskOperationExplanation"],"7FE0":["UT","PixelDataProviderURL"],9001:["UL","DataPointRows"],9002:["UL",
|
|
532
|
-
"DataPointColumns"],9003:["CS","SignalDomainColumns"],9099:["US","LargestMonochromePixelValue"],9108:["CS","DataRepresentation"],9110:["SQ","PixelMeasuresSequence"],9132:["SQ","FrameVOILUTSequence"],9145:["SQ","PixelValueTransformationSequence"],9235:["CS","SignalDomainRows"],9411:["FL","DisplayFilterPercentage"],9415:["SQ","FramePixelShiftSequence"],9416:["US","SubtractionItemID"],9422:["SQ","PixelIntensityRelationshipLUTSequence"],9443:["SQ","FramePixelDataPropertiesSequence"],9444:["CS","GeometricalProperties"],
|
|
533
|
-
9445:["FL","GeometricMaximumDistortion"],9446:["CS","ImageProcessingApplied"],9454:["CS","MaskSelectionMode"],9474:["CS","LUTFunction"],9478:["FL","MaskVisibilityPercentage"],9501:["SQ","PixelShiftSequence"],9502:["SQ","RegionPixelShiftSequence"],9503:["SS","VerticesOfTheRegion"],9505:["SQ","MultiFramePresentationSequence"],9506:["US","PixelShiftFrameRange"],9507:["US","LUTFrameRange"],9520:["DS","ImageToEquipmentMappingMatrix"],9537:["CS","EquipmentCoordinateSystemIdentification"]},"0032":{"000A":["CS",
|
|
534
|
-
"StudyStatusID"],"000C":["CS","StudyPriorityID"],"0012":["LO","StudyIDIssuer"],"0032":["DA","StudyVerifiedDate"],"0033":["TM","StudyVerifiedTime"],"0034":["DA","StudyReadDate"],"0035":["TM","StudyReadTime"],1E3:["DA","ScheduledStudyStartDate"],1001:["TM","ScheduledStudyStartTime"],1010:["DA","ScheduledStudyStopDate"],1011:["TM","ScheduledStudyStopTime"],1020:["LO","ScheduledStudyLocation"],1021:["AE","ScheduledStudyLocationAETitle"],1030:["LO","ReasonForStudy"],1031:["SQ","RequestingPhysicianIdentificationSequence"],
|
|
535
|
-
1032:["PN","RequestingPhysician"],1033:["LO","RequestingService"],1034:["SQ","RequestingServiceCodeSequence"],1040:["DA","StudyArrivalDate"],1041:["TM","StudyArrivalTime"],1050:["DA","StudyCompletionDate"],1051:["TM","StudyCompletionTime"],1055:["CS","StudyComponentStatusID"],1060:["LO","RequestedProcedureDescription"],1064:["SQ","RequestedProcedureCodeSequence"],1070:["LO","RequestedContrastAgent"],4E3:["LT","StudyComments"]},"0038":{"0004":["SQ","ReferencedPatientAliasSequence"],"0008":["CS","VisitStatusID"],
|
|
536
|
-
"0010":["LO","AdmissionID"],"0011":["LO","IssuerOfAdmissionID"],"0014":["SQ","IssuerOfAdmissionIDSequence"],"0016":["LO","RouteOfAdmissions"],"001A":["DA","ScheduledAdmissionDate"],"001B":["TM","ScheduledAdmissionTime"],"001C":["DA","ScheduledDischargeDate"],"001D":["TM","ScheduledDischargeTime"],"001E":["LO","ScheduledPatientInstitutionResidence"],"0020":["DA","AdmittingDate"],"0021":["TM","AdmittingTime"],"0030":["DA","DischargeDate"],"0032":["TM","DischargeTime"],"0040":["LO","DischargeDiagnosisDescription"],
|
|
537
|
-
"0044":["SQ","DischargeDiagnosisCodeSequence"],"0050":["LO","SpecialNeeds"],"0060":["LO","ServiceEpisodeID"],"0061":["LO","IssuerOfServiceEpisodeID"],"0062":["LO","ServiceEpisodeDescription"],"0064":["SQ","IssuerOfServiceEpisodeIDSequence"],"0100":["SQ","PertinentDocumentsSequence"],"0300":["LO","CurrentPatientLocation"],"0400":["LO","PatientInstitutionResidence"],"0500":["LO","PatientState"],"0502":["SQ","PatientClinicalTrialParticipationSequence"],4E3:["LT","VisitComments"]},"003A":{"0004":["CS",
|
|
538
|
-
"WaveformOriginality"],"0005":["US","NumberOfWaveformChannels"],"0010":["UL","NumberOfWaveformSamples"],"001A":["DS","SamplingFrequency"],"0020":["SH","MultiplexGroupLabel"],"0200":["SQ","ChannelDefinitionSequence"],"0202":["IS","WaveformChannelNumber"],"0203":["SH","ChannelLabel"],"0205":["CS","ChannelStatus"],"0208":["SQ","ChannelSourceSequence"],"0209":["SQ","ChannelSourceModifiersSequence"],"020A":["SQ","SourceWaveformSequence"],"020C":["LO","ChannelDerivationDescription"],"0210":["DS","ChannelSensitivity"],
|
|
539
|
-
"0211":["SQ","ChannelSensitivityUnitsSequence"],"0212":["DS","ChannelSensitivityCorrectionFactor"],"0213":["DS","ChannelBaseline"],"0214":["DS","ChannelTimeSkew"],"0215":["DS","ChannelSampleSkew"],"0218":["DS","ChannelOffset"],"021A":["US","WaveformBitsStored"],"0220":["DS","FilterLowFrequency"],"0221":["DS","FilterHighFrequency"],"0222":["DS","NotchFilterFrequency"],"0223":["DS","NotchFilterBandwidth"],"0230":["FL","WaveformDataDisplayScale"],"0231":["US","WaveformDisplayBackgroundCIELabValue"],
|
|
540
|
-
"0240":["SQ","WaveformPresentationGroupSequence"],"0241":["US","PresentationGroupNumber"],"0242":["SQ","ChannelDisplaySequence"],"0244":["US","ChannelRecommendedDisplayCIELabValue"],"0245":["FL","ChannelPosition"],"0246":["CS","DisplayShadingFlag"],"0247":["FL","FractionalChannelDisplayScale"],"0248":["FL","AbsoluteChannelDisplayScale"],"0300":["SQ","MultiplexedAudioChannelsDescriptionCodeSequence"],"0301":["IS","ChannelIdentificationCode"],"0302":["CS","ChannelMode"]},"0040":{"0001":["AE","ScheduledStationAETitle"],
|
|
541
|
-
"0002":["DA","ScheduledProcedureStepStartDate"],"0003":["TM","ScheduledProcedureStepStartTime"],"0004":["DA","ScheduledProcedureStepEndDate"],"0005":["TM","ScheduledProcedureStepEndTime"],"0006":["PN","ScheduledPerformingPhysicianName"],"0007":["LO","ScheduledProcedureStepDescription"],"0008":["SQ","ScheduledProtocolCodeSequence"],"0009":["SH","ScheduledProcedureStepID"],"000A":["SQ","StageCodeSequence"],"000B":["SQ","ScheduledPerformingPhysicianIdentificationSequence"],"0010":["SH","ScheduledStationName"],
|
|
542
|
-
"0011":["SH","ScheduledProcedureStepLocation"],"0012":["LO","PreMedication"],"0020":["CS","ScheduledProcedureStepStatus"],"0026":["SQ","OrderPlacerIdentifierSequence"],"0027":["SQ","OrderFillerIdentifierSequence"],"0031":["UT","LocalNamespaceEntityID"],"0032":["UT","UniversalEntityID"],"0033":["CS","UniversalEntityIDType"],"0035":["CS","IdentifierTypeCode"],"0036":["SQ","AssigningFacilitySequence"],"0039":["SQ","AssigningJurisdictionCodeSequence"],"003A":["SQ","AssigningAgencyOrDepartmentCodeSequence"],
|
|
543
|
-
"0100":["SQ","ScheduledProcedureStepSequence"],"0220":["SQ","ReferencedNonImageCompositeSOPInstanceSequence"],"0241":["AE","PerformedStationAETitle"],"0242":["SH","PerformedStationName"],"0243":["SH","PerformedLocation"],"0244":["DA","PerformedProcedureStepStartDate"],"0245":["TM","PerformedProcedureStepStartTime"],"0250":["DA","PerformedProcedureStepEndDate"],"0251":["TM","PerformedProcedureStepEndTime"],"0252":["CS","PerformedProcedureStepStatus"],"0253":["SH","PerformedProcedureStepID"],"0254":["LO",
|
|
544
|
-
"PerformedProcedureStepDescription"],"0255":["LO","PerformedProcedureTypeDescription"],"0260":["SQ","PerformedProtocolCodeSequence"],"0261":["CS","PerformedProtocolType"],"0270":["SQ","ScheduledStepAttributesSequence"],"0275":["SQ","RequestAttributesSequence"],"0280":["ST","CommentsOnThePerformedProcedureStep"],"0281":["SQ","PerformedProcedureStepDiscontinuationReasonCodeSequence"],"0293":["SQ","QuantitySequence"],"0294":["DS","Quantity"],"0295":["SQ","MeasuringUnitsSequence"],"0296":["SQ","BillingItemSequence"],
|
|
545
|
-
"0300":["US","TotalTimeOfFluoroscopy"],"0301":["US","TotalNumberOfExposures"],"0302":["US","EntranceDose"],"0303":["US","ExposedArea"],"0306":["DS","DistanceSourceToEntrance"],"0307":["DS","DistanceSourceToSupport"],"030E":["SQ","ExposureDoseSequence"],"0310":["ST","CommentsOnRadiationDose"],"0312":["DS","XRayOutput"],"0314":["DS","HalfValueLayer"],"0316":["DS","OrganDose"],"0318":["CS","OrganExposed"],"0320":["SQ","BillingProcedureStepSequence"],"0321":["SQ","FilmConsumptionSequence"],"0324":["SQ",
|
|
546
|
-
"BillingSuppliesAndDevicesSequence"],"0330":["SQ","ReferencedProcedureStepSequence"],"0340":["SQ","PerformedSeriesSequence"],"0400":["LT","CommentsOnTheScheduledProcedureStep"],"0440":["SQ","ProtocolContextSequence"],"0441":["SQ","ContentItemModifierSequence"],"0500":["SQ","ScheduledSpecimenSequence"],"050A":["LO","SpecimenAccessionNumber"],"0512":["LO","ContainerIdentifier"],"0513":["SQ","IssuerOfTheContainerIdentifierSequence"],"0515":["SQ","AlternateContainerIdentifierSequence"],"0518":["SQ","ContainerTypeCodeSequence"],
|
|
547
|
-
"051A":["LO","ContainerDescription"],"0520":["SQ","ContainerComponentSequence"],"0550":["SQ","SpecimenSequence"],"0551":["LO","SpecimenIdentifier"],"0552":["SQ","SpecimenDescriptionSequenceTrial"],"0553":["ST","SpecimenDescriptionTrial"],"0554":["UI","SpecimenUID"],"0555":["SQ","AcquisitionContextSequence"],"0556":["ST","AcquisitionContextDescription"],"059A":["SQ","SpecimenTypeCodeSequence"],"0560":["SQ","SpecimenDescriptionSequence"],"0562":["SQ","IssuerOfTheSpecimenIdentifierSequence"],"0600":["LO",
|
|
548
|
-
"SpecimenShortDescription"],"0602":["UT","SpecimenDetailedDescription"],"0610":["SQ","SpecimenPreparationSequence"],"0612":["SQ","SpecimenPreparationStepContentItemSequence"],"0620":["SQ","SpecimenLocalizationContentItemSequence"],"06FA":["LO","SlideIdentifier"],"071A":["SQ","ImageCenterPointCoordinatesSequence"],"072A":["DS","XOffsetInSlideCoordinateSystem"],"073A":["DS","YOffsetInSlideCoordinateSystem"],"074A":["DS","ZOffsetInSlideCoordinateSystem"],"08D8":["SQ","PixelSpacingSequence"],"08DA":["SQ",
|
|
549
|
-
"CoordinateSystemAxisCodeSequence"],"08EA":["SQ","MeasurementUnitsCodeSequence"],"09F8":["SQ","VitalStainCodeSequenceTrial"],1001:["SH","RequestedProcedureID"],1002:["LO","ReasonForTheRequestedProcedure"],1003:["SH","RequestedProcedurePriority"],1004:["LO","PatientTransportArrangements"],1005:["LO","RequestedProcedureLocation"],1006:["SH","PlacerOrderNumberProcedure"],1007:["SH","FillerOrderNumberProcedure"],1008:["LO","ConfidentialityCode"],1009:["SH","ReportingPriority"],"100A":["SQ","ReasonForRequestedProcedureCodeSequence"],
|
|
550
|
-
1010:["PN","NamesOfIntendedRecipientsOfResults"],1011:["SQ","IntendedRecipientsOfResultsIdentificationSequence"],1012:["SQ","ReasonForPerformedProcedureCodeSequence"],1060:["LO","RequestedProcedureDescriptionTrial"],1101:["SQ","PersonIdentificationCodeSequence"],1102:["ST","PersonAddress"],1103:["LO","PersonTelephoneNumbers"],1400:["LT","RequestedProcedureComments"],2001:["LO","ReasonForTheImagingServiceRequest"],2004:["DA","IssueDateOfImagingServiceRequest"],2005:["TM","IssueTimeOfImagingServiceRequest"],
|
|
551
|
-
2006:["SH","PlacerOrderNumberImagingServiceRequestRetired"],2007:["SH","FillerOrderNumberImagingServiceRequestRetired"],2008:["PN","OrderEnteredBy"],2009:["SH","OrderEntererLocation"],2010:["SH","OrderCallbackPhoneNumber"],2016:["LO","PlacerOrderNumberImagingServiceRequest"],2017:["LO","FillerOrderNumberImagingServiceRequest"],2400:["LT","ImagingServiceRequestComments"],3001:["LO","ConfidentialityConstraintOnPatientDataDescription"],4001:["CS","GeneralPurposeScheduledProcedureStepStatus"],4002:["CS",
|
|
552
|
-
"GeneralPurposePerformedProcedureStepStatus"],4003:["CS","GeneralPurposeScheduledProcedureStepPriority"],4004:["SQ","ScheduledProcessingApplicationsCodeSequence"],4005:["DT","ScheduledProcedureStepStartDateTime"],4006:["CS","MultipleCopiesFlag"],4007:["SQ","PerformedProcessingApplicationsCodeSequence"],4009:["SQ","HumanPerformerCodeSequence"],4010:["DT","ScheduledProcedureStepModificationDateTime"],4011:["DT","ExpectedCompletionDateTime"],4015:["SQ","ResultingGeneralPurposePerformedProcedureStepsSequence"],
|
|
553
|
-
4016:["SQ","ReferencedGeneralPurposeScheduledProcedureStepSequence"],4018:["SQ","ScheduledWorkitemCodeSequence"],4019:["SQ","PerformedWorkitemCodeSequence"],4020:["CS","InputAvailabilityFlag"],4021:["SQ","InputInformationSequence"],4022:["SQ","RelevantInformationSequence"],4023:["UI","ReferencedGeneralPurposeScheduledProcedureStepTransactionUID"],4025:["SQ","ScheduledStationNameCodeSequence"],4026:["SQ","ScheduledStationClassCodeSequence"],4027:["SQ","ScheduledStationGeographicLocationCodeSequence"],
|
|
554
|
-
4028:["SQ","PerformedStationNameCodeSequence"],4029:["SQ","PerformedStationClassCodeSequence"],4030:["SQ","PerformedStationGeographicLocationCodeSequence"],4031:["SQ","RequestedSubsequentWorkitemCodeSequence"],4032:["SQ","NonDICOMOutputCodeSequence"],4033:["SQ","OutputInformationSequence"],4034:["SQ","ScheduledHumanPerformersSequence"],4035:["SQ","ActualHumanPerformersSequence"],4036:["LO","HumanPerformerOrganization"],4037:["PN","HumanPerformerName"],4040:["CS","RawDataHandling"],4041:["CS","InputReadinessState"],
|
|
555
|
-
4050:["DT","PerformedProcedureStepStartDateTime"],4051:["DT","PerformedProcedureStepEndDateTime"],4052:["DT","ProcedureStepCancellationDateTime"],8302:["DS","EntranceDoseInmGy"],9094:["SQ","ReferencedImageRealWorldValueMappingSequence"],9096:["SQ","RealWorldValueMappingSequence"],9098:["SQ","PixelValueMappingCodeSequence"],9210:["SH","LUTLabel"],9211:["SS","RealWorldValueLastValueMapped"],9212:["FD","RealWorldValueLUTData"],9216:["SS","RealWorldValueFirstValueMapped"],9224:["FD","RealWorldValueIntercept"],
|
|
556
|
-
9225:["FD","RealWorldValueSlope"],A007:["CS","FindingsFlagTrial"],A010:["CS","RelationshipType"],A020:["SQ","FindingsSequenceTrial"],A021:["UI","FindingsGroupUIDTrial"],A022:["UI","ReferencedFindingsGroupUIDTrial"],A023:["DA","FindingsGroupRecordingDateTrial"],A024:["TM","FindingsGroupRecordingTimeTrial"],A026:["SQ","FindingsSourceCategoryCodeSequenceTrial"],A027:["LO","VerifyingOrganization"],A028:["SQ","DocumentingOrganizationIdentifierCodeSequenceTrial"],A030:["DT","VerificationDateTime"],A032:["DT",
|
|
557
|
-
"ObservationDateTime"],A040:["CS","ValueType"],A043:["SQ","ConceptNameCodeSequence"],A047:["LO","MeasurementPrecisionDescriptionTrial"],A050:["CS","ContinuityOfContent"],A057:["CS","UrgencyOrPriorityAlertsTrial"],A060:["LO","SequencingIndicatorTrial"],A066:["SQ","DocumentIdentifierCodeSequenceTrial"],A067:["PN","DocumentAuthorTrial"],A068:["SQ","DocumentAuthorIdentifierCodeSequenceTrial"],A070:["SQ","IdentifierCodeSequenceTrial"],A073:["SQ","VerifyingObserverSequence"],A074:["OB","ObjectBinaryIdentifierTrial"],
|
|
558
|
-
A075:["PN","VerifyingObserverName"],A076:["SQ","DocumentingObserverIdentifierCodeSequenceTrial"],A078:["SQ","AuthorObserverSequence"],A07A:["SQ","ParticipantSequence"],A07C:["SQ","CustodialOrganizationSequence"],A080:["CS","ParticipationType"],A082:["DT","ParticipationDateTime"],A084:["CS","ObserverType"],A085:["SQ","ProcedureIdentifierCodeSequenceTrial"],A088:["SQ","VerifyingObserverIdentificationCodeSequence"],A089:["OB","ObjectDirectoryBinaryIdentifierTrial"],A090:["SQ","EquivalentCDADocumentSequence"],
|
|
559
|
-
A0B0:["US","ReferencedWaveformChannels"],A110:["DA","DateOfDocumentOrVerbalTransactionTrial"],A112:["TM","TimeOfDocumentCreationOrVerbalTransactionTrial"],A120:["DT","DateTime"],A121:["DA","Date"],A122:["TM","Time"],A123:["PN","PersonName"],A124:["UI","UID"],A125:["CS","ReportStatusIDTrial"],A130:["CS","TemporalRangeType"],A132:["UL","ReferencedSamplePositions"],A136:["US","ReferencedFrameNumbers"],A138:["DS","ReferencedTimeOffsets"],A13A:["DT","ReferencedDateTime"],A160:["UT","TextValue"],A167:["SQ",
|
|
560
|
-
"ObservationCategoryCodeSequenceTrial"],A168:["SQ","ConceptCodeSequence"],A16A:["ST","BibliographicCitationTrial"],A170:["SQ","PurposeOfReferenceCodeSequence"],A171:["UI","ObservationUIDTrial"],A172:["UI","ReferencedObservationUIDTrial"],A173:["CS","ReferencedObservationClassTrial"],A174:["CS","ReferencedObjectObservationClassTrial"],A180:["US","AnnotationGroupNumber"],A192:["DA","ObservationDateTrial"],A193:["TM","ObservationTimeTrial"],A194:["CS","MeasurementAutomationTrial"],A195:["SQ","ModifierCodeSequence"],
|
|
561
|
-
A224:["ST","IdentificationDescriptionTrial"],A290:["CS","CoordinatesSetGeometricTypeTrial"],A296:["SQ","AlgorithmCodeSequenceTrial"],A297:["ST","AlgorithmDescriptionTrial"],A29A:["SL","PixelCoordinatesSetTrial"],A300:["SQ","MeasuredValueSequence"],A301:["SQ","NumericValueQualifierCodeSequence"],A307:["PN","CurrentObserverTrial"],A30A:["DS","NumericValue"],A313:["SQ","ReferencedAccessionSequenceTrial"],A33A:["ST","ReportStatusCommentTrial"],A340:["SQ","ProcedureContextSequenceTrial"],A352:["PN","VerbalSourceTrial"],
|
|
562
|
-
A353:["ST","AddressTrial"],A354:["LO","TelephoneNumberTrial"],A358:["SQ","VerbalSourceIdentifierCodeSequenceTrial"],A360:["SQ","PredecessorDocumentsSequence"],A370:["SQ","ReferencedRequestSequence"],A372:["SQ","PerformedProcedureCodeSequence"],A375:["SQ","CurrentRequestedProcedureEvidenceSequence"],A380:["SQ","ReportDetailSequenceTrial"],A385:["SQ","PertinentOtherEvidenceSequence"],A390:["SQ","HL7StructuredDocumentReferenceSequence"],A402:["UI","ObservationSubjectUIDTrial"],A403:["CS","ObservationSubjectClassTrial"],
|
|
563
|
-
A404:["SQ","ObservationSubjectTypeCodeSequenceTrial"],A491:["CS","CompletionFlag"],A492:["LO","CompletionFlagDescription"],A493:["CS","VerificationFlag"],A494:["CS","ArchiveRequested"],A496:["CS","PreliminaryFlag"],A504:["SQ","ContentTemplateSequence"],A525:["SQ","IdenticalDocumentsSequence"],A600:["CS","ObservationSubjectContextFlagTrial"],A601:["CS","ObserverContextFlagTrial"],A603:["CS","ProcedureContextFlagTrial"],A730:["SQ","ContentSequence"],A731:["SQ","RelationshipSequenceTrial"],A732:["SQ",
|
|
564
|
-
"RelationshipTypeCodeSequenceTrial"],A744:["SQ","LanguageCodeSequenceTrial"],A992:["ST","UniformResourceLocatorTrial"],B020:["SQ","WaveformAnnotationSequence"],DB00:["CS","TemplateIdentifier"],DB06:["DT","TemplateVersion"],DB07:["DT","TemplateLocalVersion"],DB0B:["CS","TemplateExtensionFlag"],DB0C:["UI","TemplateExtensionOrganizationUID"],DB0D:["UI","TemplateExtensionCreatorUID"],DB73:["UL","ReferencedContentItemIdentifier"],E001:["ST","HL7InstanceIdentifier"],E004:["DT","HL7DocumentEffectiveTime"],
|
|
565
|
-
E006:["SQ","HL7DocumentTypeCodeSequence"],E008:["SQ","DocumentClassCodeSequence"],E010:["UT","RetrieveURI"],E011:["UI","RetrieveLocationUID"],E020:["CS","TypeOfInstances"],E021:["SQ","DICOMRetrievalSequence"],E022:["SQ","DICOMMediaRetrievalSequence"],E023:["SQ","WADORetrievalSequence"],E024:["SQ","XDSRetrievalSequence"],E030:["UI","RepositoryUniqueID"],E031:["UI","HomeCommunityID"]},"0042":{"0010":["ST","DocumentTitle"],"0011":["OB","EncapsulatedDocument"],"0012":["LO","MIMETypeOfEncapsulatedDocument"],
|
|
566
|
-
"0013":["SQ","SourceInstanceSequence"],"0014":["LO","ListOfMIMETypes"]},"0044":{"0001":["ST","ProductPackageIdentifier"],"0002":["CS","SubstanceAdministrationApproval"],"0003":["LT","ApprovalStatusFurtherDescription"],"0004":["DT","ApprovalStatusDateTime"],"0007":["SQ","ProductTypeCodeSequence"],"0008":["LO","ProductName"],"0009":["LT","ProductDescription"],"000A":["LO","ProductLotIdentifier"],"000B":["DT","ProductExpirationDateTime"],"0010":["DT","SubstanceAdministrationDateTime"],"0011":["LO","SubstanceAdministrationNotes"],
|
|
567
|
-
"0012":["LO","SubstanceAdministrationDeviceID"],"0013":["SQ","ProductParameterSequence"],"0019":["SQ","SubstanceAdministrationParameterSequence"]},"0046":{"0012":["LO","LensDescription"],"0014":["SQ","RightLensSequence"],"0015":["SQ","LeftLensSequence"],"0016":["SQ","UnspecifiedLateralityLensSequence"],"0018":["SQ","CylinderSequence"],"0028":["SQ","PrismSequence"],"0030":["FD","HorizontalPrismPower"],"0032":["CS","HorizontalPrismBase"],"0034":["FD","VerticalPrismPower"],"0036":["CS","VerticalPrismBase"],
|
|
568
|
-
"0038":["CS","LensSegmentType"],"0040":["FD","OpticalTransmittance"],"0042":["FD","ChannelWidth"],"0044":["FD","PupilSize"],"0046":["FD","CornealSize"],"0050":["SQ","AutorefractionRightEyeSequence"],"0052":["SQ","AutorefractionLeftEyeSequence"],"0060":["FD","DistancePupillaryDistance"],"0062":["FD","NearPupillaryDistance"],"0063":["FD","IntermediatePupillaryDistance"],"0064":["FD","OtherPupillaryDistance"],"0070":["SQ","KeratometryRightEyeSequence"],"0071":["SQ","KeratometryLeftEyeSequence"],"0074":["SQ",
|
|
569
|
-
"SteepKeratometricAxisSequence"],"0075":["FD","RadiusOfCurvature"],"0076":["FD","KeratometricPower"],"0077":["FD","KeratometricAxis"],"0080":["SQ","FlatKeratometricAxisSequence"],"0092":["CS","BackgroundColor"],"0094":["CS","Optotype"],"0095":["CS","OptotypePresentation"],"0097":["SQ","SubjectiveRefractionRightEyeSequence"],"0098":["SQ","SubjectiveRefractionLeftEyeSequence"],"0100":["SQ","AddNearSequence"],"0101":["SQ","AddIntermediateSequence"],"0102":["SQ","AddOtherSequence"],"0104":["FD","AddPower"],
|
|
570
|
-
"0106":["FD","ViewingDistance"],"0121":["SQ","VisualAcuityTypeCodeSequence"],"0122":["SQ","VisualAcuityRightEyeSequence"],"0123":["SQ","VisualAcuityLeftEyeSequence"],"0124":["SQ","VisualAcuityBothEyesOpenSequence"],"0125":["CS","ViewingDistanceType"],"0135":["SS","VisualAcuityModifiers"],"0137":["FD","DecimalVisualAcuity"],"0139":["LO","OptotypeDetailedDefinition"],"0145":["SQ","ReferencedRefractiveMeasurementsSequence"],"0146":["FD","SpherePower"],"0147":["FD","CylinderPower"]},"0048":{"0001":["FL",
|
|
571
|
-
"ImagedVolumeWidth"],"0002":["FL","ImagedVolumeHeight"],"0003":["FL","ImagedVolumeDepth"],"0006":["UL","TotalPixelMatrixColumns"],"0007":["UL","TotalPixelMatrixRows"],"0008":["SQ","TotalPixelMatrixOriginSequence"],"0010":["CS","SpecimenLabelInImage"],"0011":["CS","FocusMethod"],"0012":["CS","ExtendedDepthOfField"],"0013":["US","NumberOfFocalPlanes"],"0014":["FL","DistanceBetweenFocalPlanes"],"0015":["US","RecommendedAbsentPixelCIELabValue"],"0100":["SQ","IlluminatorTypeCodeSequence"],"0102":["DS",
|
|
572
|
-
"ImageOrientationSlide"],"0105":["SQ","OpticalPathSequence"],"0106":["SH","OpticalPathIdentifier"],"0107":["ST","OpticalPathDescription"],"0108":["SQ","IlluminationColorCodeSequence"],"0110":["SQ","SpecimenReferenceSequence"],"0111":["DS","CondenserLensPower"],"0112":["DS","ObjectiveLensPower"],"0113":["DS","ObjectiveLensNumericalAperture"],"0120":["SQ","PaletteColorLookupTableSequence"],"0200":["SQ","ReferencedImageNavigationSequence"],"0201":["US","TopLeftHandCornerOfLocalizerArea"],"0202":["US",
|
|
573
|
-
"BottomRightHandCornerOfLocalizerArea"],"0207":["SQ","OpticalPathIdentificationSequence"],"021A":["SQ","PlanePositionSlideSequence"],"021E":["SL","RowPositionInTotalImagePixelMatrix"],"021F":["SL","ColumnPositionInTotalImagePixelMatrix"],"0301":["CS","PixelOriginInterpretation"]},"0050":{"0004":["CS","CalibrationImage"],"0010":["SQ","DeviceSequence"],"0012":["SQ","ContainerComponentTypeCodeSequence"],"0013":["FD","ContainerComponentThickness"],"0014":["DS","DeviceLength"],"0015":["FD","ContainerComponentWidth"],
|
|
574
|
-
"0016":["DS","DeviceDiameter"],"0017":["CS","DeviceDiameterUnits"],"0018":["DS","DeviceVolume"],"0019":["DS","InterMarkerDistance"],"001A":["CS","ContainerComponentMaterial"],"001B":["LO","ContainerComponentID"],"001C":["FD","ContainerComponentLength"],"001D":["FD","ContainerComponentDiameter"],"001E":["LO","ContainerComponentDescription"],"0020":["LO","DeviceDescription"]},"0052":{"0001":["FL","ContrastBolusIngredientPercentByVolume"],"0002":["FD","OCTFocalDistance"],"0003":["FD","BeamSpotSize"],
|
|
575
|
-
"0004":["FD","EffectiveRefractiveIndex"],"0006":["CS","OCTAcquisitionDomain"],"0007":["FD","OCTOpticalCenterWavelength"],"0008":["FD","AxialResolution"],"0009":["FD","RangingDepth"],"0011":["FD","ALineRate"],"0012":["US","ALinesPerFrame"],"0013":["FD","CatheterRotationalRate"],"0014":["FD","ALinePixelSpacing"],"0016":["SQ","ModeOfPercutaneousAccessSequence"],"0025":["SQ","IntravascularOCTFrameTypeSequence"],"0026":["CS","OCTZOffsetApplied"],"0027":["SQ","IntravascularFrameContentSequence"],"0028":["FD",
|
|
576
|
-
"IntravascularLongitudinalDistance"],"0029":["SQ","IntravascularOCTFrameContentSequence"],"0030":["SS","OCTZOffsetCorrection"],"0031":["CS","CatheterDirectionOfRotation"],"0033":["FD","SeamLineLocation"],"0034":["FD","FirstALineLocation"],"0036":["US","SeamLineIndex"],"0038":["US","NumberOfPaddedAlines"],"0039":["CS","InterpolationType"],"003A":["CS","RefractiveIndexApplied"]},"0054":{"0010":["US","EnergyWindowVector"],"0011":["US","NumberOfEnergyWindows"],"0012":["SQ","EnergyWindowInformationSequence"],
|
|
577
|
-
"0013":["SQ","EnergyWindowRangeSequence"],"0014":["DS","EnergyWindowLowerLimit"],"0015":["DS","EnergyWindowUpperLimit"],"0016":["SQ","RadiopharmaceuticalInformationSequence"],"0017":["IS","ResidualSyringeCounts"],"0018":["SH","EnergyWindowName"],"0020":["US","DetectorVector"],"0021":["US","NumberOfDetectors"],"0022":["SQ","DetectorInformationSequence"],"0030":["US","PhaseVector"],"0031":["US","NumberOfPhases"],"0032":["SQ","PhaseInformationSequence"],"0033":["US","NumberOfFramesInPhase"],"0036":["IS",
|
|
578
|
-
"PhaseDelay"],"0038":["IS","PauseBetweenFrames"],"0039":["CS","PhaseDescription"],"0050":["US","RotationVector"],"0051":["US","NumberOfRotations"],"0052":["SQ","RotationInformationSequence"],"0053":["US","NumberOfFramesInRotation"],"0060":["US","RRIntervalVector"],"0061":["US","NumberOfRRIntervals"],"0062":["SQ","GatedInformationSequence"],"0063":["SQ","DataInformationSequence"],"0070":["US","TimeSlotVector"],"0071":["US","NumberOfTimeSlots"],"0072":["SQ","TimeSlotInformationSequence"],"0073":["DS",
|
|
579
|
-
"TimeSlotTime"],"0080":["US","SliceVector"],"0081":["US","NumberOfSlices"],"0090":["US","AngularViewVector"],"0100":["US","TimeSliceVector"],"0101":["US","NumberOfTimeSlices"],"0200":["DS","StartAngle"],"0202":["CS","TypeOfDetectorMotion"],"0210":["IS","TriggerVector"],"0211":["US","NumberOfTriggersInPhase"],"0220":["SQ","ViewCodeSequence"],"0222":["SQ","ViewModifierCodeSequence"],"0300":["SQ","RadionuclideCodeSequence"],"0302":["SQ","AdministrationRouteCodeSequence"],"0304":["SQ","RadiopharmaceuticalCodeSequence"],
|
|
580
|
-
"0306":["SQ","CalibrationDataSequence"],"0308":["US","EnergyWindowNumber"],"0400":["SH","ImageID"],"0410":["SQ","PatientOrientationCodeSequence"],"0412":["SQ","PatientOrientationModifierCodeSequence"],"0414":["SQ","PatientGantryRelationshipCodeSequence"],"0500":["CS","SliceProgressionDirection"],1E3:["CS","SeriesType"],1001:["CS","Units"],1002:["CS","CountsSource"],1004:["CS","ReprojectionMethod"],1006:["CS","SUVType"],1100:["CS","RandomsCorrectionMethod"],1101:["LO","AttenuationCorrectionMethod"],
|
|
581
|
-
1102:["CS","DecayCorrection"],1103:["LO","ReconstructionMethod"],1104:["LO","DetectorLinesOfResponseUsed"],1105:["LO","ScatterCorrectionMethod"],1200:["DS","AxialAcceptance"],1201:["IS","AxialMash"],1202:["IS","TransverseMash"],1203:["DS","DetectorElementSize"],1210:["DS","CoincidenceWindowWidth"],1220:["CS","SecondaryCountsType"],1300:["DS","FrameReferenceTime"],1310:["IS","PrimaryPromptsCountsAccumulated"],1311:["IS","SecondaryCountsAccumulated"],1320:["DS","SliceSensitivityFactor"],1321:["DS",
|
|
582
|
-
"DecayFactor"],1322:["DS","DoseCalibrationFactor"],1323:["DS","ScatterFractionFactor"],1324:["DS","DeadTimeFactor"],1330:["US","ImageIndex"],1400:["CS","CountsIncluded"],1401:["CS","DeadTimeCorrectionFlag"]},"0060":{3E3:["SQ","HistogramSequence"],3002:["US","HistogramNumberOfBins"],3004:["SS","HistogramFirstBinValue"],3006:["SS","HistogramLastBinValue"],3008:["US","HistogramBinWidth"],3010:["LO","HistogramExplanation"],3020:["UL","HistogramData"]},"0062":{"0001":["CS","SegmentationType"],"0002":["SQ",
|
|
583
|
-
"SegmentSequence"],"0003":["SQ","SegmentedPropertyCategoryCodeSequence"],"0004":["US","SegmentNumber"],"0005":["LO","SegmentLabel"],"0006":["ST","SegmentDescription"],"0008":["CS","SegmentAlgorithmType"],"0009":["LO","SegmentAlgorithmName"],"000A":["SQ","SegmentIdentificationSequence"],"000B":["US","ReferencedSegmentNumber"],"000C":["US","RecommendedDisplayGrayscaleValue"],"000D":["US","RecommendedDisplayCIELabValue"],"000E":["US","MaximumFractionalValue"],"000F":["SQ","SegmentedPropertyTypeCodeSequence"],
|
|
584
|
-
"0010":["CS","SegmentationFractionalType"]},"0064":{"0002":["SQ","DeformableRegistrationSequence"],"0003":["UI","SourceFrameOfReferenceUID"],"0005":["SQ","DeformableRegistrationGridSequence"],"0007":["UL","GridDimensions"],"0008":["FD","GridResolution"],"0009":["OF","VectorGridData"],"000F":["SQ","PreDeformationMatrixRegistrationSequence"],"0010":["SQ","PostDeformationMatrixRegistrationSequence"]},"0066":{"0001":["UL","NumberOfSurfaces"],"0002":["SQ","SurfaceSequence"],"0003":["UL","SurfaceNumber"],
|
|
585
|
-
"0004":["LT","SurfaceComments"],"0009":["CS","SurfaceProcessing"],"000A":["FL","SurfaceProcessingRatio"],"000B":["LO","SurfaceProcessingDescription"],"000C":["FL","RecommendedPresentationOpacity"],"000D":["CS","RecommendedPresentationType"],"000E":["CS","FiniteVolume"],"0010":["CS","Manifold"],"0011":["SQ","SurfacePointsSequence"],"0012":["SQ","SurfacePointsNormalsSequence"],"0013":["SQ","SurfaceMeshPrimitivesSequence"],"0015":["UL","NumberOfSurfacePoints"],"0016":["OF","PointCoordinatesData"],"0017":["FL",
|
|
586
|
-
"PointPositionAccuracy"],"0018":["FL","MeanPointDistance"],"0019":["FL","MaximumPointDistance"],"001A":["FL","PointsBoundingBoxCoordinates"],"001B":["FL","AxisOfRotation"],"001C":["FL","CenterOfRotation"],"001E":["UL","NumberOfVectors"],"001F":["US","VectorDimensionality"],"0020":["FL","VectorAccuracy"],"0021":["OF","VectorCoordinateData"],"0023":["OW","TrianglePointIndexList"],"0024":["OW","EdgePointIndexList"],"0025":["OW","VertexPointIndexList"],"0026":["SQ","TriangleStripSequence"],"0027":["SQ",
|
|
587
|
-
"TriangleFanSequence"],"0028":["SQ","LineSequence"],"0029":["OW","PrimitivePointIndexList"],"002A":["UL","SurfaceCount"],"002B":["SQ","ReferencedSurfaceSequence"],"002C":["UL","ReferencedSurfaceNumber"],"002D":["SQ","SegmentSurfaceGenerationAlgorithmIdentificationSequence"],"002E":["SQ","SegmentSurfaceSourceInstanceSequence"],"002F":["SQ","AlgorithmFamilyCodeSequence"],"0030":["SQ","AlgorithmNameCodeSequence"],"0031":["LO","AlgorithmVersion"],"0032":["LT","AlgorithmParameters"],"0034":["SQ","FacetSequence"],
|
|
588
|
-
"0035":["SQ","SurfaceProcessingAlgorithmIdentificationSequence"],"0036":["LO","AlgorithmName"]},"0068":{6210:["LO","ImplantSize"],6221:["LO","ImplantTemplateVersion"],6222:["SQ","ReplacedImplantTemplateSequence"],6223:["CS","ImplantType"],6224:["SQ","DerivationImplantTemplateSequence"],6225:["SQ","OriginalImplantTemplateSequence"],6226:["DT","EffectiveDateTime"],6230:["SQ","ImplantTargetAnatomySequence"],6260:["SQ","InformationFromManufacturerSequence"],6265:["SQ","NotificationFromManufacturerSequence"],
|
|
589
|
-
6270:["DT","InformationIssueDateTime"],6280:["ST","InformationSummary"],"62A0":["SQ","ImplantRegulatoryDisapprovalCodeSequence"],"62A5":["FD","OverallTemplateSpatialTolerance"],"62C0":["SQ","HPGLDocumentSequence"],"62D0":["US","HPGLDocumentID"],"62D5":["LO","HPGLDocumentLabel"],"62E0":["SQ","ViewOrientationCodeSequence"],"62F0":["FD","ViewOrientationModifier"],"62F2":["FD","HPGLDocumentScaling"],6300:["OB","HPGLDocument"],6310:["US","HPGLContourPenNumber"],6320:["SQ","HPGLPenSequence"],6330:["US",
|
|
590
|
-
"HPGLPenNumber"],6340:["LO","HPGLPenLabel"],6345:["ST","HPGLPenDescription"],6346:["FD","RecommendedRotationPoint"],6347:["FD","BoundingRectangle"],6350:["US","ImplantTemplate3DModelSurfaceNumber"],6360:["SQ","SurfaceModelDescriptionSequence"],6380:["LO","SurfaceModelLabel"],6390:["FD","SurfaceModelScalingFactor"],"63A0":["SQ","MaterialsCodeSequence"],"63A4":["SQ","CoatingMaterialsCodeSequence"],"63A8":["SQ","ImplantTypeCodeSequence"],"63AC":["SQ","FixationMethodCodeSequence"],"63B0":["SQ","MatingFeatureSetsSequence"],
|
|
591
|
-
"63C0":["US","MatingFeatureSetID"],"63D0":["LO","MatingFeatureSetLabel"],"63E0":["SQ","MatingFeatureSequence"],"63F0":["US","MatingFeatureID"],6400:["SQ","MatingFeatureDegreeOfFreedomSequence"],6410:["US","DegreeOfFreedomID"],6420:["CS","DegreeOfFreedomType"],6430:["SQ","TwoDMatingFeatureCoordinatesSequence"],6440:["US","ReferencedHPGLDocumentID"],6450:["FD","TwoDMatingPoint"],6460:["FD","TwoDMatingAxes"],6470:["SQ","TwoDDegreeOfFreedomSequence"],6490:["FD","ThreeDDegreeOfFreedomAxis"],"64A0":["FD",
|
|
592
|
-
"RangeOfFreedom"],"64C0":["FD","ThreeDMatingPoint"],"64D0":["FD","ThreeDMatingAxes"],"64F0":["FD","TwoDDegreeOfFreedomAxis"],6500:["SQ","PlanningLandmarkPointSequence"],6510:["SQ","PlanningLandmarkLineSequence"],6520:["SQ","PlanningLandmarkPlaneSequence"],6530:["US","PlanningLandmarkID"],6540:["LO","PlanningLandmarkDescription"],6545:["SQ","PlanningLandmarkIdentificationCodeSequence"],6550:["SQ","TwoDPointCoordinatesSequence"],6560:["FD","TwoDPointCoordinates"],6590:["FD","ThreeDPointCoordinates"],
|
|
593
|
-
"65A0":["SQ","TwoDLineCoordinatesSequence"],"65B0":["FD","TwoDLineCoordinates"],"65D0":["FD","ThreeDLineCoordinates"],"65E0":["SQ","TwoDPlaneCoordinatesSequence"],"65F0":["FD","TwoDPlaneIntersection"],6610:["FD","ThreeDPlaneOrigin"],6620:["FD","ThreeDPlaneNormal"]},"0070":{"0001":["SQ","GraphicAnnotationSequence"],"0002":["CS","GraphicLayer"],"0003":["CS","BoundingBoxAnnotationUnits"],"0004":["CS","AnchorPointAnnotationUnits"],"0005":["CS","GraphicAnnotationUnits"],"0006":["ST","UnformattedTextValue"],
|
|
594
|
-
"0008":["SQ","TextObjectSequence"],"0009":["SQ","GraphicObjectSequence"],"0010":["FL","BoundingBoxTopLeftHandCorner"],"0011":["FL","BoundingBoxBottomRightHandCorner"],"0012":["CS","BoundingBoxTextHorizontalJustification"],"0014":["FL","AnchorPoint"],"0015":["CS","AnchorPointVisibility"],"0020":["US","GraphicDimensions"],"0021":["US","NumberOfGraphicPoints"],"0022":["FL","GraphicData"],"0023":["CS","GraphicType"],"0024":["CS","GraphicFilled"],"0040":["IS","ImageRotationRetired"],"0041":["CS","ImageHorizontalFlip"],
|
|
595
|
-
"0042":["US","ImageRotation"],"0050":["US","DisplayedAreaTopLeftHandCornerTrial"],"0051":["US","DisplayedAreaBottomRightHandCornerTrial"],"0052":["SL","DisplayedAreaTopLeftHandCorner"],"0053":["SL","DisplayedAreaBottomRightHandCorner"],"005A":["SQ","DisplayedAreaSelectionSequence"],"0060":["SQ","GraphicLayerSequence"],"0062":["IS","GraphicLayerOrder"],"0066":["US","GraphicLayerRecommendedDisplayGrayscaleValue"],"0067":["US","GraphicLayerRecommendedDisplayRGBValue"],"0068":["LO","GraphicLayerDescription"],
|
|
596
|
-
"0080":["CS","ContentLabel"],"0081":["LO","ContentDescription"],"0082":["DA","PresentationCreationDate"],"0083":["TM","PresentationCreationTime"],"0084":["PN","ContentCreatorName"],"0086":["SQ","ContentCreatorIdentificationCodeSequence"],"0087":["SQ","AlternateContentDescriptionSequence"],"0100":["CS","PresentationSizeMode"],"0101":["DS","PresentationPixelSpacing"],"0102":["IS","PresentationPixelAspectRatio"],"0103":["FL","PresentationPixelMagnificationRatio"],"0207":["LO","GraphicGroupLabel"],"0208":["ST",
|
|
597
|
-
"GraphicGroupDescription"],"0209":["SQ","CompoundGraphicSequence"],"0226":["UL","CompoundGraphicInstanceID"],"0227":["LO","FontName"],"0228":["CS","FontNameType"],"0229":["LO","CSSFontName"],"0230":["FD","RotationAngle"],"0231":["SQ","TextStyleSequence"],"0232":["SQ","LineStyleSequence"],"0233":["SQ","FillStyleSequence"],"0234":["SQ","GraphicGroupSequence"],"0241":["US","TextColorCIELabValue"],"0242":["CS","HorizontalAlignment"],"0243":["CS","VerticalAlignment"],"0244":["CS","ShadowStyle"],"0245":["FL",
|
|
598
|
-
"ShadowOffsetX"],"0246":["FL","ShadowOffsetY"],"0247":["US","ShadowColorCIELabValue"],"0248":["CS","Underlined"],"0249":["CS","Bold"],"0250":["CS","Italic"],"0251":["US","PatternOnColorCIELabValue"],"0252":["US","PatternOffColorCIELabValue"],"0253":["FL","LineThickness"],"0254":["CS","LineDashingStyle"],"0255":["UL","LinePattern"],"0256":["OB","FillPattern"],"0257":["CS","FillMode"],"0258":["FL","ShadowOpacity"],"0261":["FL","GapLength"],"0262":["FL","DiameterOfVisibility"],"0273":["FL","RotationPoint"],
|
|
599
|
-
"0274":["CS","TickAlignment"],"0278":["CS","ShowTickLabel"],"0279":["CS","TickLabelAlignment"],"0282":["CS","CompoundGraphicUnits"],"0284":["FL","PatternOnOpacity"],"0285":["FL","PatternOffOpacity"],"0287":["SQ","MajorTicksSequence"],"0288":["FL","TickPosition"],"0289":["SH","TickLabel"],"0294":["CS","CompoundGraphicType"],"0295":["UL","GraphicGroupID"],"0306":["CS","ShapeType"],"0308":["SQ","RegistrationSequence"],"0309":["SQ","MatrixRegistrationSequence"],"030A":["SQ","MatrixSequence"],"030C":["CS",
|
|
600
|
-
"FrameOfReferenceTransformationMatrixType"],"030D":["SQ","RegistrationTypeCodeSequence"],"030F":["ST","FiducialDescription"],"0310":["SH","FiducialIdentifier"],"0311":["SQ","FiducialIdentifierCodeSequence"],"0312":["FD","ContourUncertaintyRadius"],"0314":["SQ","UsedFiducialsSequence"],"0318":["SQ","GraphicCoordinatesDataSequence"],"031A":["UI","FiducialUID"],"031C":["SQ","FiducialSetSequence"],"031E":["SQ","FiducialSequence"],"0401":["US","GraphicLayerRecommendedDisplayCIELabValue"],"0402":["SQ",
|
|
601
|
-
"BlendingSequence"],"0403":["FL","RelativeOpacity"],"0404":["SQ","ReferencedSpatialRegistrationSequence"],"0405":["CS","BlendingPosition"]},"0072":{"0002":["SH","HangingProtocolName"],"0004":["LO","HangingProtocolDescription"],"0006":["CS","HangingProtocolLevel"],"0008":["LO","HangingProtocolCreator"],"000A":["DT","HangingProtocolCreationDateTime"],"000C":["SQ","HangingProtocolDefinitionSequence"],"000E":["SQ","HangingProtocolUserIdentificationCodeSequence"],"0010":["LO","HangingProtocolUserGroupName"],
|
|
602
|
-
"0012":["SQ","SourceHangingProtocolSequence"],"0014":["US","NumberOfPriorsReferenced"],"0020":["SQ","ImageSetsSequence"],"0022":["SQ","ImageSetSelectorSequence"],"0024":["CS","ImageSetSelectorUsageFlag"],"0026":["AT","SelectorAttribute"],"0028":["US","SelectorValueNumber"],"0030":["SQ","TimeBasedImageSetsSequence"],"0032":["US","ImageSetNumber"],"0034":["CS","ImageSetSelectorCategory"],"0038":["US","RelativeTime"],"003A":["CS","RelativeTimeUnits"],"003C":["SS","AbstractPriorValue"],"003E":["SQ","AbstractPriorCodeSequence"],
|
|
603
|
-
"0040":["LO","ImageSetLabel"],"0050":["CS","SelectorAttributeVR"],"0052":["AT","SelectorSequencePointer"],"0054":["LO","SelectorSequencePointerPrivateCreator"],"0056":["LO","SelectorAttributePrivateCreator"],"0060":["AT","SelectorATValue"],"0062":["CS","SelectorCSValue"],"0064":["IS","SelectorISValue"],"0066":["LO","SelectorLOValue"],"0068":["LT","SelectorLTValue"],"006A":["PN","SelectorPNValue"],"006C":["SH","SelectorSHValue"],"006E":["ST","SelectorSTValue"],"0070":["UT","SelectorUTValue"],"0072":["DS",
|
|
604
|
-
"SelectorDSValue"],"0074":["FD","SelectorFDValue"],"0076":["FL","SelectorFLValue"],"0078":["UL","SelectorULValue"],"007A":["US","SelectorUSValue"],"007C":["SL","SelectorSLValue"],"007E":["SS","SelectorSSValue"],"0080":["SQ","SelectorCodeSequenceValue"],"0100":["US","NumberOfScreens"],"0102":["SQ","NominalScreenDefinitionSequence"],"0104":["US","NumberOfVerticalPixels"],"0106":["US","NumberOfHorizontalPixels"],"0108":["FD","DisplayEnvironmentSpatialPosition"],"010A":["US","ScreenMinimumGrayscaleBitDepth"],
|
|
605
|
-
"010C":["US","ScreenMinimumColorBitDepth"],"010E":["US","ApplicationMaximumRepaintTime"],"0200":["SQ","DisplaySetsSequence"],"0202":["US","DisplaySetNumber"],"0203":["LO","DisplaySetLabel"],"0204":["US","DisplaySetPresentationGroup"],"0206":["LO","DisplaySetPresentationGroupDescription"],"0208":["CS","PartialDataDisplayHandling"],"0210":["SQ","SynchronizedScrollingSequence"],"0212":["US","DisplaySetScrollingGroup"],"0214":["SQ","NavigationIndicatorSequence"],"0216":["US","NavigationDisplaySet"],"0218":["US",
|
|
606
|
-
"ReferenceDisplaySets"],"0300":["SQ","ImageBoxesSequence"],"0302":["US","ImageBoxNumber"],"0304":["CS","ImageBoxLayoutType"],"0306":["US","ImageBoxTileHorizontalDimension"],"0308":["US","ImageBoxTileVerticalDimension"],"0310":["CS","ImageBoxScrollDirection"],"0312":["CS","ImageBoxSmallScrollType"],"0314":["US","ImageBoxSmallScrollAmount"],"0316":["CS","ImageBoxLargeScrollType"],"0318":["US","ImageBoxLargeScrollAmount"],"0320":["US","ImageBoxOverlapPriority"],"0330":["FD","CineRelativeToRealTime"],
|
|
607
|
-
"0400":["SQ","FilterOperationsSequence"],"0402":["CS","FilterByCategory"],"0404":["CS","FilterByAttributePresence"],"0406":["CS","FilterByOperator"],"0420":["US","StructuredDisplayBackgroundCIELabValue"],"0421":["US","EmptyImageBoxCIELabValue"],"0422":["SQ","StructuredDisplayImageBoxSequence"],"0424":["SQ","StructuredDisplayTextBoxSequence"],"0427":["SQ","ReferencedFirstFrameSequence"],"0430":["SQ","ImageBoxSynchronizationSequence"],"0432":["US","SynchronizedImageBoxList"],"0434":["CS","TypeOfSynchronization"],
|
|
608
|
-
"0500":["CS","BlendingOperationType"],"0510":["CS","ReformattingOperationType"],"0512":["FD","ReformattingThickness"],"0514":["FD","ReformattingInterval"],"0516":["CS","ReformattingOperationInitialViewDirection"],"0520":["CS","ThreeDRenderingType"],"0600":["SQ","SortingOperationsSequence"],"0602":["CS","SortByCategory"],"0604":["CS","SortingDirection"],"0700":["CS","DisplaySetPatientOrientation"],"0702":["CS","VOIType"],"0704":["CS","PseudoColorType"],"0705":["SQ","PseudoColorPaletteInstanceReferenceSequence"],
|
|
609
|
-
"0706":["CS","ShowGrayscaleInverted"],"0710":["CS","ShowImageTrueSizeFlag"],"0712":["CS","ShowGraphicAnnotationFlag"],"0714":["CS","ShowPatientDemographicsFlag"],"0716":["CS","ShowAcquisitionTechniquesFlag"],"0717":["CS","DisplaySetHorizontalJustification"],"0718":["CS","DisplaySetVerticalJustification"]},"0074":{"0120":["FD","ContinuationStartMeterset"],"0121":["FD","ContinuationEndMeterset"],1E3:["CS","ProcedureStepState"],1002:["SQ","ProcedureStepProgressInformationSequence"],1004:["DS","ProcedureStepProgress"],
|
|
610
|
-
1006:["ST","ProcedureStepProgressDescription"],1008:["SQ","ProcedureStepCommunicationsURISequence"],"100A":["ST","ContactURI"],"100C":["LO","ContactDisplayName"],"100E":["SQ","ProcedureStepDiscontinuationReasonCodeSequence"],1020:["SQ","BeamTaskSequence"],1022:["CS","BeamTaskType"],1024:["IS","BeamOrderIndexTrial"],1026:["FD","TableTopVerticalAdjustedPosition"],1027:["FD","TableTopLongitudinalAdjustedPosition"],1028:["FD","TableTopLateralAdjustedPosition"],"102A":["FD","PatientSupportAdjustedAngle"],
|
|
611
|
-
"102B":["FD","TableTopEccentricAdjustedAngle"],"102C":["FD","TableTopPitchAdjustedAngle"],"102D":["FD","TableTopRollAdjustedAngle"],1030:["SQ","DeliveryVerificationImageSequence"],1032:["CS","VerificationImageTiming"],1034:["CS","DoubleExposureFlag"],1036:["CS","DoubleExposureOrdering"],1038:["DS","DoubleExposureMetersetTrial"],"103A":["DS","DoubleExposureFieldDeltaTrial"],1040:["SQ","RelatedReferenceRTImageSequence"],1042:["SQ","GeneralMachineVerificationSequence"],1044:["SQ","ConventionalMachineVerificationSequence"],
|
|
612
|
-
1046:["SQ","IonMachineVerificationSequence"],1048:["SQ","FailedAttributesSequence"],"104A":["SQ","OverriddenAttributesSequence"],"104C":["SQ","ConventionalControlPointVerificationSequence"],"104E":["SQ","IonControlPointVerificationSequence"],1050:["SQ","AttributeOccurrenceSequence"],1052:["AT","AttributeOccurrencePointer"],1054:["UL","AttributeItemSelector"],1056:["LO","AttributeOccurrencePrivateCreator"],1057:["IS","SelectorSequencePointerItems"],1200:["CS","ScheduledProcedureStepPriority"],1202:["LO",
|
|
613
|
-
"WorklistLabel"],1204:["LO","ProcedureStepLabel"],1210:["SQ","ScheduledProcessingParametersSequence"],1212:["SQ","PerformedProcessingParametersSequence"],1216:["SQ","UnifiedProcedureStepPerformedProcedureSequence"],1220:["SQ","RelatedProcedureStepSequence"],1222:["LO","ProcedureStepRelationshipType"],1224:["SQ","ReplacedProcedureStepSequence"],1230:["LO","DeletionLock"],1234:["AE","ReceivingAE"],1236:["AE","RequestingAE"],1238:["LT","ReasonForCancellation"],1242:["CS","SCPStatus"],1244:["CS","SubscriptionListStatus"],
|
|
614
|
-
1246:["CS","UnifiedProcedureStepListStatus"],1324:["UL","BeamOrderIndex"],1338:["FD","DoubleExposureMeterset"],"133A":["FD","DoubleExposureFieldDelta"]},"0076":{"0001":["LO","ImplantAssemblyTemplateName"],"0003":["LO","ImplantAssemblyTemplateIssuer"],"0006":["LO","ImplantAssemblyTemplateVersion"],"0008":["SQ","ReplacedImplantAssemblyTemplateSequence"],"000A":["CS","ImplantAssemblyTemplateType"],"000C":["SQ","OriginalImplantAssemblyTemplateSequence"],"000E":["SQ","DerivationImplantAssemblyTemplateSequence"],
|
|
615
|
-
"0010":["SQ","ImplantAssemblyTemplateTargetAnatomySequence"],"0020":["SQ","ProcedureTypeCodeSequence"],"0030":["LO","SurgicalTechnique"],"0032":["SQ","ComponentTypesSequence"],"0034":["CS","ComponentTypeCodeSequence"],"0036":["CS","ExclusiveComponentType"],"0038":["CS","MandatoryComponentType"],"0040":["SQ","ComponentSequence"],"0055":["US","ComponentID"],"0060":["SQ","ComponentAssemblySequence"],"0070":["US","Component1ReferencedID"],"0080":["US","Component1ReferencedMatingFeatureSetID"],"0090":["US",
|
|
616
|
-
"Component1ReferencedMatingFeatureID"],"00A0":["US","Component2ReferencedID"],"00B0":["US","Component2ReferencedMatingFeatureSetID"],"00C0":["US","Component2ReferencedMatingFeatureID"]},"0078":{"0001":["LO","ImplantTemplateGroupName"],"0010":["ST","ImplantTemplateGroupDescription"],"0020":["LO","ImplantTemplateGroupIssuer"],"0024":["LO","ImplantTemplateGroupVersion"],"0026":["SQ","ReplacedImplantTemplateGroupSequence"],"0028":["SQ","ImplantTemplateGroupTargetAnatomySequence"],"002A":["SQ","ImplantTemplateGroupMembersSequence"],
|
|
617
|
-
"002E":["US","ImplantTemplateGroupMemberID"],"0050":["FD","ThreeDImplantTemplateGroupMemberMatchingPoint"],"0060":["FD","ThreeDImplantTemplateGroupMemberMatchingAxes"],"0070":["SQ","ImplantTemplateGroupMemberMatching2DCoordinatesSequence"],"0090":["FD","TwoDImplantTemplateGroupMemberMatchingPoint"],"00A0":["FD","TwoDImplantTemplateGroupMemberMatchingAxes"],"00B0":["SQ","ImplantTemplateGroupVariationDimensionSequence"],"00B2":["LO","ImplantTemplateGroupVariationDimensionName"],"00B4":["SQ","ImplantTemplateGroupVariationDimensionRankSequence"],
|
|
618
|
-
"00B6":["US","ReferencedImplantTemplateGroupMemberID"],"00B8":["US","ImplantTemplateGroupVariationDimensionRank"]},"0088":{"0130":["SH","StorageMediaFileSetID"],"0140":["UI","StorageMediaFileSetUID"],"0200":["SQ","IconImageSequence"],"0904":["LO","TopicTitle"],"0906":["ST","TopicSubject"],"0910":["LO","TopicAuthor"],"0912":["LO","TopicKeywords"]},"0100":{"0410":["CS","SOPInstanceStatus"],"0420":["DT","SOPAuthorizationDateTime"],"0424":["LT","SOPAuthorizationComment"],"0426":["LO","AuthorizationEquipmentCertificationNumber"]},
|
|
619
|
-
"0400":{"0005":["US","MACIDNumber"],"0010":["UI","MACCalculationTransferSyntaxUID"],"0015":["CS","MACAlgorithm"],"0020":["AT","DataElementsSigned"],"0100":["UI","DigitalSignatureUID"],"0105":["DT","DigitalSignatureDateTime"],"0110":["CS","CertificateType"],"0115":["OB","CertificateOfSigner"],"0120":["OB","Signature"],"0305":["CS","CertifiedTimestampType"],"0310":["OB","CertifiedTimestamp"],"0401":["SQ","DigitalSignaturePurposeCodeSequence"],"0402":["SQ","ReferencedDigitalSignatureSequence"],"0403":["SQ",
|
|
620
|
-
"ReferencedSOPInstanceMACSequence"],"0404":["OB","MAC"],"0500":["SQ","EncryptedAttributesSequence"],"0510":["UI","EncryptedContentTransferSyntaxUID"],"0520":["OB","EncryptedContent"],"0550":["SQ","ModifiedAttributesSequence"],"0561":["SQ","OriginalAttributesSequence"],"0562":["DT","AttributeModificationDateTime"],"0563":["LO","ModifyingSystem"],"0564":["LO","SourceOfPreviousValues"],"0565":["CS","ReasonForTheAttributeModification"]},2E3:{"0010":["IS","NumberOfCopies"],"001E":["SQ","PrinterConfigurationSequence"],
|
|
621
|
-
"0020":["CS","PrintPriority"],"0030":["CS","MediumType"],"0040":["CS","FilmDestination"],"0050":["LO","FilmSessionLabel"],"0060":["IS","MemoryAllocation"],"0061":["IS","MaximumMemoryAllocation"],"0062":["CS","ColorImagePrintingFlag"],"0063":["CS","CollationFlag"],"0065":["CS","AnnotationFlag"],"0067":["CS","ImageOverlayFlag"],"0069":["CS","PresentationLUTFlag"],"006A":["CS","ImageBoxPresentationLUTFlag"],"00A0":["US","MemoryBitDepth"],"00A1":["US","PrintingBitDepth"],"00A2":["SQ","MediaInstalledSequence"],
|
|
622
|
-
"00A4":["SQ","OtherMediaAvailableSequence"],"00A8":["SQ","SupportedImageDisplayFormatsSequence"],"0500":["SQ","ReferencedFilmBoxSequence"],"0510":["SQ","ReferencedStoredPrintSequence"]},2010:{"0010":["ST","ImageDisplayFormat"],"0030":["CS","AnnotationDisplayFormatID"],"0040":["CS","FilmOrientation"],"0050":["CS","FilmSizeID"],"0052":["CS","PrinterResolutionID"],"0054":["CS","DefaultPrinterResolutionID"],"0060":["CS","MagnificationType"],"0080":["CS","SmoothingType"],"00A6":["CS","DefaultMagnificationType"],
|
|
623
|
-
"00A7":["CS","OtherMagnificationTypesAvailable"],"00A8":["CS","DefaultSmoothingType"],"00A9":["CS","OtherSmoothingTypesAvailable"],"0100":["CS","BorderDensity"],"0110":["CS","EmptyImageDensity"],"0120":["US","MinDensity"],"0130":["US","MaxDensity"],"0140":["CS","Trim"],"0150":["ST","ConfigurationInformation"],"0152":["LT","ConfigurationInformationDescription"],"0154":["IS","MaximumCollatedFilms"],"015E":["US","Illumination"],"0160":["US","ReflectedAmbientLight"],"0376":["DS","PrinterPixelSpacing"],
|
|
624
|
-
"0500":["SQ","ReferencedFilmSessionSequence"],"0510":["SQ","ReferencedImageBoxSequence"],"0520":["SQ","ReferencedBasicAnnotationBoxSequence"]},2020:{"0010":["US","ImageBoxPosition"],"0020":["CS","Polarity"],"0030":["DS","RequestedImageSize"],"0040":["CS","RequestedDecimateCropBehavior"],"0050":["CS","RequestedResolutionID"],"00A0":["CS","RequestedImageSizeFlag"],"00A2":["CS","DecimateCropResult"],"0110":["SQ","BasicGrayscaleImageSequence"],"0111":["SQ","BasicColorImageSequence"],"0130":["SQ","ReferencedImageOverlayBoxSequence"],
|
|
625
|
-
"0140":["SQ","ReferencedVOILUTBoxSequence"]},2030:{"0010":["US","AnnotationPosition"],"0020":["LO","TextString"]},2040:{"0010":["SQ","ReferencedOverlayPlaneSequence"],"0011":["US","ReferencedOverlayPlaneGroups"],"0020":["SQ","OverlayPixelDataSequence"],"0060":["CS","OverlayMagnificationType"],"0070":["CS","OverlaySmoothingType"],"0072":["CS","OverlayOrImageMagnification"],"0074":["US","MagnifyToNumberOfColumns"],"0080":["CS","OverlayForegroundDensity"],"0082":["CS","OverlayBackgroundDensity"],"0090":["CS",
|
|
626
|
-
"OverlayMode"],"0100":["CS","ThresholdDensity"],"0500":["SQ","ReferencedImageBoxSequenceRetired"]},2050:{"0010":["SQ","PresentationLUTSequence"],"0020":["CS","PresentationLUTShape"],"0500":["SQ","ReferencedPresentationLUTSequence"]},2100:{"0010":["SH","PrintJobID"],"0020":["CS","ExecutionStatus"],"0030":["CS","ExecutionStatusInfo"],"0040":["DA","CreationDate"],"0050":["TM","CreationTime"],"0070":["AE","Originator"],"0140":["AE","DestinationAE"],"0160":["SH","OwnerID"],"0170":["IS","NumberOfFilms"],
|
|
627
|
-
"0500":["SQ","ReferencedPrintJobSequencePullStoredPrint"]},2110:{"0010":["CS","PrinterStatus"],"0020":["CS","PrinterStatusInfo"],"0030":["LO","PrinterName"],"0099":["SH","PrintQueueID"]},2120:{"0010":["CS","QueueStatus"],"0050":["SQ","PrintJobDescriptionSequence"],"0070":["SQ","ReferencedPrintJobSequence"]},2130:{"0010":["SQ","PrintManagementCapabilitiesSequence"],"0015":["SQ","PrinterCharacteristicsSequence"],"0030":["SQ","FilmBoxContentSequence"],"0040":["SQ","ImageBoxContentSequence"],"0050":["SQ",
|
|
628
|
-
"AnnotationContentSequence"],"0060":["SQ","ImageOverlayBoxContentSequence"],"0080":["SQ","PresentationLUTContentSequence"],"00A0":["SQ","ProposedStudySequence"],"00C0":["SQ","OriginalImageSequence"]},2200:{"0001":["CS","LabelUsingInformationExtractedFromInstances"],"0002":["UT","LabelText"],"0003":["CS","LabelStyleSelection"],"0004":["LT","MediaDisposition"],"0005":["LT","BarcodeValue"],"0006":["CS","BarcodeSymbology"],"0007":["CS","AllowMediaSplitting"],"0008":["CS","IncludeNonDICOMObjects"],"0009":["CS",
|
|
629
|
-
"IncludeDisplayApplication"],"000A":["CS","PreserveCompositeInstancesAfterMediaCreation"],"000B":["US","TotalNumberOfPiecesOfMediaCreated"],"000C":["LO","RequestedMediaApplicationProfile"],"000D":["SQ","ReferencedStorageMediaSequence"],"000E":["AT","FailureAttributes"],"000F":["CS","AllowLossyCompression"],"0020":["CS","RequestPriority"]},3002:{"0002":["SH","RTImageLabel"],"0003":["LO","RTImageName"],"0004":["ST","RTImageDescription"],"000A":["CS","ReportedValuesOrigin"],"000C":["CS","RTImagePlane"],
|
|
630
|
-
"000D":["DS","XRayImageReceptorTranslation"],"000E":["DS","XRayImageReceptorAngle"],"0010":["DS","RTImageOrientation"],"0011":["DS","ImagePlanePixelSpacing"],"0012":["DS","RTImagePosition"],"0020":["SH","RadiationMachineName"],"0022":["DS","RadiationMachineSAD"],"0024":["DS","RadiationMachineSSD"],"0026":["DS","RTImageSID"],"0028":["DS","SourceToReferenceObjectDistance"],"0029":["IS","FractionNumber"],"0030":["SQ","ExposureSequence"],"0032":["DS","MetersetExposure"],"0034":["DS","DiaphragmPosition"],
|
|
631
|
-
"0040":["SQ","FluenceMapSequence"],"0041":["CS","FluenceDataSource"],"0042":["DS","FluenceDataScale"],"0050":["SQ","PrimaryFluenceModeSequence"],"0051":["CS","FluenceMode"],"0052":["SH","FluenceModeID"]},3004:{"0001":["CS","DVHType"],"0002":["CS","DoseUnits"],"0004":["CS","DoseType"],"0006":["LO","DoseComment"],"0008":["DS","NormalizationPoint"],"000A":["CS","DoseSummationType"],"000C":["DS","GridFrameOffsetVector"],"000E":["DS","DoseGridScaling"],"0010":["SQ","RTDoseROISequence"],"0012":["DS","DoseValue"],
|
|
632
|
-
"0014":["CS","TissueHeterogeneityCorrection"],"0040":["DS","DVHNormalizationPoint"],"0042":["DS","DVHNormalizationDoseValue"],"0050":["SQ","DVHSequence"],"0052":["DS","DVHDoseScaling"],"0054":["CS","DVHVolumeUnits"],"0056":["IS","DVHNumberOfBins"],"0058":["DS","DVHData"],"0060":["SQ","DVHReferencedROISequence"],"0062":["CS","DVHROIContributionType"],"0070":["DS","DVHMinimumDose"],"0072":["DS","DVHMaximumDose"],"0074":["DS","DVHMeanDose"]},3006:{"0002":["SH","StructureSetLabel"],"0004":["LO","StructureSetName"],
|
|
633
|
-
"0006":["ST","StructureSetDescription"],"0008":["DA","StructureSetDate"],"0009":["TM","StructureSetTime"],"0010":["SQ","ReferencedFrameOfReferenceSequence"],"0012":["SQ","RTReferencedStudySequence"],"0014":["SQ","RTReferencedSeriesSequence"],"0016":["SQ","ContourImageSequence"],"0020":["SQ","StructureSetROISequence"],"0022":["IS","ROINumber"],"0024":["UI","ReferencedFrameOfReferenceUID"],"0026":["LO","ROIName"],"0028":["ST","ROIDescription"],"002A":["IS","ROIDisplayColor"],"002C":["DS","ROIVolume"],
|
|
634
|
-
"0030":["SQ","RTRelatedROISequence"],"0033":["CS","RTROIRelationship"],"0036":["CS","ROIGenerationAlgorithm"],"0038":["LO","ROIGenerationDescription"],"0039":["SQ","ROIContourSequence"],"0040":["SQ","ContourSequence"],"0042":["CS","ContourGeometricType"],"0044":["DS","ContourSlabThickness"],"0045":["DS","ContourOffsetVector"],"0046":["IS","NumberOfContourPoints"],"0048":["IS","ContourNumber"],"0049":["IS","AttachedContours"],"0050":["DS","ContourData"],"0080":["SQ","RTROIObservationsSequence"],"0082":["IS",
|
|
635
|
-
"ObservationNumber"],"0084":["IS","ReferencedROINumber"],"0085":["SH","ROIObservationLabel"],"0086":["SQ","RTROIIdentificationCodeSequence"],"0088":["ST","ROIObservationDescription"],"00A0":["SQ","RelatedRTROIObservationsSequence"],"00A4":["CS","RTROIInterpretedType"],"00A6":["PN","ROIInterpreter"],"00B0":["SQ","ROIPhysicalPropertiesSequence"],"00B2":["CS","ROIPhysicalProperty"],"00B4":["DS","ROIPhysicalPropertyValue"],"00B6":["SQ","ROIElementalCompositionSequence"],"00B7":["US","ROIElementalCompositionAtomicNumber"],
|
|
636
|
-
"00B8":["FL","ROIElementalCompositionAtomicMassFraction"],"00C0":["SQ","FrameOfReferenceRelationshipSequence"],"00C2":["UI","RelatedFrameOfReferenceUID"],"00C4":["CS","FrameOfReferenceTransformationType"],"00C6":["DS","FrameOfReferenceTransformationMatrix"],"00C8":["LO","FrameOfReferenceTransformationComment"]},3008:{"0010":["SQ","MeasuredDoseReferenceSequence"],"0012":["ST","MeasuredDoseDescription"],"0014":["CS","MeasuredDoseType"],"0016":["DS","MeasuredDoseValue"],"0020":["SQ","TreatmentSessionBeamSequence"],
|
|
637
|
-
"0021":["SQ","TreatmentSessionIonBeamSequence"],"0022":["IS","CurrentFractionNumber"],"0024":["DA","TreatmentControlPointDate"],"0025":["TM","TreatmentControlPointTime"],"002A":["CS","TreatmentTerminationStatus"],"002B":["SH","TreatmentTerminationCode"],"002C":["CS","TreatmentVerificationStatus"],"0030":["SQ","ReferencedTreatmentRecordSequence"],"0032":["DS","SpecifiedPrimaryMeterset"],"0033":["DS","SpecifiedSecondaryMeterset"],"0036":["DS","DeliveredPrimaryMeterset"],"0037":["DS","DeliveredSecondaryMeterset"],
|
|
638
|
-
"003A":["DS","SpecifiedTreatmentTime"],"003B":["DS","DeliveredTreatmentTime"],"0040":["SQ","ControlPointDeliverySequence"],"0041":["SQ","IonControlPointDeliverySequence"],"0042":["DS","SpecifiedMeterset"],"0044":["DS","DeliveredMeterset"],"0045":["FL","MetersetRateSet"],"0046":["FL","MetersetRateDelivered"],"0047":["FL","ScanSpotMetersetsDelivered"],"0048":["DS","DoseRateDelivered"],"0050":["SQ","TreatmentSummaryCalculatedDoseReferenceSequence"],"0052":["DS","CumulativeDoseToDoseReference"],"0054":["DA",
|
|
639
|
-
"FirstTreatmentDate"],"0056":["DA","MostRecentTreatmentDate"],"005A":["IS","NumberOfFractionsDelivered"],"0060":["SQ","OverrideSequence"],"0061":["AT","ParameterSequencePointer"],"0062":["AT","OverrideParameterPointer"],"0063":["IS","ParameterItemIndex"],"0064":["IS","MeasuredDoseReferenceNumber"],"0065":["AT","ParameterPointer"],"0066":["ST","OverrideReason"],"0068":["SQ","CorrectedParameterSequence"],"006A":["FL","CorrectionValue"],"0070":["SQ","CalculatedDoseReferenceSequence"],"0072":["IS","CalculatedDoseReferenceNumber"],
|
|
640
|
-
"0074":["ST","CalculatedDoseReferenceDescription"],"0076":["DS","CalculatedDoseReferenceDoseValue"],"0078":["DS","StartMeterset"],"007A":["DS","EndMeterset"],"0080":["SQ","ReferencedMeasuredDoseReferenceSequence"],"0082":["IS","ReferencedMeasuredDoseReferenceNumber"],"0090":["SQ","ReferencedCalculatedDoseReferenceSequence"],"0092":["IS","ReferencedCalculatedDoseReferenceNumber"],"00A0":["SQ","BeamLimitingDeviceLeafPairsSequence"],"00B0":["SQ","RecordedWedgeSequence"],"00C0":["SQ","RecordedCompensatorSequence"],
|
|
641
|
-
"00D0":["SQ","RecordedBlockSequence"],"00E0":["SQ","TreatmentSummaryMeasuredDoseReferenceSequence"],"00F0":["SQ","RecordedSnoutSequence"],"00F2":["SQ","RecordedRangeShifterSequence"],"00F4":["SQ","RecordedLateralSpreadingDeviceSequence"],"00F6":["SQ","RecordedRangeModulatorSequence"],"0100":["SQ","RecordedSourceSequence"],"0105":["LO","SourceSerialNumber"],"0110":["SQ","TreatmentSessionApplicationSetupSequence"],"0116":["CS","ApplicationSetupCheck"],"0120":["SQ","RecordedBrachyAccessoryDeviceSequence"],
|
|
642
|
-
"0122":["IS","ReferencedBrachyAccessoryDeviceNumber"],"0130":["SQ","RecordedChannelSequence"],"0132":["DS","SpecifiedChannelTotalTime"],"0134":["DS","DeliveredChannelTotalTime"],"0136":["IS","SpecifiedNumberOfPulses"],"0138":["IS","DeliveredNumberOfPulses"],"013A":["DS","SpecifiedPulseRepetitionInterval"],"013C":["DS","DeliveredPulseRepetitionInterval"],"0140":["SQ","RecordedSourceApplicatorSequence"],"0142":["IS","ReferencedSourceApplicatorNumber"],"0150":["SQ","RecordedChannelShieldSequence"],"0152":["IS",
|
|
643
|
-
"ReferencedChannelShieldNumber"],"0160":["SQ","BrachyControlPointDeliveredSequence"],"0162":["DA","SafePositionExitDate"],"0164":["TM","SafePositionExitTime"],"0166":["DA","SafePositionReturnDate"],"0168":["TM","SafePositionReturnTime"],"0200":["CS","CurrentTreatmentStatus"],"0202":["ST","TreatmentStatusComment"],"0220":["SQ","FractionGroupSummarySequence"],"0223":["IS","ReferencedFractionNumber"],"0224":["CS","FractionGroupType"],"0230":["CS","BeamStopperPosition"],"0240":["SQ","FractionStatusSummarySequence"],
|
|
644
|
-
"0250":["DA","TreatmentDate"],"0251":["TM","TreatmentTime"]},"300A":{"0002":["SH","RTPlanLabel"],"0003":["LO","RTPlanName"],"0004":["ST","RTPlanDescription"],"0006":["DA","RTPlanDate"],"0007":["TM","RTPlanTime"],"0009":["LO","TreatmentProtocols"],"000A":["CS","PlanIntent"],"000B":["LO","TreatmentSites"],"000C":["CS","RTPlanGeometry"],"000E":["ST","PrescriptionDescription"],"0010":["SQ","DoseReferenceSequence"],"0012":["IS","DoseReferenceNumber"],"0013":["UI","DoseReferenceUID"],"0014":["CS","DoseReferenceStructureType"],
|
|
645
|
-
"0015":["CS","NominalBeamEnergyUnit"],"0016":["LO","DoseReferenceDescription"],"0018":["DS","DoseReferencePointCoordinates"],"001A":["DS","NominalPriorDose"],"0020":["CS","DoseReferenceType"],"0021":["DS","ConstraintWeight"],"0022":["DS","DeliveryWarningDose"],"0023":["DS","DeliveryMaximumDose"],"0025":["DS","TargetMinimumDose"],"0026":["DS","TargetPrescriptionDose"],"0027":["DS","TargetMaximumDose"],"0028":["DS","TargetUnderdoseVolumeFraction"],"002A":["DS","OrganAtRiskFullVolumeDose"],"002B":["DS",
|
|
646
|
-
"OrganAtRiskLimitDose"],"002C":["DS","OrganAtRiskMaximumDose"],"002D":["DS","OrganAtRiskOverdoseVolumeFraction"],"0040":["SQ","ToleranceTableSequence"],"0042":["IS","ToleranceTableNumber"],"0043":["SH","ToleranceTableLabel"],"0044":["DS","GantryAngleTolerance"],"0046":["DS","BeamLimitingDeviceAngleTolerance"],"0048":["SQ","BeamLimitingDeviceToleranceSequence"],"004A":["DS","BeamLimitingDevicePositionTolerance"],"004B":["FL","SnoutPositionTolerance"],"004C":["DS","PatientSupportAngleTolerance"],"004E":["DS",
|
|
647
|
-
"TableTopEccentricAngleTolerance"],"004F":["FL","TableTopPitchAngleTolerance"],"0050":["FL","TableTopRollAngleTolerance"],"0051":["DS","TableTopVerticalPositionTolerance"],"0052":["DS","TableTopLongitudinalPositionTolerance"],"0053":["DS","TableTopLateralPositionTolerance"],"0055":["CS","RTPlanRelationship"],"0070":["SQ","FractionGroupSequence"],"0071":["IS","FractionGroupNumber"],"0072":["LO","FractionGroupDescription"],"0078":["IS","NumberOfFractionsPlanned"],"0079":["IS","NumberOfFractionPatternDigitsPerDay"],
|
|
648
|
-
"007A":["IS","RepeatFractionCycleLength"],"007B":["LT","FractionPattern"],"0080":["IS","NumberOfBeams"],"0082":["DS","BeamDoseSpecificationPoint"],"0084":["DS","BeamDose"],"0086":["DS","BeamMeterset"],"0088":["FL","BeamDosePointDepth"],"0089":["FL","BeamDosePointEquivalentDepth"],"008A":["FL","BeamDosePointSSD"],"00A0":["IS","NumberOfBrachyApplicationSetups"],"00A2":["DS","BrachyApplicationSetupDoseSpecificationPoint"],"00A4":["DS","BrachyApplicationSetupDose"],"00B0":["SQ","BeamSequence"],"00B2":["SH",
|
|
649
|
-
"TreatmentMachineName"],"00B3":["CS","PrimaryDosimeterUnit"],"00B4":["DS","SourceAxisDistance"],"00B6":["SQ","BeamLimitingDeviceSequence"],"00B8":["CS","RTBeamLimitingDeviceType"],"00BA":["DS","SourceToBeamLimitingDeviceDistance"],"00BB":["FL","IsocenterToBeamLimitingDeviceDistance"],"00BC":["IS","NumberOfLeafJawPairs"],"00BE":["DS","LeafPositionBoundaries"],"00C0":["IS","BeamNumber"],"00C2":["LO","BeamName"],"00C3":["ST","BeamDescription"],"00C4":["CS","BeamType"],"00C6":["CS","RadiationType"],"00C7":["CS",
|
|
650
|
-
"HighDoseTechniqueType"],"00C8":["IS","ReferenceImageNumber"],"00CA":["SQ","PlannedVerificationImageSequence"],"00CC":["LO","ImagingDeviceSpecificAcquisitionParameters"],"00CE":["CS","TreatmentDeliveryType"],"00D0":["IS","NumberOfWedges"],"00D1":["SQ","WedgeSequence"],"00D2":["IS","WedgeNumber"],"00D3":["CS","WedgeType"],"00D4":["SH","WedgeID"],"00D5":["IS","WedgeAngle"],"00D6":["DS","WedgeFactor"],"00D7":["FL","TotalWedgeTrayWaterEquivalentThickness"],"00D8":["DS","WedgeOrientation"],"00D9":["FL",
|
|
651
|
-
"IsocenterToWedgeTrayDistance"],"00DA":["DS","SourceToWedgeTrayDistance"],"00DB":["FL","WedgeThinEdgePosition"],"00DC":["SH","BolusID"],"00DD":["ST","BolusDescription"],"00E0":["IS","NumberOfCompensators"],"00E1":["SH","MaterialID"],"00E2":["DS","TotalCompensatorTrayFactor"],"00E3":["SQ","CompensatorSequence"],"00E4":["IS","CompensatorNumber"],"00E5":["SH","CompensatorID"],"00E6":["DS","SourceToCompensatorTrayDistance"],"00E7":["IS","CompensatorRows"],"00E8":["IS","CompensatorColumns"],"00E9":["DS",
|
|
652
|
-
"CompensatorPixelSpacing"],"00EA":["DS","CompensatorPosition"],"00EB":["DS","CompensatorTransmissionData"],"00EC":["DS","CompensatorThicknessData"],"00ED":["IS","NumberOfBoli"],"00EE":["CS","CompensatorType"],"00F0":["IS","NumberOfBlocks"],"00F2":["DS","TotalBlockTrayFactor"],"00F3":["FL","TotalBlockTrayWaterEquivalentThickness"],"00F4":["SQ","BlockSequence"],"00F5":["SH","BlockTrayID"],"00F6":["DS","SourceToBlockTrayDistance"],"00F7":["FL","IsocenterToBlockTrayDistance"],"00F8":["CS","BlockType"],
|
|
653
|
-
"00F9":["LO","AccessoryCode"],"00FA":["CS","BlockDivergence"],"00FB":["CS","BlockMountingPosition"],"00FC":["IS","BlockNumber"],"00FE":["LO","BlockName"],"0100":["DS","BlockThickness"],"0102":["DS","BlockTransmission"],"0104":["IS","BlockNumberOfPoints"],"0106":["DS","BlockData"],"0107":["SQ","ApplicatorSequence"],"0108":["SH","ApplicatorID"],"0109":["CS","ApplicatorType"],"010A":["LO","ApplicatorDescription"],"010C":["DS","CumulativeDoseReferenceCoefficient"],"010E":["DS","FinalCumulativeMetersetWeight"],
|
|
654
|
-
"0110":["IS","NumberOfControlPoints"],"0111":["SQ","ControlPointSequence"],"0112":["IS","ControlPointIndex"],"0114":["DS","NominalBeamEnergy"],"0115":["DS","DoseRateSet"],"0116":["SQ","WedgePositionSequence"],"0118":["CS","WedgePosition"],"011A":["SQ","BeamLimitingDevicePositionSequence"],"011C":["DS","LeafJawPositions"],"011E":["DS","GantryAngle"],"011F":["CS","GantryRotationDirection"],"0120":["DS","BeamLimitingDeviceAngle"],"0121":["CS","BeamLimitingDeviceRotationDirection"],"0122":["DS","PatientSupportAngle"],
|
|
655
|
-
"0123":["CS","PatientSupportRotationDirection"],"0124":["DS","TableTopEccentricAxisDistance"],"0125":["DS","TableTopEccentricAngle"],"0126":["CS","TableTopEccentricRotationDirection"],"0128":["DS","TableTopVerticalPosition"],"0129":["DS","TableTopLongitudinalPosition"],"012A":["DS","TableTopLateralPosition"],"012C":["DS","IsocenterPosition"],"012E":["DS","SurfaceEntryPoint"],"0130":["DS","SourceToSurfaceDistance"],"0134":["DS","CumulativeMetersetWeight"],"0140":["FL","TableTopPitchAngle"],"0142":["CS",
|
|
656
|
-
"TableTopPitchRotationDirection"],"0144":["FL","TableTopRollAngle"],"0146":["CS","TableTopRollRotationDirection"],"0148":["FL","HeadFixationAngle"],"014A":["FL","GantryPitchAngle"],"014C":["CS","GantryPitchRotationDirection"],"014E":["FL","GantryPitchAngleTolerance"],"0180":["SQ","PatientSetupSequence"],"0182":["IS","PatientSetupNumber"],"0183":["LO","PatientSetupLabel"],"0184":["LO","PatientAdditionalPosition"],"0190":["SQ","FixationDeviceSequence"],"0192":["CS","FixationDeviceType"],"0194":["SH",
|
|
657
|
-
"FixationDeviceLabel"],"0196":["ST","FixationDeviceDescription"],"0198":["SH","FixationDevicePosition"],"0199":["FL","FixationDevicePitchAngle"],"019A":["FL","FixationDeviceRollAngle"],"01A0":["SQ","ShieldingDeviceSequence"],"01A2":["CS","ShieldingDeviceType"],"01A4":["SH","ShieldingDeviceLabel"],"01A6":["ST","ShieldingDeviceDescription"],"01A8":["SH","ShieldingDevicePosition"],"01B0":["CS","SetupTechnique"],"01B2":["ST","SetupTechniqueDescription"],"01B4":["SQ","SetupDeviceSequence"],"01B6":["CS",
|
|
658
|
-
"SetupDeviceType"],"01B8":["SH","SetupDeviceLabel"],"01BA":["ST","SetupDeviceDescription"],"01BC":["DS","SetupDeviceParameter"],"01D0":["ST","SetupReferenceDescription"],"01D2":["DS","TableTopVerticalSetupDisplacement"],"01D4":["DS","TableTopLongitudinalSetupDisplacement"],"01D6":["DS","TableTopLateralSetupDisplacement"],"0200":["CS","BrachyTreatmentTechnique"],"0202":["CS","BrachyTreatmentType"],"0206":["SQ","TreatmentMachineSequence"],"0210":["SQ","SourceSequence"],"0212":["IS","SourceNumber"],
|
|
659
|
-
"0214":["CS","SourceType"],"0216":["LO","SourceManufacturer"],"0218":["DS","ActiveSourceDiameter"],"021A":["DS","ActiveSourceLength"],"0222":["DS","SourceEncapsulationNominalThickness"],"0224":["DS","SourceEncapsulationNominalTransmission"],"0226":["LO","SourceIsotopeName"],"0228":["DS","SourceIsotopeHalfLife"],"0229":["CS","SourceStrengthUnits"],"022A":["DS","ReferenceAirKermaRate"],"022B":["DS","SourceStrength"],"022C":["DA","SourceStrengthReferenceDate"],"022E":["TM","SourceStrengthReferenceTime"],
|
|
660
|
-
"0230":["SQ","ApplicationSetupSequence"],"0232":["CS","ApplicationSetupType"],"0234":["IS","ApplicationSetupNumber"],"0236":["LO","ApplicationSetupName"],"0238":["LO","ApplicationSetupManufacturer"],"0240":["IS","TemplateNumber"],"0242":["SH","TemplateType"],"0244":["LO","TemplateName"],"0250":["DS","TotalReferenceAirKerma"],"0260":["SQ","BrachyAccessoryDeviceSequence"],"0262":["IS","BrachyAccessoryDeviceNumber"],"0263":["SH","BrachyAccessoryDeviceID"],"0264":["CS","BrachyAccessoryDeviceType"],"0266":["LO",
|
|
661
|
-
"BrachyAccessoryDeviceName"],"026A":["DS","BrachyAccessoryDeviceNominalThickness"],"026C":["DS","BrachyAccessoryDeviceNominalTransmission"],"0280":["SQ","ChannelSequence"],"0282":["IS","ChannelNumber"],"0284":["DS","ChannelLength"],"0286":["DS","ChannelTotalTime"],"0288":["CS","SourceMovementType"],"028A":["IS","NumberOfPulses"],"028C":["DS","PulseRepetitionInterval"],"0290":["IS","SourceApplicatorNumber"],"0291":["SH","SourceApplicatorID"],"0292":["CS","SourceApplicatorType"],"0294":["LO","SourceApplicatorName"],
|
|
662
|
-
"0296":["DS","SourceApplicatorLength"],"0298":["LO","SourceApplicatorManufacturer"],"029C":["DS","SourceApplicatorWallNominalThickness"],"029E":["DS","SourceApplicatorWallNominalTransmission"],"02A0":["DS","SourceApplicatorStepSize"],"02A2":["IS","TransferTubeNumber"],"02A4":["DS","TransferTubeLength"],"02B0":["SQ","ChannelShieldSequence"],"02B2":["IS","ChannelShieldNumber"],"02B3":["SH","ChannelShieldID"],"02B4":["LO","ChannelShieldName"],"02B8":["DS","ChannelShieldNominalThickness"],"02BA":["DS",
|
|
663
|
-
"ChannelShieldNominalTransmission"],"02C8":["DS","FinalCumulativeTimeWeight"],"02D0":["SQ","BrachyControlPointSequence"],"02D2":["DS","ControlPointRelativePosition"],"02D4":["DS","ControlPoint3DPosition"],"02D6":["DS","CumulativeTimeWeight"],"02E0":["CS","CompensatorDivergence"],"02E1":["CS","CompensatorMountingPosition"],"02E2":["DS","SourceToCompensatorDistance"],"02E3":["FL","TotalCompensatorTrayWaterEquivalentThickness"],"02E4":["FL","IsocenterToCompensatorTrayDistance"],"02E5":["FL","CompensatorColumnOffset"],
|
|
664
|
-
"02E6":["FL","IsocenterToCompensatorDistances"],"02E7":["FL","CompensatorRelativeStoppingPowerRatio"],"02E8":["FL","CompensatorMillingToolDiameter"],"02EA":["SQ","IonRangeCompensatorSequence"],"02EB":["LT","CompensatorDescription"],"0302":["IS","RadiationMassNumber"],"0304":["IS","RadiationAtomicNumber"],"0306":["SS","RadiationChargeState"],"0308":["CS","ScanMode"],"030A":["FL","VirtualSourceAxisDistances"],"030C":["SQ","SnoutSequence"],"030D":["FL","SnoutPosition"],"030F":["SH","SnoutID"],"0312":["IS",
|
|
665
|
-
"NumberOfRangeShifters"],"0314":["SQ","RangeShifterSequence"],"0316":["IS","RangeShifterNumber"],"0318":["SH","RangeShifterID"],"0320":["CS","RangeShifterType"],"0322":["LO","RangeShifterDescription"],"0330":["IS","NumberOfLateralSpreadingDevices"],"0332":["SQ","LateralSpreadingDeviceSequence"],"0334":["IS","LateralSpreadingDeviceNumber"],"0336":["SH","LateralSpreadingDeviceID"],"0338":["CS","LateralSpreadingDeviceType"],"033A":["LO","LateralSpreadingDeviceDescription"],"033C":["FL","LateralSpreadingDeviceWaterEquivalentThickness"],
|
|
666
|
-
"0340":["IS","NumberOfRangeModulators"],"0342":["SQ","RangeModulatorSequence"],"0344":["IS","RangeModulatorNumber"],"0346":["SH","RangeModulatorID"],"0348":["CS","RangeModulatorType"],"034A":["LO","RangeModulatorDescription"],"034C":["SH","BeamCurrentModulationID"],"0350":["CS","PatientSupportType"],"0352":["SH","PatientSupportID"],"0354":["LO","PatientSupportAccessoryCode"],"0356":["FL","FixationLightAzimuthalAngle"],"0358":["FL","FixationLightPolarAngle"],"035A":["FL","MetersetRate"],"0360":["SQ",
|
|
667
|
-
"RangeShifterSettingsSequence"],"0362":["LO","RangeShifterSetting"],"0364":["FL","IsocenterToRangeShifterDistance"],"0366":["FL","RangeShifterWaterEquivalentThickness"],"0370":["SQ","LateralSpreadingDeviceSettingsSequence"],"0372":["LO","LateralSpreadingDeviceSetting"],"0374":["FL","IsocenterToLateralSpreadingDeviceDistance"],"0380":["SQ","RangeModulatorSettingsSequence"],"0382":["FL","RangeModulatorGatingStartValue"],"0384":["FL","RangeModulatorGatingStopValue"],"0386":["FL","RangeModulatorGatingStartWaterEquivalentThickness"],
|
|
668
|
-
"0388":["FL","RangeModulatorGatingStopWaterEquivalentThickness"],"038A":["FL","IsocenterToRangeModulatorDistance"],"0390":["SH","ScanSpotTuneID"],"0392":["IS","NumberOfScanSpotPositions"],"0394":["FL","ScanSpotPositionMap"],"0396":["FL","ScanSpotMetersetWeights"],"0398":["FL","ScanningSpotSize"],"039A":["IS","NumberOfPaintings"],"03A0":["SQ","IonToleranceTableSequence"],"03A2":["SQ","IonBeamSequence"],"03A4":["SQ","IonBeamLimitingDeviceSequence"],"03A6":["SQ","IonBlockSequence"],"03A8":["SQ","IonControlPointSequence"],
|
|
669
|
-
"03AA":["SQ","IonWedgeSequence"],"03AC":["SQ","IonWedgePositionSequence"],"0401":["SQ","ReferencedSetupImageSequence"],"0402":["ST","SetupImageComment"],"0410":["SQ","MotionSynchronizationSequence"],"0412":["FL","ControlPointOrientation"],"0420":["SQ","GeneralAccessorySequence"],"0421":["SH","GeneralAccessoryID"],"0422":["ST","GeneralAccessoryDescription"],"0423":["CS","GeneralAccessoryType"],"0424":["IS","GeneralAccessoryNumber"],"0431":["SQ","ApplicatorGeometrySequence"],"0432":["CS","ApplicatorApertureShape"],
|
|
670
|
-
"0433":["FL","ApplicatorOpening"],"0434":["FL","ApplicatorOpeningX"],"0435":["FL","ApplicatorOpeningY"],"0436":["FL","SourceToApplicatorMountingPositionDistance"]},"300C":{"0002":["SQ","ReferencedRTPlanSequence"],"0004":["SQ","ReferencedBeamSequence"],"0006":["IS","ReferencedBeamNumber"],"0007":["IS","ReferencedReferenceImageNumber"],"0008":["DS","StartCumulativeMetersetWeight"],"0009":["DS","EndCumulativeMetersetWeight"],"000A":["SQ","ReferencedBrachyApplicationSetupSequence"],"000C":["IS","ReferencedBrachyApplicationSetupNumber"],
|
|
671
|
-
"000E":["IS","ReferencedSourceNumber"],"0020":["SQ","ReferencedFractionGroupSequence"],"0022":["IS","ReferencedFractionGroupNumber"],"0040":["SQ","ReferencedVerificationImageSequence"],"0042":["SQ","ReferencedReferenceImageSequence"],"0050":["SQ","ReferencedDoseReferenceSequence"],"0051":["IS","ReferencedDoseReferenceNumber"],"0055":["SQ","BrachyReferencedDoseReferenceSequence"],"0060":["SQ","ReferencedStructureSetSequence"],"006A":["IS","ReferencedPatientSetupNumber"],"0080":["SQ","ReferencedDoseSequence"],
|
|
672
|
-
"00A0":["IS","ReferencedToleranceTableNumber"],"00B0":["SQ","ReferencedBolusSequence"],"00C0":["IS","ReferencedWedgeNumber"],"00D0":["IS","ReferencedCompensatorNumber"],"00E0":["IS","ReferencedBlockNumber"],"00F0":["IS","ReferencedControlPointIndex"],"00F2":["SQ","ReferencedControlPointSequence"],"00F4":["IS","ReferencedStartControlPointIndex"],"00F6":["IS","ReferencedStopControlPointIndex"],"0100":["IS","ReferencedRangeShifterNumber"],"0102":["IS","ReferencedLateralSpreadingDeviceNumber"],"0104":["IS",
|
|
673
|
-
"ReferencedRangeModulatorNumber"]},"300E":{"0002":["CS","ApprovalStatus"],"0004":["DA","ReviewDate"],"0005":["TM","ReviewTime"],"0008":["PN","ReviewerName"]},4E3:{"0010":["LT","Arbitrary"],4E3:["LT","TextComments"]},4008:{"0040":["SH","ResultsID"],"0042":["LO","ResultsIDIssuer"],"0050":["SQ","ReferencedInterpretationSequence"],"00FF":["CS","ReportProductionStatusTrial"],"0100":["DA","InterpretationRecordedDate"],"0101":["TM","InterpretationRecordedTime"],"0102":["PN","InterpretationRecorder"],"0103":["LO",
|
|
674
|
-
"ReferenceToRecordedSound"],"0108":["DA","InterpretationTranscriptionDate"],"0109":["TM","InterpretationTranscriptionTime"],"010A":["PN","InterpretationTranscriber"],"010B":["ST","InterpretationText"],"010C":["PN","InterpretationAuthor"],"0111":["SQ","InterpretationApproverSequence"],"0112":["DA","InterpretationApprovalDate"],"0113":["TM","InterpretationApprovalTime"],"0114":["PN","PhysicianApprovingInterpretation"],"0115":["LT","InterpretationDiagnosisDescription"],"0117":["SQ","InterpretationDiagnosisCodeSequence"],
|
|
675
|
-
"0118":["SQ","ResultsDistributionListSequence"],"0119":["PN","DistributionName"],"011A":["LO","DistributionAddress"],"0200":["SH","InterpretationID"],"0202":["LO","InterpretationIDIssuer"],"0210":["CS","InterpretationTypeID"],"0212":["CS","InterpretationStatusID"],"0300":["ST","Impressions"],4E3:["ST","ResultsComments"]},4010:{"0001":["CS","LowEnergyDetectors"],"0002":["CS","HighEnergyDetectors"],"0004":["SQ","DetectorGeometrySequence"],1001:["SQ","ThreatROIVoxelSequence"],1004:["FL","ThreatROIBase"],
|
|
676
|
-
1005:["FL","ThreatROIExtents"],1006:["OB","ThreatROIBitmap"],1007:["SH","RouteSegmentID"],1008:["CS","GantryType"],1009:["CS","OOIOwnerType"],"100A":["SQ","RouteSegmentSequence"],1010:["US","PotentialThreatObjectID"],1011:["SQ","ThreatSequence"],1012:["CS","ThreatCategory"],1013:["LT","ThreatCategoryDescription"],1014:["CS","ATDAbilityAssessment"],1015:["CS","ATDAssessmentFlag"],1016:["FL","ATDAssessmentProbability"],1017:["FL","Mass"],1018:["FL","Density"],1019:["FL","ZEffective"],"101A":["SH","BoardingPassID"],
|
|
677
|
-
"101B":["FL","CenterOfMass"],"101C":["FL","CenterOfPTO"],"101D":["FL","BoundingPolygon"],"101E":["SH","RouteSegmentStartLocationID"],"101F":["SH","RouteSegmentEndLocationID"],1020:["CS","RouteSegmentLocationIDType"],1021:["CS","AbortReason"],1023:["FL","VolumeOfPTO"],1024:["CS","AbortFlag"],1025:["DT","RouteSegmentStartTime"],1026:["DT","RouteSegmentEndTime"],1027:["CS","TDRType"],1028:["CS","InternationalRouteSegment"],1029:["LO","ThreatDetectionAlgorithmandVersion"],"102A":["SH","AssignedLocation"],
|
|
678
|
-
"102B":["DT","AlarmDecisionTime"],1031:["CS","AlarmDecision"],1033:["US","NumberOfTotalObjects"],1034:["US","NumberOfAlarmObjects"],1037:["SQ","PTORepresentationSequence"],1038:["SQ","ATDAssessmentSequence"],1039:["CS","TIPType"],"103A":["CS","DICOSVersion"],1041:["DT","OOIOwnerCreationTime"],1042:["CS","OOIType"],1043:["FL","OOISize"],1044:["CS","AcquisitionStatus"],1045:["SQ","BasisMaterialsCodeSequence"],1046:["CS","PhantomType"],1047:["SQ","OOIOwnerSequence"],1048:["CS","ScanType"],1051:["LO",
|
|
679
|
-
"ItineraryID"],1052:["SH","ItineraryIDType"],1053:["LO","ItineraryIDAssigningAuthority"],1054:["SH","RouteID"],1055:["SH","RouteIDAssigningAuthority"],1056:["CS","InboundArrivalType"],1058:["SH","CarrierID"],1059:["CS","CarrierIDAssigningAuthority"],1060:["FL","SourceOrientation"],1061:["FL","SourcePosition"],1062:["FL","BeltHeight"],1064:["SQ","AlgorithmRoutingCodeSequence"],1067:["CS","TransportClassification"],1068:["LT","OOITypeDescriptor"],1069:["FL","TotalProcessingTime"],"106C":["OB","DetectorCalibrationData"]}};
|
|
680
|
-
b.Dictionary.getVR=function(a,d){var f,m;if(m=b.Dictionary.dict[b.Utils.dec2hex(a)])(m=m[b.Utils.dec2hex(d)])?f=m[0]:0===d&&(f="UL");f||(m=b.Dictionary.dictPrivate[b.Utils.dec2hex(a)])&&(m=m[b.Utils.dec2hex(d)])&&(f=m[0]);f||(f="OB");return f};b.Dictionary.getDescription=function(a,d){var f,m;if(m=b.Dictionary.dict[b.Utils.dec2hex(a)])(m=m[b.Utils.dec2hex(d)])?f=m[1]:0===d&&(f="Group "+b.Utils.dec2hex(a)+" Length");f||(m=b.Dictionary.dictPrivate[b.Utils.dec2hex(a)])&&(m=m[b.Utils.dec2hex(d)])&&(f=
|
|
681
|
-
m[1]);f||(f="PrivateData");return f};"undefined"!==typeof d&&d.exports&&(d.exports=b.Dictionary)},{"./utilities.js":40}],31:[function(a,d,f){var b=b||{};b.Tag=b.Tag||("undefined"!==typeof a?a("./tag.js"):null);b.CompressionUtils=b.CompressionUtils||("undefined"!==typeof a?a("./compression-utils.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.RLE=b.RLE||("undefined"!==typeof a?a("./rle.js"):null);var e="undefined"!==typeof a?a("jpeg-lossless-decoder-js"):null,g=g||("undefined"!==
|
|
682
|
-
typeof a?a("../lib/jpeg-baseline.js").JpegImage:null),h=h||("undefined"!==typeof a?a("../lib/jpx.js"):null);b.Image=b.Image||function(){this.tags={};this.tagsFlat={};this.littleEndian=!1;this.index=-1;this.decompressed=!1;this.privateDataAll=null;this.convertedPalette=!1};b.Image.SLICE_DIRECTION_UNKNOWN=-1;b.Image.SLICE_DIRECTION_AXIAL=2;b.Image.SLICE_DIRECTION_CORONAL=1;b.Image.SLICE_DIRECTION_SAGITTAL=0;b.Image.SLICE_DIRECTION_OBLIQUE=3;b.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE=.8;b.Image.BYTE_TYPE_UNKNOWN=
|
|
683
|
-
0;b.Image.BYTE_TYPE_BINARY=1;b.Image.BYTE_TYPE_INTEGER=2;b.Image.BYTE_TYPE_INTEGER_UNSIGNED=3;b.Image.BYTE_TYPE_FLOAT=4;b.Image.BYTE_TYPE_COMPLEX=5;b.Image.BYTE_TYPE_RGB=6;b.Image.getSingleValueSafely=function(a,b){return a&&a.value?a.value[b]:null};b.Image.getValueSafely=function(a){return a?a.value:null};b.Image.getMajorAxisFromPatientRelativeDirectionCosine=function(a,e,d){var g,f,h;g=0>a?"R":"L";f=0>e?"A":"P";h=0>d?"F":"H";a=Math.abs(a);e=Math.abs(e);d=Math.abs(d);return a>b.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&
|
|
684
|
-
a>e&&a>d?g:e>b.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&e>a&&e>d?f:d>b.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&d>a&&d>e?h:null};b.Image.prototype.getCols=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_COLS[0],b.Tag.TAG_COLS[1]),0)};b.Image.prototype.getRows=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_ROWS[0],b.Tag.TAG_ROWS[1]),0)};b.Image.prototype.getSeriesDescription=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SERIES_DESCRIPTION[0],
|
|
685
|
-
b.Tag.TAG_SERIES_DESCRIPTION[1]),0)};b.Image.prototype.getSeriesInstanceUID=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SERIES_INSTANCE_UID[0],b.Tag.TAG_SERIES_INSTANCE_UID[1]),0)};b.Image.prototype.getSeriesNumber=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SERIES_NUMBER[0],b.Tag.TAG_SERIES_NUMBER[1]),0)};b.Image.prototype.getEchoNumber=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_ECHO_NUMBER[0],b.Tag.TAG_ECHO_NUMBER[1]),0)};
|
|
686
|
-
b.Image.prototype.getImagePosition=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_POSITION[0],b.Tag.TAG_IMAGE_POSITION[1]))};b.Image.prototype.getImageDirections=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_ORIENTATION[0],b.Tag.TAG_IMAGE_ORIENTATION[1]))};b.Image.prototype.getImagePositionSliceDir=function(a){var e=b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_POSITION[0],b.Tag.TAG_IMAGE_POSITION[1]));return e&&0<=a?e[a]:0};b.Image.prototype.getSliceLocation=
|
|
687
|
-
function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SLICE_LOCATION[0],b.Tag.TAG_SLICE_LOCATION[1]),0)};b.Image.prototype.getSliceLocationVector=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_SLICE_LOCATION_VECTOR[0],b.Tag.TAG_SLICE_LOCATION_VECTOR[1]))};b.Image.prototype.getImageNumber=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_IMAGE_NUM[0],b.Tag.TAG_IMAGE_NUM[1]),0)};b.Image.prototype.getTemporalPosition=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_TEMPORAL_POSITION[0],
|
|
688
|
-
b.Tag.TAG_TEMPORAL_POSITION[1]),0)};b.Image.prototype.getTemporalNumber=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[0],b.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[1]),0)};b.Image.prototype.getSliceGap=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SLICE_GAP[0],b.Tag.TAG_SLICE_GAP[1]),0)};b.Image.prototype.getSliceThickness=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SLICE_THICKNESS[0],b.Tag.TAG_SLICE_THICKNESS[1]),
|
|
689
|
-
0)};b.Image.prototype.getImageMax=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_IMAGE_MAX[0],b.Tag.TAG_IMAGE_MAX[1]),0)};b.Image.prototype.getImageMin=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_IMAGE_MIN[0],b.Tag.TAG_IMAGE_MIN[1]),0)};b.Image.prototype.getDataScaleSlope=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_DATA_SCALE_SLOPE[0],b.Tag.TAG_DATA_SCALE_SLOPE[1]),0)};b.Image.prototype.getDataScaleIntercept=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_DATA_SCALE_INTERCEPT[0],
|
|
690
|
-
b.Tag.TAG_DATA_SCALE_INTERCEPT[1]),0)};b.Image.prototype.getDataScaleElscint=function(){var a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_DATA_SCALE_ELSCINT[0],b.Tag.TAG_DATA_SCALE_ELSCINT[1]),0);a||(a=1);var e=this.getPixelBandwidth(),a=Math.sqrt(e)/(10*a);0>=a&&(a=1);return a};b.Image.prototype.getWindowWidth=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_WINDOW_WIDTH[0],b.Tag.TAG_WINDOW_WIDTH[1]),0)};b.Image.prototype.getWindowCenter=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_WINDOW_CENTER[0],
|
|
691
|
-
b.Tag.TAG_WINDOW_CENTER[1]),0)};b.Image.prototype.getPixelBandwidth=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PIXEL_BANDWIDTH[0],b.Tag.TAG_PIXEL_BANDWIDTH[1]),0)};b.Image.prototype.getSeriesId=function(){var a=this.getSeriesDescription(),b=this.getSeriesInstanceUID(),e=this.getSeriesNumber(),d=this.getEchoNumber(),g=this.getOrientation(),f=this.getCols(),h=this.getRows(),x="";null!==a&&(x+=" "+a);null!==b&&(x+=" "+b);null!==e&&(x+=" "+e);null!==d&&(x+=" "+d);null!==g&&(x+=
|
|
692
|
-
" "+g);return x+(" ("+f+" x "+h+")")};b.Image.prototype.getPixelSpacing=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_PIXEL_SPACING[0],b.Tag.TAG_PIXEL_SPACING[1]))};b.Image.prototype.getImageType=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_TYPE[0],b.Tag.TAG_IMAGE_TYPE[1]))};b.Image.prototype.getBitsStored=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_BITS_STORED[0],b.Tag.TAG_BITS_STORED[1]),0)};b.Image.prototype.getBitsAllocated=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_BITS_ALLOCATED[0],
|
|
693
|
-
b.Tag.TAG_BITS_ALLOCATED[1]),0)};b.Image.prototype.getFrameTime=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_FRAME_TIME[0],b.Tag.TAG_FRAME_TIME[1]),0)};b.Image.prototype.getAcquisitionMatrix=function(){var a,e,d;a=[0,0];a[0]=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_ACQUISITION_MATRIX[0],b.Tag.TAG_ACQUISITION_MATRIX[1]),0);null===this.privateDataAll&&(this.privateDataAll=this.getAllInterpretedPrivateData());null!==this.privateDataAll&&0<this.privateDataAll.length&&
|
|
694
|
-
(e=this.privateDataAll.indexOf("AcquisitionMatrixText"),-1!==e&&(d=this.privateDataAll.indexOf("\n",e),-1!==d&&(e=this.privateDataAll.substring(e,d),e=e.match(/\d+/g),null!==e&&2===e.length?(a[0]=e[0],a[1]=e[1]):null!==e&&1===e.length&&(a[0]=e[0]))));0===a[1]&&(a[1]=a[0]);return a};b.Image.prototype.getTR=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_TR,b.Tag.TAG_TR[1]),0)};b.Image.prototype.putTag=function(a){this.tags[a.id]=a;this.putFlattenedTag(this.tagsFlat,a)};b.Image.prototype.putFlattenedTag=
|
|
695
|
-
function(a,b){var e;if(b.sublist)for(e=0;e<b.value.length;e+=1)this.putFlattenedTag(a,b.value[e]);else a[b.id]||(a[b.id]=b)};b.Image.prototype.getTag=function(a,e){return this.tagsFlat[b.Tag.createId(a,e)]};b.Image.prototype.getPixelData=function(){return this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])]};b.Image.prototype.getPixelDataBytes=function(){this.isCompressed()&&this.decompress();this.isPalette()&&this.convertPalette();return this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],
|
|
696
|
-
b.Tag.TAG_PIXEL_DATA[1])].value.buffer};b.Image.prototype.getRawData=function(){return this.getPixelDataBytes()};b.Image.prototype.getInterpretedData=function(a,e){var d,g,f,h,A,x,G,F,z,L,l,J,K,E,y,D;G=b.Utils.createBitMask(this.getBitsAllocated()/8,this.getBitsStored(),this.getDataType()===b.Image.BYTE_TYPE_INTEGER_UNSIGNED);d=this.getDataType();g=this.getBitsAllocated()/8;f=this.getRawData();h=new DataView(f);f=f.byteLength/g;F=this.getDataScaleSlope()||1;z=this.getDataScaleIntercept()||0;L=b.Utils.MAX_VALUE;
|
|
697
|
-
l=b.Utils.MIN_VALUE;E=K=-1;y=this.littleEndian;A=a?[]:new Float32Array(f);for(x=0;x<f;x+=1)d===b.Image.BYTE_TYPE_INTEGER?1===g?D=h.getInt8(x*g):2===g&&(D=h.getInt16(x*g,y)):d===b.Image.BYTE_TYPE_INTEGER_UNSIGNED&&(1===g?D=h.getUint8(x*g):2===g&&(D=h.getUint16(x*g,y))),J=(D&G)*F+z,A[x]=J,J<L&&(L=J,K=x),J>l&&(l=J,E=x);return e?{data:A,min:L,minIndex:K,max:l,maxIndex:E,numCols:this.getCols(),numRows:this.getRows()}:A};b.Image.prototype.convertPalette=function(){var a,e,d,g,f,h,A,x,G,F;a=this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],
|
|
698
|
-
b.Tag.TAG_PIXEL_DATA[1])].value;e=this.getPalleteValues(b.Tag.TAG_PALETTE_RED);d=this.getPalleteValues(b.Tag.TAG_PALETTE_GREEN);g=this.getPalleteValues(b.Tag.TAG_PALETTE_BLUE);if(null!==e&&0<e.length&&null!==d&&0<d.length&&null!==g&&0<g.length&&!this.convertedPalette){f=new DataView(new ArrayBuffer(this.getRows()*this.getCols()*this.getNumberOfFrames()*3));h=parseInt(Math.ceil(this.getBitsAllocated()/8));A=a.byteLength/h;if(1===h)for(h=0;h<A;h+=1)x=a.getUint8(h),G=e[x],F=d[x],x=g[x],f.setUint8(3*
|
|
699
|
-
h,G),f.setUint8(3*h+1,F),f.setUint8(3*h+2,x);else if(2===h)for(h=0;h<A;h+=1)x=a.getUint16(2*h),G=e[x],F=d[x],x=g[x],f.setUint8(3*h,G),f.setUint8(3*h+1,F),f.setUint8(3*h+2,x);a=f;this.convertedPalette=!0}this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=a};b.Image.prototype.decompress=function(){var a,d,f,t,w,B,A,x,G,F;f=null;if(!this.decompressed)if(this.decompressed=!0,w=this.getRows()*this.getCols()*parseInt(Math.ceil(this.getBitsAllocated()/8)),t=this.getNumberOfFrames(),
|
|
700
|
-
this.isCompressedJPEGLossless()){a=this.getJpegs();for(A=0;A<a.length;A+=1)d=new e.lossless.Decoder,B=d.decode(a[A]),G=d.numComp,null===f&&(f=new DataView(new ArrayBuffer(w*t*G))),(new Uint8Array(f.buffer)).set(new Uint8Array(B.buffer),A*w*G);this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=f}else if(this.isCompressedJPEGBaseline()){a=this.getJpegs();for(A=0;A<a.length;A+=1)d=new g,d.parse(new Uint8Array(a[A])),B=d.width,x=d.height,G=d.components.length,null===f&&(f=
|
|
701
|
-
new DataView(new ArrayBuffer(w*t*G))),8===this.getBitsAllocated()?F=d.getData(B,x):16===this.getBitsAllocated()&&(F=d.getData16(B,x)),b.Utils.fillBuffer(F,f,A*w*G,parseInt(Math.ceil(this.getBitsAllocated()/8))),F=null;this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=f}else if(this.isCompressedJPEG2000()){a=this.getJpegs();for(A=0;A<a.length;A+=1)d=new h,d.parse(new Uint8Array(a[A])),F=d.tiles[0].items,G=d.componentsCount,null===f&&(f=new DataView(new ArrayBuffer(w*
|
|
702
|
-
t*G))),b.Utils.fillBuffer(F,f,A*w*G,parseInt(Math.ceil(this.getBitsAllocated()/8)));this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=f}else if(this.isCompressedRLE()){a=this.getRLE();for(A=0;A<a.length;A+=1)d=new b.RLE,B=d.decode(a[A],this.littleEndian,this.getRows()*this.getCols()),G=3===d.numSegments?3:1,null===f&&(f=new DataView(new ArrayBuffer(w*t*G))),(new Uint8Array(f.buffer)).set(new Uint8Array(B.buffer),A*w*G);this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],
|
|
703
|
-
b.Tag.TAG_PIXEL_DATA[1])].value=f}};b.Image.prototype.hasPixelData=function(){return void 0!==this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])]};b.Image.prototype.clearPixelData=function(){this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=null};b.Image.prototype.getOrientation=function(){var a=b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_ORIENTATION[0],b.Tag.TAG_IMAGE_ORIENTATION[1])),e,d,g=0,f=0,h=0,A="";if(!a||6!==a.length)return null;
|
|
704
|
-
e=this.getPixelSpacing();if(!e)return null;d=e[0];for(e=0;3>e;e+=1)Math.abs(a[e])>h&&(h=Math.abs(a[e]),g=e);for(h=0;6>e;e+=1)Math.abs(a[e])>h&&(h=Math.abs(a[e]),f=e);switch(g){case 0:A+="X";A=4===f?A+"YZ":A+"ZY";break;case 1:A+="Y";A=3===f?A+"XZ":A+"ZX";break;case 2:A+="Z",A=3===f?A+"XY":A+"YX"}switch(g){case 0:A=0<a[g]?A+"-":A+"+";A=4===f?0<a[f]?A+"-":A+"+":0<a[f]?A+"+":A+"-";break;case 1:A=0<a[g]?A+"-":A+"+";A=3===f?0<a[f]?A+"-":A+"+":0<a[f]?A+"+":A+"-";break;case 2:A=0<a[g]?A+"+":A+"-",A=0<a[f]?
|
|
705
|
-
A+"-":A+"+"}if(0===d)A+="+";else switch(A.charAt(2)){case "X":A=0<d?A+"-":A+"+";break;case "Y":case "Z":A=0<d?A+"+":A+"-"}return A};b.Image.prototype.isMosaic=function(){var a,b=!1,e;a=this.getImageType();if(null!==a)for(e=0;e<a.length;e+=1)if(-1!==a[e].toUpperCase().indexOf("MOSAIC")){b=!0;break}a=this.getAcquisitionMatrix();a=0<a[0]&&(a[0]<this.getRows()||a[1]<this.getCols());return b&&a};b.Image.prototype.isPalette=function(){var a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PHOTOMETRIC_INTERPRETATION[0],
|
|
706
|
-
b.Tag.TAG_PHOTOMETRIC_INTERPRETATION[1]),0);return null!==a&&-1!==a.toLowerCase().indexOf("palette")?!0:!1};b.Image.prototype.getMosaicCols=function(){return this.getCols()/this.getAcquisitionMatrix()[1]};b.Image.prototype.getMosaicRows=function(){return this.getRows()/this.getAcquisitionMatrix()[0]};b.Image.prototype.isElscint=function(){return void 0!==this.getTag(b.Tag.TAG_DATA_SCALE_ELSCINT[0],b.Tag.TAG_DATA_SCALE_ELSCINT[1])};b.Image.prototype.isCompressed=function(){b.Parser=b.Parser||("undefined"!==
|
|
707
|
-
typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return!e||-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG)&&-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE)?!1:!0};b.Image.prototype.isCompressedJPEG=function(){b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return e&&-1!==e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG)?!0:!1};b.Image.prototype.isCompressedJPEGLossless=function(){b.Parser=b.Parser||("undefined"!==
|
|
708
|
-
typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return!e||-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS)&&-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1)?!1:!0};b.Image.prototype.isCompressedJPEGBaseline=function(){b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return!e||-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT)&&-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT)?
|
|
709
|
-
!1:!0};b.Image.prototype.isCompressedJPEG2000=function(){b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return!e||-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000)&&-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS)?!1:!0};b.Image.prototype.isCompressedRLE=function(){b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return e&&-1!==e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE)?
|
|
710
|
-
!0:!1};b.Image.prototype.getNumberOfFrames=function(){var a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_NUMBER_OF_FRAMES[0],b.Tag.TAG_NUMBER_OF_FRAMES[1]),0);return null!==a?a:1};b.Image.prototype.getNumberOfSamplesPerPixel=function(){var a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SAMPLES_PER_PIXEL[0],b.Tag.TAG_SAMPLES_PER_PIXEL[1]),0);return null!==a?a:1};b.Image.prototype.getNumberOfImplicitFrames=function(){var a,b;if(this.isCompressed())return 1;a=this.getPixelData();a=a.offsetEnd-
|
|
711
|
-
a.offsetValue;b=this.getCols()*this.getRows()*parseInt(this.getBitsAllocated()/8);return parseInt(a/b)};b.Image.prototype.getPixelRepresentation=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PIXEL_REPRESENTATION[0],b.Tag.TAG_PIXEL_REPRESENTATION[1]),0)};b.Image.prototype.getPhotometricInterpretation=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PHOTOMETRIC_INTERPRETATION[0],b.Tag.TAG_PHOTOMETRIC_INTERPRETATION[1]),0)};b.Image.prototype.getPatientName=
|
|
712
|
-
function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PATIENT_NAME[0],b.Tag.TAG_PATIENT_NAME[1]),0)};b.Image.prototype.getPatientID=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PATIENT_ID[0],b.Tag.TAG_PATIENT_ID[1]),0)};b.Image.prototype.getStudyTime=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_STUDY_TIME[0],b.Tag.TAG_STUDY_TIME[1]),0)};b.Image.prototype.getTransferSyntax=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_TRANSFER_SYNTAX[0],
|
|
713
|
-
b.Tag.TAG_TRANSFER_SYNTAX[1]),0)};b.Image.prototype.getStudyDate=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_STUDY_DATE[0],b.Tag.TAG_STUDY_DATE[1]),0)};b.Image.prototype.getPlanarConfig=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PLANAR_CONFIG[0],b.Tag.TAG_PLANAR_CONFIG[1]),0)};b.Image.prototype.getImageDescription=function(){var a,e="";a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_STUDY_DES[0],b.Tag.TAG_STUDY_DES[1]),0);null!==a&&(e+=" "+a);
|
|
714
|
-
a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SERIES_DESCRIPTION[0],b.Tag.TAG_SERIES_DESCRIPTION[1]),0);null!==a&&(e+=" "+a);a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_IMAGE_COMMENTS[0],b.Tag.TAG_IMAGE_COMMENTS[1]),0);null!==a&&(e+=" "+a);return e.trim()};b.Image.prototype.getDataType=function(){var a,e;e=this.getPixelRepresentation();if(null===e)return b.Image.BYTE_TYPE_UNKNOWN;a=this.getPhotometricInterpretation();return null===a||-1===a.trim().indexOf("RGB")&&-1===a.trim().indexOf("YBR")&&
|
|
715
|
-
-1===a.trim().toLowerCase().indexOf("palette")?0===e?b.Image.BYTE_TYPE_INTEGER_UNSIGNED:1===e?b.Image.BYTE_TYPE_INTEGER:b.Image.BYTE_TYPE_UNKNOWN:b.Image.BYTE_TYPE_RGB};b.Image.prototype.getAcquiredSliceDirection=function(){var a,e,d;a=b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_ORIENTATION[0],b.Tag.TAG_IMAGE_ORIENTATION[1]));if(!a||6!==a.length)return b.Image.SLICE_DIRECTION_UNKNOWN;e=b.Image.getMajorAxisFromPatientRelativeDirectionCosine(a[0],a[1],a[2]);a=b.Image.getMajorAxisFromPatientRelativeDirectionCosine(a[3],
|
|
716
|
-
a[4],a[5]);null!==e&&null!==a?"R"!==e&&"L"!==e||"A"!==a&&"P"!==a?"R"!==a&&"L"!==a||"A"!==e&&"P"!==e?"R"!==e&&"L"!==e||"H"!==a&&"F"!==a?"R"!==a&&"L"!==a||"H"!==e&&"F"!==e?"A"!==e&&"P"!==e||"H"!==a&&"F"!==a?"A"!==a&&"P"!==a||"H"!==e&&"F"!==e||(d=b.Image.SLICE_DIRECTION_SAGITTAL):d=b.Image.SLICE_DIRECTION_SAGITTAL:d=b.Image.SLICE_DIRECTION_CORONAL:d=b.Image.SLICE_DIRECTION_CORONAL:d=b.Image.SLICE_DIRECTION_AXIAL:d=b.Image.SLICE_DIRECTION_AXIAL:d=b.Image.SLICE_DIRECTION_OBLIQUE;return d};b.Image.prototype.getEncapsulatedData=
|
|
717
|
-
function(){var e;b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);e=this.getPixelData().value.buffer;return(new b.Parser).parseEncapsulated(new DataView(e))};b.Image.prototype.getJpegs=function(){var a,e,d,g,f=[],h=[];if(a=this.getEncapsulatedData())for(e=a.length,d=0;d<e;d+=1)b.CompressionUtils.isHeaderJPEG(a[d].value)||b.CompressionUtils.isHeaderJPEG2000(a[d].value)?(g=[],g.push(a[d].value.buffer),f.push(g)):g&&a[d].value&&g.push(a[d].value.buffer);for(d=0;d<f.length;d+=1)h[d]=
|
|
718
|
-
1<f[d].length?b.Utils.concatArrayBuffers2(f[d]):f[d][0],f[d]=null;return h};b.Image.prototype.getRLE=function(){var a,b,e,d=[];if(a=this.getEncapsulatedData())for(b=a.length,e=1;e<b;e+=1)a[e].value&&d.push(a[e].value.buffer);return d};b.Image.prototype.getAllInterpretedPrivateData=function(){var a,b,e="",d=Object.keys(this.tags).sort();for(a=0;a<d.length;a+=1)b=d[a],this.tags.hasOwnProperty(b)&&(b=this.tags[b],b.hasInterpretedPrivateData()&&(e+=b.value));return e};b.Image.prototype.toString=function(){var a,
|
|
719
|
-
b,e="",d=Object.keys(this.tags).sort();for(a=0;a<d.length;a+=1)b=d[a],this.tags.hasOwnProperty(b)&&(b=this.tags[b],e+=b.toHTMLString()+"<br />");e=e.replace(/\n\s*\n/g,"\n");return e=e.replace(/(?:\r\n|\r|\n)/g,"<br />")};b.Image.prototype.getPalleteValues=function(a){var e,d,g,f,h;d=b.Image.getValueSafely(this.getTag(a[0],a[1]));if(null!==d){g=d.buffer.byteLength/2;a=[];e=[];for(f=0;f<g;f+=1)a[f]=d.getUint16(2*f,!1)&65535,e[f]=d.getUint16(2*f,!0)&65535;f=Math.max.apply(Math,a);h=Math.min.apply(Math,
|
|
720
|
-
a);d=Math.max.apply(Math,e);g=Math.min.apply(Math,e);f=Math.abs(f-h);d=Math.abs(d-g);return f<d?this.scalePalette(a):this.scalePalette(e)}return null};b.Image.prototype.scalePalette=function(a){var b,e,d;e=Math.max.apply(Math,a);b=Math.min.apply(Math,a);if(255<e||0>b)for(d=255/(e-b),e=0;e<a.length;e+=1)a[e]=parseInt(Math.round((a[e]-b)*d));return a};"undefined"!==typeof d&&d.exports&&(d.exports=b.Image)},{"../lib/jpeg-baseline.js":1,"../lib/jpx.js":2,"./compression-utils.js":29,"./parser.js":35,"./rle.js":36,
|
|
721
|
-
"./tag.js":39,"./utilities.js":40,"jpeg-lossless-decoder-js":8}],32:[function(a,d,f){var b=b||{};b.OrderedMapIterator=b.OrderedMapIterator||function(a){this.orderedMap=a;this.index=0};b.OrderedMapIterator.prototype.hasNext=function(){return this.index<this.orderedMap.orderedKeys.length};b.OrderedMapIterator.prototype.next=function(){var a=this.orderedMap.get(this.orderedMap.orderedKeys[this.index]);this.index+=1;return a};"undefined"!==typeof d&&d.exports&&(d.exports=b.OrderedMapIterator)},{}],33:[function(a,
|
|
722
|
-
d,f){var b=b||{};b.CompressionUtils=b.CompressionUtils||("undefined"!==typeof a?a("./compression-utils.js"):null);b.Dictionary=b.Dictionary||("undefined"!==typeof a?a("./dictionary.js"):null);b.Image=b.Image||("undefined"!==typeof a?a("./image.js"):null);b.OrderedMapIterator=b.OrderedMapIterator||("undefined"!==typeof a?a("./iterator.js"):null);b.OrderedMap=b.OrderedMap||("undefined"!==typeof a?a("./orderedmap.js"):null);b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);b.RLE=b.RLE||
|
|
723
|
-
("undefined"!==typeof a?a("./rle.js"):null);b.Series=b.Series||("undefined"!==typeof a?a("./series.js"):null);b.Tag=b.Tag||("undefined"!==typeof a?a("./tag.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Siemens=b.Siemens||("undefined"!==typeof a?a("./siemens.js"):null);var e=e||{};e.lossless=e.lossless||{};e.lossless.Decoder="undefined"!==typeof a?a("jpeg-lossless-decoder-js"):null;var g=g||("undefined"!==typeof a?a("../lib/jpeg-baseline.js").JpegImage:null),h=h||
|
|
724
|
-
("undefined"!==typeof a?a("../lib/jpx.js"):null),m=m||("undefined"!==typeof a?a("pako"):null);"undefined"!==typeof d&&d.exports&&(d.exports=b)},{"../lib/jpeg-baseline.js":1,"../lib/jpx.js":2,"./compression-utils.js":29,"./dictionary.js":30,"./image.js":31,"./iterator.js":32,"./orderedmap.js":34,"./parser.js":35,"./rle.js":36,"./series.js":37,"./siemens.js":38,"./tag.js":39,"./utilities.js":40,"jpeg-lossless-decoder-js":8,pako:13}],34:[function(a,d,f){var b=b||{};b.OrderedMapIterator=b.OrderedMapIterator||
|
|
725
|
-
("undefined"!==typeof a?a("./iterator.js"):null);b.OrderedMap=b.OrderedMap||function(){this.map={};this.orderedKeys=[]};b.OrderedMap.prototype.put=function(a,b){a in this.map||(this.orderedKeys.push(a),this.orderedKeys.sort(function(a,b){return parseFloat(a)-parseFloat(b)}));this.map[a]=b};b.OrderedMap.prototype.remove=function(a){var b=this.orderedKeys.indexOf(a);if(-1===b)throw Error("key does not exist");this.orderedKeys.splice(b,1);delete this.map[a]};b.OrderedMap.prototype.get=function(a){return a in
|
|
726
|
-
this.map?this.map[a]:null};b.OrderedMap.prototype.iterator=function(){return new b.OrderedMapIterator(this)};b.OrderedMap.prototype.getOrderedValues=function(){for(var a=[],b=this.iterator();b.hasNext();)a.push(b.next());return a};"undefined"!==typeof d&&d.exports&&(d.exports=b.OrderedMap)},{"./iterator.js":32}],35:[function(a,d,f){var b=b||{};b.Tag=b.Tag||("undefined"!==typeof a?a("./tag.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Dictionary=b.Dictionary||("undefined"!==
|
|
727
|
-
typeof a?a("./dictionary.js"):null);b.Image=b.Image||("undefined"!==typeof a?a("./image.js"):null);var e=e||("undefined"!==typeof a?a("pako"):null);b.Parser=b.Parser||function(){this.explicit=this.littleEndian=!0;this.metaFinished=this.metaFound=!1;this.metaFinishedOffset=-1;this.needsDeflate=!1;this.error=null};b.Parser.verbose=!1;b.Parser.MAGIC_COOKIE_OFFSET=128;b.Parser.MAGIC_COOKIE=[68,73,67,77];b.Parser.VRS="AE AS AT CS DA DS DT FL FD IS LO LT OB OD OF OW PN SH SL SS ST TM UI UL UN US UT".split(" ");
|
|
728
|
-
b.Parser.DATA_VRS="OB OW OF SQ UT UN".split(" ");b.Parser.RAW_DATA_VRS=["OB","OD","OF","OW","UN"];b.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE="1.2.840.10008.1.2";b.Parser.TRANSFER_SYNTAX_EXPLICIT_LITTLE="1.2.840.10008.1.2.1";b.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG="1.2.840.10008.1.2.2";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG="1.2.840.10008.1.2.4";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS="1.2.840.10008.1.2.4.57";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1="1.2.840.10008.1.2.4.70";
|
|
729
|
-
b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT="1.2.840.10008.1.2.4.50";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT="1.2.840.10008.1.2.4.51";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS="1.2.840.10008.1.2.4.90";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000="1.2.840.10008.1.2.4.91";b.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE="1.2.840.10008.1.2.5";b.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE="1.2.840.10008.1.2.1.99";b.Parser.UNDEFINED_LENGTH=4294967295;b.Parser.isMagicCookieFound=
|
|
730
|
-
function(a){var e=b.Parser.MAGIC_COOKIE_OFFSET,d=b.Parser.MAGIC_COOKIE.length,f;for(f=0;f<d;f+=1)if(a.getUint8(e+f)!==b.Parser.MAGIC_COOKIE[f])return!1;return!0};b.Parser.prototype.parse=function(a){var d=null,f,k,p,t;try{for(d=new b.Image,f=this.findFirstTagOffset(a),k=this.getNextTag(a,f);null!==k;){b.Parser.verbose&&console.log(k.toString());d.putTag(k);if(k.isPixelData())break;this.needsDeflate&&k.offsetEnd>=this.metaFinishedOffset&&(this.needsDeflate=!1,p=a.buffer.slice(0,k.offsetEnd),t=a.buffer.slice(k.offsetEnd),
|
|
731
|
-
a=new DataView(b.Utils.concatArrayBuffers(p,e.inflateRaw(t))));k=this.getNextTag(a,k.offsetEnd)}}catch(w){this.error=w}null!==d&&(d.littleEndian=this.littleEndian);return d};b.Parser.prototype.parseEncapsulated=function(a){var e,d=[];try{for(e=this.getNextTag(a,0);null!==e;)e.isSublistItem()&&d.push(e),b.Parser.verbose&&console.log(e.toString()),e=this.getNextTag(a,e.offsetEnd)}catch(f){this.error=f}return d};b.Parser.prototype.testForValidTag=function(a){var b,e=null;try{b=this.findFirstTagOffset(a),
|
|
732
|
-
e=this.getNextTag(a,b,!0)}catch(d){this.error=d}return e};b.Parser.prototype.getNextTag=function(a,e,d){var f=0,p,t=null,w=e,B,A=0;B=!0;var x=null;if(e>=a.byteLength)return null;this.metaFinished?(B=this.littleEndian,f=a.getUint16(e,B)):(f=a.getUint16(e,!0),-1!==this.metaFinishedOffset&&e>=this.metaFinishedOffset||2!==f?(this.metaFinished=!0,B=this.littleEndian,f=a.getUint16(e,B)):B=!0);this.metaFound||2!==f||(this.metaFound=!0);e+=2;p=a.getUint16(e,B);e+=2;this.explicit||!this.metaFinished?(x=b.Utils.getStringAt(a,
|
|
733
|
-
e,2),!this.metaFound&&this.metaFinished&&-1===b.Parser.VRS.indexOf(x)?(x=b.Dictionary.getVR(f,p),A=a.getUint32(e,B),e+=4,this.explicit=!1):(e+=2,-1!==b.Parser.DATA_VRS.indexOf(x)?(e+=2,A=a.getUint32(e,B),e+=4):(A=a.getUint16(e,B),e+=2))):(x=b.Dictionary.getVR(f,p),A=a.getUint32(e,B),A===b.Parser.UNDEFINED_LENGTH&&(x="SQ"),e+=4);B=e;"SQ"===x?(t=this.parseSublist(a,e,A),A===b.Parser.UNDEFINED_LENGTH&&(A=t[t.length-1].offsetEnd-e)):0<A&&!d&&(A===b.Parser.UNDEFINED_LENGTH&&f===b.Tag.TAG_PIXEL_DATA[0]&&
|
|
734
|
-
p===b.Tag.TAG_PIXEL_DATA[1]&&(A=a.byteLength-e),t=a.buffer.slice(e,e+A));e+=A;a=new b.Tag(f,p,x,t,w,B,e,this.littleEndian);a.isTransformSyntax()?a.value[0]===b.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE?(this.explicit=!1,this.littleEndian=!0):a.value[0]===b.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG?(this.explicit=!0,this.littleEndian=!1):(a.value[0]===b.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE&&(this.needsDeflate=!0),this.littleEndian=this.explicit=!0):a.isMetaLength()&&(this.metaFinishedOffset=a.value[0]+
|
|
735
|
-
e);return a};b.Parser.prototype.parseSublist=function(a,e,d){var f=e+d,p=[];if(d===b.Parser.UNDEFINED_LENGTH){for(e=this.parseSublistItem(a,e);!e.isSequenceDelim();)p.push(e),e=e.offsetEnd,e=this.parseSublistItem(a,e);p.push(e)}else for(;e<f;)e=this.parseSublistItem(a,e),p.push(e),e=e.offsetEnd;return p};b.Parser.prototype.parseSublistItem=function(a,e){var d,f,p,t,w=e,B,A=[];d=a.getUint16(e,this.littleEndian);e+=2;f=a.getUint16(e,this.littleEndian);e+=2;p=a.getUint32(e,this.littleEndian);B=e+=4;
|
|
736
|
-
if(p===b.Parser.UNDEFINED_LENGTH){for(t=this.getNextTag(a,e);!t.isSublistItemDelim();)A.push(t),e=t.offsetEnd,t=this.getNextTag(a,e);A.push(t);e=t.offsetEnd}else for(p=e+p;e<p;)t=this.getNextTag(a,e),A.push(t),e=t.offsetEnd;return new b.Tag(d,f,null,A,w,B,e,this.littleEndian)};b.Parser.prototype.findFirstTagOffset=function(a){var e=0,d=b.Parser.MAGIC_COOKIE.length,f=2*b.Parser.MAGIC_COOKIE_OFFSET,p=!1,t=0,w=0,p=0;if(b.Parser.isMagicCookieFound(a))e=b.Parser.MAGIC_COOKIE_OFFSET+d;else for(t=0;t<f;t+=
|
|
737
|
-
1)if(p=a.getUint8(e),p===b.Parser.MAGIC_COOKIE[0]){p=!0;for(w=1;w<d;w+=1)a.getUint8(t+w)!==b.Parser.MAGIC_COOKIE[w]&&(p=!1);if(p){e=t;break}}return e};b.Parser.prototype.hasError=function(){return null!==this.error};"undefined"!==typeof d&&d.exports&&(d.exports=b.Parser)},{"./dictionary.js":30,"./image.js":31,"./tag.js":39,"./utilities.js":40,pako:13}],36:[function(a,d,f){var b=b||{};b.RLE=b.RLE||function(){this.rawData=null;this.numSegments=this.segElemPut=this.bytesPut=this.bytesRead=0;this.segmentOffsets=
|
|
738
|
-
[];this.littleEndian=!0;this.size=this.numElements=this.segmentIndex=0;this.output=null};b.RLE.HEADER_SIZE=64;b.RLE.prototype.decode=function(a,b,d){this.rawData=new DataView(a);this.littleEndian=b;this.numElements=d;this.readHeader();this.output=new DataView(new ArrayBuffer(this.size));for(a=0;a<this.numSegments;a+=1)this.readNextSegment();return this.processData()};b.RLE.prototype.processData=function(){var a,b,d,f;if(1===this.numSegments)return this.output;if(2===this.numSegments){f=new DataView(new ArrayBuffer(this.size));
|
|
739
|
-
for(a=0;a<this.numElements;a+=1)b=this.output.getInt8(a),d=this.output.getInt8(a+this.numElements),b=(b&255)<<8|d&255,f.setInt16(2*a,b,this.littleEndian);return f}if(3===this.numSegments){f=new DataView(new ArrayBuffer(this.size));b=2*this.numElements;for(a=0;a<this.numElements;a+=1)f.setInt8(3*a,this.output.getInt8(a)),f.setInt8(3*a+1,this.output.getInt8(a+this.numElements)),f.setInt8(3*a+2,this.output.getInt8(a+b));return f}throw Error("RLE data with "+this.numSegments+" segments is not supported!");
|
|
740
|
-
};b.RLE.prototype.readHeader=function(){var a;this.numSegments=this.getInt32();this.size=this.numElements*this.numSegments;for(a=0;a<this.numSegments;a+=1)this.segmentOffsets[a]=this.getInt32();this.bytesRead=b.RLE.HEADER_SIZE};b.RLE.prototype.hasValidInput=function(){return this.bytesRead<this.rawData.buffer.byteLength&&this.bytesPut<this.size&&this.segElemPut<this.numElements};b.RLE.prototype.readNextSegment=function(){var a;this.bytesRead=this.segmentOffsets[this.segmentIndex];for(this.segElemPut=
|
|
741
|
-
0;this.hasValidInput();)a=this.get(),0<=a&&128>a?this.readLiteral(a):-1>=a&&-128<a?this.readEncoded(a):-128===a&&console.warn("RLE: unsupported code!");this.segmentIndex+=1};b.RLE.prototype.readLiteral=function(a){var b=a+1;if(this.hasValidInput())for(a=0;a<b;a+=1)this.put(this.get());else console.warn("RLE: insufficient data!")};b.RLE.prototype.readEncoded=function(a){var b=1-a,d=this.get();for(a=0;a<b;a+=1)this.put(d)};b.RLE.prototype.getInt32=function(){var a=this.rawData.getInt32(this.bytesRead,
|
|
742
|
-
this.littleEndian);this.bytesRead+=4;return a};b.RLE.prototype.getInt16=function(){var a=this.rawData.getInt16(this.bytesRead,this.littleEndian);this.bytesRead+=2;return a};b.RLE.prototype.get=function(){var a=this.rawData.getInt8(this.bytesRead);this.bytesRead+=1;return a};b.RLE.prototype.put=function(a){this.output.setInt8(this.bytesPut,a);this.bytesPut+=1;this.segElemPut+=1};"undefined"!==typeof d&&d.exports&&(d.exports=b.RLE)},{}],37:[function(a,d,f){var b=b||{};b.Parser=b.Parser||("undefined"!==
|
|
743
|
-
typeof a?a("./parser.js"):null);b.Image=b.Image||("undefined"!==typeof a?a("./image.js"):null);b.OrderedMap=b.OrderedMap||("undefined"!==typeof a?a("./orderedmap.js"):null);b.OrderedMapIterator=b.OrderedMapIterator||("undefined"!==typeof a?a("./iterator.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Series=b.Series||function(){this.images=[];this.imagesOriginalOrder=null;this.isCompressed=this.isElscint=this.isMosaic=!1;this.numberOfFramesInFile=this.numberOfFrames=
|
|
744
|
-
0;this.sliceSense=this.isImplicitTimeseries=this.isMultiFrameTimeseries=this.isMultiFrameVolume=this.isMultiFrame=!1;this.sliceDir=b.Image.SLICE_DIRECTION_UNKNOWN;this.error=null};b.Series.parserError=null;b.Series.parseImage=function(a){var d;d=new b.Parser;a=d.parse(a);return d.hasError()?(b.Series.parserError=d.error,null):a};b.Series.getMosaicOffset=function(a,b,d,f,k,p,t){b=t%a*b+k;p=(parseInt(t/a)*d+p)*f;return b+p};b.Series.orderDicoms=function(a,d,f){var m,k,p,t,w,B,A;m=null!==a[0].getImagePosition();
|
|
745
|
-
k=null!==a[0].getSliceLocation();p=null!==a[0].getImageNumber();a=b.Series.orderByTime(a,d,f,m,k);d=a.orderedKeys;A=[];for(t=0;t<d.length;t+=1)for(w=a.get(d[t]),B=m?b.Series.orderByImagePosition(w,f):k?b.Series.orderBySliceLocation(w):p?b.Series.orderByImageNumber(w):w,w=0;w<B.length;w+=1)A.push(B[w]);for(w=0;w<A.length;w+=1)A[w].index=w;return A};b.Series.orderByImagePosition=function(a,d){var f,m;f=new b.OrderedMap;for(m=0;m<a.length;m+=1)f.put(a[m].getImagePositionSliceDir(d),a[m]);return f.getOrderedValues()};
|
|
746
|
-
b.Series.orderBySliceLocation=function(a){var d,f;d=new b.OrderedMap;for(f=0;f<a.length;f+=1)d.put(a[f].getSliceLocation(),a[f]);return d.getOrderedValues()};b.Series.orderByImageNumber=function(a){var d,f;d=new b.OrderedMap;for(f=0;f<a.length;f+=1)d.put(a[f].getImageNumber(),a[f]);return d.getOrderedValues()};b.Series.hasMatchingSlice=function(a,b,d,f,k){var p=0,t,p=f?b.getImagePositionSliceDir(d):k?b.getSliceLocation():b.getImageNumber();for(b=0;b<a.length;b+=1)if(t=a[b],t=f?t.getImagePositionSliceDir(d):
|
|
747
|
-
k?t.getSliceLocation():t.getImageNumber(),t===p)return!0;return!1};b.Series.orderByTime=function(a,d,f,m,k){var p,t,w,B;p=new b.OrderedMap;t=1<d&&null!==a[0].getTemporalPosition();d=1<d&&null!==a[0].getTemporalNumber()&&a[0].getTemporalNumber()===d;if(t&&d)for(t=0;t<a.length;t+=1)f=a[t],m=f.getTemporalPosition(),d=p.get(m),d||(d=[],p.put(m,d)),d.push(f);else{w=new b.OrderedMap;for(t=0;t<a.length;t+=1)null!==a[t]&&(a[t].getImageNumber(),B=t,m?B=a[t].getImagePositionSliceDir(f):k&&(B=a[t].getSliceLocation()),
|
|
748
|
-
d=w.get(B),null===d&&(d=new b.OrderedMap,w.put(B,d)),d.put(t,a[t]));a=[];t=0;for(w=w.iterator();w.hasNext();)for(d=w.next(),d=d.iterator();d.hasNext();)a[t]=d.next(),t+=1;for(t=0;t<a.length;t+=1)if(null!==a[t]){w=null;for(B=p.iterator();B.hasNext();)if(d=B.next(),!b.Series.hasMatchingSlice(d,a[t],f,m,k)){w=d;break}null===w&&(w=[],p.put(p.orderedKeys.length,w));w.push(a[t])}}return p};b.Series.prototype.getOrder=function(){var a,b=[];for(a=0;a<this.imagesOriginalOrder.length;a+=1)b[a]=this.imagesOriginalOrder[a].index;
|
|
749
|
-
return b};b.Series.prototype.toString=function(){return this.images[0].getSeriesId()};b.Series.prototype.getName=function(){var a=this.images[0].getSeriesDescription(),b=this.images[0].getSeriesInstanceUID();return null!==a?a:null!==b?b:null};b.Series.prototype.addImage=function(a){this.images.push(a)};b.Series.prototype.matchesSeries=function(a){return 0===this.images.length?!0:this.images[0].getSeriesId()===a.getSeriesId()};b.Series.prototype.buildSeries=function(){var a,d,f;this.isMosaic=this.images[0].isMosaic();
|
|
750
|
-
this.isElscint=this.images[0].isElscint();this.isCompressed=this.images[0].isCompressed();this.numberOfFrames=this.images[0].getNumberOfFrames();this.numberOfFramesInFile=this.images[0].getNumberOfImplicitFrames();this.isMultiFrame=1<this.numberOfFrames||this.isMosaic&&1<this.images[0].length;this.isImplicitTimeseries=this.isMultiFrameTimeseries=this.isMultiFrameVolume=!1;this.isMultiFrame&&(a=0<this.images[0].getFrameTime(),this.isMosaic?this.isMultiFrameTimeseries=!0:a?this.isMultiFrameTimeseries=
|
|
751
|
-
!0:1<this.numberOfFramesInFile?(this.isMultiFrameTimeseries=!0,this.numberOfFrames=this.images.length):this.isMultiFrameVolume=!0);if(!this.isMosaic&&1>=this.numberOfFrames){f=this.images[0].getImagePosition()||[];d=f.toString();for(a=this.numberOfFrames=0;a<this.images.length;a+=1)f=this.images[a].getImagePosition()||[],f.toString()===d&&(this.numberOfFrames+=1);1<this.numberOfFrames&&(this.isImplicitTimeseries=!0)}this.sliceDir=this.images[0].getAcquiredSliceDirection();a=b.Series.orderDicoms(this.images,
|
|
752
|
-
this.numberOfFrames,this.sliceDir);d=a[0].getImagePositionSliceDir(this.sliceDir);f=a[a.length-1].getImagePositionSliceDir(this.sliceDir)-d;this.isMosaic?this.sliceSense=!0:this.isMultiFrame?(f=a[0].getSliceLocationVector(),null!==f?(d=a[0].getOrientation(),"Z"===d.charAt(2)?this.sliceSense=0>f[0]-f[f.length-1]:this.sliceSense=0<f[0]-f[f.length-1]):this.sliceSense=0>d?!1:!0):this.sliceSense=this.sliceDir===b.Image.SLICE_DIRECTION_SAGITTAL||this.sliceDir===b.Image.SLICE_DIRECTION_CORONAL?0<f?!1:!0:
|
|
753
|
-
0<f?!0:!1;this.imagesOriginalOrder=this.images;this.images=a};b.Series.prototype.concatenateImageData=function(a,b){var d,f,k;f=this.isMosaic?this.getMosaicData(this.images[0],this.images[0].getPixelDataBytes()):this.images[0].getPixelDataBytes();k=this.validatePixelDataLength(this.images[0]);this.images[0].clearPixelData();d=new Uint8Array(new ArrayBuffer(k*this.images.length));d.set(new Uint8Array(f,0,k),0);setTimeout(this.concatenateNextImageData(d,k,a,1,b),0)};b.Series.prototype.concatenateNextImageData=
|
|
754
|
-
function(a,d,f,m,k){var p,t;m>=this.images.length?(f&&f.drawProgress(1,"Reading DICOM Images"),k(a.buffer)):(f&&f.drawProgress(m/this.images.length,"Reading DICOM Images"),p=this.isMosaic?this.getMosaicData(this.images[m],this.images[m].getPixelDataBytes()):this.images[m].getPixelDataBytes(),t=this.validatePixelDataLength(this.images[m]),this.images[m].clearPixelData(),a.set(new Uint8Array(p,0,t),d*m),setTimeout(b.Utils.bind(this,function(){this.concatenateNextImageData(a,d,f,m+1,k)}),0))};b.Series.prototype.validatePixelDataLength=
|
|
755
|
-
function(a){var b=a.getPixelDataBytes().byteLength,d=a.getCols()*a.getRows();return 0===b%d?b:d*a.getNumberOfFrames()*a.getNumberOfSamplesPerPixel()*(a.getBitsAllocated()/8)};b.Series.prototype.getMosaicData=function(a,d){var f,m,k,p,t,w,B,A,x,G,F,z,L,l,J,K=0;t=parseInt(this.images[0].getBitsAllocated()/8);x=this.images[0].getMosaicCols()*this.images[0].getMosaicRows();G=parseInt(this.images[0].getRows()/this.images[0].getMosaicRows());F=parseInt(this.images[0].getCols()/this.images[0].getMosaicCols());
|
|
756
|
-
f=this.images[0].getCols();m=this.images[0].getRows();k=this.images[0].getMosaicRows();p=this.images[0].getMosaicCols();m=parseInt(m/k);k=parseInt(f/p);z=new Uint8Array(new ArrayBuffer(x*G*F*t));L=new Uint8Array(d);for(w=0;w<x;w+=1)for(B=0;B<G;B+=1)for(A=0;A<F;A+=1)for(l=b.Series.getMosaicOffset(p,k,m,f,A,B,w),J=0;J<t;J+=1)z[K]=L[l*t+J],K+=1;return z.buffer};"undefined"!==typeof d&&d.exports&&(d.exports=b.Series)},{"./image.js":31,"./iterator.js":32,"./orderedmap.js":34,"./parser.js":35,"./utilities.js":40}],
|
|
757
|
-
38:[function(a,d,f){var b=b||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Siemens=b.Siemens||function(a){this.output="";this.data=new DataView(a,0)};b.Siemens.CSA2_MAGIC_NUMBER=[83,86,49,48];b.Siemens.NAME_LENGTH=64;b.Siemens.ELEMENT_CSA1=4112;b.Siemens.ELEMENT_CSA2=4128;b.Siemens.GROUP_CSA=41;b.Siemens.prototype.readHeader=function(){var a,d,f;this.output+="<pre>";try{f=!0;for(d=0;d<b.Siemens.CSA2_MAGIC_NUMBER.length;d+=1)f&=this.data.getUint8(d)===b.Siemens.CSA2_MAGIC_NUMBER[d];
|
|
758
|
-
a=f?this.readHeaderAtOffset(b.Siemens.CSA2_MAGIC_NUMBER.length+4):this.readHeaderAtOffset(0)}catch(m){console.log(m)}this.output+="</pre>";return a};b.Siemens.prototype.readHeaderAtOffset=function(a){var d,f;this.output+="\n";d=b.Utils.swap32(this.data.getUint32(a));if(1>d||128<d)return this.output;a=a+4+4;for(f=0;f<d&&(a=this.readTag(a),-1!==a);f+=1);return this.output};b.Siemens.prototype.readTag=function(a){var d,f;d=this.readString(a,b.Siemens.NAME_LENGTH);a+=b.Siemens.NAME_LENGTH;a=a+4+4;a+=
|
|
759
|
-
4;f=b.Utils.swap32(this.data.getUint32(a));a+=4;a+=4;this.output+=" "+d+"=";for(d=0;d<f&&(a=this.readItem(a),-1!==a);d+=1)0!==a%4&&(a+=4-a%4);this.output+="\n";return a};b.Siemens.prototype.readString=function(a,b){var d,f,k="";for(f=0;f<b;f+=1){d=this.data.getUint8(a+f);if(0===d)break;k+=String.fromCharCode(d)}return k};b.Siemens.prototype.readItem=function(a){var d;d=b.Utils.swap32(this.data.getUint32(a));if(a+d>this.data.buffer.length)return-1;a+=16;0<d&&(this.output+=this.readString(a,d)+" ");
|
|
760
|
-
return a+d};b.Siemens.prototype.canRead=function(a,d){return a===b.Siemens.GROUP_CSA&&(d===b.Siemens.ELEMENT_CSA1||d===b.Siemens.ELEMENT_CSA2)};"undefined"!==typeof d&&d.exports&&(d.exports=b.Siemens)},{"./utilities.js":40}],39:[function(a,d,f){var b=b||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Dictionary=b.Dictionary||("undefined"!==typeof a?a("./dictionary.js"):null);b.Siemens=b.Siemens||("undefined"!==typeof a?a("./siemens.js"):null);b.Tag=b.Tag||function(a,d,f,m,
|
|
761
|
-
k,p,t,w){this.group=a;this.element=d;this.vr=f;this.offsetStart=k;this.offsetValue=p;this.offsetEnd=t;this.sublist=!1;this.id=b.Tag.createId(a,d);m instanceof Array?(this.value=m,this.sublist=!0):null!==m?(m=new DataView(m),this.value=b.Tag.convertValue(f,m,w),this.value===m&&this.isPrivateData()&&(this.value=b.Tag.convertPrivateValue(a,d,m))):this.value=null};b.Tag.PRIVATE_DATA_READERS=[b.Siemens];b.Tag.VR_AE_MAX_LENGTH=16;b.Tag.VR_AS_MAX_LENGTH=4;b.Tag.VR_AT_MAX_LENGTH=4;b.Tag.VR_CS_MAX_LENGTH=
|
|
762
|
-
16;b.Tag.VR_DA_MAX_LENGTH=8;b.Tag.VR_DS_MAX_LENGTH=16;b.Tag.VR_DT_MAX_LENGTH=26;b.Tag.VR_FL_MAX_LENGTH=4;b.Tag.VR_FD_MAX_LENGTH=8;b.Tag.VR_IS_MAX_LENGTH=12;b.Tag.VR_LO_MAX_LENGTH=64;b.Tag.VR_LT_MAX_LENGTH=10240;b.Tag.VR_OB_MAX_LENGTH=-1;b.Tag.VR_OD_MAX_LENGTH=-1;b.Tag.VR_OF_MAX_LENGTH=-1;b.Tag.VR_OW_MAX_LENGTH=-1;b.Tag.VR_PN_MAX_LENGTH=320;b.Tag.VR_SH_MAX_LENGTH=16;b.Tag.VR_SL_MAX_LENGTH=4;b.Tag.VR_SS_MAX_LENGTH=2;b.Tag.VR_ST_MAX_LENGTH=1024;b.Tag.VR_TM_MAX_LENGTH=16;b.Tag.VR_UI_MAX_LENGTH=64;b.Tag.VR_UL_MAX_LENGTH=
|
|
763
|
-
4;b.Tag.VR_UN_MAX_LENGTH=-1;b.Tag.VR_US_MAX_LENGTH=2;b.Tag.VR_UT_MAX_LENGTH=-1;b.Tag.TAG_TRANSFER_SYNTAX=[2,16];b.Tag.TAG_META_LENGTH=[2,0];b.Tag.TAG_SUBLIST_ITEM=[65534,57344];b.Tag.TAG_SUBLIST_ITEM_DELIM=[65534,57357];b.Tag.TAG_SUBLIST_SEQ_DELIM=[65534,57565];b.Tag.TAG_ROWS=[40,16];b.Tag.TAG_COLS=[40,17];b.Tag.TAG_ACQUISITION_MATRIX=[24,4880];b.Tag.TAG_NUMBER_OF_FRAMES=[40,8];b.Tag.TAG_NUMBER_TEMPORAL_POSITIONS=[32,261];b.Tag.TAG_PIXEL_SPACING=[40,48];b.Tag.TAG_SLICE_THICKNESS=[24,80];b.Tag.TAG_SLICE_GAP=
|
|
764
|
-
[24,136];b.Tag.TAG_TR=[24,128];b.Tag.TAG_FRAME_TIME=[24,4195];b.Tag.TAG_BITS_ALLOCATED=[40,256];b.Tag.TAG_BITS_STORED=[40,257];b.Tag.TAG_PIXEL_REPRESENTATION=[40,259];b.Tag.TAG_HIGH_BIT=[40,258];b.Tag.TAG_PHOTOMETRIC_INTERPRETATION=[40,4];b.Tag.TAG_SAMPLES_PER_PIXEL=[40,2];b.Tag.TAG_PLANAR_CONFIG=[40,6];b.Tag.TAG_PALETTE_RED=[40,4609];b.Tag.TAG_PALETTE_GREEN=[40,4610];b.Tag.TAG_PALETTE_BLUE=[40,4611];b.Tag.TAG_DATA_SCALE_SLOPE=[40,4179];b.Tag.TAG_DATA_SCALE_INTERCEPT=[40,4178];b.Tag.TAG_DATA_SCALE_ELSCINT=
|
|
765
|
-
[519,4127];b.Tag.TAG_PIXEL_BANDWIDTH=[24,149];b.Tag.TAG_IMAGE_MIN=[40,262];b.Tag.TAG_IMAGE_MAX=[40,263];b.Tag.TAG_WINDOW_CENTER=[40,4176];b.Tag.TAG_WINDOW_WIDTH=[40,4177];b.Tag.TAG_PATIENT_NAME=[16,16];b.Tag.TAG_PATIENT_ID=[16,32];b.Tag.TAG_STUDY_DATE=[8,32];b.Tag.TAG_STUDY_TIME=[8,48];b.Tag.TAG_STUDY_DES=[8,4144];b.Tag.TAG_IMAGE_TYPE=[8,8];b.Tag.TAG_IMAGE_COMMENTS=[32,16384];b.Tag.TAG_SEQUENCE_NAME=[24,36];b.Tag.TAG_MODALITY=[8,96];b.Tag.TAG_FRAME_OF_REF_UID=[32,82];b.Tag.TAG_STUDY_UID=[32,13];b.Tag.TAG_SERIES_DESCRIPTION=
|
|
766
|
-
[8,4158];b.Tag.TAG_SERIES_INSTANCE_UID=[32,14];b.Tag.TAG_SERIES_NUMBER=[32,17];b.Tag.TAG_ECHO_NUMBER=[24,134];b.Tag.TAG_TEMPORAL_POSITION=[32,256];b.Tag.TAG_IMAGE_NUM=[32,19];b.Tag.TAG_SLICE_LOCATION=[32,4161];b.Tag.TAG_IMAGE_ORIENTATION=[32,55];b.Tag.TAG_IMAGE_POSITION=[32,50];b.Tag.TAG_SLICE_LOCATION_VECTOR=[24,8197];b.Tag.TAG_PIXEL_DATA=[32736,16];b.Tag.createId=function(a,d){var f=b.Utils.dec2hex(a),m=b.Utils.dec2hex(d);return f+m};b.Tag.getUnsignedInteger16=function(a,b){var d,f,k;f=a.byteLength/
|
|
767
|
-
2;d=[];for(k=0;k<f;k+=1)d[k]=a.getUint16(2*k,b);return d};b.Tag.getSignedInteger16=function(a,b){var d,f,k;f=a.byteLength/2;d=[];for(k=0;k<f;k+=1)d[k]=a.getInt16(2*k,b);return d};b.Tag.getFloat32=function(a,b){var d,f,k;f=a.byteLength/4;d=[];for(k=0;k<f;k+=1)d[k]=a.getFloat32(4*k,b);return d};b.Tag.getSignedInteger32=function(a,b){var d,f,k;f=a.byteLength/4;d=[];for(k=0;k<f;k+=1)d[k]=a.getInt32(4*k,b);return d};b.Tag.getUnsignedInteger32=function(a,b){var d,f,k;f=a.byteLength/4;d=[];for(k=0;k<f;k+=
|
|
768
|
-
1)d[k]=a.getUint32(4*k,b);return d};b.Tag.getFloat64=function(a,b){var d,f,k;f=a.byteLength/8;d=[];for(k=0;k<f;k+=1)d[k]=a.getFloat64(8*k,b);return d};b.Tag.getDoubleElscint=function(a){var d=[],f=[],m;for(m=0;8>m;m+=1)d[m]=a.getUint8(m);f[0]=d[3];f[1]=d[2];f[2]=d[1];f[3]=d[0];f[4]=d[7];f[5]=d[6];f[6]=d[5];f[7]=d[4];return d=[b.Utils.bytesToDouble(f)]};b.Tag.getFixedLengthStringValue=function(a,d){var f,m,k;m=Math.floor(a.byteLength/d);f=[];for(k=0;k<m;k+=1)f[k]=b.Utils.getStringAt(a,k*d,d);return f};
|
|
769
|
-
b.Tag.getStringValue=function(a){a=b.Utils.getStringAt(a,0,a.byteLength).split("\\");var d;for(d=0;d<a.length;d+=1)a[d]=b.Utils.trim(a[d]);return a};b.Tag.getDateStringValue=function(a){var d=-1!==b.Tag.getSingleStringValue(a)[0].indexOf(".");a=b.Tag.getFixedLengthStringValue(a,d?10:b.Tag.VR_DA_MAX_LENGTH);var f=null,m=[],k;for(k=0;k<a.length;k+=1)d?(f=a[k].split("."),m[k]=3===f.length?new Date(b.Utils.safeParseInt(f[0]),b.Utils.safeParseInt(f[1])-1,b.Utils.safeParseInt(f[2])):new Date):m[k]=8===
|
|
770
|
-
a[k].length?new Date(b.Utils.safeParseInt(a[k].substring(0,4)),b.Utils.safeParseInt(a[k].substring(4,6))-1,b.Utils.safeParseInt(a[k].substring(6,8))):Date.parse(a[k]);return m};b.Tag.getDateTimeStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f,m=null,k=null,p=null,t=null,w=null,B=null;for(f=0;f<a.length;f+=1)4<=a[f].length?(m=parseInt(a[f].substring(0,4),10),6<=a[f].length&&(k=b.Utils.safeParseInt(a[f].substring(4,6))-1),8<=a[f].length&&(p=b.Utils.safeParseInt(a[f].substring(6,8))),10<=
|
|
771
|
-
a[f].length&&(t=b.Utils.safeParseInt(a[f].substring(8,10))),12<=a[f].length&&(w=b.Utils.safeParseInt(a[f].substring(10,12))),14<=a[f].length&&(B=b.Utils.safeParseInt(a[f].substring(12,14))),d[f]=new Date(m,k,p,t,w,B)):d[f]=Date.parse(a[f]);return d};b.Tag.getTimeStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f=null,m,k=0,p=0,t=0;for(m=0;m<a.length;m+=1)-1!==a[m].indexOf(":")?(f=a[m].split(":"),k=b.Utils.safeParseInt(f[0]),1<f.length&&(p=b.Utils.safeParseInt(f[1])),2<f.length&&(t=b.Utils.safeParseFloat(f[2]))):
|
|
772
|
-
(2<=a[m].length&&(k=b.Utils.safeParseInt(a[m].substring(0,2))),4<=a[m].length&&(p=b.Utils.safeParseInt(a[m].substring(2,4))),6<=a[m].length&&(t=b.Utils.safeParseFloat(a[m].substring(4)))),d[m]=Math.round(36E5*k+6E4*p+1E3*t);return d};b.Tag.getDoubleStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f;for(f=0;f<a.length;f+=1)d[f]=parseFloat(a[f]);return d};b.Tag.getIntegerStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f;for(f=0;f<a.length;f+=1)d[f]=parseInt(a[f],10);return d};b.Tag.getSingleStringValue=
|
|
773
|
-
function(a){return[b.Utils.trim(b.Utils.getStringAt(a,0,a.byteLength))]};b.Tag.getPersonNameStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f;for(f=0;f<a.length;f+=1)d[f]=a[f].replace("^"," ");return d};b.Tag.convertPrivateValue=function(a,d,f){var m,k;for(m=0;m<b.Tag.PRIVATE_DATA_READERS.length;m+=1)if(k=new b.Tag.PRIVATE_DATA_READERS[m](f.buffer),k.canRead(a,d))return k.readHeader();return f};b.Tag.convertValue=function(a,d,f){var m=null;"AE"===a?m=b.Tag.getSingleStringValue(d,b.Tag.VR_AE_MAX_LENGTH):
|
|
774
|
-
"AS"===a?m=b.Tag.getFixedLengthStringValue(d,b.Tag.VR_AS_MAX_LENGTH):"AT"===a?m=b.Tag.getUnsignedInteger16(d,f):"CS"===a?m=b.Tag.getStringValue(d):"DA"===a?m=b.Tag.getDateStringValue(d):"DS"===a?m=b.Tag.getDoubleStringValue(d):"DT"===a?m=b.Tag.getDateTimeStringValue(d):"FL"===a?m=b.Tag.getFloat32(d,f):"FD"===a?m=b.Tag.getFloat64(d,f):"FE"===a?m=b.Tag.getDoubleElscint(d,f):"IS"===a?m=b.Tag.getIntegerStringValue(d):"LO"===a?m=b.Tag.getStringValue(d):"LT"===a?m=b.Tag.getSingleStringValue(d):"OB"===a?
|
|
775
|
-
m=d:"OD"===a?m=d:"OF"===a?m=d:"OW"===a?m=d:"PN"===a?m=b.Tag.getPersonNameStringValue(d):"SH"===a?m=b.Tag.getStringValue(d):"SL"===a?m=b.Tag.getSignedInteger32(d,f):"SQ"===a?m=null:"SS"===a?m=b.Tag.getSignedInteger16(d,f):"ST"===a?m=b.Tag.getSingleStringValue(d):"TM"===a?m=b.Tag.getTimeStringValue(d):"UI"===a?m=b.Tag.getStringValue(d):"UL"===a?m=b.Tag.getUnsignedInteger32(d,f):"UN"===a?m=d:"US"===a?m=b.Tag.getUnsignedInteger16(d,f):"UT"===a&&(m=b.Tag.getSingleStringValue(d));return m};b.Tag.prototype.toString=
|
|
776
|
-
function(a,d){var f="",m;m=b.Utils.dec2hex(this.group);var k=b.Utils.dec2hex(this.element),k="("+m+","+k+")",p="",t;void 0===a&&(a=0);t="";for(m=0;m<a;m+=1)t=d?t+" ":t+" ";if(this.sublist)for(m=0;m<this.value.length;m+=1)f+="\n"+this.value[m].toString(a+1,d);else f="SQ"===this.vr?"":this.isPixelData()?"":this.value?"["+this.value+"]":"";this.isSublistItem()?k="Sequence Item":this.isSublistItemDelim()?k="Sequence Item Delimiter":this.isSequenceDelim()?k="Sequence Delimiter":this.isPixelData()?
|
|
777
|
-
k="Pixel Data":p=b.Utils.convertCamcelCaseToTitleCase(b.Dictionary.getDescription(this.group,this.element));return d?t+"<span style='color:#B5CBD3'>"+k+"</span> "+p+" "+f:t+" "+k+" "+p+" "+f};b.Tag.prototype.toHTMLString=function(a){return this.toString(a,!0)};b.Tag.prototype.isTransformSyntax=function(){return this.group===b.Tag.TAG_TRANSFER_SYNTAX[0]&&this.element===b.Tag.TAG_TRANSFER_SYNTAX[1]};b.Tag.prototype.isPixelData=function(){return this.group===b.Tag.TAG_PIXEL_DATA[0]&&
|
|
778
|
-
this.element===b.Tag.TAG_PIXEL_DATA[1]};b.Tag.prototype.isPrivateData=function(){return 1===(this.group&1)};b.Tag.prototype.hasInterpretedPrivateData=function(){return this.isPrivateData()&&b.Utils.isString(this.value)};b.Tag.prototype.isSublistItem=function(){return this.group===b.Tag.TAG_SUBLIST_ITEM[0]&&this.element===b.Tag.TAG_SUBLIST_ITEM[1]};b.Tag.prototype.isSublistItemDelim=function(){return this.group===b.Tag.TAG_SUBLIST_ITEM_DELIM[0]&&this.element===b.Tag.TAG_SUBLIST_ITEM_DELIM[1]};b.Tag.prototype.isSequenceDelim=
|
|
779
|
-
function(){return this.group===b.Tag.TAG_SUBLIST_SEQ_DELIM[0]&&this.element===b.Tag.TAG_SUBLIST_SEQ_DELIM[1]};b.Tag.prototype.isMetaLength=function(){return this.group===b.Tag.TAG_META_LENGTH[0]&&this.element===b.Tag.TAG_META_LENGTH[1]};"undefined"!==typeof d&&d.exports&&(d.exports=b.Tag)},{"./dictionary.js":30,"./siemens.js":38,"./utilities.js":40}],40:[function(a,d,f){var b=b||{};b.Utils=b.Utils||{};b.Utils.crcTable=null;b.Utils.MAX_VALUE=9007199254740991;b.Utils.MIN_VALUE=-9007199254740991;b.Utils.dec2hex=
|
|
780
|
-
function(a){return(a+65536).toString(16).substr(-4).toUpperCase()};b.Utils.createArray=function(a){var d=Array(a||0),f=a;if(1<arguments.length)for(var m=Array.prototype.slice.call(arguments,1);f--;)d[a-1-f]=b.Utils.createArray.apply(this,m);return d};b.Utils.getStringAt=function(a,b,d){var f="",k,p;for(k=0;k<d;k+=1)p=a.getUint8(b+k),0!==p&&(f+=String.fromCharCode(p));return f};b.Utils.trim=function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};b.Utils.stripLeadingZeros=function(a){return a.replace(/^[0]+/g,
|
|
781
|
-
"")};b.Utils.safeParseInt=function(a){a=b.Utils.stripLeadingZeros(a);return 0<a.length?parseInt(a,10):0};b.Utils.convertCamcelCaseToTitleCase=function(a){a=a.replace(/([A-Z][a-z])/g," $1");return b.Utils.trim(a.charAt(0).toUpperCase()+a.slice(1))};b.Utils.safeParseFloat=function(a){a=b.Utils.stripLeadingZeros(a);return 0<a.length?parseFloat(a):0};b.Utils.bytesToDouble=function(a){var b=(a[0]&128)>>7,d=(a[0]&127)<<4|(a[1]&240)>>4;if(0==d)return 0;if(2047==d)return b?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;
|
|
782
|
-
d=Math.pow(2,d-1023-52);a=a[7]+a[6]*Math.pow(2,8)+a[5]*Math.pow(2,16)+a[4]*Math.pow(2,24)+a[3]*Math.pow(2,32)+a[2]*Math.pow(2,40)+(a[1]&15)*Math.pow(2,48)+Math.pow(2,52);return Math.pow(-1,b)*a*d};b.Utils.concatArrayBuffers=function(a,b){var d=new Uint8Array(a.byteLength+b.byteLength);d.set(new Uint8Array(a),0);d.set(new Uint8Array(b),a.byteLength);return d.buffer};b.Utils.concatArrayBuffers2=function(a){var b=0,d=0,f;for(f=0;f<a.length;f+=1)b+=a[f].byteLength;b=new Uint8Array(b);for(f=0;f<a.length;f+=
|
|
783
|
-
1)b.set(new Uint8Array(a[f]),d),d+=a[f].byteLength;return b.buffer};b.Utils.fillBuffer=function(a,b,d,f){if(1===f)for(f=0;f<a.length;f+=1)b.setUint8(d+f,a[f]);else if(2===f)for(f=0;f<a.length;f+=1)b.setUint16(d+2*f,a[f],!0)};b.Utils.fillBufferRGB=function(a,b,d){var f,k,p,t,w=parseInt(a.length/3);for(t=0;t<w;t+=1)f=a[3*t],k=a[3*t+1],p=a[3*t+2],b.setUint8(d+t,parseInt((f+p+k)/3),!0)};b.Utils.bind=function(a,b,d,f){if(2===arguments.length)return function(){return b.apply(a,arguments)};var k=Array.prototype.slice;
|
|
784
|
-
return function(){var p=d||arguments;!0===f?(p=k.call(arguments,0),p=p.concat(d)):"number"===typeof f&&(p=k.call(arguments,0),Ext.Array.insert(p,f,d));return b.apply(a||window,p)}};b.Utils.toArrayBuffer=function(a){var b,d,f;b=new ArrayBuffer(a.length);d=new Uint8Array(b);for(f=0;f<a.length;f+=1)d[f]=a[f];return b};b.Utils.isString=function(a){return"string"===typeof a||a instanceof String};b.Utils.swap32=function(a){return(a&255)<<24|(a&65280)<<8|a>>8&65280|a>>24&255};b.Utils.swap16=function(a){return((a&
|
|
785
|
-
255)<<8|a>>8&255)<<16>>16};b.Utils.makeCRCTable=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b};b.Utils.crc32=function(a){for(var d=b.Utils.crcTable||(b.Utils.crcTable=b.Utils.makeCRCTable()),f=-1,m=0;m<a.byteLength;m++)f=f>>>8^d[(f^a.getUint8(m))&255];return(f^-1)>>>0};b.Utils.createBitMask=function(a,b,d){b=4294967295>>>8*(4-a)+(8*a-b);d?1==a?b&=255:2==a?b&=65535:4==a?b&=4294967295:8==a&&(b=4294967295):b=4294967295;return b};"undefined"!==
|
|
786
|
-
typeof d&&d.exports&&(d.exports=b.Utils)},{}]},{},[33])(33)});
|
|
787
|
-
var Base64Binary={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decodeArrayBuffer:function(c){var a=this._keyStr.indexOf(c.charAt(c.length-1)),d=this._keyStr.indexOf(c.charAt(c.length-2)),f=c.length/4*3;64==a&&f--;64==d&&f--;a=new ArrayBuffer(f);this.decode(c,a,f);return a},decode:function(c,a,d){var f,b,e,g,h,m=0,k=0;a=a?new Uint8Array(a):new Uint8Array(d);c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(m=0;m<d;m+=3)f=this._keyStr.indexOf(c.charAt(k++)),b=this._keyStr.indexOf(c.charAt(k++)),
|
|
788
|
-
g=this._keyStr.indexOf(c.charAt(k++)),h=this._keyStr.indexOf(c.charAt(k++)),f=f<<2|b>>4,b=(b&15)<<4|g>>2,e=(g&3)<<6|h,a[m]=f,64!=g&&(a[m+1]=b),64!=h&&(a[m+2]=e);return a}};
|
|
789
|
-
!function(c,a){"undefined"!=typeof module&&module.exports?module.exports.browser=a():"function"==typeof define?define(a):this[c]=a()}("bowser",function(){function c(a,c,d){return(a=a.match(c))&&a.length>d&&a[d]||0}function a(a){var e=/(msie|trident)/i.test(a),f=/chrome|crios/i.test(a),h=/phantom/i.test(a),m=/iphone/i.test(a),k=/ipad/i.test(a),p=/ipod/i.test(a),t=/touchpad/i.test(a),w=/silk/i.test(a),B=/safari/i.test(a)&&!f&&!h&&!w,A=/android/i.test(a),x=/opera/i.test(a)||/opr/i.test(a),G=/firefox/i.test(a),
|
|
790
|
-
F=/gecko\//i.test(a),z=/seamonkey\//i.test(a),L=/webos/i.test(a),l=/windows phone/i.test(a),J=/blackberry/i.test(a),K=/version\/(\d+(\.\d+)?)/i,E=/firefox[ \/](\d+(\.\d+)?)/i,y={};p&&(m=!1);if(l)y={name:"Windows Phone",windowsphone:!0,msie:!0,mobile:!0,version:c(a,/iemobile\/(\d+(\.\d+)?)/i,1)};else if(x)d=c(a,K,1)||c(a,/opr\/(\d+(\.\d+)?)/i,1)||c(a,/opera[ \/](\d+(\.\d+)?)/i,1),y={name:"Opera",opera:!0,version:d},A&&(y.android=!0,y.mobile=!0),f&&(y.webkit=!0);else if(e)y={name:"Internet Explorer",
|
|
791
|
-
msie:!0,version:c(a,/(msie |rv:)(\d+(\.\d+)?)/i,2)};else if(f){y={name:"Chrome",webkit:!0,chrome:!0,version:c(a,/(?:chrome|crios)\/(\d+(\.\d+)?)/i,1)};A&&(y.android=!0);if(k||p||m)y[m?"iphone":k?"ipad":"ipod"]=!0,y.ios=!0;if(y.android||y.ios)y.mobile=!0}else h?y={name:"PhantomJS",webkit:!0,phantom:!0,version:c(a,/phantomjs\/(\d+(\.\d+)?)/i,1)}:t?y={name:"TouchPad",webkit:!0,touchpad:!0,version:c(a,/touchpad\/(\d+(\.\d+)?)/i,1)}:w?y={name:"Amazon Silk",webkit:!0,android:!0,mobile:!0,version:c(a,/silk\/(\d+(\.\d+)?)/i,
|
|
792
|
-
1)}:m||k||p?(y={name:m?"iPhone":k?"iPad":"iPod",webkit:!0,mobile:!0,ios:!0},y[m?"iphone":k?"ipad":"ipod"]=!0,K.test(a)&&(y.version=c(a,K,1))):J?(y={name:"BlackBerry",blackberry:!0,mobile:!0},(d=c(a,K,1))?(y.version=d,y.webkit=!0):y.version=c(a,/blackberry[\d]+\/(\d+(\.\d+)?)/i,1)):L?y={name:"WebOS",mobile:!0,webkit:!0,webos:!0,version:c(a,K,1)||c(a,/wosbrowser\/(\d+(\.\d+)?)/i,1)}:F?(y={name:"Gecko",gecko:!0,mozilla:!0,version:c(a,E,1)},z?(y.name="SeaMonkey",y.seamonkey=!0,y.version=c(a,/seamonkey\/(\d+(\.\d+)?)/i,
|
|
793
|
-
1)):G&&(y.name="Firefox",y.firefox=!0),A?(y.android=!0,y.mobile=!0):!A&&G&&/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(a)&&(y.firefoxos=!0,y.mobile=!0)):A?y={name:"Android",webkit:!0,android:!0,mobile:!0,version:c(a,K,1)}:B&&(y={name:"Safari",webkit:!0,safari:!0,version:c(a,K,1)});if(A){if(a=c(a,/android[ \/](\d+(\.\d+)*)/i,1))y.osversion=a}else if(m||k||p){if(a=c(a,/os (\d+([_\s]\d+)*) like mac os x/i,1))y.osversion=a.replace(/[_\s]/g,".")}else l&&(a=c(a,/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,
|
|
794
|
-
1))&&(y.osversion=a);y.msie&&9<=y.version||y.chrome&&20<=y.version||y.firefox&&10<=y.version||y.safari&&5<=y.version||y.opera&&10<=y.version||y.ios&&y.osversion&&6<=y.osversion.split(".")[0]?y.a=!0:y.msie&&9>y.version||y.chrome&&20>y.version||y.firefox&&10>y.version||y.safari&&5>y.version||y.opera&&10>y.version||y.ios&&y.osversion&&6>y.osversion.split(".")[0]?y.c=!0:y.x=!0;return y}var d,f=a("undefined"!==typeof navigator?navigator.userAgent:"");f._detect=a;return f});"use strict";
|
|
795
|
-
var numeric={inv:function(c){var a=numeric.dim(c),d=Math.abs,f=a[0],a=a[1],b=c.clone(),e,g,h=numeric.identity(f),m,k,p,t,w;for(t=0;t<a;++t){g=c=-1;for(p=t;p!==f;++p)w=d(b[p][t]),w>g&&(c=p,g=w);g=b[c];b[c]=b[t];b[t]=g;k=h[c];h[c]=h[t];h[t]=k;c=g[t];for(w=t;w!==a;++w)g[w]/=c;for(w=a-1;-1!==w;--w)k[w]/=c;for(p=f-1;-1!==p;--p)if(p!==t){e=b[p];m=h[p];c=e[t];for(w=t+1;w!==a;++w)e[w]-=g[w]*c;for(w=a-1;0<w;--w)m[w]-=k[w]*c,--w,m[w]-=k[w]*c;0===w&&(m[0]-=k[0]*c)}}return h},dim:function(c){var a,d;return"object"===
|
|
796
|
-
typeof c?(a=c[0],"object"===typeof a?(d=a[0],"object"===typeof d?numeric._dim(c):[c.length,a.length]):[c.length]):[]},_dim:function(c){for(var a=[];"object"===typeof c;)a.push(c.length),c=c[0];return a},identity:function(c){return numeric.diag(numeric.rep([c],1))},rep:function(c,a,d){"undefined"===typeof d&&(d=0);var f=c[d],b=Array(f);if(d===c.length-1){for(f-=2;0<=f;f-=2)b[f+1]=a,b[f]=a;-1===f&&(b[0]=a);return b}for(--f;0<=f;f--)b[f]=numeric.rep(c,a,d+1);return b},diag:function(c){var a,d,f,b=c.length,
|
|
797
|
-
e=Array(b),g;for(a=b-1;0<=a;a--){g=Array(b);d=a+2;for(f=b-1;f>=d;f-=2)g[f]=0,g[f-1]=0;f>a&&(g[f]=0);g[a]=c[a];for(f=a-1;1<=f;f-=2)g[f]=0,g[f-1]=0;0===f&&(g[0]=0);e[a]=g}return e}};
|
|
798
|
-
!function(c){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=c();else if("function"==typeof define&&define.amd)define([],c);else{var a;"undefined"!=typeof window?a=window:"undefined"!=typeof global?a=global:"undefined"!=typeof self&&(a=self);a.pako=c()}}(function(){return function a(d,f,b){function e(h,k){if(!f[h]){if(!d[h]){var p="function"==typeof require&&require;if(!k&&p)return p(h,!0);if(g)return g(h,!0);throw Error("Cannot find module '"+h+"'");}p=f[h]={exports:{}};d[h][0].call(p.exports,
|
|
799
|
-
function(a){var b=d[h][1][a];return e(b?b:a)},p,p.exports,a,d,f,b)}return f[h].exports}for(var g="function"==typeof require&&require,h=0;h<b.length;h++)e(b[h]);return e}({1:[function(a,d,f){function b(a,b,d,e){b=new w(b);b.onFinish=e;b.push(a,!0,d)}var e=a("./zlib/inflate.js"),g=a("./utils/common"),h=a("./utils/strings"),m=a("./zlib/constants"),k=a("./zlib/messages"),p=a("./zlib/zstream"),t=a("./zlib/gzheader"),w=function(a){var b=this.options=g.assign({chunkSize:16384,windowBits:0,to:""},a||{});
|
|
800
|
-
b.raw&&0<=b.windowBits&&16>b.windowBits&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15));!(0<=b.windowBits&&16>b.windowBits)||a&&a.windowBits||(b.windowBits+=32);15<b.windowBits&&48>b.windowBits&&0===(b.windowBits&15)&&(b.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new p;this.strm.avail_out=0;a=e.inflateInit2(this.strm,b.windowBits);if(a!==m.Z_OK)throw Error(k[a]);this.header=new t;e.inflateGetHeader(this.strm,this.header)};w.prototype.push=function(a,
|
|
801
|
-
b,d){var e=this.strm;b=this.options.chunkSize;if(this.ended)return!1;e.input="string"===typeof a?h.binstring2buf(a):a;e.next_in=0;e.avail_in=e.input.length;a=(new DataView(a.buffer)).getUint32(a.byteLength-4,!0);this.progressMeter=d;this.progressIterations=a/b;this.progressIndex=0;this.progressNextGoal=.25;this.progressMeter&&this.progressMeter.drawProgress(.1,"Unpacking");setTimeout(this.pushProcess.bind(this),0)};w.prototype.pushProcess=function(){var a=this.strm,b=this.options.chunkSize,d,f,h;
|
|
802
|
-
do{0===a.avail_out&&(a.output=new g.Buf8(b),a.next_out=0,a.avail_out=b);d=e.inflate(a,m.Z_NO_FLUSH);if(d!==m.Z_STREAM_END&&d!==m.Z_OK)return this.onEnd(d),this.ended=!0,!1;if(a.next_out&&(0===a.avail_out||d===m.Z_STREAM_END||0===a.avail_in&&f===m.Z_FINISH))this.onData(g.shrinkBuf(a.output,a.next_out));this.progressIndex+=1;h=this.progressIndex/this.progressIterations;this.progressMeter&&this.progressMeter.drawProgress(h,"Unpacking")}while(h<this.progressNextGoal&&(0<a.avail_in||0===a.avail_out)&&
|
|
803
|
-
d!==m.Z_STREAM_END);(0<a.avail_in||0===a.avail_out)&&d!==m.Z_STREAM_END?(this.progressNextGoal+=.1,setTimeout(this.pushProcess.bind(this),0)):(d===m.Z_STREAM_END&&(f=m.Z_FINISH),f===m.Z_FINISH&&(d=e.inflateEnd(this.strm),this.onEnd(d),this.ended=!0),this.onFinish(this.result))};w.prototype.onData=function(a){this.chunks.push(a)};w.prototype.onEnd=function(a){a===m.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};
|
|
804
|
-
f.Inflate=w;f.inflate=b;f.inflateRaw=function(a,d){d=d||{};d.raw=!0;return b(a,d)};f.ungzip=b},{"./utils/common":2,"./utils/strings":3,"./zlib/constants":5,"./zlib/gzheader":7,"./zlib/inflate.js":9,"./zlib/messages":11,"./zlib/zstream":12}],2:[function(a,d,f){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;f.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!==typeof d)throw new TypeError(d+
|
|
805
|
-
"must be non-object");for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}}return a};f.shrinkBuf=function(a,b){if(a.length===b)return a;if(a.subarray)return a.subarray(0,b);a.length=b;return a};var b={arraySet:function(a,b,d,e,f){if(b.subarray&&a.subarray)a.set(b.subarray(d,d+e),f);else for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){var b,d,e,f,t;b=e=0;for(d=a.length;b<d;b++)e+=a[b].length;t=new Uint8Array(e);b=e=0;for(d=a.length;b<d;b++)f=a[b],t.set(f,e),e+=f.length;return t}},e={arraySet:function(a,
|
|
806
|
-
b,d,e,f){for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){return[].concat.apply([],a)}};f.setTyped=function(a){a?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,b)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(a)},{}],3:[function(a,d,f){function b(a,b){if(65537>b&&(a.subarray&&h||!a.subarray&&g))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var d="",f=0;f<b;f++)d+=String.fromCharCode(a[f]);return d}var e=a("./common"),g=!0,h=!0;
|
|
807
|
-
try{String.fromCharCode.apply(null,[0])}catch(m){g=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(k){h=!1}var p=new e.Buf8(256);for(a=0;256>a;a++)p[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;p[254]=p[254]=1;f.string2buf=function(a){var b,d,f,g,h,m=a.length,k=0;for(g=0;g<m;g++)d=a.charCodeAt(g),55296===(d&64512)&&g+1<m&&(f=a.charCodeAt(g+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),g++)),k+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(k);for(g=h=0;h<k;g++)d=a.charCodeAt(g),
|
|
808
|
-
55296===(d&64512)&&g+1<m&&(f=a.charCodeAt(g+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),g++)),128>d?b[h++]=d:(2048>d?b[h++]=192|d>>>6:(65536>d?b[h++]=224|d>>>12:(b[h++]=240|d>>>18,b[h++]=128|d>>>12&63),b[h++]=128|d>>>6&63),b[h++]=128|d&63);return b};f.buf2binstring=function(a){return b(a,a.length)};f.binstring2buf=function(a){for(var b=new e.Buf8(a.length),d=0,f=b.length;d<f;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,d){var e,f,g,h,m=d||a.length,k=Array(2*m);for(e=f=0;e<
|
|
809
|
-
m;)if(g=a[e++],128>g)k[f++]=g;else if(h=p[g],4<h)k[f++]=65533,e+=h-1;else{for(g&=2===h?31:3===h?15:7;1<h&&e<m;)g=g<<6|a[e++]&63,h--;1<h?k[f++]=65533:65536>g?k[f++]=g:(g-=65536,k[f++]=55296|g>>10&1023,k[f++]=56320|g&1023)}return b(k,f)};f.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(a[d]&192);)d--;return 0>d||0===d?b:d+p[a[d]]>b?d:b}},{"./common":2}],4:[function(a,d,f){d.exports=function(a,d,f,h){var m=a&65535|0;a=a>>>16&65535|0;for(var k=0;0!==f;){k=
|
|
810
|
-
2E3<f?2E3:f;f-=k;do m=m+d[h++]|0,a=a+m|0;while(--k);m%=65521;a%=65521}return m|a<<16|0}},{}],5:[function(a,d,f){d.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},
|
|
811
|
-
{}],6:[function(a,d,f){var b=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b}();d.exports=function(a,d,f,m){f=m+f;for(a^=-1;m<f;m++)a=a>>>8^b[(a^d[m])&255];return a^-1}},{}],7:[function(a,d,f){d.exports=function(){this.os=this.xflags=this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=0;this.done=!1}},{}],8:[function(a,d,f){d.exports=function(a,d){var f,h,m,k,p,t,w,B,A,x,G,F,z,L,l,J,K,E,y,D,u,n,q,
|
|
812
|
-
I;f=a.state;h=a.next_in;q=a.input;m=h+(a.avail_in-5);k=a.next_out;I=a.output;p=k-(d-a.avail_out);t=k+(a.avail_out-257);w=f.dmax;B=f.wsize;A=f.whave;x=f.wnext;G=f.window;F=f.hold;z=f.bits;L=f.lencode;l=f.distcode;J=(1<<f.lenbits)-1;K=(1<<f.distbits)-1;a:do b:for(15>z&&(F+=q[h++]<<z,z+=8,F+=q[h++]<<z,z+=8),E=L[F&J];;){y=E>>>24;F>>>=y;z-=y;y=E>>>16&255;if(0===y)I[k++]=E&65535;else if(y&16){D=E&65535;if(y&=15)z<y&&(F+=q[h++]<<z,z+=8),D+=F&(1<<y)-1,F>>>=y,z-=y;15>z&&(F+=q[h++]<<z,z+=8,F+=q[h++]<<z,z+=
|
|
813
|
-
8);E=l[F&K];c:for(;;){y=E>>>24;F>>>=y;z-=y;y=E>>>16&255;if(y&16){E&=65535;y&=15;z<y&&(F+=q[h++]<<z,z+=8,z<y&&(F+=q[h++]<<z,z+=8));E+=F&(1<<y)-1;if(E>w){a.msg="invalid distance too far back";f.mode=30;break a}F>>>=y;z-=y;y=k-p;if(E>y){y=E-y;if(y>A&&f.sane){a.msg="invalid distance too far back";f.mode=30;break a}u=0;n=G;if(0===x){if(u+=B-y,y<D){D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}}else if(x<y){if(u+=B+x-y,y-=x,y<D){D-=y;do I[k++]=G[u++];while(--y);u=0;if(x<D){y=x;D-=y;do I[k++]=G[u++];while(--y);
|
|
814
|
-
u=k-E;n=I}}}else if(u+=x-y,y<D){D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}for(;2<D;)I[k++]=n[u++],I[k++]=n[u++],I[k++]=n[u++],D-=3;D&&(I[k++]=n[u++],1<D&&(I[k++]=n[u++]))}else{u=k-E;do I[k++]=I[u++],I[k++]=I[u++],I[k++]=I[u++],D-=3;while(2<D);D&&(I[k++]=I[u++],1<D&&(I[k++]=I[u++]))}}else if(0===(y&64)){E=l[(E&65535)+(F&(1<<y)-1)];continue c}else{a.msg="invalid distance code";f.mode=30;break a}break}}else if(0===(y&64)){E=L[(E&65535)+(F&(1<<y)-1)];continue b}else{y&32?f.mode=12:(a.msg="invalid literal/length code",
|
|
815
|
-
f.mode=30);break a}break}while(h<m&&k<t);D=z>>3;h-=D;z-=D<<3;a.next_in=h;a.next_out=k;a.avail_in=h<m?5+(m-h):5-(h-m);a.avail_out=k<t?257+(t-k):257-(k-t);f.hold=F&(1<<z)-1;f.bits=z}},{}],9:[function(a,d,f){function b(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}function e(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=
|
|
816
|
-
this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new p.Buf16(320);this.work=new p.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(a){var b;if(!a||!a.state)return-2;b=a.state;a.total_in=a.total_out=b.total=0;a.msg="";b.wrap&&(a.adler=b.wrap&1);b.mode=1;b.last=0;b.havedict=0;b.dmax=32768;b.head=null;b.hold=0;b.bits=0;b.lencode=b.lendyn=new p.Buf32(852);b.distcode=b.distdyn=
|
|
817
|
-
new p.Buf32(592);b.sane=1;b.back=-1;return 0}function h(a){var b;if(!a||!a.state)return-2;b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return g(a)}function m(a,b){var d,e;if(!a||!a.state)return-2;e=a.state;0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15));if(b&&(8>b||15<b))return-2;null!==e.window&&e.wbits!==b&&(e.window=null);e.wrap=d;e.wbits=b;return h(a)}function k(a,b){var d;if(!a)return-2;d=new e;a.state=d;d.window=null;d=m(a,b);0!==d&&(a.state=null);return d}var p=a("../utils/common"),t=a("./adler32"),w=
|
|
818
|
-
a("./crc32"),B=a("./inffast"),A=a("./inftrees"),x=!0,G,F;f.inflateReset=h;f.inflateReset2=m;f.inflateResetKeep=g;f.inflateInit=function(a){return k(a,15)};f.inflateInit2=k;f.inflate=function(a,d){var e,f,g,h,m,k,u,n,q,I,H,v,C,P,M=0,R,T,O,Q=new p.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return-2;e=a.state;12===e.mode&&(e.mode=13);m=a.next_out;g=a.output;u=a.avail_out;h=a.next_in;f=a.input;k=a.avail_in;n=e.hold;q=e.bits;I=k;H=u;
|
|
819
|
-
O=0;a:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(e.wrap&2&&35615===n){e.check=0;Q[0]=n&255;Q[1]=n>>>8&255;e.check=w(e.check,Q,2,0);q=n=0;e.mode=2;break}e.flags=0;e.head&&(e.head.done=!1);if(!(e.wrap&1)||(((n&255)<<8)+(n>>8))%31){a.msg="incorrect header check";e.mode=30;break}if(8!==(n&15)){a.msg="unknown compression method";e.mode=30;break}n>>>=4;q-=4;C=(n&15)+8;if(0===e.wbits)e.wbits=C;else if(C>e.wbits){a.msg="invalid window size";
|
|
820
|
-
e.mode=30;break}e.dmax=1<<C;a.adler=e.check=1;e.mode=n&512?10:12;q=n=0;break;case 2:for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.flags=n;if(8!==(e.flags&255)){a.msg="unknown compression method";e.mode=30;break}if(e.flags&57344){a.msg="unknown header flags set";e.mode=30;break}e.head&&(e.head.text=n>>8&1);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0;e.mode=3;case 3:for(;32>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.head&&(e.head.time=n);e.flags&512&&(Q[0]=n&255,
|
|
821
|
-
Q[1]=n>>>8&255,Q[2]=n>>>16&255,Q[3]=n>>>24&255,e.check=w(e.check,Q,4,0));q=n=0;e.mode=4;case 4:for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.head&&(e.head.xflags=n&255,e.head.os=n>>8);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0;e.mode=5;case 5:if(e.flags&1024){for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.length=n;e.head&&(e.head.extra_len=n);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0}else e.head&&(e.head.extra=null);e.mode=6;
|
|
822
|
-
case 6:if(e.flags&1024&&(v=e.length,v>k&&(v=k),v&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=Array(e.head.extra_len)),p.arraySet(e.head.extra,f,h,v,C)),e.flags&512&&(e.check=w(e.check,f,v,h)),k-=v,h+=v,e.length-=v),e.length))break a;e.length=0;e.mode=7;case 7:if(e.flags&2048){if(0===k)break a;v=0;do C=f[h+v++],e.head&&C&&65536>e.length&&(e.head.name+=String.fromCharCode(C));while(C&&v<k);e.flags&512&&(e.check=w(e.check,f,v,h));k-=v;h+=v;if(C)break a}else e.head&&(e.head.name=
|
|
823
|
-
null);e.length=0;e.mode=8;case 8:if(e.flags&4096){if(0===k)break a;v=0;do C=f[h+v++],e.head&&C&&65536>e.length&&(e.head.comment+=String.fromCharCode(C));while(C&&v<k);e.flags&512&&(e.check=w(e.check,f,v,h));k-=v;h+=v;if(C)break a}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(e.flags&512){for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(n!==(e.check&65535)){a.msg="header crc mismatch";e.mode=30;break}q=n=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0);a.adler=e.check=0;e.mode=12;break;
|
|
824
|
-
case 10:for(;32>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}a.adler=e.check=b(n);q=n=0;e.mode=11;case 11:if(0===e.havedict)return a.next_out=m,a.avail_out=u,a.next_in=h,a.avail_in=k,e.hold=n,e.bits=q,2;a.adler=e.check=1;e.mode=12;case 12:if(5===d||6===d)break a;case 13:if(e.last){n>>>=q&7;q-=q&7;e.mode=27;break}for(;3>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.last=n&1;n>>>=1;--q;switch(n&3){case 0:e.mode=14;break;case 1:v=e;if(x){C=void 0;G=new p.Buf32(512);F=new p.Buf32(32);for(C=0;144>C;)v.lens[C++]=
|
|
825
|
-
8;for(;256>C;)v.lens[C++]=9;for(;280>C;)v.lens[C++]=7;for(;288>C;)v.lens[C++]=8;A(1,v.lens,0,288,G,0,v.work,{bits:9});for(C=0;32>C;)v.lens[C++]=5;A(2,v.lens,0,32,F,0,v.work,{bits:5});x=!1}v.lencode=G;v.lenbits=9;v.distcode=F;v.distbits=5;e.mode=20;if(6===d){n>>>=2;q-=2;break a}break;case 2:e.mode=17;break;case 3:a.msg="invalid block type",e.mode=30}n>>>=2;q-=2;break;case 14:n>>>=q&7;for(q-=q&7;32>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if((n&65535)!==(n>>>16^65535)){a.msg="invalid stored block lengths";
|
|
826
|
-
e.mode=30;break}e.length=n&65535;q=n=0;e.mode=15;if(6===d)break a;case 15:e.mode=16;case 16:if(v=e.length){v>k&&(v=k);v>u&&(v=u);if(0===v)break a;p.arraySet(g,f,h,v,m);k-=v;h+=v;u-=v;m+=v;e.length-=v;break}e.mode=12;break;case 17:for(;14>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.nlen=(n&31)+257;n>>>=5;q-=5;e.ndist=(n&31)+1;n>>>=5;q-=5;e.ncode=(n&15)+4;n>>>=4;q-=4;if(286<e.nlen||30<e.ndist){a.msg="too many length or distance symbols";e.mode=30;break}e.have=0;e.mode=18;case 18:for(;e.have<e.ncode;){for(;3>
|
|
827
|
-
q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.lens[U[e.have++]]=n&7;n>>>=3;q-=3}for(;19>e.have;)e.lens[U[e.have++]]=0;e.lencode=e.lendyn;e.lenbits=7;v={bits:e.lenbits};O=A(0,e.lens,0,19,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid code lengths set";e.mode=30;break}e.have=0;e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;;){M=e.lencode[n&(1<<e.lenbits)-1];v=M>>>24;M&=65535;if(v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(16>M)n>>>=v,q-=v,e.lens[e.have++]=M;else{if(16===M){for(C=
|
|
828
|
-
v+2;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;if(0===e.have){a.msg="invalid bit length repeat";e.mode=30;break}C=e.lens[e.have-1];v=3+(n&3);n>>>=2;q-=2}else if(17===M){for(C=v+3;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;C=0;v=3+(n&7);n>>>=3;q-=3}else{for(C=v+7;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;C=0;v=11+(n&127);n>>>=7;q-=7}if(e.have+v>e.nlen+e.ndist){a.msg="invalid bit length repeat";e.mode=30;break}for(;v--;)e.lens[e.have++]=C}}if(30===e.mode)break;
|
|
829
|
-
if(0===e.lens[256]){a.msg="invalid code -- missing end-of-block";e.mode=30;break}e.lenbits=9;v={bits:e.lenbits};O=A(1,e.lens,0,e.nlen,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid literal/lengths set";e.mode=30;break}e.distbits=6;e.distcode=e.distdyn;v={bits:e.distbits};O=A(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,v);e.distbits=v.bits;if(O){a.msg="invalid distances set";e.mode=30;break}e.mode=20;if(6===d)break a;case 20:e.mode=21;case 21:if(6<=k&&258<=u){a.next_out=m;a.avail_out=
|
|
830
|
-
u;a.next_in=h;a.avail_in=k;e.hold=n;e.bits=q;B(a,H);m=a.next_out;g=a.output;u=a.avail_out;h=a.next_in;f=a.input;k=a.avail_in;n=e.hold;q=e.bits;12===e.mode&&(e.back=-1);break}for(e.back=0;;){M=e.lencode[n&(1<<e.lenbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(C&&0===(C&240)){P=v;R=C;for(T=M;;){M=e.lencode[T+((n&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=P;q-=P;e.back+=P}n>>>=v;q-=v;e.back+=
|
|
831
|
-
v;e.length=M;if(0===C){e.mode=26;break}if(C&32){e.back=-1;e.mode=12;break}if(C&64){a.msg="invalid literal/length code";e.mode=30;break}e.extra=C&15;e.mode=22;case 22:if(e.extra){for(C=e.extra;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.length+=n&(1<<e.extra)-1;n>>>=e.extra;q-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=23;case 23:for(;;){M=e.distcode[n&(1<<e.distbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(0===(C&240)){P=v;R=C;for(T=M;;){M=e.distcode[T+
|
|
832
|
-
((n&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=P;q-=P;e.back+=P}n>>>=v;q-=v;e.back+=v;if(C&64){a.msg="invalid distance code";e.mode=30;break}e.offset=M;e.extra=C&15;e.mode=24;case 24:if(e.extra){for(C=e.extra;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.offset+=n&(1<<e.extra)-1;n>>>=e.extra;q-=e.extra;e.back+=e.extra}if(e.offset>e.dmax){a.msg="invalid distance too far back";e.mode=30;break}e.mode=25;case 25:if(0===u)break a;v=H-u;
|
|
833
|
-
if(e.offset>v){v=e.offset-v;if(v>e.whave&&e.sane){a.msg="invalid distance too far back";e.mode=30;break}v>e.wnext?(v-=e.wnext,C=e.wsize-v):C=e.wnext-v;v>e.length&&(v=e.length);P=e.window}else P=g,C=m-e.offset,v=e.length;v>u&&(v=u);u-=v;e.length-=v;do g[m++]=P[C++];while(--v);0===e.length&&(e.mode=21);break;case 26:if(0===u)break a;g[m++]=e.length;u--;e.mode=21;break;case 27:if(e.wrap){for(;32>q;){if(0===k)break a;k--;n|=f[h++]<<q;q+=8}H-=u;a.total_out+=H;e.total+=H;H&&(a.adler=e.check=e.flags?w(e.check,
|
|
834
|
-
g,H,m-H):t(e.check,g,H,m-H));H=u;if((e.flags?n:b(n))!==e.check){a.msg="incorrect data check";e.mode=30;break}q=n=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;32>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(n!==(e.total&4294967295)){a.msg="incorrect length check";e.mode=30;break}q=n=0}e.mode=29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=m;a.avail_out=u;a.next_in=h;a.avail_in=k;e.hold=n;e.bits=q;if(e.wsize||H!==a.avail_out&&30>e.mode&&(27>e.mode||4!==d))f=
|
|
835
|
-
a.output,h=a.next_out,m=H-a.avail_out,u=a.state,null===u.window&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new p.Buf8(u.wsize)),m>=u.wsize?(p.arraySet(u.window,f,h-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(k=u.wsize-u.wnext,k>m&&(k=m),p.arraySet(u.window,f,h-m,k,u.wnext),(m-=k)?(p.arraySet(u.window,f,h-m,m,0),u.wnext=m,u.whave=u.wsize):(u.wnext+=k,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=k)));I-=a.avail_in;H-=a.avail_out;a.total_in+=I;a.total_out+=H;e.total+=H;e.wrap&&
|
|
836
|
-
H&&(a.adler=e.check=e.flags?w(e.check,g,H,a.next_out-H):t(e.check,g,H,a.next_out-H));a.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0);(0===I&&0===H||4===d)&&0===O&&(O=-5);return O};f.inflateEnd=function(a){if(!a||!a.state)return-2;var b=a.state;b.window&&(b.window=null);a.state=null;return 0};f.inflateGetHeader=function(a,b){var d;if(!a||!a.state)return-2;d=a.state;if(0===(d.wrap&2))return-2;d.head=b;b.done=!1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},
|
|
837
|
-
{"../utils/common":2,"./adler32":4,"./crc32":6,"./inffast":8,"./inftrees":10}],10:[function(a,d,f){var b=a("../utils/common"),e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],m=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,
|
|
838
|
-
25,26,26,27,27,28,28,29,29,64,64];d.exports=function(a,d,f,w,B,A,x,G){for(var F=G.bits,z=0,L=0,l=0,J=0,K=0,E=0,y=0,D=0,u=0,n=0,q,I,H=null,v=0,C,P=new b.Buf16(16),E=new b.Buf16(16),M=null,R=0,T,O,Q,z=0;15>=z;z++)P[z]=0;for(L=0;L<w;L++)P[d[f+L]]++;K=F;for(J=15;1<=J&&0===P[J];J--);K>J&&(K=J);if(0===J)return B[A++]=20971520,B[A++]=20971520,G.bits=1,0;for(l=1;l<J&&0===P[l];l++);K<l&&(K=l);for(z=D=1;15>=z;z++)if(D<<=1,D-=P[z],0>D)return-1;if(0<D&&(0===a||1!==J))return-1;E[1]=0;for(z=1;15>z;z++)E[z+1]=E[z]+
|
|
839
|
-
P[z];for(L=0;L<w;L++)0!==d[f+L]&&(x[E[d[f+L]]++]=L);switch(a){case 0:H=M=x;C=19;break;case 1:H=e;v-=257;M=g;R-=257;C=256;break;default:H=h,M=m,C=-1}L=n=0;z=l;F=A;E=K;y=0;I=-1;u=1<<K;w=u-1;if(1===a&&852<u||2===a&&592<u)return 1;for(var U=0;;){U++;T=z-y;x[L]<C?(O=0,Q=x[L]):x[L]>C?(O=M[R+x[L]],Q=H[v+x[L]]):(O=96,Q=0);D=1<<z-y;l=q=1<<E;do q-=D,B[F+(n>>y)+q]=T<<24|O<<16|Q|0;while(0!==q);for(D=1<<z-1;n&D;)D>>=1;0!==D?(n&=D-1,n+=D):n=0;L++;if(0===--P[z]){if(z===J)break;z=d[f+x[L]]}if(z>K&&(n&w)!==I){0===
|
|
840
|
-
y&&(y=K);F+=l;E=z-y;for(D=1<<E;E+y<J;){D-=P[E+y];if(0>=D)break;E++;D<<=1}u+=1<<E;if(1===a&&852<u||2===a&&592<u)return 1;I=n&w;B[I]=K<<24|E<<16|F-A|0}}0!==n&&(B[F+n]=z-y<<24|4194304);G.bits=K;return 0}},{"../utils/common":2}],11:[function(a,d,f){d.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],12:[function(a,d,f){d.exports=function(){this.input=null;this.total_in=
|
|
841
|
-
this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},{}]},{},[1])(1)});
|
|
842
|
-
(function(c){"object"===typeof exports&&"undefined"!==typeof module?module.exports=c():"function"===typeof define&&define.amd?define([],c):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).nifti=c()})(function(){return function a(d,f,b){function e(h,k){if(!f[h]){if(!d[h]){var p="function"==typeof require&&require;if(!k&&p)return p(h,!0);if(g)return g(h,!0);p=Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p;}p=f[h]={exports:{}};
|
|
843
|
-
d[h][0].call(p.exports,function(a){var b=d[h][1][a];return e(b?b:a)},p,p.exports,a,d,f,b)}return f[h].exports}for(var g="function"==typeof require&&require,h=0;h<b.length;h++)e(b[h]);return e}({1:[function(a,d,f){f=a("./lib/utils/common").assign;var b=a("./lib/deflate"),e=a("./lib/inflate");a=a("./lib/zlib/constants");var g={};f(g,b,e,a);d.exports=g},{"./lib/deflate":2,"./lib/inflate":3,"./lib/utils/common":4,"./lib/zlib/constants":7}],2:[function(a,d,f){function b(a,b){var d=new t(b);d.push(a,!0);
|
|
844
|
-
if(d.err)throw d.msg;return d.result}var e=a("./zlib/deflate.js"),g=a("./utils/common"),h=a("./utils/strings"),m=a("./zlib/messages"),k=a("./zlib/zstream"),p=Object.prototype.toString,t=function(a){a=this.options=g.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new k;this.strm.avail_out=
|
|
845
|
-
0;var b=e.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(0!==b)throw Error(m[b]);a.header&&e.deflateSetHeader(this.strm,a.header)};t.prototype.push=function(a,b){var d=this.strm,f=this.options.chunkSize,m,k;if(this.ended)return!1;k=b===~~b?b:!0===b?4:0;"string"===typeof a?d.input=h.string2buf(a):"[object ArrayBuffer]"===p.call(a)?d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new g.Buf8(f),d.next_out=0,d.avail_out=
|
|
846
|
-
f);m=e.deflate(d,k);if(1!==m&&0!==m)return this.onEnd(m),this.ended=!0,!1;if(0===d.avail_out||0===d.avail_in&&(4===k||2===k))if("string"===this.options.to)this.onData(h.buf2binstring(g.shrinkBuf(d.output,d.next_out)));else this.onData(g.shrinkBuf(d.output,d.next_out))}while((0<d.avail_in||0===d.avail_out)&&1!==m);if(4===k)return m=e.deflateEnd(this.strm),this.onEnd(m),this.ended=!0,0===m;2===k&&(this.onEnd(0),d.avail_out=0);return!0};t.prototype.onData=function(a){this.chunks.push(a)};t.prototype.onEnd=
|
|
847
|
-
function(a){0===a&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Deflate=t;f.deflate=b;f.deflateRaw=function(a,d){d=d||{};d.raw=!0;return b(a,d)};f.gzip=function(a,d){d=d||{};d.gzip=!0;return b(a,d)}},{"./utils/common":4,"./utils/strings":5,"./zlib/deflate.js":9,"./zlib/messages":14,"./zlib/zstream":16}],3:[function(a,d,f){function b(a,b){var d=new B(b);d.push(a,!0);if(d.err)throw d.msg;return d.result}
|
|
848
|
-
var e=a("./zlib/inflate.js"),g=a("./utils/common"),h=a("./utils/strings"),m=a("./zlib/constants"),k=a("./zlib/messages"),p=a("./zlib/zstream"),t=a("./zlib/gzheader"),w=Object.prototype.toString,B=function(a){var b=this.options=g.assign({chunkSize:16384,windowBits:0,to:""},a||{});b.raw&&0<=b.windowBits&&16>b.windowBits&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15));!(0<=b.windowBits&&16>b.windowBits)||a&&a.windowBits||(b.windowBits+=32);15<b.windowBits&&48>b.windowBits&&0===(b.windowBits&
|
|
849
|
-
15)&&(b.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new p;this.strm.avail_out=0;a=e.inflateInit2(this.strm,b.windowBits);if(a!==m.Z_OK)throw Error(k[a]);this.header=new t;e.inflateGetHeader(this.strm,this.header)};B.prototype.push=function(a,b){var d=this.strm,f=this.options.chunkSize,k,p,l,t,B,E=!1;if(this.ended)return!1;p=b===~~b?b:!0===b?m.Z_FINISH:m.Z_NO_FLUSH;"string"===typeof a?d.input=h.binstring2buf(a):"[object ArrayBuffer]"===w.call(a)?d.input=new Uint8Array(a):
|
|
850
|
-
d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new g.Buf8(f),d.next_out=0,d.avail_out=f);k=e.inflate(d,m.Z_NO_FLUSH);k===m.Z_BUF_ERROR&&!0===E&&(k=m.Z_OK,E=!1);if(k!==m.Z_STREAM_END&&k!==m.Z_OK)return this.onEnd(k),this.ended=!0,!1;if(d.next_out&&(0===d.avail_out||k===m.Z_STREAM_END||0===d.avail_in&&(p===m.Z_FINISH||p===m.Z_SYNC_FLUSH)))if("string"===this.options.to)l=h.utf8border(d.output,d.next_out),t=d.next_out-l,B=h.buf2string(d.output,l),d.next_out=t,d.avail_out=
|
|
851
|
-
f-t,t&&g.arraySet(d.output,d.output,l,t,0),this.onData(B);else this.onData(g.shrinkBuf(d.output,d.next_out));0===d.avail_in&&0===d.avail_out&&(E=!0)}while((0<d.avail_in||0===d.avail_out)&&k!==m.Z_STREAM_END);k===m.Z_STREAM_END&&(p=m.Z_FINISH);if(p===m.Z_FINISH)return k=e.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===m.Z_OK;p===m.Z_SYNC_FLUSH&&(this.onEnd(m.Z_OK),d.avail_out=0);return!0};B.prototype.onData=function(a){this.chunks.push(a)};B.prototype.onEnd=function(a){a===m.Z_OK&&(this.result=
|
|
852
|
-
"string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Inflate=B;f.inflate=b;f.inflateRaw=function(a,d){d=d||{};d.raw=!0;return b(a,d)};f.ungzip=b},{"./utils/common":4,"./utils/strings":5,"./zlib/constants":7,"./zlib/gzheader":10,"./zlib/inflate.js":12,"./zlib/messages":14,"./zlib/zstream":16}],4:[function(a,d,f){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;f.assign=function(a){for(var b=
|
|
853
|
-
Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!==typeof d)throw new TypeError(d+"must be non-object");for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}}return a};f.shrinkBuf=function(a,b){if(a.length===b)return a;if(a.subarray)return a.subarray(0,b);a.length=b;return a};var b={arraySet:function(a,b,d,e,f){if(b.subarray&&a.subarray)a.set(b.subarray(d,d+e),f);else for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){var b,d,e,f,t;b=e=0;for(d=a.length;b<d;b++)e+=
|
|
854
|
-
a[b].length;t=new Uint8Array(e);b=e=0;for(d=a.length;b<d;b++)f=a[b],t.set(f,e),e+=f.length;return t}},e={arraySet:function(a,b,d,e,f){for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){return[].concat.apply([],a)}};f.setTyped=function(a){a?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,b)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(a)},{}],5:[function(a,d,f){function b(a,b){if(65537>b&&(a.subarray&&h||!a.subarray&&g))return String.fromCharCode.apply(null,
|
|
855
|
-
e.shrinkBuf(a,b));for(var d="",f=0;f<b;f++)d+=String.fromCharCode(a[f]);return d}var e=a("./common"),g=!0,h=!0;try{String.fromCharCode.apply(null,[0])}catch(m){g=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(k){h=!1}var p=new e.Buf8(256);for(a=0;256>a;a++)p[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;p[254]=p[254]=1;f.string2buf=function(a){var b,d,f,g,h,m=a.length,k=0;for(g=0;g<m;g++)d=a.charCodeAt(g),55296===(d&64512)&&g+1<m&&(f=a.charCodeAt(g+1),56320===(f&64512)&&(d=65536+
|
|
856
|
-
(d-55296<<10)+(f-56320),g++)),k+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(k);for(g=h=0;h<k;g++)d=a.charCodeAt(g),55296===(d&64512)&&g+1<m&&(f=a.charCodeAt(g+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),g++)),128>d?b[h++]=d:(2048>d?b[h++]=192|d>>>6:(65536>d?b[h++]=224|d>>>12:(b[h++]=240|d>>>18,b[h++]=128|d>>>12&63),b[h++]=128|d>>>6&63),b[h++]=128|d&63);return b};f.buf2binstring=function(a){return b(a,a.length)};f.binstring2buf=function(a){for(var b=new e.Buf8(a.length),d=0,f=b.length;d<
|
|
857
|
-
f;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,d){var e,f,g,h,m=d||a.length,k=Array(2*m);for(e=f=0;e<m;)if(g=a[e++],128>g)k[f++]=g;else if(h=p[g],4<h)k[f++]=65533,e+=h-1;else{for(g&=2===h?31:3===h?15:7;1<h&&e<m;)g=g<<6|a[e++]&63,h--;1<h?k[f++]=65533:65536>g?k[f++]=g:(g-=65536,k[f++]=55296|g>>10&1023,k[f++]=56320|g&1023)}return b(k,f)};f.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(a[d]&192);)d--;return 0>d||0===d?b:d+p[a[d]]>b?d:b}},{"./common":4}],
|
|
858
|
-
6:[function(a,d,f){d.exports=function(a,d,f,h){var m=a&65535|0;a=a>>>16&65535|0;for(var k=0;0!==f;){k=2E3<f?2E3:f;f-=k;do m=m+d[h++]|0,a=a+m|0;while(--k);m%=65521;a%=65521}return m|a<<16|0}},{}],7:[function(a,d,f){d.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,
|
|
859
|
-
Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],8:[function(a,d,f){var b=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b}();d.exports=function(a,d,f,m){f=m+f;for(a^=-1;m<f;m++)a=a>>>8^b[(a^d[m])&255];return a^-1}},{}],9:[function(a,d,f){function b(a,b){a.msg=y[b];return b}function e(a){for(var b=a.length;0<=--b;)a[b]=0}function g(a){var b=a.state,d=b.pending;d>a.avail_out&&(d=a.avail_out);
|
|
860
|
-
0!==d&&(l.arraySet(a.output,b.pending_buf,b.pending_out,d,a.next_out),a.next_out+=d,b.pending_out+=d,a.total_out+=d,a.avail_out-=d,b.pending-=d,0===b.pending&&(b.pending_out=0))}function h(a,b){J._tr_flush_block(a,0<=a.block_start?a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;g(a.strm)}function m(a,b){a.pending_buf[a.pending++]=b}function k(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function p(a,b){var d=a.max_chain_length,e=a.strstart,f,g=a.prev_length,
|
|
861
|
-
l=a.nice_match,h=a.strstart>a.w_size-262?a.strstart-(a.w_size-262):0,m=a.window,k=a.w_mask,p=a.prev,t=a.strstart+258,z=m[e+g-1],w=m[e+g];a.prev_length>=a.good_match&&(d>>=2);l>a.lookahead&&(l=a.lookahead);do if(f=b,m[f+g]===w&&m[f+g-1]===z&&m[f]===m[e]&&m[++f]===m[e+1]){e+=2;for(f++;m[++e]===m[++f]&&m[++e]===m[++f]&&m[++e]===m[++f]&&m[++e]===m[++f]&&m[++e]===m[++f]&&m[++e]===m[++f]&&m[++e]===m[++f]&&m[++e]===m[++f]&&e<t;);f=258-(t-e);e=t-258;if(f>g){a.match_start=b;g=f;if(f>=l)break;z=m[e+g-1];w=
|
|
862
|
-
m[e+g]}}while((b=p[b&k])>h&&0!==--d);return g<=a.lookahead?g:a.lookahead}function t(a){var b=a.w_size,d,e,f,g;do{g=a.window_size-a.lookahead-a.strstart;if(a.strstart>=b+(b-262)){l.arraySet(a.window,a.window,b,b,0);a.match_start-=b;a.strstart-=b;a.block_start-=b;d=e=a.hash_size;do f=a.head[--d],a.head[d]=f>=b?f-b:0;while(--e);d=e=b;do f=a.prev[--d],a.prev[d]=f>=b?f-b:0;while(--e);g+=b}if(0===a.strm.avail_in)break;d=a.strm;e=a.window;f=a.strstart+a.lookahead;var h=d.avail_in;h>g&&(h=g);0===h?e=0:(d.avail_in-=
|
|
863
|
-
h,l.arraySet(e,d.input,d.next_in,h,f),1===d.state.wrap?d.adler=K(d.adler,e,h,f):2===d.state.wrap&&(d.adler=E(d.adler,e,h,f)),d.next_in+=h,d.total_in+=h,e=h);a.lookahead+=e;if(3<=a.lookahead+a.insert)for(g=a.strstart-a.insert,a.ins_h=a.window[g],a.ins_h=(a.ins_h<<a.hash_shift^a.window[g+1])&a.hash_mask;a.insert&&!(a.ins_h=(a.ins_h<<a.hash_shift^a.window[g+3-1])&a.hash_mask,a.prev[g&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=g,g++,a.insert--,3>a.lookahead+a.insert););}while(262>a.lookahead&&0!==a.strm.avail_in)}
|
|
864
|
-
function w(a,b){for(var d;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);0!==d&&a.strstart-d<=a.w_size-262&&(a.match_length=p(a,d));if(3<=a.match_length)if(d=J._tr_tally(a,a.strstart-a.match_start,a.match_length-3),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&3<=a.lookahead){a.match_length--;
|
|
865
|
-
do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=J._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=2>a.strstart?a.strstart:2;return 4===
|
|
866
|
-
b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function B(a,b){for(var d,e;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);a.prev_length=a.match_length;a.prev_match=a.match_start;a.match_length=2;0!==d&&a.prev_length<a.max_lazy_match&&a.strstart-d<=a.w_size-262&&
|
|
867
|
-
(a.match_length=p(a,d),5>=a.match_length&&(1===a.strategy||3===a.match_length&&4096<a.strstart-a.match_start)&&(a.match_length=2));if(3<=a.prev_length&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-3;d=J._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-3);a.lookahead-=a.prev_length-1;a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);
|
|
868
|
-
a.match_available=0;a.match_length=2;a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return 1}else if(a.match_available){if((d=J._tr_tally(a,0,a.window[a.strstart-1]))&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return 1}else a.match_available=1,a.strstart++,a.lookahead--}a.match_available&&(J._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0);a.insert=2>a.strstart?a.strstart:2;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function A(a,
|
|
869
|
-
b){for(var d,e,f,g=a.window;;){if(258>=a.lookahead){t(a);if(258>=a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.match_length=0;if(3<=a.lookahead&&0<a.strstart&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){for(f=a.strstart+258;d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&e<f;);a.match_length=258-(f-e);a.match_length>a.lookahead&&(a.match_length=a.lookahead)}3<=a.match_length?(d=J._tr_tally(a,1,a.match_length-3),a.lookahead-=
|
|
870
|
-
a.match_length,a.strstart+=a.match_length,a.match_length=0):(d=J._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++);if(d&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function x(a,b){for(var d;;){if(0===a.lookahead&&(t(a),0===a.lookahead)){if(0===b)return 1;break}a.match_length=0;d=J._tr_tally(a,0,a.window[a.strstart]);a.lookahead--;a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=
|
|
871
|
-
0;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function G(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=8;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=
|
|
872
|
-
this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new l.Buf16(1146);this.dyn_dtree=new l.Buf16(122);this.bl_tree=new l.Buf16(78);e(this.dyn_ltree);e(this.dyn_dtree);e(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new l.Buf16(16);this.heap=new l.Buf16(573);e(this.heap);this.heap_max=this.heap_len=0;this.depth=new l.Buf16(573);
|
|
873
|
-
e(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.d_buf=this.last_lit=this.lit_bufsize=this.l_buf=0}function F(a){var d;if(!a||!a.state)return b(a,-2);a.total_in=a.total_out=0;a.data_type=2;d=a.state;d.pending=0;d.pending_out=0;0>d.wrap&&(d.wrap=-d.wrap);d.status=d.wrap?42:113;a.adler=2===d.wrap?0:1;d.last_flush=0;J._tr_init(d);return 0}function z(a){var b=F(a);0===b&&(a=a.state,a.window_size=2*a.w_size,e(a.head),a.max_lazy_match=D[a.level].max_lazy,
|
|
874
|
-
a.good_match=D[a.level].good_length,a.nice_match=D[a.level].nice_length,a.max_chain_length=D[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0);return b}function L(a,d,e,f,g,h){if(!a)return-2;var m=1;-1===d&&(d=6);0>f?(m=0,f=-f):15<f&&(m=2,f-=16);if(1>g||9<g||8!==e||8>f||15<f||0>d||9<d||0>h||4<h)return b(a,-2);8===f&&(f=9);var k=new G;a.state=k;k.strm=a;k.wrap=m;k.gzhead=null;k.w_bits=f;k.w_size=1<<k.w_bits;k.w_mask=
|
|
875
|
-
k.w_size-1;k.hash_bits=g+7;k.hash_size=1<<k.hash_bits;k.hash_mask=k.hash_size-1;k.hash_shift=~~((k.hash_bits+3-1)/3);k.window=new l.Buf8(2*k.w_size);k.head=new l.Buf16(k.hash_size);k.prev=new l.Buf16(k.w_size);k.lit_bufsize=1<<g+6;k.pending_buf_size=4*k.lit_bufsize;k.pending_buf=new l.Buf8(k.pending_buf_size);k.d_buf=k.lit_bufsize>>1;k.l_buf=3*k.lit_bufsize;k.level=d;k.strategy=h;k.method=e;return z(a)}var l=a("../utils/common"),J=a("./trees"),K=a("./adler32"),E=a("./crc32"),y=a("./messages");a=function(a,
|
|
876
|
-
b,d,e,f){this.good_length=a;this.max_lazy=b;this.nice_length=d;this.max_chain=e;this.func=f};var D;D=[new a(0,0,0,0,function(a,b){var d=65535;for(d>a.pending_buf_size-5&&(d=a.pending_buf_size-5);;){if(1>=a.lookahead){t(a);if(0===a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.strstart+=a.lookahead;a.lookahead=0;var e=a.block_start+d;if(0===a.strstart||a.strstart>=e)if(a.lookahead=a.strstart-e,a.strstart=e,h(a,!1),0===a.strm.avail_out)return 1;if(a.strstart-a.block_start>=a.w_size-262&&(h(a,
|
|
877
|
-
!1),0===a.strm.avail_out))return 1}a.insert=0;if(4===b)return h(a,!0),0===a.strm.avail_out?3:4;a.strstart>a.block_start&&h(a,!1);return 1}),new a(4,4,8,4,w),new a(4,5,16,8,w),new a(4,6,32,32,w),new a(4,4,16,16,B),new a(8,16,32,32,B),new a(8,16,128,128,B),new a(8,32,128,256,B),new a(32,128,258,1024,B),new a(32,258,258,4096,B)];f.deflateInit=function(a,b){return L(a,b,8,15,8,0)};f.deflateInit2=L;f.deflateReset=z;f.deflateResetKeep=F;f.deflateSetHeader=function(a,b){if(!a||!a.state||2!==a.state.wrap)return-2;
|
|
878
|
-
a.state.gzhead=b;return 0};f.deflate=function(a,d){var f,l,h,p;if(!a||!a.state||5<d||0>d)return a?b(a,-2):-2;l=a.state;if(!a.output||!a.input&&0!==a.avail_in||666===l.status&&4!==d)return b(a,0===a.avail_out?-5:-2);l.strm=a;f=l.last_flush;l.last_flush=d;42===l.status&&(2===l.wrap?(a.adler=0,m(l,31),m(l,139),m(l,8),l.gzhead?(m(l,(l.gzhead.text?1:0)+(l.gzhead.hcrc?2:0)+(l.gzhead.extra?4:0)+(l.gzhead.name?8:0)+(l.gzhead.comment?16:0)),m(l,l.gzhead.time&255),m(l,l.gzhead.time>>8&255),m(l,l.gzhead.time>>
|
|
879
|
-
16&255),m(l,l.gzhead.time>>24&255),m(l,9===l.level?2:2<=l.strategy||2>l.level?4:0),m(l,l.gzhead.os&255),l.gzhead.extra&&l.gzhead.extra.length&&(m(l,l.gzhead.extra.length&255),m(l,l.gzhead.extra.length>>8&255)),l.gzhead.hcrc&&(a.adler=E(a.adler,l.pending_buf,l.pending,0)),l.gzindex=0,l.status=69):(m(l,0),m(l,0),m(l,0),m(l,0),m(l,0),m(l,9===l.level?2:2<=l.strategy||2>l.level?4:0),m(l,3),l.status=113)):(h=8+(l.w_bits-8<<4)<<8,p=-1,p=2<=l.strategy||2>l.level?0:6>l.level?1:6===l.level?2:3,h|=p<<6,0!==
|
|
880
|
-
l.strstart&&(h|=32),l.status=113,k(l,h+(31-h%31)),0!==l.strstart&&(k(l,a.adler>>>16),k(l,a.adler&65535)),a.adler=1));if(69===l.status)if(l.gzhead.extra){for(h=l.pending;l.gzindex<(l.gzhead.extra.length&65535)&&(l.pending!==l.pending_buf_size||(l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending!==l.pending_buf_size));)m(l,l.gzhead.extra[l.gzindex]&255),l.gzindex++;l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h));l.gzindex===
|
|
881
|
-
l.gzhead.extra.length&&(l.gzindex=0,l.status=73)}else l.status=73;if(73===l.status)if(l.gzhead.name){h=l.pending;do{if(l.pending===l.pending_buf_size&&(l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending===l.pending_buf_size)){p=1;break}p=l.gzindex<l.gzhead.name.length?l.gzhead.name.charCodeAt(l.gzindex++)&255:0;m(l,p)}while(0!==p);l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h));0===p&&(l.gzindex=0,l.status=91)}else l.status=
|
|
882
|
-
91;if(91===l.status)if(l.gzhead.comment){h=l.pending;do{if(l.pending===l.pending_buf_size&&(l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending===l.pending_buf_size)){p=1;break}p=l.gzindex<l.gzhead.comment.length?l.gzhead.comment.charCodeAt(l.gzindex++)&255:0;m(l,p)}while(0!==p);l.gzhead.hcrc&&l.pending>h&&(a.adler=E(a.adler,l.pending_buf,l.pending-h,h));0===p&&(l.status=103)}else l.status=103;103===l.status&&(l.gzhead.hcrc?(l.pending+2>l.pending_buf_size&&
|
|
883
|
-
g(a),l.pending+2<=l.pending_buf_size&&(m(l,a.adler&255),m(l,a.adler>>8&255),a.adler=0,l.status=113)):l.status=113);if(0!==l.pending){if(g(a),0===a.avail_out)return l.last_flush=-1,0}else if(0===a.avail_in&&(d<<1)-(4<d?9:0)<=(f<<1)-(4<f?9:0)&&4!==d)return b(a,-5);if(666===l.status&&0!==a.avail_in)return b(a,-5);if(0!==a.avail_in||0!==l.lookahead||0!==d&&666!==l.status){f=2===l.strategy?x(l,d):3===l.strategy?A(l,d):D[l.level].func(l,d);if(3===f||4===f)l.status=666;if(1===f||3===f)return 0===a.avail_out&&
|
|
884
|
-
(l.last_flush=-1),0;if(2===f&&(1===d?J._tr_align(l):5!==d&&(J._tr_stored_block(l,0,0,!1),3===d&&(e(l.head),0===l.lookahead&&(l.strstart=0,l.block_start=0,l.insert=0))),g(a),0===a.avail_out))return l.last_flush=-1,0}if(4!==d)return 0;if(0>=l.wrap)return 1;2===l.wrap?(m(l,a.adler&255),m(l,a.adler>>8&255),m(l,a.adler>>16&255),m(l,a.adler>>24&255),m(l,a.total_in&255),m(l,a.total_in>>8&255),m(l,a.total_in>>16&255),m(l,a.total_in>>24&255)):(k(l,a.adler>>>16),k(l,a.adler&65535));g(a);0<l.wrap&&(l.wrap=-l.wrap);
|
|
885
|
-
return 0!==l.pending?0:1};f.deflateEnd=function(a){var d;if(!a||!a.state)return-2;d=a.state.status;if(42!==d&&69!==d&&73!==d&&91!==d&&103!==d&&113!==d&&666!==d)return b(a,-2);a.state=null;return 113===d?b(a,-3):0};f.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./messages":14,"./trees":15}],10:[function(a,d,f){d.exports=function(){this.os=this.xflags=this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=0;this.done=
|
|
886
|
-
!1}},{}],11:[function(a,d,f){d.exports=function(a,d){var f,h,m,k,p,t,w,B,A,x,G,F,z,L,l,J,K,E,y,D,u,n,q,I;f=a.state;h=a.next_in;q=a.input;m=h+(a.avail_in-5);k=a.next_out;I=a.output;p=k-(d-a.avail_out);t=k+(a.avail_out-257);w=f.dmax;B=f.wsize;A=f.whave;x=f.wnext;G=f.window;F=f.hold;z=f.bits;L=f.lencode;l=f.distcode;J=(1<<f.lenbits)-1;K=(1<<f.distbits)-1;a:do b:for(15>z&&(F+=q[h++]<<z,z+=8,F+=q[h++]<<z,z+=8),E=L[F&J];;){y=E>>>24;F>>>=y;z-=y;y=E>>>16&255;if(0===y)I[k++]=E&65535;else if(y&16){D=E&65535;
|
|
887
|
-
if(y&=15)z<y&&(F+=q[h++]<<z,z+=8),D+=F&(1<<y)-1,F>>>=y,z-=y;15>z&&(F+=q[h++]<<z,z+=8,F+=q[h++]<<z,z+=8);E=l[F&K];c:for(;;){y=E>>>24;F>>>=y;z-=y;y=E>>>16&255;if(y&16){E&=65535;y&=15;z<y&&(F+=q[h++]<<z,z+=8,z<y&&(F+=q[h++]<<z,z+=8));E+=F&(1<<y)-1;if(E>w){a.msg="invalid distance too far back";f.mode=30;break a}F>>>=y;z-=y;y=k-p;if(E>y){y=E-y;if(y>A&&f.sane){a.msg="invalid distance too far back";f.mode=30;break a}u=0;n=G;if(0===x){if(u+=B-y,y<D){D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}}else if(x<y){if(u+=
|
|
888
|
-
B+x-y,y-=x,y<D){D-=y;do I[k++]=G[u++];while(--y);u=0;if(x<D){y=x;D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}}}else if(u+=x-y,y<D){D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}for(;2<D;)I[k++]=n[u++],I[k++]=n[u++],I[k++]=n[u++],D-=3;D&&(I[k++]=n[u++],1<D&&(I[k++]=n[u++]))}else{u=k-E;do I[k++]=I[u++],I[k++]=I[u++],I[k++]=I[u++],D-=3;while(2<D);D&&(I[k++]=I[u++],1<D&&(I[k++]=I[u++]))}}else if(0===(y&64)){E=l[(E&65535)+(F&(1<<y)-1)];continue c}else{a.msg="invalid distance code";f.mode=30;break a}break}}else if(0===
|
|
889
|
-
(y&64)){E=L[(E&65535)+(F&(1<<y)-1)];continue b}else{y&32?f.mode=12:(a.msg="invalid literal/length code",f.mode=30);break a}break}while(h<m&&k<t);D=z>>3;h-=D;z-=D<<3;a.next_in=h;a.next_out=k;a.avail_in=h<m?5+(m-h):5-(h-m);a.avail_out=k<t?257+(t-k):257-(k-t);f.hold=F&(1<<z)-1;f.bits=z}},{}],12:[function(a,d,f){function b(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}function e(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=
|
|
890
|
-
null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new p.Buf16(320);this.work=new p.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(a){var b;if(!a||!a.state)return-2;b=a.state;a.total_in=a.total_out=b.total=0;a.msg="";b.wrap&&(a.adler=b.wrap&1);b.mode=1;b.last=0;b.havedict=
|
|
891
|
-
0;b.dmax=32768;b.head=null;b.hold=0;b.bits=0;b.lencode=b.lendyn=new p.Buf32(852);b.distcode=b.distdyn=new p.Buf32(592);b.sane=1;b.back=-1;return 0}function h(a){var b;if(!a||!a.state)return-2;b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return g(a)}function m(a,b){var d,e;if(!a||!a.state)return-2;e=a.state;0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15));if(b&&(8>b||15<b))return-2;null!==e.window&&e.wbits!==b&&(e.window=null);e.wrap=d;e.wbits=b;return h(a)}function k(a,b){var d;if(!a)return-2;d=new e;a.state=
|
|
892
|
-
d;d.window=null;d=m(a,b);0!==d&&(a.state=null);return d}var p=a("../utils/common"),t=a("./adler32"),w=a("./crc32"),B=a("./inffast"),A=a("./inftrees"),x=!0,G,F;f.inflateReset=h;f.inflateReset2=m;f.inflateResetKeep=g;f.inflateInit=function(a){return k(a,15)};f.inflateInit2=k;f.inflate=function(a,d){var e,f,g,h,m,k,u,n,q,I,H,v,C,P,M=0,R,T,O,Q=new p.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return-2;e=a.state;12===e.mode&&(e.mode=13);
|
|
893
|
-
m=a.next_out;g=a.output;u=a.avail_out;h=a.next_in;f=a.input;k=a.avail_in;n=e.hold;q=e.bits;I=k;H=u;O=0;a:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(e.wrap&2&&35615===n){e.check=0;Q[0]=n&255;Q[1]=n>>>8&255;e.check=w(e.check,Q,2,0);q=n=0;e.mode=2;break}e.flags=0;e.head&&(e.head.done=!1);if(!(e.wrap&1)||(((n&255)<<8)+(n>>8))%31){a.msg="incorrect header check";e.mode=30;break}if(8!==(n&15)){a.msg="unknown compression method";e.mode=
|
|
894
|
-
30;break}n>>>=4;q-=4;C=(n&15)+8;if(0===e.wbits)e.wbits=C;else if(C>e.wbits){a.msg="invalid window size";e.mode=30;break}e.dmax=1<<C;a.adler=e.check=1;e.mode=n&512?10:12;q=n=0;break;case 2:for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.flags=n;if(8!==(e.flags&255)){a.msg="unknown compression method";e.mode=30;break}if(e.flags&57344){a.msg="unknown header flags set";e.mode=30;break}e.head&&(e.head.text=n>>8&1);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0;e.mode=3;case 3:for(;32>
|
|
895
|
-
q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.head&&(e.head.time=n);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,Q[2]=n>>>16&255,Q[3]=n>>>24&255,e.check=w(e.check,Q,4,0));q=n=0;e.mode=4;case 4:for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.head&&(e.head.xflags=n&255,e.head.os=n>>8);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0;e.mode=5;case 5:if(e.flags&1024){for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.length=n;e.head&&(e.head.extra_len=n);e.flags&512&&(Q[0]=n&255,
|
|
896
|
-
Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(e.flags&1024&&(v=e.length,v>k&&(v=k),v&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=Array(e.head.extra_len)),p.arraySet(e.head.extra,f,h,v,C)),e.flags&512&&(e.check=w(e.check,f,v,h)),k-=v,h+=v,e.length-=v),e.length))break a;e.length=0;e.mode=7;case 7:if(e.flags&2048){if(0===k)break a;v=0;do C=f[h+v++],e.head&&C&&65536>e.length&&(e.head.name+=String.fromCharCode(C));while(C&&v<k);
|
|
897
|
-
e.flags&512&&(e.check=w(e.check,f,v,h));k-=v;h+=v;if(C)break a}else e.head&&(e.head.name=null);e.length=0;e.mode=8;case 8:if(e.flags&4096){if(0===k)break a;v=0;do C=f[h+v++],e.head&&C&&65536>e.length&&(e.head.comment+=String.fromCharCode(C));while(C&&v<k);e.flags&512&&(e.check=w(e.check,f,v,h));k-=v;h+=v;if(C)break a}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(e.flags&512){for(;16>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(n!==(e.check&65535)){a.msg="header crc mismatch";e.mode=30;break}q=
|
|
898
|
-
n=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0);a.adler=e.check=0;e.mode=12;break;case 10:for(;32>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}a.adler=e.check=b(n);q=n=0;e.mode=11;case 11:if(0===e.havedict)return a.next_out=m,a.avail_out=u,a.next_in=h,a.avail_in=k,e.hold=n,e.bits=q,2;a.adler=e.check=1;e.mode=12;case 12:if(5===d||6===d)break a;case 13:if(e.last){n>>>=q&7;q-=q&7;e.mode=27;break}for(;3>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.last=n&1;n>>>=1;--q;switch(n&3){case 0:e.mode=14;
|
|
899
|
-
break;case 1:v=e;if(x){C=void 0;G=new p.Buf32(512);F=new p.Buf32(32);for(C=0;144>C;)v.lens[C++]=8;for(;256>C;)v.lens[C++]=9;for(;280>C;)v.lens[C++]=7;for(;288>C;)v.lens[C++]=8;A(1,v.lens,0,288,G,0,v.work,{bits:9});for(C=0;32>C;)v.lens[C++]=5;A(2,v.lens,0,32,F,0,v.work,{bits:5});x=!1}v.lencode=G;v.lenbits=9;v.distcode=F;v.distbits=5;e.mode=20;if(6===d){n>>>=2;q-=2;break a}break;case 2:e.mode=17;break;case 3:a.msg="invalid block type",e.mode=30}n>>>=2;q-=2;break;case 14:n>>>=q&7;for(q-=q&7;32>q;){if(0===
|
|
900
|
-
k)break a;k--;n+=f[h++]<<q;q+=8}if((n&65535)!==(n>>>16^65535)){a.msg="invalid stored block lengths";e.mode=30;break}e.length=n&65535;q=n=0;e.mode=15;if(6===d)break a;case 15:e.mode=16;case 16:if(v=e.length){v>k&&(v=k);v>u&&(v=u);if(0===v)break a;p.arraySet(g,f,h,v,m);k-=v;h+=v;u-=v;m+=v;e.length-=v;break}e.mode=12;break;case 17:for(;14>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.nlen=(n&31)+257;n>>>=5;q-=5;e.ndist=(n&31)+1;n>>>=5;q-=5;e.ncode=(n&15)+4;n>>>=4;q-=4;if(286<e.nlen||30<e.ndist){a.msg=
|
|
901
|
-
"too many length or distance symbols";e.mode=30;break}e.have=0;e.mode=18;case 18:for(;e.have<e.ncode;){for(;3>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.lens[U[e.have++]]=n&7;n>>>=3;q-=3}for(;19>e.have;)e.lens[U[e.have++]]=0;e.lencode=e.lendyn;e.lenbits=7;v={bits:e.lenbits};O=A(0,e.lens,0,19,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid code lengths set";e.mode=30;break}e.have=0;e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;;){M=e.lencode[n&(1<<e.lenbits)-1];v=M>>>24;M&=65535;
|
|
902
|
-
if(v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(16>M)n>>>=v,q-=v,e.lens[e.have++]=M;else{if(16===M){for(C=v+2;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;if(0===e.have){a.msg="invalid bit length repeat";e.mode=30;break}C=e.lens[e.have-1];v=3+(n&3);n>>>=2;q-=2}else if(17===M){for(C=v+3;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;C=0;v=3+(n&7);n>>>=3;q-=3}else{for(C=v+7;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;C=0;v=11+(n&127);n>>>=7;q-=7}if(e.have+
|
|
903
|
-
v>e.nlen+e.ndist){a.msg="invalid bit length repeat";e.mode=30;break}for(;v--;)e.lens[e.have++]=C}}if(30===e.mode)break;if(0===e.lens[256]){a.msg="invalid code -- missing end-of-block";e.mode=30;break}e.lenbits=9;v={bits:e.lenbits};O=A(1,e.lens,0,e.nlen,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid literal/lengths set";e.mode=30;break}e.distbits=6;e.distcode=e.distdyn;v={bits:e.distbits};O=A(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,v);e.distbits=v.bits;if(O){a.msg="invalid distances set";
|
|
904
|
-
e.mode=30;break}e.mode=20;if(6===d)break a;case 20:e.mode=21;case 21:if(6<=k&&258<=u){a.next_out=m;a.avail_out=u;a.next_in=h;a.avail_in=k;e.hold=n;e.bits=q;B(a,H);m=a.next_out;g=a.output;u=a.avail_out;h=a.next_in;f=a.input;k=a.avail_in;n=e.hold;q=e.bits;12===e.mode&&(e.back=-1);break}for(e.back=0;;){M=e.lencode[n&(1<<e.lenbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(C&&0===(C&240)){P=v;R=C;for(T=M;;){M=e.lencode[T+((n&(1<<P+R)-1)>>P)];v=M>>>24;C=
|
|
905
|
-
M>>>16&255;M&=65535;if(P+v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=P;q-=P;e.back+=P}n>>>=v;q-=v;e.back+=v;e.length=M;if(0===C){e.mode=26;break}if(C&32){e.back=-1;e.mode=12;break}if(C&64){a.msg="invalid literal/length code";e.mode=30;break}e.extra=C&15;e.mode=22;case 22:if(e.extra){for(C=e.extra;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.length+=n&(1<<e.extra)-1;n>>>=e.extra;q-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=23;case 23:for(;;){M=e.distcode[n&(1<<e.distbits)-1];v=M>>>
|
|
906
|
-
24;C=M>>>16&255;M&=65535;if(v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(0===(C&240)){P=v;R=C;for(T=M;;){M=e.distcode[T+((n&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=q)break;if(0===k)break a;k--;n+=f[h++]<<q;q+=8}n>>>=P;q-=P;e.back+=P}n>>>=v;q-=v;e.back+=v;if(C&64){a.msg="invalid distance code";e.mode=30;break}e.offset=M;e.extra=C&15;e.mode=24;case 24:if(e.extra){for(C=e.extra;q<C;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}e.offset+=n&(1<<e.extra)-1;n>>>=e.extra;q-=e.extra;e.back+=
|
|
907
|
-
e.extra}if(e.offset>e.dmax){a.msg="invalid distance too far back";e.mode=30;break}e.mode=25;case 25:if(0===u)break a;v=H-u;if(e.offset>v){v=e.offset-v;if(v>e.whave&&e.sane){a.msg="invalid distance too far back";e.mode=30;break}v>e.wnext?(v-=e.wnext,C=e.wsize-v):C=e.wnext-v;v>e.length&&(v=e.length);P=e.window}else P=g,C=m-e.offset,v=e.length;v>u&&(v=u);u-=v;e.length-=v;do g[m++]=P[C++];while(--v);0===e.length&&(e.mode=21);break;case 26:if(0===u)break a;g[m++]=e.length;u--;e.mode=21;break;case 27:if(e.wrap){for(;32>
|
|
908
|
-
q;){if(0===k)break a;k--;n|=f[h++]<<q;q+=8}H-=u;a.total_out+=H;e.total+=H;H&&(a.adler=e.check=e.flags?w(e.check,g,H,m-H):t(e.check,g,H,m-H));H=u;if((e.flags?n:b(n))!==e.check){a.msg="incorrect data check";e.mode=30;break}q=n=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;32>q;){if(0===k)break a;k--;n+=f[h++]<<q;q+=8}if(n!==(e.total&4294967295)){a.msg="incorrect length check";e.mode=30;break}q=n=0}e.mode=29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=m;a.avail_out=
|
|
909
|
-
u;a.next_in=h;a.avail_in=k;e.hold=n;e.bits=q;if(e.wsize||H!==a.avail_out&&30>e.mode&&(27>e.mode||4!==d))f=a.output,h=a.next_out,m=H-a.avail_out,u=a.state,null===u.window&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new p.Buf8(u.wsize)),m>=u.wsize?(p.arraySet(u.window,f,h-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(k=u.wsize-u.wnext,k>m&&(k=m),p.arraySet(u.window,f,h-m,k,u.wnext),(m-=k)?(p.arraySet(u.window,f,h-m,m,0),u.wnext=m,u.whave=u.wsize):(u.wnext+=k,u.wnext===u.wsize&&(u.wnext=0),u.whave<
|
|
910
|
-
u.wsize&&(u.whave+=k)));I-=a.avail_in;H-=a.avail_out;a.total_in+=I;a.total_out+=H;e.total+=H;e.wrap&&H&&(a.adler=e.check=e.flags?w(e.check,g,H,a.next_out-H):t(e.check,g,H,a.next_out-H));a.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0);(0===I&&0===H||4===d)&&0===O&&(O=-5);return O};f.inflateEnd=function(a){if(!a||!a.state)return-2;var b=a.state;b.window&&(b.window=null);a.state=null;return 0};f.inflateGetHeader=function(a,b){var d;if(!a||!a.state)return-2;d=a.state;
|
|
911
|
-
if(0===(d.wrap&2))return-2;d.head=b;b.done=!1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./inffast":11,"./inftrees":13}],13:[function(a,d,f){var b=a("../utils/common"),e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,
|
|
912
|
-
3073,4097,6145,8193,12289,16385,24577,0,0],m=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];d.exports=function(a,d,f,w,B,A,x,G){for(var F=G.bits,z=0,L=0,l=0,J=0,K=0,E=0,y=0,D=0,u=0,n=0,q,I,H=null,v=0,C,P=new b.Buf16(16),E=new b.Buf16(16),M=null,R=0,T,O,Q,z=0;15>=z;z++)P[z]=0;for(L=0;L<w;L++)P[d[f+L]]++;K=F;for(J=15;1<=J&&0===P[J];J--);K>J&&(K=J);if(0===J)return B[A++]=20971520,B[A++]=20971520,G.bits=1,0;for(l=1;l<J&&0===P[l];l++);K<l&&(K=l);for(z=
|
|
913
|
-
D=1;15>=z;z++)if(D<<=1,D-=P[z],0>D)return-1;if(0<D&&(0===a||1!==J))return-1;E[1]=0;for(z=1;15>z;z++)E[z+1]=E[z]+P[z];for(L=0;L<w;L++)0!==d[f+L]&&(x[E[d[f+L]]++]=L);0===a?(H=M=x,C=19):1===a?(H=e,v-=257,M=g,R-=257,C=256):(H=h,M=m,C=-1);L=n=0;z=l;F=A;E=K;y=0;I=-1;u=1<<K;w=u-1;if(1===a&&852<u||2===a&&592<u)return 1;for(var U=0;;){U++;T=z-y;x[L]<C?(O=0,Q=x[L]):x[L]>C?(O=M[R+x[L]],Q=H[v+x[L]]):(O=96,Q=0);D=1<<z-y;l=q=1<<E;do q-=D,B[F+(n>>y)+q]=T<<24|O<<16|Q|0;while(0!==q);for(D=1<<z-1;n&D;)D>>=1;0!==D?
|
|
914
|
-
(n&=D-1,n+=D):n=0;L++;if(0===--P[z]){if(z===J)break;z=d[f+x[L]]}if(z>K&&(n&w)!==I){0===y&&(y=K);F+=l;E=z-y;for(D=1<<E;E+y<J;){D-=P[E+y];if(0>=D)break;E++;D<<=1}u+=1<<E;if(1===a&&852<u||2===a&&592<u)return 1;I=n&w;B[I]=K<<24|E<<16|F-A|0}}0!==n&&(B[F+n]=z-y<<24|4194304);G.bits=K;return 0}},{"../utils/common":4}],14:[function(a,d,f){d.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},
|
|
915
|
-
{}],15:[function(a,d,f){function b(a){for(var b=a.length;0<=--b;)a[b]=0}function e(a,b){a.pending_buf[a.pending++]=b&255;a.pending_buf[a.pending++]=b>>>8&255}function g(a,b,d){a.bi_valid>16-d?(a.bi_buf|=b<<a.bi_valid&65535,e(a,a.bi_buf),a.bi_buf=b>>16-a.bi_valid,a.bi_valid+=d-16):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=d)}function h(a,b,d){g(a,d[2*b],d[2*b+1])}function m(a,b){var d=0;do d|=a&1,a>>>=1,d<<=1;while(0<--b);return d>>>1}function k(a,b,d){var e=Array(16),f=0,g;for(g=1;15>=g;g++)e[g]=
|
|
916
|
-
f=f+d[g-1]<<1;for(d=0;d<=b;d++)f=a[2*d+1],0!==f&&(a[2*d]=m(e[f]++,f))}function p(a){var b;for(b=0;286>b;b++)a.dyn_ltree[2*b]=0;for(b=0;30>b;b++)a.dyn_dtree[2*b]=0;for(b=0;19>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[512]=1;a.opt_len=a.static_len=0;a.last_lit=a.matches=0}function t(a){8<a.bi_valid?e(a,a.bi_buf):0<a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf);a.bi_buf=0;a.bi_valid=0}function w(a,b,d,e){var f=2*b,g=2*d;return a[f]<a[g]||a[f]===a[g]&&e[b]<=e[d]}function B(a,b,d){for(var e=a.heap[d],f=d<<
|
|
917
|
-
1;f<=a.heap_len;){f<a.heap_len&&w(b,a.heap[f+1],a.heap[f],a.depth)&&f++;if(w(b,e,a.heap[f],a.depth))break;a.heap[d]=a.heap[f];d=f;f<<=1}a.heap[d]=e}function A(a,b,d){var e,f,l=0,k,m;if(0!==a.last_lit){do e=a.pending_buf[a.d_buf+2*l]<<8|a.pending_buf[a.d_buf+2*l+1],f=a.pending_buf[a.l_buf+l],l++,0===e?h(a,f,b):(k=q[f],h(a,k+256+1,b),m=J[k],0!==m&&(f-=I[k],g(a,f,m)),e--,k=256>e?n[e]:n[256+(e>>>7)],h(a,k,d),m=K[k],0!==m&&(e-=H[k],g(a,e,m)));while(l<a.last_lit)}h(a,256,b)}function x(a,b){var d=b.dyn_tree,
|
|
918
|
-
e=b.stat_desc.static_tree,f=b.stat_desc.has_stree,g=b.stat_desc.elems,h,l=-1,n;a.heap_len=0;a.heap_max=573;for(h=0;h<g;h++)0!==d[2*h]?(a.heap[++a.heap_len]=l=h,a.depth[h]=0):d[2*h+1]=0;for(;2>a.heap_len;)n=a.heap[++a.heap_len]=2>l?++l:0,d[2*n]=1,a.depth[n]=0,a.opt_len--,f&&(a.static_len-=e[2*n+1]);b.max_code=l;for(h=a.heap_len>>1;1<=h;h--)B(a,d,h);n=g;do h=a.heap[1],a.heap[1]=a.heap[a.heap_len--],B(a,d,1),e=a.heap[1],a.heap[--a.heap_max]=h,a.heap[--a.heap_max]=e,d[2*n]=d[2*h]+d[2*e],a.depth[n]=(a.depth[h]>=
|
|
919
|
-
a.depth[e]?a.depth[h]:a.depth[e])+1,d[2*h+1]=d[2*e+1]=n,a.heap[1]=n++,B(a,d,1);while(2<=a.heap_len);a.heap[--a.heap_max]=a.heap[1];h=b.dyn_tree;n=b.max_code;for(var m=b.stat_desc.static_tree,q=b.stat_desc.has_stree,C=b.stat_desc.extra_bits,p=b.stat_desc.extra_base,v=b.stat_desc.max_length,t,H,u=0,g=0;15>=g;g++)a.bl_count[g]=0;h[2*a.heap[a.heap_max]+1]=0;for(e=a.heap_max+1;573>e;e++)f=a.heap[e],g=h[2*h[2*f+1]+1]+1,g>v&&(g=v,u++),h[2*f+1]=g,f>n||(a.bl_count[g]++,t=0,f>=p&&(t=C[f-p]),H=h[2*f],a.opt_len+=
|
|
920
|
-
H*(g+t),q&&(a.static_len+=H*(m[2*f+1]+t)));if(0!==u){do{for(g=v-1;0===a.bl_count[g];)g--;a.bl_count[g]--;a.bl_count[g+1]+=2;a.bl_count[v]--;u-=2}while(0<u);for(g=v;0!==g;g--)for(f=a.bl_count[g];0!==f;)m=a.heap[--e],m>n||(h[2*m+1]!==g&&(a.opt_len+=(g-h[2*m+1])*h[2*m],h[2*m+1]=g),f--)}k(d,l,a.bl_count)}function G(a,b,d){var e,f=-1,g,h=b[1],l=0,n=7,k=4;0===h&&(n=138,k=3);b[2*(d+1)+1]=65535;for(e=0;e<=d;e++)g=h,h=b[2*(e+1)+1],++l<n&&g===h||(l<k?a.bl_tree[2*g]+=l:0!==g?(g!==f&&a.bl_tree[2*g]++,a.bl_tree[32]++):
|
|
921
|
-
10>=l?a.bl_tree[34]++:a.bl_tree[36]++,l=0,f=g,0===h?(n=138,k=3):g===h?(n=6,k=3):(n=7,k=4))}function F(a,b,d){var e,f=-1,l,n=b[1],k=0,m=7,q=4;0===n&&(m=138,q=3);for(e=0;e<=d;e++)if(l=n,n=b[2*(e+1)+1],!(++k<m&&l===n)){if(k<q){do h(a,l,a.bl_tree);while(0!==--k)}else 0!==l?(l!==f&&(h(a,l,a.bl_tree),k--),h(a,16,a.bl_tree),g(a,k-3,2)):10>=k?(h(a,17,a.bl_tree),g(a,k-3,3)):(h(a,18,a.bl_tree),g(a,k-11,7));k=0;f=l;0===n?(m=138,q=3):l===n?(m=6,q=3):(m=7,q=4)}}function z(a){var b=4093624447,d;for(d=0;31>=d;d++,
|
|
922
|
-
b>>>=1)if(b&1&&0!==a.dyn_ltree[2*d])return 0;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return 1;for(d=32;256>d;d++)if(0!==a.dyn_ltree[2*d])return 1;return 0}function L(a,b,d,f){g(a,0+(f?1:0),3);t(a);e(a,d);e(a,~d);l.arraySet(a.pending_buf,a.window,b,d,a.pending);a.pending+=d}var l=a("../utils/common"),J=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],K=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],
|
|
923
|
-
y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],D=Array(576);b(D);var u=Array(60);b(u);var n=Array(512);b(n);var q=Array(256);b(q);var I=Array(29);b(I);var H=Array(30);b(H);var v=function(a,b,d,e,f){this.static_tree=a;this.extra_bits=b;this.extra_base=d;this.elems=e;this.max_length=f;this.has_stree=a&&a.length},C,P,M,R=function(a,b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b},T=!1;f._tr_init=function(a){if(!T){var b,d,e,f=Array(16);for(e=d=0;28>e;e++)for(I[e]=d,b=0;b<1<<J[e];b++)q[d++]=e;
|
|
924
|
-
q[d-1]=e;for(e=d=0;16>e;e++)for(H[e]=d,b=0;b<1<<K[e];b++)n[d++]=e;for(d>>=7;30>e;e++)for(H[e]=d<<7,b=0;b<1<<K[e]-7;b++)n[256+d++]=e;for(b=0;15>=b;b++)f[b]=0;for(b=0;143>=b;)D[2*b+1]=8,b++,f[8]++;for(;255>=b;)D[2*b+1]=9,b++,f[9]++;for(;279>=b;)D[2*b+1]=7,b++,f[7]++;for(;287>=b;)D[2*b+1]=8,b++,f[8]++;k(D,287,f);for(b=0;30>b;b++)u[2*b+1]=5,u[2*b]=m(b,5);C=new v(D,J,257,286,15);P=new v(u,K,0,30,15);M=new v([],E,0,19,7);T=!0}a.l_desc=new R(a.dyn_ltree,C);a.d_desc=new R(a.dyn_dtree,P);a.bl_desc=new R(a.bl_tree,
|
|
925
|
-
M);a.bi_buf=0;a.bi_valid=0;p(a)};f._tr_stored_block=L;f._tr_flush_block=function(a,b,d,e){var f,h,l=0;if(0<a.level){2===a.strm.data_type&&(a.strm.data_type=z(a));x(a,a.l_desc);x(a,a.d_desc);G(a,a.dyn_ltree,a.l_desc.max_code);G(a,a.dyn_dtree,a.d_desc.max_code);x(a,a.bl_desc);for(l=18;3<=l&&0===a.bl_tree[2*y[l]+1];l--);a.opt_len+=3*(l+1)+14;f=a.opt_len+3+7>>>3;h=a.static_len+3+7>>>3;h<=f&&(f=h)}else f=h=d+5;if(d+4<=f&&-1!==b)L(a,b,d,e);else if(4===a.strategy||h===f)g(a,2+(e?1:0),3),A(a,D,u);else{g(a,
|
|
926
|
-
4+(e?1:0),3);b=a.l_desc.max_code+1;d=a.d_desc.max_code+1;l+=1;g(a,b-257,5);g(a,d-1,5);g(a,l-4,4);for(f=0;f<l;f++)g(a,a.bl_tree[2*y[f]+1],3);F(a,a.dyn_ltree,b-1);F(a,a.dyn_dtree,d-1);A(a,a.dyn_ltree,a.dyn_dtree)}p(a);e&&t(a)};f._tr_tally=function(a,b,d){a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255;a.pending_buf[a.d_buf+2*a.last_lit+1]=b&255;a.pending_buf[a.l_buf+a.last_lit]=d&255;a.last_lit++;0===b?a.dyn_ltree[2*d]++:(a.matches++,b--,a.dyn_ltree[2*(q[d]+256+1)]++,a.dyn_dtree[2*(256>b?n[b]:n[256+(b>>>
|
|
927
|
-
7)])]++);return a.last_lit===a.lit_bufsize-1};f._tr_align=function(a){g(a,2,3);h(a,256,D);16===a.bi_valid?(e(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):8<=a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf&255,a.bi_buf>>=8,a.bi_valid-=8)}},{"../utils/common":4}],16:[function(a,d,f){d.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},{}],17:[function(a,d,f){var b=
|
|
928
|
-
b||{};b.NIFTI1=b.NIFTI1||("undefined"!==typeof a?a("./nifti1.js"):null);b.NIFTI2=b.NIFTI2||("undefined"!==typeof a?a("./nifti2.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);var e=e||("undefined"!==typeof a?a("pako"):null);b.isNIFTI1=function(a){var d,e;d=new DataView(a);a=d.getUint8(b.NIFTI1.MAGIC_NUMBER_LOCATION);e=d.getUint8(b.NIFTI1.MAGIC_NUMBER_LOCATION+1);d=d.getUint8(b.NIFTI1.MAGIC_NUMBER_LOCATION+2);return!(a!==b.NIFTI1.MAGIC_NUMBER[0]||e!==b.NIFTI1.MAGIC_NUMBER[1]||
|
|
929
|
-
d!==b.NIFTI1.MAGIC_NUMBER[2])};b.isNIFTI2=function(a){var d,e;d=new DataView(a);a=d.getUint8(b.NIFTI2.MAGIC_NUMBER_LOCATION);e=d.getUint8(b.NIFTI2.MAGIC_NUMBER_LOCATION+1);d=d.getUint8(b.NIFTI2.MAGIC_NUMBER_LOCATION+2);return!(a!==b.NIFTI2.MAGIC_NUMBER[0]||e!==b.NIFTI2.MAGIC_NUMBER[1]||d!==b.NIFTI2.MAGIC_NUMBER[2])};b.isNIFTI=function(a){return b.isNIFTI1(a)||b.isNIFTI2(a)};b.isCompressed=function(a){var d;return a&&(d=new DataView(a),a=d.getUint8(0),d=d.getUint8(1),a===b.Utils.GUNZIP_MAGIC_COOKIE1||
|
|
930
|
-
d===b.Utils.GUNZIP_MAGIC_COOKIE2)?!0:!1};b.decompress=function(a){return e.inflate(a).buffer};b.readHeader=function(a){var d=null;b.isCompressed(a)&&(a=b.decompress(a));b.isNIFTI1(a)?d=new b.NIFTI1:b.isNIFTI2(a)&&(d=new b.NIFTI2);d?d.readHeader(a):console.error("That file does not appear to be NIFTI!");return d};b.hasExtension=function(a){return 0!=a.extensionFlag[0]};b.readImage=function(a,b){var d=a.vox_offset,e=1,f=1;a.dims[4]&&(e=a.dims[4]);a.dims[5]&&(f=a.dims[5]);return b.slice(d,d+a.numBitsPerVoxel/
|
|
931
|
-
8*a.dims[2]*a.dims[3]*e*f*a.dims[1])};b.readExtension=function(a,b){var d=a.getExtensionLocation();return b.slice(d,d+a.extensionSize)};b.readExtensionData=function(a,b){var d=a.getExtensionLocation();return b.slice(d+8,d+a.extensionSize-8)};"undefined"!==typeof d&&d.exports&&(d.exports=b)},{"./nifti1.js":18,"./nifti2.js":19,"./utilities.js":20,pako:1}],18:[function(a,d,f){var b=b||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.NIFTI1=b.NIFTI1||function(){this.littleEndian=
|
|
932
|
-
!1;this.dim_info=0;this.dims=[];this.slice_code=this.slice_end=this.slice_start=this.numBitsPerVoxel=this.datatypeCode=this.intent_code=this.intent_p3=this.intent_p2=this.intent_p1=0;this.pixDims=[];this.vox_offset=0;this.scl_slope=1;this.toffset=this.slice_duration=this.cal_min=this.cal_max=this.xyzt_units=this.scl_inter=0;this.intent_name=this.aux_file=this.description="";this.qoffset_z=this.qoffset_y=this.qoffset_x=this.quatern_d=this.quatern_c=this.quatern_b=this.sform_code=this.qform_code=0;
|
|
933
|
-
this.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.magic=0;this.isHDR=!1;this.extensionFlag=[0,0,0,0];this.extensionCode=this.extensionSize=0};b.NIFTI1.TYPE_NONE=0;b.NIFTI1.TYPE_BINARY=1;b.NIFTI1.TYPE_UINT8=2;b.NIFTI1.TYPE_INT16=4;b.NIFTI1.TYPE_INT32=8;b.NIFTI1.TYPE_FLOAT32=16;b.NIFTI1.TYPE_COMPLEX64=32;b.NIFTI1.TYPE_FLOAT64=64;b.NIFTI1.TYPE_RGB24=128;b.NIFTI1.TYPE_INT8=256;b.NIFTI1.TYPE_UINT16=512;b.NIFTI1.TYPE_UINT32=768;b.NIFTI1.TYPE_INT64=1024;b.NIFTI1.TYPE_UINT64=1280;b.NIFTI1.TYPE_FLOAT128=
|
|
934
|
-
1536;b.NIFTI1.TYPE_COMPLEX128=1792;b.NIFTI1.TYPE_COMPLEX256=2048;b.NIFTI1.XFORM_UNKNOWN=0;b.NIFTI1.XFORM_SCANNER_ANAT=1;b.NIFTI1.XFORM_ALIGNED_ANAT=2;b.NIFTI1.XFORM_TALAIRACH=3;b.NIFTI1.XFORM_MNI_152=4;b.NIFTI1.SPATIAL_UNITS_MASK=7;b.NIFTI1.TEMPORAL_UNITS_MASK=56;b.NIFTI1.UNITS_UNKNOWN=0;b.NIFTI1.UNITS_METER=1;b.NIFTI1.UNITS_MM=2;b.NIFTI1.UNITS_MICRON=3;b.NIFTI1.UNITS_SEC=8;b.NIFTI1.UNITS_MSEC=16;b.NIFTI1.UNITS_USEC=24;b.NIFTI1.UNITS_HZ=32;b.NIFTI1.UNITS_PPM=40;b.NIFTI1.UNITS_RADS=48;b.NIFTI1.MAGIC_COOKIE=
|
|
935
|
-
348;b.NIFTI1.MAGIC_NUMBER_LOCATION=344;b.NIFTI1.MAGIC_NUMBER=[110,43,49];b.NIFTI1.MAGIC_NUMBER2=[110,105,49];b.NIFTI1.EXTENSION_HEADER_SIZE=8;b.NIFTI1.prototype.readHeader=function(a){a=new DataView(a);var d=b.Utils.getIntAt(a,0,this.littleEndian),f,m;d!==b.NIFTI1.MAGIC_COOKIE&&(this.littleEndian=!0,d=b.Utils.getIntAt(a,0,this.littleEndian));if(d!==b.NIFTI1.MAGIC_COOKIE)throw Error("This does not appear to be a NIFTI file!");this.dim_info=b.Utils.getByteAt(a,39);for(f=0;8>f;f+=1)d=40+2*f,this.dims[f]=
|
|
936
|
-
b.Utils.getShortAt(a,d,this.littleEndian);this.intent_p1=b.Utils.getFloatAt(a,56,this.littleEndian);this.intent_p2=b.Utils.getFloatAt(a,60,this.littleEndian);this.intent_p3=b.Utils.getFloatAt(a,64,this.littleEndian);this.intent_code=b.Utils.getShortAt(a,68,this.littleEndian);this.datatypeCode=b.Utils.getShortAt(a,70,this.littleEndian);this.numBitsPerVoxel=b.Utils.getShortAt(a,72,this.littleEndian);this.slice_start=b.Utils.getShortAt(a,74,this.littleEndian);for(f=0;8>f;f+=1)d=76+4*f,this.pixDims[f]=
|
|
937
|
-
b.Utils.getFloatAt(a,d,this.littleEndian);this.vox_offset=b.Utils.getFloatAt(a,108,this.littleEndian);this.scl_slope=b.Utils.getFloatAt(a,112,this.littleEndian);this.scl_inter=b.Utils.getFloatAt(a,116,this.littleEndian);this.slice_end=b.Utils.getShortAt(a,120,this.littleEndian);this.slice_code=b.Utils.getByteAt(a,122);this.xyzt_units=b.Utils.getByteAt(a,123);this.cal_max=b.Utils.getFloatAt(a,124,this.littleEndian);this.cal_min=b.Utils.getFloatAt(a,128,this.littleEndian);this.slice_duration=b.Utils.getFloatAt(a,
|
|
938
|
-
132,this.littleEndian);this.toffset=b.Utils.getFloatAt(a,136,this.littleEndian);this.description=b.Utils.getStringAt(a,148,228);this.aux_file=b.Utils.getStringAt(a,228,252);this.qform_code=b.Utils.getShortAt(a,252,this.littleEndian);this.sform_code=b.Utils.getShortAt(a,254,this.littleEndian);this.quatern_b=b.Utils.getFloatAt(a,256,this.littleEndian);this.quatern_c=b.Utils.getFloatAt(a,260,this.littleEndian);this.quatern_d=b.Utils.getFloatAt(a,264,this.littleEndian);this.qoffset_x=b.Utils.getFloatAt(a,
|
|
939
|
-
268,this.littleEndian);this.qoffset_y=b.Utils.getFloatAt(a,272,this.littleEndian);this.qoffset_z=b.Utils.getFloatAt(a,276,this.littleEndian);for(f=0;3>f;f+=1)for(m=0;4>m;m+=1)d=280+4*(4*f+m),this.affine[f][m]=b.Utils.getFloatAt(a,d,this.littleEndian);this.affine[3][0]=0;this.affine[3][1]=0;this.affine[3][2]=0;this.affine[3][3]=1;this.intent_name=b.Utils.getStringAt(a,328,344);this.magic=b.Utils.getStringAt(a,344,348);this.isHDR=this.magic===b.NIFTI1.MAGIC_NUMBER2;a.byteLength>b.NIFTI1.MAGIC_COOKIE&&
|
|
940
|
-
(this.extensionFlag[0]=b.Utils.getByteAt(a,348),this.extensionFlag[1]=b.Utils.getByteAt(a,349),this.extensionFlag[2]=b.Utils.getByteAt(a,350),this.extensionFlag[3]=b.Utils.getByteAt(a,351),this.extensionFlag[0]&&(this.extensionSize=this.getExtensionSize(a),this.extensionCode=this.getExtensionCode(a)))};b.NIFTI1.prototype.toFormattedString=function(){var a=b.Utils.formatNumber,d;d=""+("Dim Info = "+this.dim_info+"\n");d+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+
|
|
941
|
-
this.dims[3]+", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+"\n";d+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+"\n";d+="Intent Code = "+this.intent_code+"\n";d+="Datatype = "+this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+")\n";d+="Bits Per Voxel = "+this.numBitsPerVoxel+"\n";d+="Slice Start = "+this.slice_start+"\n";d+="Voxel Dimensions (1-8): "+a(this.pixDims[0])+", "+a(this.pixDims[1])+", "+a(this.pixDims[2])+
|
|
942
|
-
", "+a(this.pixDims[3])+", "+a(this.pixDims[4])+", "+a(this.pixDims[5])+", "+a(this.pixDims[6])+", "+a(this.pixDims[7])+"\n";d+="Image Offset = "+this.vox_offset+"\n";d+="Data Scale: Slope = "+a(this.scl_slope)+" Intercept = "+a(this.scl_inter)+"\n";d+="Slice End = "+this.slice_end+"\n";d+="Slice Code = "+this.slice_code+"\n";d+="Units Code = "+this.xyzt_units+" ("+this.getUnitsCodeString(b.NIFTI1.SPATIAL_UNITS_MASK&this.xyzt_units)+", "+this.getUnitsCodeString(b.NIFTI1.TEMPORAL_UNITS_MASK&this.xyzt_units)+
|
|
943
|
-
")\n";d+="Display Range: Max = "+a(this.cal_max)+" Min = "+a(this.cal_min)+"\n";d+="Slice Duration = "+this.slice_duration+"\n";d+="Time Axis Shift = "+this.toffset+"\n";d+='Description: "'+this.description+'"\n';d+='Auxiliary File: "'+this.aux_file+'"\n';d+="Q-Form Code = "+this.qform_code+" ("+this.getTransformCodeString(this.qform_code)+")\n";d+="S-Form Code = "+this.sform_code+" ("+this.getTransformCodeString(this.sform_code)+")\n";d+="Quaternion Parameters: b = "+a(this.quatern_b)+" c = "+
|
|
944
|
-
a(this.quatern_c)+" d = "+a(this.quatern_d)+"\n";d+="Quaternion Offsets: x = "+this.qoffset_x+" y = "+this.qoffset_y+" z = "+this.qoffset_z+"\n";d+="S-Form Parameters X: "+a(this.affine[0][0])+", "+a(this.affine[0][1])+", "+a(this.affine[0][2])+", "+a(this.affine[0][3])+"\n";d+="S-Form Parameters Y: "+a(this.affine[1][0])+", "+a(this.affine[1][1])+", "+a(this.affine[1][2])+", "+a(this.affine[1][3])+"\n";d+="S-Form Parameters Z: "+a(this.affine[2][0])+", "+a(this.affine[2][1])+", "+a(this.affine[2][2])+
|
|
945
|
-
", "+a(this.affine[2][3])+"\n";d+='Intent Name: "'+this.intent_name+'"\n';this.extensionFlag[0]&&(d+="Extension: Size = "+this.extensionSize+" Code = "+this.extensionCode+"\n");return d};b.NIFTI1.prototype.getDatatypeCodeString=function(a){return a===b.NIFTI1.TYPE_UINT8?"1-Byte Unsigned Integer":a===b.NIFTI1.TYPE_INT16?"2-Byte Signed Integer":a===b.NIFTI1.TYPE_INT32?"4-Byte Signed Integer":a===b.NIFTI1.TYPE_FLOAT32?"4-Byte Float":a===b.NIFTI1.TYPE_FLOAT64?"8-Byte Float":a===b.NIFTI1.TYPE_RGB24?"RGB":
|
|
946
|
-
a===b.NIFTI1.TYPE_INT8?"1-Byte Signed Integer":a===b.NIFTI1.TYPE_UINT16?"2-Byte Unsigned Integer":a===b.NIFTI1.TYPE_UINT32?"4-Byte Unsigned Integer":a===b.NIFTI1.TYPE_INT64?"8-Byte Signed Integer":a===b.NIFTI1.TYPE_UINT64?"8-Byte Unsigned Integer":"Unknown"};b.NIFTI1.prototype.getTransformCodeString=function(a){return a===b.NIFTI1.XFORM_SCANNER_ANAT?"Scanner":a===b.NIFTI1.XFORM_ALIGNED_ANAT?"Aligned":a===b.NIFTI1.XFORM_TALAIRACH?"Talairach":a===b.NIFTI1.XFORM_MNI_152?"MNI":"Unknown"};b.NIFTI1.prototype.getUnitsCodeString=
|
|
947
|
-
function(a){return a===b.NIFTI1.UNITS_METER?"Meters":a===b.NIFTI1.UNITS_MM?"Millimeters":a===b.NIFTI1.UNITS_MICRON?"Microns":a===b.NIFTI1.UNITS_SEC?"Seconds":a===b.NIFTI1.UNITS_MSEC?"Milliseconds":a===b.NIFTI1.UNITS_USEC?"Microseconds":a===b.NIFTI1.UNITS_HZ?"Hz":a===b.NIFTI1.UNITS_PPM?"PPM":a===b.NIFTI1.UNITS_RADS?"Rads":"Unknown"};b.NIFTI1.prototype.getQformMat=function(){return this.convertNiftiQFormToNiftiSForm(this.quatern_b,this.quatern_c,this.quatern_d,this.qoffset_x,this.qoffset_y,this.qoffset_z,
|
|
948
|
-
this.pixDims[1],this.pixDims[2],this.pixDims[3],this.pixDims[0])};b.NIFTI1.prototype.convertNiftiQFormToNiftiSForm=function(a,b,d,f,k,p,t,w,B,A){var x=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],G=d;x[3][0]=x[3][1]=x[3][2]=0;x[3][3]=1;d=1-(a*a+b*b+G*G);1E-7>d?(d=1/Math.sqrt(a*a+b*b+G*G),a*=d,b*=d,G*=d,d=0):d=Math.sqrt(d);t=0<t?t:1;w=0<w?w:1;B=0<B?B:1;0>A&&(B=-B);x[0][0]=(d*d+a*a-b*b-G*G)*t;x[0][1]=2*(a*b-d*G)*w;x[0][2]=2*(a*G+d*b)*B;x[1][0]=2*(a*b+d*G)*t;x[1][1]=(d*d+b*b-a*a-G*G)*w;x[1][2]=2*(b*G-d*
|
|
949
|
-
a)*B;x[2][0]=2*(a*G-d*b)*t;x[2][1]=2*(b*G+d*a)*w;x[2][2]=(d*d+G*G-b*b-a*a)*B;x[0][3]=f;x[1][3]=k;x[2][3]=p;return x};b.NIFTI1.prototype.convertNiftiSFormToNEMA=function(a){var b,d,f,k,p,t,w,B,A,x,G,F,z,L,l,J;l=[[0,0,0],[0,0,0],[0,0,0]];J=[[0,0,0],[0,0,0],[0,0,0]];b=a[0][0];d=a[0][1];f=a[0][2];k=a[1][0];p=a[1][1];t=a[1][2];w=a[2][0];B=a[2][1];A=a[2][2];a=Math.sqrt(b*b+k*k+w*w);if(0===a)return null;b/=a;k/=a;w/=a;a=Math.sqrt(d*d+p*p+B*B);if(0===a)return null;d/=a;p/=a;B/=a;a=b*d+k*p+w*B;if(1E-4<Math.abs(a)){d-=
|
|
950
|
-
a*b;p-=a*k;B-=a*w;a=Math.sqrt(d*d+p*p+B*B);if(0===a)return null;d/=a;p/=a;B/=a}a=Math.sqrt(f*f+t*t+A*A);0===a?(f=k*B-w*p,t=w*d-B*b,A=b*p-k*d):(f/=a,t/=a,A/=a);a=b*f+k*t+w*A;if(1E-4<Math.abs(a)){f-=a*b;t-=a*k;A-=a*w;a=Math.sqrt(f*f+t*t+A*A);if(0===a)return null;f/=a;t/=a;A/=a}a=d*f+p*t+B*A;if(1E-4<Math.abs(a)){f-=a*d;t-=a*p;A-=a*B;a=Math.sqrt(f*f+t*t+A*A);if(0===a)return null;f/=a;t/=a;A/=a}l[0][0]=b;l[0][1]=d;l[0][2]=f;l[1][0]=k;l[1][1]=p;l[1][2]=t;l[2][0]=w;l[2][1]=B;l[2][2]=A;w=this.nifti_mat33_determ(l);
|
|
951
|
-
if(0===w)return null;L=-666;b=k=p=t=1;d=2;f=3;for(B=1;3>=B;B+=1)for(A=1;3>=A;A+=1)if(B!==A)for(x=1;3>=x;x+=1)if(B!==x&&A!==x)for(J[0][0]=J[0][1]=J[0][2]=J[1][0]=J[1][1]=J[1][2]=J[2][0]=J[2][1]=J[2][2]=0,G=-1;1>=G;G+=2)for(F=-1;1>=F;F+=2)for(z=-1;1>=z;z+=2)J[0][B-1]=G,J[1][A-1]=F,J[2][x-1]=z,a=this.nifti_mat33_determ(J),0<a*w&&(a=this.nifti_mat33_mul(J,l),a=a[0][0]+a[1][1]+a[2][2],a>L&&(L=a,b=B,d=A,f=x,k=G,p=F,t=z));l=J=a=w=B=A=0;switch(b*k){case 1:l="X";w="+";break;case -1:l="X";w="-";break;case 2:l=
|
|
952
|
-
"Y";w="+";break;case -2:l="Y";w="-";break;case 3:l="Z";w="+";break;case -3:l="Z",w="-"}switch(d*p){case 1:J="X";B="+";break;case -1:J="X";B="-";break;case 2:J="Y";B="+";break;case -2:J="Y";B="-";break;case 3:J="Z";B="+";break;case -3:J="Z",B="-"}switch(f*t){case 1:a="X";A="+";break;case -1:a="X";A="-";break;case 2:a="Y";A="+";break;case -2:a="Y";A="-";break;case 3:a="Z";A="+";break;case -3:a="Z",A="-"}return l+J+a+w+B+A};b.NIFTI1.prototype.nifti_mat33_mul=function(a,b){var d=[[0,0,0],[0,0,0],[0,0,
|
|
953
|
-
0]],f,k;for(f=0;3>f;f+=1)for(k=0;3>k;k+=1)d[f][k]=a[f][0]*b[0][k]+a[f][1]*b[1][k]+a[f][2]*b[2][k];return d};b.NIFTI1.prototype.nifti_mat33_determ=function(a){var b,d,f,k,p,t,w,B;b=a[0][0];d=a[0][1];f=a[0][2];k=a[1][0];p=a[1][1];t=a[1][2];w=a[2][0];B=a[2][1];a=a[2][2];return b*p*a-b*B*t-k*d*a+k*B*f+w*d*t-w*p*f};b.NIFTI1.prototype.getExtensionLocation=function(){return b.NIFTI1.MAGIC_COOKIE+4};b.NIFTI1.prototype.getExtensionSize=function(a){return b.Utils.getIntAt(a,this.getExtensionLocation(),this.littleEndian)};
|
|
954
|
-
b.NIFTI1.prototype.getExtensionCode=function(a){return b.Utils.getIntAt(a,this.getExtensionLocation()+4,this.littleEndian)};"undefined"!==typeof d&&d.exports&&(d.exports=b.NIFTI1)},{"./utilities.js":20}],19:[function(a,d,f){var b=b||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.NIFTI1=b.NIFTI1||("undefined"!==typeof a?a("./nifti1.js"):null);b.NIFTI2=b.NIFTI2||function(){this.littleEndian=!1;this.dim_info=0;this.dims=[];this.slice_code=this.slice_end=this.slice_start=this.numBitsPerVoxel=
|
|
955
|
-
this.datatypeCode=this.intent_code=this.intent_p3=this.intent_p2=this.intent_p1=0;this.pixDims=[];this.vox_offset=0;this.scl_slope=1;this.toffset=this.slice_duration=this.cal_min=this.cal_max=this.xyzt_units=this.scl_inter=0;this.intent_name=this.aux_file=this.description="";this.qoffset_z=this.qoffset_y=this.qoffset_x=this.quatern_d=this.quatern_c=this.quatern_b=this.sform_code=this.qform_code=0;this.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.magic=0;this.extensionFlag=[0,0,0,0]};b.NIFTI2.MAGIC_COOKIE=
|
|
956
|
-
540;b.NIFTI2.MAGIC_NUMBER_LOCATION=4;b.NIFTI2.MAGIC_NUMBER=[110,43,50,0,13,10,26,10];b.NIFTI2.prototype.readHeader=function(a){a=new DataView(a);var d=b.Utils.getIntAt(a,0,this.littleEndian),f,m;d!==b.NIFTI2.MAGIC_COOKIE&&(this.littleEndian=!0,d=b.Utils.getIntAt(a,0,this.littleEndian));if(d!==b.NIFTI2.MAGIC_COOKIE)throw Error("This does not appear to be a NIFTI file!");this.datatypeCode=b.Utils.getShortAt(a,12,this.littleEndian);this.numBitsPerVoxel=b.Utils.getShortAt(a,14,this.littleEndian);for(f=
|
|
957
|
-
0;8>f;f+=1)d=16+8*f,this.dims[f]=b.Utils.getLongAt(a,d,this.littleEndian);this.intent_p1=b.Utils.getDoubleAt(a,80,this.littleEndian);this.intent_p2=b.Utils.getDoubleAt(a,88,this.littleEndian);this.intent_p3=b.Utils.getDoubleAt(a,96,this.littleEndian);for(f=0;8>f;f+=1)d=104+8*f,this.pixDims[f]=b.Utils.getDoubleAt(a,d,this.littleEndian);this.vox_offset=b.Utils.getLongAt(a,168,this.littleEndian);this.scl_slope=b.Utils.getDoubleAt(a,176,this.littleEndian);this.scl_inter=b.Utils.getDoubleAt(a,184,this.littleEndian);
|
|
958
|
-
this.cal_max=b.Utils.getDoubleAt(a,192,this.littleEndian);this.cal_min=b.Utils.getDoubleAt(a,200,this.littleEndian);this.slice_duration=b.Utils.getDoubleAt(a,208,this.littleEndian);this.toffset=b.Utils.getDoubleAt(a,216,this.littleEndian);this.slice_start=b.Utils.getLongAt(a,224,this.littleEndian);this.slice_end=b.Utils.getLongAt(a,232,this.littleEndian);this.description=b.Utils.getStringAt(a,240,320);this.aux_file=b.Utils.getStringAt(a,320,344);this.qform_code=b.Utils.getIntAt(a,344,this.littleEndian);
|
|
959
|
-
this.sform_code=b.Utils.getIntAt(a,348,this.littleEndian);this.quatern_b=b.Utils.getDoubleAt(a,352,this.littleEndian);this.quatern_c=b.Utils.getDoubleAt(a,360,this.littleEndian);this.quatern_d=b.Utils.getDoubleAt(a,368,this.littleEndian);this.qoffset_x=b.Utils.getDoubleAt(a,376,this.littleEndian);this.qoffset_y=b.Utils.getDoubleAt(a,384,this.littleEndian);this.qoffset_z=b.Utils.getDoubleAt(a,392,this.littleEndian);for(f=0;3>f;f+=1)for(m=0;4>m;m+=1)d=400+8*(4*f+m),this.affine[f][m]=b.Utils.getDoubleAt(a,
|
|
960
|
-
d,this.littleEndian);this.affine[3][0]=0;this.affine[3][1]=0;this.affine[3][2]=0;this.affine[3][3]=1;this.slice_code=b.Utils.getIntAt(a,496,this.littleEndian);this.xyzt_units=b.Utils.getIntAt(a,500,this.littleEndian);this.intent_code=b.Utils.getIntAt(a,504,this.littleEndian);this.intent_name=b.Utils.getStringAt(a,508,524);this.dim_info=b.Utils.getByteAt(a,524);a.byteLength>b.NIFTI2.MAGIC_COOKIE&&(this.extensionFlag[0]=b.Utils.getByteAt(a,540),this.extensionFlag[1]=b.Utils.getByteAt(a,541),this.extensionFlag[2]=
|
|
961
|
-
b.Utils.getByteAt(a,542),this.extensionFlag[3]=b.Utils.getByteAt(a,543),this.extensionFlag[0]&&(this.extensionSize=this.getExtensionSize(a),this.extensionCode=this.getExtensionCode(a)))};b.NIFTI2.prototype.toFormattedString=function(){var a=b.Utils.formatNumber,d;d=""+("Datatype = "+ +this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+")\n");d+="Bits Per Voxel = = "+this.numBitsPerVoxel+"\n";d+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+this.dims[3]+
|
|
962
|
-
", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+"\n";d+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+"\n";d+="Voxel Dimensions (1-8): "+a(this.pixDims[0])+", "+a(this.pixDims[1])+", "+a(this.pixDims[2])+", "+a(this.pixDims[3])+", "+a(this.pixDims[4])+", "+a(this.pixDims[5])+", "+a(this.pixDims[6])+", "+a(this.pixDims[7])+"\n";d+="Image Offset = "+this.vox_offset+"\n";d+="Data Scale: Slope = "+a(this.scl_slope)+" Intercept = "+a(this.scl_inter)+
|
|
963
|
-
"\n";d+="Display Range: Max = "+a(this.cal_max)+" Min = "+a(this.cal_min)+"\n";d+="Slice Duration = "+this.slice_duration+"\n";d+="Time Axis Shift = "+this.toffset+"\n";d+="Slice Start = "+this.slice_start+"\n";d+="Slice End = "+this.slice_end+"\n";d+='Description: "'+this.description+'"\n';d+='Auxiliary File: "'+this.aux_file+'"\n';d+="Q-Form Code = "+this.qform_code+" ("+this.getTransformCodeString(this.qform_code)+")\n";d+="S-Form Code = "+this.sform_code+" ("+this.getTransformCodeString(this.sform_code)+
|
|
964
|
-
")\n";d+="Quaternion Parameters: b = "+a(this.quatern_b)+" c = "+a(this.quatern_c)+" d = "+a(this.quatern_d)+"\n";d+="Quaternion Offsets: x = "+this.qoffset_x+" y = "+this.qoffset_y+" z = "+this.qoffset_z+"\n";d+="S-Form Parameters X: "+a(this.affine[0][0])+", "+a(this.affine[0][1])+", "+a(this.affine[0][2])+", "+a(this.affine[0][3])+"\n";d+="S-Form Parameters Y: "+a(this.affine[1][0])+", "+a(this.affine[1][1])+", "+a(this.affine[1][2])+", "+a(this.affine[1][3])+"\n";d+="S-Form Parameters Z: "+
|
|
965
|
-
a(this.affine[2][0])+", "+a(this.affine[2][1])+", "+a(this.affine[2][2])+", "+a(this.affine[2][3])+"\n";d+="Slice Code = "+this.slice_code+"\n";d+="Units Code = "+this.xyzt_units+" ("+this.getUnitsCodeString(b.NIFTI1.SPATIAL_UNITS_MASK&this.xyzt_units)+", "+this.getUnitsCodeString(b.NIFTI1.TEMPORAL_UNITS_MASK&this.xyzt_units)+")\n";d+="Intent Code = "+this.intent_code+"\n";d+='Intent Name: "'+this.intent_name+'"\n';return d+="Dim Info = "+this.dim_info+"\n"};b.NIFTI2.prototype.getExtensionLocation=
|
|
966
|
-
function(){return b.NIFTI2.MAGIC_COOKIE+4};b.NIFTI2.prototype.getExtensionSize=b.NIFTI1.prototype.getExtensionSize;b.NIFTI2.prototype.getExtensionCode=b.NIFTI1.prototype.getExtensionCode;b.NIFTI2.prototype.getDatatypeCodeString=b.NIFTI1.prototype.getDatatypeCodeString;b.NIFTI2.prototype.getTransformCodeString=b.NIFTI1.prototype.getTransformCodeString;b.NIFTI2.prototype.getUnitsCodeString=b.NIFTI1.prototype.getUnitsCodeString;b.NIFTI2.prototype.getQformMat=b.NIFTI1.prototype.getQformMat;b.NIFTI2.prototype.convertNiftiQFormToNiftiSForm=
|
|
967
|
-
b.NIFTI1.prototype.convertNiftiQFormToNiftiSForm;b.NIFTI2.prototype.convertNiftiSFormToNEMA=b.NIFTI1.prototype.convertNiftiSFormToNEMA;b.NIFTI2.prototype.nifti_mat33_mul=b.NIFTI1.prototype.nifti_mat33_mul;b.NIFTI2.prototype.nifti_mat33_determ=b.NIFTI1.prototype.nifti_mat33_determ;"undefined"!==typeof d&&d.exports&&(d.exports=b.NIFTI2)},{"./nifti1.js":18,"./utilities.js":20}],20:[function(a,d,f){var b=b||{};b.Utils=b.Utils||{};b.Utils.crcTable=null;b.Utils.GUNZIP_MAGIC_COOKIE1=31;b.Utils.GUNZIP_MAGIC_COOKIE2=
|
|
968
|
-
139;b.Utils.getStringAt=function(a,b,d){for(var f="",k;b<d;b+=1)k=a.getUint8(b),0!==k&&(f+=String.fromCharCode(k));return f};b.Utils.getByteAt=function(a,b){return a.getInt8(b)};b.Utils.getShortAt=function(a,b,d){return a.getInt16(b,d)};b.Utils.getIntAt=function(a,b,d){return a.getInt32(b,d)};b.Utils.getFloatAt=function(a,b,d){return a.getFloat32(b,d)};b.Utils.getDoubleAt=function(a,b,d){return a.getFloat64(b,d)};b.Utils.getLongAt=function(a,d,f){var m,k=[],p=0;for(m=0;8>m;m+=1)k[m]=b.Utils.getByteAt(a,
|
|
969
|
-
d+m,f);for(m=k.length-1;0<=m;m--)p=256*p+k[m];return p};b.Utils.toArrayBuffer=function(a){var b,d,f;b=new ArrayBuffer(a.length);d=new Uint8Array(b);for(f=0;f<a.length;f+=1)d[f]=a[f];return b};b.Utils.isString=function(a){return"string"===typeof a||a instanceof String};b.Utils.formatNumber=function(a,d){var f=0,f=b.Utils.isString(a)?Number(a):a,f=d?f.toPrecision(5):f.toPrecision(7);return parseFloat(f)};b.Utils.makeCRCTable=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^
|
|
970
|
-
a>>>1:a>>>1;b[d]=a}return b};b.Utils.crc32=function(a){for(var d=b.Utils.crcTable||(b.Utils.crcTable=b.Utils.makeCRCTable()),f=-1,m=0;m<a.byteLength;m++)f=f>>>8^d[(f^a.getUint8(m))&255];return(f^-1)>>>0};"undefined"!==typeof d&&d.exports&&(d.exports=b.Utils)},{}]},{},[17])(17)});
|
|
971
|
-
(function(c){"object"===typeof exports&&"undefined"!==typeof module?module.exports=c():"function"===typeof define&&define.amd?define([],c):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).gifti=c()})(function(){return function a(d,f,b){function e(h,k){if(!f[h]){if(!d[h]){var p="function"==typeof require&&require;if(!k&&p)return p(h,!0);if(g)return g(h,!0);p=Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p;}p=f[h]={exports:{}};
|
|
972
|
-
d[h][0].call(p.exports,function(a){var b=d[h][1][a];return e(b?b:a)},p,p.exports,a,d,f,b)}return f[h].exports}for(var g="function"==typeof require&&require,h=0;h<b.length;h++)e(b[h]);return e}({1:[function(a,d,f){a={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decodeArrayBuffer:function(a){var d=this._keyStr.indexOf(a.charAt(a.length-1)),f=this._keyStr.indexOf(a.charAt(a.length-2)),h=a.length/4*3;64==d&&h--;64==f&&h--;d=new ArrayBuffer(h);this.decode(a,d,h);return d},
|
|
973
|
-
decode:function(a,d,f){var h,m,k,p,t,w=0,B=0;d=d?new Uint8Array(d):new Uint8Array(f);a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(w=0;w<f;w+=3)h=this._keyStr.indexOf(a.charAt(B++)),m=this._keyStr.indexOf(a.charAt(B++)),p=this._keyStr.indexOf(a.charAt(B++)),t=this._keyStr.indexOf(a.charAt(B++)),h=h<<2|m>>4,m=(m&15)<<4|p>>2,k=(p&3)<<6|t,d[w]=h,64!=p&&(d[w+1]=m),64!=t&&(d[w+2]=k);return d}};"undefined"!==typeof d&&d.exports&&(d.exports=a)},{}],2:[function(a,d,f){},{}],3:[function(a,d,f){(function(b){function d(){try{var a=
|
|
974
|
-
new Uint8Array(1);a.foo=function(){return 42};return 42===a.foo()&&"function"===typeof a.subarray&&0===a.subarray(1,1).byteLength}catch(b){return!1}}function g(a){if(!(this instanceof g))return 1<arguments.length?new g(a,arguments[1]):new g(a);g.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0);if("number"===typeof a){var b;b=k(this,0>a?0:p(a)|0);if(!g.TYPED_ARRAY_SUPPORT)for(var d=0;d<a;d++)b[d]=0;return b}if("string"===typeof a){b=this;d=1<arguments.length?arguments[1]:"utf8";if("string"!==
|
|
975
|
-
typeof d||""===d)d="utf8";var e=w(a,d)|0;b=k(b,e);b.write(a,d);return b}return h(this,a)}function h(a,b){if(g.isBuffer(b)){var d=a,e=p(b.length)|0,d=k(d,e);b.copy(d,0,0,e);return d}if(q(b)){for(var d=a,e=p(b.length)|0,d=k(d,e),f=0;f<e;f+=1)d[f]=b[f]&255;return d}if(null==b)throw new TypeError("must start with number, buffer, array or string");if("undefined"!==typeof ArrayBuffer){if(b.buffer instanceof ArrayBuffer)return m(a,b);if(b instanceof ArrayBuffer)return d=a,b.byteLength,g.TYPED_ARRAY_SUPPORT?
|
|
976
|
-
(d=new Uint8Array(b),d.__proto__=g.prototype):d=m(d,new Uint8Array(b)),d}if(b.length){d=a;e=p(b.length)|0;d=k(d,e);for(f=0;f<e;f+=1)d[f]=b[f]&255;return d}d=a;f=0;"Buffer"===b.type&&q(b.data)&&(e=b.data,f=p(e.length)|0);for(var d=k(d,f),l=0;l<f;l+=1)d[l]=e[l]&255;return d}function m(a,b){var d=p(b.length)|0;a=k(a,d);for(var e=0;e<d;e+=1)a[e]=b[e]&255;return a}function k(a,b){g.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=g.prototype):a.length=b;0!==b&&b<=g.poolSize>>>1&&(a.parent=I);return a}
|
|
977
|
-
function p(a){if(a>=(g.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(g.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return a|0}function t(a,b){if(!(this instanceof t))return new t(a,b);var d=new g(a,b);delete d.parent;return d}function w(a,b){"string"!==typeof a&&(a=""+a);var d=a.length;if(0===d)return 0;for(var e=!1;;)switch(b){case "ascii":case "binary":case "raw":case "raws":return d;case "utf8":case "utf-8":return E(a).length;
|
|
978
|
-
case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*d;case "hex":return d>>>1;case "base64":return u.toByteArray(K(a)).length;default:if(e)return E(a).length;b=(""+b).toLowerCase();e=!0}}function B(a,b,d){var e=!1;b|=0;d=void 0===d||Infinity===d?this.length:d|0;a||(a="utf8");0>b&&(b=0);d>this.length&&(d=this.length);if(d<=b)return"";for(;;)switch(a){case "hex":a=b;b=this.length;if(!a||0>a)a=0;if(!d||0>d||d>b)d=b;for(b="";a<d;a++)e=this[a],e=16>e?"0"+e.toString(16):e.toString(16),b+=e;
|
|
979
|
-
return b;case "utf8":case "utf-8":return A(this,b,d);case "ascii":a=b;b="";for(d=Math.min(this.length,d);a<d;a++)b+=String.fromCharCode(this[a]&127);return b;case "binary":a=b;b="";for(d=Math.min(this.length,d);a<d;a++)b+=String.fromCharCode(this[a]);return b;case "base64":return a=b,d=0===a&&d===this.length?u.fromByteArray(this):u.fromByteArray(this.slice(a,d)),d;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":d=this.slice(b,d);a="";for(b=0;b<d.length;b+=2)a+=String.fromCharCode(d[b]+256*
|
|
980
|
-
d[b+1]);return a;default:if(e)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase();e=!0}}function A(a,b,d){d=Math.min(a.length,d);for(var e=[];b<d;){var f=a[b],g=null,l=239<f?4:223<f?3:191<f?2:1;if(b+l<=d){var h,n,k;switch(l){case 1:128>f&&(g=f);break;case 2:h=a[b+1];128===(h&192)&&(f=(f&31)<<6|h&63,127<f&&(g=f));break;case 3:h=a[b+1];n=a[b+2];128===(h&192)&&128===(n&192)&&(f=(f&15)<<12|(h&63)<<6|n&63,2047<f&&(55296>f||57343<f)&&(g=f));break;case 4:h=a[b+1],n=a[b+2],k=a[b+3],128===(h&
|
|
981
|
-
192)&&128===(n&192)&&128===(k&192)&&(f=(f&15)<<18|(h&63)<<12|(n&63)<<6|k&63,65535<f&&1114112>f&&(g=f))}}null===g?(g=65533,l=1):65535<g&&(g-=65536,e.push(g>>>10&1023|55296),g=56320|g&1023);e.push(g);b+=l}a=e.length;if(a<=H)e=String.fromCharCode.apply(String,e);else{d="";for(b=0;b<a;)d+=String.fromCharCode.apply(String,e.slice(b,b+=H));e=d}return e}function x(a,b,d){if(0!==a%1||0>a)throw new RangeError("offset is not uint");if(a+b>d)throw new RangeError("Trying to access beyond buffer length");}function G(a,
|
|
982
|
-
b,d,e,f,l){if(!g.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>f||b<l)throw new RangeError("value is out of bounds");if(d+e>a.length)throw new RangeError("index out of range");}function F(a,b,d,e){0>b&&(b=65535+b+1);for(var f=0,g=Math.min(a.length-d,2);f<g;f++)a[d+f]=(b&255<<8*(e?f:1-f))>>>8*(e?f:1-f)}function z(a,b,d,e){0>b&&(b=4294967295+b+1);for(var f=0,g=Math.min(a.length-d,4);f<g;f++)a[d+f]=b>>>8*(e?f:3-f)&255}function L(a,b,d,e,f,g){if(d+e>a.length)throw new RangeError("index out of range");
|
|
983
|
-
if(0>d)throw new RangeError("index out of range");}function l(a,b,d,e,f){f||L(a,b,d,4,3.4028234663852886E38,-3.4028234663852886E38);n.write(a,b,d,e,23,4);return d+4}function J(a,b,d,e,f){f||L(a,b,d,8,1.7976931348623157E308,-1.7976931348623157E308);n.write(a,b,d,e,52,8);return d+8}function K(a){a=a.trim?a.trim():a.replace(/^\s+|\s+$/g,"");a=a.replace(v,"");if(2>a.length)return"";for(;0!==a.length%4;)a+="=";return a}function E(a,b){b=b||Infinity;for(var d,e=a.length,f=null,g=[],l=0;l<e;l++){d=a.charCodeAt(l);
|
|
984
|
-
if(55295<d&&57344>d){if(!f){if(56319<d){-1<(b-=3)&&g.push(239,191,189);continue}else if(l+1===e){-1<(b-=3)&&g.push(239,191,189);continue}f=d;continue}if(56320>d){-1<(b-=3)&&g.push(239,191,189);f=d;continue}d=(f-55296<<10|d-56320)+65536}else f&&-1<(b-=3)&&g.push(239,191,189);f=null;if(128>d){if(0>--b)break;g.push(d)}else if(2048>d){if(0>(b-=2))break;g.push(d>>6|192,d&63|128)}else if(65536>d){if(0>(b-=3))break;g.push(d>>12|224,d>>6&63|128,d&63|128)}else if(1114112>d){if(0>(b-=4))break;g.push(d>>18|
|
|
985
|
-
240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw Error("Invalid code point");}return g}function y(a){for(var b=[],d=0;d<a.length;d++)b.push(a.charCodeAt(d)&255);return b}function D(a,b,d,e){for(var f=0;f<e&&!(f+d>=b.length||f>=a.length);f++)b[f+d]=a[f];return f}var u=a("base64-js"),n=a("ieee754"),q=a("isarray");f.Buffer=g;f.SlowBuffer=t;f.INSPECT_MAX_BYTES=50;g.poolSize=8192;var I={};g.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d();g._augment=function(a){a.__proto__=
|
|
986
|
-
g.prototype;return a};g.TYPED_ARRAY_SUPPORT?(g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0})):(g.prototype.length=void 0,g.prototype.parent=void 0);g.isBuffer=function(a){return!(null==a||!a._isBuffer)};g.compare=function(a,b){if(!g.isBuffer(a)||!g.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var d=a.length,
|
|
987
|
-
e=b.length,f=0,l=Math.min(d,e);f<l&&a[f]===b[f];)++f;f!==l&&(d=a[f],e=b[f]);return d<e?-1:e<d?1:0};g.isEncoding=function(a){switch(String(a).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "raw":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;default:return!1}};g.concat=function(a,b){if(!q(a))throw new TypeError("list argument must be an Array of Buffers.");if(0===a.length)return new g(0);var d;if(void 0===b)for(d=b=0;d<a.length;d++)b+=
|
|
988
|
-
a[d].length;var e=new g(b),f=0;for(d=0;d<a.length;d++){var l=a[d];l.copy(e,f);f+=l.length}return e};g.byteLength=w;g.prototype._isBuffer=!0;g.prototype.toString=function(){var a=this.length|0;return 0===a?"":0===arguments.length?A(this,0,a):B.apply(this,arguments)};g.prototype.equals=function(a){if(!g.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===g.compare(this,a)};g.prototype.inspect=function(){var a="",b=f.INSPECT_MAX_BYTES;0<this.length&&(a=this.toString("hex",
|
|
989
|
-
0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... "));return"<Buffer "+a+">"};g.prototype.compare=function(a){if(!g.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?0:g.compare(this,a)};g.prototype.indexOf=function(a,b){function d(a,b,e){for(var f=-1,g=0;e+g<a.length;g++)if(a[e+g]===b[-1===f?0:g-f]){if(-1===f&&(f=g),g-f+1===b.length)return e+f}else f=-1;return-1}2147483647<b?b=2147483647:-2147483648>b&&(b=-2147483648);b>>=0;if(0===this.length||b>=this.length)return-1;
|
|
990
|
-
0>b&&(b=Math.max(this.length+b,0));if("string"===typeof a)return 0===a.length?-1:String.prototype.indexOf.call(this,a,b);if(g.isBuffer(a))return d(this,a,b);if("number"===typeof a)return g.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):d(this,[a],b);throw new TypeError("val must be string, number or Buffer");};g.prototype.write=function(a,b,d,e){if(void 0===b)e="utf8",d=this.length,b=0;else if(void 0===d&&"string"===typeof b)e=b,d=this.length,
|
|
991
|
-
b=0;else if(isFinite(b))b|=0,isFinite(d)?(d|=0,void 0===e&&(e="utf8")):(e=d,d=void 0);else{var f=e;e=b;b=d|0;d=f}f=this.length-b;if(void 0===d||d>f)d=f;if(0<a.length&&(0>d||0>b)||b>this.length)throw new RangeError("attempt to write outside buffer bounds");e||(e="utf8");for(f=!1;;)switch(e){case "hex":b=Number(b)||0;e=this.length-b;d?(d=Number(d),d>e&&(d=e)):d=e;e=a.length;if(0!==e%2)throw Error("Invalid hex string");d>e/2&&(d=e/2);for(e=0;e<d;e++){f=parseInt(a.substr(2*e,2),16);if(isNaN(f))throw Error("Invalid hex string");
|
|
992
|
-
this[b+e]=f}return e;case "utf8":case "utf-8":return D(E(a,this.length-b),this,b,d);case "ascii":return D(y(a),this,b,d);case "binary":return D(y(a),this,b,d);case "base64":return D(u.toByteArray(K(a)),this,b,d);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":e=this.length-b;for(var g=void 0,g=f=void 0,l=[],h=0;h<a.length&&!(0>(e-=2));h++)g=a.charCodeAt(h),f=g>>8,g%=256,l.push(g),l.push(f);return D(l,this,b,d);default:if(f)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase();
|
|
993
|
-
f=!0}};g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var H=4096;g.prototype.slice=function(a,b){var d=this.length;a=~~a;b=void 0===b?d:~~b;0>a?(a+=d,0>a&&(a=0)):a>d&&(a=d);0>b?(b+=d,0>b&&(b=0)):b>d&&(b=d);b<a&&(b=a);if(g.TYPED_ARRAY_SUPPORT)d=this.subarray(a,b),d.__proto__=g.prototype;else for(var e=b-a,d=new g(e,void 0),f=0;f<e;f++)d[f]=this[f+a];d.length&&(d.parent=this.parent||this);return d};g.prototype.readUIntLE=function(a,b,d){a|=0;
|
|
994
|
-
b|=0;d||x(a,b,this.length);d=this[a];for(var e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d};g.prototype.readUIntBE=function(a,b,d){a|=0;b|=0;d||x(a,b,this.length);d=this[a+--b];for(var e=1;0<b&&(e*=256);)d+=this[a+--b]*e;return d};g.prototype.readUInt8=function(a,b){b||x(a,1,this.length);return this[a]};g.prototype.readUInt16LE=function(a,b){b||x(a,2,this.length);return this[a]|this[a+1]<<8};g.prototype.readUInt16BE=function(a,b){b||x(a,2,this.length);return this[a]<<8|this[a+1]};g.prototype.readUInt32LE=
|
|
995
|
-
function(a,b){b||x(a,4,this.length);return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]};g.prototype.readUInt32BE=function(a,b){b||x(a,4,this.length);return 16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])};g.prototype.readIntLE=function(a,b,d){a|=0;b|=0;d||x(a,b,this.length);d=this[a];for(var e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;d>=128*e&&(d-=Math.pow(2,8*b));return d};g.prototype.readIntBE=function(a,b,d){a|=0;b|=0;d||x(a,b,this.length);d=b;for(var e=1,f=this[a+--d];0<d&&(e*=
|
|
996
|
-
256);)f+=this[a+--d]*e;f>=128*e&&(f-=Math.pow(2,8*b));return f};g.prototype.readInt8=function(a,b){b||x(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};g.prototype.readInt16LE=function(a,b){b||x(a,2,this.length);var d=this[a]|this[a+1]<<8;return d&32768?d|4294901760:d};g.prototype.readInt16BE=function(a,b){b||x(a,2,this.length);var d=this[a+1]|this[a]<<8;return d&32768?d|4294901760:d};g.prototype.readInt32LE=function(a,b){b||x(a,4,this.length);return this[a]|this[a+1]<<8|this[a+2]<<
|
|
997
|
-
16|this[a+3]<<24};g.prototype.readInt32BE=function(a,b){b||x(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};g.prototype.readFloatLE=function(a,b){b||x(a,4,this.length);return n.read(this,a,!0,23,4)};g.prototype.readFloatBE=function(a,b){b||x(a,4,this.length);return n.read(this,a,!1,23,4)};g.prototype.readDoubleLE=function(a,b){b||x(a,8,this.length);return n.read(this,a,!0,52,8)};g.prototype.readDoubleBE=function(a,b){b||x(a,8,this.length);return n.read(this,a,!1,52,8)};
|
|
998
|
-
g.prototype.writeUIntLE=function(a,b,d,e){a=+a;b|=0;d|=0;e||G(this,a,b,d,Math.pow(2,8*d),0);e=1;var f=0;for(this[b]=a&255;++f<d&&(e*=256);)this[b+f]=a/e&255;return b+d};g.prototype.writeUIntBE=function(a,b,d,e){a=+a;b|=0;d|=0;e||G(this,a,b,d,Math.pow(2,8*d),0);e=d-1;var f=1;for(this[b+e]=a&255;0<=--e&&(f*=256);)this[b+e]=a/f&255;return b+d};g.prototype.writeUInt8=function(a,b,d){a=+a;b|=0;d||G(this,a,b,1,255,0);g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[b]=a&255;return b+1};g.prototype.writeUInt16LE=
|
|
999
|
-
function(a,b,d){a=+a;b|=0;d||G(this,a,b,2,65535,0);g.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):F(this,a,b,!0);return b+2};g.prototype.writeUInt16BE=function(a,b,d){a=+a;b|=0;d||G(this,a,b,2,65535,0);g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):F(this,a,b,!1);return b+2};g.prototype.writeUInt32LE=function(a,b,d){a=+a;b|=0;d||G(this,a,b,4,4294967295,0);g.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a&255):z(this,a,b,!0);return b+4};g.prototype.writeUInt32BE=
|
|
1000
|
-
function(a,b,d){a=+a;b|=0;d||G(this,a,b,4,4294967295,0);g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):z(this,a,b,!1);return b+4};g.prototype.writeIntLE=function(a,b,d,e){a=+a;b|=0;e||(e=Math.pow(2,8*d-1),G(this,a,b,d,e-1,-e));e=0;var f=1,g=0>a?1:0;for(this[b]=a&255;++e<d&&(f*=256);)this[b+e]=(a/f>>0)-g&255;return b+d};g.prototype.writeIntBE=function(a,b,d,e){a=+a;b|=0;e||(e=Math.pow(2,8*d-1),G(this,a,b,d,e-1,-e));e=d-1;var f=1,g=0>a?1:0;for(this[b+e]=a&255;0<=
|
|
1001
|
-
--e&&(f*=256);)this[b+e]=(a/f>>0)-g&255;return b+d};g.prototype.writeInt8=function(a,b,d){a=+a;b|=0;d||G(this,a,b,1,127,-128);g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a&255;return b+1};g.prototype.writeInt16LE=function(a,b,d){a=+a;b|=0;d||G(this,a,b,2,32767,-32768);g.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):F(this,a,b,!0);return b+2};g.prototype.writeInt16BE=function(a,b,d){a=+a;b|=0;d||G(this,a,b,2,32767,-32768);g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&
|
|
1002
|
-
255):F(this,a,b,!1);return b+2};g.prototype.writeInt32LE=function(a,b,d){a=+a;b|=0;d||G(this,a,b,4,2147483647,-2147483648);g.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):z(this,a,b,!0);return b+4};g.prototype.writeInt32BE=function(a,b,d){a=+a;b|=0;d||G(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):z(this,a,b,!1);return b+4};g.prototype.writeFloatLE=function(a,
|
|
1003
|
-
b,d){return l(this,a,b,!0,d)};g.prototype.writeFloatBE=function(a,b,d){return l(this,a,b,!1,d)};g.prototype.writeDoubleLE=function(a,b,d){return J(this,a,b,!0,d)};g.prototype.writeDoubleBE=function(a,b,d){return J(this,a,b,!1,d)};g.prototype.copy=function(a,b,d,e){d||(d=0);e||0===e||(e=this.length);b>=a.length&&(b=a.length);b||(b=0);0<e&&e<d&&(e=d);if(e===d||0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>d||d>=this.length)throw new RangeError("sourceStart out of bounds");
|
|
1004
|
-
if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length);a.length-b<e-d&&(e=a.length-b+d);var f=e-d;if(this===a&&d<b&&b<e)for(e=f-1;0<=e;e--)a[e+b]=this[e+d];else if(1E3>f||!g.TYPED_ARRAY_SUPPORT)for(e=0;e<f;e++)a[e+b]=this[e+d];else Uint8Array.prototype.set.call(a,this.subarray(d,d+f),b);return f};g.prototype.fill=function(a,b,d){a||(a=0);b||(b=0);d||(d=this.length);if(d<b)throw new RangeError("end < start");if(d!==b&&0!==this.length){if(0>b||b>=this.length)throw new RangeError("start out of bounds");
|
|
1005
|
-
if(0>d||d>this.length)throw new RangeError("end out of bounds");if("number"===typeof a)for(;b<d;b++)this[b]=a;else{a=E(a.toString());for(var e=a.length;b<d;b++)this[b]=a[b%e]}return this}};var v=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"base64-js":4,ieee754:5,isarray:6}],4:[function(a,d,f){(function(a){function d(a){a=k[a.charCodeAt(0)];return void 0!==a?a:-1}function f(a,b,d){for(var e=[],g=b;g<d;g+=
|
|
1006
|
-
3)b=(a[g]<<16)+(a[g+1]<<8)+a[g+2],e.push(m[b>>18&63]+m[b>>12&63]+m[b>>6&63]+m[b&63]);return e.join("")}var h,m=[];for(h=0;64>h;h++)m[h]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[h];var k=[];for(h=0;64>h;++h)k["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(h)]=h;k[45]=62;k[95]=63;var p="undefined"!==typeof Uint8Array?Uint8Array:Array;a.toByteArray=function(a){function b(a){m[z++]=a}var f,g,h,k,m;if(0<a.length%4)throw Error("Invalid string. Length must be a multiple of 4");
|
|
1007
|
-
f=a.length;k="="===a.charAt(f-2)?2:"="===a.charAt(f-1)?1:0;m=new p(3*a.length/4-k);g=0<k?a.length-4:a.length;var z=0;for(f=0;f<g;f+=4)h=d(a.charAt(f))<<18|d(a.charAt(f+1))<<12|d(a.charAt(f+2))<<6|d(a.charAt(f+3)),b((h&16711680)>>16),b((h&65280)>>8),b(h&255);2===k?(h=d(a.charAt(f))<<2|d(a.charAt(f+1))>>4,b(h&255)):1===k&&(h=d(a.charAt(f))<<10|d(a.charAt(f+1))<<4|d(a.charAt(f+2))>>2,b(h>>8&255),b(h&255));return m};a.fromByteArray=function(a){var b,d=a.length%3,e="",h=[],k;b=0;for(k=a.length-d;b<k;b+=
|
|
1008
|
-
16383)h.push(f(a,b,b+16383>k?k:b+16383));switch(d){case 1:a=a[a.length-1];e+=m[a>>2];e+=m[a<<4&63];e+="==";break;case 2:a=(a[a.length-2]<<8)+a[a.length-1],e+=m[a>>10],e+=m[a>>4&63],e+=m[a<<2&63],e+="="}h.push(e);return h.join("")}})("undefined"===typeof f?this.base64js={}:f)},{}],5:[function(a,d,f){f.read=function(a,d,f,h,m){var k;k=8*m-h-1;var p=(1<<k)-1,t=p>>1,w=-7;m=f?m-1:0;var B=f?-1:1,A=a[d+m];m+=B;f=A&(1<<-w)-1;A>>=-w;for(w+=k;0<w;f=256*f+a[d+m],m+=B,w-=8);k=f&(1<<-w)-1;f>>=-w;for(w+=h;0<w;k=
|
|
1009
|
-
256*k+a[d+m],m+=B,w-=8);if(0===f)f=1-t;else{if(f===p)return k?NaN:Infinity*(A?-1:1);k+=Math.pow(2,h);f-=t}return(A?-1:1)*k*Math.pow(2,f-h)};f.write=function(a,d,f,h,m,k){var p,t=8*k-m-1,w=(1<<t)-1,B=w>>1,A=23===m?Math.pow(2,-24)-Math.pow(2,-77):0;k=h?0:k-1;var x=h?1:-1,G=0>d||0===d&&0>1/d?1:0;d=Math.abs(d);isNaN(d)||Infinity===d?(d=isNaN(d)?1:0,h=w):(h=Math.floor(Math.log(d)/Math.LN2),1>d*(p=Math.pow(2,-h))&&(h--,p*=2),d=1<=h+B?d+A/p:d+A*Math.pow(2,1-B),2<=d*p&&(h++,p/=2),h+B>=w?(d=0,h=w):1<=h+B?
|
|
1010
|
-
(d=(d*p-1)*Math.pow(2,m),h+=B):(d=d*Math.pow(2,B-1)*Math.pow(2,m),h=0));for(;8<=m;a[f+k]=d&255,k+=x,d/=256,m-=8);h=h<<m|d;for(t+=m;0<t;a[f+k]=h&255,k+=x,h/=256,t-=8);a[f+k-x]|=128*G}},{}],6:[function(a,d,f){var b={}.toString;d.exports=Array.isArray||function(a){return"[object Array]"==b.call(a)}},{}],7:[function(a,d,f){function b(){this._events=this._events||{};this._maxListeners=this._maxListeners||void 0}function e(a){return"function"===typeof a}function g(a){return"object"===typeof a&&null!==a}
|
|
1011
|
-
d.exports=b;b.EventEmitter=b;b.prototype._events=void 0;b.prototype._maxListeners=void 0;b.defaultMaxListeners=10;b.prototype.setMaxListeners=function(a){if("number"!==typeof a||0>a||isNaN(a))throw TypeError("n must be a positive number");this._maxListeners=a;return this};b.prototype.emit=function(a){var b,d,f,t;this._events||(this._events={});if("error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){b=arguments[1];if(b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.');
|
|
1012
|
-
}d=this._events[a];if(void 0===d)return!1;if(e(d))switch(arguments.length){case 1:d.call(this);break;case 2:d.call(this,arguments[1]);break;case 3:d.call(this,arguments[1],arguments[2]);break;default:b=Array.prototype.slice.call(arguments,1),d.apply(this,b)}else if(g(d))for(b=Array.prototype.slice.call(arguments,1),t=d.slice(),d=t.length,f=0;f<d;f++)t[f].apply(this,b);return!0};b.prototype.addListener=function(a,d){var f;if(!e(d))throw TypeError("listener must be a function");this._events||(this._events=
|
|
1013
|
-
{});this._events.newListener&&this.emit("newListener",a,e(d.listener)?d.listener:d);this._events[a]?g(this._events[a])?this._events[a].push(d):this._events[a]=[this._events[a],d]:this._events[a]=d;g(this._events[a])&&!this._events[a].warned&&(f=void 0!==this._maxListeners?this._maxListeners:b.defaultMaxListeners)&&0<f&&this._events[a].length>f&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
|
|
1014
|
-
this._events[a].length),"function"===typeof console.trace&&console.trace());return this};b.prototype.on=b.prototype.addListener;b.prototype.once=function(a,b){function d(){this.removeListener(a,d);f||(f=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var f=!1;d.listener=b;this.on(a,d);return this};b.prototype.removeListener=function(a,b){var d,f,t;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;d=this._events[a];
|
|
1015
|
-
t=d.length;f=-1;if(d===b||e(d.listener)&&d.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(d)){for(;0<t--;)if(d[t]===b||d[t].listener&&d[t].listener===b){f=t;break}if(0>f)return this;1===d.length?(d.length=0,delete this._events[a]):d.splice(f,1);this._events.removeListener&&this.emit("removeListener",a,b)}return this};b.prototype.removeAllListeners=function(a){var b;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?
|
|
1016
|
-
this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);this.removeAllListeners("removeListener");this._events={};return this}b=this._events[a];if(e(b))this.removeListener(a,b);else if(b)for(;b.length;)this.removeListener(a,b[b.length-1]);delete this._events[a];return this};b.prototype.listeners=function(a){return this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():
|
|
1017
|
-
[]};b.prototype.listenerCount=function(a){if(this._events){a=this._events[a];if(e(a))return 1;if(a)return a.length}return 0};b.listenerCount=function(a,b){return a.listenerCount(b)}},{}],8:[function(a,d,f){d.exports="function"===typeof Object.create?function(a,d){a.super_=d;a.prototype=Object.create(d.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:function(a,d){a.super_=d;var f=function(){};f.prototype=d.prototype;a.prototype=new f;a.prototype.constructor=a}},{}],9:[function(a,
|
|
1018
|
-
d,f){d.exports=function(a){return!(null==a||!(a._isBuffer||a.constructor&&"function"===typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)))}},{}],10:[function(a,d,f){d.exports=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)}},{}],11:[function(a,d,f){function b(){k=!1;p.length?m=p.concat(m):t=-1;m.length&&e()}function e(){if(!k){var a=setTimeout(b);k=!0;for(var d=m.length;d;){p=m;for(m=[];++t<d;)p&&p[t].run();t=-1;d=m.length}p=null;k=!1;clearTimeout(a)}}function g(a,
|
|
1019
|
-
b){this.fun=a;this.array=b}function h(){}a=d.exports={};var m=[],k=!1,p,t=-1;a.nextTick=function(a){var b=Array(arguments.length-1);if(1<arguments.length)for(var d=1;d<arguments.length;d++)b[d-1]=arguments[d];m.push(new g(a,b));1!==m.length||k||setTimeout(e,0)};g.prototype.run=function(){this.fun.apply(null,this.array)};a.title="browser";a.browser=!0;a.env={};a.argv=[];a.version="";a.versions={};a.on=h;a.addListener=h;a.once=h;a.off=h;a.removeListener=h;a.removeAllListeners=h;a.emit=h;a.binding=function(a){throw Error("process.binding is not supported");
|
|
1020
|
-
};a.cwd=function(){return"/"};a.chdir=function(a){throw Error("process.chdir is not supported");};a.umask=function(){return 0}},{}],12:[function(a,d,f){d.exports=a("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":13}],13:[function(a,d,f){function b(a){if(!(this instanceof b))return new b(a);m.call(this,a);k.call(this,a);a&&!1===a.readable&&(this.readable=!1);a&&!1===a.writable&&(this.writable=!1);this.allowHalfOpen=!0;a&&!1===a.allowHalfOpen&&(this.allowHalfOpen=!1);this.once("end",e)}function e(){this.allowHalfOpen||
|
|
1021
|
-
this._writableState.ended||h(g,this)}function g(a){a.end()}f=Object.keys||function(a){var b=[],d;for(d in a)b.push(d);return b};d.exports=b;var h=a("process-nextick-args");d=a("core-util-is");d.inherits=a("inherits");var m=a("./_stream_readable"),k=a("./_stream_writable");d.inherits(b,m);a=f(k.prototype);for(d=0;d<a.length;d++)f=a[d],b.prototype[f]||(b.prototype[f]=k.prototype[f])},{"./_stream_readable":15,"./_stream_writable":17,"core-util-is":18,inherits:8,"process-nextick-args":19}],14:[function(a,
|
|
1022
|
-
d,f){function b(a){if(!(this instanceof b))return new b(a);e.call(this,a)}d.exports=b;var e=a("./_stream_transform");d=a("core-util-is");d.inherits=a("inherits");d.inherits(b,e);b.prototype._transform=function(a,b,d){d(null,a)}},{"./_stream_transform":16,"core-util-is":18,inherits:8}],15:[function(a,d,f){(function(b){function e(b,d){I=I||a("./_stream_duplex");b=b||{};this.objectMode=!!b.objectMode;d instanceof I&&(this.objectMode=this.objectMode||!!b.readableObjectMode);var e=b.highWaterMark,f=this.objectMode?
|
|
1023
|
-
16:16384;this.highWaterMark=e||0===e?e:f;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.reading=this.endEmitted=this.ended=!1;this.sync=!0;this.readableListening=this.emittedReadable=this.needReadable=!1;this.defaultEncoding=b.defaultEncoding||"utf8";this.ranOut=!1;this.awaitDrain=0;this.readingMore=!1;this.encoding=this.decoder=null;b.encoding&&(q||(q=a("string_decoder/").StringDecoder),this.decoder=new q(b.encoding),
|
|
1024
|
-
this.encoding=b.encoding)}function f(b){I=I||a("./_stream_duplex");if(!(this instanceof f))return new f(b);this._readableState=new e(b,this);this.readable=!0;b&&"function"===typeof b.read&&(this._read=b.read);E.call(this)}function h(a,b,d,e,f){var g;g=d;var n=null;K.isBuffer(g)||"string"===typeof g||null===g||void 0===g||b.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));(g=n)?a.emit("error",g):null===d?(b.reading=!1,b.ended||(b.decoder&&(d=b.decoder.end())&&d.length&&(b.buffer.push(d),
|
|
1025
|
-
b.length+=b.objectMode?1:d.length),b.ended=!0,k(a))):b.objectMode||d&&0<d.length?b.ended&&!f?(d=Error("stream.push() after EOF"),a.emit("error",d)):b.endEmitted&&f?(d=Error("stream.unshift() after end event"),a.emit("error",d)):(!b.decoder||f||e||(d=b.decoder.write(d)),f||(b.reading=!1),b.flowing&&0===b.length&&!b.sync?(a.emit("data",d),a.read(0)):(b.length+=b.objectMode?1:d.length,f?b.buffer.unshift(d):b.buffer.push(d),b.needReadable&&k(a)),b.readingMore||(b.readingMore=!0,l(t,a,b))):f||(b.reading=
|
|
1026
|
-
!1);return!b.ended&&(b.needReadable||b.length<b.highWaterMark||0===b.length)}function m(a,b){if(0===b.length&&b.ended)return 0;if(b.objectMode)return 0===a?0:1;if(null===a||isNaN(a))return b.flowing&&b.buffer.length?b.buffer[0].length:b.length;if(0>=a)return 0;if(a>b.highWaterMark){var d=a;8388608<=d?d=8388608:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++);b.highWaterMark=d}if(a>b.length){if(b.ended)return b.length;b.needReadable=!0;return 0}return a}function k(a){var b=a._readableState;
|
|
1027
|
-
b.needReadable=!1;b.emittedReadable||(n("emitReadable",b.flowing),b.emittedReadable=!0,b.sync?l(p,a):p(a))}function p(a){n("emit readable");a.emit("readable");x(a)}function t(a,b){for(var d=b.length;!b.reading&&!b.flowing&&!b.ended&&b.length<b.highWaterMark&&(n("maybeReadMore read 0"),a.read(0),d!==b.length);)d=b.length;b.readingMore=!1}function w(a){return function(){var b=a._readableState;n("pipeOnDrain",b.awaitDrain);b.awaitDrain&&b.awaitDrain--;0===b.awaitDrain&&a.listeners("data").length&&(b.flowing=
|
|
1028
|
-
!0,x(a))}}function B(a){n("readable nexttick read 0");a.read(0)}function A(a,b){b.reading||(n("resume read 0"),a.read(0));b.resumeScheduled=!1;a.emit("resume");x(a);b.flowing&&!b.reading&&a.read(0)}function x(a){var b=a._readableState;n("flow",b.flowing);if(b.flowing){do var d=a.read();while(null!==d&&b.flowing)}}function G(a,b){var d=b.buffer,e=b.length,f=!!b.decoder,g=!!b.objectMode;if(0===d.length)return null;if(0===e)e=null;else if(g)e=d.shift();else if(!a||a>=e)e=f?d.join(""):1===d.length?d[0]:
|
|
1029
|
-
K.concat(d,e),d.length=0;else if(a<d[0].length)g=d[0],e=g.slice(0,a),d[0]=g.slice(a);else if(a===d[0].length)e=d.shift();else for(var e=f?"":new K(a),l=0,n=0,h=d.length;n<h&&l<a;n++){var g=d[0],k=Math.min(a-l,g.length);f?e+=g.slice(0,k):g.copy(e,l,0,k);k<g.length?d[0]=g.slice(k):d.shift();l+=k}return e}function F(a){var b=a._readableState;if(0<b.length)throw Error("endReadable called on non-empty stream");b.endEmitted||(b.ended=!0,l(z,b,a))}function z(a,b){a.endEmitted||0!==a.length||(a.endEmitted=
|
|
1030
|
-
!0,b.readable=!1,b.emit("end"))}function L(a,b){for(var d=0,e=a.length;d<e;d++)b(a[d],d)}d.exports=f;var l=a("process-nextick-args"),J=a("isarray"),K=a("buffer").Buffer;f.ReadableState=e;a("events");var E;try{E=a("stream")}catch(y){}finally{E||(E=a("events").EventEmitter)}var K=a("buffer").Buffer,D=a("core-util-is");D.inherits=a("inherits");var u=a("util"),n;n=u&&u.debuglog?u.debuglog("stream"):function(){};var q;D.inherits(f,E);var I;f.prototype.push=function(a,b){var d=this._readableState;d.objectMode||
|
|
1031
|
-
"string"!==typeof a||(b=b||d.defaultEncoding,b!==d.encoding&&(a=new K(a,b),b=""));return h(this,d,a,b,!1)};f.prototype.unshift=function(a){return h(this,this._readableState,a,"",!0)};f.prototype.isPaused=function(){return!1===this._readableState.flowing};f.prototype.setEncoding=function(b){q||(q=a("string_decoder/").StringDecoder);this._readableState.decoder=new q(b);this._readableState.encoding=b;return this};f.prototype.read=function(a){n("read",a);var b=this._readableState,d=a;if("number"!==typeof a||
|
|
1032
|
-
0<a)b.emittedReadable=!1;if(0===a&&b.needReadable&&(b.length>=b.highWaterMark||b.ended))return n("read: emitReadable",b.length,b.ended),0===b.length&&b.ended?F(this):k(this),null;a=m(a,b);if(0===a&&b.ended)return 0===b.length&&F(this),null;var e=b.needReadable;n("need readable",e);if(0===b.length||b.length-a<b.highWaterMark)e=!0,n("length less than watermark",e);if(b.ended||b.reading)e=!1,n("reading or ended",e);e&&(n("do read"),b.reading=!0,b.sync=!0,0===b.length&&(b.needReadable=!0),this._read(b.highWaterMark),
|
|
1033
|
-
b.sync=!1);e&&!b.reading&&(a=m(d,b));e=0<a?G(a,b):null;null===e&&(b.needReadable=!0,a=0);b.length-=a;0!==b.length||b.ended||(b.needReadable=!0);d!==a&&b.ended&&0===b.length&&F(this);null!==e&&this.emit("data",e);return e};f.prototype._read=function(a){this.emit("error",Error("not implemented"))};f.prototype.pipe=function(a,d){function e(a){n("onunpipe");a===t&&g()}function f(){n("onend");a.end()}function g(){n("cleanup");a.removeListener("close",m);a.removeListener("finish",q);a.removeListener("drain",
|
|
1034
|
-
x);a.removeListener("error",k);a.removeListener("unpipe",e);t.removeListener("end",f);t.removeListener("end",g);t.removeListener("data",h);A=!0;!u.awaitDrain||a._writableState&&!a._writableState.needDrain||x()}function h(b){n("ondata");!1===a.write(b)&&(1!==u.pipesCount||u.pipes[0]!==a||1!==t.listenerCount("data")||A||(n("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++),t.pause())}function k(b){n("onerror",b);p();a.removeListener("error",k);0===a.listeners("error").length&&
|
|
1035
|
-
a.emit("error",b)}function m(){a.removeListener("finish",q);p()}function q(){n("onfinish");a.removeListener("close",m);p()}function p(){n("unpipe");t.unpipe(a)}var t=this,u=this._readableState;switch(u.pipesCount){case 0:u.pipes=a;break;case 1:u.pipes=[u.pipes,a];break;default:u.pipes.push(a)}u.pipesCount+=1;n("pipe count=%d opts=%j",u.pipesCount,d);var z=d&&!1===d.end||a===b.stdout||a===b.stderr?g:f;if(u.endEmitted)l(z);else t.once("end",z);a.on("unpipe",e);var x=w(t);a.on("drain",x);var A=!1;t.on("data",
|
|
1036
|
-
h);if(a._events&&a._events.error)J(a._events.error)?a._events.error.unshift(k):a._events.error=[k,a._events.error];else a.on("error",k);a.once("close",m);a.once("finish",q);a.emit("pipe",t);u.flowing||(n("pipe resume"),t.resume());return a};f.prototype.unpipe=function(a){var b=this._readableState;if(0===b.pipesCount)return this;if(1===b.pipesCount){if(a&&a!==b.pipes)return this;a||(a=b.pipes);b.pipes=null;b.pipesCount=0;b.flowing=!1;a&&a.emit("unpipe",this);return this}if(!a){a=b.pipes;var d=b.pipesCount;
|
|
1037
|
-
b.pipes=null;b.pipesCount=0;b.flowing=!1;for(var e=0;e<d;e++)a[e].emit("unpipe",this);return this}a:{for(var e=b.pipes,d=0,f=e.length;d<f;d++)if(e[d]===a){e=d;break a}e=-1}if(-1===e)return this;b.pipes.splice(e,1);--b.pipesCount;1===b.pipesCount&&(b.pipes=b.pipes[0]);a.emit("unpipe",this);return this};f.prototype.on=function(a,b){var d=E.prototype.on.call(this,a,b);"data"===a&&!1!==this._readableState.flowing&&this.resume();if("readable"===a&&this.readable){var e=this._readableState;e.readableListening||
|
|
1038
|
-
(e.readableListening=!0,e.emittedReadable=!1,e.needReadable=!0,e.reading?e.length&&k(this,e):l(B,this))}return d};f.prototype.addListener=f.prototype.on;f.prototype.resume=function(){var a=this._readableState;a.flowing||(n("resume"),a.flowing=!0,a.resumeScheduled||(a.resumeScheduled=!0,l(A,this,a)));return this};f.prototype.pause=function(){n("call pause flowing=%j",this._readableState.flowing);!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause"));return this};
|
|
1039
|
-
f.prototype.wrap=function(a){var b=this._readableState,d=!1,e=this;a.on("end",function(){n("wrapped end");if(b.decoder&&!b.ended){var a=b.decoder.end();a&&a.length&&e.push(a)}e.push(null)});a.on("data",function(f){n("wrapped data");b.decoder&&(f=b.decoder.write(f));b.objectMode&&(null===f||void 0===f)||!(b.objectMode||f&&f.length)||e.push(f)||(d=!0,a.pause())});for(var f in a)void 0===this[f]&&"function"===typeof a[f]&&(this[f]=function(b){return function(){return a[b].apply(a,arguments)}}(f));L(["error",
|
|
1040
|
-
"close","destroy","pause","resume"],function(b){a.on(b,e.emit.bind(e,b))});e._read=function(b){n("wrapped _read",b);d&&(d=!1,a.resume())};return e};f._fromList=G}).call(this,a("_process"))},{"./_stream_duplex":13,_process:11,buffer:3,"core-util-is":18,events:7,inherits:8,isarray:10,"process-nextick-args":19,"string_decoder/":26,util:2}],16:[function(a,d,f){function b(a){this.afterTransform=function(b,d){var e;e=a._transformState;e.transforming=!1;var f=e.writecb;f?(e.writechunk=null,e.writecb=null,
|
|
1041
|
-
null!==d&&void 0!==d&&a.push(d),f&&f(b),e=a._readableState,e.reading=!1,(e.needReadable||e.length<e.highWaterMark)&&a._read(e.highWaterMark),e=void 0):e=a.emit("error",Error("no writecb in Transform class"));return e};this.transforming=this.needTransform=!1;this.writechunk=this.writecb=null}function e(a){if(!(this instanceof e))return new e(a);h.call(this,a);this._transformState=new b(this);var d=this;this._readableState.needReadable=!0;this._readableState.sync=!1;a&&("function"===typeof a.transform&&
|
|
1042
|
-
(this._transform=a.transform),"function"===typeof a.flush&&(this._flush=a.flush));this.once("prefinish",function(){"function"===typeof this._flush?this._flush(function(a){g(d,a)}):g(d)})}function g(a,b){if(b)return a.emit("error",b);var d=a._transformState;if(a._writableState.length)throw Error("calling transform done when ws.length != 0");if(d.transforming)throw Error("calling transform done when still transforming");return a.push(null)}d.exports=e;var h=a("./_stream_duplex");d=a("core-util-is");
|
|
1043
|
-
d.inherits=a("inherits");d.inherits(e,h);e.prototype.push=function(a,b){this._transformState.needTransform=!1;return h.prototype.push.call(this,a,b)};e.prototype._transform=function(a,b,d){throw Error("not implemented");};e.prototype._write=function(a,b,d){var e=this._transformState;e.writecb=d;e.writechunk=a;e.writeencoding=b;e.transforming||(a=this._readableState,(e.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark))};e.prototype._read=function(a){a=this._transformState;
|
|
1044
|
-
null!==a.writechunk&&a.writecb&&!a.transforming?(a.transforming=!0,this._transform(a.writechunk,a.writeencoding,a.afterTransform)):a.needTransform=!0}},{"./_stream_duplex":13,"core-util-is":18,inherits:8}],17:[function(a,d,f){function b(){}function e(a,b,d){this.chunk=a;this.encoding=b;this.callback=d;this.next=null}function g(b,d){z=z||a("./_stream_duplex");b=b||{};this.objectMode=!!b.objectMode;d instanceof z&&(this.objectMode=this.objectMode||!!b.writableObjectMode);var e=b.highWaterMark,f=this.objectMode?
|
|
1045
|
-
16:16384;this.highWaterMark=e||0===e?e:f;this.highWaterMark=~~this.highWaterMark;this.finished=this.ended=this.ending=this.needDrain=!1;this.decodeStrings=!1!==b.decodeStrings;this.defaultEncoding=b.defaultEncoding||"utf8";this.length=0;this.writing=!1;this.corked=0;this.sync=!0;this.bufferProcessing=!1;this.onwrite=function(a){var b=d._writableState,e=b.sync,f=b.writecb;b.writing=!1;b.writecb=null;b.length-=b.writelen;b.writelen=0;a?(--b.pendingcb,e?B(f,a):f(a),d._writableState.errorEmitted=!0,d.emit("error",
|
|
1046
|
-
a)):((a=t(b))||b.corked||b.bufferProcessing||!b.bufferedRequest||p(d,b),e?B(k,d,b,a,f):k(d,b,a,f))};this.writecb=null;this.writelen=0;this.lastBufferedRequest=this.bufferedRequest=null;this.pendingcb=0;this.errorEmitted=this.prefinished=!1}function h(b){z=z||a("./_stream_duplex");if(!(this instanceof h||this instanceof z))return new h(b);this._writableState=new g(b,this);this.writable=!0;b&&("function"===typeof b.write&&(this._write=b.write),"function"===typeof b.writev&&(this._writev=b.writev));
|
|
1047
|
-
G.call(this)}function m(a,b,d,e,f,g,h){b.writelen=e;b.writecb=h;b.writing=!0;b.sync=!0;d?a._writev(f,b.onwrite):a._write(f,g,b.onwrite);b.sync=!1}function k(a,b,d,e){!d&&0===b.length&&b.needDrain&&(b.needDrain=!1,a.emit("drain"));b.pendingcb--;e();w(a,b)}function p(a,b){b.bufferProcessing=!0;var d=b.bufferedRequest;if(a._writev&&d&&d.next){for(var e=[],f=[];d;)f.push(d.callback),e.push(d),d=d.next;b.pendingcb++;b.lastBufferedRequest=null;m(a,b,!0,b.length,e,"",function(a){for(var d=0;d<f.length;d++)b.pendingcb--,
|
|
1048
|
-
f[d](a)})}else{for(;d&&(e=d.chunk,m(a,b,!1,b.objectMode?1:e.length,e,d.encoding,d.callback),d=d.next,!b.writing););null===d&&(b.lastBufferedRequest=null)}b.bufferedRequest=d;b.bufferProcessing=!1}function t(a){return a.ending&&0===a.length&&null===a.bufferedRequest&&!a.finished&&!a.writing}function w(a,b){var d=t(b);d&&(0===b.pendingcb?(b.prefinished||(b.prefinished=!0,a.emit("prefinish")),b.finished=!0,a.emit("finish")):b.prefinished||(b.prefinished=!0,a.emit("prefinish")));return d}d.exports=h;
|
|
1049
|
-
var B=a("process-nextick-args"),A=a("buffer").Buffer;h.WritableState=g;d=a("core-util-is");d.inherits=a("inherits");var x={deprecate:a("util-deprecate")},G;try{G=a("stream")}catch(F){}finally{G||(G=a("events").EventEmitter)}A=a("buffer").Buffer;d.inherits(h,G);var z;g.prototype.getBuffer=function(){for(var a=this.bufferedRequest,b=[];a;)b.push(a),a=a.next;return b};(function(){try{Object.defineProperty(g.prototype,"buffer",{get:x.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(a){}})();
|
|
1050
|
-
h.prototype.pipe=function(){this.emit("error",Error("Cannot pipe. Not readable."))};h.prototype.write=function(a,d,f){var g=this._writableState,h=!1;"function"===typeof d&&(f=d,d=null);A.isBuffer(a)?d="buffer":d||(d=g.defaultEncoding);"function"!==typeof f&&(f=b);if(g.ended)g=f,a=Error("write after end"),this.emit("error",a),B(g,a);else{var k=f,p=!0;A.isBuffer(a)||"string"===typeof a||null===a||void 0===a||g.objectMode||(p=new TypeError("Invalid non-string/buffer chunk"),this.emit("error",p),B(k,
|
|
1051
|
-
p),p=!1);p&&(g.pendingcb++,h=d,g.objectMode||!1===g.decodeStrings||"string"!==typeof a||(a=new A(a,h)),A.isBuffer(a)&&(h="buffer"),k=g.objectMode?1:a.length,g.length+=k,d=g.length<g.highWaterMark,d||(g.needDrain=!0),g.writing||g.corked?(k=g.lastBufferedRequest,g.lastBufferedRequest=new e(a,h,f),k?k.next=g.lastBufferedRequest:g.bufferedRequest=g.lastBufferedRequest):m(this,g,!1,k,a,h,f),h=d)}return h};h.prototype.cork=function(){this._writableState.corked++};h.prototype.uncork=function(){var a=this._writableState;
|
|
1052
|
-
a.corked&&(a.corked--,a.writing||a.corked||a.finished||a.bufferProcessing||!a.bufferedRequest||p(this,a))};h.prototype.setDefaultEncoding=function(a){"string"===typeof a&&(a=a.toLowerCase());if(!(-1<"hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le raw".split(" ").indexOf((a+"").toLowerCase())))throw new TypeError("Unknown encoding: "+a);this._writableState.defaultEncoding=a};h.prototype._write=function(a,b,d){d(Error("not implemented"))};h.prototype._writev=null;h.prototype.end=function(a,
|
|
1053
|
-
b,d){var e=this._writableState;"function"===typeof a?(d=a,b=a=null):"function"===typeof b&&(d=b,b=null);null!==a&&void 0!==a&&this.write(a,b);e.corked&&(e.corked=1,this.uncork());if(!e.ending&&!e.finished){a=d;e.ending=!0;w(this,e);if(a)if(e.finished)B(a);else this.once("finish",a);e.ended=!0}}},{"./_stream_duplex":13,buffer:3,"core-util-is":18,events:7,inherits:8,"process-nextick-args":19,"util-deprecate":20}],18:[function(a,d,f){(function(a){f.isArray=function(a){return Array.isArray?Array.isArray(a):
|
|
1054
|
-
"[object Array]"===Object.prototype.toString.call(a)};f.isBoolean=function(a){return"boolean"===typeof a};f.isNull=function(a){return null===a};f.isNullOrUndefined=function(a){return null==a};f.isNumber=function(a){return"number"===typeof a};f.isString=function(a){return"string"===typeof a};f.isSymbol=function(a){return"symbol"===typeof a};f.isUndefined=function(a){return void 0===a};f.isRegExp=function(a){return"[object RegExp]"===Object.prototype.toString.call(a)};f.isObject=function(a){return"object"===
|
|
1055
|
-
typeof a&&null!==a};f.isDate=function(a){return"[object Date]"===Object.prototype.toString.call(a)};f.isError=function(a){return"[object Error]"===Object.prototype.toString.call(a)||a instanceof Error};f.isFunction=function(a){return"function"===typeof a};f.isPrimitive=function(a){return null===a||"boolean"===typeof a||"number"===typeof a||"string"===typeof a||"symbol"===typeof a||"undefined"===typeof a};f.isBuffer=a.isBuffer}).call(this,{isBuffer:a("../../../../insert-module-globals/node_modules/is-buffer/index.js")})},
|
|
1056
|
-
{"../../../../insert-module-globals/node_modules/is-buffer/index.js":9}],19:[function(a,d,f){(function(a){function e(d){for(var e=Array(arguments.length-1),f=0;f<e.length;)e[f++]=arguments[f];a.nextTick(function(){d.apply(null,e)})}!a.version||0===a.version.indexOf("v0.")||0===a.version.indexOf("v1.")&&0!==a.version.indexOf("v1.8.")?d.exports=e:d.exports=a.nextTick}).call(this,a("_process"))},{_process:11}],20:[function(a,d,f){(function(a){function e(d){try{if(!a.localStorage)return!1}catch(e){return!1}d=
|
|
1057
|
-
a.localStorage[d];return null==d?!1:"true"===String(d).toLowerCase()}d.exports=function(a,b){if(e("noDeprecation"))return a;var d=!1;return function(){if(!d){if(e("throwDeprecation"))throw Error(b);e("traceDeprecation")?console.trace(b):console.warn(b);d=!0}return a.apply(this,arguments)}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],21:[function(a,d,f){d.exports=a("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":14}],
|
|
1058
|
-
22:[function(a,d,f){var b;a:{try{b=a("stream");break a}catch(e){}b=void 0}f=d.exports=a("./lib/_stream_readable.js");f.Stream=b||f;f.Readable=f;f.Writable=a("./lib/_stream_writable.js");f.Duplex=a("./lib/_stream_duplex.js");f.Transform=a("./lib/_stream_transform.js");f.PassThrough=a("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":13,"./lib/_stream_passthrough.js":14,"./lib/_stream_readable.js":15,"./lib/_stream_transform.js":16,"./lib/_stream_writable.js":17}],23:[function(a,d,f){d.exports=
|
|
1059
|
-
a("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":16}],24:[function(a,d,f){d.exports=a("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":17}],25:[function(a,d,f){function b(){e.call(this)}d.exports=b;var e=a("events").EventEmitter;a("inherits")(b,e);b.Readable=a("readable-stream/readable.js");b.Writable=a("readable-stream/writable.js");b.Duplex=a("readable-stream/duplex.js");b.Transform=a("readable-stream/transform.js");b.PassThrough=a("readable-stream/passthrough.js");b.Stream=
|
|
1060
|
-
b;b.prototype.pipe=function(a,b){function d(b){a.writable&&!1===a.write(b)&&A.pause&&A.pause()}function f(){A.readable&&A.resume&&A.resume()}function p(){x||(x=!0,a.end())}function t(){x||(x=!0,"function"===typeof a.destroy&&a.destroy())}function w(a){B();if(0===e.listenerCount(this,"error"))throw a;}function B(){A.removeListener("data",d);a.removeListener("drain",f);A.removeListener("end",p);A.removeListener("close",t);A.removeListener("error",w);a.removeListener("error",w);A.removeListener("end",
|
|
1061
|
-
B);A.removeListener("close",B);a.removeListener("close",B)}var A=this;A.on("data",d);a.on("drain",f);a._isStdio||b&&!1===b.end||(A.on("end",p),A.on("close",t));var x=!1;A.on("error",w);a.on("error",w);A.on("end",B);A.on("close",B);a.on("close",B);a.emit("pipe",A);return a}},{events:7,inherits:8,"readable-stream/duplex.js":12,"readable-stream/passthrough.js":21,"readable-stream/readable.js":22,"readable-stream/transform.js":23,"readable-stream/writable.js":24}],26:[function(a,d,f){function b(a){return a.toString(this.encoding)}
|
|
1062
|
-
function e(a){this.charLength=(this.charReceived=a.length%2)?2:0}function g(a){this.charLength=(this.charReceived=a.length%3)?3:0}var h=a("buffer").Buffer,m=h.isEncoding||function(a){switch(a&&a.toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":case "raw":return!0;default:return!1}};a=f.StringDecoder=function(a){this.encoding=(a||"utf8").toLowerCase().replace(/[-_]/,"");if(a&&!m(a))throw Error("Unknown encoding: "+
|
|
1063
|
-
a);switch(this.encoding){case "utf8":this.surrogateSize=3;break;case "ucs2":case "utf16le":this.surrogateSize=2;this.detectIncompleteChar=e;break;case "base64":this.surrogateSize=3;this.detectIncompleteChar=g;break;default:this.write=b;return}this.charBuffer=new h(6);this.charLength=this.charReceived=0};a.prototype.write=function(a){for(var b="";this.charLength;){b=a.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:a.length;a.copy(this.charBuffer,this.charReceived,0,b);
|
|
1064
|
-
this.charReceived+=b;if(this.charReceived<this.charLength)return"";a=a.slice(b,a.length);var b=this.charBuffer.slice(0,this.charLength).toString(this.encoding),d=b.charCodeAt(b.length-1);if(55296<=d&&56319>=d)this.charLength+=this.surrogateSize,b="";else{this.charReceived=this.charLength=0;if(0===a.length)return b;break}}this.detectIncompleteChar(a);var e=a.length;this.charLength&&(a.copy(this.charBuffer,0,a.length-this.charReceived,e),e-=this.charReceived);b+=a.toString(this.encoding,0,e);e=b.length-
|
|
1065
|
-
1;d=b.charCodeAt(e);return 55296<=d&&56319>=d?(d=this.surrogateSize,this.charLength+=d,this.charReceived+=d,this.charBuffer.copy(this.charBuffer,d,0,d),a.copy(this.charBuffer,0,0,d),b.substring(0,e)):b};a.prototype.detectIncompleteChar=function(a){for(var b=3<=a.length?3:a.length;0<b;b--){var d=a[a.length-b];if(1==b&&6==d>>5){this.charLength=2;break}if(2>=b&&14==d>>4){this.charLength=3;break}if(3>=b&&30==d>>3){this.charLength=4;break}}this.charReceived=b};a.prototype.end=function(a){var b="";a&&a.length&&
|
|
1066
|
-
(b=this.write(a));this.charReceived&&(a=this.encoding,b+=this.charBuffer.slice(0,this.charReceived).toString(a));return b}},{buffer:3}],27:[function(a,d,f){f=a("./lib/utils/common").assign;var b=a("./lib/deflate"),e=a("./lib/inflate");a=a("./lib/zlib/constants");var g={};f(g,b,e,a);d.exports=g},{"./lib/deflate":28,"./lib/inflate":29,"./lib/utils/common":30,"./lib/zlib/constants":33}],28:[function(a,d,f){function b(a){if(!(this instanceof b))return new b(a);a=this.options=h.assign({level:-1,method:8,
|
|
1067
|
-
chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new p;this.strm.avail_out=0;var d=g.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(0!==d)throw Error(k[d]);a.header&&g.deflateSetHeader(this.strm,a.header)}function e(a,d){var e=new b(d);e.push(a,!0);if(e.err)throw e.msg;return e.result}
|
|
1068
|
-
var g=a("./zlib/deflate"),h=a("./utils/common"),m=a("./utils/strings"),k=a("./zlib/messages"),p=a("./zlib/zstream"),t=Object.prototype.toString;b.prototype.push=function(a,b){var d=this.strm,e=this.options.chunkSize,f,k;if(this.ended)return!1;k=b===~~b?b:!0===b?4:0;"string"===typeof a?d.input=m.string2buf(a):"[object ArrayBuffer]"===t.call(a)?d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new h.Buf8(e),d.next_out=0,d.avail_out=e);f=g.deflate(d,
|
|
1069
|
-
k);if(1!==f&&0!==f)return this.onEnd(f),this.ended=!0,!1;if(0===d.avail_out||0===d.avail_in&&(4===k||2===k))if("string"===this.options.to)this.onData(m.buf2binstring(h.shrinkBuf(d.output,d.next_out)));else this.onData(h.shrinkBuf(d.output,d.next_out))}while((0<d.avail_in||0===d.avail_out)&&1!==f);if(4===k)return f=g.deflateEnd(this.strm),this.onEnd(f),this.ended=!0,0===f;2===k&&(this.onEnd(0),d.avail_out=0);return!0};b.prototype.onData=function(a){this.chunks.push(a)};b.prototype.onEnd=function(a){0===
|
|
1070
|
-
a&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Deflate=b;f.deflate=e;f.deflateRaw=function(a,b){b=b||{};b.raw=!0;return e(a,b)};f.gzip=function(a,b){b=b||{};b.gzip=!0;return e(a,b)}},{"./utils/common":30,"./utils/strings":31,"./zlib/deflate":35,"./zlib/messages":40,"./zlib/zstream":42}],29:[function(a,d,f){function b(a){if(!(this instanceof b))return new b(a);var d=this.options=h.assign({chunkSize:16384,
|
|
1071
|
-
windowBits:0,to:""},a||{});d.raw&&0<=d.windowBits&&16>d.windowBits&&(d.windowBits=-d.windowBits,0===d.windowBits&&(d.windowBits=-15));!(0<=d.windowBits&&16>d.windowBits)||a&&a.windowBits||(d.windowBits+=32);15<d.windowBits&&48>d.windowBits&&0===(d.windowBits&15)&&(d.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new t;this.strm.avail_out=0;a=g.inflateInit2(this.strm,d.windowBits);if(a!==k.Z_OK)throw Error(p[a]);this.header=new w;g.inflateGetHeader(this.strm,this.header)}
|
|
1072
|
-
function e(a,d){var e=new b(d);e.push(a,!0);if(e.err)throw e.msg;return e.result}var g=a("./zlib/inflate"),h=a("./utils/common"),m=a("./utils/strings"),k=a("./zlib/constants"),p=a("./zlib/messages"),t=a("./zlib/zstream"),w=a("./zlib/gzheader"),B=Object.prototype.toString;b.prototype.push=function(a,b){var d=this.strm,e=this.options.chunkSize,f,p,l,t,w,E=!1;if(this.ended)return!1;p=b===~~b?b:!0===b?k.Z_FINISH:k.Z_NO_FLUSH;"string"===typeof a?d.input=m.binstring2buf(a):"[object ArrayBuffer]"===B.call(a)?
|
|
1073
|
-
d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new h.Buf8(e),d.next_out=0,d.avail_out=e);f=g.inflate(d,k.Z_NO_FLUSH);f===k.Z_BUF_ERROR&&!0===E&&(f=k.Z_OK,E=!1);if(f!==k.Z_STREAM_END&&f!==k.Z_OK)return this.onEnd(f),this.ended=!0,!1;if(d.next_out&&(0===d.avail_out||f===k.Z_STREAM_END||0===d.avail_in&&(p===k.Z_FINISH||p===k.Z_SYNC_FLUSH)))if("string"===this.options.to)l=m.utf8border(d.output,d.next_out),t=d.next_out-l,w=m.buf2string(d.output,
|
|
1074
|
-
l),d.next_out=t,d.avail_out=e-t,t&&h.arraySet(d.output,d.output,l,t,0),this.onData(w);else this.onData(h.shrinkBuf(d.output,d.next_out));0===d.avail_in&&0===d.avail_out&&(E=!0)}while((0<d.avail_in||0===d.avail_out)&&f!==k.Z_STREAM_END);f===k.Z_STREAM_END&&(p=k.Z_FINISH);if(p===k.Z_FINISH)return f=g.inflateEnd(this.strm),this.onEnd(f),this.ended=!0,f===k.Z_OK;p===k.Z_SYNC_FLUSH&&(this.onEnd(k.Z_OK),d.avail_out=0);return!0};b.prototype.onData=function(a){this.chunks.push(a)};b.prototype.onEnd=function(a){a===
|
|
1075
|
-
k.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Inflate=b;f.inflate=e;f.inflateRaw=function(a,b){b=b||{};b.raw=!0;return e(a,b)};f.ungzip=e},{"./utils/common":30,"./utils/strings":31,"./zlib/constants":33,"./zlib/gzheader":36,"./zlib/inflate":38,"./zlib/messages":40,"./zlib/zstream":42}],30:[function(a,d,f){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;
|
|
1076
|
-
f.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!==typeof d)throw new TypeError(d+"must be non-object");for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}}return a};f.shrinkBuf=function(a,b){if(a.length===b)return a;if(a.subarray)return a.subarray(0,b);a.length=b;return a};var b={arraySet:function(a,b,d,e,f){if(b.subarray&&a.subarray)a.set(b.subarray(d,d+e),f);else for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){var b,d,
|
|
1077
|
-
e,f,t;b=e=0;for(d=a.length;b<d;b++)e+=a[b].length;t=new Uint8Array(e);b=e=0;for(d=a.length;b<d;b++)f=a[b],t.set(f,e),e+=f.length;return t}},e={arraySet:function(a,b,d,e,f){for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){return[].concat.apply([],a)}};f.setTyped=function(a){a?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,b)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(a)},{}],31:[function(a,d,f){function b(a,b){if(65537>b&&(a.subarray&&h||
|
|
1078
|
-
!a.subarray&&g))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var d="",f=0;f<b;f++)d+=String.fromCharCode(a[f]);return d}var e=a("./common"),g=!0,h=!0;try{String.fromCharCode.apply(null,[0])}catch(m){g=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(k){h=!1}var p=new e.Buf8(256);for(a=0;256>a;a++)p[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;p[254]=p[254]=1;f.string2buf=function(a){var b,d,f,g,h,k=a.length,m=0;for(g=0;g<k;g++)d=a.charCodeAt(g),55296===(d&64512)&&
|
|
1079
|
-
g+1<k&&(f=a.charCodeAt(g+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),g++)),m+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(m);for(g=h=0;h<m;g++)d=a.charCodeAt(g),55296===(d&64512)&&g+1<k&&(f=a.charCodeAt(g+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),g++)),128>d?b[h++]=d:(2048>d?b[h++]=192|d>>>6:(65536>d?b[h++]=224|d>>>12:(b[h++]=240|d>>>18,b[h++]=128|d>>>12&63),b[h++]=128|d>>>6&63),b[h++]=128|d&63);return b};f.buf2binstring=function(a){return b(a,a.length)};f.binstring2buf=function(a){for(var b=
|
|
1080
|
-
new e.Buf8(a.length),d=0,f=b.length;d<f;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,d){var e,f,g,h,k=d||a.length,m=Array(2*k);for(e=f=0;e<k;)if(g=a[e++],128>g)m[f++]=g;else if(h=p[g],4<h)m[f++]=65533,e+=h-1;else{for(g&=2===h?31:3===h?15:7;1<h&&e<k;)g=g<<6|a[e++]&63,h--;1<h?m[f++]=65533:65536>g?m[f++]=g:(g-=65536,m[f++]=55296|g>>10&1023,m[f++]=56320|g&1023)}return b(m,f)};f.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(a[d]&192);)d--;return 0>
|
|
1081
|
-
d||0===d?b:d+p[a[d]]>b?d:b}},{"./common":30}],32:[function(a,d,f){d.exports=function(a,d,f,h){var m=a&65535|0;a=a>>>16&65535|0;for(var k=0;0!==f;){k=2E3<f?2E3:f;f-=k;do m=m+d[h++]|0,a=a+m|0;while(--k);m%=65521;a%=65521}return m|a<<16|0}},{}],33:[function(a,d,f){d.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,
|
|
1082
|
-
Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],34:[function(a,d,f){var b=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b}();d.exports=function(a,d,f,m){f=m+f;for(a^=-1;m<f;m++)a=a>>>8^b[(a^d[m])&255];return a^-1}},{}],35:[function(a,d,f){function b(a,b){a.msg=D[b];return b}function e(a){for(var b=a.length;0<=--b;)a[b]=0}function g(a){var b=
|
|
1083
|
-
a.state,d=b.pending;d>a.avail_out&&(d=a.avail_out);0!==d&&(J.arraySet(a.output,b.pending_buf,b.pending_out,d,a.next_out),a.next_out+=d,b.pending_out+=d,a.total_out+=d,a.avail_out-=d,b.pending-=d,0===b.pending&&(b.pending_out=0))}function h(a,b){K._tr_flush_block(a,0<=a.block_start?a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;g(a.strm)}function m(a,b){a.pending_buf[a.pending++]=b}function k(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function p(a,
|
|
1084
|
-
b){var d=a.max_chain_length,e=a.strstart,f,g=a.prev_length,l=a.nice_match,h=a.strstart>a.w_size-262?a.strstart-(a.w_size-262):0,k=a.window,m=a.w_mask,p=a.prev,t=a.strstart+258,u=k[e+g-1],z=k[e+g];a.prev_length>=a.good_match&&(d>>=2);l>a.lookahead&&(l=a.lookahead);do if(f=b,k[f+g]===z&&k[f+g-1]===u&&k[f]===k[e]&&k[++f]===k[e+1]){e+=2;for(f++;k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&e<t;);f=258-(t-e);e=t-
|
|
1085
|
-
258;if(f>g){a.match_start=b;g=f;if(f>=l)break;u=k[e+g-1];z=k[e+g]}}while((b=p[b&m])>h&&0!==--d);return g<=a.lookahead?g:a.lookahead}function t(a){var b=a.w_size,d,e,f,g;do{g=a.window_size-a.lookahead-a.strstart;if(a.strstart>=b+(b-262)){J.arraySet(a.window,a.window,b,b,0);a.match_start-=b;a.strstart-=b;a.block_start-=b;d=e=a.hash_size;do f=a.head[--d],a.head[d]=f>=b?f-b:0;while(--e);d=e=b;do f=a.prev[--d],a.prev[d]=f>=b?f-b:0;while(--e);g+=b}if(0===a.strm.avail_in)break;d=a.strm;e=a.window;f=a.strstart+
|
|
1086
|
-
a.lookahead;var l=d.avail_in;l>g&&(l=g);0===l?e=0:(d.avail_in-=l,J.arraySet(e,d.input,d.next_in,l,f),1===d.state.wrap?d.adler=E(d.adler,e,l,f):2===d.state.wrap&&(d.adler=y(d.adler,e,l,f)),d.next_in+=l,d.total_in+=l,e=l);a.lookahead+=e;if(3<=a.lookahead+a.insert)for(g=a.strstart-a.insert,a.ins_h=a.window[g],a.ins_h=(a.ins_h<<a.hash_shift^a.window[g+1])&a.hash_mask;a.insert&&!(a.ins_h=(a.ins_h<<a.hash_shift^a.window[g+3-1])&a.hash_mask,a.prev[g&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=g,g++,a.insert--,
|
|
1087
|
-
3>a.lookahead+a.insert););}while(262>a.lookahead&&0!==a.strm.avail_in)}function w(a,b){for(var d;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);0!==d&&a.strstart-d<=a.w_size-262&&(a.match_length=p(a,d));if(3<=a.match_length)if(d=K._tr_tally(a,a.strstart-a.match_start,a.match_length-3),a.lookahead-=
|
|
1088
|
-
a.match_length,a.match_length<=a.max_lazy_match&&3<=a.lookahead){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=K._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&
|
|
1089
|
-
(h(a,!1),0===a.strm.avail_out))return 1}a.insert=2>a.strstart?a.strstart:2;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function B(a,b){for(var d,e;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);a.prev_length=a.match_length;a.prev_match=a.match_start;
|
|
1090
|
-
a.match_length=2;0!==d&&a.prev_length<a.max_lazy_match&&a.strstart-d<=a.w_size-262&&(a.match_length=p(a,d),5>=a.match_length&&(1===a.strategy||3===a.match_length&&4096<a.strstart-a.match_start)&&(a.match_length=2));if(3<=a.prev_length&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-3;d=K._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-3);a.lookahead-=a.prev_length-1;a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&
|
|
1091
|
-
a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);a.match_available=0;a.match_length=2;a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return 1}else if(a.match_available){if((d=K._tr_tally(a,0,a.window[a.strstart-1]))&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return 1}else a.match_available=1,a.strstart++,a.lookahead--}a.match_available&&(K._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0);a.insert=2>a.strstart?a.strstart:2;return 4===b?(h(a,
|
|
1092
|
-
!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function A(a,b){for(var d,e,f,g=a.window;;){if(258>=a.lookahead){t(a);if(258>=a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.match_length=0;if(3<=a.lookahead&&0<a.strstart&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){for(f=a.strstart+258;d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&e<f;);a.match_length=258-(f-e);a.match_length>a.lookahead&&(a.match_length=
|
|
1093
|
-
a.lookahead)}3<=a.match_length?(d=K._tr_tally(a,1,a.match_length-3),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(d=K._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++);if(d&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function x(a,b){for(var d;;){if(0===a.lookahead&&(t(a),0===a.lookahead)){if(0===b)return 1;break}a.match_length=0;d=K._tr_tally(a,0,a.window[a.strstart]);
|
|
1094
|
-
a.lookahead--;a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(h(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?1:2}function G(a,b,d,e,f){this.good_length=a;this.max_lazy=b;this.nice_length=d;this.max_chain=e;this.func=f}function F(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=8;this.last_flush=-1;this.w_mask=this.w_bits=
|
|
1095
|
-
this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new J.Buf16(1146);this.dyn_dtree=new J.Buf16(122);this.bl_tree=new J.Buf16(78);e(this.dyn_ltree);e(this.dyn_dtree);
|
|
1096
|
-
e(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new J.Buf16(16);this.heap=new J.Buf16(573);e(this.heap);this.heap_max=this.heap_len=0;this.depth=new J.Buf16(573);e(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.d_buf=this.last_lit=this.lit_bufsize=this.l_buf=0}function z(a){var d;if(!a||!a.state)return b(a,-2);a.total_in=a.total_out=0;a.data_type=2;d=a.state;d.pending=0;d.pending_out=0;0>d.wrap&&(d.wrap=-d.wrap);d.status=d.wrap?
|
|
1097
|
-
42:113;a.adler=2===d.wrap?0:1;d.last_flush=0;K._tr_init(d);return 0}function L(a){var b=z(a);0===b&&(a=a.state,a.window_size=2*a.w_size,e(a.head),a.max_lazy_match=u[a.level].max_lazy,a.good_match=u[a.level].good_length,a.nice_match=u[a.level].nice_length,a.max_chain_length=u[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0);return b}function l(a,d,e,f,g,l){if(!a)return-2;var h=1;-1===d&&(d=6);0>f?(h=0,f=-f):15<f&&
|
|
1098
|
-
(h=2,f-=16);if(1>g||9<g||8!==e||8>f||15<f||0>d||9<d||0>l||4<l)return b(a,-2);8===f&&(f=9);var k=new F;a.state=k;k.strm=a;k.wrap=h;k.gzhead=null;k.w_bits=f;k.w_size=1<<k.w_bits;k.w_mask=k.w_size-1;k.hash_bits=g+7;k.hash_size=1<<k.hash_bits;k.hash_mask=k.hash_size-1;k.hash_shift=~~((k.hash_bits+3-1)/3);k.window=new J.Buf8(2*k.w_size);k.head=new J.Buf16(k.hash_size);k.prev=new J.Buf16(k.w_size);k.lit_bufsize=1<<g+6;k.pending_buf_size=4*k.lit_bufsize;k.pending_buf=new J.Buf8(k.pending_buf_size);k.d_buf=
|
|
1099
|
-
k.lit_bufsize>>1;k.l_buf=3*k.lit_bufsize;k.level=d;k.strategy=l;k.method=e;return L(a)}var J=a("../utils/common"),K=a("./trees"),E=a("./adler32"),y=a("./crc32"),D=a("./messages"),u;u=[new G(0,0,0,0,function(a,b){var d=65535;for(d>a.pending_buf_size-5&&(d=a.pending_buf_size-5);;){if(1>=a.lookahead){t(a);if(0===a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.strstart+=a.lookahead;a.lookahead=0;var e=a.block_start+d;if(0===a.strstart||a.strstart>=e)if(a.lookahead=a.strstart-e,a.strstart=e,h(a,
|
|
1100
|
-
!1),0===a.strm.avail_out)return 1;if(a.strstart-a.block_start>=a.w_size-262&&(h(a,!1),0===a.strm.avail_out))return 1}a.insert=0;if(4===b)return h(a,!0),0===a.strm.avail_out?3:4;a.strstart>a.block_start&&h(a,!1);return 1}),new G(4,4,8,4,w),new G(4,5,16,8,w),new G(4,6,32,32,w),new G(4,4,16,16,B),new G(8,16,32,32,B),new G(8,16,128,128,B),new G(8,32,128,256,B),new G(32,128,258,1024,B),new G(32,258,258,4096,B)];f.deflateInit=function(a,b){return l(a,b,8,15,8,0)};f.deflateInit2=l;f.deflateReset=L;f.deflateResetKeep=
|
|
1101
|
-
z;f.deflateSetHeader=function(a,b){if(!a||!a.state||2!==a.state.wrap)return-2;a.state.gzhead=b;return 0};f.deflate=function(a,d){var f,l,h,p;if(!a||!a.state||5<d||0>d)return a?b(a,-2):-2;l=a.state;if(!a.output||!a.input&&0!==a.avail_in||666===l.status&&4!==d)return b(a,0===a.avail_out?-5:-2);l.strm=a;f=l.last_flush;l.last_flush=d;42===l.status&&(2===l.wrap?(a.adler=0,m(l,31),m(l,139),m(l,8),l.gzhead?(m(l,(l.gzhead.text?1:0)+(l.gzhead.hcrc?2:0)+(l.gzhead.extra?4:0)+(l.gzhead.name?8:0)+(l.gzhead.comment?
|
|
1102
|
-
16:0)),m(l,l.gzhead.time&255),m(l,l.gzhead.time>>8&255),m(l,l.gzhead.time>>16&255),m(l,l.gzhead.time>>24&255),m(l,9===l.level?2:2<=l.strategy||2>l.level?4:0),m(l,l.gzhead.os&255),l.gzhead.extra&&l.gzhead.extra.length&&(m(l,l.gzhead.extra.length&255),m(l,l.gzhead.extra.length>>8&255)),l.gzhead.hcrc&&(a.adler=y(a.adler,l.pending_buf,l.pending,0)),l.gzindex=0,l.status=69):(m(l,0),m(l,0),m(l,0),m(l,0),m(l,0),m(l,9===l.level?2:2<=l.strategy||2>l.level?4:0),m(l,3),l.status=113)):(h=8+(l.w_bits-8<<4)<<8,
|
|
1103
|
-
p=-1,p=2<=l.strategy||2>l.level?0:6>l.level?1:6===l.level?2:3,h|=p<<6,0!==l.strstart&&(h|=32),l.status=113,k(l,h+(31-h%31)),0!==l.strstart&&(k(l,a.adler>>>16),k(l,a.adler&65535)),a.adler=1));if(69===l.status)if(l.gzhead.extra){for(h=l.pending;l.gzindex<(l.gzhead.extra.length&65535)&&(l.pending!==l.pending_buf_size||(l.gzhead.hcrc&&l.pending>h&&(a.adler=y(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending!==l.pending_buf_size));)m(l,l.gzhead.extra[l.gzindex]&255),l.gzindex++;l.gzhead.hcrc&&
|
|
1104
|
-
l.pending>h&&(a.adler=y(a.adler,l.pending_buf,l.pending-h,h));l.gzindex===l.gzhead.extra.length&&(l.gzindex=0,l.status=73)}else l.status=73;if(73===l.status)if(l.gzhead.name){h=l.pending;do{if(l.pending===l.pending_buf_size&&(l.gzhead.hcrc&&l.pending>h&&(a.adler=y(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending===l.pending_buf_size)){p=1;break}p=l.gzindex<l.gzhead.name.length?l.gzhead.name.charCodeAt(l.gzindex++)&255:0;m(l,p)}while(0!==p);l.gzhead.hcrc&&l.pending>h&&(a.adler=y(a.adler,
|
|
1105
|
-
l.pending_buf,l.pending-h,h));0===p&&(l.gzindex=0,l.status=91)}else l.status=91;if(91===l.status)if(l.gzhead.comment){h=l.pending;do{if(l.pending===l.pending_buf_size&&(l.gzhead.hcrc&&l.pending>h&&(a.adler=y(a.adler,l.pending_buf,l.pending-h,h)),g(a),h=l.pending,l.pending===l.pending_buf_size)){p=1;break}p=l.gzindex<l.gzhead.comment.length?l.gzhead.comment.charCodeAt(l.gzindex++)&255:0;m(l,p)}while(0!==p);l.gzhead.hcrc&&l.pending>h&&(a.adler=y(a.adler,l.pending_buf,l.pending-h,h));0===p&&(l.status=
|
|
1106
|
-
103)}else l.status=103;103===l.status&&(l.gzhead.hcrc?(l.pending+2>l.pending_buf_size&&g(a),l.pending+2<=l.pending_buf_size&&(m(l,a.adler&255),m(l,a.adler>>8&255),a.adler=0,l.status=113)):l.status=113);if(0!==l.pending){if(g(a),0===a.avail_out)return l.last_flush=-1,0}else if(0===a.avail_in&&(d<<1)-(4<d?9:0)<=(f<<1)-(4<f?9:0)&&4!==d)return b(a,-5);if(666===l.status&&0!==a.avail_in)return b(a,-5);if(0!==a.avail_in||0!==l.lookahead||0!==d&&666!==l.status){f=2===l.strategy?x(l,d):3===l.strategy?A(l,
|
|
1107
|
-
d):u[l.level].func(l,d);if(3===f||4===f)l.status=666;if(1===f||3===f)return 0===a.avail_out&&(l.last_flush=-1),0;if(2===f&&(1===d?K._tr_align(l):5!==d&&(K._tr_stored_block(l,0,0,!1),3===d&&(e(l.head),0===l.lookahead&&(l.strstart=0,l.block_start=0,l.insert=0))),g(a),0===a.avail_out))return l.last_flush=-1,0}if(4!==d)return 0;if(0>=l.wrap)return 1;2===l.wrap?(m(l,a.adler&255),m(l,a.adler>>8&255),m(l,a.adler>>16&255),m(l,a.adler>>24&255),m(l,a.total_in&255),m(l,a.total_in>>8&255),m(l,a.total_in>>16&
|
|
1108
|
-
255),m(l,a.total_in>>24&255)):(k(l,a.adler>>>16),k(l,a.adler&65535));g(a);0<l.wrap&&(l.wrap=-l.wrap);return 0!==l.pending?0:1};f.deflateEnd=function(a){var d;if(!a||!a.state)return-2;d=a.state.status;if(42!==d&&69!==d&&73!==d&&91!==d&&103!==d&&113!==d&&666!==d)return b(a,-2);a.state=null;return 113===d?b(a,-3):0};f.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":30,"./adler32":32,"./crc32":34,"./messages":40,"./trees":41}],36:[function(a,d,f){d.exports=function(){this.os=this.xflags=
|
|
1109
|
-
this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=0;this.done=!1}},{}],37:[function(a,d,f){d.exports=function(a,d){var f,h,m,k,p,t,w,B,A,x,G,F,z,L,l,J,K,E,y,D,u,n,q,I;f=a.state;h=a.next_in;q=a.input;m=h+(a.avail_in-5);k=a.next_out;I=a.output;p=k-(d-a.avail_out);t=k+(a.avail_out-257);w=f.dmax;B=f.wsize;A=f.whave;x=f.wnext;G=f.window;F=f.hold;z=f.bits;L=f.lencode;l=f.distcode;J=(1<<f.lenbits)-1;K=(1<<f.distbits)-1;a:do b:for(15>z&&(F+=q[h++]<<z,z+=8,F+=q[h++]<<
|
|
1110
|
-
z,z+=8),E=L[F&J];;){y=E>>>24;F>>>=y;z-=y;y=E>>>16&255;if(0===y)I[k++]=E&65535;else if(y&16){D=E&65535;if(y&=15)z<y&&(F+=q[h++]<<z,z+=8),D+=F&(1<<y)-1,F>>>=y,z-=y;15>z&&(F+=q[h++]<<z,z+=8,F+=q[h++]<<z,z+=8);E=l[F&K];c:for(;;){y=E>>>24;F>>>=y;z-=y;y=E>>>16&255;if(y&16){E&=65535;y&=15;z<y&&(F+=q[h++]<<z,z+=8,z<y&&(F+=q[h++]<<z,z+=8));E+=F&(1<<y)-1;if(E>w){a.msg="invalid distance too far back";f.mode=30;break a}F>>>=y;z-=y;y=k-p;if(E>y){y=E-y;if(y>A&&f.sane){a.msg="invalid distance too far back";f.mode=
|
|
1111
|
-
30;break a}u=0;n=G;if(0===x){if(u+=B-y,y<D){D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}}else if(x<y){if(u+=B+x-y,y-=x,y<D){D-=y;do I[k++]=G[u++];while(--y);u=0;if(x<D){y=x;D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}}}else if(u+=x-y,y<D){D-=y;do I[k++]=G[u++];while(--y);u=k-E;n=I}for(;2<D;)I[k++]=n[u++],I[k++]=n[u++],I[k++]=n[u++],D-=3;D&&(I[k++]=n[u++],1<D&&(I[k++]=n[u++]))}else{u=k-E;do I[k++]=I[u++],I[k++]=I[u++],I[k++]=I[u++],D-=3;while(2<D);D&&(I[k++]=I[u++],1<D&&(I[k++]=I[u++]))}}else if(0===
|
|
1112
|
-
(y&64)){E=l[(E&65535)+(F&(1<<y)-1)];continue c}else{a.msg="invalid distance code";f.mode=30;break a}break}}else if(0===(y&64)){E=L[(E&65535)+(F&(1<<y)-1)];continue b}else{y&32?f.mode=12:(a.msg="invalid literal/length code",f.mode=30);break a}break}while(h<m&&k<t);D=z>>3;h-=D;z-=D<<3;a.next_in=h;a.next_out=k;a.avail_in=h<m?5+(m-h):5-(h-m);a.avail_out=k<t?257+(t-k):257-(k-t);f.hold=F&(1<<z)-1;f.bits=z}},{}],38:[function(a,d,f){function b(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<
|
|
1113
|
-
24)}function e(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new p.Buf16(320);this.work=new p.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(a){var b;
|
|
1114
|
-
if(!a||!a.state)return-2;b=a.state;a.total_in=a.total_out=b.total=0;a.msg="";b.wrap&&(a.adler=b.wrap&1);b.mode=1;b.last=0;b.havedict=0;b.dmax=32768;b.head=null;b.hold=0;b.bits=0;b.lencode=b.lendyn=new p.Buf32(852);b.distcode=b.distdyn=new p.Buf32(592);b.sane=1;b.back=-1;return 0}function h(a){var b;if(!a||!a.state)return-2;b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return g(a)}function m(a,b){var d,e;if(!a||!a.state)return-2;e=a.state;0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15));if(b&&(8>b||15<b))return-2;
|
|
1115
|
-
null!==e.window&&e.wbits!==b&&(e.window=null);e.wrap=d;e.wbits=b;return h(a)}function k(a,b){var d;if(!a)return-2;d=new e;a.state=d;d.window=null;d=m(a,b);0!==d&&(a.state=null);return d}var p=a("../utils/common"),t=a("./adler32"),w=a("./crc32"),B=a("./inffast"),A=a("./inftrees"),x=!0,G,F;f.inflateReset=h;f.inflateReset2=m;f.inflateResetKeep=g;f.inflateInit=function(a){return k(a,15)};f.inflateInit2=k;f.inflate=function(a,d){var e,f,g,h,k,m,u,n,q,I,H,v,C,P,M=0,R,T,O,Q=new p.Buf8(4),U=[16,17,18,0,8,
|
|
1116
|
-
7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return-2;e=a.state;12===e.mode&&(e.mode=13);k=a.next_out;g=a.output;u=a.avail_out;h=a.next_in;f=a.input;m=a.avail_in;n=e.hold;q=e.bits;I=m;H=u;O=0;a:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;16>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}if(e.wrap&2&&35615===n){e.check=0;Q[0]=n&255;Q[1]=n>>>8&255;e.check=w(e.check,Q,2,0);q=n=0;e.mode=2;break}e.flags=0;e.head&&(e.head.done=!1);if(!(e.wrap&
|
|
1117
|
-
1)||(((n&255)<<8)+(n>>8))%31){a.msg="incorrect header check";e.mode=30;break}if(8!==(n&15)){a.msg="unknown compression method";e.mode=30;break}n>>>=4;q-=4;C=(n&15)+8;if(0===e.wbits)e.wbits=C;else if(C>e.wbits){a.msg="invalid window size";e.mode=30;break}e.dmax=1<<C;a.adler=e.check=1;e.mode=n&512?10:12;q=n=0;break;case 2:for(;16>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}e.flags=n;if(8!==(e.flags&255)){a.msg="unknown compression method";e.mode=30;break}if(e.flags&57344){a.msg="unknown header flags set";
|
|
1118
|
-
e.mode=30;break}e.head&&(e.head.text=n>>8&1);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0;e.mode=3;case 3:for(;32>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}e.head&&(e.head.time=n);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,Q[2]=n>>>16&255,Q[3]=n>>>24&255,e.check=w(e.check,Q,4,0));q=n=0;e.mode=4;case 4:for(;16>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}e.head&&(e.head.xflags=n&255,e.head.os=n>>8);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0;e.mode=
|
|
1119
|
-
5;case 5:if(e.flags&1024){for(;16>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}e.length=n;e.head&&(e.head.extra_len=n);e.flags&512&&(Q[0]=n&255,Q[1]=n>>>8&255,e.check=w(e.check,Q,2,0));q=n=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(e.flags&1024&&(v=e.length,v>m&&(v=m),v&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=Array(e.head.extra_len)),p.arraySet(e.head.extra,f,h,v,C)),e.flags&512&&(e.check=w(e.check,f,v,h)),m-=v,h+=v,e.length-=v),e.length))break a;e.length=0;e.mode=
|
|
1120
|
-
7;case 7:if(e.flags&2048){if(0===m)break a;v=0;do C=f[h+v++],e.head&&C&&65536>e.length&&(e.head.name+=String.fromCharCode(C));while(C&&v<m);e.flags&512&&(e.check=w(e.check,f,v,h));m-=v;h+=v;if(C)break a}else e.head&&(e.head.name=null);e.length=0;e.mode=8;case 8:if(e.flags&4096){if(0===m)break a;v=0;do C=f[h+v++],e.head&&C&&65536>e.length&&(e.head.comment+=String.fromCharCode(C));while(C&&v<m);e.flags&512&&(e.check=w(e.check,f,v,h));m-=v;h+=v;if(C)break a}else e.head&&(e.head.comment=null);e.mode=
|
|
1121
|
-
9;case 9:if(e.flags&512){for(;16>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}if(n!==(e.check&65535)){a.msg="header crc mismatch";e.mode=30;break}q=n=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0);a.adler=e.check=0;e.mode=12;break;case 10:for(;32>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}a.adler=e.check=b(n);q=n=0;e.mode=11;case 11:if(0===e.havedict)return a.next_out=k,a.avail_out=u,a.next_in=h,a.avail_in=m,e.hold=n,e.bits=q,2;a.adler=e.check=1;e.mode=12;case 12:if(5===d||6===d)break a;case 13:if(e.last){n>>>=
|
|
1122
|
-
q&7;q-=q&7;e.mode=27;break}for(;3>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}e.last=n&1;n>>>=1;--q;switch(n&3){case 0:e.mode=14;break;case 1:v=e;if(x){C=void 0;G=new p.Buf32(512);F=new p.Buf32(32);for(C=0;144>C;)v.lens[C++]=8;for(;256>C;)v.lens[C++]=9;for(;280>C;)v.lens[C++]=7;for(;288>C;)v.lens[C++]=8;A(1,v.lens,0,288,G,0,v.work,{bits:9});for(C=0;32>C;)v.lens[C++]=5;A(2,v.lens,0,32,F,0,v.work,{bits:5});x=!1}v.lencode=G;v.lenbits=9;v.distcode=F;v.distbits=5;e.mode=20;if(6===d){n>>>=2;q-=2;break a}break;
|
|
1123
|
-
case 2:e.mode=17;break;case 3:a.msg="invalid block type",e.mode=30}n>>>=2;q-=2;break;case 14:n>>>=q&7;for(q-=q&7;32>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}if((n&65535)!==(n>>>16^65535)){a.msg="invalid stored block lengths";e.mode=30;break}e.length=n&65535;q=n=0;e.mode=15;if(6===d)break a;case 15:e.mode=16;case 16:if(v=e.length){v>m&&(v=m);v>u&&(v=u);if(0===v)break a;p.arraySet(g,f,h,v,k);m-=v;h+=v;u-=v;k+=v;e.length-=v;break}e.mode=12;break;case 17:for(;14>q;){if(0===m)break a;m--;n+=f[h++]<<
|
|
1124
|
-
q;q+=8}e.nlen=(n&31)+257;n>>>=5;q-=5;e.ndist=(n&31)+1;n>>>=5;q-=5;e.ncode=(n&15)+4;n>>>=4;q-=4;if(286<e.nlen||30<e.ndist){a.msg="too many length or distance symbols";e.mode=30;break}e.have=0;e.mode=18;case 18:for(;e.have<e.ncode;){for(;3>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}e.lens[U[e.have++]]=n&7;n>>>=3;q-=3}for(;19>e.have;)e.lens[U[e.have++]]=0;e.lencode=e.lendyn;e.lenbits=7;v={bits:e.lenbits};O=A(0,e.lens,0,19,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid code lengths set";
|
|
1125
|
-
e.mode=30;break}e.have=0;e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;;){M=e.lencode[n&(1<<e.lenbits)-1];v=M>>>24;M&=65535;if(v<=q)break;if(0===m)break a;m--;n+=f[h++]<<q;q+=8}if(16>M)n>>>=v,q-=v,e.lens[e.have++]=M;else{if(16===M){for(C=v+2;q<C;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;if(0===e.have){a.msg="invalid bit length repeat";e.mode=30;break}C=e.lens[e.have-1];v=3+(n&3);n>>>=2;q-=2}else if(17===M){for(C=v+3;q<C;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;C=0;v=3+
|
|
1126
|
-
(n&7);n>>>=3;q-=3}else{for(C=v+7;q<C;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}n>>>=v;q-=v;C=0;v=11+(n&127);n>>>=7;q-=7}if(e.have+v>e.nlen+e.ndist){a.msg="invalid bit length repeat";e.mode=30;break}for(;v--;)e.lens[e.have++]=C}}if(30===e.mode)break;if(0===e.lens[256]){a.msg="invalid code -- missing end-of-block";e.mode=30;break}e.lenbits=9;v={bits:e.lenbits};O=A(1,e.lens,0,e.nlen,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid literal/lengths set";e.mode=30;break}e.distbits=6;e.distcode=
|
|
1127
|
-
e.distdyn;v={bits:e.distbits};O=A(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,v);e.distbits=v.bits;if(O){a.msg="invalid distances set";e.mode=30;break}e.mode=20;if(6===d)break a;case 20:e.mode=21;case 21:if(6<=m&&258<=u){a.next_out=k;a.avail_out=u;a.next_in=h;a.avail_in=m;e.hold=n;e.bits=q;B(a,H);k=a.next_out;g=a.output;u=a.avail_out;h=a.next_in;f=a.input;m=a.avail_in;n=e.hold;q=e.bits;12===e.mode&&(e.back=-1);break}for(e.back=0;;){M=e.lencode[n&(1<<e.lenbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=
|
|
1128
|
-
q)break;if(0===m)break a;m--;n+=f[h++]<<q;q+=8}if(C&&0===(C&240)){P=v;R=C;for(T=M;;){M=e.lencode[T+((n&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=q)break;if(0===m)break a;m--;n+=f[h++]<<q;q+=8}n>>>=P;q-=P;e.back+=P}n>>>=v;q-=v;e.back+=v;e.length=M;if(0===C){e.mode=26;break}if(C&32){e.back=-1;e.mode=12;break}if(C&64){a.msg="invalid literal/length code";e.mode=30;break}e.extra=C&15;e.mode=22;case 22:if(e.extra){for(C=e.extra;q<C;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}e.length+=n&(1<<
|
|
1129
|
-
e.extra)-1;n>>>=e.extra;q-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=23;case 23:for(;;){M=e.distcode[n&(1<<e.distbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=q)break;if(0===m)break a;m--;n+=f[h++]<<q;q+=8}if(0===(C&240)){P=v;R=C;for(T=M;;){M=e.distcode[T+((n&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=q)break;if(0===m)break a;m--;n+=f[h++]<<q;q+=8}n>>>=P;q-=P;e.back+=P}n>>>=v;q-=v;e.back+=v;if(C&64){a.msg="invalid distance code";e.mode=30;break}e.offset=M;e.extra=C&15;e.mode=24;case 24:if(e.extra){for(C=
|
|
1130
|
-
e.extra;q<C;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}e.offset+=n&(1<<e.extra)-1;n>>>=e.extra;q-=e.extra;e.back+=e.extra}if(e.offset>e.dmax){a.msg="invalid distance too far back";e.mode=30;break}e.mode=25;case 25:if(0===u)break a;v=H-u;if(e.offset>v){v=e.offset-v;if(v>e.whave&&e.sane){a.msg="invalid distance too far back";e.mode=30;break}v>e.wnext?(v-=e.wnext,C=e.wsize-v):C=e.wnext-v;v>e.length&&(v=e.length);P=e.window}else P=g,C=k-e.offset,v=e.length;v>u&&(v=u);u-=v;e.length-=v;do g[k++]=P[C++];while(--v);
|
|
1131
|
-
0===e.length&&(e.mode=21);break;case 26:if(0===u)break a;g[k++]=e.length;u--;e.mode=21;break;case 27:if(e.wrap){for(;32>q;){if(0===m)break a;m--;n|=f[h++]<<q;q+=8}H-=u;a.total_out+=H;e.total+=H;H&&(a.adler=e.check=e.flags?w(e.check,g,H,k-H):t(e.check,g,H,k-H));H=u;if((e.flags?n:b(n))!==e.check){a.msg="incorrect data check";e.mode=30;break}q=n=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;32>q;){if(0===m)break a;m--;n+=f[h++]<<q;q+=8}if(n!==(e.total&4294967295)){a.msg="incorrect length check";e.mode=
|
|
1132
|
-
30;break}q=n=0}e.mode=29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=k;a.avail_out=u;a.next_in=h;a.avail_in=m;e.hold=n;e.bits=q;if(e.wsize||H!==a.avail_out&&30>e.mode&&(27>e.mode||4!==d))f=a.output,h=a.next_out,k=H-a.avail_out,u=a.state,null===u.window&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new p.Buf8(u.wsize)),k>=u.wsize?(p.arraySet(u.window,f,h-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(m=u.wsize-u.wnext,m>k&&(m=k),p.arraySet(u.window,f,h-
|
|
1133
|
-
k,m,u.wnext),(k-=m)?(p.arraySet(u.window,f,h-k,k,0),u.wnext=k,u.whave=u.wsize):(u.wnext+=m,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=m)));I-=a.avail_in;H-=a.avail_out;a.total_in+=I;a.total_out+=H;e.total+=H;e.wrap&&H&&(a.adler=e.check=e.flags?w(e.check,g,H,a.next_out-H):t(e.check,g,H,a.next_out-H));a.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0);(0===I&&0===H||4===d)&&0===O&&(O=-5);return O};f.inflateEnd=function(a){if(!a||!a.state)return-2;var b=
|
|
1134
|
-
a.state;b.window&&(b.window=null);a.state=null;return 0};f.inflateGetHeader=function(a,b){var d;if(!a||!a.state)return-2;d=a.state;if(0===(d.wrap&2))return-2;d.head=b;b.done=!1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":30,"./adler32":32,"./crc32":34,"./inffast":37,"./inftrees":39}],39:[function(a,d,f){var b=a("../utils/common"),e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,
|
|
1135
|
-
18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],m=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];d.exports=function(a,d,f,w,B,A,x,G){for(var F=G.bits,z=0,L=0,l=0,J=0,K=0,E=0,y=0,D=0,u=0,n=0,q,I,H=null,v=0,C,P=new b.Buf16(16),E=new b.Buf16(16),M=null,R=0,T,O,Q,z=0;15>=z;z++)P[z]=0;for(L=0;L<w;L++)P[d[f+L]]++;K=F;for(J=15;1<=
|
|
1136
|
-
J&&0===P[J];J--);K>J&&(K=J);if(0===J)return B[A++]=20971520,B[A++]=20971520,G.bits=1,0;for(l=1;l<J&&0===P[l];l++);K<l&&(K=l);for(z=D=1;15>=z;z++)if(D<<=1,D-=P[z],0>D)return-1;if(0<D&&(0===a||1!==J))return-1;E[1]=0;for(z=1;15>z;z++)E[z+1]=E[z]+P[z];for(L=0;L<w;L++)0!==d[f+L]&&(x[E[d[f+L]]++]=L);0===a?(H=M=x,C=19):1===a?(H=e,v-=257,M=g,R-=257,C=256):(H=h,M=m,C=-1);L=n=0;z=l;F=A;E=K;y=0;I=-1;u=1<<K;w=u-1;if(1===a&&852<u||2===a&&592<u)return 1;for(var U=0;;){U++;T=z-y;x[L]<C?(O=0,Q=x[L]):x[L]>C?(O=M[R+
|
|
1137
|
-
x[L]],Q=H[v+x[L]]):(O=96,Q=0);D=1<<z-y;l=q=1<<E;do q-=D,B[F+(n>>y)+q]=T<<24|O<<16|Q|0;while(0!==q);for(D=1<<z-1;n&D;)D>>=1;0!==D?(n&=D-1,n+=D):n=0;L++;if(0===--P[z]){if(z===J)break;z=d[f+x[L]]}if(z>K&&(n&w)!==I){0===y&&(y=K);F+=l;E=z-y;for(D=1<<E;E+y<J;){D-=P[E+y];if(0>=D)break;E++;D<<=1}u+=1<<E;if(1===a&&852<u||2===a&&592<u)return 1;I=n&w;B[I]=K<<24|E<<16|F-A|0}}0!==n&&(B[F+n]=z-y<<24|4194304);G.bits=K;return 0}},{"../utils/common":30}],40:[function(a,d,f){d.exports={2:"need dictionary",1:"stream end",
|
|
1138
|
-
0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],41:[function(a,d,f){function b(a){for(var b=a.length;0<=--b;)a[b]=0}function e(a,b,d,e,f){this.static_tree=a;this.extra_bits=b;this.extra_base=d;this.elems=e;this.max_length=f;this.has_stree=a&&a.length}function g(a,b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b}function h(a,b){a.pending_buf[a.pending++]=b&255;a.pending_buf[a.pending++]=b>>>8&255}function m(a,
|
|
1139
|
-
b,d){a.bi_valid>16-d?(a.bi_buf|=b<<a.bi_valid&65535,h(a,a.bi_buf),a.bi_buf=b>>16-a.bi_valid,a.bi_valid+=d-16):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=d)}function k(a,b,d){m(a,d[2*b],d[2*b+1])}function p(a,b){var d=0;do d|=a&1,a>>>=1,d<<=1;while(0<--b);return d>>>1}function t(a,b,d){var e=Array(16),f=0,g;for(g=1;15>=g;g++)e[g]=f=f+d[g-1]<<1;for(d=0;d<=b;d++)f=a[2*d+1],0!==f&&(a[2*d]=p(e[f]++,f))}function w(a){var b;for(b=0;286>b;b++)a.dyn_ltree[2*b]=0;for(b=0;30>b;b++)a.dyn_dtree[2*b]=0;for(b=0;19>
|
|
1140
|
-
b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[512]=1;a.opt_len=a.static_len=0;a.last_lit=a.matches=0}function B(a){8<a.bi_valid?h(a,a.bi_buf):0<a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf);a.bi_buf=0;a.bi_valid=0}function A(a,b,d,e){var f=2*b,g=2*d;return a[f]<a[g]||a[f]===a[g]&&e[b]<=e[d]}function x(a,b,d){for(var e=a.heap[d],f=d<<1;f<=a.heap_len;){f<a.heap_len&&A(b,a.heap[f+1],a.heap[f],a.depth)&&f++;if(A(b,e,a.heap[f],a.depth))break;a.heap[d]=a.heap[f];d=f;f<<=1}a.heap[d]=e}function G(a,b,d){var e,f,
|
|
1141
|
-
g=0,h,l;if(0!==a.last_lit){do e=a.pending_buf[a.d_buf+2*g]<<8|a.pending_buf[a.d_buf+2*g+1],f=a.pending_buf[a.l_buf+g],g++,0===e?k(a,f,b):(h=H[f],k(a,h+256+1,b),l=E[h],0!==l&&(f-=v[h],m(a,f,l)),e--,h=256>e?I[e]:I[256+(e>>>7)],k(a,h,d),l=y[h],0!==l&&(e-=C[h],m(a,e,l)));while(g<a.last_lit)}k(a,256,b)}function F(a,b){var d=b.dyn_tree,e=b.stat_desc.static_tree,f=b.stat_desc.has_stree,g=b.stat_desc.elems,h,k=-1,l;a.heap_len=0;a.heap_max=573;for(h=0;h<g;h++)0!==d[2*h]?(a.heap[++a.heap_len]=k=h,a.depth[h]=
|
|
1142
|
-
0):d[2*h+1]=0;for(;2>a.heap_len;)l=a.heap[++a.heap_len]=2>k?++k:0,d[2*l]=1,a.depth[l]=0,a.opt_len--,f&&(a.static_len-=e[2*l+1]);b.max_code=k;for(h=a.heap_len>>1;1<=h;h--)x(a,d,h);l=g;do h=a.heap[1],a.heap[1]=a.heap[a.heap_len--],x(a,d,1),e=a.heap[1],a.heap[--a.heap_max]=h,a.heap[--a.heap_max]=e,d[2*l]=d[2*h]+d[2*e],a.depth[l]=(a.depth[h]>=a.depth[e]?a.depth[h]:a.depth[e])+1,d[2*h+1]=d[2*e+1]=l,a.heap[1]=l++,x(a,d,1);while(2<=a.heap_len);a.heap[--a.heap_max]=a.heap[1];h=b.dyn_tree;l=b.max_code;for(var m=
|
|
1143
|
-
b.stat_desc.static_tree,n=b.stat_desc.has_stree,p=b.stat_desc.extra_bits,q=b.stat_desc.extra_base,u=b.stat_desc.max_length,v,w,y=0,g=0;15>=g;g++)a.bl_count[g]=0;h[2*a.heap[a.heap_max]+1]=0;for(e=a.heap_max+1;573>e;e++)f=a.heap[e],g=h[2*h[2*f+1]+1]+1,g>u&&(g=u,y++),h[2*f+1]=g,f>l||(a.bl_count[g]++,v=0,f>=q&&(v=p[f-q]),w=h[2*f],a.opt_len+=w*(g+v),n&&(a.static_len+=w*(m[2*f+1]+v)));if(0!==y){do{for(g=u-1;0===a.bl_count[g];)g--;a.bl_count[g]--;a.bl_count[g+1]+=2;a.bl_count[u]--;y-=2}while(0<y);for(g=
|
|
1144
|
-
u;0!==g;g--)for(f=a.bl_count[g];0!==f;)m=a.heap[--e],m>l||(h[2*m+1]!==g&&(a.opt_len+=(g-h[2*m+1])*h[2*m],h[2*m+1]=g),f--)}t(d,k,a.bl_count)}function z(a,b,d){var e,f=-1,g,h=b[1],k=0,l=7,m=4;0===h&&(l=138,m=3);b[2*(d+1)+1]=65535;for(e=0;e<=d;e++)g=h,h=b[2*(e+1)+1],++k<l&&g===h||(k<m?a.bl_tree[2*g]+=k:0!==g?(g!==f&&a.bl_tree[2*g]++,a.bl_tree[32]++):10>=k?a.bl_tree[34]++:a.bl_tree[36]++,k=0,f=g,0===h?(l=138,m=3):g===h?(l=6,m=3):(l=7,m=4))}function L(a,b,d){var e,f=-1,g,h=b[1],l=0,n=7,p=4;0===h&&(n=138,
|
|
1145
|
-
p=3);for(e=0;e<=d;e++)if(g=h,h=b[2*(e+1)+1],!(++l<n&&g===h)){if(l<p){do k(a,g,a.bl_tree);while(0!==--l)}else 0!==g?(g!==f&&(k(a,g,a.bl_tree),l--),k(a,16,a.bl_tree),m(a,l-3,2)):10>=l?(k(a,17,a.bl_tree),m(a,l-3,3)):(k(a,18,a.bl_tree),m(a,l-11,7));l=0;f=g;0===h?(n=138,p=3):g===h?(n=6,p=3):(n=7,p=4)}}function l(a){var b=4093624447,d;for(d=0;31>=d;d++,b>>>=1)if(b&1&&0!==a.dyn_ltree[2*d])return 0;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return 1;for(d=32;256>d;d++)if(0!==a.dyn_ltree[2*
|
|
1146
|
-
d])return 1;return 0}function J(a,b,d,e){m(a,0+(e?1:0),3);B(a);h(a,d);h(a,~d);K.arraySet(a.pending_buf,a.window,b,d,a.pending);a.pending+=d}var K=a("../utils/common"),E=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],n=Array(576);b(n);var q=Array(60);b(q);var I=Array(512);b(I);var H=Array(256);b(H);var v=Array(29);b(v);var C=
|
|
1147
|
-
Array(30);b(C);var P,M,R,T=!1;f._tr_init=function(a){if(!T){var b,d,f,h=Array(16);for(f=d=0;28>f;f++)for(v[f]=d,b=0;b<1<<E[f];b++)H[d++]=f;H[d-1]=f;for(f=d=0;16>f;f++)for(C[f]=d,b=0;b<1<<y[f];b++)I[d++]=f;for(d>>=7;30>f;f++)for(C[f]=d<<7,b=0;b<1<<y[f]-7;b++)I[256+d++]=f;for(b=0;15>=b;b++)h[b]=0;for(b=0;143>=b;)n[2*b+1]=8,b++,h[8]++;for(;255>=b;)n[2*b+1]=9,b++,h[9]++;for(;279>=b;)n[2*b+1]=7,b++,h[7]++;for(;287>=b;)n[2*b+1]=8,b++,h[8]++;t(n,287,h);for(b=0;30>b;b++)q[2*b+1]=5,q[2*b]=p(b,5);P=new e(n,
|
|
1148
|
-
E,257,286,15);M=new e(q,y,0,30,15);R=new e([],D,0,19,7);T=!0}a.l_desc=new g(a.dyn_ltree,P);a.d_desc=new g(a.dyn_dtree,M);a.bl_desc=new g(a.bl_tree,R);a.bi_buf=0;a.bi_valid=0;w(a)};f._tr_stored_block=J;f._tr_flush_block=function(a,b,d,e){var f,g,h=0;if(0<a.level){2===a.strm.data_type&&(a.strm.data_type=l(a));F(a,a.l_desc);F(a,a.d_desc);z(a,a.dyn_ltree,a.l_desc.max_code);z(a,a.dyn_dtree,a.d_desc.max_code);F(a,a.bl_desc);for(h=18;3<=h&&0===a.bl_tree[2*u[h]+1];h--);a.opt_len+=3*(h+1)+14;f=a.opt_len+3+
|
|
1149
|
-
7>>>3;g=a.static_len+3+7>>>3;g<=f&&(f=g)}else f=g=d+5;if(d+4<=f&&-1!==b)J(a,b,d,e);else if(4===a.strategy||g===f)m(a,2+(e?1:0),3),G(a,n,q);else{m(a,4+(e?1:0),3);b=a.l_desc.max_code+1;d=a.d_desc.max_code+1;h+=1;m(a,b-257,5);m(a,d-1,5);m(a,h-4,4);for(f=0;f<h;f++)m(a,a.bl_tree[2*u[f]+1],3);L(a,a.dyn_ltree,b-1);L(a,a.dyn_dtree,d-1);G(a,a.dyn_ltree,a.dyn_dtree)}w(a);e&&B(a)};f._tr_tally=function(a,b,d){a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255;a.pending_buf[a.d_buf+2*a.last_lit+1]=b&255;a.pending_buf[a.l_buf+
|
|
1150
|
-
a.last_lit]=d&255;a.last_lit++;0===b?a.dyn_ltree[2*d]++:(a.matches++,b--,a.dyn_ltree[2*(H[d]+256+1)]++,a.dyn_dtree[2*(256>b?I[b]:I[256+(b>>>7)])]++);return a.last_lit===a.lit_bufsize-1};f._tr_align=function(a){m(a,2,3);k(a,256,n);16===a.bi_valid?(h(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):8<=a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf&255,a.bi_buf>>=8,a.bi_valid-=8)}},{"../utils/common":30}],42:[function(a,d,f){d.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=
|
|
1151
|
-
null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},{}],43:[function(a,d,f){(function(b){(function(d){function f(a,b){if(!(this instanceof f))return new f(a,b);for(var h=0,k=E.length;h<k;h++)this[E[h]]="";this.q=this.c="";this.bufferCheckPosition=d.MAX_BUFFER_LENGTH;this.opt=b||{};this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags;this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase";this.tags=[];this.closed=this.closedRoot=
|
|
1152
|
-
this.sawRoot=!1;this.tag=this.error=null;this.strict=!!a;this.noscript=!(!a&&!this.opt.noscript);this.state=N.BEGIN;this.ENTITIES=(this.strictEntities=this.opt.strictEntities)?Object.create(d.XML_ENTITIES):Object.create(d.ENTITIES);this.attribList=[];this.opt.xmlns&&(this.ns=Object.create(T));if(this.trackPosition=!1!==this.opt.position)this.position=this.line=this.column=0;this.onready&&this.onready(void 0)}function h(a,b){if(!(this instanceof h))return new h(a,b);y.apply(this);this._parser=new f(a,
|
|
1153
|
-
b);this.readable=this.writable=!0;var d=this;this._parser.onend=function(){d.emit("end")};this._parser.onerror=function(a){d.emit("error",a);d._parser.error=null};this._decoder=null;u.forEach(function(a){Object.defineProperty(d,"on"+a,{get:function(){return d._parser["on"+a]},set:function(b){if(!b)return d.removeAllListeners(a),d._parser["on"+a]=b;d.on(a,b)},enumerable:!0,configurable:!1})})}function m(a){return a.split("").reduce(function(a,b){a[b]=!0;return a},{})}function k(a,b){return"[object RegExp]"===
|
|
1154
|
-
Object.prototype.toString.call(a)?!!b.match(a):a[b]}function p(a,b,d){a.textNode&&t(a);a[b]&&a[b](d)}function t(a){a.textNode=w(a.opt,a.textNode);a.textNode&&a.ontext&&a.ontext(a.textNode);a.textNode=""}function w(a,b){a.trim&&(b=b.trim());a.normalize&&(b=b.replace(/\s+/g," "));return b}function B(a,b){t(a);a.trackPosition&&(b+="\nLine: "+a.line+"\nColumn: "+a.column+"\nChar: "+a.c);b=Error(b);a.error=b;a.onerror&&a.onerror(b);return a}function A(a){a.sawRoot&&!a.closedRoot&&x(a,"Unclosed root tag");
|
|
1155
|
-
a.state!==N.BEGIN&&a.state!==N.BEGIN_WHITESPACE&&a.state!==N.TEXT&&B(a,"Unexpected end");t(a);a.c="";a.closed=!0;a.onend&&a.onend(void 0);f.call(a,a.strict,a.opt);return a}function x(a,b){if("object"!==typeof a||!(a instanceof f))throw Error("bad call to strictFail");a.strict&&B(a,b)}function G(a,b){var d=0>a.indexOf(":")?["",a]:a.split(":"),e=d[0],d=d[1];b&&"xmlns"===a&&(e="xmlns",d="");return{prefix:e,local:d}}function F(a){a.strict||(a.attribName=a.attribName[a.looseCase]());if(-1===a.attribList.indexOf(a.attribName)&&
|
|
1156
|
-
!a.tag.attributes.hasOwnProperty(a.attribName))if(a.opt.xmlns){var b=G(a.attribName,!0),d=b.local;if("xmlns"===b.prefix)if("xml"===d&&a.attribValue!==M)x(a,"xml: prefix must be bound to "+M+"\nActual: "+a.attribValue);else if("xmlns"===d&&a.attribValue!==R)x(a,"xmlns: prefix must be bound to "+R+"\nActual: "+a.attribValue);else{var b=a.tag,e=a.tags[a.tags.length-1]||a;b.ns===e.ns&&(b.ns=Object.create(e.ns));b.ns[d]=a.attribValue}a.attribList.push([a.attribName,a.attribValue])}else a.tag.attributes[a.attribName]=
|
|
1157
|
-
a.attribValue,p(a,"onattribute",{name:a.attribName,value:a.attribValue});a.attribName=a.attribValue=""}function z(a,b){if(a.opt.xmlns){var d=a.tag,e=G(a.tagName);d.prefix=e.prefix;d.local=e.local;d.uri=d.ns[e.prefix]||"";d.prefix&&!d.uri&&(x(a,"Unbound namespace prefix: "+JSON.stringify(a.tagName)),d.uri=e.prefix);e=a.tags[a.tags.length-1]||a;d.ns&&e.ns!==d.ns&&Object.keys(d.ns).forEach(function(b){p(a,"onopennamespace",{prefix:b,uri:d.ns[b]})});for(var e=0,f=a.attribList.length;e<f;e++){var g=a.attribList[e],
|
|
1158
|
-
h=g[0],k=g[1],l=G(h,!0),g=l.prefix,m=""===g?"":d.ns[g]||"",k={name:h,value:k,prefix:g,local:l.local,uri:m};g&&"xmlns"!==g&&!m&&(x(a,"Unbound namespace prefix: "+JSON.stringify(g)),k.uri=g);a.tag.attributes[h]=k;p(a,"onattribute",k)}a.attribList.length=0}a.tag.isSelfClosing=!!b;a.sawRoot=!0;a.tags.push(a.tag);p(a,"onopentag",a.tag);b||(a.noscript||"script"!==a.tagName.toLowerCase()?a.state=N.TEXT:a.state=N.SCRIPT,a.tag=null,a.tagName="");a.attribName=a.attribValue="";a.attribList.length=0}function L(a){if(a.tagName){if(a.script){if("script"!==
|
|
1159
|
-
a.tagName){a.script+="</"+a.tagName+">";a.tagName="";a.state=N.SCRIPT;return}p(a,"onscript",a.script);a.script=""}var b=a.tags.length,d=a.tagName;a.strict||(d=d[a.looseCase]());for(var e=d;b--;)if(a.tags[b].name!==e)x(a,"Unexpected close tag");else break;if(0>b)x(a,"Unmatched closing tag: "+a.tagName),a.textNode+="</"+a.tagName+">";else{a.tagName=d;for(d=a.tags.length;d-- >b;){var f=a.tag=a.tags.pop();a.tagName=a.tag.name;p(a,"onclosetag",a.tagName);for(var g in f.ns);e=a.tags[a.tags.length-1]||a;
|
|
1160
|
-
a.opt.xmlns&&f.ns!==e.ns&&Object.keys(f.ns).forEach(function(b){p(a,"onclosenamespace",{prefix:b,uri:f.ns[b]})})}0===b&&(a.closedRoot=!0);a.tagName=a.attribValue=a.attribName="";a.attribList.length=0}}else x(a,"Weird empty close tag."),a.textNode+="</>";a.state=N.TEXT}function l(a){var b=a.entity,d=b.toLowerCase(),e,f="";if(a.ENTITIES[b])return a.ENTITIES[b];if(a.ENTITIES[d])return a.ENTITIES[d];b=d;"#"===b.charAt(0)&&("x"===b.charAt(1)?(b=b.slice(2),e=parseInt(b,16),f=e.toString(16)):(b=b.slice(1),
|
|
1161
|
-
e=parseInt(b,10),f=e.toString(10)));b=b.replace(/^0+/,"");return f.toLowerCase()!==b?(x(a,"Invalid character entity"),"&"+a.entity+";"):String.fromCodePoint(e)}function J(a,b){"<"===b?(a.state=N.OPEN_WAKA,a.startTagPosition=a.position):k(n,b)||(x(a,"Non-whitespace before first tag."),a.textNode=b,a.state=N.TEXT)}function K(a,b){var d="";b<a.length&&(d=a.charAt(b));return d}d.parser=function(a,b){return new f(a,b)};d.SAXParser=f;d.SAXStream=h;d.createStream=function(a,b){return new h(a,b)};d.MAX_BUFFER_LENGTH=
|
|
1162
|
-
65536;var E="comment sgmlDecl textNode tagName doctype procInstName procInstBody entity attribName attribValue cdata script".split(" ");d.EVENTS="text processinginstruction sgmldeclaration doctype comment attribute opentag closetag opencdata cdata closecdata error end ready script opennamespace closenamespace".split(" ");Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});Object.keys||(Object.keys=function(a){var b=[],d;for(d in a)a.hasOwnProperty(d)&&b.push(d);return b});
|
|
1163
|
-
f.prototype={end:function(){A(this)},write:function(a){if(this.error)throw this.error;if(this.closed)return B(this,"Cannot write after close. Assign an onready handler.");if(null===a)return A(this);for(var b=0,f="";;){this.c=f=K(a,b++);if(!f)break;this.trackPosition&&(this.position++,"\n"===f?(this.line++,this.column=0):this.column++);switch(this.state){case N.BEGIN:this.state=N.BEGIN_WHITESPACE;if("\ufeff"===f)continue;J(this,f);continue;case N.BEGIN_WHITESPACE:J(this,f);continue;case N.TEXT:if(this.sawRoot&&
|
|
1164
|
-
!this.closedRoot){for(var g=b-1;f&&"<"!==f&&"&"!==f;)(f=K(a,b++))&&this.trackPosition&&(this.position++,"\n"===f?(this.line++,this.column=0):this.column++);this.textNode+=a.substring(g,b-1)}"<"!==f||this.sawRoot&&this.closedRoot&&!this.strict?(k(n,f)||this.sawRoot&&!this.closedRoot||x(this,"Text data outside of root node."),"&"===f?this.state=N.TEXT_ENTITY:this.textNode+=f):(this.state=N.OPEN_WAKA,this.startTagPosition=this.position);continue;case N.SCRIPT:"<"===f?this.state=N.SCRIPT_ENDING:this.script+=
|
|
1165
|
-
f;continue;case N.SCRIPT_ENDING:"/"===f?this.state=N.CLOSE_TAG:(this.script+="<"+f,this.state=N.SCRIPT);continue;case N.OPEN_WAKA:"!"===f?(this.state=N.SGML_DECL,this.sgmlDecl=""):k(n,f)||(k(O,f)?(this.state=N.OPEN_TAG,this.tagName=f):"/"===f?(this.state=N.CLOSE_TAG,this.tagName=""):"?"===f?(this.state=N.PROC_INST,this.procInstName=this.procInstBody=""):(x(this,"Unencoded <"),this.startTagPosition+1<this.position&&(f=Array(this.position-this.startTagPosition).join(" ")+f),this.textNode+="<"+f,this.state=
|
|
1166
|
-
N.TEXT));continue;case N.SGML_DECL:(this.sgmlDecl+f).toUpperCase()===C?(p(this,"onopencdata"),this.state=N.CDATA,this.cdata=this.sgmlDecl=""):"--"===this.sgmlDecl+f?(this.state=N.COMMENT,this.sgmlDecl=this.comment=""):(this.sgmlDecl+f).toUpperCase()===P?(this.state=N.DOCTYPE,(this.doctype||this.sawRoot)&&x(this,"Inappropriately located doctype declaration"),this.sgmlDecl=this.doctype=""):">"===f?(p(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=N.TEXT):(k(H,f)&&(this.state=N.SGML_DECL_QUOTED),
|
|
1167
|
-
this.sgmlDecl+=f);continue;case N.SGML_DECL_QUOTED:f===this.q&&(this.state=N.SGML_DECL,this.q="");this.sgmlDecl+=f;continue;case N.DOCTYPE:">"===f?(this.state=N.TEXT,p(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=f,"["===f?this.state=N.DOCTYPE_DTD:k(H,f)&&(this.state=N.DOCTYPE_QUOTED,this.q=f));continue;case N.DOCTYPE_QUOTED:this.doctype+=f;f===this.q&&(this.q="",this.state=N.DOCTYPE);continue;case N.DOCTYPE_DTD:this.doctype+=f;"]"===f?this.state=N.DOCTYPE:k(H,f)&&(this.state=N.DOCTYPE_DTD_QUOTED,
|
|
1168
|
-
this.q=f);continue;case N.DOCTYPE_DTD_QUOTED:this.doctype+=f;f===this.q&&(this.state=N.DOCTYPE_DTD,this.q="");continue;case N.COMMENT:"-"===f?this.state=N.COMMENT_ENDING:this.comment+=f;continue;case N.COMMENT_ENDING:"-"===f?(this.state=N.COMMENT_ENDED,(this.comment=w(this.opt,this.comment))&&p(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+f,this.state=N.COMMENT);continue;case N.COMMENT_ENDED:">"!==f?(x(this,"Malformed comment"),this.comment+="--"+f,this.state=N.COMMENT):this.state=
|
|
1169
|
-
N.TEXT;continue;case N.CDATA:"]"===f?this.state=N.CDATA_ENDING:this.cdata+=f;continue;case N.CDATA_ENDING:"]"===f?this.state=N.CDATA_ENDING_2:(this.cdata+="]"+f,this.state=N.CDATA);continue;case N.CDATA_ENDING_2:">"===f?(this.cdata&&p(this,"oncdata",this.cdata),p(this,"onclosecdata"),this.cdata="",this.state=N.TEXT):"]"===f?this.cdata+="]":(this.cdata+="]]"+f,this.state=N.CDATA);continue;case N.PROC_INST:"?"===f?this.state=N.PROC_INST_ENDING:k(n,f)?this.state=N.PROC_INST_BODY:this.procInstName+=f;
|
|
1170
|
-
continue;case N.PROC_INST_BODY:if(!this.procInstBody&&k(n,f))continue;else"?"===f?this.state=N.PROC_INST_ENDING:this.procInstBody+=f;continue;case N.PROC_INST_ENDING:">"===f?(p(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=N.TEXT):(this.procInstBody+="?"+f,this.state=N.PROC_INST_BODY);continue;case N.OPEN_TAG:if(k(Q,f))this.tagName+=f;else{this.strict||(this.tagName=this.tagName[this.looseCase]());var g=this.tags[this.tags.length-
|
|
1171
|
-
1]||this,h=this.tag={name:this.tagName,attributes:{}};this.opt.xmlns&&(h.ns=g.ns);this.attribList.length=0;">"===f?z(this):"/"===f?this.state=N.OPEN_TAG_SLASH:(k(n,f)||x(this,"Invalid character in tag name"),this.state=N.ATTRIB)}continue;case N.OPEN_TAG_SLASH:">"===f?(z(this,!0),L(this)):(x(this,"Forward-slash in opening tag not followed by >"),this.state=N.ATTRIB);continue;case N.ATTRIB:if(k(n,f))continue;else">"===f?z(this):"/"===f?this.state=N.OPEN_TAG_SLASH:k(O,f)?(this.attribName=f,this.attribValue=
|
|
1172
|
-
"",this.state=N.ATTRIB_NAME):x(this,"Invalid attribute name");continue;case N.ATTRIB_NAME:"="===f?this.state=N.ATTRIB_VALUE:">"===f?(x(this,"Attribute without value"),this.attribValue=this.attribName,F(this),z(this)):k(n,f)?this.state=N.ATTRIB_NAME_SAW_WHITE:k(Q,f)?this.attribName+=f:x(this,"Invalid attribute name");continue;case N.ATTRIB_NAME_SAW_WHITE:if("="===f)this.state=N.ATTRIB_VALUE;else if(k(n,f))continue;else x(this,"Attribute without value"),this.attribValue=this.tag.attributes[this.attribName]=
|
|
1173
|
-
"",p(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===f?z(this):k(O,f)?(this.attribName=f,this.state=N.ATTRIB_NAME):(x(this,"Invalid attribute name"),this.state=N.ATTRIB);continue;case N.ATTRIB_VALUE:if(k(n,f))continue;else k(H,f)?(this.q=f,this.state=N.ATTRIB_VALUE_QUOTED):(x(this,"Unquoted attribute value"),this.state=N.ATTRIB_VALUE_UNQUOTED,this.attribValue=f);continue;case N.ATTRIB_VALUE_QUOTED:if(f!==this.q){"&"===f?this.state=N.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=
|
|
1174
|
-
f;continue}F(this);this.q="";this.state=N.ATTRIB_VALUE_CLOSED;continue;case N.ATTRIB_VALUE_CLOSED:k(n,f)?this.state=N.ATTRIB:">"===f?z(this):"/"===f?this.state=N.OPEN_TAG_SLASH:k(O,f)?(x(this,"No whitespace between attributes"),this.attribName=f,this.attribValue="",this.state=N.ATTRIB_NAME):x(this,"Invalid attribute name");continue;case N.ATTRIB_VALUE_UNQUOTED:if(!k(v,f)){"&"===f?this.state=N.ATTRIB_VALUE_ENTITY_U:this.attribValue+=f;continue}F(this);">"===f?z(this):this.state=N.ATTRIB;continue;case N.CLOSE_TAG:if(this.tagName)">"===
|
|
1175
|
-
f?L(this):k(Q,f)?this.tagName+=f:this.script?(this.script+="</"+this.tagName,this.tagName="",this.state=N.SCRIPT):(k(n,f)||x(this,"Invalid tagname in closing tag"),this.state=N.CLOSE_TAG_SAW_WHITE);else if(k(n,f))continue;else k(O,f)?this.tagName=f:this.script?(this.script+="</"+f,this.state=N.SCRIPT):x(this,"Invalid tagname in closing tag.");continue;case N.CLOSE_TAG_SAW_WHITE:if(k(n,f))continue;">"===f?L(this):x(this,"Invalid characters in closing tag");continue;case N.TEXT_ENTITY:case N.ATTRIB_VALUE_ENTITY_Q:case N.ATTRIB_VALUE_ENTITY_U:var m,
|
|
1176
|
-
q;switch(this.state){case N.TEXT_ENTITY:m=N.TEXT;q="textNode";break;case N.ATTRIB_VALUE_ENTITY_Q:m=N.ATTRIB_VALUE_QUOTED;q="attribValue";break;case N.ATTRIB_VALUE_ENTITY_U:m=N.ATTRIB_VALUE_UNQUOTED,q="attribValue"}";"===f?(this[q]+=l(this),this.entity="",this.state=m):k(this.entity.length?ua:U,f)?this.entity+=f:(x(this,"Invalid character in entity name"),this[q]+="&"+this.entity+f,this.entity="",this.state=m);continue;default:throw Error(this,"Unknown state: "+this.state);}}if(this.position>=this.bufferCheckPosition){a=
|
|
1177
|
-
Math.max(d.MAX_BUFFER_LENGTH,10);f=b=0;for(m=E.length;f<m;f++){q=this[E[f]].length;if(q>a)switch(E[f]){case "textNode":t(this);break;case "cdata":p(this,"oncdata",this.cdata);this.cdata="";break;case "script":p(this,"onscript",this.script);this.script="";break;default:B(this,"Max buffer length exceeded: "+E[f])}b=Math.max(b,q)}this.bufferCheckPosition=d.MAX_BUFFER_LENGTH-b+this.position}return this},resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){t(this);
|
|
1178
|
-
""!==this.cdata&&(p(this,"oncdata",this.cdata),this.cdata="");""!==this.script&&(p(this,"onscript",this.script),this.script="")}};var y;try{y=a("stream").Stream}catch(D){y=function(){}}var u=d.EVENTS.filter(function(a){return"error"!==a&&"end"!==a});h.prototype=Object.create(y.prototype,{constructor:{value:h}});h.prototype.write=function(d){"function"===typeof b&&"function"===typeof b.isBuffer&&b.isBuffer(d)&&(this._decoder||(this._decoder=new (a("string_decoder").StringDecoder)("utf8")),d=this._decoder.write(d));
|
|
1179
|
-
this._parser.write(d.toString());this.emit("data",d);return!0};h.prototype.end=function(a){a&&a.length&&this.write(a);this._parser.end();return!0};h.prototype.on=function(a,b){var d=this;d._parser["on"+a]||-1===u.indexOf(a)||(d._parser["on"+a]=function(){var b=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);b.splice(0,0,a);d.emit.apply(d,b)});return y.prototype.on.call(d,a,b)};var n="\r\n\t ",q="0124356789",I="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",H="'\"",v=n+">",C=
|
|
1180
|
-
"[CDATA[",P="DOCTYPE",M="http://www.w3.org/XML/1998/namespace",R="http://www.w3.org/2000/xmlns/",T={xml:M,xmlns:R},n=m(n),q=m(q),I=m(I),O=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,U=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
|
|
1181
|
-
ua=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,H=m(H),v=m(v),N=0;d.STATE={BEGIN:N++,BEGIN_WHITESPACE:N++,TEXT:N++,TEXT_ENTITY:N++,OPEN_WAKA:N++,SGML_DECL:N++,SGML_DECL_QUOTED:N++,DOCTYPE:N++,DOCTYPE_QUOTED:N++,DOCTYPE_DTD:N++,DOCTYPE_DTD_QUOTED:N++,COMMENT_STARTING:N++,COMMENT:N++,COMMENT_ENDING:N++,COMMENT_ENDED:N++,CDATA:N++,CDATA_ENDING:N++,CDATA_ENDING_2:N++,
|
|
1182
|
-
PROC_INST:N++,PROC_INST_BODY:N++,PROC_INST_ENDING:N++,OPEN_TAG:N++,OPEN_TAG_SLASH:N++,ATTRIB:N++,ATTRIB_NAME:N++,ATTRIB_NAME_SAW_WHITE:N++,ATTRIB_VALUE:N++,ATTRIB_VALUE_QUOTED:N++,ATTRIB_VALUE_CLOSED:N++,ATTRIB_VALUE_UNQUOTED:N++,ATTRIB_VALUE_ENTITY_Q:N++,ATTRIB_VALUE_ENTITY_U:N++,CLOSE_TAG:N++,CLOSE_TAG_SAW_WHITE:N++,SCRIPT:N++,SCRIPT_ENDING:N++};d.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};d.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,
|
|
1183
|
-
Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,
|
|
1184
|
-
ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,
|
|
1185
|
-
Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,
|
|
1186
|
-
zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,
|
|
1187
|
-
ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(d.ENTITIES).forEach(function(a){var b=d.ENTITIES[a],b="number"===
|
|
1188
|
-
typeof b?String.fromCharCode(b):b;d.ENTITIES[a]=b});for(var ea in d.STATE)d.STATE[d.STATE[ea]]=ea;N=d.STATE;String.fromCodePoint||function(){var a=String.fromCharCode,b=Math.floor,d=function(){var d=[],e,f,g=-1,h=arguments.length;if(!h)return"";for(var k="";++g<h;){f=Number(arguments[g]);if(!isFinite(f)||0>f||1114111<f||b(f)!==f)throw RangeError("Invalid code point: "+f);65535>=f?d.push(f):(f-=65536,e=(f>>10)+55296,f=f%1024+56320,d.push(e,f));if(g+1===h||16384<d.length)k+=a.apply(null,d),d.length=
|
|
1189
|
-
0}return k};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:d,configurable:!0,writable:!0}):String.fromCodePoint=d}()})("undefined"===typeof f?this.sax={}:f)}).call(this,a("buffer").Buffer)},{buffer:3,stream:25,string_decoder:26}],44:[function(a,d,f){var b=b||{};b.Transform=b.Transform||("undefined"!==typeof a?a("./transform.js"):null);var e=e||("undefined"!==typeof a?a("../lib/base64-binary.js"):null),g=g||("undefined"!==typeof a?a("pako"):null);b.NIFTI_INTENT_GENMATRIX=
|
|
1190
|
-
"NIFTI_INTENT_GENMATRIX";b.NIFTI_INTENT_LABEL="NIFTI_INTENT_LABEL";b.NIFTI_INTENT_NODE_INDEX="NIFTI_INTENT_NODE_INDEX";b.NIFTI_INTENT_POINTSET="NIFTI_INTENT_POINTSET";b.NIFTI_INTENT_RGB_VECTOR="NIFTI_INTENT_RGB_VECTOR";b.NIFTI_INTENT_RGBA_VECTOR="NIFTI_INTENT_RGBA_VECTOR";b.NIFTI_INTENT_SHAPE="NIFTI_INTENT_SHAPE";b.NIFTI_INTENT_TIME_SERIES="NIFTI_INTENT_TIME_SERIES";b.NIFTI_INTENT_TRIANGLE="NIFTI_INTENT_TRIANGLE";b.NIFTI_INTENT_NONE="NIFTI_INTENT_NONE";b.NIFTI_INTENT_VECTOR="NIFTI_INTENT_VECTOR";
|
|
1191
|
-
b.ATT_ARRAYINDEXINGORDER="ArrayIndexingOrder";b.ATT_DATATYPE="DataType";b.ATT_DIMENSIONALITY="Dimensionality";b.ATT_DIMN="Dim";b.ATT_ENCODING="Encoding";b.ATT_ENDIAN="Endian";b.ATT_EXTERNALFILENAME="ExternalFileName";b.ATT_EXTERNALFILEOFFSET="ExternalFileOffset";b.ATT_INTENT="Intent";b.ENCODING_ASCII="ASCII";b.ENCODING_BASE64BINARY="Base64Binary";b.ENCODING_GZIPBASE64BINARY="GZipBase64Binary";b.ENCODING_EXTERNALFILEBINARY="ExternalFileBinary";b.TYPE_NIFTI_TYPE_UINT8="NIFTI_TYPE_UINT8";b.TYPE_NIFTI_TYPE_INT32=
|
|
1192
|
-
"NIFTI_TYPE_INT32";b.TYPE_NIFTI_TYPE_FLOAT32="NIFTI_TYPE_FLOAT32";b.DataArray=b.DataArray||function(){this.attributes=null;this.metadata={};this.transforms=[];this.data=null;this.dataConverted=!1};b.DataArray.prototype.isPointSet=function(){return this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_POINTSET};b.DataArray.prototype.isTriangles=function(){return this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_TRIANGLE};b.DataArray.prototype.isNormals=function(){return this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_VECTOR};
|
|
1193
|
-
b.DataArray.prototype.isColors=function(){return this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_RGB_VECTOR||this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_RGBA_VECTOR};b.DataArray.prototype.getDimensions=function(){return parseInt(this.attributes[b.ATT_DIMENSIONALITY])};b.DataArray.prototype.getNumElements=function(a){void 0===a&&(a=0);return parseInt(this.attributes[b.ATT_DIMN+a])};b.DataArray.prototype.isScalar=function(){return 1==this.getDimensions()};b.DataArray.prototype.isTriple=function(){return 2==
|
|
1194
|
-
this.getDimensions()&&3==this.getNumElements(1)};b.DataArray.prototype.isQuad=function(){return 2==this.getDimensions()&&4==this.getNumElements(1)};b.DataArray.prototype.isAscii=function(){return b.ENCODING_ASCII===this.attributes[b.ATT_ENCODING]};b.DataArray.prototype.isBase64Binary=function(){return b.ENCODING_BASE64BINARY===this.attributes[b.ATT_ENCODING]};b.DataArray.prototype.isGzipBase64Binary=function(){return b.ENCODING_GZIPBASE64BINARY===this.attributes[b.ATT_ENCODING]};b.DataArray.prototype.isBase64Encoded=
|
|
1195
|
-
function(){return this.isBase64Binary()||this.isGzipBase64Binary()};b.DataArray.prototype.isFloat32=function(){return b.TYPE_NIFTI_TYPE_FLOAT32===this.attributes[b.ATT_DATATYPE]};b.DataArray.prototype.isInt32=function(){return b.TYPE_NIFTI_TYPE_INT32===this.attributes[b.ATT_DATATYPE]};b.DataArray.prototype.isUnsignedInt8=function(){return b.TYPE_NIFTI_TYPE_UINT8===this.attributes[b.ATT_DATATYPE]};b.DataArray.prototype.getData=function(){this.dataConverted||(this.dataConverted=!0,this.isAscii()?this.isUnsignedInt8()?
|
|
1196
|
-
b.DataArray.readUnsignedInt8ASCII(this):this.isInt32()?b.DataArray.readSignedInt32ASCII(this):b.DataArray.readFloat32ASCII(this):this.isBase64Binary()?this.isUnsignedInt8()?b.DataArray.readUnsignedInt8Base64(this):this.isInt32()?b.DataArray.readSignedInt32Base64(this):b.DataArray.readFloat32Base64(this):this.isGzipBase64Binary()&&(this.isUnsignedInt8()?b.DataArray.readUnsignedInt8GZIPBase64(this):this.isInt32()?b.DataArray.readSignedInt32GZIPBase64(this):b.DataArray.readFloat32GZIPBase64(this)));
|
|
1197
|
-
return this.data};b.DataArray.prototype.getDataAsync=function(a,d){this.dataConverted||(this.dataConverted=!0,this.isAscii()?(this.isUnsignedInt8()?b.DataArray.readUnsignedInt8ASCII(this):this.isInt32()?b.DataArray.readSignedInt32ASCII(this):b.DataArray.readFloat32ASCII(this),d()):this.isBase64Binary()?(this.isUnsignedInt8()?b.DataArray.readUnsignedInt8Base64(this):this.isInt32()?b.DataArray.readSignedInt32Base64(this):b.DataArray.readFloat32Base64(this),d()):this.isGzipBase64Binary()&&(this.isUnsignedInt8()?
|
|
1198
|
-
b.DataArray.readUnsignedInt8GZIPBase64Async(this,a,d):this.isInt32()?b.DataArray.readSignedInt32GZIPBase64Async(this,a,d):b.DataArray.readFloat32GZIPBase64Async(this,a,d)))};b.DataArray.readFloat32ASCII=function(a){a.data=new Float32Array(a.data.match(/[+-]?\d+(\.\d+)?/g).map(function(a){return parseFloat(a)}))};b.DataArray.readSignedInt32ASCII=function(a){a.data=new Int32Array(a.data.match(/[+-]?\d+(\.\d+)?/g).map(function(a){return parseInt(a)}))};b.DataArray.readUnsignedInt8ASCII=function(a){a.data=
|
|
1199
|
-
new Uint8Array(a.data.match(/[+-]?\d+(\.\d+)?/g).map(function(a){return parseInt(a)}))};b.DataArray.readUnsignedInt8Base64=function(a){var b=e.decodeArrayBuffer(a.data);a.data=new Uint8Array(b,0,b.byteLength)};b.DataArray.readSignedInt32Base64=function(a){var b=e.decodeArrayBuffer(a.data);a.data=new Int32Array(b,0,b.byteLength/4)};b.DataArray.readFloat32Base64=function(a){var b=e.decodeArrayBuffer(a.data);a.data=new Float32Array(b,0,b.byteLength/4)};b.DataArray.readUnsignedInt8GZIPBase64=function(a){var b=
|
|
1200
|
-
e.decodeArrayBuffer(a.data),b=g.inflate(b).buffer;a.data=new Uint8Array(b,0,b.byteLength)};b.DataArray.readUnsignedInt8GZIPBase64Async=function(a,d,f){var p=e.decodeArrayBuffer(a.data),t=new g.Inflate,w=function(){a.data=new Uint8Array(t.result.buffer,0,t.result.buffer.byteLength);f(a.data)};setTimeout(function(){b.DataArray.readNext(t,p,0,d,w)},0)};b.DataArray.readSignedInt32GZIPBase64=function(a){var b=e.decodeArrayBuffer(a.data),b=g.inflate(b).buffer;a.data=new Int32Array(b,0,b.byteLength/4)};
|
|
1201
|
-
b.DataArray.readSignedInt32GZIPBase64Async=function(a,d,f){var p=e.decodeArrayBuffer(a.data),t=new g.Inflate,w=function(){a.data=new Int32Array(t.result.buffer,0,t.result.buffer.byteLength/4);f(a.data)};setTimeout(function(){b.DataArray.readNext(t,p,0,d,w)},0)};b.DataArray.readFloat32GZIPBase64=function(a){var b=e.decodeArrayBuffer(a.data),b=g.inflate(b).buffer;a.data=new Float32Array(b,0,b.byteLength/4)};b.DataArray.readFloat32GZIPBase64Async=function(a,d,f){var p=e.decodeArrayBuffer(a.data),t=new g.Inflate,
|
|
1202
|
-
w=function(){a.data=new Float32Array(t.result.buffer,0,t.result.buffer.byteLength/4);f(a.data)};setTimeout(function(){b.DataArray.readNext(t,p,0,d,w)},0)};b.DataArray.readNext=function(a,d,e,f,g){var w=e+32768,B=w>=d.byteLength;a.push(d.slice(e,e+32768),B);B?g():(f(w/d.byteLength),setTimeout(function(){b.DataArray.readNext(a,d,w,f,g)},0))};"undefined"!==typeof d&&d.exports&&(d.exports=b.DataArray)},{"../lib/base64-binary.js":1,"./transform.js":46,pako:27}],45:[function(a,d,f){var b=b||{};b.Utils=
|
|
1203
|
-
b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.DataArray=b.DataArray||("undefined"!==typeof a?a("./dataArray.js"):null);b.Transform=b.Transform||("undefined"!==typeof a?a("./transform.js"):null);var e=e||("undefined"!==typeof a?a("sax"):null);b.TAG_TRANSFORM="CoordinateSystemTransformMatrix";b.TAG_DATA="Data";b.TAG_DATAARRAY="DataArray";b.TAG_DATASPACE="DataSpace";b.TAG_GIFTI="GIFTI";b.TAG_LABEL="Label";b.TAG_LABELTABLE="LabelTable";b.TAG_MATRIXDATA="MatrixData";b.TAG_METADATA="MetaData";
|
|
1204
|
-
b.TAG_MD="MD";b.TAG_NAME="Name";b.TAG_TRANSFORMEDSPACE="TransformedSpace";b.TAG_VALUE="Value";b.GIFTI=b.GIFTI||function(){this.attributes=null;this.metadata={};this.dataArrays=[]};b.GIFTI.prototype.getPointsDataArray=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isPointSet())return this.dataArrays[a];return null};b.GIFTI.prototype.getTrianglesDataArray=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isTriangles())return this.dataArrays[a];
|
|
1205
|
-
return null};b.GIFTI.prototype.getNormalsDataArray=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isNormals())return this.dataArrays[a];return null};b.GIFTI.prototype.getColorsDataArray=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isColors())return this.dataArrays[a];return null};b.GIFTI.prototype.getNumPoints=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isPointSet())return this.dataArrays[a].getNumElements();
|
|
1206
|
-
return 0};b.GIFTI.prototype.getNumTriangles=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isTriangles())return this.dataArrays[a].getNumElements();return 0};b.isThisFormat=function(a){return-1!==a.indexOf(".gii")};b.parse=function(a){var d=e.parser(!0),f=null,k=null,p=null,t=null,w=null,B=null,A="",x=!1,G=!1,F=!1,z=!1,L=!1,l=!1;d.onopentag=function(a){a.name===b.TAG_GIFTI?(p=f=new b.GIFTI,f.attributes=a.attributes):a.name!==b.TAG_METADATA&&a.name!==b.TAG_MD&&(a.name===
|
|
1207
|
-
b.TAG_NAME?x=!0:a.name===b.TAG_VALUE?G=!0:a.name===b.TAG_DATAARRAY?(p=k=new b.DataArray,f.dataArrays.push(k),k.attributes=a.attributes):a.name===b.TAG_TRANSFORM?(B=new b.Transform,k.transforms.push(B)):a.name===b.TAG_DATASPACE?F=!0:a.name===b.TAG_TRANSFORMEDSPACE?z=!0:a.name===b.TAG_MATRIXDATA?L=!0:a.name===b.TAG_DATA&&(l=!0))};d.ontext=d.oncdata=function(a){x?A+=a:G?A+=a:F?A+=a:z?A+=a:L?A+=a:l&&(A+=a)};d.onclosetag=function(a){a!==b.TAG_GIFTI&&a!==b.TAG_METADATA&&(a===b.TAG_MD?p&&(p.metadata[t]=
|
|
1208
|
-
w):a===b.TAG_NAME?(x=!1,t=A,A=""):a===b.TAG_VALUE?(G=!1,w=A,A=""):a!==b.TAG_DATAARRAY&&a!==b.TAG_TRANSFORM&&(a===b.TAG_DATASPACE?(F=!1,B.dataSpace=A,A=""):a===b.TAG_TRANSFORMEDSPACE?(z=!1,B.transformedSpace=A,A=""):a===b.TAG_MATRIXDATA?(L=!1,B.matrixData=A,A=""):a===b.TAG_DATA&&(l=!1,k.data=A,A="")))};d.onerror=function(a){console.log(a)};d.write(a).close();return f};"undefined"!==typeof d&&d.exports&&(d.exports=b)},{"./dataArray.js":44,"./transform.js":46,"./utilities.js":47,sax:43}],46:[function(a,
|
|
1209
|
-
d,f){var b=b||{};b.Transform=b.Transform||function(){this.matrixData=this.transformedSpace=this.dataSpace=null};"undefined"!==typeof d&&d.exports&&(d.exports=b.Transform)},{}],47:[function(a,d,f){var b=b||{};b.Utils=b.Utils||{};b.Utils.crcTable=null;b.Utils.makeCRCTable=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b};b.Utils.crc32=function(a){for(var d=b.Utils.crcTable||(b.Utils.crcTable=b.Utils.makeCRCTable()),f=-1,m=0;m<a.byteLength;m++)f=
|
|
1210
|
-
f>>>8^d[(f^a.getUint8(m))&255];return(f^-1)>>>0};"undefined"!==typeof d&&d.exports&&(d.exports=b.Utils)},{}]},{},[45])(45)});glMatrixArrayType="undefined"!=typeof Float32Array?Float32Array:"undefined"!=typeof WebGLFloatArray?WebGLFloatArray:Array;
|
|
1211
|
-
var vec3={create:function(c){var a=new glMatrixArrayType(3);c&&(a[0]=c[0],a[1]=c[1],a[2]=c[2]);return a},set:function(c,a){a[0]=c[0];a[1]=c[1];a[2]=c[2];return a},add:function(c,a,d){if(!d||c==d)return c[0]+=a[0],c[1]+=a[1],c[2]+=a[2],c;d[0]=c[0]+a[0];d[1]=c[1]+a[1];d[2]=c[2]+a[2];return d},subtract:function(c,a,d){if(!d||c==d)return c[0]-=a[0],c[1]-=a[1],c[2]-=a[2],c;d[0]=c[0]-a[0];d[1]=c[1]-a[1];d[2]=c[2]-a[2];return d},negate:function(c,a){a||(a=c);a[0]=-c[0];a[1]=-c[1];a[2]=-c[2];return a},scale:function(c,
|
|
1212
|
-
a,d){if(!d||c==d)return c[0]*=a,c[1]*=a,c[2]*=a,c;d[0]=c[0]*a;d[1]=c[1]*a;d[2]=c[2]*a;return d},normalize:function(c,a){a||(a=c);var d=c[0],f=c[1],b=c[2],e=Math.sqrt(d*d+f*f+b*b);if(e){if(1==e)return a[0]=d,a[1]=f,a[2]=b,a}else return a[0]=0,a[1]=0,a[2]=0,a;e=1/e;a[0]=d*e;a[1]=f*e;a[2]=b*e;return a},cross:function(c,a,d){d||(d=c);var f=c[0],b=c[1];c=c[2];var e=a[0],g=a[1];a=a[2];d[0]=b*a-c*g;d[1]=c*e-f*a;d[2]=f*g-b*e;return d},length:function(c){var a=c[0],d=c[1];c=c[2];return Math.sqrt(a*a+d*d+c*
|
|
1213
|
-
c)},dot:function(c,a){return c[0]*a[0]+c[1]*a[1]+c[2]*a[2]},direction:function(c,a,d){d||(d=c);var f=c[0]-a[0],b=c[1]-a[1];c=c[2]-a[2];a=Math.sqrt(f*f+b*b+c*c);if(!a)return d[0]=0,d[1]=0,d[2]=0,d;a=1/a;d[0]=f*a;d[1]=b*a;d[2]=c*a;return d},lerp:function(c,a,d,f){f||(f=c);f[0]=c[0]+d*(a[0]-c[0]);f[1]=c[1]+d*(a[1]-c[1]);f[2]=c[2]+d*(a[2]-c[2]);return f},str:function(c){return"["+c[0]+", "+c[1]+", "+c[2]+"]"}},mat3={create:function(c){var a=new glMatrixArrayType(9);c&&(a[0]=c[0],a[1]=c[1],a[2]=c[2],a[3]=
|
|
1214
|
-
c[3],a[4]=c[4],a[5]=c[5],a[6]=c[6],a[7]=c[7],a[8]=c[8],a[9]=c[9]);return a},set:function(c,a){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];a[4]=c[4];a[5]=c[5];a[6]=c[6];a[7]=c[7];a[8]=c[8];return a},identity:function(c){c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=1;c[5]=0;c[6]=0;c[7]=0;c[8]=1;return c},transpose:function(c,a){if(!a||c==a){var d=c[1],f=c[2],b=c[5];c[1]=c[3];c[2]=c[6];c[3]=d;c[5]=c[7];c[6]=f;c[7]=b;return c}a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]=c[2];a[7]=c[5];a[8]=c[8];return a},
|
|
1215
|
-
toMat4:function(c,a){a||(a=mat4.create());a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=0;a[4]=c[3];a[5]=c[4];a[6]=c[5];a[7]=0;a[8]=c[6];a[9]=c[7];a[10]=c[8];a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},str:function(c){return"["+c[0]+", "+c[1]+", "+c[2]+", "+c[3]+", "+c[4]+", "+c[5]+", "+c[6]+", "+c[7]+", "+c[8]+"]"}},mat4={create:function(c){var a=new glMatrixArrayType(16);c&&(a[0]=c[0],a[1]=c[1],a[2]=c[2],a[3]=c[3],a[4]=c[4],a[5]=c[5],a[6]=c[6],a[7]=c[7],a[8]=c[8],a[9]=c[9],a[10]=c[10],a[11]=c[11],a[12]=
|
|
1216
|
-
c[12],a[13]=c[13],a[14]=c[14],a[15]=c[15]);return a},set:function(c,a){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];a[4]=c[4];a[5]=c[5];a[6]=c[6];a[7]=c[7];a[8]=c[8];a[9]=c[9];a[10]=c[10];a[11]=c[11];a[12]=c[12];a[13]=c[13];a[14]=c[14];a[15]=c[15];return a},identity:function(c){c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=1;c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=1;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c},transpose:function(c,a){if(!a||c==a){var d=c[1],f=c[2],b=c[3],e=c[6],g=c[7],h=c[11];c[1]=c[4];c[2]=
|
|
1217
|
-
c[8];c[3]=c[12];c[4]=d;c[6]=c[9];c[7]=c[13];c[8]=f;c[9]=e;c[11]=c[14];c[12]=b;c[13]=g;c[14]=h;return c}a[0]=c[0];a[1]=c[4];a[2]=c[8];a[3]=c[12];a[4]=c[1];a[5]=c[5];a[6]=c[9];a[7]=c[13];a[8]=c[2];a[9]=c[6];a[10]=c[10];a[11]=c[14];a[12]=c[3];a[13]=c[7];a[14]=c[11];a[15]=c[15];return a},determinant:function(c){var a=c[0],d=c[1],f=c[2],b=c[3],e=c[4],g=c[5],h=c[6],m=c[7],k=c[8],p=c[9],t=c[10],w=c[11],B=c[12],A=c[13],x=c[14];c=c[15];return B*p*h*b-k*A*h*b-B*g*t*b+e*A*t*b+k*g*x*b-e*p*x*b-B*p*f*m+k*A*f*m+
|
|
1218
|
-
B*d*t*m-a*A*t*m-k*d*x*m+a*p*x*m+B*g*f*w-e*A*f*w-B*d*h*w+a*A*h*w+e*d*x*w-a*g*x*w-k*g*f*c+e*p*f*c+k*d*h*c-a*p*h*c-e*d*t*c+a*g*t*c},inverse:function(c,a){a||(a=c);var d=c[0],f=c[1],b=c[2],e=c[3],g=c[4],h=c[5],m=c[6],k=c[7],p=c[8],t=c[9],w=c[10],B=c[11],A=c[12],x=c[13],G=c[14],F=c[15],z=d*h-f*g,L=d*m-b*g,l=d*k-e*g,J=f*m-b*h,K=f*k-e*h,E=b*k-e*m,y=p*x-t*A,D=p*G-w*A,u=p*F-B*A,n=t*G-w*x,q=t*F-B*x,I=w*F-B*G,H=1/(z*I-L*q+l*n+J*u-K*D+E*y);a[0]=(h*I-m*q+k*n)*H;a[1]=(-f*I+b*q-e*n)*H;a[2]=(x*E-G*K+F*J)*H;a[3]=
|
|
1219
|
-
(-t*E+w*K-B*J)*H;a[4]=(-g*I+m*u-k*D)*H;a[5]=(d*I-b*u+e*D)*H;a[6]=(-A*E+G*l-F*L)*H;a[7]=(p*E-w*l+B*L)*H;a[8]=(g*q-h*u+k*y)*H;a[9]=(-d*q+f*u-e*y)*H;a[10]=(A*K-x*l+F*z)*H;a[11]=(-p*K+t*l-B*z)*H;a[12]=(-g*n+h*D-m*y)*H;a[13]=(d*n-f*D+b*y)*H;a[14]=(-A*J+x*L-G*z)*H;a[15]=(p*J-t*L+w*z)*H;return a},toRotationMat:function(c,a){a||(a=mat4.create());a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];a[4]=c[4];a[5]=c[5];a[6]=c[6];a[7]=c[7];a[8]=c[8];a[9]=c[9];a[10]=c[10];a[11]=c[11];a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},
|
|
1220
|
-
toMat3:function(c,a){a||(a=mat3.create());a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[4];a[4]=c[5];a[5]=c[6];a[6]=c[8];a[7]=c[9];a[8]=c[10];return a},toInverseMat3:function(c,a){var d=c[0],f=c[1],b=c[2],e=c[4],g=c[5],h=c[6],m=c[8],k=c[9],p=c[10],t=p*g-h*k,w=-p*e+h*m,B=k*e-g*m,A=d*t+f*w+b*B;if(!A)return null;A=1/A;a||(a=mat3.create());a[0]=t*A;a[1]=(-p*f+b*k)*A;a[2]=(h*f-b*g)*A;a[3]=w*A;a[4]=(p*d-b*m)*A;a[5]=(-h*d+b*e)*A;a[6]=B*A;a[7]=(-k*d+f*m)*A;a[8]=(g*d-f*e)*A;return a},multiply:function(c,a,d){d||(d=
|
|
1221
|
-
c);var f=c[0],b=c[1],e=c[2],g=c[3],h=c[4],m=c[5],k=c[6],p=c[7],t=c[8],w=c[9],B=c[10],A=c[11],x=c[12],G=c[13],F=c[14];c=c[15];var z=a[0],L=a[1],l=a[2],J=a[3],K=a[4],E=a[5],y=a[6],D=a[7],u=a[8],n=a[9],q=a[10],I=a[11],H=a[12],v=a[13],C=a[14];a=a[15];d[0]=z*f+L*h+l*t+J*x;d[1]=z*b+L*m+l*w+J*G;d[2]=z*e+L*k+l*B+J*F;d[3]=z*g+L*p+l*A+J*c;d[4]=K*f+E*h+y*t+D*x;d[5]=K*b+E*m+y*w+D*G;d[6]=K*e+E*k+y*B+D*F;d[7]=K*g+E*p+y*A+D*c;d[8]=u*f+n*h+q*t+I*x;d[9]=u*b+n*m+q*w+I*G;d[10]=u*e+n*k+q*B+I*F;d[11]=u*g+n*p+q*A+I*c;
|
|
1222
|
-
d[12]=H*f+v*h+C*t+a*x;d[13]=H*b+v*m+C*w+a*G;d[14]=H*e+v*k+C*B+a*F;d[15]=H*g+v*p+C*A+a*c;return d},multiplyVec3:function(c,a,d){d||(d=a);var f=a[0],b=a[1];a=a[2];d[0]=c[0]*f+c[4]*b+c[8]*a+c[12];d[1]=c[1]*f+c[5]*b+c[9]*a+c[13];d[2]=c[2]*f+c[6]*b+c[10]*a+c[14];return d},multiplyVec4:function(c,a,d){d||(d=a);var f=a[0],b=a[1],e=a[2];a=a[3];d[0]=c[0]*f+c[4]*b+c[8]*e+c[12]*a;d[1]=c[1]*f+c[5]*b+c[9]*e+c[13]*a;d[2]=c[2]*f+c[6]*b+c[10]*e+c[14]*a;d[3]=c[3]*f+c[7]*b+c[11]*e+c[15]*a;return d},translate:function(c,
|
|
1223
|
-
a,d){var f=a[0],b=a[1];a=a[2];if(!d||c==d)return c[12]=c[0]*f+c[4]*b+c[8]*a+c[12],c[13]=c[1]*f+c[5]*b+c[9]*a+c[13],c[14]=c[2]*f+c[6]*b+c[10]*a+c[14],c[15]=c[3]*f+c[7]*b+c[11]*a+c[15],c;var e=c[0],g=c[1],h=c[2],m=c[3],k=c[4],p=c[5],t=c[6],w=c[7],B=c[8],A=c[9],x=c[10],G=c[11];d[0]=e;d[1]=g;d[2]=h;d[3]=m;d[4]=k;d[5]=p;d[6]=t;d[7]=w;d[8]=B;d[9]=A;d[10]=x;d[11]=G;d[12]=e*f+k*b+B*a+c[12];d[13]=g*f+p*b+A*a+c[13];d[14]=h*f+t*b+x*a+c[14];d[15]=m*f+w*b+G*a+c[15];return d},scale:function(c,a,d){var f=a[0],b=
|
|
1224
|
-
a[1];a=a[2];if(!d||c==d)return c[0]*=f,c[1]*=f,c[2]*=f,c[3]*=f,c[4]*=b,c[5]*=b,c[6]*=b,c[7]*=b,c[8]*=a,c[9]*=a,c[10]*=a,c[11]*=a,c;d[0]=c[0]*f;d[1]=c[1]*f;d[2]=c[2]*f;d[3]=c[3]*f;d[4]=c[4]*b;d[5]=c[5]*b;d[6]=c[6]*b;d[7]=c[7]*b;d[8]=c[8]*a;d[9]=c[9]*a;d[10]=c[10]*a;d[11]=c[11]*a;d[12]=c[12];d[13]=c[13];d[14]=c[14];d[15]=c[15];return d},rotate:function(c,a,d,f){var b=d[0],e=d[1];d=d[2];var g=Math.sqrt(b*b+e*e+d*d);if(!g)return null;1!=g&&(g=1/g,b*=g,e*=g,d*=g);var h=Math.sin(a),m=Math.cos(a),k=1-m;
|
|
1225
|
-
a=c[0];var g=c[1],p=c[2],t=c[3],w=c[4],B=c[5],A=c[6],x=c[7],G=c[8],F=c[9],z=c[10],L=c[11],l=b*b*k+m,J=e*b*k+d*h,K=d*b*k-e*h,E=b*e*k-d*h,y=e*e*k+m,D=d*e*k+b*h,u=b*d*k+e*h,b=e*d*k-b*h,e=d*d*k+m;f?c!=f&&(f[12]=c[12],f[13]=c[13],f[14]=c[14],f[15]=c[15]):f=c;f[0]=a*l+w*J+G*K;f[1]=g*l+B*J+F*K;f[2]=p*l+A*J+z*K;f[3]=t*l+x*J+L*K;f[4]=a*E+w*y+G*D;f[5]=g*E+B*y+F*D;f[6]=p*E+A*y+z*D;f[7]=t*E+x*y+L*D;f[8]=a*u+w*b+G*e;f[9]=g*u+B*b+F*e;f[10]=p*u+A*b+z*e;f[11]=t*u+x*b+L*e;return f},rotateX:function(c,a,d){var f=Math.sin(a);
|
|
1226
|
-
a=Math.cos(a);var b=c[4],e=c[5],g=c[6],h=c[7],m=c[8],k=c[9],p=c[10],t=c[11];d?c!=d&&(d[0]=c[0],d[1]=c[1],d[2]=c[2],d[3]=c[3],d[12]=c[12],d[13]=c[13],d[14]=c[14],d[15]=c[15]):d=c;d[4]=b*a+m*f;d[5]=e*a+k*f;d[6]=g*a+p*f;d[7]=h*a+t*f;d[8]=b*-f+m*a;d[9]=e*-f+k*a;d[10]=g*-f+p*a;d[11]=h*-f+t*a;return d},rotateY:function(c,a,d){var f=Math.sin(a);a=Math.cos(a);var b=c[0],e=c[1],g=c[2],h=c[3],m=c[8],k=c[9],p=c[10],t=c[11];d?c!=d&&(d[4]=c[4],d[5]=c[5],d[6]=c[6],d[7]=c[7],d[12]=c[12],d[13]=c[13],d[14]=c[14],
|
|
1227
|
-
d[15]=c[15]):d=c;d[0]=b*a+m*-f;d[1]=e*a+k*-f;d[2]=g*a+p*-f;d[3]=h*a+t*-f;d[8]=b*f+m*a;d[9]=e*f+k*a;d[10]=g*f+p*a;d[11]=h*f+t*a;return d},rotateZ:function(c,a,d){var f=Math.sin(a);a=Math.cos(a);var b=c[0],e=c[1],g=c[2],h=c[3],m=c[4],k=c[5],p=c[6],t=c[7];d?c!=d&&(d[8]=c[8],d[9]=c[9],d[10]=c[10],d[11]=c[11],d[12]=c[12],d[13]=c[13],d[14]=c[14],d[15]=c[15]):d=c;d[0]=b*a+m*f;d[1]=e*a+k*f;d[2]=g*a+p*f;d[3]=h*a+t*f;d[4]=b*-f+m*a;d[5]=e*-f+k*a;d[6]=g*-f+p*a;d[7]=h*-f+t*a;return d},frustum:function(c,a,d,f,
|
|
1228
|
-
b,e,g){g||(g=mat4.create());var h=a-c,m=f-d,k=e-b;g[0]=2*b/h;g[1]=0;g[2]=0;g[3]=0;g[4]=0;g[5]=2*b/m;g[6]=0;g[7]=0;g[8]=(a+c)/h;g[9]=(f+d)/m;g[10]=-(e+b)/k;g[11]=-1;g[12]=0;g[13]=0;g[14]=-(e*b*2)/k;g[15]=0;return g},perspective:function(c,a,d,f,b){c=d*Math.tan(c*Math.PI/360);a*=c;return mat4.frustum(-a,a,-c,c,d,f,b)},ortho:function(c,a,d,f,b,e,g){g||(g=mat4.create());var h=a-c,m=f-d,k=e-b;g[0]=2/h;g[1]=0;g[2]=0;g[3]=0;g[4]=0;g[5]=2/m;g[6]=0;g[7]=0;g[8]=0;g[9]=0;g[10]=-2/k;g[11]=0;g[12]=-(c+a)/h;g[13]=
|
|
1229
|
-
-(f+d)/m;g[14]=-(e+b)/k;g[15]=1;return g},lookAt:function(c,a,d,f){f||(f=mat4.create());var b=c[0],e=c[1];c=c[2];var g=d[0],h=d[1],m=d[2];d=a[1];var k=a[2];if(b==a[0]&&e==d&&c==k)return mat4.identity(f);var p,t,w,B;d=b-a[0];k=e-a[1];a=c-a[2];B=1/Math.sqrt(d*d+k*k+a*a);d*=B;k*=B;a*=B;p=h*a-m*k;m=m*d-g*a;g=g*k-h*d;(B=Math.sqrt(p*p+m*m+g*g))?(B=1/B,p*=B,m*=B,g*=B):g=m=p=0;h=k*g-a*m;t=a*p-d*g;w=d*m-k*p;(B=Math.sqrt(h*h+t*t+w*w))?(B=1/B,h*=B,t*=B,w*=B):w=t=h=0;f[0]=p;f[1]=h;f[2]=d;f[3]=0;f[4]=m;f[5]=t;
|
|
1230
|
-
f[6]=k;f[7]=0;f[8]=g;f[9]=w;f[10]=a;f[11]=0;f[12]=-(p*b+m*e+g*c);f[13]=-(h*b+t*e+w*c);f[14]=-(d*b+k*e+a*c);f[15]=1;return f},str:function(c){return"["+c[0]+", "+c[1]+", "+c[2]+", "+c[3]+", "+c[4]+", "+c[5]+", "+c[6]+", "+c[7]+", "+c[8]+", "+c[9]+", "+c[10]+", "+c[11]+", "+c[12]+", "+c[13]+", "+c[14]+", "+c[15]+"]"}};
|
|
1231
|
-
quat4={create:function(c){var a=new glMatrixArrayType(4);c&&(a[0]=c[0],a[1]=c[1],a[2]=c[2],a[3]=c[3]);return a},set:function(c,a){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];return a},calculateW:function(c,a){var d=c[0],f=c[1],b=c[2];if(!a||c==a)return c[3]=-Math.sqrt(Math.abs(1-d*d-f*f-b*b)),c;a[0]=d;a[1]=f;a[2]=b;a[3]=-Math.sqrt(Math.abs(1-d*d-f*f-b*b));return a},inverse:function(c,a){if(!a||c==a)return c[0]*=1,c[1]*=1,c[2]*=1,c;a[0]=-c[0];a[1]=-c[1];a[2]=-c[2];a[3]=c[3];return a},length:function(c){var a=
|
|
1232
|
-
c[0],d=c[1],f=c[2];c=c[3];return Math.sqrt(a*a+d*d+f*f+c*c)},normalize:function(c,a){a||(a=c);var d=c[0],f=c[1],b=c[2],e=c[3],g=Math.sqrt(d*d+f*f+b*b+e*e);if(0==g)return a[0]=0,a[1]=0,a[2]=0,a[3]=0,a;g=1/g;a[0]=d*g;a[1]=f*g;a[2]=b*g;a[3]=e*g;return a},multiply:function(c,a,d){d||(d=c);var f=c[0],b=c[1],e=c[2];c=c[3];var g=a[0],h=a[1],m=a[2];a=a[3];d[0]=f*a+c*g+b*m-e*h;d[1]=b*a+c*h+e*g-f*m;d[2]=e*a+c*m+f*h-b*g;d[3]=c*a-f*g-b*h-e*m;return d},multiplyVec3:function(c,a,d){d||(d=a);var f=a[0],b=a[1],e=
|
|
1233
|
-
a[2];a=c[0];var g=c[1],h=c[2];c=c[3];var m=c*f+g*e-h*b,k=c*b+h*f-a*e,p=c*e+a*b-g*f,f=-a*f-g*b-h*e;d[0]=m*c+f*-a+k*-h-p*-g;d[1]=k*c+f*-g+p*-a-m*-h;d[2]=p*c+f*-h+m*-g-k*-a;return d},toMat3:function(c,a){a||(a=mat3.create());var d=c[0],f=c[1],b=c[2],e=c[3],g=d+d,h=f+f,m=b+b,k=d*g,p=d*h,d=d*m,t=f*h,f=f*m,b=b*m,g=e*g,h=e*h,e=e*m;a[0]=1-(t+b);a[1]=p-e;a[2]=d+h;a[3]=p+e;a[4]=1-(k+b);a[5]=f-g;a[6]=d-h;a[7]=f+g;a[8]=1-(k+t);return a},toMat4:function(c,a){a||(a=mat4.create());var d=c[0],f=c[1],b=c[2],e=c[3],
|
|
1234
|
-
g=d+d,h=f+f,m=b+b,k=d*g,p=d*h,d=d*m,t=f*h,f=f*m,b=b*m,g=e*g,h=e*h,e=e*m;a[0]=1-(t+b);a[1]=p-e;a[2]=d+h;a[3]=0;a[4]=p+e;a[5]=1-(k+b);a[6]=f-g;a[7]=0;a[8]=d-h;a[9]=f+g;a[10]=1-(k+t);a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},slerp:function(c,a,d,f){f||(f=c);var b=d;0>c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]*a[3]&&(b=-1*d);f[0]=1-d*c[0]+b*a[0];f[1]=1-d*c[1]+b*a[1];f[2]=1-d*c[2]+b*a[2];f[3]=1-d*c[3]+b*a[3];return f},str:function(c){return"["+c[0]+", "+c[1]+", "+c[2]+", "+c[3]+"]"}};var GLU={};
|
|
1235
|
-
(function(c){c.unProject=function(a,d,f,b,e,g,h){a=[a,d,f,1];d=[];c.multMatrices(b,e,d);if(!c.invertMatrix(d,d))return!1;a[0]=(a[0]-g[0])/g[2];a[1]=(a[1]-g[1])/g[3];a[0]=2*a[0]-1;a[1]=2*a[1]-1;a[2]=2*a[2]-1;b=[];c.multMatrixVec(d,a,b);if(0===b[3])return!1;b[0]/=b[3];b[1]/=b[3];b[2]/=b[3];h[0]=b[0];h[1]=b[1];h[2]=b[2];return!0};c.multMatrixVec=function(a,c,f){for(var b=0;4>b;b+=1)f[b]=c[0]*a[0+b]+c[1]*a[4+b]+c[2]*a[8+b]+c[3]*a[12+b]};c.multMatrices=function(a,c,f){for(var b=0;4>b;b+=1)for(var e=0;4>
|
|
1236
|
-
e;e+=1)f[4*b+e]=a[4*b+0]*c[0+e]+a[4*b+1]*c[4+e]+a[4*b+2]*c[8+e]+a[4*b+3]*c[12+e]};c.invertMatrix=function(a,c){var f=[];f[0]=a[5]*a[10]*a[15]-a[5]*a[11]*a[14]-a[9]*a[6]*a[15]+a[9]*a[7]*a[14]+a[13]*a[6]*a[11]-a[13]*a[7]*a[10];f[4]=-a[4]*a[10]*a[15]+a[4]*a[11]*a[14]+a[8]*a[6]*a[15]-a[8]*a[7]*a[14]-a[12]*a[6]*a[11]+a[12]*a[7]*a[10];f[8]=a[4]*a[9]*a[15]-a[4]*a[11]*a[13]-a[8]*a[5]*a[15]+a[8]*a[7]*a[13]+a[12]*a[5]*a[11]-a[12]*a[7]*a[9];f[12]=-a[4]*a[9]*a[14]+a[4]*a[10]*a[13]+a[8]*a[5]*a[14]-a[8]*a[6]*a[13]-
|
|
1237
|
-
a[12]*a[5]*a[10]+a[12]*a[6]*a[9];f[1]=-a[1]*a[10]*a[15]+a[1]*a[11]*a[14]+a[9]*a[2]*a[15]-a[9]*a[3]*a[14]-a[13]*a[2]*a[11]+a[13]*a[3]*a[10];f[5]=a[0]*a[10]*a[15]-a[0]*a[11]*a[14]-a[8]*a[2]*a[15]+a[8]*a[3]*a[14]+a[12]*a[2]*a[11]-a[12]*a[3]*a[10];f[9]=-a[0]*a[9]*a[15]+a[0]*a[11]*a[13]+a[8]*a[1]*a[15]-a[8]*a[3]*a[13]-a[12]*a[1]*a[11]+a[12]*a[3]*a[9];f[13]=a[0]*a[9]*a[14]-a[0]*a[10]*a[13]-a[8]*a[1]*a[14]+a[8]*a[2]*a[13]+a[12]*a[1]*a[10]-a[12]*a[2]*a[9];f[2]=a[1]*a[6]*a[15]-a[1]*a[7]*a[14]-a[5]*a[2]*a[15]+
|
|
1238
|
-
a[5]*a[3]*a[14]+a[13]*a[2]*a[7]-a[13]*a[3]*a[6];f[6]=-a[0]*a[6]*a[15]+a[0]*a[7]*a[14]+a[4]*a[2]*a[15]-a[4]*a[3]*a[14]-a[12]*a[2]*a[7]+a[12]*a[3]*a[6];f[10]=a[0]*a[5]*a[15]-a[0]*a[7]*a[13]-a[4]*a[1]*a[15]+a[4]*a[3]*a[13]+a[12]*a[1]*a[7]-a[12]*a[3]*a[5];f[14]=-a[0]*a[5]*a[14]+a[0]*a[6]*a[13]+a[4]*a[1]*a[14]-a[4]*a[2]*a[13]-a[12]*a[1]*a[6]+a[12]*a[2]*a[5];f[3]=-a[1]*a[6]*a[11]+a[1]*a[7]*a[10]+a[5]*a[2]*a[11]-a[5]*a[3]*a[10]-a[9]*a[2]*a[7]+a[9]*a[3]*a[6];f[7]=a[0]*a[6]*a[11]-a[0]*a[7]*a[10]-a[4]*a[2]*
|
|
1239
|
-
a[11]+a[4]*a[3]*a[10]+a[8]*a[2]*a[7]-a[8]*a[3]*a[6];f[11]=-a[0]*a[5]*a[11]+a[0]*a[7]*a[9]+a[4]*a[1]*a[11]-a[4]*a[3]*a[9]-a[8]*a[1]*a[7]+a[8]*a[3]*a[5];f[15]=a[0]*a[5]*a[10]-a[0]*a[6]*a[9]-a[4]*a[1]*a[10]+a[4]*a[2]*a[9]+a[8]*a[1]*a[6]-a[8]*a[2]*a[5];var b=a[0]*f[0]+a[1]*f[4]+a[2]*f[8]+a[3]*f[12];if(0===b)return!1;for(var b=1/b,e=0;16>e;e+=1)c[e]=f[e]*b;return!0}})(GLU);
|
|
1240
|
-
var PAPAYA_BROWSER_MIN_FIREFOX=7,PAPAYA_BROWSER_MIN_CHROME=7,PAPAYA_BROWSER_MIN_SAFARI=6,PAPAYA_BROWSER_MIN_IE=10,PAPAYA_BROWSER_MIN_OPERA=12,PAPAYA_SURFACE_BROWSER_MIN_FIREFOX=7,PAPAYA_SURFACE_BROWSER_MIN_CHROME=8,PAPAYA_SURFACE_BROWSER_MIN_SAFARI=6,PAPAYA_SURFACE_BROWSER_MIN_IE=11,PAPAYA_SURFACE_BROWSER_MIN_OPERA=12,PAPAYA_CONTAINER_CLASS_NAME="papaya",PAPAYA_CONTAINER_COLLAPSABLE="papaya-collapsable",PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT="papaya-collapsable-exempt",PAPAYA_CONTAINER_FULLSCREEN="papaya-fullscreen",
|
|
1241
|
-
PAPAYA_VIEWER_CSS="papaya-viewer",PAPAYA_TOOLBAR_CSS="papaya-toolbar",PAPAYA_TITLEBAR_CSS="papaya-titlebar",PAPAYA_SLIDER_CSS="papaya-slider-slice",PAPAYA_KIOSK_CONTROLS_CSS="papaya-kiosk-controls",PAPAYA_DISPLAY_CSS="papaya-display",PAPAYA_DIALOG_CSS="papaya-dialog",PAPAYA_DIALOG_CONTENT_CSS="papaya-dialog-content",PAPAYA_DIALOG_CONTENT_NOWRAP_CSS="papaya-dialog-content-nowrap",PAPAYA_DIALOG_CONTENT_LABEL_CSS="papaya-dialog-content-label",PAPAYA_DIALOG_CONTENT_CONTROL_CSS="papaya-dialog-content-control",
|
|
1242
|
-
PAPAYA_DIALOG_TITLE_CSS="papaya-dialog-title",PAPAYA_DIALOG_BUTTON_CSS="papaya-dialog-button",PAPAYA_DIALOG_BACKGROUND="papaya-dialog-background",PAPAYA_DIALOG_STOPSCROLL="papaya-dialog-stopscroll",PAPAYA_DIALOG_CONTENT_HELP="papaya-dialog-content-help",PAPAYA_MENU_CSS="papaya-menu",PAPAYA_MENU_LABEL_CSS="papaya-menu-label",PAPAYA_MENU_TITLEBAR_CSS="papaya-menu-titlebar",PAPAYA_MENU_ICON_CSS="papaya-menu-icon",PAPAYA_MENU_HOVERING_CSS="papaya-menu-hovering",PAPAYA_MENU_SPACER_CSS="papaya-menu-spacer",
|
|
1243
|
-
PAPAYA_MENU_UNSELECTABLE="papaya-menu-unselectable",PAPAYA_MENU_FILECHOOSER="papaya-menu-filechooser",PAPAYA_MENU_BUTTON_CSS="papaya-menu-button",PAPAYA_MENU_BUTTON_HOVERING_CSS="papaya-menu-button-hovering",PAPAYA_MENU_COLORTABLE_CSS="papaya-menu-colortable",PAPAYA_MENU_INPUT_FIELD="papaya-menu-input",PAPAYA_MENU_SLIDER="papaya-menu-slider",PAPAYA_CONTROL_INCREMENT_BUTTON_CSS="papaya-control-increment",PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS="papaya-control-goto-center",PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS=
|
|
1244
|
-
"papaya-control-goto-origin",PAPAYA_CONTROL_SWAP_BUTTON_CSS="papaya-control-swap",PAPAYA_CONTROL_DIRECTION_SLIDER="papaya-direction-slider",PAPAYA_CONTROL_MAIN_SLIDER="papaya-main-slider",PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS="papaya-main-increment",PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS="papaya-main-decrement",PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS="papaya-main-swap",PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS="papaya-main-goto-center",PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS="papaya-main-goto-origin",
|
|
1245
|
-
PAPAYA_CONTROL_BAR_LABELS_CSS="papaya-controlbar-label",PAPAYA_UTILS_CHECKFORJS_CSS="checkForJS",PAPAYA_UTILS_UNSUPPORTED_CSS="papaya-utils-unsupported",PAPAYA_UTILS_UNSUPPORTED_MESSAGE_CSS="papaya-utils-unsupported-message",PAPAYA_DEFAULT_VIEWER_ID="papayaViewer",PAPAYA_DEFAULT_DISPLAY_ID="papayaDisplay",PAPAYA_DEFAULT_TOOLBAR_ID="papayaToolbar",PAPAYA_DEFAULT_CONTAINER_ID="papayaContainer",PAPAYA_DEFAULT_SLIDER_ID="papayaSliceSlider",PAPAYA_SPACING=3,PAPAYA_PADDING=8,PAPAYA_CONTAINER_PADDING=20,
|
|
1246
|
-
PAPAYA_CONTAINER_PADDING_TOP=PAPAYA_CONTAINER_PADDING,PAPAYA_MANGO_INSTALLED="mangoinstalled",PAPAYA_CUSTOM_PROTOCOL="mango",GUNZIP_MAGIC_COOKIE1=31,GUNZIP_MAGIC_COOKIE2=139;"use strict";var papaya=papaya||{};papaya.utilities=papaya.utilities||{};papaya.utilities.ArrayUtils=papaya.utilities.ArrayUtils||{};
|
|
1247
|
-
papaya.utilities.ArrayUtils.createArray=function(c){var a=Array(c||0),d;if(1<arguments.length){var f=Array.prototype.slice.call(arguments,1);for(d=0;d<c;d+=1)a[d]=papaya.utilities.ArrayUtils.createArray.apply(this,f)}return a};papaya.utilities.ArrayUtils.contains=function(c,a){for(var d=c.length;d--;)if(c[d]===a)return!0;return!1};Array.prototype.clone=function(){var c,a;c=this.slice(0);for(a=0;a<this.length;a+=1)this[a].clone&&(c[a]=this[a].clone());return c};"use strict";papaya=papaya||{};
|
|
1248
|
-
papaya.utilities=papaya.utilities||{};papaya.utilities.MathUtils=papaya.utilities.MathUtils||{};papaya.utilities.MathUtils.EPSILON=1E-8;papaya.utilities.MathUtils.signum=function(c){return c?0>c?-1:1:0};papaya.utilities.MathUtils.lineDistance=function(c,a,d,f){c=d-c;a=f-a;return Math.sqrt(c*c+a*a)};papaya.utilities.MathUtils.lineDistance3d=function(c,a,d,f,b,e){c=f-c;a=b-a;d=e-d;return Math.sqrt(c*c+a*a+d*d)};
|
|
1249
|
-
papaya.utilities.MathUtils.essentiallyEqual=function(c,a){return c===a||Math.abs(c-a)<=(Math.abs(c)>Math.abs(a)?Math.abs(a):Math.abs(c))*papaya.utilities.MathUtils.EPSILON};papaya.utilities.MathUtils.getPowerOfTwo=function(c,a){for(a=a||1;a<c;)a*=2;return a};function papayaRoundFast(c){return.5+c|0}function papayaFloorFast(c){return c|0}"use strict";papaya=papaya||{};papaya.utilities=papaya.utilities||{};papaya.utilities.ObjectUtils=papaya.utilities.ObjectUtils||{};
|
|
1250
|
-
papaya.utilities.ObjectUtils.bind=function(c,a,d,f){if(2===arguments.length)return function(){return a.apply(c,arguments)};var b=Array.prototype.slice;return function(){var e=d||arguments;!0===f?(e=b.call(arguments,0),e=e.concat(d)):"number"===typeof f&&(e=b.call(arguments,0),Ext.Array.insert(e,f,d));return a.apply(c||window,e)}};papaya.utilities.ObjectUtils.isString=function(c){return"string"===typeof c||c instanceof String};
|
|
1251
|
-
papaya.utilities.ObjectUtils.dereference=function(c){return papaya.utilities.ObjectUtils.dereferenceIn(window,c)};papaya.utilities.ObjectUtils.dereferenceIn=function(c,a){var d,f;if(!papaya.utilities.ObjectUtils.isString(a))return null;if(f=a.replace(/(^[' "]+|[" ']+$)/g,"").match(/(^[\w\$]+(\.[\w\$]+)*)/))for(f=f[1].split("."),d=c[f.shift()];d&&f.length;)d=d[f.shift()];return d||null};"use strict";papaya=papaya||{};papaya.utilities=papaya.utilities||{};
|
|
1252
|
-
papaya.utilities.PlatformUtils=papaya.utilities.PlatformUtils||{};var console=console||{};console.log=console.log||function(){};console.warn=console.warn||function(){};console.error=console.error||function(){};console.info=console.info||function(){};papaya.utilities.PlatformUtils.os=null;papaya.utilities.PlatformUtils.browser=bowser.name;papaya.utilities.PlatformUtils.browserVersion=bowser.version;papaya.utilities.PlatformUtils.ios=bowser.ios;papaya.utilities.PlatformUtils.mobile=bowser.mobile;
|
|
1253
|
-
papaya.utilities.PlatformUtils.lastScrollEventTimestamp=0;papaya.utilities.PlatformUtils.smallScreen=window.matchMedia&&window.matchMedia("only screen and (max-width: 760px)").matches;papaya.utilities.PlatformUtils.detectOs=function(){return-1!==navigator.appVersion.indexOf("Win")?"Windows":-1!==navigator.appVersion.indexOf("Mac")?"MacOS":-1!==navigator.appVersion.indexOf("X11")||-1!==navigator.appVersion.indexOf("Linux")?"Linux":"Unknown"};papaya.utilities.PlatformUtils.os=papaya.utilities.PlatformUtils.detectOs();
|
|
1254
|
-
papaya.utilities.PlatformUtils.checkForBrowserCompatibility=function(){if("Firefox"===papaya.utilities.PlatformUtils.browser){if(papaya.utilities.PlatformUtils.browserVersion<PAPAYA_BROWSER_MIN_FIREFOX)return"Papaya requires Firefox version "+PAPAYA_BROWSER_MIN_FIREFOX+" or higher."}else if("Chrome"===papaya.utilities.PlatformUtils.browser){if(papaya.utilities.PlatformUtils.browserVersion<PAPAYA_BROWSER_MIN_CHROME)return"Papaya requires Chrome version "+PAPAYA_BROWSER_MIN_CHROME+" or higher."}else if("Internet Explorer"===
|
|
1255
|
-
papaya.utilities.PlatformUtils.browser){if(papaya.utilities.PlatformUtils.browserVersion<PAPAYA_BROWSER_MIN_IE)return"Papaya requires Internet Explorer version "+PAPAYA_BROWSER_MIN_IE+" or higher."}else if("Safari"===papaya.utilities.PlatformUtils.browser){if(papaya.utilities.PlatformUtils.browserVersion<PAPAYA_BROWSER_MIN_SAFARI)return"Papaya requires Safari version "+PAPAYA_BROWSER_MIN_SAFARI+" or higher."}else if("Opera"===papaya.utilities.PlatformUtils.browser&&papaya.utilities.PlatformUtils.browserVersion<
|
|
1256
|
-
PAPAYA_BROWSER_MIN_OPERA)return"Papaya requires Opera version "+PAPAYA_BROWSER_MIN_OPERA+" or higher.";return null};papaya.utilities.PlatformUtils.isWebGLSupported=function(){var c,a,d;try{if(c=document.createElement("canvas"),a=c.getContext("webgl")||c.getContext("experimental-webgl"),d=a.getExtension("OES_element_index_uint"),!d)return!1}catch(f){return console.log("There was a problem detecting WebGL! "+f),!1}return!0};
|
|
1257
|
-
papaya.utilities.PlatformUtils.getMousePositionX=function(c){var a;c.originalEvent&&(c=c.originalEvent);if(c.targetTouches){if(1===c.targetTouches.length&&(a=c.targetTouches[0]))return a.pageX}else if(c.changedTouches&&1===c.changedTouches.length&&(a=c.changedTouches[0]))return a.pageX;return c.pageX};
|
|
1258
|
-
papaya.utilities.PlatformUtils.getMousePositionY=function(c){var a;if(c.targetTouches){if(1===c.targetTouches.length&&(a=c.targetTouches[0]))return a.pageY}else if(c.changedTouches&&1===c.changedTouches.length&&(a=c.changedTouches[0]))return a.pageY;return c.pageY};
|
|
1259
|
-
papaya.utilities.PlatformUtils.getScrollSign=function(c,a){var d,f;d=a?75:"Firefox"===papaya.utilities.PlatformUtils.browser?10:"Chrome"===papaya.utilities.PlatformUtils.browser?50:"Internet Explorer"===papaya.utilities.PlatformUtils.browser?0:"Safari"===papaya.utilities.PlatformUtils.browser?50:10;f=Date.now();return f-papaya.utilities.PlatformUtils.lastScrollEventTimestamp>d?(papaya.utilities.PlatformUtils.lastScrollEventTimestamp=f,f=papaya.utilities.PlatformUtils.normalizeWheel(c).spinY,d=0<-1*
|
|
1260
|
-
papaya.utilities.PlatformUtils.normalizeWheel(c).spinY?1:-1,d*=Math.ceil(Math.abs(f/10))):0};papaya.utilities.PlatformUtils.makeSlice=function(c,a,d){return"undefined"===typeof File?function(){}:File.prototype.slice?c.slice(a,a+d):File.prototype.mozSlice?c.mozSlice(a,d):File.prototype.webkitSlice?c.webkitSlice(a,d):null};papaya.utilities.PlatformUtils.isPlatformLittleEndian=function(){var c=new ArrayBuffer(2);(new DataView(c)).setInt16(0,256,!0);return 256===(new Int16Array(c))[0]};
|
|
1261
|
-
papaya.utilities.PlatformUtils.isInputRangeSupported=function(){var c=document.createElement("input");c.setAttribute("type","range");return"range"===c.type};
|
|
1262
|
-
papaya.utilities.PlatformUtils.launchCustomProtocol=function(c,a,d){var f,b,e=!1;if("Internet Explorer"===papaya.utilities.PlatformUtils.browser)b=window.open("","","width=0,height=0"),b.document.write("<iframe src='"+a+"'></iframe>"),setTimeout(function(){try{b.location.href,e=!0}catch(a){console.log(a)}e?b.setTimeout("window.close()",100):b.close();d(e)},100);else if("Firefox"===papaya.utilities.PlatformUtils.browser){try{f=$("<iframe />"),f.css({display:"none"}),f.appendTo("body"),f[0].contentWindow.location.href=
|
|
1263
|
-
a,e=!0}catch(g){e=!1}f.remove();d(e)}else"Chrome"===papaya.utilities.PlatformUtils.browser?(c.viewerHtml.css({outline:0}),c.viewerHtml.attr("tabindex","1"),c.viewerHtml.focus(),c.viewerHtml.blur(function(){e=!0;d(!0)}),location.href=a,setTimeout(function(){c.viewerHtml.off("blur");c.viewerHtml.removeAttr("tabindex");e||d(!1)},2E3)):((f=papaya.utilities.UrlUtils.readCookie(papaya.viewer.Preferences.COOKIE_PREFIX+PAPAYA_MANGO_INSTALLED))||papaya.mangoinstalled?e=!0:confirm("This feature requires that "+
|
|
1264
|
-
(papaya.utilities.PlatformUtils.ios?"iMango":"Mango")+" is installed. Continue?")&&(papaya.utilities.UrlUtils.createCookie(papaya.viewer.Preferences.COOKIE_PREFIX+PAPAYA_MANGO_INSTALLED,!0,papaya.viewer.Preferences.COOKIE_EXPIRY_DAYS),e=!0),e&&(location.href=a),d(e))};
|
|
1265
|
-
papaya.utilities.PlatformUtils.getSupportedScrollEvent=function(){return"Firefox"===papaya.utilities.PlatformUtils.browser?"DOMMouseScroll":"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll"};var PIXEL_STEP=10,LINE_HEIGHT=40,PAGE_HEIGHT=800;
|
|
1266
|
-
papaya.utilities.PlatformUtils.normalizeWheel=function(c){var a=0,d=0,f=0,b=0;"detail"in c&&(d=c.detail);"wheelDelta"in c&&(d=-c.wheelDelta/120);"wheelDeltaY"in c&&(d=-c.wheelDeltaY/120);"wheelDeltaX"in c&&(a=-c.wheelDeltaX/120);"axis"in c&&c.axis===c.HORIZONTAL_AXIS&&(a=d,d=0);f=a*PIXEL_STEP;b=d*PIXEL_STEP;"deltaY"in c&&(b=c.deltaY);"deltaX"in c&&(f=c.deltaX);(f||b)&&c.deltaMode&&(1==c.deltaMode?(f*=LINE_HEIGHT,b*=LINE_HEIGHT):(f*=PAGE_HEIGHT,b*=PAGE_HEIGHT));f&&!a&&(a=1>f?-1:1);b&&!d&&(d=1>b?-1:
|
|
1267
|
-
1);return{spinX:a,spinY:d,pixelX:f,pixelY:b}};"use strict";papaya=papaya||{};papaya.utilities=papaya.utilities||{};papaya.utilities.StringUtils=papaya.utilities.StringUtils||{};papaya.utilities.StringUtils.isStringBlank=function(c){return c&&"string"==(typeof c).toLowerCase()?0===c.trim().length:!0};papaya.utilities.StringUtils.formatNumber=function(c,a){var d=0,d=papaya.utilities.ObjectUtils.isString(c)?Number(c):c,d=a?d.toPrecision(5):d.toPrecision(7);return parseFloat(d)};
|
|
1268
|
-
papaya.utilities.StringUtils.getSizeString=function(c){var a=null;return a=1048576<c?papaya.utilities.StringUtils.formatNumber(c/1048576,!0)+" Mb":1024<c?papaya.utilities.StringUtils.formatNumber(c/1024,!0)+" Kb":c+" Bytes"};papaya.utilities.StringUtils.wordwrap=function(c,a,d,f){d=d||"\n";a=a||75;return c?c.match(new RegExp(".{1,"+a+"}(\\s|$)"+(f?"|.{"+a+"}|.+$":"|\\S+?(\\s|$)"),"g")).join(d):c};
|
|
1269
|
-
papaya.utilities.StringUtils.truncateMiddleString=function(c,a){if(c.length<=a)return c;var d=a-3,f=Math.ceil(d/2),d=Math.floor(d/2);return c.substr(0,f)+"..."+c.substr(c.length-d)};papaya.utilities.StringUtils.pad=function(c,a){return("000000000"+c).substr(-a)};"function"!==typeof String.prototype.startsWith&&(String.prototype.startsWith=function(c){return 0===this.indexOf(c)});
|
|
1270
|
-
"function"!==typeof String.prototype.endsWith&&(String.prototype.endsWith=function(c){return-1!==this.indexOf(c,this.length-c.length)});"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});"use strict";papaya=papaya||{};papaya.utilities=papaya.utilities||{};papaya.utilities.UrlUtils=papaya.utilities.UrlUtils||{};
|
|
1271
|
-
papaya.utilities.UrlUtils.createCookie=function(c,a,d){var f;d?(f=new Date,f.setTime(f.getTime()+864E5*d),d="; expires="+f.toGMTString()):d="";document.cookie=c+"="+a+d+"; path=/"};papaya.utilities.UrlUtils.readCookie=function(c){var a,d,f;c+="=";a=document.cookie.split(";");for(d=0;d<a.length;d+=1){for(f=a[d];" "===f.charAt(0);)f=f.substring(1,f.length);if(0===f.indexOf(c))return f.substring(c.length,f.length)}return null};
|
|
1272
|
-
papaya.utilities.UrlUtils.eraseCookie=function(c){papaya.utilities.UrlUtils.createCookie(c,"",-1)};papaya.utilities.UrlUtils.getQueryParams=function(c){var a,d,f=/[?&]?([^=]+)=([^&]*)/g;if(-1!==document.location.href.indexOf("?"))for(d=document.location.href.substring(document.location.href.indexOf("?")+1),d=d.split("+").join(" "),a=f.exec(d);a;)c[decodeURIComponent(a[1])]=decodeURIComponent(a[2]),a=f.exec(d)};
|
|
1273
|
-
papaya.utilities.UrlUtils.getAbsoluteUrl=function(c,a){var d,f;d=window.location.href;d=d.substring(0,d.lastIndexOf("/"));f=document.createElement("a");f.href=d+"/"+a;d=f.host;f=f.pathname;"/"!==f.charAt(0)&&(f="/"+f);return c+"://"+d+f};"use strict";papaya=papaya||{};papaya.core=papaya.core||{};papaya.core.Coordinate=papaya.core.Coordinate||function(c,a,d){this.x=c;this.y=a;this.z=d};
|
|
1274
|
-
papaya.core.Coordinate.prototype.setCoordinate=function(c,a,d,f){f?(this.x=Math.round(c),this.y=Math.round(a),this.z=Math.round(d)):(this.x=c,this.y=a,this.z=d)};papaya.core.Coordinate.prototype.toString=function(){return"("+this.x+","+this.y+","+this.z+")"};papaya.core.Coordinate.prototype.isAllZeros=function(){return 0===this.x&&0===this.y&&0===this.z};"use strict";papaya=papaya||{};papaya.core=papaya.core||{};papaya.core.Point=papaya.core.Point||function(c,a){this.x=c;this.y=a};"use strict";
|
|
1275
|
-
papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.Header=papaya.volume.Header||function(c){this.origin=this.error=this.imageRange=this.orientation=this.imageType=this.imageDescription=this.voxelDimensions=this.imageDimensions=this.fileFormat=null;this.pad=c;this.orientationCertainty=papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN;this.onFinishedFileFormatRead=null};papaya.volume.Header.HEADER_TYPE_UNKNOWN=0;papaya.volume.Header.HEADER_TYPE_NIFTI=1;
|
|
1276
|
-
papaya.volume.Header.HEADER_TYPE_DICOM=2;papaya.volume.Header.ERROR_UNRECOGNIZED_FORMAT="This format is not recognized!";papaya.volume.Header.INVALID_IMAGE_DIMENSIONS="Image dimensions are not valid!";papaya.volume.Header.INVALID_VOXEL_DIMENSIONS="Voxel dimensions are not valid!";papaya.volume.Header.INVALID_DATATYPE="Datatype is not valid or not supported!";papaya.volume.Header.INVALID_IMAGE_RANGE="Image range is not valid!";papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN=0;
|
|
1277
|
-
papaya.volume.Header.ORIENTATION_CERTAINTY_LOW=1;papaya.volume.Header.ORIENTATION_CERTAINTY_HIGH=2;papaya.volume.Header.prototype.findHeaderType=function(c,a){return papaya.volume.nifti.HeaderNIFTI.isThisFormat(c,a)?papaya.volume.Header.HEADER_TYPE_NIFTI:papaya.Container.DICOM_SUPPORT&&papaya.volume.dicom.HeaderDICOM.isThisFormat(c,a)?papaya.volume.Header.HEADER_TYPE_DICOM:papaya.volume.Header.HEADER_TYPE_UNKNOWN};
|
|
1278
|
-
papaya.volume.Header.prototype.readHeaderData=function(c,a,d,f,b){c=this.findHeaderType(c,a);this.onFinishedFileFormatRead=b;c===papaya.volume.Header.HEADER_TYPE_NIFTI?(this.fileFormat=new papaya.volume.nifti.HeaderNIFTI,this.fileFormat.readHeaderData(a,d,f,papaya.utilities.ObjectUtils.bind(this,this.onFinishedHeaderRead))):c===papaya.volume.Header.HEADER_TYPE_DICOM?(this.fileFormat=new papaya.volume.dicom.HeaderDICOM,this.fileFormat.readHeaderData(a,d,f,papaya.utilities.ObjectUtils.bind(this,this.onFinishedHeaderRead))):
|
|
1279
|
-
(this.error=Error(papaya.volume.Header.ERROR_UNRECOGNIZED_FORMAT),this.onFinishedFileFormatRead())};
|
|
1280
|
-
papaya.volume.Header.prototype.onFinishedHeaderRead=function(){this.fileFormat.hasError()?this.error=this.fileFormat.error:(this.imageType=this.fileFormat.getImageType(),this.imageType.isValid()||(this.error=Error(papaya.volume.Header.INVALID_DATATYPE)),this.imageDimensions=this.fileFormat.getImageDimensions(),this.imageDimensions.isValid()||(this.error=Error(papaya.volume.Header.INVALID_IMAGE_DIMENSIONS)),this.voxelDimensions=this.fileFormat.getVoxelDimensions(),this.voxelDimensions.isValid()||(this.error=
|
|
1281
|
-
Error(papaya.volume.Header.INVALID_VOXEL_DIMENSIONS)),this.pad&&this.imageDimensions.padIsometric(this.voxelDimensions),this.orientation=this.fileFormat.getOrientation(),this.orientation.isValid()?this.orientationCertainty=this.fileFormat.getOrientationCertainty():(this.orientation=new papaya.volume.Orientation(papaya.volume.Orientation.DEFAULT),this.orientationCertainty=papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN),this.orientation.createInfo(this.imageDimensions,this.voxelDimensions),this.origin=
|
|
1282
|
-
this.orientation.convertCoordinate(this.fileFormat.getOrigin(),new papaya.core.Coordinate(0,0,0)),this.imageRange=this.fileFormat.getImageRange(),this.imageRange.isValid()||(this.error=Error(papaya.volume.Header.INVALID_IMAGE_RANGE)),this.imageDescription=this.fileFormat.getImageDescription());this.onFinishedFileFormatRead()};papaya.volume.Header.prototype.getName=function(){return this.fileFormat.getName()};
|
|
1283
|
-
papaya.volume.Header.prototype.readImageData=function(c,a){this.fileFormat.readImageData(c,a)};papaya.volume.Header.prototype.hasError=function(){return null!==this.error};papaya.volume.Header.prototype.getBestTransform=function(){return this.fileFormat.getBestTransform()};papaya.volume.Header.prototype.getBestTransformOrigin=function(){return this.fileFormat.getBestTransformOrigin()};papaya.volume.Header.prototype.toString=function(){return this.fileFormat.toString()};"use strict";
|
|
1284
|
-
papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.ImageData=papaya.volume.ImageData||function(c){this.data=null;this.pad=c};
|
|
1285
|
-
papaya.volume.ImageData.prototype.readFileData=function(c,a,d){var f,b;this.pad&&(a=this.padIsometric(c,a));if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_RGB)if(f=a.byteLength/3,b=2*f,c=c.imageType.rgbBySample,a=new DataView(a,0),this.data=new Uint32Array(f),c){for(c=0;c<f;c+=1)this.data[c]|=a.getUint8(c)<<16;for(c=0;c<f;c+=1)this.data[c]|=a.getUint8(c+f)<<8;for(c=0;c<f;c+=1)this.data[c]|=a.getUint8(c+b)}else for(c=0;c<f;c+=1)this.data[c]=a.getUint8(3*c)<<16|a.getUint8(3*c+1)<<8|a.getUint8(3*
|
|
1286
|
-
c+2);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED&&1===c.imageType.numBytes)this.data=new Int8Array(a,0,a.byteLength);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED&&1===c.imageType.numBytes)this.data=new Uint8Array(a,0,a.byteLength);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED&&2===c.imageType.numBytes)this.data=new Int16Array(a,0,a.byteLength/2);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED&&
|
|
1287
|
-
2===c.imageType.numBytes)this.data=new Uint16Array(a,0,a.byteLength/2);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED&&4===c.imageType.numBytes)this.data=new Int32Array(a,0,a.byteLength/4);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED&&4===c.imageType.numBytes)this.data=new Uint32Array(a,0,a.byteLength/4);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_FLOAT&&4===c.imageType.numBytes)if(c.imageType.swapped)for(f=a.byteLength/
|
|
1288
|
-
Float32Array.BYTES_PER_ELEMENT,a=new DataView(a,0),this.data=new Float32Array(f),c=0;c<f;c+=1)this.data[c]=a.getFloat32(c*Float32Array.BYTES_PER_ELEMENT);else this.data=new Float32Array(a,0,a.byteLength/4);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_FLOAT&&8===c.imageType.numBytes)if(c.imageType.swapped)for(f=a.byteLength/Float64Array.BYTES_PER_ELEMENT,a=new DataView(a,0),this.data=new Float64Array(f),c=0;c<f;c+=1)this.data[c]=a.getFloat64(c*Float64Array.BYTES_PER_ELEMENT);else this.data=
|
|
1289
|
-
new Float64Array(a,0,a.byteLength/8);d()};
|
|
1290
|
-
papaya.volume.ImageData.prototype.padIsometric=function(c,a){for(var d=c.imageDimensions,f=c.voxelDimensions,b=c.imageType.numBytes,e=new Uint8Array(a,0,a.byteLength),g=d.colsOrig,h=d.rowsOrig,d=d.slicesOrig,m=g*f.colSize,k=h*f.rowSize,p=d*f.sliceSize,t=Math.max(Math.max(m,k),p),m=parseInt((t-m)/f.colSize/2,10),k=parseInt((t-k)/f.rowSize/2,10),t=parseInt((t-p)/f.sliceSize/2,10),w=g+2*m,B=h+2*k,g=g*b,m=m*b,k=k*w*b,A=t*w*B*b,p=f=0,b=new ArrayBuffer(w*B*(d+2*t)*b),t=new Uint8Array(b,0,b.byteLength),
|
|
1291
|
-
f=f+A,w=0;w<d;w+=1){f+=k;for(B=0;B<h;B+=1){f+=m;for(A=0;A<g;A+=1,p++,f++)t[f]=e[p];f+=m}f+=k}return b};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.ImageDescription=papaya.volume.ImageDescription||function(c){this.notes="(none)";papaya.utilities.StringUtils.isStringBlank(c)||(this.notes=c)};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
|
|
1292
|
-
papaya.volume.ImageDimensions=papaya.volume.ImageDimensions||function(c,a,d,f){this.cols=c;this.rows=a;this.slices=d;this.colsOrig=c;this.rowsOrig=a;this.slicesOrig=d;this.zDim=this.yDim=this.xDim=-1;this.timepoints=f||1;this.dataOffsets=[];this.dataLengths=[]};
|
|
1293
|
-
papaya.volume.ImageDimensions.prototype.padIsometric=function(c){var a=this.cols,d=this.rows,f=this.slices,b=a*c.colSize,e=d*c.rowSize,g=f*c.sliceSize,h=Math.max(Math.max(b,e),g),b=parseInt((h-b)/c.colSize/2,10),e=parseInt((h-e)/c.rowSize/2,10);c=parseInt((h-g)/c.sliceSize/2,10);this.cols=a+2*b;this.rows=d+2*e;this.slices=f+2*c};papaya.volume.ImageDimensions.prototype.getNumVoxelsSeries=function(){return this.cols*this.rows*this.slices*this.timepoints};
|
|
1294
|
-
papaya.volume.ImageDimensions.prototype.getNumVoxelsSlice=function(){return this.rows*this.cols};papaya.volume.ImageDimensions.prototype.getNumVoxelsVolume=function(){return this.rows*this.cols*this.slices};papaya.volume.ImageDimensions.prototype.isValid=function(){return 0<this.cols&&0<this.rows&&0<this.slices&&0<this.timepoints&&0<=this.dataOffsets[0]&&0<=this.dataLengths[0]};var moduleType=typeof module;"undefined"!==moduleType&&module.exports&&(module.exports.ImageDimensions=papaya.volume.ImageDimensions);
|
|
1295
|
-
"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.ImageRange=papaya.volume.ImageRange||function(c,a){this.displayMin=c;this.displayMax=a;this.imageMax=this.imageMin=0;this.dataScaleSlopes=[];this.dataScaleIntercepts=[];this.globalDataScaleSlope=1;this.globalDataScaleIntercept=0;this.usesGlobalDataScale=!1};papaya.volume.ImageRange.DEFAULT_SCALE=1;papaya.volume.ImageRange.DEFAULT_INTERCEPT=0;papaya.volume.ImageRange.prototype.isValid=function(){return!0};
|
|
1296
|
-
papaya.volume.ImageRange.prototype.setGlobalDataScale=function(c,a){this.globalDataScaleSlope=c;this.globalDataScaleIntercept=a;this.usesGlobalDataScale=!0;this.dataScaleSlopes=[];this.dataScaleIntercepts=[]};
|
|
1297
|
-
papaya.volume.ImageRange.prototype.validateDataScale=function(){var c,a,d=!1;if(1!==this.globalDataScaleSlope||0!==this.globalDataScaleIntercept)this.dataScaleSlopes=[],this.dataScaleIntercepts=[],this.usesGlobalDataScale=!0;else if(0<this.dataScaleSlopes.length&&0<this.dataScaleIntercepts.length){a=this.dataScaleSlopes[0];for(c=1;c<this.dataScaleSlopes.length;c+=1)if(a!==this.dataScaleSlopes[c]){d=!0;break}a=this.dataScaleIntercepts[0];for(c=1;c<this.dataScaleIntercepts.length;c+=1)if(a!==this.dataScaleIntercepts[c]){d=
|
|
1298
|
-
!0;break}d?this.usesGlobalDataScale=!1:this.setGlobalDataScale(this.dataScaleSlopes[0],this.dataScaleIntercepts[0])}else this.setGlobalDataScale(1,0)};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.ImageType=papaya.volume.ImageType||function(c,a,d,f){this.datatype=c;this.numBytes=a;this.littleEndian=d;this.swapped=!1;this.compressed=f;this.rgbBySample=!1};papaya.volume.ImageType.DATATYPE_UNKNOWN=0;papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED=1;
|
|
1299
|
-
papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED=2;papaya.volume.ImageType.DATATYPE_FLOAT=3;papaya.volume.ImageType.DATATYPE_RGB=4;papaya.volume.ImageType.MAX_SUPPORTED_BYTES_FLOAT=8;papaya.volume.ImageType.MAX_SUPPORTED_BYTES_INTEGER=4;
|
|
1300
|
-
papaya.volume.ImageType.prototype.isValid=function(){return this.datatype<=papaya.volume.ImageType.DATATYPE_RGB&&this.datatype>papaya.volume.ImageType.DATATYPE_UNKNOWN&&0<this.numBytes&&(this.datatype===papaya.volume.ImageType.DATATYPE_FLOAT&&this.numBytes<=papaya.volume.ImageType.MAX_SUPPORTED_BYTES_FLOAT||this.datatype!==papaya.volume.ImageType.DATATYPE_FLOAT&&this.numBytes<=papaya.volume.ImageType.MAX_SUPPORTED_BYTES_INTEGER)};
|
|
1301
|
-
papaya.volume.ImageType.prototype.getTypeDescription=function(){return this.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED?"Signed Integer":this.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED?"Unsigned Integer":this.datatype===papaya.volume.ImageType.DATATYPE_FLOAT?"Float":this.datatype===papaya.volume.ImageType.DATATYPE_RGB?"RGB":"Unknown"};
|
|
1302
|
-
papaya.volume.ImageType.prototype.getOrderDescription=function(){return 1<this.numBytes?this.littleEndian?"Little Endian":"Big Endian":null};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.nifti=papaya.volume.nifti||{};papaya.volume.nifti.HeaderNIFTI=papaya.volume.nifti.HeaderNIFTI||function(){this.nifti=null;this.compressed=this.isNIFTI2=!1;this.imageData=null};papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT="XYZ-++";
|
|
1303
|
-
papaya.volume.nifti.HeaderNIFTI.SPATIAL_UNITS_MASK=7;papaya.volume.nifti.HeaderNIFTI.TEMPORAL_UNITS_MASK=56;papaya.volume.nifti.HeaderNIFTI.isThisFormat=function(c,a){return-1!==c.indexOf(".nii")?!0:nifti.isNIFTI(a[0])};papaya.volume.nifti.HeaderNIFTI.prototype.readHeaderData=function(c,a,d,f){this.nifti=nifti.readHeader(c[0]);this.isNIFTI2=nifti.isNIFTI2(c[0]);this.imageData=nifti.readImage(this.nifti,c[0]);f()};
|
|
1304
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.readImageData=function(c,a){a(this.imageData);this.imageData=null};papaya.volume.nifti.HeaderNIFTI.prototype.getImageDimensions=function(){var c=new papaya.volume.ImageDimensions(this.nifti.dims[1],this.nifti.dims[2],this.nifti.dims[3],this.nifti.dims[4]);c.dataOffsets[0]=this.nifti.vox_offset;c.dataLengths[0]=c.getNumVoxelsSeries()*(this.nifti.numBitsPerVoxel/8);return c};papaya.volume.nifti.HeaderNIFTI.prototype.getName=function(){return null};
|
|
1305
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getVoxelDimensions=function(){var c;c=new papaya.volume.VoxelDimensions(this.nifti.pixDims[1],this.nifti.pixDims[2],this.nifti.pixDims[3],this.nifti.pixDims[4]);c.spatialUnit=this.nifti.xyzt_units&papaya.volume.nifti.HeaderNIFTI.SPATIAL_UNITS_MASK;c.temporalUnit=this.nifti.xyzt_units&papaya.volume.nifti.HeaderNIFTI.TEMPORAL_UNITS_MASK;c.flip=-1===this.nifti.pixDims[0];return c};
|
|
1306
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getImageType=function(){var c=papaya.volume.ImageType.DATATYPE_UNKNOWN;this.nifti.datatypeCode===nifti.NIFTI1.TYPE_UINT8||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_UINT16||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_UINT32||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_UINT64?c=papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED:this.nifti.datatypeCode===nifti.NIFTI1.TYPE_INT8||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_INT16||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_INT32||
|
|
1307
|
-
this.nifti.datatypeCode===nifti.NIFTI1.TYPE_INT64?c=papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED:this.nifti.datatypeCode===nifti.NIFTI1.TYPE_FLOAT32||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_FLOAT64?c=papaya.volume.ImageType.DATATYPE_FLOAT:this.nifti.datatypeCode===nifti.NIFTI1.TYPE_RGB24&&(c=papaya.volume.ImageType.DATATYPE_RGB);return new papaya.volume.ImageType(c,this.nifti.numBitsPerVoxel/8,this.nifti.littleEndian,this.compressed)};
|
|
1308
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getOrientation=function(){var c=null;0<this.nifti.qform_code&&!this.qFormHasRotations()&&(c=this.getOrientationQform());this.nifti.sform_code>this.nifti.qform_code&&!this.sFormHasRotations()&&(c=this.getOrientationSform());null===c&&(c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT);return new papaya.volume.Orientation(c)};
|
|
1309
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getOrientationQform=function(){var c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT,c=this.nifti.convertNiftiQFormToNiftiSForm(this.nifti.quatern_b,this.nifti.quatern_c,this.nifti.quatern_d,this.nifti.qoffset_x,this.nifti.qoffset_y,this.nifti.qoffset_z,this.nifti.pixDims[1],this.nifti.pixDims[2],this.nifti.pixDims[3],this.nifti.pixDims[0]);0<this.nifti.qform_code?(c=this.nifti.convertNiftiSFormToNEMA(c),papaya.volume.Orientation.isValidOrientationString(c)||
|
|
1310
|
-
(c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT)):c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT;return c};papaya.volume.nifti.HeaderNIFTI.prototype.getOrientationSform=function(){var c=this.nifti.convertNiftiSFormToNEMA(this.nifti.affine);papaya.volume.Orientation.isValidOrientationString(c)||(c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT);return c};papaya.volume.nifti.HeaderNIFTI.prototype.getQformMatCopy=function(){return this.nifti.getQformMat().clone()};
|
|
1311
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getSformMatCopy=function(){return this.nifti.affine.clone()};
|
|
1312
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getOrigin=function(c,a){var d=new papaya.core.Coordinate(0,0,0),f,b,e,g,h,m,k;0<this.nifti.qform_code&&!a?this.qFormHasRotations()?(f=this.nifti.getQformMat(),f=numeric.inv(f),d.setCoordinate(f[0][3],f[1][3],f[2][3])):(f=this.nifti.convertNiftiQFormToNiftiSForm(this.nifti.quatern_b,this.nifti.quatern_c,this.nifti.quatern_d,this.nifti.qoffset_x,this.nifti.qoffset_y,this.nifti.qoffset_z,this.nifti.pixDims[1],this.nifti.pixDims[2],this.nifti.pixDims[3],this.nifti.pixDims[0]),
|
|
1313
|
-
f=this.nifti.convertNiftiSFormToNEMA(f),papaya.volume.Orientation.isValidOrientationString(f)||(f=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT),e=f.substring(0,3).toUpperCase(),b=f.substring(3),f=e.indexOf("X"),g=e.indexOf("Y"),e=e.indexOf("Z"),h="+"===b.charAt(f),m="+"===b.charAt(g),k="+"===b.charAt(e),b=Array(3),b[0]=this.nifti.qoffset_x/this.nifti.pixDims[f+1]*(h?-1:1),b[1]=this.nifti.qoffset_y/this.nifti.pixDims[g+1]*(m?-1:1),b[2]=this.nifti.qoffset_z/this.nifti.pixDims[e+1]*(k?-1:1),d.setCoordinate(b[0],
|
|
1314
|
-
b[1],b[2],!0)):0<this.nifti.sform_code&&!c&&(this.sFormHasRotations()?(f=numeric.inv(this.nifti.affine),d.setCoordinate(f[0][3],f[1][3],f[2][3])):(f=this.nifti.convertNiftiSFormToNEMA(this.nifti.affine),papaya.volume.Orientation.isValidOrientationString(f)||(f=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT),e=f.substring(0,3).toUpperCase(),b=f.substring(3),f=e.indexOf("X"),g=e.indexOf("Y"),e=e.indexOf("Z"),h="+"===b.charAt(f),m="+"===b.charAt(g),k="+"===b.charAt(e),b=Array(3),b[0]=this.nifti.affine[0][3]/
|
|
1315
|
-
this.nifti.pixDims[f+1]*(h?-1:1),b[1]=this.nifti.affine[1][3]/this.nifti.pixDims[g+1]*(m?-1:1),b[2]=this.nifti.affine[2][3]/this.nifti.pixDims[e+1]*(k?-1:1),d.setCoordinate(b[0],b[1],b[2],!0)));d.isAllZeros()&&d.setCoordinate(this.nifti.dims[1]/2,this.nifti.dims[2]/2,this.nifti.dims[3]/2);return d};papaya.volume.nifti.HeaderNIFTI.prototype.qFormHasRotations=function(){return papaya.volume.Transform.hasRotations(this.getQformMatCopy())};papaya.volume.nifti.HeaderNIFTI.prototype.sFormHasRotations=function(){return papaya.volume.Transform.hasRotations(this.getSformMatCopy())};
|
|
1316
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getImageRange=function(){var c=new papaya.volume.ImageRange(this.nifti.cal_min,this.nifti.cal_max),a=this.nifti.scl_slope,d=this.getImageDimensions();0===a&&(a=1);c.setGlobalDataScale(a,this.nifti.scl_inter,d.slices*d.timepoints);c.validateDataScale();return c};papaya.volume.nifti.HeaderNIFTI.prototype.hasError=function(){return!1};papaya.volume.nifti.HeaderNIFTI.prototype.getImageDescription=function(){return new papaya.volume.ImageDescription(this.nifti.description)};
|
|
1317
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getOrientationCertainty=function(){var c,a;c=papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN;if(0<this.nifti.qform_code||0<this.nifti.sform_code)c=papaya.volume.Header.ORIENTATION_CERTAINTY_LOW,a=this.getOrigin(),null===a||a.isAllZeros()||(c=papaya.volume.Header.ORIENTATION_CERTAINTY_HIGH);return c};
|
|
1318
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getBestTransform=function(){return 0<this.nifti.qform_code&&this.nifti.qform_code>this.nifti.sform_code&&this.qFormHasRotations()?this.getQformMatCopy():0<this.nifti.sform_code&&this.nifti.sform_code>=this.nifti.qform_code&&this.sFormHasRotations()?this.getSformMatCopy():null};
|
|
1319
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.getBestTransformOrigin=function(){return 0<this.nifti.qform_code&&this.nifti.qform_code>this.nifti.sform_code&&this.qFormHasRotations()?this.getOrigin(!0,!1):0<this.nifti.sform_code&&this.nifti.sform_code>=this.nifti.qform_code&&this.sFormHasRotations()?this.getOrigin(!1,!0):null};
|
|
1320
|
-
papaya.volume.nifti.HeaderNIFTI.prototype.toString=function(){var c=papaya.utilities.StringUtils.formatNumber,a="";this.isNIFTI2?(a+="<span style='color:#B5CBD3'>Datatype</span><span style='color:gray'> = </span>"+this.nifti.datatypeCode+" ("+this.nifti.getDatatypeCodeString(this.nifti.datatypeCode)+")<br />",a+="<span style='color:#B5CBD3'>Bits Per Voxel</span><span style='color:gray'> = </span>"+this.nifti.numBitsPerVoxel+"<br />",a+="<span style='color:#B5CBD3'>Image Dimensions</span> (1-8): "+
|
|
1321
|
-
this.nifti.dims[0]+", "+this.nifti.dims[1]+", "+this.nifti.dims[2]+", "+this.nifti.dims[3]+", "+this.nifti.dims[4]+", "+this.nifti.dims[5]+", "+this.nifti.dims[6]+", "+this.nifti.dims[7]+"<br />",a+="<span style='color:#B5CBD3'>Intent Parameters</span> (1-3): "+this.nifti.intent_p1+", "+this.nifti.intent_p2+", "+this.nifti.intent_p3+"<br />",a+="<span style='color:#B5CBD3'>Voxel Dimensions</span> (1-8): "+c(this.nifti.pixDims[0])+", "+c(this.nifti.pixDims[1])+", "+c(this.nifti.pixDims[2])+", "+c(this.nifti.pixDims[3])+
|
|
1322
|
-
", "+c(this.nifti.pixDims[4])+", "+c(this.nifti.pixDims[5])+", "+c(this.nifti.pixDims[6])+", "+c(this.nifti.pixDims[7])+"<br />",a+="<span style='color:#B5CBD3'>Image Offset</span><span style='color:gray'> = </span>"+this.nifti.vox_offset+"<br />",a+="<span style='color:#B5CBD3'>Data Scale: Slope</span><span style='color:gray'> = </span>"+this.nifti.scl_slope+" <span style='color:#B5CBD3'>Intercept</span><span style='color:gray'> = </span>"+this.nifti.scl_inter+"<br />",a+="<span style='color:#B5CBD3'>Display Range: Max</span><span style='color:gray'> = </span>"+
|
|
1323
|
-
this.nifti.cal_max+" <span style='color:#B5CBD3'>Min</span><span style='color:gray'> = </span>"+this.nifti.cal_min+"<br />",a+="<span style='color:#B5CBD3'>Slice Duration</span><span style='color:gray'> = </span>"+this.nifti.slice_duration+"<br />",a+="<span style='color:#B5CBD3'>Time Axis Shift</span><span style='color:gray'> = </span>"+this.nifti.toffset+"<br />",a+="<span style='color:#B5CBD3'>Slice Start</span><span style='color:gray'> = </span>"+this.nifti.slice_start+"<br />",a+="<span style='color:#B5CBD3'>Slice End</span><span style='color:gray'> = </span>"+
|
|
1324
|
-
this.nifti.slice_end+"<br />",a+="<span style='color:#B5CBD3'>Description</span>: \""+this.nifti.description+'"<br />',a+="<span style='color:#B5CBD3'>Auxiliary File</span>: \""+this.nifti.aux_file+'"<br />',a+="<span style='color:#B5CBD3'>Q-Form Code</span><span style='color:gray'> = </span>"+this.nifti.qform_code+" ("+this.nifti.getTransformCodeString(this.nifti.qform_code)+")<br />",a+="<span style='color:#B5CBD3'>S-Form Code</span><span style='color:gray'> = </span>"+this.nifti.sform_code+" ("+
|
|
1325
|
-
this.nifti.getTransformCodeString(this.nifti.sform_code)+")<br />",a+="<span style='color:#B5CBD3'>Quaternion Parameters</span>: <span style='color:#B5CBD3'>b</span> <span style='color:gray'>=</span> "+c(this.nifti.quatern_b)+" <span style='color:#B5CBD3'>c</span> <span style='color:gray'>=</span> "+c(this.nifti.quatern_c)+" <span style='color:#B5CBD3'>d</span> <span style='color:gray'>=</span> "+c(this.nifti.quatern_d)+"<br />",a+="<span style='color:#B5CBD3'>Quaternion Offsets</span>: <span style='color:#B5CBD3'>x</span> <span style='color:gray'>=</span> "+
|
|
1326
|
-
this.nifti.qoffset_x+" <span style='color:#B5CBD3'>y</span> <span style='color:gray'>=</span> "+this.nifti.qoffset_y+" <span style='color:#B5CBD3'>z</span> <span style='color:gray'>=</span> "+this.nifti.qoffset_z+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters X</span>: "+c(this.nifti.affine[0][0])+", "+c(this.nifti.affine[0][1])+", "+c(this.nifti.affine[0][2])+", "+c(this.nifti.affine[0][3])+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters Y</span>: "+c(this.nifti.affine[1][0])+
|
|
1327
|
-
", "+c(this.nifti.affine[1][1])+", "+c(this.nifti.affine[1][2])+", "+c(this.nifti.affine[1][3])+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters Z</span>: "+c(this.nifti.affine[2][0])+", "+c(this.nifti.affine[2][1])+", "+c(this.nifti.affine[2][2])+", "+c(this.nifti.affine[2][3])+"<br />",a+="<span style='color:#B5CBD3'>Slice Code</span><span style='color:gray'> = </span>"+this.nifti.slice_code+"<br />",a+="<span style='color:#B5CBD3'>Units Code</span><span style='color:gray'> = </span>"+
|
|
1328
|
-
this.nifti.xyzt_units+" ("+this.nifti.getUnitsCodeString(nifti.NIFTI1.SPATIAL_UNITS_MASK&this.nifti.xyzt_units)+", "+this.nifti.getUnitsCodeString(nifti.NIFTI1.TEMPORAL_UNITS_MASK&this.nifti.xyzt_units)+")<br />",a+="<span style='color:#B5CBD3'>Intent Code </span><span style='color:gray'> = </span>"+this.nifti.intent_code+"<br />",a+="<span style='color:#B5CBD3'>Intent Name</span>: \""+this.nifti.intent_name+'"<br />',a+="<span style='color:#B5CBD3'>Dim Info </span><span style='color:gray'> = </span>"+
|
|
1329
|
-
this.nifti.dim_info+"<br />"):(a+="<span style='color:#B5CBD3'>Dim Info</span><span style='color:gray'> = </span>"+this.nifti.dim_info+"<br />",a+="<span style='color:#B5CBD3'>Image Dimensions</span> (1-8): "+this.nifti.dims[0]+", "+this.nifti.dims[1]+", "+this.nifti.dims[2]+", "+this.nifti.dims[3]+", "+this.nifti.dims[4]+", "+this.nifti.dims[5]+", "+this.nifti.dims[6]+", "+this.nifti.dims[7]+"<br />",a+="<span style='color:#B5CBD3'>Intent Parameters</span> (1-3): "+this.nifti.intent_p1+", "+this.nifti.intent_p2+
|
|
1330
|
-
", "+this.nifti.intent_p3+"<br />",a+="<span style='color:#B5CBD3'>Intent Code</span><span style='color:gray'> = </span>"+this.nifti.intent_code+"<br />",a+="<span style='color:#B5CBD3'>Datatype</span><span style='color:gray'> = </span>"+this.nifti.datatypeCode+" ("+this.nifti.getDatatypeCodeString(this.nifti.datatypeCode)+")<br />",a+="<span style='color:#B5CBD3'>Bits Per Voxel</span><span style='color:gray'> = </span>"+this.nifti.numBitsPerVoxel+"<br />",a+="<span style='color:#B5CBD3'>Slice Start</span><span style='color:gray'> = </span>"+
|
|
1331
|
-
this.nifti.slice_start+"<br />",a+="<span style='color:#B5CBD3'>Voxel Dimensions</span> (1-8): "+c(this.nifti.pixDims[0])+", "+c(this.nifti.pixDims[1])+", "+c(this.nifti.pixDims[2])+", "+c(this.nifti.pixDims[3])+", "+c(this.nifti.pixDims[4])+", "+c(this.nifti.pixDims[5])+", "+c(this.nifti.pixDims[6])+", "+c(this.nifti.pixDims[7])+"<br />",a+="<span style='color:#B5CBD3'>Image Offset</span><span style='color:gray'> = </span>"+this.nifti.vox_offset+"<br />",a+="<span style='color:#B5CBD3'>Data Scale</span>: <span style='color:#B5CBD3'>Slope</span> = "+
|
|
1332
|
-
this.nifti.scl_slope+" <span style='color:#B5CBD3'>Intercept</span> = "+this.nifti.scl_inter+"<br />",a+="<span style='color:#B5CBD3'>Slice End</span><span style='color:gray'> = </span>"+this.nifti.slice_end+"<br />",a+="<span style='color:#B5CBD3'>Slice Code</span><span style='color:gray'> = </span>"+this.nifti.slice_code+"<br />",a+="<span style='color:#B5CBD3'>Units Code</span><span style='color:gray'> = </span>"+this.nifti.xyzt_units+" ("+this.nifti.getUnitsCodeString(nifti.NIFTI1.SPATIAL_UNITS_MASK&
|
|
1333
|
-
this.nifti.xyzt_units)+", "+this.nifti.getUnitsCodeString(nifti.NIFTI1.TEMPORAL_UNITS_MASK&this.nifti.xyzt_units)+")<br />",a+="<span style='color:#B5CBD3'>Display Range</span>: <span style='color:#B5CBD3'>Max</span><span style='color:gray'> = </span>"+this.nifti.cal_max+" <span style='color:#B5CBD3'>Min</span><span style='color:gray'> = </span>"+this.nifti.cal_min+"<br />",a+="<span style='color:#B5CBD3'>Slice Duration</span><span style='color:gray'> = </span>"+this.nifti.slice_duration+"<br />",
|
|
1334
|
-
a+="<span style='color:#B5CBD3'>Time Axis Shift</span><span style='color:gray'> = </span>"+this.nifti.toffset+"<br />",a+="<span style='color:#B5CBD3'>Description</span>: \""+this.nifti.description+'"<br />',a+="<span style='color:#B5CBD3'>Auxiliary File</span>: \""+this.nifti.aux_file+'"<br />',a+="<span style='color:#B5CBD3'>Q-Form Code</span><span style='color:gray'> = </span>"+this.nifti.qform_code+" ("+this.nifti.getTransformCodeString(this.nifti.qform_code)+")<br />",a+="<span style='color:#B5CBD3'>S-Form Code</span><span style='color:gray'> = </span>"+
|
|
1335
|
-
this.nifti.sform_code+" ("+this.nifti.getTransformCodeString(this.nifti.sform_code)+")<br />",a+="<span style='color:#B5CBD3'>Quaternion Parameters</span>: <span style='color:#B5CBD3'>b</span><span style='color:gray'> = </span>"+c(this.nifti.quatern_b)+" <span style='color:#B5CBD3'>c</span><span style='color:gray'> = </span>"+c(this.nifti.quatern_c)+" <span style='color:#B5CBD3'>d</span><span style='color:gray'> = </span>"+c(this.nifti.quatern_d)+"<br />",a+="<span style='color:#B5CBD3'>Quaternion Offsets</span>: <span style='color:#B5CBD3'>x</span><span style='color:gray'> = </span>"+
|
|
1336
|
-
this.nifti.qoffset_x+" <span style='color:#B5CBD3'>y</span><span style='color:gray'> = </span>"+this.nifti.qoffset_y+" <span style='color:#B5CBD3'>z</span><span style='color:gray'> = </span>"+this.nifti.qoffset_z+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters X</span>: "+c(this.nifti.affine[0][0])+", "+c(this.nifti.affine[0][1])+", "+c(this.nifti.affine[0][2])+", "+c(this.nifti.affine[0][3])+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters Y</span>: "+c(this.nifti.affine[1][0])+
|
|
1337
|
-
", "+c(this.nifti.affine[1][1])+", "+c(this.nifti.affine[1][2])+", "+c(this.nifti.affine[1][3])+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters Z</span>: "+c(this.nifti.affine[2][0])+", "+c(this.nifti.affine[2][1])+", "+c(this.nifti.affine[2][2])+", "+c(this.nifti.affine[2][3])+"<br />",a+="<span style='color:#B5CBD3'>Intent Name</span>: \""+this.nifti.intent_name+'"<br />');return a};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
|
|
1338
|
-
papaya.volume.dicom=papaya.volume.dicom||{};papaya.volume.dicom.HeaderDICOM=papaya.volume.dicom.HeaderDICOM||function(){this.series=null;this.seriesMap=[];this.dialogHandler=this.onFinishedHeaderRead=this.error=null};papaya.volume.dicom.HeaderDICOM.ORIENTATION_DEFAULT="XYZ+--";papaya.volume.dicom.HeaderDICOM.SUPPORTED_TRANSFER_SYNTAXES="1.2.840.10008.1.2 1.2.840.10008.1.2.1 1.2.840.10008.1.2.2 1.2.840.10008.1.2.1.99 1.2.840.10008.1.2.4.50 1.2.840.10008.1.2.4.51 1.2.840.10008.1.2.4.57 1.2.840.10008.1.2.4.70 1.2.840.10008.1.2.4.90 1.2.840.10008.1.2.4.91 1.2.840.10008.1.2.5".split(" ");
|
|
1339
|
-
papaya.volume.dicom.HeaderDICOM.isThisFormat=function(c,a){var d,f,b,e,g=0;if(-1!==c.indexOf(".dcm"))return!0;d=new DataView(a[0]);f=daikon.Parser.MAGIC_COOKIE_OFFSET;b=daikon.Parser.MAGIC_COOKIE.length;for(e=0;e<b;e+=1)d.getUint8(f+e)===daikon.Parser.MAGIC_COOKIE[e]&&(g+=1);if(4===g)return!0;f=new daikon.Parser;d=f.testForValidTag(d);return null!==d&&8>=d.group&&!f.hasError()};
|
|
1340
|
-
papaya.volume.dicom.HeaderDICOM.prototype.setSeries=function(c,a){var d;for(d=0;d<Object.keys(this.seriesMap).length;d+=1)if(-1!==Object.keys(this.seriesMap)[d].indexOf(a)){this.series=this.seriesMap[Object.keys(this.seriesMap)[d]];break}};papaya.volume.dicom.HeaderDICOM.prototype.getDataScaleSlope=function(c,a){return c?a.getDataScaleElscint()||1:a.getDataScaleSlope()||1};papaya.volume.dicom.HeaderDICOM.prototype.getDataScaleIntercept=function(c,a){return c?0:a.getDataScaleIntercept()||0};
|
|
1341
|
-
papaya.volume.dicom.HeaderDICOM.prototype.finishedHeaderRead=function(){var c,a;if(this.error)this.onFinishedHeaderRead();else if(1<Object.keys(this.seriesMap).length){this.series=this.seriesMap[Object.keys(this.seriesMap)[0]];c=[];for(a=0;a<Object.keys(this.seriesMap).length;a+=1)c.push(this.seriesMap[Object.keys(this.seriesMap)[a]]);c={items:[{label:"Select:",field:"series",options:c}]};this.dialogHandler.showDialog("Select DICOM Series",c,this,papaya.utilities.ObjectUtils.bind(this,this.setSeries),
|
|
1342
|
-
papaya.utilities.ObjectUtils.bind(this,this.finishedSeriesSelection))}else this.series=this.seriesMap[Object.keys(this.seriesMap)[0]],0<this.series.images.length?(this.series.buildSeries(),this.isTransferSyntaxSupported()||(this.error=Error("This transfer syntax is currently not supported!"))):this.error=Error("No images found!"),this.onFinishedHeaderRead()};
|
|
1343
|
-
papaya.volume.dicom.HeaderDICOM.prototype.isTransferSyntaxSupported=function(){var c=this.series.images[0].getTransferSyntax();return papaya.utilities.StringUtils.isStringBlank(c)||papaya.utilities.ArrayUtils.contains(papaya.volume.dicom.HeaderDICOM.SUPPORTED_TRANSFER_SYNTAXES,c)};
|
|
1344
|
-
papaya.volume.dicom.HeaderDICOM.prototype.finishedSeriesSelection=function(){0<this.series.images.length?(this.series.buildSeries(),this.isTransferSyntaxSupported()||(this.error=Error("This transfer syntax is currently not supported!"))):this.error=Error("No images found!");this.seriesMap=null;this.onFinishedHeaderRead()};
|
|
1345
|
-
papaya.volume.dicom.HeaderDICOM.prototype.readHeaderData=function(c,a,d,f){this.onFinishedHeaderRead=f;this.dialogHandler=d;this.readNextHeaderData(c,0,a,papaya.utilities.ObjectUtils.bind(this,this.finishedHeaderRead))};
|
|
1346
|
-
papaya.volume.dicom.HeaderDICOM.prototype.readNextHeaderData=function(c,a,d,f){var b,e;a>=c.length?(d.drawProgress(1,"Reading DICOM Headers"),f()):(b=daikon.Series.parseImage(new DataView(c[a])),null===b?this.error=daikon.Series.parserError:b.hasPixelData()?(e=this.findSeries(b.getSeriesId()),e||(e=new daikon.Series,this.seriesMap[b.getSeriesId()]=e),e.addImage(b)):this.error=Error("No pixel data found!"),this.error?f():(d.drawProgress(a/c.length,"Reading DICOM Headers"),setTimeout(function(){this.readNextHeaderData(c,
|
|
1347
|
-
a+1,d,f)}.bind(this),0)))};papaya.volume.dicom.HeaderDICOM.prototype.getName=function(){var c=this.series.getName();return c?c:null};papaya.volume.dicom.HeaderDICOM.prototype.findSeries=function(c){return 0===Object.keys(this.seriesMap).length?null:this.seriesMap[c]};papaya.volume.dicom.HeaderDICOM.prototype.readImageData=function(c,a){this.series.concatenateImageData(c,a)};
|
|
1348
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getImageDimensions=function(){var c,a,d;this.series.isMosaic?(c=this.series.images[0].getMosaicCols()*this.series.images[0].getMosaicRows(),c=new papaya.volume.ImageDimensions(parseInt(this.series.images[0].getCols()/this.series.images[0].getMosaicCols()),parseInt(this.series.images[0].getRows()/this.series.images[0].getMosaicRows()),c,this.series.images.length)):c=this.series.isMultiFrameVolume?new papaya.volume.ImageDimensions(this.series.images[0].getCols(),
|
|
1349
|
-
this.series.images[0].getRows(),this.series.numberOfFrames,1):this.series.isMultiFrameTimeseries?new papaya.volume.ImageDimensions(this.series.images[0].getCols(),this.series.images[0].getRows(),this.series.numberOfFramesInFile,this.series.numberOfFrames):this.series.isImplicitTimeseries?new papaya.volume.ImageDimensions(this.series.images[0].getCols(),this.series.images[0].getRows(),parseInt(this.series.images.length/this.series.numberOfFrames),this.series.numberOfFrames):new papaya.volume.ImageDimensions(this.series.images[0].getCols(),
|
|
1350
|
-
this.series.images[0].getRows(),this.series.images.length,1);d=parseInt(c.getNumVoxelsSeries()*parseInt(this.series.images[0].getBitsAllocated()/8)/this.series.images.length);for(a=0;a<this.series.images.length;a+=1)c.dataOffsets[a]=this.series.images[a].getPixelData().offsetValue,c.dataLengths[a]=d;return c};
|
|
1351
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getVoxelDimensions=function(){var c,a;c=this.series.images[0].getPixelSpacing()||[0,0];a=Math.max(this.series.images[0].getSliceGap(),this.series.images[0].getSliceThickness());this.series.isMosaic||this.series.isMultiFrame||1===this.series.images.length||(a=Math.abs(this.series.images[0].getSliceLocation()-this.series.images[1].getSliceLocation()),0===a&&(a=Math.max(this.series.images[0].getSliceGap(),this.series.images[0].getSliceThickness())));c=new papaya.volume.VoxelDimensions(c[1],
|
|
1352
|
-
c[0],a,this.series.images[0].getTR()/1E3);c.isValid()||(0===c.rowSize&&(c.rowSize=1),0===c.colSize&&(c.colSize=1),0===c.sliceSize&&(c.sliceSize=1));c.spatialUnit=papaya.volume.VoxelDimensions.UNITS_MM;c.temporalUnit=papaya.volume.VoxelDimensions.UNITS_SEC;return c};
|
|
1353
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getImageType=function(){var c;c=this.series.images[0].getDataType();c=new papaya.volume.ImageType(c===daikon.Image.BYTE_TYPE_INTEGER?papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED:c===daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED?papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED:c===daikon.Image.BYTE_TYPE_FLOAT?papaya.volume.ImageType.DATATYPE_FLOAT:c===daikon.Image.BYTE_TYPE_RGB?papaya.volume.ImageType.DATATYPE_RGB:papaya.volume.ImageType.DATATYPE_UNKNOWN,parseInt(this.series.images[0].getBitsAllocated()/
|
|
1354
|
-
8),this.series.images[0].littleEndian,!1);c.rgbBySample=1===this.series.images[0].getPlanarConfig();return c};
|
|
1355
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getImageRange=function(){var c,a,d,f,b,e,g,h,m,k=[],p=[];h=[];m=[];for(b=a=c=0;b<this.series.images.length;b+=1)d=this.series.images[b],f=d.getImageMax()*this.getDataScaleSlope(this.series.isElscint,d)+(d.getDataScaleIntercept()||0),d=d.getImageMin()*this.getDataScaleSlope(this.series.isElscint,d)+(d.getDataScaleIntercept()||0),0===b?(c=f,a=d):(f>c&&(c=f),d<a&&(a=d));e=f=0;if(this.series.isElscint)for(b=0;b<this.series.images.length;b+=1)d=this.series.images[b],
|
|
1356
|
-
g=d.getWindowWidth()*d.getDataScaleElscint(),d=d.getWindowCenter()*d.getDataScaleElscint(),0===b?(f=g,e=d):e<d&&(f=g,e=d);else for(b=0;b<this.series.images.length;b+=1)d=this.series.images[b],g=d.getWindowWidth(),d=d.getWindowCenter(),0===b?(f=g,e=d):e<d&&(f=g,e=d);c=new papaya.volume.ImageRange(a,c);c.displayMin=e-f/2;c.displayMax=e+f/2;b=this.getImageDimensions();if(this.series.isMosaic){h=b.slices;m=h*this.series.images.length;for(b=0;b<m;b+=1)d=this.series.images[parseInt(b/h)],k[b]=this.getDataScaleSlope(this.series.isElscint,
|
|
1357
|
-
d),p[b]=this.getDataScaleIntercept(this.series.isElscint,d);c.dataScaleSlopes=k;c.dataScaleIntercepts=p}else if(this.series.isMultiFrame){b=b.slices*b.timepoints;k=[];p=[];m=parseInt(b/this.series.images.length);for(b=0;b<this.series.images.length;b+=1)for(h=0;h<m;h+=1)d=this.series.images[b],k[b*m+h]=this.getDataScaleSlope(this.series.isElscint,d),p[b*m+h]=this.getDataScaleIntercept(this.series.isElscint,d);c.dataScaleSlopes=k;c.dataScaleIntercepts=p}else if(this.series.isImplicitTimeseries)if(b=
|
|
1358
|
-
b.slices*b.timepoints,this.series.images.length!==b)c.setGlobalDataScale(this.getDataScaleSlope(this.series.isElscint,this.series.images[0]),this.getDataScaleIntercept(this.series.isElscint,this.series.images[0]),this.series.numberOfFrames);else{for(b=0;b<this.series.images.length;b+=1)d=this.series.images[b],h[b]=this.getDataScaleSlope(this.series.isElscint,d),m[b]=this.getDataScaleIntercept(this.series.isElscint,d);c.dataScaleSlopes=h;c.dataScaleIntercepts=m}else{for(b=0;b<this.series.images.length;b+=
|
|
1359
|
-
1)d=this.series.images[b],h[b]=this.getDataScaleSlope(this.series.isElscint,d),m[b]=this.getDataScaleIntercept(this.series.isElscint,d);c.dataScaleSlopes=h;c.dataScaleIntercepts=m}c.validateDataScale();return c};papaya.volume.dicom.HeaderDICOM.prototype.getOrientation=function(){var c=this.series.images[0].getOrientation();null===c&&(c=papaya.volume.dicom.HeaderDICOM.ORIENTATION_DEFAULT);c=c.substring(0,5)+(this.series.sliceSense?"+":"-");return new papaya.volume.Orientation(c)};
|
|
1360
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getOrientationCertainty=function(){return null===this.series.images[0].getOrientation()?papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN:this.series.isMosaic||this.series.isMultiFrameVolume?papaya.volume.Header.ORIENTATION_CERTAINTY_LOW:papaya.volume.Header.ORIENTATION_CERTAINTY_HIGH};
|
|
1361
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getOrigin=function(){var c=this.getBestTransform();return c?(c=numeric.inv(c),new papaya.core.Coordinate(c[0][3],c[1][3],c[2][3])):new papaya.core.Coordinate(0,0,0)};papaya.volume.dicom.HeaderDICOM.prototype.hasError=function(){return null!==this.error};
|
|
1362
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getImageDescription=function(){var c,a,d,f,b,e="";c=this.series.images[0].getPatientName();a=this.series.images[0].getPatientID();d=this.series.images[0].getStudyTime();f=this.series.images[0].getStudyDate();b=this.series.images[0].getImageDescription();c&&(e+=" "+c);a&&(e+=" "+a);d&&(e+=" "+d);f&&(e+=" "+f);b&&(e+=" "+b);return new papaya.volume.ImageDescription(e.trim())};
|
|
1363
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getBestTransform=function(){var c=this.series.images[0].getImageDirections(),a=null;if(c)var a=this.getVoxelDimensions(),d=this.series.images[0].getImagePosition(),f=[c[0],c[1],c[2]],c=[c[3],c[4],c[5]],b=[f[1]*c[2]-f[2]*c[1],f[2]*c[0]-f[0]*c[2],f[0]*c[1]-f[1]*c[0]],a=[[f[0]*a.colSize*-1,c[0]*a.rowSize,b[0]*a.sliceSize,-1*d[0]],[f[1]*a.colSize,c[1]*a.rowSize*-1,b[1]*a.sliceSize,-1*d[1]],[f[2]*a.colSize,c[2]*a.rowSize,b[2]*a.sliceSize,d[2]],[0,0,0,1]];return a};
|
|
1364
|
-
papaya.volume.dicom.HeaderDICOM.prototype.getBestTransformOrigin=function(){return this.getOrigin()};papaya.volume.dicom.HeaderDICOM.prototype.toString=function(){return this.series.images[0].toString()};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.Orientation=papaya.volume.Orientation||function(c){this.orientation=c;this.orientMat=null;this.zIncrement=this.yIncrement=this.xIncrement=-1};papaya.volume.Orientation.DEFAULT="XYZ+--";
|
|
1365
|
-
papaya.volume.Orientation.isValidOrientationString=function(c){var a,d=!0;if(null===c||6!==c.length)d=!1;a=c.toUpperCase().indexOf("X");if(-1===a||2<a||c.toUpperCase().lastIndexOf("X")!==a)d=!1;a=c.toUpperCase().indexOf("Y");if(-1===a||2<a||c.toUpperCase().lastIndexOf("Y")!==a)d=!1;a=c.toUpperCase().indexOf("Z");if(-1===a||2<a||c.toUpperCase().lastIndexOf("Z")!==a)d=!1;"+"!==c.charAt(3)&&"-"!==c.charAt(3)&&(d=!1);"+"!==c.charAt(4)&&"-"!==c.charAt(4)&&(d=!1);"+"!==c.charAt(5)&&"-"!==c.charAt(5)&&(d=
|
|
1366
|
-
!1);return d};papaya.volume.Orientation.prototype.convertIndexToOffsetNative=function(c,a,d){return c*this.xIncrement+a*this.yIncrement+d*this.zIncrement};
|
|
1367
|
-
papaya.volume.Orientation.prototype.convertIndexToOffset=function(c,a,d){var f,b;f=papayaFloorFast(c*this.orientMat[0][0]+a*this.orientMat[0][1]+d*this.orientMat[0][2]+this.orientMat[0][3]);b=papayaFloorFast(c*this.orientMat[1][0]+a*this.orientMat[1][1]+d*this.orientMat[1][2]+this.orientMat[1][3]);c=papayaFloorFast(c*this.orientMat[2][0]+a*this.orientMat[2][1]+d*this.orientMat[2][2]+this.orientMat[2][3]);return f*this.xIncrement+b*this.yIncrement+c*this.zIncrement};
|
|
1368
|
-
papaya.volume.Orientation.prototype.convertCoordinate=function(c,a){a.x=papayaRoundFast(c.x*this.orientMat[0][0]+c.y*this.orientMat[0][1]+c.z*this.orientMat[0][2]+this.orientMat[0][3]);a.y=papayaRoundFast(c.x*this.orientMat[1][0]+c.y*this.orientMat[1][1]+c.z*this.orientMat[1][2]+this.orientMat[1][3]);a.z=papayaRoundFast(c.x*this.orientMat[2][0]+c.y*this.orientMat[2][1]+c.z*this.orientMat[2][2]+this.orientMat[2][3]);return a};
|
|
1369
|
-
papaya.volume.Orientation.prototype.createInfo=function(c,a){var d,f,b,e,g,h,m,k,p,t,w,B,A,x,G,F;t=c.cols;w=c.rows;B=c.slices;A=c.getNumVoxelsSlice();x=a.colSize;G=a.rowSize;F=a.sliceSize;m="+"===this.orientation.charAt(3);k="+"===this.orientation.charAt(4);p="+"===this.orientation.charAt(5);-1!==this.orientation.toUpperCase().indexOf("XYZ")?(c.xDim=t,c.yDim=w,c.zDim=B,a.xSize=x,a.ySize=G,a.zSize=F,this.xIncrement=1,this.yIncrement=t,this.zIncrement=A,m?(d=1,e=0):(d=-1,e=t-1),k?(f=-1,g=w-1):(f=1,
|
|
1370
|
-
g=0),p?(b=-1,h=B-1):(b=1,h=0)):-1!==this.orientation.toUpperCase().indexOf("XZY")?(c.xDim=t,c.yDim=B,c.zDim=w,a.xSize=x,a.ySize=F,a.zSize=G,this.xIncrement=1,this.yIncrement=A,this.zIncrement=t,m?(d=1,e=0):(d=-1,e=t-1),k?(b=-1,h=w-1):(b=1,h=0),p?(f=-1,g=B-1):(f=1,g=0)):-1!==this.orientation.toUpperCase().indexOf("YXZ")?(c.xDim=w,c.yDim=t,c.zDim=B,a.xSize=G,a.ySize=x,a.zSize=F,this.xIncrement=t,this.yIncrement=1,this.zIncrement=A,m?(f=-1,g=t-1):(f=1,g=0),k?(d=1,e=0):(d=-1,e=w-1),p?(b=-1,h=B-1):(b=
|
|
1371
|
-
1,h=0)):-1!==this.orientation.toUpperCase().indexOf("YZX")?(c.xDim=B,c.yDim=t,c.zDim=w,a.xSize=F,a.ySize=x,a.zSize=G,this.xIncrement=A,this.yIncrement=1,this.zIncrement=t,m?(f=-1,g=t-1):(f=1,g=0),k?(b=-1,h=w-1):(b=1,h=0),p?(d=1,e=0):(d=-1,e=B-1)):-1!==this.orientation.toUpperCase().indexOf("ZXY")?(c.xDim=w,c.yDim=B,c.zDim=t,a.xSize=G,a.ySize=F,a.zSize=x,this.xIncrement=t,this.yIncrement=A,this.zIncrement=1,m?(b=-1,h=t-1):(b=1,h=0),k?(d=1,e=0):(d=-1,e=w-1),p?(f=-1,g=B-1):(f=1,g=0)):-1!==this.orientation.toUpperCase().indexOf("ZYX")&&
|
|
1372
|
-
(c.xDim=B,c.yDim=w,c.zDim=t,a.xSize=F,a.ySize=G,a.zSize=x,this.xIncrement=A,this.yIncrement=t,this.zIncrement=1,m?(b=-1,h=t-1):(b=1,h=0),k?(f=-1,g=w-1):(f=1,g=0),p?(d=1,e=0):(d=-1,e=B-1));this.orientMat=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.orientMat[0][0]=d;this.orientMat[0][1]=0;this.orientMat[0][2]=0;this.orientMat[0][3]=e;this.orientMat[1][0]=0;this.orientMat[1][1]=f;this.orientMat[1][2]=0;this.orientMat[1][3]=g;this.orientMat[2][0]=0;this.orientMat[2][1]=0;this.orientMat[2][2]=b;this.orientMat[2][3]=
|
|
1373
|
-
h;this.orientMat[3][0]=0;this.orientMat[3][1]=0;this.orientMat[3][2]=0;this.orientMat[3][3]=1};papaya.volume.Orientation.prototype.isValid=function(){return papaya.volume.Orientation.isValidOrientationString(this.orientation)};papaya.volume.Orientation.prototype.getOrientationDescription=function(){var c=this.orientation;return"Cols ("+c.charAt(0)+c.charAt(3)+"), Rows ("+c.charAt(1)+c.charAt(4)+"), Slices ("+c.charAt(2)+c.charAt(5)+")"};"use strict";papaya=papaya||{};
|
|
1374
|
-
papaya.volume=papaya.volume||{};
|
|
1375
|
-
papaya.volume.Transform=papaya.volume.Transform||function(c,a){this.voxelValue=new papaya.volume.VoxelValue(a.imageData,a.header.imageType,a.header.imageDimensions,a.header.imageRange,a.header.orientation);this.voxelDimensions=a.header.voxelDimensions;this.imageDimensions=a.header.imageDimensions;this.volume=a;this.mat=papaya.volume.Transform.IDENTITY.clone();this.indexMat=papaya.volume.Transform.IDENTITY.clone();this.sizeMat=papaya.volume.Transform.IDENTITY.clone();this.sizeMatInverse=papaya.volume.Transform.IDENTITY.clone();
|
|
1376
|
-
this.mmMat=papaya.volume.Transform.IDENTITY.clone();this.worldMat=papaya.volume.Transform.IDENTITY.clone();this.worldMatNifti=null;this.originMat=papaya.volume.Transform.IDENTITY.clone();this.tempMat=papaya.volume.Transform.IDENTITY.clone();this.tempMat2=papaya.volume.Transform.IDENTITY.clone();this.orientMat=papaya.volume.Transform.IDENTITY.clone();this.centerMat=papaya.volume.Transform.IDENTITY.clone();this.centerMatInverse=papaya.volume.Transform.IDENTITY.clone();this.rotMatX=papaya.volume.Transform.IDENTITY.clone();
|
|
1377
|
-
this.rotMatY=papaya.volume.Transform.IDENTITY.clone();this.rotMatZ=papaya.volume.Transform.IDENTITY.clone();this.rotMat=papaya.volume.Transform.IDENTITY.clone();this.updateTransforms(c)};papaya.volume.Transform.IDENTITY=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];papaya.volume.Transform.EPSILON=1E-5;
|
|
1378
|
-
papaya.volume.Transform.printTransform=function(c){console.log(c[0][0]+" "+c[0][1]+" "+c[0][2]+" "+c[0][3]);console.log(c[1][0]+" "+c[1][1]+" "+c[1][2]+" "+c[1][3]);console.log(c[2][0]+" "+c[2][1]+" "+c[2][2]+" "+c[2][3]);console.log(c[3][0]+" "+c[3][1]+" "+c[3][2]+" "+c[3][3])};
|
|
1379
|
-
papaya.volume.Transform.decompose=function(c){var a,d,f,b,e,g,h,m,k,p,t,w,B,A,x,G,F,z,L,l;l=[];a=papaya.volume.Transform.validateNum(c[0][3]);d=papaya.volume.Transform.validateNum(c[1][3]);f=papaya.volume.Transform.validateNum(c[2][3]);b=papaya.volume.Transform.validateNum(Math.atan(c[2][1]/c[2][2]));e=0===b?papaya.volume.Transform.validateNum(Math.atan(-1*Math.cos(b)*(c[2][0]/c[2][2]))):papaya.volume.Transform.validateNum(Math.atan(-1*Math.sin(b)*(c[2][0]/c[2][1])));0===e&&(e=papaya.volume.Transform.EPSILON);
|
|
1380
|
-
m=papaya.volume.Transform.validateScale(c[2][2]/(Math.cos(e)*Math.cos(b)));h=Math.cos(b);k=Math.sin(b)*Math.sin(e)+Math.sin(b)*(Math.cos(e)/Math.tan(e));p=c[1][0]*(Math.sin(b)/Math.tan(e))+c[1][1];g=-1*Math.sin(b);t=Math.cos(b)*Math.sin(e)+Math.cos(b)*(Math.cos(e)/Math.tan(e));w=c[1][0]*(Math.cos(b)/Math.tan(e))+c[1][2];g=papaya.volume.Transform.validateNum(Math.atan((h*w-p*g)/(p*t-k*w)));h=papaya.volume.Transform.validateScale(p/(Math.cos(g)*h+Math.sin(g)*k));k=papaya.volume.Transform.validateNum((h*
|
|
1381
|
-
Math.sin(g)*Math.cos(e)-c[1][0])/(m*Math.sin(e)));p=Math.cos(e)*Math.cos(g);t=h*Math.cos(e)*Math.sin(g);w=-1*m*Math.sin(e);B=Math.sin(b)*Math.sin(e)*Math.cos(g)-Math.cos(b)*Math.sin(g);A=Math.sin(b)*Math.sin(e)*Math.sin(g)+Math.cos(b)*Math.cos(g);x=m*Math.sin(b)*Math.cos(e);G=Math.cos(b)*Math.sin(e)*Math.cos(g)+Math.sin(b)*Math.sin(g);F=Math.cos(b)*Math.sin(e)*Math.sin(g)-Math.sin(b)*Math.cos(g);z=m*Math.cos(b)*Math.cos(e);A=t*B-p*A;x=w*B-p*x;B=B*c[0][0]-p*c[0][1];F=t*G-p*F;z=w*G-p*z;L=G*c[0][0]-
|
|
1382
|
-
p*c[0][2];G=papaya.volume.Transform.validateNum((F*B-L*A)/(x*F-A*z));A=papaya.volume.Transform.validateNum((B*z-x*L)/(A*z-x*F));c=papaya.volume.Transform.validateScale((c[0][0]-A*t-G*w)/p);e===papaya.volume.Transform.EPSILON&&(e=0);b*=180/Math.PI;e*=180/Math.PI;g*=180/Math.PI;l[0]=papaya.volume.Transform.validateZero(a);l[1]=papaya.volume.Transform.validateZero(d);l[2]=papaya.volume.Transform.validateZero(f);l[3]=papaya.volume.Transform.validateZero(b);l[4]=papaya.volume.Transform.validateZero(e);
|
|
1383
|
-
l[5]=papaya.volume.Transform.validateZero(g);l[6]=c;l[7]=h;l[8]=m;l[9]=papaya.volume.Transform.validateZero(k);l[10]=papaya.volume.Transform.validateZero(G);l[11]=papaya.volume.Transform.validateZero(A);return l};papaya.volume.Transform.hasRotations=function(c){var a,d;return null!==c?(a=papaya.volume.Transform.decompose(c),c=Math.abs(1-Math.abs(a[3])/90)%1,d=Math.abs(1-Math.abs(a[4])/90)%1,a=Math.abs(1-Math.abs(a[5])/90)%1,.01<c||.01<d||.01<a):!1};
|
|
1384
|
-
papaya.volume.Transform.validateNum=function(c){return c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY||isNaN(c)||0===c?0:c};papaya.volume.Transform.validateScale=function(c){return c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY||isNaN(c)?1:c};papaya.volume.Transform.validateZero=function(c){return Math.abs(c)<papaya.volume.Transform.EPSILON?0:c};
|
|
1385
|
-
papaya.volume.Transform.prototype.updateSizeMat=function(){this.sizeMat[0][0]=this.voxelDimensions.xSize;this.sizeMat[1][1]=this.voxelDimensions.ySize;this.sizeMat[2][2]=this.voxelDimensions.zSize;this.sizeMat[3][3]=1;this.sizeMatInverse[0][0]=1/this.voxelDimensions.xSize;this.sizeMatInverse[1][1]=1/this.voxelDimensions.ySize;this.sizeMatInverse[2][2]=1/this.voxelDimensions.zSize;this.sizeMatInverse[3][3]=1};papaya.volume.Transform.prototype.updateOrientMat=function(){this.orientMat=this.volume.header.orientation.orientMat};
|
|
1386
|
-
papaya.volume.Transform.prototype.updateIndexTransform=function(){var c,a;for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.indexMat[c][a]=this.orientMat[c][0]*this.mat[0][a]+this.orientMat[c][1]*this.mat[1][a]+this.orientMat[c][2]*this.mat[2][a]+this.orientMat[c][3]*this.mat[3][a]};
|
|
1387
|
-
papaya.volume.Transform.prototype.updateMmTransform=function(){var c,a;for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.mmMat[c][a]=this.indexMat[c][0]*this.sizeMatInverse[0][a]+this.indexMat[c][1]*this.sizeMatInverse[1][a]+this.indexMat[c][2]*this.sizeMatInverse[2][a]+this.indexMat[c][3]*this.sizeMatInverse[3][a]};
|
|
1388
|
-
papaya.volume.Transform.prototype.updateOriginMat=function(){this.originMat[0][0]=1;this.originMat[1][1]=-1;this.originMat[2][2]=-1;this.originMat[3][3]=1;this.originMat[0][3]=this.volume.header.origin.x;this.originMat[1][3]=this.volume.header.origin.y;this.originMat[2][3]=this.volume.header.origin.z};
|
|
1389
|
-
papaya.volume.Transform.prototype.updateImageMat=function(c,a,d,f,b,e){this.updateCenterMat(c,a,d);a=f*Math.PI/180;c=Math.cos(a);a=Math.sin(a);this.rotMatX[1][1]=c;this.rotMatX[1][2]=a;this.rotMatX[2][1]=-1*a;this.rotMatX[2][2]=c;a=b*Math.PI/180;c=Math.cos(a);a=Math.sin(a);this.rotMatY[0][0]=c;this.rotMatY[0][2]=-1*a;this.rotMatY[2][0]=a;this.rotMatY[2][2]=c;a=e*Math.PI/180;c=Math.cos(a);a=Math.sin(a);this.rotMatZ[0][0]=c;this.rotMatZ[0][1]=a;this.rotMatZ[1][0]=-1*a;this.rotMatZ[1][1]=c;for(b=0;4>
|
|
1390
|
-
b;b+=1)for(e=0;4>e;e+=1)this.tempMat[b][e]=this.rotMatX[b][0]*this.rotMatY[0][e]+this.rotMatX[b][1]*this.rotMatY[1][e]+this.rotMatX[b][2]*this.rotMatY[2][e]+this.rotMatX[b][3]*this.rotMatY[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.rotMat[b][e]=this.tempMat[b][0]*this.rotMatZ[0][e]+this.tempMat[b][1]*this.rotMatZ[1][e]+this.tempMat[b][2]*this.rotMatZ[2][e]+this.tempMat[b][3]*this.rotMatZ[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.tempMat[b][e]=this.sizeMatInverse[b][0]*this.centerMatInverse[0][e]+
|
|
1391
|
-
this.sizeMatInverse[b][1]*this.centerMatInverse[1][e]+this.sizeMatInverse[b][2]*this.centerMatInverse[2][e]+this.sizeMatInverse[b][3]*this.centerMatInverse[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.tempMat2[b][e]=this.tempMat[b][0]*this.rotMat[0][e]+this.tempMat[b][1]*this.rotMat[1][e]+this.tempMat[b][2]*this.rotMat[2][e]+this.tempMat[b][3]*this.rotMat[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.tempMat[b][e]=this.tempMat2[b][0]*this.centerMat[0][e]+this.tempMat2[b][1]*this.centerMat[1][e]+this.tempMat2[b][2]*
|
|
1392
|
-
this.centerMat[2][e]+this.tempMat2[b][3]*this.centerMat[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.tempMat2[b][e]=this.tempMat[b][0]*this.sizeMat[0][e]+this.tempMat[b][1]*this.sizeMat[1][e]+this.tempMat[b][2]*this.sizeMat[2][e]+this.tempMat[b][3]*this.sizeMat[3][e];this.volume.transform.updateTransforms(this.tempMat2)};
|
|
1393
|
-
papaya.volume.Transform.prototype.updateCenterMat=function(c,a,d){this.centerMat[0][0]=1;this.centerMat[1][1]=1;this.centerMat[2][2]=1;this.centerMat[3][3]=1;this.centerMat[0][3]=-1*c;this.centerMat[1][3]=-1*a;this.centerMat[2][3]=-1*d;this.centerMatInverse[0][0]=1;this.centerMatInverse[1][1]=1;this.centerMatInverse[2][2]=1;this.centerMatInverse[3][3]=1;this.centerMatInverse[0][3]=c;this.centerMatInverse[1][3]=a;this.centerMatInverse[2][3]=d};
|
|
1394
|
-
papaya.volume.Transform.prototype.updateWorldMat=function(){var c,a,d,f;if(this.worldMatNifti){d=[[-1,0,0,this.imageDimensions.xDim-1],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f=papaya.volume.Transform.IDENTITY.clone();f[0][0]=-1;f[1][1]=-1;f[2][2]=-1;f[3][3]=1;f[0][3]=this.volume.header.origin.x;f[1][3]=this.volume.header.origin.y;f[2][3]=this.volume.header.origin.z;for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat[c][a]=this.sizeMat[c][0]*f[0][a]+this.sizeMat[c][1]*f[1][a]+this.sizeMat[c][2]*f[2][a]+this.sizeMat[c][3]*
|
|
1395
|
-
f[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat2[c][a]=this.tempMat[c][0]*d[0][a]+this.tempMat[c][1]*d[1][a]+this.tempMat[c][2]*d[2][a]+this.tempMat[c][3]*d[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat[c][a]=this.tempMat2[c][0]*this.mat[0][a]+this.tempMat2[c][1]*this.mat[1][a]+this.tempMat2[c][2]*this.mat[2][a]+this.tempMat2[c][3]*this.mat[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat2[c][a]=this.tempMat[c][0]*d[0][a]+this.tempMat[c][1]*d[1][a]+this.tempMat[c][2]*d[2][a]+this.tempMat[c][3]*
|
|
1396
|
-
d[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat[c][a]=this.tempMat2[c][0]*f[0][a]+this.tempMat2[c][1]*f[1][a]+this.tempMat2[c][2]*f[2][a]+this.tempMat2[c][3]*f[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat2[c][a]=this.tempMat[c][0]*this.sizeMatInverse[0][a]+this.tempMat[c][1]*this.sizeMatInverse[1][a]+this.tempMat[c][2]*this.sizeMatInverse[2][a]+this.tempMat[c][3]*this.sizeMatInverse[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.worldMat[c][a]=this.worldMatNifti[c][0]*this.tempMat2[0][a]+
|
|
1397
|
-
this.worldMatNifti[c][1]*this.tempMat2[1][a]+this.worldMatNifti[c][2]*this.tempMat2[2][a]+this.worldMatNifti[c][3]*this.tempMat2[3][a]}else{for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat[c][a]=this.indexMat[c][0]*this.originMat[0][a]+this.indexMat[c][1]*this.originMat[1][a]+this.indexMat[c][2]*this.originMat[2][a]+this.indexMat[c][3]*this.originMat[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.worldMat[c][a]=this.tempMat[c][0]*this.sizeMatInverse[0][a]+this.tempMat[c][1]*this.sizeMatInverse[1][a]+
|
|
1398
|
-
this.tempMat[c][2]*this.sizeMatInverse[2][a]+this.tempMat[c][3]*this.sizeMatInverse[3][a]}};papaya.volume.Transform.prototype.updateTransforms=function(c){this.mat=c;this.updateSizeMat();this.updateOrientMat();this.updateOriginMat();this.updateIndexTransform();this.updateMmTransform();this.updateWorldMat()};papaya.volume.Transform.prototype.getVoxelAtIndexNative=function(c,a,d,f,b){return this.voxelValue.getVoxelAtIndexNative(c,a,d,f,b)};
|
|
1399
|
-
papaya.volume.Transform.prototype.getVoxelAtIndex=function(c,a,d,f,b){return this.voxelValue.getVoxelAtIndex(c,a,d,f,b)};
|
|
1400
|
-
papaya.volume.Transform.prototype.getVoxelAtCoordinate=function(c,a,d,f,b){return this.voxelValue.getVoxelAtIndexNative(c*this.worldMat[0][0]+a*this.worldMat[0][1]+d*this.worldMat[0][2]+this.worldMat[0][3],c*this.worldMat[1][0]+a*this.worldMat[1][1]+d*this.worldMat[1][2]+this.worldMat[1][3],c*this.worldMat[2][0]+a*this.worldMat[2][1]+d*this.worldMat[2][2]+this.worldMat[2][3],f,b)};
|
|
1401
|
-
papaya.volume.Transform.prototype.getVoxelAtMM=function(c,a,d,f,b){return this.voxelValue.getVoxelAtIndexNative(c*this.mmMat[0][0]+a*this.mmMat[0][1]+d*this.mmMat[0][2]+this.mmMat[0][3],c*this.mmMat[1][0]+a*this.mmMat[1][1]+d*this.mmMat[1][2]+this.mmMat[1][3],c*this.mmMat[2][0]+a*this.mmMat[2][1]+d*this.mmMat[2][2]+this.mmMat[2][3],f,b)};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
|
|
1402
|
-
papaya.volume.Volume=papaya.volume.Volume||function(c,a,d){this.progressMeter=c;this.dialogHandler=a;this.files=[];this.rawData=[];this.fileLength=0;this.fileName=this.urls=null;this.compressed=!1;this.transform=null;this.numTimepoints=0;this.transform=this.error=this.onFinishedRead=null;this.isLoaded=!1;this.numTimepoints=1;this.loaded=!1;this.params=d;this.header=new papaya.volume.Header(void 0!==this.params&&this.params.padAllImages);this.imageData=new papaya.volume.ImageData(void 0!==this.params&&
|
|
1403
|
-
this.params.padAllImages)};papaya.volume.Volume.PROGRESS_LABEL_LOADING="Loading";papaya.volume.Volume.prototype.fileIsCompressed=function(c,a){var d,f;return-1!==c.indexOf(".gz")||a&&(d=new DataView(a),f=d.getUint8(0),d=d.getUint8(1),f===GUNZIP_MAGIC_COOKIE1||d===GUNZIP_MAGIC_COOKIE2)?!0:!1};
|
|
1404
|
-
papaya.volume.Volume.prototype.readFiles=function(c,a){this.files=c;this.fileName=c[0].name;this.onFinishedRead=a;this.compressed=this.fileIsCompressed(this.fileName);this.fileLength=this.files[0].size;this.readNextFile(this,0)};
|
|
1405
|
-
papaya.volume.Volume.prototype.readNextFile=function(c,a){var d;if(a<this.files.length){d=papaya.utilities.PlatformUtils.makeSlice(this.files[a],0,this.files[a].size);try{var f=new FileReader;f.onloadend=papaya.utilities.ObjectUtils.bind(c,function(b){b.target.readyState===FileReader.DONE&&(c.rawData[a]=b.target.result,setTimeout(function(){c.readNextFile(c,a+1)},0))});f.onerror=papaya.utilities.ObjectUtils.bind(c,function(a){c.error=Error("There was a problem reading that file:\n\n"+a.getMessage());
|
|
1406
|
-
c.finishedLoad()});f.readAsArrayBuffer(d)}catch(b){c.error=Error("There was a problem reading that file:\n\n"+b.message),c.finishedLoad()}}else setTimeout(function(){c.decompress(c)},0)};
|
|
1407
|
-
papaya.volume.Volume.prototype.readURLs=function(c,a){var d=this;this.urls=c;this.fileName=c[0].substr(c[0].lastIndexOf("/")+1,c[0].length);this.onFinishedRead=a;this.compressed=this.fileIsCompressed(this.fileName);this.rawData=[];this.loadedFileCount=0;this.readEachURL(this).done(function(){setTimeout(function(){d.decompress(d)},0)}).fail(function(a,b,c){b=b.message||"";"undefined"!==typeof c&&(b="Response status = "+c.status);a.error=Error("There was a problem reading that file ("+a.fileName+"):\n\n"+
|
|
1408
|
-
b);a.finishedLoad()})};
|
|
1409
|
-
papaya.volume.Volume.prototype.loadURL=function(c,a){var d,f,b,e;d=jQuery.Deferred();"string"===typeof(new XMLHttpRequest).responseType?(f=new XMLHttpRequest,f.open("GET",c,!0),f.responseType="arraybuffer",f.onreadystatechange=function(){4===f.readyState&&(200===f.status?(a.fileLength=a.rawData.byteLength,d.resolve(f.response)):d.reject(a,!1,f))},f.onprogress=function(a){a.lengthComputable&&d.notify(a.loaded,a.total)},f.send(null)):(a.error=Error("There was a problem reading that file ("+a.fileName+
|
|
1410
|
-
"):\n\nResponse type is not supported."),a.finishedLoad());return d.promise().done(function(b){a.loadedFileCount++;a.rawData.push(b)}).fail(function(a,b,c){console.error(a,b,c)}).progress(function(c,d){b=parseInt(100*a.loadedFileCount/a.urls.length,10);e=papaya.volume.Volume.PROGRESS_LABEL_LOADING+" image "+(a.loadedFileCount+1)+" of "+a.urls.length+" ("+b+"%)";a.progressMeter.drawProgress(c/d,e)})};
|
|
1411
|
-
papaya.volume.Volume.prototype.readEachURL=function(c,a){for(var d=[],f=0;f<c.urls.length;f++){var b=c.loadURL(c.urls[f],c);d.push(b)}return $.when.apply($,d)};papaya.volume.Volume.prototype.readEncodedData=function(c,a){var d=null;try{this.fileName=c[0],this.onFinishedRead=a,d=this,this.fileLength=0,d.readNextEncodedData(d,0,c)}catch(f){d&&(d.error=Error("There was a problem reading that file:\n\n"+f.message),d.finishedLoad())}};
|
|
1412
|
-
papaya.volume.Volume.prototype.readNextEncodedData=function(c,a,d){if(a<d.length)try{c.rawData[a]=Base64Binary.decodeArrayBuffer(papaya.utilities.ObjectUtils.dereference(d[a])),c.compressed=this.fileIsCompressed(this.fileName,c.rawData[a]),setTimeout(function(){c.readNextEncodedData(c,a+1,d)},0)}catch(f){c&&(c.error=Error("There was a problem reading that file:\n\n"+f.message),c.finishedLoad())}else c.decompress(c)};
|
|
1413
|
-
papaya.volume.Volume.prototype.getVoxelAtIndexNative=function(c,a,d,f,b){return this.transform.getVoxelAtIndexNative(c,a,d,0,b)};papaya.volume.Volume.prototype.getVoxelAtIndex=function(c,a,d,f,b){return this.transform.getVoxelAtIndex(c,a,d,f,b)};papaya.volume.Volume.prototype.getVoxelAtCoordinate=function(c,a,d,f,b){return this.transform.getVoxelAtCoordinate(c,a,d,f,b)};papaya.volume.Volume.prototype.getVoxelAtMM=function(c,a,d,f,b){return this.transform.getVoxelAtMM(c,a,d,f,b)};
|
|
1414
|
-
papaya.volume.Volume.prototype.hasError=function(){return null!==this.error};papaya.volume.Volume.prototype.getXDim=function(){return this.header.imageDimensions.xDim};papaya.volume.Volume.prototype.getYDim=function(){return this.header.imageDimensions.yDim};papaya.volume.Volume.prototype.getZDim=function(){return this.header.imageDimensions.zDim};papaya.volume.Volume.prototype.getXSize=function(){return this.header.voxelDimensions.xSize};papaya.volume.Volume.prototype.getYSize=function(){return this.header.voxelDimensions.ySize};
|
|
1415
|
-
papaya.volume.Volume.prototype.getZSize=function(){return this.header.voxelDimensions.zSize};papaya.volume.Volume.prototype.decompress=function(c){if(c.compressed)try{pako.inflate(new Uint8Array(c.rawData[0]),null,this.progressMeter,function(a){c.finishedDecompress(c,a.buffer)})}catch(a){console.log(a)}else setTimeout(function(){c.finishedReadData(c)},0)};papaya.volume.Volume.prototype.finishedDecompress=function(c,a){c.rawData[0]=a;setTimeout(function(){c.finishedReadData(c)},0)};
|
|
1416
|
-
papaya.volume.Volume.prototype.finishedReadData=function(c){c.header.readHeaderData(c.fileName,c.rawData,this.progressMeter,this.dialogHandler,papaya.utilities.ObjectUtils.bind(this,this.finishedReadHeaderData))};
|
|
1417
|
-
papaya.volume.Volume.prototype.finishedReadHeaderData=function(){this.rawData=null;this.header.hasError()?(this.error=this.header.error,console.error(this.error.stack),this.onFinishedRead(this)):(this.header.imageType.swapped=this.header.imageType.littleEndian!==papaya.utilities.PlatformUtils.isPlatformLittleEndian(),this.header.getName()&&(this.fileName=this.header.getName()),this.header.readImageData(this.progressMeter,papaya.utilities.ObjectUtils.bind(this,this.finishedReadImageData)))};
|
|
1418
|
-
papaya.volume.Volume.prototype.finishedReadImageData=function(c){this.imageData.readFileData(this.header,c,papaya.utilities.ObjectUtils.bind(this,this.finishedLoad))};
|
|
1419
|
-
papaya.volume.Volume.prototype.finishedLoad=function(){this.loaded||(this.loaded=!0,this.onFinishedRead&&(this.hasError()?console.log(this.error):(this.transform=new papaya.volume.Transform(papaya.volume.Transform.IDENTITY.clone(),this),this.numTimepoints=this.header.imageDimensions.timepoints||1,this.applyBestTransform()),this.isLoaded=!0,this.rawData=null,this.onFinishedRead(this)))};
|
|
1420
|
-
papaya.volume.Volume.prototype.setOrigin=function(c){c=this.header.orientation.convertCoordinate(c,new papaya.core.Coordinate(0,0,0));this.header.origin.setCoordinate(c.x,c.y,c.z)};papaya.volume.Volume.prototype.getOrigin=function(){return this.header.orientation.convertCoordinate(this.header.origin,new papaya.core.Coordinate(0,0,0))};
|
|
1421
|
-
papaya.volume.Volume.prototype.applyBestTransform=function(){var c=this.header.getBestTransform();null!==c&&(this.transform.worldMatNifti=numeric.inv(c),this.setOrigin(this.header.getBestTransformOrigin()),this.transform.updateWorldMat())};
|
|
1422
|
-
papaya.volume.Volume.prototype.isWorldSpaceOnly=function(){var c,a=!1;return this.header.fileFormat instanceof papaya.volume.nifti.HeaderNIFTI?(c=this.header.fileFormat,0<c.nifti.qform_code&&(a|=!c.qFormHasRotations()),0<c.nifti.sform_code&&(a|=!c.sFormHasRotations()),!a):!1};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
|
|
1423
|
-
papaya.volume.VoxelDimensions=papaya.volume.VoxelDimensions||function(c,a,d,f){this.colSize=Math.abs(c);this.rowSize=Math.abs(a);this.sliceSize=Math.abs(d);this.zSize=this.ySize=this.xSize=0;this.flip=!1;this.timeSize=f;this.temporalUnit=this.spatialUnit=papaya.volume.VoxelDimensions.UNITS_UNKNOWN};papaya.volume.VoxelDimensions.UNITS_UNKNOWN=0;papaya.volume.VoxelDimensions.UNITS_METER=1;papaya.volume.VoxelDimensions.UNITS_MM=2;papaya.volume.VoxelDimensions.UNITS_MICRON=3;
|
|
1424
|
-
papaya.volume.VoxelDimensions.UNITS_SEC=8;papaya.volume.VoxelDimensions.UNITS_MSEC=16;papaya.volume.VoxelDimensions.UNITS_USEC=24;papaya.volume.VoxelDimensions.UNITS_HZ=32;papaya.volume.VoxelDimensions.UNITS_PPM=40;papaya.volume.VoxelDimensions.UNITS_RADS=48;papaya.volume.VoxelDimensions.UNIT_STRINGS=[];papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_UNKNOWN]="Unknown Unit";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_METER]="Meters";
|
|
1425
|
-
papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_MM]="Millimeters";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_MICRON]="Microns";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_SEC]="Seconds";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_MSEC]="Milliseconds";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_USEC]="Microseconds";
|
|
1426
|
-
papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_HZ]="Hertz";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_PPM]="Parts-per-million";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_RADS]="Radians-per-second";papaya.volume.VoxelDimensions.prototype.isValid=function(){return 0<this.colSize&&0<this.rowSize&&0<this.sliceSize&&0<=this.timeSize};papaya.volume.VoxelDimensions.prototype.getSpatialUnitString=function(){return papaya.volume.VoxelDimensions.UNIT_STRINGS[this.spatialUnit]};
|
|
1427
|
-
papaya.volume.VoxelDimensions.prototype.getTemporalUnitString=function(){return papaya.volume.VoxelDimensions.UNIT_STRINGS[this.temporalUnit]};papaya.volume.VoxelDimensions.prototype.getTemporalUnitMultiplier=function(){return this.temporalUnit===papaya.volume.VoxelDimensions.UNITS_MSEC?.001:this.temporalUnit===papaya.volume.VoxelDimensions.UNITS_USEC?1E-6:1};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
|
|
1428
|
-
papaya.volume.VoxelValue=papaya.volume.VoxelValue||function(c,a,d,f,b){this.imageData=c;this.imageType=a;this.imageRange=f;this.orientation=b;this.swap16=2===this.imageType.numBytes&&this.imageType.swapped&&this.imageType.datatype!==papaya.volume.ImageType.DATATYPE_FLOAT;this.swap32=4===this.imageType.numBytes&&this.imageType.swapped&&this.imageType.datatype!==papaya.volume.ImageType.DATATYPE_FLOAT;this.xIncrement=b.xIncrement;this.yIncrement=b.yIncrement;this.zIncrement=b.zIncrement;this.xDim=d.xDim;
|
|
1429
|
-
this.yDim=d.yDim;this.zDim=d.zDim;this.sliceSize=d.getNumVoxelsSlice();this.volSize=d.getNumVoxelsVolume();this.dataScaleSlopes=f.dataScaleSlopes;this.dataScaleIntercepts=f.dataScaleIntercepts;this.globalDataScaleSlope=f.globalDataScaleSlope;this.globalDataScaleIntercept=f.globalDataScaleIntercept;this.usesGlobalDataScale=f.usesGlobalDataScale;this.interpFirstPass=[[0,0],[0,0]];this.interpSecondPass=[0,0];this.forceABS=!1};
|
|
1430
|
-
papaya.volume.VoxelValue.prototype.getVoxelAtIndexNative=function(c,a,d,f,b){return b?(c=papayaRoundFast(c),a=papayaRoundFast(a),d=papayaRoundFast(d),this.getVoxelAtOffset(this.orientation.convertIndexToOffsetNative(c,a,d),f,c,a,d)):this.getVoxelAtIndexLinear(c,a,d,f)};
|
|
1431
|
-
papaya.volume.VoxelValue.prototype.getVoxelAtIndex=function(c,a,d,f,b){return b?(c=papayaRoundFast(c),a=papayaRoundFast(a),d=papayaRoundFast(d),this.getVoxelAtOffset(this.orientation.convertIndexToOffset(c,a,d),f,c,a,d)):this.getVoxelAtIndexLinear(c,a,d,f)};
|
|
1432
|
-
papaya.volume.VoxelValue.prototype.getVoxelAtOffset=function(c,a,d,f,b){c+=this.volSize*a;if(0>d||d>=this.xDim||0>f||f>=this.yDim||0>b||b>=this.zDim)return 0;this.usesGlobalDataScale?d=this.checkSwap(this.imageData.data[c])*this.globalDataScaleSlope+this.globalDataScaleIntercept:(d=parseInt(c/this.sliceSize),d=this.checkSwap(this.imageData.data[c])*this.dataScaleSlopes[d]+this.dataScaleIntercepts[d]);return this.forceABS?Math.abs(d):d};
|
|
1433
|
-
papaya.volume.VoxelValue.prototype.getVoxelAtIndexLinear=function(c,a,d,f){var b,e,g,h,m,k,p,t,w;m=Math.floor(c);k=Math.floor(a);p=Math.floor(d);b=c-m;e=a-k;g=d-p;h=0!==b;t=0!==e;w=0!==g;if(h&&t&&w){for(a=0;2>a;a+=1)for(d=0;2>d;d+=1)h=this.orientation.convertIndexToOffsetNative(m+a,k+d,p),c=this.getVoxelAtOffset(h,f,m+a,k+d,p)*(1-g),h=this.orientation.convertIndexToOffsetNative(m+a,k+d,p+1),h=this.getVoxelAtOffset(h,f,m+a,k+d,p+1)*g,this.interpFirstPass[a][d]=c+h;this.interpSecondPass[0]=this.interpFirstPass[0][0]*
|
|
1434
|
-
(1-e)+this.interpFirstPass[0][1]*e;this.interpSecondPass[1]=this.interpFirstPass[1][0]*(1-e)+this.interpFirstPass[1][1]*e;f=this.interpSecondPass[0]*(1-b)+this.interpSecondPass[1]*b}else if(h&&t&&!w){for(a=0;2>a;a+=1)h=this.orientation.convertIndexToOffsetNative(m+a,k,p),c=this.getVoxelAtOffset(h,f,m+a,k,p)*(1-e),h=this.orientation.convertIndexToOffsetNative(m+a,k+1,p),h=this.getVoxelAtOffset(h,f,m+a,k+1,p)*e,this.interpSecondPass[a]=c+h;f=this.interpSecondPass[0]*(1-b)+this.interpSecondPass[1]*b}else if(h&&
|
|
1435
|
-
!t&&w){for(a=0;2>a;a+=1)h=this.orientation.convertIndexToOffsetNative(m+a,k,p),c=this.getVoxelAtOffset(h,f,m+a,k,p)*(1-g),h=this.orientation.convertIndexToOffsetNative(m+a,k,p+1),h=this.getVoxelAtOffset(h,f,m+a,k,p+1)*g,this.interpSecondPass[a]=c+h;f=this.interpSecondPass[0]*(1-b)+this.interpSecondPass[1]*b}else if(!h&&t&&w){for(d=0;2>d;d+=1)h=this.orientation.convertIndexToOffsetNative(m,k+d,p),c=this.getVoxelAtOffset(h,f,m,k+d,p)*(1-g),h=this.orientation.convertIndexToOffsetNative(m,k+d,p+1),h=
|
|
1436
|
-
this.getVoxelAtOffset(h,f,m,k+d,p+1)*g,this.interpSecondPass[d]=c+h;f=this.interpSecondPass[0]*(1-e)+this.interpSecondPass[1]*e}else h||t||!w?h||!t||w?!h||t||w?f=this.getVoxelAtOffset(this.orientation.convertIndexToOffsetNative(c,a,d),f,c,a,d):(h=this.orientation.convertIndexToOffsetNative(m,k,p),c=this.getVoxelAtOffset(h,f,m,k,p)*(1-b),h=this.orientation.convertIndexToOffsetNative(m+1,k,p),h=this.getVoxelAtOffset(h,f,m+1,k,p)*b,f=c+h):(h=this.orientation.convertIndexToOffsetNative(m,k,p),c=this.getVoxelAtOffset(h,
|
|
1437
|
-
f,m,k,p)*(1-e),h=this.orientation.convertIndexToOffsetNative(m,k+1,p),h=this.getVoxelAtOffset(h,f,m,k+1,p)*e,f=c+h):(h=this.orientation.convertIndexToOffsetNative(m,k,p),c=this.getVoxelAtOffset(h,f,m,k,p)*(1-g),h=this.orientation.convertIndexToOffsetNative(m,k,p+1),h=this.getVoxelAtOffset(h,f,m,k,p+1)*g,f=c+h);return f};papaya.volume.VoxelValue.prototype.checkSwap=function(c){return this.swap16?((c&255)<<8|c>>8&255)<<16>>16:this.swap32?(c&255)<<24|(c&65280)<<8|c>>8&65280|c>>24&255:c};"use strict";
|
|
1438
|
-
papaya=papaya||{};papaya.surface=papaya.surface||{};
|
|
1439
|
-
papaya.surface.Surface=papaya.surface.Surface||function(c,a){this.progressMeter=c;this.colorsData=this.normalsData=this.triangleData=this.pointData=this.onFinishedRead=this.rawData=this.filename=this.error=null;this.numTriangles=this.numPoints=0;this.solidColor=this.colorsBuffer=this.normalsBuffer=this.trianglesBuffer=this.pointsBuffer=null;this.surfaceType=papaya.surface.Surface.SURFACE_TYPE_UNKNOWN;this.fileFormat=null;this.params=a;this.volume=this.nextSurface=null;this.alpha=1};
|
|
1440
|
-
papaya.surface.Surface.SURFACE_TYPE_UNKNOWN=0;papaya.surface.Surface.SURFACE_TYPE_GIFTI=1;papaya.surface.Surface.SURFACE_TYPE_MANGO=2;papaya.surface.Surface.SURFACE_TYPE_VTK=3;papaya.surface.Surface.findSurfaceType=function(c){return gifti.isThisFormat(c)?papaya.surface.Surface.SURFACE_TYPE_GIFTI:papaya.surface.SurfaceMango.isThisFormat(c)?papaya.surface.Surface.SURFACE_TYPE_MANGO:papaya.surface.SurfaceVTK.isThisFormat(c)?papaya.surface.Surface.SURFACE_TYPE_VTK:papaya.surface.Surface.SURFACE_TYPE_UNKNOWN};
|
|
1441
|
-
papaya.surface.Surface.prototype.makeFileFormat=function(c){this.surfaceType=papaya.surface.Surface.findSurfaceType(c);this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_GIFTI?this.fileFormat=new papaya.surface.SurfaceGIFTI:this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_MANGO?this.fileFormat=new papaya.surface.SurfaceMango:this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_VTK&&(this.fileFormat=new papaya.surface.SurfaceVTK)};
|
|
1442
|
-
papaya.surface.Surface.prototype.readURL=function(c,a,d){var f,b=this;this.filename=c.substr(c.lastIndexOf("/")+1,c.length);this.onFinishedRead=d;this.volume=a;this.processParams(this.filename);this.makeFileFormat(this.filename);if(this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_UNKNOWN)this.error=Error("This surface format is not supported!"),this.finishedLoading();else try{"string"===typeof(new XMLHttpRequest).responseType?(f=new XMLHttpRequest,f.open("GET",c,!0),this.fileFormat.isSurfaceDataBinary()&&
|
|
1443
|
-
(f.responseType="arraybuffer"),f.onreadystatechange=function(){4===f.readyState&&(200===f.status?b.rawData=f.response:b.error=Error("There was a problem reading that file ("+b.filename+"):\n\nResponse status = "+f.status),b.finishedLoading())},f.onprogress=function(a){a.lengthComputable&&b.progressMeter.drawProgress(a.loaded/a.total,papaya.volume.Volume.PROGRESS_LABEL_LOADING)},f.send(null)):(b.error=Error("There was a problem reading that file ("+b.filename+"):\n\nResponse type is not supported."),
|
|
1444
|
-
b.finishedLoading())}catch(e){null!==b&&(b.error=Error("There was a problem reading that file ("+b.filename+"):\n\n"+e.message),b.finishedLoading())}};
|
|
1445
|
-
papaya.surface.Surface.prototype.readFile=function(c,a,d){var f=papaya.utilities.PlatformUtils.makeSlice(c,0,c.size),b=this;this.filename=c.name;this.onFinishedRead=d;this.volume=a;this.processParams(this.filename);this.makeFileFormat(this.filename);if(this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_UNKNOWN)this.error=Error("This surface format is not supported!"),this.finishedLoading();else try{var e=new FileReader;e.onloadend=function(a){a.target.readyState===FileReader.DONE&&(b.rawData=
|
|
1446
|
-
a.target.result,b.finishedLoading())};e.onerror=function(a){b.error=Error("There was a problem reading that file:\n\n"+a.getMessage());b.finishedLoading()};this.fileFormat.isSurfaceDataBinary()?e.readAsArrayBuffer(f):e.readAsText(f)}catch(g){b.error=Error("There was a problem reading that file:\n\n"+g.message),b.finishedLoading()}};
|
|
1447
|
-
papaya.surface.Surface.prototype.readEncodedData=function(c,a,d){this.filename=c+".surf.gii";this.onFinishedRead=d;this.volume=a;this.processParams(c);this.makeFileFormat(this.filename);if(this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_UNKNOWN)this.error=Error("This surface format is not supported!");else try{this.fileFormat.isSurfaceDataBinary()?this.rawData=Base64Binary.decodeArrayBuffer(papaya.utilities.ObjectUtils.dereference(c)):this.rawData=atob(papaya.utilities.ObjectUtils.dereference(c))}catch(f){this.error=
|
|
1448
|
-
Error("There was a problem reading that file:\n\n"+f.message)}this.finishedLoading()};papaya.surface.Surface.prototype.processParams=function(c){if(c=params[c])void 0!==c.color&&(this.solidColor=c.color),void 0!==c.alpha&&(this.alpha=c.alpha)};papaya.surface.Surface.prototype.finishedLoading=function(){this.readData()};
|
|
1449
|
-
papaya.surface.Surface.prototype.readData=function(){if(this.error)console.log(this.error),this.onFinishedRead(this);else{var c=this.progressMeter,a=function(a){c.drawProgress(a,"Loading surface...")};try{this.fileFormat.readData(this.rawData,a,papaya.utilities.ObjectUtils.bind(this,this.finishedReading),this.volume)}catch(d){this.error=d,this.onFinishedRead(this)}}};
|
|
1450
|
-
papaya.surface.Surface.prototype.finishedReading=function(){var c=this.fileFormat.getNumSurfaces(),a=this,d;if(this.fileFormat.error)this.error=this.fileFormat.error;else for(d=0;d<c;d+=1)0<d&&(a.nextSurface=new papaya.surface.Surface,a=a.nextSurface),a.numPoints=this.fileFormat.getNumPoints(d),a.numTriangles=this.fileFormat.getNumTriangles(d),a.pointData=this.fileFormat.getPointData(d),a.normalsData=this.fileFormat.getNormalsData(d),a.triangleData=this.fileFormat.getTriangleData(d),a.colorsData=
|
|
1451
|
-
this.fileFormat.getColorsData(d),null===a.normalsData&&this.generateNormals(),this.fileFormat.getSolidColor(d)&&(a.solidColor=this.fileFormat.getSolidColor(d));this.progressMeter.drawProgress(1,"Loading surface...");this.onFinishedRead(this)};
|
|
1452
|
-
papaya.surface.Surface.prototype.generateNormals=function(){var c=[],a=[],d=[],f=[],b=[],e,g=this.pointData.length,h,m,k,p,t,w,B,A,x,G;this.normalsData=new Float32Array(g);h=3*this.numTriangles;for(e=0;e<h;e+=3)A=3*this.triangleData[e],x=3*this.triangleData[e+1],G=3*this.triangleData[e+2],c.x=this.pointData[A],c.y=this.pointData[A+1],c.z=this.pointData[A+2],a.x=this.pointData[x],a.y=this.pointData[x+1],a.z=this.pointData[x+2],d.x=this.pointData[G],d.y=this.pointData[G+1],d.z=this.pointData[G+2],m=
|
|
1453
|
-
a.x-c.x,k=a.y-c.y,p=a.z-c.z,t=d.x-c.x,w=d.y-c.y,B=d.z-c.z,f[0]=w*p-B*k,f[1]=B*m-t*p,f[2]=t*k-w*m,this.normalsData[A]+=f[0],this.normalsData[A+1]+=f[1],this.normalsData[A+2]+=f[2],this.normalsData[x]+=f[0],this.normalsData[x+1]+=f[1],this.normalsData[x+2]+=f[2],this.normalsData[G]+=f[0],this.normalsData[G+1]+=f[1],this.normalsData[G+2]+=f[2];for(e=0;e<g;e+=3)f[0]=-1*this.normalsData[e],f[1]=-1*this.normalsData[e+1],f[2]=-1*this.normalsData[e+2],vec3.normalize(f,b),this.normalsData[e]=b[0],this.normalsData[e+
|
|
1454
|
-
1]=b[1],this.normalsData[e+2]=b[2]};"use strict";papaya=papaya||{};papaya.surface=papaya.surface||{};papaya.surface.SurfaceGIFTI=papaya.surface.SurfaceGIFTI||function(){this.onFinishedRead=this.colorsData=this.normalsData=this.triangleData=this.pointData=this.error=this.gii=null};papaya.surface.SurfaceGIFTI.prototype.isSurfaceDataBinary=function(){return!1};
|
|
1455
|
-
papaya.surface.SurfaceGIFTI.prototype.readData=function(c,a,d){var f=this;a(0);this.onFinishedRead=d;this.gii=gifti.parse(c);setTimeout(function(){f.readDataPoints(f,a)},0)};papaya.surface.SurfaceGIFTI.prototype.readDataPoints=function(c,a){a(.2);null!=c.gii.getPointsDataArray()?c.pointData=c.gii.getPointsDataArray().getData():c.error=Error("Surface is missing point information!");setTimeout(function(){c.readDataNormals(c,a)},0)};
|
|
1456
|
-
papaya.surface.SurfaceGIFTI.prototype.readDataNormals=function(c,a){a(.4);null!=c.gii.getNormalsDataArray()&&(c.normalsData=c.gii.getNormalsDataArray().getData());setTimeout(function(){c.readDataTriangles(c,a)},0)};papaya.surface.SurfaceGIFTI.prototype.readDataTriangles=function(c,a){a(.6);null!=c.gii.getTrianglesDataArray()?c.triangleData=c.gii.getTrianglesDataArray().getData():c.error=Error("Surface is missing triangle information!");setTimeout(function(){c.readDataColors(c,a)},0)};
|
|
1457
|
-
papaya.surface.SurfaceGIFTI.prototype.readDataColors=function(c,a){a(.8);null!=c.gii.getColorsDataArray()&&(c.colorsData=c.gii.getColorsDataArray().getData());setTimeout(function(){c.onFinishedRead()},0)};papaya.surface.SurfaceGIFTI.prototype.getNumSurfaces=function(){return 1};papaya.surface.SurfaceGIFTI.prototype.getNumPoints=function(){return this.gii.getNumPoints()};papaya.surface.SurfaceGIFTI.prototype.getNumTriangles=function(){return this.gii.getNumTriangles()};
|
|
1458
|
-
papaya.surface.SurfaceGIFTI.prototype.getPointData=function(){return this.pointData};papaya.surface.SurfaceGIFTI.prototype.getNormalsData=function(){return this.normalsData};papaya.surface.SurfaceGIFTI.prototype.getTriangleData=function(){return this.triangleData};papaya.surface.SurfaceGIFTI.prototype.getColorsData=function(){return this.colorsData};papaya.surface.SurfaceGIFTI.prototype.getSolidColor=function(){return this.solidColor};"use strict";papaya=papaya||{};
|
|
1459
|
-
papaya.surface=papaya.surface||{};papaya.surface.SurfaceMango=papaya.surface.SurfaceMango||function(){this.onFinishedRead=this.error=null;this.origin=[];this.imageDims=[];this.voxelDims=[];this.center=[];this.diffs=[];this.dv=null;this.numSurfaces=this.dataLength=this.surfaceIndex=this.index=0;this.littleEndian=!1;this.surfaces=[];this.v15=this.v14=!1};
|
|
1460
|
-
papaya.surface.SurfaceMangoData=papaya.surface.SurfaceMangoData||function(){this.colorsData=this.normalsData=this.triangleData=this.pointData=null;this.solidColor=[]};papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5="mangol15".split("");papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_5="mangob15".split("");papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4="mangol14".split("");papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_4="mangob14".split("");
|
|
1461
|
-
papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER=[0,0,0,0,"s","c","a","l"];papaya.surface.SurfaceMango.NAME_SIZE=64;papaya.surface.SurfaceMango.isThisFormat=function(c){return c.endsWith(".surf")};papaya.surface.SurfaceMango.prototype.isSurfaceDataBinary=function(){return!0};
|
|
1462
|
-
papaya.surface.SurfaceMango.prototype.isLittleEndian15=function(c){c=new Uint8Array(c);var a;for(a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5[a].charCodeAt(0))return!1;return!0};
|
|
1463
|
-
papaya.surface.SurfaceMango.prototype.isLittleEndian14=function(c){c=new Uint8Array(c);var a;for(a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4[a].charCodeAt(0))return!1;return!0};
|
|
1464
|
-
papaya.surface.SurfaceMango.prototype.isVersion15=function(c){c=new Uint8Array(c);var a,d=!0;for(a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5[a].charCodeAt(0)){d=!1;break}if(!d)for(d=!0,a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_5.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_5[a].charCodeAt(0)){d=!1;break}return d};
|
|
1465
|
-
papaya.surface.SurfaceMango.prototype.isVersion14=function(c){c=new Uint8Array(c);var a,d=!0;for(a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4[a].charCodeAt(0)){d=!1;break}if(!d)for(d=!0,a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_4.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_4[a].charCodeAt(0)){d=!1;break}return d};
|
|
1466
|
-
papaya.surface.SurfaceMango.prototype.isLittleEndian=function(c){return this.isLittleEndian15(c)||this.isLittleEndian14(c)};papaya.surface.SurfaceMango.prototype.hasOverlay=function(){var c,a;for(c=0;c<papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER.length;c+=1)if((a=papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER[c])&&(a=papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER[c].charCodeAt(0)),this.dv.getUint8(this.index+c)!==a)return!1;return!0};
|
|
1467
|
-
papaya.surface.SurfaceMango.prototype.getString=function(c){var a,d=[];for(a=0;a<c;a+=1)d[a]=this.dv.getUint8(this.index+a);return String.fromCharCode.apply(null,d)};
|
|
1468
|
-
papaya.surface.SurfaceMango.prototype.readData=function(c,a,d){a(.2);this.littleEndian=this.isLittleEndian(c);this.dataLength=c.byteLength;this.v14=this.isVersion14(c);this.v15=this.isVersion15(c);this.index=papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5.length;this.dv=new DataView(c);if(!this.v14&&!this.v15)throw Error("Only Mango surface format version 1.4 and 1.5 are supported!");this.onFinishedRead=d;c=this.dv.getUint32(this.index,this.littleEndian);this.index+=4;this.numSurfaces=this.dv.getUint32(this.index,
|
|
1469
|
-
this.littleEndian);this.index+=4;this.index+=128;this.imageDims[0]=this.dv.getUint32(this.index,this.littleEndian);this.index+=4;this.imageDims[1]=this.dv.getUint32(this.index,this.littleEndian);this.index+=4;this.imageDims[2]=this.dv.getUint32(this.index,this.littleEndian);this.index+=4;this.voxelDims[0]=this.dv.getFloat32(this.index,this.littleEndian);this.index+=4;this.voxelDims[1]=this.dv.getFloat32(this.index,this.littleEndian);this.index+=4;this.voxelDims[2]=this.dv.getFloat32(this.index,this.littleEndian);
|
|
1470
|
-
this.index+=4;this.origin[0]=this.dv.getFloat32(this.index,this.littleEndian)*this.voxelDims[0];this.index+=4;this.origin[1]=this.dv.getFloat32(this.index,this.littleEndian)*this.voxelDims[1];this.index+=4;this.origin[2]=this.dv.getFloat32(this.index,this.littleEndian)*this.voxelDims[2];this.index+=4;this.center[0]=this.imageDims[0]*this.voxelDims[0]/2;this.center[1]=this.imageDims[1]*this.voxelDims[1]/2;this.center[2]=this.imageDims[2]*this.voxelDims[2]/2;this.v14?(this.diffs[0]=this.center[0]-this.origin[0],
|
|
1471
|
-
this.diffs[1]=this.center[1]-this.origin[1],this.diffs[2]=this.origin[2]-this.center[2]):(this.diffs[0]=this.center[0]-this.origin[0],this.diffs[1]=this.center[1]-this.origin[1],this.diffs[2]=this.center[2]-this.origin[2]);this.index+=4;this.index+=c;this.readNextSurface(this,a)};
|
|
1472
|
-
papaya.surface.SurfaceMango.prototype.readNextSurface=function(c,a){var d=new papaya.surface.SurfaceMangoData;c.index+=papaya.surface.SurfaceMango.NAME_SIZE;c.surfaces[c.surfaceIndex]=d;c.surfaces[c.surfaceIndex].solidColor[0]=c.dv.getFloat32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].solidColor[1]=c.dv.getFloat32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].solidColor[2]=c.dv.getFloat32(c.index,c.littleEndian);c.index+=4;setTimeout(function(){c.readDataPoints(c,
|
|
1473
|
-
a)},0)};
|
|
1474
|
-
papaya.surface.SurfaceMango.prototype.readDataPoints=function(c,a){var d,f;a(.4);c.index+=4;d=c.dv.getInt32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].pointData=new Float32Array(d);if(c.v14)for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].pointData[f]=(2!==f%3?-1:1)*(c.dv.getFloat32(c.index,c.littleEndian)+c.diffs[f%3]);else for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].pointData[f]=(0!==f%3?-1:1)*(c.dv.getFloat32(c.index,c.littleEndian)+c.diffs[f%3]);setTimeout(function(){c.readDataNormals(c,a)},
|
|
1475
|
-
0)};
|
|
1476
|
-
papaya.surface.SurfaceMango.prototype.readDataNormals=function(c,a){var d,f;a(.6);c.index+=4;d=c.dv.getInt32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].normalsData=new Float32Array(d);if(c.v14)for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].normalsData[f]=(2!==f%3?-1:1)*c.dv.getFloat32(c.index,c.littleEndian);else for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].normalsData[f]=(0!==f%3?-1:1)*c.dv.getFloat32(c.index,c.littleEndian);setTimeout(function(){c.readDataTriangles(c,a)},
|
|
1477
|
-
0)};papaya.surface.SurfaceMango.prototype.readDataTriangles=function(c,a){var d,f;a(.8);c.index+=4;d=c.dv.getInt32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].triangleData=new Uint32Array(d);for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].triangleData[f]=c.dv.getUint32(c.index,c.littleEndian);setTimeout(function(){c.readDataColors(c,a)},0)};
|
|
1478
|
-
papaya.surface.SurfaceMango.prototype.readDataColors=function(c,a){for(var d,f,b,e,g,h,m,k;c.index<c.dataLength;)if(c.hasOverlay()){c.index+=papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER.length;c.index+=papaya.surface.SurfaceMango.NAME_SIZE;m=c.getString(papaya.surface.SurfaceMango.NAME_SIZE);c.index+=papaya.surface.SurfaceMango.NAME_SIZE;m=m.replace(/\0/g,"");c.index+=4;d=c.dv.getFloat32(this.index,this.littleEndian);c.index+=4;f=c.dv.getFloat32(this.index,this.littleEndian);c.index+=
|
|
1479
|
-
4;b=255/(f-d);c.index+=4;c.index+=4;e=c.dv.getUint32(this.index,this.littleEndian);c.index+=4;g=new Float32Array(e);for(k=0;k<e;k+=1,c.index+=4)g[k]=c.dv.getFloat32(c.index,c.littleEndian);m=papaya.viewer.ColorTable.findLUT(m)!==papaya.viewer.ColorTable.TABLE_GRAYSCALE?new papaya.viewer.ColorTable(m,!1):new papaya.viewer.ColorTable("Spectrum",!1);m.updateLUT(0,255);e=c.surfaces[c.surfaceIndex].pointData.length/3;null===c.surfaces[c.surfaceIndex].colorsData&&(c.surfaces[c.surfaceIndex].colorsData=
|
|
1480
|
-
new Float32Array(4*e));for(k=0;k<e;k+=1)h=g[k],h<=d?0===c.surfaces[c.surfaceIndex].colorsData[4*k+3]&&(c.surfaces[c.surfaceIndex].colorsData[4*k]=c.surfaces[c.surfaceIndex].solidColor[0],c.surfaces[c.surfaceIndex].colorsData[4*k+1]=c.surfaces[c.surfaceIndex].solidColor[1],c.surfaces[c.surfaceIndex].colorsData[4*k+2]=c.surfaces[c.surfaceIndex].solidColor[2],c.surfaces[c.surfaceIndex].colorsData[4*k+3]=1):(h>f?(c.surfaces[c.surfaceIndex].colorsData[4*k]=m.lookupRed(255)/255,c.surfaces[c.surfaceIndex].colorsData[4*
|
|
1481
|
-
k+1]=m.lookupGreen(255)/255,c.surfaces[c.surfaceIndex].colorsData[4*k+2]=m.lookupBlue(255)/255):(h=Math.floor((h-d)*b+.5),c.surfaces[c.surfaceIndex].colorsData[4*k]=m.lookupRed(h)/255,c.surfaces[c.surfaceIndex].colorsData[4*k+1]=m.lookupGreen(h)/255,c.surfaces[c.surfaceIndex].colorsData[4*k+2]=m.lookupBlue(h)/255),c.surfaces[c.surfaceIndex].colorsData[4*k+3]=1)}else break;c.surfaceIndex++;c.surfaceIndex===c.numSurfaces?setTimeout(function(){c.onFinishedRead()},0):setTimeout(function(){c.readNextSurface(c,
|
|
1482
|
-
a)},0)};papaya.surface.SurfaceMango.prototype.getNumSurfaces=function(){return this.numSurfaces};papaya.surface.SurfaceMango.prototype.getNumPoints=function(c){return this.surfaces[c].pointData.length/3};papaya.surface.SurfaceMango.prototype.getNumTriangles=function(c){return this.surfaces[c].triangleData.length/3};papaya.surface.SurfaceMango.prototype.getSolidColor=function(c){return this.surfaces[c].solidColor};papaya.surface.SurfaceMango.prototype.getPointData=function(c){return this.surfaces[c].pointData};
|
|
1483
|
-
papaya.surface.SurfaceMango.prototype.getNormalsData=function(c){return this.surfaces[c].normalsData};papaya.surface.SurfaceMango.prototype.getTriangleData=function(c){return this.surfaces[c].triangleData};papaya.surface.SurfaceMango.prototype.getColorsData=function(c){return this.surfaces[c].colorsData};"use strict";papaya=papaya||{};papaya.surface=papaya.surface||{};
|
|
1484
|
-
papaya.surface.SurfaceVTK=papaya.surface.SurfaceVTK||function(){this.dv=this.onFinishedRead=this.error=null;this.index=0;this.littleEndian=!0;this.numPoints=0;this.colorsData=this.normalsData=this.triangleData=this.pointData=null;this.solidColor=[1,1,1,1];this.description=this.vtkVersion=null;this.ascii=!1;this.volume=null;this.done=!1};papaya.surface.SurfaceVTK.MAGIC_NUMBER="# vtk DataFile Version";papaya.surface.SurfaceVTK.MAGIC_NUMBER_ASCII="ASCII";
|
|
1485
|
-
papaya.surface.SurfaceVTK.MAGIC_NUMBER_DATASET="DATASET";papaya.surface.SurfaceVTK.MAGIC_NUMBER_POLYDATA="POLYDATA";papaya.surface.SurfaceVTK.MAGIC_NUMBER_POINTS="POINTS";papaya.surface.SurfaceVTK.MAGIC_NUMBER_POLYGONS="POLYGONS";papaya.surface.SurfaceVTK.MAGIC_NUMBER_NORMALS="NORMALS";papaya.surface.SurfaceVTK.isThisFormat=function(c){return c.endsWith(".vtk")};papaya.surface.SurfaceVTK.prototype.isSurfaceDataBinary=function(){return!0};papaya.surface.SurfaceVTK.prototype.hasOverlay=function(){return!1};
|
|
1486
|
-
papaya.surface.SurfaceVTK.prototype.getNextLine=function(c){var a,d,f=[];c||(c=256);for(a=0;a<c;a+=1){if(this.index>=this.dv.byteLength){this.done=!0;break}d=this.dv.getUint8(this.index++);if(32>d)break;f[a]=d}return String.fromCharCode.apply(null,f)};
|
|
1487
|
-
papaya.surface.SurfaceVTK.prototype.readData=function(c,a,d,f){var b=this,e;a(.2);this.onFinishedRead=d;this.dv=new DataView(c);this.volume=f;this.vtkVersion=this.getNextLine().substring(papaya.surface.SurfaceVTK.MAGIC_NUMBER.length).trim();this.description=this.getNextLine().trim();this.ascii=this.getNextLine()==papaya.surface.SurfaceVTK.MAGIC_NUMBER_ASCII;this.datasetType=this.getNextLine().substring(papaya.surface.SurfaceVTK.MAGIC_NUMBER_DATASET.length).trim();this.datasetType!=papaya.surface.SurfaceVTK.MAGIC_NUMBER_POLYDATA&&
|
|
1488
|
-
(this.error=Error("VTK: Only POLYDATA format is currently supported!"),this.onFinishedRead());e=this.getNextLine().split(" ");e[0]==papaya.surface.SurfaceVTK.MAGIC_NUMBER_POINTS&&setTimeout(function(){b.readDataPoints(b,e[1],a)},0)};
|
|
1489
|
-
papaya.surface.SurfaceVTK.prototype.readNextData=function(c,a){var d,f=.2;c.pointData&&(f+=.2);c.normalsData&&(f+=.2);c.triangleData&&(f+=.2);a(f);if(c.done||c.pointData&&c.normalsData&&c.triangleData)c.onFinishedRead();else(d=this.getNextLine().split(" "))&&d[0]==papaya.surface.SurfaceVTK.MAGIC_NUMBER_POINTS?setTimeout(function(){c.readDataPoints(c,d[1],a)},0):d&&d[0]==papaya.surface.SurfaceVTK.MAGIC_NUMBER_POLYGONS?setTimeout(function(){c.readDataTriangles(c,d[1],a)},0):d&&d[0]==papaya.surface.SurfaceVTK.MAGIC_NUMBER_NORMALS?
|
|
1490
|
-
setTimeout(function(){c.readDataNormals(c,a)},0):setTimeout(function(){c.readNextData(c,a)},0)};
|
|
1491
|
-
papaya.surface.SurfaceVTK.prototype.readDataPoints=function(c,a,d){var f,b=0,e=[],g,h=0,m=3*a;c.numPoints=a;c.pointData=new Float32Array(m);var k=c.volume.header.orientation.orientation;f=c.volume.header.voxelDimensions;g=c.volume.header.origin;a=("-"===k.charAt(3)?1:-1)*(f.flip?-1:1);var p="-"!==k.charAt(4)?1:-1,t="-"!==k.charAt(5)?1:-1,w=k.indexOf("X"),B=k.indexOf("Y"),k=k.indexOf("Z"),A=a*g.x*f.xSize,x=p*g.y*f.ySize,G=t*g.z*f.zSize;if(c.ascii)for(;h<m;)for(g=c.getNextLine().trim().split(" "),f=
|
|
1492
|
-
0;f<g.length;f+=1)e[b]=parseFloat(g[f]),2===b&&(c.pointData[h++]=e[w]*a-A,c.pointData[h++]=e[B]*p-x,c.pointData[h++]=e[k]*t-G),b++,b%=3;else for(f=0;f<m;f+=1,c.index+=4)e[b]=c.dv.getFloat32(c.index,!1),2===b&&(c.pointData[h++]=e[w]*a-A,c.pointData[h++]=e[B]*p-x,c.pointData[h++]=e[k]*t-G),b++,b%=3;c.readNextData(c,d)};
|
|
1493
|
-
papaya.surface.SurfaceVTK.prototype.readDataNormals=function(c,a){var d,f,b=0,e=3*c.numPoints;c.normalsData=new Float32Array(e);if(c.ascii)for(;b<e;)for(f=c.getNextLine().trim().split(" "),d=0;d<f.length;d+=1)c.normalsData[b++]=parseFloat(f[d]);else for(d=0;d<e;d+=1,c.index+=4)c.normalsData[d]=c.dv.getFloat32(c.index,!1);c.readNextData(c,a)};
|
|
1494
|
-
papaya.surface.SurfaceVTK.prototype.readDataTriangles=function(c,a,d){var f,b=0,e=3*a;c.triangleData=new Uint32Array(e);if(c.ascii)for(;b<e;)for(a=c.getNextLine().trim().split(" "),f=1;f<a.length;f+=1)c.triangleData[b++]=parseInt(a[f],10);else for(f=0;f<a;f+=1,c.index+=16)c.triangleData[3*f]=c.dv.getUint32(c.index+4,!1),c.triangleData[3*f+1]=c.dv.getUint32(c.index+8,!1),c.triangleData[3*f+2]=c.dv.getUint32(c.index+12,!1);c.readNextData(c,d)};papaya.surface.SurfaceVTK.prototype.getColorsData=function(){return null};
|
|
1495
|
-
papaya.surface.SurfaceVTK.prototype.getNumSurfaces=function(){return 1};papaya.surface.SurfaceVTK.prototype.getNumPoints=function(){return this.pointData.length/3};papaya.surface.SurfaceVTK.prototype.getNumTriangles=function(){return this.triangleData.length/3};papaya.surface.SurfaceVTK.prototype.getSolidColor=function(){return this.solidColor};papaya.surface.SurfaceVTK.prototype.getPointData=function(){return this.pointData};papaya.surface.SurfaceVTK.prototype.getNormalsData=function(){return this.normalsData};
|
|
1496
|
-
papaya.surface.SurfaceVTK.prototype.getTriangleData=function(){return this.triangleData};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};papaya.ui.Dialog=papaya.ui.Dialog||function(c,a,d,f,b,e,g,h){this.container=c;this.viewer=c.viewer;this.title=a;this.modifier="";papaya.utilities.StringUtils.isStringBlank(g)||(this.modifier=g);this.id=this.title.replace(/ /g,"_");this.content=d;this.dataSource=f;this.callback=b;this.callbackOk=e;this.doWrap=h;this.scrollBehavior2=this.scrollBehavior1=null};
|
|
1497
|
-
papaya.ui.Dialog.showModalDialog=function(c,a,d){var f,b,e;c=document.documentElement;var g=window.pageYOffset||c.scrollTop;f=$(window).outerWidth();c=$(window).outerHeight();b=$(d).outerWidth();e=$(d).outerHeight();f=f/2-b/2+"px";c=g+c/2-e/2+"px";$(d).css({position:"absolute",zIndex:100,left:f,top:c});a.removeScroll();$(d).hide().fadeIn(200)};
|
|
1498
|
-
papaya.ui.Dialog.prototype.showDialog=function(){var c,a,d,f,b;f="#"+this.id;c=$(f);c.remove();b=$("body");d="<div id='"+this.id+"' class='"+PAPAYA_DIALOG_CSS+"'><span class='"+PAPAYA_DIALOG_TITLE_CSS+"'>"+this.title+"</span>";if(this.content){d+="<div class='"+PAPAYA_DIALOG_CONTENT_CSS+"'><table>";for(c=0;c<this.content.items.length;c+=1)if(this.content.items[c].spacer)d+="<tr><td class='"+PAPAYA_DIALOG_CONTENT_LABEL_CSS+"'> </td><td class='"+PAPAYA_DIALOG_CONTENT_CONTROL_CSS+"'> </td></tr>";
|
|
1499
|
-
else if(this.content.items[c].readonly)d+="<tr><td class='"+PAPAYA_DIALOG_CONTENT_LABEL_CSS+"'>"+this.content.items[c].label+"</td><td class='"+PAPAYA_DIALOG_CONTENT_CONTROL_CSS+"' id='"+this.content.items[c].field+"'></td></tr>";else{a=this.content.items[c].disabled&&!0===papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this,this.content.items[c].disabled))()?"disabled='disabled'":"";d+="<tr><td class='"+PAPAYA_DIALOG_CONTENT_LABEL_CSS+"'>"+this.content.items[c].label+
|
|
1500
|
-
"</td><td class='"+PAPAYA_DIALOG_CONTENT_CONTROL_CSS+"'><select "+a+" id='"+this.content.items[c].field+"'>";for(a=0;a<this.content.items[c].options.length;a+=1)d+="<option value='"+this.content.items[c].options[a]+"'>"+papaya.utilities.StringUtils.truncateMiddleString(this.content.items[c].options[a].toString(),40)+"</option>";d+="</select></td></tr>";this.content.items[c].help&&(d+="<tr><td colspan='2' class='"+PAPAYA_DIALOG_CONTENT_HELP+"'>"+this.content.items[c].help+"</td></tr>")}d+="</table></div>"}d+=
|
|
1501
|
-
"<div class='"+PAPAYA_DIALOG_BUTTON_CSS+"'><button type='button' id='"+this.id+"-Ok'>Ok</button></div></div>";b.append('<div class="'+PAPAYA_DIALOG_BACKGROUND+'"></div>');b.append(d);for(c=0;c<this.content.items.length;c+=1)this.content.items[c].readonly?(d=this.dataSource[this.content.items[c].field](this.modifier),null!==d?$("#"+this.content.items[c].field).html(d):$("#"+this.content.items[c].field).parent().remove()):this.content.items[c].spacer||(d=$("#"+this.content.items[c].field),d.val(this.dataSource[this.content.items[c].field]),
|
|
1502
|
-
d.change(papaya.utilities.ObjectUtils.bind(this,this.doAction,[this.content.items[c].field])));this.doWrap||$("."+PAPAYA_DIALOG_CONTENT_CSS).addClass(PAPAYA_DIALOG_CONTENT_NOWRAP_CSS);$("#"+this.id+"-Ok").click(papaya.utilities.ObjectUtils.bind(this,this.doOk));c=$(f);b.addClass(PAPAYA_DIALOG_STOPSCROLL);papaya.ui.Dialog.showModalDialog(this,this.viewer,c[0])};
|
|
1503
|
-
papaya.ui.Dialog.prototype.doOk=function(){var c,a;c=$("."+PAPAYA_DIALOG_CSS);a=$("."+PAPAYA_DIALOG_BACKGROUND);c.hide(100);a.hide(100);c.remove();a.remove();window.onmousewheel=this.scrollBehavior1;document.onmousewheel=this.scrollBehavior2;this.callbackOk&&this.callbackOk();$("body").removeClass(PAPAYA_DIALOG_STOPSCROLL);this.container.viewer.addScroll()};papaya.ui.Dialog.prototype.doAction=function(c){this.callback(c,$("#"+c).val())};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
|
|
1504
|
-
papaya.ui.Menu=papaya.ui.Menu||function(c,a,d,f,b){this.viewer=c;this.method=a.method;this.isTitleBar=a.titleBar;this.label=a.label;this.icons=a.icons;this.callback=d;this.dataSource=f;this.items=[];this.rangeItem=null;this.menuOnHover=a.menuOnHover;this.contextMenu=!1;void 0===b||null===b?(this.imageIndex=-1,this.modifier=this.viewer.container.containerIndex):(this.imageIndex=b,this.modifier=b+this.viewer.container.containerIndex);this.buttonId=this.label.replace(/ /g,"_").replace("...","_")+(this.modifier||
|
|
1505
|
-
"");this.menuId=(this.label+"Menu").replace(/ /g,"_").replace("...","_")+(this.modifier||"");this.isRight=null!==a.icons;this.isImageButton=a.imageButton;this.isSurfaceButton=a.surfaceButton;this.htmlParent=this.viewer.container.showControlBar&&this.viewer.container.kioskMode&&this.viewer.container.showImageButtons?this.viewer.container.sliderControlHtml:this.viewer.container.toolbarHtml};
|
|
1506
|
-
papaya.ui.Menu.doShowMenu=function(c,a,d,f){var b,e,g,h,m;b=$(c.canvas).offset();m=$(c.container.display.canvas).outerHeight();e=$(a).offset();g=$(a).outerWidth();h=$(d).outerWidth();a=$(d).outerHeight();f=e.left+(f?-1*h+g:5)+"px";c=c.container.showControlBar&&c.container.kioskMode&&c.container.showImageButtons?b.top+$(c.canvas).outerHeight()+PAPAYA_SPACING+m-a+"px":b.top+"px";$(d).css({position:"absolute",zIndex:100,left:f,top:c});$(d).hide().fadeIn(200)};
|
|
1507
|
-
papaya.ui.Menu.getColorComponents=function(c){return c?c.match(/\d+/g):[0,0,0,255]};papaya.ui.Menu.getNiceForegroundColor=function(c){c=papaya.ui.Menu.getColorComponents(c);127<(parseInt(c[0])+parseInt(c[1])+parseInt(c[2]))/3?c[0]=c[1]=c[2]=0:c[0]=c[1]=c[2]=255;return"rgb("+c[0]+", "+c[1]+", "+c[2]+")"};
|
|
1508
|
-
papaya.ui.Menu.prototype.buildMenuButton=function(){var c,a,d;d="#"+this.buttonId;c=$(d);c.remove();c=null;this.icons?(c="<span id='"+this.buttonId+"' class='"+PAPAYA_MENU_UNSELECTABLE+" "+PAPAYA_MENU_ICON_CSS+" "+(this.isImageButton?PAPAYA_MENU_BUTTON_CSS:"")+"'"+(this.isRight?" style='float:right'":"")+"><img class='"+PAPAYA_MENU_UNSELECTABLE+"' style='width:"+papaya.viewer.ColorTable.ICON_SIZE+"px; height:"+papaya.viewer.ColorTable.ICON_SIZE+"px; vertical-align:bottom; ",c=!this.isSurfaceButton&&
|
|
1509
|
-
this.dataSource.isSelected(parseInt(this.imageIndex,10))?c+"border:2px solid #FF5A3D;background-color:#eeeeee;padding:1px;":c+"border:2px outset lightgray;background-color:#eeeeee;padding:1px;",c=this.method?c+("' src='"+this.icons[papaya.utilities.ObjectUtils.bind(this.viewer,papaya.utilities.ObjectUtils.dereferenceIn(this.viewer,this.method))()?1:0]+"' /></span>"):c+("' src='"+this.icons[0]+"' /></span>")):c=this.isTitleBar?"<div class='"+PAPAYA_MENU_UNSELECTABLE+" "+PAPAYA_MENU_TITLEBAR_CSS+" "+
|
|
1510
|
-
PAPAYA_TITLEBAR_CSS+"' style='z-index:-1;position:absolute;top:"+(this.viewer.container.viewerHtml.position().top-1.25*papaya.ui.Toolbar.SIZE)+"px;width:"+this.htmlParent.width()+"px;text-align:center;color:"+papaya.ui.Menu.getNiceForegroundColor(this.viewer.bgColor)+"'>"+this.label+"</div>":"<span id='"+this.buttonId+"' class='"+PAPAYA_MENU_UNSELECTABLE+" "+PAPAYA_MENU_LABEL_CSS+"'>"+this.label+"</span>";this.htmlParent.append(c);this.isTitleBar||(c=$(d),d="#"+this.buttonId+" > img",d=$(d),a=this,
|
|
1511
|
-
this.menuOnHover&&(d.mouseenter(function(){a.showHoverMenuTimeout=setTimeout(papaya.utilities.ObjectUtils.bind(a,a.showMenu),500)}),d.mouseleave(function(){clearTimeout(a.showHoverMenuTimeout);a.showHoverMenuTimeout=null})),c.click(papaya.utilities.ObjectUtils.bind(this,this.doClick)),this.icons?(d.hover(function(){1<a.icons.length?$(this).css({"border-color":"gray"}):$(this).css({"border-color":"#FF5A3D"})},papaya.utilities.ObjectUtils.bind(a,function(){a.dataSource.isSelected(parseInt(a.imageIndex,
|
|
1512
|
-
10))&&a.dataSource.isSelectable()?$("#"+a.buttonId+" > img").css({border:"2px solid #FF5A3D"}):$("#"+a.buttonId+" > img").css({border:"2px outset lightgray"})})),d.mousedown(function(){$(this).css({border:"2px inset lightgray"})}),d.mouseup(function(){$(this).css({border:"2px outset lightgray"})})):this.isTitleBar||c.hover(function(){$(this).toggleClass(PAPAYA_MENU_BUTTON_HOVERING_CSS)}));return this.buttonId};papaya.ui.Menu.prototype.setMenuButton=function(c){this.buttonId=c};
|
|
1513
|
-
papaya.ui.Menu.prototype.buildMenu=function(){var c;this.htmlParent.append("<ul id='"+this.menuId+"' class='"+PAPAYA_MENU_CSS+"'></ul>");this.viewer.container.contextManager&&papaya.utilities.PlatformUtils.smallScreen&&($("#"+this.menuId)[0].style.width=this.viewer.viewerDim-10+"px");for(c=0;c<this.items.length;c+=1)this.items[c].hide||this.items[c].buildHTML(this.menuId)};papaya.ui.Menu.prototype.addMenuItem=function(c){c instanceof papaya.ui.MenuItemRange&&(this.rangeItem=c);this.items.push(c)};
|
|
1514
|
-
papaya.ui.Menu.prototype.showContextMenu=function(){var c,a,d,f=0,b;0<this.items.length&&(d="#"+this.menuId,a=$(d),c=a.is(":visible"),a.remove(),c||(this.htmlParent=this.viewer.container.viewerHtml,this.buildMenu(),a=$(d),a.hide(),c=a.outerHeight(),d=$(this.viewer.canvas).offset(),b=$(this.viewer.container.display.canvas).outerHeight(),this.viewer.contextMenuMousePositionY+c>d.top+b+$(this.viewer.canvas).outerHeight()+PAPAYA_SPACING&&(f=this.viewer.contextMenuMousePositionY+c-(d.top+b+$(this.viewer.canvas).outerHeight()+
|
|
1515
|
-
PAPAYA_SPACING)-1),this.viewer.container.contextManager&&papaya.utilities.PlatformUtils.smallScreen?a.css({position:"absolute",zIndex:100,left:this.viewer.canvasRect.left,top:this.viewer.canvasRect.top-f}):a.css({position:"absolute",zIndex:100,left:this.viewer.contextMenuMousePositionX+this.viewer.canvasRect.left,top:this.viewer.contextMenuMousePositionY+this.viewer.canvasRect.top-f}),a.hide().fadeIn(200)))};
|
|
1516
|
-
papaya.ui.Menu.prototype.showMenu=function(){var c,a,d;this.viewer.container.toolbar.closeAllMenus();this.contextMenu?this.showContextMenu():0<this.items.length&&(d="#"+this.menuId,a=$(d),c=a.is(":visible"),a.remove(),c||(c=$("#"+this.buttonId),this.buildMenu(),a=$(d),a.hide(),papaya.ui.Menu.doShowMenu(this.viewer,c[0],a[0],this.isRight)))};
|
|
1517
|
-
papaya.ui.Menu.prototype.doClick=function(){var c;c=$("#"+this.menuId).is(":visible");this.callback(this.buttonId);this.icons&&(this.method?$("#"+this.buttonId+" > img").attr("src",this.icons[papaya.utilities.ObjectUtils.bind(this.viewer,papaya.utilities.ObjectUtils.dereferenceIn(this.viewer,this.method))()?1:0]):$("#"+this.buttonId+" > img").attr("src",this.icons[0]));this.menuOnHover||c||this.showMenu()};
|
|
1518
|
-
papaya.ui.Menu.prototype.updateRangeItem=function(c,a){this.rangeItem&&($("#"+this.rangeItem.minId).val(c),$("#"+this.rangeItem.maxId).val(a))};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
|
|
1519
|
-
papaya.ui.MenuItem=papaya.ui.MenuItem||function(c,a,d,f,b,e,g){this.viewer=c;this.modifier="";papaya.utilities.StringUtils.isStringBlank(g)||(this.modifier="-"+g);this.dataSource=b;this.method=e;this.label=this.dataSource&&this.method?this.dataSource[this.method]():a;this.action=d+this.modifier;this.id=this.action.replace(/ /g,"_")+this.viewer.container.containerIndex;this.callback=f;this.menu=null;this.isContext=!1};
|
|
1520
|
-
papaya.ui.MenuItem.prototype.buildHTML=function(c){var a;a=this.dataSource&&this.method?this.dataSource[this.method]():this.label;a="<li id='"+this.id+"'><span class='"+PAPAYA_MENU_UNSELECTABLE+"'>"+a+"</span>"+(this.menu?"<span style='float:right'> ▶</span>":"")+"</li>";$("#"+c).append(a);c=$("#"+this.id);this.viewer.container.contextManager&&papaya.utilities.PlatformUtils.smallScreen&&(c[0].style.width=this.viewer.viewerDim-10+"px",c[0].style.fontSize="18px");c.click(papaya.utilities.ObjectUtils.bind(this,
|
|
1521
|
-
function(a){this.doAction(this.isContext&&a.shiftKey)}));c.hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)})};papaya.ui.MenuItem.prototype.doAction=function(c){c||this.menu||(this.viewer.showingContextMenu=!1);this.callback(this.action,null,c)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
|
|
1522
|
-
papaya.ui.MenuItemCheckBox=papaya.ui.MenuItemCheckBox||function(c,a,d,f,b,e,g){this.viewer=c;this.label=a;this.modifier="";void 0!==g&&null!==g&&(this.modifier="-"+g);this.action=d+this.modifier;this.method=e;this.id=this.action.replace(/ /g,"_").replace(/\(/g,"").replace(/\)/g,"")+this.viewer.container.containerIndex;this.callback=f;this.dataSource=b};
|
|
1523
|
-
papaya.ui.MenuItemCheckBox.prototype.buildHTML=function(c){var a,d;a=this.dataSource[this.method](this.label);d="";a&&(d="checked='checked'");a="<li id='"+this.id+"'><input type='checkbox' class='"+PAPAYA_MENU_COLORTABLE_CSS+"' name='"+PAPAYA_MENU_COLORTABLE_CSS+"' id='"+this.id+"' value='"+this.id+"' "+d+"><span class='"+PAPAYA_MENU_UNSELECTABLE+"'> "+this.label+"</span></li>";$("#"+c).append(a);c=$("#"+this.id);c.click(papaya.utilities.ObjectUtils.bind(this,this.doAction));c.hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)})};
|
|
1524
|
-
papaya.ui.MenuItemCheckBox.prototype.doAction=function(){$("."+PAPAYA_MENU_COLORTABLE_CSS).removeAttr("checked");$("#"+this.id+" > input")[0].checked=!0;this.callback(this.action,null,!0)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
|
|
1525
|
-
papaya.ui.MenuItemRadioButton=papaya.ui.MenuItemRadioButton||function(c,a,d,f,b,e,g){this.viewer=c;this.label=a;this.modifier="";void 0!==g&&null!==g&&(this.modifier="-"+g);this.methodParam=this.action=d+this.modifier;this.method=e;this.id=this.action.replace(/ /g,"_").replace(/\(/g,"").replace(/\)/g,"")+this.viewer.container.containerIndex;this.callback=f;this.dataSource=b};
|
|
1526
|
-
papaya.ui.MenuItemRadioButton.prototype.buildHTML=function(c){var a,d;a=this.dataSource[this.method](this.label);d="";a&&(d="checked='checked'");a="<li id='"+this.id+"'><input type='radio' class='"+PAPAYA_MENU_COLORTABLE_CSS+"' name='"+PAPAYA_MENU_COLORTABLE_CSS+"' id='"+this.id+"' value='"+this.id+"' "+d+"><span class='"+PAPAYA_MENU_UNSELECTABLE+"'> "+this.label+"</span></li>";$("#"+c).append(a);c=$("#"+this.id);c.click(papaya.utilities.ObjectUtils.bind(this,this.doAction));c.hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)})};
|
|
1527
|
-
papaya.ui.MenuItemRadioButton.prototype.doAction=function(){$("."+PAPAYA_MENU_COLORTABLE_CSS).removeAttr("checked");$("#"+this.id+" > input")[0].checked=!0;this.callback(this.action,null,!0)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
|
|
1528
|
-
papaya.ui.MenuItemFileChooser=papaya.ui.MenuItemFileChooser||function(c,a,d,f,b,e){this.viewer=c;this.label=a;this.modifier="";void 0!==e&&null!==e&&(this.modifier="-"+e);this.action=d+this.modifier;this.id=this.action.replace(/ /g,"_")+this.viewer.container.containerIndex;this.fileChooserId="fileChooser"+this.label.replace(/ /g,"_").replace(/\./g,"")+this.viewer.container.containerIndex+(b?"folder":"");this.callback=f;this.folder=b};
|
|
1529
|
-
papaya.ui.MenuItemFileChooser.prototype.buildHTML=function(c){var a,d;a=this;d="<li id='"+this.id+"'><span class='"+PAPAYA_MENU_UNSELECTABLE+"'><label class='"+PAPAYA_MENU_FILECHOOSER+"' for='"+this.fileChooserId+"'>"+this.label;d=this.folder?d+("</label><input type='file' id='"+this.fileChooserId+"' multiple='multiple' webkitdirectory directory name='files' /></span></li>"):d+("</label><input type='file' id='"+this.fileChooserId+"' multiple='multiple' name='files' /></span></li>");$("#"+c).append(d);
|
|
1530
|
-
$("#"+this.fileChooserId)[0].onchange=papaya.utilities.ObjectUtils.bind(a,function(){a.callback(a.action,document.getElementById(a.fileChooserId).files)});$("#"+this.id).hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)})};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
|
|
1531
|
-
papaya.ui.MenuItemRange=papaya.ui.MenuItemRange||function(c,a,d,f,b,e,g){"ChangeRangeNeg"===d&&(this.negatives=!0,g=c.getScreenVolumeIndex(c.screenVolumes[parseInt(g)].negativeScreenVol).toString());this.viewer=c;this.label=a;this.index=g;this.modifier="";void 0!==g&&(this.modifier="-"+g);this.action=d+this.modifier;this.minId=this.action.replace(/ /g,"_")+"Min"+this.viewer.container.containerIndex;this.maxId=this.action.replace(/ /g,"_")+"Max"+this.viewer.container.containerIndex;this.callback=f;
|
|
1532
|
-
this.dataSource=b;this.method=e;this.id=a+this.modifier+this.viewer.container.containerIndex;this.grabOffset=0;this.screenVol=this.viewer.screenVolumes[this.index]};papaya.ui.MenuItemRange.getRelativeMousePositionFromParentX=function(c,a){var d=c.parent().offset();return papaya.utilities.PlatformUtils.getMousePositionX(a)-d.left};papaya.ui.MenuItemRange.getRelativeMousePositionX=function(c,a){var d=c.offset();return papaya.utilities.PlatformUtils.getMousePositionX(a)-d.left};
|
|
1533
|
-
papaya.ui.MenuItemRange.prototype.buildHTML=function(c){var a,d,f,b,e,g,h,m,k,p;e=this.id+"SliderMin";h=this.id+"SliderMax";k=this.id+"Slider";a=this.dataSource[this.method]();d=this;a="<li id='"+this.id+"'><span class='"+PAPAYA_MENU_UNSELECTABLE+"' style=''><input class='"+PAPAYA_MENU_INPUT_FIELD+"' type='text' size='4' id='"+this.minId+"' value='"+a[0]+"' /><div style='display:inline-block;position:relative;width:"+(papaya.viewer.ColorTable.COLOR_BAR_WIDTH+papaya.viewer.ColorTable.ARROW_ICON_WIDTH)+
|
|
1534
|
-
"px;top:-12px;'><img id='"+e+"' class='"+PAPAYA_MENU_UNSELECTABLE+"' style='position:absolute;top:5px;left:"+d.screenVol.colorTable.minLUT/papaya.viewer.ColorTable.LUT_MAX*(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1)+"px;z-index:99' src='"+papaya.viewer.ColorTable.ARROW_ICON+"' /><img id='"+h+"' class='"+PAPAYA_MENU_UNSELECTABLE+"' style='position:absolute;top:5px;left:"+d.screenVol.colorTable.maxLUT/papaya.viewer.ColorTable.LUT_MAX*(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1)+"px;z-index:99' src='"+
|
|
1535
|
-
papaya.viewer.ColorTable.ARROW_ICON+"' /><img id='"+k+"' class='"+PAPAYA_MENU_UNSELECTABLE+"' style='position:absolute;top:0;left:"+parseInt(papaya.viewer.ColorTable.ARROW_ICON_WIDTH/2,10)+"px;' src='"+this.viewer.screenVolumes[parseInt(this.index,10)].colorBar+"' /></div><input class='"+PAPAYA_MENU_INPUT_FIELD+"' type='text' size='4' id='"+this.maxId+"' value='"+a[1]+"' /></span></li>";$("#"+c).append(a);f=$("#"+this.minId);b=$("#"+this.maxId);g=$("#"+e);m=$("#"+h);p=$("#"+k);papaya.utilities.PlatformUtils.ios&&
|
|
1536
|
-
(f[0].style.width="35px",f[0].style.marginRight="4px",b[0].style.width="35px",b[0].style.marginRight="4px");g.bind(papaya.utilities.PlatformUtils.ios?"touchstart":"mousedown",function(a){d.grabOffset=papaya.ui.MenuItemRange.getRelativeMousePositionX(g,a);$(window).bind(papaya.utilities.PlatformUtils.ios?"touchmove":"mousemove",function(a){var b;b=d.screenVol.colorTable.maxLUT/papaya.viewer.ColorTable.LUT_MAX*(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1);a=papaya.ui.MenuItemRange.getRelativeMousePositionFromParentX(g,
|
|
1537
|
-
a)-d.grabOffset;0>a?a=0:a>=papaya.viewer.ColorTable.COLOR_BAR_WIDTH?a=papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1:a>b&&(a=b);d.screenVol.updateMinLUT(Math.round(a/(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1)*papaya.viewer.ColorTable.LUT_MAX));g.css({left:a+"px"});d.viewer.drawViewer(!1,!0);f.val(d.dataSource[d.method]()[0]);d.screenVol.updateColorBar();p.attr("src",d.screenVol.colorBar)});return!1});m.bind(papaya.utilities.PlatformUtils.ios?"touchstart":"mousedown",function(a){d.grabOffset=papaya.ui.MenuItemRange.getRelativeMousePositionX(m,
|
|
1538
|
-
a);$(window).bind(papaya.utilities.PlatformUtils.ios?"touchmove":"mousemove",function(a){var c;c=d.screenVol.colorTable.minLUT/papaya.viewer.ColorTable.LUT_MAX*(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1);a=papaya.ui.MenuItemRange.getRelativeMousePositionFromParentX(m,a)-d.grabOffset;0>a?a=0:a>=papaya.viewer.ColorTable.COLOR_BAR_WIDTH?a=papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1:a<c&&(a=c);d.screenVol.updateMaxLUT(Math.round(a/(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1)*papaya.viewer.ColorTable.LUT_MAX));
|
|
1539
|
-
m.css({left:a+"px"});d.viewer.drawViewer(!1,!0);b.val(d.dataSource[d.method]()[1]);d.screenVol.updateColorBar();p.attr("src",d.screenVol.colorBar)});return!1});$(window).bind(papaya.utilities.PlatformUtils.ios?"touchend":"mouseup",function(){$(window).unbind(papaya.utilities.PlatformUtils.ios?"touchmove":"mousemove")});$("#"+this.id).hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)});f.change(papaya.utilities.ObjectUtils.bind(this,function(){d.rangeChanged(!0)}));b.change(papaya.utilities.ObjectUtils.bind(this,
|
|
1540
|
-
function(){d.rangeChanged(!1)}));f.keyup(papaya.utilities.ObjectUtils.bind(this,function(a){13===a.keyCode&&(d.rangeChanged(!1),d.viewer.container.toolbar.closeAllMenus())}));b.keyup(papaya.utilities.ObjectUtils.bind(this,function(a){13===a.keyCode&&(d.rangeChanged(!1),d.viewer.container.toolbar.closeAllMenus())}));papaya.utilities.PlatformUtils.ios||setTimeout(function(){f.focus();f.select()},10)};
|
|
1541
|
-
papaya.ui.MenuItemRange.prototype.rangeChanged=function(c){this.updateDataSource(c);this.viewer.drawViewer(!0);this.resetSlider()};papaya.ui.MenuItemRange.prototype.updateDataSource=function(c){var a,d,f,b;b=$("#"+this.minId);f=$("#"+this.maxId);d=parseFloat(b.val());isNaN(d)&&(d=this.dataSource.screenMin);a=parseFloat(f.val());isNaN(a)&&(a=this.dataSource.screenMax);b.val(d);f.val(a);this.negatives?this.dataSource.setScreenRangeNegatives(d,a):this.dataSource.setScreenRange(d,a);c&&(f.focus(),f.select())};
|
|
1542
|
-
papaya.ui.MenuItemRange.prototype.resetSlider=function(){var c,a,d;c=this.id+"SliderMin";a=this.id+"SliderMax";d=this.id+"Slider";c=$("#"+c);a=$("#"+a);d=$("#"+d);c.css({left:0});a.css({left:papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1+"px"});this.screenVol.resetDynamicRange();d.attr("src",this.screenVol.colorBar)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
|
|
1543
|
-
papaya.ui.MenuItemSlider=papaya.ui.MenuItemSlider||function(c,a,d,f,b,e,g){"alphaneg"===d&&(d="alpha",g=c.getScreenVolumeIndex(c.screenVolumes[parseInt(g)].negativeScreenVol).toString());this.viewer=c;this.label=a;this.index=g;this.modifier="";papaya.utilities.StringUtils.isStringBlank(g)||(this.modifier="-"+g);this.dataSource=b;this.method=e;this.action=d;this.event=-1!=this.action.toLowerCase().indexOf("alpha")||this.viewer.screenVolumes[0].isHighResSlice?"change":"input change";this.id=this.action.replace(/ /g,
|
|
1544
|
-
"_")+this.viewer.container.containerIndex+"_"+this.index;this.callback=f;this.screenVol=b};
|
|
1545
|
-
papaya.ui.MenuItemSlider.prototype.buildHTML=function(c){var a,d,f,b,e;e=this.event;d=this.id+"Slider";a="<li id='"+this.id+"'><span style='padding-right:5px;' class='"+PAPAYA_MENU_UNSELECTABLE+"'>"+this.label+":</span><input min='0' max='100' value='"+parseInt(100*(1-this.screenVol[this.action]),10)+"' id='"+d+"' class='"+PAPAYA_MENU_SLIDER+"' type='range' /></li>";$("#"+c).append(a);$("#"+this.id).hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)});f=$("#"+d);b=this;$("#"+this.id+"Slider").on(e,
|
|
1546
|
-
function(){b.screenVol[b.action]=1-f.val()/100;b.doAction();b.viewer.drawViewer(!0,!1)})};papaya.ui.MenuItemSlider.prototype.doAction=function(){this.callback(this.action,null,!0)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};papaya.ui.MenuItemSpacer=papaya.ui.MenuItemSpacer||function(){};papaya.ui.MenuItemSpacer.prototype.buildHTML=function(c){var a;a="<div class='"+PAPAYA_MENU_SPACER_CSS+" "+PAPAYA_MENU_UNSELECTABLE+"'></div>";$("#"+c).append(a)};"use strict";papaya=papaya||{};
|
|
1547
|
-
papaya.ui=papaya.ui||{};papayaLoadableImages=papayaLoadableImages||[];papaya.ui.Toolbar=papaya.ui.Toolbar||function(c){this.container=c;this.viewer=c.viewer;this.spaceMenu=this.surfaceMenus=this.imageMenus=null};papaya.ui.Toolbar.SIZE=22;papaya.ui.Toolbar.ICON_IMAGESPACE="data:image/gif;base64,R0lGODlhFAAUAPcAMf//////GP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2f/ZNbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1qWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpVpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACoALAAAAAAUABQAAAipAFUIHEiwoMB/A1coXLiwisOHVf4hVLFCosWLGC9SzMgR48Z/VEJSUVjFj0mTESdWBCmS5EmU/6oIXCly5IqSLx/OlFjT5Us/DneybIkzp8yPDElChCjwj8Q/UKOqmkqVatOnUaGqmsaVq1UVTv+lGjv2z9SuXlVdFUs2ldmtaKeubev2bFy1YCXSfYt2mty8/6CS5XtXRcasVRMftJj1beK/hicanKwiIAA7";
|
|
1548
|
-
papaya.ui.Toolbar.ICON_WORLDSPACE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAplJREFUeNqM1H1ozVEcx/Hr3p+7O08jQzbzMErznEItK0+Fv0Ye/tki20ia//wn+YMSaXkoEiKkkCVKZhOipsnDstnFagzlrmGMNfeO6/Nd71unu2s59bq7O517ft/z/X7Pz+dLPUbLJrkqX+SbdEubfJZK2cC6PiOQYm61HJcpkintEpcmCcpryZV5spaHhvvbdJ9slsPyU67wgPlEli0X5aiMkMeyXSbKnVRRVxDRRtkm5czbZrv5vkgu8z1P9stWfleRHGkhT3xCLu1YzZIjpfKWnA6VEn43mwcWEaWlo1Ve2YZj5Jms53iP5BjFsFz9lg/yDj0U7JbslFpZQyBP2a83khoiLiWPA/h/OVGOk+GwnJ5y1iyRS5Im1VLm18cKOc+CYrlGjnxUuZPIOlAn0yWdNXdlrMyRE7LM00eBjBT7niFVTvHsKJ8k6sw1yC4ZIl0EUMOcRT/X44v14xEZSBWfk+d8NpzKujgPGiYrOXI+XTGeGtjpewtjm16Qh3JT3sgvickfNo4yF6V4PVyE2wQUZvP7FmmIa/iDIpwkHRPkrC2iEIlhEZ2mtarIsz3sOoX0PPrP7nAWPRYjj51E85JiJEYO0VsfR5hL5wZal3T7aZl10kLiEyNEHtOSbt4g/gaduRjzC+S9RwtZ332XBxQpzGZ+p72SR5BumUYHLaaDSiySUXKPig6Wj+SmjX5s4BQB0pFBQVo4dhenspfKC1kaYLKVa9pOAW5Q2Ww2qeU92kHbzZRDvK2sBSfLDLtNUp/82rOj7nDm9tJi7lhoeWNzG7Pkqxz8R5p8ByhcGVd0CzkOOWv28KBJvNGa+V2/Y5U08vQm8mgvmTNyjpxHSFUj6/9rZPKerGSTuCPCi7qIdX3GXwEGAPFYt+/OgAXDAAAAAElFTkSuQmCC";
|
|
1549
|
-
papaya.ui.Toolbar.ICON_EXPAND="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAE00lEQVR42u2djW3UQBCFJx3QAemAdJBQAVABTgekAqCC0EGOCoAKWDqADkIHKQGPfKdEh3Nr7493Z977pJWQwtk7+77ETs6zdyYEmrPWEyBtoQDgUABwKAA4FAAcCgAOBQCHAoBDAcChAOBQAHAoADgUABwKAE6uALfjuGg094dx7Mbxo9H5D7wZxzCOF43O/3scN6kvzhXg5ziuGhV+4K20k0DD/964/jCO16kv9iCABvCu0bm/ySRgS4KAC7Abx3Wjc9/J9OO/JUGABXjYn/9Po/O/kimAVtd/EQMC6E1Krevkbhx/Kx17KSpBrcuAHjd2kx2kcwGUYRxfy60LBO9lEjxGEAMCKINQgqUsDV8JYkQAZRBKEGNN+EqQzgTQa/6p69YglOA5YuHPrW2QzgT4NI77SCGDUIJjYuEP4ziXaX2fEqRDAT4vLIgSTCxdq49iSIA1hSGzZo3MCbC2QDTWro1JAVIKRSBlTcwKkFqwV1LXwrQAOYV7ImcNzAuQuwDWya3dhQAlFsIiJWp2I0CpBbFCqVpdCVByYXqmZI3uBCi9QL1RujaXAigeJahRk1sBFE8S1KrFtQCKBwlq1uBeAMWyBLXnDiGAYlGCLeYMI4BiSYKt5golgGJBgi3nCCeA0rMEW88NUgClRwlazKk7AeaaI3WCpQVQepKg1VzmBMhqjs0V4Lg9unavXg8StJzDS5keDX/ai5jVHl9ih5DDBgka/hep36jZMoAeBNRexA8ySaBzydobweoWMS2C6CH84lgVQNkyEJfhK5YFULYIxm34inUBlFhA55K+h8DcTddTBjEcvuJBAOWUBIOkh3Qp0+/ZpY/bDV4EUJ6T4GocvxKP+ZwAgzgIX/EkgKIS6K+ihx/ZQTL+Srbn+K+dgzgJX/EmgKLX7fP9v1O/84+53B8zSPs9iYriUQCyAgoADgUAhwKAQwHAoQDgUABwKAA4FAAcCgAOBQCHAoBDAcChAOB4FEDfDr6Sacfykm8Hy/6YfDu4Y46fCgpS9oEQ7X3QZ/L5QEiH8JGwBLwIcOqh0CtJF6DWw6bd4EGAUyHpj2z9iJWcx8LvT3x9EOMSWBeAjSGZWBaArWEFsCoAm0MLwfZwO+c+0FV7+NwGETk3XTF6CKDlHOY+rLrpBhHcImbbuXS3RQw3idp2Tt1tEsVt4rhNHDeK3HCOUAJYCH/rucIIYCn8LecMIYDF8Leau3sBLIe/RQ2uBfAQfu1a3ArgKfyaNbkUwGP4tWpzJ4Dn8GvU6EoAhPBL1+pGAKTwS9bsQgDE8EvVbl4A5PBLrIFpARj+I6lrYVYAhv8/KWtiUgCG/zxr18acAAw/zpo1MiUAw1/O0rUyI8D9woLII0skOBcDAuhHrFxECmH488QkmFvbIJ0JcIpBGH6MmATHBDEiwCAMfylrJAhiQIBBGP5alkoQpHMB9Lr1PX6oJPS4tXsRY+geAkOlY2vX1UXk/wTpXICa1P6w6hhzvXpbo+eHFUDZjeO60bnvpN53/1KCgAuQ1RyZyVxz7NYEARcgqz06k+P2+BYEaSjArcRvUmqh1/+dtAv/wGGDjFb3AXqTfZP6YqtbxJBCUABwKAA4FAAcCgAOBQCHAoBDAcChAOBQAHAoADgUABwKAA4FAIcCgPMPvdAfn3qMP2kAAAAASUVORK5CYII=";
|
|
1550
|
-
papaya.ui.Toolbar.ICON_COLLAPSE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187xPdVQWOk5Q8vxAfSiIUc7Z7xr6zY/+hpqwSyv0I0/QMTRb7RMgBxNodTfSPqdraz/sDjzKBrv4zu2+a2t0/HHzjd2Lbcc2sG7GtsL42K+xLfxtUgI7YHqKlqHK8HbCCXgjHT1cAdMlDetv4FnQ2lLasaOl6vmB0CMmwT/IPszSueHQqv6i/qluqF+oF9TfO2qEGTumJH0qfSv9KH0nfS/9TIp0Wboi/SRdlb6RLgU5u++9nyXYe69fYRPdil1o1WufNSdTTsp75BfllPy8/LI8G7AUuV8ek6fkvfDsCfbNDP0dvRh0CrNqTbV7LfEEGDQPJQadBtfGVMWEq3QWWdufk6ZSNsjG2PQjp3ZcnOWWing6noonSInvi0/Ex+IzAreevPhe+CawpgP1/pMTMDo64G0sTCXIM+KdOnFWRfQKdJvQzV1+Bt8OokmrdtY2yhVX2a+qrykJfMq4Ml3VR4cVzTQVz+UoNne4vcKLoyS+gyKO6EHe+75Fdt0Mbe5bRIf/wjvrVmhbqBN97RD1vxrahvBOfOYzoosH9bq94uejSOQGkVM6sN/7HelL4t10t9F4gPdVzydEOx83Gv+uNxo7XyL/FtFl8z9ZAHF4bBsrEwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAeJJREFUOBG1lU1KA0EQhTP5c5MggkvFvQfQjS4iIcled3qBrDyCHsFsvEBcegBBkEBA0VuIW0UFBX8w4/c6VUMbAhoYG16qquvVm05Nd0+SpmlBI0mSogzxV5iY8Yf6EiWUp6NQasJFWfPL7lucQIzzvoDAn6xxrsRDEXYVrE0S44dM86kJC1GtNKxeDy+ULFDiAbQsrpqtMFeXb3GNuDLBaVmtL6zkZH+qCPegGQm1iftR3CduR3HTanxBY62I4OIiPoGOcoxdMIh4A81ZroMvblgINmiEnBcY0f++Cl6B2rMBzp0n3+aUE8cXEGqdVyaRDSY/FGDP2D4N3B64Bs/Ah/wdsA4acG+U8Fr5GuHtIaItpb1cAW2gv18FEt0HC8CHfM0pVxXXavSSpRG0fMUK1NA5sAeWwSfQ6i7AEPhwf4mJAyDBO3AJVBO0dNLw8x+hFfnLsj0kSlt0+kbYOuExiFuhng7JH2LFld0Ej2AeeCu6cF5cy3vs/XiDeAIWwS3Q298G8ZDoFuiBI7ACdKjegcZYSz2eBgjap1dAxafOkW9zyoUj7LnY/hCFmNsByYQRzf9IR6L5XUKI/uXarHn/4Gvn/H5tQvqfi14rcXHzs6vPYh3RmT9N2ZHWxkYgt4/pN/LAOfka/AG9AAAAAElFTkSuQmCC";
|
|
1551
|
-
papaya.ui.Toolbar.FILE_MENU_DATA={label:"File",icons:null,items:[{label:"Add Image...",action:"OpenImage",type:"file",hide:papaya.utilities.PlatformUtils.ios},{label:"Add Surface...",action:"OpenSurface",type:"file",hide:papaya.utilities.PlatformUtils.ios},{label:"Add DICOM Folder...",action:"OpenFolder",type:"folder",hide:"Chrome"!==papaya.utilities.PlatformUtils.browser||"undefined"===typeof daikon},{label:"Add DTI Vector Series...",action:"OpenDTI",type:"file"},{type:"spacer"},{label:"Close All",
|
|
1552
|
-
action:"CloseAllImages"}]};papaya.ui.Toolbar.RGB_FILE_MENU_DATA={label:"File",icons:null,items:[{label:"Close All",action:"CloseAllImages"}]};
|
|
1553
|
-
papaya.ui.Toolbar.MENU_DATA={menus:[papaya.ui.Toolbar.FILE_MENU_DATA,{label:"View",icons:null,items:[{label:"Orientation",action:"ShowOrientation",type:"checkbox",method:"isShowingOrientation"},{label:"Crosshairs",action:"ShowCrosshairs",type:"checkbox",method:"isShowingCrosshairs"},{label:"Ruler",action:"ShowRuler",type:"checkbox",method:"isShowingRuler"},{type:"spacer",required:"hasSurface"},{label:"Surface Planes",action:"ShowSurfacePlanes",type:"checkbox",method:"isShowingSurfacePlanes",required:"hasSurface"}]},
|
|
1554
|
-
{label:"Settings",icons:null,items:[{label:"Viewer Preferences",action:"Preferences"},{label:"Surface Preferences",action:"SurfacePreferences",required:"hasSurface"}]},{label:"Help",icons:null,items:[{label:"Show Keyboard Reference",action:"KeyboardRef"},{label:"Show Mouse Reference",action:"MouseRef"},{label:"Show License",action:"License"}]},{label:"",icons:null,titleBar:"true"},{label:"EXPAND",icons:[papaya.ui.Toolbar.ICON_EXPAND,papaya.ui.Toolbar.ICON_COLLAPSE],items:[],method:"isCollapsable",
|
|
1555
|
-
required:"isExpandable"},{label:"SPACE",icons:[papaya.ui.Toolbar.ICON_IMAGESPACE,papaya.ui.Toolbar.ICON_WORLDSPACE],items:[],method:"isWorldMode",menuOnHover:!0}]};papaya.ui.Toolbar.MENU_DATA_KIOSK={menus:[{label:"EXPAND",icons:[papaya.ui.Toolbar.ICON_EXPAND,papaya.ui.Toolbar.ICON_COLLAPSE],items:[],method:"isCollapsable",required:"isExpandable"}]};
|
|
1556
|
-
papaya.ui.Toolbar.OVERLAY_IMAGE_MENU_DATA={items:[{label:"Show Header",action:"ShowHeader"},{label:"Show Image Info",action:"ImageInfo"},{type:"spacer",required:"isParametricCombined"},{label:"DisplayRange",action:"ChangeRange",type:"displayrange",method:"getRange"},{label:"Load Negatives",action:"LoadNegatives",required:"canCurrentOverlayLoadNegatives"},{label:"Transparency",action:"alpha",type:"range",method:"getAlpha"},{label:"Color Table",action:"ColorTable",items:[],required:"isNonParametricCombined"},
|
|
1557
|
-
{type:"spacer",required:"isParametricCombined"},{label:"DisplayRange",action:"ChangeRangeNeg",type:"displayrange",method:"getRangeNegative",required:"isParametricCombined"},{label:"Transparency",action:"alphaneg",type:"range",method:"getAlpha",required:"isParametricCombined"},{type:"spacer",required:"isParametricCombined"},{label:"Hide Overlay",action:"ToggleOverlay",method:"getHiddenLabel"},{label:"Close Overlay",action:"CloseOverlay",required:"isDesktopMode"},{label:"Open in Mango",action:"OpenInMango",
|
|
1558
|
-
required:"canOpenInMango"}]};
|
|
1559
|
-
papaya.ui.Toolbar.BASE_IMAGE_MENU_DATA={items:[{label:"Show Header",action:"ShowHeader"},{label:"Show Image Info",action:"ImageInfo"},{label:"DisplayRange",action:"ChangeRange",type:"displayrange",method:"getRange"},papaya.ui.Toolbar.OVERLAY_IMAGE_MENU_DATA.items[6],{label:"Rotation",action:"Rotation",items:[{label:"About X Axis",action:"rotationX",type:"range",method:"getRotationX"},{label:"About Y Axis",action:"rotationY",type:"range",method:"getRotationY"},{label:"About Z Axis",action:"rotationZ",
|
|
1560
|
-
type:"range",method:"getRotationZ"},{label:"Reset Transform",action:"ResetTransform"},{label:"Rotate About Center",action:"Rotate About Center",type:"radiobutton",method:"isRotatingAbout"},{label:"Rotate About Origin",action:"Rotate About Origin",type:"radiobutton",method:"isRotatingAbout"},{label:"Rotate About Crosshairs",action:"Rotate About Crosshairs",type:"radiobutton",method:"isRotatingAbout"}]},{label:"Open in Mango",action:"OpenInMango",required:"canOpenInMango"}]};
|
|
1561
|
-
papaya.ui.Toolbar.RGB_IMAGE_MENU_DATA={items:[{label:"Show Header",action:"ShowHeader"},{label:"Show Image Info",action:"ImageInfo"},{label:"Open in Mango",action:"OpenInMango",required:"canOpenInMango"}]};papaya.ui.Toolbar.SURFACE_MENU_DATA={items:[{label:"Show Surface Info",action:"SurfaceInfo"},{label:"Transparency",action:"alpha",type:"range",method:"getAlpha"}]};
|
|
1562
|
-
papaya.ui.Toolbar.DTI_IMAGE_MENU_DATA={items:[{label:"Show Header",action:"ShowHeader"},{label:"Show Image Info",action:"ImageInfo"},{label:"Display Colors",action:"DTI-RGB",type:"checkbox",method:"isDTIRGB"},{label:"Display Lines",action:"DTI-Lines",type:"checkbox",method:"isDTILines"},{label:"Display Lines & Colors",action:"DTI-LinesColors",type:"checkbox",method:"isDTILinesAndRGB"},{label:"Transparency",action:"alpha",type:"range",method:"getAlpha",required:"canCurrentOverlayLoadMod"},{label:"Modulate with...",
|
|
1563
|
-
action:"DTI-Mod",type:"file",hide:papaya.utilities.PlatformUtils.ios,required:"canCurrentOverlayLoadMod"},{label:"Modulation",action:"dtiAlphaFactor",type:"range",method:"getDtiAlphaFactor",required:"canCurrentOverlayModulate"},{label:"Open in Mango",action:"OpenInMango",required:"canOpenInMango"}]};
|
|
1564
|
-
papaya.ui.Toolbar.PREFERENCES_DATA={items:[{label:"Coordinate display of:",field:"atlasLocks",options:["Mouse","Crosshairs"]},{label:"Scroll wheel behavior:",field:"scrollBehavior",options:["Zoom","Increment Slice"],disabled:"container.disableScrollWheel"},{spacer:"true"},{label:"Smooth display:",field:"smoothDisplay",options:["Yes","No"]},{label:"Radiological display:",field:"radiological",options:["Yes","No"]}]};
|
|
1565
|
-
papaya.ui.Toolbar.PREFERENCES_SURFACE_DATA={items:[{label:"Background color:",field:"surfaceBackgroundColor",options:["Black","Dark Gray","Gray","Light Gray","White"]}]};
|
|
1566
|
-
papaya.ui.Toolbar.IMAGE_INFO_DATA={items:[{label:"Filename:",field:"getFilename",readonly:"true"},{spacer:"true"},{label:"Image Dims:",field:"getImageDimensionsDescription",readonly:"true"},{label:"Voxel Dims:",field:"getVoxelDimensionsDescription",readonly:"true"},{spacer:"true"},{label:"Byte Type:",field:"getByteTypeDescription",readonly:"true"},{label:"Byte Order:",field:"getByteOrderDescription",readonly:"true"},{spacer:"true"},{label:"Orientation:",field:"getOrientationDescription",readonly:"true"},
|
|
1567
|
-
{spacer:"true"},{label:"Notes:",field:"getImageDescription",readonly:"true"}]};
|
|
1568
|
-
papaya.ui.Toolbar.SERIES_INFO_DATA={items:[{label:"Filename:",field:"getFilename",readonly:"true"},{label:"File Length:",field:"getFileLength",readonly:"true"},{spacer:"true"},{label:"Image Dims:",field:"getImageDimensionsDescription",readonly:"true"},{label:"Voxel Dims:",field:"getVoxelDimensionsDescription",readonly:"true"},{label:"Series Points:",field:"getSeriesDimensionsDescription",readonly:"true"},{label:"Series Point Size:",field:"getSeriesSizeDescription",readonly:"true"},{spacer:"true"},
|
|
1569
|
-
{label:"Byte Type:",field:"getByteTypeDescription",readonly:"true"},{label:"Byte Order:",field:"getByteOrderDescription",readonly:"true"},{label:"Compressed:",field:"getCompressedDescription",readonly:"true"},{spacer:"true"},{label:"Orientation:",field:"getOrientationDescription",readonly:"true"},{label:"Notes:",field:"getImageDescription",readonly:"true"}]};
|
|
1570
|
-
papaya.ui.Toolbar.SURFACE_INFO_DATA={items:[{label:"Filename:",field:"getSurfaceFilename",readonly:"true"},{spacer:"true"},{label:"Points:",field:"getSurfaceNumPoints",readonly:"true"},{label:"Triangles:",field:"getSurfaceNumTriangles",readonly:"true"}]};papaya.ui.Toolbar.HEADER_DATA={items:[{label:"",field:"getHeaderDescription",readonly:"true"}]};papaya.ui.Toolbar.LICENSE_DATA={items:[{label:"",field:"getLicense",readonly:"true"}]};
|
|
1571
|
-
papaya.ui.Toolbar.KEYBOARD_REF_DATA={items:[{label:"",field:"getKeyboardReference",readonly:"true"}]};papaya.ui.Toolbar.MOUSE_REF_DATA={items:[{label:"",field:"getMouseReference",readonly:"true"}]};papaya.ui.Toolbar.applyContextState=function(c){var a;c.contextMenu=!0;if(c.items)for(a=0;a<c.items.length;a+=1)c.items[a].menu?papaya.ui.Toolbar.applyContextState(c.items[a].menu):c.items[a].isContext=!0};
|
|
1572
|
-
papaya.ui.Toolbar.prototype.buildToolbar=function(){var c;this.spaceMenu=this.surfaceMenus=this.imageMenus=null;this.container.toolbarHtml.find("."+PAPAYA_MENU_ICON_CSS).remove();this.container.toolbarHtml.find("."+PAPAYA_MENU_LABEL_CSS).remove();this.container.toolbarHtml.find("."+PAPAYA_TITLEBAR_CSS).remove();if(this.container.kioskMode)for(c=0;c<papaya.ui.Toolbar.MENU_DATA_KIOSK.menus.length;c+=1)this.buildMenu(papaya.ui.Toolbar.MENU_DATA_KIOSK.menus[c],null,this.viewer,null);else{0<this.container.viewer.screenVolumes.length&&
|
|
1573
|
-
this.container.viewer.screenVolumes[0].rgb?papaya.ui.Toolbar.MENU_DATA.menus[0]=papaya.ui.Toolbar.RGB_FILE_MENU_DATA:(papaya.ui.Toolbar.MENU_DATA.menus[0]=papaya.ui.Toolbar.FILE_MENU_DATA,this.buildOpenMenuItems(papaya.ui.Toolbar.MENU_DATA));for(c=0;c<papaya.ui.Toolbar.MENU_DATA.menus.length;c+=1)this.buildMenu(papaya.ui.Toolbar.MENU_DATA.menus[c],null,this.viewer,null);this.buildAtlasMenu()}this.buildColorMenuItems();this.container.titlebarHtml=this.container.containerHtml.find("."+PAPAYA_TITLEBAR_CSS);
|
|
1574
|
-
600>this.container.getViewerDimensions()[0]?this.container.titlebarHtml.css({visibility:"hidden"}):this.container.titlebarHtml.css({visibility:"visible"})};
|
|
1575
|
-
papaya.ui.Toolbar.prototype.buildAtlasMenu=function(){if(papaya.data&&papaya.data.Atlas){var c=this.spaceMenu.items;c[0]={label:papaya.data.Atlas.labels.atlas.header.name,action:"AtlasChanged-"+papaya.data.Atlas.labels.atlas.header.name,type:"radiobutton",method:"isUsingAtlas"};papaya.data.Atlas.labels.atlas.header.transformedname&&(c[1]={label:papaya.data.Atlas.labels.atlas.header.transformedname,action:"AtlasChanged-"+papaya.data.Atlas.labels.atlas.header.transformedname,type:"radiobutton",method:"isUsingAtlas"})}};
|
|
1576
|
-
papaya.ui.Toolbar.prototype.buildColorMenuItems=function(){var c,a,d,f;if(c=this.container.params.luts)for(a=0;a<c.length;a+=1)papaya.viewer.ColorTable.addCustomLUT(c[a]);d=papaya.viewer.ColorTable.TABLE_ALL;c=papaya.ui.Toolbar.OVERLAY_IMAGE_MENU_DATA.items;for(a=0;a<c.length;a+=1)if("Color Table"===c[a].label){c=c[a].items;break}for(a=0;a<d.length;a+=1)f={label:d[a].name,action:"ColorTable-"+d[a].name,type:"radiobutton",method:"isUsingColorTable"},c[a]=f};
|
|
1577
|
-
papaya.ui.Toolbar.prototype.buildOpenMenuItems=function(c){var a,d;for(a=0;a<c.menus.length;a+=1)if("File"===c.menus[a].label){d=c.menus[a].items;break}if(d)for(a=0;a<papayaLoadableImages.length;a+=1)papayaLoadableImages[a].hide||(papayaLoadableImages[a].surface?(c="Add Surface "+papayaLoadableImages[a].nicename,this.menuContains(d,c)||d.splice(2,0,{label:c,action:"OpenSurface-"+papayaLoadableImages[a].name})):(c="Add "+papayaLoadableImages[a].nicename,this.menuContains(d,c)||d.splice(2,0,{label:c,
|
|
1578
|
-
action:"Open-"+papayaLoadableImages[a].name})))};papaya.ui.Toolbar.prototype.menuContains=function(c,a){var d;if(c)for(d=0;d<c.length;d+=1)if(c[d].label===a)return!0;return!1};
|
|
1579
|
-
papaya.ui.Toolbar.prototype.buildMenu=function(c,a,d,f,b){var e=null;void 0===b&&(b=!1);c.required&&!0!==papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this.container,c.required))()||(e=new papaya.ui.Menu(this.viewer,c,papaya.utilities.ObjectUtils.bind(this,this.doAction),this.viewer,f),"SPACE"===c.label&&(this.spaceMenu=c),b||(a?e.setMenuButton(a):a=e.buildMenuButton()),(c=c.items)&&this.buildMenuItems(e,c,a,d,f));return e};
|
|
1580
|
-
papaya.ui.Toolbar.prototype.buildMenuItems=function(c,a,d,f,b){var e,g,h;void 0===b&&(b="");for(e=0;e<a.length;e+=1)a[e].required&&!0!==papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this.container,a[e].required))(parseInt(b))?g=null:"spacer"===a[e].type?g=new papaya.ui.MenuItemSpacer:"radiobutton"===a[e].type?g=new papaya.ui.MenuItemRadioButton(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,b):"checkbox"===
|
|
1581
|
-
a[e].type?g=new papaya.ui.MenuItemCheckBox(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,b):"file"===a[e].type?a[e].hide||a[e].required&&!0!==papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this.container,a[e].required))(parseInt(b))||(g=new papaya.ui.MenuItemFileChooser(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),!1,b)):"folder"===a[e].type?g=a[e].hide||
|
|
1582
|
-
a[e].required&&!0!==papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this.container,a[e].required))(parseInt(b))?null:new papaya.ui.MenuItemFileChooser(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),!0,b):"displayrange"===a[e].type?g=this.viewer.screenVolumes[b].supportsDynamicColorTable()?new papaya.ui.MenuItemRange(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,
|
|
1583
|
-
b):null:"range"===a[e].type?papaya.utilities.PlatformUtils.isInputRangeSupported()&&(g=new papaya.ui.MenuItemSlider(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,b)):g=new papaya.ui.MenuItem(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,b),g&&(c.addMenuItem(g),a[e].items&&(h=this.buildMenu(a[e],d,f,b),g.menu=h,g.callback=papaya.utilities.ObjectUtils.bind(h,h.showMenu)))};
|
|
1584
|
-
papaya.ui.Toolbar.prototype.updateImageButtons=function(){this.container.toolbarHtml.find("."+PAPAYA_MENU_BUTTON_CSS).remove();this.doUpdateImageButtons();this.updateSurfaceButtons()};
|
|
1585
|
-
papaya.ui.Toolbar.prototype.doUpdateImageButtons=function(){var c,a,d;this.imageMenus=[];if(this.container.showImageButtons)for(a=this.viewer.screenVolumes.length-1;0<=a;--a)d=this.viewer.screenVolumes[a],c=d.icon,c=[{label:"ImageButton",icons:[c],items:null,imageButton:!0}],c[0].items=0===a?d.rgb?papaya.ui.Toolbar.RGB_IMAGE_MENU_DATA.items:d.dti?papaya.ui.Toolbar.DTI_IMAGE_MENU_DATA.items:papaya.ui.Toolbar.BASE_IMAGE_MENU_DATA.items:d.dti?papaya.ui.Toolbar.DTI_IMAGE_MENU_DATA.items:papaya.ui.Toolbar.OVERLAY_IMAGE_MENU_DATA.items,
|
|
1586
|
-
this.container.combineParametric&&d.parametric||this.imageMenus.push(this.buildMenu(c[0],null,d,a.toString()))};
|
|
1587
|
-
papaya.ui.Toolbar.prototype.updateSurfaceButtons=function(){var c,a;this.surfaceMenus=[];if(this.container.showImageButtons)for(a=this.viewer.surfaces.length-1;0<=a;--a)c=this.viewer.surfaces[a].solidColor,null===c&&(c=[.5,.5,.5]),c=papaya.viewer.ScreenVolume.makeSolidIcon(c[0],c[1],c[2]),c=[{label:"SurfaceButton",icons:[c],items:papaya.ui.Toolbar.SURFACE_MENU_DATA.items,imageButton:!0,surfaceButton:!0}],this.surfaceMenus.push(this.buildMenu(c[0],null,this.viewer.surfaces[a],a.toString()))};
|
|
1588
|
-
papaya.ui.Toolbar.prototype.closeAllMenus=function(c){var a;a=this.container.toolbarHtml.find("."+PAPAYA_MENU_CSS);a.hide(100);a.remove();this.container.showControlBar&&(a=this.container.sliderControlHtml.find("."+PAPAYA_MENU_CSS),a.hide(100),a.remove());a=this.container.toolbarHtml.find("."+PAPAYA_DIALOG_CSS);a.hide(100);a.remove();a=this.container.toolbarHtml.find("."+PAPAYA_DIALOG_BACKGROUND);a.hide(100);a.remove();!c&&(c=this.container.viewerHtml.find("."+PAPAYA_MENU_CSS))&&(c.hide(100),c.remove())};
|
|
1589
|
-
papaya.ui.Toolbar.prototype.isShowingMenus=function(){var c,a;c=this.container.toolbarHtml.find("."+PAPAYA_MENU_CSS).is(":visible");a=this.container.toolbarHtml.find("."+PAPAYA_DIALOG_CSS).is(":visible");return c||a};
|
|
1590
|
-
papaya.ui.Toolbar.prototype.doAction=function(c,a,d){d||this.closeAllMenus();if(c)if(c.startsWith("ImageButton"))c=parseInt(c.substr(c.length-2,1),10),this.viewer.setCurrentScreenVol(c),this.updateImageButtons();else if(c.startsWith("OpenSurface-"))a=c.substring(c.indexOf("-")+1),this.viewer.loadSurface(a);else if(c.startsWith("Open-"))a=c.substring(c.indexOf("-")+1),this.viewer.loadImage(a);else if("OpenImage"===c)this.container.display.drawProgress(.1,"Loading"),this.viewer.loadImage(a);else if("OpenDTI"===
|
|
1591
|
-
c)this.container.display.drawProgress(.1,"Loading"),this.viewer.loadingDTI=!0,this.viewer.loadImage(a);else if("OpenSurface"===c)this.container.display.drawProgress(.1,"Loading"),this.viewer.loadSurface(a);else if("OpenFolder"===c){c=[];for(d=0;d<a.length;d+=1)a[d].name.startsWith(".")?console.log("Ignoring file "+a[d].name):c.push(a[d]);this.container.display.drawProgress(.1,"Loading");this.viewer.loadImage(c)}else c.startsWith("ColorTable")?(a=c.substring(c.indexOf("-")+1,c.lastIndexOf("-")),c=
|
|
1592
|
-
c.substring(c.lastIndexOf("-")+1),this.viewer.screenVolumes[c].changeColorTable(this.viewer,a),this.updateImageButtons()):c.startsWith("CloseAllImages")?papaya.Container.resetViewer(this.container.containerIndex,{}):"Preferences"===c?(a=new papaya.ui.Dialog(this.container,"Viewer Preferences",papaya.ui.Toolbar.PREFERENCES_DATA,this.container.preferences,papaya.utilities.ObjectUtils.bind(this.container.preferences,this.container.preferences.updatePreference),papaya.utilities.ObjectUtils.bind(this,
|
|
1593
|
-
function(){this.viewer.updateScreenSliceTransforms();this.viewer.drawViewer(!1,!0)})),a.showDialog()):"SurfacePreferences"===c?(a=new papaya.ui.Dialog(this.container,"Surface Preferences",papaya.ui.Toolbar.PREFERENCES_SURFACE_DATA,this.container.preferences,papaya.utilities.ObjectUtils.bind(this.container.preferences,this.container.preferences.updatePreference),papaya.utilities.ObjectUtils.bind(this,function(){this.viewer.updateScreenSliceTransforms();this.viewer.surfaceView.updatePreferences();this.viewer.drawViewer(!1,
|
|
1594
|
-
!0)})),a.showDialog()):"License"===c?(a=new papaya.ui.Dialog(this.container,"License",papaya.ui.Toolbar.LICENSE_DATA,papaya.Container,null,null,null,!0),a.showDialog()):"KeyboardRef"===c?(a=new papaya.ui.Dialog(this.container,"Keyboard Reference",papaya.ui.Toolbar.KEYBOARD_REF_DATA,papaya.Container,null,null,null,!0),a.showDialog()):"MouseRef"===c?(a=new papaya.ui.Dialog(this.container,"Mouse Reference",papaya.ui.Toolbar.MOUSE_REF_DATA,papaya.Container,null,null,null,!0),a.showDialog()):c.startsWith("ImageInfo")?
|
|
1595
|
-
(c=c.substring(c.lastIndexOf("-")+1),a=1<this.viewer.screenVolumes[c].volume.numTimepoints?new papaya.ui.Dialog(this.container,"Image Info",papaya.ui.Toolbar.SERIES_INFO_DATA,this.viewer,null,null,c.toString()):new papaya.ui.Dialog(this.container,"Image Info",papaya.ui.Toolbar.IMAGE_INFO_DATA,this.viewer,null,null,c.toString()),a.showDialog()):c.startsWith("SurfaceInfo")?(c=c.substring(c.lastIndexOf("-")+1),a=new papaya.ui.Dialog(this.container,"Surface Info",papaya.ui.Toolbar.SURFACE_INFO_DATA,this.viewer,
|
|
1596
|
-
null,null,c.toString()),a.showDialog()):c.startsWith("ShowHeader")?(c=c.substring(c.lastIndexOf("-")+1),a=new papaya.ui.Dialog(this.container,"Header",papaya.ui.Toolbar.HEADER_DATA,this.viewer,null,null,c.toString()),a.showDialog()):c.startsWith("SPACE")?(this.viewer.toggleWorldSpace(),this.viewer.drawViewer(!0)):c.startsWith("AtlasChanged")?(a=c.substring(c.lastIndexOf("-")+1),this.viewer.atlas.currentAtlas=a,this.viewer.drawViewer(!0)):c.startsWith("ShowRuler")?("Yes"===this.container.preferences.showRuler?
|
|
1597
|
-
this.container.preferences.updatePreference("showRuler","No"):this.container.preferences.updatePreference("showRuler","Yes"),this.viewer.drawViewer(),this.closeAllMenus()):c.startsWith("ShowOrientation")?("Yes"===this.container.preferences.showOrientation?this.container.preferences.updatePreference("showOrientation","No"):this.container.preferences.updatePreference("showOrientation","Yes"),this.viewer.drawViewer(),this.closeAllMenus()):c.startsWith("ShowCrosshairs")?("Yes"===this.container.preferences.showCrosshairs?
|
|
1598
|
-
this.container.preferences.updatePreference("showCrosshairs","No"):this.container.preferences.updatePreference("showCrosshairs","Yes"),this.viewer.drawViewer(),this.closeAllMenus()):c.startsWith("EXPAND")?this.container.collapsable?this.container.collapseViewer():this.container.expandViewer():c.startsWith("OpenInMango")?(c=parseInt(c.substring(c.lastIndexOf("-")+1),10),0===c?this.container.viewer.volume.urls[0]&&papaya.utilities.PlatformUtils.launchCustomProtocol(this.container,papaya.utilities.UrlUtils.getAbsoluteUrl(PAPAYA_CUSTOM_PROTOCOL,
|
|
1599
|
-
this.container.viewer.volume.urls[0]),this.customProtocolResult):this.container.viewer.screenVolumes[c].volume.urls[0]&&papaya.utilities.PlatformUtils.launchCustomProtocol(this.container,papaya.utilities.UrlUtils.getAbsoluteUrl(PAPAYA_CUSTOM_PROTOCOL,this.container.viewer.screenVolumes[c].volume.urls[0])+"?"+encodeURIComponent("baseimage="+this.container.viewer.volume.fileName+"¶ms=o"),this.customProtocolResult)):c.startsWith("CloseOverlay")?(c=parseInt(c.substring(c.lastIndexOf("-")+1),10),this.container.viewer.removeOverlay(c)):
|
|
1600
|
-
c.startsWith("ToggleOverlay")?(c=parseInt(c.substring(c.lastIndexOf("-")+1),10),this.container.viewer.toggleOverlay(c)):c.startsWith("Context-")?this.container.contextManager.actionPerformed(c.substring(8)):c.startsWith("DTI-RGB")?(c=c.substring(c.lastIndexOf("-")+1),this.viewer.screenVolumes[c].dtiLines=!1,this.viewer.screenVolumes[c].dtiColors=!0,this.viewer.screenVolumes[c].initDTI(),this.viewer.drawViewer(!0,!1)):c.startsWith("DTI-LinesColors")?(c=c.substring(c.lastIndexOf("-")+1),this.viewer.screenVolumes[c].dtiLines=
|
|
1601
|
-
!0,this.viewer.screenVolumes[c].dtiColors=!0,this.viewer.screenVolumes[c].initDTI(),this.viewer.drawViewer(!0,!1)):c.startsWith("DTI-Lines")?(c=c.substring(c.lastIndexOf("-")+1),this.viewer.screenVolumes[c].dtiLines=!0,this.viewer.screenVolumes[c].dtiColors=!1,this.viewer.screenVolumes[c].initDTI(),this.viewer.drawViewer(!0,!1)):c.startsWith("DTI-Mod")?(c=c.substring(c.lastIndexOf("-")+1),this.container.display.drawProgress(.1,"Loading"),this.viewer.loadingDTIModRef=this.viewer.screenVolumes[c],this.viewer.loadImage(a)):
|
|
1602
|
-
c.startsWith("LoadNegatives")?(c=c.substring(c.lastIndexOf("-")+1),this.viewer.addParametric(c)):c.startsWith("ShowSurfacePlanes")?(this.viewer.surfaceView.showSurfacePlanes=!this.viewer.surfaceView.showSurfacePlanes,this.viewer.surfaceView.updateActivePlanes(),"Yes"===this.container.preferences.showSurfacePlanes?this.container.preferences.updatePreference("showSurfacePlanes","No"):this.container.preferences.updatePreference("showSurfacePlanes","Yes"),this.viewer.drawViewer(!1,!0),this.closeAllMenus()):
|
|
1603
|
-
c.startsWith("ShowSurfaceCrosshairs")?(this.viewer.surfaceView.showSurfaceCrosshairs=!this.viewer.surfaceView.showSurfaceCrosshairs,this.viewer.surfaceView.updateActivePlanes(),"Yes"===this.container.preferences.showSurfaceCrosshairs?this.container.preferences.updatePreference("showSurfaceCrosshairs","No"):this.container.preferences.updatePreference("showSurfaceCrosshairs","Yes"),this.viewer.drawViewer(!1,!0),this.closeAllMenus()):c.startsWith("rotation")?this.viewer.screenVolumes[0].updateTransform():
|
|
1604
|
-
c.startsWith("Rotate About")?(this.viewer.screenVolumes[0].rotationAbout=c.substring(0,c.indexOf("-")),this.viewer.screenVolumes[0].updateTransform(),this.viewer.drawViewer(!0,!1)):c.startsWith("ResetTransform")&&(this.viewer.screenVolumes[0].resetTransform(),this.viewer.screenVolumes[0].updateTransform(),this.viewer.drawViewer(!0,!1))};
|
|
1605
|
-
papaya.ui.Toolbar.prototype.customProtocolResult=function(c){!1===c&&("Chrome"===papaya.utilities.PlatformUtils.browser||"Internet Explorer"===papaya.utilities.PlatformUtils.browser?alert("Mango does not appear to be installed. You can download Mango at:\n\nhttp://ric.uthscsa.edu/mango"):papaya.utilities.PlatformUtils.ios?confirm("iMango does not appear to be installed. Would you like to download it now?")&&window.open("http://itunes.apple.com/us/app/imango/id423626092"):confirm("Mango does not appear to be installed. Would you like to download it now?")&&
|
|
1606
|
-
window.open("http://ric.uthscsa.edu/mango/mango.html"))};papaya.ui.Toolbar.prototype.updateTitleBar=function(c){var a=this.container.titlebarHtml[0];a&&(a.innerHTML=c);this.container.titlebarHtml.css({top:this.container.viewerHtml.position().top-1.25*papaya.ui.Toolbar.SIZE})};papaya.ui.Toolbar.prototype.showImageMenu=function(c){this.viewer.screenVolumes[c].resetDynamicRange();this.imageMenus[c].showMenu()};
|
|
1607
|
-
papaya.ui.Toolbar.prototype.updateImageMenuRange=function(c,a,d){this.imageMenus[c].updateRangeItem(a,d)};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};
|
|
1608
|
-
papaya.viewer.Atlas=papaya.viewer.Atlas||function(c,a,d){this.container=a;this.callback=d;this.transformedname=this.name=null;this.labels=[];this.atlasLabelData=c.labels;this.volume=new papaya.volume.Volume(a.display,a.viewer);this.currentAtlas=this.transform=this.returnLabels=this.displayColumns=null;this.maxLabels=0;this.probabilistic=!1;c=a.findLoadableImage(c.labels.atlas.header.images.summaryimagefile);a.params.atlasURL?this.volume.readURLs([a.params.atlasURL],papaya.utilities.ObjectUtils.bind(this,
|
|
1609
|
-
this.readFinished)):null!==c&&void 0!==c.encode?this.volume.readEncodedData([c.encode],papaya.utilities.ObjectUtils.bind(this,this.readFinished)):null!==c&&void 0!==c.url&&this.volume.readURLs([c.url],papaya.utilities.ObjectUtils.bind(this,this.readFinished))};papaya.viewer.Atlas.MAX_LABELS=4;papaya.viewer.Atlas.PROBABILISTIC=["probabalistic","probabilistic","statistic"];papaya.viewer.Atlas.LABEL_SPLIT_REGEX=/\.|:|,|\//;
|
|
1610
|
-
papaya.viewer.Atlas.prototype.getLabelAtCoordinate=function(c,a,d){var f,b;this.transform&&this.currentAtlas===this.transformedname?(f=c*this.transform[0][0]+a*this.transform[0][1]+d*this.transform[0][2]+this.transform[0][3],b=c*this.transform[1][0]+a*this.transform[1][1]+d*this.transform[1][2]+this.transform[1][3],c=c*this.transform[2][0]+a*this.transform[2][1]+d*this.transform[2][2]+this.transform[2][3]):(f=c,b=a,c=d);f=this.volume.getVoxelAtCoordinate(f,b,c,0,!0);this.probabilistic&&--f;return this.formatLabels(this.labels[f],
|
|
1611
|
-
this.returnLabels)};
|
|
1612
|
-
papaya.viewer.Atlas.prototype.readFinished=function(){this.parseTransform();this.parseLabels();this.parseDisplayColumns();this.maxLabels=this.findMaxLabelParts();this.probabilistic=this.atlasLabelData.atlas.header.type&&(this.atlasLabelData.atlas.header.type.toLowerCase()===papaya.viewer.Atlas.PROBABILISTIC[0]||this.atlasLabelData.atlas.header.type.toLowerCase()===papaya.viewer.Atlas.PROBABILISTIC[1]||this.atlasLabelData.atlas.header.type.toLowerCase()===papaya.viewer.Atlas.PROBABILISTIC[2]);this.returnLabels=
|
|
1613
|
-
[];this.returnLabels.length=this.maxLabels;this.atlasLabelData.atlas.header.transformedname&&(this.transformedname=this.atlasLabelData.atlas.header.transformedname);this.currentAtlas=this.name=this.atlasLabelData.atlas.header.name;var c=this.container.params.atlas;c&&c===this.transformedname&&(this.currentAtlas=this.transformedname);this.callback()};
|
|
1614
|
-
papaya.viewer.Atlas.prototype.parseDisplayColumns=function(){var c,a,d;if(this.atlasLabelData.atlas.header.display)for(this.displayColumns=[],c=0,a=this.atlasLabelData.atlas.header.display.split(papaya.viewer.Atlas.LABEL_SPLIT_REGEX),d=0;d<a.length;d+=1)"*"===a[d]&&(this.displayColumns[c]=d,c+=1)};
|
|
1615
|
-
papaya.viewer.Atlas.prototype.parseTransform=function(){var c,a,d;if(this.atlasLabelData.atlas.header.transform&&(c=this.atlasLabelData.atlas.header.transform.split(" "),this.transform=papaya.volume.Transform.IDENTITY.clone(),16===c.length))for(a=0;4>a;a+=1)for(d=0;4>d;d+=1)this.transform[a][d]=parseFloat(c[4*a+d])};
|
|
1616
|
-
papaya.viewer.Atlas.prototype.parseLabels=function(){var c,a,d;for(c=0;c<this.atlasLabelData.atlas.data.label.length;c+=1)d=this.atlasLabelData.atlas.data.label[c],a=d.index?parseInt(d.index,10):c,this.labels[a]=d.content?d.content:d};
|
|
1617
|
-
papaya.viewer.Atlas.prototype.formatLabels=function(c,a){var d,f,b;if(c)if(f=c.split(papaya.viewer.Atlas.LABEL_SPLIT_REGEX),this.displayColumns)for(d=0;d<f.length;d+=1)d<this.displayColumns.length&&(a[d]=f[this.displayColumns[d]]);else for(b=f.length,d=0,b>papaya.viewer.Atlas.MAX_LABELS&&(d=b-papaya.viewer.Atlas.MAX_LABELS);d<f.length;d+=1)a[d]=f[d].trim();else for(d=0;d<a.length;d+=1)a[d]="";return a};
|
|
1618
|
-
papaya.viewer.Atlas.prototype.findMaxLabelParts=function(){var c,a;if(this.displayColumns)return this.displayColumns.length;a=[];for(c=0;c<this.labels.length;c+=1)this.formatLabels(this.labels[c],a);return a.length};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};
|
|
1619
|
-
papaya.viewer.ColorTable=papaya.viewer.ColorTable||function(c,a,d){var f=null,f=void 0!==d?d:papaya.viewer.ColorTable.findLUT(c);this.lutData=f.data;this.minLUT=this.maxLUT=0;this.knotThresholds=[];this.knotRangeRatios=[];this.LUTarrayG=Array(256);this.LUTarrayR=Array(256);this.LUTarrayB=Array(256);this.isBaseImage=a;this.knotMin=this.lutData[0];this.knotMax=this.lutData[this.lutData.length-1];this.useGradation="undefined"===typeof f.gradation||f.gradation;this.updateLUT(papaya.viewer.ColorTable.LUT_MIN,
|
|
1620
|
-
papaya.viewer.ColorTable.LUT_MAX)};papaya.viewer.ColorTable.TABLE_GRAYSCALE={name:"Grayscale",data:[[0,0,0,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_SPECTRUM={name:"Spectrum",data:[[0,0,0,0],[.1,0,0,1],[.33,0,1,1],[.5,0,1,0],[.66,1,1,0],[.9,1,0,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_RED2YELLOW={name:"Overlay (Positives)",data:[[0,1,0,0],[1,1,1,0]],gradation:!0};papaya.viewer.ColorTable.TABLE_BLUE2GREEN={name:"Overlay (Negatives)",data:[[0,0,0,1],[1,0,1,0]],gradation:!0};
|
|
1621
|
-
papaya.viewer.ColorTable.TABLE_HOTANDCOLD={name:"Hot-and-Cold",data:[[0,0,0,1],[.15,0,1,1],[.3,0,1,0],[.45,0,0,0],[.5,0,0,0],[.55,0,0,0],[.7,1,1,0],[.85,1,0,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_GOLD={name:"Gold",data:[[0,0,0,0],[.13,.19,.03,0],[.25,.39,.12,0],[.38,.59,.26,0],[.5,.8,.46,.08],[.63,.99,.71,.21],[.75,.99,.88,.34],[.88,.99,.99,.48],[1,.9,.95,.61]],gradation:!0};
|
|
1622
|
-
papaya.viewer.ColorTable.TABLE_RED2WHITE={name:"Red Overlay",data:[[0,.75,0,0],[.5,1,.5,0],[.95,1,1,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_GREEN2WHITE={name:"Green Overlay",data:[[0,0,.75,0],[.5,.5,1,0],[.95,1,1,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_BLUE2WHITE={name:"Blue Overlay",data:[[0,0,0,1],[.5,0,.5,1],[.95,0,1,1],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_DTI_SPECTRUM={name:"Spectrum",data:[[0,1,0,0],[.5,0,1,0],[1,0,0,1]],gradation:!0};
|
|
1623
|
-
papaya.viewer.ColorTable.TABLE_FIRE={name:"Fire",data:[[0,0,0,0],[.06,0,0,.36],[.16,.29,0,.75],[.22,.48,0,.89],[.31,.68,0,.6],[.37,.76,0,.36],[.5,.94,.31,0],[.56,1,.45,0],[.81,1,.91,0],[.88,1,1,.38],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.ARROW_ICON="data:image/gif;base64,R0lGODlhCwARAPfGMf//////zP//mf//Zv//M///AP/M///MzP/Mmf/MZv/MM//MAP+Z//+ZzP+Zmf+ZZv+ZM/+ZAP9m//9mzP9mmf9mZv9mM/9mAP8z//8zzP8zmf8zZv8zM/8zAP8A//8AzP8Amf8AZv8AM/8AAMz//8z/zMz/mcz/Zsz/M8z/AMzM/8zMzMzMmczMZszMM8zMAMyZ/8yZzMyZmcyZZsyZM8yZAMxm/8xmzMxmmcxmZsxmM8xmAMwz/8wzzMwzmcwzZswzM8wzAMwA/8wAzMwAmcwAZswAM8wAAJn//5n/zJn/mZn/Zpn/M5n/AJnM/5nMzJnMmZnMZpnMM5nMAJmZ/5mZzJmZmZmZZpmZM5mZAJlm/5lmzJlmmZlmZplmM5lmAJkz/5kzzJkzmZkzZpkzM5kzAJkA/5kAzJkAmZkAZpkAM5kAAGb//2b/zGb/mWb/Zmb/M2b/AGbM/2bMzGbMmWbMZmbMM2bMAGaZ/2aZzGaZmWaZZmaZM2aZAGZm/2ZmzGZmmWZmZmZmM2ZmAGYz/2YzzGYzmWYzZmYzM2YzAGYA/2YAzGYAmWYAZmYAM2YAADP//zP/zDP/mTP/ZjP/MzP/ADPM/zPMzDPMmTPMZjPMMzPMADOZ/zOZzDOZmTOZZjOZMzOZADNm/zNmzDNmmTNmZjNmMzNmADMz/zMzzDMzmTMzZjMzMzMzADMA/zMAzDMAmTMAZjMAMzMAAAD//wD/zAD/mQD/ZgD/MwD/AADM/wDMzADMmQDMZgDMMwDMAACZ/wCZzACZmQCZZgCZMwCZAABm/wBmzABmmQBmZgBmMwBmAAAz/wAzzAAzmQAzZgAzMwAzAAAA/wAAzAAAmQAAZgAAM+4AAN0AALsAAKoAAIgAAHcAAFUAAEQAACIAABEAAADuAADdAAC7AACqAACIAAB3AABVAABEAAAiAAARAAAA7gAA3QAAuwAAqgAAiAAAdwAAVQAARAAAIgAAEe7u7t3d3bu7u6qqqoiIiHd3d1VVVURERCIiIhEREQAAACH5BAEAAMYALAAAAAALABEAAAg/AI0JFGhvoEGC+vodRKgv4UF7DSMqZBixoUKIFSv2w5jRIseOGztK/JgxpMiEJDWmHHkSZUuTIvvt60ezps2AADs=";
|
|
1624
|
-
papaya.viewer.ColorTable.ARROW_ICON_WIDTH=11;papaya.viewer.ColorTable.DEFAULT_COLOR_TABLE=papaya.viewer.ColorTable.TABLE_GRAYSCALE;papaya.viewer.ColorTable.PARAMETRIC_COLOR_TABLES=[papaya.viewer.ColorTable.TABLE_RED2YELLOW,papaya.viewer.ColorTable.TABLE_BLUE2GREEN];papaya.viewer.ColorTable.OVERLAY_COLOR_TABLES=[papaya.viewer.ColorTable.TABLE_RED2WHITE,papaya.viewer.ColorTable.TABLE_GREEN2WHITE,papaya.viewer.ColorTable.TABLE_BLUE2WHITE];
|
|
1625
|
-
papaya.viewer.ColorTable.TABLE_ALL=[papaya.viewer.ColorTable.TABLE_GRAYSCALE,papaya.viewer.ColorTable.TABLE_SPECTRUM,papaya.viewer.ColorTable.TABLE_FIRE,papaya.viewer.ColorTable.TABLE_HOTANDCOLD,papaya.viewer.ColorTable.TABLE_GOLD,papaya.viewer.ColorTable.TABLE_RED2YELLOW,papaya.viewer.ColorTable.TABLE_BLUE2GREEN,papaya.viewer.ColorTable.TABLE_RED2WHITE,papaya.viewer.ColorTable.TABLE_GREEN2WHITE,papaya.viewer.ColorTable.TABLE_BLUE2WHITE];papaya.viewer.ColorTable.LUT_MIN=0;
|
|
1626
|
-
papaya.viewer.ColorTable.LUT_MAX=255;papaya.viewer.ColorTable.ICON_SIZE=18;papaya.viewer.ColorTable.COLOR_BAR_WIDTH=100;papaya.viewer.ColorTable.COLOR_BAR_HEIGHT=15;papaya.viewer.ColorTable.findLUT=function(c){var a;for(a=0;a<papaya.viewer.ColorTable.TABLE_ALL.length;a+=1)if(papaya.viewer.ColorTable.TABLE_ALL[a].name==c)return papaya.viewer.ColorTable.TABLE_ALL[a];return papaya.viewer.ColorTable.TABLE_GRAYSCALE};
|
|
1627
|
-
papaya.viewer.ColorTable.addCustomLUT=function(c){papaya.viewer.ColorTable.findLUT(c.name).data===papaya.viewer.ColorTable.TABLE_GRAYSCALE.data&&papaya.viewer.ColorTable.TABLE_ALL.push(c)};papaya.viewer.ColorTable.prototype.updateMinLUT=function(c){this.updateLUT(c,this.maxLUT)};papaya.viewer.ColorTable.prototype.updateMaxLUT=function(c){this.updateLUT(this.minLUT,c)};
|
|
1628
|
-
papaya.viewer.ColorTable.prototype.updateLUT=function(c,a){var d,f,b;this.maxLUT=a;this.minLUT=c;d=this.maxLUT-this.minLUT;for(f=0;f<this.lutData.length;f+=1)this.knotThresholds[f]=this.lutData[f][0]*d+this.minLUT;for(f=0;f<this.lutData.length-1;f+=1)this.knotRangeRatios[f]=papaya.viewer.ColorTable.LUT_MAX/(this.knotThresholds[f+1]-this.knotThresholds[f]);for(f=0;256>f;f+=1)if(f<=this.minLUT)this.LUTarrayR[f]=this.knotMin[1]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayG[f]=this.knotMin[2]*papaya.viewer.ColorTable.LUT_MAX,
|
|
1629
|
-
this.LUTarrayB[f]=this.knotMin[3]*papaya.viewer.ColorTable.LUT_MAX;else if(f>this.maxLUT)this.LUTarrayR[f]=this.knotMax[1]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayG[f]=this.knotMax[2]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayB[f]=this.knotMax[3]*papaya.viewer.ColorTable.LUT_MAX;else for(d=0;d<this.lutData.length-1;d+=1)f>this.knotThresholds[d]&&f<=this.knotThresholds[d+1]&&(this.useGradation?(b=((f-this.knotThresholds[d])*this.knotRangeRatios[d]+.5)/papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayR[f]=
|
|
1630
|
-
((1-b)*this.lutData[d][1]+b*this.lutData[d+1][1])*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayG[f]=((1-b)*this.lutData[d][2]+b*this.lutData[d+1][2])*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayB[f]=((1-b)*this.lutData[d][3]+b*this.lutData[d+1][3])*papaya.viewer.ColorTable.LUT_MAX):(this.LUTarrayR[f]=this.lutData[d][1]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayG[f]=this.lutData[d][2]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayB[f]=this.lutData[d][3]*papaya.viewer.ColorTable.LUT_MAX))};
|
|
1631
|
-
papaya.viewer.ColorTable.prototype.lookupRed=function(c){return 0<=c&&256>c?this.LUTarrayR[c]&255:0};papaya.viewer.ColorTable.prototype.lookupGreen=function(c){return 0<=c&&256>c?this.LUTarrayG[c]&255:0};papaya.viewer.ColorTable.prototype.lookupBlue=function(c){return 0<=c&&256>c?this.LUTarrayB[c]&255:0};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};
|
|
1632
|
-
papaya.viewer.Display=papaya.viewer.Display||function(c,a){this.container=c;this.viewer=c.viewer;this.canvas=document.createElement("canvas");this.canvas.width=a;this.canvas.height=papaya.viewer.Display.SIZE;this.context=this.canvas.getContext("2d");this.canvas.style.padding=0;this.canvas.style.margin=0;this.canvas.style.border="none";this.canvas.style.cursor="default";this.tempCoord=new papaya.core.Coordinate(0,0,0);this.drawingError=!1;this.progressStartTime=this.progress=0;this.progressTimeout=
|
|
1633
|
-
null;this.drawingProgress=!1;this.errorMessage="";this.drawUninitializedDisplay()};papaya.viewer.Display.SIZE=50;papaya.viewer.Display.MINI_LABELS_THRESH=700;papaya.viewer.Display.PADDING=8;papaya.viewer.Display.FONT_COLOR_WHITE="white";papaya.viewer.Display.FONT_COLOR_ORANGE="rgb(182, 59, 0)";papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL=12;papaya.viewer.Display.FONT_COLOR_COORDINATE_LABEL=papaya.viewer.Display.FONT_COLOR_WHITE;papaya.viewer.Display.FONT_TYPE_COORDINATE_LABEL="sans-serif";
|
|
1634
|
-
papaya.viewer.Display.FONT_SIZE_COORDINATE_VALUE=18;papaya.viewer.Display.FONT_COLOR_COORDINATE_VALUE=papaya.viewer.Display.FONT_COLOR_ORANGE;papaya.viewer.Display.FONT_TYPE_COORDINATE_VALUE="sans-serif";papaya.viewer.Display.PRECISION_COORDINATE_VALUE=5;papaya.viewer.Display.PRECISION_COORDINATE_MAX=12;papaya.viewer.Display.FONT_SIZE_IMAGE_VALUE=20;papaya.viewer.Display.FONT_COLOR_IMAGE_VALUE=papaya.viewer.Display.FONT_COLOR_WHITE;papaya.viewer.Display.FONT_TYPE_IMAGE_VALUE="sans-serif";
|
|
1635
|
-
papaya.viewer.Display.PRECISION_IMAGE_VALUE=9;papaya.viewer.Display.PRECISION_IMAGE_MAX=14;papaya.viewer.Display.FONT_SIZE_ATLAS_MINI=14;papaya.viewer.Display.FONT_SIZE_ATLAS=20;papaya.viewer.Display.FONT_TYPE_ATLAS="sans-serif";papaya.viewer.Display.FONT_SIZE_MESSAGE_VALUE=20;papaya.viewer.Display.FONT_TYPE_MESSAGE_VALUE="sans-serif";papaya.viewer.Display.FONT_COLOR_MESSAGE="rgb(200, 75, 25)";papaya.viewer.Display.PROGRESS_LABEL_SUFFIX=["...","",".",".."];
|
|
1636
|
-
papaya.viewer.Display.PROGRESS_LABEL_DEFAULT="Loading";papaya.viewer.Display.prototype.drawUninitializedDisplay=function(){this.context.fillStyle="#000000";this.context.fillRect(0,0,this.canvas.width,this.canvas.height)};papaya.viewer.Display.prototype.canDraw=function(){return!(this.drawingError||this.drawingProgress)};
|
|
1637
|
-
papaya.viewer.Display.prototype.drawEmptyDisplay=function(){this.canDraw()?(this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle="#000000",this.context.fillRect(0,0,this.canvas.width,this.canvas.height)):this.drawError&&this.drawError(this.errorMessage)};
|
|
1638
|
-
papaya.viewer.Display.prototype.drawDisplay=function(c,a,d){var f,b,e,g,h,m,k,p,t;if(this.canDraw()){if(g=this.viewer.canvas.width/600,p=this.viewer.canvas.width/2,h=p/5,e=this.canvas.height,t=300>p,"Mouse"!==this.container.preferences.atlasLocks&&(c=this.viewer.currentCoord.x,a=this.viewer.currentCoord.y,d=this.viewer.currentCoord.z),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle="#000000",this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=
|
|
1639
|
-
papaya.viewer.Display.FONT_COLOR_COORDINATE_LABEL,this.context.font=papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL+"px "+papaya.viewer.Display.FONT_TYPE_COORDINATE_LABEL,f=papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL+.75*papaya.viewer.Display.PADDING,this.context.fillText("x",1.5*papaya.viewer.Display.PADDING,f),this.context.fillText("y",1.5*papaya.viewer.Display.PADDING+h,f),this.context.fillText("z",1.5*papaya.viewer.Display.PADDING+2*h,f),f+=papaya.viewer.Display.FONT_SIZE_COORDINATE_VALUE+
|
|
1640
|
-
papaya.viewer.Display.PADDING/2,this.context.fillStyle=papaya.viewer.Display.FONT_COLOR_COORDINATE_VALUE,this.context.font=papaya.viewer.Display.FONT_SIZE_COORDINATE_VALUE-(t?2:0)+"px "+papaya.viewer.Display.FONT_TYPE_COORDINATE_VALUE,this.viewer.worldSpace?(b=this.viewer.screenVolumes[0].volume.header.origin,m=this.viewer.screenVolumes[0].volume.header.voxelDimensions,k=Math.min(papaya.viewer.Display.PRECISION_COORDINATE_MAX,Math.round(papaya.viewer.Display.PRECISION_COORDINATE_VALUE*g)),this.context.fillText(parseFloat(((c-
|
|
1641
|
-
b.x)*m.xSize).toString().substr(0,k)),1.5*papaya.viewer.Display.PADDING,f),this.context.fillText(parseFloat(((b.y-a)*m.ySize).toString().substr(0,k)),1.5*papaya.viewer.Display.PADDING+h,f),this.context.fillText(parseFloat(((b.z-d)*m.zSize).toString().substr(0,k)),1.5*papaya.viewer.Display.PADDING+2*h,f)):(this.context.fillText(Math.round(c).toString(),1.5*papaya.viewer.Display.PADDING,f),this.context.fillText(Math.round(a).toString(),1.5*papaya.viewer.Display.PADDING+h,f),this.context.fillText(Math.round(d).toString(),
|
|
1642
|
-
1.5*papaya.viewer.Display.PADDING+2*h,f)),this.viewer.currentScreenVolume.rgb||this.viewer.currentScreenVolume.dti||(b=this.viewer.getCurrentValueAt(c,a,d),this.canvas.currentval=b.toString(),f=e/2+papaya.viewer.Display.FONT_SIZE_IMAGE_VALUE/2-papaya.viewer.Display.PADDING/2,this.context.fillStyle=papaya.viewer.Display.FONT_COLOR_IMAGE_VALUE,this.context.font=papaya.viewer.Display.FONT_SIZE_IMAGE_VALUE-(t?2:0)+"px "+papaya.viewer.Display.FONT_TYPE_IMAGE_VALUE,k=Math.min(papaya.viewer.Display.PRECISION_IMAGE_MAX,
|
|
1643
|
-
Math.round(papaya.viewer.Display.PRECISION_IMAGE_VALUE*g)),this.context.fillText(parseFloat(b.toString().substr(0,k)),2*papaya.viewer.Display.PADDING+3*h,f)),this.viewer.atlas&&this.viewer.atlas.volume.isLoaded)if(this.viewer.getWorldCoordinateAtIndex(c,a,d,this.tempCoord),d=this.viewer.atlas.getLabelAtCoordinate(this.tempCoord.x,this.tempCoord.y,this.tempCoord.z),c=d.length,k=Math.ceil(this.viewer.atlas.maxLabels/2),300>p&&2<=c)for(a=.75*p,g=c-1;0<=g;--g)this.context.fillStyle=g===c-2?papaya.viewer.Display.FONT_COLOR_ORANGE:
|
|
1644
|
-
papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS_MINI+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,h=this.context.measureText(d[g]),h.width>a-2*papaya.viewer.Display.PADDING&&(d[g]=d[g].substr(0,Math.round(d[g].length/3))+" ... "+d[g].substr(d[g].length-3,3)),g===c-2?this.context.fillText(d[g],p+.25*p,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):g===c-1&&this.context.fillText(d[g],p+.25*p,papaya.viewer.Display.PADDING+
|
|
1645
|
-
e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2);else if(600>p&&2<c)for(a=p/2,g=c-1;0<=g;--g)this.context.fillStyle=g<k?papaya.viewer.Display.FONT_COLOR_ORANGE:papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS_MINI+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,h=this.context.measureText(d[g]),h.width>a-6*papaya.viewer.Display.PADDING&&(d[g]=d[g].substr(0,Math.round(d[g].length/3))+" ... "+d[g].substr(d[g].length-3,3)),0===g?this.context.fillText(d[g],p+
|
|
1646
|
-
5*papaya.viewer.Display.PADDING,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):1===g?this.context.fillText(d[g],p+5*papaya.viewer.Display.PADDING,papaya.viewer.Display.PADDING+e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):2===g?this.context.fillText(d[g],1.5*p+5*papaya.viewer.Display.PADDING,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):3===g&&this.context.fillText(d[g],1.5*p+5*papaya.viewer.Display.PADDING,papaya.viewer.Display.PADDING+
|
|
1647
|
-
e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2);else if(800>p&&3<c)for(a=p/3,g=0;4>g;g+=1)2>g?(this.context.fillStyle=g<k?papaya.viewer.Display.FONT_COLOR_ORANGE:papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS_MINI+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,h=this.context.measureText(d[g]),h.width>a-6*papaya.viewer.Display.PADDING&&(d[g]=d[g].substr(0,Math.round(d[g].length/3))+" ... "+d[g].substr(d[g].length-3,3)),0===g?this.context.fillText(d[g],
|
|
1648
|
-
p+5*papaya.viewer.Display.PADDING,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):1===g?this.context.fillText(d[g],p+5*papaya.viewer.Display.PADDING,papaya.viewer.Display.PADDING+e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):2===g?this.context.fillText(d[g],1.5*p+5*papaya.viewer.Display.PADDING,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):3===g&&this.context.fillText(d[g],1.5*p+5*papaya.viewer.Display.PADDING,papaya.viewer.Display.PADDING+
|
|
1649
|
-
e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2)):(f=e/2+papaya.viewer.Display.FONT_SIZE_ATLAS/2-papaya.viewer.Display.PADDING/2,this.context.fillStyle=g<k?papaya.viewer.Display.FONT_COLOR_ORANGE:papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,h=this.context.measureText(d[g]),h.width>a-2*papaya.viewer.Display.PADDING&&(d[g]=d[g].substr(0,Math.round(d[g].length/3))+" ... "+d[g].substr(d[g].length-3,3)),2===
|
|
1650
|
-
g?this.context.fillText(d[g],p+papaya.viewer.Display.PADDING+a,f):3===g&&this.context.fillText(d[g],p+papaya.viewer.Display.PADDING+2*a,f));else for(a=p/c,f=e/2+papaya.viewer.Display.FONT_SIZE_ATLAS/2-papaya.viewer.Display.PADDING/2,g=0;g<c;g+=1)this.context.fillStyle=g<k?papaya.viewer.Display.FONT_COLOR_ORANGE:papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS-(t?4:0)+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,h=this.context.measureText(d[g]),h.width>
|
|
1651
|
-
a-2*papaya.viewer.Display.PADDING-.05*p*Math.max(0,3-c)&&(d[g]=d[g].substr(0,Math.round(d[g].length/3))+" ... "+d[g].substr(d[g].length-3,3)),this.context.fillText(d[g],p+papaya.viewer.Display.PADDING+.05*p*Math.max(0,3-c)+g*a,f)}else this.drawError&&this.drawError(this.errorMessage)};
|
|
1652
|
-
papaya.viewer.Display.prototype.drawError=function(c){var a;this.errorMessage=c;this.drawingError=!0;a=this;window.setTimeout(papaya.utilities.ObjectUtils.bind(a,function(){a.drawingError=!1}),3E3);this.context.clearRect(0,0,this.canvas.width,this.canvas.height);this.context.fillStyle="#000000";this.context.fillRect(0,0,this.canvas.width,this.canvas.height);this.context.fillStyle="red";this.context.font=papaya.viewer.Display.FONT_SIZE_MESSAGE_VALUE+"px "+papaya.viewer.Display.FONT_TYPE_MESSAGE_VALUE;
|
|
1653
|
-
this.context.fillText(c,papaya.viewer.Display.PADDING,papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL+papaya.viewer.Display.PADDING+1.5*papaya.viewer.Display.PADDING)};
|
|
1654
|
-
papaya.viewer.Display.prototype.drawProgress=function(c,a){var d,f,b,e;d=Math.round(1E3*c);d>this.progress&&(this.progress=d,d=void 0!==a?a:papaya.viewer.Display.PROGRESS_LABEL_DEFAULT,b=0===this.progressStartTime?this.progressStartTime=(new Date).getTime():(new Date).getTime(),b=parseInt((b-this.progressStartTime)/500,10)%4,990<=this.progress?(this.progressTimeout&&(window.clearTimeout(this.progressTimeout),this.progressTimeout=null),this.drawingProgress=!1,this.progressStartTime=this.progress=0,
|
|
1655
|
-
this.drawEmptyDisplay()):(this.progressTimeout&&window.clearTimeout(this.progressTimeout),f=this,this.progressTimeout=window.setTimeout(papaya.utilities.ObjectUtils.bind(f,function(){f.drawingProgress=!1}),3E3),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle="#fff",this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle="#000",this.context.fillRect(0,0,this.canvas.width*c,this.canvas.height),this.context.font=papaya.viewer.Display.FONT_SIZE_MESSAGE_VALUE+
|
|
1656
|
-
"px "+papaya.viewer.Display.FONT_TYPE_MESSAGE_VALUE,this.context.fillStyle=papaya.viewer.Display.FONT_COLOR_MESSAGE,e=papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL+papaya.viewer.Display.PADDING+1.5*papaya.viewer.Display.PADDING,this.context.fillText(d+papaya.viewer.Display.PROGRESS_LABEL_SUFFIX[b],2*papaya.viewer.Display.PADDING,e)))};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
|
|
1657
|
-
papaya.viewer.Preferences=papaya.viewer.Preferences||function(){this.viewer=null;this.showCrosshairs=papaya.viewer.Preferences.DEFAULT_SHOW_CROSSHAIRS;this.atlasLocks=papaya.viewer.Preferences.DEFAULT_ATLAS_LOCKS;this.showOrientation=papaya.viewer.Preferences.DEFAULT_SHOW_ORIENTATION;this.scrollBehavior=papaya.viewer.Preferences.DEFAULT_SCROLL;this.smoothDisplay=papaya.viewer.Preferences.DEFAULT_SMOOTH_DISPLAY;this.radiological=papaya.viewer.Preferences.DEFAULT_RADIOLOGICAL;this.showRuler=papaya.viewer.Preferences.DEFAULT_SHOW_RULER;
|
|
1658
|
-
this.surfaceBackgroundColor=papaya.viewer.Preferences.DEFAULT_SURFACE_BACKGROUND_COLOR;this.showSurfacePlanes=papaya.viewer.Preferences.DEFAULT_SHOW_SURFACE_PLANES;this.showSurfaceCrosshairs=papaya.viewer.Preferences.DEFAULT_SHOW_SURFACE_CROSSHAIRS};papaya.viewer.Preferences.ALL_PREFS="showCrosshairs atlasLocks showOrientation scrollBehavior smoothDisplay radiological showRuler surfaceBackgroundColor showSurfacePlanes".split(" ");papaya.viewer.Preferences.COOKIE_PREFIX="papaya-";
|
|
1659
|
-
papaya.viewer.Preferences.COOKIE_EXPIRY_DAYS=365;papaya.viewer.Preferences.DEFAULT_SHOW_CROSSHAIRS="Yes";papaya.viewer.Preferences.DEFAULT_ATLAS_LOCKS="Mouse";papaya.viewer.Preferences.DEFAULT_SHOW_ORIENTATION="No";papaya.viewer.Preferences.DEFAULT_SCROLL="Increment Slice";papaya.viewer.Preferences.DEFAULT_SMOOTH_DISPLAY="Yes";papaya.viewer.Preferences.DEFAULT_RADIOLOGICAL="No";papaya.viewer.Preferences.DEFAULT_SHOW_RULER="No";papaya.viewer.Preferences.DEFAULT_SURFACE_BACKGROUND_COLOR="Gray";
|
|
1660
|
-
papaya.viewer.Preferences.DEFAULT_SHOW_SURFACE_PLANES="Yes";papaya.viewer.Preferences.prototype.updatePreference=function(c,a){this[c]=a;this.viewer.drawViewer(!0);papaya.utilities.UrlUtils.createCookie(papaya.viewer.Preferences.COOKIE_PREFIX+c,a,papaya.viewer.Preferences.COOKIE_EXPIRY_DAYS)};
|
|
1661
|
-
papaya.viewer.Preferences.prototype.readPreferences=function(){var c,a;for(c=0;c<papaya.viewer.Preferences.ALL_PREFS.length;c+=1)(a=papaya.utilities.UrlUtils.readCookie(papaya.viewer.Preferences.COOKIE_PREFIX+papaya.viewer.Preferences.ALL_PREFS[c]))&&(this[papaya.viewer.Preferences.ALL_PREFS[c]]=a)};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};
|
|
1662
|
-
papaya.viewer.ScreenSlice=papaya.viewer.ScreenSlice||function(c,a,d,f,b,e,g,h){this.screenVolumes=g;this.sliceDirection=a;this.currentSlice=-1;this.xDim=d;this.yDim=f;this.xSize=b;this.ySize=e;this.canvasMain=document.createElement("canvas");this.canvasMain.width=this.xDim;this.canvasMain.height=this.yDim;this.contextMain=this.canvasMain.getContext("2d");this.imageDataDraw=this.contextMain.createImageData(this.xDim,this.yDim);this.screenDim=this.screenOffsetY=this.screenOffsetX=0;this.screenTransform=
|
|
1663
|
-
[[1,0,0],[0,1,0],[0,0,1]];this.zoomTransform=[[1,0,0],[0,1,0],[0,0,1]];this.finalTransform=[[1,0,0],[0,1,0],[0,0,1]];this.radiologicalTransform=[[-1,0,this.xDim],[0,1,0],[0,0,1]];this.tempTransform=[[1,0,0],[0,1,0],[0,0,1]];this.tempTransform2=[[1,0,0],[0,1,0],[0,0,1]];this.screenTransform2=[[1,0,0],[0,1,0],[0,0,1]];this.finalTransform2=[[1,0,0],[0,1,0],[0,0,1]];this.imageData=[];this.imageData2=[];this.manager=h;this.rulerPoints=[new papaya.core.Point(parseInt(.25*d),parseInt(.25*f)),new papaya.core.Point(parseInt(.75*
|
|
1664
|
-
d),parseInt(.75*f))];this.tempPoint=new papaya.core.Point;this.contextDTILines=this.canvasDTILines=null};papaya.viewer.ScreenSlice.DIRECTION_UNKNOWN=0;papaya.viewer.ScreenSlice.DIRECTION_AXIAL=1;papaya.viewer.ScreenSlice.DIRECTION_CORONAL=2;papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL=3;papaya.viewer.ScreenSlice.DIRECTION_TEMPORAL=4;papaya.viewer.ScreenSlice.DIRECTION_SURFACE=5;papaya.viewer.ScreenSlice.SCREEN_PIXEL_MAX=255;papaya.viewer.ScreenSlice.SCREEN_PIXEL_MIN=0;
|
|
1665
|
-
papaya.viewer.ScreenSlice.GRAB_RADIUS=5;papaya.viewer.ScreenSlice.DTI_COLORS=["#ff0000","#00ff00","#0000ff"];
|
|
1666
|
-
papaya.viewer.ScreenSlice.prototype.updateSlice=function(c,a){var d,f,b,e,g,h,m,k,p,t,w,B,A,x,G,F,z,L,l,J,K,E,y,D=!1,u,n=0,q,I=!1,H=this.manager.isWorldMode();c=Math.round(c);u=this.manager.isRadiologicalMode()&&this.isRadiologicalSensitive()?-1:1;if(a||this.currentSlice!==c){this.currentSlice=c;d=this.screenVolumes[0].volume.header.origin;f=this.screenVolumes[0].volume.header.voxelDimensions;this.contextMain.clearRect(0,0,this.canvasMain.width,this.canvasMain.height);this.contextDTILines&&this.contextDTILines.clearRect(0,
|
|
1667
|
-
0,this.screenDim,this.screenDim);this.imageData.length<this.screenVolumes.length&&(this.imageData=papaya.utilities.ArrayUtils.createArray(this.screenVolumes.length,this.xDim*this.yDim),this.imageData2=papaya.utilities.ArrayUtils.createArray(this.screenVolumes.length,1));for(b=0;b<this.screenVolumes.length;b+=1)if(!this.screenVolumes[b].hidden){t=this.screenVolumes[b].currentTimepoint;w=this.screenVolumes[b].rgb;B=this.screenVolumes[b].dti;A=this.screenVolumes[b].dtiLines;I|=!A;L=this.screenVolumes[b].dtiColors;
|
|
1668
|
-
y=this.screenVolumes[b].dtiAlphaFactor;q=0===b||this.screenVolumes[b].interpolation;q&="Yes"===this.manager.container.preferences.smoothDisplay;A&&(this.updateDTILinesImage(),this.contextDTILines.lineWidth=1,L||(this.contextDTILines.strokeStyle=papaya.viewer.ScreenSlice.DTI_COLORS[n],n+=1,n%=3,this.contextDTILines.beginPath()));for(e=0;e<this.yDim;e+=1)for(g=0;g<this.xDim;g+=1)(h=0,m=255,p=this.screenVolumes[b].alpha,w)?(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?h=this.screenVolumes[b].volume.getVoxelAtIndex(g,
|
|
1669
|
-
e,c,t,!0):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?h=this.screenVolumes[b].volume.getVoxelAtIndex(g,c,e,t,!0):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(h=this.screenVolumes[b].volume.getVoxelAtIndex(c,g,e,t,!0)),k=4*(e*this.xDim+g),this.imageData[b][k]=h,this.imageDataDraw.data[k]=h>>16&255,this.imageDataDraw.data[k+1]=h>>8&255,this.imageDataDraw.data[k+2]=h&255,this.imageDataDraw.data[k+3]=m):B?(H?(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?
|
|
1670
|
-
(l=(g-d.x)*f.xSize,J=(d.y-e)*f.ySize,K=(d.z-c)*f.zSize):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(l=(g-d.x)*f.xSize,J=(d.y-c)*f.ySize,K=(d.z-e)*f.zSize):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(l=(c-d.x)*f.xSize,J=(d.y-g)*f.ySize,K=(d.z-e)*f.zSize),F=this.screenVolumes[b].volume.getVoxelAtCoordinate(l,J,K,0,!q),x=this.screenVolumes[b].volume.getVoxelAtCoordinate(l,J,K,1,!q),G=this.screenVolumes[b].volume.getVoxelAtCoordinate(l,J,K,2,!q),this.screenVolumes[b].dtiVolumeMod&&
|
|
1671
|
-
(p=Math.min(1,this.screenVolumes[b].dtiVolumeMod.getVoxelAtCoordinate(l,J,K,0,!q)))):(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(l=g*f.xSize,J=e*f.ySize,K=c*f.zSize):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(l=g*f.xSize,J=c*f.ySize,K=e*f.zSize):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(l=c*f.xSize,J=g*f.ySize,K=e*f.zSize),F=this.screenVolumes[b].volume.getVoxelAtMM(l,J,K,0,!q),x=this.screenVolumes[b].volume.getVoxelAtMM(l,J,
|
|
1672
|
-
K,1,!q),G=this.screenVolumes[b].volume.getVoxelAtMM(l,J,K,2,!q),this.screenVolumes[b].dtiVolumeMod&&(p=Math.min(1,this.screenVolumes[b].dtiVolumeMod.getVoxelAtMM(l,J,K,0,!q)))),k=4*(e*this.xDim+g),A?0!==F||0!==x||0!==G?(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(z=Math.atan2(u*x,F),E=Math.acos(Math.abs(G)/Math.sqrt(F*F+x*x+G*G))):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(z=Math.atan2(u*G,F),E=Math.acos(Math.abs(x)/Math.sqrt(F*F+x*x+G*G))):this.sliceDirection===
|
|
1673
|
-
papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(z=Math.atan2(G,x),E=Math.acos(Math.abs(F)/Math.sqrt(F*F+x*x+G*G))),E=1-E/1.5708,F=papayaRoundFast(Math.abs(255*F)),x=papayaRoundFast(Math.abs(255*x)),G=papayaRoundFast(Math.abs(255*G)),h=papayaRoundFast(255*p),h=(h&255)<<24|(F&255)<<16|(x&255)<<8|G&255,L&&(this.contextDTILines.beginPath(),m=h&16777215,this.contextDTILines.strokeStyle="#"+papaya.utilities.StringUtils.pad(m.toString(16),6)),this.imageData[b][k]=z,this.imageData2[b][k]=h,p=Math.sin(z),h=
|
|
1674
|
-
Math.cos(z),k=this.finalTransform2[0][2]+(g+.5)*this.finalTransform2[0][0],m=this.finalTransform2[1][2]+(e+.5)*this.finalTransform2[1][1],x=this.finalTransform2[0][2]+(g+.5*E)*this.finalTransform2[0][0],G=this.finalTransform2[1][2]+(e+.5)*this.finalTransform2[1][1],F=h*(x-k)-p*(G-m)+k,x=p*(x-k)+h*(G-m)+m,this.contextDTILines.moveTo(F,x),x=this.finalTransform2[0][2]+(g+1-.5*E)*this.finalTransform2[0][0],G=this.finalTransform2[1][2]+(e+.5)*this.finalTransform2[1][1],F=h*(x-k)-p*(G-m)+k,k=p*(x-k)+h*
|
|
1675
|
-
(G-m)+m,this.contextDTILines.lineTo(F,k),L&&this.contextDTILines.stroke()):this.imageData[b][k]=Number.NaN:(p=0!==F||0!==x||0!==G?1-(1-p)*y:0,F=papayaRoundFast(Math.abs(255*F)),x=papayaRoundFast(Math.abs(255*x)),G=papayaRoundFast(Math.abs(255*G)),h=papayaRoundFast(255*p),this.imageData[b][k]=(h&255)<<24|(F&255)<<16|(x&255)<<8|G&255,D?(this.imageDataDraw.data[k]=this.imageDataDraw.data[k]*(1-p)+(F&255)*p,this.imageDataDraw.data[k+1]=this.imageDataDraw.data[k+1]*(1-p)+(x&255)*p,this.imageDataDraw.data[k+
|
|
1676
|
-
2]=this.imageDataDraw.data[k+2]*(1-p)+(G&255)*p,this.imageDataDraw.data[k+3]=m):(this.imageDataDraw.data[k]=F&255,this.imageDataDraw.data[k+1]=x&255,this.imageDataDraw.data[k+2]=G&255,this.imageDataDraw.data[k+3]=h&255))):(H?this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?h=this.screenVolumes[b].volume.getVoxelAtCoordinate((g-d.x)*f.xSize,(d.y-e)*f.ySize,(d.z-c)*f.zSize,t,!q):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?h=this.screenVolumes[b].volume.getVoxelAtCoordinate((g-
|
|
1677
|
-
d.x)*f.xSize,(d.y-c)*f.ySize,(d.z-e)*f.zSize,t,!q):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(h=this.screenVolumes[b].volume.getVoxelAtCoordinate((c-d.x)*f.xSize,(d.y-g)*f.ySize,(d.z-e)*f.zSize,t,!q)):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?h=this.screenVolumes[b].volume.getVoxelAtMM(g*f.xSize,e*f.ySize,c*f.zSize,t,!q):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?h=this.screenVolumes[b].volume.getVoxelAtMM(g*f.xSize,c*f.ySize,
|
|
1678
|
-
e*f.zSize,t,!q):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(h=this.screenVolumes[b].volume.getVoxelAtMM(c*f.xSize,g*f.ySize,e*f.zSize,t,!q)),k=4*(e*this.xDim+g),F=h,this.imageData[b][k]=h,!this.screenVolumes[b].negative&&h<=this.screenVolumes[b].screenMin||this.screenVolumes[b].negative&&h>=this.screenVolumes[b].screenMin||isNaN(h)?(h=papaya.viewer.ScreenSlice.SCREEN_PIXEL_MIN,m=this.screenVolumes[b].isOverlay()?0:255):h=!this.screenVolumes[b].negative&&h>=this.screenVolumes[b].screenMax||
|
|
1679
|
-
this.screenVolumes[b].negative&&h<=this.screenVolumes[b].screenMax?papaya.viewer.ScreenSlice.SCREEN_PIXEL_MAX:papayaRoundFast((h-this.screenVolumes[b].screenMin)*this.screenVolumes[b].screenRatio),D)?0<m&&(this.imageDataDraw.data[k]=this.imageDataDraw.data[k]*(1-p)+this.screenVolumes[b].colorTable.lookupRed(h,F)*p,this.imageDataDraw.data[k+1]=this.imageDataDraw.data[k+1]*(1-p)+this.screenVolumes[b].colorTable.lookupGreen(h,F)*p,this.imageDataDraw.data[k+2]=this.imageDataDraw.data[k+2]*(1-p)+this.screenVolumes[b].colorTable.lookupBlue(h,
|
|
1680
|
-
F)*p,this.imageDataDraw.data[k+3]=m):(this.imageDataDraw.data[k]=this.screenVolumes[b].colorTable.lookupRed(h,F)*p,this.imageDataDraw.data[k+1]=this.screenVolumes[b].colorTable.lookupGreen(h,F)*p,this.imageDataDraw.data[k+2]=this.screenVolumes[b].colorTable.lookupBlue(h,F)*p,this.imageDataDraw.data[k+3]=m);L||this.contextDTILines.stroke();A||(D=!0)}I&&this.contextMain.putImageData(this.imageDataDraw,0,0)}};
|
|
1681
|
-
papaya.viewer.ScreenSlice.prototype.repaint=function(c,a,d){var f,b,e,g;a=0;var h,m,k,p,t,w,B,A,x,G;d=0;var F=!1;this.currentSlice=c=Math.round(c);this.contextMain.clearRect(0,0,this.canvasMain.width,this.canvasMain.height);this.contextDTILines&&this.contextDTILines.clearRect(0,0,this.screenDim,this.screenDim);if(this.imageData.length===this.screenVolumes.length){for(c=0;c<this.screenVolumes.length;c+=1)if(!this.screenVolumes[c].hidden){m=this.screenVolumes[c].rgb;k=this.screenVolumes[c].dti;p=this.screenVolumes[c].dtiLines;
|
|
1682
|
-
G=this.screenVolumes[c].dtiColors;p&&(this.contextDTILines.lineWidth=1,G||(this.contextDTILines.strokeStyle=papaya.viewer.ScreenSlice.DTI_COLORS[d],d+=1,d%=3,this.contextDTILines.beginPath()));for(f=0;f<this.yDim;f+=1)for(b=0;b<this.xDim;b+=1)(e=this.imageData[c][a],g=255,h=this.screenVolumes[c].alpha,a=4*(f*this.xDim+b),m)?(this.imageDataDraw.data[a]=e>>16&255,this.imageDataDraw.data[a+1]=e>>8&255,this.imageDataDraw.data[a+2]=e&255,this.imageDataDraw.data[a+3]=g):k?p?(g=this.imageData[c][a],isNaN(g)||
|
|
1683
|
-
(e=this.imageData2[c][a],x=e>>16&255,A=e>>8&255,w=e&255,h=e&16777215,this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?t=Math.acos(Math.abs(w)/Math.sqrt(x*x+A*A+w*w)):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?t=Math.acos(Math.abs(A)/Math.sqrt(x*x+A*A+w*w)):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(t=Math.acos(Math.abs(x)/Math.sqrt(x*x+A*A+w*w))),t=1-t/1.5708,G&&(this.contextDTILines.beginPath(),this.contextDTILines.strokeStyle="#"+papaya.utilities.StringUtils.pad(h.toString(16),
|
|
1684
|
-
6)),e=Math.sin(g),x=Math.cos(g),h=this.finalTransform2[0][2]+(b+.5)*this.finalTransform2[0][0],g=this.finalTransform2[1][2]+(f+.5)*this.finalTransform2[1][1],w=this.finalTransform2[0][2]+(b+.5*t)*this.finalTransform2[0][0],B=this.finalTransform2[1][2]+(f+.5)*this.finalTransform2[1][1],A=x*(w-h)-e*(B-g)+h,w=e*(w-h)+x*(B-g)+g,this.contextDTILines.moveTo(A,w),w=this.finalTransform2[0][2]+(b+1-.5*t)*this.finalTransform2[0][0],B=this.finalTransform2[1][2]+(f+.5)*this.finalTransform2[1][1],A=x*(w-h)-e*
|
|
1685
|
-
(B-g)+h,e=e*(w-h)+x*(B-g)+g,this.contextDTILines.lineTo(A,e),G&&this.contextDTILines.stroke())):(e=this.imageData[c][a],h=e&16777215,h=0!==h?(e>>24&255)/255:0,F?(this.imageDataDraw.data[a]=this.imageDataDraw.data[a]*(1-h)+(e>>16&255)*h,this.imageDataDraw.data[a+1]=this.imageDataDraw.data[a+1]*(1-h)+(e>>8&255)*h,this.imageDataDraw.data[a+2]=this.imageDataDraw.data[a+2]*(1-h)+(e&255)*h,this.imageDataDraw.data[a+3]=g):(this.imageDataDraw.data[a]=e>>16&255,this.imageDataDraw.data[a+1]=e>>8&255,this.imageDataDraw.data[a+
|
|
1686
|
-
2]=e&255,this.imageDataDraw.data[a+3]=e>>24&255)):(x=e=this.imageData[c][a],!this.screenVolumes[c].negative&&e<=this.screenVolumes[c].screenMin||this.screenVolumes[c].negative&&e>=this.screenVolumes[c].screenMin||isNaN(e)?(e=papaya.viewer.ScreenSlice.SCREEN_PIXEL_MIN,g=this.screenVolumes[c].isOverlay()?0:255):e=!this.screenVolumes[c].negative&&e>=this.screenVolumes[c].screenMax||this.screenVolumes[c].negative&&e<=this.screenVolumes[c].screenMax?papaya.viewer.ScreenSlice.SCREEN_PIXEL_MAX:papayaRoundFast((e-
|
|
1687
|
-
this.screenVolumes[c].screenMin)*this.screenVolumes[c].screenRatio),F)?0<g&&(this.imageDataDraw.data[a]=this.imageDataDraw.data[a]*(1-h)+this.screenVolumes[c].colorTable.lookupRed(e,x)*h,this.imageDataDraw.data[a+1]=this.imageDataDraw.data[a+1]*(1-h)+this.screenVolumes[c].colorTable.lookupGreen(e,x)*h,this.imageDataDraw.data[a+2]=this.imageDataDraw.data[a+2]*(1-h)+this.screenVolumes[c].colorTable.lookupBlue(e,x)*h,this.imageDataDraw.data[a+3]=g):(this.imageDataDraw.data[a]=this.screenVolumes[c].colorTable.lookupRed(e,
|
|
1688
|
-
x)*h,this.imageDataDraw.data[a+1]=this.screenVolumes[c].colorTable.lookupGreen(e,x)*h,this.imageDataDraw.data[a+2]=this.screenVolumes[c].colorTable.lookupBlue(e,x)*h,this.imageDataDraw.data[a+3]=g);G||this.contextDTILines.stroke();p||(F=!0)}this.contextMain.putImageData(this.imageDataDraw,0,0)}else this.updateSlice(c,!0)};papaya.viewer.ScreenSlice.prototype.getRealWidth=function(){return this.xDim*this.xSize};papaya.viewer.ScreenSlice.prototype.getRealHeight=function(){return this.yDim*this.ySize};
|
|
1689
|
-
papaya.viewer.ScreenSlice.prototype.getXYratio=function(){return this.xSize/this.ySize};papaya.viewer.ScreenSlice.prototype.getYXratio=function(){return this.ySize/this.xSize};papaya.viewer.ScreenSlice.prototype.getXSize=function(){return this.xSize};papaya.viewer.ScreenSlice.prototype.getYSize=function(){return this.ySize};papaya.viewer.ScreenSlice.prototype.getXDim=function(){return this.xDim};papaya.viewer.ScreenSlice.prototype.getYDim=function(){return this.yDim};
|
|
1690
|
-
papaya.viewer.ScreenSlice.prototype.updateZoomTransform=function(c,a,d,f,b,e){var g;a=(a+.5)*(c-1)*-1;d=(d+.5)*(c-1)*-1;f=a+f*(c-1);g=-1*(c-1)*this.xDim;0<f?f=0:f<g&&(f=g);b=d+b*(c-1);g=-1*(c-1)*this.yDim;0<b?b=0:b<g&&(b=g);1<c&&(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(e.panAmountX=Math.round((f-a)/(c-1)),e.panAmountY=Math.round((b-d)/(c-1))):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(e.panAmountX=Math.round((f-a)/(c-1)),e.panAmountZ=Math.round((b-
|
|
1691
|
-
d)/(c-1))):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(e.panAmountY=Math.round((f-a)/(c-1)),e.panAmountZ=Math.round((b-d)/(c-1))));this.zoomTransform[0][0]=c;this.zoomTransform[0][1]=0;this.zoomTransform[0][2]=f;this.zoomTransform[1][0]=0;this.zoomTransform[1][1]=c;this.zoomTransform[1][2]=b;this.updateFinalTransform()};
|
|
1692
|
-
papaya.viewer.ScreenSlice.prototype.updateFinalTransform=function(){var c,a;if(this.manager.isRadiologicalMode()&&this.isRadiologicalSensitive()){for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.tempTransform[c][a]=this.screenTransform[c][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.tempTransform2[c][a]=this.tempTransform[c][0]*this.radiologicalTransform[0][a]+this.tempTransform[c][1]*this.radiologicalTransform[1][a]+this.tempTransform[c][2]*this.radiologicalTransform[2][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.finalTransform[c][a]=
|
|
1693
|
-
this.tempTransform2[c][0]*this.zoomTransform[0][a]+this.tempTransform2[c][1]*this.zoomTransform[1][a]+this.tempTransform2[c][2]*this.zoomTransform[2][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.tempTransform[c][a]=this.screenTransform2[c][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.tempTransform2[c][a]=this.tempTransform[c][0]*this.radiologicalTransform[0][a]+this.tempTransform[c][1]*this.radiologicalTransform[1][a]+this.tempTransform[c][2]*this.radiologicalTransform[2][a];for(c=0;3>c;c+=1)for(a=0;3>
|
|
1694
|
-
a;a+=1)this.finalTransform2[c][a]=this.tempTransform2[c][0]*this.zoomTransform[0][a]+this.tempTransform2[c][1]*this.zoomTransform[1][a]+this.tempTransform2[c][2]*this.zoomTransform[2][a]}else{for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.finalTransform[c][a]=this.screenTransform[c][0]*this.zoomTransform[0][a]+this.screenTransform[c][1]*this.zoomTransform[1][a]+this.screenTransform[c][2]*this.zoomTransform[2][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.finalTransform2[c][a]=this.screenTransform2[c][0]*this.zoomTransform[0][a]+
|
|
1695
|
-
this.screenTransform2[c][1]*this.zoomTransform[1][a]+this.screenTransform2[c][2]*this.zoomTransform[2][a]}};papaya.viewer.ScreenSlice.prototype.isRadiologicalSensitive=function(){return this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL||this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL};
|
|
1696
|
-
papaya.viewer.ScreenSlice.prototype.findProximalRulerHandle=function(c,a){this.tempPoint.x=c;this.tempPoint.y=a;return papaya.utilities.MathUtils.lineDistance(this.tempPoint.x,this.tempPoint.y,this.rulerPoints[0].x,this.rulerPoints[0].y)<papaya.viewer.ScreenSlice.GRAB_RADIUS?this.rulerPoints[0]:papaya.utilities.MathUtils.lineDistance(this.tempPoint.x,this.tempPoint.y,this.rulerPoints[1].x,this.rulerPoints[1].y)<papaya.viewer.ScreenSlice.GRAB_RADIUS?this.rulerPoints[1]:null};
|
|
1697
|
-
papaya.viewer.ScreenSlice.prototype.updateDTILinesImage=function(){if(null===this.canvasDTILines||this.canvasDTILines.width!==this.screenDim)this.canvasDTILines=document.createElement("canvas"),this.canvasDTILines.width=this.screenDim,this.canvasDTILines.height=this.screenDim,this.contextDTILines=this.canvasDTILines.getContext("2d")};papaya.viewer.ScreenSlice.prototype.clearDTILinesImage=function(){this.contextDTILines=this.canvasDTILines=null};"use strict";papaya=papaya||{};
|
|
1698
|
-
papaya.viewer=papaya.viewer||{};
|
|
1699
|
-
papaya.viewer.ScreenVolume=papaya.viewer.ScreenVolume||function(c,a,d,f,b,e){this.volume=c;this.lutName=d;this.colorTable=new papaya.viewer.ColorTable(this.lutName,f);this.screenMin=this.volume.header.imageRange.displayMin;this.screenMax=this.volume.header.imageRange.displayMax;this.imageMin=this.volume.header.imageRange.imageMin;this.imageMax=this.volume.header.imageRange.imageMax;this.alpha=1;this.currentTimepoint=0;this.parametric=void 0!==b&&b;this.negativeScreenVol=null;this.dtiLines=this.dti=
|
|
1700
|
-
!1;this.dtiColors=!0;this.dtiVolumeMod=null;this.dtiAlphaFactor=1;this.rgb=this.volume.header.imageType.datatype===papaya.volume.ImageType.DATATYPE_RGB;this.hasCheckedImageRange=!1;this.interpolation=!0;this.error=null;this.hidden=!1;this.rotationZ=this.rotationY=this.rotationX=.5;this.rotationAbout="Rotate About Center";this.isHighResSlice=262144<this.volume.header.imageDimensions.getNumVoxelsSlice();this.currentCoord=e;(c=a[this.volume.fileName])?(void 0!==c.interpolation&&(this.interpolation=c.interpolation),
|
|
1701
|
-
void 0!==c.dti&&((this.dti=c.dti)&&3!==this.volume.numTimepoints&&(this.error=Error("DTI vector series must have 3 series points!")),this.dti&&(this.dtiLines=c.dtiLines,this.dtiColors=c.dtiColors,this.dtiLines||this.dtiColors||(this.dtiColors=!0),this.initDTI())),void 0!==c.min&&void 0!==c.max?b?(this.screenMin=-1*Math.abs(c.min),this.screenMax=-1*Math.abs(c.max)):(this.screenMin=c.min,this.screenMax=c.max):this.findDisplayRange(b,c),b?void 0!==c.negative_lut&&(this.lutName=c.negative_lut,this.colorTable=
|
|
1702
|
-
new papaya.viewer.ColorTable(this.lutName,f)):void 0!==c.lut&&("string"===typeof c.lut||c.lut instanceof String?(this.lutName=c.lut,this.colorTable=new papaya.viewer.ColorTable(this.lutName,f)):(this.lutName="Object",this.colorTable=c.lut)),void 0===c.alpha||f||(this.alpha=c.alpha),f&&(void 0!==c.rotation&&c.rotation.length&&3===c.rotation.length&&(this.rotationX=(Math.min(Math.max(c.rotation[0],-90),90)+90)/180,this.rotationY=(Math.min(Math.max(c.rotation[1],-90),90)+90)/180,this.rotationZ=(Math.min(Math.max(c.rotation[2],
|
|
1703
|
-
-90),90)+90)/180),c.rotationPoint&&("origin"===c.rotationPoint.toLowerCase()?this.rotationAbout="Rotate About Origin":"crosshairs"===c.rotationPoint.toLowerCase()?this.rotationAbout="Rotate About Crosshairs":this.rotationAbout="Rotate About Center"),this.updateTransform())):this.findDisplayRange(b,{});this.negative=!1;this.updateScreenRange();this.canvasIcon=document.createElement("canvas");this.canvasIcon.width=papaya.viewer.ColorTable.ICON_SIZE;this.canvasIcon.height=papaya.viewer.ColorTable.ICON_SIZE;
|
|
1704
|
-
this.contextIcon=this.canvasIcon.getContext("2d");this.imageDataIcon=this.contextIcon.createImageData(papaya.viewer.ColorTable.ICON_SIZE,papaya.viewer.ColorTable.ICON_SIZE);this.icon=null;this.canvasBar=document.createElement("canvas");this.canvasBar.width=papaya.viewer.ColorTable.COLOR_BAR_WIDTH;this.canvasBar.height=papaya.viewer.ColorTable.COLOR_BAR_HEIGHT;this.contextBar=this.canvasBar.getContext("2d");this.imageDataBar=this.contextBar.createImageData(papaya.viewer.ColorTable.COLOR_BAR_WIDTH,
|
|
1705
|
-
papaya.viewer.ColorTable.COLOR_BAR_HEIGHT);this.colorBar=null;this.updateIcon();this.updateColorBar()};papaya.viewer.ScreenVolume.makeSolidIcon=function(c,a,d){var f=document.createElement("canvas");f.width=papaya.viewer.ColorTable.ICON_SIZE;f.height=papaya.viewer.ColorTable.ICON_SIZE;var b=f.getContext("2d");b.fillStyle="rgb("+parseInt(255*c,10)+","+parseInt(255*a,10)+","+parseInt(255*d,10)+")";b.fillRect(0,0,papaya.viewer.ColorTable.ICON_SIZE,papaya.viewer.ColorTable.ICON_SIZE);return f.toDataURL()};
|
|
1706
|
-
papaya.viewer.ScreenVolume.prototype.setScreenRange=function(c,a){this.screenMin=c;this.screenMax=a;this.updateScreenRange()};papaya.viewer.ScreenVolume.prototype.setScreenRangeNegatives=function(c,a){this.negativeScreenVol.setScreenRange(c,a)};papaya.viewer.ScreenVolume.prototype.updateScreenRange=function(){this.screenRatio=papaya.viewer.ScreenSlice.SCREEN_PIXEL_MAX/(this.screenMax-this.screenMin);this.negative=this.screenMax<this.screenMin};papaya.viewer.ScreenVolume.prototype.isOverlay=function(){return!this.colorTable.isBaseImage};
|
|
1707
|
-
papaya.viewer.ScreenVolume.prototype.findImageRange=function(){var c,a,d,f,b,e,g,h,m;if(this.volume.header.imageRange.imageMin===this.volume.header.imageRange.imageMax&&!this.hasCheckedImageRange){this.hasCheckedImageRange=!0;c=Number.MAX_VALUE;a=Number.MIN_VALUE;d=this.volume.header.imageDimensions.xDim;f=this.volume.header.imageDimensions.yDim;b=this.volume.header.imageDimensions.zDim;for(e=0;e<b;e+=1)for(g=0;g<f;g+=1)for(h=0;h<d;h+=1)m=this.volume.getVoxelAtIndexNative(h,g,e,0,!0),m>a&&(a=m),m<
|
|
1708
|
-
c&&(c=m);this.volume.header.imageRange.imageMin=this.imageMin=c;this.volume.header.imageRange.imageMax=this.imageMax=a}};
|
|
1709
|
-
papaya.viewer.ScreenVolume.prototype.findDisplayRange=function(c,a){var d,f,b,e;d=this.volume.header.imageRange.imageMin!==this.volume.header.imageRange.imageMax;f=this.screenMin;b=this.screenMax;c&&Math.abs(f)>Math.abs(b)&&(e=b,b=f,f=e);if(c||void 0===a.minPercent&&void 0===a.maxPercent)if(this.isOverlay()){if(f===b||0>f&&0<b||0<f&&0>b||c&&(0<f||0<b)||a.symmetric)this.findImageRange(),c?a.symmetric||0===this.imageMin?(f=-1*(this.imageMax-.75*this.imageMax),b=-1*(this.imageMax-.25*this.imageMax)):
|
|
1710
|
-
(f=this.imageMin-.75*this.imageMin,b=this.imageMin-.25*this.imageMin):(f=this.imageMax-.75*this.imageMax,b=this.imageMax-.25*this.imageMax);1>f&&-1<f&&1>b&&-1<b||(f=Math.round(f),b=Math.round(b))}else 1>f&&-1<f&&1>b&&-1<b||(f=Math.round(f),b=Math.round(b)),0===f&&0===b&&(this.findImageRange(),f=this.imageMin,b=this.imageMax),b<=f&&(this.findImageRange(),f=this.imageMin,b=this.imageMax),d&&f<this.imageMin&&(this.findImageRange(),f=this.imageMin),d&&b>this.imageMax&&(this.findImageRange(),b=this.imageMax);
|
|
1711
|
-
else this.findImageRange(),f=void 0!==a.minPercent?this.imageMax*a.minPercent:this.imageMin,b=void 0!==a.maxPercent?this.imageMax*a.maxPercent:this.imageMax;this.screenMin=f;this.screenMax=b};papaya.viewer.ScreenVolume.prototype.isUsingColorTable=function(c){return this.lutName===c};papaya.viewer.ScreenVolume.prototype.isRotatingAbout=function(c){return this.rotationAbout===c};
|
|
1712
|
-
papaya.viewer.ScreenVolume.prototype.changeColorTable=function(c,a){this.colorTable=new papaya.viewer.ColorTable(a,!this.isOverlay());this.lutName=a;this.updateIcon();this.updateColorBar();c.drawViewer(!0)};papaya.viewer.ScreenVolume.prototype.getRange=function(){var c=Array(2);c[0]=this.colorTable.minLUT/(255/(this.screenMax-this.screenMin))+this.screenMin;c[1]=this.colorTable.maxLUT/(255/(this.screenMax-this.screenMin))+this.screenMin;return c};
|
|
1713
|
-
papaya.viewer.ScreenVolume.prototype.getRangeNegative=function(){return this.negativeScreenVol.getRange()};papaya.viewer.ScreenVolume.prototype.getAlphaNegative=function(){return this.negativeScreenVol.alpha};papaya.viewer.ScreenVolume.prototype.incrementTimepoint=function(){var c=this.volume.numTimepoints;this.currentTimepoint+=1;this.currentTimepoint>=c&&(this.currentTimepoint=c-1)};
|
|
1714
|
-
papaya.viewer.ScreenVolume.prototype.decrementTimepoint=function(){--this.currentTimepoint;0>this.currentTimepoint&&(this.currentTimepoint=0)};papaya.viewer.ScreenVolume.prototype.setTimepoint=function(c){this.currentTimepoint=0>c?0:c>=this.volume.numTimepoints?this.volume.numTimepoints-1:c};papaya.viewer.ScreenVolume.prototype.updateMinLUT=function(c){this.colorTable.updateMinLUT(c)};papaya.viewer.ScreenVolume.prototype.updateMaxLUT=function(c){this.colorTable.updateMaxLUT(c)};
|
|
1715
|
-
papaya.viewer.ScreenVolume.prototype.updateLUT=function(c,a){this.colorTable.updateLUT(c,a)};papaya.viewer.ScreenVolume.prototype.supportsDynamicColorTable=function(){return void 0!==this.colorTable.updateMinLUT&&void 0!==this.colorTable.updateMaxLUT&&void 0!==this.colorTable.updateLUT};papaya.viewer.ScreenVolume.prototype.resetDynamicRange=function(){this.colorTable.minLUT=0;this.colorTable.maxLUT=papaya.viewer.ColorTable.LUT_MAX;this.updateLUT(this.colorTable.minLUT,this.colorTable.maxLUT);this.updateColorBar()};
|
|
1716
|
-
papaya.viewer.ScreenVolume.prototype.getCurrentTime=function(){return this.currentTimepoint*this.volume.header.voxelDimensions.timeSize*this.volume.header.voxelDimensions.getTemporalUnitMultiplier()};papaya.viewer.ScreenVolume.prototype.setCurrentTime=function(c){var a=this.volume.header.voxelDimensions.timeSize*this.volume.header.voxelDimensions.getTemporalUnitMultiplier();0===a?this.setTimepoint(0):this.setTimepoint(parseInt(Math.round(c/a),10))};
|
|
1717
|
-
papaya.viewer.ScreenVolume.prototype.hasError=function(){return null!==this.error};papaya.viewer.ScreenVolume.prototype.initDTI=function(){this.volume.numTimepoints=1;this.volume.header.imageDimensions.timepoints=1;this.colorTable=new papaya.viewer.ColorTable(this.lutName,!1,papaya.viewer.ColorTable.TABLE_DTI_SPECTRUM);this.volume.transform.voxelValue.forceABS=!this.dtiLines;this.updateIcon()};papaya.viewer.ScreenVolume.prototype.isDTILines=function(){return this.dtiLines&&!this.dtiColors};
|
|
1718
|
-
papaya.viewer.ScreenVolume.prototype.isDTIRGB=function(){return!this.dtiLines&&this.dtiColors};papaya.viewer.ScreenVolume.prototype.isDTILinesAndRGB=function(){return this.dtiLines&&this.dtiColors};papaya.viewer.ScreenVolume.prototype.getHiddenLabel=function(){return this.hidden?"Show Overlay":"Hide Overlay"};
|
|
1719
|
-
papaya.viewer.ScreenVolume.prototype.updateIcon=function(){var c,a,d,f,b;if(this.imageDataIcon){c=papaya.viewer.ColorTable.LUT_MAX/papaya.viewer.ColorTable.ICON_SIZE;for(a=0;a<papaya.viewer.ColorTable.ICON_SIZE;a+=1)for(d=0;d<papaya.viewer.ColorTable.ICON_SIZE;d+=1)f=4*(a*papaya.viewer.ColorTable.ICON_SIZE+d),b=Math.round(d*c),this.imageDataIcon.data[f]=this.colorTable.lookupRed(b),this.imageDataIcon.data[f+1]=this.colorTable.lookupGreen(b),this.imageDataIcon.data[f+2]=this.colorTable.lookupBlue(b),
|
|
1720
|
-
this.imageDataIcon.data[f+3]=255;this.contextIcon.putImageData(this.imageDataIcon,0,0);this.icon=this.canvasIcon.toDataURL()}};
|
|
1721
|
-
papaya.viewer.ScreenVolume.prototype.updateColorBar=function(){var c,a,d,f,b;if(this.imageDataBar){c=papaya.viewer.ColorTable.LUT_MAX/papaya.viewer.ColorTable.COLOR_BAR_WIDTH;for(a=0;a<papaya.viewer.ColorTable.COLOR_BAR_HEIGHT;a+=1)for(d=0;d<papaya.viewer.ColorTable.COLOR_BAR_WIDTH;d+=1)f=4*(a*papaya.viewer.ColorTable.COLOR_BAR_WIDTH+d),b=Math.round(d*c),this.imageDataBar.data[f]=this.colorTable.lookupRed(b),this.imageDataBar.data[f+1]=this.colorTable.lookupGreen(b),this.imageDataBar.data[f+2]=this.colorTable.lookupBlue(b),
|
|
1722
|
-
this.imageDataBar.data[f+3]=255;this.contextBar.putImageData(this.imageDataBar,0,0);this.colorBar=this.canvasBar.toDataURL()}};
|
|
1723
|
-
papaya.viewer.ScreenVolume.prototype.updateTransform=function(){var c=180*(this.rotationX-.5),a=180*(this.rotationY-.5),d=180*(this.rotationZ-.5),f,b,e;"Rotate About Origin"===this.rotationAbout?(f=this.volume.header.origin.x*this.volume.header.voxelDimensions.xSize,b=this.volume.header.origin.y*this.volume.header.voxelDimensions.ySize,e=this.volume.header.origin.z*this.volume.header.voxelDimensions.zSize):"Rotate About Crosshairs"===this.rotationAbout?(f=this.currentCoord.x*this.volume.header.voxelDimensions.xSize,
|
|
1724
|
-
b=this.currentCoord.y*this.volume.header.voxelDimensions.ySize,e=this.currentCoord.z*this.volume.header.voxelDimensions.zSize):(f=this.volume.header.imageDimensions.xDim/2*this.volume.header.voxelDimensions.xSize,b=this.volume.header.imageDimensions.yDim/2*this.volume.header.voxelDimensions.ySize,e=this.volume.header.imageDimensions.zDim/2*this.volume.header.voxelDimensions.zSize);this.volume.transform.updateImageMat(f,b,e,c,a,d)};
|
|
1725
|
-
papaya.viewer.ScreenVolume.prototype.resetTransform=function(){this.rotationZ=this.rotationY=this.rotationX=.5};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};var PAPAYA_BUILD_NUM=PAPAYA_BUILD_NUM||"0";
|
|
1726
|
-
papaya.viewer.Viewer=papaya.viewer.Viewer||function(c,a,d,f){this.container=c;this.canvas=document.createElement("canvas");this.canvas.width=a;this.canvas.height=d;this.context=this.canvas.getContext("2d");this.canvas.style.padding=0;this.canvas.style.margin=0;this.canvas.style.border="none";this.atlas=null;this.pageLoaded=this.initialized=!1;this.loadingVolume=null;this.volume=new papaya.volume.Volume(this.container.display,this);this.screenVolumes=[];this.surfaces=[];this.lowerImageTop=this.lowerImageBot=
|
|
1727
|
-
this.lowerImageBot2=this.mainImage=this.selectedSlice=this.surfaceView=this.sagittalSlice=this.coronalSlice=this.axialSlice=this.currentScreenVolume=null;this.viewerDim=0;this.worldSpace=!1;this.currentCoord=new papaya.core.Coordinate(0,0,0);this.cursorPosition=new papaya.core.Coordinate(0,0,0);this.draggingSliceDir=this.longestDimSize=this.longestDim=0;this.isLongTouch=this.didLongTouch=this.isPanning=this.isContextMode=this.isZoomMode=this.isWindowControl=this.isDragging=!1;this.zoomFactorPrevious=
|
|
1728
|
-
this.zoomFactor=papaya.viewer.Viewer.ZOOM_FACTOR_MIN;this.panAmountZ=this.panAmountY=this.panAmountX=this.panLocZ=this.panLocY=this.panLocX=this.zoomLocZ=this.zoomLocY=this.zoomLocX=0;this.keyPressIgnored=!1;this.previousMousePosition=new papaya.core.Point;this.isShiftKeyDown=this.isAltKeyDown=this.isControlKeyDown=!1;this.toggleMainCrosshairs=!0;this.bgColor=null;this.loadingDTI=this.controlsHidden=this.hasSeries=!1;this.loadingDTIModRef=null;this.tempCoor=new papaya.core.Coordinate;this.listenerContextMenu=
|
|
1729
|
-
function(a){a.preventDefault();return!1};this.listenerMouseMove=papaya.utilities.ObjectUtils.bind(this,this.mouseMoveEvent);this.listenerMouseDown=papaya.utilities.ObjectUtils.bind(this,this.mouseDownEvent);this.listenerMouseOut=papaya.utilities.ObjectUtils.bind(this,this.mouseOutEvent);this.listenerMouseLeave=papaya.utilities.ObjectUtils.bind(this,this.mouseLeaveEvent);this.listenerMouseUp=papaya.utilities.ObjectUtils.bind(this,this.mouseUpEvent);this.listenerMouseDoubleClick=papaya.utilities.ObjectUtils.bind(this,
|
|
1730
|
-
this.mouseDoubleClickEvent);this.listenerKeyDown=papaya.utilities.ObjectUtils.bind(this,this.keyDownEvent);this.listenerKeyUp=papaya.utilities.ObjectUtils.bind(this,this.keyUpEvent);this.listenerTouchMove=papaya.utilities.ObjectUtils.bind(this,this.touchMoveEvent);this.listenerTouchStart=papaya.utilities.ObjectUtils.bind(this,this.touchStartEvent);this.listenerTouchEnd=papaya.utilities.ObjectUtils.bind(this,this.touchEndEvent);this.initialCoordinate=null;this.listenerScroll=papaya.utilities.ObjectUtils.bind(this,
|
|
1731
|
-
this.scrolled);this.updateTimerEvent=this.updateTimer=this.longTouchTimer=null;this.drawEmptyViewer();this.processParams(f)};papaya.viewer.Viewer.GAP=PAPAYA_SPACING;papaya.viewer.Viewer.BACKGROUND_COLOR="rgba(0, 0, 0, 255)";papaya.viewer.Viewer.CROSSHAIRS_COLOR="rgba(28, 134, 238, 255)";papaya.viewer.Viewer.KEYCODE_ROTATE_VIEWS=32;papaya.viewer.Viewer.KEYCODE_CENTER=67;papaya.viewer.Viewer.KEYCODE_ORIGIN=79;papaya.viewer.Viewer.KEYCODE_ARROW_UP=38;papaya.viewer.Viewer.KEYCODE_ARROW_DOWN=40;
|
|
1732
|
-
papaya.viewer.Viewer.KEYCODE_ARROW_RIGHT=39;papaya.viewer.Viewer.KEYCODE_ARROW_LEFT=37;papaya.viewer.Viewer.KEYCODE_PAGE_UP=33;papaya.viewer.Viewer.KEYCODE_PAGE_DOWN=34;papaya.viewer.Viewer.KEYCODE_SINGLE_QUOTE=222;papaya.viewer.Viewer.KEYCODE_FORWARD_SLASH=191;papaya.viewer.Viewer.KEYCODE_INCREMENT_MAIN=71;papaya.viewer.Viewer.KEYCODE_DECREMENT_MAIN=86;papaya.viewer.Viewer.KEYCODE_TOGGLE_CROSSHAIRS=65;papaya.viewer.Viewer.KEYCODE_SERIES_BACK=188;papaya.viewer.Viewer.KEYCODE_SERIES_FORWARD=190;
|
|
1733
|
-
papaya.viewer.Viewer.MAX_OVERLAYS=8;papaya.viewer.Viewer.ORIENTATION_MARKER_SUPERIOR="S";papaya.viewer.Viewer.ORIENTATION_MARKER_INFERIOR="I";papaya.viewer.Viewer.ORIENTATION_MARKER_ANTERIOR="A";papaya.viewer.Viewer.ORIENTATION_MARKER_POSTERIOR="P";papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT="L";papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT="R";papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE=16;papaya.viewer.Viewer.ORIENTATION_CERTAINTY_UNKNOWN_COLOR="red";
|
|
1734
|
-
papaya.viewer.Viewer.ORIENTATION_CERTAINTY_LOW_COLOR="yellow";papaya.viewer.Viewer.ORIENTATION_CERTAINTY_HIGH_COLOR="white";papaya.viewer.Viewer.UPDATE_TIMER_INTERVAL=250;papaya.viewer.Viewer.ZOOM_FACTOR_MAX=10;papaya.viewer.Viewer.ZOOM_FACTOR_MIN=1;papaya.viewer.Viewer.MOUSE_SCROLL_THRESHLD=.25;papaya.viewer.Viewer.TITLE_MAX_LENGTH=30;papaya.viewer.Viewer.validDimBounds=function(c,a){return c<a?c:a-1};papaya.viewer.Viewer.getKeyCode=function(c){return c.keyCode||c.charCode};
|
|
1735
|
-
papaya.viewer.Viewer.isControlKey=function(c){c=papaya.viewer.Viewer.getKeyCode(c);return"MacOS"!==papaya.utilities.PlatformUtils.os||91!==c&&93!==c&&224!==c?"MacOS"!==papaya.utilities.PlatformUtils.os&&17===c:!0};papaya.viewer.Viewer.isAltKey=function(c){return 18===papaya.viewer.Viewer.getKeyCode(c)};papaya.viewer.Viewer.isShiftKey=function(c){c=!!c.shiftKey;!c&&window.event&&(c=!!window.event.shiftKey);return c};
|
|
1736
|
-
papaya.viewer.Viewer.getOffsetRect=function(c){c=c.getBoundingClientRect();var a=document.body,d=document.documentElement,f=c.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||a.clientLeft||0);return{top:Math.round(c.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||a.clientTop||0)),left:Math.round(f)}};
|
|
1737
|
-
papaya.viewer.Viewer.drawRoundRect=function(c,a,d,f,b,e,g,h){"undefined"===typeof h&&(h=!0);"undefined"===typeof e&&(e=5);c.beginPath();c.moveTo(a+e,d);c.lineTo(a+f-e,d);c.quadraticCurveTo(a+f,d,a+f,d+e);c.lineTo(a+f,d+b-e);c.quadraticCurveTo(a+f,d+b,a+f-e,d+b);c.lineTo(a+e,d+b);c.quadraticCurveTo(a,d+b,a,d+b-e);c.lineTo(a,d+e);c.quadraticCurveTo(a,d,a+e,d);c.closePath();h&&c.stroke();g&&c.fill()};
|
|
1738
|
-
papaya.viewer.Viewer.prototype.loadImage=function(c,a,d){0===this.screenVolumes.length?this.loadBaseImage(c,a,d):this.loadOverlay(c,a,d)};papaya.viewer.Viewer.prototype.showDialog=function(c,a,d,f,b){var e,g=-1;for(e=0;e<papayaContainers.length;e+=1)if(papayaContainers[e]===this.container){g=e;break}(new papaya.ui.Dialog(this.container,c,a,d,f,b,g)).showDialog()};
|
|
1739
|
-
papaya.viewer.Viewer.prototype.loadBaseImage=function(c,a,d){var f=this.container.findLoadableImage(c);this.volume=new papaya.volume.Volume(this.container.display,this,this.container.params);d?(c=f.encode,c instanceof Array||(c=[],c[0]=f.encode),this.volume.readEncodedData(c,papaya.utilities.ObjectUtils.bind(this,this.initializeViewer))):null!==f&&void 0!==f.encode?(c=f.encode,c instanceof Array||(c=[],c[0]=f.encode),this.volume.readEncodedData(c,papaya.utilities.ObjectUtils.bind(this,this.initializeViewer))):
|
|
1740
|
-
a?this.volume.readURLs(c,papaya.utilities.ObjectUtils.bind(this,this.initializeViewer)):null!==f&&void 0!==f.url?this.volume.readURLs([f.url],papaya.utilities.ObjectUtils.bind(this,this.initializeViewer)):this.volume.readFiles(c,papaya.utilities.ObjectUtils.bind(this,this.initializeViewer))};
|
|
1741
|
-
papaya.viewer.Viewer.prototype.loadOverlay=function(c,a,d){var f=this.container.findLoadableImage(c);this.loadingVolume=new papaya.volume.Volume(this.container.display,this,this.container.params);this.screenVolumes.length>papaya.viewer.Viewer.MAX_OVERLAYS?(this.loadingVolume.error=Error("Maximum number of overlays ("+papaya.viewer.Viewer.MAX_OVERLAYS+") has been reached!"),this.initializeOverlay()):d?(c=f.encode,c instanceof Array||(c=[],c[0]=f.encode),this.loadingVolume.readEncodedData(c,papaya.utilities.ObjectUtils.bind(this,
|
|
1742
|
-
this.initializeOverlay))):null!==f&&void 0!==f.encode?(c=f.encode,c instanceof Array||(c=[],c[0]=f.encode),this.loadingVolume.readEncodedData(c,papaya.utilities.ObjectUtils.bind(this,this.initializeOverlay))):a?this.loadingVolume.readURLs(c,papaya.utilities.ObjectUtils.bind(this,this.initializeOverlay)):null!==f&&void 0!==f.url?this.loadingVolume.readURLs([f.url],papaya.utilities.ObjectUtils.bind(this,this.initializeOverlay)):this.loadingVolume.readFiles(c,papaya.utilities.ObjectUtils.bind(this,this.initializeOverlay))};
|
|
1743
|
-
papaya.viewer.Viewer.prototype.loadSurface=function(c,a,d){var f=this.container.findLoadableImage(c,!0);if(0==this.screenVolumes.length)this.container.display.drawError("Load an image before loading a surface!");else{var b=new papaya.surface.Surface(this.container.display,this.container.params);d?b.readEncodedData(c[0],this.volume,papaya.utilities.ObjectUtils.bind(this,this.initializeSurface)):null!==f&&void 0!==f.encode?b.readEncodedData(f.encode,this.volume,papaya.utilities.ObjectUtils.bind(this,
|
|
1744
|
-
this.initializeSurface)):a?b.readURL(c,this.volume,papaya.utilities.ObjectUtils.bind(this,this.initializeSurface)):null!==f&&void 0!==f.url?b.readURL(f.url,this.volume,papaya.utilities.ObjectUtils.bind(this,this.initializeSurface)):b.readFile(c[0],this.volume,papaya.utilities.ObjectUtils.bind(this,this.initializeSurface))}};
|
|
1745
|
-
papaya.viewer.Viewer.prototype.initializeSurface=function(c){var a=c;if(c.error)c.error&&this.container.display.drawError(c.error);else{for(;null!==a;)this.surfaces.push(a),a=a.nextSurface;if(null===this.surfaceView)this.lowerImageBot2=this.surfaceView=new papaya.viewer.ScreenSurface(this.volume,this.surfaces,this,this.container.params),this.container.resizeViewerComponents(!0);else for(a=c;null!==a;)this.surfaceView.initBuffers(this.surfaceView.context,a),a=a.nextSurface;this.container.params.mainView&&
|
|
1746
|
-
"surface"===this.container.params.mainView.toLowerCase()&&(this.mainImage=this.surfaceView,this.lowerImageTop=this.axialSlice,this.lowerImageBot=this.sagittalSlice,this.lowerImageBot2=this.coronalSlice,this.viewsChanged());this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons();this.container.hasMoreToLoad()?this.container.loadNext():this.finishedLoading()}};papaya.viewer.Viewer.prototype.atlasLoaded=function(){this.finishedLoading()};
|
|
1747
|
-
papaya.viewer.Viewer.prototype.initializeViewer=function(){var c,a;a=this;if(this.volume.hasError())c=this.volume.error.message,this.resetViewer(),this.container.clearParams(),this.container.display.drawError(c);else if(this.screenVolumes[0]=new papaya.viewer.ScreenVolume(this.volume,this.container.params,papaya.viewer.ColorTable.DEFAULT_COLOR_TABLE.name,!0,!1,this.currentCoord),this.loadingDTI&&(this.loadingDTI=!1,this.screenVolumes[0].dti=!0,this.screenVolumes[0].dti&&3!==this.screenVolumes[0].volume.numTimepoints&&
|
|
1748
|
-
(this.screenVolumes[0].error=Error("DTI vector series must have 3 series points!")),this.screenVolumes[0].dti&&this.screenVolumes[0].initDTI()),this.screenVolumes[0].hasError())c=this.screenVolumes[0].error.message,this.resetViewer(),this.container.clearParams(),this.container.display.drawError(c);else{this.setCurrentScreenVol(0);this.axialSlice=new papaya.viewer.ScreenSlice(this.volume,papaya.viewer.ScreenSlice.DIRECTION_AXIAL,this.volume.getXDim(),this.volume.getYDim(),this.volume.getXSize(),this.volume.getYSize(),
|
|
1749
|
-
this.screenVolumes,this);this.coronalSlice=new papaya.viewer.ScreenSlice(this.volume,papaya.viewer.ScreenSlice.DIRECTION_CORONAL,this.volume.getXDim(),this.volume.getZDim(),this.volume.getXSize(),this.volume.getZSize(),this.screenVolumes,this);this.sagittalSlice=new papaya.viewer.ScreenSlice(this.volume,papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL,this.volume.getYDim(),this.volume.getZDim(),this.volume.getYSize(),this.volume.getZSize(),this.screenVolumes,this);void 0===this.container.params.mainView||
|
|
1750
|
-
"axial"===this.container.params.mainView.toLowerCase()?(this.mainImage=this.axialSlice,this.lowerImageTop=this.sagittalSlice,this.lowerImageBot=this.coronalSlice):"coronal"===this.container.params.mainView.toLowerCase()?(this.mainImage=this.coronalSlice,this.lowerImageTop=this.axialSlice,this.lowerImageBot=this.sagittalSlice):"sagittal"===this.container.params.mainView.toLowerCase()?(this.mainImage=this.sagittalSlice,this.lowerImageTop=this.coronalSlice,this.lowerImageBot=this.axialSlice):(this.mainImage=
|
|
1751
|
-
this.axialSlice,this.lowerImageTop=this.sagittalSlice,this.lowerImageBot=this.coronalSlice);this.canvas.addEventListener("mousemove",this.listenerMouseMove,!1);this.canvas.addEventListener("mousedown",this.listenerMouseDown,!1);this.canvas.addEventListener("mouseout",this.listenerMouseOut,!1);this.canvas.addEventListener("mouseleave",this.listenerMouseLeave,!1);this.canvas.addEventListener("mouseup",this.listenerMouseUp,!1);document.addEventListener("keydown",this.listenerKeyDown,!0);document.addEventListener("keyup",
|
|
1752
|
-
this.listenerKeyUp,!0);this.canvas.addEventListener("touchmove",this.listenerTouchMove,!1);this.canvas.addEventListener("touchstart",this.listenerTouchStart,!1);this.canvas.addEventListener("touchend",this.listenerTouchEnd,!1);this.canvas.addEventListener("dblclick",this.listenerMouseDoubleClick,!1);document.addEventListener("contextmenu",this.listenerContextMenu,!1);this.container.showControlBar?($(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_MAIN_SLIDER).find("button")).eq(0).click(function(){a.mainImage.sliceDirection===
|
|
1753
|
-
papaya.viewer.ScreenSlice.DIRECTION_AXIAL?a.incrementAxial(!1):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?a.incrementCoronal(!1):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&a.incrementSagittal(!0)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_MAIN_SLIDER).find("button")).eq(1).click(function(){a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?a.incrementAxial(!0):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?
|
|
1754
|
-
a.incrementCoronal(!0):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&a.incrementSagittal(!1)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(0).find("button").eq(0)).click(function(){a.incrementAxial(!1)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(0).find("button").eq(1)).click(function(){a.incrementAxial(!0)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(1).find("button").eq(0)).click(function(){a.incrementCoronal(!1)}),
|
|
1755
|
-
$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(1).find("button").eq(1)).click(function(){a.incrementCoronal(!0)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(2).find("button").eq(0)).click(function(){a.incrementSagittal(!0)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(2).find("button").eq(1)).click(function(){a.incrementSagittal(!1)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(3).find("button").eq(0)).click(function(){a.decrementSeriesPoint()}),
|
|
1756
|
-
$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(3).find("button").eq(1)).click(function(){a.incrementSeriesPoint()}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS)).click(function(){a.rotateViews()}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS)).click(function(){var c=new papaya.core.Coordinate(Math.floor(a.volume.header.imageDimensions.xDim/2),Math.floor(a.volume.header.imageDimensions.yDim/2),Math.floor(a.volume.header.imageDimensions.zDim/
|
|
1757
|
-
2));a.gotoCoordinate(c)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS)).click(function(){a.gotoCoordinate(a.volume.header.origin)}),$("."+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS).prop("disabled",!1),$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).prop("disabled",!1),$("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).prop("disabled",!1),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).prop("disabled",!1)):this.container.showControls&&($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).css({display:"inline"}),
|
|
1758
|
-
$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).css({display:"inline"}),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).css({display:"inline"}),$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex)).click(function(){a.rotateViews()}),$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex)).click(function(){a.mainImage.sliceDirection===
|
|
1759
|
-
papaya.viewer.ScreenSlice.DIRECTION_AXIAL?a.incrementAxial(!1):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?a.incrementCoronal(!1):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&a.incrementSagittal(!0)}),$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex)).click(function(){a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?a.incrementAxial(!0):a.mainImage.sliceDirection===
|
|
1760
|
-
papaya.viewer.ScreenSlice.DIRECTION_CORONAL?a.incrementCoronal(!0):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&a.incrementSagittal(!1)}),$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex)).click(function(){var c=new papaya.core.Coordinate(Math.floor(a.volume.header.imageDimensions.xDim/2),Math.floor(a.volume.header.imageDimensions.yDim/2),Math.floor(a.volume.header.imageDimensions.zDim/2));a.gotoCoordinate(c)}),
|
|
1761
|
-
$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex)).click(function(){a.gotoCoordinate(a.volume.header.origin)}));this.hasSeries=1<this.volume.header.imageDimensions.timepoints;this.container.allowScroll&&this.addScroll();this.setLongestDim(this.volume);this.calculateScreenSliceTransforms(this);this.currentCoord.setCoordinate(papayaFloorFast(this.volume.getXDim()/2),papayaFloorFast(this.volume.getYDim()/2),papayaFloorFast(this.volume.getZDim()/
|
|
1762
|
-
2));this.updateOffsetRect();this.bgColor=$("body").css("background-color");if("rgba(0, 0, 0, 0)"===this.bgColor||"transparent"===this.bgColor)this.bgColor="rgba(255, 255, 255, 255)";this.context.fillStyle=this.bgColor;this.context.fillRect(0,0,this.canvas.offsetWidth,this.canvas.offsetHeight);this.volume.isWorldSpaceOnly()&&(this.worldSpace=!0);this.initialized=!0;this.container.resizeViewerComponents(!0);this.drawViewer();this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons();
|
|
1763
|
-
this.updateWindowTitle();this.container.loadingImageIndex=1;this.container.hasMoreToLoad()?this.container.loadNext():this.finishedLoading()}};papaya.viewer.Viewer.prototype.finishedLoading=function(){this.pageLoaded||(this.goToInitialCoordinate(),this.updateSliceSliderControl(),this.pageLoaded=!0);this.container.loadingComplete&&(this.container.loadingComplete(),this.container.loadingComplete=null);this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons()};
|
|
1764
|
-
papaya.viewer.Viewer.prototype.addScroll=function(){this.container.nestedViewer||window.addEventListener(papaya.utilities.PlatformUtils.getSupportedScrollEvent(),this.listenerScroll,!1)};papaya.viewer.Viewer.prototype.removeScroll=function(){window.removeEventListener(papaya.utilities.PlatformUtils.getSupportedScrollEvent(),this.listenerScroll,!1)};papaya.viewer.Viewer.prototype.updateOffsetRect=function(){this.canvasRect=papaya.viewer.Viewer.getOffsetRect(this.canvas)};
|
|
1765
|
-
papaya.viewer.Viewer.prototype.initializeOverlay=function(){var c,a,d;if(this.loadingVolume.hasError())this.container.display.drawError(this.loadingVolume.error.message),this.container.clearParams(),this.loadingVolume=null;else{a=(c=this.container.params[this.loadingVolume.fileName])&&c.parametric;d=c&&c.dtiMod;if(this.loadingDTIModRef)this.loadingDTIModRef.dtiVolumeMod=this.loadingVolume,this.loadingDTIModRef=null;else if(d){if(a=this.getScreenVolumeByName(c.dtiRef))a.dtiVolumeMod=this.loadingVolume,
|
|
1766
|
-
a.dtiAlphaFactor=void 0!==c.dtiModAlphaFactor?c.dtiModAlphaFactor:1}else{c=new papaya.viewer.ScreenVolume(this.loadingVolume,this.container.params,a?papaya.viewer.ColorTable.PARAMETRIC_COLOR_TABLES[0].name:this.getNextColorTable(),!1,!1,this.currentCoord);this.loadingDTI&&(this.loadingDTI=!1,c.dti=!0,c.dti&&3!==c.volume.numTimepoints&&(c.error=Error("DTI vector series must have 3 series points!")),c.dti&&c.initDTI());if(c.hasError()){this.container.display.drawError(c.error.message);this.container.clearParams();
|
|
1767
|
-
this.loadingVolume=null;return}this.screenVolumes[this.screenVolumes.length]=c;this.setCurrentScreenVol(this.screenVolumes.length-1);a&&(this.screenVolumes[this.screenVolumes.length-1].findImageRange(),0>this.screenVolumes[this.screenVolumes.length-1].volume.header.imageRange.imageMin&&(this.screenVolumes[this.screenVolumes.length]=a=new papaya.viewer.ScreenVolume(this.loadingVolume,this.container.params,papaya.viewer.ColorTable.PARAMETRIC_COLOR_TABLES[1].name,!1,!0,this.currentCoord),c.negativeScreenVol=
|
|
1768
|
-
a,this.setCurrentScreenVol(this.screenVolumes.length-1)))}this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons();this.drawViewer(!0);this.hasSeries=!1;for(c=0;c<this.screenVolumes.length;c+=1)if(1<this.screenVolumes[c].volume.header.imageDimensions.timepoints){this.hasSeries=!0;break}this.container.resizeViewerComponents();this.updateWindowTitle();this.loadingVolume=null;this.container.hasMoreToLoad()?this.container.loadNext():this.finishedLoading()}};
|
|
1769
|
-
papaya.viewer.Viewer.prototype.closeOverlayByRef=function(c){this.closeOverlay(this.getScreenVolumeIndex(c))};
|
|
1770
|
-
papaya.viewer.Viewer.prototype.closeOverlay=function(c){var a;for(a=0;a<this.screenVolumes.length;a+=1)this.screenVolumes[a].negativeScreenVol===this.screenVolumes[c]&&(this.screenVolumes[a].negativeScreenVol=null);this.screenVolumes.splice(c,1);this.setCurrentScreenVol(this.screenVolumes.length-1);this.drawViewer(!0);this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons();this.updateWindowTitle();this.hasSeries=!1;for(a=0;a<this.screenVolumes.length;a+=1)if(1<this.screenVolumes[a].volume.header.imageDimensions.timepoints){this.hasSeries=
|
|
1771
|
-
!0;break}this.container.resizeViewerComponents()};papaya.viewer.Viewer.prototype.hasDefinedAtlas=function(){var c;return"undefined"!==typeof papaya.data&&(c=typeof papaya.data.Atlas,"undefined"!==c)?!0:!1};papaya.viewer.Viewer.prototype.loadAtlas=function(){null===this.atlas&&(this.atlas=new papaya.viewer.Atlas(papaya.data.Atlas,this.container,papaya.utilities.ObjectUtils.bind(this,this.atlasLoaded)))};
|
|
1772
|
-
papaya.viewer.Viewer.prototype.isInsideMainSlice=function(c,a){this.updateOffsetRect();c-=this.canvasRect.left;a-=this.canvasRect.top;return this.mainImage===this.axialSlice?this.insideScreenSlice(this.axialSlice,c,a,this.volume.getXDim(),this.volume.getYDim()):this.mainImage===this.coronalSlice?this.insideScreenSlice(this.coronalSlice,c,a,this.volume.getXDim(),this.volume.getZDim()):this.mainImage===this.sagittalSlice?this.insideScreenSlice(this.sagittalSlice,c,a,this.volume.getYDim(),this.volume.getZDim()):
|
|
1773
|
-
!1};
|
|
1774
|
-
papaya.viewer.Viewer.prototype.updatePosition=function(c,a,d,f){var b,e;c.updateOffsetRect();b=a;e=d;a-=this.canvasRect.left;d-=this.canvasRect.top;if(this.insideScreenSlice(c.axialSlice,a,d,c.volume.getXDim(),c.volume.getYDim())){if(!this.isDragging||this.draggingSliceDir===papaya.viewer.ScreenSlice.DIRECTION_AXIAL)if(a=this.convertScreenToImageCoordinateX(a,c.axialSlice),d=this.convertScreenToImageCoordinateY(d,c.axialSlice),a!==c.currentCoord.x||d!==c.currentCoord.y)c.currentCoord.x=a,c.currentCoord.y=d,
|
|
1775
|
-
this.draggingSliceDir=papaya.viewer.ScreenSlice.DIRECTION_AXIAL}else if(this.insideScreenSlice(c.coronalSlice,a,d,c.volume.getXDim(),c.volume.getZDim())){if(!this.isDragging||this.draggingSliceDir===papaya.viewer.ScreenSlice.DIRECTION_CORONAL)if(a=this.convertScreenToImageCoordinateX(a,c.coronalSlice),d=this.convertScreenToImageCoordinateY(d,c.coronalSlice),a!==c.currentCoord.x||d!==c.currentCoord.y)c.currentCoord.x=a,c.currentCoord.z=d,this.draggingSliceDir=papaya.viewer.ScreenSlice.DIRECTION_CORONAL}else if(this.insideScreenSlice(c.sagittalSlice,
|
|
1776
|
-
a,d,c.volume.getYDim(),c.volume.getZDim())){if(!this.isDragging||this.draggingSliceDir===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL)if(a=this.convertScreenToImageCoordinateX(a,c.sagittalSlice),d=this.convertScreenToImageCoordinateY(d,c.sagittalSlice),a!==c.currentCoord.x||d!==c.currentCoord.y)c.currentCoord.y=a,c.currentCoord.z=d,this.draggingSliceDir=papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL}else c.surfaceView&&this.insideScreenSlice(c.surfaceView,a,d,c.surfaceView.screenDim,c.surfaceView.screenDim)&&
|
|
1777
|
-
c.surfaceView.updateDynamic(b,e,this.selectedSlice===this.mainImage?1:3);this.container.coordinateChanged(this);c.drawViewer(!1,f)};papaya.viewer.Viewer.prototype.convertScreenToImageCoordinateX=function(c,a){return papaya.viewer.Viewer.validDimBounds(papayaFloorFast((c-a.finalTransform[0][2])/a.finalTransform[0][0]),a.xDim)};
|
|
1778
|
-
papaya.viewer.Viewer.prototype.convertScreenToImageCoordinateY=function(c,a){return papaya.viewer.Viewer.validDimBounds(papayaFloorFast((c-a.finalTransform[1][2])/a.finalTransform[1][1]),a.yDim)};
|
|
1779
|
-
papaya.viewer.Viewer.prototype.convertScreenToImageCoordinate=function(c,a,d){var f,b,e;void 0===d&&(d=this.mainImage);d.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(f=this.convertScreenToImageCoordinateX(c,d),b=this.convertScreenToImageCoordinateY(a,d),e=this.axialSlice.currentSlice):d.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(f=this.convertScreenToImageCoordinateX(c,d),e=this.convertScreenToImageCoordinateY(a,d),b=this.coronalSlice.currentSlice):d.sliceDirection===
|
|
1780
|
-
papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(b=this.convertScreenToImageCoordinateX(c,d),e=this.convertScreenToImageCoordinateY(a,d),f=this.sagittalSlice.currentSlice);return new papaya.core.Coordinate(f,b,e)};papaya.viewer.Viewer.prototype.convertCurrentCoordinateToScreen=function(c){return this.convertCoordinateToScreen(this.currentCoord,c)};
|
|
1781
|
-
papaya.viewer.Viewer.prototype.intersectsMainSlice=function(c){var a=this.mainImage.sliceDirection;return a===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?c.z===this.mainImage.currentSlice:a===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?c.y===this.mainImage.currentSlice:a===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL?c.x===this.mainImage.currentSlice:!1};
|
|
1782
|
-
papaya.viewer.Viewer.prototype.convertCoordinateToScreen=function(c,a){var d,f,b;void 0===a&&(a=this.mainImage);b=a.sliceDirection;b===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(d=papayaFloorFast(a.finalTransform[0][2]+(c.x+.5)*a.finalTransform[0][0]),f=papayaFloorFast(a.finalTransform[1][2]+(c.y+.5)*a.finalTransform[1][1])):b===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(d=papayaFloorFast(a.finalTransform[0][2]+(c.x+.5)*a.finalTransform[0][0]),f=papayaFloorFast(a.finalTransform[1][2]+(c.z+.5)*a.finalTransform[1][1])):
|
|
1783
|
-
b===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(d=papayaFloorFast(a.finalTransform[0][2]+(c.y+.5)*a.finalTransform[0][0]),f=papayaFloorFast(a.finalTransform[1][2]+(c.z+.5)*a.finalTransform[1][1]));return new papaya.core.Point(d,f)};
|
|
1784
|
-
papaya.viewer.Viewer.prototype.updateCursorPosition=function(c,a,d){var f,b,e,g=null,h;this.container.display&&(a-=this.canvasRect.left,d-=this.canvasRect.top,this.insideScreenSlice(c.axialSlice,a,d,c.volume.getXDim(),c.volume.getYDim())?(f=this.convertScreenToImageCoordinateX(a,c.axialSlice),b=this.convertScreenToImageCoordinateY(d,c.axialSlice),e=c.axialSlice.currentSlice,h=!0):this.insideScreenSlice(c.coronalSlice,a,d,c.volume.getXDim(),c.volume.getZDim())?(f=this.convertScreenToImageCoordinateX(a,
|
|
1785
|
-
c.coronalSlice),e=this.convertScreenToImageCoordinateY(d,c.coronalSlice),b=c.coronalSlice.currentSlice,h=!0):this.insideScreenSlice(c.sagittalSlice,a,d,c.volume.getYDim(),c.volume.getZDim())?(b=this.convertScreenToImageCoordinateX(a,c.sagittalSlice),e=this.convertScreenToImageCoordinateY(d,c.sagittalSlice),f=c.sagittalSlice.currentSlice,h=!0):this.insideScreenSlice(c.surfaceView,a,d)&&(a-=c.surfaceView.screenOffsetX,d-=c.surfaceView.screenOffsetY,g=this.surfaceView.pick(a,d))&&(this.getIndexCoordinateAtWorld(g.coordinate[0],
|
|
1786
|
-
g.coordinate[1],g.coordinate[2],this.tempCoor),f=this.tempCoor.x,b=this.tempCoor.y,e=this.tempCoor.z,h=!0),h?(this.cursorPosition.x=f,this.cursorPosition.y=b,this.cursorPosition.z=e,this.container.display.drawDisplay(f,b,e)):this.container.display.drawEmptyDisplay())};
|
|
1787
|
-
papaya.viewer.Viewer.prototype.insideScreenSlice=function(c,a,d,f,b){var e,g;if(!c)return!1;c===this.surfaceView?(e=c.screenOffsetX,f=c.screenOffsetX+c.screenDim,g=c.screenOffsetY,c=c.screenOffsetY+c.screenDim):(e=papayaRoundFast(c.screenTransform[0][2]),f=papayaRoundFast(c.screenTransform[0][2]+f*c.screenTransform[0][0]),g=papayaRoundFast(c.screenTransform[1][2]),c=papayaRoundFast(c.screenTransform[1][2]+b*c.screenTransform[1][1]));return a>=e&&a<f&&d>=g&&d<c};
|
|
1788
|
-
papaya.viewer.Viewer.prototype.drawEmptyViewer=function(){var c,a,d;this.context.fillStyle="#000000";this.context.fillRect(0,0,this.canvas.width,this.canvas.height);this.context.fillStyle="#AAAAAA";this.container.readyForDnD()&&(this.context.font="18px sans-serif",c=this.canvas.height-22,a="Drop here or click the File menu",d=this.context.measureText(a),d=d.width,this.context.fillText(a,this.canvas.width/2-d/2,c));900<this.canvas.width&&(this.context.font="14px sans-serif",c=this.canvas.height-20,
|
|
1789
|
-
a="Supported formats: NIFTI"+(papaya.Container.DICOM_SUPPORT?", DICOM":""),this.context.fillText(a,20,c),this.context.font="14px sans-serif",c=this.canvas.height-20,a="Papaya (Build "+PAPAYA_BUILD_NUM+")",d=this.context.measureText(a),d=d.width,this.context.fillText(a,this.canvas.width-d-20,c))};
|
|
1790
|
-
papaya.viewer.Viewer.prototype.drawViewer=function(c,a){var d="Yes"===this.container.preferences.radiological,f="Yes"===this.container.preferences.showOrientation;this.initialized?(this.context.save(),a?(this.axialSlice.repaint(this.currentCoord.z,c,this.worldSpace),this.coronalSlice.repaint(this.currentCoord.y,c,this.worldSpace),this.sagittalSlice.repaint(this.currentCoord.x,c,this.worldSpace)):((c||this.draggingSliceDir!==papaya.viewer.ScreenSlice.DIRECTION_AXIAL)&&this.axialSlice.updateSlice(this.currentCoord.z,
|
|
1791
|
-
c,this.worldSpace),(c||this.draggingSliceDir!==papaya.viewer.ScreenSlice.DIRECTION_CORONAL)&&this.coronalSlice.updateSlice(this.currentCoord.y,c,this.worldSpace),(c||this.draggingSliceDir!==papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL)&&this.sagittalSlice.updateSlice(this.currentCoord.x,c,this.worldSpace)),!this.hasSurface()||papaya.utilities.PlatformUtils.smallScreen&&!c&&this.selectedSlice!==this.surfaceView||this.surfaceView.draw(),"No"===this.container.preferences.smoothDisplay?(this.context.imageSmoothingEnabled=
|
|
1792
|
-
!1,this.context.webkitImageSmoothingEnabled=!1,this.context.mozImageSmoothingEnabled=!1,this.context.msImageSmoothingEnabled=!1):(this.context.imageSmoothingEnabled=!0,this.context.webkitImageSmoothingEnabled=!0,this.context.mozImageSmoothingEnabled=!0,this.context.msImageSmoothingEnabled=!0),this.drawScreenSlice(this.mainImage),this.container.orthogonal&&(this.drawScreenSlice(this.lowerImageTop),this.drawScreenSlice(this.lowerImageBot),this.hasSurface()&&this.drawScreenSlice(this.lowerImageBot2)),
|
|
1793
|
-
(f||d)&&this.drawOrientation(),"Yes"===this.container.preferences.showCrosshairs&&this.drawCrosshairs(),"Yes"===this.container.preferences.showRuler&&this.drawRuler(),this.container.display&&this.container.display.drawDisplay(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z,this.getCurrentValueAt(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z)),this.container.contextManager&&this.container.contextManager.drawToViewer&&this.container.contextManager.drawToViewer(this.context)):
|
|
1794
|
-
this.drawEmptyViewer()};papaya.viewer.Viewer.prototype.hasSurface=function(){return this.container.hasSurface()&&this.surfaceView&&this.surfaceView.initialized};
|
|
1795
|
-
papaya.viewer.Viewer.prototype.drawScreenSlice=function(c){var a,d;c===this.surfaceView?(this.context.fillStyle=this.surfaceView.getBackgroundColor(),this.context.fillRect(c.screenOffsetX,c.screenOffsetY,c.screenDim,c.screenDim),this.context.drawImage(c.canvas,c.screenOffsetX,c.screenOffsetY),"Yes"===this.container.preferences.showRuler&&this.surfaceView===this.mainImage&&(this.context.font=papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+"px sans-serif",a=this.context.measureText("Ruler Length: ").width,
|
|
1796
|
-
d=this.context.measureText("Ruler Length: 000.00").width,d/=2,this.context.fillStyle="#ffb3db",this.context.fillText("Ruler Length: ",c.screenDim/2-d/2,papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+5),this.context.fillStyle="#FFFFFF",this.context.fillText(this.surfaceView.getRulerLength().toFixed(2),c.screenDim/2+a-d/2,papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+5))):(this.context.fillStyle=papaya.viewer.Viewer.BACKGROUND_COLOR,this.context.setTransform(1,0,0,1,0,0),this.context.fillRect(c.screenOffsetX,
|
|
1797
|
-
c.screenOffsetY,c.screenDim,c.screenDim),this.context.save(),this.context.beginPath(),this.context.rect(c.screenOffsetX,c.screenOffsetY,c.screenDim,c.screenDim),this.context.clip(),this.context.setTransform(c.finalTransform[0][0],0,0,c.finalTransform[1][1],c.finalTransform[0][2],c.finalTransform[1][2]),this.context.drawImage(c.canvasMain,0,0),this.context.restore(),c.canvasDTILines&&this.context.drawImage(c.canvasDTILines,c.screenOffsetX,c.screenOffsetY))};
|
|
1798
|
-
papaya.viewer.Viewer.prototype.drawOrientation=function(){var c,a,d,f,b,e,g,h,m,k,p,t="Yes"===this.container.preferences.showOrientation;if(this.mainImage!==this.surfaceView){this.context.setTransform(1,0,0,1,0,0);this.context.fillStyle=this.getOrientationCertaintyColor();this.context.font=papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+"px sans-serif";c=this.context.measureText("X");c=c.width;a="Yes"===this.container.preferences.radiological;this.mainImage===this.axialSlice?(d=papaya.viewer.Viewer.ORIENTATION_MARKER_ANTERIOR,
|
|
1799
|
-
f=papaya.viewer.Viewer.ORIENTATION_MARKER_POSTERIOR,a?(b=papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT,e=papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT):(b=papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT,e=papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT)):this.mainImage===this.coronalSlice?(d=papaya.viewer.Viewer.ORIENTATION_MARKER_SUPERIOR,f=papaya.viewer.Viewer.ORIENTATION_MARKER_INFERIOR,a?(b=papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT,e=papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT):(b=papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT,
|
|
1800
|
-
e=papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT)):this.mainImage===this.sagittalSlice&&(d=papaya.viewer.Viewer.ORIENTATION_MARKER_SUPERIOR,f=papaya.viewer.Viewer.ORIENTATION_MARKER_INFERIOR,b=papaya.viewer.Viewer.ORIENTATION_MARKER_ANTERIOR,e=papaya.viewer.Viewer.ORIENTATION_MARKER_POSTERIOR);a=this.mainImage.screenOffsetX;g=this.mainImage.screenOffsetX+this.mainImage.screenDim;h=Math.round(g/2);m=this.mainImage.screenOffsetY;k=this.mainImage.screenOffsetY+this.mainImage.screenDim;p=Math.round(k/
|
|
1801
|
-
2);if(t||this.mainImage.isRadiologicalSensitive())this.context.fillText(b,a+papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE,p+.5*papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE),this.context.fillText(e,g-1.5*papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE,p+.5*papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE);t&&(this.context.fillText(d,h-c/2,m+1.5*papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE),this.context.fillText(f,h-c/2,k-papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE))}};
|
|
1802
|
-
papaya.viewer.Viewer.prototype.drawRuler=function(){var c,a,d,f,b,e;this.mainImage!==this.surfaceView&&(this.mainImage===this.axialSlice?(c=this.axialSlice.finalTransform[0][2]+(this.axialSlice.rulerPoints[0].x+.5)*this.axialSlice.finalTransform[0][0],a=this.axialSlice.finalTransform[1][2]+(this.axialSlice.rulerPoints[0].y+.5)*this.axialSlice.finalTransform[1][1],d=this.axialSlice.finalTransform[0][2]+(this.axialSlice.rulerPoints[1].x+.5)*this.axialSlice.finalTransform[0][0],f=this.axialSlice.finalTransform[1][2]+
|
|
1803
|
-
(this.axialSlice.rulerPoints[1].y+.5)*this.axialSlice.finalTransform[1][1]):this.mainImage===this.coronalSlice?(c=this.coronalSlice.finalTransform[0][2]+(this.coronalSlice.rulerPoints[0].x+.5)*this.coronalSlice.finalTransform[0][0],a=this.coronalSlice.finalTransform[1][2]+(this.coronalSlice.rulerPoints[0].y+.5)*this.coronalSlice.finalTransform[1][1],d=this.coronalSlice.finalTransform[0][2]+(this.coronalSlice.rulerPoints[1].x+.5)*this.coronalSlice.finalTransform[0][0],f=this.coronalSlice.finalTransform[1][2]+
|
|
1804
|
-
(this.coronalSlice.rulerPoints[1].y+.5)*this.coronalSlice.finalTransform[1][1]):this.mainImage===this.sagittalSlice&&(c=this.sagittalSlice.finalTransform[0][2]+(this.sagittalSlice.rulerPoints[0].x+.5)*this.sagittalSlice.finalTransform[0][0],a=this.sagittalSlice.finalTransform[1][2]+(this.sagittalSlice.rulerPoints[0].y+.5)*this.sagittalSlice.finalTransform[1][1],d=this.sagittalSlice.finalTransform[0][2]+(this.sagittalSlice.rulerPoints[1].x+.5)*this.sagittalSlice.finalTransform[0][0],f=this.sagittalSlice.finalTransform[1][2]+
|
|
1805
|
-
(this.sagittalSlice.rulerPoints[1].y+.5)*this.sagittalSlice.finalTransform[1][1]),this.context.setTransform(1,0,0,1,0,0),this.context.strokeStyle="#FF1493",this.context.fillStyle="#FF1493",this.context.lineWidth=2,this.context.save(),this.context.beginPath(),this.context.moveTo(c,a),this.context.lineTo(d,f),this.context.stroke(),this.context.closePath(),this.context.beginPath(),this.context.arc(c,a,3,0,2*Math.PI,!1),this.context.arc(d,f,3,0,2*Math.PI,!1),this.context.fill(),this.context.closePath(),
|
|
1806
|
-
b=papaya.utilities.StringUtils.formatNumber(papaya.utilities.MathUtils.lineDistance(this.mainImage.rulerPoints[0].x*this.mainImage.xSize,this.mainImage.rulerPoints[0].y*this.mainImage.ySize,this.mainImage.rulerPoints[1].x*this.mainImage.xSize,this.mainImage.rulerPoints[1].y*this.mainImage.ySize),!1),e=this.context.measureText(b),e=e.width,c=parseInt((c+d)/2)-e/2,a=parseInt((a+f)/2)+7,this.context.fillStyle="#FFFFFF",papaya.viewer.Viewer.drawRoundRect(this.context,c-2,a-14-2+1,e+4,18,5,!0,!1),this.context.font=
|
|
1807
|
-
papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+"px sans-serif",this.context.strokeStyle="#FF1493",this.context.fillStyle="#FF1493",this.context.fillText(b,c,a))};
|
|
1808
|
-
papaya.viewer.Viewer.prototype.drawCrosshairs=function(){var c,a,d;this.context.setTransform(1,0,0,1,0,0);this.context.strokeStyle=papaya.viewer.Viewer.CROSSHAIRS_COLOR;this.context.lineWidth=1;if(this.mainImage!==this.axialSlice||this.toggleMainCrosshairs)this.context.save(),this.context.beginPath(),this.context.rect(this.axialSlice.screenOffsetX,this.axialSlice.screenOffsetY,this.axialSlice.screenDim,this.axialSlice.screenDim),this.context.closePath(),this.context.clip(),this.context.beginPath(),
|
|
1809
|
-
c=this.axialSlice.finalTransform[0][2]+(this.currentCoord.x+.5)*this.axialSlice.finalTransform[0][0],a=this.axialSlice.finalTransform[1][2],d=this.axialSlice.finalTransform[1][2]+this.axialSlice.yDim*this.axialSlice.finalTransform[1][1],this.context.moveTo(c,a),this.context.lineTo(c,d),c=this.axialSlice.finalTransform[1][2]+(this.currentCoord.y+.5)*this.axialSlice.finalTransform[1][1],a=this.axialSlice.finalTransform[0][2],d=this.axialSlice.finalTransform[0][2]+this.axialSlice.xDim*this.axialSlice.finalTransform[0][0],
|
|
1810
|
-
this.context.moveTo(a,c),this.context.lineTo(d,c),this.context.closePath(),this.context.stroke(),this.context.restore();if(this.mainImage!==this.coronalSlice||this.toggleMainCrosshairs)this.context.save(),this.context.beginPath(),this.context.rect(this.coronalSlice.screenOffsetX,this.coronalSlice.screenOffsetY,this.coronalSlice.screenDim,this.coronalSlice.screenDim),this.context.closePath(),this.context.clip(),this.context.beginPath(),c=this.coronalSlice.finalTransform[0][2]+(this.currentCoord.x+
|
|
1811
|
-
.5)*this.coronalSlice.finalTransform[0][0],a=this.coronalSlice.finalTransform[1][2],d=this.coronalSlice.finalTransform[1][2]+this.coronalSlice.yDim*this.coronalSlice.finalTransform[1][1],this.context.moveTo(c,a),this.context.lineTo(c,d),c=this.coronalSlice.finalTransform[1][2]+(this.currentCoord.z+.5)*this.coronalSlice.finalTransform[1][1],a=this.coronalSlice.finalTransform[0][2],d=this.coronalSlice.finalTransform[0][2]+this.coronalSlice.xDim*this.coronalSlice.finalTransform[0][0],this.context.moveTo(a,
|
|
1812
|
-
c),this.context.lineTo(d,c),this.context.closePath(),this.context.stroke(),this.context.restore();if(this.mainImage!==this.sagittalSlice||this.toggleMainCrosshairs)this.context.save(),this.context.beginPath(),this.context.rect(this.sagittalSlice.screenOffsetX,this.sagittalSlice.screenOffsetY,this.sagittalSlice.screenDim,this.sagittalSlice.screenDim),this.context.closePath(),this.context.clip(),this.context.beginPath(),c=this.sagittalSlice.finalTransform[0][2]+(this.currentCoord.y+.5)*this.sagittalSlice.finalTransform[0][0],
|
|
1813
|
-
a=this.sagittalSlice.finalTransform[1][2],d=this.sagittalSlice.finalTransform[1][2]+this.sagittalSlice.yDim*this.sagittalSlice.finalTransform[1][1],this.context.moveTo(c,a),this.context.lineTo(c,d),c=this.sagittalSlice.finalTransform[1][2]+(this.currentCoord.z+.5)*this.sagittalSlice.finalTransform[1][1],a=this.sagittalSlice.finalTransform[0][2],d=this.sagittalSlice.finalTransform[0][2]+this.sagittalSlice.xDim*this.sagittalSlice.finalTransform[0][0],this.context.moveTo(a,c),this.context.lineTo(d,c),
|
|
1814
|
-
this.context.closePath(),this.context.stroke(),this.context.restore()};
|
|
1815
|
-
papaya.viewer.Viewer.prototype.calculateScreenSliceTransforms=function(){this.container.orthogonalTall?this.container.hasSurface()?(this.viewerDim=this.canvas.height/1.333,this.getTransformParameters(this.mainImage,this.viewerDim,!1,3),this.mainImage.screenTransform[0][2]+=this.mainImage.screenOffsetX=0,this.mainImage.screenTransform[1][2]+=this.mainImage.screenOffsetY=0,this.getTransformParameters(this.lowerImageTop,this.viewerDim,!0,3),this.lowerImageTop.screenTransform[0][2]+=this.lowerImageTop.screenOffsetX=
|
|
1816
|
-
0,this.lowerImageTop.screenTransform[1][2]+=this.lowerImageTop.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageBot,this.viewerDim,!0,3),this.lowerImageBot.screenTransform[0][2]+=this.lowerImageBot.screenOffsetX=(this.viewerDim-papaya.viewer.Viewer.GAP)/3+papaya.viewer.Viewer.GAP,this.lowerImageBot.screenTransform[1][2]+=this.lowerImageBot.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageBot2,this.viewerDim,
|
|
1817
|
-
!0,3),this.lowerImageBot2.screenTransform[0][2]+=this.lowerImageBot2.screenOffsetX=2*((this.viewerDim-papaya.viewer.Viewer.GAP)/3+papaya.viewer.Viewer.GAP),this.lowerImageBot2.screenTransform[1][2]+=this.lowerImageBot2.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP):(this.viewerDim=this.canvas.height/1.5,this.getTransformParameters(this.mainImage,this.viewerDim,!1,2),this.mainImage.screenTransform[0][2]+=this.mainImage.screenOffsetX=0,this.mainImage.screenTransform[1][2]+=this.mainImage.screenOffsetY=
|
|
1818
|
-
0,this.getTransformParameters(this.lowerImageBot,this.viewerDim,!0,2),this.lowerImageBot.screenTransform[0][2]+=this.lowerImageBot.screenOffsetX=0,this.lowerImageBot.screenTransform[1][2]+=this.lowerImageBot.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageTop,this.viewerDim,!0,2),this.lowerImageTop.screenTransform[0][2]+=this.lowerImageTop.screenOffsetX=(this.viewerDim-papaya.viewer.Viewer.GAP)/2+papaya.viewer.Viewer.GAP,this.lowerImageTop.screenTransform[1][2]+=
|
|
1819
|
-
this.lowerImageTop.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP):(this.viewerDim=this.canvas.height,this.container.hasSurface()?(this.getTransformParameters(this.mainImage,this.viewerDim,!1,3),this.mainImage.screenTransform[0][2]+=this.mainImage.screenOffsetX=0,this.mainImage.screenTransform[1][2]+=this.mainImage.screenOffsetY=0,this.getTransformParameters(this.lowerImageTop,this.viewerDim,!0,3),this.lowerImageTop.screenTransform[0][2]+=this.lowerImageTop.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,
|
|
1820
|
-
this.lowerImageTop.screenTransform[1][2]+=this.lowerImageTop.screenOffsetY=0,this.getTransformParameters(this.lowerImageBot,this.viewerDim,!0,3),this.lowerImageBot.screenTransform[0][2]+=this.lowerImageBot.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,this.lowerImageBot.screenTransform[1][2]+=this.lowerImageBot.screenOffsetY=(this.viewerDim-papaya.viewer.Viewer.GAP)/3+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageBot2,this.viewerDim,!0,3),this.lowerImageBot2.screenTransform[0][2]+=
|
|
1821
|
-
this.lowerImageBot2.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,this.lowerImageBot2.screenTransform[1][2]+=this.lowerImageBot2.screenOffsetY=(this.viewerDim-papaya.viewer.Viewer.GAP)/3*2+2*papaya.viewer.Viewer.GAP):(this.getTransformParameters(this.mainImage,this.viewerDim,!1,2),this.mainImage.screenTransform[0][2]+=this.mainImage.screenOffsetX=0,this.mainImage.screenTransform[1][2]+=this.mainImage.screenOffsetY=0,this.getTransformParameters(this.lowerImageBot,this.viewerDim,!0,2),this.lowerImageBot.screenTransform[0][2]+=
|
|
1822
|
-
this.lowerImageBot.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,this.lowerImageBot.screenTransform[1][2]+=this.lowerImageBot.screenOffsetY=(this.viewerDim-papaya.viewer.Viewer.GAP)/2+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageTop,this.viewerDim,!0,2),this.lowerImageTop.screenTransform[0][2]+=this.lowerImageTop.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,this.lowerImageTop.screenTransform[1][2]+=this.lowerImageTop.screenOffsetY=0));this.updateScreenSliceTransforms()};
|
|
1823
|
-
papaya.viewer.Viewer.prototype.updateScreenSliceTransforms=function(){this.axialSlice.updateFinalTransform();this.coronalSlice.updateFinalTransform();this.sagittalSlice.updateFinalTransform()};
|
|
1824
|
-
papaya.viewer.Viewer.prototype.getTransformParameters=function(c,a,d,f){var b,e,g,h;b=d?f:1;c===this.surfaceView?this.surfaceView.resize(this.viewerDim/b):(c.getRealWidth()>c.getRealHeight()?(e=(d?a-papaya.viewer.Viewer.GAP:a)/this.longestDim/b*(c.getXSize()/this.longestDimSize),g=(d?a-papaya.viewer.Viewer.GAP:a)/this.longestDim*c.getYXratio()/b*(c.getXSize()/this.longestDimSize)):(e=(d?a-papaya.viewer.Viewer.GAP:a)/this.longestDim*c.getXYratio()/b*(c.getYSize()/this.longestDimSize),g=(d?a-papaya.viewer.Viewer.GAP:
|
|
1825
|
-
a)/this.longestDim/b*(c.getYSize()/this.longestDimSize)),h=((d?a-papaya.viewer.Viewer.GAP:a)/b-c.getXDim()*e)/2,b=((d?a-papaya.viewer.Viewer.GAP:a)/b-c.getYDim()*g)/2,c.screenDim=d?(a-papaya.viewer.Viewer.GAP)/f:a,c.screenTransform[0][0]=e,c.screenTransform[1][1]=g,c.screenTransform[0][2]=h,c.screenTransform[1][2]=b,c.screenTransform2[0][0]=e,c.screenTransform2[1][1]=g,c.screenTransform2[0][2]=h,c.screenTransform2[1][2]=b)};
|
|
1826
|
-
papaya.viewer.Viewer.prototype.setLongestDim=function(c){this.longestDim=c.getXDim();this.longestDimSize=c.getXSize();c.getYDim()*c.getYSize()>this.longestDim*this.longestDimSize&&(this.longestDim=c.getYDim(),this.longestDimSize=c.getYSize());c.getZDim()*c.getZSize()>this.longestDim*this.longestDimSize&&(this.longestDim=c.getZDim(),this.longestDimSize=c.getZSize())};
|
|
1827
|
-
papaya.viewer.Viewer.prototype.keyDownEvent=function(c){var a;this.keyPressIgnored=!1;this.container.toolbar.isShowingMenus()||(1<papayaContainers.length||papayaContainers[0].nestedViewer)&&papaya.Container.papayaLastHoveredViewer!==this||(a=papaya.viewer.Viewer.getKeyCode(c),papaya.viewer.Viewer.isControlKey(c)?this.isControlKeyDown=!0:papaya.viewer.Viewer.isAltKey(c)?this.isAltKeyDown=!0:papaya.viewer.Viewer.isShiftKey(c)?this.isShiftKeyDown=!0:a===papaya.viewer.Viewer.KEYCODE_ROTATE_VIEWS?this.rotateViews():
|
|
1828
|
-
a===papaya.viewer.Viewer.KEYCODE_CENTER?(a=new papaya.core.Coordinate(Math.floor(this.volume.header.imageDimensions.xDim/2),Math.floor(this.volume.header.imageDimensions.yDim/2),Math.floor(this.volume.header.imageDimensions.zDim/2)),this.gotoCoordinate(a)):a===papaya.viewer.Viewer.KEYCODE_ORIGIN?this.gotoCoordinate(this.volume.header.origin):a===papaya.viewer.Viewer.KEYCODE_ARROW_UP?this.incrementCoronal(!1):a===papaya.viewer.Viewer.KEYCODE_ARROW_DOWN?this.incrementCoronal(!0):a===papaya.viewer.Viewer.KEYCODE_ARROW_LEFT?
|
|
1829
|
-
this.incrementSagittal(!0):a===papaya.viewer.Viewer.KEYCODE_ARROW_RIGHT?this.incrementSagittal(!1):a===papaya.viewer.Viewer.KEYCODE_PAGE_DOWN||a===papaya.viewer.Viewer.KEYCODE_FORWARD_SLASH?this.incrementAxial(!0):a===papaya.viewer.Viewer.KEYCODE_PAGE_UP||a===papaya.viewer.Viewer.KEYCODE_SINGLE_QUOTE?this.incrementAxial(!1):a===papaya.viewer.Viewer.KEYCODE_INCREMENT_MAIN?this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.incrementAxial(!1):this.mainImage.sliceDirection===
|
|
1830
|
-
papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.incrementCoronal(!1):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&this.incrementSagittal(!0):a===papaya.viewer.Viewer.KEYCODE_DECREMENT_MAIN?this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.incrementAxial(!0):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.incrementCoronal(!0):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&
|
|
1831
|
-
this.incrementSagittal(!1):a===papaya.viewer.Viewer.KEYCODE_TOGGLE_CROSSHAIRS?"Yes"===this.container.preferences.showCrosshairs&&(this.toggleMainCrosshairs=!this.toggleMainCrosshairs,this.drawViewer(!0)):a===papaya.viewer.Viewer.KEYCODE_SERIES_FORWARD?this.incrementSeriesPoint():a===papaya.viewer.Viewer.KEYCODE_SERIES_BACK?this.decrementSeriesPoint():this.keyPressIgnored=!0,this.keyPressIgnored||(c.handled=!0,c.preventDefault()))};
|
|
1832
|
-
papaya.viewer.Viewer.prototype.keyUpEvent=function(c){1<papayaContainers.length&&papaya.Container.papayaLastHoveredViewer!==this||(this.isShiftKeyDown=this.isAltKeyDown=this.isControlKeyDown=!1,this.keyPressIgnored||(c.handled=!0,c.preventDefault()),this.hasSurface()&&papaya.utilities.PlatformUtils.smallScreen&&this.drawViewer(!0,!1))};
|
|
1833
|
-
papaya.viewer.Viewer.prototype.rotateViews=function(){var c;this.container.contextManager&&this.container.contextManager.clearContext&&this.container.contextManager.clearContext();this.hasSurface()?(c=this.lowerImageBot2,this.lowerImageBot2=this.lowerImageBot):c=this.lowerImageBot;this.lowerImageBot=this.lowerImageTop;this.lowerImageTop=this.mainImage;this.mainImage=c;this.viewsChanged()};
|
|
1834
|
-
papaya.viewer.Viewer.prototype.viewsChanged=function(){this.calculateScreenSliceTransforms();this.hasSurface()&&this.lowerImageBot2.clearDTILinesImage();this.lowerImageBot.clearDTILinesImage();this.lowerImageTop.clearDTILinesImage();this.mainImage.clearDTILinesImage();this.controlsHidden||(this.mainImage!==this.surfaceView?this.fadeInControls():($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).fadeOut(),$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).fadeOut()),
|
|
1835
|
-
$("#"+PAPAYA_DEFAULT_SLIDER_ID+this.container.containerIndex+"main").find("button").prop("disabled",this.mainImage===this.surfaceView));this.drawViewer(!0);this.updateSliceSliderControl()};papaya.viewer.Viewer.prototype.timepointChanged=function(){this.drawViewer(!0);this.updateSliceSliderControl();this.updateWindowTitle()};
|
|
1836
|
-
papaya.viewer.Viewer.prototype.resetUpdateTimer=function(c){var a=this;null!==this.updateTimer&&(window.clearTimeout(this.updateTimer),this.updateTimerEvent=this.updateTimer=null);null!==c&&(this.updateTimerEvent=c,this.updateTimer=window.setTimeout(papaya.utilities.ObjectUtils.bind(a,function(){a.updatePosition(this,papaya.utilities.PlatformUtils.getMousePositionX(a.updateTimerEvent),papaya.utilities.PlatformUtils.getMousePositionY(a.updateTimerEvent))}),papaya.viewer.Viewer.UPDATE_TIMER_INTERVAL))};
|
|
1837
|
-
papaya.viewer.Viewer.prototype.mouseDownEvent=function(c){var a=!0,d;papaya.Container.allowPropagation||c.stopPropagation();c.preventDefault();if(this.showingContextMenu)this.container.toolbar.closeAllMenus(),c.handled=!0;else if("IMG"===c.target.nodeName||"CANVAS"===c.target.nodeName)!0!==c.handled&&(this.container.toolbar.closeAllMenus(),this.previousMousePosition.x=papaya.utilities.PlatformUtils.getMousePositionX(c),this.previousMousePosition.y=papaya.utilities.PlatformUtils.getMousePositionY(c),
|
|
1838
|
-
this.findClickedSlice(this,this.previousMousePosition.x,this.previousMousePosition.y),(2===c.button||this.isControlKeyDown||this.isLongTouch)&&this.container.contextManager&&this.selectedSlice===this.mainImage&&this.mainImage===this.surfaceView?(this.contextMenuMousePositionX=this.previousMousePosition.x-this.canvasRect.left,this.contextMenuMousePositionY=this.previousMousePosition.y-this.canvasRect.top,this.container.contextManager.prefersColorPicking&&this.container.contextManager.prefersColorPicking()&&
|
|
1839
|
-
(d=this.surfaceView.pickColor(this.contextMenuMousePositionX,this.contextMenuMousePositionY),d=this.container.contextManager.getContextAtColor(d[0],d[1],d[2])),d&&(this.isContextMode=!0,d=this.container.toolbar.buildMenu(d,null,null,null,!0),papaya.ui.Toolbar.applyContextState(d),a=!1,d.showMenu(),this.showingContextMenu=!0),this.isContextMode=!0):(2===c.button||this.isControlKeyDown||this.isLongTouch)&&this.container.contextManager&&this.selectedSlice===this.mainImage?(this.isLongTouch?(d=this.convertCurrentCoordinateToScreen(this.mainImage),
|
|
1840
|
-
this.contextMenuMousePositionX=d.x,this.contextMenuMousePositionY=d.y,d=this.container.contextManager.getContextAtImagePosition(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z)):(this.contextMenuMousePositionX=this.previousMousePosition.x-this.canvasRect.left,this.contextMenuMousePositionY=this.previousMousePosition.y-this.canvasRect.top,d=this.container.contextManager.getContextAtImagePosition(this.cursorPosition.x,this.cursorPosition.y,this.cursorPosition.z)),d&&(this.isContextMode=
|
|
1841
|
-
!0,d=this.container.toolbar.buildMenu(d,null,null,null,!0),papaya.ui.Toolbar.applyContextState(d),a=!1,d.showMenu(),this.showingContextMenu=!0)):2!==c.button&&!this.isControlKeyDown||this.currentScreenVolume.rgb||this.container.kioskMode?this.isAltKeyDown&&this.selectedSlice?(this.isZoomMode=!0,this.selectedSlice===this.surfaceView?(this.isPanning=this.isShiftKeyDown,this.surfaceView.setStartDynamic(this.previousMousePosition.x,this.previousMousePosition.y)):this.isZooming()&&this.isShiftKeyDown?
|
|
1842
|
-
(this.isPanning=!0,this.setStartPanLocation(this.convertScreenToImageCoordinateX(this.previousMousePosition.x,this.selectedSlice),this.convertScreenToImageCoordinateY(this.previousMousePosition.y,this.selectedSlice),this.selectedSlice.sliceDirection)):this.setZoomLocation()):this.selectedSlice&&this.selectedSlice!==this.surfaceView?(this.grabbedHandle=this.selectedSlice.findProximalRulerHandle(this.convertScreenToImageCoordinateX(this.previousMousePosition.x-this.canvasRect.left,this.selectedSlice),
|
|
1843
|
-
this.convertScreenToImageCoordinateY(this.previousMousePosition.y-this.canvasRect.top,this.selectedSlice)),null===this.grabbedHandle&&(this.updatePosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c),!1),this.resetUpdateTimer(c))):this.selectedSlice&&this.selectedSlice===this.surfaceView&&(this.surfaceView.findProximalRulerHandle(this.previousMousePosition.x-this.canvasRect.left,this.previousMousePosition.y-this.canvasRect.top)||(this.isPanning=
|
|
1844
|
-
this.isShiftKeyDown,this.surfaceView.setStartDynamic(this.previousMousePosition.x,this.previousMousePosition.y)),this.container.display.drawEmptyDisplay()):(this.isWindowControl=!0,this.container.showImageButtons&&(this.container.showControlBar||!this.container.kioskMode)&&this.screenVolumes[this.getCurrentScreenVolIndex()].supportsDynamicColorTable()&&this.container.toolbar.showImageMenu(this.getCurrentScreenVolIndex())),this.isDragging=a,c.handled=!0),this.controlsHidden||(this.controlsHiddenPrimed=
|
|
1845
|
-
!0)};
|
|
1846
|
-
papaya.viewer.Viewer.prototype.mouseUpEvent=function(c){papaya.Container.allowPropagation||c.stopPropagation();c.preventDefault();this.showingContextMenu?(this.showingContextMenu=!1,c.handled=!0):("IMG"!==c.target.nodeName&&"CANVAS"!==c.target.nodeName||!0===c.handled||(this.isWindowControl||this.isZoomMode||this.isContextMode||null!==this.grabbedHandle||this.surfaceView&&-1!==this.surfaceView.grabbedRulerPoint||this.updatePosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c)),this.selectedSlice===
|
|
1847
|
-
this.surfaceView&&this.updateCursorPosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c)),this.zoomFactorPrevious=this.zoomFactor,this.isPanning=this.isZoomMode=this.isWindowControl=this.isDragging=!1,this.selectedSlice=null,this.controlsHiddenPrimed=!1,c.handled=!0),this.grabbedHandle=null,this.isContextMode=!1,this.updateWindowTitle(),this.updateSliceSliderControl(),this.container.toolbar.closeAllMenus(!0),this.hasSurface()&&(-1===
|
|
1848
|
-
this.surfaceView.grabbedRulerPoint?this.surfaceView.updateCurrent():this.surfaceView.grabbedRulerPoint=-1,papaya.utilities.PlatformUtils.smallScreen&&this.drawViewer(!0,!1)),this.controlsHidden&&(this.controlsHidden=!1,this.fadeInControls()))};
|
|
1849
|
-
papaya.viewer.Viewer.prototype.fadeOutControls=function(){$("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).fadeOut();$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).fadeOut();$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).fadeOut();$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex).fadeOut();$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex).fadeOut()};
|
|
1850
|
-
papaya.viewer.Viewer.prototype.fadeInControls=function(){600>this.container.getViewerDimensions()[0]?(this.mainImage!==this.surfaceView&&($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).fadeIn(),$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).fadeIn()),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).fadeIn()):(this.mainImage!==this.surfaceView&&($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).fadeIn(),
|
|
1851
|
-
$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).fadeIn()),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).fadeIn(),$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex).fadeIn(),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex).fadeIn())};
|
|
1852
|
-
papaya.viewer.Viewer.prototype.findClickedSlice=function(c,a,d){a-=this.canvasRect.left;d-=this.canvasRect.top;this.insideScreenSlice(c.axialSlice,a,d,c.volume.getXDim(),c.volume.getYDim())?this.selectedSlice=this.axialSlice:this.insideScreenSlice(c.coronalSlice,a,d,c.volume.getXDim(),c.volume.getZDim())?this.selectedSlice=this.coronalSlice:this.insideScreenSlice(c.sagittalSlice,a,d,c.volume.getYDim(),c.volume.getZDim())?this.selectedSlice=this.sagittalSlice:this.insideScreenSlice(c.surfaceView,a,
|
|
1853
|
-
d,c.volume.getYDim(),c.volume.getZDim())?this.selectedSlice=this.surfaceView:this.selectedSlice=null};
|
|
1854
|
-
papaya.viewer.Viewer.prototype.mouseMoveEvent=function(c){c.preventDefault();if(this.showingContextMenu)c.handled=!0;else{var a,d;papaya.Container.papayaLastHoveredViewer=this;a=papaya.utilities.PlatformUtils.getMousePositionX(c);d=papaya.utilities.PlatformUtils.getMousePositionY(c);this.isDragging?this.grabbedHandle?this.isInsideMainSlice(a,d)&&(this.grabbedHandle.x=this.convertScreenToImageCoordinateX(a-this.canvasRect.left,this.selectedSlice),this.grabbedHandle.y=this.convertScreenToImageCoordinateY(d-
|
|
1855
|
-
this.canvasRect.top,this.selectedSlice),this.drawViewer(!0,!0)):this.isWindowControl?(this.windowLevelChanged(this.previousMousePosition.x-a,this.previousMousePosition.y-d),this.previousMousePosition.x=a,this.previousMousePosition.y=d):this.isPanning?this.selectedSlice===this.surfaceView?(this.surfaceView.updateTranslateDynamic(papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c),this.selectedSlice===this.mainImage?1:3),this.drawViewer(!1,!0)):this.setCurrentPanLocation(this.convertScreenToImageCoordinateX(a,
|
|
1856
|
-
this.selectedSlice),this.convertScreenToImageCoordinateY(d,this.selectedSlice),this.selectedSlice.sliceDirection):this.isZoomMode?(this.selectedSlice===this.surfaceView?(c=.5*(this.previousMousePosition.y-d)*this.surfaceView.scaleFactor,this.surfaceView.zoom+=c,this.previousMousePosition.x=a,this.previousMousePosition.y=d):(c=.05*(this.previousMousePosition.y-d),this.setZoomFactor(this.zoomFactorPrevious-c),this.axialSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocY,this.panAmountX,
|
|
1857
|
-
this.panAmountY,this),this.coronalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocZ,this.panAmountX,this.panAmountZ,this),this.sagittalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocY,this.zoomLocZ,this.panAmountY,this.panAmountZ,this)),this.drawViewer(!0)):(this.resetUpdateTimer(null),null!==this.selectedSlice&&(this.selectedSlice===this.surfaceView?-1!==this.surfaceView.grabbedRulerPoint?(this.surfaceView.pickRuler(a-this.canvasRect.left,d-this.canvasRect.top),this.drawViewer(!1,
|
|
1858
|
-
!0)):(this.surfaceView.updateDynamic(papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c),this.selectedSlice===this.mainImage?1:3),this.drawViewer(!1,!0),this.container.display.drawEmptyDisplay()):this.updatePosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c)))):(this.updateCursorPosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c)),
|
|
1859
|
-
this.isZoomMode=!1);this.controlsHidden&&!this.isDragging&&(this.controlsHidden=!1,this.fadeInControls());this.controlsTimer&&(clearTimeout(this.controlsTimer),this.controlsTimer=null);this.controlsTimer=setTimeout(papaya.utilities.ObjectUtils.bind(this,function(){this.controlsHidden=!0;this.fadeOutControls()}),8E3);this.controlsHiddenPrimed&&(this.controlsHiddenPrimed=!1,this.controlsHidden=!0,this.fadeOutControls())}};
|
|
1860
|
-
papaya.viewer.Viewer.prototype.mouseDoubleClickEvent=function(){this.isAltKeyDown&&(this.zoomFactorPrevious=1,this.setZoomFactor(1))};papaya.viewer.Viewer.prototype.mouseOutEvent=function(c){papaya.Container.papayaLastHoveredViewer=null;this.isDragging?this.mouseUpEvent(c):(this.container.display&&this.container.display.drawEmptyDisplay(),this.grabbedHandle=null)};papaya.viewer.Viewer.prototype.mouseLeaveEvent=function(){};
|
|
1861
|
-
papaya.viewer.Viewer.prototype.touchMoveEvent=function(c){this.didLongTouch||(this.longTouchTimer&&(clearTimeout(this.longTouchTimer),this.longTouchTimer=null),this.isDragging||(this.mouseDownEvent(c),this.isDragging=!0),this.mouseMoveEvent(c))};papaya.viewer.Viewer.prototype.touchStartEvent=function(c){papaya.Container.allowPropagation||c.stopPropagation();c.preventDefault();this.longTouchTimer=setTimeout(papaya.utilities.ObjectUtils.bind(this,function(){this.doLongTouch(c)}),500)};
|
|
1862
|
-
papaya.viewer.Viewer.prototype.touchEndEvent=function(c){this.didLongTouch||(this.longTouchTimer&&(clearTimeout(this.longTouchTimer),this.longTouchTimer=null),this.isDragging||this.mouseDownEvent(c),this.mouseUpEvent(c));this.isLongTouch=this.didLongTouch=!1};
|
|
1863
|
-
papaya.viewer.Viewer.prototype.doLongTouch=function(c){this.longTouchTimer=null;this.isLongTouch=this.didLongTouch=!0;this.updateCursorPosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c));this.mouseDownEvent(c);this.mouseUpEvent(c)};
|
|
1864
|
-
papaya.viewer.Viewer.prototype.windowLevelChanged=function(c,a){var d,f;d=.025*(this.currentScreenVolume.screenMax-this.currentScreenVolume.screenMin);Math.abs(c)>Math.abs(a)?(f=this.currentScreenVolume.screenMin+d*papaya.utilities.MathUtils.signum(c),d=this.currentScreenVolume.screenMax+-1*d*papaya.utilities.MathUtils.signum(c),d<=f&&(d=f=this.currentScreenVolume.screenMin)):(f=this.currentScreenVolume.screenMin+d*papaya.utilities.MathUtils.signum(a),d=this.currentScreenVolume.screenMax+d*papaya.utilities.MathUtils.signum(a));
|
|
1865
|
-
this.currentScreenVolume.setScreenRange(f,d);this.container.showImageButtons&&this.container.toolbar.updateImageMenuRange(this.getCurrentScreenVolIndex(),parseFloat(f.toPrecision(7)),parseFloat(d.toPrecision(7)));this.drawViewer(!0)};
|
|
1866
|
-
papaya.viewer.Viewer.prototype.gotoCoordinate=function(c,a){if(this.initialized){var d=this.volume.header.imageDimensions.xDim,f=this.volume.header.imageDimensions.yDim,b=this.volume.header.imageDimensions.zDim;this.currentCoord.x=0>c.x?0:c.x>=d?d-1:c.x;this.currentCoord.y=0>c.y?0:c.y>=f?f-1:c.y;this.currentCoord.z=0>c.z?0:c.z>=b?b-1:c.z;this.drawViewer(!0);this.updateSliceSliderControl();a||(this.container.coordinateChanged(this),this.drawViewer(!1))}};
|
|
1867
|
-
papaya.viewer.Viewer.prototype.gotoWorldCoordinate=function(c,a){var d=new papaya.core.Coordinate;this.gotoCoordinate(this.getIndexCoordinateAtWorld(c.x,c.y,c.z,d),a)};
|
|
1868
|
-
papaya.viewer.Viewer.prototype.resizeViewer=function(c){var a=PAPAYA_PADDING/2,d;this.canvas.width=c[0];this.canvas.height=c[1];this.initialized&&(this.calculateScreenSliceTransforms(),this.canvasRect=this.canvas.getBoundingClientRect(),this.drawViewer(!0),this.container.showControls&&(c=$(this.canvas).offset(),d=$("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex),d.css({top:c.top+a,left:c.left+this.mainImage.screenDim-d.outerWidth()-a,position:"absolute"}),d=$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+
|
|
1869
|
-
this.container.containerIndex),d.css({top:c.top+d.outerHeight()+PAPAYA_PADDING,left:c.left+this.mainImage.screenDim-d.outerWidth()-a,position:"absolute"}),d=$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex),d.css({top:c.top+this.mainImage.screenDim-d.outerHeight()-a,left:c.left+this.mainImage.screenDim-d.outerWidth()-a,position:"absolute"}),d=$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex),d.css({top:c.top+this.mainImage.screenDim-d.outerHeight()-
|
|
1870
|
-
a,left:c.left+a,position:"absolute"}),d=$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex),d.css({top:c.top+this.mainImage.screenDim-d.outerHeight()-a,left:c.left+a+d.outerWidth()+PAPAYA_PADDING,position:"absolute"})))};
|
|
1871
|
-
papaya.viewer.Viewer.prototype.getWorldCoordinateAtIndex=function(c,a,d,f){f.setCoordinate((c-this.volume.header.origin.x)*this.volume.header.voxelDimensions.xSize,(this.volume.header.origin.y-a)*this.volume.header.voxelDimensions.ySize,(this.volume.header.origin.z-d)*this.volume.header.voxelDimensions.zSize);return f};
|
|
1872
|
-
papaya.viewer.Viewer.prototype.getIndexCoordinateAtWorld=function(c,a,d,f){f.setCoordinate(c/this.volume.header.voxelDimensions.xSize+this.volume.header.origin.x,-1*(a/this.volume.header.voxelDimensions.ySize-this.volume.header.origin.y),-1*(d/this.volume.header.voxelDimensions.zSize-this.volume.header.origin.z),!0);return f};
|
|
1873
|
-
papaya.viewer.Viewer.prototype.getNextColorTable=function(){var c,a=0;for(c=1;c<this.screenVolumes.length;c+=1)this.screenVolumes[c].dti||(a+=1);return papaya.viewer.ColorTable.OVERLAY_COLOR_TABLES[a%papaya.viewer.ColorTable.OVERLAY_COLOR_TABLES.length].name};
|
|
1874
|
-
papaya.viewer.Viewer.prototype.getCurrentValueAt=function(c,a,d){var f=!this.currentScreenVolume.interpolation,f=f&"Yes"===this.container.preferences.smoothDisplay;return this.worldSpace?this.currentScreenVolume.volume.getVoxelAtCoordinate((c-this.volume.header.origin.x)*this.volume.header.voxelDimensions.xSize,(this.volume.header.origin.y-a)*this.volume.header.voxelDimensions.ySize,(this.volume.header.origin.z-d)*this.volume.header.voxelDimensions.zSize,this.currentScreenVolume.currentTimepoint,
|
|
1875
|
-
!f):this.currentScreenVolume.volume.getVoxelAtMM(c*this.volume.header.voxelDimensions.xSize,a*this.volume.header.voxelDimensions.ySize,d*this.volume.header.voxelDimensions.zSize,this.currentScreenVolume.currentTimepoint,!f)};
|
|
1876
|
-
papaya.viewer.Viewer.prototype.resetViewer=function(){this.container.showControlBar?($("."+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).prop("disabled",!0)):this.container.showControls&&($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+
|
|
1877
|
-
this.container.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex).css({display:"none"}));this.initialized=!1;this.loadingVolume=null;this.volume=new papaya.volume.Volume(this.container.display,this);this.screenVolumes=[];this.surfaces=[];
|
|
1878
|
-
this.lowerImageTop=this.lowerImageBot=this.lowerImageBot2=this.mainImage=this.sagittalSlice=this.coronalSlice=this.axialSlice=this.currentScreenVolume=this.surfaceView=null;this.viewerDim=0;this.currentCoord=new papaya.core.Coordinate(0,0,0);this.draggingSliceDir=this.longestDimSize=this.longestDim=0;this.hasSeries=this.isWindowControl=this.isDragging=!1;this.previousMousePosition=new papaya.core.Point;this.canvas.removeEventListener("mousemove",this.listenerMouseMove,!1);this.canvas.removeEventListener("mousedown",
|
|
1879
|
-
this.listenerMouseDown,!1);this.canvas.removeEventListener("mouseout",this.listenerMouseOut,!1);this.canvas.removeEventListener("mouseleave",this.listenerMouseLeave,!1);this.canvas.removeEventListener("mouseup",this.listenerMouseUp,!1);document.removeEventListener("keydown",this.listenerKeyDown,!0);document.removeEventListener("keyup",this.listenerKeyUp,!0);document.removeEventListener("contextmenu",this.listenerContextMenu,!1);this.canvas.removeEventListener("touchmove",this.listenerTouchMove,!1);
|
|
1880
|
-
this.canvas.removeEventListener("touchstart",this.listenerTouchStart,!1);this.canvas.removeEventListener("touchend",this.listenerTouchEnd,!1);this.canvas.removeEventListener("dblclick",this.listenerMouseDoubleClick,!1);this.removeScroll();this.updateTimerEvent=this.updateTimer=null;this.drawEmptyViewer();this.container.display&&this.container.display.drawEmptyDisplay();this.updateSliceSliderControl();this.container.toolbar.buildToolbar()};
|
|
1881
|
-
papaya.viewer.Viewer.prototype.getHeaderDescription=function(c){return this.screenVolumes[c||0].volume.header.toString()};papaya.viewer.Viewer.prototype.getImageDimensionsDescription=function(c){var a;a=this.screenVolumes[c].volume.header.orientation.orientation;c=this.screenVolumes[c].volume.header.imageDimensions;return"("+a.charAt(0)+", "+a.charAt(1)+", "+a.charAt(2)+") "+c.cols+" x "+c.rows+" x "+c.slices};
|
|
1882
|
-
papaya.viewer.Viewer.prototype.getVoxelDimensionsDescription=function(c){var a;a=this.screenVolumes[c].volume.header.orientation.orientation;c=this.screenVolumes[c].volume.header.voxelDimensions;return"("+a.charAt(0)+", "+a.charAt(1)+", "+a.charAt(2)+") "+papaya.utilities.StringUtils.formatNumber(c.colSize,!0)+" x "+papaya.utilities.StringUtils.formatNumber(c.rowSize,!0)+" x "+papaya.utilities.StringUtils.formatNumber(c.sliceSize,!0)+" "+c.getSpatialUnitString()};
|
|
1883
|
-
papaya.viewer.Viewer.prototype.getSeriesDimensionsDescription=function(c){return this.screenVolumes[c].volume.header.imageDimensions.timepoints.toString()};papaya.viewer.Viewer.prototype.getSeriesSizeDescription=function(c){c=this.screenVolumes[c].volume.header.voxelDimensions;return c.timeSize.toString()+" "+c.getTemporalUnitString()};papaya.viewer.Viewer.prototype.getFilename=function(c){return papaya.utilities.StringUtils.wordwrap(this.screenVolumes[c].volume.fileName,25,"<br />",!0)};
|
|
1884
|
-
papaya.viewer.Viewer.prototype.getSurfaceFilename=function(c){return papaya.utilities.StringUtils.wordwrap(this.surfaces[c].filename,25,"<br />",!0)};papaya.viewer.Viewer.prototype.getSurfaceNumPoints=function(c){return this.surfaces[c].numPoints};papaya.viewer.Viewer.prototype.getSurfaceNumTriangles=function(c){return this.surfaces[c].numTriangles};
|
|
1885
|
-
papaya.viewer.Viewer.prototype.getNiceFilename=function(c){c=this.screenVolumes[c].volume.fileName.replace(".nii","").replace(".gz","");c.length>papaya.viewer.Viewer.TITLE_MAX_LENGTH&&(c=c.substr(0,papaya.viewer.Viewer.TITLE_MAX_LENGTH-3)+"...");return c};papaya.viewer.Viewer.prototype.getFileLength=function(c){return papaya.utilities.StringUtils.getSizeString(this.screenVolumes[c].volume.fileLength)};
|
|
1886
|
-
papaya.viewer.Viewer.prototype.getByteTypeDescription=function(c){return this.screenVolumes[c].volume.header.imageType.numBytes+"-Byte "+this.screenVolumes[c].volume.header.imageType.getTypeDescription()};papaya.viewer.Viewer.prototype.getByteOrderDescription=function(c){return this.screenVolumes[c].volume.header.imageType.getOrderDescription()};papaya.viewer.Viewer.prototype.getCompressedDescription=function(c){return this.screenVolumes[c].volume.header.imageType.compressed?"Yes":"No"};
|
|
1887
|
-
papaya.viewer.Viewer.prototype.getOrientationDescription=function(c){return this.screenVolumes[c].volume.header.orientation.getOrientationDescription()};papaya.viewer.Viewer.prototype.getImageDescription=function(c){return papaya.utilities.StringUtils.wordwrap(this.screenVolumes[c].volume.header.imageDescription.notes,35,"<br />",!0)};papaya.viewer.Viewer.prototype.setCurrentScreenVol=function(c){this.currentScreenVolume=this.screenVolumes[c];this.updateWindowTitle()};
|
|
1888
|
-
papaya.viewer.Viewer.prototype.updateWindowTitle=function(){var c;c=this.getNiceFilename(this.getCurrentScreenVolIndex());1<this.currentScreenVolume.volume.numTimepoints&&(c=c+" ("+(this.currentScreenVolume.currentTimepoint+1)+" of "+this.currentScreenVolume.volume.numTimepoints+")");this.isZooming()&&(c=c+" "+this.getZoomString());this.container.toolbar.updateTitleBar(c)};
|
|
1889
|
-
papaya.viewer.Viewer.prototype.getCurrentScreenVolIndex=function(){var c;for(c=0;c<this.screenVolumes.length;c+=1)if(this.screenVolumes[c]===this.currentScreenVolume)return c;return-1};papaya.viewer.Viewer.prototype.toggleWorldSpace=function(){this.worldSpace=!this.worldSpace;this.container.syncOverlaySeries&&this.reconcileOverlaySeriesPoint(this.currentScreenVolume)};papaya.viewer.Viewer.prototype.isSelected=function(c){return this.isSelectable()&&c===this.getCurrentScreenVolIndex()};
|
|
1890
|
-
papaya.viewer.Viewer.prototype.isSelectable=function(){return 1<this.screenVolumes.length};
|
|
1891
|
-
papaya.viewer.Viewer.prototype.processParams=function(c){c.worldSpace&&(this.worldSpace=!0);c.coordinate&&(this.initialCoordinate=c.coordinate);this.container.isDesktopMode()||(void 0!==c.showOrientation&&(this.container.preferences.showOrientation=c.showOrientation?"Yes":"No"),void 0!==c.smoothDisplay&&(this.container.preferences.smoothDisplay=c.smoothDisplay?"Yes":"No"),void 0!==c.radiological&&(this.container.preferences.radiological=c.radiological?"Yes":"No"),void 0!==c.showRuler&&(this.container.preferences.showRuler=
|
|
1892
|
-
c.showRuler?"Yes":"No"),void 0!==c.showSurfacePlanes&&(this.container.preferences.showSurfacePlanes=c.showSurfacePlanes?"Yes":"No"),void 0!==c.showSurfaceCrosshairs&&(this.container.preferences.showSurfaceCrosshairs=c.showSurfaceCrosshairs?"Yes":"No"))};papaya.viewer.Viewer.prototype.hasLoadedDTI=function(){return 1===this.screenVolumes.length&&this.screenVolumes[0].dti&&null===this.screenVolumes[0].dtiVolumeMod};
|
|
1893
|
-
papaya.viewer.Viewer.prototype.goToInitialCoordinate=function(){var c=new papaya.core.Coordinate;0<this.screenVolumes.length&&(null===this.initialCoordinate?c.setCoordinate(papayaFloorFast(this.volume.header.imageDimensions.xDim/2),papayaFloorFast(this.volume.header.imageDimensions.yDim/2),papayaFloorFast(this.volume.header.imageDimensions.zDim/2),!0):(this.worldSpace?this.getIndexCoordinateAtWorld(this.initialCoordinate[0],this.initialCoordinate[1],this.initialCoordinate[2],c):c.setCoordinate(this.initialCoordinate[0],
|
|
1894
|
-
this.initialCoordinate[1],this.initialCoordinate[2],!0),this.initialCoordinate=null),this.gotoCoordinate(c),this.container.display&&this.container.display.drawDisplay(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z,this.getCurrentValueAt(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z)))};
|
|
1895
|
-
papaya.viewer.Viewer.prototype.getOrientationCertaintyColor=function(){var c=this.screenVolumes[0].volume.header.orientationCertainty;return c===papaya.volume.Header.ORIENTATION_CERTAINTY_LOW?papaya.viewer.Viewer.ORIENTATION_CERTAINTY_LOW_COLOR:c===papaya.volume.Header.ORIENTATION_CERTAINTY_HIGH?papaya.viewer.Viewer.ORIENTATION_CERTAINTY_HIGH_COLOR:papaya.viewer.Viewer.ORIENTATION_CERTAINTY_UNKNOWN_COLOR};papaya.viewer.Viewer.prototype.isUsingAtlas=function(c){return c===this.atlas.currentAtlas};
|
|
1896
|
-
papaya.viewer.Viewer.prototype.scrolled=function(c){var a;this.container.nestedViewer||1<papayaContainers.length&&!this.container.collapsable||(c=c||window.event,c.preventDefault&&c.preventDefault(),c.returnValue=!1,a="Increment Slice"===this.container.preferences.scrollBehavior,c=papaya.utilities.PlatformUtils.getScrollSign(c,!a),a?0>c?(this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.incrementAxial(!1,Math.abs(c)):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?
|
|
1897
|
-
this.incrementCoronal(!1,Math.abs(c)):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&this.incrementSagittal(!1,Math.abs(c)),this.gotoCoordinate(this.currentCoord)):0<c&&(this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.incrementAxial(!0,Math.abs(c)):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.incrementCoronal(!0,Math.abs(c)):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&
|
|
1898
|
-
this.incrementSagittal(!0,Math.abs(c)),this.gotoCoordinate(this.currentCoord)):0!==c&&(this.isZoomMode=!0,this.mainImage===this.surfaceView?(this.surfaceView.zoom+=-5*c*this.surfaceView.scaleFactor,this.drawViewer(!1,!0)):(this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.setZoomLocation(this.currentCoord.x,this.currentCoord.y,this.mainImage.sliceDirection):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.setZoomLocation(this.currentCoord.x,
|
|
1899
|
-
this.currentCoord.z,this.mainImage.sliceDirection):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&this.setZoomLocation(this.currentCoord.y,this.currentCoord.z,this.mainImage.sliceDirection),this.setZoomFactor(this.zoomFactorPrevious+.1*c*this.zoomFactorPrevious)),this.zoomFactorPrevious=this.zoomFactor))};
|
|
1900
|
-
papaya.viewer.Viewer.prototype.incrementAxial=function(c,a){var d=this.volume.header.imageDimensions.zDim;void 0===a&&(a=1);c?(this.currentCoord.z+=a,this.currentCoord.z>=d&&(this.currentCoord.z=d-1)):(this.currentCoord.z-=a,0>this.currentCoord.z&&(this.currentCoord.z=0));this.gotoCoordinate(this.currentCoord)};
|
|
1901
|
-
papaya.viewer.Viewer.prototype.incrementCoronal=function(c,a){var d=this.volume.header.imageDimensions.yDim;void 0===a&&(a=1);c?(this.currentCoord.y+=a,this.currentCoord.y>=d&&(this.currentCoord.y=d-1)):(this.currentCoord.y-=a,0>this.currentCoord.y&&(this.currentCoord.y=0));this.gotoCoordinate(this.currentCoord)};
|
|
1902
|
-
papaya.viewer.Viewer.prototype.incrementSagittal=function(c,a){var d=this.volume.header.imageDimensions.xDim;void 0===a&&(a=1);c?(this.currentCoord.x-=a,0>this.currentCoord.x&&(this.currentCoord.x=0)):(this.currentCoord.x+=a,this.currentCoord.x>=d&&(this.currentCoord.x=d-1));this.gotoCoordinate(this.currentCoord)};
|
|
1903
|
-
papaya.viewer.Viewer.prototype.setZoomFactor=function(c){c>papaya.viewer.Viewer.ZOOM_FACTOR_MAX?c=papaya.viewer.Viewer.ZOOM_FACTOR_MAX:c<papaya.viewer.Viewer.ZOOM_FACTOR_MIN&&(c=papaya.viewer.Viewer.ZOOM_FACTOR_MIN);this.zoomFactor=c;1===this.zoomFactor&&(this.panAmountX=this.panAmountY=this.panAmountZ=0);this.axialSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocY,this.panAmountX,this.panAmountY,this);this.coronalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocZ,
|
|
1904
|
-
this.panAmountX,this.panAmountZ,this);this.sagittalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocY,this.zoomLocZ,this.panAmountY,this.panAmountZ,this);this.drawViewer(!1,!0);this.updateWindowTitle()};papaya.viewer.Viewer.prototype.getZoomString=function(){return parseInt(100*this.zoomFactor,10)+"%"};papaya.viewer.Viewer.prototype.isZooming=function(){return 1<this.zoomFactor};
|
|
1905
|
-
papaya.viewer.Viewer.prototype.setZoomLocation=function(){1===this.zoomFactor&&(this.zoomLocX=this.currentCoord.x,this.zoomLocY=this.currentCoord.y,this.zoomLocZ=this.currentCoord.z,this.axialSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocY,this.panAmountX,this.panAmountY,this),this.coronalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocZ,this.panAmountX,this.panAmountZ,this),this.sagittalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocY,this.zoomLocZ,
|
|
1906
|
-
this.panAmountY,this.panAmountZ,this),this.drawViewer(!1,!0))};
|
|
1907
|
-
papaya.viewer.Viewer.prototype.setStartPanLocation=function(c,a,d){1<this.zoomFactor&&(d===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(this.panLocX=c,this.panLocY=a,this.panLocZ=this.axialSlice.currentSlice):d===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(this.panLocX=c,this.panLocY=this.coronalSlice.currentSlice,this.panLocZ=a):d===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(this.panLocX=this.sagittalSlice.currentSlice,this.panLocY=c,this.panLocZ=a))};
|
|
1908
|
-
papaya.viewer.Viewer.prototype.setCurrentPanLocation=function(c,a,d){1<this.zoomFactor&&(d===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(this.panAmountX+=c-this.panLocX,this.panAmountY+=a-this.panLocY,this.panAmountZ=0):d===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(this.panAmountX+=c-this.panLocX,this.panAmountY=0,this.panAmountZ+=a-this.panLocZ):d===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(this.panAmountX=0,this.panAmountY+=c-this.panLocY,this.panAmountZ+=a-this.panLocZ),this.axialSlice.updateZoomTransform(this.zoomFactor,
|
|
1909
|
-
this.zoomLocX,this.zoomLocY,this.panAmountX,this.panAmountY,this),this.coronalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocZ,this.panAmountX,this.panAmountZ,this),this.sagittalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocY,this.zoomLocZ,this.panAmountY,this.panAmountZ,this),this.drawViewer(!1,!0))};papaya.viewer.Viewer.prototype.isWorldMode=function(){return this.worldSpace};papaya.viewer.Viewer.prototype.isRadiologicalMode=function(){return"Yes"===this.container.preferences.radiological};
|
|
1910
|
-
papaya.viewer.Viewer.prototype.isCollapsable=function(){return this.container.collapsable};
|
|
1911
|
-
papaya.viewer.Viewer.prototype.mainSliderControlChanged=function(){this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.currentCoord.z=parseInt(this.mainSliderControl.val(),10):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.currentCoord.y=parseInt(this.mainSliderControl.val(),10):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(this.currentCoord.x=parseInt(this.mainSliderControl.val(),10));this.gotoCoordinate(this.currentCoord)};
|
|
1912
|
-
papaya.viewer.Viewer.prototype.axialSliderControlChanged=function(){this.currentCoord.z=parseInt(this.axialSliderControl.val(),10);this.gotoCoordinate(this.currentCoord)};papaya.viewer.Viewer.prototype.coronalSliderControlChanged=function(){this.currentCoord.y=parseInt(this.coronalSliderControl.val(),10);this.gotoCoordinate(this.currentCoord)};papaya.viewer.Viewer.prototype.sagittalSliderControlChanged=function(){this.currentCoord.x=parseInt(this.sagittalSliderControl.val(),10);this.gotoCoordinate(this.currentCoord)};
|
|
1913
|
-
papaya.viewer.Viewer.prototype.seriesSliderControlChanged=function(){this.currentScreenVolume.setTimepoint(parseInt(this.seriesSliderControl.val(),10));this.currentScreenVolume.isOverlay()&&this.container.syncOverlaySeries&&this.reconcileOverlaySeriesPoint(this.currentScreenVolume);this.timepointChanged()};
|
|
1914
|
-
papaya.viewer.Viewer.prototype.updateSliceSliderControl=function(){this.mainSliderControl&&this.doUpdateSliceSliderControl(this.mainSliderControl,this.mainImage.sliceDirection);this.axialSliderControl&&this.doUpdateSliceSliderControl(this.axialSliderControl,papaya.viewer.ScreenSlice.DIRECTION_AXIAL);this.coronalSliderControl&&this.doUpdateSliceSliderControl(this.coronalSliderControl,papaya.viewer.ScreenSlice.DIRECTION_CORONAL);this.sagittalSliderControl&&this.doUpdateSliceSliderControl(this.sagittalSliderControl,
|
|
1915
|
-
papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL);this.seriesSliderControl&&this.doUpdateSliceSliderControl(this.seriesSliderControl,papaya.viewer.ScreenSlice.DIRECTION_TEMPORAL)};
|
|
1916
|
-
papaya.viewer.Viewer.prototype.doUpdateSliceSliderControl=function(c,a){this.initialized?(c.prop("disabled",!1),c.prop("min","0"),c.prop("step","1"),a===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(c.prop("max",(this.volume.header.imageDimensions.zDim-1).toString()),c.val(this.currentCoord.z)):a===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(c.prop("max",(this.volume.header.imageDimensions.yDim-1).toString()),c.val(this.currentCoord.y)):a===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL?(c.prop("max",
|
|
1917
|
-
(this.volume.header.imageDimensions.xDim-1).toString()),c.val(this.currentCoord.x)):a===papaya.viewer.ScreenSlice.DIRECTION_TEMPORAL&&(c.prop("max",(this.currentScreenVolume.volume.header.imageDimensions.timepoints-1).toString()),c.val(this.currentScreenVolume.currentTimepoint))):(c.prop("disabled",!0),c.prop("min","0"),c.prop("step","1"),c.prop("max","1"),c.val(0))};
|
|
1918
|
-
papaya.viewer.Viewer.prototype.incrementSeriesPoint=function(){this.currentScreenVolume.incrementTimepoint();this.currentScreenVolume.isOverlay()&&this.container.syncOverlaySeries&&this.reconcileOverlaySeriesPoint(this.currentScreenVolume);this.timepointChanged()};
|
|
1919
|
-
papaya.viewer.Viewer.prototype.decrementSeriesPoint=function(){this.currentScreenVolume.decrementTimepoint();this.currentScreenVolume.isOverlay()&&this.container.syncOverlaySeries&&this.reconcileOverlaySeriesPoint(this.currentScreenVolume);this.timepointChanged()};
|
|
1920
|
-
papaya.viewer.Viewer.prototype.reconcileOverlaySeriesPoint=function(c){var a,d;if(this.worldSpace)for(d=c.getCurrentTime(),a=1;a<this.screenVolumes.length;a+=1)this.screenVolumes[a]!==c&&this.screenVolumes[a].setCurrentTime(d);else for(d=c.currentTimepoint,a=1;a<this.screenVolumes.length;a+=1)this.screenVolumes[a]!==c&&this.screenVolumes[a].setTimepoint(d)};papaya.viewer.Viewer.prototype.hasParametricPair=function(c){return c?null!==this.screenVolumes[c].negativeScreenVol:!1};
|
|
1921
|
-
papaya.viewer.Viewer.prototype.getScreenVolumeIndex=function(c){var a;if(c)for(a=0;a<this.screenVolumes.length;a+=1)if(c===this.screenVolumes[a])return a;return-1};papaya.viewer.Viewer.prototype.getScreenVolumeByName=function(c){var a;for(a=0;a<this.screenVolumes.length;a+=1)if(c==this.screenVolumes[a].volume.fileName)return this.screenVolumes[a];return null};papaya.viewer.Viewer.prototype.isShowingRuler=function(){return"Yes"===this.container.preferences.showRuler};
|
|
1922
|
-
papaya.viewer.Viewer.prototype.isShowingOrientation=function(){return"Yes"===this.container.preferences.showOrientation};papaya.viewer.Viewer.prototype.isShowingCrosshairs=function(){return"Yes"===this.container.preferences.showCrosshairs};papaya.viewer.Viewer.prototype.isShowingSurfacePlanes=function(){return this.surfaceView&&this.surfaceView.showSurfacePlanes};papaya.viewer.Viewer.prototype.isShowingSurfaceCrosshairs=function(){return this.surfaceView&&this.surfaceView.showSurfaceCrosshairs};
|
|
1923
|
-
papaya.viewer.Viewer.prototype.restart=function(c,a,d){this.resetViewer();this.container.toolbar.updateImageButtons();this.loadImage(c,a,d)};papaya.viewer.Viewer.prototype.removeOverlay=function(c){var a;c=this.container.viewer.screenVolumes[c];a=c.negativeScreenVol;this.closeOverlayByRef(c);this.container.combineParametric&&this.closeOverlayByRef(a);this.drawViewer(!0,!1)};
|
|
1924
|
-
papaya.viewer.Viewer.prototype.toggleOverlay=function(c){var a;c=this.container.viewer.screenVolumes[c];c.hidden=!c.hidden;a=c.negativeScreenVol;this.container.combineParametric&&a&&(a.hidden=!a.hidden);this.drawViewer(!0,!1);return c.hidden};
|
|
1925
|
-
papaya.viewer.Viewer.prototype.addParametric=function(c){c=this.container.viewer.screenVolumes[c];var a;null===c.negativeScreenVol&&(this.screenVolumes[this.screenVolumes.length]=a=new papaya.viewer.ScreenVolume(c.volume,{},papaya.viewer.ColorTable.PARAMETRIC_COLOR_TABLES[1].name,!1,!0,this.currentCoord),c.negativeScreenVol=a,this.setCurrentScreenVol(this.screenVolumes.length-1),this.drawViewer(!0,!1),this.container.toolbar.buildToolbar(),this.container.toolbar.updateImageButtons())};"use strict";
|
|
1926
|
-
papaya=papaya||{};papaya.viewer=papaya.viewer||{};
|
|
1927
|
-
var shaderVert="precision mediump float;\nattribute vec3 aVertexPosition;\nattribute vec3 aVertexNormal;\nattribute vec4 aVertexColor;\nattribute vec2 aTextureCoord;\nuniform mat4 uMVMatrix;\nuniform mat4 uPMatrix;\nuniform mat3 uNMatrix;\nuniform vec3 uAmbientColor;\nuniform vec3 uPointLightingLocation;\nuniform vec3 uPointLightingColor;\nuniform bool uActivePlane;\nuniform bool uActivePlaneEdge;\nuniform bool uCrosshairs;\nuniform bool uColors;\nuniform bool uColorPicking;\nuniform bool uTrianglePicking;\nuniform bool uColorSolid;\nuniform vec4 uSolidColor;\nuniform bool uOrientationText;\nuniform bool uRuler;\nuniform float uAlpha;\nvarying vec3 vLightWeighting;\nvarying lowp vec4 vColor;\nvarying vec2 vTextureCoord;\nvoid main(void) {\n vec4 mvPosition = uMVMatrix * vec4(aVertexPosition, 1.0);\n gl_Position = uPMatrix * mvPosition;\n if (!uActivePlane && !uActivePlaneEdge && !uCrosshairs && !uOrientationText && !uRuler) {\n vec3 lightDirection = normalize(uPointLightingLocation - mvPosition.xyz);\n vec3 transformedNormal = uNMatrix * aVertexNormal;\n float directionalLightWeighting = max(dot(transformedNormal, lightDirection), 0.0);\n vLightWeighting = uAmbientColor + uPointLightingColor * directionalLightWeighting;\n if (uColors) {\n vColor = aVertexColor;\n }\n }\n if (uColorSolid) {\n vColor = uSolidColor;\n }\n if (uOrientationText) {\n vTextureCoord = aTextureCoord;\n }\n}",shaderFrag=
|
|
1928
|
-
"precision mediump float;\nuniform bool uActivePlane;\nuniform bool uActivePlaneEdge;\nuniform bool uCrosshairs;\nuniform bool uColors;\nuniform bool uColorPicking;\nuniform bool uTrianglePicking;\nuniform bool uColorSolid;\nuniform vec4 uSolidColor;\nuniform bool uOrientationText;\nuniform bool uRuler;\nuniform sampler2D uSampler;\nuniform float uAlpha;\nvarying vec3 vLightWeighting;\nvarying lowp vec4 vColor;\nvarying vec2 vTextureCoord;\nvec4 packFloatToVec4i(const float value) {\n const vec4 bitSh = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bitMsk = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(value * bitSh);\n res -= res.xxyz * bitMsk;\n return res;\n}\nvoid main(void) {\n vec4 fragmentColor = vec4(1.0, 1.0, 1.0, 1.0);\n if (uColors) {\n fragmentColor = vColor;\n } else if (uColorSolid) {\n fragmentColor = vColor;\n }\n if (uActivePlane) {\n gl_FragColor = vec4(0.10980392156863, 0.52549019607843, 0.93333333333333, 0.5);\n } else if (uActivePlaneEdge) {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n } else if (uRuler) {\n gl_FragColor = vec4(1.0, 0.078, 0.576, 1.0);\n } else if (uOrientationText) {\n vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a > 0.0) {\n gl_FragColor = vec4(textureColor.rgb, textureColor.a);\n } else {\n gl_FragColor = vec4(textureColor.rgb, 0);\n }\n } else if (uCrosshairs) {\n gl_FragColor = vec4(0.10980392156863, 0.52549019607843, 0.93333333333333, 1.0);\n } else if (uColorPicking) {\n gl_FragColor = vec4(fragmentColor.r, fragmentColor.g, fragmentColor.b, 1);\n } else if (uTrianglePicking) {\n gl_FragColor = packFloatToVec4i(gl_FragCoord.z);\n } else {\n gl_FragColor = vec4(fragmentColor.rgb * vLightWeighting, uAlpha);\n }\n}";
|
|
1929
|
-
papaya.viewer.ScreenSurface=papaya.viewer.ScreenSurface||function(c,a,d,f){this.shaderProgram=null;this.mvMatrix=mat4.create();this.pMatrix=mat4.create();this.pMatrix1=mat4.create();this.centerMat=mat4.create();this.centerMatInv=mat4.create();this.tempMat=mat4.create();this.tempMat2=mat4.create();this.pickingBuffer=null;this.initialized=!1;this.screenDim=this.screenOffsetY=this.screenOffsetX=0;this.screenTransform=[[1,0,0],[0,1,0],[0,0,1]];this.volume=c;this.surfaces=a;this.viewer=d;this.currentCoord=
|
|
1930
|
-
d.currentCoord;this.zoom=0;this.sliceDirection=papaya.viewer.ScreenSlice.DIRECTION_SURFACE;this.dynamicStartY=this.dynamicStartX=-1;this.activePlaneVertsAxial=new Float32Array(12);this.activePlaneVertsCoronal=new Float32Array(12);this.activePlaneVertsSagittal=new Float32Array(12);this.activePlaneVertsAxialEdges=new Float32Array(24);this.activePlaneVertsCoronalEdges=new Float32Array(24);this.activePlaneVertsSagittalEdges=new Float32Array(24);this.orientationVerts=new Float32Array(24);this.crosshairLineVertsX=
|
|
1931
|
-
new Float32Array(6);this.crosshairLineVertsY=new Float32Array(6);this.crosshairLineVertsZ=new Float32Array(6);this.mouseRotDragX=this.clearTransform([]);this.mouseRotDragY=this.clearTransform([]);this.mouseRotDrag=this.clearTransform([]);this.mouseTransDrag=this.clearTransform([]);this.mouseRotCurrent=this.clearTransform([]);this.mouseTransCurrent=this.clearTransform([]);this.mouseRotTemp=this.clearTransform([]);this.mouseTransTemp=this.clearTransform([]);this.crosshairLineZBuffer=this.crosshairLineZBuffer=
|
|
1932
|
-
this.crosshairLineYBuffer=this.crosshairLineXBuffer=this.orientationBuffer=this.activePlaneSagittalEdgesBuffer=this.activePlaneCoronalEdgesBuffer=this.activePlaneAxialEdgesBuffer=this.activePlaneSagittalBuffer=this.activePlaneCoronalBuffer=this.activePlaneAxialBuffer=null;this.xSize=this.volume.header.voxelDimensions.xSize;this.xDim=this.volume.header.imageDimensions.xDim;this.xHalf=this.xDim*this.xSize/2;this.ySize=this.volume.header.voxelDimensions.ySize;this.yDim=this.volume.header.imageDimensions.yDim;
|
|
1933
|
-
this.yHalf=this.yDim*this.ySize/2;this.zSize=this.volume.header.voxelDimensions.zSize;this.zDim=this.volume.header.imageDimensions.zDim;this.zHalf=this.zDim*this.zSize/2;this.showSurfacePlanes="Yes"===d.container.preferences.showSurfacePlanes;this.backgroundColor=papaya.viewer.ScreenSurface.DEFAULT_BACKGROUND;this.pickLocY=this.pickLocX=0;this.needsPickColor=!1;this.pickedColor=null;this.needsPick=!1;this.pickedCoordinate=null;this.scaleFactor=1;this.rulerPoints=this.orientationContext=this.orientationCanvas=
|
|
1934
|
-
this.orientationTextureCoordBuffer=this.orientationTextureCoords=this.orientationTexture=null;this.grabbedRulerPoint=-1;this.processParams(f)};papaya.viewer.ScreenSurface.DEFAULT_ORIENTATION=[-.015552218963737041,.09408106275544359,-.9954430697501158,0,-.9696501263313991,.24152923619118966,.03797658948646743,0,.24400145970103732,.965822108594413,.0874693978960848,0,0,0,0,1];papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY=.3;papaya.viewer.ScreenSurface.DEFAULT_BACKGROUND=[.5,.5,.5];
|
|
1935
|
-
papaya.viewer.ScreenSurface.TEXT_SIZE=50;papaya.viewer.ScreenSurface.ORIENTATION_SIZE=10;papaya.viewer.ScreenSurface.RULER_COLOR=[1,.078,.576];papaya.viewer.ScreenSurface.RULER_NUM_LINES=25;papaya.viewer.ScreenSurface.RULER_RADIUS=1;papaya.viewer.ScreenSurface.EXT_INT=null;papaya.viewer.ScreenSurface.makeShader=function(c,a,d){d=c.createShader(d);c.shaderSource(d,a);c.compileShader(d);return c.getShaderParameter(d,c.COMPILE_STATUS)?d:(console.log(c.getShaderInfoLog(d)),null)};
|
|
1936
|
-
papaya.viewer.ScreenSurface.initShaders=function(c){var a=papaya.viewer.ScreenSurface.makeShader(c,shaderVert,c.VERTEX_SHADER),d=papaya.viewer.ScreenSurface.makeShader(c,shaderFrag,c.FRAGMENT_SHADER),f=c.createProgram();c.attachShader(f,d);c.attachShader(f,a);c.linkProgram(f);c.getProgramParameter(f,c.LINK_STATUS)||console.log("Could not initialise shaders");c.useProgram(f);f.vertexPositionAttribute=c.getAttribLocation(f,"aVertexPosition");c.enableVertexAttribArray(f.vertexPositionAttribute);f.vertexNormalAttribute=
|
|
1937
|
-
c.getAttribLocation(f,"aVertexNormal");c.enableVertexAttribArray(f.vertexNormalAttribute);f.vertexColorAttribute=c.getAttribLocation(f,"aVertexColor");f.textureCoordAttribute=c.getAttribLocation(f,"aTextureCoord");f.pMatrixUniform=c.getUniformLocation(f,"uPMatrix");f.mvMatrixUniform=c.getUniformLocation(f,"uMVMatrix");f.nMatrixUniform=c.getUniformLocation(f,"uNMatrix");f.ambientColorUniform=c.getUniformLocation(f,"uAmbientColor");f.pointLightingLocationUniform=c.getUniformLocation(f,"uPointLightingLocation");
|
|
1938
|
-
f.pointLightingColorUniform=c.getUniformLocation(f,"uPointLightingColor");f.activePlane=c.getUniformLocation(f,"uActivePlane");f.activePlaneEdge=c.getUniformLocation(f,"uActivePlaneEdge");f.colorPicking=c.getUniformLocation(f,"uColorPicking");f.trianglePicking=c.getUniformLocation(f,"uTrianglePicking");f.crosshairs=c.getUniformLocation(f,"uCrosshairs");f.hasColors=c.getUniformLocation(f,"uColors");f.hasSolidColor=c.getUniformLocation(f,"uColorSolid");f.solidColor=c.getUniformLocation(f,"uSolidColor");
|
|
1939
|
-
f.orientationText=c.getUniformLocation(f,"uOrientationText");f.samplerUniform=c.getUniformLocation(f,"uSampler");f.ruler=c.getUniformLocation(f,"uRuler");f.alphaVal=c.getUniformLocation(f,"uAlpha");return f};
|
|
1940
|
-
papaya.viewer.ScreenSurface.prototype.initialize=function(){var c;this.initialized=!0;this.canvas=document.createElement("canvas");this.canvas.width=this.screenDim;this.canvas.height=this.screenDim;this.context=this.canvas.getContext("webgl")||this.canvas.getContext("experimental-webgl");this.context.viewportWidth=this.canvas.width;this.context.viewportHeight=this.canvas.height;this.zoom=this.volume.header.imageDimensions.yDim*this.volume.header.voxelDimensions.ySize*1.5;this.initPerspective();this.shaderProgram=
|
|
1941
|
-
papaya.viewer.ScreenSurface.initShaders(this.context);for(c=0;c<this.surfaces.length;c+=1)this.initBuffers(this.context,this.surfaces[c]);this.calculateScaleFactor();this.initActivePlaneBuffers(this.context);this.initRulerBuffers(this.context);mat4.multiply(this.centerMat,papaya.viewer.ScreenSurface.DEFAULT_ORIENTATION,this.tempMat);mat4.multiply(this.tempMat,this.centerMatInv,this.mouseRotCurrent);papaya.viewer.ScreenSurface.EXT_INT=this.context.getExtension("OES_element_index_uint");papaya.viewer.ScreenSurface.EXT_INT||
|
|
1942
|
-
console.log("This browser does not support OES_element_index_uint extension!");this.updateBackgroundColor()};papaya.viewer.ScreenSurface.prototype.calculateScaleFactor=function(){var c=this.ySize*this.yDim,a=this.zSize*this.zDim,d=this.xSize*this.xDim;c>d&&(d=c);a>d&&(d=a);this.scaleFactor=d/256};
|
|
1943
|
-
papaya.viewer.ScreenSurface.prototype.resize=function(c){this.initialized||this.initialize();this.screenDim=c;this.canvas.width=this.screenDim;this.canvas.height=this.screenDim;this.context.viewportWidth=this.canvas.width;this.context.viewportHeight=this.canvas.height};
|
|
1944
|
-
papaya.viewer.ScreenSurface.prototype.applyMatrixUniforms=function(c){c.uniformMatrix4fv(this.shaderProgram.pMatrixUniform,!1,this.pMatrix);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.mvMatrix);var a=mat3.create();mat4.toInverseMat3(this.mvMatrix,a);mat3.transpose(a);c.uniformMatrix3fv(this.shaderProgram.nMatrixUniform,!1,a)};papaya.viewer.ScreenSurface.prototype.draw=function(){0<this.surfaces.length&&(this.initialized||this.initialize(),this.drawScene(this.context))};
|
|
1945
|
-
papaya.viewer.ScreenSurface.prototype.initBuffers=function(c,a){a.pointsBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,a.pointsBuffer);c.bufferData(c.ARRAY_BUFFER,a.pointData,c.STATIC_DRAW);a.pointsBuffer.itemSize=3;a.pointsBuffer.numItems=a.numPoints;a.normalsBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,a.normalsBuffer);c.bufferData(c.ARRAY_BUFFER,a.normalsData,c.STATIC_DRAW);a.normalsBuffer.itemSize=3;a.normalsBuffer.numItems=a.numPoints;a.colorsData&&(a.colorsBuffer=c.createBuffer(),
|
|
1946
|
-
c.bindBuffer(c.ARRAY_BUFFER,a.colorsBuffer),c.bufferData(c.ARRAY_BUFFER,a.colorsData,c.STATIC_DRAW),a.colorsBuffer.itemSize=4,a.colorsBuffer.numItems=a.numPoints);a.trianglesBuffer=c.createBuffer();c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,a.trianglesBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,a.triangleData,c.STATIC_DRAW);a.trianglesBuffer.itemSize=1;a.trianglesBuffer.numItems=3*a.numTriangles};
|
|
1947
|
-
papaya.viewer.ScreenSurface.prototype.initOrientationBuffers=function(c){this.makeOrientedTextSquare();this.orientationBuffer=c.createBuffer();this.orientationBuffer.itemSize=3;this.orientationBuffer.numItems=4;this.orientationTextureCoordBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,this.orientationTextureCoordBuffer);this.orientationTextureCoords=[0,1,0,0,1,1,1,0];c.bufferData(c.ARRAY_BUFFER,new Float32Array(this.orientationTextureCoords),c.STATIC_DRAW);this.orientationTextureCoordBuffer.itemSize=
|
|
1948
|
-
2;this.orientationTextureCoordBuffer.numItems=4};
|
|
1949
|
-
papaya.viewer.ScreenSurface.prototype.initActivePlaneBuffers=function(c){this.updateActivePlanes();this.activePlaneAxialBuffer=c.createBuffer();this.activePlaneAxialBuffer.itemSize=3;this.activePlaneAxialBuffer.numItems=4;this.activePlaneCoronalBuffer=c.createBuffer();this.activePlaneCoronalBuffer.itemSize=3;this.activePlaneCoronalBuffer.numItems=4;this.activePlaneSagittalBuffer=c.createBuffer();this.activePlaneSagittalBuffer.itemSize=3;this.activePlaneSagittalBuffer.numItems=4;this.activePlaneAxialEdgesBuffer=
|
|
1950
|
-
c.createBuffer();this.activePlaneAxialEdgesBuffer.itemSize=3;this.activePlaneAxialEdgesBuffer.numItems=8;this.activePlaneCoronalEdgesBuffer=c.createBuffer();this.activePlaneCoronalEdgesBuffer.itemSize=3;this.activePlaneCoronalEdgesBuffer.numItems=8;this.activePlaneSagittalEdgesBuffer=c.createBuffer();this.activePlaneSagittalEdgesBuffer.itemSize=3;this.activePlaneSagittalEdgesBuffer.numItems=8;this.crosshairLineXBuffer=c.createBuffer();this.crosshairLineXBuffer.itemSize=3;this.crosshairLineXBuffer.numItems=
|
|
1951
|
-
2;this.crosshairLineYBuffer=c.createBuffer();this.crosshairLineYBuffer.itemSize=3;this.crosshairLineYBuffer.numItems=2;this.crosshairLineZBuffer=c.createBuffer();this.crosshairLineZBuffer.itemSize=3;this.crosshairLineZBuffer.numItems=2};
|
|
1952
|
-
papaya.viewer.ScreenSurface.prototype.initRulerBuffers=function(c){this.rulerPointData=this.makeSphere(papaya.viewer.ScreenSurface.RULER_NUM_LINES,papaya.viewer.ScreenSurface.RULER_NUM_LINES,papaya.viewer.ScreenSurface.RULER_RADIUS*this.scaleFactor);this.sphereVertexPositionBuffer=c.createBuffer();this.sphereVertexPositionBuffer.itemSize=3;this.sphereVertexPositionBuffer.numItems=this.rulerPointData.vertices.length/3;this.sphereNormalsPositionBuffer=c.createBuffer();this.sphereNormalsPositionBuffer.itemSize=
|
|
1953
|
-
3;this.sphereNormalsPositionBuffer.numItems=this.rulerPointData.normals.length/3;this.sphereVertexIndexBuffer=c.createBuffer();this.sphereVertexIndexBuffer.itemSize=1;this.sphereVertexIndexBuffer.numItems=this.rulerPointData.indices.length;this.rulerLineBuffer=c.createBuffer();this.rulerLineBuffer.itemSize=3;this.rulerLineBuffer.numItems=2};
|
|
1954
|
-
papaya.viewer.ScreenSurface.prototype.initPerspective=function(){mat4.perspective(45,1,10,1E5,this.pMatrix1);this.eye=new vec3.create;this.eye[0]=0;this.eye[1]=0;this.center=new vec3.create;this.centerWorld=new papaya.core.Coordinate;this.viewer.getWorldCoordinateAtIndex(parseInt(this.xDim/2,10),parseInt(this.yDim/2,10),parseInt(this.zDim/2,10),this.centerWorld);this.center[0]=this.centerWorld.x;this.center[1]=this.centerWorld.y;this.center[2]=this.centerWorld.z;mat4.identity(this.centerMat);mat4.translate(this.centerMat,
|
|
1955
|
-
[this.center[0],this.center[1],this.center[2]]);mat4.identity(this.centerMatInv);mat4.translate(this.centerMatInv,[-this.center[0],-this.center[1],-this.center[2]]);this.up=new vec3.create;this.up[0]=0;this.up[1]=1;this.up[2]=0};papaya.viewer.ScreenSurface.prototype.updatePerspective=function(){var c;this.eye[2]=this.zoom;c=mat4.lookAt(this.eye,this.center,this.up);mat4.multiply(this.pMatrix1,c,this.pMatrix)};
|
|
1956
|
-
papaya.viewer.ScreenSurface.prototype.unpackFloatFromVec4i=function(c){var a=[1/16777216,1/65536,1/256,1];return c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]*a[3]};papaya.viewer.ScreenSurface.prototype.hasTranslucentSurfaces=function(){var c;for(c=0;c<this.surfaces.length;c+=1)if(1>this.surfaces[c].alpha)return!0;return!1};
|
|
1957
|
-
papaya.viewer.ScreenSurface.prototype.drawScene=function(c){var a,d,f;d=this.hasTranslucentSurfaces();c.clearColor(this.backgroundColor[0],this.backgroundColor[1],this.backgroundColor[2],1);c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT);c.viewport(0,0,c.viewportWidth,c.viewportHeight);mat4.identity(this.mvMatrix);mat4.multiply(this.mouseRotDrag,this.mouseRotCurrent,this.mouseRotTemp);mat4.multiply(this.mouseTransDrag,this.mouseTransCurrent,this.mouseTransTemp);mat4.multiply(this.mouseTransTemp,this.mouseRotTemp,
|
|
1958
|
-
this.tempMat);mat4.set(this.tempMat,this.mvMatrix);this.updatePerspective();this.applyMatrixUniforms(c);c.uniform3f(this.shaderProgram.ambientColorUniform,.2,.2,.2);c.uniform3f(this.shaderProgram.pointLightingLocationUniform,0,0,300*this.scaleFactor);c.uniform3f(this.shaderProgram.pointLightingColorUniform,.8,.8,.8);c.uniform1i(this.shaderProgram.orientationText,0);c.uniform1i(this.shaderProgram.activePlane,0);c.uniform1i(this.shaderProgram.activePlaneEdge,0);c.uniform1i(this.shaderProgram.crosshairs,
|
|
1959
|
-
0);c.uniform1i(this.shaderProgram.hasColors,0);c.uniform1i(this.shaderProgram.colorPicking,0);c.uniform1i(this.shaderProgram.trianglePicking,0);if(this.needsPick){if(c.uniform1i(this.shaderProgram.trianglePicking,1),null===this.pickingBuffer||this.pickingBuffer.length!==c.viewportWidth*c.viewportHeight*4)this.pickingBuffer=new Uint8Array(c.viewportWidth*c.viewportHeight*4)}else this.needsPickColor&&(c.uniform1i(this.shaderProgram.colorPicking,1),null===this.pickingBuffer||this.pickingBuffer.length!==
|
|
1960
|
-
c.viewportWidth*c.viewportHeight*4)&&(this.pickingBuffer=new Uint8Array(c.viewportWidth*c.viewportHeight*4));c.enable(c.DEPTH_TEST);for(a=0;a<this.surfaces.length;a+=1)this.renderSurface(c,a,1>this.surfaces[a].alpha,!0,!1);c.uniform1i(this.shaderProgram.hasSolidColor,0);c.uniform1i(this.shaderProgram.hasColors,0);if(this.needsPick)this.needsPick=!1,this.pickedCoordinate=this.findPickedCoordinate(c,this.pickLocX,this.pickLocY),c.uniform1i(this.shaderProgram.trianglePicking,0);else if(this.needsPickColor)this.needsPickColor=
|
|
1961
|
-
!1,this.pickedColor=this.findPickedColor(c),c.uniform1i(this.shaderProgram.colorPicking,0);else{this.showSurfacePlanes&&(this.needsUpdateActivePlanes&&(this.needsUpdateActivePlanes=!1,this.bindActivePlanes(c)),c.depthMask(!1),c.uniform1i(this.shaderProgram.activePlane,1),c.enable(c.BLEND),c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneAxialBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneAxialBuffer.itemSize,c.FLOAT,
|
|
1962
|
-
!1,0,0),c.drawArrays(c.TRIANGLE_STRIP,0,4),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneCoronalBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneCoronalBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.TRIANGLE_STRIP,0,4),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneSagittalBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneSagittalBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.TRIANGLE_STRIP,0,4),c.depthMask(!0),c.disable(c.BLEND),
|
|
1963
|
-
c.uniform1i(this.shaderProgram.activePlane,0),c.uniform1i(this.shaderProgram.activePlaneEdge,1),c.lineWidth(this.isMainView()?3:2),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneAxialEdgesBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneAxialEdgesBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,8),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneCoronalEdgesBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneCoronalEdgesBuffer.itemSize,
|
|
1964
|
-
c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,8),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneSagittalEdgesBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneSagittalEdgesBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,8),c.uniform1i(this.shaderProgram.activePlaneEdge,0));this.viewer.isShowingCrosshairs()&&(this.viewer.mainImage!==this||this.viewer.toggleMainCrosshairs)&&(this.needsUpdateActivePlanes&&(this.needsUpdateActivePlanes=!1,this.bindActivePlanes(c)),
|
|
1965
|
-
c.uniform1i(this.shaderProgram.crosshairs,1),c.lineWidth(this.isMainView()?3:2),c.bindBuffer(c.ARRAY_BUFFER,this.crosshairLineXBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.crosshairLineXBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,2),c.bindBuffer(c.ARRAY_BUFFER,this.crosshairLineYBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.crosshairLineYBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,2),c.bindBuffer(c.ARRAY_BUFFER,
|
|
1966
|
-
this.crosshairLineZBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.crosshairLineZBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,2),c.uniform1i(this.shaderProgram.crosshairs,0));c.enable(c.DEPTH_TEST);for(a=0;a<this.surfaces.length;a+=1)d&&this.renderSurface(c,a,1>this.surfaces[a].alpha,!1,!0);this.viewer.mainImage===this.viewer.surfaceView&&"Yes"===this.viewer.container.preferences.showOrientation&&(a=this.currentCoord.x+(this.xDim/2-this.volume.header.origin.x),
|
|
1967
|
-
d=this.yDim-this.currentCoord.y-(this.yDim/2-this.volume.header.origin.y),f=this.zDim-this.currentCoord.z-(this.zDim/2-this.volume.header.origin.z),this.drawOrientedText(c,"S",papaya.viewer.ScreenSurface.TEXT_SIZE,[a*this.xSize-this.xHalf,d*this.ySize-this.yHalf,this.zHalf+papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor-(this.zDim/2-this.volume.header.origin.z)*this.zSize]),this.drawOrientedText(c,"I",papaya.viewer.ScreenSurface.TEXT_SIZE,[a*this.xSize-this.xHalf,d*this.ySize-this.yHalf,
|
|
1968
|
-
-this.zHalf-papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor-(this.zDim/2-this.volume.header.origin.z)*this.zSize]),this.drawOrientedText(c,"P",papaya.viewer.ScreenSurface.TEXT_SIZE,[a*this.xSize-this.xHalf,-this.yHalf-papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor-(this.yDim/2-this.volume.header.origin.y)*this.ySize,f*this.zSize-this.zHalf]),this.drawOrientedText(c,"A",papaya.viewer.ScreenSurface.TEXT_SIZE,[a*this.xSize-this.xHalf,this.yHalf+papaya.viewer.ScreenSurface.ORIENTATION_SIZE*
|
|
1969
|
-
this.scaleFactor-(this.yDim/2-this.volume.header.origin.y)*this.ySize,f*this.zSize-this.zHalf]),this.drawOrientedText(c,"L",papaya.viewer.ScreenSurface.TEXT_SIZE,[-this.xHalf-papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor+(this.xDim/2-this.volume.header.origin.x)*this.xSize,d*this.ySize-this.yHalf,f*this.zSize-this.zHalf]),this.drawOrientedText(c,"R",papaya.viewer.ScreenSurface.TEXT_SIZE,[this.xHalf+papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor+(this.xDim/2-this.volume.header.origin.x)*
|
|
1970
|
-
this.xSize,d*this.ySize-this.yHalf,f*this.zSize-this.zHalf]));"Yes"===this.viewer.container.preferences.showRuler?this.isMainView()&&this.drawRuler(c):this.rulerPoints=null}c.disable(c.DEPTH_TEST)};
|
|
1971
|
-
papaya.viewer.ScreenSurface.prototype.renderSurface=function(c,a,d,f,b){c.uniform1f(this.shaderProgram.alphaVal,this.surfaces[a].alpha);d?f?(c.enable(c.BLEND),c.enable(c.CULL_FACE),c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA),c.frontFace(c.CCW),c.cullFace(c.FRONT),c.uniform3f(this.shaderProgram.ambientColorUniform,0,0,0),c.uniform3f(this.shaderProgram.pointLightingLocationUniform,0,0,-300*this.scaleFactor)):b&&(c.enable(c.BLEND),c.enable(c.CULL_FACE),c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA),
|
|
1972
|
-
c.frontFace(c.CCW),c.cullFace(c.BACK),c.uniform3f(this.shaderProgram.ambientColorUniform,.2,.2,.2),c.uniform3f(this.shaderProgram.pointLightingLocationUniform,0,0,300*this.scaleFactor)):(c.uniform3f(this.shaderProgram.ambientColorUniform,.2,.2,.2),c.uniform3f(this.shaderProgram.pointLightingLocationUniform,0,0,300*this.scaleFactor));c.uniform1i(this.shaderProgram.hasSolidColor,0);c.uniform1i(this.shaderProgram.hasColors,0);this.surfaces[a].solidColor&&(c.uniform1i(this.shaderProgram.hasSolidColor,
|
|
1973
|
-
1),c.uniform4f(this.shaderProgram.solidColor,this.surfaces[a].solidColor[0],this.surfaces[a].solidColor[1],this.surfaces[a].solidColor[2],1));c.bindBuffer(c.ARRAY_BUFFER,this.surfaces[a].pointsBuffer);c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.surfaces[a].pointsBuffer.itemSize,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,this.surfaces[a].normalsBuffer);c.vertexAttribPointer(this.shaderProgram.vertexNormalAttribute,this.surfaces[a].normalsBuffer.itemSize,c.FLOAT,!1,0,0);this.surfaces[a].colorsData?
|
|
1974
|
-
(c.uniform1i(this.shaderProgram.hasColors,1),c.bindBuffer(c.ARRAY_BUFFER,this.surfaces[a].colorsBuffer),c.enableVertexAttribArray(this.shaderProgram.vertexColorAttribute),c.vertexAttribPointer(this.shaderProgram.vertexColorAttribute,this.surfaces[a].colorsBuffer.itemSize,c.FLOAT,!1,0,0)):c.disableVertexAttribArray(this.shaderProgram.vertexColorAttribute);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.surfaces[a].trianglesBuffer);c.drawElements(c.TRIANGLES,this.surfaces[a].trianglesBuffer.numItems,c.UNSIGNED_INT,
|
|
1975
|
-
0);d&&(f||b)&&(c.disable(c.BLEND),c.disable(c.CULL_FACE))};
|
|
1976
|
-
papaya.viewer.ScreenSurface.prototype.drawRuler=function(c){var a=!0;null===this.rulerPoints&&(this.rulerPoints=new Float32Array(6),a=this.findInitialRulerPoints(c),this.drawScene(c));a&&(c.uniform1i(this.shaderProgram.ruler,1),this.drawRulerPoint(c,this.rulerPoints[0],this.rulerPoints[1],this.rulerPoints[2]),this.drawRulerPoint(c,this.rulerPoints[3],this.rulerPoints[4],this.rulerPoints[5]),c.bindBuffer(c.ARRAY_BUFFER,this.rulerLineBuffer),c.bufferData(c.ARRAY_BUFFER,this.rulerPoints,c.DYNAMIC_DRAW),
|
|
1977
|
-
c.bindBuffer(c.ARRAY_BUFFER,this.rulerLineBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.rulerLineBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,2),c.uniform1i(this.shaderProgram.ruler,0))};
|
|
1978
|
-
papaya.viewer.ScreenSurface.prototype.drawRulerPoint=function(c,a,d,f){this.sphereVertexPositionBuffer.numItems=this.rulerPointData.vertices.length/3;c.bindBuffer(c.ARRAY_BUFFER,this.sphereVertexPositionBuffer);c.bufferData(c.ARRAY_BUFFER,new Float32Array(this.rulerPointData.vertices),c.STATIC_DRAW);this.sphereNormalsPositionBuffer.numItems=this.rulerPointData.normals.length/3;c.bindBuffer(c.ARRAY_BUFFER,this.sphereNormalsPositionBuffer);c.bufferData(c.ARRAY_BUFFER,new Float32Array(this.rulerPointData.normals),
|
|
1979
|
-
c.STATIC_DRAW);this.sphereVertexIndexBuffer.numItems=this.rulerPointData.indices.length;c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.sphereVertexIndexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.rulerPointData.indices),c.STATIC_DRAW);c.uniform1i(this.shaderProgram.hasSolidColor,1);c.uniform4f(this.shaderProgram.solidColor,papaya.viewer.ScreenSurface.RULER_COLOR[0],papaya.viewer.ScreenSurface.RULER_COLOR[1],papaya.viewer.ScreenSurface.RULER_COLOR[2],1);c.bindBuffer(c.ARRAY_BUFFER,this.sphereVertexPositionBuffer);
|
|
1980
|
-
c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.sphereVertexPositionBuffer.itemSize,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,this.sphereNormalsPositionBuffer);c.vertexAttribPointer(this.shaderProgram.vertexNormalAttribute,this.sphereNormalsPositionBuffer.itemSize,c.FLOAT,!1,0,0);mat4.set(this.mvMatrix,this.tempMat);mat4.translate(this.mvMatrix,[a,d,f]);this.applyMatrixUniforms(c);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.sphereVertexIndexBuffer);c.drawElements(c.TRIANGLES,
|
|
1981
|
-
this.sphereVertexIndexBuffer.numItems,c.UNSIGNED_SHORT,0);mat4.set(this.tempMat,this.mvMatrix);this.applyMatrixUniforms(c)};
|
|
1982
|
-
papaya.viewer.ScreenSurface.prototype.drawOrientedText=function(c,a,d,f){null===this.orientationCanvas&&this.initOrientationBuffers(this.context);this.updateOrientedTextSquare(d,a);null===this.orientationTexture&&(this.orientationTexture=c.createTexture());this.bindOrientation(c);c.enableVertexAttribArray(this.shaderProgram.textureCoordAttribute);c.uniform1i(this.shaderProgram.orientationText,1);c.enable(c.BLEND);c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA);this.orientationContext.imageSmoothingEnabled=
|
|
1983
|
-
!0;this.orientationContext.webkitImageSmoothingEnabled=!0;this.orientationContext.mozImageSmoothingEnabled=!0;this.orientationContext.msImageSmoothingEnabled=!0;this.orientationContext.textAlign="center";this.orientationContext.textBaseline="middle";this.orientationContext.font=d+"px sans-serif";this.orientationContext.clearRect(0,0,this.orientationCanvas.width,this.orientationCanvas.height);this.orientationContext.fillStyle="#FFFFFF";this.orientationContext.fillText(a,this.orientationCanvas.width/
|
|
1984
|
-
2,this.orientationCanvas.height/2);mat4.set(this.mvMatrix,this.tempMat);mat4.multiplyVec3(this.mvMatrix,f);mat4.identity(this.mvMatrix);c.bindBuffer(c.ARRAY_BUFFER,this.orientationBuffer);c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.orientationBuffer.itemSize,c.FLOAT,!1,0,0);c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,1);c.bindTexture(c.TEXTURE_2D,this.orientationTexture);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,
|
|
1985
|
-
c.CLAMP_TO_EDGE);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,this.orientationCanvas);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR_MIPMAP_NEAREST);c.generateMipmap(c.TEXTURE_2D);c.bindTexture(c.TEXTURE_2D,null);c.bindBuffer(c.ARRAY_BUFFER,this.orientationTextureCoordBuffer);c.vertexAttribPointer(this.shaderProgram.textureCoordAttribute,this.orientationTextureCoordBuffer.itemSize,c.FLOAT,!1,0,0);c.activeTexture(c.TEXTURE0);
|
|
1986
|
-
c.bindTexture(c.TEXTURE_2D,this.orientationTexture);c.uniform1i(this.shaderProgram.samplerUniform,0);mat4.translate(this.mvMatrix,f);this.applyMatrixUniforms(c);c.drawArrays(c.TRIANGLE_STRIP,0,4);mat4.set(this.tempMat,this.mvMatrix);this.applyMatrixUniforms(c);c.disable(c.BLEND);c.uniform1i(this.shaderProgram.orientationText,0);c.disableVertexAttribArray(this.shaderProgram.textureCoordAttribute)};
|
|
1987
|
-
papaya.viewer.ScreenSurface.prototype.bindOrientation=function(c){c.bindBuffer(c.ARRAY_BUFFER,this.orientationBuffer);c.bufferData(c.ARRAY_BUFFER,this.orientationVerts,c.DYNAMIC_DRAW)};
|
|
1988
|
-
papaya.viewer.ScreenSurface.prototype.bindActivePlanes=function(c){c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneAxialBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsAxial,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneCoronalBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsCoronal,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneSagittalBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsSagittal,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneAxialEdgesBuffer);
|
|
1989
|
-
c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsAxialEdges,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneCoronalEdgesBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsCoronalEdges,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneSagittalEdgesBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsSagittalEdges,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.crosshairLineXBuffer);c.bufferData(c.ARRAY_BUFFER,this.crosshairLineVertsX,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,
|
|
1990
|
-
this.crosshairLineYBuffer);c.bufferData(c.ARRAY_BUFFER,this.crosshairLineVertsY,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.crosshairLineZBuffer);c.bufferData(c.ARRAY_BUFFER,this.crosshairLineVertsZ,c.DYNAMIC_DRAW)};papaya.viewer.ScreenSurface.prototype.clearDTILinesImage=function(){};
|
|
1991
|
-
papaya.viewer.ScreenSurface.prototype.findProximalRulerHandle=function(c,a){this.pick(c,a,!0);this.grabbedRulerPoint=-1;this.pickedCoordinate&&this.rulerPoints&&(papaya.utilities.MathUtils.lineDistance3d(this.rulerPoints[0],this.rulerPoints[1],this.rulerPoints[2],this.pickedCoordinate.coordinate[0],this.pickedCoordinate.coordinate[1],this.pickedCoordinate.coordinate[2])<papaya.viewer.ScreenSlice.GRAB_RADIUS*this.scaleFactor?this.grabbedRulerPoint=0:papaya.utilities.MathUtils.lineDistance3d(this.rulerPoints[3],
|
|
1992
|
-
this.rulerPoints[4],this.rulerPoints[5],this.pickedCoordinate.coordinate[0],this.pickedCoordinate.coordinate[1],this.pickedCoordinate.coordinate[2])<papaya.viewer.ScreenSlice.GRAB_RADIUS*this.scaleFactor&&(this.grabbedRulerPoint=1));return-1!==this.grabbedRulerPoint};papaya.viewer.ScreenSurface.prototype.setStartDynamic=function(c,a){this.dynamicStartX=c;this.dynamicStartY=a};
|
|
1993
|
-
papaya.viewer.ScreenSurface.prototype.updateDynamic=function(c,a,d){a=(a-this.dynamicStartY)*papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY*d;c=(c-this.dynamicStartX)*papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY*d*Math.PI/180;mat4.identity(this.mouseRotDragX);mat4.rotateY(this.mouseRotDragX,c);c=a*Math.PI/180;mat4.identity(this.mouseRotDragY);mat4.rotateX(this.mouseRotDragY,c);mat4.multiply(this.centerMat,this.mouseRotDragY,this.tempMat);mat4.multiply(this.tempMat,this.mouseRotDragX,this.tempMat2);
|
|
1994
|
-
mat4.multiply(this.tempMat2,this.centerMatInv,this.mouseRotDrag)};papaya.viewer.ScreenSurface.prototype.updateTranslateDynamic=function(c,a,d){c=(c-this.dynamicStartX)*papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY*d;a=(a-this.dynamicStartY)*papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY*d*-1;mat4.identity(this.mouseTransDrag);mat4.translate(this.mouseTransDrag,[c,a,0])};
|
|
1995
|
-
papaya.viewer.ScreenSurface.prototype.updateCurrent=function(){var c=mat4.multiply(this.mouseRotDrag,this.mouseRotCurrent);mat4.set(c,this.mouseRotCurrent);c=mat4.multiply(this.mouseTransDrag,this.mouseTransCurrent);mat4.set(c,this.mouseTransCurrent);mat4.identity(this.mouseTransDrag);mat4.identity(this.mouseRotDragX);mat4.identity(this.mouseRotDragY);mat4.identity(this.mouseRotDrag)};papaya.viewer.ScreenSurface.prototype.clearTransform=function(c){mat4.identity(c);return c};
|
|
1996
|
-
papaya.viewer.ScreenSurface.prototype.makeOrientedTextSquare=function(){var c=papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor;this.orientationVerts[0]=-c;this.orientationVerts[1]=c;this.orientationVerts[2]=0;this.orientationVerts[3]=-c;this.orientationVerts[4]=-c;this.orientationVerts[5]=0;this.orientationVerts[6]=c;this.orientationVerts[7]=c;this.orientationVerts[8]=0;this.orientationVerts[9]=c;this.orientationVerts[10]=-c;this.orientationVerts[11]=0;this.orientationCanvas=document.createElement("canvas");
|
|
1997
|
-
this.orientationContext=this.orientationCanvas.getContext("2d");this.orientationContext.imageSmoothingEnabled=!0;this.orientationContext.webkitImageSmoothingEnabled=!0;this.orientationContext.mozImageSmoothingEnabled=!0;this.orientationContext.msImageSmoothingEnabled=!0;this.orientationContext.fillStyle="#FFFFFF";this.orientationContext.textAlign="center";this.orientationContext.textBaseline="middle"};
|
|
1998
|
-
papaya.viewer.ScreenSurface.prototype.updateOrientedTextSquare=function(c,a){var d;this.orientationContext.imageSmoothingEnabled=!0;this.orientationContext.webkitImageSmoothingEnabled=!0;this.orientationContext.mozImageSmoothingEnabled=!0;this.orientationContext.msImageSmoothingEnabled=!0;this.orientationContext.fillStyle="#FFFFFF";this.orientationContext.textAlign="center";this.orientationContext.textBaseline="middle";this.orientationContext.font=c+"px sans-serif";d=this.orientationContext.measureText(a).width;
|
|
1999
|
-
d=Math.max(d,c);this.orientationCanvas.width=papaya.utilities.MathUtils.getPowerOfTwo(d);this.orientationCanvas.height=papaya.utilities.MathUtils.getPowerOfTwo(d)};
|
|
2000
|
-
papaya.viewer.ScreenSurface.prototype.updateActivePlanes=function(){var c,a,d;if(this.showSurfacePlanes||this.viewer.isShowingCrosshairs())c=this.currentCoord.x+(this.xDim/2-this.volume.header.origin.x),a=this.yDim-this.currentCoord.y-(this.yDim/2-this.volume.header.origin.y),d=this.zDim-this.currentCoord.z-(this.zDim/2-this.volume.header.origin.z),this.activePlaneVertsAxial[0]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxial[1]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxial[2]=
|
|
2001
|
-
d*this.zSize-this.zHalf,this.activePlaneVertsAxial[3]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxial[4]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxial[5]=d*this.zSize-this.zHalf,this.activePlaneVertsAxial[6]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxial[7]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxial[8]=d*this.zSize-this.zHalf,this.activePlaneVertsAxial[9]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxial[10]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxial[11]=
|
|
2002
|
-
d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[0]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[1]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[2]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[3]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[4]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[5]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[6]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[7]=
|
|
2003
|
-
-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[8]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[9]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[10]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[11]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[12]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[13]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[14]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[15]=
|
|
2004
|
-
this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[16]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[17]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[18]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[19]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[20]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[21]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[22]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[23]=
|
|
2005
|
-
d*this.zSize-this.zHalf,this.activePlaneVertsCoronal[0]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronal[1]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronal[2]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronal[3]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronal[4]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronal[5]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronal[6]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronal[7]=a*this.ySize-this.yHalf,
|
|
2006
|
-
this.activePlaneVertsCoronal[8]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronal[9]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronal[10]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronal[11]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[0]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[1]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[2]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[3]=-this.xHalf+this.centerWorld.x,
|
|
2007
|
-
this.activePlaneVertsCoronalEdges[4]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[5]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[6]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[7]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[8]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[9]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[10]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[11]=-this.zHalf+
|
|
2008
|
-
this.centerWorld.z,this.activePlaneVertsCoronalEdges[12]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[13]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[14]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[15]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[16]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[17]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[18]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[19]=
|
|
2009
|
-
a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[20]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[21]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[22]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[23]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittal[0]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittal[1]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittal[2]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittal[3]=
|
|
2010
|
-
c*this.xSize-this.xHalf,this.activePlaneVertsSagittal[4]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittal[5]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittal[6]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittal[7]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittal[8]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittal[9]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittal[10]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittal[11]=-this.zHalf+
|
|
2011
|
-
this.centerWorld.z,this.activePlaneVertsSagittalEdges[0]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[1]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[2]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[3]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[4]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[5]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[6]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[7]=
|
|
2012
|
-
-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[8]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[9]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[10]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[11]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[12]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[13]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[14]=-this.zHalf+this.centerWorld.z,
|
|
2013
|
-
this.activePlaneVertsSagittalEdges[15]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[16]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[17]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[18]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[19]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[20]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[21]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[22]=
|
|
2014
|
-
-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[23]=this.zHalf+this.centerWorld.z,this.crosshairLineVertsZ[0]=c*this.xSize-this.xHalf,this.crosshairLineVertsZ[1]=a*this.ySize-this.yHalf,this.crosshairLineVertsZ[2]=-this.zHalf+this.centerWorld.z,this.crosshairLineVertsZ[3]=c*this.xSize-this.xHalf,this.crosshairLineVertsZ[4]=a*this.ySize-this.yHalf,this.crosshairLineVertsZ[5]=this.zHalf+this.centerWorld.z,this.crosshairLineVertsY[0]=c*this.xSize-this.xHalf,this.crosshairLineVertsY[1]=
|
|
2015
|
-
-this.yHalf+this.centerWorld.y,this.crosshairLineVertsY[2]=d*this.zSize-this.zHalf,this.crosshairLineVertsY[3]=c*this.xSize-this.xHalf,this.crosshairLineVertsY[4]=this.yHalf+this.centerWorld.y,this.crosshairLineVertsY[5]=d*this.zSize-this.zHalf,this.crosshairLineVertsX[0]=-this.xHalf+this.centerWorld.x,this.crosshairLineVertsX[1]=a*this.ySize-this.yHalf,this.crosshairLineVertsX[2]=d*this.zSize-this.zHalf,this.crosshairLineVertsX[3]=this.xHalf+this.centerWorld.x,this.crosshairLineVertsX[4]=a*this.ySize-
|
|
2016
|
-
this.yHalf,this.crosshairLineVertsX[5]=d*this.zSize-this.zHalf,this.needsUpdateActivePlanes=!0};papaya.viewer.ScreenSurface.prototype.pick=function(c,a,d){this.needsPick=!0;this.pickLocX=c;this.pickLocY=a;this.draw();if(d)return this.pickedCoordinate;this.draw();return this.pickedCoordinate};
|
|
2017
|
-
papaya.viewer.ScreenSurface.prototype.pickRuler=function(c,a){this.needsPick=!0;this.pickLocX=c;this.pickLocY=a;this.draw();this.pickedCoordinate&&(this.rulerPoints[3*this.grabbedRulerPoint]=this.pickedCoordinate.coordinate[0],this.rulerPoints[3*this.grabbedRulerPoint+1]=this.pickedCoordinate.coordinate[1],this.rulerPoints[3*this.grabbedRulerPoint+2]=this.pickedCoordinate.coordinate[2],this.draw());return this.pickedCoordinate};
|
|
2018
|
-
papaya.viewer.ScreenSurface.prototype.pickColor=function(c,a){this.needsPickColor=!0;this.pickLocX=c;this.pickLocY=a;this.draw();this.draw();return this.pickedColor};
|
|
2019
|
-
papaya.viewer.ScreenSurface.prototype.findPickedCoordinate=function(c,a,d){d=c.viewportHeight-1-d;var f,b=[];c.readPixels(a,d,1,1,c.RGBA,c.UNSIGNED_BYTE,this.pickingBuffer);f=this.unpackFloatFromVec4i(this.pickingBuffer)/255;return 1<=f?null:GLU.unProject(a,d,f,this.mvMatrix,this.pMatrix,[0,0,c.viewportWidth,c.viewportHeight],b)?{coordinate:b,depth:f}:null};
|
|
2020
|
-
papaya.viewer.ScreenSurface.prototype.findInitialRulerPoints=function(c){var a=c.viewportWidth,d=c.viewportHeight,f;c=[];var b=[],e,g;for(g=1;5>g;g+=1)f=parseInt(.1*a*g,10),e=parseInt(.1*d*g,10),(f=this.pick(f,e,!0))&&c.push(f),f=parseInt(a-.1*a*g,10),e=parseInt(.1*d*g,10),(f=this.pick(f,e,!0))&&c.push(f),f=parseInt(a-.1*a*g,10),e=parseInt(d-.1*d*g,10),(f=this.pick(f,e,!0))&&c.push(f),f=parseInt(.1*a*g,10),e=parseInt(d-.1*d*g,10),(f=this.pick(f,e,!0))&&c.push(f);if(2>c)return!1;for(g=a=0;g<c.length;g+=
|
|
2021
|
-
1)c[g].depth<c[a].depth&&(a=g);b.push(c[a].coordinate);c.splice(a,1);for(g=a=0;g<c.length;g+=1)c[g].depth<c[a].depth&&(a=g);b.push(c[a].coordinate);this.rulerPoints[0]=b[0][0];this.rulerPoints[1]=b[0][1];this.rulerPoints[2]=b[0][2];this.rulerPoints[3]=b[1][0];this.rulerPoints[4]=b[1][1];this.rulerPoints[5]=b[1][2];return!0};
|
|
2022
|
-
papaya.viewer.ScreenSurface.prototype.findPickedColor=function(c){c.readPixels(0,0,c.viewportWidth,c.viewportHeight,c.RGBA,c.UNSIGNED_BYTE,this.pickingBuffer);c=(c.viewportHeight-1-this.pickLocY)*c.viewportWidth*4+4*this.pickLocX;return[this.pickingBuffer[c],this.pickingBuffer[c+1],this.pickingBuffer[c+2]]};
|
|
2023
|
-
papaya.viewer.ScreenSurface.prototype.getBackgroundColor=function(){return"rgba("+parseInt(255*this.backgroundColor[0]+.5)+","+parseInt(255*this.backgroundColor[1]+.5)+","+parseInt(255*this.backgroundColor[2]+.5)+",255)"};papaya.viewer.ScreenSurface.prototype.updatePreferences=function(){this.updateBackgroundColor()};
|
|
2024
|
-
papaya.viewer.ScreenSurface.prototype.updateBackgroundColor=function(){var c=this.viewer.container.preferences.surfaceBackgroundColor;this.backgroundColor="Black"===c?[0,0,0]:"Dark Gray"===c?[.25,.25,.25]:"Gray"===c?[.5,.5,.5]:"Light Gray"===c?[.75,.75,.75]:"White"===c?[1,1,1]:papaya.viewer.ScreenSurface.DEFAULT_BACKGROUND};papaya.viewer.ScreenSurface.prototype.isMainView=function(){return this.viewer.mainImage===this.viewer.surfaceView};
|
|
2025
|
-
papaya.viewer.ScreenSurface.prototype.processParams=function(c){this.viewer.container.isDesktopMode()||void 0===c.surfaceBackground||(this.viewer.container.preferences.surfaceBackgroundColor=c.surfaceBackground)};
|
|
2026
|
-
papaya.viewer.ScreenSurface.prototype.makeSphere=function(c,a,d){var f,b,e=[],g=[];for(f=0;f<=c;f++){b=f*Math.PI/c;var h=Math.sin(b),m=Math.cos(b);for(b=0;b<=a;b++){var k=2*b*Math.PI/a,p=Math.sin(k),k=Math.cos(k)*h,t=m,p=p*h;g.push(k);g.push(t);g.push(p);e.push(d*k);e.push(d*t);e.push(d*p)}}d=[];for(f=0;f<c;f++)for(b=0;b<a;b++)h=f*(a+1)+b,m=h+a+1,d.push(h),d.push(m),d.push(h+1),d.push(m),d.push(m+1),d.push(h+1);return{vertices:e,normals:g,indices:d}};
|
|
2027
|
-
papaya.viewer.ScreenSurface.prototype.getRulerLength=function(){return papaya.utilities.MathUtils.lineDistance3d(this.rulerPoints[0],this.rulerPoints[1],this.rulerPoints[2],this.rulerPoints[3],this.rulerPoints[4],this.rulerPoints[5])};"use strict";var papaya=papaya||{},papayaContainers=[],papayaLoadableImages=papayaLoadableImages||[],papayaDroppedFiles=[];
|
|
2028
|
-
papaya.Container=papaya.Container||function(c){this.containerHtml=c;this.preferences=this.toolbar=this.display=this.viewer=this.sliderControlHtml=this.titlebarHtml=this.displayHtml=this.viewerHtml=this.toolbarHtml=this.containerIndex=null;this.params=[];this.loadingSurfaceIndex=this.loadingImageIndex=0;this.collapsable=this.nestedViewer=!1;this.orthogonal=!0;this.kioskMode=this.orthogonalDynamic=this.orthogonalTall=!1;this.showControls=!0;this.showControlBar=!1;this.fullScreenPadding=this.showImageButtons=
|
|
2029
|
-
!0;this.combineParametric=!1;this.dropTimeout=null;this.showRuler=!1;this.syncOverlaySeries=!0;this.surfaceParams={};this.contextManager=null;this.allowScroll=!0;this.loadingComplete=null;this.resetComponents()};papaya.Container.LICENSE_TEXT="<p>THIS PRODUCT IS NOT FOR CLINICAL USE.<br /><br />This software is available for use, as is, free of charge. The software and data derived from this software may not be used for clinical purposes.<br /><br />The authors of this software make no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, non-infringement, or conformance to a specification or standard. The authors of this software shall not be liable for any damages suffered by licensee as a result of using or modifying this software or its derivatives.<br /><br />By using this software, you agree to be bounded by the terms of this license. If you do not agree to the terms of this license, do not use this software.</p>";
|
|
2030
|
-
papaya.Container.KEYBOARD_REF_TEXT="<span style='color:#B5CBD3'>[Spacebar]</span> Cycle the main slice view in a clockwise rotation.<br /><br /><span style='color:#B5CBD3'>[Page Up]</span> or <span style='color:#B5CBD3'>[']</span> Increment the axial slice.<br /><br /><span style='color:#B5CBD3'>[Page Down]</span> or <span style='color:#B5CBD3'>[/]</span> Decrement the axial slice.<br /><br /><span style='color:#B5CBD3'>[Arrow Up]</span> and <span style='color:#B5CBD3'>[Arrow Down]</span> Increment/decrement the coronal slice.<br /><br /><span style='color:#B5CBD3'>[Arrow Right]</span> and <span style='color:#B5CBD3'>[Arrow Left]</span> Increment/decrement the sagittal slice.<br /><br /><span style='color:#B5CBD3'>[g]</span> and <span style='color:#B5CBD3'>[v]</span> Increment/decrement main slice.<br /><br /><span style='color:#B5CBD3'>[<]</span> or <span style='color:#B5CBD3'>[,]</span> Decrement the series point.<br /><br /><span style='color:#B5CBD3'>[>]</span> or <span style='color:#B5CBD3'>[.]</span> Increment the series point.<br /><br /><span style='color:#B5CBD3'>[o]</span> Navigate viewer to the image origin.<br /><br /><span style='color:#B5CBD3'>[c]</span> Navigate viewer to the center of the image.<br /><br /><span style='color:#B5CBD3'>[a]</span> Toggle main crosshairs on/off.";
|
|
2031
|
-
papaya.Container.MOUSE_REF_TEXT="<span style='color:#B5CBD3'>(Left-click and drag)</span> Change current coordinate.<br /><br /><span style='color:#B5CBD3'>[Alt](Left-click and drag)</span> Zoom in and out.<br /><br /><span style='color:#B5CBD3'>[Alt](Double left-click)</span> Reset zoom.<br /><br /><span style='color:#B5CBD3'>[Alt][Shift](Left-click and drag)</span> Pan zoomed image.<br /><br /><span style='color:#B5CBD3'>(Right-click and drag)</span> Window level controls.<br /><br /><span style='color:#B5CBD3'>(Scroll wheel)</span> See Preferences.<br /><br />";
|
|
2032
|
-
papaya.Container.DICOM_SUPPORT=!0;papaya.Container.syncViewers=!1;papaya.Container.syncViewersWorld=!1;papaya.Container.allowPropagation=!1;papaya.Container.papayaLastHoveredViewer=null;papaya.Container.restartViewer=function(c,a,d,f){papayaContainers[c].viewer.restart(a,d,f)};
|
|
2033
|
-
papaya.Container.resetViewer=function(c,a){a||(a=papayaContainers[c].params,a.loadedImages&&(a.images=a.loadedImages),a.loadedEncodedImages&&(a.encodedImages=a.loadedEncodedImages),a.loadedSurfaces&&(a.surfaces=a.loadedSurfaces),a.loadedEncodedSurfaces&&(a.encodedSurfaces=a.loadedEncodedSurfaces),a.loadedFiles&&(a.files=a.loadedFiles));papayaContainers[c].viewer.resetViewer();papayaContainers[c].toolbar.updateImageButtons();papayaContainers[c].reset();papayaContainers[c].params=a;papayaContainers[c].readGlobalParams();
|
|
2034
|
-
papayaContainers[c].rebuildContainer(a,c);papayaContainers[c].viewer.processParams(a)};papaya.Container.removeImage=function(c,a){1>a&&console.log("Cannot remove the base image. Try papaya.Container.resetViewer() instead.");papayaContainers[c].viewer.removeOverlay(a)};papaya.Container.hideImage=function(c,a){papayaContainers[c].viewer.screenVolumes[a].hidden=!0;papayaContainers[c].viewer.drawViewer(!0,!1)};
|
|
2035
|
-
papaya.Container.showImage=function(c,a){papayaContainers[c].viewer.screenVolumes[a].hidden=!1;papayaContainers[c].viewer.drawViewer(!0,!1)};papaya.Container.addImage=function(c,a,d){d&&(papayaContainers[c].params=$.extend({},papayaContainers[c].params,d));a instanceof Array?d=a:(d=[],d[0]=a);papayaContainers[c].params.images?papayaContainers[c].viewer.loadImage(d,!0,!1):papayaContainers[c].params.encodedImages&&papayaContainers[c].viewer.loadImage(d,!1,!0)};
|
|
2036
|
-
papaya.Container.findParameters=function(c){var a,d=null;a=c.data("params");a||(c=c.find("."+PAPAYA_VIEWER_CSS))&&(a=c.data("params"));a&&("object"===typeof a?d=a:window[a]&&(d=window[a]));d&&papaya.utilities.UrlUtils.getQueryParams(d);return d};
|
|
2037
|
-
papaya.Container.fillContainerHTML=function(c,a,d,f){var b;a?(d=c.find("#"+PAPAYA_DEFAULT_TOOLBAR_ID),b=c.find("#"+PAPAYA_DEFAULT_VIEWER_ID),a=c.find("#"+PAPAYA_DEFAULT_DISPLAY_ID),d?d.addClass(PAPAYA_TOOLBAR_CSS):c.prepend("<div class='"+PAPAYA_TOOLBAR_CSS+"' id='"+PAPAYA_DEFAULT_TOOLBAR_ID+"'></div>"),b?b.addClass(PAPAYA_VIEWER_CSS):$("<div class='"+PAPAYA_VIEWER_CSS+"' id='"+PAPAYA_DEFAULT_VIEWER_ID+"'></div>").insertAfter($("#"+PAPAYA_DEFAULT_TOOLBAR_ID)),a?a.addClass(PAPAYA_DISPLAY_CSS):$("<div class='"+
|
|
2038
|
-
PAPAYA_DISPLAY_CSS+"' id='"+PAPAYA_DEFAULT_DISPLAY_ID+"'></div>").insertAfter($("#"+PAPAYA_DEFAULT_VIEWER_ID)),console.log("This method of adding a Papaya container is deprecated. Try simply <div class='papaya' data-params='params'></div> instead...")):(a=void 0!==f?f:papayaContainers.length,c.attr("id",PAPAYA_DEFAULT_CONTAINER_ID+a),d&&void 0!==d.kioskMode&&d.kioskMode||c.append("<div id='"+(PAPAYA_DEFAULT_TOOLBAR_ID+a)+"' class='"+PAPAYA_TOOLBAR_CSS+"'></div>"),c.append("<div id='"+(PAPAYA_DEFAULT_VIEWER_ID+
|
|
2039
|
-
a)+"' class='"+PAPAYA_VIEWER_CSS+"'></div>"),c.append("<div id='"+(PAPAYA_DEFAULT_DISPLAY_ID+a)+"' class='"+PAPAYA_DISPLAY_CSS+"'></div>"),d&&d.showControlBar&&(void 0===d.showControls||d.showControls)?(c.append("<div id='"+PAPAYA_KIOSK_CONTROLS_CSS+a+"' class='"+PAPAYA_KIOSK_CONTROLS_CSS+"'><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"main' class='"+PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_MAIN_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Slice: </span> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+
|
|
2040
|
-
"'>+</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>-</button> </div><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"axial' class='"+PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_DIRECTION_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Axial: </span> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>+</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>-</button> </div><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"coronal' class='"+
|
|
2041
|
-
PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_DIRECTION_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Coronal: </span> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>+</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>-</button> </div><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"sagittal' class='"+PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_DIRECTION_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Sagittal: </span> <button type='button' class='"+
|
|
2042
|
-
PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>+</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>-</button> </div><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"series' class='"+PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_DIRECTION_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Series: </span> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'><</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>></button> </div> <button type='button' "+
|
|
2043
|
-
(d.kioskMode&&(void 0===d.showImageButtons||d.showImageButtons)?"":"style='float:right;margin-left:5px;' ")+"class='"+PAPAYA_CONTROL_SWAP_BUTTON_CSS+"'>Swap View</button> <button type='button' "+(d.kioskMode&&(void 0===d.showImageButtons||d.showImageButtons)?"":"style='float:right;margin-left:5px;' ")+"class='"+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS+"'>Go To Center</button> <button type='button' "+(d.kioskMode&&(void 0===d.showImageButtons||d.showImageButtons)?"":"style='float:right;margin-left:5px;' ")+
|
|
2044
|
-
"class='"+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS+"'>Go To Origin</button> </div>"),$("."+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).prop("disabled",!0)):d&&(void 0===d.showControls||d.showControls)&&(c.append("<button type='button' id='"+(PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+
|
|
2045
|
-
"'>+</button> "),c.append("<button type='button' id='"+(PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+"'>-</button> "),c.append("<button type='button' id='"+(PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+"'>Swap View</button> "),c.append("<button type='button' id='"+(PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+"'>Go To Center</button> "),c.append("<button type='button' id='"+
|
|
2046
|
-
(PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+"'>Go To Origin</button> "),$("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+a).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+a).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+a).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+a).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+a).css({display:"none"})));return b};
|
|
2047
|
-
papaya.Container.buildContainer=function(c,a,d){var f,b,e;b=null;f=papaya.utilities.PlatformUtils.checkForBrowserCompatibility();b=c.find("."+PAPAYA_VIEWER_CSS);null!==f?(papaya.Container.removeCheckForJSClasses(c,b),c.addClass(PAPAYA_UTILS_UNSUPPORTED_CSS),b.addClass(PAPAYA_UTILS_UNSUPPORTED_MESSAGE_CSS),b.html(f)):(f=void 0!==d?d:papayaContainers.length,d=new papaya.Container(c),d.containerIndex=f,d.preferences=new papaya.viewer.Preferences,papaya.Container.removeCheckForJSClasses(c,b),a&&(d.params=
|
|
2048
|
-
$.extend(d.params,a)),d.nestedViewer="BODY"!==c.parent()[0].tagName.toUpperCase(),d.readGlobalParams(),d.isDesktopMode()&&d.preferences.readPreferences(),d.buildViewer(d.params),d.buildDisplay(),d.showControlBar&&d.buildSliderControl(),d.buildToolbar(),d.setUpDnD(),(e=b.data("load-url"))?(b=e,b instanceof Array||(b=[],b[0]=e),d.viewer.loadImage(b,!0,!1)):d.params.images?(b=d.params.images[0],b instanceof Array||(b=[],b[0]=d.params.images[0]),d.viewer.loadImage(b,!0,!1)):d.params.encodedImages?(b=
|
|
2049
|
-
d.params.encodedImages[0],b instanceof Array||(b=[],b[0]=d.params.encodedImages[0]),d.viewer.loadImage(b,!1,!0)):d.params.files?(b=d.params.files[0],b instanceof Array||(b=[],b[0]=d.params.files[0]),d.viewer.loadImage(b,!1,!1)):d.viewer.finishedLoading(),d.resizeViewerComponents(!1),d.nestedViewer||(c.parent().height("100%"),c.parent().width("100%")),papayaContainers[f]=d,papaya.Container.showLicense(d,a))};
|
|
2050
|
-
papaya.Container.prototype.rebuildContainer=function(c,a){this.containerHtml.empty();papaya.Container.fillContainerHTML(this.containerHtml,!1,c,a);papaya.Container.buildContainer(this.containerHtml,c,a);1!==papayaContainers.length||papayaContainers[0].nestedViewer||($("html").addClass(PAPAYA_CONTAINER_FULLSCREEN),$("body").addClass(PAPAYA_CONTAINER_FULLSCREEN),papaya.Container.setToFullPage())};
|
|
2051
|
-
papaya.Container.buildAllContainers=function(){var c,a;c=$("#"+PAPAYA_DEFAULT_CONTAINER_ID);0<c.length?(papaya.Container.fillContainerHTML(c,!0),a=papaya.Container.findParameters(c),papaya.Container.buildContainer(c,a)):$("."+PAPAYA_CONTAINER_CLASS_NAME).each(function(){a=papaya.Container.findParameters($(this));null===a&&(a=[]);!0===a.fullScreen&&(a.fullScreenPadding=!1,a.kioskMode=!0,a.showControlBar=!1,$("body").css({"background-color":"black"}));papaya.Container.fillContainerHTML($(this),!1,a);
|
|
2052
|
-
papaya.Container.buildContainer($(this),a)});1!==papayaContainers.length||papayaContainers[0].nestedViewer||($("html").addClass(PAPAYA_CONTAINER_FULLSCREEN),$("body").addClass(PAPAYA_CONTAINER_FULLSCREEN),papaya.Container.setToFullPage(),papayaContainers[0].resizeViewerComponents(!0))};papaya.Container.startPapaya=function(){setTimeout(function(){window.scrollTo(0,0)},0);papaya.Container.DICOM_SUPPORT="undefined"!==typeof daikon;papaya.Container.buildAllContainers()};
|
|
2053
|
-
papaya.Container.resizePapaya=function(c,a){var d;papaya.Container.updateOrthogonalState();if(1!==papayaContainers.length||papayaContainers[0].nestedViewer)for(d=0;d<papayaContainers.length;d+=1)papayaContainers[d].resizeViewerComponents(!0);else papaya.utilities.PlatformUtils.smallScreen&&!a||papayaContainers[0].resizeViewerComponents(!0);setTimeout(function(){window.scrollTo(0,0)},0)};
|
|
2054
|
-
papaya.Container.addViewer=function(c,a,d){var f;f=$("#"+c);c=$('<div class="papaya"></div>');f.html(c);f[0].onclick="";f.off("click");papaya.Container.fillContainerHTML(c,!1,a);papaya.Container.buildContainer(c,a);d&&d()};papaya.Container.removeCheckForJSClasses=function(c,a){a.removeClass(PAPAYA_CONTAINER_CLASS_NAME);a.removeClass(PAPAYA_UTILS_CHECKFORJS_CSS);c.removeClass(PAPAYA_CONTAINER_CLASS_NAME);c.removeClass(PAPAYA_UTILS_CHECKFORJS_CSS)};
|
|
2055
|
-
papaya.Container.setToFullPage=function(){document.body.style.marginTop=0;document.body.style.marginBottom=0;document.body.style.marginLeft="auto";document.body.style.marginRight="auto";document.body.style.padding=0;document.body.style.overflow="hidden";document.body.style.width="100%";document.body.style.height="100%"};papaya.Container.getLicense=function(){return papaya.Container.LICENSE_TEXT};papaya.Container.getKeyboardReference=function(){return papaya.Container.KEYBOARD_REF_TEXT};
|
|
2056
|
-
papaya.Container.getMouseReference=function(){return papaya.Container.MOUSE_REF_TEXT};papaya.Container.setLicenseRead=function(){papaya.utilities.UrlUtils.createCookie(papaya.viewer.Preferences.COOKIE_PREFIX+"eula","Yes",papaya.viewer.Preferences.COOKIE_EXPIRY_DAYS)};papaya.Container.isLicenseRead=function(){var c=papaya.utilities.UrlUtils.readCookie(papaya.viewer.Preferences.COOKIE_PREFIX+"eula");return c&&"Yes"===c};
|
|
2057
|
-
papaya.Container.showLicense=function(c,a){a&&void 0!==a.showEULA&&a.showEULA&&!papaya.Container.isLicenseRead()&&(new papaya.ui.Dialog(c,"License",papaya.ui.Toolbar.LICENSE_DATA,papaya.Container,null,papaya.Container.setLicenseRead,null,!0)).showDialog()};
|
|
2058
|
-
papaya.Container.updateOrthogonalState=function(){var c;for(c=0;c<papayaContainers.length;c+=1)papayaContainers[c].orthogonal&&(papaya.utilities.PlatformUtils.mobile||papayaContainers[c].orthogonalDynamic)&&($(window).height()>$(window).width()?papayaContainers[c].orthogonalTall=!0:papayaContainers[c].orthogonalTall=!1)};
|
|
2059
|
-
papaya.Container.reorientPapaya=function(){var c;for(c=0;c<papayaContainers.length;c+=1)papayaContainers[c].toolbar.closeAllMenus();papaya.Container.updateOrthogonalState();papaya.Container.resizePapaya(null,!0)};papaya.Container.prototype.resetComponents=function(){this.containerHtml.css({height:"auto"});this.containerHtml.css({width:"auto"});this.containerHtml.css({margin:"auto"});$("head").append("<style>div#papayaViewer:before{ content:'' }</style>")};
|
|
2060
|
-
papaya.Container.prototype.hasSurface=function(){return this.viewer&&0<this.viewer.surfaces.length};
|
|
2061
|
-
papaya.Container.prototype.getViewerDimensions=function(){var c,a,d,f;c=this.containerHtml.parent().width()-(this.fullScreenPadding?2*PAPAYA_PADDING:0);d=this.orthogonal?this.hasSurface()?1.333:1.5:1;this.orthogonalTall||!this.orthogonal?(c=(this.collapsable?window.innerHeight:this.containerHtml.parent().height())-(papaya.viewer.Display.SIZE+(this.kioskMode?0:papaya.ui.Toolbar.SIZE+PAPAYA_SPACING)+PAPAYA_SPACING+(this.fullScreenPadding&&!this.nestedViewer?2*PAPAYA_CONTAINER_PADDING_TOP:0))-(this.showControlBar?
|
|
2062
|
-
2*papaya.ui.Toolbar.SIZE:0),a=papayaRoundFast(c/d)):(a=c,c=papayaRoundFast(a/d));if(!this.nestedViewer||this.collapsable)this.orthogonalTall?(f=window.innerWidth-(this.fullScreenPadding?2*PAPAYA_PADDING:0),a>f&&(a=f,c=papayaRoundFast(a*d))):(f=window.innerHeight-(papaya.viewer.Display.SIZE+(this.kioskMode?0:papaya.ui.Toolbar.SIZE+PAPAYA_SPACING)+PAPAYA_SPACING+(this.fullScreenPadding?2*PAPAYA_CONTAINER_PADDING_TOP:0))-(this.showControlBar?2*papaya.ui.Toolbar.SIZE:0),c>f&&(c=f,a=papayaRoundFast(c*
|
|
2063
|
-
d)));return[a,c]};papaya.Container.prototype.getViewerPadding=function(){var c,a;c=this.containerHtml.parent().width()-(this.fullScreenPadding?2*PAPAYA_PADDING:0);a=this.getViewerDimensions();return(c-a[0])/2};
|
|
2064
|
-
papaya.Container.prototype.readGlobalParams=function(){this.kioskMode=!0===this.params.kioskMode||papaya.utilities.PlatformUtils.smallScreen;this.combineParametric=!0===this.params.combineParametric;this.params.loadingComplete&&(this.loadingComplete=this.params.loadingComplete);void 0!==this.params.showControls&&(this.showControls=this.params.showControls);void 0!==this.params.showImageButtons&&(this.showImageButtons=this.params.showImageButtons);papaya.utilities.PlatformUtils.smallScreen&&(this.showImageButtons=
|
|
2065
|
-
!1);void 0!==this.params.fullScreenPadding&&(this.fullScreenPadding=this.params.fullScreenPadding);void 0!==this.params.orthogonal&&(this.orthogonal=this.params.orthogonal);this.surfaceParams.showSurfacePlanes=!0===this.params.showSurfacePlanes;this.surfaceParams.showSurfaceCrosshairs=!0===this.params.showSurfaceCrosshairs;this.surfaceParams.surfaceBackground=this.params.surfaceBackground;this.orthogonalTall=this.orthogonal&&!0===this.params.orthogonalTall;this.orthogonalDynamic=this.orthogonal&&
|
|
2066
|
-
!0===this.params.orthogonalDynamic;void 0!==this.params.allowScroll&&(this.allowScroll=this.params.allowScroll);(papaya.utilities.PlatformUtils.mobile||this.orthogonalDynamic)&&this.orthogonal&&($(window).height()>$(window).width()?this.orthogonalTall=!0:this.orthogonalTall=!1);void 0!==this.params.syncOverlaySeries&&(this.syncOverlaySeries=this.params.syncOverlaySeries);void 0!==this.params.showControlBar&&(this.showControlBar=this.showControls&&this.params.showControlBar);void 0!==this.params.contextManager&&
|
|
2067
|
-
(this.contextManager=this.params.contextManager);!0===this.params.fullScreen&&(this.fullScreenPadding=this.params.fullScreenPadding=!1,this.kioskMode=this.params.kioskMode=!0,this.showControlBar=this.params.showControlBar=!1,$("body").css("background-color:'black'"))};
|
|
2068
|
-
papaya.Container.prototype.reset=function(){this.loadingSurfaceIndex=this.loadingImageIndex=0;this.collapsable=this.nestedViewer=!1;this.orthogonal=!0;this.kioskMode=this.orthogonalDynamic=this.orthogonalTall=!1;this.showControls=!0;this.showControlBar=!1;this.fullScreenPadding=!0;this.showRuler=this.combineParametric=!1};
|
|
2069
|
-
papaya.Container.prototype.resizeViewerComponents=function(c){var a,d,f=0;this.toolbar.closeAllMenus();a=this.getViewerDimensions();d=this.getViewerPadding();this.toolbarHtml.css({width:a[0]+"px"});this.toolbarHtml.css({height:papaya.ui.Toolbar.SIZE+"px"});this.toolbarHtml.css({paddingLeft:d+"px"});this.toolbarHtml.css({paddingBottom:PAPAYA_SPACING+"px"});this.viewerHtml.css({width:a[0]+"px"});this.viewerHtml.css({height:a[1]+"px"});this.viewerHtml.css({paddingLeft:d+"px"});c&&this.viewer.resizeViewer(a);
|
|
2070
|
-
this.displayHtml.css({height:papaya.viewer.Display.SIZE+"px"});this.displayHtml.css({paddingLeft:d+"px"});this.displayHtml.css({paddingTop:PAPAYA_SPACING+"px"});this.display.canvas.width=a[0];this.showControls&&this.showControlBar?(this.sliderControlHtml.css({width:a[0]+"px"}),this.sliderControlHtml.css({height:papaya.viewer.Display.SIZE+"px"}),f=this.kioskMode?f+0:f+-50,f=this.viewer.hasSeries?f+200:f+0,a[0]<775+f?($("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).css({display:"none"}),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).css({display:"none"})):
|
|
2071
|
-
($("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).css({display:"inline"}),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).css({display:"inline"})),a[0]<600+f?($("."+PAPAYA_CONTROL_DIRECTION_SLIDER).css({display:"none"}),$("."+PAPAYA_CONTROL_MAIN_SLIDER).css({display:"inline"})):($("."+PAPAYA_CONTROL_DIRECTION_SLIDER).css({display:"inline"}),$("."+PAPAYA_CONTROL_MAIN_SLIDER).css({display:"none"})),this.viewer.hasSeries&&a[0]<450+f&&$("."+PAPAYA_CONTROL_MAIN_SLIDER).css({display:"none"}),200>a[0]?$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).css({display:"none"}):
|
|
2072
|
-
$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).css({display:"inline"}),this.viewer.hasSeries?$("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(3).css({display:"inline"}):$("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(3).css({display:"none"})):this.showControls&&this.viewer.initialized&&(600>a[0]?($("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.containerIndex).css({display:"none"})):this.viewer.controlsHidden||($("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+
|
|
2073
|
-
this.containerIndex).css({display:"inline"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.containerIndex).css({display:"inline"})));this.isDesktopMode()&&(600>a[0]?this.titlebarHtml.css({visibility:"hidden"}):this.titlebarHtml.css({visibility:"visible"}));this.nestedViewer&&!this.collapsable||!this.fullScreenPadding?this.containerHtml.css({paddingTop:"0"}):this.containerHtml.css({paddingTop:PAPAYA_CONTAINER_PADDING_TOP+"px"});this.fullScreenPadding&&(this.containerHtml.css({paddingLeft:PAPAYA_PADDING+
|
|
2074
|
-
"px"}),this.containerHtml.css({paddingRight:PAPAYA_PADDING+"px"}));this.viewer.initialized?this.viewer.drawViewer(!1,!0):(this.viewer.drawEmptyViewer(),this.display.drawEmptyDisplay());this.titlebarHtml.css({width:a[0]+"px",top:this.viewerHtml.position().top-1.25*papaya.ui.Toolbar.SIZE})};papaya.Container.prototype.updateViewerSize=function(){this.toolbar.closeAllMenus();this.viewer.resizeViewer(this.getViewerDimensions());this.viewer.updateOffsetRect()};
|
|
2075
|
-
papaya.Container.prototype.buildViewer=function(c){var a;this.viewerHtml=this.containerHtml.find("."+PAPAYA_VIEWER_CSS);papaya.Container.removeCheckForJSClasses(this.containerHtml,this.viewerHtml);this.viewerHtml.html("");a=this.getViewerDimensions();this.viewer=new papaya.viewer.Viewer(this,a[0],a[1],c);this.viewerHtml.append($(this.viewer.canvas));this.preferences.viewer=this.viewer};
|
|
2076
|
-
papaya.Container.prototype.buildDisplay=function(){var c;this.displayHtml=this.containerHtml.find("."+PAPAYA_DISPLAY_CSS);c=this.getViewerDimensions();this.display=new papaya.viewer.Display(this,c[0]);this.displayHtml.append($(this.display.canvas))};papaya.Container.prototype.buildSliderControl=function(){this.sliderControlHtml=this.containerHtml.find("."+PAPAYA_KIOSK_CONTROLS_CSS)};
|
|
2077
|
-
papaya.Container.prototype.buildToolbar=function(){this.toolbarHtml=this.containerHtml.find("."+PAPAYA_TOOLBAR_CSS);this.toolbar=new papaya.ui.Toolbar(this);this.toolbar.buildToolbar();this.toolbar.updateImageButtons()};papaya.Container.prototype.readFile=function(c,a){c.file(function(a,c){a&&"."!==c.name.charAt(0)&&a(c)}.bind(this,a))};papaya.Container.prototype.readDir=function(c){this.readDirNextEntries(c.createReader())};
|
|
2078
|
-
papaya.Container.prototype.readDirNextEntries=function(c){var a=this;c.readEntries(function(d){var f=d.length,b,e;if(0<f){for(b=0;b<f;b+=1)e=d[b],e.isFile&&a.readFile(e,papaya.utilities.ObjectUtils.bind(a,a.addDroppedFile));a.readDirNextEntries(c)}})};
|
|
2079
|
-
papaya.Container.prototype.setUpDnD=function(){var c=this;this.containerHtml[0].ondragover=function(){c.viewer.draggingOver=!0;c.viewer.initialized||c.viewer.drawEmptyViewer();return!1};this.containerHtml[0].ondragleave=function(){c.viewer.draggingOver=!1;c.viewer.initialized||c.viewer.drawEmptyViewer();return!1};this.containerHtml[0].ondragend=function(){c.viewer.draggingOver=!1;c.viewer.initialized||c.viewer.drawEmptyViewer();return!1};this.containerHtml[0].ondrop=function(a){a.preventDefault();
|
|
2080
|
-
var d=a.dataTransfer;c.display.drawProgress(.1,"Loading");if(d)if(d.items&&0<d.items.length){a=d.items;var d=a.length,f,b;for(f=0;f<d;f+=1)b=a[f],b.getAsEntry?b=b.getAsEntry():b.webkitGetAsEntry&&(b=b.webkitGetAsEntry()),b.isFile?c.readFile(b,papaya.utilities.ObjectUtils.bind(c,c.addDroppedFile)):b.isDirectory&&c.readDir(b)}else d.files&&0<d.files.length&&c.viewer.loadImage(a.dataTransfer.files);return!1}};
|
|
2081
|
-
papaya.Container.prototype.addDroppedFile=function(c){clearTimeout(this.dropTimeout);papayaDroppedFiles.push(c);this.dropTimeout=setTimeout(papaya.utilities.ObjectUtils.bind(this,this.droppedFilesFinishedLoading),100)};
|
|
2082
|
-
papaya.Container.prototype.droppedFilesFinishedLoading=function(){papaya.surface.Surface.findSurfaceType(papayaDroppedFiles[0].name)!==papaya.surface.Surface.SURFACE_TYPE_UNKNOWN?this.viewer.loadSurface(papayaDroppedFiles):this.viewer.loadImage(papayaDroppedFiles);papayaDroppedFiles=[]};papaya.Container.prototype.clearParams=function(){this.params=[]};
|
|
2083
|
-
papaya.Container.prototype.loadNext=function(){this.hasImageToLoad()?this.loadNextImage():this.hasSurfaceToLoad()?this.loadNextSurface():this.hasAtlasToLoad()&&this.viewer.loadAtlas()};papaya.Container.prototype.hasMoreToLoad=function(){return this.hasImageToLoad()||this.hasSurfaceToLoad()||this.hasAtlasToLoad()};
|
|
2084
|
-
papaya.Container.prototype.hasImageToLoad=function(){return this.params.images?this.loadingImageIndex<this.params.images.length:this.params.encodedImages?this.loadingImageIndex<this.params.encodedImages.length:this.params.files?this.loadingImageIndex<this.params.files.length:!1};papaya.Container.prototype.hasAtlasToLoad=function(){return this.viewer.hasDefinedAtlas()};
|
|
2085
|
-
papaya.Container.prototype.hasSurfaceToLoad=function(){return papaya.utilities.PlatformUtils.isWebGLSupported()?this.params.surfaces?this.loadingSurfaceIndex<this.params.surfaces.length:this.params.encodedSurfaces?this.loadingSurfaceIndex<this.params.encodedSurfaces.length:!1:(console.log("Warning: This browser version is not able to load surfaces."),!1)};
|
|
2086
|
-
papaya.Container.prototype.loadNextSurface=function(){var c=!1,a;this.params.surfaces?this.loadingSurfaceIndex<this.params.surfaces.length?(c=!0,a=this.params.surfaces[this.loadingSurfaceIndex],this.loadingSurfaceIndex+=1,this.viewer.loadSurface(a,!0,!1)):(this.params.loadedSurfaces=this.params.surfaces,this.params.surfaces=[]):this.params.encodedSurfaces&&(this.loadingSurfaceIndex<this.params.encodedSurfaces.length?(c=!0,a=this.params.encodedSurfaces[this.loadingSurfaceIndex],a instanceof Array||
|
|
2087
|
-
(a=[],a[0]=this.params.encodedSurfaces[this.loadingSurfaceIndex]),this.viewer.loadSurface(a,!1,!0),this.loadingSurfaceIndex+=1):(this.params.loadedEncodedSurfaces=this.params.encodedSurfaces,this.params.encodedSurfaces=[]));return c};
|
|
2088
|
-
papaya.Container.prototype.loadNextImage=function(){var c=!1,a;this.params.images?this.loadingImageIndex<this.params.images.length?(c=!0,a=this.params.images[this.loadingImageIndex],a instanceof Array||(a=[],a[0]=this.params.images[this.loadingImageIndex]),this.viewer.loadImage(a,!0,!1),this.loadingImageIndex+=1):(this.params.loadedImages=this.params.images,this.params.images=[]):this.params.encodedImages?this.loadingImageIndex<this.params.encodedImages.length?(c=!0,a=this.params.encodedImages[this.loadingImageIndex],
|
|
2089
|
-
a instanceof Array||(a=[],a[0]=this.params.encodedImages[this.loadingImageIndex]),this.viewer.loadImage(a,!1,!0),this.loadingImageIndex+=1):(this.params.loadedEncodedImages=this.params.encodedImages,this.params.encodedImages=[]):this.params.files&&(this.loadingImageIndex<this.params.files.length?(c=!0,a=this.params.files[this.loadingImageIndex],a instanceof Array||(a=[],a[0]=this.params.files[this.loadingImageIndex]),this.viewer.loadImage(a,!1,!1),this.loadingImageIndex+=1):(this.params.loadedFiles=
|
|
2090
|
-
this.params.files,this.params.files=[]));return c};papaya.Container.prototype.readyForDnD=function(){return!this.kioskMode&&(void 0===this.params.images||this.loadingImageIndex>=this.params.images.length)&&(void 0===this.params.encodedImages||this.loadingImageIndex>=this.params.encodedImages.length)&&(void 0===this.params.encodedSurfaces||this.loadingSurfaceIndex>=this.params.encodedSurfaces.length)};
|
|
2091
|
-
papaya.Container.prototype.findLoadableImage=function(c,a){var d;for(d=0;d<papayaLoadableImages.length;d+=1)if(a){if(papayaLoadableImages[d].surface&&papayaLoadableImages[d].name==c)return papayaLoadableImages[d]}else if(papayaLoadableImages[d].name==c)return papayaLoadableImages[d];return null};
|
|
2092
|
-
papaya.Container.prototype.expandViewer=function(){var c=this;this.nestedViewer&&(this.nestedViewer=!1,this.collapsable=!0,this.tempScrollTop=$(window).scrollTop(),$(":hidden").addClass(PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT),$(document.body).children().hide(),this.containerHtml.show(),this.originalStyle={},this.originalStyle.width=document.body.style.width,this.originalStyle.height=document.body.style.height,this.originalStyle.marginTop=document.body.style.marginTop,this.originalStyle.marginRight=document.body.style.marginRight,
|
|
2093
|
-
this.originalStyle.marginBottom=document.body.style.marginBottom,this.originalStyle.marginLeft=document.body.style.marginLeft,this.originalStyle.paddingTop=document.body.style.paddingTop,this.originalStyle.paddingRight=document.body.style.paddingRight,this.originalStyle.paddingBottom=document.body.style.paddingBottom,this.originalStyle.paddingLeft=document.body.style.paddingLeft,this.originalStyle.overflow=document.body.style.overflow,papaya.Container.setToFullPage(),this.containerHtml.after('<div style="display:none" class="'+
|
|
2094
|
-
PAPAYA_CONTAINER_COLLAPSABLE+'"></div>'),$(document.body).prepend(this.containerHtml),this.resizeViewerComponents(!0),this.viewer.updateOffsetRect(),this.updateViewerSize(),setTimeout(function(){window.scrollTo(0,0);c.viewer.addScroll()},0))};
|
|
2095
|
-
papaya.Container.prototype.collapseViewer=function(){var c,a;a=this;if(this.collapsable){this.nestedViewer=!0;this.collapsable=!1;document.body.style.width=this.originalStyle.width;document.body.style.height=this.originalStyle.height;document.body.style.marginTop=this.originalStyle.marginTop;document.body.style.marginRight=this.originalStyle.marginRight;document.body.style.marginBottom=this.originalStyle.marginBottom;document.body.style.marginLeft=this.originalStyle.marginLeft;document.body.style.paddingTop=
|
|
2096
|
-
this.originalStyle.paddingTop;document.body.style.paddingRight=this.originalStyle.paddingRight;document.body.style.paddingBottom=this.originalStyle.paddingBottom;document.body.style.paddingLeft=this.originalStyle.paddingLeft;document.body.style.overflow=this.originalStyle.overflow;$("."+PAPAYA_CONTAINER_COLLAPSABLE).replaceWith(this.containerHtml);$(document.body).children(":not(."+PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT+")").show();$("."+PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT).removeClass(PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT);
|
|
2097
|
-
this.resizeViewerComponents(!0);for(c=0;c<papayaContainers.length;c+=1)papayaContainers[c].updateViewerSize(),papayaContainers[c].viewer.drawViewer(!0);setTimeout(function(){$(window).scrollTop(a.tempScrollTop);a.viewer.removeScroll()},0)}};papaya.Container.prototype.isNestedViewer=function(){return this.nestedViewer||this.collapsable};papaya.Container.prototype.isDesktopMode=function(){return!this.kioskMode};papaya.Container.prototype.hasLoadedDTI=function(){return this.viewer.hasLoadedDTI()};
|
|
2098
|
-
papaya.Container.prototype.disableScrollWheel=function(){return this.isNestedViewer()||papaya.utilities.PlatformUtils.ios};papaya.Container.prototype.canOpenInMango=function(){return this.params.canOpenInMango};papaya.Container.prototype.isExpandable=function(){return this.params.expandable&&this.isNestedViewer()};papaya.Container.prototype.isParametricCombined=function(c){return this.combineParametric&&this.viewer.hasParametricPair(c)};papaya.Container.prototype.isNonParametricCombined=function(c){return!this.isParametricCombined(c)};
|
|
2099
|
-
papaya.Container.prototype.coordinateChanged=function(c){var a,d,f=c.currentCoord;if(papaya.Container.syncViewersWorld)for(a=0;a<papayaContainers.length;a+=1)papayaContainers[a].viewer!==c&&(d=new papaya.core.Coordinate,papayaContainers[a].viewer.gotoWorldCoordinate(c.getWorldCoordinateAtIndex(f.x,f.y,f.z,d),!0));else if(papaya.Container.syncViewers)for(a=0;a<papayaContainers.length;a+=1)papayaContainers[a].viewer!==c&&papayaContainers[a].viewer.gotoCoordinate(f,!0);c.surfaceView&&c.surfaceView.updateActivePlanes();
|
|
2100
|
-
this.contextManager&&this.contextManager.clearContext&&this.contextManager.clearContext()};papaya.Container.prototype.canCurrentOverlayLoadNegatives=function(){var c=this.viewer.currentScreenVolume;return!c.negative&&null===c.negativeScreenVol};papaya.Container.prototype.canCurrentOverlayLoadMod=function(){var c=this.viewer.currentScreenVolume;return c.dti&&null===c.dtiVolumeMod};
|
|
2101
|
-
papaya.Container.prototype.canCurrentOverlayModulate=function(){var c=this.viewer.currentScreenVolume;return c.dti&&null!==c.dtiVolumeMod};window.addEventListener("resize",papaya.Container.resizePapaya,!1);window.addEventListener("orientationchange",papaya.Container.reorientPapaya,!1);window.addEventListener("load",papaya.Container.startPapaya,!1);window.addEventListener("message",function(c){c.data===PAPAYA_MANGO_INSTALLED&&(papaya.mangoinstalled=!0)},!1);
|