@vitessce/ome-tiff 3.6.6 → 3.6.7

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-DhCSKj-N.js";
2
+ import { B as BaseDecoder } from "./index-DayW9LOs.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -104771,22 +104771,22 @@ async function getDecoder(fileDirectory) {
104771
104771
  const Decoder = await importFn();
104772
104772
  return new Decoder(fileDirectory);
104773
104773
  }
104774
- addDecoder([void 0, 1], () => import("./raw-Bs6xZKCz.js").then((m) => m.default));
104775
- addDecoder(5, () => import("./lzw-DE-YIxT2.js").then((m) => m.default));
104774
+ addDecoder([void 0, 1], () => import("./raw-8RpAiEWv.js").then((m) => m.default));
104775
+ addDecoder(5, () => import("./lzw-C3j8n_C_.js").then((m) => m.default));
104776
104776
  addDecoder(6, () => {
104777
104777
  throw new Error("old style JPEG compression is not supported.");
104778
104778
  });
104779
- addDecoder(7, () => import("./jpeg-CMQmXH4z.js").then((m) => m.default));
104780
- addDecoder([8, 32946], () => import("./deflate-DKBrgfhi.js").then((m) => m.default));
104781
- addDecoder(32773, () => import("./packbits-BT-Ed6dQ.js").then((m) => m.default));
104779
+ addDecoder(7, () => import("./jpeg-BHVrU3cB.js").then((m) => m.default));
104780
+ addDecoder([8, 32946], () => import("./deflate-Cf0xAa_y.js").then((m) => m.default));
104781
+ addDecoder(32773, () => import("./packbits-aUchmhLK.js").then((m) => m.default));
104782
104782
  addDecoder(
104783
104783
  34887,
104784
- () => import("./lerc-CPWteBlj.js").then(async (m) => {
104784
+ () => import("./lerc-DcvJGmf8.js").then(async (m) => {
104785
104785
  await m.zstd.init();
104786
104786
  return m;
104787
104787
  }).then((m) => m.default)
104788
104788
  );
104789
- addDecoder(50001, () => import("./webimage-DvRQ4HVR.js").then((m) => m.default));
104789
+ addDecoder(50001, () => import("./webimage-DAZ0DnAA.js").then((m) => m.default));
104790
104790
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
104791
104791
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
104792
104792
  }
@@ -141558,6 +141558,44 @@ function hexToRgb(hex) {
141558
141558
  parseInt(result[3].toLowerCase(), 16)
141559
141559
  ];
141560
141560
  }
141561
+ function normalizeCoordinateTransformations(coordinateTransformations, datasets) {
141562
+ var _a3;
141563
+ let result = [];
141564
+ if (Array.isArray(coordinateTransformations)) {
141565
+ result = coordinateTransformations.flatMap((transform2) => {
141566
+ if (transform2.input && transform2.output) {
141567
+ const { type } = transform2;
141568
+ if (type === "translation") {
141569
+ return {
141570
+ type,
141571
+ translation: transform2.translation
141572
+ };
141573
+ }
141574
+ if (type === "scale") {
141575
+ return {
141576
+ type,
141577
+ scale: transform2.scale
141578
+ };
141579
+ }
141580
+ if (type === "identity") {
141581
+ return { type };
141582
+ }
141583
+ if (type === "sequence") {
141584
+ return normalizeCoordinateTransformations(transform2.transformations, datasets);
141585
+ }
141586
+ log$1.warn(`Coordinate transformation type "${type}" is not supported.`);
141587
+ }
141588
+ return transform2;
141589
+ });
141590
+ }
141591
+ if (Array.isArray((_a3 = datasets == null ? void 0 : datasets[0]) == null ? void 0 : _a3.coordinateTransformations)) {
141592
+ result = [
141593
+ ...datasets[0].coordinateTransformations,
141594
+ ...result
141595
+ ];
141596
+ }
141597
+ return result;
141598
+ }
141561
141599
  function getDomains() {
141562
141600
  const domains = {};
141563
141601
  const needMin = ["Int8", "Int16", "Int32"];
@@ -141598,10 +141636,11 @@ class ImageWrapper {
141598
141636
  getModelMatrix() {
141599
141637
  const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options;
141600
141638
  if ("multiscales" in this.vivLoader.metadata) {
141601
- const { multiscales: [{ coordinateTransformations, axes }] } = this.vivLoader.metadata;
141639
+ const { multiscales: [{ datasets, coordinateTransformations: coordinateTransformationsFromFile, axes }] } = this.vivLoader.metadata;
141602
141640
  const ngffAxes = getNgffAxes(axes);
141603
141641
  const transformMatrixFromOptions = coordinateTransformationsToMatrix(coordinateTransformationsFromOptions, ngffAxes);
141604
- const transformMatrixFromFile = coordinateTransformationsToMatrix(coordinateTransformations, ngffAxes);
141642
+ const normCoordinateTransformationsFromFile = normalizeCoordinateTransformations(coordinateTransformationsFromFile, datasets);
141643
+ const transformMatrixFromFile = coordinateTransformationsToMatrix(normCoordinateTransformationsFromFile, ngffAxes);
141605
141644
  const transformMatrix = transformMatrixFromFile.multiplyLeft(transformMatrixFromOptions);
141606
141645
  return transformMatrix;
141607
141646
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c, b, O } from "./index-DhCSKj-N.js";
1
+ import { c, b, O } from "./index-DayW9LOs.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-DhCSKj-N.js";
1
+ import { B as BaseDecoder } from "./index-DayW9LOs.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-DhCSKj-N.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-DayW9LOs.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-DhCSKj-N.js";
1
+ import { B as BaseDecoder } from "./index-DayW9LOs.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-DhCSKj-N.js";
1
+ import { B as BaseDecoder } from "./index-DayW9LOs.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-DhCSKj-N.js";
1
+ import { B as BaseDecoder } from "./index-DayW9LOs.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-DhCSKj-N.js";
1
+ import { B as BaseDecoder } from "./index-DayW9LOs.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.6.6",
3
+ "version": "3.6.7",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -18,14 +18,14 @@
18
18
  "dependencies": {
19
19
  "d3-array": "^2.4.0",
20
20
  "lodash-es": "^4.17.21",
21
- "@vitessce/abstract": "3.6.6",
22
- "@vitessce/constants-internal": "3.6.6",
23
- "@vitessce/config": "3.6.6",
24
- "@vitessce/gl": "3.6.6",
25
- "@vitessce/sets-utils": "3.6.6",
26
- "@vitessce/spatial-utils": "3.6.6",
27
- "@vitessce/image-utils": "3.6.6",
28
- "@vitessce/utils": "3.6.6"
21
+ "@vitessce/abstract": "3.6.7",
22
+ "@vitessce/constants-internal": "3.6.7",
23
+ "@vitessce/config": "3.6.7",
24
+ "@vitessce/sets-utils": "3.6.7",
25
+ "@vitessce/spatial-utils": "3.6.7",
26
+ "@vitessce/image-utils": "3.6.7",
27
+ "@vitessce/utils": "3.6.7",
28
+ "@vitessce/gl": "3.6.7"
29
29
  },
30
30
  "scripts": {
31
31
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",