@fnndsc/argus 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Settings-DScSRN4w.js → Settings-CpJHgU8P.js} +1 -1
- package/dist/assets/{Texture-C5SfDh5g.js → Texture-BFywN4BL.js} +1 -1
- package/dist/assets/{addVolumesToViewports-BVAFib39.js → addVolumesToViewports-CKWYzwhw.js} +1 -1
- package/dist/assets/cornerstoneEngine-DgoPMn1N.js +2 -0
- package/dist/assets/index-Bm3uV1GS.js +4231 -0
- package/dist/assets/index-CIblWv2u.css +1 -0
- package/dist/assets/{index-D9ut-XoL.js → index-CWklH47t.js} +1 -1
- package/dist/assets/{index-g0L5iAkX.js → index-Cdc7wwHW.js} +1 -1
- package/dist/assets/{index-Cp_HszKm.js → index-CokKuJob.js} +1 -1
- package/dist/assets/{index-uGrOO66a.js → index-DSjYEFdg.js} +1 -1
- package/dist/assets/{index-Cu42vM8O.js → index-DfeCnMQa.js} +1 -1
- package/dist/assets/{index-D1rU7b6p.js → index-TqVFBkTw.js} +1 -1
- package/dist/assets/layoutWorker-DqMRqv-I.js +1 -0
- package/dist/assets/niivueEngine-DSlA46Rh.js +2 -0
- package/dist/assets/{slabScene-DlAXLC-K.js → slabScene-D4-P_5n2.js} +1 -1
- package/dist/index.html +3 -2
- package/package.json +1 -1
- package/dist/assets/cornerstoneEngine-CZtg0zW5.js +0 -2
- package/dist/assets/index-CockqLgs.css +0 -1
- package/dist/assets/index-ZX_UE_97.js +0 -4189
- package/dist/assets/niivueEngine-BvSlE0Vd.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as H,B as U,t as E,E as M,g as L,a as W,b as S,u as G,s as $,V as q,c as Z,e as y,i as F,d as k,f as v,R as O,h as J,j as K,k as Y,l as Q,m as X,n as ee,o as te,p as ne,r as se,q as oe,w as ie,x as ae,y as re,z as de,A as ce,C as le,D as ge,F as me,G as he,I as ue,H as pe,J as N,S as xe,K as j,L as we,M as fe,N as Ie,O as Ve,P as Ce,Q as Pe,W as De,T as Re,U as Se,X as ve,Y as Ee,Z as Me,_ as _e,$ as Ge,a0 as ye,a1 as be,a2 as ze,a3 as Te,a4 as We,a5 as Fe,a6 as ke,a7 as Oe,a8 as Ae,a9 as Le,aa as Ne,ab as je}from"./Settings-DScSRN4w.js";import{ac as xt,ad as wt,ae as ft,af as It,ag as Vt,ah as Ct,ai as Pt,aj as Dt,ak as Rt,al as St,am as vt,an as Et,ao as Mt,ap as _t,aq as Gt,ar as yt,as as bt,at as zt,au as Tt,av as Wt,aw as Ft,ax as kt,ay as Ot,az as At,aA as Lt,aB as Nt,aC as jt,aD as Bt,aE as Ht,aF as Ut,aG as $t,aH as qt,aI as Zt,aJ as Jt,aK as Kt,aL as Yt,aM as Qt,aN as Xt,aO as en,aP as tn,aQ as nn,aR as sn,aS as on,aT as an,aU as rn,aV as dn,aW as cn,aX as ln,aY as gn,aZ as mn,aO as hn,a_ as un,a$ as pn,b0 as xn,b1 as wn,b2 as fn,b3 as In,b4 as Vn,b5 as Cn,b6 as Pn}from"./Settings-DScSRN4w.js";import{a as Be,T as He}from"./index-Cp_HszKm.js";import{g as Rn,b as Sn,c as vn,d as En,s as Mn,u as _n,v as Gn,e as yn,f as bn,h as zn}from"./index-Cp_HszKm.js";import"./cornerstoneEngine-CZtg0zW5.js";import"./Texture-C5SfDh5g.js";import{a as Wn}from"./addVolumesToViewports-BVAFib39.js";import"./dcmjs.es-DfWkgqfk.js";import"./index-ZX_UE_97.js";import"./_commonjsHelpers-CE1G-McA.js";function rt(l,e,t){for(const n of t){const o=l.getViewport(n);if(!o)throw new Error(`Viewport with Id ${n} does not exist`);if(!o.addImages){console.warn(`Viewport with Id ${n} does not have addImages. Cannot add image segmentation to this viewport.`);return}}t.forEach(n=>{l.getViewport(n).addImages(e)})}class Ue{constructor(e,t=""){this.contexts=[],this.offScreenCanvasContainers=[],this.viewportToContext=new Map,this.viewportSizes=new Map,this.contextMaxSizes=new Map;for(let n=0;n<e;n++){const o=H.newInstance(),s=document.createElement("div");o.setContainer(s),Be(o,t,n),this.contexts.push(o),this.offScreenCanvasContainers.push(s)}}getContextByIndex(e){return e>=0&&e<this.contexts.length?{context:this.contexts[e],container:this.offScreenCanvasContainers[e]}:null}assignViewportToContext(e,t){this.viewportToContext.set(e,t)}getContextIndexForViewport(e){return this.viewportToContext.get(e)}getAllContexts(){return this.contexts}getContextCount(){return this.contexts.length}updateViewportSize(e,t,n){const o=this.viewportToContext.get(e);if(o===void 0)return!1;this.viewportSizes.set(e,{width:t,height:n});const s=this.contextMaxSizes.get(o),i=this.calculateMaxSizeForContext(o);return this.contextMaxSizes.set(o,i),!s||s.width!==i.width||s.height!==i.height}getMaxSizeForContext(e){return this.contextMaxSizes.get(e)}calculateMaxSizeForContext(e){let t=0,n=0;return this.viewportToContext.forEach((o,s)=>{if(o===e){const i=this.viewportSizes.get(s);i&&(t=Math.max(t,i.width),n=Math.max(n,i.height))}}),{width:t,height:n}}removeViewport(e){const t=this.viewportToContext.get(e);if(this.viewportToContext.delete(e),this.viewportSizes.delete(e),t!==void 0){const n=this.calculateMaxSizeForContext(t);this.contextMaxSizes.set(t,n)}}destroy(){this.contexts.forEach(e=>{e.delete()}),this.contexts=[],this.offScreenCanvasContainers=[],this.viewportToContext.clear(),this.viewportSizes.clear(),this.contextMaxSizes.clear()}}class A extends U{constructor(e){super(e),this._renderFlaggedViewports=()=>{this._throwIfDestroyed();const n=this._getViewportsAsArray().filter(s=>this._needsRender.has(s.id));if(n.length===0){this._animationFrameSet=!1,this._animationFrameHandle=null;return}const o=n.map(s=>{const i=this.renderViewportUsingCustomOrVtkPipeline(s);return s.setRendered(),this._needsRender.delete(s.id),i});this._animationFrameSet=!1,this._animationFrameHandle=null,o.forEach(s=>{s?.element&&E(s.element,M.IMAGE_RENDERED,s)})},this.useCPURendering||this.ensureContextPool()}ensureContextPool(){if(!this.contextPool){const{rendering:e}=L(),{webGlContextCount:t}=e;this.contextPool=new Ue(t,this.id)}return this.contextPool}enableVTKjsDrivenViewport(e){const o=this._getViewportsAsArray().filter(a=>W(a.type)===!1).map(a=>a.canvas),s=S(e.element);G(s),o.push(s);const i={...e,canvas:s};this.addVtkjsDrivenViewport(i)}addVtkjsDrivenViewport(e){const t=this.ensureContextPool(),{element:n,canvas:o,viewportId:s,type:i,defaultOptions:a}=e;n.tabIndex=-1,$(n);let r=0;if(i===q.STACK){const u=t.getAllContexts();r=this._viewports.size%u.length}t.assignViewportToContext(s,r),t.updateViewportSize(s,o.width,o.height);const d=t.getContextByIndex(r),{context:g,container:m}=d,p=t.getMaxSizeForContext(r);m.width=p.width,m.height=p.height,g.resize(),g.addRenderer({viewport:[0,0,1,1],id:s,background:a.background?a.background:[0,0,0]});const x={id:s,element:n,renderingEngineId:this.id,type:i,canvas:o,sx:0,sy:0,sWidth:o.width,sHeight:o.height,defaultOptions:a||{}},f=Z(e);if(!f)throw new Error(`Viewport Type ${i} is not supported`);const h=new f(x);h.requestedType=e.requestedType??i,this._viewports.set(s,h);const c={element:n,viewportId:s,renderingEngineId:this.id};h.suppressEvents||E(y,M.ELEMENT_ENABLED,c)}setVtkjsDrivenViewports(e){if(e.length){const t=e.map(n=>S(n.element));t.forEach(n=>G(n));for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i={...o,canvas:s};this.addVtkjsDrivenViewport(i)}}}_getDisplayedSize(e){const t=window.devicePixelRatio||1,n=F(e)?e.element:S(e.element);return{displayedWidth:Math.round(n.clientWidth*t),displayedHeight:Math.round(n.clientHeight*t)}}_resizeVTKViewports(e,t=!0,n=!0){const o=[];for(const s of e){const i=S(s.element),{displayedWidth:a,displayedHeight:r}=this._getDisplayedSize(s);if(a===0||r===0)continue;const d=i.width,g=i.height;a===d&&r===g||o.push(s)}if(o.length!==0){for(const s of o){const{displayedWidth:i,displayedHeight:a}=this._getDisplayedSize(s),r=Math.max(v,i),d=Math.max(v,a);s.sWidth=r,s.sHeight=d}this._animationFrameSet||(e.length&&this._resize(e),e.forEach(s=>{if(s.resize?.(),F(s))return;const i=s.getCamera(),a=s.getRotation?.()??0,{flipHorizontal:r}=i,d=s;d.resetViewStateForResize?d.resetViewStateForResize():d.resetCameraForResize?.();const g=s.getDisplayArea();t&&(g?(r&&s.setCamera({flipHorizontal:r}),a&&s.setViewPresentation({rotation:a})):s.setCamera(i))}),n&&this.render())}}renderViewportUsingCustomOrVtkPipeline(e){if(k(e))return e.customRenderViewportToCanvas();if(!this.contextPool)throw new Error("GPU not available, and using a viewport with no custom render pipeline.");const t=this.contextPool.getContextIndexForViewport(e.id),n=this.contextPool.getContextByIndex(t),{context:o,container:s}=n;return this._renderViewportWithContext(e,o,s)}_renderViewportWithContext(e,t,n){if(e.canvas.clientWidth===0||e.canvas.clientHeight===0)return;if(e.sWidth<v||e.sHeight<v){console.warn("Viewport is too small",e.sWidth,e.sHeight);return}if(k(e))return e.customRenderViewportToCanvas();if(!this.contextPool)throw new Error("GPU not available, and using a viewport with no custom render pipeline.");t.getRenderer(e.id)||t.addRenderer({viewport:[0,0,1,1],id:e.id,background:e.defaultOptions?.background||[0,0,0]});const o=t.getRenderWindow(),s=o.getViews()[0],i=s.getRenderPasses(),a=this.getViewportRenderPasses(e.id);a&&s.setRenderPasses(a),this._resizeOffScreenCanvasForViewport(e,n,t);const r=t.getRenderer(e.id),d=this.contextPool.getContextIndexForViewport(e.id),g=this.contextPool.getMaxSizeForContext(d),m=e.sWidth,p=e.sHeight,x=Math.min(1,m/g.width),f=Math.min(1,p/g.height);r.setViewport(0,0,x,f);const h=t.getRenderers();h.forEach(({renderer:w,id:V})=>{const _=V.split("::")[0];w.setDraw(_===e.id)});const c=this.getWidgetRenderers();c.forEach((w,V)=>{V.setDraw(w===e.id)}),o.render(),h.forEach(({renderer:w})=>w.setDraw(!1)),c.forEach((w,V)=>{V.setDraw(!1)}),i&&s.setRenderPasses(i);const I=t.getOpenGLRenderWindow().get3DContext().canvas;return this._copyToOnscreenCanvas(e,I)}_renderViewportFromVtkCanvasToOnscreenCanvas(e,t){return this._copyToOnscreenCanvas(e,t)}_resizeOffScreenCanvasForViewport(e,t,n){const o=this.contextPool.getContextIndexForViewport(e.id);if(o===void 0||!this.contextPool.updateViewportSize(e.id,e.sWidth,e.sHeight))return;const i=this.contextPool.getMaxSizeForContext(o);t.width===i.width&&t.height===i.height||(t.width=i.width,t.height=i.height,n.resize())}_copyToOnscreenCanvas(e,t){const{element:n,canvas:o,id:s,renderingEngineId:i,suppressEvents:a}=e,r=e.sWidth,d=e.sHeight;G(o,{width:r,height:d});const g=o.getContext("2d"),m=this.contextPool.getContextIndexForViewport(s),x=this.contextPool.getMaxSizeForContext(m).height-d;return g.drawImage(t,0,x,r,d,0,0,r,d),{element:n,suppressEvents:a,viewportId:s,renderingEngineId:i,viewportStatus:e.viewportStatus}}_resize(e){const t=new Set;for(const n of e){n.sx=0,n.sy=0;const o=this.contextPool.getContextIndexForViewport(n.id);this.contextPool.updateViewportSize(n.id,n.sWidth,n.sHeight)&&t.add(o);const i=this.contextPool.getContextByIndex(o),{context:a}=i,r=a.getRenderer(n.id),d=this.contextPool.getMaxSizeForContext(o),g=Math.min(1,n.sWidth/d.width),m=Math.min(1,n.sHeight/d.height);r.setViewport(0,0,g,m)}t.forEach(n=>{const o=this.contextPool.getContextByIndex(n);if(o){const{context:s,container:i}=o,a=this.contextPool.getMaxSizeForContext(n);i.width=a.width,i.height=a.height,s.resize()}})}getWidgetRenderers(){const e=this._getViewportsAsArray(),t=new Map;return e.forEach(n=>{(n.getWidgets?n.getWidgets():[]).forEach(s=>{const i=s.getRenderer?s.getRenderer():null;i&&t.set(i,n.id)})}),t}getViewportRenderPasses(e){const t=this.getViewport(e);return t?.getRenderPasses?t.getRenderPasses():null}getRenderer(e){const t=this.contextPool?.getContextIndexForViewport(e);if(t===void 0||!this.contextPool)return;const n=this.contextPool.getContextByIndex(t);if(!n)return;const{context:o}=n;return o.getRenderer(e)}disableElement(e){const t=this.getViewport(e);if(t&&(super.disableElement(e),!W(t.type)&&this.contextPool)){const n=this.contextPool.getContextIndexForViewport(e);if(n!==void 0){const o=this.contextPool.getContextByIndex(n);if(o){const{context:s}=o;s.removeRenderer(e)}}this.contextPool.removeViewport(e)}}destroy(){super.destroy(),this.contextPool&&this.contextPool.destroy()}getOffscreenMultiRenderWindow(e){if(!this.contextPool)throw new Error("Offscreen multi render window is not available.");const t=this.contextPool.getContextIndexForViewport(e);if(t===void 0)throw new Error(`Offscreen multi render window is not available for viewport ${e}.`);const n=this.contextPool.getContextByIndex(t);if(!n)throw new Error(`Offscreen multi render window is not available for viewport ${e}.`);return n.context}}class dt{constructor(e){const n=L()?.rendering?.renderingEngineMode;switch(n){case O.Tiled:this._implementation=new He(e);break;case O.ContextPool:this._implementation=new A(e);break;default:console.warn(`RenderingEngine: Unknown rendering engine mode "${n}". Defaulting to Next rendering engine.`),this._implementation=new A(e);break}}get id(){return this._implementation.id}disableViewport(e){return this._implementation.disableElement(e)}enableElement(e){return this._implementation.enableElement(e)}disableElement(e){return this._implementation.disableElement(e)}setViewports(e){return this._implementation.setViewports(e)}resize(e=!0,t=!0){return this._implementation.resize(e,t)}getViewport(e){return this._implementation.getViewport(e)}getViewports(){return this._implementation.getViewports()}getRenderer(e){return this._implementation.getRenderer(e)}fillCanvasWithBackgroundColor(e,t){return this._implementation.fillCanvasWithBackgroundColor(e,t)}render(){return this._implementation.render()}renderViewports(e){return this._implementation.renderViewports(e)}renderViewport(e){return this._implementation.renderViewport(e)}destroy(){return this._implementation.destroy()}getOffscreenMultiRenderWindow(e){return this._implementation.getOffscreenMultiRenderWindow(e)}}const $e={adapter:K,getSnapshot:J},qe={adapter:Q,getSnapshot:Y},Ze={adapter:de,getSnapshot:re,getZoom:ae,getScale:ie,getPan:oe,resolveICamera:se,derivePresentation:ne,applyToRenderer:te,createImageSliceBasis:ee,createVolumeSliceBasis:X},Je={adapter:le,getSnapshot:ce},Ke={adapter:me,getSnapshot:ge},ct="5.8.2";class Ye extends he{constructor(e,t){super(e,t),this._dimensionGroupNumber=1,this._loadedDimensionGroups=new Set,this._getImageIdRequests=(s,i)=>this.getImageIdsRequests(s,i),this.getImageLoadRequests=s=>{const i=this.getImageIdsToLoad();return this._getImageIdRequests(i,s)};const{imageIdGroups:n,splittingTag:o}=e;this._splittingTag=o,this._imageIdGroups=n,this.numDimensionGroups=this._imageIdGroups.length}_getImageIdsToLoad(){const e=this._imageIdGroups,t=this._dimensionGroupNumber-1,n=[...e[t]];let o=t-1,s=t+1;for(;o>=0||s<e.length;)o>=0&&n.push(...e[o--]),s<e.length&&n.push(...e[s++]);return n}getImageIdsToLoad(){return this._getImageIdsToLoad()}get dimensionGroupNumber(){return this._dimensionGroupNumber}set dimensionGroupNumber(e){this._dimensionGroupNumber!==e&&(this._dimensionGroupNumber=e,this.voxelManager.setDimensionGroupNumber(e),this.invalidateVolume(!0),E(y,M.DYNAMIC_VOLUME_DIMENSION_GROUP_CHANGED,{volumeId:this.volumeId,dimensionGroupNumber:e,numDimensionGroups:this.numDimensionGroups,imageIdGroupIndex:e-1,numImageIdGroups:this.numDimensionGroups,splittingTag:this.splittingTag}))}scroll(e){const t=this._dimensionGroupNumber+e;t<1?this.dimensionGroupNumber=this.numDimensionGroups:t>this.numDimensionGroups?this.dimensionGroupNumber=1:this.dimensionGroupNumber=t}getCurrentDimensionGroupImageIds(){return this._imageIdGroups[this._dimensionGroupNumber-1]}flatImageIdIndexToDimensionGroupNumber(e){return Math.floor(e/this._imageIdGroups[0].length)+1}flatImageIdIndexToImageIdIndex(e){return e%this._imageIdGroups[0].length}get splittingTag(){return this._splittingTag}isDimensionGroupLoaded(e){return this._loadedDimensionGroups.has(e)}markDimensionGroupAsLoaded(e){this._loadedDimensionGroups.add(e),E(y,M.DYNAMIC_VOLUME_DIMENSION_GROUP_LOADED,{volumeId:this.volumeId,dimensionGroupNumber:e})}checkDimensionGroupCompletion(e){const t=this.flatImageIdIndexToDimensionGroupNumber(e);this._imageIdGroups[t-1].every(s=>{const i=this.getImageIdIndex(s);return this.cachedFrames[i]===ue.FULL_RESOLUTION})&&!this.isDimensionGroupLoaded(t)&&this.markDimensionGroupAsLoaded(t)}}function Qe(l,e,t){return e.reduce((n,o)=>o.apply(n,t),l)}const Xe={name:"InPlaneDecimationModifier",apply(l,e){const[t=1,n=t]=e.options.ijkDecimation??[],o=Math.max(1,Math.floor(t)),s=Math.max(1,Math.floor(n));if(o===1&&s===1)return l;const[i,a]=l.dimensions,r=Math.max(1,Math.floor(i/o)),d=Math.max(1,Math.floor(a/s)),g=[r,d,l.dimensions[2]],m=[l.spacing[0]*o,l.spacing[1]*s,l.spacing[2]],p={...l.metadata,Columns:r,Rows:d,PixelSpacing:[m[1],m[0]]};return{...l,dimensions:g,spacing:m,metadata:p}}};function lt(l,e){if(!e||!e.imageIds||!e.imageIds.length)throw new Error("ImageIds must be provided to create a streaming image volume ");const[t=1,n=t,o=1]=e.ijkDecimation??[],s=Math.max(1,Math.floor(t)),i=n>1?Math.max(1,Math.floor(n)):s,a=Math.max(1,Math.floor(o)),r=s>1||i>1,d={ijkDecimation:[s,i,a]},g=[Xe];function m(c,u){return u===1?c:`${c}#decimation=${u}`}const p=Math.floor(e.imageIds.length/a),x=a>1&&e.imageIds.length<=p+1;if(a>1&&!x){const c=pe(e.imageIds,a),u=Array.isArray(c)&&c.length&&typeof c[0]=="number"?c.map(P=>e.imageIds[P]):c;e.imageIds=u}s>1&&(e.imageIds=e.imageIds.map(c=>m(c,s)));async function f(){const c=N(e.imageIds,l),u={volumeId:l,imageIds:e.imageIds,options:d},P=Qe(c,g,u),{dimensions:I,spacing:R,origin:w,direction:V,metadata:_,imageIds:b,dataType:B,numberOfComponents:z}=P,C=new xe({volumeId:l,metadata:_,dimensions:I,spacing:R,origin:w,direction:V,imageIds:b,dataType:B,numberOfComponents:z},{imageIds:b,loadStatus:{loaded:!1,loading:!1,cancelled:!1,cachedFrames:[],callbacks:[]}});if(r){const D=C.imageData;D&&(D.setDimensions(C.dimensions),D.setSpacing(C.spacing),D.modified());const T=j.createImageVolumeVoxelManager({dimensions:C.dimensions,imageIds:C.imageIds,numberOfComponents:z});C.voxelManager=T,D&&D.set({voxelManager:T})}return C}const h=f();return{promise:h,decache:()=>{h.then(c=>{c.destroy(),c=null})},cancel:()=>{h.then(c=>{c.cancelLoading()})}}}function gt(l,e){if(!e||!e.imageIds||!e.imageIds.length)throw new Error("ImageIds must be provided to create a 4D streaming image volume");const{imageIds:t}=e,{splittingTag:n,imageIdGroups:o}=we(t),s=Math.floor(o.length/2),i=N(o[s],l),{metadata:a,dimensions:r,spacing:d,direction:g,sizeInBytes:m,origin:p,numberOfComponents:x,dataType:f}=i,h=g.slice(6,9),c=o.map(R=>fe(R,h).sortedImageIds),u=c.flat(),P=j.createScalarDynamicVolumeVoxelManager({dimensions:r,imageIdGroups:c,dimensionGroupNumber:1,numberOfComponents:x});let I=new Ye({volumeId:l,metadata:a,dimensions:r,spacing:d,origin:p,direction:g,sizeInBytes:m,imageIds:u,imageIdGroups:c,splittingTag:n,voxelManager:P,numberOfComponents:x,dataType:f},{imageIds:u,loadStatus:{loaded:!1,loading:!1,cancelled:!1,cachedFrames:[],callbacks:[]}});return{promise:Promise.resolve(I),decache:()=>{I.destroy(),I=null},cancel:()=>{I.cancelLoading()}}}const mt={GenericViewport:je,DefaultRenderPathResolver:Ne,defaultRenderPathResolver:Le,ECGGenericViewport:Ae,createDefaultECGRenderPaths:Oe,createECGRenderPathResolver:ke,DefaultECGDataProvider:Fe,ecgProjection:$e,VideoGenericViewport:We,createDefaultVideoRenderPaths:Te,createVideoRenderPathResolver:ze,DefaultVideoDataProvider:be,videoProjection:qe,PlanarViewport:ye,createDefaultPlanarRenderPaths:Ge,createPlanarRenderPathResolver:_e,DefaultPlanarDataProvider:Me,planarProjection:Ze,VolumeViewport3D:Ee,createDefaultVolume3DRenderPaths:ve,createVolume3DRenderPathResolver:Se,DefaultVolume3DDataProvider:Re,volume3DProjection:Je,WSIGenericViewport:De,createDefaultWSIRenderPaths:Pe,createWSIRenderPathResolver:Ce,DefaultWSIDataProvider:Ve,wsiProjection:Ke},ht=Ie;export{xt as ActorRenderMode,U as BaseRenderingEngine,wt as BaseVolumeViewport,ft as CONSTANTS,A as ContextPoolRenderingEngine,Fe as DefaultECGDataProvider,Me as DefaultPlanarDataProvider,Ne as DefaultRenderPathResolver,be as DefaultVideoDataProvider,Re as DefaultVolume3DDataProvider,Ve as DefaultWSIDataProvider,Ae as ECGGenericViewport,It as ECGViewport,Vt as EPSILON,M as EVENTS,Ct as Enums,je as GenericViewport,Ee as GenericVolumeViewport3D,Pt as ImageVolume,ht as LegacyVolumeViewport3D,ye as PlanarViewport,Dt as ProgressiveRetrieveImages,Rt as RenderBackends,dt as RenderingEngine,St as Settings,vt as StackViewport,Ye as StreamingDynamicImageVolume,xe as StreamingImageVolume,Et as Surface,He as TiledRenderingEngine,We as VideoGenericViewport,Mt as VideoViewport,_t as Viewport,Gt as ViewportProjectionService,yt as VolumeViewport,Ie as VolumeViewport3D,De as WSIGenericViewport,bt as WSIViewport,rt as addImageSlicesToViewports,Wn as addVolumesToViewports,zt as cache,Tt as canRenderFloatTextures,Wt as convertColorArrayToRgbString,Ft as convertMapperToNotSharedMapper,kt as cornerstoneMeshLoader,gt as cornerstoneStreamingDynamicImageVolumeLoader,Ot as cornerstoneStreamingImageVolumeLoader,At as createCanvas,Oe as createDefaultECGRenderPaths,Ge as createDefaultPlanarRenderPaths,Te as createDefaultVideoRenderPaths,ve as createDefaultVolume3DRenderPaths,Pe as createDefaultWSIRenderPaths,ke as createECGRenderPathResolver,_e as createPlanarRenderPathResolver,ze as createVideoRenderPathResolver,Lt as createViewportElement,Se as createVolume3DRenderPathResolver,Nt as createVolumeActor,jt as createVolumeMapper,Ce as createWSIRenderPathResolver,lt as decimatedVolumeLoader,Le as defaultRenderPathResolver,Bt as detectRenderingCapabilities,$e as ecgProjection,y as eventTarget,Ht as geometryLoader,L as getConfiguration,Ut as getEffectiveRenderBackend,Rn as getEnabledElement,Sn as getEnabledElementByIds,vn as getEnabledElementByViewportId,En as getEnabledElements,S as getOrCreateCanvas,$t as getProjectionScaleMatrix,qt as getRenderBackend,Zt as getRenderingCapabilities,Jt as getRenderingEngine,Kt as getRenderingEngines,Yt as getShouldUseCPURendering,Qt as getUseGenericViewport,Xt as getWebWorkerManager,en as imageLoadPoolManager,tn as imageLoader,nn as imageRetrievalPoolManager,sn as init,on as isCornerstoneInitialized,an as isRegisteredRenderBackend,rn as isRegisteredViewportType,dn as metaData,cn as peerImport,Ze as planarProjection,ln as registerImageLoader,gn as registerRenderBackend,mn as registerViewportType,mt as renderingEngineExportsV2,hn as requestPoolManager,un as resetInitialization,pn as resetUseCPURendering,xn as setCanvasCreator,wn as setConfiguration,fn as setPreferSizeOverAccuracy,In as setRenderBackend,Vn as setUseCPURendering,Mn as setVolumesForViewports,E as triggerEvent,G as updateCanvasSizeAndAspectRatio,_n as utilities,ct as version,qe as videoProjection,Gn as viewportHasCanvasWorldTransform,yn as viewportHasFrameOfReferenceUID,bn as viewportHasPan,zn as viewportHasZoom,Cn as viewportProjection,Je as volume3DProjection,Pn as volumeLoader,Ke as wsiProjection};
|
|
1
|
+
import{v as H,B as U,t as E,E as M,g as L,a as W,b as S,u as G,s as $,V as q,c as Z,e as y,i as F,d as k,f as v,R as O,h as J,j as K,k as Y,l as Q,m as X,n as ee,o as te,p as ne,r as se,q as oe,w as ie,x as ae,y as re,z as de,A as ce,C as le,D as ge,F as me,G as he,I as ue,H as pe,J as N,S as xe,K as j,L as we,M as fe,N as Ie,O as Ve,P as Ce,Q as Pe,W as De,T as Re,U as Se,X as ve,Y as Ee,Z as Me,_ as _e,$ as Ge,a0 as ye,a1 as be,a2 as ze,a3 as Te,a4 as We,a5 as Fe,a6 as ke,a7 as Oe,a8 as Ae,a9 as Le,aa as Ne,ab as je}from"./Settings-CpJHgU8P.js";import{ac as xt,ad as wt,ae as ft,af as It,ag as Vt,ah as Ct,ai as Pt,aj as Dt,ak as Rt,al as St,am as vt,an as Et,ao as Mt,ap as _t,aq as Gt,ar as yt,as as bt,at as zt,au as Tt,av as Wt,aw as Ft,ax as kt,ay as Ot,az as At,aA as Lt,aB as Nt,aC as jt,aD as Bt,aE as Ht,aF as Ut,aG as $t,aH as qt,aI as Zt,aJ as Jt,aK as Kt,aL as Yt,aM as Qt,aN as Xt,aO as en,aP as tn,aQ as nn,aR as sn,aS as on,aT as an,aU as rn,aV as dn,aW as cn,aX as ln,aY as gn,aZ as mn,aO as hn,a_ as un,a$ as pn,b0 as xn,b1 as wn,b2 as fn,b3 as In,b4 as Vn,b5 as Cn,b6 as Pn}from"./Settings-CpJHgU8P.js";import{a as Be,T as He}from"./index-CokKuJob.js";import{g as Rn,b as Sn,c as vn,d as En,s as Mn,u as _n,v as Gn,e as yn,f as bn,h as zn}from"./index-CokKuJob.js";import"./cornerstoneEngine-DgoPMn1N.js";import"./Texture-BFywN4BL.js";import{a as Wn}from"./addVolumesToViewports-CKWYzwhw.js";import"./dcmjs.es-DfWkgqfk.js";import"./index-Bm3uV1GS.js";import"./_commonjsHelpers-CE1G-McA.js";function rt(l,e,t){for(const n of t){const o=l.getViewport(n);if(!o)throw new Error(`Viewport with Id ${n} does not exist`);if(!o.addImages){console.warn(`Viewport with Id ${n} does not have addImages. Cannot add image segmentation to this viewport.`);return}}t.forEach(n=>{l.getViewport(n).addImages(e)})}class Ue{constructor(e,t=""){this.contexts=[],this.offScreenCanvasContainers=[],this.viewportToContext=new Map,this.viewportSizes=new Map,this.contextMaxSizes=new Map;for(let n=0;n<e;n++){const o=H.newInstance(),s=document.createElement("div");o.setContainer(s),Be(o,t,n),this.contexts.push(o),this.offScreenCanvasContainers.push(s)}}getContextByIndex(e){return e>=0&&e<this.contexts.length?{context:this.contexts[e],container:this.offScreenCanvasContainers[e]}:null}assignViewportToContext(e,t){this.viewportToContext.set(e,t)}getContextIndexForViewport(e){return this.viewportToContext.get(e)}getAllContexts(){return this.contexts}getContextCount(){return this.contexts.length}updateViewportSize(e,t,n){const o=this.viewportToContext.get(e);if(o===void 0)return!1;this.viewportSizes.set(e,{width:t,height:n});const s=this.contextMaxSizes.get(o),i=this.calculateMaxSizeForContext(o);return this.contextMaxSizes.set(o,i),!s||s.width!==i.width||s.height!==i.height}getMaxSizeForContext(e){return this.contextMaxSizes.get(e)}calculateMaxSizeForContext(e){let t=0,n=0;return this.viewportToContext.forEach((o,s)=>{if(o===e){const i=this.viewportSizes.get(s);i&&(t=Math.max(t,i.width),n=Math.max(n,i.height))}}),{width:t,height:n}}removeViewport(e){const t=this.viewportToContext.get(e);if(this.viewportToContext.delete(e),this.viewportSizes.delete(e),t!==void 0){const n=this.calculateMaxSizeForContext(t);this.contextMaxSizes.set(t,n)}}destroy(){this.contexts.forEach(e=>{e.delete()}),this.contexts=[],this.offScreenCanvasContainers=[],this.viewportToContext.clear(),this.viewportSizes.clear(),this.contextMaxSizes.clear()}}class A extends U{constructor(e){super(e),this._renderFlaggedViewports=()=>{this._throwIfDestroyed();const n=this._getViewportsAsArray().filter(s=>this._needsRender.has(s.id));if(n.length===0){this._animationFrameSet=!1,this._animationFrameHandle=null;return}const o=n.map(s=>{const i=this.renderViewportUsingCustomOrVtkPipeline(s);return s.setRendered(),this._needsRender.delete(s.id),i});this._animationFrameSet=!1,this._animationFrameHandle=null,o.forEach(s=>{s?.element&&E(s.element,M.IMAGE_RENDERED,s)})},this.useCPURendering||this.ensureContextPool()}ensureContextPool(){if(!this.contextPool){const{rendering:e}=L(),{webGlContextCount:t}=e;this.contextPool=new Ue(t,this.id)}return this.contextPool}enableVTKjsDrivenViewport(e){const o=this._getViewportsAsArray().filter(a=>W(a.type)===!1).map(a=>a.canvas),s=S(e.element);G(s),o.push(s);const i={...e,canvas:s};this.addVtkjsDrivenViewport(i)}addVtkjsDrivenViewport(e){const t=this.ensureContextPool(),{element:n,canvas:o,viewportId:s,type:i,defaultOptions:a}=e;n.tabIndex=-1,$(n);let r=0;if(i===q.STACK){const u=t.getAllContexts();r=this._viewports.size%u.length}t.assignViewportToContext(s,r),t.updateViewportSize(s,o.width,o.height);const d=t.getContextByIndex(r),{context:g,container:m}=d,p=t.getMaxSizeForContext(r);m.width=p.width,m.height=p.height,g.resize(),g.addRenderer({viewport:[0,0,1,1],id:s,background:a.background?a.background:[0,0,0]});const x={id:s,element:n,renderingEngineId:this.id,type:i,canvas:o,sx:0,sy:0,sWidth:o.width,sHeight:o.height,defaultOptions:a||{}},f=Z(e);if(!f)throw new Error(`Viewport Type ${i} is not supported`);const h=new f(x);h.requestedType=e.requestedType??i,this._viewports.set(s,h);const c={element:n,viewportId:s,renderingEngineId:this.id};h.suppressEvents||E(y,M.ELEMENT_ENABLED,c)}setVtkjsDrivenViewports(e){if(e.length){const t=e.map(n=>S(n.element));t.forEach(n=>G(n));for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i={...o,canvas:s};this.addVtkjsDrivenViewport(i)}}}_getDisplayedSize(e){const t=window.devicePixelRatio||1,n=F(e)?e.element:S(e.element);return{displayedWidth:Math.round(n.clientWidth*t),displayedHeight:Math.round(n.clientHeight*t)}}_resizeVTKViewports(e,t=!0,n=!0){const o=[];for(const s of e){const i=S(s.element),{displayedWidth:a,displayedHeight:r}=this._getDisplayedSize(s);if(a===0||r===0)continue;const d=i.width,g=i.height;a===d&&r===g||o.push(s)}if(o.length!==0){for(const s of o){const{displayedWidth:i,displayedHeight:a}=this._getDisplayedSize(s),r=Math.max(v,i),d=Math.max(v,a);s.sWidth=r,s.sHeight=d}this._animationFrameSet||(e.length&&this._resize(e),e.forEach(s=>{if(s.resize?.(),F(s))return;const i=s.getCamera(),a=s.getRotation?.()??0,{flipHorizontal:r}=i,d=s;d.resetViewStateForResize?d.resetViewStateForResize():d.resetCameraForResize?.();const g=s.getDisplayArea();t&&(g?(r&&s.setCamera({flipHorizontal:r}),a&&s.setViewPresentation({rotation:a})):s.setCamera(i))}),n&&this.render())}}renderViewportUsingCustomOrVtkPipeline(e){if(k(e))return e.customRenderViewportToCanvas();if(!this.contextPool)throw new Error("GPU not available, and using a viewport with no custom render pipeline.");const t=this.contextPool.getContextIndexForViewport(e.id),n=this.contextPool.getContextByIndex(t),{context:o,container:s}=n;return this._renderViewportWithContext(e,o,s)}_renderViewportWithContext(e,t,n){if(e.canvas.clientWidth===0||e.canvas.clientHeight===0)return;if(e.sWidth<v||e.sHeight<v){console.warn("Viewport is too small",e.sWidth,e.sHeight);return}if(k(e))return e.customRenderViewportToCanvas();if(!this.contextPool)throw new Error("GPU not available, and using a viewport with no custom render pipeline.");t.getRenderer(e.id)||t.addRenderer({viewport:[0,0,1,1],id:e.id,background:e.defaultOptions?.background||[0,0,0]});const o=t.getRenderWindow(),s=o.getViews()[0],i=s.getRenderPasses(),a=this.getViewportRenderPasses(e.id);a&&s.setRenderPasses(a),this._resizeOffScreenCanvasForViewport(e,n,t);const r=t.getRenderer(e.id),d=this.contextPool.getContextIndexForViewport(e.id),g=this.contextPool.getMaxSizeForContext(d),m=e.sWidth,p=e.sHeight,x=Math.min(1,m/g.width),f=Math.min(1,p/g.height);r.setViewport(0,0,x,f);const h=t.getRenderers();h.forEach(({renderer:w,id:V})=>{const _=V.split("::")[0];w.setDraw(_===e.id)});const c=this.getWidgetRenderers();c.forEach((w,V)=>{V.setDraw(w===e.id)}),o.render(),h.forEach(({renderer:w})=>w.setDraw(!1)),c.forEach((w,V)=>{V.setDraw(!1)}),i&&s.setRenderPasses(i);const I=t.getOpenGLRenderWindow().get3DContext().canvas;return this._copyToOnscreenCanvas(e,I)}_renderViewportFromVtkCanvasToOnscreenCanvas(e,t){return this._copyToOnscreenCanvas(e,t)}_resizeOffScreenCanvasForViewport(e,t,n){const o=this.contextPool.getContextIndexForViewport(e.id);if(o===void 0||!this.contextPool.updateViewportSize(e.id,e.sWidth,e.sHeight))return;const i=this.contextPool.getMaxSizeForContext(o);t.width===i.width&&t.height===i.height||(t.width=i.width,t.height=i.height,n.resize())}_copyToOnscreenCanvas(e,t){const{element:n,canvas:o,id:s,renderingEngineId:i,suppressEvents:a}=e,r=e.sWidth,d=e.sHeight;G(o,{width:r,height:d});const g=o.getContext("2d"),m=this.contextPool.getContextIndexForViewport(s),x=this.contextPool.getMaxSizeForContext(m).height-d;return g.drawImage(t,0,x,r,d,0,0,r,d),{element:n,suppressEvents:a,viewportId:s,renderingEngineId:i,viewportStatus:e.viewportStatus}}_resize(e){const t=new Set;for(const n of e){n.sx=0,n.sy=0;const o=this.contextPool.getContextIndexForViewport(n.id);this.contextPool.updateViewportSize(n.id,n.sWidth,n.sHeight)&&t.add(o);const i=this.contextPool.getContextByIndex(o),{context:a}=i,r=a.getRenderer(n.id),d=this.contextPool.getMaxSizeForContext(o),g=Math.min(1,n.sWidth/d.width),m=Math.min(1,n.sHeight/d.height);r.setViewport(0,0,g,m)}t.forEach(n=>{const o=this.contextPool.getContextByIndex(n);if(o){const{context:s,container:i}=o,a=this.contextPool.getMaxSizeForContext(n);i.width=a.width,i.height=a.height,s.resize()}})}getWidgetRenderers(){const e=this._getViewportsAsArray(),t=new Map;return e.forEach(n=>{(n.getWidgets?n.getWidgets():[]).forEach(s=>{const i=s.getRenderer?s.getRenderer():null;i&&t.set(i,n.id)})}),t}getViewportRenderPasses(e){const t=this.getViewport(e);return t?.getRenderPasses?t.getRenderPasses():null}getRenderer(e){const t=this.contextPool?.getContextIndexForViewport(e);if(t===void 0||!this.contextPool)return;const n=this.contextPool.getContextByIndex(t);if(!n)return;const{context:o}=n;return o.getRenderer(e)}disableElement(e){const t=this.getViewport(e);if(t&&(super.disableElement(e),!W(t.type)&&this.contextPool)){const n=this.contextPool.getContextIndexForViewport(e);if(n!==void 0){const o=this.contextPool.getContextByIndex(n);if(o){const{context:s}=o;s.removeRenderer(e)}}this.contextPool.removeViewport(e)}}destroy(){super.destroy(),this.contextPool&&this.contextPool.destroy()}getOffscreenMultiRenderWindow(e){if(!this.contextPool)throw new Error("Offscreen multi render window is not available.");const t=this.contextPool.getContextIndexForViewport(e);if(t===void 0)throw new Error(`Offscreen multi render window is not available for viewport ${e}.`);const n=this.contextPool.getContextByIndex(t);if(!n)throw new Error(`Offscreen multi render window is not available for viewport ${e}.`);return n.context}}class dt{constructor(e){const n=L()?.rendering?.renderingEngineMode;switch(n){case O.Tiled:this._implementation=new He(e);break;case O.ContextPool:this._implementation=new A(e);break;default:console.warn(`RenderingEngine: Unknown rendering engine mode "${n}". Defaulting to Next rendering engine.`),this._implementation=new A(e);break}}get id(){return this._implementation.id}disableViewport(e){return this._implementation.disableElement(e)}enableElement(e){return this._implementation.enableElement(e)}disableElement(e){return this._implementation.disableElement(e)}setViewports(e){return this._implementation.setViewports(e)}resize(e=!0,t=!0){return this._implementation.resize(e,t)}getViewport(e){return this._implementation.getViewport(e)}getViewports(){return this._implementation.getViewports()}getRenderer(e){return this._implementation.getRenderer(e)}fillCanvasWithBackgroundColor(e,t){return this._implementation.fillCanvasWithBackgroundColor(e,t)}render(){return this._implementation.render()}renderViewports(e){return this._implementation.renderViewports(e)}renderViewport(e){return this._implementation.renderViewport(e)}destroy(){return this._implementation.destroy()}getOffscreenMultiRenderWindow(e){return this._implementation.getOffscreenMultiRenderWindow(e)}}const $e={adapter:K,getSnapshot:J},qe={adapter:Q,getSnapshot:Y},Ze={adapter:de,getSnapshot:re,getZoom:ae,getScale:ie,getPan:oe,resolveICamera:se,derivePresentation:ne,applyToRenderer:te,createImageSliceBasis:ee,createVolumeSliceBasis:X},Je={adapter:le,getSnapshot:ce},Ke={adapter:me,getSnapshot:ge},ct="5.8.2";class Ye extends he{constructor(e,t){super(e,t),this._dimensionGroupNumber=1,this._loadedDimensionGroups=new Set,this._getImageIdRequests=(s,i)=>this.getImageIdsRequests(s,i),this.getImageLoadRequests=s=>{const i=this.getImageIdsToLoad();return this._getImageIdRequests(i,s)};const{imageIdGroups:n,splittingTag:o}=e;this._splittingTag=o,this._imageIdGroups=n,this.numDimensionGroups=this._imageIdGroups.length}_getImageIdsToLoad(){const e=this._imageIdGroups,t=this._dimensionGroupNumber-1,n=[...e[t]];let o=t-1,s=t+1;for(;o>=0||s<e.length;)o>=0&&n.push(...e[o--]),s<e.length&&n.push(...e[s++]);return n}getImageIdsToLoad(){return this._getImageIdsToLoad()}get dimensionGroupNumber(){return this._dimensionGroupNumber}set dimensionGroupNumber(e){this._dimensionGroupNumber!==e&&(this._dimensionGroupNumber=e,this.voxelManager.setDimensionGroupNumber(e),this.invalidateVolume(!0),E(y,M.DYNAMIC_VOLUME_DIMENSION_GROUP_CHANGED,{volumeId:this.volumeId,dimensionGroupNumber:e,numDimensionGroups:this.numDimensionGroups,imageIdGroupIndex:e-1,numImageIdGroups:this.numDimensionGroups,splittingTag:this.splittingTag}))}scroll(e){const t=this._dimensionGroupNumber+e;t<1?this.dimensionGroupNumber=this.numDimensionGroups:t>this.numDimensionGroups?this.dimensionGroupNumber=1:this.dimensionGroupNumber=t}getCurrentDimensionGroupImageIds(){return this._imageIdGroups[this._dimensionGroupNumber-1]}flatImageIdIndexToDimensionGroupNumber(e){return Math.floor(e/this._imageIdGroups[0].length)+1}flatImageIdIndexToImageIdIndex(e){return e%this._imageIdGroups[0].length}get splittingTag(){return this._splittingTag}isDimensionGroupLoaded(e){return this._loadedDimensionGroups.has(e)}markDimensionGroupAsLoaded(e){this._loadedDimensionGroups.add(e),E(y,M.DYNAMIC_VOLUME_DIMENSION_GROUP_LOADED,{volumeId:this.volumeId,dimensionGroupNumber:e})}checkDimensionGroupCompletion(e){const t=this.flatImageIdIndexToDimensionGroupNumber(e);this._imageIdGroups[t-1].every(s=>{const i=this.getImageIdIndex(s);return this.cachedFrames[i]===ue.FULL_RESOLUTION})&&!this.isDimensionGroupLoaded(t)&&this.markDimensionGroupAsLoaded(t)}}function Qe(l,e,t){return e.reduce((n,o)=>o.apply(n,t),l)}const Xe={name:"InPlaneDecimationModifier",apply(l,e){const[t=1,n=t]=e.options.ijkDecimation??[],o=Math.max(1,Math.floor(t)),s=Math.max(1,Math.floor(n));if(o===1&&s===1)return l;const[i,a]=l.dimensions,r=Math.max(1,Math.floor(i/o)),d=Math.max(1,Math.floor(a/s)),g=[r,d,l.dimensions[2]],m=[l.spacing[0]*o,l.spacing[1]*s,l.spacing[2]],p={...l.metadata,Columns:r,Rows:d,PixelSpacing:[m[1],m[0]]};return{...l,dimensions:g,spacing:m,metadata:p}}};function lt(l,e){if(!e||!e.imageIds||!e.imageIds.length)throw new Error("ImageIds must be provided to create a streaming image volume ");const[t=1,n=t,o=1]=e.ijkDecimation??[],s=Math.max(1,Math.floor(t)),i=n>1?Math.max(1,Math.floor(n)):s,a=Math.max(1,Math.floor(o)),r=s>1||i>1,d={ijkDecimation:[s,i,a]},g=[Xe];function m(c,u){return u===1?c:`${c}#decimation=${u}`}const p=Math.floor(e.imageIds.length/a),x=a>1&&e.imageIds.length<=p+1;if(a>1&&!x){const c=pe(e.imageIds,a),u=Array.isArray(c)&&c.length&&typeof c[0]=="number"?c.map(P=>e.imageIds[P]):c;e.imageIds=u}s>1&&(e.imageIds=e.imageIds.map(c=>m(c,s)));async function f(){const c=N(e.imageIds,l),u={volumeId:l,imageIds:e.imageIds,options:d},P=Qe(c,g,u),{dimensions:I,spacing:R,origin:w,direction:V,metadata:_,imageIds:b,dataType:B,numberOfComponents:z}=P,C=new xe({volumeId:l,metadata:_,dimensions:I,spacing:R,origin:w,direction:V,imageIds:b,dataType:B,numberOfComponents:z},{imageIds:b,loadStatus:{loaded:!1,loading:!1,cancelled:!1,cachedFrames:[],callbacks:[]}});if(r){const D=C.imageData;D&&(D.setDimensions(C.dimensions),D.setSpacing(C.spacing),D.modified());const T=j.createImageVolumeVoxelManager({dimensions:C.dimensions,imageIds:C.imageIds,numberOfComponents:z});C.voxelManager=T,D&&D.set({voxelManager:T})}return C}const h=f();return{promise:h,decache:()=>{h.then(c=>{c.destroy(),c=null})},cancel:()=>{h.then(c=>{c.cancelLoading()})}}}function gt(l,e){if(!e||!e.imageIds||!e.imageIds.length)throw new Error("ImageIds must be provided to create a 4D streaming image volume");const{imageIds:t}=e,{splittingTag:n,imageIdGroups:o}=we(t),s=Math.floor(o.length/2),i=N(o[s],l),{metadata:a,dimensions:r,spacing:d,direction:g,sizeInBytes:m,origin:p,numberOfComponents:x,dataType:f}=i,h=g.slice(6,9),c=o.map(R=>fe(R,h).sortedImageIds),u=c.flat(),P=j.createScalarDynamicVolumeVoxelManager({dimensions:r,imageIdGroups:c,dimensionGroupNumber:1,numberOfComponents:x});let I=new Ye({volumeId:l,metadata:a,dimensions:r,spacing:d,origin:p,direction:g,sizeInBytes:m,imageIds:u,imageIdGroups:c,splittingTag:n,voxelManager:P,numberOfComponents:x,dataType:f},{imageIds:u,loadStatus:{loaded:!1,loading:!1,cancelled:!1,cachedFrames:[],callbacks:[]}});return{promise:Promise.resolve(I),decache:()=>{I.destroy(),I=null},cancel:()=>{I.cancelLoading()}}}const mt={GenericViewport:je,DefaultRenderPathResolver:Ne,defaultRenderPathResolver:Le,ECGGenericViewport:Ae,createDefaultECGRenderPaths:Oe,createECGRenderPathResolver:ke,DefaultECGDataProvider:Fe,ecgProjection:$e,VideoGenericViewport:We,createDefaultVideoRenderPaths:Te,createVideoRenderPathResolver:ze,DefaultVideoDataProvider:be,videoProjection:qe,PlanarViewport:ye,createDefaultPlanarRenderPaths:Ge,createPlanarRenderPathResolver:_e,DefaultPlanarDataProvider:Me,planarProjection:Ze,VolumeViewport3D:Ee,createDefaultVolume3DRenderPaths:ve,createVolume3DRenderPathResolver:Se,DefaultVolume3DDataProvider:Re,volume3DProjection:Je,WSIGenericViewport:De,createDefaultWSIRenderPaths:Pe,createWSIRenderPathResolver:Ce,DefaultWSIDataProvider:Ve,wsiProjection:Ke},ht=Ie;export{xt as ActorRenderMode,U as BaseRenderingEngine,wt as BaseVolumeViewport,ft as CONSTANTS,A as ContextPoolRenderingEngine,Fe as DefaultECGDataProvider,Me as DefaultPlanarDataProvider,Ne as DefaultRenderPathResolver,be as DefaultVideoDataProvider,Re as DefaultVolume3DDataProvider,Ve as DefaultWSIDataProvider,Ae as ECGGenericViewport,It as ECGViewport,Vt as EPSILON,M as EVENTS,Ct as Enums,je as GenericViewport,Ee as GenericVolumeViewport3D,Pt as ImageVolume,ht as LegacyVolumeViewport3D,ye as PlanarViewport,Dt as ProgressiveRetrieveImages,Rt as RenderBackends,dt as RenderingEngine,St as Settings,vt as StackViewport,Ye as StreamingDynamicImageVolume,xe as StreamingImageVolume,Et as Surface,He as TiledRenderingEngine,We as VideoGenericViewport,Mt as VideoViewport,_t as Viewport,Gt as ViewportProjectionService,yt as VolumeViewport,Ie as VolumeViewport3D,De as WSIGenericViewport,bt as WSIViewport,rt as addImageSlicesToViewports,Wn as addVolumesToViewports,zt as cache,Tt as canRenderFloatTextures,Wt as convertColorArrayToRgbString,Ft as convertMapperToNotSharedMapper,kt as cornerstoneMeshLoader,gt as cornerstoneStreamingDynamicImageVolumeLoader,Ot as cornerstoneStreamingImageVolumeLoader,At as createCanvas,Oe as createDefaultECGRenderPaths,Ge as createDefaultPlanarRenderPaths,Te as createDefaultVideoRenderPaths,ve as createDefaultVolume3DRenderPaths,Pe as createDefaultWSIRenderPaths,ke as createECGRenderPathResolver,_e as createPlanarRenderPathResolver,ze as createVideoRenderPathResolver,Lt as createViewportElement,Se as createVolume3DRenderPathResolver,Nt as createVolumeActor,jt as createVolumeMapper,Ce as createWSIRenderPathResolver,lt as decimatedVolumeLoader,Le as defaultRenderPathResolver,Bt as detectRenderingCapabilities,$e as ecgProjection,y as eventTarget,Ht as geometryLoader,L as getConfiguration,Ut as getEffectiveRenderBackend,Rn as getEnabledElement,Sn as getEnabledElementByIds,vn as getEnabledElementByViewportId,En as getEnabledElements,S as getOrCreateCanvas,$t as getProjectionScaleMatrix,qt as getRenderBackend,Zt as getRenderingCapabilities,Jt as getRenderingEngine,Kt as getRenderingEngines,Yt as getShouldUseCPURendering,Qt as getUseGenericViewport,Xt as getWebWorkerManager,en as imageLoadPoolManager,tn as imageLoader,nn as imageRetrievalPoolManager,sn as init,on as isCornerstoneInitialized,an as isRegisteredRenderBackend,rn as isRegisteredViewportType,dn as metaData,cn as peerImport,Ze as planarProjection,ln as registerImageLoader,gn as registerRenderBackend,mn as registerViewportType,mt as renderingEngineExportsV2,hn as requestPoolManager,un as resetInitialization,pn as resetUseCPURendering,xn as setCanvasCreator,wn as setConfiguration,fn as setPreferSizeOverAccuracy,In as setRenderBackend,Vn as setUseCPURendering,Mn as setVolumesForViewports,E as triggerEvent,G as updateCanvasSizeAndAspectRatio,_n as utilities,ct as version,qe as videoProjection,Gn as viewportHasCanvasWorldTransform,yn as viewportHasFrameOfReferenceUID,bn as viewportHasPan,zn as viewportHasZoom,Cn as viewportProjection,Je as volume3DProjection,Pn as volumeLoader,Ke as wsiProjection};
|
|
@@ -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-ZX_UE_97.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-Bm3uV1GS.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+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b7 as Re,t as Rt,e as Z,al as mv,aJ as Ne,aK as Vi,b8 as Se,at as Q,b9 as jr,ba as pv,ac as We,V as so,ar as Xe,bb as Gn,ad as pn,am as Pn,ae as Qo,bc as wn,bd as Xr,be as vv,ah as Ea,bf as ve,i as ie,bg as vc,bh as Iv,bi as rn,bj as bh,bk as Hn,bl as eo,bm as Fi,bn as _h,bo as yh,bp as Nl,bq as qr,E as yt,aN as Es,br as Ss,bs as wv,bt as $o,bu as IC,bv as Fn,bw as wC,bx as EC,by as SC,bz as CC,bA as Yc,bB as bC,aw as _C,b5 as Kc,bC as yC,bD as Ev,bE as xC,bF as xh,bG as Sv,bH as PC,bI as DC,aL as Eg,K as kl,bJ as Sa,ao as Cv,bK as TC,bL as MC,bM as AC,aO as fr,bN as bv,bO as Ud,bP as _v,bQ as Ph,bR as Dh,bS as LC,bT as OC,av as RC,g as NC,bU as po,bV as kC,bW as UC,bX as Zc,bY as Sg,bZ as VC,b_ as Vd,ag as Ks,af as FC,b$ as Cg,J as GC,ai as HC,c0 as WC,c1 as Th,c2 as BC,c3 as zC}from"./Settings-DScSRN4w.js";import{D as _n,I as Mh,M as Vt,m as Lt,P as Di,a as ku,V as bg,B as di,b as $C,s as jC,d as _g,n as tr,c as XC,t as qC,i as YC,e as yg,f as KC,g as ZC,h as Bc,j as JC}from"./cornerstoneEngine-CZtg0zW5.js";import{C as yv,P as Ah,I as QC,a as tb,b as Vo,c as la,M as Oo,A as vo,d as Ul,R as xv,T as Pv,t as Jc,e as er,f as xg,Q as eb,g as nb,h as ob,L as ib}from"./Texture-C5SfDh5g.js";import{i as sb,b as ae,g as N,j as ab,c as le,u as oe,k as Dv,l as Lh,m as Uu,f as gr,h as Zs,n as rb,d as cb,o as Oh,r as de,p as lb,q as Tv,t as gn,w as is,x as Rh,y as Mv,z as db,A as da,M as ub,B as Av,C as Pg,D as Fa,E as Vu,F as hb}from"./index-Cp_HszKm.js";import{c as Ic,g as fb}from"./_commonjsHelpers-CE1G-McA.js";import{A as Kn,E as Js,c as B,f as Ot,d as xt,a as Me,l as mr,n as Wt,e as pr,s as bn,b as Oe,g as tn,h as mn,i as ee,j as Yr,k as gb,m as ke,t as Un,o as Ue,p as Lv,q as Fu,r as yn,u as Ov,v as ho,w as Rv,x as Nv,y as mb,z as pb,B as vb,C as Dg,D as Ib,F as wb,G as Eb}from"./throttle-CjIII7Yf.js";import{a as Sb}from"./addVolumesToViewports-BVAFib39.js";import"./dcmjs.es-DfWkgqfk.js";import"./index-ZX_UE_97.js";function Cb(i,t){let n;if(t===void 0)for(const e of i)e!=null&&(n>e||n===void 0&&e>=e)&&(n=e);else{let e=-1;for(let o of i)(o=t(o,++e,i))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function bb(i){if(!(s=i.length))return[];for(var t=-1,n=Cb(i,_b),e=new Array(n);++t<n;)for(var o=-1,s,a=e[t]=new Array(s);++o<s;)a[o]=i[o][t];return e}function _b(i){return i.length}function Tg(){return bb(arguments)}function yb(i,t,n,e,o){var s=i*i,a=s*i;return((1-3*i+3*s-a)*t+(4-6*s+3*a)*n+(1+3*i+3*s-3*a)*e+a*o)/6}function Fd(i){var t=i.length-1;return function(n){var e=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=i[e],s=i[e+1],a=e>0?i[e-1]:2*o-s,r=e<t-1?i[e+2]:2*s-o;return yb((n-e/t)*t,a,o,s,r)}}function Ga(i,t){for(var n=new Array(t),e=0;e<t;++e)n[e]=i(e/(t-1));return n}var Fo;(function(i){i[i.Primary=1]="Primary",i[i.Secondary=2]="Secondary",i[i.Primary_And_Secondary=3]="Primary_And_Secondary",i[i.Auxiliary=4]="Auxiliary",i[i.Primary_And_Auxiliary=5]="Primary_And_Auxiliary",i[i.Secondary_And_Auxiliary=6]="Secondary_And_Auxiliary",i[i.Primary_And_Secondary_And_Auxiliary=7]="Primary_And_Secondary_And_Auxiliary",i[i.Fourth_Button=8]="Fourth_Button",i[i.Fifth_Button=16]="Fifth_Button",i[i.Wheel=524288]="Wheel",i[i.Wheel_Primary=524289]="Wheel_Primary"})(Fo||(Fo={}));var vn;(function(i){i[i.Shift=16]="Shift",i[i.Ctrl=17]="Ctrl",i[i.Alt=18]="Alt",i[i.Meta=91]="Meta",i[i.ShiftCtrl=1617]="ShiftCtrl",i[i.ShiftAlt=1618]="ShiftAlt",i[i.ShiftMeta=1691]="ShiftMeta",i[i.CtrlAlt=1718]="CtrlAlt",i[i.CtrlMeta=1791]="CtrlMeta",i[i.AltMeta=1891]="AltMeta"})(vn||(vn={}));var se;(function(i){i.Active="Active",i.Passive="Passive",i.Enabled="Enabled",i.Disabled="Disabled"})(se||(se={}));var To;(function(i){i.Default="",i.Highlighted="Highlighted",i.Selected="Selected",i.Locked="Locked",i.AutoGenerated="AutoGenerated"})(To||(To={}));var E;(function(i){i.TOOL_ACTIVATED="CORNERSTONE_TOOLS_TOOL_ACTIVATED",i.TOOLGROUP_VIEWPORT_ADDED="CORNERSTONE_TOOLS_TOOLGROUP_VIEWPORT_ADDED",i.TOOLGROUP_VIEWPORT_REMOVED="CORNERSTONE_TOOLS_TOOLGROUP_VIEWPORT_REMOVED",i.TOOL_MODE_CHANGED="CORNERSTONE_TOOLS_TOOL_MODE_CHANGED",i.CROSSHAIR_TOOL_CENTER_CHANGED="CORNERSTONE_TOOLS_CROSSHAIR_TOOL_CENTER_CHANGED",i.WORLD_CROSSHAIR_POINT_CHANGED="CORNERSTONE_TOOLS_WORLD_CROSSHAIR_POINT_CHANGED",i.WORLD_CROSSHAIR_POINT_CLEARED="CORNERSTONE_TOOLS_WORLD_CROSSHAIR_POINT_CLEARED",i.WORLD_CROSSHAIR_JUMPED_TO_POINT="CORNERSTONE_TOOLS_WORLD_CROSSHAIR_JUMPED_TO_POINT",i.SLICE_INTERSECTION_LINE_SELECTED="CORNERSTONE_TOOLS_SLICE_INTERSECTION_LINE_SELECTED",i.SLICE_INTERSECTION_MANIPULATION_STARTED="CORNERSTONE_TOOLS_SLICE_INTERSECTION_MANIPULATION_STARTED",i.SLICE_INTERSECTION_MANIPULATION_ENDED="CORNERSTONE_TOOLS_SLICE_INTERSECTION_MANIPULATION_ENDED",i.SLICE_INTERSECTION_SLAB_THICKNESS_CHANGED="CORNERSTONE_TOOLS_SLICE_INTERSECTION_SLAB_THICKNESS_CHANGED",i.VOLUMECROPPINGCONTROL_TOOL_CHANGED="CORNERSTONE_TOOLS_VOLUMECROPPINGCONTROL_TOOL_CHANGED",i.VOLUMECROPPING_TOOL_CHANGED="CORNERSTONE_TOOLS_VOLUMECROPPING_TOOL_CHANGED",i.STACK_PREFETCH_COMPLETE="CORNERSTONE_TOOLS_STACK_PREFETCH_COMPLETE",i.ANNOTATION_ADDED="CORNERSTONE_TOOLS_ANNOTATION_ADDED",i.ANNOTATION_COMPLETED="CORNERSTONE_TOOLS_ANNOTATION_COMPLETED",i.ANNOTATION_MODIFIED="CORNERSTONE_TOOLS_ANNOTATION_MODIFIED",i.ANNOTATION_REMOVED="CORNERSTONE_TOOLS_ANNOTATION_REMOVED",i.ANNOTATION_SELECTION_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_SELECTION_CHANGE",i.ANNOTATION_LOCK_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_LOCK_CHANGE",i.ANNOTATION_VISIBILITY_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_VISIBILITY_CHANGE",i.ANNOTATION_RENDERED="CORNERSTONE_TOOLS_ANNOTATION_RENDERED",i.ANNOTATION_CUT_MERGE_PROCESS_COMPLETED="CORNERSTONE_TOOLS_ANNOTATION_CUT_MERGE_PROCESS_COMPLETED",i.ANNOTATION_INTERPOLATION_PROCESS_COMPLETED="CORNERSTONE_TOOLS_ANNOTATION_INTERPOLATION_PROCESS_COMPLETED",i.INTERPOLATED_ANNOTATIONS_REMOVED="CORNERSTONE_TOOLS_INTERPOLATED_ANNOTATIONS_REMOVED",i.SEGMENTATION_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_MODIFIED",i.SEGMENTATION_RENDERED="CORNERSTONE_TOOLS_SEGMENTATION_RENDERED",i.SEGMENTATION_REPRESENTATION_ADDED="CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_ADDED",i.SEGMENTATION_ADDED="CORNERSTONE_TOOLS_SEGMENTATION_ADDED",i.SEGMENTATION_REPRESENTATION_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_MODIFIED",i.SEGMENTATION_REMOVED="CORNERSTONE_TOOLS_SEGMENTATION_REMOVED",i.SEGMENTATION_REPRESENTATION_REMOVED="CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_REMOVED",i.SEGMENTATION_DATA_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED",i.HISTORY_UNDO="CORNERSTONE_TOOLS_HISTORY_UNDO",i.HISTORY_REDO="CORNERSTONE_TOOLS_HISTORY_REDO",i.KEY_DOWN="CORNERSTONE_TOOLS_KEY_DOWN",i.KEY_UP="CORNERSTONE_TOOLS_KEY_UP",i.MOUSE_DOWN="CORNERSTONE_TOOLS_MOUSE_DOWN",i.MOUSE_UP="CORNERSTONE_TOOLS_MOUSE_UP",i.MOUSE_DOWN_ACTIVATE="CORNERSTONE_TOOLS_MOUSE_DOWN_ACTIVATE",i.MOUSE_DRAG="CORNERSTONE_TOOLS_MOUSE_DRAG",i.MOUSE_MOVE="CORNERSTONE_TOOLS_MOUSE_MOVE",i.MOUSE_CLICK="CORNERSTONE_TOOLS_MOUSE_CLICK",i.MOUSE_DOUBLE_CLICK="CORNERSTONE_TOOLS_MOUSE_DOUBLE_CLICK",i.MOUSE_WHEEL="CORNERSTONE_TOOLS_MOUSE_WHEEL",i.TOUCH_START="CORNERSTONE_TOOLS_TOUCH_START",i.TOUCH_START_ACTIVATE="CORNERSTONE_TOOLS_TOUCH_START_ACTIVATE",i.TOUCH_PRESS="CORNERSTONE_TOOLS_TOUCH_PRESS",i.TOUCH_DRAG="CORNERSTONE_TOOLS_TOUCH_DRAG",i.TOUCH_END="CORNERSTONE_TOOLS_TOUCH_END",i.TOUCH_TAP="CORNERSTONE_TOOLS_TAP",i.TOUCH_SWIPE="CORNERSTONE_TOOLS_SWIPE"})(E||(E={}));var St;(function(i){i.Labelmap="Labelmap",i.Contour="Contour",i.Surface="Surface"})(St||(St={}));var ss;(function(i){i.UP="UP",i.DOWN="DOWN",i.LEFT="LEFT",i.RIGHT="RIGHT"})(ss||(ss={}));var dt;(function(i){i.CalculateCursorGeometry="calculateCursorGeometry",i.RenderCursor="renderCursor",i.OnInteractionStart="onInteractionStart",i.OnInteractionEnd="onInteractionEnd",i.Preview="preview",i.RejectPreview="rejectPreview",i.AcceptPreview="acceptPreview",i.Fill="fill",i.Interpolate="interpolate",i.StrategyFunction="strategyFunction",i.CreateIsInThreshold="createIsInThreshold",i.Initialize="initialize",i.INTERNAL_setValue="setValue",i.AddPreview="addPreview",i.ComputeInnerCircleRadius="computeInnerCircleRadius",i.GetStatistics="getStatistics",i.EnsureImageVolumeFor3DManipulation="ensureImageVolumeFor3DManipulation",i.EnsureSegmentationVolumeFor3DManipulation="ensureSegmentationVolumeFor3DManipulation"})(dt||(dt={}));var Bt;(function(i){i.Interaction="Interaction",i.HandlesUpdated="HandlesUpdated",i.StatsUpdated="StatsUpdated",i.InitialSetup="InitialSetup",i.Completed="Completed",i.InterpolationUpdated="InterpolationUpdated",i.History="History",i.MetadataReferenceModified="MetadataReferenceModified",i.LabelChange="LabelChange"})(Bt||(Bt={}));var no;(function(i){i.POLYSEG_CONTOUR_TO_LABELMAP="Converting Contour to Labelmap",i.POLYSEG_SURFACE_TO_LABELMAP="Converting Surfaces to Labelmap",i.POLYSEG_CONTOUR_TO_SURFACE="Converting Contour to Surface",i.POLYSEG_LABELMAP_TO_SURFACE="Converting Labelmap to Surface",i.SURFACE_CLIPPING="Clipping Surfaces",i.COMPUTE_STATISTICS="Computing Statistics",i.INTERPOLATE_LABELMAP="Interpolating Labelmap",i.COMPUTE_LARGEST_BIDIRECTIONAL="Computing Largest Bidirectional",i.GENERATE_CONTOUR_SETS="Generating Contour Sets"})(no||(no={}));var Io;(function(i){i.Linear="Linear",i.Area="Area",i.Volume="Volume",i.Pixel="Pixel"})(Io||(Io={}));const yG=Object.freeze(Object.defineProperty({__proto__:null,AnnotationStyleStates:To,ChangeTypes:Bt,Events:E,get KeyboardBindings(){return vn},get MeasurementType(){return Io},get MouseBindings(){return Fo},SegmentationRepresentations:St,StrategyCallbacks:dt,get Swipe(){return ss},ToolModes:se,WorkerTypes:no},Symbol.toStringTag,{value:"Module"}));let Vl={};function xb(){Vl={}}const Mg={isInteractingWithTool:!1,isMultiPartToolActive:!1,tools:{},toolGroups:[],synchronizers:[],svgNodeCache:Vl,enabledElements:[],handleRadius:6};let $={isInteractingWithTool:!1,isMultiPartToolActive:!1,tools:{},toolGroups:[],synchronizers:[],svgNodeCache:Vl,enabledElements:[],handleRadius:6};function Pb(){xb(),$={...Re({...Mg,svgNodeCache:{}}),svgNodeCache:{...Mg.svgNodeCache}}}var Gd,Ag;function Db(){if(Ag)return Gd;Ag=1;var i="Expected a function",t="__lodash_hash_undefined__",n="[object Function]",e="[object GeneratorFunction]",o="[object Symbol]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/,r=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/[\\^$.*+?()[\]{}|]/g,d=/\\(\\)?/g,u=/^\[object .+?Constructor\]$/,h=typeof Ic=="object"&&Ic&&Ic.Object===Object&&Ic,f=typeof self=="object"&&self&&self.Object===Object&&self,g=h||f||Function("return this")();function m(G,et){return G?.[et]}function p(G){var et=!1;if(G!=null&&typeof G.toString!="function")try{et=!!(G+"")}catch{}return et}var v=Array.prototype,I=Function.prototype,w=Object.prototype,C=g["__core-js_shared__"],S=(function(){var G=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||"");return G?"Symbol(src)_1."+G:""})(),b=I.toString,_=w.hasOwnProperty,y=w.toString,D=RegExp("^"+b.call(_).replace(l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=g.Symbol,P=v.splice,x=Ht(g,"Map"),M=Ht(Object,"create"),L=T?T.prototype:void 0,R=L?L.toString:void 0;function U(G){var et=-1,at=G?G.length:0;for(this.clear();++et<at;){var jt=G[et];this.set(jt[0],jt[1])}}function W(){this.__data__=M?M(null):{}}function K(G){return this.has(G)&&delete this.__data__[G]}function j(G){var et=this.__data__;if(M){var at=et[G];return at===t?void 0:at}return _.call(et,G)?et[G]:void 0}function F(G){var et=this.__data__;return M?et[G]!==void 0:_.call(et,G)}function z(G,et){var at=this.__data__;return at[G]=M&&et===void 0?t:et,this}U.prototype.clear=W,U.prototype.delete=K,U.prototype.get=j,U.prototype.has=F,U.prototype.set=z;function q(G){var et=-1,at=G?G.length:0;for(this.clear();++et<at;){var jt=G[et];this.set(jt[0],jt[1])}}function J(){this.__data__=[]}function it(G){var et=this.__data__,at=te(et,G);if(at<0)return!1;var jt=et.length-1;return at==jt?et.pop():P.call(et,at,1),!0}function tt(G){var et=this.__data__,at=te(et,G);return at<0?void 0:et[at][1]}function ot(G){return te(this.__data__,G)>-1}function nt(G,et){var at=this.__data__,jt=te(at,G);return jt<0?at.push([G,et]):at[jt][1]=et,this}q.prototype.clear=J,q.prototype.delete=it,q.prototype.get=tt,q.prototype.has=ot,q.prototype.set=nt;function lt(G){var et=-1,at=G?G.length:0;for(this.clear();++et<at;){var jt=G[et];this.set(jt[0],jt[1])}}function rt(){this.__data__={hash:new U,map:new(x||q),string:new U}}function ut(G){return Ut(this,G).delete(G)}function Tt(G){return Ut(this,G).get(G)}function kt(G){return Ut(this,G).has(G)}function Pt(G,et){return Ut(this,G).set(G,et),this}lt.prototype.clear=rt,lt.prototype.delete=ut,lt.prototype.get=Tt,lt.prototype.has=kt,lt.prototype.set=Pt;function te(G,et){for(var at=G.length;at--;)if(Bo(G[at][0],et))return at;return-1}function Ie(G,et){et=Jt(et,G)?[et]:ce(et);for(var at=0,jt=et.length;G!=null&&at<jt;)G=G[Ve(et[at++])];return at&&at==jt?G:void 0}function re(G){if(!lo(G)||De(G))return!1;var et=yi(G)||p(G)?D:u;return et.test(Wo(G))}function Zt(G){if(typeof G=="string")return G;if(oi(G))return R?R.call(G):"";var et=G+"";return et=="0"&&1/G==-1/0?"-0":et}function ce(G){return co(G)?G:ln(G)}function Ut(G,et){var at=G.__data__;return Pe(et)?at[typeof et=="string"?"string":"hash"]:at.map}function Ht(G,et){var at=m(G,et);return re(at)?at:void 0}function Jt(G,et){if(co(G))return!1;var at=typeof G;return at=="number"||at=="symbol"||at=="boolean"||G==null||oi(G)?!0:a.test(G)||!s.test(G)||et!=null&&G in Object(et)}function Pe(G){var et=typeof G;return et=="string"||et=="number"||et=="symbol"||et=="boolean"?G!=="__proto__":G===null}function De(G){return!!S&&S in G}var ln=jn(function(G){G=st(G);var et=[];return r.test(G)&&et.push(""),G.replace(c,function(at,jt,je,dn){et.push(je?dn.replace(d,"$1"):jt||at)}),et});function Ve(G){if(typeof G=="string"||oi(G))return G;var et=G+"";return et=="0"&&1/G==-1/0?"-0":et}function Wo(G){if(G!=null){try{return b.call(G)}catch{}try{return G+""}catch{}}return""}function jn(G,et){if(typeof G!="function"||et&&typeof et!="function")throw new TypeError(i);var at=function(){var jt=arguments,je=et?et.apply(this,jt):jt[0],dn=at.cache;if(dn.has(je))return dn.get(je);var yo=G.apply(this,jt);return at.cache=dn.set(je,yo),yo};return at.cache=new(jn.Cache||lt),at}jn.Cache=lt;function Bo(G,et){return G===et||G!==G&&et!==et}var co=Array.isArray;function yi(G){var et=lo(G)?y.call(G):"";return et==n||et==e}function lo(G){var et=typeof G;return!!G&&(et=="object"||et=="function")}function xi(G){return!!G&&typeof G=="object"}function oi(G){return typeof G=="symbol"||xi(G)&&y.call(G)==o}function st(G){return G==null?"":Zt(G)}function Mt(G,et,at){var jt=G==null?void 0:Ie(G,et);return jt===void 0?at:jt}return Gd=Mt,Gd}var Tb=Db();const Mb=fb(Tb),Lg=Symbol("DefinedCursors"),kv=new Set(["alias","all-scroll","auto","cell","col-resize","context-menu","copy","crosshair","default","e-resize","ew-resize","grab","grabbing","help","move","ne-resize","nesw-resize","no-drop","none","not-allowed","n-resize","ns-resize","nw-resize","nwse-resize","pointer","progress","row-resize","se-resize","s-resize","sw-resize","text","vertical-text","wait","w-resize","zoom-in","zoom-out"]);class An{constructor(t,n){this.name=t+"",this.fallback=n}getName(){return this.name+""}addFallbackStyleProperty(t){const{fallback:n}=this;return n instanceof An?`${t}, ${n.getStyleProperty()}`:t+""}getStyleProperty(){return this.addFallbackStyleProperty(this.name)+""}static getDefinedCursor(t){const n=Og(An,Lg);let e=n.get(t);if(e instanceof An)return e;if(kv.has(t))return e=new An(t),n.set(t,e),e}static setDefinedCursor(t,n){return n instanceof An?(Og(An,Lg).set(t,n),!0):!1}}function Og(i,t){let n=i[t];return n instanceof Map||(n=new Map,Object.defineProperty(i,t,{value:n})),n}const Ab=kv.values(),Lb="image-cursor";class vr extends An{constructor(t,n,e,o,s){super(o||vr.getUniqueInstanceName(Lb),s),this.url=t,this.x=Number(n)||0,this.y=Number(e)||0}getStyleProperty(){const{url:t,x:n,y:e}=this;let o=`url('${t}')`;return n>=0&&e>=0&&(n>0||e>0)&&(o+=` ${n} ${e}`),this.addFallbackStyleProperty(o)}static getUniqueInstanceName(t){return`${t}-${sb(vr)}`}}const he={iconContent:"",iconSize:16,viewBox:{x:16,y:16},mousePoint:{x:8,y:8},mousePointerGroupString:`
|
|
1
|
+
import{b7 as Re,t as Rt,e as Z,al as mv,aJ as Ne,aK as Vi,b8 as Se,at as Q,b9 as jr,ba as pv,ac as We,V as so,ar as Xe,bb as Gn,ad as pn,am as Pn,ae as Qo,bc as wn,bd as Xr,be as vv,ah as Ea,bf as ve,i as ie,bg as vc,bh as Iv,bi as rn,bj as bh,bk as Hn,bl as eo,bm as Fi,bn as _h,bo as yh,bp as Nl,bq as qr,E as yt,aN as Es,br as Ss,bs as wv,bt as $o,bu as IC,bv as Fn,bw as wC,bx as EC,by as SC,bz as CC,bA as Yc,bB as bC,aw as _C,b5 as Kc,bC as yC,bD as Ev,bE as xC,bF as xh,bG as Sv,bH as PC,bI as DC,aL as Eg,K as kl,bJ as Sa,ao as Cv,bK as TC,bL as MC,bM as AC,aO as fr,bN as bv,bO as Ud,bP as _v,bQ as Ph,bR as Dh,bS as LC,bT as OC,av as RC,g as NC,bU as po,bV as kC,bW as UC,bX as Zc,bY as Sg,bZ as VC,b_ as Vd,ag as Ks,af as FC,b$ as Cg,J as GC,ai as HC,c0 as WC,c1 as Th,c2 as BC,c3 as zC}from"./Settings-CpJHgU8P.js";import{D as _n,I as Mh,M as Vt,m as Lt,P as Di,a as ku,V as bg,B as di,b as $C,s as jC,d as _g,n as tr,c as XC,t as qC,i as YC,e as yg,f as KC,g as ZC,h as Bc,j as JC}from"./cornerstoneEngine-DgoPMn1N.js";import{C as yv,P as Ah,I as QC,a as tb,b as Vo,c as la,M as Oo,A as vo,d as Ul,R as xv,T as Pv,t as Jc,e as er,f as xg,Q as eb,g as nb,h as ob,L as ib}from"./Texture-BFywN4BL.js";import{i as sb,b as ae,g as N,j as ab,c as le,u as oe,k as Dv,l as Lh,m as Uu,f as gr,h as Zs,n as rb,d as cb,o as Oh,r as de,p as lb,q as Tv,t as gn,w as is,x as Rh,y as Mv,z as db,A as da,M as ub,B as Av,C as Pg,D as Fa,E as Vu,F as hb}from"./index-CokKuJob.js";import{c as Ic,g as fb}from"./_commonjsHelpers-CE1G-McA.js";import{A as Kn,E as Js,c as B,f as Ot,d as xt,a as Me,l as mr,n as Wt,e as pr,s as bn,b as Oe,g as tn,h as mn,i as ee,j as Yr,k as gb,m as ke,t as Un,o as Ue,p as Lv,q as Fu,r as yn,u as Ov,v as ho,w as Rv,x as Nv,y as mb,z as pb,B as vb,C as Dg,D as Ib,F as wb,G as Eb}from"./throttle-CjIII7Yf.js";import{a as Sb}from"./addVolumesToViewports-CKWYzwhw.js";import"./dcmjs.es-DfWkgqfk.js";import"./index-Bm3uV1GS.js";function Cb(i,t){let n;if(t===void 0)for(const e of i)e!=null&&(n>e||n===void 0&&e>=e)&&(n=e);else{let e=-1;for(let o of i)(o=t(o,++e,i))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function bb(i){if(!(s=i.length))return[];for(var t=-1,n=Cb(i,_b),e=new Array(n);++t<n;)for(var o=-1,s,a=e[t]=new Array(s);++o<s;)a[o]=i[o][t];return e}function _b(i){return i.length}function Tg(){return bb(arguments)}function yb(i,t,n,e,o){var s=i*i,a=s*i;return((1-3*i+3*s-a)*t+(4-6*s+3*a)*n+(1+3*i+3*s-3*a)*e+a*o)/6}function Fd(i){var t=i.length-1;return function(n){var e=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=i[e],s=i[e+1],a=e>0?i[e-1]:2*o-s,r=e<t-1?i[e+2]:2*s-o;return yb((n-e/t)*t,a,o,s,r)}}function Ga(i,t){for(var n=new Array(t),e=0;e<t;++e)n[e]=i(e/(t-1));return n}var Fo;(function(i){i[i.Primary=1]="Primary",i[i.Secondary=2]="Secondary",i[i.Primary_And_Secondary=3]="Primary_And_Secondary",i[i.Auxiliary=4]="Auxiliary",i[i.Primary_And_Auxiliary=5]="Primary_And_Auxiliary",i[i.Secondary_And_Auxiliary=6]="Secondary_And_Auxiliary",i[i.Primary_And_Secondary_And_Auxiliary=7]="Primary_And_Secondary_And_Auxiliary",i[i.Fourth_Button=8]="Fourth_Button",i[i.Fifth_Button=16]="Fifth_Button",i[i.Wheel=524288]="Wheel",i[i.Wheel_Primary=524289]="Wheel_Primary"})(Fo||(Fo={}));var vn;(function(i){i[i.Shift=16]="Shift",i[i.Ctrl=17]="Ctrl",i[i.Alt=18]="Alt",i[i.Meta=91]="Meta",i[i.ShiftCtrl=1617]="ShiftCtrl",i[i.ShiftAlt=1618]="ShiftAlt",i[i.ShiftMeta=1691]="ShiftMeta",i[i.CtrlAlt=1718]="CtrlAlt",i[i.CtrlMeta=1791]="CtrlMeta",i[i.AltMeta=1891]="AltMeta"})(vn||(vn={}));var se;(function(i){i.Active="Active",i.Passive="Passive",i.Enabled="Enabled",i.Disabled="Disabled"})(se||(se={}));var To;(function(i){i.Default="",i.Highlighted="Highlighted",i.Selected="Selected",i.Locked="Locked",i.AutoGenerated="AutoGenerated"})(To||(To={}));var E;(function(i){i.TOOL_ACTIVATED="CORNERSTONE_TOOLS_TOOL_ACTIVATED",i.TOOLGROUP_VIEWPORT_ADDED="CORNERSTONE_TOOLS_TOOLGROUP_VIEWPORT_ADDED",i.TOOLGROUP_VIEWPORT_REMOVED="CORNERSTONE_TOOLS_TOOLGROUP_VIEWPORT_REMOVED",i.TOOL_MODE_CHANGED="CORNERSTONE_TOOLS_TOOL_MODE_CHANGED",i.CROSSHAIR_TOOL_CENTER_CHANGED="CORNERSTONE_TOOLS_CROSSHAIR_TOOL_CENTER_CHANGED",i.WORLD_CROSSHAIR_POINT_CHANGED="CORNERSTONE_TOOLS_WORLD_CROSSHAIR_POINT_CHANGED",i.WORLD_CROSSHAIR_POINT_CLEARED="CORNERSTONE_TOOLS_WORLD_CROSSHAIR_POINT_CLEARED",i.WORLD_CROSSHAIR_JUMPED_TO_POINT="CORNERSTONE_TOOLS_WORLD_CROSSHAIR_JUMPED_TO_POINT",i.SLICE_INTERSECTION_LINE_SELECTED="CORNERSTONE_TOOLS_SLICE_INTERSECTION_LINE_SELECTED",i.SLICE_INTERSECTION_MANIPULATION_STARTED="CORNERSTONE_TOOLS_SLICE_INTERSECTION_MANIPULATION_STARTED",i.SLICE_INTERSECTION_MANIPULATION_ENDED="CORNERSTONE_TOOLS_SLICE_INTERSECTION_MANIPULATION_ENDED",i.SLICE_INTERSECTION_SLAB_THICKNESS_CHANGED="CORNERSTONE_TOOLS_SLICE_INTERSECTION_SLAB_THICKNESS_CHANGED",i.VOLUMECROPPINGCONTROL_TOOL_CHANGED="CORNERSTONE_TOOLS_VOLUMECROPPINGCONTROL_TOOL_CHANGED",i.VOLUMECROPPING_TOOL_CHANGED="CORNERSTONE_TOOLS_VOLUMECROPPING_TOOL_CHANGED",i.STACK_PREFETCH_COMPLETE="CORNERSTONE_TOOLS_STACK_PREFETCH_COMPLETE",i.ANNOTATION_ADDED="CORNERSTONE_TOOLS_ANNOTATION_ADDED",i.ANNOTATION_COMPLETED="CORNERSTONE_TOOLS_ANNOTATION_COMPLETED",i.ANNOTATION_MODIFIED="CORNERSTONE_TOOLS_ANNOTATION_MODIFIED",i.ANNOTATION_REMOVED="CORNERSTONE_TOOLS_ANNOTATION_REMOVED",i.ANNOTATION_SELECTION_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_SELECTION_CHANGE",i.ANNOTATION_LOCK_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_LOCK_CHANGE",i.ANNOTATION_VISIBILITY_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_VISIBILITY_CHANGE",i.ANNOTATION_RENDERED="CORNERSTONE_TOOLS_ANNOTATION_RENDERED",i.ANNOTATION_CUT_MERGE_PROCESS_COMPLETED="CORNERSTONE_TOOLS_ANNOTATION_CUT_MERGE_PROCESS_COMPLETED",i.ANNOTATION_INTERPOLATION_PROCESS_COMPLETED="CORNERSTONE_TOOLS_ANNOTATION_INTERPOLATION_PROCESS_COMPLETED",i.INTERPOLATED_ANNOTATIONS_REMOVED="CORNERSTONE_TOOLS_INTERPOLATED_ANNOTATIONS_REMOVED",i.SEGMENTATION_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_MODIFIED",i.SEGMENTATION_RENDERED="CORNERSTONE_TOOLS_SEGMENTATION_RENDERED",i.SEGMENTATION_REPRESENTATION_ADDED="CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_ADDED",i.SEGMENTATION_ADDED="CORNERSTONE_TOOLS_SEGMENTATION_ADDED",i.SEGMENTATION_REPRESENTATION_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_MODIFIED",i.SEGMENTATION_REMOVED="CORNERSTONE_TOOLS_SEGMENTATION_REMOVED",i.SEGMENTATION_REPRESENTATION_REMOVED="CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_REMOVED",i.SEGMENTATION_DATA_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED",i.HISTORY_UNDO="CORNERSTONE_TOOLS_HISTORY_UNDO",i.HISTORY_REDO="CORNERSTONE_TOOLS_HISTORY_REDO",i.KEY_DOWN="CORNERSTONE_TOOLS_KEY_DOWN",i.KEY_UP="CORNERSTONE_TOOLS_KEY_UP",i.MOUSE_DOWN="CORNERSTONE_TOOLS_MOUSE_DOWN",i.MOUSE_UP="CORNERSTONE_TOOLS_MOUSE_UP",i.MOUSE_DOWN_ACTIVATE="CORNERSTONE_TOOLS_MOUSE_DOWN_ACTIVATE",i.MOUSE_DRAG="CORNERSTONE_TOOLS_MOUSE_DRAG",i.MOUSE_MOVE="CORNERSTONE_TOOLS_MOUSE_MOVE",i.MOUSE_CLICK="CORNERSTONE_TOOLS_MOUSE_CLICK",i.MOUSE_DOUBLE_CLICK="CORNERSTONE_TOOLS_MOUSE_DOUBLE_CLICK",i.MOUSE_WHEEL="CORNERSTONE_TOOLS_MOUSE_WHEEL",i.TOUCH_START="CORNERSTONE_TOOLS_TOUCH_START",i.TOUCH_START_ACTIVATE="CORNERSTONE_TOOLS_TOUCH_START_ACTIVATE",i.TOUCH_PRESS="CORNERSTONE_TOOLS_TOUCH_PRESS",i.TOUCH_DRAG="CORNERSTONE_TOOLS_TOUCH_DRAG",i.TOUCH_END="CORNERSTONE_TOOLS_TOUCH_END",i.TOUCH_TAP="CORNERSTONE_TOOLS_TAP",i.TOUCH_SWIPE="CORNERSTONE_TOOLS_SWIPE"})(E||(E={}));var St;(function(i){i.Labelmap="Labelmap",i.Contour="Contour",i.Surface="Surface"})(St||(St={}));var ss;(function(i){i.UP="UP",i.DOWN="DOWN",i.LEFT="LEFT",i.RIGHT="RIGHT"})(ss||(ss={}));var dt;(function(i){i.CalculateCursorGeometry="calculateCursorGeometry",i.RenderCursor="renderCursor",i.OnInteractionStart="onInteractionStart",i.OnInteractionEnd="onInteractionEnd",i.Preview="preview",i.RejectPreview="rejectPreview",i.AcceptPreview="acceptPreview",i.Fill="fill",i.Interpolate="interpolate",i.StrategyFunction="strategyFunction",i.CreateIsInThreshold="createIsInThreshold",i.Initialize="initialize",i.INTERNAL_setValue="setValue",i.AddPreview="addPreview",i.ComputeInnerCircleRadius="computeInnerCircleRadius",i.GetStatistics="getStatistics",i.EnsureImageVolumeFor3DManipulation="ensureImageVolumeFor3DManipulation",i.EnsureSegmentationVolumeFor3DManipulation="ensureSegmentationVolumeFor3DManipulation"})(dt||(dt={}));var Bt;(function(i){i.Interaction="Interaction",i.HandlesUpdated="HandlesUpdated",i.StatsUpdated="StatsUpdated",i.InitialSetup="InitialSetup",i.Completed="Completed",i.InterpolationUpdated="InterpolationUpdated",i.History="History",i.MetadataReferenceModified="MetadataReferenceModified",i.LabelChange="LabelChange"})(Bt||(Bt={}));var no;(function(i){i.POLYSEG_CONTOUR_TO_LABELMAP="Converting Contour to Labelmap",i.POLYSEG_SURFACE_TO_LABELMAP="Converting Surfaces to Labelmap",i.POLYSEG_CONTOUR_TO_SURFACE="Converting Contour to Surface",i.POLYSEG_LABELMAP_TO_SURFACE="Converting Labelmap to Surface",i.SURFACE_CLIPPING="Clipping Surfaces",i.COMPUTE_STATISTICS="Computing Statistics",i.INTERPOLATE_LABELMAP="Interpolating Labelmap",i.COMPUTE_LARGEST_BIDIRECTIONAL="Computing Largest Bidirectional",i.GENERATE_CONTOUR_SETS="Generating Contour Sets"})(no||(no={}));var Io;(function(i){i.Linear="Linear",i.Area="Area",i.Volume="Volume",i.Pixel="Pixel"})(Io||(Io={}));const yG=Object.freeze(Object.defineProperty({__proto__:null,AnnotationStyleStates:To,ChangeTypes:Bt,Events:E,get KeyboardBindings(){return vn},get MeasurementType(){return Io},get MouseBindings(){return Fo},SegmentationRepresentations:St,StrategyCallbacks:dt,get Swipe(){return ss},ToolModes:se,WorkerTypes:no},Symbol.toStringTag,{value:"Module"}));let Vl={};function xb(){Vl={}}const Mg={isInteractingWithTool:!1,isMultiPartToolActive:!1,tools:{},toolGroups:[],synchronizers:[],svgNodeCache:Vl,enabledElements:[],handleRadius:6};let $={isInteractingWithTool:!1,isMultiPartToolActive:!1,tools:{},toolGroups:[],synchronizers:[],svgNodeCache:Vl,enabledElements:[],handleRadius:6};function Pb(){xb(),$={...Re({...Mg,svgNodeCache:{}}),svgNodeCache:{...Mg.svgNodeCache}}}var Gd,Ag;function Db(){if(Ag)return Gd;Ag=1;var i="Expected a function",t="__lodash_hash_undefined__",n="[object Function]",e="[object GeneratorFunction]",o="[object Symbol]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/,r=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/[\\^$.*+?()[\]{}|]/g,d=/\\(\\)?/g,u=/^\[object .+?Constructor\]$/,h=typeof Ic=="object"&&Ic&&Ic.Object===Object&&Ic,f=typeof self=="object"&&self&&self.Object===Object&&self,g=h||f||Function("return this")();function m(G,et){return G?.[et]}function p(G){var et=!1;if(G!=null&&typeof G.toString!="function")try{et=!!(G+"")}catch{}return et}var v=Array.prototype,I=Function.prototype,w=Object.prototype,C=g["__core-js_shared__"],S=(function(){var G=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||"");return G?"Symbol(src)_1."+G:""})(),b=I.toString,_=w.hasOwnProperty,y=w.toString,D=RegExp("^"+b.call(_).replace(l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=g.Symbol,P=v.splice,x=Ht(g,"Map"),M=Ht(Object,"create"),L=T?T.prototype:void 0,R=L?L.toString:void 0;function U(G){var et=-1,at=G?G.length:0;for(this.clear();++et<at;){var jt=G[et];this.set(jt[0],jt[1])}}function W(){this.__data__=M?M(null):{}}function K(G){return this.has(G)&&delete this.__data__[G]}function j(G){var et=this.__data__;if(M){var at=et[G];return at===t?void 0:at}return _.call(et,G)?et[G]:void 0}function F(G){var et=this.__data__;return M?et[G]!==void 0:_.call(et,G)}function z(G,et){var at=this.__data__;return at[G]=M&&et===void 0?t:et,this}U.prototype.clear=W,U.prototype.delete=K,U.prototype.get=j,U.prototype.has=F,U.prototype.set=z;function q(G){var et=-1,at=G?G.length:0;for(this.clear();++et<at;){var jt=G[et];this.set(jt[0],jt[1])}}function J(){this.__data__=[]}function it(G){var et=this.__data__,at=te(et,G);if(at<0)return!1;var jt=et.length-1;return at==jt?et.pop():P.call(et,at,1),!0}function tt(G){var et=this.__data__,at=te(et,G);return at<0?void 0:et[at][1]}function ot(G){return te(this.__data__,G)>-1}function nt(G,et){var at=this.__data__,jt=te(at,G);return jt<0?at.push([G,et]):at[jt][1]=et,this}q.prototype.clear=J,q.prototype.delete=it,q.prototype.get=tt,q.prototype.has=ot,q.prototype.set=nt;function lt(G){var et=-1,at=G?G.length:0;for(this.clear();++et<at;){var jt=G[et];this.set(jt[0],jt[1])}}function rt(){this.__data__={hash:new U,map:new(x||q),string:new U}}function ut(G){return Ut(this,G).delete(G)}function Tt(G){return Ut(this,G).get(G)}function kt(G){return Ut(this,G).has(G)}function Pt(G,et){return Ut(this,G).set(G,et),this}lt.prototype.clear=rt,lt.prototype.delete=ut,lt.prototype.get=Tt,lt.prototype.has=kt,lt.prototype.set=Pt;function te(G,et){for(var at=G.length;at--;)if(Bo(G[at][0],et))return at;return-1}function Ie(G,et){et=Jt(et,G)?[et]:ce(et);for(var at=0,jt=et.length;G!=null&&at<jt;)G=G[Ve(et[at++])];return at&&at==jt?G:void 0}function re(G){if(!lo(G)||De(G))return!1;var et=yi(G)||p(G)?D:u;return et.test(Wo(G))}function Zt(G){if(typeof G=="string")return G;if(oi(G))return R?R.call(G):"";var et=G+"";return et=="0"&&1/G==-1/0?"-0":et}function ce(G){return co(G)?G:ln(G)}function Ut(G,et){var at=G.__data__;return Pe(et)?at[typeof et=="string"?"string":"hash"]:at.map}function Ht(G,et){var at=m(G,et);return re(at)?at:void 0}function Jt(G,et){if(co(G))return!1;var at=typeof G;return at=="number"||at=="symbol"||at=="boolean"||G==null||oi(G)?!0:a.test(G)||!s.test(G)||et!=null&&G in Object(et)}function Pe(G){var et=typeof G;return et=="string"||et=="number"||et=="symbol"||et=="boolean"?G!=="__proto__":G===null}function De(G){return!!S&&S in G}var ln=jn(function(G){G=st(G);var et=[];return r.test(G)&&et.push(""),G.replace(c,function(at,jt,je,dn){et.push(je?dn.replace(d,"$1"):jt||at)}),et});function Ve(G){if(typeof G=="string"||oi(G))return G;var et=G+"";return et=="0"&&1/G==-1/0?"-0":et}function Wo(G){if(G!=null){try{return b.call(G)}catch{}try{return G+""}catch{}}return""}function jn(G,et){if(typeof G!="function"||et&&typeof et!="function")throw new TypeError(i);var at=function(){var jt=arguments,je=et?et.apply(this,jt):jt[0],dn=at.cache;if(dn.has(je))return dn.get(je);var yo=G.apply(this,jt);return at.cache=dn.set(je,yo),yo};return at.cache=new(jn.Cache||lt),at}jn.Cache=lt;function Bo(G,et){return G===et||G!==G&&et!==et}var co=Array.isArray;function yi(G){var et=lo(G)?y.call(G):"";return et==n||et==e}function lo(G){var et=typeof G;return!!G&&(et=="object"||et=="function")}function xi(G){return!!G&&typeof G=="object"}function oi(G){return typeof G=="symbol"||xi(G)&&y.call(G)==o}function st(G){return G==null?"":Zt(G)}function Mt(G,et,at){var jt=G==null?void 0:Ie(G,et);return jt===void 0?at:jt}return Gd=Mt,Gd}var Tb=Db();const Mb=fb(Tb),Lg=Symbol("DefinedCursors"),kv=new Set(["alias","all-scroll","auto","cell","col-resize","context-menu","copy","crosshair","default","e-resize","ew-resize","grab","grabbing","help","move","ne-resize","nesw-resize","no-drop","none","not-allowed","n-resize","ns-resize","nw-resize","nwse-resize","pointer","progress","row-resize","se-resize","s-resize","sw-resize","text","vertical-text","wait","w-resize","zoom-in","zoom-out"]);class An{constructor(t,n){this.name=t+"",this.fallback=n}getName(){return this.name+""}addFallbackStyleProperty(t){const{fallback:n}=this;return n instanceof An?`${t}, ${n.getStyleProperty()}`:t+""}getStyleProperty(){return this.addFallbackStyleProperty(this.name)+""}static getDefinedCursor(t){const n=Og(An,Lg);let e=n.get(t);if(e instanceof An)return e;if(kv.has(t))return e=new An(t),n.set(t,e),e}static setDefinedCursor(t,n){return n instanceof An?(Og(An,Lg).set(t,n),!0):!1}}function Og(i,t){let n=i[t];return n instanceof Map||(n=new Map,Object.defineProperty(i,t,{value:n})),n}const Ab=kv.values(),Lb="image-cursor";class vr extends An{constructor(t,n,e,o,s){super(o||vr.getUniqueInstanceName(Lb),s),this.url=t,this.x=Number(n)||0,this.y=Number(e)||0}getStyleProperty(){const{url:t,x:n,y:e}=this;let o=`url('${t}')`;return n>=0&&e>=0&&(n>0||e>0)&&(o+=` ${n} ${e}`),this.addFallbackStyleProperty(o)}static getUniqueInstanceName(t){return`${t}-${sb(vr)}`}}const he={iconContent:"",iconSize:16,viewBox:{x:16,y:16},mousePoint:{x:8,y:8},mousePointerGroupString:`
|
|
2
2
|
<path stroke="{{color}}" d="M8 16L8 0"></path>
|
|
3
3
|
<path stroke="{{color}}" d="M16 8L0 8"></path>
|
|
4
4
|
`},Xn={x:127,y:60},As=`
|
|
@@ -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})};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DfeCnMQa.js","./_commonjsHelpers-CE1G-McA.js","./index-Bm3uV1GS.js","./index-CIblWv2u.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as h,b as u,I as c}from"./index-Bm3uV1GS.js";const d={gray:"gray",hot:"hot",jet:"jet",cool:"cool"},m={wl:"contrast",pan:"pan",length:"measurement",angle:"angle"};class _{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-DfeCnMQa.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:u(this.host.source.url_of(this.path),location.href),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,d[s]),!0)}toolsOffered_get(){return c}ghost_set(s){return!1}tool_set(s){const t=m[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{_ 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-DgoPMn1N.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-BFywN4BL.js";import"./index-Bm3uV1GS.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-Bm3uV1GS.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,7 @@
|
|
|
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>
|
|
311
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>
|
|
312
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>
|
|
313
314
|
<button class="strategy-pill universe-refresh" title="ask the session for the space again">REFRESH</button>
|