@vitessce/layer-controller 2.0.2 → 2.0.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.
Files changed (42) hide show
  1. package/dist/deflate.b44720d0.mjs +13 -0
  2. package/dist/index.ca9e70ae.mjs +137540 -0
  3. package/dist/index.mjs +10 -0
  4. package/dist/jpeg.edb20ff0.mjs +840 -0
  5. package/dist/lerc.df2f1733.mjs +1943 -0
  6. package/dist/lzw.2a639594.mjs +128 -0
  7. package/dist/packbits.958f7a40.mjs +30 -0
  8. package/dist/pako.esm.4b234125.mjs +3940 -0
  9. package/dist/raw.4239192e.mjs +12 -0
  10. package/dist/webimage.de21cf13.mjs +32 -0
  11. package/{dist → dist-tsc}/index.js +0 -0
  12. package/package.json +10 -10
  13. package/src/BitmaskChannelController.js +63 -0
  14. package/src/ChannelOptions.js +62 -0
  15. package/src/ColorPalette.js +49 -0
  16. package/src/ImageAddButton.js +51 -0
  17. package/src/LayerController.js +599 -0
  18. package/src/LayerControllerSubscriber.js +510 -0
  19. package/src/LayerOptions.js +463 -0
  20. package/src/RasterChannelController.js +256 -0
  21. package/src/RasterChannelController.test.js +23 -0
  22. package/src/VectorLayerController.js +65 -0
  23. package/src/VolumeOptions.js +218 -0
  24. package/src/constants.js +14 -0
  25. package/src/index.js +3 -0
  26. package/{dist → src}/shared-channel-controls.js +35 -6
  27. package/src/styles.js +113 -0
  28. package/src/utils.js +129 -0
  29. package/dist/BitmaskChannelController.js +0 -31
  30. package/dist/ChannelOptions.js +0 -39
  31. package/dist/ColorPalette.js +0 -31
  32. package/dist/ImageAddButton.js +0 -28
  33. package/dist/LayerController.js +0 -311
  34. package/dist/LayerControllerSubscriber.js +0 -197
  35. package/dist/LayerOptions.js +0 -211
  36. package/dist/RasterChannelController.js +0 -160
  37. package/dist/RasterChannelController.test.js +0 -21
  38. package/dist/VectorLayerController.js +0 -30
  39. package/dist/VolumeOptions.js +0 -78
  40. package/dist/constants.js +0 -12
  41. package/dist/styles.js +0 -103
  42. package/dist/utils.js +0 -109
