@vitessce/spatial-utils 3.7.1 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-BG1V_H-C.js";
2
+ import { B as BaseDecoder } from "./index-zLXH8-s_.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -120352,22 +120352,22 @@ function addDecoder(cases, importFn) {
120352
120352
  }
120353
120353
  cases.forEach((c) => registry$2.set(c, importFn));
120354
120354
  }
120355
- addDecoder([void 0, 1], () => import("./raw-DYD4ffWY.js").then((m) => m.default));
120356
- addDecoder(5, () => import("./lzw-CR842oo8.js").then((m) => m.default));
120355
+ addDecoder([void 0, 1], () => import("./raw-DZY6tqRx.js").then((m) => m.default));
120356
+ addDecoder(5, () => import("./lzw-DSzM2vzP.js").then((m) => m.default));
120357
120357
  addDecoder(6, () => {
120358
120358
  throw new Error("old style JPEG compression is not supported.");
120359
120359
  });
120360
- addDecoder(7, () => import("./jpeg-BbjFORMl.js").then((m) => m.default));
120361
- addDecoder([8, 32946], () => import("./deflate-ldFkItxC.js").then((m) => m.default));
120362
- addDecoder(32773, () => import("./packbits-d5Chjmu1.js").then((m) => m.default));
120360
+ addDecoder(7, () => import("./jpeg-ByXD9maJ.js").then((m) => m.default));
120361
+ addDecoder([8, 32946], () => import("./deflate-D_2UO6fa.js").then((m) => m.default));
120362
+ addDecoder(32773, () => import("./packbits-CrqHVPsh.js").then((m) => m.default));
120363
120363
  addDecoder(
120364
120364
  34887,
120365
- () => import("./lerc-BuRW-ikH.js").then(async (m) => {
120365
+ () => import("./lerc-BQbF85ET.js").then(async (m) => {
120366
120366
  await m.zstd.init();
120367
120367
  return m;
120368
120368
  }).then((m) => m.default)
120369
120369
  );
120370
- addDecoder(50001, () => import("./webimage-BzeeSDvF.js").then((m) => m.default));
120370
+ addDecoder(50001, () => import("./webimage-CFSHFGmn.js").then((m) => m.default));
120371
120371
  function decodeRowAcc(row, stride) {
120372
120372
  let length2 = row.length - stride;
120373
120373
  let offset = 0;
@@ -137813,13 +137813,18 @@ const getStatsForResolution = (loader, resolution) => {
137813
137813
  const height = shape[labels.indexOf("y")];
137814
137814
  const width = shape[labels.indexOf("x")];
137815
137815
  const depth = shape[labels.indexOf("z")];
137816
+ const dims = Object.fromEntries(
137817
+ labels.map((label, i2) => [label, shape[i2]])
137818
+ );
137816
137819
  const depthDownsampled = Math.max(1, depth >> resolution);
137817
137820
  const totalBytes = 4 * height * width * depthDownsampled;
137818
137821
  return {
137819
137822
  height,
137820
137823
  width,
137824
+ depth,
137821
137825
  depthDownsampled,
137822
- totalBytes
137826
+ totalBytes,
137827
+ dims
137823
137828
  };
137824
137829
  };
137825
137830
  const canLoadResolution = (loader, resolution) => {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D, e, a, b, c, d, H, G, Z, E, s, n, o, F, C, z, l, m, A, y, h, r, w, q, i, f, j, k, v, u, t, p, x } from "./index-BG1V_H-C.js";
1
+ import { D, e, a, b, c, d, H, G, Z, E, s, n, o, F, C, z, l, m, A, y, h, r, w, q, i, f, j, k, v, u, t, p, x } from "./index-zLXH8-s_.js";
2
2
  export {
3
3
  D as DEFAULT_CELLS_LAYER,
4
4
  e as DEFAULT_LAYER_TYPE_ORDERING,
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-BG1V_H-C.js";
1
+ import { B as BaseDecoder } from "./index-zLXH8-s_.js";
2
2
  const dctZigZag = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-BG1V_H-C.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-zLXH8-s_.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-BG1V_H-C.js";
1
+ import { B as BaseDecoder } from "./index-zLXH8-s_.js";
2
2
  const MIN_BITS = 9;
3
3
  const CLEAR_CODE = 256;
4
4
  const EOI_CODE = 257;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-BG1V_H-C.js";
1
+ import { B as BaseDecoder } from "./index-zLXH8-s_.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-BG1V_H-C.js";
1
+ import { B as BaseDecoder } from "./index-zLXH8-s_.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-BG1V_H-C.js";
1
+ import { B as BaseDecoder } from "./index-zLXH8-s_.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
@@ -100,8 +100,12 @@ export function coordinateTransformationsToMatrixForSpatialData(ngffMetadata: {
100
100
  export function getStatsForResolution(loader: any, resolution: any): {
101
101
  height: any;
102
102
  width: any;
103
+ depth: any;
103
104
  depthDownsampled: number;
104
105
  totalBytes: number;
106
+ dims: {
107
+ [k: string]: any;
108
+ };
105
109
  };
106
110
  export function canLoadResolution(loader: any, resolution: any): boolean;
107
111
  import { Matrix4 } from 'math.gl';
@@ -1 +1 @@
1
- {"version":3,"file":"spatial.d.ts","sourceRoot":"","sources":["../src/spatial.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,4CAJW,MAAM,SACN,MAAM,GAAG,SAAS,GAChB,MAAM,CAMlB;AAmCD;;;;GAIG;AACH,8BAHW,MAAM,YACN,KAAK,GAAC,IAAI,WAiBpB;AAID,sHAmCC;AAiHD;;GAEG;AACH,qC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CC;AAiHD;;GAEG;AACH,qCAFW,KAAK,CAAE,MAAM,CAAC,WAKxB;AAED;;;;;;GAMG;AACH,gDALW,MAAM,eAEJ,MAAM,EAAE,CAuCpB;AAED;;;;;;;;;GASG;AACH,gEAJW,MAAM,EAAE,sBAER,CAAC,MAAM,EAAE,GAAC,IAAI,CAAC,+CAuEzB;AASD;;;IAuBC;AAED,uDAQC;AAED;;;;;;GAMG;AACH,6CAJW,CAAC,GAAG,GAAC,GAAG,GAAC,GAAG,CAAC,EAAE,cACf,CAAC,GAAG,GAAC,GAAG,GAAC,GAAG,CAAC,EAAE,GACd,MAAM,EAAE,EAAE,CA6BrB;AAED;;;;;;;;GAQG;AACH,6EANW,MAAM,EAAE,GAAC,SAAS,QAElB,MAAM,EAAE,GAAC,SAAS,GAEhB,OAAO,CAiHnB;AAED,6CAOC;AAMD,8CASC;AAED,iEAKC;AAGD;;;;;;;;;GASG;AACH,8EANW,MAAM,EAAE,GAAC,SAAS,YAGlB,MAAM,EAAE,GACN,MAAM,EAAE,CA4CpB;AAED;;;;;;;;;;;;;;GAcG;AACH,8EAVW;IACV,GAAM,CAAC,EAAE,CAAC,MAAM,EAAE,GAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;IACrE,yBAA4B,CAAC,EAAE,MAAM,EAAE,CAAC;IACxC,QAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB,0BAEO,MAAM,GACJ,OAAO,CA2CnB;AA7qBM;;;;;;;;;EAiBN;AAEM,yEAiBN;wBAzDuB,SAAS"}
@@ -23,12 +23,13 @@ export const getStatsForResolution = (loader, resolution) => {
23
23
  const height = shape[labels.indexOf('y')];
24
24
  const width = shape[labels.indexOf('x')];
25
25
  const depth = shape[labels.indexOf('z')];
26
+ const dims = Object.fromEntries(labels.map((label, i) => ([label, shape[i]])));
26
27
  // eslint-disable-next-line no-bitwise
27
28
  const depthDownsampled = Math.max(1, depth >> resolution);
28
29
  // Check memory allocation limits for Float32Array (used in XR3DLayer for rendering)
29
30
  const totalBytes = 4 * height * width * depthDownsampled;
30
31
  return {
31
- height, width, depthDownsampled, totalBytes,
32
+ height, width, depth, depthDownsampled, totalBytes, dims,
32
33
  };
33
34
  };
34
35
  export const canLoadResolution = (loader, resolution) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/spatial-utils",
3
- "version": "3.7.1",
3
+ "version": "3.8.0",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -21,12 +21,12 @@
21
21
  "math.gl": "^3.5.6",
22
22
  "mathjs": "^9.2.0",
23
23
  "internmap": "^2.0.3",
24
- "@vitessce/gl": "3.7.1",
25
- "@vitessce/utils": "3.7.1",
26
- "@vitessce/zarr-utils": "3.7.1",
27
- "@vitessce/constants-internal": "3.7.1",
28
- "@vitessce/globals": "3.7.1",
29
- "@vitessce/error": "3.7.1"
24
+ "@vitessce/gl": "3.8.0",
25
+ "@vitessce/utils": "3.8.0",
26
+ "@vitessce/zarr-utils": "3.8.0",
27
+ "@vitessce/constants-internal": "3.8.0",
28
+ "@vitessce/globals": "3.8.0",
29
+ "@vitessce/error": "3.8.0"
30
30
  },
31
31
  "scripts": {
32
32
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",
package/src/spatial.js CHANGED
@@ -25,12 +25,17 @@ export const getStatsForResolution = (loader, resolution) => {
25
25
  const height = shape[labels.indexOf('y')];
26
26
  const width = shape[labels.indexOf('x')];
27
27
  const depth = shape[labels.indexOf('z')];
28
+
29
+ const dims = Object.fromEntries(
30
+ labels.map((label, i) => ([label, shape[i]])),
31
+ );
32
+
28
33
  // eslint-disable-next-line no-bitwise
29
34
  const depthDownsampled = Math.max(1, depth >> resolution);
30
35
  // Check memory allocation limits for Float32Array (used in XR3DLayer for rendering)
31
36
  const totalBytes = 4 * height * width * depthDownsampled;
32
37
  return {
33
- height, width, depthDownsampled, totalBytes,
38
+ height, width, depth, depthDownsampled, totalBytes, dims,
34
39
  };
35
40
  };
36
41