@vitessce/all 3.3.1 → 3.3.3

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.
@@ -29,7 +29,7 @@ var __privateMethod = (obj, member, method2) => {
29
29
  var _bytes, _encoder, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _metadata, _a2, _metadata2, _b, _c, _overrides, _use_suffix_request, _merge_init, merge_init_fn;
30
30
  import * as React from "react";
31
31
  import React__default, { Children, isValidElement, cloneElement, useMemo, forwardRef, useRef, useImperativeHandle, useEffect, useLayoutEffect as useLayoutEffect$1, useState, PureComponent, Component as Component$1, useCallback, createElement, useContext, useReducer, Suspense } from "react";
32
- import { useLoaders, useCoordination, useDescription, useImageData, useReady, TitleInfo, useVitessceContainer, useSetWarning, useObsSetsData, useUrls, usePlotOptionsStyles, OptionsContainer, CellColorEncodingOption, OptionSelect, useComponentHover, useComponentViewInfo, useSetComponentHover, useSetComponentViewInfo, useInitialCoordination, useDeckCanvasSize, useMultiObsLabels, useObsEmbeddingData, useFeatureSelection, useObsFeatureMatrixIndices, useFeatureLabelsData, useGetObsInfo, useUint8FeatureSelection, useExpressionValueGetter, useAuxiliaryCoordination, useHasLoader, useObsLocationsData, useObsLabelsData, useObsSegmentationsData, useNeighborhoodsData, useCoordinationScopes, useCoordinationScopesBy, useMultiCoordinationScopesSecondaryNonNull, useMultiCoordinationScopesNonNull, useComplexCoordination, useComplexCoordinationSecondary, useMultiObsPoints, usePointMultiObsLabels, useMultiObsSpots, useSpotMultiObsSets, useSpotMultiFeatureSelection, useSpotMultiObsFeatureMatrixIndices, useSegmentationMultiObsLocations, useMultiObsSegmentations, useSegmentationMultiObsSets, useSegmentationMultiFeatureSelection, useSegmentationMultiObsFeatureMatrixIndices, useMultiImages, useObsFeatureMatrixData, useUint8ObsFeatureMatrix, useGetObsMembership, PopperMenu, useComponentLayout, useClosestVitessceContainerSize, useWindowDimensions, useRemoveImageChannelInMetaCoordinationScopes, useAddImageChannelInMetaCoordinationScopes, useWarning, useGridItemSize, useGenomicProfilesData, DataSourceFetchError, AbstractLoaderError, AbstractTwoStepLoader, LoaderResult, LoaderValidationError, logConfig, VitS } from "@vitessce/vit-s";
32
+ import { useLoaders, useCoordination, useDescription, useImageData, useReady, TitleInfo, useVitessceContainer, useSetWarning, useObsSetsData, useUrls, usePlotOptionsStyles, OptionsContainer, CellColorEncodingOption, OptionSelect, useComponentHover, useComponentViewInfo, useSetComponentHover, useSetComponentViewInfo, useInitialCoordination, useDeckCanvasSize, useMultiObsLabels, useObsEmbeddingData, useFeatureSelection, useObsFeatureMatrixIndices, useFeatureLabelsData, useGetObsInfo, useUint8FeatureSelection, useExpressionValueGetter, useAuxiliaryCoordination, useHasLoader, useObsLocationsData, useObsLabelsData, useObsSegmentationsData, useNeighborhoodsData, useMergeCoordination, useCoordinationScopes, useCoordinationScopesBy, useMultiCoordinationScopesSecondaryNonNull, useMultiCoordinationScopesNonNull, useComplexCoordination, useComplexCoordinationSecondary, useMultiObsPoints, usePointMultiObsLabels, useMultiObsSpots, useSpotMultiObsSets, useSpotMultiFeatureSelection, useSpotMultiObsFeatureMatrixIndices, useSegmentationMultiObsLocations, useMultiObsSegmentations, useSegmentationMultiObsSets, useSegmentationMultiFeatureSelection, useSegmentationMultiObsFeatureMatrixIndices, useMultiImages, useObsFeatureMatrixData, useUint8ObsFeatureMatrix, useGetObsMembership, PopperMenu, useComponentLayout, useClosestVitessceContainerSize, useWindowDimensions, useRemoveImageChannelInMetaCoordinationScopes, useAddImageChannelInMetaCoordinationScopes, useWarning, useGridItemSize, useGenomicProfilesData, DataSourceFetchError, AbstractLoaderError, AbstractTwoStepLoader, LoaderResult, LoaderValidationError, logConfig, VitS } from "@vitessce/vit-s";
33
33
  import * as ReactDOM from "react-dom";
34
34
  import ReactDOM__default from "react-dom";
35
35
  function _mergeNamespaces(n3, m2) {
@@ -19015,7 +19015,9 @@ const FileType$1 = {
19015
19015
  OBS_SEGMENTATIONS_JSON: "obsSegmentations.json",
19016
19016
  OBS_SETS_CSV: "obsSets.csv",
19017
19017
  OBS_SETS_JSON: "obsSets.json",
19018
+ // OME-Zarr
19018
19019
  IMAGE_OME_ZARR: "image.ome-zarr",
19020
+ OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
19019
19021
  // AnnData
19020
19022
  OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
19021
19023
  OBS_SETS_ANNDATA_ZARR: "obsSets.anndata.zarr",
@@ -19504,7 +19506,9 @@ const COMPONENT_COORDINATION_TYPES = {
19504
19506
  CoordinationType$1.SPATIAL_SEGMENTATION_FILLED,
19505
19507
  CoordinationType$1.SPATIAL_SEGMENTATION_STROKE_WIDTH,
19506
19508
  CoordinationType$1.IMAGE_CHANNEL,
19509
+ CoordinationType$1.IMAGE_LAYER,
19507
19510
  CoordinationType$1.SEGMENTATION_CHANNEL,
19511
+ CoordinationType$1.SEGMENTATION_LAYER,
19508
19512
  CoordinationType$1.SPATIAL_CHANNEL_VISIBLE,
19509
19513
  CoordinationType$1.SPATIAL_CHANNEL_OPACITY,
19510
19514
  CoordinationType$1.SPATIAL_CHANNEL_WINDOW,
@@ -19522,6 +19526,9 @@ const COMPONENT_COORDINATION_TYPES = {
19522
19526
  CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH,
19523
19527
  CoordinationType$1.SPATIAL_LAYER_COLOR,
19524
19528
  CoordinationType$1.OBS_COLOR_ENCODING,
19529
+ CoordinationType$1.FEATURE_VALUE_COLORMAP,
19530
+ CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
19531
+ CoordinationType$1.FEATURE_SELECTION,
19525
19532
  CoordinationType$1.TOOLTIPS_VISIBLE,
19526
19533
  CoordinationType$1.TOOLTIP_CROSSHAIRS_VISIBLE,
19527
19534
  CoordinationType$1.LEGEND_VISIBLE,
@@ -19884,13 +19891,22 @@ const imageOmeTiffSchema = z.object({
19884
19891
  offsetsUrl: z.string().optional(),
19885
19892
  coordinateTransformations: omeCoordinateTransformations.optional()
19886
19893
  });
19894
+ const obsSegmentationsOmeTiffSchema = imageOmeTiffSchema.extend({
19895
+ obsTypesFromChannelNames: z.boolean().optional()
19896
+ });
19887
19897
  const imageOmeZarrSchema = z.object({
19888
19898
  coordinateTransformations: omeCoordinateTransformations.optional()
19889
19899
  });
19900
+ const obsSegmentationsOmeZarrSchema = imageOmeZarrSchema.extend({
19901
+ obsTypesFromChannelNames: z.boolean().optional()
19902
+ });
19890
19903
  const imageSpatialdataSchema = imageOmeZarrSchema.extend({
19891
19904
  path: z.string()
19892
19905
  });
19893
19906
  const obsSegmentationsSpatialdataSchema = z.object({
19907
+ // TODO: should this also extend the imageOmeZarrSchema?
19908
+ // TODO: should this be renamed labelsSpatialdataSchema?
19909
+ // TODO: support obsTypesFromChannelNames?
19894
19910
  path: z.string()
19895
19911
  });
19896
19912
  z.object({
@@ -19975,6 +19991,19 @@ const anndataZarrSchema = z.object({
19975
19991
  z.array(annDataConvenienceObsEmbeddingItem)
19976
19992
  ])
19977
19993
  }).partial();
19994
+ const spatialdataZarrSchema = z.object({
19995
+ // TODO: should `image` be a special schema
19996
+ // to allow specifying fileUid (like for embeddingType)?
19997
+ image: imageSpatialdataSchema,
19998
+ // TODO: should this be a special schema
19999
+ // to allow specifying fileUid (like for embeddingType)?
20000
+ labels: obsSegmentationsSpatialdataSchema,
20001
+ obsFeatureMatrix: obsFeatureMatrixSpatialdataSchema,
20002
+ obsSpots: obsSpotsSpatialdataSchema,
20003
+ // TODO: obsPoints
20004
+ // TODO: obsLocations
20005
+ obsSets: obsSetsSpatialdataSchema
20006
+ }).partial();
19978
20007
  const cellsJsonSchema = z.object({
19979
20008
  obsLabelsTypes: z.array(z.string()).optional(),
19980
20009
  embeddingTypes: z.array(z.string()).optional()
@@ -38827,7 +38856,7 @@ function Description(props2) {
38827
38856
  return jsxRuntimeExports.jsxs("div", { className: classes.description, children: [jsxRuntimeExports.jsx("p", { children: description2 }), metadata2 && Array.from(metadata2.entries()).map(([layerIndex, { name: layerName, metadata: metadataRecord }]) => metadataRecord && Object.entries(metadataRecord).length > 0 ? jsxRuntimeExports.jsxs("details", { children: [jsxRuntimeExports.jsx("summary", { children: layerName }), jsxRuntimeExports.jsx("div", { className: classes.metadataContainer, children: jsxRuntimeExports.jsx("table", { children: jsxRuntimeExports.jsx("tbody", { children: Object.entries(metadataRecord).map(([key2, value2]) => jsxRuntimeExports.jsxs("tr", { children: [jsxRuntimeExports.jsx("th", { title: key2, children: key2 }), jsxRuntimeExports.jsx("td", { title: value2, children: value2 })] }, key2)) }) }) })] }, layerIndex) : null)] });
38828
38857
  }
38829
38858
  function DescriptionSubscriber(props2) {
38830
- const { coordinationScopes, description: descriptionOverride, removeGridComponent, theme, title: title2 = "Description" } = props2;
38859
+ const { coordinationScopes, description: descriptionOverride, removeGridComponent, theme, title: title2 = "Description", closeButtonVisible } = props2;
38831
38860
  const loaders = useLoaders();
38832
38861
  const [{ dataset, spatialImageLayer: rasterLayers }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.DESCRIPTION], coordinationScopes);
38833
38862
  const [description2] = useDescription(loaders, dataset);
@@ -38849,7 +38878,7 @@ function DescriptionSubscriber(props2) {
38849
38878
  }
38850
38879
  return result;
38851
38880
  }, [rasterLayers, imageLayerMeta, imageLayerLoaders]);
38852
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, removeGridComponent, isScroll: true, theme, isReady, children: jsxRuntimeExports.jsx(Description, { description: descriptionOverride || description2, metadata: metadata2 }) });
38881
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, closeButtonVisible, removeGridComponent, isScroll: true, theme, isReady, children: jsxRuntimeExports.jsx(Description, { description: descriptionOverride || description2, metadata: metadata2 }) });
38853
38882
  }
38854
38883
  var _global = { exports: {} };
38855
38884
  var global$6 = _global.exports = typeof window != "undefined" && window.Math == Math ? window : typeof self != "undefined" && self.Math == Math ? self : Function("return this")();
@@ -39100,11 +39129,11 @@ var _toLength = function(it) {
39100
39129
  return it > 0 ? min$5(toInteger$2(it), 9007199254740991) : 0;
39101
39130
  };
39102
39131
  var toInteger$1 = _toInteger;
39103
- var max$4 = Math.max;
39132
+ var max$5 = Math.max;
39104
39133
  var min$4 = Math.min;
39105
39134
  var _toAbsoluteIndex = function(index2, length2) {
39106
39135
  index2 = toInteger$1(index2);
39107
- return index2 < 0 ? max$4(index2 + length2, 0) : min$4(index2, length2);
39136
+ return index2 < 0 ? max$5(index2 + length2, 0) : min$4(index2, length2);
39108
39137
  };
39109
39138
  var toIObject$5 = _toIobject;
39110
39139
  var toLength = _toLength;
@@ -52163,7 +52192,7 @@ function SetsManager(props2) {
52163
52192
  }
52164
52193
  const packageJson = { name: "vitessce" };
52165
52194
  function ObsSetsManagerSubscriber(props2) {
52166
- const { coordinationScopes, removeGridComponent, theme, title: titleOverride } = props2;
52195
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: titleOverride } = props2;
52167
52196
  const loaders = useLoaders();
52168
52197
  const setWarning = useSetWarning();
52169
52198
  const [{ dataset, obsType, obsSetSelection: cellSetSelection, obsSetExpansion: cellSetExpansion, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, obsColorEncoding: cellColorEncoding }, { setObsSetSelection: setCellSetSelection, setObsColorEncoding: setCellColorEncoding, setObsSetColor: setCellSetColor, setObsSetExpansion: setCellSetExpansion, setAdditionalObsSets: setAdditionalCellSets }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.OBS_SETS], coordinationScopes);
@@ -52556,7 +52585,7 @@ function ObsSetsManagerSubscriber(props2) {
52556
52585
  setWarning,
52557
52586
  theme
52558
52587
  ]);
52559
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, removeGridComponent, urls: urls2, theme, isReady, children: manager });
52588
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, children: manager });
52560
52589
  }