@@ -0,0 +1,510 @@
1
+ /* eslint-disable dot-notation */
2
+ /* eslint-disable no-unused-vars */
3
+ import React, {
4
+ useCallback, useRef, forwardRef,
5
+ } from 'react';
6
+ import Grid from '@material-ui/core/Grid';
7
+ import {
8
+ TitleInfo,
9
+ useReady,
10
+ useClosestVitessceContainerSize, useWindowDimensions,
11
+ useImageData,
12
+ useObsLocationsData,
13
+ useObsSegmentationsData,
14
+ useCoordination,
15
+ useLoaders,
16
+ useAuxiliaryCoordination,
17
+ useComponentLayout,
18
+ registerPluginViewType,
19
+ } from '@vitessce/vit-s';
20
+ import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
21
+ import { capitalize } from '@vitessce/utils';
22
+ import { initializeLayerChannels, DEFAULT_RASTER_LAYER_PROPS } from '@vitessce/spatial-utils';
23
+ import RasterChannelController from './RasterChannelController';
24
+ import BitmaskChannelController from './BitmaskChannelController';
25
+ import VectorLayerController from './VectorLayerController';
26
+ import LayerController from './LayerController';
27
+ import ImageAddButton from './ImageAddButton';
28
+
29
+ // LayerController is memoized to prevent updates from prop changes that
30
+ // are caused by view state updates i.e zooming and panning within
31
+ // the actual Spatial component. Re-rendering this component is very
32
+ // expensive so we have to be careful with props in this file in general.
33
+ const LayerControllerMemoized = React.memo(
34
+ forwardRef((props, ref) => {
35
+ const {
36
+ title,
37
+ removeGridComponent,
38
+ theme,
39
+ isReady,
40
+ dataset,
41
+ obsType,
42
+ moleculesLayer,
43
+ setMoleculesLayer,
44
+ cellsLayer, // May be one polygon layer object or an array of bitmask layers.
45
+ setCellsLayer,
46
+
47
+ rasterLayers,
48
+ imageLayerLoaders,
49
+ imageLayerMeta,
50
+ imageLayerCallbacks,
51
+ setImageLayerCallbacks,
52
+ areLoadingImageChannels,
53
+ setAreLoadingImageChannels,
54
+ handleRasterLayerChange,
55
+ handleRasterLayerRemove,
56
+
57
+ obsSegmentationsType,
58
+ segmentationLayerLoaders,
59
+ segmentationLayerMeta,
60
+ segmentationLayerCallbacks,
61
+ setSegmentationLayerCallbacks,
62
+ areLoadingSegmentationChannels,
63
+ setAreLoadingSegmentationChannels,
64
+ handleSegmentationLayerChange,
65
+ handleSegmentationLayerRemove,
66
+
67
+ disable3d,
68
+ globalDisable3d,
69
+ disableChannelsIfRgbDetected,
70
+ layerIs3DIndex,
71
+ setZoom,
72
+ setTargetX,
73
+ setTargetY,
74
+ setTargetZ,
75
+ setRotationX,
76
+ setRotationOrbit,
77
+ componentHeight,
78
+ componentWidth,
79
+ spatialLayout,
80
+ handleImageAdd,
81
+ enableLayerButtonsWithOneLayer,
82
+ } = props;
83
+ const shouldShowImageLayerButton = Boolean(
84
+ enableLayerButtonsWithOneLayer || imageLayerLoaders?.length > 1,
85
+ );
86
+ return (
87
+ <TitleInfo
88
+ title={title}
89
+ isScroll
90
+ removeGridComponent={removeGridComponent}
91
+ theme={theme}
92
+ isReady={isReady}
93
+ >
94
+ <div className="layer-controller-container" ref={ref}>
95
+ {moleculesLayer && (
96
+ <VectorLayerController
97
+ key={`${dataset}-molecules`}
98
+ label="Molecules"
99
+ layerType="molecules"
100
+ layer={moleculesLayer}
101
+ handleLayerChange={setMoleculesLayer}
102
+ />
103
+ )}
104
+ {cellsLayer && obsSegmentationsType === 'polygon' && (
105
+ <VectorLayerController
106
+ key={`${dataset}-cells`}
107
+ label={`${capitalize(obsType)} Segmentations`}
108
+ layerType="cells"
109
+ layer={cellsLayer}
110
+ handleLayerChange={setCellsLayer}
111
+ />
112
+ )}
113
+ {/* Segmentation bitmask layers: */}
114
+ {cellsLayer && obsSegmentationsType === 'bitmask'
115
+ && cellsLayer.map((layer, i) => {
116
+ const { index } = layer;
117
+ const loader = segmentationLayerLoaders?.[index];
118
+ const layerMeta = segmentationLayerMeta?.[index];
119
+ const isRaster = false;
120
+ // Set up the call back mechanism so that each layer manages
121
+ // callbacks/loading state for itself and its channels.
122
+ const setSegmentationLayerCallback = (cb) => {
123
+ const newRasterLayersCallbacks = [
124
+ ...(imageLayerCallbacks || []),
125
+ ];
126
+ newRasterLayersCallbacks[i] = cb;
127
+ setSegmentationLayerCallbacks(newRasterLayersCallbacks);
128
+ };
129
+ const areLayerChannelsLoading = (areLoadingSegmentationChannels || [])[i] || [];
130
+ const setAreLayerChannelsLoading = (v) => {
131
+ const newAreLoadingImageChannels = [
132
+ ...(areLoadingSegmentationChannels || []),
133
+ ];
134
+ newAreLoadingImageChannels[i] = v;
135
+ setAreLoadingSegmentationChannels(newAreLoadingImageChannels);
136
+ };
137
+ return loader && layerMeta ? (
138
+ <Grid
139
+ // eslint-disable-next-line react/no-array-index-key
140
+ key={`${dataset}-raster-${index}-${i}`}
141
+ item
142
+ style={{ marginTop: '10px' }}
143
+ >
144
+ <LayerController
145
+ name={layerMeta.name}
146
+ layer={layer}
147
+ loader={loader}
148
+ theme={theme}
149
+ handleLayerChange={v => handleSegmentationLayerChange(v, i)}
150
+ handleLayerRemove={() => handleSegmentationLayerRemove(i)}
151
+ ChannelController={BitmaskChannelController}
152
+ shouldShowTransparentColor={isRaster}
153
+ shouldShowDomain={isRaster}
154
+ shouldShowColormap={isRaster}
155
+ // Disable 3D if given explicit instructions to do so
156
+ // or if another layer is using 3D mode.
157
+ disable3d={
158
+ globalDisable3d
159
+ || (disable3d || []).indexOf(layerMeta.name) >= 0
160
+ || (typeof layerIs3DIndex === 'number'
161
+ && layerIs3DIndex !== -1
162
+ && layerIs3DIndex !== i)
163
+ }
164
+ disabled={
165
+ typeof layerIs3DIndex === 'number'
166
+ && layerIs3DIndex !== -1
167
+ && layerIs3DIndex !== i
168
+ }
169
+ disableChannelsIfRgbDetected={disableChannelsIfRgbDetected}
170
+ imageLayerCallbacks={imageLayerCallbacks}
171
+ setImageLayerCallback={setSegmentationLayerCallback}
172
+ setViewState={({
173
+ zoom: newZoom,
174
+ target,
175
+ rotationX: newRotationX,
176
+ rotationOrbit: newRotationOrbit,
177
+ }) => {
178
+ setZoom(newZoom);
179
+ setTargetX(target[0]);
180
+ setTargetY(target[1]);
181
+ setTargetZ(target[2]);
182
+ setRotationX(newRotationX);
183
+ setRotationOrbit(newRotationOrbit);
184
+ }}
185
+ setAreLayerChannelsLoading={setAreLayerChannelsLoading}
186
+ areLayerChannelsLoading={areLayerChannelsLoading}
187
+ spatialHeight={(componentHeight * (spatialLayout ? spatialLayout.h : 1)) / 12}
188
+ spatialWidth={(componentWidth * (spatialLayout ? spatialLayout.w : 1)) / 12}
189
+ shouldShowRemoveLayerButton={shouldShowImageLayerButton}
190
+ />
191
+ </Grid>
192
+ ) : null;
193
+ })}
194
+ {/* Image layers: */}
195
+ {rasterLayers
196
+ && rasterLayers.map((layer, i) => {
197
+ const { index } = layer;
198
+ const loader = imageLayerLoaders?.[index];
199
+ const layerMeta = imageLayerMeta?.[index];
200
+ // Bitmasks are handled above.
201
+ const isRaster = true;
202
+ // Set up the call back mechanism so that each layer manages
203
+ // callbacks/loading state for itself and its channels.
204
+ const setImageLayerCallback = (cb) => {
205
+ const newRasterLayersCallbacks = [
206
+ ...(imageLayerCallbacks || []),
207
+ ];
208
+ newRasterLayersCallbacks[i] = cb;
209
+ setImageLayerCallbacks(newRasterLayersCallbacks);
210
+ };
211
+ const areLayerChannelsLoading = (areLoadingImageChannels || [])[i] || [];
212
+ const setAreLayerChannelsLoading = (v) => {
213
+ const newAreLoadingImageChannels = [
214
+ ...(areLoadingImageChannels || []),
215
+ ];
216
+ newAreLoadingImageChannels[i] = v;
217
+ setAreLoadingImageChannels(newAreLoadingImageChannels);
218
+ };
219
+ return loader && layerMeta ? (
220
+ <Grid
221
+ // eslint-disable-next-line react/no-array-index-key
222
+ key={`${dataset}-raster-${index}-${i}`}
223
+ item
224
+ style={{ marginTop: '10px' }}
225
+ >
226
+ <LayerController
227
+ name={layerMeta.name}
228
+ layer={layer}
229
+ loader={loader}
230
+ theme={theme}
231
+ handleLayerChange={v => handleRasterLayerChange(v, i)}
232
+ handleLayerRemove={() => handleRasterLayerRemove(i)}
233
+ ChannelController={RasterChannelController}
234
+ shouldShowTransparentColor={isRaster}
235
+ shouldShowDomain={isRaster}
236
+ shouldShowColormap={isRaster}
237
+ // Disable 3D if given explicit instructions to do so
238
+ // or if another layer is using 3D mode.
239
+ disable3d={
240
+ globalDisable3d
241
+ || (disable3d || []).indexOf(layerMeta.name) >= 0
242
+ || (typeof layerIs3DIndex === 'number'
243
+ && layerIs3DIndex !== -1
244
+ && layerIs3DIndex !== i)
245
+ }
246
+ disabled={
247
+ typeof layerIs3DIndex === 'number'
248
+ && layerIs3DIndex !== -1
249
+ && layerIs3DIndex !== i
250
+ }
251
+ disableChannelsIfRgbDetected={disableChannelsIfRgbDetected}
252
+ imageLayerCallbacks={imageLayerCallbacks}
253
+ setImageLayerCallback={setImageLayerCallback}
254
+ setViewState={({
255
+ zoom: newZoom,
256
+ target,
257
+ rotationX: newRotationX,
258
+ rotationOrbit: newRotationOrbit,
259
+ }) => {
260
+ setZoom(newZoom);
261
+ setTargetX(target[0]);
262
+ setTargetY(target[1]);
263
+ setTargetZ(target[2]);
264
+ setRotationX(newRotationX);
265
+ setRotationOrbit(newRotationOrbit);
266
+ }}
267
+ setAreLayerChannelsLoading={setAreLayerChannelsLoading}
268
+ areLayerChannelsLoading={areLayerChannelsLoading}
269
+ spatialHeight={(componentHeight * (spatialLayout ? spatialLayout.h : 1)) / 12}
270
+ spatialWidth={(componentWidth * (spatialLayout ? spatialLayout.w : 1)) / 12}
271
+ shouldShowRemoveLayerButton={shouldShowImageLayerButton}
272
+ />
273
+ </Grid>
274
+ ) : null;
275
+ })}
276
+ {shouldShowImageLayerButton
277
+ ? (
278
+ <Grid item>
279
+ <ImageAddButton
280
+ imageOptions={imageLayerMeta}
281
+ handleImageAdd={handleImageAdd}
282
+ />
283
+ </Grid>
284
+ ) : null}
285
+ </div>
286
+ </TitleInfo>
287
+ );
288
+ }),
289
+ );
290
+
291
+ /**
292
+ * A subscriber component for the spatial layer controller.
293
+ * @param {object} props
294
+ * @param {string} props.theme The current theme name.
295
+ * @param {object} props.coordinationScopes The mapping from coordination types to coordination
296
+ * scopes.
297
+ * @param {function} props.removeGridComponent The callback function to pass to TitleInfo,
298
+ * to call when the component has been removed from the grid.
299
+ * @param {string} props.title The component title.
300
+ * @param {Object} props.disable3d Which layers should have 3D disabled (from `raster.json` names).
301
+ * @param {boolean} props.globalDisable3d Disable 3D for all layers. Overrides the `disable3d` prop.
302
+ * @param {boolean} props.disableChannelsIfRgbDetected Disable channel controls if an
303
+ * RGB image is detected i.e 3 channel 8 bit.
304
+ * @param {boolean} props.enableLayerButtonsWithOneLayer If there is only one layer,
305
+ * show the the layer add/remove buttons.
306
+ */
307
+ export function LayerControllerSubscriber(props) {
308
+ const {
309
+ coordinationScopes,
310
+ removeGridComponent,
311
+ theme,
312
+ title = 'Spatial Layers',
313
+ disable3d,
314
+ globalDisable3d,
315
+ disableChannelsIfRgbDetected,
316
+ enableLayerButtonsWithOneLayer,
317
+ } = props;
318
+
319
+ const loaders = useLoaders();
320
+
321
+ // Get "props" from the coordination space.
322
+ const [
323
+ {
324
+ dataset,
325
+ obsType,
326
+ spatialImageLayer: rasterLayers,
327
+ spatialSegmentationLayer: cellsLayer,
328
+ spatialPointLayer: moleculesLayer,
329
+ },
330
+ {
331
+ setSpatialImageLayer: setRasterLayers,
332
+ setSpatialSegmentationLayer: setCellsLayer,
333
+ setSpatialPointLayer: setMoleculesLayer,
334
+ setSpatialTargetX: setTargetX,
335
+ setSpatialTargetY: setTargetY,
336
+ setSpatialTargetZ: setTargetZ,
337
+ setSpatialRotationX: setRotationX,
338
+ setSpatialRotationOrbit: setRotationOrbit,
339
+ setSpatialZoom: setZoom,
340
+ },
341
+ ] = useCoordination(
342
+ COMPONENT_COORDINATION_TYPES[ViewType.LAYER_CONTROLLER],
343
+ coordinationScopes,
344
+ );
345
+
346
+ const [
347
+ {
348
+ imageLayerCallbacks,
349
+ areLoadingImageChannels,
350
+ segmentationLayerCallbacks,
351
+ areLoadingSegmentationChannels,
352
+ },
353
+ {
354
+ setImageLayerCallbacks,
355
+ setAreLoadingImageChannels,
356
+ setSegmentationLayerCallbacks,
357
+ setAreLoadingSegmentationChannels,
358
+ },
359
+ ] = useAuxiliaryCoordination(
360
+ COMPONENT_COORDINATION_TYPES.layerController,
361
+ coordinationScopes,
362
+ );
363
+ // Spatial layout + window size is needed for the "re-center" button to work properly.
364
+ // Dimensions of the Spatial component can be inferred and used for resetting view state to
365
+ // a nice, centered view.
366
+ const [spatialLayout] = useComponentLayout('spatial', ['spatialImageLayer'], coordinationScopes);
367
+ const layerControllerRef = useRef();
368
+ const [componentWidth, componentHeight] = useClosestVitessceContainerSize(layerControllerRef);
369
+ const { height: windowHeight, width: windowWidth } = useWindowDimensions();
370
+
371
+ // Get data from loaders using the data hooks.
372
+ // eslint-disable-next-line no-unused-vars
373
+ const [obsLocationsData, obsLocationsStatus] = useObsLocationsData(
374
+ loaders, dataset, () => {}, false,
375
+ { setSpatialPointLayer: setMoleculesLayer },
376
+ { spatialPointLayer: moleculesLayer },
377
+ {}, // TODO: use obsType once #1240 is merged.
378
+ );
379
+ const [
380
+ { obsSegmentations, obsSegmentationsType },
381
+ obsSegmentationsStatus,
382
+ ] = useObsSegmentationsData(
383
+ loaders, dataset, () => {}, false,
384
+ { setSpatialSegmentationLayer: setCellsLayer },
385
+ { spatialSegmentationLayer: cellsLayer },
386
+ {}, // TODO: use obsType once #1240 is merged.
387
+ );
388
+ const [{ image }, imageStatus] = useImageData(
389
+ loaders, dataset, () => {}, false,
390
+ { setSpatialImageLayer: setRasterLayers },
391
+ { spatialImageLayer: rasterLayers },
392
+ {}, // TODO: which values to match on
393
+ );
394
+ const { loaders: imageLayerLoaders, meta: imageLayerMeta } = image || {};
395
+ const isReady = useReady([
396
+ obsLocationsStatus,
397
+ obsSegmentationsStatus,
398
+ imageStatus,
399
+ ]);
400
+
401
+ const segmentationLayerLoaders = obsSegmentations && obsSegmentationsType === 'bitmask' ? obsSegmentations.loaders : null;
402
+ const segmentationLayerMeta = obsSegmentations && obsSegmentationsType === 'bitmask' ? obsSegmentations.meta : null;
403
+
404
+ // useCallback prevents new functions from propogating
405
+ // changes to the underlying component.
406
+ const handleImageAdd = useCallback(async (index) => {
407
+ const loader = imageLayerLoaders[index];
408
+ const newChannels = await initializeLayerChannels(
409
+ loader,
410
+ (rasterLayers[index] || {}).use3d,
411
+ );
412
+ const newLayer = {
413
+ index,
414
+ modelMatrix: imageLayerMeta[index]?.metadata?.transform?.matrix,
415
+ ...DEFAULT_RASTER_LAYER_PROPS,
416
+ channels: newChannels,
417
+ type: imageLayerMeta[index]?.metadata?.isBitmask ? 'bitmask' : 'raster',
418
+ };
419
+ const newLayers = [...rasterLayers, newLayer];
420
+ setRasterLayers(newLayers);
421
+ }, [imageLayerLoaders, imageLayerMeta, rasterLayers, setRasterLayers]);
422
+
423
+ const handleRasterLayerChange = useCallback((newLayer, i) => {
424
+ const newLayers = [...rasterLayers];
425
+ newLayers[i] = newLayer;
426
+ setRasterLayers(newLayers);
427
+ }, [rasterLayers, setRasterLayers]);
428
+
429
+ const handleRasterLayerRemove = useCallback((i) => {
430
+ const newLayers = [...rasterLayers];
431
+ newLayers.splice(i, 1);
432
+ setRasterLayers(newLayers);
433
+ }, [rasterLayers, setRasterLayers]);
434
+
435
+ const handleSegmentationLayerChange = useCallback((newLayer, i) => {
436
+ // Currently only used when obsSegmentationsType is 'bitmask'
437
+ const newLayers = [...cellsLayer];
438
+ newLayers[i] = newLayer;
439
+ setCellsLayer(newLayers);
440
+ }, [cellsLayer, setCellsLayer]);
441
+
442
+ const handleSegmentationLayerRemove = useCallback((i) => {
443
+ // Currently only used when obsSegmentationsType is 'bitmask'
444
+ const newLayers = [...cellsLayer];
445
+ newLayers.splice(i, 1);
446
+ setCellsLayer(newLayers);
447
+ }, [cellsLayer, setCellsLayer]);
448
+
449
+ const layerIs3DIndex = rasterLayers?.findIndex && rasterLayers.findIndex(layer => layer.use3d);
450
+ return (
451
+ <LayerControllerMemoized
452
+ ref={layerControllerRef}
453
+ title={title}
454
+ removeGridComponent={removeGridComponent}
455
+ theme={theme}
456
+ isReady={isReady}
457
+ moleculesLayer={moleculesLayer}
458
+ dataset={dataset}
459
+ obsType={obsType}
460
+ setMoleculesLayer={setMoleculesLayer}
461
+ cellsLayer={cellsLayer}
462
+ setCellsLayer={setCellsLayer}
463
+
464
+ rasterLayers={rasterLayers}
465
+ imageLayerLoaders={imageLayerLoaders}
466
+ imageLayerMeta={imageLayerMeta}
467
+ imageLayerCallbacks={imageLayerCallbacks}
468
+ setImageLayerCallbacks={setImageLayerCallbacks}
469
+ areLoadingImageChannels={areLoadingImageChannels}
470
+ setAreLoadingImageChannels={setAreLoadingImageChannels}
471
+ handleRasterLayerChange={handleRasterLayerChange}
472
+ handleRasterLayerRemove={handleRasterLayerRemove}
473
+
474
+ obsSegmentationsType={obsSegmentationsType}
475
+ segmentationLayerLoaders={segmentationLayerLoaders}
476
+ segmentationLayerMeta={segmentationLayerMeta}
477
+ segmentationLayerCallbacks={segmentationLayerCallbacks}
478
+ setSegmentationLayerCallbacks={setSegmentationLayerCallbacks}
479
+ areLoadingSegmentationChannels={areLoadingSegmentationChannels}
480
+ setAreLoadingSegmentationChannels={setAreLoadingSegmentationChannels}
481
+ handleSegmentationLayerChange={handleSegmentationLayerChange}
482
+ handleSegmentationLayerRemove={handleSegmentationLayerRemove}
483
+
484
+ disable3d={disable3d}
485
+ globalDisable3d={globalDisable3d}
486
+ layerIs3DIndex={layerIs3DIndex}
487
+ disableChannelsIfRgbDetected={disableChannelsIfRgbDetected}
488
+ enableLayerButtonsWithOneLayer={enableLayerButtonsWithOneLayer}
489
+ setZoom={setZoom}
490
+ setTargetX={setTargetX}
491
+ setTargetY={setTargetY}
492
+ setTargetZ={setTargetZ}
493
+ setRotationX={setRotationX}
494
+ setRotationOrbit={setRotationOrbit}
495
+ // Fall back to window for height and width.
496
+ componentHeight={componentHeight || windowHeight}
497
+ componentWidth={componentWidth || windowWidth}
498
+ spatialLayout={spatialLayout}
499
+ handleImageAdd={handleImageAdd}
500
+ />
501
+ );
502
+ }
503
+
504
+ export function register() {
505
+ registerPluginViewType(
506
+ ViewType.LAYER_CONTROLLER,
507
+ LayerControllerSubscriber,
508
+ COMPONENT_COORDINATION_TYPES[ViewType.LAYER_CONTROLLER],
509
+ );
510
+ }