@vitessce/ome-tiff 3.1.2 → 3.2.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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c, b, O } from "./index-902940dd.js";
1
+ import { c, b, O } from "./index-738cadd7.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-902940dd.js";
1
+ import { B as BaseDecoder } from "./index-738cadd7.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  const dctZigZag = new Int32Array([
@@ -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-902940dd.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-738cadd7.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  var LercDecode = { exports: {} };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-902940dd.js";
1
+ import { B as BaseDecoder } from "./index-738cadd7.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  const MIN_BITS = 9;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-902940dd.js";
1
+ import { B as BaseDecoder } from "./index-738cadd7.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  class PackbitsDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-902940dd.js";
1
+ import { B as BaseDecoder } from "./index-738cadd7.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  class RawDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-902940dd.js";
1
+ import { B as BaseDecoder } from "./index-738cadd7.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  class WebImageDecoder extends BaseDecoder {
@@ -1 +1 @@
1
- {"version":3,"file":"OmeTiffAsObsSegmentationsLoader.d.ts","sourceRoot":"","sources":["../src/OmeTiffAsObsSegmentationsLoader.js"],"names":[],"mappings":"AASA;CAwFC"}
1
+ {"version":3,"file":"OmeTiffAsObsSegmentationsLoader.d.ts","sourceRoot":"","sources":["../src/OmeTiffAsObsSegmentationsLoader.js"],"names":[],"mappings":"AAYA;CA6FC"}
@@ -1,6 +1,7 @@
1
1
  import { viv } from '@vitessce/gl';
2
2
  import { LoaderResult } from '@vitessce/vit-s';
3
3
  import { initializeRasterLayersAndChannels, coordinateTransformationsToMatrix, getNgffAxesForTiff, } from '@vitessce/spatial-utils';
4
+ import { ImageWrapper, } from '@vitessce/image-utils';
4
5
  import OmeTiffLoader from './OmeTiffLoader.js';
5
6
  export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
6
7
  async load() {
@@ -8,6 +9,7 @@ export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
8
9
  const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
9
10
  const offsets = await this.loadOffsets();
10
11
  const loader = await viv.loadOmeTiff(url, { offsets, headers: requestInit?.headers });
12
+ const imageWrapper = new ImageWrapper(loader, this.options);
11
13
  const { Name: imageName, Pixels: { Channels, DimensionOrder, PhysicalSizeX, PhysicalSizeXUnit, PhysicalSizeY, PhysicalSizeYUnit, }, } = loader.metadata;
12
14
  const transformMatrixFromOptions = coordinateTransformationsToMatrix(coordinateTransformationsFromOptions, getNgffAxesForTiff(DimensionOrder));
13
15
  const usePhysicalSizeScaling = (PhysicalSizeX
@@ -55,7 +57,11 @@ export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
55
57
  };
56
58
  return new LoaderResult({
57
59
  obsSegmentationsType: 'bitmask',
58
- obsSegmentations: { loaders: imageLayerLoaders, meta: imageLayerMeta },
60
+ obsSegmentations: {
61
+ loaders: imageLayerLoaders,
62
+ meta: imageLayerMeta,
63
+ instance: imageWrapper, // TODO: make this the root value of LoaderResult.image.
64
+ },
59
65
  }, urls, coordinationValues);
60
66
  });
61
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OmeTiffLoader.d.ts","sourceRoot":"","sources":["../src/OmeTiffLoader.js"],"names":[],"mappings":"AAQA;IACE,4BAWC;IAED,qBAqFC;IAtBG,oBAIC;CAmBN"}
1
+ {"version":3,"file":"OmeTiffLoader.d.ts","sourceRoot":"","sources":["../src/OmeTiffLoader.js"],"names":[],"mappings":"AASA;IACE,4BAWC;IAED,qBA4FC;IA1BG,oBAIC;CAuBN"}
@@ -1,5 +1,6 @@
1
1
  import { viv } from '@vitessce/gl';
2
2
  import { initializeRasterLayersAndChannels, coordinateTransformationsToMatrix, getNgffAxesForTiff, } from '@vitessce/spatial-utils';
3
+ import { ImageWrapper } from '@vitessce/image-utils';
3
4
  import { AbstractTwoStepLoader, LoaderResult } from '@vitessce/vit-s';