52561
52590
  function ascending$6(a2, b2) {
52562
52591
  return a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
@@ -52783,6 +52812,24 @@ function tickStep$1(start, stop3, count2) {
52783
52812
  step1 *= 2;
52784
52813
  return stop3 < start ? -step1 : step1;
52785
52814
  }
52815
+ function max$4(values3, valueof) {
52816
+ let max2;
52817
+ if (valueof === void 0) {
52818
+ for (const value2 of values3) {
52819
+ if (value2 != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
52820
+ max2 = value2;
52821
+ }
52822
+ }
52823
+ } else {
52824
+ let index2 = -1;
52825
+ for (let value2 of values3) {
52826
+ if ((value2 = valueof(value2, ++index2, values3)) != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
52827
+ max2 = value2;
52828
+ }
52829
+ }
52830
+ }
52831
+ return max2;
52832
+ }
52786
52833
  function quantileSorted$1(values3, p, valueof = number$a) {
52787
52834
  if (!(n3 = values3.length))
52788
52835
  return;
@@ -156081,16 +156128,16 @@ async function getDecoder(fileDirectory) {
156081
156128
  const Decoder = await importFn();
156082
156129
  return new Decoder(fileDirectory);
156083
156130
  }
156084
- addDecoder([void 0, 1], () => import("./raw-da28bf32.js").then((m2) => m2.default));
156085
- addDecoder(5, () => import("./lzw-54abbb89.js").then((m2) => m2.default));
156131
+ addDecoder([void 0, 1], () => import("./raw-81ed6601.js").then((m2) => m2.default));
156132
+ addDecoder(5, () => import("./lzw-846a70ec.js").then((m2) => m2.default));
156086
156133
  addDecoder(6, () => {
156087
156134
  throw new Error("old style JPEG compression is not supported.");
156088
156135
  });
156089
- addDecoder(7, () => import("./jpeg-d4932e74.js").then((m2) => m2.default));
156090
- addDecoder([8, 32946], () => import("./deflate-4c7ad087.js").then((m2) => m2.default));
156091
- addDecoder(32773, () => import("./packbits-0cb854db.js").then((m2) => m2.default));
156092
- addDecoder(34887, () => import("./lerc-8e20c0a6.js").then((m2) => m2.default));
156093
- addDecoder(50001, () => import("./webimage-344622f8.js").then((m2) => m2.default));
156136
+ addDecoder(7, () => import("./jpeg-dc640134.js").then((m2) => m2.default));
156137
+ addDecoder([8, 32946], () => import("./deflate-ff8e0389.js").then((m2) => m2.default));
156138
+ addDecoder(32773, () => import("./packbits-8a313c48.js").then((m2) => m2.default));
156139
+ addDecoder(34887, () => import("./lerc-42f701c0.js").then((m2) => m2.default));
156140
+ addDecoder(50001, () => import("./webimage-72021080.js").then((m2) => m2.default));
156094
156141
  function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
156095
156142
  return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
156096
156143
  }
@@ -170384,16 +170431,16 @@ function normalize$4(arr) {
170384
170431
  const data2 = new Uint8Array(arr.map((i2) => Math.floor((i2 - min2) * ratio)));
170385
170432
  return data2;
170386
170433
  }
170387
- function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSetColorMode, texSize) {
170434
+ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode, texSize) {
170388
170435
  let totalValuesLength = 0;
170389
170436
  let totalColorsLength = 0;
170390
170437
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
170391
- var _a3, _b2, _c2, _d, _e;
170438
+ var _a3, _b2, _c2, _d;
170392
170439
  if (isSetColorMode) {
170393
- totalValuesLength += ((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.obsIndex) == null ? void 0 : _b2.length) || 0;
170394
- totalColorsLength += (((_d = (_c2 = setColorValues[channelIndex]) == null ? void 0 : _c2.setColors) == null ? void 0 : _d.length) || 0) * 3;
170440
+ totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) || 0) * 3;
170441
+ totalValuesLength += ((_c2 = setColorValues[channelIndex]) == null ? void 0 : _c2.obsIndex) ? max$4(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
170395
170442
  } else {
170396
- totalValuesLength += ((_e = multiFeatureValues[channelIndex]) == null ? void 0 : _e.length) || 0;
170443
+ totalValuesLength += multiMatrixObsIndex[channelIndex] ? max$4(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) || 0;
170397
170444
  }
170398
170445
  });
170399
170446
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
@@ -170411,12 +170458,20 @@ function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSet
170411
170458
  let indexOffset = 0;
170412
170459
  let colorOffset = 0;
