@vitessce/types 3.3.8 → 3.3.10

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.
@@ -0,0 +1,11 @@
1
+ import type { Readable } from '@zarrita/storage';
2
+ export type DataSourceParams = {
3
+ url?: string;
4
+ /** Options to pass to fetch calls. */
5
+ requestInit?: RequestInit;
6
+ /** A Zarrita store object. */
7
+ store?: Readable;
8
+ /** The file type. */
9
+ fileType: string;
10
+ };
11
+ //# sourceMappingURL=data-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-sources.d.ts","sourceRoot":"","sources":["../src/data-sources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,81 @@
1
+ import type { AbstractImageWrapper } from './imaging.js';
2
+ import type { SetsTree } from './sets.js';
3
+ export type MatrixResult = {
4
+ data: number[] | Float32Array[];
5
+ shape: number[];
6
+ };
7
+ export type ObsFeatureMatrixData = {
8
+ obsIndex: string[];
9
+ featureIndex: string[];
10
+ obsFeatureMatrix: MatrixResult;
11
+ };
12
+ export type ObsFeatureMatrixAttrs = {
13
+ obsIndex: string[];
14
+ featureIndex: string[];
15
+ };
16
+ export type ObsEmbeddingData = {
17
+ obsIndex: string[];
18
+ obsEmbedding: MatrixResult;
19
+ };
20
+ export type ObsLocationsData = {
21
+ obsIndex: string[];
22
+ obsLocations: MatrixResult;
23
+ };
24
+ export type ObsPointsData = {
25
+ obsIndex: string[];
26
+ obsPoints: MatrixResult;
27
+ };
28
+ export type ObsSpotsData = {
29
+ obsIndex: string[];
30
+ obsSpots: MatrixResult;
31
+ };
32
+ export type FeatureLabelsData = {
33
+ featureIndex: string[];
34
+ featureLabels: string[];
35
+ featureLabelsMap: Map<string, string>;
36
+ };
37
+ export type ObsLabelsData = {
38
+ obsIndex: string[];
39
+ obsLabels: string[];
40
+ obsLabelsMap: Map<string, string>;
41
+ };
42
+ export type ObsSetsData = {
43
+ obsIndex: string[];
44
+ obsSets: SetsTree;
45
+ obsSetsMembership: Map<string, string[][]>;
46
+ };
47
+ export type ObsSegmentationsPolygons = {
48
+ obsSegmentations: {
49
+ data: number[][][];
50
+ shape: number[];
51
+ };
52
+ obsSegmentationsType: 'polygon';
53
+ };
54
+ export type ObsSegmentationsBitmask = {
55
+ obsSegmentations: {
56
+ instance: AbstractImageWrapper;
57
+ image?: any;
58
+ metadata?: any;
59
+ };
60
+ obsSegmentationsType: 'bitmask';
61
+ };
62
+ export type ObsSegmentationsData = ObsSegmentationsPolygons | ObsSegmentationsBitmask;
63
+ export type ImageData = {
64
+ image: {
65
+ instance: AbstractImageWrapper;
66
+ image?: any;
67
+ metadata?: any;
68
+ };
69
+ featureIndex: string[];
70
+ };
71
+ export type LoaderParams = {
72
+ type: string;
73
+ fileType: string;
74
+ url?: string;
75
+ requestInit?: RequestInit;
76
+ options?: any;
77
+ coordinationValues?: {
78
+ [key: string]: any;
79
+ };
80
+ };
81
+ //# sourceMappingURL=data-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-types.d.ts","sourceRoot":"","sources":["../src/data-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,EAAE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EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;CAC5C,CAAC;AAGF,MAAM,MAAM,wBAAwB,GAAG;IACrC,gBAAgB,EAAE;QAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC1D,oBAAoB,EAAE,SAAS,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,gBAAgB,EAAE;QAChB,QAAQ,EAAE,oBAAoB,CAAC;QAC/B,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;KAChB,CAAC;IACF,oBAAoB,EAAE,SAAS,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GAAG,uBAAuB,CAAC;AAEtF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE;QACL,QAAQ,EAAE,oBAAoB,CAAC;QAC/B,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;KAChB,CAAC;IACF,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAUF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAC7C,CAAC"}
@@ -0,0 +1,44 @@
1
+ export {};
2
+ /*
3
+ export abstract class Loader<DataType> {
4
+ fileType: string;
5
+
6
+ type: string;
7
+
8
+ url?: string;
9
+
10
+ requestInit?: RequestInit;
11
+
12
+ options?: any;
13
+
14
+ coordinationValues?: { [key: string]: any };
15
+
16
+ constructor({
17
+ type, fileType,
18
+ url, requestInit,
19
+ options, coordinationValues,
20
+ }: LoaderParams) {
21
+ this.fileType = fileType;
22
+ this.type = type;
23
+ this.url = url;
24
+ this.requestInit = requestInit;
25
+ this.options = options;
26
+ this.coordinationValues = coordinationValues;
27
+ }
28
+
29
+ abstract load(): Promise<LoaderResult<DataType>>;
30
+ }
31
+
32
+ export abstract class TwoStepLoader<DataType, DataSourceType> extends Loader<DataType> {
33
+ dataSource: DataSourceType;
34
+
35
+ constructor(dataSource: DataSourceType, params: LoaderParams) {
36
+ super(params);
37
+ this.dataSource = dataSource;
38
+ }
39
+ }
40
+
41
+ export abstract class ObsFeatureMatrixLoader extends Loader<ObsFeatureMatrixData> {
42
+ abstract loadAttrs?(): Promise<LoaderResult<ObsFeatureMatrixAttrs>>;
43
+ }
44
+ */
@@ -0,0 +1,64 @@
1
+ import type { LoadOmeTiffReturnValue } from './ome-tiff-types.js';
2
+ import type { LoadOmeZarrReturnValue } from './ome-zarr-types.js';
3
+ export type VivLoaderType = LoadOmeTiffReturnValue<string[]> | LoadOmeZarrReturnValue<string[]>;
4
+ export type VivLoaderDataType = VivLoaderType['data'];
5
+ export type ImageOptions = {
6
+ coordinateTransformations?: object[];
7
+ offsetsUrl?: string;
8
+ };
9
+ export type ChannelObject = {
10
+ name: string;
11
+ defaultColor?: number[];
12
+ defaultWindow?: [number, number];
13
+ autoDefaultColor?: number[];
14
+ };
15
+ export type ResolutionObject = {
16
+ height: number;
17
+ width: number;
18
+ depthDownsampled: number;
19
+ totalBytes: number;
20
+ canLoad: boolean;
21
+ };
22
+ export type BoundingCube = [
23
+ [
24
+ number,
25
+ number
26
+ ],
27
+ [
28
+ number,
29
+ number
30
+ ],
31
+ [
32
+ number,
33
+ number
34
+ ]
35
+ ];
36
+ export interface AbstractImageWrapper {
37
+ getType(): 'ome-tiff' | 'ome-zarr';
38
+ hasPhysicalSize(): boolean;
39
+ getData(): VivLoaderDataType;
40
+ getModelMatrix(): number[];
41
+ getDefaultTargetT(): number;
42
+ getDefaultTargetZ(): number;
43
+ getName(): string;
44
+ getNumChannels(): number;
45
+ getChannelNames(): string[];
46
+ getChannelObjects(): ChannelObject[];
47
+ getDtype(): string | undefined;
48
+ hasZStack(): boolean;
49
+ hasTStack(): boolean;
50
+ getNumZ(): number;
51
+ getNumT(): number;
52
+ isMultiResolution(): boolean;
53
+ getMultiResolutionStats(): ResolutionObject[];
54
+ /**
55
+ * Compute an index of an array element returned by getMultiResolutionStats()
56
+ * which corresponds to a "good" automatic target resolution to select.
57
+ * In the future, we could make this more sophisticated, for example
58
+ * to take into account the network speed.
59
+ */
60
+ getAutoTargetResolution(): number | null;
61
+ getBoundingCube(): BoundingCube;
62
+ isInterleaved(): boolean;
63
+ }
64
+ //# sourceMappingURL=imaging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imaging.d.ts","sourceRoot":"","sources":["../src/imaging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC,MAAM,EAAE,CAAC,GAAG,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC;AAChG,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG;IACzB,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IAGb,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAKjC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB;QAAC,MAAM;QAAE,MAAM;KAAC;IAChB;QAAC,MAAM;QAAE,MAAM;KAAC;IAChB;QAAC,MAAM;QAAE,MAAM;KAAC;CACjB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IAEnC,OAAO,IAAI,UAAU,GAAG,UAAU,CAAC;IAEnC,eAAe,IAAI,OAAO,CAAC;IAE3B,OAAO,IAAI,iBAAiB,CAAC;IAE7B,cAAc,IAAI,MAAM,EAAE,CAAC;IAE3B,iBAAiB,IAAI,MAAM,CAAC;IAE5B,iBAAiB,IAAI,MAAM,CAAC;IAE5B,OAAO,IAAI,MAAM,CAAC;IAElB,cAAc,IAAI,MAAM,CAAC;IAEzB,eAAe,IAAI,MAAM,EAAE,CAAC;IAE5B,iBAAiB,IAAI,aAAa,EAAE,CAAC;IAErC,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;IAE/B,SAAS,IAAI,OAAO,CAAC;IAErB,SAAS,IAAI,OAAO,CAAC;IAErB,OAAO,IAAI,MAAM,CAAC;IAElB,OAAO,IAAI,MAAM,CAAC;IAElB,iBAAiB,IAAI,OAAO,CAAC;IAE7B,uBAAuB,IAAI,gBAAgB,EAAE,CAAC;IAE9C;;;;;OAKG;IACH,uBAAuB,IAAI,MAAM,GAAC,IAAI,CAAC;IAEvC,eAAe,IAAI,YAAY,CAAC;IAEhC,aAAa,IAAI,OAAO,CAAC;CAC1B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,62 +1,6 @@
1
- declare type MatrixResult = {
2
- data: number[] | Float32Array[];
3
- shape: number[];
4
- };
5
- export declare type ObsFeatureMatrixData = {
6
- obsIndex: string[];
7
- featureIndex: string[];
8
- obsFeatureMatrix: MatrixResult;
9
- };
10
- export declare type ObsEmbeddingData = {
11
- obsIndex: string[];
12
- obsEmbedding: MatrixResult;
13
- };
14
- export declare type ObsLocationsData = {
15
- obsIndex: string[];
16
- obsLocations: MatrixResult;
17
- };
18
- export declare type ObsPointsData = {
19
- obsIndex: string[];
20
- obsPoints: MatrixResult;
21
- };
22
- export declare type ObsSpotsDatat = {
23
- obsIndex: string[];
24
- obsSpots: MatrixResult;
25
- };
26
- export declare type ObsSegmentationsPolygons = {
27
- obsSegmentations: {
28
- data: number[][][];
29
- shape: number[];
30
- };
31
- obsSegmentationsType: 'polygon';
32
- };
33
- export declare type ObsSegmentationsData = ObsSegmentationsPolygons;
34
- export declare type FeatureLabelsData = {
35
- featureIndex: string[];
36
- featureLabels: string[];
37
- };
38
- export declare type ObsLabelsData = {
39
- obsIndex: string[];
40
- obsLabels: string[];
41
- };
42
- export declare type SetsTreeNodeLeaf = {
43
- name: string;
44
- color?: number[];
45
- set: Array<[string, number | null]>;
46
- };
47
- export declare type SetsTreeNodeNonLeaf = {
48
- name: string;
49
- color?: number[];
50
- children: Array<SetsTreeNodeNonLeaf | SetsTreeNodeLeaf>;
51
- };
52
- export declare type SetsTree = {
53
- version: '0.1.3';
54
- tree: SetsTreeNodeNonLeaf[];
55
- };
56
- export declare type ObsSetsData = {
57
- obsIndex: string[];
58
- obsSets: SetsTree;
59
- obsSetsMembership: Map<string, string[][]>;
60
- };
1
+ export type { MatrixResult, ObsFeatureMatrixData, ObsFeatureMatrixAttrs, ObsEmbeddingData, ObsLocationsData, ObsPointsData, ObsSpotsData, FeatureLabelsData, ObsLabelsData, ObsSetsData, ObsSegmentationsPolygons, ObsSegmentationsBitmask, ObsSegmentationsData, ImageData, LoaderParams, } from './data-types.js';
2
+ export type { DataSourceParams, } from './data-sources.js';
3
+ export type { AbstractImageWrapper, VivLoaderType, VivLoaderDataType, ImageOptions, ChannelObject, ResolutionObject, BoundingCube, } from './imaging.js';
4
+ export type { SetsTreeNodeLeaf, SetsTreeNodeNonLeaf, SetsTree, } from './sets.js';
61
5
  export {};
