@idetik/core 0.33.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as gl_matrix from 'gl-matrix';
2
- import { vec2, mat4, vec3, quat, vec4 } from 'gl-matrix';
2
+ import { vec2, mat4, vec3, vec4, quat } from 'gl-matrix';
3
3
  import * as zarr from 'zarrita';
4
4
  import { Location, Readable } from 'zarrita';
5
5
  import { z } from 'zod';
@@ -37,6 +37,12 @@ declare abstract class Texture extends Node {
37
37
  get type(): string;
38
38
  }
39
39
 
40
+ type SpatialAxis = "x" | "y" | "z";
41
+ type SliceAxes = {
42
+ u: SpatialAxis;
43
+ v: SpatialAxis;
44
+ w: SpatialAxis;
45
+ };
40
46
  type SliceOrientation = "XY" | "XZ" | "YZ";
41
47
 
42
48
  declare const chunkDataTypes: readonly [Int8ArrayConstructor, Int16ArrayConstructor, Int32ArrayConstructor, Uint8ArrayConstructor, Uint16ArrayConstructor, Uint32ArrayConstructor, Float32ArrayConstructor];
@@ -171,7 +177,7 @@ declare class ChunkStore {
171
177
  get channelCount(): number;
172
178
  get dimensions(): SourceDimensionMap;
173
179
  getLowestResLOD(): number;
174
- addView(policy: ImageSourcePolicy): ChunkStoreView;
180
+ addView(policy: ImageSourcePolicy, axes?: SliceAxes): ChunkStoreView;
175
181
  get views(): ReadonlyArray<ChunkStoreView>;
176
182
  canDispose(): boolean;
177
183
  updateAndCollectChunkChanges(): Set<Chunk>;
@@ -220,11 +226,12 @@ declare class ChunkStoreView {
220
226
  private readonly sourceMaxSquareDistance2D_;
221
227
  private readonly chunkViewStates_;
222
228
  private isDisposed_;
223
- constructor(store: ChunkStore, policy: ImageSourcePolicy);
229
+ constructor(store: ChunkStore, policy: ImageSourcePolicy, axes?: SliceAxes);
224
230
  get chunkViewStates(): ReadonlyMap<Chunk, ChunkViewState>;
225
231
  get isDisposed(): boolean;
226
232
  get lodCount(): number;
227
233
  get channelCount(): number;
234
+ getWholePlaneRect(): Box2;
228
235
  getChunksToRender(): Chunk[];
229
236
  updateChunksForImage(sliceCoords: SliceCoordinates, view: {
230
237
  worldViewRect: Box2;
@@ -278,7 +285,7 @@ declare class ChunkManager {
278
285
  cpuChunkBytes: number;
279
286
  cpuChunkCount: number;
280
287
  };
281
- addView(source: ChunkSource, policy: ImageSourcePolicy): ChunkStoreView;
288
+ addView(source: ChunkSource, policy: ImageSourcePolicy, axes?: SliceAxes): ChunkStoreView;
282
289
  update(): void;
283
290
  private releaseChunk;
284
291
  private enqueueWithinBudget;
@@ -289,6 +296,34 @@ declare class ChunkManager {
289
296
  private disposeChunkTexture;
290
297
  }
291
298
 
299
+ /** @group Layer Configuration */
300
+ type ColorLike = Color | vec3 | vec4 | string;
301
+ /** @group Layer Configuration */
302
+ declare class Color {
303
+ static readonly RED: Color;
304
+ static readonly GREEN: Color;
305
+ static readonly BLUE: Color;
306
+ static readonly YELLOW: Color;
307
+ static readonly MAGENTA: Color;
308
+ static readonly CYAN: Color;
309
+ static readonly BLACK: Color;
310
+ static readonly WHITE: Color;
311
+ static readonly TRANSPARENT: Color;
312
+ private readonly rgba_;
313
+ constructor(r: number, g: number, b: number, a?: number);
314
+ get rgb(): [number, number, number];
315
+ get rgba(): readonly [number, number, number, number];
316
+ get r(): number;
317
+ get g(): number;
318
+ get b(): number;
319
+ get a(): number;
320
+ get rgbHex(): string;
321
+ get packed(): number;
322
+ static from(colorLike: ColorLike): Color;
323
+ static fromRgbHex(hex: string): Color;
324
+ private toHexComponent;
325
+ }
326
+
292
327
  declare class Box3 {
293
328
  min: vec3;
294
329
  max: vec3;
@@ -360,34 +395,6 @@ declare class TrsTransform {
360
395
 
361
396
  type Shader = "floatScalarImage" | "floatVolume" | "intLabelImage" | "intScalarImage" | "intVolume" | "labelImage" | "points" | "projectedLine" | "uintScalarImage" | "uintVolume" | "wireframe";
362
397
 
363
- /** @group Layer Configuration */
364
- type ColorLike = Color | vec3 | vec4 | string;
365
- /** @group Layer Configuration */
366
- declare class Color {
367
- static readonly RED: Color;
368
- static readonly GREEN: Color;
369
- static readonly BLUE: Color;
370
- static readonly YELLOW: Color;
371
- static readonly MAGENTA: Color;
372
- static readonly CYAN: Color;
373
- static readonly BLACK: Color;
374
- static readonly WHITE: Color;
375
- static readonly TRANSPARENT: Color;
376
- private readonly rgba_;
377
- constructor(r: number, g: number, b: number, a?: number);
378
- get rgb(): [number, number, number];
379
- get rgba(): readonly [number, number, number, number];
380
- get r(): number;
381
- get g(): number;
382
- get b(): number;
383
- get a(): number;
384
- get rgbHex(): string;
385
- get packed(): number;
386
- static from(colorLike: ColorLike): Color;
387
- static fromRgbHex(hex: string): Color;
388
- private toHexComponent;
389
- }
390
-
391
398
  type CullingMode = "none" | "front" | "back" | "both";
392
399
 
393
400
  declare abstract class RenderableObject extends Node {
@@ -692,6 +699,7 @@ type IdetikParams = {
692
699
  memoryLimitMB?: number;
693
700
  maxConcurrentRequests?: number;
694
701
  maxGpuUploadsPerUpdate?: number;
702
+ backgroundColor?: ColorLike;
695
703
  };
696
704
  type IdetikContext = {
697
705
  chunkManager: ChunkManager;
@@ -1490,6 +1498,7 @@ type ImageLayerProps = LayerOptions & {
1490
1498
  source: ChunkSource;
1491
1499
  sliceCoords: SliceCoordinates;
1492
1500
  policy: ImageSourcePolicy;
1501
+ orientation?: SliceOrientation;
1493
1502
  channelProps?: ChannelProps[];
1494
1503
  onPickValue?: (info: PointPickingResult) => void;
1495
1504
  };
@@ -1512,6 +1521,7 @@ declare class ImageLayer extends Layer implements ChannelsEnabled {
1512
1521
  private readonly source_;
1513
1522
  private readonly sliceCoords_;
1514
1523
  private readonly axes_;
1524
+ private readonly planeRotation_;
1515
1525
  private readonly onPickValue_?;
1516
1526
  private readonly visibleChunks_;
1517
1527
  private readonly pool_;
@@ -1526,7 +1536,7 @@ declare class ImageLayer extends Layer implements ChannelsEnabled {
1526
1536
  private lastPresentationTimeStamp_?;
1527
1537
  private lastPresentationTimeCoord_?;
1528
1538
  private readonly wireframeColors_;
1529
- constructor({ source, sliceCoords, policy, channelProps, onPickValue, ...layerOptions }: ImageLayerProps);
1539
+ constructor({ source, sliceCoords, policy, orientation, channelProps, onPickValue, ...layerOptions }: ImageLayerProps);
1530
1540
  protected attach(context: IdetikContext): void;
1531
1541
  protected detach(_context: IdetikContext): void;
1532
1542
  update(viewport?: Viewport): void;
@@ -1619,6 +1629,7 @@ type LabelLayerProps = LayerOptions & {
1619
1629
  source: ChunkSource;
1620
1630
  sliceCoords: SliceCoordinates;
1621
1631
  policy: ImageSourcePolicy;
1632
+ orientation?: SliceOrientation;
1622
1633
  colorMap?: LabelColorMapProps;
1623
1634
  onPickValue?: (info: PointPickingResult) => void;
1624
1635
  outlineSelected?: boolean;
@@ -1629,6 +1640,7 @@ declare class LabelLayer extends Layer {
1629
1640
  private readonly source_;
1630
1641
  private readonly sliceCoords_;
1631
1642
  private readonly axes_;
1643
+ private readonly planeRotation_;
1632
1644
  private readonly onPickValue_?;
1633
1645
  private readonly outlineSelected_;
1634
1646
  private readonly visibleChunks_;
@@ -1641,7 +1653,7 @@ declare class LabelLayer extends Layer {
1641
1653
  private static readonly STALE_PRESENTATION_MS_;
1642
1654
  private lastPresentationTimeStamp_?;
1643
1655
  private lastPresentationTimeCoord_?;
1644
- constructor({ source, sliceCoords, policy, colorMap, onPickValue, outlineSelected, ...layerOptions }: LabelLayerProps);
1656
+ constructor({ source, sliceCoords, policy, orientation, colorMap, onPickValue, outlineSelected, ...layerOptions }: LabelLayerProps);
1645
1657
  protected attach(context: IdetikContext): void;
1646
1658
  protected detach(_context: IdetikContext): void;
1647
1659
  update(viewport?: Viewport): void;
@@ -2039,4 +2051,4 @@ type Image = z.infer<typeof Image>;
2039
2051
  type OmeZarrImage = Image;
2040
2052
 
2041
2053
  export { AxesLayer, Color, Idetik, ImageLayer, ImageRenderable, LabelColorMap, LabelImageRenderable, LabelLayer, Layer, OmeZarrImageSource, OrbitControls, OrthographicCamera, PanZoomControls, PerspectiveCamera, Points, ProjectedLine, VolumeLayer, VolumeRenderable, createExplorationPolicy, createImageSourcePolicy, createNoPrefetchPolicy, createPlaybackPolicy, loadOmeZarrPlate, loadOmeZarrWell, loadOmeroChannels, loadOmeroDefaults };
2042
- export type { ChannelProps, ColorLike, LayerState, MemoryStats, OmeZarrImage, Overlay, SliceCoordinates };
2054
+ export type { ChannelProps, ColorLike, LayerState, MemoryStats, OmeZarrImage, Overlay, SliceCoordinates, SliceOrientation };