170413
170460
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
170461
+ const matrixObsIndex = multiMatrixObsIndex[channelIndex];
170462
+ const bitmaskValueIsIndex = matrixObsIndex === null;
170414
170463
  if (isSetColorMode) {
170415
170464
  const { setColorIndices, setColors, obsIndex } = setColorValues[channelIndex] || {};
170416
170465
  if (setColorIndices && setColors && obsIndex) {
170417
170466
  for (let i2 = 0; i2 < obsIndex.length; i2++) {
170418
- const colorIndex = setColorIndices.get(String(i2 + 1));
170419
- totalData[indexOffset + i2] = colorIndex === void 0 ? 0 : colorIndex + 1;
170467
+ let obsId = String(i2 + 1);
170468
+ let obsI = i2;
170469
+ if (!bitmaskValueIsIndex) {
170470
+ obsId = obsIndex[i2];
170471
+ obsI = parseInt(obsId) - 1;
170472
+ }
170473
+ const colorIndex = setColorIndices.get(obsId);
170474
+ totalData[indexOffset + obsI] = colorIndex === void 0 ? 0 : colorIndex + 1;
170420
170475
  }
170421
170476
  for (let i2 = 0; i2 < setColors.length; i2++) {
170422
170477
  const { color: [r3, g2, b2] } = setColors[i2];
@@ -170431,7 +170486,16 @@ function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSet
170431
170486
  colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
170432
170487
  } else {
170433
170488
  const featureArr = multiFeatureValues[channelIndex];
170434
- totalData.set(normalize$4(featureArr), indexOffset);
170489
+ const normalizedFeatureArr = normalize$4(featureArr);
170490
+ if (!bitmaskValueIsIndex && matrixObsIndex) {
170491
+ for (let i2 = 0; i2 < matrixObsIndex.length; i2++) {
170492
+ const obsId = matrixObsIndex[i2];
170493
+ const obsI = parseInt(obsId) - 1;
170494
+ totalData[indexOffset + obsI] = normalizedFeatureArr[i2];
170495
+ }
170496
+ } else {
170497
+ totalData.set(normalizedFeatureArr, indexOffset);
170498
+ }
170435
170499
  indicesOffsets.push(indexOffset);
170436
170500
  indexOffset += featureArr.length;
170437
170501
  colorsOffsets.push(colorOffset);
@@ -170458,6 +170522,17 @@ function padWithDefault(arr, defaultValue2, padWidth) {
170458
170522
  function getColor(arr) {
170459
170523
  return arr ? arr.map((v) => v / 255) : [0, 0, 0];
170460
170524
  }
170525
+ function isEqualShallow(prevArr, nextArr) {
170526
+ if (prevArr === nextArr) {
170527
+ return true;
170528
+ }
170529
+ if (Array.isArray(prevArr) && Array.isArray(nextArr)) {
170530
+ if (prevArr.length === nextArr.length) {
170531
+ return !prevArr.some((v, i2) => v !== nextArr[i2] && (!Array.isArray(v) && !Array.isArray(nextArr[i2]) || (v.length > 0 || nextArr[i2].length > 0)));
170532
+ }
170533
+ }
170534
+ return prevArr === nextArr;
170535
+ }
170461
170536
  const defaultProps = {
170462
170537
  channelStrokeWidths: { type: "array", value: null, compare: true },
170463
170538
  channelsFilled: { type: "array", value: null, compare: true },
@@ -170467,6 +170542,7 @@ const defaultProps = {
170467
170542
  colormap: { type: "string", value: GLSL_COLORMAP_DEFAULT, compare: true },
170468
170543
  expressionData: { type: "object", value: null, compare: true },
170469
170544
  multiFeatureValues: { type: "array", value: null, compare: true },
170545
+ multiMatrixObsIndex: { type: "array", value: null, compare: true },
170470
170546
  setColorValues: { type: "array", value: null, compare: true },
170471
170547
  channelFeatureValueColormaps: { type: "array", value: null, compare: true },
170472
170548
  channelFeatureValueColormapRanges: { type: "array", value: null, compare: true },
@@ -170513,9 +170589,9 @@ class BitmaskLayer2 extends XRLayer {
170513
170589
  }
170514
170590
  updateState({ props: props2, oldProps, changeFlags }) {
170515
170591
  super.updateState({ props: props2, oldProps, changeFlags });
170516
- if (props2.multiFeatureValues !== oldProps.multiFeatureValues || props2.setColorValues !== oldProps.setColorValues || props2.channelIsSetColorMode !== oldProps.channelIsSetColorMode) {
170517
- const { multiFeatureValues, setColorValues, channelIsSetColorMode } = this.props;
170518
- const [valueTex, colorTex, valueTexOffsets, colorTexOffsets, valueTexHeight, colorTexHeight] = this.multiSetsToTexture(multiFeatureValues, setColorValues, channelIsSetColorMode);
170592
+ if (!isEqualShallow(props2.multiFeatureValues, oldProps.multiFeatureValues) || !isEqualShallow(props2.multiMatrixObsIndex, oldProps.multiMatrixObsIndex) || !isEqualShallow(props2.setColorValues, oldProps.setColorValues) || !isEqualShallow(props2.channelIsSetColorMode, oldProps.channelIsSetColorMode)) {
170593
+ const { multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode } = this.props;
170594
+ const [valueTex, colorTex, valueTexOffsets, colorTexOffsets, valueTexHeight, colorTexHeight] = this.multiSetsToTexture(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode);
170519
170595
  this.setState({
170520
170596
  valueTex,
170521
170597
  colorTex,
@@ -170667,9 +170743,9 @@ class BitmaskLayer2 extends XRLayer {
170667
170743
  type: GL$1.FLOAT
170668
170744
  });
170669
170745
  }
170670
- multiSetsToTexture(multiFeatureValues, setColorValues, channelIsSetColorMode) {
170746
+ multiSetsToTexture(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode) {
170671
170747
  const isWebGL2On = isWebGL2$1(this.context.gl);
170672
- const [totalData, valueTexHeight, indicesOffsets, totalColors, colorTexHeight, colorsOffsets] = multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSetColorMode, MULTI_FEATURE_TEX_SIZE);
170748
+ const [totalData, valueTexHeight, indicesOffsets, totalColors, colorTexHeight, colorsOffsets] = multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode, MULTI_FEATURE_TEX_SIZE);
170673
170749
  return [
170674
170750
  // Color indices texture
170675
170751
  new Texture2D(this.context.gl, {
@@ -173967,6 +174043,8 @@ function EmbeddingScatterplotSubscriber(props2) {
173967
174043
  const {
173968
174044
  uuid,
173969
174045
  coordinationScopes,
174046
+ closeButtonVisible,
174047
+ downloadButtonVisible,
173970
174048
  removeGridComponent,
173971
174049
  theme,
173972
174050
  observationsLabelOverride,
@@ -174126,7 +174204,7 @@ function EmbeddingScatterplotSubscriber(props2) {
174126
174204
  setTargetY(target2[1]);
174127
174205
  setTargetZ(target2[2] || 0);
174128
174206
  };
174129
- return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(observationsLabel, cellsCount)}`, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(ScatterplotOptions, { observationsLabel, cellRadius: cellRadiusFixed, setCellRadius: setCellRadiusFixed, cellRadiusMode, setCellRadiusMode, cellOpacity: cellOpacityFixed, setCellOpacity: setCellOpacityFixed, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, tooltipsVisible, setTooltipsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange }), children: [jsxRuntimeExports.jsx(ScatterplotWrapper, { ref: deckRef, uuid, theme, viewState: { zoom: zoom2, target: [targetX2, targetY2, targetZ] }, setViewState, originalViewState, obsEmbeddingIndex, obsEmbedding, cellFilter, cellSelection, cellHighlight, cellColors, cellSetPolygons, cellSetLabelSize, cellSetLabelsVisible, cellSetPolygonsVisible, setCellFilter, setCellSelection: setCellSelectionProp, setCellHighlight, cellRadius, cellOpacity, cellColorEncoding, geneExpressionColormap, geneExpressionColormapRange, setComponentHover: () => {
174207
+ return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(observationsLabel, cellsCount)}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(ScatterplotOptions, { observationsLabel, cellRadius: cellRadiusFixed, setCellRadius: setCellRadiusFixed, cellRadiusMode, setCellRadiusMode, cellOpacity: cellOpacityFixed, setCellOpacity: setCellOpacityFixed, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, tooltipsVisible, setTooltipsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange }), children: [jsxRuntimeExports.jsx(ScatterplotWrapper, { ref: deckRef, uuid, theme, viewState: { zoom: zoom2, target: [targetX2, targetY2, targetZ] }, setViewState, originalViewState, obsEmbeddingIndex, obsEmbedding, cellFilter, cellSelection, cellHighlight, cellColors, cellSetPolygons, cellSetLabelSize, cellSetLabelsVisible, cellSetPolygonsVisible, setCellFilter, setCellSelection: setCellSelectionProp, setCellHighlight, cellRadius, cellOpacity, cellColorEncoding, geneExpressionColormap, geneExpressionColormapRange, setComponentHover: () => {
174130
174208
  setComponentHover(uuid);
174131
174209
  }, updateViewInfo: setComponentViewInfo, getExpressionValue, getCellIsSelected }), tooltipsVisible && jsxRuntimeExports.jsx(ScatterplotTooltipSubscriber, { parentUuid: uuid, obsHighlight: cellHighlight, width: width2, height: height2, getObsInfo }), jsxRuntimeExports.jsx(Legend, { visible: true, theme, featureType, featureValueType, obsColorEncoding: cellColorEncoding, featureSelection: geneSelection, featureLabelsMap, featureValueColormap: geneExpressionColormap, featureValueColormapRange: geneExpressionColormapRange, extent: expressionExtents == null ? void 0 : expressionExtents[0] })] });
174132
174210
  }
@@ -174175,6 +174253,8 @@ function GatingSubscriber(props2) {
174175
174253
  const {
174176
174254
  uuid,
174177
174255
  coordinationScopes,
174256
+ closeButtonVisible,
174257
+ downloadButtonVisible,
174178
174258
  removeGridComponent,
174179
174259
  theme,
174180
174260
  disableTooltip = false,
@@ -174369,7 +174449,7 @@ function GatingSubscriber(props2) {
174369
174449
  gatingFeatureSelectionY,
174370
174450
  obsType
174371
174451
  ]);
174372
- return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(obsType, cellsCount)}`, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(ScatterplotOptions, { observationsLabel: obsType, cellRadius: cellRadiusFixed, setCellRadius: setCellRadiusFixed, cellRadiusMode, setCellRadiusMode, cellOpacity: cellOpacityFixed, setCellOpacity: setCellOpacityFixed, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, children: jsxRuntimeExports.jsx(GatingScatterplotOptions, { featureType, gatingFeatureSelectionX, setGatingFeatureSelectionX, gatingFeatureSelectionY, setGatingFeatureSelectionY, gatingFeatureValueTransform: featureValueTransform, setGatingFeatureValueTransform: (newValue) => {
174452
+ return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(obsType, cellsCount)}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(ScatterplotOptions, { observationsLabel: obsType, cellRadius: cellRadiusFixed, setCellRadius: setCellRadiusFixed, cellRadiusMode, setCellRadiusMode, cellOpacity: cellOpacityFixed, setCellOpacity: setCellOpacityFixed, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, children: jsxRuntimeExports.jsx(GatingScatterplotOptions, { featureType, gatingFeatureSelectionX, setGatingFeatureSelectionX, gatingFeatureSelectionY, setGatingFeatureSelectionY, gatingFeatureValueTransform: featureValueTransform, setGatingFeatureValueTransform: (newValue) => {
174373
174453
  setFeatureValueTransform(newValue);
174374
174454
  setTargetX(null);
174375
174455
  setTargetY(null);
@@ -191331,8 +191411,7 @@ class ZarritaPixelSource extends ZarrPixelSource {
191331
191411
  this._readChunks = false;
191332
191412
  }
191333
191413
  }
191334
- async function loadOmeZarr(url, requestInit2) {
191335
- const root2 = await zarrOpenRoot(url, requestInit2);
191414
+ async function loadOmeZarr(root2) {
191336
191415
  const { data: data2, rootAttrs, labels: labels2 } = await loadMultiscales(root2);
191337
191416
  const tileSize = guessTileSize(data2[0]);
191338
191417
  const pyramid = data2.map((arr) => new ZarritaPixelSource(createZarrArrayAdapter(arr), labels2, tileSize));
@@ -192169,7 +192248,7 @@ function SpatialTooltipSubscriber$1(props2) {
192169
192248
  return cellInfo ? jsxRuntimeExports.jsx(Tooltip2D, { x: x2, y: y2, parentUuid, sourceUuid, parentWidth: width2, parentHeight: height2, children: jsxRuntimeExports.jsx(TooltipContent, { info: cellInfo }) }) : null;
192170
192249
  }
192171
192250
  function SpatialSubscriber$1(props2) {
192172
- const { uuid, coordinationScopes, removeGridComponent, observationsLabelOverride, subobservationsLabelOverride: subobservationsLabel = "molecule", theme, title: title2 = "Spatial", disable3d, globalDisable3d, useFullResolutionImage = {}, channelNamesVisible = false } = props2;
192251
+ const { uuid, coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, observationsLabelOverride, subobservationsLabelOverride: subobservationsLabel = "molecule", theme, title: title2 = "Spatial", disable3d, globalDisable3d, useFullResolutionImage = {}, channelNamesVisible = false } = props2;
192173
192252
  const loaders = useLoaders();
192174
192253
  const setComponentHover = useSetComponentHover();
192175
192254
  const setComponentViewInfo = useSetComponentViewInfo(uuid);
@@ -192418,7 +192497,7 @@ function SpatialSubscriber$1(props2) {
192418
192497
  }
192419
192498
  return [names, colors2];
192420
192499
  }, [imageLayers, imageLayerLoaders]);
192421
- return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, removeGridComponent, isReady, options, children: [jsxRuntimeExports.jsx("div", { style: {
192500
+ return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady, options, children: [jsxRuntimeExports.jsx("div", { style: {
192422
192501
  position: "absolute",
192423
192502
  bottom: "5px",
192424
192503
  left: "5px",
@@ -192680,6 +192759,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
192680
192759
  this.prevSpotSetColor = {};
192681
192760
  this.prevSpotSetSelection = {};
192682
192761
  this.segmentationToMatrixIndexMap = {};
192762
+ this.segmentationToMatrixIndexArr = {};
192683
192763
  this.segmentationColors = {};
192684
192764
  this.segmentationExpressionGetters = {};
192685
192765
  this.prevSegmentationSetColor = {};
@@ -192962,7 +193042,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
192962
193042
  return spatialRenderingMode === "3D";
192963
193043
  }
192964
193044
  // New createImageLayer function.
192965
- createBitmaskSegmentationLayer(layerScope, layerCoordination, channelScopes, channelCoordination, image2, layerFeatureValues) {
193045
+ createBitmaskSegmentationLayer(layerScope, layerCoordination, channelScopes, channelCoordination, image2, layerFeatureValues, layerMatrixObsIndices, bitmaskValueIsIndex) {
192966
193046
  var _a3, _b2, _c2, _d;
192967
193047
  const { delegateHover, targetT, targetZ } = this.props;
192968
193048
  const data2 = (_b2 = (_a3 = image2 == null ? void 0 : image2.obsSegmentations) == null ? void 0 : _a3.instance) == null ? void 0 : _b2.getData();
@@ -193007,6 +193087,11 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
193007
193087
  var _a4;
193008
193088
  return ((_a4 = layerFeatureValues == null ? void 0 : layerFeatureValues[cScope]) == null ? void 0 : _a4[0]) || [];
193009
193089
  }),
193090
+ // Pass in the matrixObsIndex to account for the fact that
193091
+ // the obsIndex of the obsFeatureMatrix
193092
+ // may not be ["1", "2", "3", "4", ... "N"] and
193093
+ // instead may be ["3", "20", "4", "6"].
193094
+ multiMatrixObsIndex: channelScopes.map((cScope) => bitmaskValueIsIndex ? null : (layerMatrixObsIndices == null ? void 0 : layerMatrixObsIndices[cScope]) || null),
193010
193095
  setColorValues: channelScopes.map((cScope) => {
193011
193096
  var _a4, _b3;
193012
193097
  return ((_b3 = (_a4 = this.segmentationColors) == null ? void 0 : _a4[layerScope]) == null ? void 0 : _b3[cScope]) || [];
@@ -193153,12 +193238,23 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
193153
193238
  });
193154
193239
  }
193155
193240
  createSegmentationLayers() {
193156
- const { obsSegmentations = {}, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, segmentationLayerCallbacks = [], segmentationMultiExpressionData } = this.props;
193241
+ const { obsSegmentations = {}, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, segmentationLayerCallbacks = [], segmentationMultiExpressionData, bitmaskValueIsIndex } = this.props;
193157
193242
  return segmentationLayerScopes.map((layerScope) => {
193243
+ var _a3;
193158
193244
  if (obsSegmentations[layerScope]) {
193159
193245
  const { obsSegmentationsType } = obsSegmentations[layerScope];
193160
193246
  if (obsSegmentationsType === "bitmask") {
193161
- return this.createBitmaskSegmentationLayer(layerScope, segmentationLayerCoordination[0][layerScope], segmentationChannelScopesByLayer[layerScope], segmentationChannelCoordination[0][layerScope], obsSegmentations[layerScope], segmentationMultiExpressionData == null ? void 0 : segmentationMultiExpressionData[layerScope]);
193247
+ return this.createBitmaskSegmentationLayer(
193248
+ layerScope,
193249
+ segmentationLayerCoordination[0][layerScope],
193250
+ segmentationChannelScopesByLayer[layerScope],
193251
+ segmentationChannelCoordination[0][layerScope],
193252
+ obsSegmentations[layerScope],
193253
+ segmentationMultiExpressionData == null ? void 0 : segmentationMultiExpressionData[layerScope],
193254
+ (_a3 = this.segmentationToMatrixIndexArr) == null ? void 0 : _a3[layerScope],
193255
+ // TODO: get this from the layer coordination.
193256
+ bitmaskValueIsIndex
193257
+ );
193162
193258
  }
193163
193259
  if (obsSegmentationsType === "polygon") {
193164
193260
  return this.createPolygonSegmentationLayer(layerScope, segmentationLayerCoordination[0][layerScope], segmentationChannelScopesByLayer[layerScope], segmentationChannelCoordination[0][layerScope], obsSegmentations[layerScope], segmentationMultiExpressionData == null ? void 0 : segmentationMultiExpressionData[layerScope]);
@@ -193329,6 +193425,12 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
193329
193425
  }
193330
193426
  this.segmentationToMatrixIndexMap[layerScope][channelScope] = instanceObsIndex.map((key2) => matrixIndexMap.get(key2));
193331
193427
  }
193428
+ if (matrixObsIndex) {
193429
+ if (!this.segmentationToMatrixIndexArr[layerScope]) {
193430
+ this.segmentationToMatrixIndexArr[layerScope] = {};
193431
+ }
193432
+ this.segmentationToMatrixIndexArr[layerScope][channelScope] = matrixObsIndex;
193433
+ }
193332
193434
  }
193333
193435
  onUpdateAllSegmentationsIndexData() {
193334
193436
  const { segmentationLayerScopes, segmentationChannelScopesByLayer } = this.props;
@@ -193346,7 +193448,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
193346
193448
  const expressionData = (_a3 = segmentationMultiExpressionData == null ? void 0 : segmentationMultiExpressionData[layerScope]) == null ? void 0 : _a3[channelScope];
193347
193449
  const toMatrixIndexMap = (_c2 = (_b2 = this.segmentationToMatrixIndexMap) == null ? void 0 : _b2[layerScope]) == null ? void 0 : _c2[channelScope];
193348
193450
  const getExpressionValue = (entry2, { index: instanceIndex }) => {
193349
- if (toMatrixIndexMap && expressionData && expressionData[0]) {
193451
+ if (expressionData && expressionData[0]) {
193350
193452
  const rowIndex = toMatrixIndexMap[instanceIndex];
193351
193453
  const val = expressionData[0][rowIndex];
193352
193454
  return val;
@@ -193818,10 +193920,25 @@ function getHoverData(hoverInfo, layerType) {
193818
193920
  return null;
193819
193921
  }
193820
193922
  function SpatialSubscriber(props2) {
193821
- const { uuid, coordinationScopes: coordinationScopesRaw, coordinationScopesBy: coordinationScopesByRaw, removeGridComponent, observationsLabelOverride, subobservationsLabelOverride: subobservationsLabel = "molecule", theme, disableTooltip = false, title: title2 = "Spatial" } = props2;
193923
+ const {
193924
+ uuid,
193925
+ coordinationScopes: coordinationScopesRaw,
193926
+ coordinationScopesBy: coordinationScopesByRaw,
193927
+ closeButtonVisible,
193928
+ downloadButtonVisible,
193929
+ removeGridComponent,
193930
+ observationsLabelOverride,
193931
+ subobservationsLabelOverride: subobservationsLabel = "molecule",
193932
+ theme,
193933
+ disableTooltip = false,
193934
+ title: title2 = "Spatial",
193935
+ bitmaskValueIsIndex = false
193936
+ // TODO: move to coordination type
193937
+ } = props2;
193822
193938
  const loaders = useLoaders();
193823
193939
  const setComponentHover = useSetComponentHover();
193824
193940
  const setComponentViewInfo = useSetComponentViewInfo(uuid);
193941
+ const mergeCoordination = useMergeCoordination();
193825
193942
  const coordinationScopes = useCoordinationScopes(coordinationScopesRaw);
193826
193943
  const coordinationScopesBy = useCoordinationScopesBy(coordinationScopes, coordinationScopesByRaw);
193827
193944
  const [{ dataset, obsType, featureType, featureValueType, spatialZoom: zoom2, spatialTargetX: targetX2, spatialTargetY: targetY2, spatialTargetZ: targetZ, spatialTargetT: targetT, spatialRenderingMode, spatialRotationX: rotationX, spatialRotationOrbit: rotationOrbit, spatialOrbitAxis: orbitAxis, spatialAxisFixed }, { setSpatialZoom: setZoom, setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.SPATIAL_BETA], coordinationScopes);
@@ -193918,18 +194035,18 @@ function SpatialSubscriber(props2) {
193918
194035
  ], coordinationScopes, coordinationScopesBy, CoordinationType$1.POINT_LAYER);
193919
194036
  const is3dMode = spatialRenderingMode === "3D";
193920
194037
  const [width2, height2, deckRef] = useDeckCanvasSize();
193921
- const [obsPointsData, obsPointsDataStatus, obsPointsUrls] = useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset);
194038
+ const [obsPointsData, obsPointsDataStatus, obsPointsUrls] = useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
193922
194039
  const [pointMultiObsLabelsData, pointMultiObsLabelsDataStatus] = usePointMultiObsLabels(coordinationScopes, coordinationScopesBy, loaders, dataset);
193923
- const [obsSpotsData, obsSpotsDataStatus, obsSpotsUrls] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset);
194040
+ const [obsSpotsData, obsSpotsDataStatus, obsSpotsUrls] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
193924
194041
  const [obsSpotsSetsData, obsSpotsSetsDataStatus] = useSpotMultiObsSets(coordinationScopes, coordinationScopesBy, loaders, dataset);
193925
194042
  const [spotMultiExpressionData, spotMultiLoadedFeatureSelection, spotMultiExpressionExtents, spotMultiExpressionNormData, spotMultiFeatureSelectionStatus] = useSpotMultiFeatureSelection(coordinationScopes, coordinationScopesBy, loaders, dataset);
193926
194043
  const [spotMultiIndicesData, spotMultiIndicesDataStatus] = useSpotMultiObsFeatureMatrixIndices(coordinationScopes, coordinationScopesBy, loaders, dataset);
193927
194044
  const [obsSegmentationsLocationsData, obsSegmentationsLocationsDataStatus] = useSegmentationMultiObsLocations(coordinationScopes, coordinationScopesBy, loaders, dataset);
193928
- const [obsSegmentationsData, obsSegmentationsDataStatus, obsSegmentationsUrls] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset);
194045
+ const [obsSegmentationsData, obsSegmentationsDataStatus, obsSegmentationsUrls] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
193929
194046
  const [obsSegmentationsSetsData, obsSegmentationsSetsDataStatus] = useSegmentationMultiObsSets(coordinationScopes, coordinationScopesBy, loaders, dataset);
193930
194047
  const [segmentationMultiExpressionData, segmentationMultiLoadedFeatureSelection, segmentationMultiExpressionExtents, segmentationMultiExpressionNormData, segmentationMultiFeatureSelectionStatus] = useSegmentationMultiFeatureSelection(coordinationScopes, coordinationScopesBy, loaders, dataset);
193931
194048
  const [segmentationMultiIndicesData, segmentationMultiIndicesDataStatus] = useSegmentationMultiObsFeatureMatrixIndices(coordinationScopes, coordinationScopesBy, loaders, dataset);
193932
- const [imageData, imageDataStatus, imageUrls] = useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset);
194049
+ const [imageData, imageDataStatus, imageUrls] = useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
193933
194050
  const isReadyToComputeInitialViewState = useReady([
193934
194051
  obsPointsDataStatus,
193935
194052
  obsSpotsDataStatus,
@@ -194099,7 +194216,7 @@ function SpatialSubscriber(props2) {
194099
194216
  if (layerType === "segmentation-bitmask") {
194100
194217
  const { obsIndex } = ((_a3 = segmentationMultiIndicesData == null ? void 0 : segmentationMultiIndicesData[segmentationLayerScope]) == null ? void 0 : _a3[channelScope]) || {};
194101
194218
  obsI -= 1;
194102
- if (obsIndex) {
194219
+ if (obsIndex && bitmaskValueIsIndex) {
194103
194220
  obsId = obsIndex == null ? void 0 : obsIndex[obsI];
194104
194221
  } else {
194105
194222
  obsId = String(obsI);
@@ -194168,7 +194285,7 @@ function SpatialSubscriber(props2) {
194168
194285
  var _a3;
194169
194286
  return (_a3 = obsSegmentationsLocationsData == null ? void 0 : obsSegmentationsLocationsData[layerScope]) == null ? void 0 : _a3[channelScope];
194170
194287
  })).length > 0;
194171
- return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, removeGridComponent, isReady, children: [jsxRuntimeExports.jsx(SpatialWrapper, {
194288
+ return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady, children: [jsxRuntimeExports.jsx(SpatialWrapper, {
194172
194289
  ref: deckRef,
194173
194290
  uuid,
194174
194291
  width: width2,
@@ -194213,6 +194330,7 @@ function SpatialSubscriber(props2) {
194213
194330
  obsSegmentationsSets: obsSegmentationsSetsData,
194214
194331
  segmentationMatrixIndices: segmentationMultiIndicesData,
194215
194332
  segmentationMultiExpressionData: segmentationMultiExpressionNormData,
194333
+ bitmaskValueIsIndex,
194216
194334
  // Images
194217
194335
  images: imageData,
194218
194336
  imageLayerScopes,
@@ -195131,7 +195249,7 @@ function HeatmapOptions(props2) {
195131
195249
  }) })] }), jsxRuntimeExports.jsxs(TableRow$1, { children: [jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, variant: "head", scope: "row", children: jsxRuntimeExports.jsx("label", { htmlFor: `heatmap-gene-expression-colormap-range-${heatmapOptionsId}`, children: "Gene Expression Colormap Range" }) }), jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, variant: "body", children: jsxRuntimeExports.jsx(Slider$1, { classes: { root: classes.slider, valueLabel: classes.sliderValueLabel }, value: geneExpressionColormapRange, onChange: handleColormapRangeChangeDebounced, getAriaLabel: (index2) => index2 === 0 ? "Low value colormap range slider" : "High value colormap range slider", id: `heatmap-gene-expression-colormap-range-${heatmapOptionsId}`, valueLabelDisplay: "auto", step: 5e-3, min: 0, max: 1 }) })] })] });
195132
195250
  }
195133
195251
  function HeatmapSubscriber(props2) {
195134
- const { uuid, coordinationScopes, removeGridComponent, theme, transpose: transpose2, observationsLabelOverride, variablesLabelOverride, title: title2 = "Heatmap" } = props2;
195252
+ const { uuid, coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, transpose: transpose2, observationsLabelOverride, variablesLabelOverride, title: title2 = "Heatmap" } = props2;
195135
195253
  const loaders = useLoaders();
195136
195254
  const setComponentHover = useSetComponentHover();
195137
195255
  const setComponentViewInfo = useSetComponentViewInfo(uuid);
@@ -195207,7 +195325,7 @@ function HeatmapSubscriber(props2) {
195207
195325
  ], [observationsLabel]);
195208
195326
  const selectedCount = cellColors.size;
195209
195327
  return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(observationsLabel, cellsCount)} × ${commaNumber(genesCount)} ${pluralize(variablesLabel, genesCount)},
195210
- with ${commaNumber(selectedCount)} ${pluralize(observationsLabel, selectedCount)} selected`, urls: urls2, theme, removeGridComponent, isReady: isReady && !isRendering, options: jsxRuntimeExports.jsx(HeatmapOptions, { geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, tooltipsVisible, setTooltipsVisible }), children: [jsxRuntimeExports.jsx(Heatmap$1, { ref: deckRef, transpose: transpose2, viewState: { zoom: zoomX, target: [targetX2, targetY2] }, setViewState: ({ zoom: zoom2, target: target2 }) => {
195328
+ with ${commaNumber(selectedCount)} ${pluralize(observationsLabel, selectedCount)} selected`, urls: urls2, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady: isReady && !isRendering, options: jsxRuntimeExports.jsx(HeatmapOptions, { geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, tooltipsVisible, setTooltipsVisible }), children: [jsxRuntimeExports.jsx(Heatmap$1, { ref: deckRef, transpose: transpose2, viewState: { zoom: zoomX, target: [targetX2, targetY2] }, setViewState: ({ zoom: zoom2, target: target2 }) => {
195211
195329
  setZoomX(zoom2);
195212
195330
  setZoomY(zoom2);
195213
195331
  setTargetX(target2[0]);
@@ -199613,7 +199731,7 @@ function FeatureListOptions(props2) {
199613
199731
  } }) })] })] }) : null] });
199614
199732
  }
199615
199733
  function FeatureListSubscriber(props2) {
199616
- const { coordinationScopes, removeGridComponent, variablesLabelOverride, theme, title: titleOverride, enableMultiSelect = false, showTable = false, sort: sort2 = "alphabetical", sortKey: sortKey2 = null } = props2;
199734
+ const { coordinationScopes, removeGridComponent, variablesLabelOverride, theme, title: titleOverride, enableMultiSelect = false, showTable = false, sort: sort2 = "alphabetical", sortKey: sortKey2 = null, closeButtonVisible, downloadButtonVisible } = props2;
199617
199735
  const loaders = useLoaders();
199618
199736
  const [{ dataset, obsType, featureType, featureSelection: geneSelection, featureFilter: geneFilter, obsColorEncoding: cellColorEncoding }, { setFeatureSelection: setGeneSelection, setFeatureFilter: setGeneFilter, setFeatureHighlight: setGeneHighlight, setObsColorEncoding: setCellColorEncoding }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.FEATURE_LIST], coordinationScopes);
199619
199737
  const variablesLabel = variablesLabelOverride || featureType;
@@ -199648,6 +199766,8 @@ function FeatureListSubscriber(props2) {
199648
199766
  // even though this no longer uses the TitleInfo component's
199649
199767
  // scroll css (SelectableTable is virtual scroll).
199650
199768
  isScroll: true,
199769
+ closeButtonVisible,
199770
+ downloadButtonVisible,
199651
199771
  removeGridComponent,
199652
199772
  isReady,
199653
199773
  urls: urls2,
@@ -200088,8 +200208,8 @@ const Slicer = ({ xSlice, ySlice, zSlice, handleSlicerSetting, loader: loader2,
200088
200208
  ]
200089
200209
  ];
200090
200210
  const classes = useSlicerStyles();
200091
- const Slicers = sliceValuesAndSetSliceFunctions.map(([val, setVal, label2, [min2, max2]]) => jsxRuntimeExports.jsxs(Grid$3, { container: true, direction: "row", justifyContent: "flex-start", alignItems: "center", children: [jsxRuntimeExports.jsx(Grid$3, { item: true, xs: 1, children: jsxRuntimeExports.jsxs(Typography$1, { className: !use3d ? classes.disabled : classes.enabled, style: { marginBottom: 0 }, variant: "h2", children: [label2, ":"] }) }), jsxRuntimeExports.jsx(Grid$3, { item: true, xs: 11, children: jsxRuntimeExports.jsx(Slider$1, { disabled: !use3d, className: !use3d ? classes.disabled : classes.enabled, value: val, onChange: (e3, v) => setVal(v), valueLabelDisplay: "auto", valueLabelFormat: (v) => abbreviateNumber(v), "aria-label": `Volume options ${label2} slider`, min: min2, max: max2, step: 5e-3, orientation: "horizontal" }) })] }, label2));
200092
- return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Typography$1, { className: !use3d ? classes.disabled : classes.enabled, style: { marginTop: 16, marginBottom: 0 }, variant: "h2", children: ["Clipping Planes:", " "] }), " ", Slicers] });
200211
+ const Slicers = sliceValuesAndSetSliceFunctions.map(([val, setVal, label2, [min2, max2]]) => jsxRuntimeExports.jsxs(Grid$3, { container: true, direction: "row", justifyContent: "flex-start", alignItems: "center", children: [jsxRuntimeExports.jsx(Grid$3, { item: true, xs: 1, children: jsxRuntimeExports.jsxs(Typography$1, { className: !use3d ? classes.disabled : classes.enabled, style: { marginBottom: 0 }, children: [label2, ":"] }) }), jsxRuntimeExports.jsx(Grid$3, { item: true, xs: 11, children: jsxRuntimeExports.jsx(Slider$1, { disabled: !use3d, className: !use3d ? classes.disabled : classes.enabled, value: val, onChange: (e3, v) => setVal(v), valueLabelDisplay: "auto", valueLabelFormat: (v) => abbreviateNumber(v), "aria-label": `Volume options ${label2} slider`, min: min2, max: max2, step: 5e-3, orientation: "horizontal" }) })] }, label2));
200212
+ return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Typography$1, { className: !use3d ? classes.disabled : classes.enabled, style: { marginTop: 16, marginBottom: 0 }, children: ["Clipping Planes:", " "] }), " ", Slicers] });
200093
200213
  };
200094
200214
  const renderingOptions = Object.values(RENDERING_MODES);
200095
200215
  function RenderingModeSelect({ handleRenderingModeChange, renderingMode, use3d }) {
@@ -200428,6 +200548,8 @@ function ImageAddButton({ imageOptions, handleImageAdd }) {
200428
200548
  const LayerControllerMemoized = React__default.memo(forwardRef((props2, ref2) => {
200429
200549
  const {
200430
200550
  title: title2,
200551
+ closeButtonVisible,
200552
+ downloadButtonVisible,
200431
200553
  removeGridComponent,
200432
200554
  theme,
200433
200555
  isReady,
@@ -200473,7 +200595,7 @@ const LayerControllerMemoized = React__default.memo(forwardRef((props2, ref2) =>
200473
200595
  enableLayerButtonsWithOneLayer
200474
200596
  } = props2;
200475
200597
  const shouldShowImageLayerButton = Boolean(enableLayerButtonsWithOneLayer || (imageLayerLoaders == null ? void 0 : imageLayerLoaders.length) > 1);
200476
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, removeGridComponent, theme, isReady, children: jsxRuntimeExports.jsxs("div", { className: "layer-controller-container", ref: ref2, children: [moleculesLayer && jsxRuntimeExports.jsx(VectorLayerController, { label: "Molecules", layerType: "molecules", layer: moleculesLayer, handleLayerChange: setMoleculesLayer }, `${dataset}-molecules`), cellsLayer && obsSegmentationsType === "polygon" && jsxRuntimeExports.jsx(VectorLayerController, { label: `${capitalize$2(obsType)} Segmentations`, layerType: "cells", layer: cellsLayer, handleLayerChange: setCellsLayer }, `${dataset}-cells`), cellsLayer && obsSegmentationsType === "bitmask" && cellsLayer.map((layer, i2) => {
200598
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, children: jsxRuntimeExports.jsxs("div", { className: "layer-controller-container", ref: ref2, children: [moleculesLayer && jsxRuntimeExports.jsx(VectorLayerController, { label: "Molecules", layerType: "molecules", layer: moleculesLayer, handleLayerChange: setMoleculesLayer }, `${dataset}-molecules`), cellsLayer && obsSegmentationsType === "polygon" && jsxRuntimeExports.jsx(VectorLayerController, { label: `${capitalize$2(obsType)} Segmentations`, layerType: "cells", layer: cellsLayer, handleLayerChange: setCellsLayer }, `${dataset}-cells`), cellsLayer && obsSegmentationsType === "bitmask" && cellsLayer.map((layer, i2) => {
200477
200599
  const { index: index2 } = layer;
200478
200600
  const loader2 = segmentationLayerLoaders == null ? void 0 : segmentationLayerLoaders[index2];
200479
200601
  const layerMeta = segmentationLayerMeta == null ? void 0 : segmentationLayerMeta[index2];
@@ -200588,7 +200710,7 @@ const LayerControllerMemoized = React__default.memo(forwardRef((props2, ref2) =>
200588
200710
  }), shouldShowImageLayerButton ? jsxRuntimeExports.jsx(Grid$3, { item: true, children: jsxRuntimeExports.jsx(ImageAddButton, { imageOptions: imageLayerMeta, handleImageAdd }) }) : null] }) });
200589
200711
  }));
200590
200712
  function LayerControllerSubscriber$1(props2) {
200591
- const { coordinationScopes, removeGridComponent, theme, title: title2 = "Spatial Layers", disable3d, globalDisable3d, disableChannelsIfRgbDetected, enableLayerButtonsWithOneLayer } = props2;
200713
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: title2 = "Spatial Layers", disable3d, globalDisable3d, disableChannelsIfRgbDetected, enableLayerButtonsWithOneLayer } = props2;
200592
200714
  const loaders = useLoaders();
200593
200715
  const [{ dataset, obsType, spatialImageLayer: rasterLayers, spatialSegmentationLayer: cellsLayer, spatialPointLayer: moleculesLayer }, { setSpatialImageLayer: setRasterLayers, setSpatialSegmentationLayer: setCellsLayer, setSpatialPointLayer: setMoleculesLayer, setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit, setSpatialZoom: setZoom }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.LAYER_CONTROLLER], coordinationScopes);
200594
200716
  const [{ imageLayerCallbacks, areLoadingImageChannels, segmentationLayerCallbacks, areLoadingSegmentationChannels }, { setImageLayerCallbacks, setAreLoadingImageChannels, setSegmentationLayerCallbacks, setAreLoadingSegmentationChannels }] = useAuxiliaryCoordination(COMPONENT_COORDINATION_TYPES.layerController, coordinationScopes);
@@ -200645,6 +200767,8 @@ function LayerControllerSubscriber$1(props2) {
200645
200767
  return jsxRuntimeExports.jsx(LayerControllerMemoized, {
200646
200768
  ref: layerControllerRef,
200647
200769
  title: title2,
200770
+ closeButtonVisible,
200771
+ downloadButtonVisible,
200648
200772
  removeGridComponent,
200649
200773
  theme,
200650
200774
  isReady,
@@ -202281,8 +202405,9 @@ function LayerController(props2) {
202281
202405
  })] });
202282
202406
  }
202283
202407
  function LayerControllerSubscriber(props2) {
202284
- const { coordinationScopes: coordinationScopesRaw, coordinationScopesBy: coordinationScopesByRaw, removeGridComponent, theme, title: title2 = "Spatial Layers" } = props2;
202408
+ const { coordinationScopes: coordinationScopesRaw, coordinationScopesBy: coordinationScopesByRaw, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: title2 = "Spatial Layers", uuid } = props2;
202285
202409
  const loaders = useLoaders();
202410
+ const mergeCoordination = useMergeCoordination();
202286
202411
  const coordinationScopes = useCoordinationScopes(coordinationScopesRaw);
202287
202412
  const coordinationScopesBy = useCoordinationScopesBy(coordinationScopes, coordinationScopesByRaw);
202288
202413
  const [{ dataset, spatialTargetT: targetT, spatialTargetZ: targetZ, spatialRenderingMode }, { setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialTargetT: setTargetT, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit, setSpatialZoom: setZoom, setSpatialRenderingMode }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.LAYER_CONTROLLER_BETA], coordinationScopes);
@@ -202372,17 +202497,17 @@ function LayerControllerSubscriber(props2) {
202372
202497
  const layerControllerRef = useRef();
202373
202498
  useClosestVitessceContainerSize(layerControllerRef);
202374
202499
  useWindowDimensions();
202375
- const [obsSegmentationsData, obsSegmentationsDataStatus] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset);
202376
- const [imageData, imageDataStatus] = useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset);
202377
- const [obsSpotsData, obsSpotsDataStatus] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset);
202378
- const [obsPointsData, obsPointsDataStatus] = useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset);
202500
+ const [obsSegmentationsData, obsSegmentationsDataStatus] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
202501
+ const [imageData, imageDataStatus] = useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
202502
+ const [obsSpotsData, obsSpotsDataStatus] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
202503
+ const [obsPointsData, obsPointsDataStatus] = useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
202379
202504
  const isReady = useReady([
202380
202505
  obsSpotsDataStatus,
202381
202506
  obsPointsDataStatus,
202382
202507
  obsSegmentationsDataStatus,
202383
202508
  imageDataStatus
202384
202509
  ]);
202385
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, removeGridComponent, theme, isReady, children: jsxRuntimeExports.jsx(LayerController, { theme, coordinationScopesRaw, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, images: imageData, imageLayerScopes, imageLayerCoordination, targetT, targetZ, setTargetT, setTargetZ, spatialRenderingMode, setSpatialRenderingMode, imageChannelScopesByLayer, imageChannelCoordination, spotLayerScopes, spotLayerCoordination, pointLayerScopes, pointLayerCoordination }) });
202510
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, children: jsxRuntimeExports.jsx(LayerController, { theme, coordinationScopesRaw, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, images: imageData, imageLayerScopes, imageLayerCoordination, targetT, targetZ, setTargetT, setTargetZ, spatialRenderingMode, setSpatialRenderingMode, imageChannelScopesByLayer, imageChannelCoordination, spotLayerScopes, spotLayerCoordination, pointLayerScopes, pointLayerCoordination }) });
202386
202511
  }
202387
202512
  const useStyles$3 = makeStyles(() => ({
202388
202513
  info: {
@@ -202416,7 +202541,7 @@ function Status(props2) {
202416
202541
  return messages2;
202417
202542
  }
202418
202543
  function StatusSubscriber(props2) {
202419
- const { coordinationScopes, removeGridComponent, theme, title: title2 = "Status" } = props2;
202544
+ const { coordinationScopes, closeButtonVisible, removeGridComponent, theme, title: title2 = "Status" } = props2;
202420
202545
  const [{ obsHighlight: cellHighlight, featureHighlight: geneHighlight, moleculeHighlight }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.STATUS], coordinationScopes);
202421
202546
  const warn2 = useWarning();
202422
202547
  const infos = [
@@ -202425,7 +202550,7 @@ function StatusSubscriber(props2) {
202425
202550
  ...moleculeHighlight ? [`Hovered gene ${moleculeHighlight}`] : []
202426
202551
  ];
202427
202552
  const info2 = infos.join("; ");
202428
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, theme, removeGridComponent, isScroll: true, isReady: true, children: jsxRuntimeExports.jsx(Status, { warn: warn2, info: info2 }) });
202553
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, theme, closeButtonVisible, removeGridComponent, isScroll: true, isReady: true, children: jsxRuntimeExports.jsx(Status, { warn: warn2, info: info2 }) });
202429
202554
  }
202430
202555
  window.higlassTracks = window.higlassTracks || {};
202431
202556
  window.higlassTracksByType = window.higlassTracksByType || {};
@@ -202677,7 +202802,7 @@ const HIGLASS_BUNDLE_VERSION = "1.11.13";
202677
202802
  const HIGLASS_CSS_URL = `https://unpkg.com/${HIGLASS_PKG_NAME}@${HIGLASS_BUNDLE_VERSION}/dist/hglib.css`;
202678
202803
  register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
202679
202804
  const LazyHiGlassComponent = React__default.lazy(async () => {
202680
- const { HiGlassComponent } = await import("./hglib-7473f81f.js").then((n3) => n3.h);
202805
+ const { HiGlassComponent } = await import("./hglib-6e6aad2d.js").then((n3) => n3.h);
202681
202806
  return { default: HiGlassComponent };
202682
202807
  });
202683
202808
  const HG_SIZE = 800;
@@ -202806,10 +202931,10 @@ HiGlassLazy.defaultProps = {
202806
202931
  };
202807
202932
  const urls = [];
202808
202933
  function HiGlassSubscriber(props2) {
202809
- const { coordinationScopes, theme, hgViewConfig, removeGridComponent } = props2;
202934
+ const { coordinationScopes, theme, hgViewConfig, closeButtonVisible, downloadButtonVisible, removeGridComponent } = props2;
202810
202935
  const [width2, height2, containerRef] = useGridItemSize();
202811
202936
  const classes = useStyles$2();
202812
- return jsxRuntimeExports.jsx("div", { className: classes.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: "HiGlass", removeGridComponent, theme, isReady: true, urls, children: jsxRuntimeExports.jsx("div", { className: classes.higlassLazyWrapper, ref: containerRef, children: jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) }) }) });
202937
+ return jsxRuntimeExports.jsx("div", { className: classes.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: "HiGlass", closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady: true, urls, children: jsxRuntimeExports.jsx("div", { className: classes.higlassLazyWrapper, ref: containerRef, children: jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) }) }) });
202813
202938
  }
