@vitessce/ome-tiff 3.2.2 → 3.3.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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-c89b6124.js";
2
+ import { B as BaseDecoder } from "./index-132d2403.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  class DeflateDecoder extends BaseDecoder {
@@ -2982,7 +2982,7 @@ const jsonLoader = {
2982
2982
  testText: isJSON,
2983
2983
  parseTextSync: JSON.parse
2984
2984
  };
2985
- const version = "8.8.20";
2985
+ const version = "8.8.27";
2986
2986
  const existingVersion = globalThis.deck && globalThis.deck.VERSION;
2987
2987
  if (existingVersion && existingVersion !== version) {
2988
2988
  throw new Error("deck.gl - multiple versions detected: ".concat(existingVersion, " vs ").concat(version));
@@ -4181,9 +4181,8 @@ function cssToDeviceRatio(gl) {
4181
4181
  luma
4182
4182
  } = gl;
4183
4183
  if (gl.canvas && luma) {
4184
- const {
4185
- clientWidth
4186
- } = luma.canvasSizeInfo;
4184
+ const cachedSize = luma.canvasSizeInfo;
4185
+ const clientWidth = "clientWidth" in cachedSize ? cachedSize.clientWidth : gl.canvas.clientWidth;
4187
4186
  return clientWidth ? gl.drawingBufferWidth / clientWidth : 1;
4188
4187
  }
4189
4188
  return 1;
@@ -4439,7 +4438,7 @@ function setDevicePixelRatio(gl, devicePixelRatio, options) {
4439
4438
  });
4440
4439
  }
4441
4440
  }
4442
- const VERSION$7 = "8.5.16";
4441
+ const VERSION$7 = "8.5.21";
4443
4442
  const STARTUP_MESSAGE = "set luma.log.level=1 (or higher) to trace rendering";
