@fideus-labs/ngff-zarr 0.0.1 → 0.2.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.
Files changed (176) hide show
  1. package/README.md +10 -2
  2. package/esm/io/from_ngff_zarr.d.ts +4 -1
  3. package/esm/io/from_ngff_zarr.d.ts.map +1 -1
  4. package/esm/io/from_ngff_zarr.js +94 -27
  5. package/esm/io/hcs.d.ts +18 -0
  6. package/esm/io/hcs.d.ts.map +1 -0
  7. package/esm/io/hcs.js +51 -0
  8. package/esm/io/itk_image_to_ngff_image.d.ts +30 -0
  9. package/esm/io/itk_image_to_ngff_image.d.ts.map +1 -0
  10. package/esm/io/itk_image_to_ngff_image.js +127 -0
  11. package/esm/io/ngff_image_to_itk_image.d.ts +30 -0
  12. package/esm/io/ngff_image_to_itk_image.d.ts.map +1 -0
  13. package/esm/io/ngff_image_to_itk_image.js +218 -0
  14. package/esm/io/to_multiscales.d.ts +18 -0
  15. package/esm/io/to_multiscales.d.ts.map +1 -0
  16. package/esm/io/to_multiscales.js +62 -0
  17. package/esm/io/to_ngff_image.d.ts +17 -0
  18. package/esm/io/to_ngff_image.d.ts.map +1 -0
  19. package/esm/io/to_ngff_image.js +136 -0
  20. package/esm/io/to_ngff_zarr.d.ts +3 -2
  21. package/esm/io/to_ngff_zarr.d.ts.map +1 -1
  22. package/esm/io/to_ngff_zarr.js +289 -26
  23. package/esm/methods/itkwasm.d.ts +6 -0
  24. package/esm/methods/itkwasm.d.ts.map +1 -0
  25. package/esm/methods/itkwasm.js +958 -0
  26. package/esm/mod.d.ts +9 -2
  27. package/esm/mod.d.ts.map +1 -1
  28. package/esm/mod.js +10 -2
  29. package/esm/schemas/coordinate_systems.d.ts +251 -0
  30. package/esm/schemas/coordinate_systems.d.ts.map +1 -0
  31. package/esm/schemas/coordinate_systems.js +139 -0
  32. package/esm/schemas/index.d.ts +9 -0
  33. package/esm/schemas/index.d.ts.map +1 -0
  34. package/esm/schemas/index.js +38 -0
  35. package/esm/schemas/methods.d.ts.map +1 -1
  36. package/esm/schemas/methods.js +2 -0
  37. package/esm/schemas/multiscales.d.ts.map +1 -1
  38. package/esm/schemas/multiscales.js +2 -0
  39. package/esm/schemas/ngff_image.d.ts +9 -2
  40. package/esm/schemas/ngff_image.d.ts.map +1 -1
  41. package/esm/schemas/ngff_image.js +11 -2
  42. package/esm/schemas/ome_zarr.d.ts +617 -0
  43. package/esm/schemas/ome_zarr.d.ts.map +1 -0
  44. package/esm/schemas/ome_zarr.js +208 -0
  45. package/esm/schemas/rfc4.d.ts +334 -0
  46. package/esm/schemas/rfc4.d.ts.map +1 -0
  47. package/esm/schemas/rfc4.js +129 -0
  48. package/esm/schemas/units.d.ts +70 -5
  49. package/esm/schemas/units.d.ts.map +1 -1
  50. package/esm/schemas/units.js +4 -12
  51. package/esm/schemas/zarr_metadata.d.ts +10 -4
  52. package/esm/schemas/zarr_metadata.d.ts.map +1 -1
  53. package/esm/schemas/zarr_metadata.js +22 -1
  54. package/esm/types/array_interface.d.ts +7 -0
  55. package/esm/types/array_interface.d.ts.map +1 -0
  56. package/esm/types/array_interface.js +1 -0
  57. package/esm/types/hcs.d.ts +70 -0
  58. package/esm/types/hcs.d.ts.map +1 -0
  59. package/esm/types/hcs.js +204 -0
  60. package/esm/types/methods.d.ts.map +1 -1
  61. package/esm/types/methods.js +2 -0
  62. package/esm/types/multiscales.d.ts.map +1 -1
  63. package/esm/types/ngff_image.d.ts +6 -3
  64. package/esm/types/ngff_image.d.ts.map +1 -1
  65. package/esm/types/ngff_image.js +13 -1
  66. package/esm/types/rfc4.d.ts +94 -0
  67. package/esm/types/rfc4.d.ts.map +1 -0
  68. package/esm/types/rfc4.js +135 -0
  69. package/esm/types/units.d.ts +1 -1
  70. package/esm/types/units.d.ts.map +1 -1
  71. package/esm/types/zarr_metadata.d.ts +14 -5
  72. package/esm/types/zarr_metadata.d.ts.map +1 -1
  73. package/esm/utils/create_queue.d.ts +6 -0
  74. package/esm/utils/create_queue.d.ts.map +1 -0
  75. package/esm/utils/create_queue.js +11 -0
  76. package/esm/utils/factory.d.ts +1 -1
  77. package/esm/utils/factory.d.ts.map +1 -1
  78. package/esm/utils/factory.js +16 -7
  79. package/esm/utils/method_metadata.d.ts +10 -0
  80. package/esm/utils/method_metadata.d.ts.map +1 -0
  81. package/esm/utils/method_metadata.js +37 -0
  82. package/esm/utils/validation.d.ts.map +1 -1
  83. package/package.json +7 -1
  84. package/script/io/from_ngff_zarr.d.ts +4 -1
  85. package/script/io/from_ngff_zarr.d.ts.map +1 -1
  86. package/script/io/from_ngff_zarr.js +94 -27
  87. package/script/io/hcs.d.ts +18 -0
  88. package/script/io/hcs.d.ts.map +1 -0
  89. package/script/io/hcs.js +55 -0
  90. package/script/io/itk_image_to_ngff_image.d.ts +30 -0
  91. package/script/io/itk_image_to_ngff_image.d.ts.map +1 -0
  92. package/script/io/itk_image_to_ngff_image.js +153 -0
  93. package/script/io/ngff_image_to_itk_image.d.ts +30 -0
  94. package/script/io/ngff_image_to_itk_image.d.ts.map +1 -0
  95. package/script/io/ngff_image_to_itk_image.js +244 -0
  96. package/script/io/to_multiscales.d.ts +18 -0
  97. package/script/io/to_multiscales.d.ts.map +1 -0
  98. package/script/io/to_multiscales.js +67 -0
  99. package/script/io/to_ngff_image.d.ts +17 -0
  100. package/script/io/to_ngff_image.d.ts.map +1 -0
  101. package/script/io/to_ngff_image.js +162 -0
  102. package/script/io/to_ngff_zarr.d.ts +3 -2
  103. package/script/io/to_ngff_zarr.d.ts.map +1 -1
  104. package/script/io/to_ngff_zarr.js +289 -26
  105. package/script/methods/itkwasm.d.ts +6 -0
  106. package/script/methods/itkwasm.d.ts.map +1 -0
  107. package/script/methods/itkwasm.js +984 -0
  108. package/script/mod.d.ts +9 -2
  109. package/script/mod.d.ts.map +1 -1
  110. package/script/mod.js +12 -3
  111. package/script/schemas/coordinate_systems.d.ts +251 -0
  112. package/script/schemas/coordinate_systems.d.ts.map +1 -0
  113. package/script/schemas/coordinate_systems.js +142 -0
  114. package/script/schemas/index.d.ts +9 -0
  115. package/script/schemas/index.d.ts.map +1 -0
  116. package/script/schemas/index.js +101 -0
  117. package/script/schemas/methods.d.ts.map +1 -1
  118. package/script/schemas/methods.js +2 -0
  119. package/script/schemas/multiscales.d.ts.map +1 -1
  120. package/script/schemas/multiscales.js +2 -0
  121. package/script/schemas/ngff_image.d.ts +9 -2
  122. package/script/schemas/ngff_image.d.ts.map +1 -1
  123. package/script/schemas/ngff_image.js +11 -2
  124. package/script/schemas/ome_zarr.d.ts +617 -0
  125. package/script/schemas/ome_zarr.d.ts.map +1 -0
  126. package/script/schemas/ome_zarr.js +211 -0
  127. package/script/schemas/rfc4.d.ts +334 -0
  128. package/script/schemas/rfc4.d.ts.map +1 -0
  129. package/script/schemas/rfc4.js +132 -0
  130. package/script/schemas/units.d.ts +70 -5
  131. package/script/schemas/units.d.ts.map +1 -1
  132. package/script/schemas/units.js +4 -12
  133. package/script/schemas/zarr_metadata.d.ts +10 -4
  134. package/script/schemas/zarr_metadata.d.ts.map +1 -1
  135. package/script/schemas/zarr_metadata.js +23 -2
  136. package/script/types/array_interface.d.ts +7 -0
  137. package/script/types/array_interface.d.ts.map +1 -0
  138. package/script/types/array_interface.js +2 -0
  139. package/script/types/hcs.d.ts +70 -0
  140. package/script/types/hcs.d.ts.map +1 -0
  141. package/script/types/hcs.js +233 -0
  142. package/script/types/methods.d.ts.map +1 -1
  143. package/script/types/methods.js +2 -0
  144. package/script/types/multiscales.d.ts.map +1 -1
  145. package/script/types/ngff_image.d.ts +6 -3
  146. package/script/types/ngff_image.d.ts.map +1 -1
  147. package/script/types/ngff_image.js +13 -1
  148. package/script/types/rfc4.d.ts +94 -0
  149. package/script/types/rfc4.d.ts.map +1 -0
  150. package/script/types/rfc4.js +143 -0
  151. package/script/types/units.d.ts +1 -1
  152. package/script/types/units.d.ts.map +1 -1
  153. package/script/types/zarr_metadata.d.ts +14 -5
  154. package/script/types/zarr_metadata.d.ts.map +1 -1
  155. package/script/utils/create_queue.d.ts +6 -0
  156. package/script/utils/create_queue.d.ts.map +1 -0
  157. package/script/utils/create_queue.js +17 -0
  158. package/script/utils/factory.d.ts +1 -1
  159. package/script/utils/factory.d.ts.map +1 -1
  160. package/script/utils/factory.js +39 -7
  161. package/script/utils/method_metadata.d.ts +10 -0
  162. package/script/utils/method_metadata.d.ts.map +1 -0
  163. package/script/utils/method_metadata.js +40 -0
  164. package/script/utils/validation.d.ts.map +1 -1
  165. package/esm/schemas/lazy_array.d.ts +0 -8
  166. package/esm/schemas/lazy_array.d.ts.map +0 -1
  167. package/esm/schemas/lazy_array.js +0 -7
  168. package/esm/types/lazy_array.d.ts +0 -18
  169. package/esm/types/lazy_array.d.ts.map +0 -1
  170. package/esm/types/lazy_array.js +0 -27
  171. package/script/schemas/lazy_array.d.ts +0 -8
  172. package/script/schemas/lazy_array.d.ts.map +0 -1
  173. package/script/schemas/lazy_array.js +0 -10
  174. package/script/types/lazy_array.d.ts +0 -18
  175. package/script/types/lazy_array.d.ts.map +0 -1
  176. package/script/types/lazy_array.js +0 -31