202814
202939
  const REFERENCE_TILESETS = {
202815
202940
  hg38: {
@@ -202830,7 +202955,7 @@ const REFERENCE_TILESETS = {
202830
202955
  }
202831
202956
  };
202832
202957
  function GenomicProfilesSubscriber(props2) {
202833
- const { coordinationScopes, theme, removeGridComponent, profileTrackUidKey = "path", profileTrackNameKey = null, higlassServer = "https://higlass.io/api/v1", assembly = "hg38", title: title2 = "Genomic Profiles" } = props2;
202958
+ const { coordinationScopes, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, profileTrackUidKey = "path", profileTrackNameKey = null, higlassServer = "https://higlass.io/api/v1", assembly = "hg38", title: title2 = "Genomic Profiles" } = props2;
202834
202959
  const [width2, height2, containerRef] = useGridItemSize();
202835
202960
  const loaders = useLoaders();
202836
202961
  const [{ dataset, obsSetColor: cellSetColor, obsSetSelection: cellSetSelection }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.GENOMIC_PROFILES], coordinationScopes);
@@ -202961,7 +203086,7 @@ function GenomicProfilesSubscriber(props2) {
202961
203086
  assembly
202962
203087
  ]);
202963
203088
  const classes = useStyles$2();
202964
- return jsxRuntimeExports.jsx("div", { className: classes.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: title2, removeGridComponent, theme, isReady, urls: urls2, children: jsxRuntimeExports.jsx("div", { className: classes.higlassLazyWrapper, ref: containerRef, children: hgViewConfig ? jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) : null }) }) });
203089
+ return jsxRuntimeExports.jsx("div", { className: classes.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: title2, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, urls: urls2, children: jsxRuntimeExports.jsx("div", { className: classes.higlassLazyWrapper, ref: containerRef, children: hgViewConfig ? jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) : null }) }) });
202965
203090
  }
