@fideus-labs/ngff-zarr 0.0.1 → 0.1.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 (174) hide show
  1. package/README.md +9 -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 +25 -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 +216 -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 +273 -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 +816 -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 +644 -0
  30. package/esm/schemas/coordinate_systems.d.ts.map +1 -0
  31. package/esm/schemas/coordinate_systems.js +140 -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 +581 -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 +439 -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.map +1 -1
  49. package/esm/schemas/units.js +5 -0
  50. package/esm/schemas/zarr_metadata.d.ts +302 -9
  51. package/esm/schemas/zarr_metadata.d.ts.map +1 -1
  52. package/esm/schemas/zarr_metadata.js +22 -1
  53. package/esm/types/array_interface.d.ts +7 -0
  54. package/esm/types/array_interface.d.ts.map +1 -0
  55. package/esm/types/array_interface.js +1 -0
  56. package/esm/types/hcs.d.ts +70 -0
  57. package/esm/types/hcs.d.ts.map +1 -0
  58. package/esm/types/hcs.js +204 -0
  59. package/esm/types/methods.d.ts.map +1 -1
  60. package/esm/types/methods.js +2 -0
  61. package/esm/types/multiscales.d.ts.map +1 -1
  62. package/esm/types/ngff_image.d.ts +6 -3
  63. package/esm/types/ngff_image.d.ts.map +1 -1
  64. package/esm/types/ngff_image.js +13 -1
  65. package/esm/types/rfc4.d.ts +94 -0
  66. package/esm/types/rfc4.d.ts.map +1 -0
  67. package/esm/types/rfc4.js +135 -0
  68. package/esm/types/units.d.ts +1 -1
  69. package/esm/types/units.d.ts.map +1 -1
  70. package/esm/types/zarr_metadata.d.ts +14 -5
  71. package/esm/types/zarr_metadata.d.ts.map +1 -1
  72. package/esm/utils/create_queue.d.ts +6 -0
  73. package/esm/utils/create_queue.d.ts.map +1 -0
  74. package/esm/utils/create_queue.js +11 -0
  75. package/esm/utils/factory.d.ts +1 -1
  76. package/esm/utils/factory.d.ts.map +1 -1
  77. package/esm/utils/factory.js +16 -7
  78. package/esm/utils/method_metadata.d.ts +10 -0
  79. package/esm/utils/method_metadata.d.ts.map +1 -0
  80. package/esm/utils/method_metadata.js +37 -0
  81. package/esm/utils/validation.d.ts.map +1 -1
  82. package/package.json +7 -1
  83. package/script/io/from_ngff_zarr.d.ts +4 -1
  84. package/script/io/from_ngff_zarr.d.ts.map +1 -1
  85. package/script/io/from_ngff_zarr.js +94 -27
  86. package/script/io/hcs.d.ts +18 -0
  87. package/script/io/hcs.d.ts.map +1 -0
  88. package/script/io/hcs.js +55 -0
  89. package/script/io/itk_image_to_ngff_image.d.ts +25 -0
  90. package/script/io/itk_image_to_ngff_image.d.ts.map +1 -0
  91. package/script/io/itk_image_to_ngff_image.js +153 -0
  92. package/script/io/ngff_image_to_itk_image.d.ts +30 -0
  93. package/script/io/ngff_image_to_itk_image.d.ts.map +1 -0
  94. package/script/io/ngff_image_to_itk_image.js +242 -0
  95. package/script/io/to_multiscales.d.ts +18 -0
  96. package/script/io/to_multiscales.d.ts.map +1 -0
  97. package/script/io/to_multiscales.js +67 -0
  98. package/script/io/to_ngff_image.d.ts +17 -0
  99. package/script/io/to_ngff_image.d.ts.map +1 -0
  100. package/script/io/to_ngff_image.js +162 -0
  101. package/script/io/to_ngff_zarr.d.ts +3 -2
  102. package/script/io/to_ngff_zarr.d.ts.map +1 -1
  103. package/script/io/to_ngff_zarr.js +273 -26
  104. package/script/methods/itkwasm.d.ts +6 -0
  105. package/script/methods/itkwasm.d.ts.map +1 -0
  106. package/script/methods/itkwasm.js +842 -0
  107. package/script/mod.d.ts +9 -2
  108. package/script/mod.d.ts.map +1 -1
  109. package/script/mod.js +12 -3
  110. package/script/schemas/coordinate_systems.d.ts +644 -0
  111. package/script/schemas/coordinate_systems.d.ts.map +1 -0
  112. package/script/schemas/coordinate_systems.js +143 -0
  113. package/script/schemas/index.d.ts +9 -0
  114. package/script/schemas/index.d.ts.map +1 -0
  115. package/script/schemas/index.js +101 -0
  116. package/script/schemas/methods.d.ts.map +1 -1
  117. package/script/schemas/methods.js +2 -0
  118. package/script/schemas/multiscales.d.ts.map +1 -1
  119. package/script/schemas/multiscales.js +2 -0
  120. package/script/schemas/ngff_image.d.ts +9 -2
  121. package/script/schemas/ngff_image.d.ts.map +1 -1
  122. package/script/schemas/ngff_image.js +11 -2
  123. package/script/schemas/ome_zarr.d.ts +581 -0
  124. package/script/schemas/ome_zarr.d.ts.map +1 -0
  125. package/script/schemas/ome_zarr.js +211 -0
  126. package/script/schemas/rfc4.d.ts +439 -0
  127. package/script/schemas/rfc4.d.ts.map +1 -0
  128. package/script/schemas/rfc4.js +132 -0
  129. package/script/schemas/units.d.ts.map +1 -1
  130. package/script/schemas/units.js +5 -0
  131. package/script/schemas/zarr_metadata.d.ts +302 -9
  132. package/script/schemas/zarr_metadata.d.ts.map +1 -1
  133. package/script/schemas/zarr_metadata.js +23 -2
  134. package/script/types/array_interface.d.ts +7 -0
  135. package/script/types/array_interface.d.ts.map +1 -0
  136. package/script/types/array_interface.js +2 -0
  137. package/script/types/hcs.d.ts +70 -0
  138. package/script/types/hcs.d.ts.map +1 -0
  139. package/script/types/hcs.js +233 -0
  140. package/script/types/methods.d.ts.map +1 -1
  141. package/script/types/methods.js +2 -0
  142. package/script/types/multiscales.d.ts.map +1 -1
  143. package/script/types/ngff_image.d.ts +6 -3
  144. package/script/types/ngff_image.d.ts.map +1 -1
  145. package/script/types/ngff_image.js +13 -1
  146. package/script/types/rfc4.d.ts +94 -0
  147. package/script/types/rfc4.d.ts.map +1 -0
  148. package/script/types/rfc4.js +143 -0
  149. package/script/types/units.d.ts +1 -1
  150. package/script/types/units.d.ts.map +1 -1
  151. package/script/types/zarr_metadata.d.ts +14 -5
  152. package/script/types/zarr_metadata.d.ts.map +1 -1
  153. package/script/utils/create_queue.d.ts +6 -0
  154. package/script/utils/create_queue.d.ts.map +1 -0
  155. package/script/utils/create_queue.js +17 -0
  156. package/script/utils/factory.d.ts +1 -1
  157. package/script/utils/factory.d.ts.map +1 -1
  158. package/script/utils/factory.js +39 -7
  159. package/script/utils/method_metadata.d.ts +10 -0
  160. package/script/utils/method_metadata.d.ts.map +1 -0
  161. package/script/utils/method_metadata.js +40 -0
  162. package/script/utils/validation.d.ts.map +1 -1
  163. package/esm/schemas/lazy_array.d.ts +0 -8
  164. package/esm/schemas/lazy_array.d.ts.map +0 -1
  165. package/esm/schemas/lazy_array.js +0 -7
  166. package/esm/types/lazy_array.d.ts +0 -18
  167. package/esm/types/lazy_array.d.ts.map +0 -1
  168. package/esm/types/lazy_array.js +0 -27
  169. package/script/schemas/lazy_array.d.ts +0 -8
  170. package/script/schemas/lazy_array.d.ts.map +0 -1
  171. package/script/schemas/lazy_array.js +0 -10
  172. package/script/types/lazy_array.d.ts +0 -18
  173. package/script/types/lazy_array.d.ts.map +0 -1
  174. package/script/types/lazy_array.js +0 -31
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.HCSPlate = exports.HCSWell = exports.LRUCache = void 0;
27
+ class LRUCache {
28
+ cache;
29
+ maxSize;
30
+ constructor(options) {
31
+ this.cache = new Map();
32
+ this.maxSize = options.maxSize;
33
+ }
34
+ get(key) {
35
+ const value = this.cache.get(key);
36
+ if (value !== undefined) {
37
+ // Move to end (most recently used)
38
+ this.cache.delete(key);
39
+ this.cache.set(key, value);
40
+ }
41
+ return value;
42
+ }
43
+ set(key, value) {
44
+ if (this.cache.has(key)) {
45
+ // Update existing item
46
+ this.cache.delete(key);
47
+ }
48
+ else if (this.cache.size >= this.maxSize) {
49
+ // Remove least recently used item
50
+ const firstKey = this.cache.keys().next().value;
51
+ if (firstKey !== undefined) {
52
+ this.cache.delete(firstKey);
53
+ }
54
+ }
55
+ this.cache.set(key, value);
56
+ }
57
+ has(key) {
58
+ return this.cache.has(key);
59
+ }
60
+ clear() {
61
+ this.cache.clear();
62
+ }
63
+ }
64
+ exports.LRUCache = LRUCache;
65
+ class HCSWell {
66
+ store;
67
+ path;
68
+ plateMetadata;
69
+ metadata;
70
+ _images;
71
+ constructor(options) {
72
+ this.store = options.store;
73
+ this.path = options.wellPath;
74
+ this.plateMetadata = { ...options.plateMetadata };
75
+ this.metadata = {
76
+ images: [...options.wellGroupMetadata.images],
77
+ version: options.wellGroupMetadata.version,
78
+ };
79
+ const imageCacheSize = options.imageCacheSize ?? 100;
80
+ this._images = new LRUCache({
81
+ maxSize: imageCacheSize,
82
+ });
83
+ }
84
+ get rowIndex() {
85
+ return this.plateMetadata.rowIndex;
86
+ }
87
+ get columnIndex() {
88
+ return this.plateMetadata.columnIndex;
89
+ }
90
+ get images() {
91
+ return [...this.metadata.images];
92
+ }
93
+ async getImage(fieldIndex = 0) {
94
+ if (fieldIndex < 0 || fieldIndex >= this.metadata.images.length) {
95
+ return null;
96
+ }
97
+ const imageMeta = this.metadata.images[fieldIndex];
98
+ const imagePath = `${this.path}/${imageMeta.path}`;
99
+ // Check cache first
100
+ const cached = this._images.get(imagePath);
101
+ if (cached) {
102
+ return cached;
103
+ }
104
+ // Load the image using fromNgffZarr
105
+ const { fromNgffZarr } = await Promise.resolve().then(() => __importStar(require("../io/from_ngff_zarr.js")));
106
+ let fullImagePath;
107
+ if (typeof this.store === "string") {
108
+ // If store is a path string, append the image path
109
+ fullImagePath = `${this.store}/${this.path}/${imageMeta.path}`;
110
+ }
111
+ else {
112
+ // For other store types, we need to handle differently
113
+ // This would need to be adapted based on the specific store type
114
+ throw new Error("Non-string store types not yet implemented for HCS");
115
+ }
116
+ try {
117
+ const multiscales = await fromNgffZarr(fullImagePath);
118
+ this._images.set(imagePath, multiscales);
119
+ return multiscales;
120
+ }
121
+ catch (error) {
122
+ console.error(`Failed to load image at ${fullImagePath}:`, error);
123
+ return null;
124
+ }
125
+ }
126
+ getImageByAcquisition(acquisitionId, fieldIndex = 0) {
127
+ // Find images for the specified acquisition
128
+ const acquisitionImages = this.metadata.images.filter((img) => img.acquisition === acquisitionId);
129
+ if (fieldIndex < 0 || fieldIndex >= acquisitionImages.length) {
130
+ return Promise.resolve(null);
131
+ }
132
+ // Find the actual image index in the full list
133
+ const targetImage = acquisitionImages[fieldIndex];
134
+ const actualIndex = this.metadata.images.indexOf(targetImage);
135
+ return this.getImage(actualIndex);
136
+ }
137
+ static fromStore(store, wellPath, wellMetadata, imageCacheSize) {
138
+ // Simplified implementation - we'll improve this when implementing the IO functions
139
+ const wellGroupMetadata = {
140
+ images: [
141
+ { path: "0", acquisition: 0 },
142
+ { path: "1", acquisition: 0 },
143
+ ],
144
+ version: "0.4",
145
+ };
146
+ return new HCSWell({
147
+ store,
148
+ wellPath,
149
+ plateMetadata: wellMetadata,
150
+ wellGroupMetadata,
151
+ imageCacheSize,
152
+ });
153
+ }
154
+ }
155
+ exports.HCSWell = HCSWell;
156
+ class HCSPlate {
157
+ store;
158
+ metadata;
159
+ _wells;
160
+ imageCacheSize;
161
+ constructor(options) {
162
+ this.store = options.store;
163
+ this.metadata = {
164
+ columns: [...options.metadata.columns],
165
+ rows: [...options.metadata.rows],
166
+ wells: [...options.metadata.wells],
167
+ version: options.metadata.version,
168
+ acquisitions: options.metadata.acquisitions
169
+ ? [...options.metadata.acquisitions]
170
+ : undefined,
171
+ field_count: options.metadata.field_count,
172
+ name: options.metadata.name,
173
+ };
174
+ this.imageCacheSize = options.imageCacheSize;
175
+ const wellCacheSize = options.wellCacheSize ?? 500;
176
+ this._wells = new LRUCache({ maxSize: wellCacheSize });
177
+ }
178
+ get name() {
179
+ return this.metadata.name;
180
+ }
181
+ get rows() {
182
+ return [...this.metadata.rows];
183
+ }
184
+ get columns() {
185
+ return [...this.metadata.columns];
186
+ }
187
+ get wells() {
188
+ return [...this.metadata.wells];
189
+ }
190
+ get acquisitions() {
191
+ return this.metadata.acquisitions
192
+ ? [...this.metadata.acquisitions]
193
+ : undefined;
194
+ }
195
+ get fieldCount() {
196
+ return this.metadata.field_count;
197
+ }
198
+ getWell(rowName, columnName) {
199
+ const wellPath = `${rowName}/${columnName}`;
200
+ // Check if well exists in metadata
201
+ const wellMeta = this.metadata.wells.find((well) => well.path === wellPath);
202
+ if (!wellMeta) {
203
+ return null;
204
+ }
205
+ // Check cache first
206
+ const cached = this._wells.get(wellPath);
207
+ if (cached) {
208
+ return cached;
209
+ }
210
+ // Load the well
211
+ try {
212
+ const well = HCSWell.fromStore(this.store, wellPath, wellMeta, this.imageCacheSize);
213
+ this._wells.set(wellPath, well);
214
+ return well;
215
+ }
216
+ catch (error) {
217
+ console.error(`Failed to load well at ${wellPath}:`, error);
218
+ return null;
219
+ }
220
+ }
221
+ getWellByIndices(rowIndex, columnIndex) {
222
+ if (rowIndex < 0 ||
223
+ rowIndex >= this.metadata.rows.length ||
224
+ columnIndex < 0 ||
225
+ columnIndex >= this.metadata.columns.length) {
226
+ return null;
227
+ }
228
+ const rowName = this.metadata.rows[rowIndex].name;
229
+ const columnName = this.metadata.columns[columnIndex].name;
230
+ return this.getWell(rowName, columnName);
231
+ }
232
+ }
233
+ exports.HCSPlate = HCSPlate;
@@ -1 +1 @@
1
- {"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/types/methods.ts"],"names":[],"mappings":"AAAA,oBAAY,OAAO;IACjB,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;CAC5C;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,EAA2B,CAAC"}
1
+ {"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/types/methods.ts"],"names":[],"mappings":"AAEA,oBAAY,OAAO;IACjB,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;CAC5C;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,EAA2B,CAAC"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.methodsValues = exports.Methods = void 0;
4
+ // SPDX-FileCopyrightText: Copyright (c) Fideus Labs LLC
5
+ // SPDX-License-Identifier: MIT
4
6
  var Methods;