@@ -0,0 +1,208 @@
1
+ // SPDX-FileCopyrightText: Copyright (c) Fideus Labs LLC
2
+ // SPDX-License-Identifier: MIT
3
+ import { z } from "zod";
4
+ // Version schemas for different OME-Zarr specification versions
5
+ export const OmeZarrVersion01Schema = z.literal("0.1");
6
+ export const OmeZarrVersion02Schema = z.literal("0.2");
7
+ export const OmeZarrVersion03Schema = z.literal("0.3");
8
+ export const OmeZarrVersion04Schema = z.literal("0.4");
9
+ export const OmeZarrVersion05Schema = z.literal("0.5");
10
+ export const OmeZarrVersionSchema = z.union([
11
+ OmeZarrVersion01Schema,
12
+ OmeZarrVersion02Schema,
13
+ OmeZarrVersion03Schema,
14
+ OmeZarrVersion04Schema,
15
+ OmeZarrVersion05Schema,
16
+ ]);
17
+ // Common schemas used across versions
18
+ export const OmeroWindowSchema = z.object({
19
+ start: z.number(),
20
+ min: z.number(),
21
+ end: z.number(),
22
+ max: z.number(),
23
+ });
24
+ export const OmeroChannelSchema = z.object({
25
+ window: OmeroWindowSchema,
26
+ label: z.string().optional(),
27
+ family: z.string().optional(),
28
+ color: z.string(),
29
+ active: z.boolean().optional(),
30
+ });
31
+ export const OmeroChannelSchemaV01 = z.object({
32
+ window: OmeroWindowSchema,
33
+ label: z.string().optional(),
34
+ family: z.string().optional(),
35
+ color: z.string(),
36
+ active: z.boolean().optional(),
37
+ });
38
+ export const OmeroSchema = z.object({
39
+ channels: z.array(OmeroChannelSchema),
40
+ });
41
+ // Dataset schemas for different versions
42
+ export const DatasetSchemaV01 = z.object({
43
+ path: z.string(),
44
+ });
45
+ export const OmeZarrCoordinateTransformationSchema = z.union([
46
+ z.object({
47
+ type: z.literal("scale"),
48
+ scale: z.array(z.number()).min(2),
49
+ }),
50
+ z.object({
51
+ type: z.literal("translation"),
52
+ translation: z.array(z.number()).min(2),
53
+ }),
54
+ ]);
55
+ export const DatasetSchemaV05 = z.object({
56
+ path: z.string(),
57
+ coordinateTransformations: z
58
+ .array(OmeZarrCoordinateTransformationSchema)
59
+ .min(1),
60
+ });
61
+ // Axis schemas for different versions
62
+ export const AxisSchemaV05 = z.union([
63
+ z.object({
64
+ name: z.string(),
65
+ type: z.enum(["channel", "time", "space"]),
66
+ unit: z.string().optional(),
67
+ }),
68
+ z.object({
69
+ name: z.string(),
70
+ type: z
71
+ .string()
72
+ .refine((val) => !["space", "time", "channel"].includes(val)),
73
+ }),
74
+ ]);
75
+ // Multiscales schemas for different versions
76
+ export const MultiscalesSchemaV01 = z.object({
77
+ name: z.string().optional(),
78
+ datasets: z.array(DatasetSchemaV01).min(1),
79
+ version: OmeZarrVersion01Schema.optional(),
80
+ metadata: z
81
+ .object({
82
+ method: z.string().optional(),
83
+ version: z.string().optional(),
84
+ })
85
+ .optional(),
86
+ });
87
+ export const MultiscalesSchemaV05 = z.object({
88
+ name: z.string().optional(),
89
+ datasets: z.array(DatasetSchemaV05).min(1),
90
+ axes: z
91
+ .array(AxisSchemaV05)
92
+ .min(2)
93
+ .max(5)
94
+ .refine((axes) => {
95
+ const spaceAxes = axes.filter((axis) => typeof axis.type === "string" && axis.type === "space");
96
+ return spaceAxes.length >= 2 && spaceAxes.length <= 3;
97
+ }, {
98
+ message: "Must contain 2-3 space axes",
99
+ }),
100
+ coordinateTransformations: z
101
+ .array(OmeZarrCoordinateTransformationSchema)
102
+ .optional(),
103
+ });
104
+ // Image schemas for different versions
105
+ export const ImageSchemaV01 = z.object({
106
+ multiscales: z.array(MultiscalesSchemaV01).min(1),
107
+ omero: OmeroSchema.optional(),
108
+ });
109
+ export const ImageSchemaV05 = z.object({
110
+ ome: z.object({
111
+ multiscales: z.array(MultiscalesSchemaV05).min(1),
112
+ omero: OmeroSchema.optional(),
113
+ version: OmeZarrVersion05Schema,
114
+ }),
115
+ });
116
+ // Label schemas
117
+ export const LabelColorSchema = z.object({
118
+ "label-value": z.number(),
119
+ rgba: z.array(z.number().min(0).max(255)).length(4).optional(),
120
+ });
121
+ export const LabelPropertySchema = z.object({
122
+ "label-value": z.number(),
123
+ });
124
+ export const LabelSchemaV04 = z.object({
125
+ "image-label": z
126
+ .object({
127
+ colors: z.array(LabelColorSchema).min(1).optional(),
128
+ properties: z.array(LabelPropertySchema).min(1).optional(),
129
+ source: z
130
+ .object({
131
+ image: z.string().optional(),
132
+ })
133
+ .optional(),
134
+ version: OmeZarrVersion04Schema.optional(),
135
+ })
136
+ .optional(),
137
+ });
138
+ // Plate schemas
139
+ export const PlateAcquisitionSchema = z.object({
140
+ id: z.number().min(0),
141
+ maximumfieldcount: z.number().positive().optional(),
142
+ name: z.string().optional(),
143
+ description: z.string().optional(),
144
+ starttime: z.number().min(0).optional(),
145
+ endtime: z.number().min(0).optional(),
146
+ });
147
+ export const PlateColumnSchema = z.object({
148
+ name: z.string().regex(/^[A-Za-z0-9]+$/),
149
+ });
150
+ export const PlateRowSchema = z.object({
151
+ name: z.string().regex(/^[A-Za-z0-9]+$/),
152
+ });
153
+ export const PlateWellSchema = z.object({
154
+ path: z.string().regex(/^[A-Za-z0-9]+\/[A-Za-z0-9]+$/),
155
+ rowIndex: z.number().min(0),
156
+ columnIndex: z.number().min(0),
157
+ });
158
+ export const PlateSchemaV05 = z.object({
159
+ ome: z.object({
160
+ plate: z.object({
161
+ acquisitions: z.array(PlateAcquisitionSchema).optional(),
162
+ field_count: z.number().positive().optional(),
163
+ name: z.string().optional(),
164
+ columns: z.array(PlateColumnSchema).min(1),
165
+ rows: z.array(PlateRowSchema).min(1),
166
+ wells: z.array(PlateWellSchema).min(1),
167
+ }),
168
+ version: OmeZarrVersion05Schema,
169
+ }),
170
+ });
171
+ // Well schemas
172
+ export const WellImageSchema = z.object({
173
+ acquisition: z.number().optional(),
174
+ path: z.string().regex(/^[A-Za-z0-9]+$/),
175
+ });
176
+ export const WellSchemaV05 = z.object({
177
+ ome: z.object({
178
+ well: z.object({
179
+ images: z.array(WellImageSchema).min(1),
180
+ }),
181
+ version: OmeZarrVersion05Schema,
182
+ }),
183
+ });
184
+ // OME metadata schema (for ome.schema)
185
+ export const OmeSeriesSchema = z.object({
186
+ image: z.string(),
187
+ });
188
+ export const OmeMetadataSchema = z.object({
189
+ ome: z.object({
190
+ series: z.array(OmeSeriesSchema),
191
+ version: OmeZarrVersionSchema,
192
+ }),
193
+ });
194
+ // Union schemas for version-agnostic usage
195
+ export const ImageSchema = z.union([ImageSchemaV01, ImageSchemaV05]);
196
+ export const MultiscalesSchema = z.union([
197
+ MultiscalesSchemaV01,
198
+ MultiscalesSchemaV05,
199
+ ]);
200
+ // Comprehensive OME-Zarr metadata schema that can handle any version
201
+ export const OmeZarrMetadataSchema = z.union([
202
+ ImageSchemaV01,
203
+ ImageSchemaV05,
204
+ LabelSchemaV04,
205
+ PlateSchemaV05,
206
+ WellSchemaV05,
207
+ OmeMetadataSchema,
208
+ ]);
@@ -0,0 +1,334 @@
1
+ import { z } from "zod";
2
+ export declare const AnatomicalOrientationValuesSchema: z.ZodType<"left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal">;
3
+ export declare const AnatomicalOrientationSchema: z.ZodType<{
4
+ type: "anatomical";
5
+ value: "left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal";
6
+ }>;
7
+ export declare const OrientationTypeSchema: z.ZodEnum<{
8
+ anatomical: "anatomical";
9
+ }>;
10
+ export declare const OrientationSchema: z.ZodObject<{
11
+ type: z.ZodEnum<{
12
+ anatomical: "anatomical";
13
+ }>;
14
+ value: z.ZodType<"left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal", unknown, z.core.$ZodTypeInternals<"left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal", unknown>>;
15
+ }, z.core.$strip>;
16
+ export declare const AxesNamesSchema: z.ZodEnum<{
17
+ c: "c";
18
+ x: "x";
19
+ y: "y";
20
+ z: "z";
21
+ t: "t";
22
+ }>;
23
+ export declare const SpaceAxesNamesSchema: z.ZodEnum<{
24
+ x: "x";
25
+ y: "y";
26
+ z: "z";
27
+ }>;
28
+ export declare const AxisTypeSchema: z.ZodEnum<{
29
+ time: "time";
30
+ space: "space";
31
+ channel: "channel";
32
+ }>;
33
+ export declare const SpaceUnitSchema: z.ZodEnum<{
34
+ angstrom: "angstrom";
35
+ attometer: "attometer";
36
+ centimeter: "centimeter";
37
+ decimeter: "decimeter";
38
+ exameter: "exameter";
39
+ femtometer: "femtometer";
40
+ foot: "foot";
41
+ gigameter: "gigameter";
42
+ hectometer: "hectometer";
43
+ inch: "inch";
44
+ kilometer: "kilometer";
45
+ megameter: "megameter";
46
+ meter: "meter";
47
+ micrometer: "micrometer";
48
+ mile: "mile";
49
+ millimeter: "millimeter";
50
+ nanometer: "nanometer";
51
+ parsec: "parsec";
52
+ petameter: "petameter";
53
+ picometer: "picometer";
54
+ terameter: "terameter";
55
+ yard: "yard";
56
+ yoctometer: "yoctometer";
57
+ yottameter: "yottameter";
58
+ zeptometer: "zeptometer";
59
+ zettameter: "zettameter";
60
+ }>;
61
+ export declare const TimeUnitSchema: z.ZodEnum<{
62
+ attosecond: "attosecond";
63
+ centisecond: "centisecond";
64
+ day: "day";
65
+ decisecond: "decisecond";
66
+ exasecond: "exasecond";
67
+ femtosecond: "femtosecond";
68
+ gigasecond: "gigasecond";
69
+ hectosecond: "hectosecond";
70
+ hour: "hour";
71
+ kilosecond: "kilosecond";
72
+ megasecond: "megasecond";
73
+ microsecond: "microsecond";
74
+ millisecond: "millisecond";
75
+ minute: "minute";
76
+ nanosecond: "nanosecond";
77
+ petasecond: "petasecond";
78
+ picosecond: "picosecond";
79
+ second: "second";
80
+ terasecond: "terasecond";
81
+ yoctosecond: "yoctosecond";
82
+ yottasecond: "yottasecond";
83
+ zeptosecond: "zeptosecond";
84
+ zettasecond: "zettasecond";
85
+ }>;
86
+ export declare const BaseAxisSchema: z.ZodObject<{
87
+ name: z.ZodString;
88
+ type: z.ZodEnum<{
89
+ time: "time";
90
+ space: "space";
91
+ channel: "channel";
92
+ }>;
93
+ }, z.core.$strip>;
94
+ export declare const ChannelAxisSchema: z.ZodObject<{
95
+ name: z.ZodLiteral<"c">;
96
+ type: z.ZodLiteral<"channel">;
97
+ }, z.core.$strip>;
98
+ export declare const SpaceAxisSchema: z.ZodObject<{
99
+ name: z.ZodEnum<{
100
+ x: "x";
101
+ y: "y";
102
+ z: "z";
103
+ }>;
104
+ type: z.ZodLiteral<"space">;
105
+ unit: z.ZodEnum<{
106
+ angstrom: "angstrom";
107
+ attometer: "attometer";
108
+ centimeter: "centimeter";
109
+ decimeter: "decimeter";
110
+ exameter: "exameter";
111
+ femtometer: "femtometer";
112
+ foot: "foot";
113
+ gigameter: "gigameter";
114
+ hectometer: "hectometer";
115
+ inch: "inch";
116
+ kilometer: "kilometer";
117
+ megameter: "megameter";
118
+ meter: "meter";
119
+ micrometer: "micrometer";
120
+ mile: "mile";
121
+ millimeter: "millimeter";
122
+ nanometer: "nanometer";
123
+ parsec: "parsec";
124
+ petameter: "petameter";
125
+ picometer: "picometer";
126
+ terameter: "terameter";
127
+ yard: "yard";
128
+ yoctometer: "yoctometer";
129
+ yottameter: "yottameter";
130
+ zeptometer: "zeptometer";
131
+ zettameter: "zettameter";
132
+ }>;
133
+ orientation: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<{
134
+ type: "anatomical";
135
+ value: "left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal";
136
+ }, unknown, z.core.$ZodTypeInternals<{
137
+ type: "anatomical";
138
+ value: "left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal";
139
+ }, unknown>>, z.ZodNull]>>;
140
+ }, z.core.$strip>;
141
+ export declare const TimeAxisSchema: z.ZodObject<{
142
+ name: z.ZodLiteral<"t">;
143
+ type: z.ZodLiteral<"time">;
144
+ unit: z.ZodEnum<{
145
+ attosecond: "attosecond";
146
+ centisecond: "centisecond";
147
+ day: "day";
148
+ decisecond: "decisecond";
149
+ exasecond: "exasecond";
150
+ femtosecond: "femtosecond";
151
+ gigasecond: "gigasecond";
152
+ hectosecond: "hectosecond";
153
+ hour: "hour";
154
+ kilosecond: "kilosecond";
155
+ megasecond: "megasecond";
156
+ microsecond: "microsecond";
157
+ millisecond: "millisecond";
158
+ minute: "minute";
159
+ nanosecond: "nanosecond";
160
+ petasecond: "petasecond";
161
+ picosecond: "picosecond";
162
+ second: "second";
163
+ terasecond: "terasecond";
164
+ yoctosecond: "yoctosecond";
165
+ yottasecond: "yottasecond";
166
+ zeptosecond: "zeptosecond";
167
+ zettasecond: "zettasecond";
168
+ }>;
169
+ }, z.core.$strip>;
170
+ export declare const AxisSchema: z.ZodUnion<readonly [z.ZodObject<{
171
+ name: z.ZodLiteral<"c">;
172
+ type: z.ZodLiteral<"channel">;
173
+ }, z.core.$strip>, z.ZodObject<{
174
+ name: z.ZodEnum<{
175
+ x: "x";
176
+ y: "y";
177
+ z: "z";
178
+ }>;
179
+ type: z.ZodLiteral<"space">;
180
+ unit: z.ZodEnum<{
181
+ angstrom: "angstrom";
182
+ attometer: "attometer";
183
+ centimeter: "centimeter";
184
+ decimeter: "decimeter";
185
+ exameter: "exameter";
186
+ femtometer: "femtometer";
187
+ foot: "foot";
188
+ gigameter: "gigameter";
189
+ hectometer: "hectometer";
190
+ inch: "inch";
191
+ kilometer: "kilometer";
192
+ megameter: "megameter";
193
+ meter: "meter";
194
+ micrometer: "micrometer";
195
+ mile: "mile";
196
+ millimeter: "millimeter";
197
+ nanometer: "nanometer";
198
+ parsec: "parsec";
199
+ petameter: "petameter";
200
+ picometer: "picometer";
201
+ terameter: "terameter";
202
+ yard: "yard";
203
+ yoctometer: "yoctometer";
204
+ yottameter: "yottameter";
205
+ zeptometer: "zeptometer";
206
+ zettameter: "zettameter";
207
+ }>;
208
+ orientation: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<{
209
+ type: "anatomical";
210
+ value: "left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal";
211
+ }, unknown, z.core.$ZodTypeInternals<{
212
+ type: "anatomical";
213
+ value: "left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal";
214
+ }, unknown>>, z.ZodNull]>>;
215
+ }, z.core.$strip>, z.ZodObject<{
216
+ name: z.ZodLiteral<"t">;
217
+ type: z.ZodLiteral<"time">;
218
+ unit: z.ZodEnum<{
219
+ attosecond: "attosecond";
220
+ centisecond: "centisecond";
221
+ day: "day";
222
+ decisecond: "decisecond";
223
+ exasecond: "exasecond";
224
+ femtosecond: "femtosecond";
225
+ gigasecond: "gigasecond";
226
+ hectosecond: "hectosecond";
227
+ hour: "hour";
228
+ kilosecond: "kilosecond";
229
+ megasecond: "megasecond";
230
+ microsecond: "microsecond";
231
+ millisecond: "millisecond";
232
+ minute: "minute";
233
+ nanosecond: "nanosecond";
234
+ petasecond: "petasecond";
235
+ picosecond: "picosecond";
236
+ second: "second";
237
+ terasecond: "terasecond";
238
+ yoctosecond: "yoctosecond";
239
+ yottasecond: "yottasecond";
240
+ zeptosecond: "zeptosecond";
241
+ zettasecond: "zettasecond";
242
+ }>;
243
+ }, z.core.$strip>]>;
244
+ export declare const AxesSchema: z.ZodObject<{
245
+ axes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
246
+ name: z.ZodLiteral<"c">;
247
+ type: z.ZodLiteral<"channel">;
248
+ }, z.core.$strip>, z.ZodObject<{
249
+ name: z.ZodEnum<{
250
+ x: "x";
251
+ y: "y";
252
+ z: "z";
253
+ }>;
254
+ type: z.ZodLiteral<"space">;
255
+ unit: z.ZodEnum<{
256
+ angstrom: "angstrom";
257
+ attometer: "attometer";
258
+ centimeter: "centimeter";
259
+ decimeter: "decimeter";
260
+ exameter: "exameter";
261
+ femtometer: "femtometer";
262
+ foot: "foot";
263
+ gigameter: "gigameter";
264
+ hectometer: "hectometer";
265
+ inch: "inch";
266
+ kilometer: "kilometer";
267
+ megameter: "megameter";
268
+ meter: "meter";
269
+ micrometer: "micrometer";
270
+ mile: "mile";
271
+ millimeter: "millimeter";
272
+ nanometer: "nanometer";
273
+ parsec: "parsec";
274
+ petameter: "petameter";
275
+ picometer: "picometer";
276
+ terameter: "terameter";
277
+ yard: "yard";
278
+ yoctometer: "yoctometer";
279
+ yottameter: "yottameter";
280
+ zeptometer: "zeptometer";
281
+ zettameter: "zettameter";
282
+ }>;
283
+ orientation: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<{
284
+ type: "anatomical";
285
+ value: "left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal";
286
+ }, unknown, z.core.$ZodTypeInternals<{
287
+ type: "anatomical";
288
+ value: "left-to-right" | "right-to-left" | "anterior-to-posterior" | "posterior-to-anterior" | "inferior-to-superior" | "superior-to-inferior" | "dorsal-to-ventral" | "ventral-to-dorsal" | "dorsal-to-palmar" | "palmar-to-dorsal" | "dorsal-to-plantar" | "plantar-to-dorsal" | "rostral-to-caudal" | "caudal-to-rostral" | "cranial-to-caudal" | "caudal-to-cranial" | "proximal-to-distal" | "distal-to-proximal";
289
+ }, unknown>>, z.ZodNull]>>;
290
+ }, z.core.$strip>, z.ZodObject<{
291
+ name: z.ZodLiteral<"t">;
292
+ type: z.ZodLiteral<"time">;
293
+ unit: z.ZodEnum<{
294
+ attosecond: "attosecond";
295
+ centisecond: "centisecond";
296
+ day: "day";
297
+ decisecond: "decisecond";
298
+ exasecond: "exasecond";
299
+ femtosecond: "femtosecond";
300
+ gigasecond: "gigasecond";
301
+ hectosecond: "hectosecond";
302
+ hour: "hour";
303
+ kilosecond: "kilosecond";
304
+ megasecond: "megasecond";
305
+ microsecond: "microsecond";
306
+ millisecond: "millisecond";
307
+ minute: "minute";
308
+ nanosecond: "nanosecond";
309
+ petasecond: "petasecond";
310
+ picosecond: "picosecond";
311
+ second: "second";
312
+ terasecond: "terasecond";
313
+ yoctosecond: "yoctosecond";
314
+ yottasecond: "yottasecond";
315
+ zeptosecond: "zeptosecond";
316
+ zettasecond: "zettasecond";
317
+ }>;
318
+ }, z.core.$strip>]>>>>;
319
+ }, z.core.$strip>;
320
+ export type AnatomicalOrientationValues = z.infer<typeof AnatomicalOrientationValuesSchema>;
321
+ export type AnatomicalOrientation = z.infer<typeof AnatomicalOrientationSchema>;
322
+ export type Orientation = z.infer<typeof OrientationSchema>;
323
+ export type AxesNames = z.infer<typeof AxesNamesSchema>;
324
+ export type SpaceAxesNames = z.infer<typeof SpaceAxesNamesSchema>;
325
+ export type AxisType = z.infer<typeof AxisTypeSchema>;
326
+ export type SpaceUnit = z.infer<typeof SpaceUnitSchema>;
327
+ export type TimeUnit = z.infer<typeof TimeUnitSchema>;
328
+ export type BaseAxis = z.infer<typeof BaseAxisSchema>;
329
+ export type ChannelAxis = z.infer<typeof ChannelAxisSchema>;
330
+ export type SpaceAxis = z.infer<typeof SpaceAxisSchema>;
331
+ export type TimeAxis = z.infer<typeof TimeAxisSchema>;
332
+ export type Axis = z.infer<typeof AxisSchema>;
333
+ export type Axes = z.infer<typeof AxesSchema>;
334
+ //# sourceMappingURL=rfc4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rfc4.d.ts","sourceRoot":"","sources":["../../src/schemas/rfc4.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAAO,CACrD,eAAe,GACf,eAAe,GACf,uBAAuB,GACvB,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,oBAAoB,GACpB,oBAAoB,CAoBtB,CAAC;AAGH,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CAAC;IAClD,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EACD,eAAe,GACf,e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GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -0,0 +1,129 @@
1
+ // SPDX-FileCopyrightText: Copyright (c) Fideus Labs LLC
2
+ // SPDX-License-Identifier: MIT
3
+ import { z } from "zod";
4
+ // Anatomical Orientation Values based on RFC4
5
+ export const AnatomicalOrientationValuesSchema = z.enum([
6
+ "left-to-right",
7
+ "right-to-left",
8
+ "anterior-to-posterior",
9
+ "posterior-to-anterior",
10
+ "inferior-to-superior",
11
+ "superior-to-inferior",
12
+ "dorsal-to-ventral",
13
+ "ventral-to-dorsal",
14
+ "dorsal-to-palmar",
15
+ "palmar-to-dorsal",
16
+ "dorsal-to-plantar",
17
+ "plantar-to-dorsal",
18
+ "rostral-to-caudal",
19
+ "caudal-to-rostral",
20
+ "cranial-to-caudal",
21
+ "caudal-to-cranial",
22
+ "proximal-to-distal",
23
+ "distal-to-proximal",
24
+ ]);
25
+ // AnatomicalOrientation object schema
26
+ export const AnatomicalOrientationSchema = z.object({
27
+ type: z.literal("anatomical"),
28
+ value: AnatomicalOrientationValuesSchema,
29
+ });
30
+ // Base Orientation schema (extensible for future orientation types)
31
+ export const OrientationTypeSchema = z.enum(["anatomical"]);
32
+ export const OrientationSchema = z.object({
33
+ type: OrientationTypeSchema,
34
+ value: AnatomicalOrientationValuesSchema,
35
+ });
36
+ // Axes Names enum
37
+ export const AxesNamesSchema = z.enum(["t", "c", "z", "y", "x"]);
38
+ // Space Axes Names enum (subset of AxesNames for spatial dimensions)
39
+ export const SpaceAxesNamesSchema = z.enum(["z", "y", "x"]);
40
+ // Axis Type enum
41
+ export const AxisTypeSchema = z.enum(["channel", "space", "time"]);
42
+ // Space Units enum
43
+ export const SpaceUnitSchema = z.enum([
44
+ "angstrom",
45
+ "attometer",
46
+ "centimeter",
47
+ "decimeter",
48
+ "exameter",
49
+ "femtometer",
50
+ "foot",
51
+ "gigameter",
52
+ "hectometer",
53
+ "inch",
54
+ "kilometer",
55
+ "megameter",
56
+ "meter",
57
+ "micrometer",
58
+ "mile",
59
+ "millimeter",
60
+ "nanometer",
61
+ "parsec",
62
+ "petameter",
63
+ "picometer",
64
+ "terameter",
65
+ "yard",
66
+ "yoctometer",
67
+ "yottameter",
68
+ "zeptometer",
69
+ "zettameter",
70
+ ]);
71
+ // Time Units enum
72
+ export const TimeUnitSchema = z.enum([
73
+ "attosecond",
74
+ "centisecond",
75
+ "day",
76
+ "decisecond",
77
+ "exasecond",
78
+ "femtosecond",
79
+ "gigasecond",
80
+ "hectosecond",
81
+ "hour",
82
+ "kilosecond",
83
+ "megasecond",
84
+ "microsecond",
85
+ "millisecond",
86
+ "minute",
87
+ "nanosecond",
88
+ "petasecond",
89
+ "picosecond",
90
+ "second",
91
+ "terasecond",
92
+ "yoctosecond",
93
+ "yottasecond",
94
+ "zeptosecond",
95
+ "zettasecond",
96
+ ]);
97
+ // Base Axis schema
98
+ export const BaseAxisSchema = z.object({
99
+ name: z.string(),
100
+ type: AxisTypeSchema,
101
+ });
102
+ // Channel Axis schema
103
+ export const ChannelAxisSchema = z.object({
104
+ name: z.literal("c"),
105
+ type: z.literal("channel"),
106
+ });
107
+ // Space Axis schema (includes orientation)
108
+ export const SpaceAxisSchema = z.object({
109
+ name: SpaceAxesNamesSchema,
110
+ type: z.literal("space"),
111
+ unit: SpaceUnitSchema,
112
+ orientation: z.union([AnatomicalOrientationSchema, z.null()]).optional(),
113
+ });
114
+ // Time Axis schema
115
+ export const TimeAxisSchema = z.object({
116
+ name: z.literal("t"),
117
+ type: z.literal("time"),
118
+ unit: TimeUnitSchema,
119
+ });
120
+ // Union of all axis types
121
+ export const AxisSchema = z.union([
122
+ ChannelAxisSchema,
123
+ SpaceAxisSchema,
124
+ TimeAxisSchema,
125
+ ]);
126
+ // Axes collection schema
127
+ export const AxesSchema = z.object({
128
+ axes: z.array(AxisSchema).nullable().optional(),
129
+ });