202966
203091
  function CellSetExpressionPlotOptions(props2) {
202967
203092
  const { featureValueTransform, setFeatureValueTransform, featureValueTransformCoefficient, setFeatureValueTransformCoefficient, transformOptions } = props2;
@@ -259600,7 +259725,7 @@ function useExpressionByCellSet(expressionData, obsIndex, cellSets, additionalCe
259600
259725
  }
259601
259726
  function CellSetExpressionPlotSubscriber(props2) {
259602
259727
  var _a3;
259603
- const { coordinationScopes, removeGridComponent, theme } = props2;
259728
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme } = props2;
259604
259729
  const classes = useStyles();
259605
259730
  const loaders = useLoaders();
259606
259731
  const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, featureValueTransform, featureValueTransformCoefficient, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets }, { setFeatureValueTransform, setFeatureValueTransformCoefficient }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.OBS_SET_FEATURE_VALUE_DISTRIBUTION], coordinationScopes);
@@ -259624,7 +259749,7 @@ function CellSetExpressionPlotSubscriber(props2) {
259624
259749
  const [expressionArr, setArr, expressionMax] = useExpressionByCellSet(expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme);
259625
259750
  const firstGeneSelected = geneSelection && geneSelection.length >= 1 ? (featureLabelsMap == null ? void 0 : featureLabelsMap.get(geneSelection[0])) || geneSelection[0] : null;
259626
259751
  const selectedTransformName = (_a3 = transformOptions.find((o2) => o2.value === featureValueTransform)) == null ? void 0 : _a3.name;
259627
- return jsxRuntimeExports.jsx(TitleInfo, { title: `Expression by ${capitalize$2(obsType)} Set${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(CellSetExpressionPlotOptions, { featureValueTransform, setFeatureValueTransform, featureValueTransformCoefficient, setFeatureValueTransformCoefficient, transformOptions }), children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: expressionArr ? jsxRuntimeExports.jsx(CellSetExpressionPlot, { domainMax: expressionMax, colors: setArr, data: expressionArr, theme, width: width2, height: height2, obsType, featureValueType, featureValueTransformName: selectedTransformName }) : jsxRuntimeExports.jsxs("span", { children: ["Select a ", featureType, "."] }) }) });
259752
+ return jsxRuntimeExports.jsx(TitleInfo, { title: `Expression by ${capitalize$2(obsType)} Set${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(CellSetExpressionPlotOptions, { featureValueTransform, setFeatureValueTransform, featureValueTransformCoefficient, setFeatureValueTransformCoefficient, transformOptions }), children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: expressionArr ? jsxRuntimeExports.jsx(CellSetExpressionPlot, { domainMax: expressionMax, colors: setArr, data: expressionArr, theme, width: width2, height: height2, obsType, featureValueType, featureValueTransformName: selectedTransformName }) : jsxRuntimeExports.jsxs("span", { children: ["Select a ", featureType, "."] }) }) });
259628
259753
  }
259629
259754
  function CellSetSizesPlot(props2) {
259630
259755
  const { data: rawData, theme, width: width2, height: height2, marginRight = 90, marginBottom = 120, keyLength = 36, obsType, onBarSelect } = props2;
@@ -259744,7 +259869,7 @@ function CellSetSizesPlot(props2) {
259744
259869
  return jsxRuntimeExports.jsx(VegaPlot, { data: data2, spec, signalListeners, getTooltipText });
259745
259870
  }
259746
259871
  function CellSetSizesPlotSubscriber(props2) {
259747
- const { coordinationScopes, removeGridComponent, theme, title: titleOverride } = props2;
259872
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: titleOverride } = props2;
259748
259873
  const classes = useStyles();
259749
259874
  const loaders = useLoaders();
259750
259875
  const [{ dataset, obsType, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, obsSetExpansion: cellSetExpansion }, { setObsSetSelection: setCellSetSelection, setObsSetColor: setCellSetColor }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.OBS_SET_SIZES], coordinationScopes);
@@ -259791,7 +259916,7 @@ function CellSetSizesPlotSubscriber(props2) {
259791
259916
  setCellSetSelection([...cellSetSelection, setNamePath]);
259792
259917
  }
259793
259918
  };
