@vitessce/json 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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C, d, e, f, h, G, b, J, M, i, O, c, R, j } from "./index-c9e50f8e.js";
1
+ import { C, d, e, f, h, G, b, J, M, i, O, c, R, j } from "./index-cd2c00d9.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-c9e50f8e.js";
1
+ import { B as BaseDecoder } from "./index-cd2c00d9.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
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-c9e50f8e.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-cd2c00d9.js";
3
3
  import "@vitessce/vit-s";
4
4
  import "react";
5
5
  var LercDecode = { exports: {} };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-c9e50f8e.js";
1
+ import { B as BaseDecoder } from "./index-cd2c00d9.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  const MIN_BITS = 9;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-c9e50f8e.js";
1
+ import { B as BaseDecoder } from "./index-cd2c00d9.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  class PackbitsDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-c9e50f8e.js";
1
+ import { B as BaseDecoder } from "./index-cd2c00d9.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  class RawDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-c9e50f8e.js";
1
+ import { B as BaseDecoder } from "./index-cd2c00d9.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  class WebImageDecoder extends BaseDecoder {
@@ -1 +1 @@
1
- {"version":3,"file":"ObsSegmentationsJson.d.ts","sourceRoot":"","sources":["../../src/json-loaders/ObsSegmentationsJson.js"],"names":[],"mappings":"AAGA;IACE;;;;;;;MAYC;IAFC;;;;;;;kBAAmF;IAIrF,qBAWC;CACF"}
1
+ {"version":3,"file":"ObsSegmentationsJson.d.ts","sourceRoot":"","sources":["../../src/json-loaders/ObsSegmentationsJson.js"],"names":[],"mappings":"AAIA;IACE;;;;;;;MAYC;IAFC;;;;;;;kBAAmF;IAIrF,qBAwCC;CACF"}
@@ -1,4 +1,5 @@
1
1
  import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
2
+ import { CoordinationLevel as CL } from '@vitessce/config';
2
3
  import JsonLoader from './JsonLoader.js';