5
7
  (function (Methods) {
6
8
  Methods["ITKWASM_GAUSSIAN"] = "itkwasm_gaussian";
@@ -1 +1 @@
1
- {"version":3,"file":"multiscales.d.ts","sourceRoot":"","sources":["../../src/types/multiscales.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,EAAE,EAAE,GACV,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;AAElD,M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EAAE,GAAG,SAAS,CAAC;IAC9D,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;CAC/B;AAED,qBAAa,WAAW;IACtB,SAAgB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpC,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IACnC,SAAgB,YAAY,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC;IAC9E,SAAgB,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5C,SAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;gBAElC,OAAO,EAAE,kBAAkB;IAUvC,QAAQ,IAAI,MAAM;CAwBnB"}
@@ -1,22 +1,25 @@
1
- import type { LazyArray } from "./lazy_array.js";
1
+ import * as zarr from "zarrita";
2
2
  import type { Units } from "./units.js";
3
+ import type { AnatomicalOrientation } from "./rfc4.js";
3
4
  export type ComputedCallback = () => void;
4
5
  export interface NgffImageOptions {
5
- data: LazyArray;
6
+ data: zarr.Array<zarr.DataType, zarr.Readable>;
6
7
  dims: string[];
7
8
  scale: Record<string, number>;
8
9
  translation: Record<string, number>;
9
10
  name: string | undefined;
10
11
  axesUnits: Record<string, Units> | undefined;
12
+ axesOrientations?: Record<string, AnatomicalOrientation> | undefined;
11
13
  computedCallbacks: ComputedCallback[] | undefined;
12
14
  }
13
15
  export declare class NgffImage {
14
- readonly data: LazyArray;
16
+ readonly data: zarr.Array<zarr.DataType, zarr.Readable>;
15
17
  readonly dims: string[];
16
18
  readonly scale: Record<string, number>;
17
19
  readonly translation: Record<string, number>;
18
20
  readonly name: string;
19
21
  readonly axesUnits: Record<string, Units> | undefined;
22
+ readonly axesOrientations: Record<string, AnatomicalOrientation> | undefined;
20
23
  readonly computedCallbacks: ComputedCallback[];
21
24
  constructor(options: NgffImageOptions);
22
25
  toString(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"ngff_image.d.ts","sourceRoot":"","sources":["../../src/types/ngff_image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC;AAE1C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC;IAC7C,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAC;CACnD;AAED,qBAAa,SAAS;IACpB,SAAgB,IAAI,EAAE,SAAS,CAAC;IAChC,SAAgB,IAAI,EAAE,MAAM,EAAE,CAAC;IAC/B,SAAgB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,SAAgB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC;IAC7D,SAAgB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;gBAE1C,OAAO,EAAE,gBAAgB;IAUrC,QAAQ,IAAI,MAAM;CAcnB"}
1
+ {"version":3,"file":"ngff_image.d.ts","sourceRoot":"","sources":["../../src/types/ngff_image.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EA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AE,CAAC;gBAE1C,OAAO,EAAE,gBAAgB;IAarC,QAAQ,IAAI,MAAM;CA8BnB"}
@@ -8,6 +8,7 @@ class NgffImage {
8
8
  translation;
9
9
  name;
10
10
  axesUnits;
11
+ axesOrientations;
11
12
  computedCallbacks;
12
13
  constructor(options) {
13
14
  this.data = options.data;
@@ -16,19 +17,30 @@ class NgffImage {
16
17
  this.translation = { ...options.translation };
17
18
  this.name = options.name ?? "image";
18
19
  this.axesUnits = options.axesUnits ? { ...options.axesUnits } : undefined;
20
+ this.axesOrientations = options.axesOrientations
21
+ ? { ...options.axesOrientations }
22
+ : undefined;
19
23
  this.computedCallbacks = [...(options.computedCallbacks ?? [])];
20
24
  }
21
25
  toString() {
22
26
  const axesUnitsStr = this.axesUnits
23
27
  ? JSON.stringify(this.axesUnits)
24
28
  : "None";
29
+ const axesOrientationsStr = this.axesOrientations
30
+ ? JSON.stringify(this.axesOrientations)
31
+ : "None";
32
+ // Create array string representation using zarr.Array properties
33
+ const path = this.data.path || this.name;
34
+ const chunks = this.data.chunks.join(", ");
35
+ const arrayStr = `Array(name=${path}, shape=(${this.data.shape.join(", ")}), dtype=${this.data.dtype}, chunksize=(${chunks}), chunktype=TypedArray)`;
25
36
  return `NgffImage(
26
- data=${this.data.toString()},
37
+ data=${arrayStr},
27
38
  dims=[${this.dims.map((d) => `'${d}'`).join(", ")}],
28
39
  scale=${JSON.stringify(this.scale)},
29
40
  translation=${JSON.stringify(this.translation)},
30
41
  name='${this.name}',
31
42
  axes_units=${axesUnitsStr},
43
+ axes_orientations=${axesOrientationsStr},
32
44
  computed_callbacks=[${this.computedCallbacks.length} callbacks]
33
45
  )`;
34
46
  }
@@ -0,0 +1,94 @@
1
+ /**
2
+ * RFC 4 implementation for anatomical orientation in OME-NGFF.
3
+ *
4
+ * This module implements RFC 4 which adds anatomical orientation support
5
+ * to OME-NGFF axes, based on the LinkML schema.
6
+ */
7
+ /**
8
+ * Anatomical orientation refers to the specific arrangement and directional
9
+ * alignment of anatomical structures within an imaging dataset. It is crucial
10
+ * for ensuring accurate alignment and comparison of images to anatomical atlases,
11
+ * facilitating consistent analysis and interpretation of biological data.
12
+ */
13
+ export declare enum AnatomicalOrientationValues {
14
+ LeftToRight = "left-to-right",
15
+ RightToLeft = "right-to-left",
16
+ AnteriorToPosterior = "anterior-to-posterior",
17
+ PosteriorToAnterior = "posterior-to-anterior",
18
+ InferiorToSuperior = "inferior-to-superior",
19
+ SuperiorToInferior = "superior-to-inferior",
20
+ DorsalToVentral = "dorsal-to-ventral",
21
+ VentralToDorsal = "ventral-to-dorsal",
22
+ DorsalToPalmar = "dorsal-to-palmar",
23
+ PalmarToDorsal = "palmar-to-dorsal",
24
+ DorsalToPlantar = "dorsal-to-plantar",
25
+ PlantarToDorsal = "plantar-to-dorsal",
26
+ RostralToCaudal = "rostral-to-caudal",
27
+ CaudalToRostral = "caudal-to-rostral",
28
+ CranialToCaudal = "cranial-to-caudal",
29
+ CaudalToCranial = "caudal-to-cranial",
30
+ ProximalToDistal = "proximal-to-distal",
31
+ DistalToProximal = "distal-to-proximal"
32
+ }
33
+ /**
34
+ * Anatomical orientation specification for spatial axes.
35
+ */
36
+ export interface AnatomicalOrientation {
37
+ readonly type: "anatomical";
38
+ readonly value: AnatomicalOrientationValues;
39
+ }
40
+ /**
41
+ * Create an anatomical orientation object.
42
+ */
43
+ export declare function createAnatomicalOrientation(value: AnatomicalOrientationValues): AnatomicalOrientation;
44
+ /**
45
+ * LPS (Left-Posterior-Superior) coordinate system orientations.
46
+ * In LPS, the axes increase from:
47
+ * - X: right-to-left (L = Left)
48
+ * - Y: anterior-to-posterior (P = Posterior)
49
+ * - Z: inferior-to-superior (S = Superior)
50
+ * This is the standard coordinate system used by ITK and many medical imaging applications.
51
+ */
52
+ export declare const LPS: Record<string, AnatomicalOrientation>;
53
+ /**
54
+ * RAS (Right-Anterior-Superior) coordinate system orientations.
55
+ * In RAS, the axes increase from:
56
+ * - X: left-to-right (R = Right)
57
+ * - Y: posterior-to-anterior (A = Anterior)
58
+ * - Z: inferior-to-superior (S = Superior)
59
+ * This coordinate system is commonly used in neuroimaging applications like FreeSurfer and FSL.
60
+ */
61
+ export declare const RAS: Record<string, AnatomicalOrientation>;
62
+ /**
63
+ * Convert ITK LPS coordinate system to anatomical orientation.
64
+ *
65
+ * ITK uses the LPS (Left-Posterior-Superior) coordinate system by default.
66
+ * In LPS, the axes increase from:
67
+ * - X: right-to-left (L = Left)
68
+ * - Y: anterior-to-posterior (P = Posterior)
69
+ * - Z: inferior-to-superior (S = Superior)
70
+ *
71
+ * @param axisName - The axis name ('x', 'y', or 'z')
72
+ * @returns The corresponding anatomical orientation, or undefined for non-spatial axes
73
+ */
74
+ export declare function itkLpsToAnatomicalOrientation(axisName: string): AnatomicalOrientation | undefined;
75
+ /**
76
+ * Check if RFC 4 is enabled in the list of enabled RFCs.
77
+ */
78
+ export declare function isRfc4Enabled(enabledRfcs?: number[]): boolean;
79
+ /**
80
+ * Add anatomical orientation to an axis object.
81
+ *
82
+ * @param axisDict - The axis object to modify
83
+ * @param orientation - The anatomical orientation to add
84
+ * @returns The modified axis object
85
+ */
86
+ export declare function addAnatomicalOrientationToAxis(axisDict: Record<string, unknown>, orientation: AnatomicalOrientation): Record<string, unknown>;
87
+ /**
88
+ * Remove anatomical orientation from an axis object.
89
+ *
90
+ * @param axisDict - The axis object to modify
91
+ * @returns The modified axis object
92
+ */
93
+ export declare function removeAnatomicalOrientationFromAxis(axisDict: Record<string, unknown>): Record<string, unknown>;
94
+ //# sourceMappingURL=rfc4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rfc4.d.ts","sourceRoot":"","sources":["../../src/types/rfc4.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH;;;;;GAKG;AACH,oBAAY,2BAA2B;IAErC,WAAW,kBAAkB;IAE7B,WAAW,kBAAkB;IAE7B,mBAAmB,0BAA0B;IAE7C,mBAAmB,0BAA0B;IAE7C,kBAAkB,yBAAyB;IAE3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-FileCopyrightText: Copyright (c) Fideus Labs LLC
3
+ // SPDX-License-Identifier: MIT
4
+ /**
5
+ * RFC 4 implementation for anatomical orientation in OME-NGFF.
6
+ *
7
+ * This module implements RFC 4 which adds anatomical orientation support
8
+ * to OME-NGFF axes, based on the LinkML schema.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.RAS = exports.LPS = exports.AnatomicalOrientationValues = void 0;
12
+ exports.createAnatomicalOrientation = createAnatomicalOrientation;
13
+ exports.itkLpsToAnatomicalOrientation = itkLpsToAnatomicalOrientation;
14
+ exports.isRfc4Enabled = isRfc4Enabled;
15
+ exports.addAnatomicalOrientationToAxis = addAnatomicalOrientationToAxis;
16
+ exports.removeAnatomicalOrientationFromAxis = removeAnatomicalOrientationFromAxis;
17
+ /**
18
+ * Anatomical orientation refers to the specific arrangement and directional
19
+ * alignment of anatomical structures within an imaging dataset. It is crucial
20
+ * for ensuring accurate alignment and comparison of images to anatomical atlases,
21
+ * facilitating consistent analysis and interpretation of biological data.
22
+ */
23
+ var AnatomicalOrientationValues;
24
+ (function (AnatomicalOrientationValues) {
25
+ // Describes the directional orientation from the left side to the right lateral side of an anatomical structure or body
26
+ AnatomicalOrientationValues["LeftToRight"] = "left-to-right";
27
+ // Describes the directional orientation from the right side to the left lateral side of an anatomical structure or body
28
+ AnatomicalOrientationValues["RightToLeft"] = "right-to-left";
29
+ // Describes the directional orientation from the front (anterior) to the back (posterior) of an anatomical structure or body
30
+ AnatomicalOrientationValues["AnteriorToPosterior"] = "anterior-to-posterior";
31
+ // Describes the directional orientation from the back (posterior) to the front (anterior) of an anatomical structure or body
32
+ AnatomicalOrientationValues["PosteriorToAnterior"] = "posterior-to-anterior";
33
+ // Describes the directional orientation from below (inferior) to above (superior) in an anatomical structure or body
34
+ AnatomicalOrientationValues["InferiorToSuperior"] = "inferior-to-superior";
35
+ // Describes the directional orientation from above (superior) to below (inferior) in an anatomical structure or body
36
+ AnatomicalOrientationValues["SuperiorToInferior"] = "superior-to-inferior";
37
+ // Describes the directional orientation from the top/upper (dorsal) to the belly/lower (ventral) in an anatomical structure or body
38
+ AnatomicalOrientationValues["DorsalToVentral"] = "dorsal-to-ventral";
39
+ // Describes the directional orientation from the belly/lower (ventral) to the top/upper (dorsal) in an anatomical structure or body
40
+ AnatomicalOrientationValues["VentralToDorsal"] = "ventral-to-dorsal";
41
+ // Describes the directional orientation from the top/upper (dorsal) to the palm of the hand (palmar) in a body
42
+ AnatomicalOrientationValues["DorsalToPalmar"] = "dorsal-to-palmar";
43
+ // Describes the directional orientation from the palm of the hand (palmar) to the top/upper (dorsal) in a body
44
+ AnatomicalOrientationValues["PalmarToDorsal"] = "palmar-to-dorsal";
45
+ // Describes the directional orientation from the top/upper (dorsal) to the sole of the foot (plantar) in a body
46
+ AnatomicalOrientationValues["DorsalToPlantar"] = "dorsal-to-plantar";
47
+ // Describes the directional orientation from the sole of the foot (plantar) to the top/upper (dorsal) in a body
48
+ AnatomicalOrientationValues["PlantarToDorsal"] = "plantar-to-dorsal";
49
+ // Describes the directional orientation from the nasal (rostral) to the tail (caudal) end of an anatomical structure, typically used in reference to the central nervous system
50
+ AnatomicalOrientationValues["RostralToCaudal"] = "rostral-to-caudal";
51
+ // Describes the directional orientation from the tail (caudal) to the nasal (rostral) end of an anatomical structure, typically used in reference to the central nervous system
52
+ AnatomicalOrientationValues["CaudalToRostral"] = "caudal-to-rostral";
53
+ // Describes the directional orientation from the head (cranial) to the tail (caudal) end of an anatomical structure or body
54
+ AnatomicalOrientationValues["CranialToCaudal"] = "cranial-to-caudal";
55
+ // Describes the directional orientation from the tail (caudal) to the head (cranial) end of an anatomical structure or body
56
+ AnatomicalOrientationValues["CaudalToCranial"] = "caudal-to-cranial";
57
+ // Describes the directional orientation from the center of the body to the periphery of an anatomical structure or limb
58
+ AnatomicalOrientationValues["ProximalToDistal"] = "proximal-to-distal";
59
+ // Describes the directional orientation from the periphery of an anatomical structure or limb to the center of the body
60
+ AnatomicalOrientationValues["DistalToProximal"] = "distal-to-proximal";
61
+ })(AnatomicalOrientationValues || (exports.AnatomicalOrientationValues = AnatomicalOrientationValues = {}));
62
+ /**
63
+ * Create an anatomical orientation object.
64
+ */
65
+ function createAnatomicalOrientation(value) {
66
+ return {
67
+ type: "anatomical",
68
+ value,
69
+ };
70
+ }
71
+ /**
72
+ * LPS (Left-Posterior-Superior) coordinate system orientations.
73
+ * In LPS, the axes increase from:
74
+ * - X: right-to-left (L = Left)
75
+ * - Y: anterior-to-posterior (P = Posterior)
76
+ * - Z: inferior-to-superior (S = Superior)
77
+ * This is the standard coordinate system used by ITK and many medical imaging applications.
78
+ */
79
+ exports.LPS = {
80
+ x: createAnatomicalOrientation(AnatomicalOrientationValues.RightToLeft),
81
+ y: createAnatomicalOrientation(AnatomicalOrientationValues.AnteriorToPosterior),
82
+ z: createAnatomicalOrientation(AnatomicalOrientationValues.InferiorToSuperior),
83
+ };
84
+ /**
85
+ * RAS (Right-Anterior-Superior) coordinate system orientations.
86
+ * In RAS, the axes increase from:
87
+ * - X: left-to-right (R = Right)
88
+ * - Y: posterior-to-anterior (A = Anterior)
89
+ * - Z: inferior-to-superior (S = Superior)
90
+ * This coordinate system is commonly used in neuroimaging applications like FreeSurfer and FSL.
91
+ */
92
+ exports.RAS = {
93
+ x: createAnatomicalOrientation(AnatomicalOrientationValues.LeftToRight),
94
+ y: createAnatomicalOrientation(AnatomicalOrientationValues.PosteriorToAnterior),
95
+ z: createAnatomicalOrientation(AnatomicalOrientationValues.InferiorToSuperior),
96
+ };
97
+ /**
98
+ * Convert ITK LPS coordinate system to anatomical orientation.
99
+ *
100
+ * ITK uses the LPS (Left-Posterior-Superior) coordinate system by default.
101
+ * In LPS, the axes increase from:
102
+ * - X: right-to-left (L = Left)
103
+ * - Y: anterior-to-posterior (P = Posterior)
104
+ * - Z: inferior-to-superior (S = Superior)
105
+ *
106
+ * @param axisName - The axis name ('x', 'y', or 'z')
107
+ * @returns The corresponding anatomical orientation, or undefined for non-spatial axes
108
+ */
109
+ function itkLpsToAnatomicalOrientation(axisName) {
110
+ return exports.LPS[axisName];
111
+ }
112
+ /**
113
+ * Check if RFC 4 is enabled in the list of enabled RFCs.
114
+ */
115
+ function isRfc4Enabled(enabledRfcs) {
116
+ return enabledRfcs !== undefined && enabledRfcs.includes(4);
117
+ }
118
+ /**
119
+ * Add anatomical orientation to an axis object.
120
+ *
121
+ * @param axisDict - The axis object to modify
122
+ * @param orientation - The anatomical orientation to add
123
+ * @returns The modified axis object
124
+ */
125
+ function addAnatomicalOrientationToAxis(axisDict, orientation) {
126
+ return {
127
+ ...axisDict,
128
+ orientation: {
129
+ type: orientation.type,
130
+ value: orientation.value,
131
+ },
132
+ };
133
+ }
134
+ /**
135
+ * Remove anatomical orientation from an axis object.
136
+ *
137
+ * @param axisDict - The axis object to modify
138
+ * @returns The modified axis object
139
+ */
140
+ function removeAnatomicalOrientationFromAxis(axisDict) {
141
+ const { orientation: _orientation, ...rest } = axisDict;
142
+ return rest;
143
+ }
@@ -1,6 +1,6 @@
1
1
  export type SupportedDims = "c" | "x" | "y" | "z" | "t";
2
2
  export type SpatialDims = "x" | "y" | "z";
3
- export type AxesType = "time" | "space" | "channel";
3
+ export type AxesType = "time" | "space" | "channel" | "array" | "coordinate" | "displacement";
4
4
  export type SpaceUnits = "angstrom" | "attometer" | "centimeter" | "decimeter" | "exameter" | "femtometer" | "foot" | "gigameter" | "hectometer" | "inch" | "kilometer" | "megameter" | "meter" | "micrometer" | "mile" | "millimeter" | "nanometer" | "parsec" | "petameter" | "picometer" | "terameter" | "yard" | "yoctometer" | "yottameter" | "zeptometer" | "zettameter";
5
5
  export type TimeUnits = "attosecond" | "centisecond" | "day" | "decisecond" | "exasecond" | "femtosecond" | "gigasecond" | "hectosecond" | "hour" | "kilosecond" | "megasecond" | "microsecond" | "millisecond" | "minute" | "nanosecond" | "petasecond" | "picosecond" | "second" | "terasecond" | "yoctosecond" | "yottasecond" | "zeptosecond" | "zettasecond";
6
6
  export type Units =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BAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,aAAa,CAEtE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,KAAK,CAK3D"}
@@ -21,18 +21,25 @@ export interface Dataset {
21
21
  coordinateTransformations: Transform[];
22
22
  }
23
23
  export interface OmeroWindow {
24
- min: number;
25
- max: number;
26
- start: number;
27
- end: number;
24
+ min?: number;
25
+ max?: number;
26
+ start?: number;
27
+ end?: number;
28
28
  }
29
29
  export interface OmeroChannel {
30
30
  color: string;
31
31
  window: OmeroWindow;
32
- label: string | undefined;
32
+ label?: string;
33
+ active?: boolean;
33
34
  }
34
35
  export interface Omero {
35
36
  channels: OmeroChannel[];
37
+ version?: string;
38
+ }
39
+ export interface MethodMetadata {
40
+ description: string;
41
+ method: string;
42
+ version: string;
36
43
  }
37
44
  export interface Metadata {
38
45
  axes: Axis[];
@@ -41,6 +48,8 @@ export interface Metadata {
41
48
  omero: Omero | undefined;
42
49
  name: string;
43
50
  version: string;
51
+ type?: string;
52
+ metadata?: MethodMetadata;
44
53
  }
45
54
  export declare function validateColor(color: string): void;
46
55
  export declare function createScale(scale: number[]): Scale;
@@ -1 +1 @@
1
- {"version":3,"file":"zarr_metadata.d.ts","sourceRoot":"","sources":["../../src/types/zarr_metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,WA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AAC;IACnD,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAIjD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAElD;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,WAAW,CAEpE;AAED,wBAAgB,cAAc,IAAI,QAAQ,CAEzC"}
@@ -0,0 +1,6 @@
1
+ export type ChunkQueue = {
2
+ add(fn: () => Promise<void>): void;
3
+ onIdle(): Promise<void>;
4
+ };
5
+ export declare function createQueue(): ChunkQueue;
6
+ //# sourceMappingURL=create_queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create_queue.d.ts","sourceRoot":"","sources":["../../src/utils/create_queue.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACnC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB,CAAC;AAEF,wBAAgB,WAAW,IAAI,UAAU,CAOxC"}