259794
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, removeGridComponent, urls: urls2, theme, isReady, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(CellSetSizesPlot, { data: data2, onBarSelect, theme, width: width2, height: height2, obsType }) }) });
259919
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(CellSetSizesPlot, { data: data2, onBarSelect, theme, width: width2, height: height2, obsType }) }) });
259795
259920
  }
259796
259921
  function ExpressionHistogram(props2) {
259797
259922
  const { geneSelection, data: data2, theme, width: width2, height: height2, marginRight = 90, marginBottom = 50, onSelect } = props2;
@@ -259849,7 +259974,7 @@ function ExpressionHistogram(props2) {
259849
259974
  return jsxRuntimeExports.jsx(VegaPlot, { data: data2, signalListeners, spec });
259850
259975
  }
259851
259976
  function ExpressionHistogramSubscriber(props2) {
259852
- const { coordinationScopes, removeGridComponent, theme } = props2;
259977
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme } = props2;
259853
259978
  const classes = useStyles();
259854
259979
  const loaders = useLoaders();
259855
259980
  const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, additionalObsSets: additionalCellSets, obsSetColor: cellSetColor }, { setAdditionalObsSets: setAdditionalCellSets, setObsSetColor: setCellSetColor, setObsColorEncoding: setCellColorEncoding, setObsSetSelection: setCellSetSelection }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.FEATURE_VALUE_HISTOGRAM], coordinationScopes);
@@ -259898,7 +260023,7 @@ function ExpressionHistogramSubscriber(props2) {
259898
260023
  setCellSetSelection,
259899
260024
  firstGeneSelected
259900
260025
  ]);
259901
- return jsxRuntimeExports.jsx(TitleInfo, { title: `Expression Histogram${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, removeGridComponent, urls: urls2, theme, isReady, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(ExpressionHistogram, { geneSelection, onSelect, data: data2, theme, width: width2, height: height2 }) }) });
260026
+ return jsxRuntimeExports.jsx(TitleInfo, { title: `Expression Histogram${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(ExpressionHistogram, { geneSelection, onSelect, data: data2, theme, width: width2, height: height2 }) }) });
259902
260027
  }
259903
260028
  class CsvSource {
259904
260029
  constructor({ url, requestInit: requestInit2 }) {
@@ -260006,6 +260131,24 @@ class ObsLabelsCsvLoader extends CsvLoader {
260006
260131
  return this.cachedResult;
260007
260132
  }
260008
260133
  }
260134
+ class CoordinationLevel {
260135
+ constructor(value2) {
260136
+ this.value = value2;
260137
+ this.cachedValue = null;
260138
+ }
260139
+ setCached(processedLevel) {
260140
+ this.cachedValue = processedLevel;
260141
+ }
260142
+ getCached() {
260143
+ return this.cachedValue;
260144
+ }
260145
+ isCached() {
260146
+ return this.cachedValue !== null;
260147
+ }
260148
+ }
260149
+ function CL(value2) {
260150
+ return new CoordinationLevel(value2);
260151
+ }
260009
260152
  class ObsSpotsCsvLoader extends CsvLoader {
260010
260153
  loadFromCache(data2) {
260011
260154
  if (this.cachedResult) {
@@ -260022,6 +260165,32 @@ class ObsSpotsCsvLoader extends CsvLoader {
260022
260165
  this.cachedResult = { obsIndex, obsSpots };
260023
260166
  return this.cachedResult;
260024
260167
  }
260168
+ async load() {
260169
+ const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
260170
+ if (payload instanceof AbstractLoaderError) {
260171
+ return Promise.reject(payload);
260172
+ }
260173
+ const coordinationValues = {
260174
+ spotLayer: CL({
260175
+ obsType: "spot",
260176
+ // obsColorEncoding: 'spatialLayerColor',
260177
+ // spatialLayerColor: [255, 255, 255],
260178
+ spatialLayerVisible: true,
260179
+ spatialLayerOpacity: 1,
260180
+ spatialSpotRadius: 10
260181
+ // TODO: spatialSpotRadiusUnit: 'µm' or 'um'
260182
+ // after resolving https://github.com/vitessce/vitessce/issues/1760
260183
+ // featureValueColormapRange: [0, 1],
260184
+ // obsHighlight: null,
260185
+ // obsSetColor: null,
260186
+ // obsSetSelection: null,
260187
+ // additionalObsSets: null,
260188
+ })
260189
+ };
260190
+ const { data: data2, url } = payload;
260191
+ const result = this.loadFromCache(data2);
260192
+ return Promise.resolve(new LoaderResult(result, url, coordinationValues));
260193
+ }
260025
260194
  }
260026
260195
  class ObsPointsCsvLoader extends CsvLoader {
260027
260196
  loadFromCache(data2) {
@@ -260039,6 +260208,31 @@ class ObsPointsCsvLoader extends CsvLoader {
260039
260208
  this.cachedResult = { obsIndex, obsPoints };
260040
260209
  return this.cachedResult;
260041
260210
  }
260211
+ async load() {
260212
+ const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
260213
+ if (payload instanceof AbstractLoaderError) {
260214
+ return Promise.reject(payload);
260215
+ }
260216
+ const coordinationValues = {
260217
+ pointLayer: CL({
260218
+ obsType: "point",
260219
+ // obsColorEncoding: 'spatialLayerColor',
260220
+ // spatialLayerColor: [255, 255, 255],
260221
+ spatialLayerVisible: true,
260222
+ spatialLayerOpacity: 1
260223
+ // TODO: support a point radius?
260224
+ // featureValueColormapRange: [0, 1],
260225
+ // obsHighlight: null,
260226
+ // obsSetColor: null,
260227
+ // obsSetSelection: null,
260228
+ // additionalObsSets: null,
260229
+ // obsLabelsType: null,
260230
+ })
260231
+ };
260232
+ const { data: data2, url } = payload;
260233
+ const result = this.loadFromCache(data2);
260234
+ return Promise.resolve(new LoaderResult(result, url, coordinationValues));
260235
+ }
260042
260236
  }
260043
260237
  class ObsLocationsCsvLoader extends CsvLoader {
260044
260238
  loadFromCache(data2) {
@@ -260195,13 +260389,39 @@ class ObsSegmentationsJsonLoader extends JsonLoader {
260195
260389
  return this.cachedResult;
260196
260390
  }
260197
260391
  async load() {
260392
+ var _a3;
260198
260393
  const payload = await super.load().catch((reason) => Promise.resolve(reason));
260199
260394
  if (payload instanceof AbstractLoaderError) {
260200
260395
  return Promise.reject(payload);
260201
260396
  }
260397
+ const channelCoordination = [{
260398
+ // obsType: null,
260399
+ spatialChannelColor: [255, 255, 255],
260400
+ spatialChannelVisible: true,
260401
+ spatialChannelOpacity: 1,
260402
+ spatialChannelWindow: null,
260403
+ // featureType: 'feature',
260404
+ // featureValueType: 'value',
260405
+ obsColorEncoding: "spatialChannelColor",
260406
+ spatialSegmentationFilled: true,
260407
+ spatialSegmentationStrokeWidth: 1,
260408
+ obsHighlight: null
260409
+ }];
260410
+ const coordinationValues = {
260411
+ // spatialTargetZ: imageWrapper.getDefaultTargetZ(),
260412
+ // spatialTargetT: imageWrapper.getDefaultTargetT(),
260413
+ segmentationLayer: CL([
260414
+ {
260415
+ fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
260416
+ spatialLayerOpacity: 1,
260417
+ spatialLayerVisible: true,
260418
+ segmentationChannel: CL(channelCoordination)
260419
+ }
260420
+ ])
260421
+ };
260202
260422
  const { data: data2, url } = payload;
260203
260423
  const result = this.loadFromCache(data2);
260204
- return Promise.resolve(new LoaderResult(result, url));
260424
+ return Promise.resolve(new LoaderResult(result, url, coordinationValues));
260205
260425
  }
260206
260426
  }
260207
260427
  class ObsSetsJsonLoader extends JsonLoader {
@@ -260568,7 +260788,8 @@ async function initLoader(imageData) {
260568
260788
  }
260569
260789
  case "ome-zarr": {
260570
260790
  const { coordinateTransformations: coordinateTransformationsFromOptions } = metadata2 || {};
260571
- const loader2 = await loadOmeZarr(url, requestInit2);
260791
+ const root2 = await zarrOpenRoot(url, requestInit2);
260792
+ const loader2 = await loadOmeZarr(root2);
260572
260793
  const { metadata: loaderMetadata } = loader2;
260573
260794
  const { omero, multiscales } = loaderMetadata;
260574
260795
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
@@ -260704,6 +260925,9 @@ class ZarrDataSource {
260704
260925
  this.storeRoot = zarrOpenRoot(url, requestInit2);
260705
260926
  }
260706
260927
  }
260928
+ getStoreRoot(path2) {
260929
+ return this.storeRoot.resolve(path2);
260930
+ }
260707
260931
  /**
260708
260932
  * Class method for decoding json from the store.
260709
260933
  * @param {string} key A path to the item.
@@ -260711,13 +260935,14 @@ class ZarrDataSource {
260711
260935
  * that resolves to the parsed JSON if successful.
260712
260936
  * @throws This may throw an error.
260713
260937
  */
260714
- async getJson(key2) {
260938
+ async getJson(key2, storeRootParam = null) {
260715
260939
  const { storeRoot } = this;
260940
+ const storeRootToUse = storeRootParam || storeRoot;
260716
260941
  let dirKey = key2;
260717
260942
  if (key2.endsWith(".zattrs") || key2.endsWith(".zarray") || key2.endsWith(".zgroup")) {
260718
260943
  dirKey = key2.substring(0, key2.length - 8);
260719
260944
  }
260720
- return (await open(storeRoot.resolve(dirKey))).attrs;
260945
+ return (await open(storeRootToUse.resolve(dirKey))).attrs;
260721
260946
  }
260722
260947
  }
260723
260948
  function dirname(path2) {
@@ -261528,10 +261753,28 @@ class ObsSpotsAnndataLoader extends AbstractTwoStepLoader {
261528
261753
  if (superResult instanceof AbstractLoaderError) {
261529
261754
  return Promise.reject(superResult);
261530
261755
  }
261756
+ const coordinationValues = {
261757
+ spotLayer: CL({
261758
+ obsType: "spot",
261759
+ // obsColorEncoding: 'spatialLayerColor',
261760
+ // spatialLayerColor: [255, 255, 255],
261761
+ spatialLayerVisible: true,
261762
+ spatialLayerOpacity: 1,
261763
+ spatialSpotRadius: 10
261764
+ // TODO: get this from adata.uns if possible.
261765
+ // TODO: spatialSpotRadiusUnit: 'µm' or 'um'
261766
+ // after resolving https://github.com/vitessce/vitessce/issues/1760
261767
+ // featureValueColormapRange: [0, 1],
261768
+ // obsHighlight: null,
261769
+ // obsSetColor: null,
261770
+ // obsSetSelection: null,
261771
+ // additionalObsSets: null,
261772
+ })
261773
+ };
261531
261774
  return Promise.all([
261532
261775
  this.dataSource.loadObsIndex(path2),
261533
261776
  this.loadSpots()
261534
- ]).then(([obsIndex, obsSpots]) => Promise.resolve(new LoaderResult({ obsIndex, obsSpots }, null)));
261777
+ ]).then(([obsIndex, obsSpots]) => Promise.resolve(new LoaderResult({ obsIndex, obsSpots }, null, coordinationValues)));
261535
261778
  }
261536
261779
  }
261537
261780
  class ObsPointsAnndataLoader extends AbstractTwoStepLoader {
@@ -261557,10 +261800,26 @@ class ObsPointsAnndataLoader extends AbstractTwoStepLoader {
261557
261800
  if (superResult instanceof AbstractLoaderError) {
261558
261801
  return Promise.reject(superResult);
261559
261802
  }
261803
+ const coordinationValues = {
261804
+ pointLayer: CL({
261805
+ obsType: "point",
261806
+ // obsColorEncoding: 'spatialLayerColor',
261807
+ // spatialLayerColor: [255, 255, 255],
261808
+ spatialLayerVisible: true,
261809
+ spatialLayerOpacity: 1
261810
+ // TODO: support a point radius?
261811
+ // featureValueColormapRange: [0, 1],
261812
+ // obsHighlight: null,
261813
+ // obsSetColor: null,
261814
+ // obsSetSelection: null,
261815
+ // additionalObsSets: null,
261816
+ // obsLabelsType: null,
261817
+ })
261818
+ };
261560
261819
  return Promise.all([
261561
261820
  this.dataSource.loadObsIndex(path2),
261562
261821
  this.loadPoints()
261563
- ]).then(([obsIndex, obsPoints]) => Promise.resolve(new LoaderResult({ obsIndex, obsPoints }, null)));
261822
+ ]).then(([obsIndex, obsPoints]) => Promise.resolve(new LoaderResult({ obsIndex, obsPoints }, null, coordinationValues)));
261564
261823
  }
261565
261824
  }
261566
261825
  class ObsLocationsAnndataLoader extends AbstractTwoStepLoader {
@@ -261628,13 +261887,39 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
261628
261887
  return this.segmentations;
261629
261888
  }
261630
261889
  async load() {
261890
+ var _a3;
261631
261891
  const { path: path2 } = this.options;
261632
261892
  const superResult = await super.load().catch((reason) => Promise.resolve(reason));
261633
261893
  if (superResult instanceof AbstractLoaderError) {
261634
261894
  return Promise.reject(superResult);
261635
261895
  }
261896
+ const channelCoordination = [{
261897
+ // obsType: null,
261898
+ spatialChannelColor: [255, 255, 255],
261899
+ spatialChannelVisible: true,
261900
+ spatialChannelOpacity: 1,
261901
+ spatialChannelWindow: null,
261902
+ // featureType: 'feature',
261903
+ // featureValueType: 'value',
261904
+ obsColorEncoding: "spatialChannelColor",
261905
+ spatialSegmentationFilled: true,
261906
+ spatialSegmentationStrokeWidth: 1,
261907
+ obsHighlight: null
261908
+ }];
261636
261909
  const coordinationValues = {
261637
- spatialSegmentationLayer: DEFAULT_CELLS_LAYER
261910
+ // Old
261911
+ spatialSegmentationLayer: DEFAULT_CELLS_LAYER,
261912
+ // New
261913
+ // spatialTargetZ: imageWrapper.getDefaultTargetZ(),
261914
+ // spatialTargetT: imageWrapper.getDefaultTargetT(),
261915
+ segmentationLayer: CL([
261916
+ {
261917
+ fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
261918
+ spatialLayerOpacity: 1,
261919
+ spatialLayerVisible: true,
261920
+ segmentationChannel: CL(channelCoordination)
261921
+ }
261922
+ ])
261638
261923
  };
261639
261924
  return Promise.all([
261640
261925
  this.dataSource.loadObsIndex(path2),
@@ -261643,7 +261928,7 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
261643
261928
  obsIndex,
261644
261929
  obsSegmentations,
261645
261930
  obsSegmentationsType: "polygon"
261646
- }, coordinationValues)));
261931
+ }, null, coordinationValues)));
261647
261932
  }