4444
4443
  class StatsManager {
4445
4444
  constructor() {
@@ -4560,7 +4559,6 @@ let Resource$1 = class Resource {
4560
4559
  this._handle = this._createHandle();
4561
4560
  }
4562
4561
  this.byteLength = 0;
4563
- this._initStats();
4564
4562
  this._addStats();
4565
4563
  }
4566
4564
  toString() {
@@ -4696,9 +4694,6 @@ let Resource$1 = class Resource {
4696
4694
  this.gl.luma = this.gl.luma || {};
4697
4695
  return this.gl.luma;
4698
4696
  }
4699
- _initStats() {
4700
- this.gl.stats = this.gl.stats || new StatsManager();
4701
- }
4702
4697
  _addStats() {
4703
4698
  const name2 = this[Symbol.toStringTag];
4704
4699
  const stats = lumaStats.get("Resource Counts");
@@ -4713,27 +4708,29 @@ let Resource$1 = class Resource {
4713
4708
  }
4714
4709
  _trackAllocatedMemory(bytes) {
4715
4710
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
4716
- this._doTrackAllocatedMemory(bytes, name2);
4717
- this._doTrackAllocatedMemory(bytes, name2, this.gl.stats.get("Memory Usage"));
4711
+ this._trackAllocatedMemoryForContext(bytes, name2);
4712
+ this._trackAllocatedMemoryForContext(bytes, name2, this.gl.canvas && this.gl.canvas.id);
4713
+ this.byteLength = bytes;
4718
4714
  }
4719
- _doTrackAllocatedMemory(bytes) {
4715
+ _trackAllocatedMemoryForContext(bytes) {
4720
4716
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
4721
- let stats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lumaStats.get("Memory Usage");
4717
+ let id = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
4718
+ const stats = lumaStats.get("Memory Usage".concat(id));
4722
4719
  stats.get("GPU Memory").addCount(bytes);
4723
4720
  stats.get("".concat(name2, " Memory")).addCount(bytes);
4724
- this.byteLength = bytes;
4725
4721
  }
4726
4722
  _trackDeallocatedMemory() {
4727
4723
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
4728
- this._doTrackDeallocatedMemory(name2);
4729
- this._doTrackDeallocatedMemory(name2, this.gl.stats.get("Memory Usage"));
4724
+ this._trackDeallocatedMemoryForContext(name2);
4725
+ this._trackDeallocatedMemoryForContext(name2, this.gl.canvas && this.gl.canvas.id);
4726
+ this.byteLength = 0;
4730
4727
  }
4731
- _doTrackDeallocatedMemory() {
4728
+ _trackDeallocatedMemoryForContext() {
4732
4729
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
4733
- let stats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : lumaStats.get("Memory Usage");
4730
+ let id = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
4731
+ const stats = lumaStats.get("Memory Usage".concat(id));
4734
4732
  stats.get("GPU Memory").subtractCount(this.byteLength);
4735
4733
  stats.get("".concat(name2, " Memory")).subtractCount(this.byteLength);
4736
- this.byteLength = 0;
4737
4734
  }
4738
4735
  };
4739
4736
  const ERR_TYPE_DEDUCTION = "Failed to deduce GL constant from typed array";
@@ -17949,6 +17946,7 @@ const picking = {
17949
17946
  inject: {
17950
17947
  "vs:DECKGL_FILTER_GL_POSITION": "\n // for picking depth values\n picking_setPickingAttribute(position.z / position.w);\n ",
17951
17948
  "vs:DECKGL_FILTER_COLOR": "\n picking_setPickingColor(geometry.pickingColor);\n ",
17949
+ "fs:#decl": "\nuniform bool picking_uAttribute;\n ",
17952
17950
  "fs:DECKGL_FILTER_COLOR": {
17953
17951
  order: 99,
17954
17952
  injection: "\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "
@@ -18759,6 +18757,9 @@ class Viewport {
18759
18757
  this.projectFlat = this.projectFlat.bind(this);
18760
18758
  this.unprojectFlat = this.unprojectFlat.bind(this);
18761
18759
  }
18760
+ get subViewports() {
18761
+ return null;
18762
+ }
18762
18763
  get metersPerPixel() {
18763
18764
  return this.distanceScales.metersPerUnit[2] / this.scale;
18764
18765
  }
@@ -27683,7 +27684,7 @@ class Attribute extends DataColumn {
27683
27684
  const {
27684
27685
  startIndices
27685
27686
  } = this;
27686
- const vertexIndex = startIndices ? startIndices[row] : row;
27687
+ const vertexIndex = startIndices ? row < startIndices.length ? startIndices[row] : this.numInstances : row;
27687
27688
  return vertexIndex * this.size;
27688
27689
  }
27689
27690
  getShaderAttributes() {
@@ -30327,7 +30328,7 @@ class Layer extends Component {
30327
30328
  if (Array.isArray(highlightColor)) {
30328
30329
  parameters.pickingHighlightColor = highlightColor;
30329
30330
  }
30330
- if (Number.isInteger(highlightedObjectIndex)) {
30331
+ if (forceUpdate || highlightedObjectIndex !== oldProps.highlightedObjectIndex) {
30331
30332
  parameters.pickingSelectedColor = Number.isFinite(highlightedObjectIndex) && highlightedObjectIndex >= 0 ? this.encodePickingColor(highlightedObjectIndex) : null;
30332
30333
  }
30333
30334
  this.setModuleParameters(parameters);
@@ -31690,7 +31691,7 @@ function interpolateQuad(quad, ut, vt) {
31690
31691
  }
31691
31692
  const vs$g = "\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n geometry.worldPosition = positions;\n geometry.uv = texCoords;\n geometry.pickingColor = pickingColor;\n\n gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTexCoord = texCoords;\n\n if (coordinateConversion < -0.5) {\n vTexPos = geometry.position.xy + project_uCommonOrigin.xy;\n } else if (coordinateConversion > 0.5) {\n vTexPos = geometry.worldPosition.xy;\n }\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n";
31692
31693
  const packUVsIntoRGB = "\nvec3 packUVsIntoRGB(vec2 uv) {\n // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n vec2 uv8bit = floor(uv * 256.);\n\n // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n // Scale and clamp to 0-1 range\n vec2 uvFraction = fract(uv * 256.);\n vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;\n\n return vec3(uv8bit, fractions) / 255.;\n}\n";
31693
- const fs$i = "\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n float x = lnglat.x;\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n xy /= WORLD_SCALE;\n return degrees(vec2(\n xy.x - PI,\n atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n float luminance = (color.r + color.g + color.b) * 0.333333333;\n return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n return mix(transparentColor, vec4(color, 1.0), alpha);\n}\n\nvec2 getUV(vec2 pos) {\n return vec2(\n (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n );\n}\n\n".concat(packUVsIntoRGB, "\n\nvoid main(void) {\n vec2 uv = vTexCoord;\n if (coordinateConversion < -0.5) {\n vec2 lnglat = mercator_to_lnglat(vTexPos);\n uv = getUV(lnglat);\n } else if (coordinateConversion > 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n if (picking_uActive) {\n // Since instance information is not used, we can use picking color for pixel index\n gl_FragColor.rgb = packUVsIntoRGB(uv);\n }\n}\n");
31694
+ const fs$i = "\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n float x = lnglat.x;\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n xy /= WORLD_SCALE;\n return degrees(vec2(\n xy.x - PI,\n atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n float luminance = (color.r + color.g + color.b) * 0.333333333;\n return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n return mix(transparentColor, vec4(color, 1.0), alpha);\n}\n\nvec2 getUV(vec2 pos) {\n return vec2(\n (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n );\n}\n\n".concat(packUVsIntoRGB, "\n\nvoid main(void) {\n vec2 uv = vTexCoord;\n if (coordinateConversion < -0.5) {\n vec2 lnglat = mercator_to_lnglat(vTexPos);\n uv = getUV(lnglat);\n } else if (coordinateConversion > 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n if (picking_uActive && !picking_uAttribute) {\n // Since instance information is not used, we can use picking color for pixel index\n gl_FragColor.rgb = packUVsIntoRGB(uv);\n }\n}\n");
31694
31695
  const defaultProps$I = {
31695
31696
  image: {
31696
31697
  type: "image",
@@ -39833,18 +39834,22 @@ function getBoundingBox(viewport, zRange, extent2) {
39833
39834
  }
39834
39835
  function getCullBounds({
39835
39836
  viewport,
39836
- z: z2,
39837
+ z: z2 = 0,
39837
39838
  cullRect
39838
39839
  }) {
39839
- const x2 = cullRect.x - viewport.x;
39840
- const y2 = cullRect.y - viewport.y;
39841
- const {
39842
- width,
39843
- height
39844
- } = cullRect;
39840
+ const subViewports = viewport.subViewports || [viewport];
39841
+ return subViewports.map((v) => getCullBoundsInViewport(v, z2, cullRect));
39842
+ }
39843
+ function getCullBoundsInViewport(viewport, z2, cullRect) {
39845
39844
  if (!Array.isArray(z2)) {
39845
+ const x2 = cullRect.x - viewport.x;
39846
+ const y2 = cullRect.y - viewport.y;
39847
+ const {
39848
+ width,
39849
+ height
39850
+ } = cullRect;
39846
39851
  const unprojectOption = {
39847
- targetZ: z2 || 0
39852
+ targetZ: z2
39848
39853
  };
39849
39854
  const topLeft = viewport.unproject([x2, y2], unprojectOption);
39850
39855
  const topRight = viewport.unproject([x2 + width, y2], unprojectOption);
@@ -39852,16 +39857,8 @@ function getCullBounds({
39852
39857
  const bottomRight = viewport.unproject([x2 + width, y2 + height], unprojectOption);
39853
39858
  return [Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]), Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]), Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]), Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1])];
39854
39859
  }
39855
- const bounds0 = getCullBounds({
39856
- viewport,
39857
- z: z2[0],
39858
- cullRect
39859
- });
39860
- const bounds1 = getCullBounds({
39861
- viewport,
39862
- z: z2[1],
39863
- cullRect
39864
- });
39860
+ const bounds0 = getCullBoundsInViewport(viewport, z2[0], cullRect);
39861
+ const bounds1 = getCullBoundsInViewport(viewport, z2[1], cullRect);
39865
39862
  return [Math.min(bounds0[0], bounds1[0]), Math.min(bounds0[1], bounds1[1]), Math.max(bounds0[2], bounds1[2]), Math.max(bounds0[3], bounds1[3])];
39866
39863
  }
39867
39864
  function getIndexingCoords(bbox2, scale2, modelMatrixInverse) {
@@ -40091,7 +40088,7 @@ class Tileset2D {
40091
40088
  return false;
40092
40089
  }
40093
40090
  if (cullRect && this._viewport) {
40094
- const [minX, minY, maxX, maxY] = getCullBounds({
40091
+ const boundsArr = this._getCullBounds({
40095
40092
  viewport: this._viewport,
40096
40093
  z: this._zRange,
40097
40094
  cullRect
@@ -40099,12 +40096,20 @@ class Tileset2D {
40099
40096
  const {
40100
40097
  bbox: bbox2
40101
40098
  } = tile;
40102
- if ("west" in bbox2) {
40103
- return bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
40099
+ for (const [minX, minY, maxX, maxY] of boundsArr) {
40100
+ let overlaps;
40101
+ if ("west" in bbox2) {
40102
+ overlaps = bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
40103
+ } else {
40104
+ const y02 = Math.min(bbox2.top, bbox2.bottom);
40105
+ const y12 = Math.max(bbox2.top, bbox2.bottom);
40106
+ overlaps = bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
40107
+ }
40108
+ if (overlaps) {
40109
+ return true;
40110
+ }
40104
40111
  }
40105
- const y02 = Math.min(bbox2.top, bbox2.bottom);
40106
- const y12 = Math.max(bbox2.top, bbox2.bottom);
40107
- return bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
40112
+ return false;
40108
40113
  }
40109
40114
  return true;
40110
40115
  }
@@ -40553,14 +40558,19 @@ class TileLayer extends CompositeLayer {
40553
40558
  info,
40554
40559
  sourceLayer
40555
40560
  }) {
40561
+ const sourceTile = sourceLayer.props.tile;
40556
40562
  if (info.picked) {
40557
- info.tile = sourceLayer.props.tile;
40563
+ info.tile = sourceTile;
40558
40564
  }
40565
+ info.sourceTile = sourceTile;
40559
40566
  return info;
40560
40567
  }
40561
40568
  _updateAutoHighlight(info) {
40562
- if (info.sourceLayer) {
40563
- info.sourceLayer.updateAutoHighlight(info);
40569
+ const sourceTile = info.sourceTile;
40570
+ if (sourceTile && sourceTile.layers) {
40571
+ for (const layer of sourceTile.layers) {
40572
+ layer.updateAutoHighlight(info);
40573
+ }
40564
40574
  }
40565
40575
  }
40566
40576
  renderLayers() {
@@ -52878,6 +52888,9 @@ class ScenegraphNode {
52878
52888
  toString() {
52879
52889
  return "{type: ScenegraphNode, id: ".concat(this.id, ")}");
52880
52890
  }
52891
+ getBounds() {
52892
+ return null;
52893
+ }
52881
52894
  setPosition(position) {
52882
52895
  assert$8(position.length === 3, "setPosition requires vector argument");
52883
52896
  this.position = position;
@@ -53028,6 +53041,34 @@ class GroupNode extends ScenegraphNode {
53028
53041
  this.removeAll();
53029
53042
  super.delete();
53030
53043
  }
53044
+ getBounds() {
53045
+ const result = [[Infinity, Infinity, Infinity], [-Infinity, -Infinity, -Infinity]];
53046
+ this.traverse((node, _ref) => {
53047
+ let {
53048
+ worldMatrix
53049
+ } = _ref;
53050
+ const bounds2 = node.getBounds();
53051
+ if (!bounds2) {
53052
+ return;
53053
+ }
53054
+ const [min2, max2] = bounds2;
53055
+ const center2 = new Vector3(min2).add(max2).divide([2, 2, 2]);
53056
+ worldMatrix.transformAsPoint(center2, center2);
53057
+ const halfSize = new Vector3(max2).subtract(min2).divide([2, 2, 2]);
53058
+ worldMatrix.transformAsVector(halfSize, halfSize);
53059
+ for (let v = 0; v < 8; v++) {
53060
+ const position = new Vector3(v & 1 ? -1 : 1, v & 2 ? -1 : 1, v & 4 ? -1 : 1).multiply(halfSize).add(center2);
53061
+ for (let i2 = 0; i2 < 3; i2++) {
53062
+ result[0][i2] = Math.min(result[0][i2], position[i2]);
53063
+ result[1][i2] = Math.max(result[1][i2], position[i2]);
53064
+ }
53065
+ }
53066
+ });
53067
+ if (!Number.isFinite(result[0][0])) {
53068
+ return null;
53069
+ }
53070
+ return result;
53071
+ }
53031
53072
  traverse(visitor) {
53032
53073
  let {
53033
53074
  worldMatrix = new Matrix4()
@@ -53277,6 +53318,7 @@ class ModelNode extends ScenegraphNode {
53277
53318
  } else {
53278
53319
  this.model = new Model(gl, props2);
53279
53320
  }
53321
+ this.bounds = null;
53280
53322
  this.managedResources = props2.managedResources || [];
53281
53323
  }
53282
53324
  setProps(props2) {
@@ -53284,6 +53326,9 @@ class ModelNode extends ScenegraphNode {
53284
53326
  this._setModelNodeProps(props2);
53285
53327
  return this;
53286
53328
  }
53329
+ getBounds() {
53330
+ return this.bounds;
53331
+ }
53287
53332
  delete() {
53288
53333
  if (this.model) {
53289
53334
  this.model.delete();
@@ -53468,17 +53513,21 @@ function createGLTFModel(gl, options) {
53468
53513
  const managedResources = [];
53469
53514
  managedResources.push(...materialParser.generatedTextures);
53470
53515
  managedResources.push(...Object.values(attributes).map((attribute) => attribute.buffer));
53471
- const model = new ModelNode(gl, Object.assign({
53516
+ const model = new ModelNode(gl, {
53472
53517
  id,
53473
53518
  drawMode,
53474
53519
  vertexCount,
53475
53520
  modules: [pbr],
53476
- defines: materialParser.defines,
53477
53521
  parameters: materialParser.parameters,
53478
53522
  vs: addVersionToShader(gl, vs$7),
53479
53523
  fs: addVersionToShader(gl, fs$7),
53480
- managedResources
53481
- }, modelOptions));
53524
+ managedResources,
53525
+ ...modelOptions,
53526
+ defines: {
53527
+ ...materialParser.defines,
53528
+ ...modelOptions.defines
53529
+ }
53530
+ });
53482
53531
  model.setProps({
53483
53532
  attributes
53484
53533
  });
@@ -53573,13 +53622,15 @@ class GLTFInstantiator {
53573
53622
  log$3.warn("getVertexCount() not found")();
53574
53623
  }
53575
53624
  createPrimitive(gltfPrimitive, i2, gltfMesh) {
53576
- return createGLTFModel(this.gl, Object.assign({
53625
+ const model = createGLTFModel(this.gl, Object.assign({
53577
53626
  id: gltfPrimitive.name || "".concat(gltfMesh.name || gltfMesh.id, "-primitive-").concat(i2),
53578
53627
  drawMode: gltfPrimitive.mode || 4,
53579
53628
  vertexCount: gltfPrimitive.indices ? gltfPrimitive.indices.count : this.getVertexCount(gltfPrimitive.attributes),
53580
53629
  attributes: this.createAttributes(gltfPrimitive.attributes, gltfPrimitive.indices),
53581
53630
  material: gltfPrimitive.material
53582
53631
  }, this.options));
53632
+ model.bounds = [gltfPrimitive.attributes.POSITION.min, gltfPrimitive.attributes.POSITION.max];
53633
+ return model;
53583
53634
  }
53584
53635
  createAttributes(attributes, indices) {
53585
53636
  const loadedAttributes = {};
@@ -61507,15 +61558,11 @@ class Tile3DLayer extends CompositeLayer {
61507
61558
  info,
61508
61559
  sourceLayer
61509
61560
  }) {
61510
- const {
61511
- layerMap
61512
- } = this.state;
61513
- const layerId = sourceLayer && sourceLayer.id;
61514
- if (layerId) {
61515
- const substr = layerId.substring(this.id.length + 1);
61516
- const tileId = substr.substring(substr.indexOf("-") + 1);
61517
- info.object = layerMap[tileId] && layerMap[tileId].tile;
61561
+ const sourceTile = sourceLayer && sourceLayer.props.tile;
61562
+ if (info.picked) {
61563
+ info.object = sourceTile;
61518
61564
  }
61565
+ info.sourceTile = sourceTile;
61519
61566
  return info;
61520
61567
  }
61521
61568
  filterSubLayer({
@@ -61531,8 +61578,10 @@ class Tile3DLayer extends CompositeLayer {
61531
61578
  return tile.selected && tile.viewportIds.includes(viewportId);
61532
61579
  }
61533
61580
  _updateAutoHighlight(info) {
61534
- if (info.sourceLayer) {
61535
- info.sourceLayer.updateAutoHighlight(info);
61581
+ const sourceTile = info.sourceTile;
61582
+ const layerCache = this.state.layerMap[sourceTile === null || sourceTile === void 0 ? void 0 : sourceTile.id];
61583
+ if (layerCache && layerCache.layer) {
61584
+ layerCache.layer.updateAutoHighlight(info);
61536
61585
  }
61537
61586
  }
61538
61587
  async _loadTileset(tilesetUrl) {
@@ -103472,16 +103521,16 @@ async function getDecoder(fileDirectory) {
103472
103521
  const Decoder = await importFn();
103473
103522
  return new Decoder(fileDirectory);
103474
103523
  }
103475
- addDecoder([void 0, 1], () => import("./raw-a79aeb3f.js").then((m) => m.default));
103476
- addDecoder(5, () => import("./lzw-dc830cdf.js").then((m) => m.default));
103524
+ addDecoder([void 0, 1], () => import("./raw-28a6a5da.js").then((m) => m.default));
103525
+ addDecoder(5, () => import("./lzw-1ab3ee13.js").then((m) => m.default));
103477
103526
  addDecoder(6, () => {
103478
103527
  throw new Error("old style JPEG compression is not supported.");
103479
103528
  });
103480
- addDecoder(7, () => import("./jpeg-2e272217.js").then((m) => m.default));
103481
- addDecoder([8, 32946], () => import("./deflate-6bc21747.js").then((m) => m.default));
103482
- addDecoder(32773, () => import("./packbits-a6204131.js").then((m) => m.default));
103483
- addDecoder(34887, () => import("./lerc-3cd543dc.js").then((m) => m.default));
103484
- addDecoder(50001, () => import("./webimage-c95937a4.js").then((m) => m.default));
103529
+ addDecoder(7, () => import("./jpeg-7fba9dd6.js").then((m) => m.default));
103530
+ addDecoder([8, 32946], () => import("./deflate-40eec6b1.js").then((m) => m.default));
103531
+ addDecoder(32773, () => import("./packbits-15dfe2f1.js").then((m) => m.default));
103532
+ addDecoder(34887, () => import("./lerc-6801cc14.js").then((m) => m.default));
103533
+ addDecoder(50001, () => import("./webimage-a5b735d8.js").then((m) => m.default));
103485
103534
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
103486
103535
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
103487
103536
  }
@@ -125942,6 +125991,7 @@ const DataType$1 = {
125942
125991
  const FileType$1 = {
125943
125992
  // Joint file types
125944
125993
  ANNDATA_ZARR: "anndata.zarr",
125994
+ SPATIALDATA_ZARR: "spatialdata.zarr",
125945
125995
  // Atomic file types
125946
125996
  OBS_EMBEDDING_CSV: "obsEmbedding.csv",
125947
125997
  OBS_SPOTS_CSV: "obsSpots.csv",
@@ -125964,6 +126014,16 @@ const FileType$1 = {
125964
126014
  OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
125965
126015
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
125966
126016
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
126017
+ // SpatialData
126018
+ IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
126019
+ LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
126020
+ SHAPES_SPATIALDATA_ZARR: "shapes.spatialdata.zarr",
126021
+ OBS_FEATURE_MATRIX_SPATIALDATA_ZARR: "obsFeatureMatrix.spatialdata.zarr",
126022
+ OBS_SETS_SPATIALDATA_ZARR: "obsSets.spatialdata.zarr",
126023
+ OBS_SPOTS_SPATIALDATA_ZARR: "obsSpots.spatialdata.zarr",
126024
+ // TODO:
126025
+ // OBS_POINTS_SPATIALDATA_ZARR: 'obsPoints.spatialdata.zarr',
126026
+ // OBS_LOCATIONS_SPATIALDATA_ZARR: 'obsLocations.spatialdata.zarr',
125967
126027
  // MuData
125968
126028
  OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
125969
126029
  OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
@@ -126400,9 +126460,30 @@ z.object({
126400
126460
  offsetsUrl: z.string().optional(),
126401
126461
  coordinateTransformations: omeCoordinateTransformations.optional()
126402
126462
  });
126403
- z.object({
126463
+ const imageOmeZarrSchema = z.object({
126404
126464
  coordinateTransformations: omeCoordinateTransformations.optional()
126405
126465
  });
126466
+ imageOmeZarrSchema.extend({
126467
+ path: z.string()
126468
+ });
126469
+ z.object({
126470
+ path: z.string()
126471
+ });
126472
+ z.object({
126473
+ path: z.string()
126474
+ });
126475
+ z.object({
126476
+ path: z.string(),
126477
+ tablePath: z.string().optional().describe("The path to a table which annotates the spots. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected.")
126478
+ });
126479
+ annDataObsFeatureMatrix.extend({
126480
+ region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional()
126481
+ });
126482
+ z.object({
126483
+ region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional(),
126484
+ tablePath: z.string().optional().describe("The path to a table which contains the index for the set values."),
126485
+ obsSets: annDataObsSets
126486
+ });
126406
126487
  z.object({
126407
126488
  obsIndex: z.string(),
126408
126489
  obsEmbedding: z.array(z.string()).length(2)
@@ -132960,9 +133041,9 @@ const schemePlasma = [[13, 8, 135], [16, 7, 136], [19, 7, 137], [22, 7, 138], [2
132960
133041
  function rgbSpline(spline) {
132961
133042
  return (colors) => {
132962
133043
  const n3 = colors.length;
132963
- let r2 = new Array(n3);
132964
- let g2 = new Array(n3);
132965
- let b = new Array(n3);
133044
+ const r2 = new Array(n3);
133045
+ const g2 = new Array(n3);
133046
+ const b = new Array(n3);
132966
133047
  let i2;
132967
133048
  let color;
132968
133049
  for (i2 = 0; i2 < n3; ++i2) {
@@ -132971,10 +133052,10 @@ function rgbSpline(spline) {
132971
133052
  g2[i2] = color[1] || 0;
132972
133053
  b[i2] = color[2] || 0;
132973
133054
  }
132974
- r2 = spline(r2);
132975
- g2 = spline(g2);
132976
- b = spline(b);
132977
- return (t2) => [r2(t2), g2(t2), b(t2)];
133055
+ const rFunc = spline(r2);
133056
+ const gFunc = spline(g2);
133057
+ const bFunc = spline(b);
133058
+ return (t2) => [rFunc(t2), gFunc(t2), bFunc(t2)];
132978
133059
  };
132979
133060
  }
132980
133061
  function basis(values2) {
@@ -149086,6 +149167,13 @@ class ImageWrapper {
149086
149167
  const { omero: { channels: channels2 } } = this.vivLoader.metadata;
149087
149168
  return channels2.length;
149088
149169
  }
149170
+ if ("channels_metadata" in this.vivLoader.metadata) {
149171
+ const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
149172
+ return (channelsMetadata == null ? void 0 : channelsMetadata.channels.length) || 0;
149173
+ }
149174
+ if ("image-label" in this.vivLoader.metadata) {
149175
+ return 1;
149176
+ }
149089
149177
  return 0;
149090
149178
  }
149091
149179
  getChannelNames() {
@@ -149097,6 +149185,12 @@ class ImageWrapper {
149097
149185
  const { omero: { channels: channels2 } } = this.vivLoader.metadata;
149098
149186
  return channels2.map((channel, i2) => channel.label || `Channel ${i2}`);
149099
149187
  }
149188
+ if ("channels_metadata" in this.vivLoader.metadata) {
149189
+ const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
149190
+ if (channelsMetadata && Array.isArray(channelsMetadata == null ? void 0 : channelsMetadata.channels)) {
149191
+ return channelsMetadata.channels.map((channel) => `Channel ${channel.label}`);
149192
+ }
149193
+ }
149100
149194
  return [];
149101
149195
  }
149102
149196
  getChannelObjects() {
@@ -149118,6 +149212,17 @@ class ImageWrapper {
149118
149212
  autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
149119
149213
  }));
149120
149214
  }
149215
+ if ("channels_metadata" in this.vivLoader.metadata) {
149216
+ const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
149217
+ if (channelsMetadata && Array.isArray(channelsMetadata == null ? void 0 : channelsMetadata.channels)) {
149218
+ return channelsMetadata.channels.map((channel, i2) => ({
149219
+ name: `Channel ${channel.label}`,
149220
+ defaultColor: void 0,
149221
+ defaultWindow: void 0,
149222
+ autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
149223
+ }));
149224
+ }
149225
+ }
149121
149226
  return [];
149122
149227
  }
149123
149228
  getDtype() {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c, b, O } from "./index-c89b6124.js";
1
+ import { c, b, O } from "./index-132d2403.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-c89b6124.js";
1
+ import { B as BaseDecoder } from "./index-132d2403.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-c89b6124.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-132d2403.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-c89b6124.js";
1
+ import { B as BaseDecoder } from "./index-132d2403.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-c89b6124.js";
1
+ import { B as BaseDecoder } from "./index-132d2403.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-c89b6124.js";
1
+ import { B as BaseDecoder } from "./index-132d2403.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-c89b6124.js";
1
+ import { B as BaseDecoder } from "./index-132d2403.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  class WebImageDecoder extends BaseDecoder {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/ome-tiff",
3
- "version": "3.2.2",
3
+ "version": "3.3.1",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,13 +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.2.2",
23
- "@vitessce/gl": "3.2.2",
24
- "@vitessce/sets-utils": "3.2.2",
25
- "@vitessce/spatial-utils": "3.2.2",
26
- "@vitessce/image-utils": "3.2.2",
27
- "@vitessce/utils": "3.2.2",
28
- "@vitessce/vit-s": "3.2.2"
22
+ "@vitessce/constants-internal": "3.3.1",
23
+ "@vitessce/gl": "3.3.1",
24
+ "@vitessce/spatial-utils": "3.3.1",
25
+ "@vitessce/sets-utils": "3.3.1",
26
+ "@vitessce/image-utils": "3.3.1",
27
+ "@vitessce/utils": "3.3.1",
28
+ "@vitessce/vit-s": "3.3.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "ajv": "^6.10.0"