@vitessce/ome-tiff 3.7.1 → 3.8.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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-232sb5OI.js";
2
+ import { B as BaseDecoder } from "./index-CbC3R3Yt.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -104765,22 +104765,22 @@ async function getDecoder(fileDirectory) {
104765
104765
  const Decoder = await importFn();
104766
104766
  return new Decoder(fileDirectory);
104767
104767
  }
104768
- addDecoder([void 0, 1], () => import("./raw-DrIPO2u3.js").then((m) => m.default));
104769
- addDecoder(5, () => import("./lzw-BoCtt2-m.js").then((m) => m.default));
104768
+ addDecoder([void 0, 1], () => import("./raw-DfYEbbM8.js").then((m) => m.default));
104769
+ addDecoder(5, () => import("./lzw-iAN9_BAn.js").then((m) => m.default));
104770
104770
  addDecoder(6, () => {
104771
104771
  throw new Error("old style JPEG compression is not supported.");
104772
104772
  });
104773
- addDecoder(7, () => import("./jpeg-BlicShCt.js").then((m) => m.default));
104774
- addDecoder([8, 32946], () => import("./deflate-_lVGjEGe.js").then((m) => m.default));
104775
- addDecoder(32773, () => import("./packbits-DX44B-XP.js").then((m) => m.default));
104773
+ addDecoder(7, () => import("./jpeg-f6Tz1iJ-.js").then((m) => m.default));
104774
+ addDecoder([8, 32946], () => import("./deflate-ChCTSJeP.js").then((m) => m.default));
104775
+ addDecoder(32773, () => import("./packbits-pGQCZ9pu.js").then((m) => m.default));
104776
104776
  addDecoder(
104777
104777
  34887,
104778
- () => import("./lerc-CAv7lilE.js").then(async (m) => {
104778
+ () => import("./lerc-DJq-_kdR.js").then(async (m) => {
104779
104779
  await m.zstd.init();
104780
104780
  return m;
104781
104781
  }).then((m) => m.default)
104782
104782
  );
104783
- addDecoder(50001, () => import("./webimage-DPm5zEbA.js").then((m) => m.default));
104783
+ addDecoder(50001, () => import("./webimage-Dwoxj7RN.js").then((m) => m.default));
104784
104784
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
104785
104785
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
104786
104786
  }
@@ -141384,13 +141384,16 @@ const getStatsForResolution = (loader, resolution) => {
141384
141384
  const height = shape[labels.indexOf("y")];
141385
141385
  const width = shape[labels.indexOf("x")];
141386
141386
  const depth = shape[labels.indexOf("z")];
141387
+ const dims = Object.fromEntries(labels.map((label, i2) => [label, shape[i2]]));
141387
141388
  const depthDownsampled = Math.max(1, depth >> resolution);
141388
141389
  const totalBytes = 4 * height * width * depthDownsampled;
141389
141390
  return {
141390
141391
  height,
141391
141392
  width,
141393
+ depth,
141392
141394
  depthDownsampled,
141393
- totalBytes
141395
+ totalBytes,
141396
+ dims
141394
141397
  };
141395
141398
  };
141396
141399
  const canLoadResolution = (loader, resolution) => {
@@ -142030,6 +142033,10 @@ class ImageWrapper {
142030
142033
  const { labels, shape } = Array.isArray(loader.data) ? loader.data[0] : loader.data;
142031
142034
  return shape[labels.indexOf("c")];
142032
142035
  }
142036
+ getNumResolutions() {
142037
+ const loader = this.vivLoader;
142038
+ return Array.isArray(loader.data) ? loader.data.length : 1;
142039
+ }
142033
142040
  isMultiResolution() {
142034
142041
  const loader = this.vivLoader;
142035
142042
  const hasViewableResolutions = Boolean(Array.from({
@@ -142040,13 +142047,21 @@ class ImageWrapper {
142040
142047
  getMultiResolutionStats() {
142041
142048
  const loader = this.vivLoader;
142042
142049
  return Array.from({ length: loader.data.length }).fill(0).map((_, resolution) => {
142043
- const { height, width, depthDownsampled, totalBytes } = getStatsForResolution(loader.data, resolution);
142050
+ const { height, width, depth, depthDownsampled, totalBytes, dims } = getStatsForResolution(loader.data, resolution);
142044
142051
  return {
142045
142052
  canLoad: canLoadResolution(loader.data, resolution),
142046
142053
  height,
142047
142054
  width,
142055
+ depth,
142048
142056
  depthDownsampled,
142049
- totalBytes
142057
+ totalBytes,
142058
+ dims
142059
+ // chunkHeight
142060
+ // chunkWidth
142061
+ // chunkDepth
142062
+ // physicalSizeVoxel
142063
+ // eslint-disable-next-line max-len
142064
+ // physicalSizeTotal (physicalSizeVoxel * highest-resolution numPixels, for each dimension)
142050
142065
  };
142051
142066
  });
142052
142067
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c, b, O } from "./index-232sb5OI.js";
1
+ import { c, b, O } from "./index-CbC3R3Yt.js";
2
2
  export {
3
3
  c as OmeTiffAsObsSegmentationsLoader,
4
4
  b as OmeTiffLoader,
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-232sb5OI.js";
1
+ import { B as BaseDecoder } from "./index-CbC3R3Yt.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, L as LercParameters, a as LercAddCompression } from "./index-232sb5OI.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-CbC3R3Yt.js";
3
3
  var LercDecode = { exports: {} };
4
4
  var hasRequiredLercDecode;
5
5
  function requireLercDecode() {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-232sb5OI.js";
1
+ import { B as BaseDecoder } from "./index-CbC3R3Yt.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-232sb5OI.js";
1
+ import { B as BaseDecoder } from "./index-CbC3R3Yt.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-232sb5OI.js";
1
+ import { B as BaseDecoder } from "./index-CbC3R3Yt.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-232sb5OI.js";
1
+ import { B as BaseDecoder } from "./index-CbC3R3Yt.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/ome-tiff",
3
- "version": "3.7.1",
3
+ "version": "3.8.1",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -18,16 +18,16 @@
18
18
  "dependencies": {
19
19
  "d3-array": "^2.4.0",
20
20
  "lodash-es": "^4.17.21",
21
- "@vitessce/globals": "3.7.1",
22
- "@vitessce/abstract": "3.7.1",
23
- "@vitessce/error": "3.7.1",
24
- "@vitessce/constants-internal": "3.7.1",
25
- "@vitessce/config": "3.7.1",
26
- "@vitessce/gl": "3.7.1",
27
- "@vitessce/sets-utils": "3.7.1",
28
- "@vitessce/spatial-utils": "3.7.1",
29
- "@vitessce/image-utils": "3.7.1",
30
- "@vitessce/utils": "3.7.1"
21
+ "@vitessce/globals": "3.8.1",
22
+ "@vitessce/abstract": "3.8.1",
23
+ "@vitessce/error": "3.8.1",
24
+ "@vitessce/constants-internal": "3.8.1",
25
+ "@vitessce/config": "3.8.1",
26
+ "@vitessce/gl": "3.8.1",
27
+ "@vitessce/sets-utils": "3.8.1",
28
+ "@vitessce/spatial-utils": "3.8.1",
29
+ "@vitessce/image-utils": "3.8.1",
30
+ "@vitessce/utils": "3.8.1"
31
31
  },
32
32
  "scripts": {
33
33
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",