62
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,aAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,YAAY,CAAC;CAChC,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,gBAAgB,EAAE;QAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC1D,oBAAoB,EAAE,SAAS,CAAC;CACjC,CAAC;AAGF,oBAAY,oBAAoB,GAAG,wBAAwB,CAAC;AAE5D,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,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AChB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,GACT,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,CAAC"}
@@ -0,0 +1,53 @@
1
+ import type { TiffPixelSource } from '@hms-dbmi/viv';
2
+ type DimensionOrder = 'XYZCT' | 'XYZTC' | 'XYCTZ' | 'XYCZT' | 'XYTCZ' | 'XYTZC';
3
+ type PixelType = 'int8' | 'int16' | 'int32' | 'uint8' | 'uint16' | 'uint32' | 'float' | 'bit' | 'double' | 'complex' | 'double-complex';
4
+ type UnitsLength = 'Ym' | 'Zm' | 'Em' | 'Pm' | 'Tm' | 'Gm' | 'Mm' | 'km' | 'hm' | 'dam' | 'm' | 'dm' | 'cm' | 'mm' | 'µm' | 'nm' | 'pm' | 'fm' | 'am' | 'zm' | 'ym' | 'Å' | 'thou' | 'li' | 'in' | 'ft' | 'yd' | 'mi' | 'ua' | 'ly' | 'pc' | 'pt' | 'pixel' | 'reference frame';
5
+ type Channel = {
6
+ ID: string;
7
+ SamplesPerPixel: number;
8
+ Name?: string;
9
+ Color?: number[];
10
+ };
11
+ type Pixels = {
12
+ Channels: Channel[];
13
+ TiffData: {
14
+ IFD: string;
15
+ PlaneCount: number;
16
+ };
17
+ PhysicalSizeX: number;
18
+ PhysicalSizeXUnit: UnitsLength;
19
+ PhysicalSizeY: number;
20
+ PhysicalSizeYUnit: UnitsLength;
21
+ PhysicalSizeZ: number;
22
+ PhysicalSizeZUnit: UnitsLength;
23
+ SizeT: number;
24
+ SizeC: number;
25
+ SizeZ: number;
26
+ SizeY: number;
27
+ SizeX: number;
28
+ SignificantBits: number;
29
+ BigEndian: boolean;
30
+ Interleaved: boolean;
31
+ ID: string;
32
+ DimensionOrder: DimensionOrder;
33
+ Type: PixelType;
34
+ };
35
+ type Image = {
36
+ ID: string;
37
+ Name: string;
38
+ AquisitionDate?: string;
39
+ Description?: string;
40
+ Pixels: Pixels;
41
+ InstrumentRef: {
42
+ ID: string;
43
+ };
44
+ ObjectiveSettings: {
45
+ ID: string;
46
+ };
47
+ };
48
+ export type LoadOmeTiffReturnValue<S extends string[]> = {
49
+ data: TiffPixelSource<S>[];
50
+ metadata: Image;
51
+ };
52
+ export {};
53
+ //# sourceMappingURL=ome-tiff-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ome-tiff-types.d.ts","sourceRoot":"","sources":["../src/ome-tiff-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,KAAK,cAAc,GAAG,OAAO,GACzB,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,CAAC;AAEZ,KAAK,SAAS,GACV,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,KAAK,GACL,QAAQ,GACR,SAAS,GACT,gBAAgB,CAAC;AAErB,KAAK,WAAW,GACZ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,GAAG,GACH,MAAM,GACN,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,OAAO,GACP,iBAAiB,CAAC;AAUtB,KAAK,OAAO,GAAG;IACb,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,Q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sVisible: boolean;
4
+ color: string;
5
+ label: string;
6
+ window: {
7
+ min?: number;
8
+ max?: number;
9
+ start: number;
10
+ end: number;
11
+ };
12
+ };
13
+ type Omero = {
14
+ channels: Channel[];
15
+ rdefs: {
16
+ defaultT?: number;
17
+ defaultZ?: number;
18
+ model: string;
19
+ };
20
+ name?: string;
21
+ };
22
+ type Axis = {
23
+ name: string;
24
+ type?: string;
25
+ unit?: string;
26
+ };
27
+ type Multiscale = {
28
+ datasets: {
29
+ path: string;
30
+ }[];
31
+ axes?: string[] | Axis[];
32
+ version?: string;
33
+ coordinateTransformations?: object[];
34
+ };
35
+ type SpatialDataTempAttrs = {
36
+ channels_metadata?: {
37
+ channels: {
38
+ label: number;
39
+ }[];
40
+ };
41
+ 'image-label'?: {
42
+ version: string;
43
+ };
44
+ };
45
+ type RootAttrs = {
46
+ omero: Omero;
47
+ multiscales: Multiscale[];
48
+ } | SpatialDataTempAttrs;
49
+ export type LoadOmeZarrReturnValue<S extends string[]> = {
50
+ data: ZarrPixelSource<S>[];
51
+ metadata: RootAttrs;
52
+ };
53
+ export {};
54
+ //# sourceMappingURL=ome-zarr-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ome-zarr-types.d.ts","sourceRoot":"","sources":["../src/ome-zarr-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,KAAK,OAAO,GAAG;IACb,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAA;AAED,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAA;AAGD,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;CACtC,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,iBAAiB,CAAC,EAAE;QAClB,QAAQ,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC/B,CAAA;IACD,aAAa,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACrC,CAAA;AAED,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,GAAG,oBAAoB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI;IACvD,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ export type SetsTreeNodeLeaf = {
2
+ name: string;
3
+ color?: number[];
4
+ set: Array<[string, number | null]>;
5
+ };
6
+ export type SetsTreeNodeNonLeaf = {
7
+ name: string;
8
+ color?: number[];
9
+ children: Array<SetsTreeNodeNonLeaf | SetsTreeNodeLeaf>;
10
+ };
11
+ export type SetsTree = {
12
+ version: '0.1.3';
13
+ tree: SetsTreeNodeNonLeaf[];
14
+ };
15
+ //# sourceMappingURL=sets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../src/sets.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CACrC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,mBAAmB,EAAE,CAAC;CAC7B,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/types",
3
- "version": "3.3.8",
3
+ "version": "3.3.10",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -15,7 +15,10 @@
15
15
  "dist",
