@vitessce/types 3.4.12 → 3.4.14
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-tsc/ngff-types.d.ts +81 -0
- package/dist-tsc/ngff-types.d.ts.map +1 -0
- package/dist-tsc/ngff-types.js +1 -0
- package/package.json +1 -1
- package/src/ngff-types.ts +115 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export type NgffAxis = {
|
|
2
|
+
/**
|
|
3
|
+
* Name of the axis
|
|
4
|
+
*/
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* Longer name or description of the axis.
|
|
8
|
+
*/
|
|
9
|
+
longName?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Dimension of the axis
|
|
12
|
+
*/
|
|
13
|
+
type?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the dimension is discrete
|
|
16
|
+
*/
|
|
17
|
+
discrete?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Unit for the axis
|
|
20
|
+
*/
|
|
21
|
+
unit?: string;
|
|
22
|
+
};
|
|
23
|
+
export type NgffAxes = NgffAxis[];
|
|
24
|
+
export type NgffCoordinateSystem = {
|
|
25
|
+
name: string;
|
|
26
|
+
axes: NgffAxes;
|
|
27
|
+
};
|
|
28
|
+
export type NgffCoordinateSystems = NgffCoordinateSystem[];
|
|
29
|
+
export type ScaleTransformation = {
|
|
30
|
+
type: 'scale';
|
|
31
|
+
scale: number[];
|
|
32
|
+
};
|
|
33
|
+
export type TranslationTransformation = {
|
|
34
|
+
type: 'translation';
|
|
35
|
+
translation: number[];
|
|
36
|
+
};
|
|
37
|
+
export type AffineTransformation = {
|
|
38
|
+
type: 'affine';
|
|
39
|
+
matrix: number[] | number[][];
|
|
40
|
+
};
|
|
41
|
+
export type RotationTransformation = {
|
|
42
|
+
type: 'rotation';
|
|
43
|
+
rotation: number[];
|
|
44
|
+
};
|
|
45
|
+
export type InverseOfTransformation = {
|
|
46
|
+
type: 'inverseOf';
|
|
47
|
+
transformation: NgffCoordinateTransformation;
|
|
48
|
+
};
|
|
49
|
+
export type SequenceTransformation = {
|
|
50
|
+
type: 'sequence';
|
|
51
|
+
transformations: NgffCoordinateTransformation[];
|
|
52
|
+
};
|
|
53
|
+
export type CoordinatesTransformation = {
|
|
54
|
+
type: 'coordinates';
|
|
55
|
+
path: string;
|
|
56
|
+
interpolation: 'nearest' | 'linear' | 'cubic';
|
|
57
|
+
};
|
|
58
|
+
export type DisplacementsTransformation = {
|
|
59
|
+
type: 'displacements';
|
|
60
|
+
path: string;
|
|
61
|
+
interpolation: 'nearest' | 'linear' | 'cubic';
|
|
62
|
+
};
|
|
63
|
+
export type ByDimensionTransformation = {
|
|
64
|
+
type: 'byDimension';
|
|
65
|
+
transformations: NgffCoordinateTransformation[];
|
|
66
|
+
};
|
|
67
|
+
export type BijectionTransformation = {
|
|
68
|
+
type: 'bijection';
|
|
69
|
+
forward: object;
|
|
70
|
+
inverse: object;
|
|
71
|
+
};
|
|
72
|
+
export type NgffCoordinateTransformation = {
|
|
73
|
+
input: string | NgffCoordinateSystem;
|
|
74
|
+
output: string | NgffCoordinateSystem;
|
|
75
|
+
} & (ScaleTransformation | TranslationTransformation | AffineTransformation | RotationTransformation | InverseOfTransformation | SequenceTransformation | CoordinatesTransformation | DisplacementsTransformation | ByDimensionTransformation | BijectionTransformation);
|
|
76
|
+
export type NgffCoordinateTransformations = NgffCoordinateTransformation[];
|
|
77
|
+
export type NgffCoordinateSystemsAndTransformations = {
|
|
78
|
+
coordinateSystems: NgffCoordinateSystems;
|
|
79
|
+
coordinateTransformations: NgffCoordinateTransformations;
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=ngff-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngff-types.d.ts","sourceRoot":"","sources":["../src/ngff-types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;I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AE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC/C,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC/C,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG;IAEtC,IAAI,EAAE,aAAa,CAAC;IAEpB,eAAe,EAAE,4BAA4B,EAAE,CAAC;CACjD,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,4BAA4B,GAAG;IAOzC,KAAK,EAAE,MAAM,GAAG,oBAAoB,CAAC;IACrC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAAC;CACvC,GAAG,CACF,mBAAmB,GACjB,yBAAyB,GACzB,oBAAoB,GACpB,sBAAsB,GACtB,uBAAuB,GACvB,sBAAsB,GACtB,yBAAyB,GACzB,2BAA2B,GAC3B,yBAAyB,GACzB,uBAAuB,CAC1B,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,4BAA4B,EAAE,CAAC;AAG3E,MAAM,MAAM,uCAAuC,GAAG;IACpD,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,yBAAyB,EAAE,6BAA6B,CAAC;CAC1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// Reference: https://github.com/ome/ngff/blob/bc4f395193b63ed671d4e4bdc0d7477c58abada8/latest/schemas/axes.schema
|
|
2
|
+
export type NgffAxis = {
|
|
3
|
+
/**
|
|
4
|
+
* Name of the axis
|
|
5
|
+
*/
|
|
6
|
+
name: string
|
|
7
|
+
/**
|
|
8
|
+
* Longer name or description of the axis.
|
|
9
|
+
*/
|
|
10
|
+
longName?: string
|
|
11
|
+
/**
|
|
12
|
+
* Dimension of the axis
|
|
13
|
+
*/
|
|
14
|
+
type?: string
|
|
15
|
+
/**
|
|
16
|
+
* Whether the dimension is discrete
|
|
17
|
+
*/
|
|
18
|
+
discrete?: boolean
|
|
19
|
+
/**
|
|
20
|
+
* Unit for the axis
|
|
21
|
+
*/
|
|
22
|
+
unit?: string
|
|
23
|
+
};
|
|
24
|
+
export type NgffAxes = NgffAxis[];
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// Reference: https://github.com/ome/ngff/blob/bc4f395193b63ed671d4e4bdc0d7477c58abada8/latest/schemas/coordinate_systems.schema
|
|
28
|
+
export type NgffCoordinateSystem = {
|
|
29
|
+
name: string;
|
|
30
|
+
axes: NgffAxes;
|
|
31
|
+
};
|
|
32
|
+
export type NgffCoordinateSystems = NgffCoordinateSystem[];
|
|
33
|
+
|
|
34
|
+
// Reference: https://github.com/ome/ngff/blob/bc4f395193b63ed671d4e4bdc0d7477c58abada8/latest/schemas/coordinateTransformations.schema
|
|
35
|
+
export type ScaleTransformation = {
|
|
36
|
+
type: 'scale';
|
|
37
|
+
scale: number[];
|
|
38
|
+
};
|
|
39
|
+
export type TranslationTransformation = {
|
|
40
|
+
type: 'translation';
|
|
41
|
+
translation: number[];
|
|
42
|
+
};
|
|
43
|
+
export type AffineTransformation = {
|
|
44
|
+
type: 'affine';
|
|
45
|
+
matrix: number[] | number[][];
|
|
46
|
+
// Can have a "c" referenced in the affine, but we
|
|
47
|
+
// just throw away and use the x/y parts of the matrix.
|
|
48
|
+
};
|
|
49
|
+
export type RotationTransformation = {
|
|
50
|
+
// Not supported yet by SpatialData
|
|
51
|
+
type: 'rotation';
|
|
52
|
+
rotation: number[];
|
|
53
|
+
};
|
|
54
|
+
export type InverseOfTransformation = {
|
|
55
|
+
type: 'inverseOf';
|
|
56
|
+
// eslint-disable-next-line no-use-before-define
|
|
57
|
+
transformation: NgffCoordinateTransformation;
|
|
58
|
+
};
|
|
59
|
+
export type SequenceTransformation = {
|
|
60
|
+
type: 'sequence';
|
|
61
|
+
// eslint-disable-next-line no-use-before-define
|
|
62
|
+
transformations: NgffCoordinateTransformation[];
|
|
63
|
+
// Sometimes, the axes are not explicitly specified,
|
|
64
|
+
// and instead they are inferred. May need to throw error
|
|
65
|
+
// if ambiguous.
|
|
66
|
+
};
|
|
67
|
+
export type CoordinatesTransformation = {
|
|
68
|
+
type: 'coordinates';
|
|
69
|
+
path: string;
|
|
70
|
+
interpolation: 'nearest' | 'linear' | 'cubic';
|
|
71
|
+
};
|
|
72
|
+
export type DisplacementsTransformation = {
|
|
73
|
+
type: 'displacements';
|
|
74
|
+
path: string;
|
|
75
|
+
interpolation: 'nearest' | 'linear' | 'cubic';
|
|
76
|
+
};
|
|
77
|
+
export type ByDimensionTransformation = {
|
|
78
|
+
// Weird behavior, we can parse and just throw error/warning.
|
|
79
|
+
type: 'byDimension';
|
|
80
|
+
// eslint-disable-next-line no-use-before-define
|
|
81
|
+
transformations: NgffCoordinateTransformation[];
|
|
82
|
+
};
|
|
83
|
+
export type BijectionTransformation = {
|
|
84
|
+
type: 'bijection';
|
|
85
|
+
forward: object;
|
|
86
|
+
inverse: object;
|
|
87
|
+
};
|
|
88
|
+
export type NgffCoordinateTransformation = {
|
|
89
|
+
// Note: in the latest version of the NGFF coordinate systems proposal,
|
|
90
|
+
// the `input` and `output` fields are only allowed to be strings referencing
|
|
91
|
+
// coordinate systems within the `coordinateSystems` array.
|
|
92
|
+
// Here, we also support an earlier version in which these coordinate systems
|
|
93
|
+
// are defined inline a bit redundantly (because there is not a
|
|
94
|
+
// `coordinateSystems` property more globally).
|
|
95
|
+
input: string | NgffCoordinateSystem;
|
|
96
|
+
output: string | NgffCoordinateSystem;
|
|
97
|
+
} & (
|
|
98
|
+
ScaleTransformation
|
|
99
|
+
| TranslationTransformation
|
|
100
|
+
| AffineTransformation
|
|
101
|
+
| RotationTransformation
|
|
102
|
+
| InverseOfTransformation
|
|
103
|
+
| SequenceTransformation
|
|
104
|
+
| CoordinatesTransformation
|
|
105
|
+
| DisplacementsTransformation
|
|
106
|
+
| ByDimensionTransformation
|
|
107
|
+
| BijectionTransformation
|
|
108
|
+
);
|
|
109
|
+
export type NgffCoordinateTransformations = NgffCoordinateTransformation[];
|
|
110
|
+
|
|
111
|
+
// Reference: https://github.com/ome/ngff/blob/bc4f395193b63ed671d4e4bdc0d7477c58abada8/latest/schemas/coordinate_systems_and_transforms.schema
|
|
112
|
+
export type NgffCoordinateSystemsAndTransformations = {
|
|
113
|
+
coordinateSystems: NgffCoordinateSystems;
|
|
114
|
+
coordinateTransformations: NgffCoordinateTransformations;
|
|
115
|
+
};
|