261648
261933
  }
261649
261934
  class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
@@ -261840,20 +262125,20 @@ class ImageWrapper {
261840
262125
  return result;
261841
262126
  }
261842
262127
  getNumChannels() {
261843
- if ("Pixels" in this.vivLoader.metadata) {
261844
- const { Pixels: { Channels } } = this.vivLoader.metadata;
261845
- return Channels.length;
261846
- }
261847
- if ("omero" in this.vivLoader.metadata) {
261848
- const { omero: { channels: channels2 } } = this.vivLoader.metadata;
261849
- return channels2.length;
262128
+ if ("image-label" in this.vivLoader.metadata) {
262129
+ return 1;
261850
262130
  }
261851
262131
  if ("channels_metadata" in this.vivLoader.metadata) {
261852
262132
  const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
261853
262133
  return (channelsMetadata == null ? void 0 : channelsMetadata.channels.length) || 0;
261854
262134
  }
261855
- if ("image-label" in this.vivLoader.metadata) {
261856
- return 1;
262135
+ if ("omero" in this.vivLoader.metadata) {
262136
+ const { omero: { channels: channels2 } } = this.vivLoader.metadata;
262137
+ return channels2.length;
262138
+ }
262139
+ if ("Pixels" in this.vivLoader.metadata) {
262140
+ const { Pixels: { Channels } } = this.vivLoader.metadata;
262141
+ return Channels.length;
261857
262142
  }
261858
262143
  return 0;
261859
262144
  }
@@ -261862,9 +262147,8 @@ class ImageWrapper {
261862
262147
  const { Pixels: { Channels } } = this.vivLoader.metadata;
261863
262148
  return Channels.map((channel, i2) => channel.Name || `Channel ${i2}`);
261864
262149
  }
261865
- if ("omero" in this.vivLoader.metadata) {
261866
- const { omero: { channels: channels2 } } = this.vivLoader.metadata;
261867
- return channels2.map((channel, i2) => channel.label || `Channel ${i2}`);
262150
+ if ("image-label" in this.vivLoader.metadata) {
262151
+ return ["labels"];
261868
262152
  }
261869
262153
  if ("channels_metadata" in this.vivLoader.metadata) {
261870
262154
  const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
@@ -261872,9 +262156,33 @@ class ImageWrapper {
261872
262156
  return channelsMetadata.channels.map((channel) => `Channel ${channel.label}`);
261873
262157
  }
261874
262158
  }
262159
+ if ("omero" in this.vivLoader.metadata) {
262160
+ const { omero: { channels: channels2 } } = this.vivLoader.metadata;
262161
+ return channels2.map((channel, i2) => channel.label || `Channel ${i2}`);
262162
+ }
261875
262163
  return [];
261876
262164
  }
262165
+ // TODO: support passing a custom color palette array.
261877
262166
  getChannelObjects() {
262167
+ if ("image-label" in this.vivLoader.metadata) {
262168
+ return [{
262169
+ name: "labels",
262170
+ defaultColor: [255, 255, 255],
262171
+ defaultWindow: [0, 255],
262172
+ autoDefaultColor: [0, 0, 0]
262173
+ }];
262174
+ }
262175
+ if ("channels_metadata" in this.vivLoader.metadata) {
262176
+ const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
262177
+ if (channelsMetadata && Array.isArray(channelsMetadata == null ? void 0 : channelsMetadata.channels)) {
262178
+ return channelsMetadata.channels.map((channel, i2) => ({
262179
+ name: `Channel ${channel.label}`,
262180
+ defaultColor: void 0,
262181
+ defaultWindow: void 0,
262182
+ autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
262183
+ }));
262184
+ }
262185
+ }
261878
262186
  if ("omero" in this.vivLoader.metadata) {
261879
262187
  const { omero: { channels: channels2 } } = this.vivLoader.metadata;
261880
262188
  return channels2.map((channel, i2) => ({
@@ -261893,17 +262201,6 @@ class ImageWrapper {
261893
262201
  autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
261894
262202
  }));
261895
262203
  }
261896
- if ("channels_metadata" in this.vivLoader.metadata) {
261897
- const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
261898
- if (channelsMetadata && Array.isArray(channelsMetadata == null ? void 0 : channelsMetadata.channels)) {
261899
- return channelsMetadata.channels.map((channel, i2) => ({
261900
- name: `Channel ${channel.label}`,
261901
- defaultColor: void 0,
261902
- defaultWindow: void 0,
261903
- autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
261904
- }));
261905
- }
261906
- }
261907
262204
  return [];
261908
262205
  }
261909
262206
  getDtype() {
@@ -261992,15 +262289,42 @@ class ImageWrapper {
261992
262289
  const { shape: shape2 } = Array.isArray(loader2.data) ? loader2.data[0] : loader2.data;
261993
262290
  return isInterleaved$1(shape2);
261994
262291
  }
262292
+ getPhotometricInterpretation() {
262293
+ const loader2 = this.vivLoader;
262294
+ if ("Pixels" in loader2.metadata) {
262295
+ const source2 = Array.isArray(loader2.data) ? loader2.data[0] : loader2.data;
262296
+ if ("meta" in source2) {
262297
+ const { meta: meta2 } = source2;
262298
+ if (meta2 && "photometricInterpretation" in meta2) {
262299
+ const numericValue = meta2.photometricInterpretation;
262300
+ if (numericValue === 2) {
262301
+ return "RGB";
262302
+ }
262303
+ }
262304
+ }
262305
+ }
262306
+ if ("omero" in loader2.metadata) {
262307
+ const { omero: { rdefs: { model } } } = loader2.metadata;
262308
+ if (model === "color") {
262309
+ return "RGB";
262310
+ }
262311
+ }
262312
+ return "BlackIsZero";
262313
+ }
261995
262314
  }
261996
262315
  class OmeZarrLoader extends AbstractTwoStepLoader {
262316
+ constructor(dataSource, params2) {
262317
+ super(dataSource, params2);
262318
+ this.storeRoot = this.dataSource.storeRoot;
262319
+ }
261997
262320
  async load() {
261998
- const payload = await this.dataSource.getJson(".zattrs").catch((reason) => Promise.resolve(reason));
262321
+ var _a3;
262322
+ const payload = await this.dataSource.getJson(".zattrs", this.storeRoot).catch((reason) => Promise.resolve(reason));
261999
262323
  if (payload instanceof AbstractLoaderError) {
262000
262324
  return Promise.reject(payload);
262001
262325
  }
262002
262326
  const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
262003
- const loader2 = await loadOmeZarr(this.url, this.requestInit);
262327
+ const loader2 = await loadOmeZarr(this.storeRoot);
262004
262328
  const imageWrapper = new ImageWrapper(loader2, this.options);
262005
262329
  const { metadata: metadata2, data: data2 } = loader2;
262006
262330
  const { omero, multiscales, channels_metadata: spatialDataChannels, "image-label": imageLabel } = metadata2;
@@ -262083,8 +262407,31 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
262083
262407
  }
262084
262408
  ];
262085
262409
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = await initializeRasterLayersAndChannels(imagesWithLoaderCreators, void 0);
262410
+ const channelObjects2 = imageWrapper.getChannelObjects();
262411
+ const channelCoordination = channelObjects2.slice(0, 5).map((channelObj, i2) => ({
262412
+ spatialTargetC: i2,
262413
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
262414
+ spatialChannelVisible: true,
262415
+ spatialChannelOpacity: 1,
262416
+ spatialChannelWindow: channelObj.defaultWindow || null
262417
+ }));
262086
262418
  const coordinationValues = {
262087
- spatialImageLayer: autoImageLayers
262419
+ // Old
262420
+ spatialImageLayer: autoImageLayers,
262421
+ // New
262422
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
262423
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
262424
+ imageLayer: CL([
262425
+ {
262426
+ fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
262427
+ spatialLayerOpacity: 1,
262428
+ spatialLayerVisible: true,
262429
+ photometricInterpretation: imageWrapper.getPhotometricInterpretation(),
262430
+ volumetricRenderingAlgorithm: "maximumIntensityProjection",
262431
+ spatialTargetResolution: null,
262432
+ imageChannel: CL(channelCoordination)
262433
+ }
262434
+ ])
262088
262435
  };
262089
262436
  return Promise.resolve(new LoaderResult({
262090
262437
  image: {
@@ -262094,21 +262441,57 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
262094
262441
  // TODO: make this the root value of LoaderResult.image.
262095
262442
  },
262096
262443
  featureIndex: imageWrapper.getChannelNames()
262097
- }, [], coordinationValues));
262444
+ }, null, coordinationValues));
262445
+ }
262446
+ }
262447
+ class OmeZarrAsObsSegmentationsLoader extends OmeZarrLoader {
262448
+ async load() {
262449
+ var _a3;
262450
+ const { obsTypesFromChannelNames } = this.options || {};
262451
+ const result = await super.load();
262452
+ const imageWrapper = result.data.image.instance;
262453
+ const channelObjects = imageWrapper.getChannelObjects();
262454
+ const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i2) => ({
262455
+ spatialTargetC: i2,
262456
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
262457
+ spatialChannelVisible: true,
262458
+ spatialChannelOpacity: 1,
262459
+ spatialChannelWindow: channelObj.defaultWindow || null,
262460
+ // featureType: 'feature',
262461
+ // featureValueType: 'value',
262462
+ obsColorEncoding: "spatialChannelColor",
262463
+ spatialSegmentationFilled: true,
262464
+ spatialSegmentationStrokeWidth: 1,
262465
+ obsHighlight: null,
262466
+ ...obsTypesFromChannelNames ? { obsType: channelObj.name } : {}
262467
+ }));
262468
+ const coordinationValues = {
262469
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
262470
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
262471
+ segmentationLayer: CL([
262472
+ {
262473
+ fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
262474
+ spatialLayerOpacity: 1,
262475
+ spatialLayerVisible: true,
262476
+ segmentationChannel: CL(channelCoordination)
262477
+ }
262478
+ ])
262479
+ };
262480
+ return Promise.resolve(new LoaderResult({
262481
+ obsSegmentationsType: "bitmask",
262482
+ obsSegmentations: result.data.image
262483
+ }, result.url, coordinationValues));
262098
262484
  }
262099
262485
  }
262100
262486
  class SpatialDataImageLoader extends OmeZarrLoader {
262101
262487
  constructor(dataSource, params2) {
262102
- const newParams = {
262103
- ...params2,
262104
- url: `${params2.url}/${params2.options.path}`
262105
- };
262106
- super(dataSource, newParams);
262107
- this.dataSource = dataSource;
262488
+ super(dataSource, params2);
262489
+ this.storeRoot = this.dataSource.getStoreRoot(params2.options.path);
262108
262490
  }
262109
262491
  }
262110
262492
  class SpatialDataLabelsLoader extends SpatialDataImageLoader {
262111
262493
  async load() {
262494
+ var _a3;
262112
262495
  const result = await super.load();
262113
262496
  if (result instanceof AbstractLoaderError) {
262114
262497
  return Promise.reject(result);
@@ -262117,12 +262500,44 @@ class SpatialDataLabelsLoader extends SpatialDataImageLoader {
262117
262500
  obsSegmentations: result.data.image,
262118
262501
  obsSegmentationsType: "bitmask"
262119
262502
  };
262503
+ const imageWrapper = result.data.obsSegmentations.instance;
262504
+ const channelObjects = imageWrapper.getChannelObjects();
262505
+ const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i2) => ({
262506
+ spatialTargetC: i2,
262507
+ // obsType: channelObj.name,
262508
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
262509
+ spatialChannelVisible: true,
262510
+ spatialChannelOpacity: 1,
262511
+ spatialChannelWindow: channelObj.defaultWindow || null,
262512
+ // featureType: 'feature',
262513
+ // featureValueType: 'value',
262514
+ obsColorEncoding: "spatialChannelColor",
262515
+ spatialSegmentationFilled: true,
262516
+ spatialSegmentationStrokeWidth: 1,
262517
+ obsHighlight: null
262518
+ }));
262519
+ const coordinationValues = {
262520
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
262521
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
262522
+ segmentationLayer: CL([
262523
+ {
262524
+ fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
262525
+ spatialLayerOpacity: 1,
262526
+ spatialLayerVisible: true,
262527
+ segmentationChannel: CL(channelCoordination)
262528
+ }
262529
+ ])
262530
+ };
262531
+ result.coordinationValues = coordinationValues;
262120
262532
  return Promise.resolve(result);
262121
262533
  }
262122
262534
  }
262123
262535
  function getCoordsPath(path2) {
262124
262536
  return `${path2}/coords`;
262125
262537
  }
262538
+ function getRadiusPath(path2) {
262539
+ return `${path2}/radius`;
262540
+ }
262126
262541
  class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
