@vitessce/ome-tiff 3.6.18 → 3.7.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/{deflate-u7j5fAYD.js → deflate-_lVGjEGe.js} +1 -1
- package/dist/{index-Cm9YItP4.js → index-232sb5OI.js} +442 -452
- package/dist/index.js +1 -1
- package/dist/{jpeg-Dp1zNV18.js → jpeg-BlicShCt.js} +1 -1
- package/dist/{lerc-D8aoR9iq.js → lerc-CAv7lilE.js} +1 -1
- package/dist/{lzw-DgaeJZEg.js → lzw-BoCtt2-m.js} +1 -1
- package/dist/{packbits-ilQhXLbG.js → packbits-DX44B-XP.js} +1 -1
- package/dist/{raw-BqYJ21Lo.js → raw-DrIPO2u3.js} +1 -1
- package/dist/{webimage-C8B5E807.js → webimage-DPm5zEbA.js} +1 -1
- package/dist-tsc/OmeTiffLoader.d.ts.map +1 -1
- package/dist-tsc/OmeTiffLoader.js +20 -0
- package/package.json +12 -11
- package/src/OmeTiffLoader.js +22 -1
package/dist/index.js
CHANGED
|
@@ -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-
|
|
2
|
+
import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-232sb5OI.js";
|
|
3
3
|
var LercDecode = { exports: {} };
|
|
4
4
|
var hasRequiredLercDecode;
|
|
5
5
|
function requireLercDecode() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmeTiffLoader.d.ts","sourceRoot":"","sources":["../src/OmeTiffLoader.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OmeTiffLoader.d.ts","sourceRoot":"","sources":["../src/OmeTiffLoader.js"],"names":[],"mappings":"AAcA;;IACE,4BAWC;IAED,qBAsIC;IA1CG,oBAIC;CAuCN;sCA5JmD,oBAAoB"}
|
|
@@ -3,6 +3,9 @@ import { initializeRasterLayersAndChannels, coordinateTransformationsToMatrix, g
|
|
|
3
3
|
import { ImageWrapper } from '@vitessce/image-utils';
|
|
4
4
|
import { AbstractTwoStepLoader, LoaderResult } from '@vitessce/abstract';
|
|
5
5
|
import { CoordinationLevel as CL } from '@vitessce/config';
|
|
6
|
+
import { getDebugMode, log } from '@vitessce/globals';
|
|
7
|
+
const OFFSETS_DOCS_URL = 'https://vitessce.io/docs/data-troubleshooting/#ome-tiff-offsets';
|
|
8
|
+
const PYRAMID_DOCS_URL = 'https://vitessce.io/docs/data-troubleshooting/#multi-resolution-pyramidal-representation';
|
|
6
9
|
export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
7
10
|
async loadOffsets() {
|
|
8
11
|
const { offsetsUrl } = this.options || {};
|
|
@@ -22,6 +25,23 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
|
22
25
|
const offsets = await this.loadOffsets();
|
|
23
26
|
const loader = await viv.loadOmeTiff(url, { offsets, headers: requestInit?.headers });
|
|
24
27
|
const imageWrapper = new ImageWrapper(loader, this.options);
|
|
28
|
+
// Check size of lowest resolution.
|
|
29
|
+
// TODO: does this multiResolutionStats logic still work when image is not pyramidal?
|
|
30
|
+
const multiResolutionStats = imageWrapper.getMultiResolutionStats();
|
|
31
|
+
const lowestResolutionStats = multiResolutionStats.at(-1);
|
|
32
|
+
if (!lowestResolutionStats.canLoad) {
|
|
33
|
+
throw new Error(`The lowest resolution of this image exceeds texture size limits or the browser max heap size. Please use an image pyramid with lower resolution levels. See documentation at ${PYRAMID_DOCS_URL}`);
|
|
34
|
+
}
|
|
35
|
+
// Check that offsets are provided.
|
|
36
|
+
if (!offsets) {
|
|
37
|
+
// Offsets are missing.
|
|
38
|
+
if (getDebugMode()) {
|
|
39
|
+
throw new Error(`In debug mode, OME-TIFF offsets JSON file is required. See documentation at ${OFFSETS_DOCS_URL}`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
log.error(`OME-TIFF offsets JSON file is missing, which can increase loading times and degrade performance. See documentation at ${OFFSETS_DOCS_URL}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
25
45
|
const { Name: imageName, Pixels: { Channels, DimensionOrder, PhysicalSizeX, PhysicalSizeXUnit, PhysicalSizeY, PhysicalSizeYUnit, }, } = loader.metadata;
|
|
26
46
|
const channels = Array.isArray(Channels)
|
|
27
47
|
? Channels.map((channel, i) => channel.Name || `Channel ${i}`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/ome-tiff",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -18,18 +18,19 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"d3-array": "^2.4.0",
|
|
20
20
|
"lodash-es": "^4.17.21",
|
|
21
|
-
"@vitessce/
|
|
22
|
-
"@vitessce/
|
|
23
|
-
"@vitessce/
|
|
24
|
-
"@vitessce/
|
|
25
|
-
"@vitessce/
|
|
26
|
-
"@vitessce/
|
|
27
|
-
"@vitessce/
|
|
28
|
-
"@vitessce/
|
|
29
|
-
"@vitessce/utils": "3.
|
|
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"
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
32
|
-
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.
|
|
33
|
+
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",
|
|
33
34
|
"test": "pnpm exec vitest --run"
|
|
34
35
|
},
|
|
35
36
|
"module": "dist/index.js",
|
package/src/OmeTiffLoader.js
CHANGED
|
@@ -7,6 +7,10 @@ import {
|
|
|
7
7
|
import { ImageWrapper } from '@vitessce/image-utils';
|
|
8
8
|
import { AbstractTwoStepLoader, LoaderResult } from '@vitessce/abstract';
|
|
9
9
|
import { CoordinationLevel as CL } from '@vitessce/config';
|
|
10
|
+
import { getDebugMode, log } from '@vitessce/globals';
|
|
11
|
+
|
|
12
|
+
const OFFSETS_DOCS_URL = 'https://vitessce.io/docs/data-troubleshooting/#ome-tiff-offsets';
|
|
13
|
+
const PYRAMID_DOCS_URL = 'https://vitessce.io/docs/data-troubleshooting/#multi-resolution-pyramidal-representation';
|
|
10
14
|
|
|
11
15
|
export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
12
16
|
async loadOffsets() {
|
|
@@ -28,9 +32,26 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
|
28
32
|
|
|
29
33
|
const offsets = await this.loadOffsets();
|
|
30
34
|
const loader = await viv.loadOmeTiff(url, { offsets, headers: requestInit?.headers });
|
|
31
|
-
|
|
32
35
|
const imageWrapper = new ImageWrapper(loader, this.options);
|
|
33
36
|
|
|
37
|
+
// Check size of lowest resolution.
|
|
38
|
+
// TODO: does this multiResolutionStats logic still work when image is not pyramidal?
|
|
39
|
+
const multiResolutionStats = imageWrapper.getMultiResolutionStats();
|
|
40
|
+
const lowestResolutionStats = multiResolutionStats.at(-1);
|
|
41
|
+
if (!lowestResolutionStats.canLoad) {
|
|
42
|
+
throw new Error(`The lowest resolution of this image exceeds texture size limits or the browser max heap size. Please use an image pyramid with lower resolution levels. See documentation at ${PYRAMID_DOCS_URL}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Check that offsets are provided.
|
|
46
|
+
if (!offsets) {
|
|
47
|
+
// Offsets are missing.
|
|
48
|
+
if (getDebugMode()) {
|
|
49
|
+
throw new Error(`In debug mode, OME-TIFF offsets JSON file is required. See documentation at ${OFFSETS_DOCS_URL}`);
|
|
50
|
+
} else {
|
|
51
|
+
log.error(`OME-TIFF offsets JSON file is missing, which can increase loading times and degrade performance. See documentation at ${OFFSETS_DOCS_URL}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
34
55
|
const {
|
|
35
56
|
Name: imageName,
|
|
36
57
|
Pixels: {
|