@fnndsc/argus 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Settings-S56FlUIT.js → Settings-BVnfxRPh.js} +1 -1
- package/dist/assets/{Texture-CQH9MGcs.js → Texture-C99vHuBO.js} +1 -1
- package/dist/assets/{addVolumesToViewports-CiUohVc9.js → addVolumesToViewports-42A0OSZO.js} +1 -1
- package/dist/assets/{cornerstoneEngine-B_XTzElr.js → cornerstoneEngine-CGEzAsx7.js} +2 -2
- package/dist/assets/index-CIblWv2u.css +1 -0
- package/dist/assets/{index-DvkyE6TP.js → index-Cbx1WubN.js} +1 -1
- package/dist/assets/{index-CwtHAV6C.js → index-CmFTTf9P.js} +1 -1
- package/dist/assets/{index-CVqHWut9.js → index-Cy_-g61h.js} +1 -1
- package/dist/assets/{index-Cw7e-G_5.js → index-D21xH-i4.js} +1 -1
- package/dist/assets/{index-CuA0bs3S.js → index-DeAAUX9B.js} +1 -1
- package/dist/assets/index-Dtsm0q-Z.js +4230 -0
- package/dist/assets/{index-DZlIIbYs.js → index-mx1chng0.js} +1 -1
- package/dist/assets/layoutWorker-DqMRqv-I.js +1 -0
- package/dist/assets/{niivueEngine-DjOwOc5f.js → niivueEngine-D4fRmSZx.js} +2 -2
- package/dist/assets/{slabScene-D0q5X-Ay.js → slabScene-Bh7W1X9C.js} +1 -1
- package/dist/index.html +4 -2
- package/package.json +1 -1
- package/dist/assets/index-e3Rd5Dlh.js +0 -4156
- package/dist/assets/index-i8iYSiHn.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./blosc-CrUiACa7.js","./chunk-INHXZS53-D3tQiqtZ.js","./lz4-B_Exjfmr.js","./zstd-u5eweWyS.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{g as va}from"./_commonjsHelpers-CE1G-McA.js";import{_ as Mi}from"./index-e3Rd5Dlh.js";var _t=1e-6,Ae=typeof Float32Array<"u"?Float32Array:Array;function qi(){var t=new Ae(9);return Ae!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function wa(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function He(t,e,i,r,s,n,a,o,l){var c=new Ae(9);return c[0]=t,c[1]=e,c[2]=i,c[3]=r,c[4]=s,c[5]=n,c[6]=a,c[7]=o,c[8]=l,c}function ya(t,e){var i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=h*a-o*c,f=-h*n+o*l,u=c*n-a*l,m=i*d+r*f+s*u;return m?(m=1/m,t[0]=d*m,t[1]=(-h*r+s*c)*m,t[2]=(o*r-s*a)*m,t[3]=f*m,t[4]=(h*i-s*l)*m,t[5]=(-o*i+s*n)*m,t[6]=u*m,t[7]=(-c*i+r*l)*m,t[8]=(a*i-r*n)*m,t):null}function Hs(t,e,i){var r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],l=e[5],c=e[6],h=e[7],d=e[8],f=i[0],u=i[1],m=i[2],p=i[3],g=i[4],x=i[5],A=i[6],y=i[7],v=i[8];return t[0]=f*r+u*a+m*c,t[1]=f*s+u*o+m*h,t[2]=f*n+u*l+m*d,t[3]=p*r+g*a+x*c,t[4]=p*s+g*o+x*h,t[5]=p*n+g*l+x*d,t[6]=A*r+y*a+v*c,t[7]=A*s+y*o+v*h,t[8]=A*n+y*l+v*d,t}function J(){var t=new Ae(16);return Ae!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function de(t){var e=new Ae(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ba(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ee(t,e,i,r,s,n,a,o,l,c,h,d,f,u,m,p){var g=new Ae(16);return g[0]=t,g[1]=e,g[2]=i,g[3]=r,g[4]=s,g[5]=n,g[6]=a,g[7]=o,g[8]=l,g[9]=c,g[10]=h,g[11]=d,g[12]=f,g[13]=u,g[14]=m,g[15]=p,g}function qs(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Te(t,e){if(t===e){var i=e[1],r=e[2],s=e[3],n=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=n,t[11]=e[14],t[12]=s,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Se(t,e){var i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],u=e[11],m=e[12],p=e[13],g=e[14],x=e[15],A=i*o-r*a,y=i*l-s*a,v=i*c-n*a,b=r*l-s*o,w=r*c-n*o,C=s*c-n*l,M=h*p-d*m,T=h*g-f*m,E=h*x-u*m,I=d*g-f*p,S=d*x-u*p,U=f*x-u*g,B=A*U-y*S+v*I+b*E-w*T+C*M;return B?(B=1/B,t[0]=(o*U-l*S+c*I)*B,t[1]=(s*S-r*U-n*I)*B,t[2]=(p*C-g*w+x*b)*B,t[3]=(f*w-d*C-u*b)*B,t[4]=(l*E-a*U-c*T)*B,t[5]=(i*U-s*E+n*T)*B,t[6]=(g*v-m*C-x*y)*B,t[7]=(h*C-f*v+u*y)*B,t[8]=(a*S-o*E+c*M)*B,t[9]=(r*E-i*S-n*M)*B,t[10]=(m*w-p*v+x*A)*B,t[11]=(d*v-h*w-u*A)*B,t[12]=(o*T-a*I-l*M)*B,t[13]=(i*I-r*T+s*M)*B,t[14]=(p*y-m*b-g*A)*B,t[15]=(h*b-d*y+f*A)*B,t):null}function Ye(t,e,i){var r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],l=e[5],c=e[6],h=e[7],d=e[8],f=e[9],u=e[10],m=e[11],p=e[12],g=e[13],x=e[14],A=e[15],y=i[0],v=i[1],b=i[2],w=i[3];return t[0]=y*r+v*o+b*d+w*p,t[1]=y*s+v*l+b*f+w*g,t[2]=y*n+v*c+b*u+w*x,t[3]=y*a+v*h+b*m+w*A,y=i[4],v=i[5],b=i[6],w=i[7],t[4]=y*r+v*o+b*d+w*p,t[5]=y*s+v*l+b*f+w*g,t[6]=y*n+v*c+b*u+w*x,t[7]=y*a+v*h+b*m+w*A,y=i[8],v=i[9],b=i[10],w=i[11],t[8]=y*r+v*o+b*d+w*p,t[9]=y*s+v*l+b*f+w*g,t[10]=y*n+v*c+b*u+w*x,t[11]=y*a+v*h+b*m+w*A,y=i[12],v=i[13],b=i[14],w=i[15],t[12]=y*r+v*o+b*d+w*p,t[13]=y*s+v*l+b*f+w*g,t[14]=y*n+v*c+b*u+w*x,t[15]=y*a+v*h+b*m+w*A,t}function tt(t,e,i){var r=i[0],s=i[1],n=i[2],a,o,l,c,h,d,f,u,m,p,g,x;return e===t?(t[12]=e[0]*r+e[4]*s+e[8]*n+e[12],t[13]=e[1]*r+e[5]*s+e[9]*n+e[13],t[14]=e[2]*r+e[6]*s+e[10]*n+e[14],t[15]=e[3]*r+e[7]*s+e[11]*n+e[15]):(a=e[0],o=e[1],l=e[2],c=e[3],h=e[4],d=e[5],f=e[6],u=e[7],m=e[8],p=e[9],g=e[10],x=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=c,t[4]=h,t[5]=d,t[6]=f,t[7]=u,t[8]=m,t[9]=p,t[10]=g,t[11]=x,t[12]=a*r+h*s+m*n+e[12],t[13]=o*r+d*s+p*n+e[13],t[14]=l*r+f*s+g*n+e[14],t[15]=c*r+u*s+x*n+e[15]),t}function fr(t,e,i){var r=i[0],s=i[1],n=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ut(t,e,i){var r=Math.sin(i),s=Math.cos(i),n=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=e[9],d=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=n*s+c*r,t[5]=a*s+h*r,t[6]=o*s+d*r,t[7]=l*s+f*r,t[8]=c*s-n*r,t[9]=h*s-a*r,t[10]=d*s-o*r,t[11]=f*s-l*r,t}function Ca(t,e,i){var r=Math.sin(i),s=Math.cos(i),n=e[0],a=e[1],o=e[2],l=e[3],c=e[8],h=e[9],d=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*s-c*r,t[1]=a*s-h*r,t[2]=o*s-d*r,t[3]=l*s-f*r,t[8]=n*r+c*s,t[9]=a*r+h*s,t[10]=o*r+d*s,t[11]=l*r+f*s,t}function Rt(t,e,i){var r=Math.sin(i),s=Math.cos(i),n=e[0],a=e[1],o=e[2],l=e[3],c=e[4],h=e[5],d=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*s+c*r,t[1]=a*s+h*r,t[2]=o*s+d*r,t[3]=l*s+f*r,t[4]=c*s-n*r,t[5]=h*s-a*r,t[6]=d*s-o*r,t[7]=f*s-l*r,t}function Ma(t,e,i){var r=i[0],s=i[1],n=i[2],a=Math.sqrt(r*r+s*s+n*n),o,l,c;return a<_t?null:(a=1/a,r*=a,s*=a,n*=a,o=Math.sin(e),l=Math.cos(e),c=1-l,t[0]=r*r*c+l,t[1]=s*r*c+n*o,t[2]=n*r*c-s*o,t[3]=0,t[4]=r*s*c-n*o,t[5]=s*s*c+l,t[6]=n*s*c+r*o,t[7]=0,t[8]=r*n*c+s*o,t[9]=s*n*c-r*o,t[10]=n*n*c+l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Da(t,e,i,r,s,n,a){var o=1/(e-i),l=1/(r-s),c=1/(n-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*o,t[13]=(s+r)*l,t[14]=(a+n)*c,t[15]=1,t}var hi=Da;function Ta(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t}var Qs=Ye;function se(){var t=new Ae(3);return Ae!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ve(t){var e=new Ae(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Qe(t){var e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)}function k(t,e,i){var r=new Ae(3);return r[0]=t,r[1]=e,r[2]=i,r}function Hr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function it(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function ne(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function ur(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function mr(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function Sa(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Ea(t,e){var i=e[0]-t[0],r=e[1]-t[1],s=e[2]-t[2];return Math.sqrt(i*i+r*r+s*s)}function Ia(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function Ie(t,e){var i=e[0],r=e[1],s=e[2],n=i*i+r*r+s*s;return n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Fa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Jt(t,e,i){var r=e[0],s=e[1],n=e[2],a=i[0],o=i[1],l=i[2];return t[0]=s*l-n*o,t[1]=n*a-r*l,t[2]=r*o-s*a,t}function Ba(t,e,i,r){var s=e[0],n=e[1],a=e[2];return t[0]=s+r*(i[0]-s),t[1]=n+r*(i[1]-n),t[2]=a+r*(i[2]-a),t}function qr(t,e,i){var r=e[0],s=e[1],n=e[2];return t[0]=r*i[0]+s*i[3]+n*i[6],t[1]=r*i[1]+s*i[4]+n*i[7],t[2]=r*i[2]+s*i[5]+n*i[8],t}function Di(t,e){var i=t[0],r=t[1],s=t[2],n=e[0],a=e[1],o=e[2],l=Math.sqrt((i*i+r*r+s*s)*(n*n+a*a+o*o)),c=l&&Fa(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function Ua(t,e){var i=t[0],r=t[1],s=t[2],n=e[0],a=e[1],o=e[2];return Math.abs(i-n)<=_t*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-a)<=_t*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(s-o)<=_t*Math.max(1,Math.abs(s),Math.abs(o))}var Qr=ne,Vt=Qe;(function(){var t=se();return function(e,i,r,s,n,a){var o,l;for(i||(i=3),r||(r=0),s?l=Math.min(s*i+r,e.length):l=e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],n(t,t,a),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2];return e}})();function Xe(){var t=new Ae(4);return Ae!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ze(t){var e=new Ae(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ae(t,e,i,r){var s=new Ae(4);return s[0]=t,s[1]=e,s[2]=i,s[3]=r,s}function Zr(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}function Ra(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}function Va(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function ve(t,e,i){var r=e[0],s=e[1],n=e[2],a=e[3];return t[0]=i[0]*r+i[4]*s+i[8]*n+i[12]*a,t[1]=i[1]*r+i[5]*s+i[9]*n+i[13]*a,t[2]=i[2]*r+i[6]*s+i[10]*n+i[14]*a,t[3]=i[3]*r+i[7]*s+i[11]*n+i[15]*a,t}var Pa=Ra;(function(){var t=Xe();return function(e,i,r,s,n,a){var o,l;for(i||(i=4),r||(r=0),s?l=Math.min(s*i+r,e.length):l=e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],t[3]=e[o+3],n(t,t,a),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2],e[o+3]=t[3];return e}})();function Na(){var t=new Ae(2);return Ae!=Float32Array&&(t[0]=0,t[1]=0),t}function La(t,e){var i=new Ae(2);return i[0]=t,i[1]=e,i}(function(){var t=Na();return function(e,i,r,s,n,a){var o,l;for(i||(i=2),r||(r=0),s?l=Math.min(s*i+r,e.length):l=e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],n(t,t,a),e[o]=t[0],e[o+1]=t[1];return e}})();var et=256,$t=[],Yt;for(;et--;)$t[et]=(et+256).toString(16).substring(1);function di(){var t=0,e,i="";if(!Yt||et+16>256){for(Yt=Array(t=256);t--;)Yt[t]=256*Math.random()|0;t=et=0}for(;t<16;t++)e=Yt[et+t],t==6?i+=$t[e&15|64]:t==8?i+=$t[e&63|128]:i+=$t[e],t&1&&t>1&&t<11&&(i+="-");return et++,i}var Ti,jr;function ka(){return jr||(jr=1,Ti=function(e,i){var r=e.length;if(e===i)return!0;if(r!==i.length)return!1;for(var s=0;s<r;s++)if(e[s]!==i[s])return!1;return!0}),Ti}var Oa=ka();const za=va(Oa);var ge=Uint8Array,ut=Uint16Array,Ga=Int32Array,Zs=new ge([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,0,0,0]),js=new ge([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,0,0]),Ya=new ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_s=function(t,e){for(var i=new ut(31),r=0;r<31;++r)i[r]=e+=1<<t[r-1];for(var s=new Ga(i[30]),r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)s[n]=n-i[r]<<5|r;return{b:i,r:s}},Js=_s(Zs,2),$s=Js.b,Xa=Js.r;$s[28]=258,Xa[258]=28;var Wa=_s(js,0),Ka=Wa.b,Qi=new ut(32768);for(var oe=0;oe<32768;++oe){var We=(oe&43690)>>1|(oe&21845)<<1;We=(We&52428)>>2|(We&13107)<<2,We=(We&61680)>>4|(We&3855)<<4,Qi[oe]=((We&65280)>>8|(We&255)<<8)>>1}var Ft=(function(t,e,i){for(var r=t.length,s=0,n=new ut(e);s<r;++s)t[s]&&++n[t[s]-1];var a=new ut(e);for(s=1;s<e;++s)a[s]=a[s-1]+n[s-1]<<1;var o;if(i){o=new ut(1<<e);var l=15-e;for(s=0;s<r;++s)if(t[s])for(var c=s<<4|t[s],h=e-t[s],d=a[t[s]-1]++<<h,f=d|(1<<h)-1;d<=f;++d)o[Qi[d]>>l]=c}else for(o=new ut(r),s=0;s<r;++s)t[s]&&(o[s]=Qi[a[t[s]-1]++]>>15-t[s]);return o}),Pt=new ge(288);for(var oe=0;oe<144;++oe)Pt[oe]=8;for(var oe=144;oe<256;++oe)Pt[oe]=9;for(var oe=256;oe<280;++oe)Pt[oe]=7;for(var oe=280;oe<288;++oe)Pt[oe]=8;var en=new ge(32);for(var oe=0;oe<32;++oe)en[oe]=5;var Ha=Ft(Pt,9,1),qa=Ft(en,5,1),Si=function(t){for(var e=t[0],i=1;i<t.length;++i)t[i]>e&&(e=t[i]);return e},Be=function(t,e,i){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&i},Ei=function(t,e){var i=e/8|0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>(e&7)},tn=function(t){return(t+7)/8|0},ei=function(t,e,i){return(e==null||e<0)&&(e=0),(i==null||i>t.length)&&(i=t.length),new ge(t.subarray(e,i))},Qa=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ye=function(t,e,i){var r=new Error(e||Qa[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,ye),!i)throw r;return r},Ai=function(t,e,i,r){var s=t.length,n=0;if(!s||e.f&&!e.l)return i||new ge(0);var a=!i,o=a||e.i!=2,l=e.i;a&&(i=new ge(s*3));var c=function(at){var _e=i.length;if(at>_e){var Fe=new ge(Math.max(_e*2,at));Fe.set(i),i=Fe}},h=e.f||0,d=e.p||0,f=e.b||0,u=e.l,m=e.d,p=e.m,g=e.n,x=s*8;do{if(!u){h=Be(t,d,1);var A=Be(t,d+1,3);if(d+=3,A)if(A==1)u=Ha,m=qa,p=9,g=5;else if(A==2){var w=Be(t,d,31)+257,C=Be(t,d+10,15)+4,M=w+Be(t,d+5,31)+1;d+=14;for(var T=new ge(M),E=new ge(19),I=0;I<C;++I)E[Ya[I]]=Be(t,d+I*3,7);d+=C*3;for(var S=Si(E),U=(1<<S)-1,B=Ft(E,S,1),I=0;I<M;){var V=B[Be(t,d,U)];d+=V&15;var y=V>>4;if(y<16)T[I++]=y;else{var R=0,P=0;for(y==16?(P=3+Be(t,d,3),d+=2,R=T[I-1]):y==17?(P=3+Be(t,d,7),d+=3):y==18&&(P=11+Be(t,d,127),d+=7);P--;)T[I++]=R}}var L=T.subarray(0,w),N=T.subarray(w);p=Si(L),g=Si(N),u=Ft(L,p,1),m=Ft(N,g,1)}else ye(1);else{var y=tn(d)+4,v=t[y-4]|t[y-3]<<8,b=y+v;if(b>s){l&&ye(0);break}o&&c(f+v),i.set(t.subarray(y,b),f),e.b=f+=v,e.p=d=b*8,e.f=h;continue}if(d>x){l&&ye(0);break}}o&&c(f+131072);for(var Y=(1<<p)-1,_=(1<<g)-1,z=d;;z=d){var R=u[Ei(t,d)&Y],W=R>>4;if(d+=R&15,d>x){l&&ye(0);break}if(R||ye(2),W<256)i[f++]=W;else if(W==256){z=d,u=null;break}else{var K=W-254;if(W>264){var I=W-257,Z=Zs[I];K=Be(t,d,(1<<Z)-1)+$s[I],d+=Z}var q=m[Ei(t,d)&_],te=q>>4;q||ye(3),d+=q&15;var N=Ka[te];if(te>3){var Z=js[te];N+=Ei(t,d)&(1<<Z)-1,d+=Z}if(d>x){l&&ye(0);break}o&&c(f+131072);var ue=f+K;if(f<N){var le=n-N,je=Math.min(N,ue);for(le+f<0&&ye(3);f<je;++f)i[f]=r[le+f]}for(;f<ue;++f)i[f]=i[f-N]}}e.l=u,e.p=z,e.b=f,e.f=h,u&&(h=1,e.m=p,e.d=m,e.n=g)}while(!h);return f!=i.length&&a?ei(i,0,f):i.subarray(0,f)},Za=new ge(0),rn=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&ye(6,"invalid gzip data");var e=t[3],i=10;e&4&&(i+=(t[10]|t[11]<<8)+2);for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[i++]);return i+(e&2)},ja=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},_a=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&ye(6,"invalid zlib data"),(t[1]>>5&1)==1&&ye(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2},Xt=(function(){function t(e,i){typeof e=="function"&&(i=e,e={}),this.ondata=i;var r=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:r?r.length:0},this.o=new ge(32768),this.p=new ge(0),r&&this.o.set(r)}return t.prototype.e=function(e){if(this.ondata||ye(5),this.d&&ye(4),!this.p.length)this.p=e;else if(e.length){var i=new ge(this.p.length+e.length);i.set(this.p),i.set(e,this.p.length),this.p=i}},t.prototype.c=function(e){this.s.i=+(this.d=e||!1);var i=this.s.b,r=Ai(this.p,this.s,this.o);this.ondata(ei(r,i,this.s.b),this.d),this.o=ei(r,this.s.b-32768),this.s.b=this.o.length,this.p=ei(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,i){this.e(e),this.c(i)},t})();function Ja(t,e){return Ai(t,{i:2},e,e)}var $a=(function(){function t(e,i){this.v=1,this.r=0,Xt.call(this,e,i)}return t.prototype.push=function(e,i){if(Xt.prototype.e.call(this,e),this.r+=e.length,this.v){var r=this.p.subarray(this.v-1),s=r.length>3?rn(r):4;if(s>r.length){if(!i)return}else this.v>1&&this.onmember&&this.onmember(this.r-r.length);this.p=r.subarray(s),this.v=0}Xt.prototype.c.call(this,0),this.s.f&&!this.s.l?(this.v=tn(this.s.p)+9,this.s={i:0},this.o=new ge(0),this.push(new ge(0),i)):i&&Xt.prototype.c.call(this,i)},t})();function eo(t,e){var i=rn(t);return i+8>t.length&&ye(6,"invalid gzip data"),Ai(t.subarray(i,-8),{i:2},new ge(ja(t)),e)}function to(t,e){return Ai(t.subarray(_a(t),-4),{i:2},e,e)}function io(t,e){return t[0]==31&&t[1]==139&&t[2]==8?eo(t,e):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?Ja(t,e):to(t,e)}var ro=typeof TextDecoder<"u"&&new TextDecoder,so=0;try{ro.decode(Za,{stream:!0}),so=1}catch{}class sn{esize;ecode;edata;littleEndian;constructor(e,i,r,s){if(e%16!=0)throw new Error("This does not appear to be a NIFTI extension");this.esize=e,this.ecode=i,this.edata=r,this.littleEndian=s}toArrayBuffer(){let e=new Uint8Array(this.esize),i=new Uint8Array(this.edata);e.set(i,8);let r=new DataView(e.buffer);return r.setInt32(0,this.esize,this.littleEndian),r.setInt32(4,this.ecode,this.littleEndian),e.buffer}}class O{static crcTable=null;static GUNZIP_MAGIC_COOKIE1=31;static GUNZIP_MAGIC_COOKIE2=139;static getStringAt(e,i,r){var s="",n,a;for(n=i;n<r;n+=1)a=e.getUint8(n),a!==0&&(s+=String.fromCharCode(a));return s}static getByteAt=function(e,i){return e.getUint8(i)};static getShortAt=function(e,i,r){return e.getInt16(i,r)};static getIntAt(e,i,r){return e.getInt32(i,r)}static getFloatAt(e,i,r){return e.getFloat32(i,r)}static getDoubleAt(e,i,r){return e.getFloat64(i,r)}static getInt64At(e,i,r){const s=e.getUint32(i,r),n=e.getInt32(i+4,r);let a;return r?a=n*2**32+s:a=s*2**32+n,n<0&&(a+=-1*2**32*2**32),a}static getUint64At(e,i,r){const s=e.getUint32(i+(r?0:4),r),n=e.getUint32(i+(r?4:0),r);return r?n*2**32+s:s*2**32+n}static getExtensionsAt(e,i,r,s){let n=[],a=i;for(;a<s;){let o=r,l=O.getIntAt(e,a,r);if(!l)break;if(l+a>s&&(o=!o,l=O.getIntAt(e,a,o),l+a>s))throw new Error("This does not appear to be a valid NIFTI extension");if(l%16!=0)throw new Error("This does not appear to be a NIFTI extension");let c=O.getIntAt(e,a+4,o),h=e.buffer.slice(a+8,a+l),d=new sn(l,c,h,o);n.push(d),a+=l}return n}static toArrayBuffer(e){var i,r,s;for(i=new ArrayBuffer(e.length),r=new Uint8Array(i),s=0;s<e.length;s+=1)r[s]=e[s];return i}static isString(e){return typeof e=="string"||e instanceof String}static formatNumber(e,i=void 0){let r;return O.isString(e)?r=Number(e):r=e,i?r=r.toPrecision(5):r=r.toPrecision(7),parseFloat(r)}static makeCRCTable(){let e,i=[];for(var r=0;r<256;r++){e=r;for(var s=0;s<8;s++)e=e&1?3988292384^e>>>1:e>>>1;i[r]=e}return i}static crc32(e){O.crcTable||(O.crcTable=O.makeCRCTable());const i=O.crcTable;let r=-1;for(var s=0;s<e.byteLength;s++)r=r>>>8^i[(r^e.getUint8(s))&255];return(r^-1)>>>0}}class G{littleEndian=!1;dim_info=0;dims=[];intent_p1=0;intent_p2=0;intent_p3=0;intent_code=0;datatypeCode=0;numBitsPerVoxel=0;slice_start=0;slice_end=0;slice_code=0;pixDims=[];vox_offset=0;scl_slope=1;scl_inter=0;xyzt_units=0;cal_max=0;cal_min=0;slice_duration=0;toffset=0;description="";aux_file="";intent_name="";qform_code=0;sform_code=0;quatern_a=0;quatern_b=0;quatern_c=0;quatern_d=0;qoffset_x=0;qoffset_y=0;qoffset_z=0;affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];qfac=1;quatern_R;magic="0";isHDR=!1;extensionFlag=[0,0,0,0];extensionSize=0;extensionCode=0;extensions=[];static TYPE_NONE=0;static TYPE_BINARY=1;static TYPE_UINT8=2;static TYPE_INT16=4;static TYPE_INT32=8;static TYPE_FLOAT32=16;static TYPE_COMPLEX64=32;static TYPE_FLOAT64=64;static TYPE_RGB24=128;static TYPE_INT8=256;static TYPE_UINT16=512;static TYPE_UINT32=768;static TYPE_INT64=1024;static TYPE_UINT64=1280;static TYPE_FLOAT128=1536;static TYPE_COMPLEX128=1792;static TYPE_COMPLEX256=2048;static XFORM_UNKNOWN=0;static XFORM_SCANNER_ANAT=1;static XFORM_ALIGNED_ANAT=2;static XFORM_TALAIRACH=3;static XFORM_MNI_152=4;static SPATIAL_UNITS_MASK=7;static TEMPORAL_UNITS_MASK=56;static UNITS_UNKNOWN=0;static UNITS_METER=1;static UNITS_MM=2;static UNITS_MICRON=3;static UNITS_SEC=8;static UNITS_MSEC=16;static UNITS_USEC=24;static UNITS_HZ=32;static UNITS_PPM=40;static UNITS_RADS=48;static MAGIC_COOKIE=348;static STANDARD_HEADER_SIZE=348;static MAGIC_NUMBER_LOCATION=344;static MAGIC_NUMBER=[110,43,49];static MAGIC_NUMBER2=[110,105,49];static EXTENSION_HEADER_SIZE=8;readHeader(e){var i=new DataView(e),r=O.getIntAt(i,0,this.littleEndian),s,n,a,o;if(r!==G.MAGIC_COOKIE&&(this.littleEndian=!0,r=O.getIntAt(i,0,this.littleEndian)),r!==G.MAGIC_COOKIE)throw new Error("This does not appear to be a NIFTI file!");for(this.dim_info=O.getByteAt(i,39),s=0;s<8;s+=1)o=40+s*2,this.dims[s]=O.getShortAt(i,o,this.littleEndian);for(this.intent_p1=O.getFloatAt(i,56,this.littleEndian),this.intent_p2=O.getFloatAt(i,60,this.littleEndian),this.intent_p3=O.getFloatAt(i,64,this.littleEndian),this.intent_code=O.getShortAt(i,68,this.littleEndian),this.datatypeCode=O.getShortAt(i,70,this.littleEndian),this.numBitsPerVoxel=O.getShortAt(i,72,this.littleEndian),this.slice_start=O.getShortAt(i,74,this.littleEndian),s=0;s<8;s+=1)o=76+s*4,this.pixDims[s]=O.getFloatAt(i,o,this.littleEndian);if(this.vox_offset=O.getFloatAt(i,108,this.littleEndian),this.scl_slope=O.getFloatAt(i,112,this.littleEndian),this.scl_inter=O.getFloatAt(i,116,this.littleEndian),this.slice_end=O.getShortAt(i,120,this.littleEndian),this.slice_code=O.getByteAt(i,122),this.xyzt_units=O.getByteAt(i,123),this.cal_max=O.getFloatAt(i,124,this.littleEndian),this.cal_min=O.getFloatAt(i,128,this.littleEndian),this.slice_duration=O.getFloatAt(i,132,this.littleEndian),this.toffset=O.getFloatAt(i,136,this.littleEndian),this.description=O.getStringAt(i,148,228),this.aux_file=O.getStringAt(i,228,252),this.qform_code=O.getShortAt(i,252,this.littleEndian),this.sform_code=O.getShortAt(i,254,this.littleEndian),this.quatern_b=O.getFloatAt(i,256,this.littleEndian),this.quatern_c=O.getFloatAt(i,260,this.littleEndian),this.quatern_d=O.getFloatAt(i,264,this.littleEndian),this.quatern_a=Math.sqrt(1-(Math.pow(this.quatern_b,2)+Math.pow(this.quatern_c,2)+Math.pow(this.quatern_d,2))),this.qoffset_x=O.getFloatAt(i,268,this.littleEndian),this.qoffset_y=O.getFloatAt(i,272,this.littleEndian),this.qoffset_z=O.getFloatAt(i,276,this.littleEndian),this.qform_code<1&&this.sform_code<1&&(this.affine[0][0]=this.pixDims[1],this.affine[1][1]=this.pixDims[2],this.affine[2][2]=this.pixDims[3]),this.qform_code>0&&this.sform_code<this.qform_code){const l=this.quatern_a,c=this.quatern_b,h=this.quatern_c,d=this.quatern_d;for(this.qfac=this.pixDims[0]===0?1:this.pixDims[0],this.quatern_R=[[l*l+c*c-h*h-d*d,2*c*h-2*l*d,2*c*d+2*l*h],[2*c*h+2*l*d,l*l+h*h-c*c-d*d,2*h*d-2*l*c],[2*c*d-2*l*h,2*h*d+2*l*c,l*l+d*d-h*h-c*c]],n=0;n<3;n+=1)for(a=0;a<3;a+=1)this.affine[n][a]=this.quatern_R[n][a]*this.pixDims[a+1],a===2&&(this.affine[n][a]*=this.qfac);this.affine[0][3]=this.qoffset_x,this.affine[1][3]=this.qoffset_y,this.affine[2][3]=this.qoffset_z}else if(this.sform_code>0)for(n=0;n<3;n+=1)for(a=0;a<4;a+=1)o=280+(n*4+a)*4,this.affine[n][a]=O.getFloatAt(i,o,this.littleEndian);if(this.affine[3][0]=0,this.affine[3][1]=0,this.affine[3][2]=0,this.affine[3][3]=1,this.intent_name=O.getStringAt(i,328,344),this.magic=O.getStringAt(i,344,348),this.isHDR=this.magic===String.fromCharCode.apply(null,G.MAGIC_NUMBER2),i.byteLength>G.MAGIC_COOKIE){this.extensionFlag[0]=O.getByteAt(i,348),this.extensionFlag[1]=O.getByteAt(i,349),this.extensionFlag[2]=O.getByteAt(i,350),this.extensionFlag[3]=O.getByteAt(i,351);let l=!0;!this.isHDR&&this.vox_offset<=352&&(l=!1),i.byteLength<=368&&(l=!1),l&&this.extensionFlag[0]&&(this.extensions=O.getExtensionsAt(i,this.getExtensionLocation(),this.littleEndian,this.vox_offset),this.extensionSize=this.extensions[0].esize,this.extensionCode=this.extensions[0].ecode)}}toFormattedString(){var e=O.formatNumber,i="";return i+="Dim Info = "+this.dim_info+`
|
|
2
|
+
import{g as va}from"./_commonjsHelpers-CE1G-McA.js";import{_ as Mi}from"./index-Dtsm0q-Z.js";var _t=1e-6,Ae=typeof Float32Array<"u"?Float32Array:Array;function qi(){var t=new Ae(9);return Ae!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function wa(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function He(t,e,i,r,s,n,a,o,l){var c=new Ae(9);return c[0]=t,c[1]=e,c[2]=i,c[3]=r,c[4]=s,c[5]=n,c[6]=a,c[7]=o,c[8]=l,c}function ya(t,e){var i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=h*a-o*c,f=-h*n+o*l,u=c*n-a*l,m=i*d+r*f+s*u;return m?(m=1/m,t[0]=d*m,t[1]=(-h*r+s*c)*m,t[2]=(o*r-s*a)*m,t[3]=f*m,t[4]=(h*i-s*l)*m,t[5]=(-o*i+s*n)*m,t[6]=u*m,t[7]=(-c*i+r*l)*m,t[8]=(a*i-r*n)*m,t):null}function Hs(t,e,i){var r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],l=e[5],c=e[6],h=e[7],d=e[8],f=i[0],u=i[1],m=i[2],p=i[3],g=i[4],x=i[5],A=i[6],y=i[7],v=i[8];return t[0]=f*r+u*a+m*c,t[1]=f*s+u*o+m*h,t[2]=f*n+u*l+m*d,t[3]=p*r+g*a+x*c,t[4]=p*s+g*o+x*h,t[5]=p*n+g*l+x*d,t[6]=A*r+y*a+v*c,t[7]=A*s+y*o+v*h,t[8]=A*n+y*l+v*d,t}function J(){var t=new Ae(16);return Ae!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function de(t){var e=new Ae(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ba(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ee(t,e,i,r,s,n,a,o,l,c,h,d,f,u,m,p){var g=new Ae(16);return g[0]=t,g[1]=e,g[2]=i,g[3]=r,g[4]=s,g[5]=n,g[6]=a,g[7]=o,g[8]=l,g[9]=c,g[10]=h,g[11]=d,g[12]=f,g[13]=u,g[14]=m,g[15]=p,g}function qs(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Te(t,e){if(t===e){var i=e[1],r=e[2],s=e[3],n=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=n,t[11]=e[14],t[12]=s,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Se(t,e){var i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],u=e[11],m=e[12],p=e[13],g=e[14],x=e[15],A=i*o-r*a,y=i*l-s*a,v=i*c-n*a,b=r*l-s*o,w=r*c-n*o,C=s*c-n*l,M=h*p-d*m,T=h*g-f*m,E=h*x-u*m,I=d*g-f*p,S=d*x-u*p,U=f*x-u*g,B=A*U-y*S+v*I+b*E-w*T+C*M;return B?(B=1/B,t[0]=(o*U-l*S+c*I)*B,t[1]=(s*S-r*U-n*I)*B,t[2]=(p*C-g*w+x*b)*B,t[3]=(f*w-d*C-u*b)*B,t[4]=(l*E-a*U-c*T)*B,t[5]=(i*U-s*E+n*T)*B,t[6]=(g*v-m*C-x*y)*B,t[7]=(h*C-f*v+u*y)*B,t[8]=(a*S-o*E+c*M)*B,t[9]=(r*E-i*S-n*M)*B,t[10]=(m*w-p*v+x*A)*B,t[11]=(d*v-h*w-u*A)*B,t[12]=(o*T-a*I-l*M)*B,t[13]=(i*I-r*T+s*M)*B,t[14]=(p*y-m*b-g*A)*B,t[15]=(h*b-d*y+f*A)*B,t):null}function Ye(t,e,i){var r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],l=e[5],c=e[6],h=e[7],d=e[8],f=e[9],u=e[10],m=e[11],p=e[12],g=e[13],x=e[14],A=e[15],y=i[0],v=i[1],b=i[2],w=i[3];return t[0]=y*r+v*o+b*d+w*p,t[1]=y*s+v*l+b*f+w*g,t[2]=y*n+v*c+b*u+w*x,t[3]=y*a+v*h+b*m+w*A,y=i[4],v=i[5],b=i[6],w=i[7],t[4]=y*r+v*o+b*d+w*p,t[5]=y*s+v*l+b*f+w*g,t[6]=y*n+v*c+b*u+w*x,t[7]=y*a+v*h+b*m+w*A,y=i[8],v=i[9],b=i[10],w=i[11],t[8]=y*r+v*o+b*d+w*p,t[9]=y*s+v*l+b*f+w*g,t[10]=y*n+v*c+b*u+w*x,t[11]=y*a+v*h+b*m+w*A,y=i[12],v=i[13],b=i[14],w=i[15],t[12]=y*r+v*o+b*d+w*p,t[13]=y*s+v*l+b*f+w*g,t[14]=y*n+v*c+b*u+w*x,t[15]=y*a+v*h+b*m+w*A,t}function tt(t,e,i){var r=i[0],s=i[1],n=i[2],a,o,l,c,h,d,f,u,m,p,g,x;return e===t?(t[12]=e[0]*r+e[4]*s+e[8]*n+e[12],t[13]=e[1]*r+e[5]*s+e[9]*n+e[13],t[14]=e[2]*r+e[6]*s+e[10]*n+e[14],t[15]=e[3]*r+e[7]*s+e[11]*n+e[15]):(a=e[0],o=e[1],l=e[2],c=e[3],h=e[4],d=e[5],f=e[6],u=e[7],m=e[8],p=e[9],g=e[10],x=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=c,t[4]=h,t[5]=d,t[6]=f,t[7]=u,t[8]=m,t[9]=p,t[10]=g,t[11]=x,t[12]=a*r+h*s+m*n+e[12],t[13]=o*r+d*s+p*n+e[13],t[14]=l*r+f*s+g*n+e[14],t[15]=c*r+u*s+x*n+e[15]),t}function fr(t,e,i){var r=i[0],s=i[1],n=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ut(t,e,i){var r=Math.sin(i),s=Math.cos(i),n=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=e[9],d=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=n*s+c*r,t[5]=a*s+h*r,t[6]=o*s+d*r,t[7]=l*s+f*r,t[8]=c*s-n*r,t[9]=h*s-a*r,t[10]=d*s-o*r,t[11]=f*s-l*r,t}function Ca(t,e,i){var r=Math.sin(i),s=Math.cos(i),n=e[0],a=e[1],o=e[2],l=e[3],c=e[8],h=e[9],d=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*s-c*r,t[1]=a*s-h*r,t[2]=o*s-d*r,t[3]=l*s-f*r,t[8]=n*r+c*s,t[9]=a*r+h*s,t[10]=o*r+d*s,t[11]=l*r+f*s,t}function Rt(t,e,i){var r=Math.sin(i),s=Math.cos(i),n=e[0],a=e[1],o=e[2],l=e[3],c=e[4],h=e[5],d=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*s+c*r,t[1]=a*s+h*r,t[2]=o*s+d*r,t[3]=l*s+f*r,t[4]=c*s-n*r,t[5]=h*s-a*r,t[6]=d*s-o*r,t[7]=f*s-l*r,t}function Ma(t,e,i){var r=i[0],s=i[1],n=i[2],a=Math.sqrt(r*r+s*s+n*n),o,l,c;return a<_t?null:(a=1/a,r*=a,s*=a,n*=a,o=Math.sin(e),l=Math.cos(e),c=1-l,t[0]=r*r*c+l,t[1]=s*r*c+n*o,t[2]=n*r*c-s*o,t[3]=0,t[4]=r*s*c-n*o,t[5]=s*s*c+l,t[6]=n*s*c+r*o,t[7]=0,t[8]=r*n*c+s*o,t[9]=s*n*c-r*o,t[10]=n*n*c+l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Da(t,e,i,r,s,n,a){var o=1/(e-i),l=1/(r-s),c=1/(n-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*o,t[13]=(s+r)*l,t[14]=(a+n)*c,t[15]=1,t}var hi=Da;function Ta(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t}var Qs=Ye;function se(){var t=new Ae(3);return Ae!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ve(t){var e=new Ae(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Qe(t){var e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)}function k(t,e,i){var r=new Ae(3);return r[0]=t,r[1]=e,r[2]=i,r}function Hr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function it(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function ne(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function ur(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function mr(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function Sa(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Ea(t,e){var i=e[0]-t[0],r=e[1]-t[1],s=e[2]-t[2];return Math.sqrt(i*i+r*r+s*s)}function Ia(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function Ie(t,e){var i=e[0],r=e[1],s=e[2],n=i*i+r*r+s*s;return n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Fa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Jt(t,e,i){var r=e[0],s=e[1],n=e[2],a=i[0],o=i[1],l=i[2];return t[0]=s*l-n*o,t[1]=n*a-r*l,t[2]=r*o-s*a,t}function Ba(t,e,i,r){var s=e[0],n=e[1],a=e[2];return t[0]=s+r*(i[0]-s),t[1]=n+r*(i[1]-n),t[2]=a+r*(i[2]-a),t}function qr(t,e,i){var r=e[0],s=e[1],n=e[2];return t[0]=r*i[0]+s*i[3]+n*i[6],t[1]=r*i[1]+s*i[4]+n*i[7],t[2]=r*i[2]+s*i[5]+n*i[8],t}function Di(t,e){var i=t[0],r=t[1],s=t[2],n=e[0],a=e[1],o=e[2],l=Math.sqrt((i*i+r*r+s*s)*(n*n+a*a+o*o)),c=l&&Fa(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function Ua(t,e){var i=t[0],r=t[1],s=t[2],n=e[0],a=e[1],o=e[2];return Math.abs(i-n)<=_t*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-a)<=_t*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(s-o)<=_t*Math.max(1,Math.abs(s),Math.abs(o))}var Qr=ne,Vt=Qe;(function(){var t=se();return function(e,i,r,s,n,a){var o,l;for(i||(i=3),r||(r=0),s?l=Math.min(s*i+r,e.length):l=e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],n(t,t,a),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2];return e}})();function Xe(){var t=new Ae(4);return Ae!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ze(t){var e=new Ae(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ae(t,e,i,r){var s=new Ae(4);return s[0]=t,s[1]=e,s[2]=i,s[3]=r,s}function Zr(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}function Ra(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}function Va(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function ve(t,e,i){var r=e[0],s=e[1],n=e[2],a=e[3];return t[0]=i[0]*r+i[4]*s+i[8]*n+i[12]*a,t[1]=i[1]*r+i[5]*s+i[9]*n+i[13]*a,t[2]=i[2]*r+i[6]*s+i[10]*n+i[14]*a,t[3]=i[3]*r+i[7]*s+i[11]*n+i[15]*a,t}var Pa=Ra;(function(){var t=Xe();return function(e,i,r,s,n,a){var o,l;for(i||(i=4),r||(r=0),s?l=Math.min(s*i+r,e.length):l=e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],t[3]=e[o+3],n(t,t,a),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2],e[o+3]=t[3];return e}})();function Na(){var t=new Ae(2);return Ae!=Float32Array&&(t[0]=0,t[1]=0),t}function La(t,e){var i=new Ae(2);return i[0]=t,i[1]=e,i}(function(){var t=Na();return function(e,i,r,s,n,a){var o,l;for(i||(i=2),r||(r=0),s?l=Math.min(s*i+r,e.length):l=e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],n(t,t,a),e[o]=t[0],e[o+1]=t[1];return e}})();var et=256,$t=[],Yt;for(;et--;)$t[et]=(et+256).toString(16).substring(1);function di(){var t=0,e,i="";if(!Yt||et+16>256){for(Yt=Array(t=256);t--;)Yt[t]=256*Math.random()|0;t=et=0}for(;t<16;t++)e=Yt[et+t],t==6?i+=$t[e&15|64]:t==8?i+=$t[e&63|128]:i+=$t[e],t&1&&t>1&&t<11&&(i+="-");return et++,i}var Ti,jr;function ka(){return jr||(jr=1,Ti=function(e,i){var r=e.length;if(e===i)return!0;if(r!==i.length)return!1;for(var s=0;s<r;s++)if(e[s]!==i[s])return!1;return!0}),Ti}var Oa=ka();const za=va(Oa);var ge=Uint8Array,ut=Uint16Array,Ga=Int32Array,Zs=new ge([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,0,0,0]),js=new ge([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,0,0]),Ya=new ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_s=function(t,e){for(var i=new ut(31),r=0;r<31;++r)i[r]=e+=1<<t[r-1];for(var s=new Ga(i[30]),r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)s[n]=n-i[r]<<5|r;return{b:i,r:s}},Js=_s(Zs,2),$s=Js.b,Xa=Js.r;$s[28]=258,Xa[258]=28;var Wa=_s(js,0),Ka=Wa.b,Qi=new ut(32768);for(var oe=0;oe<32768;++oe){var We=(oe&43690)>>1|(oe&21845)<<1;We=(We&52428)>>2|(We&13107)<<2,We=(We&61680)>>4|(We&3855)<<4,Qi[oe]=((We&65280)>>8|(We&255)<<8)>>1}var Ft=(function(t,e,i){for(var r=t.length,s=0,n=new ut(e);s<r;++s)t[s]&&++n[t[s]-1];var a=new ut(e);for(s=1;s<e;++s)a[s]=a[s-1]+n[s-1]<<1;var o;if(i){o=new ut(1<<e);var l=15-e;for(s=0;s<r;++s)if(t[s])for(var c=s<<4|t[s],h=e-t[s],d=a[t[s]-1]++<<h,f=d|(1<<h)-1;d<=f;++d)o[Qi[d]>>l]=c}else for(o=new ut(r),s=0;s<r;++s)t[s]&&(o[s]=Qi[a[t[s]-1]++]>>15-t[s]);return o}),Pt=new ge(288);for(var oe=0;oe<144;++oe)Pt[oe]=8;for(var oe=144;oe<256;++oe)Pt[oe]=9;for(var oe=256;oe<280;++oe)Pt[oe]=7;for(var oe=280;oe<288;++oe)Pt[oe]=8;var en=new ge(32);for(var oe=0;oe<32;++oe)en[oe]=5;var Ha=Ft(Pt,9,1),qa=Ft(en,5,1),Si=function(t){for(var e=t[0],i=1;i<t.length;++i)t[i]>e&&(e=t[i]);return e},Be=function(t,e,i){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&i},Ei=function(t,e){var i=e/8|0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>(e&7)},tn=function(t){return(t+7)/8|0},ei=function(t,e,i){return(e==null||e<0)&&(e=0),(i==null||i>t.length)&&(i=t.length),new ge(t.subarray(e,i))},Qa=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ye=function(t,e,i){var r=new Error(e||Qa[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,ye),!i)throw r;return r},Ai=function(t,e,i,r){var s=t.length,n=0;if(!s||e.f&&!e.l)return i||new ge(0);var a=!i,o=a||e.i!=2,l=e.i;a&&(i=new ge(s*3));var c=function(at){var _e=i.length;if(at>_e){var Fe=new ge(Math.max(_e*2,at));Fe.set(i),i=Fe}},h=e.f||0,d=e.p||0,f=e.b||0,u=e.l,m=e.d,p=e.m,g=e.n,x=s*8;do{if(!u){h=Be(t,d,1);var A=Be(t,d+1,3);if(d+=3,A)if(A==1)u=Ha,m=qa,p=9,g=5;else if(A==2){var w=Be(t,d,31)+257,C=Be(t,d+10,15)+4,M=w+Be(t,d+5,31)+1;d+=14;for(var T=new ge(M),E=new ge(19),I=0;I<C;++I)E[Ya[I]]=Be(t,d+I*3,7);d+=C*3;for(var S=Si(E),U=(1<<S)-1,B=Ft(E,S,1),I=0;I<M;){var V=B[Be(t,d,U)];d+=V&15;var y=V>>4;if(y<16)T[I++]=y;else{var R=0,P=0;for(y==16?(P=3+Be(t,d,3),d+=2,R=T[I-1]):y==17?(P=3+Be(t,d,7),d+=3):y==18&&(P=11+Be(t,d,127),d+=7);P--;)T[I++]=R}}var L=T.subarray(0,w),N=T.subarray(w);p=Si(L),g=Si(N),u=Ft(L,p,1),m=Ft(N,g,1)}else ye(1);else{var y=tn(d)+4,v=t[y-4]|t[y-3]<<8,b=y+v;if(b>s){l&&ye(0);break}o&&c(f+v),i.set(t.subarray(y,b),f),e.b=f+=v,e.p=d=b*8,e.f=h;continue}if(d>x){l&&ye(0);break}}o&&c(f+131072);for(var Y=(1<<p)-1,_=(1<<g)-1,z=d;;z=d){var R=u[Ei(t,d)&Y],W=R>>4;if(d+=R&15,d>x){l&&ye(0);break}if(R||ye(2),W<256)i[f++]=W;else if(W==256){z=d,u=null;break}else{var K=W-254;if(W>264){var I=W-257,Z=Zs[I];K=Be(t,d,(1<<Z)-1)+$s[I],d+=Z}var q=m[Ei(t,d)&_],te=q>>4;q||ye(3),d+=q&15;var N=Ka[te];if(te>3){var Z=js[te];N+=Ei(t,d)&(1<<Z)-1,d+=Z}if(d>x){l&&ye(0);break}o&&c(f+131072);var ue=f+K;if(f<N){var le=n-N,je=Math.min(N,ue);for(le+f<0&&ye(3);f<je;++f)i[f]=r[le+f]}for(;f<ue;++f)i[f]=i[f-N]}}e.l=u,e.p=z,e.b=f,e.f=h,u&&(h=1,e.m=p,e.d=m,e.n=g)}while(!h);return f!=i.length&&a?ei(i,0,f):i.subarray(0,f)},Za=new ge(0),rn=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&ye(6,"invalid gzip data");var e=t[3],i=10;e&4&&(i+=(t[10]|t[11]<<8)+2);for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[i++]);return i+(e&2)},ja=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},_a=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&ye(6,"invalid zlib data"),(t[1]>>5&1)==1&&ye(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2},Xt=(function(){function t(e,i){typeof e=="function"&&(i=e,e={}),this.ondata=i;var r=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:r?r.length:0},this.o=new ge(32768),this.p=new ge(0),r&&this.o.set(r)}return t.prototype.e=function(e){if(this.ondata||ye(5),this.d&&ye(4),!this.p.length)this.p=e;else if(e.length){var i=new ge(this.p.length+e.length);i.set(this.p),i.set(e,this.p.length),this.p=i}},t.prototype.c=function(e){this.s.i=+(this.d=e||!1);var i=this.s.b,r=Ai(this.p,this.s,this.o);this.ondata(ei(r,i,this.s.b),this.d),this.o=ei(r,this.s.b-32768),this.s.b=this.o.length,this.p=ei(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,i){this.e(e),this.c(i)},t})();function Ja(t,e){return Ai(t,{i:2},e,e)}var $a=(function(){function t(e,i){this.v=1,this.r=0,Xt.call(this,e,i)}return t.prototype.push=function(e,i){if(Xt.prototype.e.call(this,e),this.r+=e.length,this.v){var r=this.p.subarray(this.v-1),s=r.length>3?rn(r):4;if(s>r.length){if(!i)return}else this.v>1&&this.onmember&&this.onmember(this.r-r.length);this.p=r.subarray(s),this.v=0}Xt.prototype.c.call(this,0),this.s.f&&!this.s.l?(this.v=tn(this.s.p)+9,this.s={i:0},this.o=new ge(0),this.push(new ge(0),i)):i&&Xt.prototype.c.call(this,i)},t})();function eo(t,e){var i=rn(t);return i+8>t.length&&ye(6,"invalid gzip data"),Ai(t.subarray(i,-8),{i:2},new ge(ja(t)),e)}function to(t,e){return Ai(t.subarray(_a(t),-4),{i:2},e,e)}function io(t,e){return t[0]==31&&t[1]==139&&t[2]==8?eo(t,e):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?Ja(t,e):to(t,e)}var ro=typeof TextDecoder<"u"&&new TextDecoder,so=0;try{ro.decode(Za,{stream:!0}),so=1}catch{}class sn{esize;ecode;edata;littleEndian;constructor(e,i,r,s){if(e%16!=0)throw new Error("This does not appear to be a NIFTI extension");this.esize=e,this.ecode=i,this.edata=r,this.littleEndian=s}toArrayBuffer(){let e=new Uint8Array(this.esize),i=new Uint8Array(this.edata);e.set(i,8);let r=new DataView(e.buffer);return r.setInt32(0,this.esize,this.littleEndian),r.setInt32(4,this.ecode,this.littleEndian),e.buffer}}class O{static crcTable=null;static GUNZIP_MAGIC_COOKIE1=31;static GUNZIP_MAGIC_COOKIE2=139;static getStringAt(e,i,r){var s="",n,a;for(n=i;n<r;n+=1)a=e.getUint8(n),a!==0&&(s+=String.fromCharCode(a));return s}static getByteAt=function(e,i){return e.getUint8(i)};static getShortAt=function(e,i,r){return e.getInt16(i,r)};static getIntAt(e,i,r){return e.getInt32(i,r)}static getFloatAt(e,i,r){return e.getFloat32(i,r)}static getDoubleAt(e,i,r){return e.getFloat64(i,r)}static getInt64At(e,i,r){const s=e.getUint32(i,r),n=e.getInt32(i+4,r);let a;return r?a=n*2**32+s:a=s*2**32+n,n<0&&(a+=-1*2**32*2**32),a}static getUint64At(e,i,r){const s=e.getUint32(i+(r?0:4),r),n=e.getUint32(i+(r?4:0),r);return r?n*2**32+s:s*2**32+n}static getExtensionsAt(e,i,r,s){let n=[],a=i;for(;a<s;){let o=r,l=O.getIntAt(e,a,r);if(!l)break;if(l+a>s&&(o=!o,l=O.getIntAt(e,a,o),l+a>s))throw new Error("This does not appear to be a valid NIFTI extension");if(l%16!=0)throw new Error("This does not appear to be a NIFTI extension");let c=O.getIntAt(e,a+4,o),h=e.buffer.slice(a+8,a+l),d=new sn(l,c,h,o);n.push(d),a+=l}return n}static toArrayBuffer(e){var i,r,s;for(i=new ArrayBuffer(e.length),r=new Uint8Array(i),s=0;s<e.length;s+=1)r[s]=e[s];return i}static isString(e){return typeof e=="string"||e instanceof String}static formatNumber(e,i=void 0){let r;return O.isString(e)?r=Number(e):r=e,i?r=r.toPrecision(5):r=r.toPrecision(7),parseFloat(r)}static makeCRCTable(){let e,i=[];for(var r=0;r<256;r++){e=r;for(var s=0;s<8;s++)e=e&1?3988292384^e>>>1:e>>>1;i[r]=e}return i}static crc32(e){O.crcTable||(O.crcTable=O.makeCRCTable());const i=O.crcTable;let r=-1;for(var s=0;s<e.byteLength;s++)r=r>>>8^i[(r^e.getUint8(s))&255];return(r^-1)>>>0}}class G{littleEndian=!1;dim_info=0;dims=[];intent_p1=0;intent_p2=0;intent_p3=0;intent_code=0;datatypeCode=0;numBitsPerVoxel=0;slice_start=0;slice_end=0;slice_code=0;pixDims=[];vox_offset=0;scl_slope=1;scl_inter=0;xyzt_units=0;cal_max=0;cal_min=0;slice_duration=0;toffset=0;description="";aux_file="";intent_name="";qform_code=0;sform_code=0;quatern_a=0;quatern_b=0;quatern_c=0;quatern_d=0;qoffset_x=0;qoffset_y=0;qoffset_z=0;affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];qfac=1;quatern_R;magic="0";isHDR=!1;extensionFlag=[0,0,0,0];extensionSize=0;extensionCode=0;extensions=[];static TYPE_NONE=0;static TYPE_BINARY=1;static TYPE_UINT8=2;static TYPE_INT16=4;static TYPE_INT32=8;static TYPE_FLOAT32=16;static TYPE_COMPLEX64=32;static TYPE_FLOAT64=64;static TYPE_RGB24=128;static TYPE_INT8=256;static TYPE_UINT16=512;static TYPE_UINT32=768;static TYPE_INT64=1024;static TYPE_UINT64=1280;static TYPE_FLOAT128=1536;static TYPE_COMPLEX128=1792;static TYPE_COMPLEX256=2048;static XFORM_UNKNOWN=0;static XFORM_SCANNER_ANAT=1;static XFORM_ALIGNED_ANAT=2;static XFORM_TALAIRACH=3;static XFORM_MNI_152=4;static SPATIAL_UNITS_MASK=7;static TEMPORAL_UNITS_MASK=56;static UNITS_UNKNOWN=0;static UNITS_METER=1;static UNITS_MM=2;static UNITS_MICRON=3;static UNITS_SEC=8;static UNITS_MSEC=16;static UNITS_USEC=24;static UNITS_HZ=32;static UNITS_PPM=40;static UNITS_RADS=48;static MAGIC_COOKIE=348;static STANDARD_HEADER_SIZE=348;static MAGIC_NUMBER_LOCATION=344;static MAGIC_NUMBER=[110,43,49];static MAGIC_NUMBER2=[110,105,49];static EXTENSION_HEADER_SIZE=8;readHeader(e){var i=new DataView(e),r=O.getIntAt(i,0,this.littleEndian),s,n,a,o;if(r!==G.MAGIC_COOKIE&&(this.littleEndian=!0,r=O.getIntAt(i,0,this.littleEndian)),r!==G.MAGIC_COOKIE)throw new Error("This does not appear to be a NIFTI file!");for(this.dim_info=O.getByteAt(i,39),s=0;s<8;s+=1)o=40+s*2,this.dims[s]=O.getShortAt(i,o,this.littleEndian);for(this.intent_p1=O.getFloatAt(i,56,this.littleEndian),this.intent_p2=O.getFloatAt(i,60,this.littleEndian),this.intent_p3=O.getFloatAt(i,64,this.littleEndian),this.intent_code=O.getShortAt(i,68,this.littleEndian),this.datatypeCode=O.getShortAt(i,70,this.littleEndian),this.numBitsPerVoxel=O.getShortAt(i,72,this.littleEndian),this.slice_start=O.getShortAt(i,74,this.littleEndian),s=0;s<8;s+=1)o=76+s*4,this.pixDims[s]=O.getFloatAt(i,o,this.littleEndian);if(this.vox_offset=O.getFloatAt(i,108,this.littleEndian),this.scl_slope=O.getFloatAt(i,112,this.littleEndian),this.scl_inter=O.getFloatAt(i,116,this.littleEndian),this.slice_end=O.getShortAt(i,120,this.littleEndian),this.slice_code=O.getByteAt(i,122),this.xyzt_units=O.getByteAt(i,123),this.cal_max=O.getFloatAt(i,124,this.littleEndian),this.cal_min=O.getFloatAt(i,128,this.littleEndian),this.slice_duration=O.getFloatAt(i,132,this.littleEndian),this.toffset=O.getFloatAt(i,136,this.littleEndian),this.description=O.getStringAt(i,148,228),this.aux_file=O.getStringAt(i,228,252),this.qform_code=O.getShortAt(i,252,this.littleEndian),this.sform_code=O.getShortAt(i,254,this.littleEndian),this.quatern_b=O.getFloatAt(i,256,this.littleEndian),this.quatern_c=O.getFloatAt(i,260,this.littleEndian),this.quatern_d=O.getFloatAt(i,264,this.littleEndian),this.quatern_a=Math.sqrt(1-(Math.pow(this.quatern_b,2)+Math.pow(this.quatern_c,2)+Math.pow(this.quatern_d,2))),this.qoffset_x=O.getFloatAt(i,268,this.littleEndian),this.qoffset_y=O.getFloatAt(i,272,this.littleEndian),this.qoffset_z=O.getFloatAt(i,276,this.littleEndian),this.qform_code<1&&this.sform_code<1&&(this.affine[0][0]=this.pixDims[1],this.affine[1][1]=this.pixDims[2],this.affine[2][2]=this.pixDims[3]),this.qform_code>0&&this.sform_code<this.qform_code){const l=this.quatern_a,c=this.quatern_b,h=this.quatern_c,d=this.quatern_d;for(this.qfac=this.pixDims[0]===0?1:this.pixDims[0],this.quatern_R=[[l*l+c*c-h*h-d*d,2*c*h-2*l*d,2*c*d+2*l*h],[2*c*h+2*l*d,l*l+h*h-c*c-d*d,2*h*d-2*l*c],[2*c*d-2*l*h,2*h*d+2*l*c,l*l+d*d-h*h-c*c]],n=0;n<3;n+=1)for(a=0;a<3;a+=1)this.affine[n][a]=this.quatern_R[n][a]*this.pixDims[a+1],a===2&&(this.affine[n][a]*=this.qfac);this.affine[0][3]=this.qoffset_x,this.affine[1][3]=this.qoffset_y,this.affine[2][3]=this.qoffset_z}else if(this.sform_code>0)for(n=0;n<3;n+=1)for(a=0;a<4;a+=1)o=280+(n*4+a)*4,this.affine[n][a]=O.getFloatAt(i,o,this.littleEndian);if(this.affine[3][0]=0,this.affine[3][1]=0,this.affine[3][2]=0,this.affine[3][3]=1,this.intent_name=O.getStringAt(i,328,344),this.magic=O.getStringAt(i,344,348),this.isHDR=this.magic===String.fromCharCode.apply(null,G.MAGIC_NUMBER2),i.byteLength>G.MAGIC_COOKIE){this.extensionFlag[0]=O.getByteAt(i,348),this.extensionFlag[1]=O.getByteAt(i,349),this.extensionFlag[2]=O.getByteAt(i,350),this.extensionFlag[3]=O.getByteAt(i,351);let l=!0;!this.isHDR&&this.vox_offset<=352&&(l=!1),i.byteLength<=368&&(l=!1),l&&this.extensionFlag[0]&&(this.extensions=O.getExtensionsAt(i,this.getExtensionLocation(),this.littleEndian,this.vox_offset),this.extensionSize=this.extensions[0].esize,this.extensionCode=this.extensions[0].ecode)}}toFormattedString(){var e=O.formatNumber,i="";return i+="Dim Info = "+this.dim_info+`
|
|
3
3
|
`,i+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+this.dims[3]+", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+`
|
|
4
4
|
`,i+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+`
|
|
5
5
|
`,i+="Intent Code = "+this.intent_code+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function st(t,n,i){var e,r=1;t==null&&(t=0),n==null&&(n=0),i==null&&(i=0);function o(){var f,s=e.length,a,c=0,u=0,h=0;for(f=0;f<s;++f)a=e[f],c+=a.x||0,u+=a.y||0,h+=a.z||0;for(c=(c/s-t)*r,u=(u/s-n)*r,h=(h/s-i)*r,f=0;f<s;++f)a=e[f],c&&(a.x-=c),u&&(a.y-=u),h&&(a.z-=h)}return o.initialize=function(f){e=f},o.x=function(f){return arguments.length?(t=+f,o):t},o.y=function(f){return arguments.length?(n=+f,o):n},o.z=function(f){return arguments.length?(i=+f,o):i},o.strength=function(f){return arguments.length?(r=+f,o):r},o}function Zt(t){const n=+this._x.call(null,t);return Rt(this.cover(n),n,t)}function Rt(t,n,i){if(isNaN(n))return t;var e,r=t._root,o={data:i},f=t._x0,s=t._x1,a,c,u,h,_;if(!r)return t._root=o,t;for(;r.length;)if((u=n>=(a=(f+s)/2))?f=a:s=a,e=r,!(r=r[h=+u]))return e[h]=o,t;if(c=+t._x.call(null,r.data),n===c)return o.next=r,e?e[h]=o:t._root=o,t;do e=e?e[h]=new Array(2):t._root=new Array(2),(u=n>=(a=(f+s)/2))?f=a:s=a;while((h=+u)==(_=+(c>=a)));return e[_]=r,e[h]=o,t}function Jt(t){Array.isArray(t)||(t=Array.from(t));const n=t.length,i=new Float64Array(n);let e=1/0,r=-1/0;for(let o=0,f;o<n;++o)isNaN(f=+this._x.call(null,t[o]))||(i[o]=f,f<e&&(e=f),f>r&&(r=f));if(e>r)return this;this.cover(e).cover(r);for(let o=0;o<n;++o)Rt(this,i[o],t[o]);return this}function Vt(t){if(isNaN(t=+t))return this;var n=this._x0,i=this._x1;if(isNaN(n))i=(n=Math.floor(t))+1;else{for(var e=i-n||1,r=this._root,o,f;n>t||t>=i;)switch(f=+(t<n),o=new Array(2),o[f]=r,r=o,e*=2,f){case 0:i=n+e;break;case 1:n=i-e;break}this._root&&this._root.length&&(this._root=r)}return this._x0=n,this._x1=i,this}function tn(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function nn(t){return arguments.length?this.cover(+t[0][0]).cover(+t[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function J(t,n,i){this.node=t,this.x0=n,this.x1=i}function en(t,n){var i,e=this._x0,r,o,f=this._x1,s=[],a=this._root,c,u;for(a&&s.push(new J(a,e,f)),n==null?n=1/0:(e=t-n,f=t+n);c=s.pop();)if(!(!(a=c.node)||(r=c.x0)>f||(o=c.x1)<e))if(a.length){var h=(r+o)/2;s.push(new J(a[1],h,o),new J(a[0],r,h)),(u=+(t>=h))&&(c=s[s.length-1],s[s.length-1]=s[s.length-1-u],s[s.length-1-u]=c)}else{var _=Math.abs(t-+this._x.call(null,a.data));_<n&&(n=_,e=t-_,f=t+_,i=a.data)}return i}function rn(t){if(isNaN(a=+this._x.call(null,t)))return this;var n,i=this._root,e,r,o,f=this._x0,s=this._x1,a,c,u,h,_;if(!i)return this;if(i.length)for(;;){if((u=a>=(c=(f+s)/2))?f=c:s=c,n=i,!(i=i[h=+u]))return this;if(!i.length)break;n[h+1&1]&&(e=n,_=h)}for(;i.data!==t;)if(r=i,!(i=i.next))return this;return(o=i.next)&&delete i.next,r?(o?r.next=o:delete r.next,this):n?(o?n[h]=o:delete n[h],(i=n[0]||n[1])&&i===(n[1]||n[0])&&!i.length&&(e?e[_]=i:this._root=i),this):(this._root=o,this)}function on(t){for(var n=0,i=t.length;n<i;++n)this.remove(t[n]);return this}function sn(){return this._root}function fn(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function an(t){var n=[],i,e=this._root,r,o,f;for(e&&n.push(new J(e,this._x0,this._x1));i=n.pop();)if(!t(e=i.node,o=i.x0,f=i.x1)&&e.length){var s=(o+f)/2;(r=e[1])&&n.push(new J(r,s,f)),(r=e[0])&&n.push(new J(r,o,s))}return this}function hn(t){var n=[],i=[],e;for(this._root&&n.push(new J(this._root,this._x0,this._x1));e=n.pop();){var r=e.node;if(r.length){var o,f=e.x0,s=e.x1,a=(f+s)/2;(o=r[0])&&n.push(new J(o,f,a)),(o=r[1])&&n.push(new J(o,a,s))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.x1);return this}function un(t){return t[0]}function cn(t){return arguments.length?(this._x=t,this):this._x}function zt(t,n){var i=new Mt(n??un,NaN,NaN);return t==null?i:i.addAll(t)}function Mt(t,n,i){this._x=t,this._x0=n,this._x1=i,this._root=void 0}function It(t){for(var n={data:t.data},i=n;t=t.next;)i=i.next={data:t.data};return n}var K=zt.prototype=Mt.prototype;K.copy=function(){var t=new Mt(this._x,this._x0,this._x1),n=this._root,i,e;if(!n)return t;if(!n.length)return t._root=It(n),t;for(i=[{source:n,target:t._root=new Array(2)}];n=i.pop();)for(var r=0;r<2;++r)(e=n.source[r])&&(e.length?i.push({source:e,target:n.target[r]=new Array(2)}):n.target[r]=It(e));return t};K.add=Zt;K.addAll=Jt;K.cover=Vt;K.data=tn;K.extent=nn;K.find=en;K.remove=rn;K.removeAll=on;K.root=sn;K.size=fn;K.visit=an;K.visitAfter=hn;K.x=cn;function ln(t){const n=+this._x.call(null,t),i=+this._y.call(null,t);return Ct(this.cover(n,i),n,i,t)}function Ct(t,n,i,e){if(isNaN(n)||isNaN(i))return t;var r,o=t._root,f={data:e},s=t._x0,a=t._y0,c=t._x1,u=t._y1,h,_,g,p,w,y,l,N;if(!o)return t._root=f,t;for(;o.length;)if((w=n>=(h=(s+c)/2))?s=h:c=h,(y=i>=(_=(a+u)/2))?a=_:u=_,r=o,!(o=o[l=y<<1|w]))return r[l]=f,t;if(g=+t._x.call(null,o.data),p=+t._y.call(null,o.data),n===g&&i===p)return f.next=o,r?r[l]=f:t._root=f,t;do r=r?r[l]=new Array(4):t._root=new Array(4),(w=n>=(h=(s+c)/2))?s=h:c=h,(y=i>=(_=(a+u)/2))?a=_:u=_;while((l=y<<1|w)===(N=(p>=_)<<1|g>=h));return r[N]=o,r[l]=f,t}function gn(t){var n,i,e=t.length,r,o,f=new Array(e),s=new Array(e),a=1/0,c=1/0,u=-1/0,h=-1/0;for(i=0;i<e;++i)isNaN(r=+this._x.call(null,n=t[i]))||isNaN(o=+this._y.call(null,n))||(f[i]=r,s[i]=o,r<a&&(a=r),r>u&&(u=r),o<c&&(c=o),o>h&&(h=o));if(a>u||c>h)return this;for(this.cover(a,c).cover(u,h),i=0;i<e;++i)Ct(this,f[i],s[i],t[i]);return this}function _n(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var i=this._x0,e=this._y0,r=this._x1,o=this._y1;if(isNaN(i))r=(i=Math.floor(t))+1,o=(e=Math.floor(n))+1;else{for(var f=r-i||1,s=this._root,a,c;i>t||t>=r||e>n||n>=o;)switch(c=(n<e)<<1|t<i,a=new Array(4),a[c]=s,s=a,f*=2,c){case 0:r=i+f,o=e+f;break;case 1:i=r-f,o=e+f;break;case 2:r=i+f,e=o-f;break;case 3:i=r-f,e=o-f;break}this._root&&this._root.length&&(this._root=s)}return this._x0=i,this._y0=e,this._x1=r,this._y1=o,this}function pn(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function vn(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function U(t,n,i,e,r){this.node=t,this.x0=n,this.y0=i,this.x1=e,this.y1=r}function xn(t,n,i){var e,r=this._x0,o=this._y0,f,s,a,c,u=this._x1,h=this._y1,_=[],g=this._root,p,w;for(g&&_.push(new U(g,r,o,u,h)),i==null?i=1/0:(r=t-i,o=n-i,u=t+i,h=n+i,i*=i);p=_.pop();)if(!(!(g=p.node)||(f=p.x0)>u||(s=p.y0)>h||(a=p.x1)<r||(c=p.y1)<o))if(g.length){var y=(f+a)/2,l=(s+c)/2;_.push(new U(g[3],y,l,a,c),new U(g[2],f,l,y,c),new U(g[1],y,s,a,l),new U(g[0],f,s,y,l)),(w=(n>=l)<<1|t>=y)&&(p=_[_.length-1],_[_.length-1]=_[_.length-1-w],_[_.length-1-w]=p)}else{var N=t-+this._x.call(null,g.data),M=n-+this._y.call(null,g.data),z=N*N+M*M;if(z<i){var x=Math.sqrt(i=z);r=t-x,o=n-x,u=t+x,h=n+x,e=g.data}}return e}function yn(t){if(isNaN(u=+this._x.call(null,t))||isNaN(h=+this._y.call(null,t)))return this;var n,i=this._root,e,r,o,f=this._x0,s=this._y0,a=this._x1,c=this._y1,u,h,_,g,p,w,y,l;if(!i)return this;if(i.length)for(;;){if((p=u>=(_=(f+a)/2))?f=_:a=_,(w=h>=(g=(s+c)/2))?s=g:c=g,n=i,!(i=i[y=w<<1|p]))return this;if(!i.length)break;(n[y+1&3]||n[y+2&3]||n[y+3&3])&&(e=n,l=y)}for(;i.data!==t;)if(r=i,!(i=i.next))return this;return(o=i.next)&&delete i.next,r?(o?r.next=o:delete r.next,this):n?(o?n[y]=o:delete n[y],(i=n[0]||n[1]||n[2]||n[3])&&i===(n[3]||n[2]||n[1]||n[0])&&!i.length&&(e?e[l]=i:this._root=i),this):(this._root=o,this)}function dn(t){for(var n=0,i=t.length;n<i;++n)this.remove(t[n]);return this}function wn(){return this._root}function zn(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function Mn(t){var n=[],i,e=this._root,r,o,f,s,a;for(e&&n.push(new U(e,this._x0,this._y0,this._x1,this._y1));i=n.pop();)if(!t(e=i.node,o=i.x0,f=i.y0,s=i.x1,a=i.y1)&&e.length){var c=(o+s)/2,u=(f+a)/2;(r=e[3])&&n.push(new U(r,c,u,s,a)),(r=e[2])&&n.push(new U(r,o,u,c,a)),(r=e[1])&&n.push(new U(r,c,f,s,u)),(r=e[0])&&n.push(new U(r,o,f,c,u))}return this}function Nn(t){var n=[],i=[],e;for(this._root&&n.push(new U(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var o,f=e.x0,s=e.y0,a=e.x1,c=e.y1,u=(f+a)/2,h=(s+c)/2;(o=r[0])&&n.push(new U(o,f,s,u,h)),(o=r[1])&&n.push(new U(o,u,s,a,h)),(o=r[2])&&n.push(new U(o,f,h,u,c)),(o=r[3])&&n.push(new U(o,u,h,a,c))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function An(t){return t[0]}function mn(t){return arguments.length?(this._x=t,this):this._x}function $n(t){return t[1]}function In(t){return arguments.length?(this._y=t,this):this._y}function Nt(t,n,i){var e=new At(n??An,i??$n,NaN,NaN,NaN,NaN);return t==null?e:e.addAll(t)}function At(t,n,i,e,r,o){this._x=t,this._y=n,this._x0=i,this._y0=e,this._x1=r,this._y1=o,this._root=void 0}function kt(t){for(var n={data:t.data},i=n;t=t.next;)i=i.next={data:t.data};return n}var H=Nt.prototype=At.prototype;H.copy=function(){var t=new At(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,i,e;if(!n)return t;if(!n.length)return t._root=kt(n),t;for(i=[{source:n,target:t._root=new Array(4)}];n=i.pop();)for(var r=0;r<4;++r)(e=n.source[r])&&(e.length?i.push({source:e,target:n.target[r]=new Array(4)}):n.target[r]=kt(e));return t};H.add=ln;H.addAll=gn;H.cover=_n;H.data=pn;H.extent=vn;H.find=xn;H.remove=yn;H.removeAll=dn;H.root=wn;H.size=zn;H.visit=Mn;H.visitAfter=Nn;H.x=mn;H.y=In;function kn(t){const n=+this._x.call(null,t),i=+this._y.call(null,t),e=+this._z.call(null,t);return Pt(this.cover(n,i,e),n,i,e,t)}function Pt(t,n,i,e,r){if(isNaN(n)||isNaN(i)||isNaN(e))return t;var o,f=t._root,s={data:r},a=t._x0,c=t._y0,u=t._z0,h=t._x1,_=t._y1,g=t._z1,p,w,y,l,N,M,z,x,$,I,q;if(!f)return t._root=s,t;for(;f.length;)if((z=n>=(p=(a+h)/2))?a=p:h=p,(x=i>=(w=(c+_)/2))?c=w:_=w,($=e>=(y=(u+g)/2))?u=y:g=y,o=f,!(f=f[I=$<<2|x<<1|z]))return o[I]=s,t;if(l=+t._x.call(null,f.data),N=+t._y.call(null,f.data),M=+t._z.call(null,f.data),n===l&&i===N&&e===M)return s.next=f,o?o[I]=s:t._root=s,t;do o=o?o[I]=new Array(8):t._root=new Array(8),(z=n>=(p=(a+h)/2))?a=p:h=p,(x=i>=(w=(c+_)/2))?c=w:_=w,($=e>=(y=(u+g)/2))?u=y:g=y;while((I=$<<2|x<<1|z)===(q=(M>=y)<<2|(N>=w)<<1|l>=p));return o[q]=f,o[I]=s,t}function bn(t){Array.isArray(t)||(t=Array.from(t));const n=t.length,i=new Float64Array(n),e=new Float64Array(n),r=new Float64Array(n);let o=1/0,f=1/0,s=1/0,a=-1/0,c=-1/0,u=-1/0;for(let h=0,_,g,p,w;h<n;++h)isNaN(g=+this._x.call(null,_=t[h]))||isNaN(p=+this._y.call(null,_))||isNaN(w=+this._z.call(null,_))||(i[h]=g,e[h]=p,r[h]=w,g<o&&(o=g),g>a&&(a=g),p<f&&(f=p),p>c&&(c=p),w<s&&(s=w),w>u&&(u=w));if(o>a||f>c||s>u)return this;this.cover(o,f,s).cover(a,c,u);for(let h=0;h<n;++h)Pt(this,i[h],e[h],r[h],t[h]);return this}function qn(t,n,i){if(isNaN(t=+t)||isNaN(n=+n)||isNaN(i=+i))return this;var e=this._x0,r=this._y0,o=this._z0,f=this._x1,s=this._y1,a=this._z1;if(isNaN(e))f=(e=Math.floor(t))+1,s=(r=Math.floor(n))+1,a=(o=Math.floor(i))+1;else{for(var c=f-e||1,u=this._root,h,_;e>t||t>=f||r>n||n>=s||o>i||i>=a;)switch(_=(i<o)<<2|(n<r)<<1|t<e,h=new Array(8),h[_]=u,u=h,c*=2,_){case 0:f=e+c,s=r+c,a=o+c;break;case 1:e=f-c,s=r+c,a=o+c;break;case 2:f=e+c,r=s-c,a=o+c;break;case 3:e=f-c,r=s-c,a=o+c;break;case 4:f=e+c,s=r+c,o=a-c;break;case 5:e=f-c,s=r+c,o=a-c;break;case 6:f=e+c,r=s-c,o=a-c;break;case 7:e=f-c,r=s-c,o=a-c;break}this._root&&this._root.length&&(this._root=u)}return this._x0=e,this._y0=r,this._z0=o,this._x1=f,this._y1=s,this._z1=a,this}function Sn(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function En(t){return arguments.length?this.cover(+t[0][0],+t[0][1],+t[0][2]).cover(+t[1][0],+t[1][1],+t[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function F(t,n,i,e,r,o,f){this.node=t,this.x0=n,this.y0=i,this.z0=e,this.x1=r,this.y1=o,this.z1=f}function On(t,n,i,e){var r,o=this._x0,f=this._y0,s=this._z0,a,c,u,h,_,g,p=this._x1,w=this._y1,y=this._z1,l=[],N=this._root,M,z;for(N&&l.push(new F(N,o,f,s,p,w,y)),e==null?e=1/0:(o=t-e,f=n-e,s=i-e,p=t+e,w=n+e,y=i+e,e*=e);M=l.pop();)if(!(!(N=M.node)||(a=M.x0)>p||(c=M.y0)>w||(u=M.z0)>y||(h=M.x1)<o||(_=M.y1)<f||(g=M.z1)<s))if(N.length){var x=(a+h)/2,$=(c+_)/2,I=(u+g)/2;l.push(new F(N[7],x,$,I,h,_,g),new F(N[6],a,$,I,x,_,g),new F(N[5],x,c,I,h,$,g),new F(N[4],a,c,I,x,$,g),new F(N[3],x,$,u,h,_,I),new F(N[2],a,$,u,x,_,I),new F(N[1],x,c,u,h,$,I),new F(N[0],a,c,u,x,$,I)),(z=(i>=I)<<2|(n>=$)<<1|t>=x)&&(M=l[l.length-1],l[l.length-1]=l[l.length-1-z],l[l.length-1-z]=M)}else{var q=t-+this._x.call(null,N.data),Y=n-+this._y.call(null,N.data),W=i-+this._z.call(null,N.data),R=q*q+Y*Y+W*W;if(R<e){var v=Math.sqrt(e=R);o=t-v,f=n-v,s=i-v,p=t+v,w=n+v,y=i+v,r=N.data}}return r}const Dn=(t,n,i,e,r,o)=>Math.sqrt((t-e)**2+(n-r)**2+(i-o)**2);function Fn(t,n,i,e){const r=[],o=t-e,f=n-e,s=i-e,a=t+e,c=n+e,u=i+e;return this.visit((h,_,g,p,w,y,l)=>{if(!h.length)do{const N=h.data;Dn(t,n,i,this._x(N),this._y(N),this._z(N))<=e&&r.push(N)}while(h=h.next);return _>a||g>c||p>u||w<o||y<f||l<s}),r}function jn(t){if(isNaN(_=+this._x.call(null,t))||isNaN(g=+this._y.call(null,t))||isNaN(p=+this._z.call(null,t)))return this;var n,i=this._root,e,r,o,f=this._x0,s=this._y0,a=this._z0,c=this._x1,u=this._y1,h=this._z1,_,g,p,w,y,l,N,M,z,x,$;if(!i)return this;if(i.length)for(;;){if((N=_>=(w=(f+c)/2))?f=w:c=w,(M=g>=(y=(s+u)/2))?s=y:u=y,(z=p>=(l=(a+h)/2))?a=l:h=l,n=i,!(i=i[x=z<<2|M<<1|N]))return this;if(!i.length)break;(n[x+1&7]||n[x+2&7]||n[x+3&7]||n[x+4&7]||n[x+5&7]||n[x+6&7]||n[x+7&7])&&(e=n,$=x)}for(;i.data!==t;)if(r=i,!(i=i.next))return this;return(o=i.next)&&delete i.next,r?(o?r.next=o:delete r.next,this):n?(o?n[x]=o:delete n[x],(i=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&i===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!i.length&&(e?e[$]=i:this._root=i),this):(this._root=o,this)}function Tn(t){for(var n=0,i=t.length;n<i;++n)this.remove(t[n]);return this}function Wn(){return this._root}function Rn(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function Cn(t){var n=[],i,e=this._root,r,o,f,s,a,c,u;for(e&&n.push(new F(e,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=n.pop();)if(!t(e=i.node,o=i.x0,f=i.y0,s=i.z0,a=i.x1,c=i.y1,u=i.z1)&&e.length){var h=(o+a)/2,_=(f+c)/2,g=(s+u)/2;(r=e[7])&&n.push(new F(r,h,_,g,a,c,u)),(r=e[6])&&n.push(new F(r,o,_,g,h,c,u)),(r=e[5])&&n.push(new F(r,h,f,g,a,_,u)),(r=e[4])&&n.push(new F(r,o,f,g,h,_,u)),(r=e[3])&&n.push(new F(r,h,_,s,a,c,g)),(r=e[2])&&n.push(new F(r,o,_,s,h,c,g)),(r=e[1])&&n.push(new F(r,h,f,s,a,_,g)),(r=e[0])&&n.push(new F(r,o,f,s,h,_,g))}return this}function Pn(t){var n=[],i=[],e;for(this._root&&n.push(new F(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=n.pop();){var r=e.node;if(r.length){var o,f=e.x0,s=e.y0,a=e.z0,c=e.x1,u=e.y1,h=e.z1,_=(f+c)/2,g=(s+u)/2,p=(a+h)/2;(o=r[0])&&n.push(new F(o,f,s,a,_,g,p)),(o=r[1])&&n.push(new F(o,_,s,a,c,g,p)),(o=r[2])&&n.push(new F(o,f,g,a,_,u,p)),(o=r[3])&&n.push(new F(o,_,g,a,c,u,p)),(o=r[4])&&n.push(new F(o,f,s,p,_,g,h)),(o=r[5])&&n.push(new F(o,_,s,p,c,g,h)),(o=r[6])&&n.push(new F(o,f,g,p,_,u,h)),(o=r[7])&&n.push(new F(o,_,g,p,c,u,h))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.z0,e.x1,e.y1,e.z1);return this}function Gn(t){return t[0]}function Xn(t){return arguments.length?(this._x=t,this):this._x}function Yn(t){return t[1]}function Bn(t){return arguments.length?(this._y=t,this):this._y}function Un(t){return t[2]}function Hn(t){return arguments.length?(this._z=t,this):this._z}function mt(t,n,i,e){var r=new $t(n??Gn,i??Yn,e??Un,NaN,NaN,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function $t(t,n,i,e,r,o,f,s,a){this._x=t,this._y=n,this._z=i,this._x0=e,this._y0=r,this._z0=o,this._x1=f,this._y1=s,this._z1=a,this._root=void 0}function bt(t){for(var n={data:t.data},i=n;t=t.next;)i=i.next={data:t.data};return n}var X=mt.prototype=$t.prototype;X.copy=function(){var t=new $t(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root,i,e;if(!n)return t;if(!n.length)return t._root=bt(n),t;for(i=[{source:n,target:t._root=new Array(8)}];n=i.pop();)for(var r=0;r<8;++r)(e=n.source[r])&&(e.length?i.push({source:e,target:n.target[r]=new Array(8)}):n.target[r]=bt(e));return t};X.add=kn;X.addAll=bn;X.cover=qn;X.data=Sn;X.extent=En;X.find=On;X.findAllWithinRadius=Fn;X.remove=jn;X.removeAll=Tn;X.root=Wn;X.size=Rn;X.visit=Cn;X.visitAfter=Pn;X.x=Xn;X.y=Bn;X.z=Hn;function P(t){return function(){return t}}function Q(t){return(t()-.5)*1e-6}function _t(t){return t.x+t.vx}function qt(t){return t.y+t.vy}function Kn(t){return t.z+t.vz}function ft(t){var n,i,e,r,o=1,f=1;typeof t!="function"&&(t=P(t==null?1:+t));function s(){for(var u,h=n.length,_,g,p,w,y,l,N,M=0;M<f;++M)for(_=(i===1?zt(n,_t):i===2?Nt(n,_t,qt):i===3?mt(n,_t,qt,Kn):null).visitAfter(a),u=0;u<h;++u)g=n[u],l=e[g.index],N=l*l,p=g.x+g.vx,i>1&&(w=g.y+g.vy),i>2&&(y=g.z+g.vz),_.visit(z);function z(x,$,I,q,Y,W,R){var v=[$,I,q,Y,W,R],m=v[0],A=v[1],d=v[2],k=v[i],O=v[i+1],G=v[i+2],D=x.data,b=x.r,E=l+b;if(D){if(D.index>g.index){var C=p-D.x-D.vx,j=i>1?w-D.y-D.vy:0,B=i>2?y-D.z-D.vz:0,T=C*C+j*j+B*B;T<E*E&&(C===0&&(C=Q(r),T+=C*C),i>1&&j===0&&(j=Q(r),T+=j*j),i>2&&B===0&&(B=Q(r),T+=B*B),T=(E-(T=Math.sqrt(T)))/T*o,g.vx+=(C*=T)*(E=(b*=b)/(N+b)),i>1&&(g.vy+=(j*=T)*E),i>2&&(g.vz+=(B*=T)*E),D.vx-=C*(E=1-E),i>1&&(D.vy-=j*E),i>2&&(D.vz-=B*E))}return}return m>p+E||k<p-E||i>1&&(A>w+E||O<w-E)||i>2&&(d>y+E||G<y-E)}}function a(u){if(u.data)return u.r=e[u.data.index];for(var h=u.r=0;h<Math.pow(2,i);++h)u[h]&&u[h].r>u.r&&(u.r=u[h].r)}function c(){if(n){var u,h=n.length,_;for(e=new Array(h),u=0;u<h;++u)_=n[u],e[_.index]=+t(_,u,n)}}return s.initialize=function(u,...h){n=u,r=h.find(_=>typeof _=="function")||Math.random,i=h.find(_=>[1,2,3].includes(_))||2,c()},s.iterations=function(u){return arguments.length?(f=+u,s):f},s.strength=function(u){return arguments.length?(o=+u,s):o},s.radius=function(u){return arguments.length?(t=typeof u=="function"?u:P(+u),c(),s):t},s}function Ln(t){return t.index}function St(t,n){var i=t.get(n);if(!i)throw new Error("node not found: "+n);return i}function yt(t){var n=Ln,i=_,e,r=P(30),o,f,s,a,c,u,h=1;t==null&&(t=[]);function _(l){return 1/Math.min(a[l.source.index],a[l.target.index])}function g(l){for(var N=0,M=t.length;N<h;++N)for(var z=0,x,$,I,q=0,Y=0,W=0,R,v;z<M;++z)x=t[z],$=x.source,I=x.target,q=I.x+I.vx-$.x-$.vx||Q(u),s>1&&(Y=I.y+I.vy-$.y-$.vy||Q(u)),s>2&&(W=I.z+I.vz-$.z-$.vz||Q(u)),R=Math.sqrt(q*q+Y*Y+W*W),R=(R-o[z])/R*l*e[z],q*=R,Y*=R,W*=R,I.vx-=q*(v=c[z]),s>1&&(I.vy-=Y*v),s>2&&(I.vz-=W*v),$.vx+=q*(v=1-v),s>1&&($.vy+=Y*v),s>2&&($.vz+=W*v)}function p(){if(f){var l,N=f.length,M=t.length,z=new Map(f.map(($,I)=>[n($,I,f),$])),x;for(l=0,a=new Array(N);l<M;++l)x=t[l],x.index=l,typeof x.source!="object"&&(x.source=St(z,x.source)),typeof x.target!="object"&&(x.target=St(z,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(l=0,c=new Array(M);l<M;++l)x=t[l],c[l]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);e=new Array(M),w(),o=new Array(M),y()}}function w(){if(f)for(var l=0,N=t.length;l<N;++l)e[l]=+i(t[l],l,t)}function y(){if(f)for(var l=0,N=t.length;l<N;++l)o[l]=+r(t[l],l,t)}return g.initialize=function(l,...N){f=l,u=N.find(M=>typeof M=="function")||Math.random,s=N.find(M=>[1,2,3].includes(M))||2,p()},g.links=function(l){return arguments.length?(t=l,p(),g):t},g.id=function(l){return arguments.length?(n=l,g):n},g.iterations=function(l){return arguments.length?(h=+l,g):h},g.strength=function(l){return arguments.length?(i=typeof l=="function"?l:P(+l),w(),g):i},g.distance=function(l){return arguments.length?(r=typeof l=="function"?l:P(+l),y(),g):r},g}var Qn={value:()=>{}};function Gt(){for(var t=0,n=arguments.length,i={},e;t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new at(i)}function at(t){this._=t}function Zn(t,n){return t.trim().split(/^|\s+/).map(function(i){var e="",r=i.indexOf(".");if(r>=0&&(e=i.slice(r+1),i=i.slice(0,r)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:e}})}at.prototype=Gt.prototype={constructor:at,on:function(t,n){var i=this._,e=Zn(t+"",i),r,o=-1,f=e.length;if(arguments.length<2){for(;++o<f;)if((r=(t=e[o]).type)&&(r=Jn(i[r],t.name)))return r;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<f;)if(r=(t=e[o]).type)i[r]=Et(i[r],t.name,n);else if(n==null)for(r in i)i[r]=Et(i[r],t.name,null);return this},copy:function(){var t={},n=this._;for(var i in n)t[i]=n[i].slice();return new at(t)},call:function(t,n){if((r=arguments.length-2)>0)for(var i=new Array(r),e=0,r,o;e<r;++e)i[e]=arguments[e+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],e=0,r=o.length;e<r;++e)o[e].value.apply(n,i)},apply:function(t,n,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var e=this._[t],r=0,o=e.length;r<o;++r)e[r].value.apply(n,i)}};function Jn(t,n){for(var i=0,e=t.length,r;i<e;++i)if((r=t[i]).name===n)return r.value}function Et(t,n,i){for(var e=0,r=t.length;e<r;++e)if(t[e].name===n){t[e]=Qn,t=t.slice(0,e).concat(t.slice(e+1));break}return i!=null&&t.push({name:n,value:i}),t}var tt=0,it=0,nt=0,Xt=1e3,ct,et,lt=0,V=0,gt=0,rt=typeof performance=="object"&&performance.now?performance:Date,Yt=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Bt(){return V||(Yt(Vn),V=rt.now()+gt)}function Vn(){V=0}function dt(){this._call=this._time=this._next=null}dt.prototype=Ut.prototype={constructor:dt,restart:function(t,n,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Bt():+i)+(n==null?0:+n),!this._next&&et!==this&&(et?et._next=this:ct=this,et=this),this._call=t,this._time=i,wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,wt())}};function Ut(t,n,i){var e=new dt;return e.restart(t,n,i),e}function ti(){Bt(),++tt;for(var t=ct,n;t;)(n=V-t._time)>=0&&t._call.call(void 0,n),t=t._next;--tt}function Ot(){V=(lt=rt.now())+gt,tt=it=0;try{ti()}finally{tt=0,ii(),V=0}}function ni(){var t=rt.now(),n=t-lt;n>Xt&&(gt-=n,lt=t)}function ii(){for(var t,n=ct,i,e=1/0;n;)n._call?(e>n._time&&(e=n._time),t=n,n=n._next):(i=n._next,n._next=null,n=t?t._next=i:ct=i);et=t,wt(e)}function wt(t){if(!tt){it&&(it=clearTimeout(it));var n=t-V;n>24?(t<1/0&&(it=setTimeout(Ot,t-rt.now()-gt)),nt&&(nt=clearInterval(nt))):(nt||(lt=rt.now(),nt=setInterval(ni,Xt)),tt=1,Yt(Ot))}}const ei=1664525,ri=1013904223,Dt=4294967296;function oi(){let t=1;return()=>(t=(ei*t+ri)%Dt)/Dt}var Ft=3;function pt(t){return t.x}function jt(t){return t.y}function si(t){return t.z}var fi=10,ai=Math.PI*(3-Math.sqrt(5)),hi=Math.PI*20/(9+Math.sqrt(221));function ht(t,n){n=n||2;var i=Math.min(Ft,Math.max(1,Math.round(n))),e,r=1,o=.001,f=1-Math.pow(o,1/300),s=0,a=.6,c=new Map,u=Ut(g),h=Gt("tick","end"),_=oi();t==null&&(t=[]);function g(){p(),h.call("tick",e),r<o&&(u.stop(),h.call("end",e))}function p(l){var N,M=t.length,z;l===void 0&&(l=1);for(var x=0;x<l;++x)for(r+=(s-r)*f,c.forEach(function($){$(r)}),N=0;N<M;++N)z=t[N],z.fx==null?z.x+=z.vx*=a:(z.x=z.fx,z.vx=0),i>1&&(z.fy==null?z.y+=z.vy*=a:(z.y=z.fy,z.vy=0)),i>2&&(z.fz==null?z.z+=z.vz*=a:(z.z=z.fz,z.vz=0));return e}function w(){for(var l=0,N=t.length,M;l<N;++l){if(M=t[l],M.index=l,M.fx!=null&&(M.x=M.fx),M.fy!=null&&(M.y=M.fy),M.fz!=null&&(M.z=M.fz),isNaN(M.x)||i>1&&isNaN(M.y)||i>2&&isNaN(M.z)){var z=fi*(i>2?Math.cbrt(.5+l):i>1?Math.sqrt(.5+l):l),x=l*ai,$=l*hi;i===1?M.x=z:i===2?(M.x=z*Math.cos(x),M.y=z*Math.sin(x)):(M.x=z*Math.sin(x)*Math.cos($),M.y=z*Math.cos(x),M.z=z*Math.sin(x)*Math.sin($))}(isNaN(M.vx)||i>1&&isNaN(M.vy)||i>2&&isNaN(M.vz))&&(M.vx=0,i>1&&(M.vy=0),i>2&&(M.vz=0))}}function y(l){return l.initialize&&l.initialize(t,_,i),l}return w(),e={tick:p,restart:function(){return u.restart(g),e},stop:function(){return u.stop(),e},numDimensions:function(l){return arguments.length?(i=Math.min(Ft,Math.max(1,Math.round(l))),c.forEach(y),e):i},nodes:function(l){return arguments.length?(t=l,w(),c.forEach(y),e):t},alpha:function(l){return arguments.length?(r=+l,e):r},alphaMin:function(l){return arguments.length?(o=+l,e):o},alphaDecay:function(l){return arguments.length?(f=+l,e):+f},alphaTarget:function(l){return arguments.length?(s=+l,e):s},velocityDecay:function(l){return arguments.length?(a=1-l,e):1-a},randomSource:function(l){return arguments.length?(_=l,c.forEach(y),e):_},force:function(l,N){return arguments.length>1?(N==null?c.delete(l):c.set(l,y(N)),e):c.get(l)},find:function(){var l=Array.prototype.slice.call(arguments),N=l.shift()||0,M=(i>1?l.shift():null)||0,z=(i>2?l.shift():null)||0,x=l.shift()||1/0,$=0,I=t.length,q,Y,W,R,v,m;for(x*=x,$=0;$<I;++$)v=t[$],q=N-v.x,Y=M-(v.y||0),W=z-(v.z||0),R=q*q+Y*Y+W*W,R<x&&(m=v,x=R);return m},on:function(l,N){return arguments.length>1?(h.on(l,N),e):h.on(l)}}}function ut(){var t,n,i,e,r,o=P(-30),f,s=1,a=1/0,c=.81;function u(p){var w,y=t.length,l=(n===1?zt(t,pt):n===2?Nt(t,pt,jt):n===3?mt(t,pt,jt,si):null).visitAfter(_);for(r=p,w=0;w<y;++w)i=t[w],l.visit(g)}function h(){if(t){var p,w=t.length,y;for(f=new Array(w),p=0;p<w;++p)y=t[p],f[y.index]=+o(y,p,t)}}function _(p){var w=0,y,l,N=0,M,z,x,$,I=p.length;if(I){for(M=z=x=$=0;$<I;++$)(y=p[$])&&(l=Math.abs(y.value))&&(w+=y.value,N+=l,M+=l*(y.x||0),z+=l*(y.y||0),x+=l*(y.z||0));w*=Math.sqrt(4/I),p.x=M/N,n>1&&(p.y=z/N),n>2&&(p.z=x/N)}else{y=p,y.x=y.data.x,n>1&&(y.y=y.data.y),n>2&&(y.z=y.data.z);do w+=f[y.data.index];while(y=y.next)}p.value=w}function g(p,w,y,l,N){if(!p.value)return!0;var M=[y,l,N][n-1],z=p.x-i.x,x=n>1?p.y-i.y:0,$=n>2?p.z-i.z:0,I=M-w,q=z*z+x*x+$*$;if(I*I/c<q)return q<a&&(z===0&&(z=Q(e),q+=z*z),n>1&&x===0&&(x=Q(e),q+=x*x),n>2&&$===0&&($=Q(e),q+=$*$),q<s&&(q=Math.sqrt(s*q)),i.vx+=z*p.value*r/q,n>1&&(i.vy+=x*p.value*r/q),n>2&&(i.vz+=$*p.value*r/q)),!0;if(p.length||q>=a)return;(p.data!==i||p.next)&&(z===0&&(z=Q(e),q+=z*z),n>1&&x===0&&(x=Q(e),q+=x*x),n>2&&$===0&&($=Q(e),q+=$*$),q<s&&(q=Math.sqrt(s*q)));do p.data!==i&&(I=f[p.data.index]*r/q,i.vx+=z*I,n>1&&(i.vy+=x*I),n>2&&(i.vz+=$*I));while(p=p.next)}return u.initialize=function(p,...w){t=p,e=w.find(y=>typeof y=="function")||Math.random,n=w.find(y=>[1,2,3].includes(y))||2,h()},u.strength=function(p){return arguments.length?(o=typeof p=="function"?p:P(+p),h(),u):o},u.distanceMin=function(p){return arguments.length?(s=p*p,u):Math.sqrt(s)},u.distanceMax=function(p){return arguments.length?(a=p*p,u):Math.sqrt(a)},u.theta=function(p){return arguments.length?(c=p*p,u):Math.sqrt(c)},u}function Ht(t){var n=P(.1),i,e,r;typeof t!="function"&&(t=P(t==null?0:+t));function o(s){for(var a=0,c=i.length,u;a<c;++a)u=i[a],u.vx+=(r[a]-u.x)*e[a]*s}function f(){if(i){var s,a=i.length;for(e=new Array(a),r=new Array(a),s=0;s<a;++s)e[s]=isNaN(r[s]=+t(i[s],s,i))?0:+n(i[s],s,i)}}return o.initialize=function(s){i=s,f()},o.strength=function(s){return arguments.length?(n=typeof s=="function"?s:P(+s),f(),o):n},o.x=function(s){return arguments.length?(t=typeof s=="function"?s:P(+s),f(),o):t},o}function Kt(t){var n=P(.1),i,e,r;typeof t!="function"&&(t=P(t==null?0:+t));function o(s){for(var a=0,c=i.length,u;a<c;++a)u=i[a],u.vy+=(r[a]-u.y)*e[a]*s}function f(){if(i){var s,a=i.length;for(e=new Array(a),r=new Array(a),s=0;s<a;++s)e[s]=isNaN(r[s]=+t(i[s],s,i))?0:+n(i[s],s,i)}}return o.initialize=function(s){i=s,f()},o.strength=function(s){return arguments.length?(n=typeof s=="function"?s:P(+s),f(),o):n},o.y=function(s){return arguments.length?(t=typeof s=="function"?s:P(+s),f(),o):t},o}function Lt(t){var n=P(.1),i,e,r;typeof t!="function"&&(t=P(t==null?0:+t));function o(s){for(var a=0,c=i.length,u;a<c;++a)u=i[a],u.vz+=(r[a]-u.z)*e[a]*s}function f(){if(i){var s,a=i.length;for(e=new Array(a),r=new Array(a),s=0;s<a;++s)e[s]=isNaN(r[s]=+t(i[s],s,i))?0:+n(i[s],s,i)}}return o.initialize=function(s){i=s,f()},o.strength=function(s){return arguments.length?(n=typeof s=="function"?s:P(+s),f(),o):n},o.z=function(s){return arguments.length?(t=typeof s=="function"?s:P(+s),f(),o):t},o}const Z=.55,ui=12,ci=60,vt=60;function li(t){const n=new Map(t.map((i,e)=>[i.id,e]));return t.map(i=>`${i.parents.map(r=>n.get(r)??-1).join(".")}:${i.radius.toFixed(2)}`).join("|")}function gi(t,n,i){const[e,r,o]=t,f=e*Math.cos(n)+o*Math.sin(n),s=-e*Math.sin(n)+o*Math.cos(n),a=r*Math.cos(i)-s*Math.sin(i),c=r*Math.sin(i)+s*Math.cos(i);return[f,a,c]}function _i(t,n,i){const e=p=>Math.hypot(p[0],p[1],p[2]),r=e(n),o=e(i);if(r<1e-9||o<1e-9)return t;const f=[n[0]/r,n[1]/r,n[2]/r],s=[i[0]/o,i[1]/o,i[2]/o],a=[f[1]*s[2]-f[2]*s[1],f[2]*s[0]-f[0]*s[2],f[0]*s[1]-f[1]*s[0]],c=e(a),u=f[0]*s[0]+f[1]*s[1]+f[2]*s[2];if(c<1e-9)return u>0?t:[-t[0],-t[1],-t[2]];const h=[a[0]/c,a[1]/c,a[2]/c],_=h[0]*t[0]+h[1]*t[1]+h[2]*t[2],g=[h[1]*t[2]-h[2]*t[1],h[2]*t[0]-h[0]*t[2],h[0]*t[1]-h[1]*t[0]];return[t[0]*u+g[0]*c+h[0]*_*(1-u),t[1]*u+g[1]*c+h[1]*_*(1-u),t[2]*u+g[2]*c+h[2]*_*(1-u)]}function Tt(t,n,i){if(n.length===0)return t;let e=0;for(const r of n)e+=i.get(r.id.slice(6))??Z;return e/=n.length,Math.max(t+2,Math.sqrt(n.length)*e*1.6)}function xt(t,n,i){const e=n<=1?0:1-2*(t+.5)/n,r=Math.sqrt(Math.max(0,1-e*e)),o=t*Math.PI*(3-Math.sqrt(5));return[Math.cos(o)*r*i,e*i,Math.sin(o)*r*i]}function Qt(t,n,i=()=>{},e="clumps"){const r=new Map(t.map(v=>[v.id,v])),o=new Map,f=[];for(const v of t)v.group===null?f.push(v):o.set(v.group,[...o.get(v.group)??[],v]);const s=new Map,a=new Map,c=new Map,u=new Set;let h=0;const _=Math.max(1,o.size),g=new Map;for(const[v,m]of o){const A=m.filter(b=>b.seed!==void 0),d=[0,0,0];for(const b of A)d[0]+=b.seed[0],d[1]+=b.seed[1],d[2]+=b.seed[2];A.length>0&&(d[0]/=A.length,d[1]/=A.length,d[2]/=A.length,c.set(v,d)),m.every(b=>b.frozen===!0&&b.seed!==void 0)&&u.add(v);const k=new Map,O=A.length===0?li(m):null,G=O===null?void 0:g.get(O);if(A.length===m.length)for(const b of m)k.set(b.id,[b.seed[0]-d[0],b.seed[1]-d[1],b.seed[2]-d[2]]);else if(G!==void 0){const b=Math.random()*Math.PI*2,E=(Math.random()-.5)*Math.PI;m.forEach((C,j)=>{k.set(C.id,gi(G[j]??[0,0,0],b,E))})}else{const b=m.map(S=>{const L={id:S.id,r:S.radius};return S.seed!==void 0&&(L.x=S.seed[0]-d[0],L.y=S.seed[1]-d[1],L.z=S.seed[2]-d[2],S.frozen===!0&&(L.fx=L.x,L.fy=L.y,L.fz=L.z)),L}),E=new Set(m.map(S=>S.id)),C=[];for(const S of m)for(const L of S.parents)E.has(L)&&C.push({source:L,target:S.id});const j=new Map(m.map(S=>[S.id,S.radius])),B=ht(b,3).force("link",yt(C).id(S=>S.id).distance(n.link?S=>(j.get(S.source.id)??Z)+(j.get(S.target.id)??Z)+1.4:2.2)).force("charge",ut().strength(S=>n.charge?-6*(S.r/Z)**2:-6).distanceMax(ui)).force("center",st(0,0,0)).stop();n.collide&&B.force("collide",ft().radius(S=>S.r*1.2));for(let S=0;S<ci;S++)B.tick();const T=[0,0,0];for(const S of b)T[0]+=S.x??0,T[1]+=S.y??0,T[2]+=S.z??0;T[0]/=b.length,T[1]/=b.length,T[2]/=b.length;for(const S of b)k.set(S.id,[(S.x??0)-T[0],(S.y??0)-T[1],(S.z??0)-T[2]]);O!==null&&g.set(O,m.map(S=>k.get(S.id)??[0,0,0]))}let D=Z;for(const b of m){const E=k.get(b.id)??[0,0,0];s.set(b.id,E),D=Math.max(D,Math.hypot(E[0],E[1],E[2])+b.radius)}a.set(v,D),h+=1,h%50===0&&i(.3*(h/_))}i(.3);const p=v=>{const m=r.get(v);return m!==void 0&&m.group!==null?`group:${m.group}`:v},w=[],y=new Map;let l=!1;for(const[v]of o){const m=`group:${v}`,A=a.get(v)??Z,d={id:m,r:A},k=c.get(v);k!==void 0&&(d.x=k[0],d.y=k[1],d.z=k[2],u.has(v)&&(d.fx=k[0],d.fy=k[1],d.fz=k[2],l=!0)),y.set(m,A),w.push(d)}for(const v of f){const m={id:v.id,r:v.radius};v.seed!==void 0&&(m.x=v.seed[0],m.y=v.seed[1],m.z=v.seed[2],v.frozen===!0&&(m.fx=v.seed[0],m.fy=v.seed[1],m.fz=v.seed[2],l=!0)),y.set(v.id,v.radius),w.push(m)}const N=new Set,M=[];for(const v of t)for(const m of v.parents){if(!r.has(m))continue;const A=p(m),d=p(v.id);if(A===d)continue;const k=`${A}\0${d}`;N.has(k)||(N.add(k),M.push({source:A,target:d}))}const z=new Map;for(const v of M)if(v.source.startsWith("group:")!==v.target.startsWith("group:")){const m=v.source.startsWith("group:")?v.source:v.target,A=v.source.startsWith("group:")?v.target:v.source;z.has(m)||z.set(m,A)}const x=new Map;for(const v of w){const m=z.get(v.id);m!==void 0&&x.set(m,[...x.get(m)??[],v])}const $=w.reduce((v,m)=>v+m.r*m.r,0),I=w.filter(v=>!v.id.startsWith("group:"));I.forEach((v,m)=>{if(v.x!==void 0)return;const[A,d,k]=xt(m,I.length,Math.sqrt($)*1.2+10);v.x=A,v.y=d,v.z=k});for(const[v,m]of x){const A=w.find(k=>k.id===v),d=Math.sqrt(m.reduce((k,O)=>k+O.r*O.r,0))*1.4+2;m.forEach((k,O)=>{if(k.x!==void 0)return;const[G,D,b]=xt(O,m.length,d);k.x=(A?.x??0)+G,k.y=(A?.y??0)+D,k.z=(A?.z??0)+b})}const q=new Set;if(e==="spokes"){const v=A=>{const d=o.get(A)??[],k=new Set(d.map(G=>G.id)),O=d.find(G=>G.parents.some(D=>!k.has(D)))??d[0];return O===void 0?[0,0,0]:s.get(O.id)??[0,0,0]},m=[];for(const A of w){if(A.id.startsWith("group:")&&z.has(A.id)){q.add(A.id);continue}if(A.id.startsWith("group:"))m.push(A);else{const d=x.get(A.id)??[];let k=A.r;const O=Tt(A.r,d,a);for(const G of d){const D=G.id.slice(6),b=v(D);k=Math.max(k,O+Math.hypot(b[0],b[1],b[2])+2*(a.get(D)??Z))}m.push({id:A.id,r:k,x:A.x,y:A.y,z:A.z,...A.fx!==void 0?{fx:A.fx,fy:A.fy,fz:A.fz}:{}})}}if(!m.every(A=>A.fx!==void 0)){const A=ht(m,3).force("charge",ut().strength(d=>-1.5*d.r)).force("collide",ft().radius(d=>d.r*.9)).stop();l||A.force("center",st(0,0,0));for(let d=0;d<vt;d++)A.tick(),d%5===0&&i(.3+.7*(d/vt))}for(const A of m){const d=w.find(k=>k.id===A.id);d!==void 0&&d!==A&&(d.x=A.x,d.y=A.y,d.z=A.z)}for(const A of w){if(A.id.startsWith("group:")||!x.has(A.id))continue;const d=x.get(A.id)??[],k=Tt(A.r,d,a);d.forEach((O,G)=>{if(O.fx!==void 0||c.has(O.id.slice(6)))return;const D=v(O.id.slice(6)),b=xt(G,d.length,1),E=.35+.65*(G*.6180339887%1),C=A.r+1.4+k*E+Math.hypot(D[0],D[1],D[2]);O.x=(A.x??0)+b[0]*C,O.y=(A.y??0)+b[1]*C,O.z=(A.z??0)+b[2]*C})}}if(!w.every(v=>v.fx!==void 0)&&e!=="spokes"){const v=ht(w,3).force("link",yt(M).id(d=>d.id).distance(n.link?d=>(y.get(d.source.id)??Z)+(y.get(d.target.id)??Z)+1.4:2.2)).stop(),m=ut().strength(d=>n.charge?-6*(d.r/Z)**2:-6);if(n.reach!==void 0&&m.distanceMax(n.reach),v.force("charge",m),l||v.force("center",st(0,0,0)),n.collide&&v.force("collide",ft().radius(d=>d.r*1.05)),n.gravity){const d=k=>Math.min(1,(k.r/Z)**2*.08);v.force("gx",Ht(0).strength(d)).force("gy",Kt(0).strength(d)).force("gz",Lt(0).strength(d))}const A=vt;for(let d=0;d<A;d++)v.tick(),d%5===0&&i(.3+.7*(d/A))}const W=new Map(w.map(v=>[v.id,v]));if(e==="spokes")for(const[v,m]of o){if(m.some(j=>j.seed!==void 0))continue;const A=`group:${v}`,d=W.get(A),k=z.get(A),O=k===void 0?void 0:W.get(k);if(d===void 0||O===void 0)continue;const G=[(d.x??0)-(O.x??0),(d.y??0)-(O.y??0),(d.z??0)-(O.z??0)],D=new Set(m.map(j=>j.id)),b=m.find(j=>j.parents.some(B=>!D.has(B)))??m[0],E=s.get(b.id)??[0,0,0],C=[-E[0],-E[1],-E[2]];for(const j of m){const B=s.get(j.id)??[0,0,0];s.set(j.id,_i(B,C,G))}}const R={};for(const v of t){const m=W.get(p(v.id)),A=[m?.x??0,m?.y??0,m?.z??0],d=v.group===null?[0,0,0]:s.get(v.id)??[0,0,0];R[v.id]=[A[0]+d[0],A[1]+d[1],A[2]+d[2]]}return i(1),R}const ot=.55,Wt=80;function pi(t,n,i=()=>{}){const e=t.some(h=>h.seed===void 0),r=e?Qt(t,n,h=>i(.05*h),"spokes"):{};i(.05);const o=t.map(h=>{const _=h.seed??r[h.id],g={id:h.id,r:h.radius};return _!==void 0&&(g.x=_[0],g.y=_[1],g.z=_[2],h.frozen===!0&&h.seed!==void 0&&(g.fx=_[0],g.fy=_[1],g.fz=_[2])),g}),f=new Set(t.map(h=>h.id)),s=[];for(const h of t)for(const _ of h.parents)f.has(_)&&s.push({source:_,target:h.id});const a=new Map(t.map(h=>[h.id,h.radius])),c=o.some(h=>h.fx!==void 0);if(!o.every(h=>h.fx!==void 0)){const h=ht(o,3).force("link",yt(s).id(g=>g.id).distance(n.link?g=>(a.get(g.source.id)??ot)+(a.get(g.target.id)??ot)+1.4:2.2)).stop(),_=ut().strength(g=>n.charge?-6*(g.r/ot)**2:-6);if(n.reach!==void 0&&_.distanceMax(n.reach),h.force("charge",_),c||h.force("center",st(0,0,0)),n.collide&&h.force("collide",ft().radius(g=>g.r*1.2)),n.gravity){const g=p=>(p.r/ot)**2*.08;h.force("gx",Ht(0).strength(g)).force("gy",Kt(0).strength(g)).force("gz",Lt(0).strength(g))}e&&h.alpha(.6);for(let g=0;g<Wt;g++)h.tick(),g%2===0&&i(.05+.95*(g/Wt))}const u={};for(const h of o)u[h.id]=[h.x??0,h.y??0,h.z??0];return i(1),u}self.onmessage=t=>{const{generation:n,nodes:i,physics:e,arrangement:r}=t.data;let o=-1;const f=a=>{const c=Math.floor(a*100);c!==o&&(o=c,self.postMessage({generation:n,type:"progress",fraction:a}))},s=r==="galaxy"?pi(i,e,f):Qt(i,e,f,r);self.postMessage({generation:n,type:"done",positions:s})};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{_ as h,I as u}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-mx1chng0.js","./_commonjsHelpers-CE1G-McA.js","./index-Dtsm0q-Z.js","./index-CIblWv2u.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as h,I as u}from"./index-Dtsm0q-Z.js";const c={gray:"gray",hot:"hot",jet:"jet",cool:"cool"},d={wl:"contrast",pan:"pan",length:"measurement",angle:"angle"};class v{name="niivue";host;path;nv=null;module=null;layout="mpr";tool="wl";colormap="gray";slice=0;slices=0;refused=0;disposed=!1;constructor(s,t){this.host=s,this.path=t}async open(s){const t=document.createElement("canvas");t.className="image-canvas",s.appendChild(t),this.host.readout_set("LOADING"),this.host.progress_set({label:"READING VOLUME",done:0,total:0});const e=performance.now();if(this.module=await h(()=>import("./index-mx1chng0.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),this.disposed)return;const i=new this.module.Niivue({isResizeCanvas:!0,logLevel:"error",dragAndDropEnabled:!1,crosshairWidth:.4,crosshairWidthUnit:"percent"});i.onLocationChange=o=>{const r=o,l=r.vox?.[2];l!==void 0&&(this.slice=l+1),this.host.readout_set(`${this.slices>0?`SLICE ${this.slice} OF ${this.slices} · `:""}${r.string??""}`)},await i.attachToCanvas(t);const n=this.path.split("/").pop()??"volume.nii.gz";try{await i.loadVolumes([{url:`${location.origin}${this.host.source.url_of(this.path)}`,name:n}])}catch(o){this.refused=1,this.host.progress_set(null),this.host.readout_set("REFUSED 1 OF 1"),this.host.note(`image: ${this.path}: ${o instanceof Error?o.message:String(o)}`);return}if(this.host.progress_set(null),this.disposed)return;this.nv=i;const a=i.volumes[0]?.dims;this.slices=a?.[3]??0,i.setSliceType(i.sliceTypeMultiplanar),this.layout="mpr",this.host.readout_set(`${this.slices} SLICES`),this.host.note(`image: ${n} drawn in ${Math.round(performance.now()-e)} ms`),this.host.regard(this.path)}async layout_set(s){return s==="slab"||this.nv===null?!1:(this.nv.setSliceType(s==="single"?this.nv.sliceTypeAxial:s==="mpr"?this.nv.sliceTypeMultiplanar:this.nv.sliceTypeRender),this.layout=s,this.host.readout_set(`${this.slices} SLICES`),!0)}slice_set(s){if(this.nv===null||this.slices===0)return!1;const t=Math.max(1,Math.min(s,this.slices)),e=this.slice>0?this.slice:Math.ceil(this.slices/2);return this.nv.moveCrosshairInVox(0,0,t-e),this.slice=t,!0}wl_set(s,t){const e=this.nv?.volumes[0];return this.nv===null||e===void 0?!1:(e.cal_min=s,e.cal_max=t,this.nv.updateGLVolume(),!0)}colormap_set(s){const t=this.nv?.volumes[0];return this.nv===null||t?.id===void 0?!1:(this.colormap=s,this.nv.setColormap(t.id,c[s]),!0)}toolsOffered_get(){return u}ghost_set(s){return!1}tool_set(s){const t=d[s];return this.nv===null||t===void 0?!1:(this.nv.setDragMode(t),this.tool=s,!0)}annotations_export(){return Promise.resolve(null)}annotations_import(){return Promise.resolve(0)}async slices_fill(){return this.nv!==null}state_get(){return{engine:"niivue",layout:this.layout,slice:this.slice,slices:this.slices,tool:this.tool,primaryTool:this.tool,refused:this.refused,annotations:0,filled:this.nv!==null,colormap:this.colormap}}dispose(){this.disposed=!0,this.nv=null}}export{v as NiivueEngine};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as v,as as _e,R as gt,K as Pe,L as Ge,W as ke,N as Le,k as de,E as j,t as ft,i as Me,x as ce,F as vt,Z as ht,h as St,D as dt,al as Tt,c as wt,at as yt,d as Ve,au as Ct,y as ue,ak as le,av as We,j as pe}from"./cornerstoneEngine-
|
|
1
|
+
import{m as v,as as _e,R as gt,K as Pe,L as Ge,W as ke,N as Le,k as de,E as j,t as ft,i as Me,x as ce,F as vt,Z as ht,h as St,D as dt,al as Tt,c as wt,at as yt,d as Ve,au as Ct,y as ue,ak as le,av as We,j as pe}from"./cornerstoneEngine-CGEzAsx7.js";import{ae as ze,am as De,an as ae,K as D,k as Q,al as W,D as se,U as Ne,X as Be,B as b,J as xt,E as Et,ak as Rt,$ as $e,a2 as _t,Z as Mt,b as Vt,_ as Ke,ao as Dt,ap as He,aq as Bt,ar as Te,as as mt,z as Ot,at as Ut,au as Ft,av as re,ad as Pt,R as Gt,aw as I,ah as kt,ai as Lt,C as Wt,P as zt,I as Nt,a as $t}from"./Texture-C99vHuBO.js";import"./index-Dtsm0q-Z.js";import"./_commonjsHelpers-CE1G-McA.js";function Kt(t){return t}function ye(t){if(t===null||t==="null")return null;if(t==="true")return!0;if(t==="false")return!1;if(!(t===void 0||t==="undefined"))return t[0]==="["&&t[t.length-1]==="]"?t.substring(1,t.length-1).split(",").map(e=>ye(e.trim())):t===""||Number.isNaN(Number(t))?t:Number(t)}function Ht(t=!0,e=window.location.search){const a={},s=t?ye:Kt;return new URLSearchParams(e).forEach((n,r)=>{r&&(a[r]=n?s(n):!0)}),a}var bt={toNativeType:ye,extractURLParameters:Ht},It={IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025},Ce={States:It},{vtkErrorMacro:jt,VOID:Qt}=v;function Yt(t,e,a,s){return t.getRenderWindow().getViews()[0].worldToDisplay(e,a,s,t)}function Xt(t,e,a,s){return t.getRenderWindow().getViews()[0].displayToWorld(e,a,s,t)}var Zt={computeWorldToDisplay:Yt,computeDisplayToWorld:Xt};function Jt(t,e){e.classHierarchy.push("vtkInteractorObserver");const a={...t};function s(){for(;e.subscribedEvents.length;)e.subscribedEvents.pop().unsubscribe()}function n(){ze.handledEvents.forEach(r=>{t[`handle${r}`]&&e.subscribedEvents.push(e._interactor[`on${r}`](o=>e.processEvents?t[`handle${r}`](o):Qt,e.priority))})}t.setInteractor=r=>{r!==e._interactor&&(s(),e._interactor=r,r&&e.enabled&&n(),t.modified())},t.setEnabled=r=>{r!==e.enabled&&(s(),r&&(e._interactor?n():jt(`
|
|
2
2
|
The interactor must be set before subscribing to events
|
|
3
3
|
`)),e.enabled=r,t.modified())},t.computeDisplayToWorld=(r,o,i,u)=>r?e._interactor.getView().displayToWorld(o,i,u,r):null,t.computeWorldToDisplay=(r,o,i,u)=>r?e._interactor.getView().worldToDisplay(o,i,u,r):null,t.setPriority=r=>{a.setPriority(r)&&e._interactor&&(s(),n())}}var qt={enabled:!0,priority:0,processEvents:!0,subscribedEvents:[]};function be(t,e,a={}){Object.assign(e,qt,a),v.obj(t,e),v.event(t,e,"InteractionEvent"),v.event(t,e,"StartInteractionEvent"),v.event(t,e,"EndInteractionEvent"),v.get(t,e,["_interactor","enabled"]),v.setGet(t,e,["priority","processEvents"]),v.moveToProtected(t,e,["interactor"]),Jt(t,e)}var At=v.newInstance(be,"vtkInteractorObserver"),en={newInstance:At,extend:be,...Zt},{States:L}=Ce,ge={Rotate:L.IS_ROTATE,Pan:L.IS_PAN,Spin:L.IS_SPIN,Dolly:L.IS_DOLLY,CameraPose:L.IS_CAMERA_POSE,WindowLevel:L.IS_WINDOW_LEVEL,Slice:L.IS_SLICE};function tn(t,e){e.classHierarchy.push("vtkInteractorStyle"),Object.keys(ge).forEach(a=>{v.event(t,e,`Start${a}Event`),t[`start${a}`]=()=>{e.state===L.IS_NONE&&(e.state=ge[a],e._interactor.requestAnimation(t),t.invokeStartInteractionEvent({type:"StartInteractionEvent"}),t[`invokeStart${a}Event`]({type:`Start${a}Event`}))},v.event(t,e,`End${a}Event`),t[`end${a}`]=()=>{e.state===ge[a]&&(e.state=L.IS_NONE,e._interactor.cancelAnimation(t),t.invokeEndInteractionEvent({type:"EndInteractionEvent"}),t[`invokeEnd${a}Event`]({type:`End${a}Event`}),e._interactor.render())}}),e.getRenderer=a=>e.focusedRenderer||a.pokedRenderer,t.handleKeyPress=a=>{const s=e._interactor;let n=null;switch(a.key){case"r":case"R":e.getRenderer(a).resetCamera(),s.render();break;case"w":case"W":n=e.getRenderer(a).getActors(),n.forEach(r=>{const o=r.getProperty();o.setRepresentationToWireframe&&o.setRepresentationToWireframe()}),s.render();break;case"s":case"S":n=e.getRenderer(a).getActors(),n.forEach(r=>{const o=r.getProperty();o.setRepresentationToSurface&&o.setRepresentationToSurface()}),s.render();break;case"v":case"V":n=e.getRenderer(a).getActors(),n.forEach(r=>{const o=r.getProperty();o.setRepresentationToPoints&&o.setRepresentationToPoints()}),s.render();break}}}var nn={state:L.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function Ie(t,e,a={}){Object.assign(e,nn,a),en.extend(t,e,a),v.setGet(t,e,["focusedRenderer"]),tn(t,e)}var an=v.newInstance(Ie,"vtkInteractorStyle"),xe={newInstance:an,extend:Ie,...Ce},{States:G}=Ce;function rn(t,e){e.classHierarchy.push("vtkInteractorStyleTrackballCamera"),t.handleMouseMove=a=>{const s=a.position,n=e.getRenderer(a);switch(e.state){case G.IS_ROTATE:t.handleMouseRotate(n,s),t.invokeInteractionEvent({type:"InteractionEvent"});break;case G.IS_PAN:t.handleMousePan(n,s),t.invokeInteractionEvent({type:"InteractionEvent"});break;case G.IS_DOLLY:e.wheelDolly||(t.handleMouseDolly(n,s),t.invokeInteractionEvent({type:"InteractionEvent"}));break;case G.IS_SPIN:t.handleMouseSpin(n,s),t.invokeInteractionEvent({type:"InteractionEvent"});break}e.previousPosition=s},t.handleButton3D=a=>{if(a&&a.pressed&&a.device===De.RightController&&(a.input===ae.Trigger||a.input===ae.TrackPad)){t.startCameraPose();return}a&&!a.pressed&&a.device===De.RightController&&(a.input===ae.Trigger||a.input===ae.TrackPad)&&e.state===G.IS_CAMERA_POSE&&t.endCameraPose()},t.handleMove3D=a=>{e.state===G.IS_CAMERA_POSE&&t.updateCameraPose(a)},t.updateCameraPose=a=>{const s=e.getRenderer(a).getActiveCamera(),n=s.getPhysicalTranslation(),r=.5*.05*s.getPhysicalScale(),o=s.physicalOrientationToWorldDirection([a.orientation.x,a.orientation.y,a.orientation.z,a.orientation.w]);s.setPhysicalTranslation(n[0]+o[0]*r,n[1]+o[1]*r,n[2]+o[2]*r)},t.handleLeftButtonPress=a=>{e.previousPosition=a.position,a.shiftKey?a.controlKey||a.altKey?t.startDolly():t.startPan():a.controlKey||a.altKey?t.startSpin():t.startRotate()},t.handleLeftButtonRelease=()=>{switch(e.state){case G.IS_DOLLY:t.endDolly();break;case G.IS_PAN:t.endPan();break;case G.IS_SPIN:t.endSpin();break;case G.IS_ROTATE:t.endRotate();break}},t.handleStartMouseWheel=()=>{e.wheelDolly=!0,t.startDolly()},t.handleEndMouseWheel=()=>{t.endDolly(),e.wheelDolly=!1},t.handleStartPinch=a=>{e.previousScale=a.scale,t.startDolly()},t.handleEndPinch=()=>{t.endDolly()},t.handleStartRotate=a=>{e.previousRotation=a.rotation,t.startRotate()},t.handleEndRotate=()=>{t.endRotate()},t.handleStartPan=a=>{e.previousTranslation=a.translation,t.startPan()},t.handleEndPan=()=>{t.endPan()},t.handlePinch=a=>{t.dollyByFactor(e.getRenderer(a),a.scale/e.previousScale),e.previousScale=a.scale},t.handlePan=a=>{const s=e.getRenderer(a).getActiveCamera();let n=s.getFocalPoint();n=t.computeWorldToDisplay(e.getRenderer(a),n[0],n[1],n[2]);const r=n[2],o=a.translation,i=e.previousTranslation,u=t.computeDisplayToWorld(e.getRenderer(a),n[0]+o[0]-i[0],n[1]+o[1]-i[1],r),p=t.computeDisplayToWorld(e.getRenderer(a),n[0],n[1],r),c=[];c[0]=p[0]-u[0],c[1]=p[1]-u[1],c[2]=p[2]-u[2],n=s.getFocalPoint();const l=s.getPosition();s.setFocalPoint(c[0]+n[0],c[1]+n[1],c[2]+n[2]),s.setPosition(c[0]+l[0],c[1]+l[1],c[2]+l[2]),e._interactor.getLightFollowCamera()&&e.getRenderer(a).updateLightsGeometryToFollowCamera(),s.orthogonalizeViewUp(),e.previousTranslation=a.translation},t.handleRotate=a=>{const s=e.getRenderer(a).getActiveCamera();s.roll(a.rotation-e.previousRotation),s.orthogonalizeViewUp(),e.previousRotation=a.rotation},t.handleMouseRotate=(a,s)=>{if(!e.previousPosition)return;const n=e._interactor,r=s.x-e.previousPosition.x,o=s.y-e.previousPosition.y,i=n.getView().getViewportSize(a);let u=-.1,p=-.1;i[0]&&i[1]&&(u=-20/i[1],p=-20/i[0]);const c=r*p*e.motionFactor,l=o*u*e.motionFactor,g=a.getActiveCamera();!Number.isNaN(c)&&!Number.isNaN(l)&&(g.azimuth(c),g.elevation(l),g.orthogonalizeViewUp()),e.autoAdjustCameraClippingRange&&a.resetCameraClippingRange(),n.getLightFollowCamera()&&a.updateLightsGeometryToFollowCamera()},t.handleMouseSpin=(a,s)=>{if(!e.previousPosition)return;const n=e._interactor,r=a.getActiveCamera(),o=n.getView().getViewportCenter(a),i=_e(Math.atan2(e.previousPosition.y-o[1],e.previousPosition.x-o[0])),u=_e(Math.atan2(s.y-o[1],s.x-o[0]))-i;Number.isNaN(u)||(r.roll(u),r.orthogonalizeViewUp())},t.handleMousePan=(a,s)=>{if(!e.previousPosition)return;const n=a.getActiveCamera();let r=n.getFocalPoint();r=t.computeWorldToDisplay(a,r[0],r[1],r[2]);const o=r[2],i=t.computeDisplayToWorld(a,s.x,s.y,o),u=t.computeDisplayToWorld(a,e.previousPosition.x,e.previousPosition.y,o),p=[];p[0]=u[0]-i[0],p[1]=u[1]-i[1],p[2]=u[2]-i[2],r=n.getFocalPoint();const c=n.getPosition();n.setFocalPoint(p[0]+r[0],p[1]+r[1],p[2]+r[2]),n.setPosition(p[0]+c[0],p[1]+c[1],p[2]+c[2]),e._interactor.getLightFollowCamera()&&a.updateLightsGeometryToFollowCamera()},t.handleMouseDolly=(a,s)=>{if(!e.previousPosition)return;const n=s.y-e.previousPosition.y,r=e._interactor.getView().getViewportCenter(a),o=e.motionFactor*n/r[1];t.dollyByFactor(a,1.1**o)},t.handleMouseWheel=a=>{const s=1-a.spinY/e.zoomFactor;t.dollyByFactor(e.getRenderer(a),s)},t.dollyByFactor=(a,s)=>{if(Number.isNaN(s))return;const n=a.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/s):(n.dolly(s),e.autoAdjustCameraClippingRange&&a.resetCameraClippingRange()),e._interactor.getLightFollowCamera()&&a.updateLightsGeometryToFollowCamera()}}var sn={motionFactor:10,zoomFactor:10,wheelDolly:!1};function je(t,e,a={}){Object.assign(e,sn,a),xe.extend(t,e,a),v.setGet(t,e,["motionFactor","zoomFactor"]),rn(t,e)}var on=v.newInstance(je,"vtkInteractorStyleTrackballCamera"),cn={newInstance:on,extend:je},{vtkErrorMacro:un}=gt,fe=["setBindGroup","setIndexBuffer","setVertexBuffer","draw","drawIndexed"];function ln(t,e){e.classHierarchy.push("vtkWebGPURenderEncoder"),t.begin=a=>{e.drawCallbacks=[],e.handle=a.beginRenderPass(e.description),e.label&&e.handle.pushDebugGroup(e.label)},t.end=()=>{for(let a=0;a<e.drawCallbacks.length;a++){const s=e.drawCallbacks[a],n=s.pipeline;t.setPipeline(n);for(let r=0;r<s.callbacks.length;r++)s.callbacks[r](t)}e.label&&e.handle.popDebugGroup(),e.handle.end(),e.boundPipeline=null},t.setPipeline=a=>{if(e.boundPipeline===a)return;e.handle.setPipeline(a.getHandle());const s=a.getPipelineDescription(),n=s.fragment?.targets;if(e.colorTextureViews.length!==n.length)console.log(`mismatched attachment counts on pipeline ${n.length} while encoder has ${e.colorTextureViews.length}`),console.trace();else for(let r=0;r<e.colorTextureViews.length;r++){const o=e.colorTextureViews[r].getTexture()?.getFormat();o&&o!==n[r].format&&(console.log(`mismatched attachments for attachment ${r} on pipeline ${n[r].format} while encoder has ${o}`),console.trace())}if(!!e.depthTextureView!="depthStencil"in s)console.log("mismatched depth attachments"),console.trace();else if(e.depthTextureView){const r=e.depthTextureView.getTexture()?.getFormat();r&&r!==s.depthStencil.format&&(console.log(`mismatched depth attachments on pipeline ${s.depthStencil.format} while encoder has ${r}`),console.trace())}e.boundPipeline=a},t.replaceShaderCode=a=>{e.replaceShaderCodeFunction(a)},t.setColorTextureView=(a,s)=>{e.colorTextureViews[a]!==s&&(e.colorTextureViews[a]=s)},t.activateBindGroup=a=>{const s=e.boundPipeline.getDevice(),n=e.boundPipeline.getBindGroupLayoutIndex(a.getLabel());if(n<0){un(`vtkWebGPURenderEncoder: could not find bind group layout ${a.getLabel()}`);return}e.handle.setBindGroup(n,a.getBindGroup(s));const r=s.getBindGroupLayoutDescription(a.getBindGroupLayout(s)),o=s.getBindGroupLayoutDescription(e.boundPipeline.getBindGroupLayout(n));r!==o&&(console.log(`renderEncoder ${e.pipelineHash} mismatched bind group layouts bind group has
|
|
4
4
|
${r}
|
package/dist/index.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap"
|
|
13
13
|
rel="stylesheet"
|
|
14
14
|
/>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-Dtsm0q-Z.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CIblWv2u.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<!-- ARGUS's own four sounds, synthesised rather than borrowed
|
|
@@ -308,6 +308,8 @@
|
|
|
308
308
|
<button class="strategy-pill universe-view" title="every feed its own molecule, or the shapes folded to one molecule each">FEEDS</button>
|
|
309
309
|
<button class="strategy-pill universe-scale" title="what sizes a sphere: its jobs (log scale) or nothing, every sphere alike">JOBS</button>
|
|
310
310
|
<button class="strategy-pill universe-density" title="a stage as one sphere with its count (SHAPE), or every job as its own point (CENSUS)">SHAPE</button>
|
|
311
|
+
<button class="strategy-pill universe-arrangement" title="the space's own emergent shape (GALAXY), each feed a spoke from its shape's hub (SPOKES), or the feeds packed round it (CLUMPS)">GALAXY</button>
|
|
312
|
+
<button class="strategy-pill universe-draw" title="every sphere a point of light (STARS), or lit and solid (SPHERES); a feed you enter is always solid">STARS</button>
|
|
311
313
|
<button class="strategy-pill universe-gravity" title="mass-weighted centring: what gathers the clusters (a knob for play; universe physics … by word)">GRAVITY ON</button>
|
|
312
314
|
<button class="strategy-pill universe-refresh" title="ask the session for the space again">REFRESH</button>
|
|
313
315
|
<button class="strategy-pill universe-open" title="this feed in a RUNS pane of its own">OPEN FEED</button>
|