262127
262542
  /**
262128
262543
  * Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
@@ -262140,6 +262555,18 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
262140
262555
  this.locations = Promise.resolve(null);
262141
262556
  return this.locations;
262142
262557
  }
262558
+ loadRadius() {
262559
+ const { path: path2 } = this.options;
262560
+ if (this.radius) {
262561
+ return this.radius;
262562
+ }
262563
+ if (!this.radius) {
262564
+ this.radius = this.dataSource.loadNumeric(getRadiusPath(path2));
262565
+ return this.radius;
262566
+ }
262567
+ this.radius = Promise.resolve(null);
262568
+ return this.radius;
262569
+ }
262143
262570
  async load() {
262144
262571
  const { path: path2, tablePath } = this.options;
262145
262572
  const superResult = await super.load().catch((reason) => Promise.resolve(reason));
@@ -262148,8 +262575,30 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
262148
262575
  }
262149
262576
  return Promise.all([
262150
262577
  this.dataSource.loadObsIndex(getCoordsPath(path2), tablePath),
262151
- this.loadSpots()
262152
- ]).then(([obsIndex, obsSpots]) => Promise.resolve(new LoaderResult({ obsIndex, obsSpots }, null)));
262578
+ this.loadSpots(),
262579
+ this.loadRadius()
262580
+ ]).then(([obsIndex, obsSpots, obsRadius]) => {
262581
+ var _a3;
262582
+ const spatialSpotRadius = (_a3 = obsRadius == null ? void 0 : obsRadius.data) == null ? void 0 : _a3[0];
262583
+ const coordinationValues = {
262584
+ spotLayer: CL({
262585
+ obsType: "spot",
262586
+ // obsColorEncoding: 'spatialLayerColor',
262587
+ // spatialLayerColor: [255, 255, 255],
262588
+ spatialLayerVisible: true,
262589
+ spatialLayerOpacity: 1,
262590
+ spatialSpotRadius
262591
+ // TODO: spatialSpotRadiusUnit: 'µm' or 'um'
262592
+ // after resolving https://github.com/vitessce/vitessce/issues/1760
262593
+ // featureValueColormapRange: [0, 1],
262594
+ // obsHighlight: null,
262595
+ // obsSetColor: null,
262596
+ // obsSetSelection: null,
262597
+ // additionalObsSets: null,
262598
+ })
262599
+ };
262600
+ return Promise.resolve(new LoaderResult({ obsIndex, obsSpots }, null, coordinationValues));
262601
+ });
262153
262602
  }
262154
262603
  }
262155
262604
  class SpatialDataObsSetsLoader extends ObsSetsAnndataLoader {
@@ -262216,6 +262665,14 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
262216
262665
  const urls2 = [
262217
262666
  { url, name: image2.name }
262218
262667
  ];
262668
+ const channelObjects = imageWrapper.getChannelObjects();
262669
+ const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i2) => ({
262670
+ spatialTargetC: i2,
262671
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
262672
+ spatialChannelVisible: true,
262673
+ spatialChannelOpacity: 1,
262674
+ spatialChannelWindow: channelObj.defaultWindow || null
262675
+ }));
262219
262676
  const imagesWithLoaderCreators = [
262220
262677
  {
262221
262678
  ...image2,
@@ -262227,9 +262684,25 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
262227
262684
  this.autoImageCache = initializeRasterLayersAndChannels(imagesWithLoaderCreators, renderLayers, usePhysicalSizeScaling);
262228
262685
  }
262229
262686
  return this.autoImageCache.then((autoImages) => {
262687
+ var _a3;
262230
262688
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
262231
262689
  const coordinationValues = {
262232
- spatialImageLayer: autoImageLayers
262690
+ // Old
262691
+ spatialImageLayer: autoImageLayers,
262692
+ // New
262693
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
262694
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
262695
+ imageLayer: CL([
262696
+ {
262697
+ fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
262698
+ spatialLayerOpacity: 1,
262699
+ spatialLayerVisible: true,
262700
+ photometricInterpretation: imageWrapper.getPhotometricInterpretation(),
262701
+ volumetricRenderingAlgorithm: "maximumIntensityProjection",
262702
+ spatialTargetResolution: null,
262703
+ imageChannel: CL(channelCoordination)
262704
+ }
262705
+ ])
262233
262706
  };
262234
262707
  return new LoaderResult({
262235
262708
  image: {
@@ -262246,7 +262719,7 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
262246
262719
  class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
262247
262720
  async load() {
262248
262721
  const { url, requestInit: requestInit2 } = this;
262249
- const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
262722
+ const { coordinateTransformations: coordinateTransformationsFromOptions, obsTypesFromChannelNames } = this.options || {};
262250
262723
  const offsets2 = await this.loadOffsets();
262251
262724
  const loader2 = await loadOmeTiff(url, { offsets: offsets2, headers: requestInit2 == null ? void 0 : requestInit2.headers });
262252
262725
  const imageWrapper = new ImageWrapper(loader2, this.options);
@@ -262268,6 +262741,21 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
262268
262741
  }
262269
262742
  };
262270
262743
  const urls2 = [{ url, name: image2.name }];
262744
+ const channelObjects = imageWrapper.getChannelObjects();
262745
+ const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i2) => ({
262746
+ spatialTargetC: i2,
262747
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
262748
+ spatialChannelVisible: true,
262749
+ spatialChannelOpacity: 1,
262750
+ spatialChannelWindow: channelObj.defaultWindow || null,
262751
+ // featureType: 'feature',
262752
+ // featureValueType: 'value',
262753
+ obsColorEncoding: "spatialChannelColor",
262754
+ spatialSegmentationFilled: true,
262755
+ spatialSegmentationStrokeWidth: 1,
262756
+ obsHighlight: null,
262757
+ ...obsTypesFromChannelNames ? { obsType: channelObj.name } : {}
262758
+ }));
262271
262759
  const imagesWithLoaderCreators = [
262272
262760
  {
262273
262761
  ...image2,
@@ -262282,9 +262770,22 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
262282
262770
  this.autoImageCache = initializeRasterLayersAndChannels(imagesWithLoaderCreators, renderLayers, usePhysicalSizeScaling);
262283
262771
  }
262284
262772
  return this.autoImageCache.then((autoImages) => {
262773
+ var _a3;
262285
262774
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
262286
262775
  const coordinationValues = {
262287
- spatialSegmentationLayer: autoImageLayers
262776
+ // Old
262777
+ spatialSegmentationLayer: autoImageLayers,
262778
+ // New
262779
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
262780
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
262781
+ segmentationLayer: CL([
262782
+ {
262783
+ fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
262784
+ spatialLayerOpacity: 1,
262785
+ spatialLayerVisible: true,
262786
+ segmentationChannel: CL(channelCoordination)
262787
+ }
262788
+ ])
262288
262789
  };
262289
262790
  return new LoaderResult({
262290
262791
  obsSegmentationsType: "bitmask",
@@ -262469,6 +262970,84 @@ function expandAnndataZarr(fileDef) {
262469
262970
  }] : []
262470
262971
  ];
262471
262972
  }
262973
+ function expandSpatialdataZarr(fileDef) {
262974
+ var _a3, _b2, _c2;
262975
+ const baseFileDef = {
262976
+ url: fileDef.url,
262977
+ requestInit: fileDef.requestInit,
262978
+ coordinationValues: {
262979
+ ...fileDef.coordinationValues,
262980
+ obsType: ((_a3 = fileDef.coordinationValues) == null ? void 0 : _a3.obsType) || "cell",
262981
+ featureType: ((_b2 = fileDef.coordinationValues) == null ? void 0 : _b2.featureType) || "gene",
262982
+ featureValueType: ((_c2 = fileDef.coordinationValues) == null ? void 0 : _c2.featureValueType) || "expression"
262983
+ }
262984
+ };
262985
+ const extraCoordinationValues = {};
262986
+ Object.entries(baseFileDef.coordinationValues).forEach(([key2, value2]) => {
262987
+ if (!expectedCoordinationTypes.includes(key2)) {
262988
+ extraCoordinationValues[key2] = value2;
262989
+ }
262990
+ });
262991
+ const { options = {} } = fileDef;
262992
+ return [
262993
+ // obsFeatureMatrix
262994
+ ...options.obsFeatureMatrix ? [{
262995
+ ...baseFileDef,
262996
+ fileType: FileType$1.OBS_FEATURE_MATRIX_SPATIALDATA_ZARR,
262997
+ options: options.obsFeatureMatrix,
262998
+ coordinationValues: {
262999
+ ...extraCoordinationValues,
263000
+ obsType: baseFileDef.coordinationValues.obsType,
263001
+ featureType: baseFileDef.coordinationValues.featureType,
263002
+ featureValueType: baseFileDef.coordinationValues.featureValueType
263003
+ }
263004
+ }] : [],
263005
+ // obsSets
263006
+ ...options.obsSets ? [{
263007
+ ...baseFileDef,
263008
+ fileType: FileType$1.OBS_SETS_SPATIALDATA_ZARR,
263009
+ options: options.obsSets,
263010
+ coordinationValues: {
263011
+ ...extraCoordinationValues,
263012
+ obsType: baseFileDef.coordinationValues.obsType
263013
+ }
263014
+ }] : [],
263015
+ // obsSpots
263016
+ ...options.obsSpots ? [{
263017
+ ...baseFileDef,
263018
+ fileType: FileType$1.OBS_SPOTS_SPATIALDATA_ZARR,
263019
+ options: options.obsSpots,
263020
+ coordinationValues: {
263021
+ ...extraCoordinationValues,
263022
+ obsType: baseFileDef.coordinationValues.obsType
263023
+ }
263024
+ }] : [],
263025
+ // TODO: obsPoints?
263026
+ // TODO: obsLocations?
263027
+ // image
263028
+ ...options.image ? [{
263029
+ ...baseFileDef,
263030
+ fileType: FileType$1.IMAGE_SPATIALDATA_ZARR,
263031
+ options: options.image,
263032
+ coordinationValues: {
263033
+ ...extraCoordinationValues,
263034
+ featureType: baseFileDef.coordinationValues.featureType
263035
+ // TODO: fileUid?
263036
+ }
263037
+ }] : [],
263038
+ // labels
263039
+ ...options.labels ? [{
263040
+ ...baseFileDef,
263041
+ fileType: FileType$1.LABELS_SPATIALDATA_ZARR,
263042
+ options: options.labels,
263043
+ coordinationValues: {
263044
+ ...extraCoordinationValues,
263045
+ obsType: baseFileDef.coordinationValues.obsType
263046
+ // TODO: fileUid?
263047
+ }
263048
+ }] : []
263049
+ ];
263050
+ }
262472
263051
  function expandMoleculesJson(fileDef) {
262473
263052
  var _a3;
262474
263053
  const baseFileDef = {
@@ -262801,7 +263380,8 @@ const baseFileTypes = [
262801
263380
  // All OME file types
262802
263381
  makeFileType(FileType$1.IMAGE_OME_ZARR, DataType$2.IMAGE, OmeZarrLoader, ZarrDataSource, imageOmeZarrSchema),
262803
263382
  makeFileType(FileType$1.IMAGE_OME_TIFF, DataType$2.IMAGE, OmeTiffLoader, OmeTiffSource, imageOmeTiffSchema),
262804
- makeFileType(FileType$1.OBS_SEGMENTATIONS_OME_TIFF, DataType$2.OBS_SEGMENTATIONS, OmeTiffAsObsSegmentationsLoader, OmeTiffSource, imageOmeZarrSchema),
263383
+ makeFileType(FileType$1.OBS_SEGMENTATIONS_OME_ZARR, DataType$2.OBS_SEGMENTATIONS, OmeZarrAsObsSegmentationsLoader, ZarrDataSource, obsSegmentationsOmeZarrSchema),
263384
+ makeFileType(FileType$1.OBS_SEGMENTATIONS_OME_TIFF, DataType$2.OBS_SEGMENTATIONS, OmeTiffAsObsSegmentationsLoader, OmeTiffSource, obsSegmentationsOmeTiffSchema),
262805
263385
  // SpatialData file types
262806
263386
  makeFileType(FileType$1.IMAGE_SPATIALDATA_ZARR, DataType$2.IMAGE, SpatialDataImageLoader, ZarrDataSource, imageSpatialdataSchema),
262807
263387
  // TODO: create a new loader for labels that returns obsSegmentations with obsSegmentationsType: 'bitmask'
@@ -262830,7 +263410,7 @@ const baseFileTypes = [
262830
263410
  ];
262831
263411
  const baseJointFileTypes = [
262832
263412
  new PluginJointFileType(FileType$1.ANNDATA_ZARR, expandAnndataZarr, anndataZarrSchema),
262833
- // new PluginJointFileType(FileType.SPATIALDATA_ZARR, expandSpatialdataZarr, spatialdataZarrSchema),
263413
+ new PluginJointFileType(FileType$1.SPATIALDATA_ZARR, expandSpatialdataZarr, spatialdataZarrSchema),
262834
263414
  // For legacy file types:
262835
263415
  new PluginJointFileType(FileType$1.ANNDATA_CELLS_ZARR, expandAnndataCellsZarr, anndataCellsZarrSchema),
262836
263416
  new PluginJointFileType(FileType$1.ANNDATA_CELL_SETS_ZARR, expandAnndataCellSetsZarr, anndataCellSetsZarrSchema),
@@ -263002,7 +263582,7 @@ const baseCoordinationTypes = [
263002
263582
  new PluginCoordinationType(CoordinationType$1.SPATIAL_CHANNEL_VISIBLE, true, z.boolean()),
263003
263583
  new PluginCoordinationType(CoordinationType$1.SPATIAL_CHANNEL_OPACITY, 1, z.number()),
263004
263584
  new PluginCoordinationType(CoordinationType$1.SPATIAL_CHANNEL_WINDOW, null, z.array(z.number()).length(2).nullable()),
263005
- new PluginCoordinationType(CoordinationType$1.SPATIAL_CHANNEL_COLOR, null, z.array(z.number()).length(3).nullable()),
263585
+ new PluginCoordinationType(CoordinationType$1.SPATIAL_CHANNEL_COLOR, [255, 255, 255], z.array(z.number()).length(3).nullable()),
263006
263586
  new PluginCoordinationType(CoordinationType$1.SPATIAL_SEGMENTATION_FILLED, true, z.boolean()),
263007
263587
  new PluginCoordinationType(CoordinationType$1.SPATIAL_SEGMENTATION_STROKE_WIDTH, 1, z.number()),
263008
263588
  // Reference: https://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html