3
4
  export default class ObsSegmentationsJsonLoader extends JsonLoader {
4
5
  loadFromCache(data) {
@@ -19,8 +20,33 @@ export default class ObsSegmentationsJsonLoader extends JsonLoader {
19
20
  if (payload instanceof AbstractLoaderError) {
20
21
  return Promise.reject(payload);
21
22
  }
23
+ const channelCoordination = [{
24
+ // obsType: null,
25
+ spatialChannelColor: [255, 255, 255],
26
+ spatialChannelVisible: true,
27
+ spatialChannelOpacity: 1.0,
28
+ spatialChannelWindow: null,
29
+ // featureType: 'feature',
30
+ // featureValueType: 'value',
31
+ obsColorEncoding: 'spatialChannelColor',
32
+ spatialSegmentationFilled: true,
33
+ spatialSegmentationStrokeWidth: 1.0,
34
+ obsHighlight: null,
35
+ }];
36
+ const coordinationValues = {
37
+ // spatialTargetZ: imageWrapper.getDefaultTargetZ(),
38
+ // spatialTargetT: imageWrapper.getDefaultTargetT(),
39
+ segmentationLayer: CL([
40
+ {
41
+ fileUid: this.coordinationValues?.fileUid || null,
42
+ spatialLayerOpacity: 1.0,
43
+ spatialLayerVisible: true,
44
+ segmentationChannel: CL(channelCoordination),
45
+ },
46
+ ]),
47
+ };
22
48
  const { data, url } = payload;
23
49
  const result = this.loadFromCache(data);
24
- return Promise.resolve(new LoaderResult(result, url));
50
+ return Promise.resolve(new LoaderResult(result, url, coordinationValues));
25
51
  }
26
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RasterJsonLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonLoader.js"],"names":[],"mappings":"AA6HA;IAWE,qBAyCC;IAnBG,oBAIC;CAgBN"}
1
+ {"version":3,"file":"RasterJsonLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonLoader.js"],"names":[],"mappings":"AA8HA;IAWE,qBAyCC;IAnBG,oBAIC;CAgBN"}
@@ -63,7 +63,8 @@ async function initLoader(imageData) {
63
63
  // Most of the following has been copied from OmeZarrLoader.js.
64
64
  // Reference: https://github.com/vitessce/vitessce/blob/fb0e7f/packages/file-types/zarr/src/ome-loaders/OmeZarrLoader.js#L29
65
65
  const { coordinateTransformations: coordinateTransformationsFromOptions } = metadata || {};
66
- const loader = await loadOmeZarr(url, requestInit);
66
+ const root = await zarrOpenRoot(url, requestInit);
67
+ const loader = await loadOmeZarr(root);
67
68
  const { metadata: loaderMetadata } = loader;
68
69
  const { omero, multiscales } = loaderMetadata;
69
70
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/json",
3
- "version": "3.3.2",
3
+ "version": "3.3.4",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -20,14 +20,15 @@
20
20
  "lodash-es": "^4.17.21",
21
21
  "zarrita": "0.4.0-next.4",
22
22
  "zod": "^3.21.4",
23
- "@vitessce/constants-internal": "3.3.2",
24
- "@vitessce/gl": "3.3.2",
25
- "@vitessce/schemas": "3.3.2",
26
- "@vitessce/spatial-utils": "3.3.2",
27
- "@vitessce/sets-utils": "3.3.2",
28
- "@vitessce/zarr-utils": "3.3.2",
29
- "@vitessce/utils": "3.3.2",
30
- "@vitessce/vit-s": "3.3.2"
23
+ "@vitessce/schemas": "3.3.4",
24
+ "@vitessce/constants-internal": "3.3.4",
25
+ "@vitessce/spatial-utils": "3.3.4",
26
+ "@vitessce/sets-utils": "3.3.4",
27
+ "@vitessce/gl": "3.3.4",
28
+ "@vitessce/utils": "3.3.4",
29
+ "@vitessce/vit-s": "3.3.4",
30
+ "@vitessce/config": "3.3.4",
31
+ "@vitessce/zarr-utils": "3.3.4"
31
32
  },
32
33
  "scripts": {
33
34
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
@@ -1,4 +1,5 @@
1
1
  import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
2
+ import { CoordinationLevel as CL } from '@vitessce/config';
2
3
  import JsonLoader from './JsonLoader.js';
3
4
 
4
5
  export default class ObsSegmentationsJsonLoader extends JsonLoader {
@@ -21,11 +22,40 @@ export default class ObsSegmentationsJsonLoader extends JsonLoader {
21
22
  if (payload instanceof AbstractLoaderError) {
22
23
  return Promise.reject(payload);
23
24
  }
25
+
26
+ const channelCoordination = [{
27
+ // obsType: null,
28
+ spatialChannelColor: [255, 255, 255],
29
+ spatialChannelVisible: true,
30
+ spatialChannelOpacity: 1.0,
31
+ spatialChannelWindow: null,
32
+ // featureType: 'feature',
33
+ // featureValueType: 'value',
34
+ obsColorEncoding: 'spatialChannelColor',
35
+ spatialSegmentationFilled: true,
36
+ spatialSegmentationStrokeWidth: 1.0,
37
+ obsHighlight: null,
38
+ }];
39
+
40
+ const coordinationValues = {
41
+ // spatialTargetZ: imageWrapper.getDefaultTargetZ(),
42
+ // spatialTargetT: imageWrapper.getDefaultTargetT(),
43
+ segmentationLayer: CL([
44
+ {
45
+ fileUid: this.coordinationValues?.fileUid || null,
46
+ spatialLayerOpacity: 1.0,
47
+ spatialLayerVisible: true,
48
+ segmentationChannel: CL(channelCoordination),
49
+ },
50
+ ]),
51
+ };
52
+
24
53
  const { data, url } = payload;
25
54
  const result = this.loadFromCache(data);
26
55
  return Promise.resolve(new LoaderResult(
27
56
  result,
28
57
  url,
58
+ coordinationValues,
29
59
  ));
30
60
  }
31
61
  }
@@ -80,7 +80,8 @@ async function initLoader(imageData) {
80
80
  // Reference: https://github.com/vitessce/vitessce/blob/fb0e7f/packages/file-types/zarr/src/ome-loaders/OmeZarrLoader.js#L29
81
81
  const { coordinateTransformations: coordinateTransformationsFromOptions } = metadata || {};
82
82
 
83
- const loader = await loadOmeZarr(url, requestInit);
83
+ const root = await zarrOpenRoot(url, requestInit);
84
+ const loader = await loadOmeZarr(root);
84
85
  const { metadata: loaderMetadata } = loader;
85
86
 
86
87
  const { omero, multiscales } = loaderMetadata;