UNPKG

modified-dicom-pacs

Version:

A modified version of DICOM PACS implementation

2 lines 3.63 kB
(()=>{var e,t,a={72962:(e,t,a)=>{"use strict";var n=a(39371),o=a(44753),r=a(51250),i=a(45128),s=a(99178);const c=({dimensions:e,origin:t,direction:a,spacing:n,scalarData:o,metadata:s})=>{const c=r.Ay.newInstance();c.setDimensions(e),c.setOrigin(t),c.setDirection(a),c.setSpacing(n);const l=i.Ay.newInstance({name:"Pixels",numberOfComponents:1,values:o});return c.getPointData().setScalars(l),c.modified(),{imageData:c,metadata:s,getScalarData:()=>o}};const l={calculateSuvPeak:function({labelmapProps:e,referenceVolumeProps:t,annotations:a,segmentIndex:r=1}){const i=c(e),s=c(t);if("PT"!==s.metadata.Modality)return;const l=i.getScalarData(),d=s.getScalarData();if(l.length!==d.length)throw new Error("labelmap and referenceVolume must have the same number of pixels");const{dimensions:u,imageData:p}=i,{imageData:f}=s;let m;if(a?.length&&a[0].data?.cachedStats){const{projectionPoints:e}=a[0].data.cachedStats,t=[].concat(...e).map((e=>{const t=o.eR.fromValues(0,0,0);return f.worldToIndex(e,t),t}));m=n.utilities.boundingBox.getBoundingBoxAroundShape(t,u)}let b=0,g=[0,0,0],h=[0,0,0];n.utilities.pointInShapeCallback(p,(()=>!0),(({pointIJK:e,pointLPS:t})=>{const a=f.computeOffsetIndex(e);if(l[a]!==r)return;const n=d[a];n>b&&(b=n,g=e,h=t)}),m);const v=p.getDirection().slice(0,3),S=2*(10*Math.pow(1/(4/3*Math.PI),1/3)),x=o.eR.create(),y=o.eR.create(),w=o.eR.create();f.indexToWorld(g,x),o.eR.scaleAndAdd(y,x,v,-S/2),o.eR.scaleAndAdd(w,x,v,S/2);const O=[y,w];let P=0,D=0;return n.utilities.pointInSurroundingSphereCallback(f,O,(({value:e})=>{D+=e,P+=1})),{max:b,maxIJK:g,maxLPS:h,mean:D/P}}};(0,s.p)(l)},89288:()=>{}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return a[e].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.m=a,o.x=()=>{var e=o.O(void 0,[203,473,702,416,117],(()=>o(72962)));return e=o.O(e)},o.amdD=function(){throw new Error("define cannot be used indirect")},o.amdO={},e=[],o.O=(t,a,n,r)=>{if(!a){var i=1/0;for(d=0;d<e.length;d++){for(var[a,n,r]=e[d],s=!0,c=0;c<a.length;c++)(!1&r||i>=r)&&Object.keys(o.O).every((e=>o.O[e](a[c])))?a.splice(c--,1):(s=!1,r<i&&(i=r));if(s){e.splice(d--,1);var l=n();void 0!==l&&(t=l)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[a,n,r]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,a)=>(o.f[a](e,t),t)),[])),o.u=e=>(572===e?"polySeg":e)+".bundle."+{117:"f625454f3e1aa757efb9",203:"d9cd79e7446fc5487b59",416:"f996275a6023c3ab4063",473:"12e70051b6d1ab699f25",572:"b4e806ccaa3eee7a13dd",702:"baa44e8e8bb05d8f5669"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/",(()=>{o.b=self.location+"";var e={584:1,572:1};o.f.i=(t,a)=>{e[t]||importScripts(o.p+o.u(t))};var t=globalThis.webpackChunk=globalThis.webpackChunk||[],a=t.push.bind(t);t.push=t=>{var[n,r,i]=t;for(var s in r)o.o(r,s)&&(o.m[s]=r[s]);for(i&&i(o);n.length;)e[n.pop()]=1;a(t)}})(),t=o.x,o.x=()=>Promise.all([203,473,702,416,117].map(o.e,o)).then(t);o.x()})(); //# sourceMappingURL=suv-peak-worker.bundle.2ce046f99718fd076295.js.map