4
5
  export default class OmeTiffLoader extends AbstractTwoStepLoader {
5
6
  async loadOffsets() {
@@ -19,6 +20,7 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
19
20
  const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
20
21
  const offsets = await this.loadOffsets();
21
22
  const loader = await viv.loadOmeTiff(url, { offsets, headers: requestInit?.headers });
23
+ const imageWrapper = new ImageWrapper(loader, this.options);
22
24
  const { Name: imageName, Pixels: { Channels, DimensionOrder, PhysicalSizeX, PhysicalSizeXUnit, PhysicalSizeY, PhysicalSizeYUnit, }, } = loader.metadata;
23
25
  const channels = Array.isArray(Channels)
24
26
  ? Channels.map((channel, i) => channel.Name || `Channel ${i}`)
@@ -63,8 +65,12 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
63
65
  spatialImageLayer: autoImageLayers,
64
66
  };
65
67
  return new LoaderResult({
66
- image: { loaders: imageLayerLoaders, meta: imageLayerMeta },
67
- featureIndex: channels,
68
+ image: {
69
+ loaders: imageLayerLoaders,
70
+ meta: imageLayerMeta,
71
+ instance: imageWrapper, // TODO: make this the root value of LoaderResult.image.
72
+ },
73
+ featureIndex: imageWrapper.getChannelNames(),
68
74
  }, urls, coordinationValues);
69
75
  });
70
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/ome-tiff",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,12 +19,13 @@
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.1.2",
23
- "@vitessce/gl": "3.1.2",
24
- "@vitessce/sets-utils": "3.1.2",
25
- "@vitessce/spatial-utils": "3.1.2",
26
- "@vitessce/utils": "3.1.2",
27
- "@vitessce/vit-s": "3.1.2"
22
+ "@vitessce/constants-internal": "3.2.0",
23
+ "@vitessce/gl": "3.2.0",
24
+ "@vitessce/sets-utils": "3.2.0",
25
+ "@vitessce/spatial-utils": "3.2.0",
26
+ "@vitessce/image-utils": "3.2.0",
27
+ "@vitessce/utils": "3.2.0",
28
+ "@vitessce/vit-s": "3.2.0"
28
29
  },
29
30
  "devDependencies": {
30
31
  "ajv": "^6.10.0"
@@ -5,6 +5,9 @@ import {
5
5
  coordinateTransformationsToMatrix,
6
6
  getNgffAxesForTiff,
7
7
  } from '@vitessce/spatial-utils';
8
+ import {
9
+ ImageWrapper,
10
+ } from '@vitessce/image-utils';
8
11
  import OmeTiffLoader from './OmeTiffLoader.js';
9
12
 
10
13
  export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
@@ -13,6 +16,7 @@ export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
13
16
  const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
14
17
  const offsets = await this.loadOffsets();
15
18
  const loader = await viv.loadOmeTiff(url, { offsets, headers: requestInit?.headers });
19
+ const imageWrapper = new ImageWrapper(loader, this.options);
16
20
  const {
17
21
  Name: imageName,
18
22
  Pixels: {
@@ -88,7 +92,11 @@ export default class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
88
92
  return new LoaderResult(
89
93
  {
90
94
  obsSegmentationsType: 'bitmask',
91
- obsSegmentations: { loaders: imageLayerLoaders, meta: imageLayerMeta },
95
+ obsSegmentations: {
96
+ loaders: imageLayerLoaders, // TODO: replace with imageWrapper
97
+ meta: imageLayerMeta, // TODO: replace with imageWrapper
98
+ instance: imageWrapper, // TODO: make this the root value of LoaderResult.image.
99
+ },
92
100
  },
93
101
  urls,
94
102
  coordinationValues,
@@ -4,6 +4,7 @@ import {
4
4
  coordinateTransformationsToMatrix,
5
5
  getNgffAxesForTiff,
6
6
  } from '@vitessce/spatial-utils';
7
+ import { ImageWrapper } from '@vitessce/image-utils';
7
8
  import { AbstractTwoStepLoader, LoaderResult } from '@vitessce/vit-s';
8
9
 
9
10
  export default class OmeTiffLoader extends AbstractTwoStepLoader {
@@ -26,6 +27,9 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
26
27
 
27
28
  const offsets = await this.loadOffsets();
28
29
  const loader = await viv.loadOmeTiff(url, { offsets, headers: requestInit?.headers });
30
+
31
+ const imageWrapper = new ImageWrapper(loader, this.options);
32
+
29
33
  const {
30
34
  Name: imageName,
31
35
  Pixels: {
@@ -98,8 +102,12 @@ export default class OmeTiffLoader extends AbstractTwoStepLoader {
98
102
  };
99
103
  return new LoaderResult(
100
104
  {
101
- image: { loaders: imageLayerLoaders, meta: imageLayerMeta },
102
- featureIndex: channels,
105
+ image: {
106
+ loaders: imageLayerLoaders, // TODO: replace with imageWrapper
107
+ meta: imageLayerMeta, // TODO: replace with imageWrapper
108
+ instance: imageWrapper, // TODO: make this the root value of LoaderResult.image.
109
+ },
110
+ featureIndex: imageWrapper.getChannelNames(),
103
111
  },
104
112
  urls,
105
113
  coordinationValues,