16
16
  "dist-tsc"
17
17
  ],
18
- "dependencies": {},
18
+ "dependencies": {
19
+ "@hms-dbmi/viv": "~0.13.8",
20
+ "@zarrita/storage": "0.1.0-next.4"
21
+ },
19
22
  "devDependencies": {
20
23
  "@types/react": "^18.0.28",
21
24
  "vite": "^4.3.0",
@@ -0,0 +1,11 @@
1
+ import type { Readable } from '@zarrita/storage';
2
+
3
+ export type DataSourceParams = {
4
+ url?: string;
5
+ /** Options to pass to fetch calls. */
6
+ requestInit?: RequestInit;
7
+ /** A Zarrita store object. */
8
+ store?: Readable;
9
+ /** The file type. */
10
+ fileType: string;
11
+ }
@@ -0,0 +1,143 @@
1
+ import type { AbstractImageWrapper } from './imaging.js';
2
+ import type { SetsTree } from './sets.js';
3
+
4
+ export type MatrixResult = {
5
+ data: number[] | Float32Array[];
6
+ shape: number[];
7
+ };
8
+
9
+ export type ObsFeatureMatrixData = {
10
+ obsIndex: string[];
11
+ featureIndex: string[];
12
+ obsFeatureMatrix: MatrixResult;
13
+ };
14
+
15
+ export type ObsFeatureMatrixAttrs = {
16
+ obsIndex: string[];
17
+ featureIndex: string[];
18
+ };
19
+
20
+ export type ObsEmbeddingData = {
21
+ obsIndex: string[];
22
+ obsEmbedding: MatrixResult;
23
+ };
24
+
25
+ export type ObsLocationsData = {
26
+ obsIndex: string[];
27
+ obsLocations: MatrixResult;
28
+ };
29
+
30
+ export type ObsPointsData = {
31
+ obsIndex: string[];
32
+ obsPoints: MatrixResult;
33
+ };
34
+
35
+ export type ObsSpotsData = {
36
+ obsIndex: string[];
37
+ obsSpots: MatrixResult;
38
+ };
39
+
40
+ export type FeatureLabelsData = {
41
+ featureIndex: string[];
42
+ featureLabels: string[];
43
+ featureLabelsMap: Map<string, string>;
44
+ };
45
+
46
+ export type ObsLabelsData = {
47
+ obsIndex: string[];
48
+ obsLabels: string[];
49
+ obsLabelsMap: Map<string, string>;
50
+ };
51
+
52
+ export type ObsSetsData = {
53
+ obsIndex: string[];
54
+ obsSets: SetsTree;
55
+ obsSetsMembership: Map<string, string[][]>;
56
+ };
57
+
58
+ // Imaging
59
+ export type ObsSegmentationsPolygons = {
60
+ obsSegmentations: { data: number[][][], shape: number[] };
61
+ obsSegmentationsType: 'polygon';
62
+ };
63
+
64
+ export type ObsSegmentationsBitmask = {
65
+ obsSegmentations: {
66
+ instance: AbstractImageWrapper;
67
+ image?: any;
68
+ metadata?: any;
69
+ };
70
+ obsSegmentationsType: 'bitmask';
71
+ };
72
+
73
+ export type ObsSegmentationsData = ObsSegmentationsPolygons | ObsSegmentationsBitmask;
74
+
75
+ export type ImageData = {
76
+ image: {
77
+ instance: AbstractImageWrapper;
78
+ image?: any;
79
+ metadata?: any;
80
+ };
81
+ featureIndex: string[];
82
+ };
83
+
84
+ /*
85
+ export interface LoaderResult<DataType> {
86
+ data: DataType;
87
+ url?: string | { url: string, name: string}[];
88
+ coordinationValues?: { [key: string]: any };
89
+ }
90
+ */
91
+
92
+ export type LoaderParams = {
93
+ type: string,
94
+ fileType: string,
95
+ url?: string,
96
+ requestInit?: RequestInit,
97
+ options?: any,
98
+ coordinationValues?: { [key: string]: any },
99
+ };
100
+
101
+ /*
102
+ export abstract class Loader<DataType> {
103
+ fileType: string;
104
+
105
+ type: string;
106
+
107
+ url?: string;
108
+
109
+ requestInit?: RequestInit;
110
+
111
+ options?: any;
112
+
113
+ coordinationValues?: { [key: string]: any };
114
+
115
+ constructor({
116
+ type, fileType,
117
+ url, requestInit,
118
+ options, coordinationValues,
119
+ }: LoaderParams) {
120
+ this.fileType = fileType;
121
+ this.type = type;
122
+ this.url = url;
123
+ this.requestInit = requestInit;
124
+ this.options = options;
125
+ this.coordinationValues = coordinationValues;
126
+ }
127
+
128
+ abstract load(): Promise<LoaderResult<DataType>>;
129
+ }
130
+
131
+ export abstract class TwoStepLoader<DataType, DataSourceType> extends Loader<DataType> {
132
+ dataSource: DataSourceType;
133
+
134
+ constructor(dataSource: DataSourceType, params: LoaderParams) {
135
+ super(params);
136
+ this.dataSource = dataSource;
137
+ }
138
+ }
139
+
140
+ export abstract class ObsFeatureMatrixLoader extends Loader<ObsFeatureMatrixData> {
141
+ abstract loadAttrs?(): Promise<LoaderResult<ObsFeatureMatrixAttrs>>;
142
+ }
143
+ */
package/src/imaging.ts ADDED
@@ -0,0 +1,86 @@
1
+ import type { LoadOmeTiffReturnValue } from './ome-tiff-types.js';
2
+ import type { LoadOmeZarrReturnValue } from './ome-zarr-types.js';
3
+
4
+ export type VivLoaderType = LoadOmeTiffReturnValue<string[]> | LoadOmeZarrReturnValue<string[]>;
5
+ export type VivLoaderDataType = VivLoaderType['data'];
6
+
7
+ export type ImageOptions = {
8
+ coordinateTransformations?: object[]; // TODO: stricter type
9
+ offsetsUrl?: string;
10
+ };
11
+
12
+ export type ChannelObject = {
13
+ name: string;
14
+ // Defaults that originate from image file contents
15
+ // (takes precedence over automatic defaults below)
16
+ defaultColor?: number[];
17
+ defaultWindow?: [number, number];
18
+ // Defaults for automatic initialization
19
+ // (if defaults above are null or not provided).
20
+ // TODO: should autoDefaultColor be exposed as a separate value?
21
+ // or just set as the value of defaultColor when applicable?
22
+ autoDefaultColor?: number[];
23
+ };
24
+
25
+ export type ResolutionObject = {
26
+ height: number;
27
+ width: number;
28
+ depthDownsampled: number;
29
+ totalBytes: number;
30
+ canLoad: boolean;
31
+ };
32
+
33
+ export type BoundingCube = [
34
+ [number, number],
35
+ [number, number],
36
+ [number, number]
37
+ ];
38
+
39
+ export interface AbstractImageWrapper {
40
+
41
+ getType(): 'ome-tiff' | 'ome-zarr';
42
+
43
+ hasPhysicalSize(): boolean;
44
+
45
+ getData(): VivLoaderDataType;
46
+
47
+ getModelMatrix(): number[];
48
+
49
+ getDefaultTargetT(): number;
50
+
51
+ getDefaultTargetZ(): number;
52
+
53
+ getName(): string;
54
+
55
+ getNumChannels(): number;
56
+
57
+ getChannelNames(): string[];
58
+
59
+ getChannelObjects(): ChannelObject[];
60
+
61
+ getDtype(): string | undefined;
62
+
63
+ hasZStack(): boolean;
64
+
65
+ hasTStack(): boolean;
66
+
67
+ getNumZ(): number;
68
+
69
+ getNumT(): number;
70
+
71
+ isMultiResolution(): boolean;
72
+
73
+ getMultiResolutionStats(): ResolutionObject[];
74
+
75
+ /**
76
+ * Compute an index of an array element returned by getMultiResolutionStats()
77
+ * which corresponds to a "good" automatic target resolution to select.
78
+ * In the future, we could make this more sophisticated, for example
79
+ * to take into account the network speed.
80
+ */
81
+ getAutoTargetResolution(): number|null;
82
+
83
+ getBoundingCube(): BoundingCube;
84
+
85
+ isInterleaved(): boolean;
86
+ }
package/src/index.ts CHANGED
@@ -1,74 +1,37 @@
1
- // This is a type-only sub-package.
2
- type MatrixResult = {
3
- data: number[] | Float32Array[];
4
- shape: number[];
5
- };
6
-
7
- export type ObsFeatureMatrixData = {
8
- obsIndex: string[];
9
- featureIndex: string[];
10
- obsFeatureMatrix: MatrixResult;
11
- };
12
-
13
- export type ObsEmbeddingData = {
14
- obsIndex: string[];
15
- obsEmbedding: MatrixResult;
16
- };
17
-
18
- export type ObsLocationsData = {
19
- obsIndex: string[];
20
- obsLocations: MatrixResult;
21
- };
22
-
23
- export type ObsPointsData = {
24
- obsIndex: string[];
25
- obsPoints: MatrixResult;
26
- };
27
-
28
- export type ObsSpotsDatat = {
29
- obsIndex: string[];
30
- obsSpots: MatrixResult;
31
- };
32
-
33
- export type ObsSegmentationsPolygons = {
34
- obsSegmentations: { data: number[][][], shape: number[] };
35
- obsSegmentationsType: 'polygon';
36
- };
37
-
38
- // TODO: bitmask
39
- export type ObsSegmentationsData = ObsSegmentationsPolygons;
40
-
41
- export type FeatureLabelsData = {
42
- featureIndex: string[];
43
- featureLabels: string[];
44
- };
45
-
46
- export type ObsLabelsData = {
47
- obsIndex: string[];
48
- obsLabels: string[];
49
- };
50
-
51
- export type SetsTreeNodeLeaf = {
52
- name: string;
53
- color?: number[];
54
- set: Array<[string, number | null]>;
55
- }
56
-
57
- export type SetsTreeNodeNonLeaf = {
58
- name: string;
59
- color?: number[];
60
- children: Array<SetsTreeNodeNonLeaf | SetsTreeNodeLeaf>;
61
- };
62
-
63
- export type SetsTree = {
64
- version: '0.1.3';
65
- tree: SetsTreeNodeNonLeaf[];
66
- };
67
-
68
- export type ObsSetsData = {
69
- obsIndex: string[];
70
- obsSets: SetsTree;
71
- obsSetsMembership: Map<string, string[][]>;
72
- };
73
-
1
+ export type {
2
+ MatrixResult,
3
+ ObsFeatureMatrixData,
4
+ ObsFeatureMatrixAttrs,
5
+ ObsEmbeddingData,
6
+ ObsLocationsData,
7
+ ObsPointsData,
8
+ ObsSpotsData,
9
+ FeatureLabelsData,
10
+ ObsLabelsData,
11
+ ObsSetsData,
12
+ ObsSegmentationsPolygons,
13
+ ObsSegmentationsBitmask,
14
+ ObsSegmentationsData,
15
+ ImageData,
16
+ LoaderParams,
17
+ } from './data-types.js';
18
+ export type {
19
+ DataSourceParams,
20
+ } from './data-sources.js';
21
+ export type {
22
+ AbstractImageWrapper,
23
+ VivLoaderType,
24
+ VivLoaderDataType,
25
+ ImageOptions,
26
+ ChannelObject,
27
+ ResolutionObject,
28
+ BoundingCube,
29
+ } from './imaging.js';
30
+ export type {
31
+ SetsTreeNodeLeaf,
32
+ SetsTreeNodeNonLeaf,
33
+ SetsTree,
34
+ } from './sets.js';
35
+
36
+ // This is a types-only package.
74
37
  export {};
@@ -0,0 +1,117 @@
1
+ import type { TiffPixelSource } from '@hms-dbmi/viv';
2
+
3
+ type DimensionOrder = 'XYZCT'
4
+ | 'XYZTC'
5
+ | 'XYCTZ'
6
+ | 'XYCZT'
7
+ | 'XYTCZ'
8
+ | 'XYTZC';
9
+
10
+ type PixelType =
11
+ | 'int8'
12
+ | 'int16'
13
+ | 'int32'
14
+ | 'uint8'
15
+ | 'uint16'
16
+ | 'uint32'
17
+ | 'float'
18
+ | 'bit'
19
+ | 'double'
20
+ | 'complex'
21
+ | 'double-complex';
22
+
23
+ type UnitsLength =
24
+ | 'Ym'
25
+ | 'Zm'
26
+ | 'Em'
27
+ | 'Pm'
28
+ | 'Tm'
29
+ | 'Gm'
30
+ | 'Mm'
31
+ | 'km'
32
+ | 'hm'
33
+ | 'dam'
34
+ | 'm'
35
+ | 'dm'
36
+ | 'cm'
37
+ | 'mm'
38
+ | 'µm'
39
+ | 'nm'
40
+ | 'pm'
41
+ | 'fm'
42
+ | 'am'
43
+ | 'zm'
44
+ | 'ym'
45
+ | 'Å'
46
+ | 'thou'
47
+ | 'li'
48
+ | 'in'
49
+ | 'ft'
50
+ | 'yd'
51
+ | 'mi'
52
+ | 'ua'
53
+ | 'ly'
54
+ | 'pc'
55
+ | 'pt'
56
+ | 'pixel'
57
+ | 'reference frame';
58
+
59
+ type Instrument = {
60
+ Objective: {
61
+ ID: string;
62
+ Model: string;
63
+ NominalMagnification: unknown;
64
+ };
65
+ };
66
+
67
+ type Channel = {
68
+ ID: string;
69
+ SamplesPerPixel: number;
70
+ Name?: string;
71
+ Color?: number[]; // [R, G, B, A]
72
+ };
73
+
74
+ type Pixels = {
75
+ Channels: Channel[];
76
+ TiffData: {
77
+ IFD: string;
78
+ PlaneCount: number;
79
+ };
80
+ PhysicalSizeX: number;
81
+ PhysicalSizeXUnit: UnitsLength;
82
+ PhysicalSizeY: number;
83
+ PhysicalSizeYUnit: UnitsLength;
84
+ PhysicalSizeZ: number;
85
+ PhysicalSizeZUnit: UnitsLength;
86
+ SizeT: number;
87
+ SizeC: number;
88
+ SizeZ: number;
89
+ SizeY: number;
90
+ SizeX: number;
91
+ SignificantBits: number;
92
+ BigEndian: boolean;
93
+ Interleaved: boolean;
94
+ ID: string;
95
+ DimensionOrder: DimensionOrder;
96
+ Type: PixelType;
97
+ }
98
+
99
+ type Image = {
100
+ ID: string;
101
+ Name: string;
102
+ AquisitionDate?: string;
103
+ Description?: string;
104
+ Pixels: Pixels;
105
+ InstrumentRef: { ID: string };
106
+ ObjectiveSettings: { ID: string };
107
+ }
108
+
109
+ type OME = {
110
+ Instrument: Instrument;
111
+ Image: Image | Image[];
112
+ }
113
+
114
+ export type LoadOmeTiffReturnValue<S extends string[]> = {
115
+ data: TiffPixelSource<S>[];
116
+ metadata: Image;
117
+ };
@@ -0,0 +1,54 @@
1
+ import type { ZarrPixelSource } from '@hms-dbmi/viv';
2
+
3
+ type Channel = {
4
+ channelsVisible: boolean;
5
+ color: string;
6
+ label: string;
7
+ window: {
8
+ min?: number;
9
+ max?: number;
10
+ start: number;
11
+ end: number;
12
+ };
13
+ }
14
+
15
+ type Omero = {
16
+ channels: Channel[];
17
+ rdefs: {
18
+ defaultT?: number;
19
+ defaultZ?: number;
20
+ model: string;
21
+ };
22
+ name?: string;
23
+ }
24
+
25
+ // See https://ngff.openmicroscopy.org/latest/#axes-md
26
+ type Axis = {
27
+ name: string;
28
+ type?: string;
29
+ unit?: string;
30
+ }
31
+
32
+ type Multiscale = {
33
+ datasets: { path: string }[];
34
+ axes?: string[] | Axis[];
35
+ version?: string;
36
+ coordinateTransformations?: object[]; // TODO: stricter type
37
+ }
38
+
39
+ type SpatialDataTempAttrs = {
40
+ channels_metadata?: {
41
+ channels: { label: number }[];
42
+ }
43
+ 'image-label'?: { version: string };
44
+ }
45
+
46
+ type RootAttrs = {
47
+ omero: Omero;
48
+ multiscales: Multiscale[];
49
+ } | SpatialDataTempAttrs;
50
+
51
+ export type LoadOmeZarrReturnValue<S extends string[]> = {
52
+ data: ZarrPixelSource<S>[];
53
+ metadata: RootAttrs;
54
+ };
package/src/sets.ts ADDED
@@ -0,0 +1,16 @@
1
+ export type SetsTreeNodeLeaf = {
2
+ name: string;
3
+ color?: number[];
4
+ set: Array<[string, number | null]>;
5
+ }
6
+
7
+ export type SetsTreeNodeNonLeaf = {
8
+ name: string;
9
+ color?: number[];
10
+ children: Array<SetsTreeNodeNonLeaf | SetsTreeNodeLeaf>;
11
+ };
12
+
13
+ export type SetsTree = {
14
+ version: '0.1.3';
15
+ tree: SetsTreeNodeNonLeaf[];
16
+ };