@vitessce/ome-tiff 3.3.2 → 3.3.4
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-40eec6b1.js → deflate-0f58bee5.js} +1 -1
- package/dist/{index-132d2403.js → index-0bfa571c.js} +5836 -20177
- package/dist/index.js +1 -1
- package/dist/{jpeg-7fba9dd6.js → jpeg-84155fcd.js} +1 -1
- package/dist/{lerc-6801cc14.js → lerc-85b51660.js} +1 -1
- package/dist/{lzw-1ab3ee13.js → lzw-3a99a2e8.js} +1 -1
- package/dist/{packbits-15dfe2f1.js → packbits-da510b69.js} +1 -1
- package/dist/{raw-28a6a5da.js → raw-42b199bf.js} +1 -1
- package/dist/{webimage-a5b735d8.js → webimage-01cf8fb0.js} +1 -1
- package/dist-tsc/OmeTiffAsObsSegmentationsLoader.d.ts.map +1 -1
- package/dist-tsc/OmeTiffAsObsSegmentationsLoader.js +29 -1
- package/dist-tsc/OmeTiffLoader.d.ts.map +1 -1
- package/dist-tsc/OmeTiffLoader.js +24 -0
- package/package.json +9 -8
- package/src/OmeTiffAsObsSegmentationsLoader.js +34 -1
- package/src/OmeTiffLoader.js +26 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate_1 } from "./pako.esm-68f84e2a.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-0bfa571c.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@vitessce/vit-s";
|
|
5
5
|
var LercDecode = { exports: {} };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmeTiffAsObsSegmentationsLoader.d.ts","sourceRoot":"","sources":["../src/OmeTiffAsObsSegmentationsLoader.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OmeTiffAsObsSegmentationsLoader.d.ts","sourceRoot":"","sources":["../src/OmeTiffAsObsSegmentationsLoader.js"],"names":[],"mappings":"AAaA;CA6HC"}
|
|
@@ -2,11 +2,12 @@ import { viv } from '@vitessce/gl';
|
|
|
2
2
|
import { LoaderResult } from '@vitessce/vit-s';
|
|
3
3
|
import { initializeRasterLayersAndChannels, coordinateTransformationsToMatrix, getNgffAxesForTiff, } from '@vitessce/spatial-utils';
|
|
4
4
|
import { ImageWrapper, } from '@vitessce/image-utils';
|
|
5
|
+
import { CoordinationLevel as CL } from '@vitessce/config';
|
|
5
6
|
import OmeTiffLoader from './OmeTiffLoader.js';
|
|
6
7
|
export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
7
8
|
async load() {
|
|
8
9
|
const { url, requestInit } = this;
|
|
9
|
-
const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
|
|
10
|
+
const { coordinateTransformations: coordinateTransformationsFromOptions, obsTypesFromChannelNames, } = this.options || {};
|
|
10
11
|
const offsets = await this.loadOffsets();
|
|
11
12
|
const loader = await viv.loadOmeTiff(url, { offsets, headers: requestInit?.headers });
|
|
12
13
|
const imageWrapper = new ImageWrapper(loader, this.options);
|
|
@@ -32,6 +33,21 @@ export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
|
32
33
|
};
|
|
33
34
|
// Get image name and URL tuples.
|
|
34
35
|
const urls = [{ url, name: image.name }];
|
|
36
|
+
const channelObjects = imageWrapper.getChannelObjects();
|
|
37
|
+
const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i) => ({
|
|
38
|
+
spatialTargetC: i,
|
|
39
|
+
spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
|
|
40
|
+
spatialChannelVisible: true,
|
|
41
|
+
spatialChannelOpacity: 1.0,
|
|
42
|
+
spatialChannelWindow: channelObj.defaultWindow || null,
|
|
43
|
+
// featureType: 'feature',
|
|
44
|
+
// featureValueType: 'value',
|
|
45
|
+
obsColorEncoding: 'spatialChannelColor',
|
|
46
|
+
spatialSegmentationFilled: true,
|
|
47
|
+
spatialSegmentationStrokeWidth: 1.0,
|
|
48
|
+
obsHighlight: null,
|
|
49
|
+
...(obsTypesFromChannelNames ? { obsType: channelObj.name } : {}),
|
|
50
|
+
}));
|
|
35
51
|
// Add a loaderCreator function for each image layer.
|
|
36
52
|
const imagesWithLoaderCreators = [
|
|
37
53
|
{
|
|
@@ -53,7 +69,19 @@ export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
|
53
69
|
return this.autoImageCache.then((autoImages) => {
|
|
54
70
|
const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
|
|
55
71
|
const coordinationValues = {
|
|
72
|
+
// Old
|
|
56
73
|
spatialSegmentationLayer: autoImageLayers,
|
|
74
|
+
// New
|
|
75
|
+
spatialTargetZ: imageWrapper.getDefaultTargetZ(),
|
|
76
|
+
spatialTargetT: imageWrapper.getDefaultTargetT(),
|
|
77
|
+
segmentationLayer: CL([
|
|
78
|
+
{
|
|
79
|
+
fileUid: this.coordinationValues?.fileUid || null,
|
|
80
|
+
spatialLayerOpacity: 1.0,
|
|
81
|
+
spatialLayerVisible: true,
|
|
82
|
+
segmentationChannel: CL(channelCoordination),
|
|
83
|
+
},
|
|
84
|
+
]),
|
|
57
85
|
};
|
|
58
86
|
return new LoaderResult({
|
|
59
87
|
obsSegmentationsType: 'bitmask',
|
|
@@ -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":"AAUA;IACE,4BAWC;IAED,qBAqHC;IA1CG,oBAIC;CAuCN"}
|
|
@@ -2,6 +2,7 @@ import { viv } from '@vitessce/gl';
|
|
|
2
2
|
import { initializeRasterLayersAndChannels, coordinateTransformationsToMatrix, getNgffAxesForTiff, } from '@vitessce/spatial-utils';
|
|
3
3
|
import { ImageWrapper } from '@vitessce/image-utils';
|
|
4
4
|
import { AbstractTwoStepLoader, LoaderResult } from '@vitessce/vit-s';
|
|
5
|
+
import { CoordinationLevel as CL } from '@vitessce/config';
|
|
5
6
|
export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
6
7
|
async loadOffsets() {
|
|
7
8
|
const { offsetsUrl } = this.options || {};
|
|
@@ -46,6 +47,14 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
|
46
47
|
const urls = [
|
|
47
48
|
{ url, name: image.name },
|
|
48
49
|
];
|
|
50
|
+
const channelObjects = imageWrapper.getChannelObjects();
|
|
51
|
+
const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i) => ({
|
|
52
|
+
spatialTargetC: i,
|
|
53
|
+
spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
|
|
54
|
+
spatialChannelVisible: true,
|
|
55
|
+
spatialChannelOpacity: 1.0,
|
|
56
|
+
spatialChannelWindow: channelObj.defaultWindow || null,
|
|
57
|
+
}));
|
|
49
58
|
// Add a loaderCreator function for each image layer.
|
|
50
59
|
const imagesWithLoaderCreators = [
|
|
51
60
|
{
|
|
@@ -62,7 +71,22 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
|
62
71
|
return this.autoImageCache.then((autoImages) => {
|
|
63
72
|
const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
|
|
64
73
|
const coordinationValues = {
|
|
74
|
+
// Old
|
|
65
75
|
spatialImageLayer: autoImageLayers,
|
|
76
|
+
// New
|
|
77
|
+
spatialTargetZ: imageWrapper.getDefaultTargetZ(),
|
|
78
|
+
spatialTargetT: imageWrapper.getDefaultTargetT(),
|
|
79
|
+
imageLayer: CL([
|
|
80
|
+
{
|
|
81
|
+
fileUid: this.coordinationValues?.fileUid || null,
|
|
82
|
+
spatialLayerOpacity: 1.0,
|
|
83
|
+
spatialLayerVisible: true,
|
|
84
|
+
photometricInterpretation: imageWrapper.getPhotometricInterpretation(),
|
|
85
|
+
volumetricRenderingAlgorithm: 'maximumIntensityProjection',
|
|
86
|
+
spatialTargetResolution: null,
|
|
87
|
+
imageChannel: CL(channelCoordination),
|
|
88
|
+
},
|
|
89
|
+
]),
|
|
66
90
|
};
|
|
67
91
|
return new LoaderResult({
|
|
68
92
|
image: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/ome-tiff",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"author": "Gehlenborg Lab",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -19,13 +19,14 @@
|
|
|
19
19
|
"ajv": "^6.10.0",
|
|
20
20
|
"d3-array": "^2.4.0",
|
|
21
21
|
"lodash-es": "^4.17.21",
|
|
22
|
-
"@vitessce/constants-internal": "3.3.
|
|
23
|
-
"@vitessce/sets-utils": "3.3.
|
|
24
|
-
"@vitessce/
|
|
25
|
-
"@vitessce/
|
|
26
|
-
"@vitessce/
|
|
27
|
-
"@vitessce/
|
|
28
|
-
"@vitessce/
|
|
22
|
+
"@vitessce/constants-internal": "3.3.4",
|
|
23
|
+
"@vitessce/sets-utils": "3.3.4",
|
|
24
|
+
"@vitessce/gl": "3.3.4",
|
|
25
|
+
"@vitessce/config": "3.3.4",
|
|
26
|
+
"@vitessce/spatial-utils": "3.3.4",
|
|
27
|
+
"@vitessce/utils": "3.3.4",
|
|
28
|
+
"@vitessce/vit-s": "3.3.4",
|
|
29
|
+
"@vitessce/image-utils": "3.3.4"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"ajv": "^6.10.0"
|
|
@@ -8,12 +8,16 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
ImageWrapper,
|
|
10
10
|
} from '@vitessce/image-utils';
|
|
11
|
+
import { CoordinationLevel as CL } from '@vitessce/config';
|
|
11
12
|
import OmeTiffLoader from './OmeTiffLoader.js';
|
|
12
13
|
|
|
13
14
|
export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
14
15
|
async load() {
|
|
15
16
|
const { url, requestInit } = this;
|
|
16
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
coordinateTransformations: coordinateTransformationsFromOptions,
|
|
19
|
+
obsTypesFromChannelNames,
|
|
20
|
+
} = this.options || {};
|
|
17
21
|
const offsets = await this.loadOffsets();
|
|
18
22
|
const loader = await viv.loadOmeTiff(url, { offsets, headers: requestInit?.headers });
|
|
19
23
|
const imageWrapper = new ImageWrapper(loader, this.options);
|
|
@@ -58,6 +62,22 @@ export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
|
58
62
|
// Get image name and URL tuples.
|
|
59
63
|
const urls = [{ url, name: image.name }];
|
|
60
64
|
|
|
65
|
+
const channelObjects = imageWrapper.getChannelObjects();
|
|
66
|
+
const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i) => ({
|
|
67
|
+
spatialTargetC: i,
|
|
68
|
+
spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
|
|
69
|
+
spatialChannelVisible: true,
|
|
70
|
+
spatialChannelOpacity: 1.0,
|
|
71
|
+
spatialChannelWindow: channelObj.defaultWindow || null,
|
|
72
|
+
// featureType: 'feature',
|
|
73
|
+
// featureValueType: 'value',
|
|
74
|
+
obsColorEncoding: 'spatialChannelColor',
|
|
75
|
+
spatialSegmentationFilled: true,
|
|
76
|
+
spatialSegmentationStrokeWidth: 1.0,
|
|
77
|
+
obsHighlight: null,
|
|
78
|
+
...(obsTypesFromChannelNames ? { obsType: channelObj.name } : {}),
|
|
79
|
+
}));
|
|
80
|
+
|
|
61
81
|
// Add a loaderCreator function for each image layer.
|
|
62
82
|
const imagesWithLoaderCreators = [
|
|
63
83
|
{
|
|
@@ -87,8 +107,21 @@ export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
|
87
107
|
const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
|
|
88
108
|
|
|
89
109
|
const coordinationValues = {
|
|
110
|
+
// Old
|
|
90
111
|
spatialSegmentationLayer: autoImageLayers,
|
|
112
|
+
// New
|
|
113
|
+
spatialTargetZ: imageWrapper.getDefaultTargetZ(),
|
|
114
|
+
spatialTargetT: imageWrapper.getDefaultTargetT(),
|
|
115
|
+
segmentationLayer: CL([
|
|
116
|
+
{
|
|
117
|
+
fileUid: this.coordinationValues?.fileUid || null,
|
|
118
|
+
spatialLayerOpacity: 1.0,
|
|
119
|
+
spatialLayerVisible: true,
|
|
120
|
+
segmentationChannel: CL(channelCoordination),
|
|
121
|
+
},
|
|
122
|
+
]),
|
|
91
123
|
};
|
|
124
|
+
|
|
92
125
|
return new LoaderResult(
|
|
93
126
|
{
|
|
94
127
|
obsSegmentationsType: 'bitmask',
|
package/src/OmeTiffLoader.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from '@vitessce/spatial-utils';
|
|
7
7
|
import { ImageWrapper } from '@vitessce/image-utils';
|
|
8
8
|
import { AbstractTwoStepLoader, LoaderResult } from '@vitessce/vit-s';
|
|
9
|
+
import { CoordinationLevel as CL } from '@vitessce/config';
|
|
9
10
|
|
|
10
11
|
export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
11
12
|
async loadOffsets() {
|
|
@@ -74,6 +75,15 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
|
74
75
|
{ url, name: image.name },
|
|
75
76
|
];
|
|
76
77
|
|
|
78
|
+
const channelObjects = imageWrapper.getChannelObjects();
|
|
79
|
+
const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i) => ({
|
|
80
|
+
spatialTargetC: i,
|
|
81
|
+
spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
|
|
82
|
+
spatialChannelVisible: true,
|
|
83
|
+
spatialChannelOpacity: 1.0,
|
|
84
|
+
spatialChannelWindow: channelObj.defaultWindow || null,
|
|
85
|
+
}));
|
|
86
|
+
|
|
77
87
|
// Add a loaderCreator function for each image layer.
|
|
78
88
|
const imagesWithLoaderCreators = [
|
|
79
89
|
{
|
|
@@ -98,8 +108,24 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
|
98
108
|
const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
|
|
99
109
|
|
|
100
110
|
const coordinationValues = {
|
|
111
|
+
// Old
|
|
101
112
|
spatialImageLayer: autoImageLayers,
|
|
113
|
+
// New
|
|
114
|
+
spatialTargetZ: imageWrapper.getDefaultTargetZ(),
|
|
115
|
+
spatialTargetT: imageWrapper.getDefaultTargetT(),
|
|
116
|
+
imageLayer: CL([
|
|
117
|
+
{
|
|
118
|
+
fileUid: this.coordinationValues?.fileUid || null,
|
|
119
|
+
spatialLayerOpacity: 1.0,
|
|
120
|
+
spatialLayerVisible: true,
|
|
121
|
+
photometricInterpretation: imageWrapper.getPhotometricInterpretation(),
|
|
122
|
+
volumetricRenderingAlgorithm: 'maximumIntensityProjection',
|
|
123
|
+
spatialTargetResolution: null,
|
|
124
|
+
imageChannel: CL(channelCoordination),
|
|
125
|
+
},
|
|
126
|
+
]),
|
|
102
127
|
};
|
|
128
|
+
|
|
103
129
|
return new LoaderResult(
|
|
104
130
|
{
|
|
105
131
|
image: {
|