@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.
- package/README.md +10 -2
- package/esm/io/from_ngff_zarr.d.ts +4 -1
- package/esm/io/from_ngff_zarr.d.ts.map +1 -1
- package/esm/io/from_ngff_zarr.js +94 -27
- package/esm/io/hcs.d.ts +18 -0
- package/esm/io/hcs.d.ts.map +1 -0
- package/esm/io/hcs.js +51 -0
- package/esm/io/itk_image_to_ngff_image.d.ts +30 -0
- package/esm/io/itk_image_to_ngff_image.d.ts.map +1 -0
- package/esm/io/itk_image_to_ngff_image.js +127 -0
- package/esm/io/ngff_image_to_itk_image.d.ts +30 -0
- package/esm/io/ngff_image_to_itk_image.d.ts.map +1 -0
- package/esm/io/ngff_image_to_itk_image.js +218 -0
- package/esm/io/to_multiscales.d.ts +18 -0
- package/esm/io/to_multiscales.d.ts.map +1 -0
- package/esm/io/to_multiscales.js +62 -0
- package/esm/io/to_ngff_image.d.ts +17 -0
- package/esm/io/to_ngff_image.d.ts.map +1 -0
- package/esm/io/to_ngff_image.js +136 -0
- package/esm/io/to_ngff_zarr.d.ts +3 -2
- package/esm/io/to_ngff_zarr.d.ts.map +1 -1
- package/esm/io/to_ngff_zarr.js +289 -26
- package/esm/methods/itkwasm.d.ts +6 -0
- package/esm/methods/itkwasm.d.ts.map +1 -0
- package/esm/methods/itkwasm.js +958 -0
- package/esm/mod.d.ts +9 -2
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +10 -2
- package/esm/schemas/coordinate_systems.d.ts +251 -0
- package/esm/schemas/coordinate_systems.d.ts.map +1 -0
- package/esm/schemas/coordinate_systems.js +139 -0
- package/esm/schemas/index.d.ts +9 -0
- package/esm/schemas/index.d.ts.map +1 -0
- package/esm/schemas/index.js +38 -0
- package/esm/schemas/methods.d.ts.map +1 -1
- package/esm/schemas/methods.js +2 -0
- package/esm/schemas/multiscales.d.ts.map +1 -1
- package/esm/schemas/multiscales.js +2 -0
- package/esm/schemas/ngff_image.d.ts +9 -2
- package/esm/schemas/ngff_image.d.ts.map +1 -1
- package/esm/schemas/ngff_image.js +11 -2
- package/esm/schemas/ome_zarr.d.ts +617 -0
- package/esm/schemas/ome_zarr.d.ts.map +1 -0
- package/esm/schemas/ome_zarr.js +208 -0
- package/esm/schemas/rfc4.d.ts +334 -0
- package/esm/schemas/rfc4.d.ts.map +1 -0
- package/esm/schemas/rfc4.js +129 -0
- package/esm/schemas/units.d.ts +70 -5
- package/esm/schemas/units.d.ts.map +1 -1
- package/esm/schemas/units.js +4 -12
- package/esm/schemas/zarr_metadata.d.ts +10 -4
- package/esm/schemas/zarr_metadata.d.ts.map +1 -1
- package/esm/schemas/zarr_metadata.js +22 -1
- package/esm/types/array_interface.d.ts +7 -0
- package/esm/types/array_interface.d.ts.map +1 -0
- package/esm/types/array_interface.js +1 -0
- package/esm/types/hcs.d.ts +70 -0
- package/esm/types/hcs.d.ts.map +1 -0
- package/esm/types/hcs.js +204 -0
- package/esm/types/methods.d.ts.map +1 -1
- package/esm/types/methods.js +2 -0
- package/esm/types/multiscales.d.ts.map +1 -1
- package/esm/types/ngff_image.d.ts +6 -3
- package/esm/types/ngff_image.d.ts.map +1 -1
- package/esm/types/ngff_image.js +13 -1
- package/esm/types/rfc4.d.ts +94 -0
- package/esm/types/rfc4.d.ts.map +1 -0
- package/esm/types/rfc4.js +135 -0
- package/esm/types/units.d.ts +1 -1
- package/esm/types/units.d.ts.map +1 -1
- package/esm/types/zarr_metadata.d.ts +14 -5
- package/esm/types/zarr_metadata.d.ts.map +1 -1
- package/esm/utils/create_queue.d.ts +6 -0
- package/esm/utils/create_queue.d.ts.map +1 -0
- package/esm/utils/create_queue.js +11 -0
- package/esm/utils/factory.d.ts +1 -1
- package/esm/utils/factory.d.ts.map +1 -1
- package/esm/utils/factory.js +16 -7
- package/esm/utils/method_metadata.d.ts +10 -0
- package/esm/utils/method_metadata.d.ts.map +1 -0
- package/esm/utils/method_metadata.js +37 -0
- package/esm/utils/validation.d.ts.map +1 -1
- package/package.json +7 -1
- package/script/io/from_ngff_zarr.d.ts +4 -1
- package/script/io/from_ngff_zarr.d.ts.map +1 -1
- package/script/io/from_ngff_zarr.js +94 -27
- package/script/io/hcs.d.ts +18 -0
- package/script/io/hcs.d.ts.map +1 -0
- package/script/io/hcs.js +55 -0
- package/script/io/itk_image_to_ngff_image.d.ts +30 -0
- package/script/io/itk_image_to_ngff_image.d.ts.map +1 -0
- package/script/io/itk_image_to_ngff_image.js +153 -0
- package/script/io/ngff_image_to_itk_image.d.ts +30 -0
- package/script/io/ngff_image_to_itk_image.d.ts.map +1 -0
- package/script/io/ngff_image_to_itk_image.js +244 -0
- package/script/io/to_multiscales.d.ts +18 -0
- package/script/io/to_multiscales.d.ts.map +1 -0
- package/script/io/to_multiscales.js +67 -0
- package/script/io/to_ngff_image.d.ts +17 -0
- package/script/io/to_ngff_image.d.ts.map +1 -0
- package/script/io/to_ngff_image.js +162 -0
- package/script/io/to_ngff_zarr.d.ts +3 -2
- package/script/io/to_ngff_zarr.d.ts.map +1 -1
- package/script/io/to_ngff_zarr.js +289 -26
- package/script/methods/itkwasm.d.ts +6 -0
- package/script/methods/itkwasm.d.ts.map +1 -0
- package/script/methods/itkwasm.js +984 -0
- package/script/mod.d.ts +9 -2
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +12 -3
- package/script/schemas/coordinate_systems.d.ts +251 -0
- package/script/schemas/coordinate_systems.d.ts.map +1 -0
- package/script/schemas/coordinate_systems.js +142 -0
- package/script/schemas/index.d.ts +9 -0
- package/script/schemas/index.d.ts.map +1 -0
- package/script/schemas/index.js +101 -0
- package/script/schemas/methods.d.ts.map +1 -1
- package/script/schemas/methods.js +2 -0
- package/script/schemas/multiscales.d.ts.map +1 -1
- package/script/schemas/multiscales.js +2 -0
- package/script/schemas/ngff_image.d.ts +9 -2
- package/script/schemas/ngff_image.d.ts.map +1 -1
- package/script/schemas/ngff_image.js +11 -2
- package/script/schemas/ome_zarr.d.ts +617 -0
- package/script/schemas/ome_zarr.d.ts.map +1 -0
- package/script/schemas/ome_zarr.js +211 -0
- package/script/schemas/rfc4.d.ts +334 -0
- package/script/schemas/rfc4.d.ts.map +1 -0
- package/script/schemas/rfc4.js +132 -0
- package/script/schemas/units.d.ts +70 -5
- package/script/schemas/units.d.ts.map +1 -1
- package/script/schemas/units.js +4 -12
- package/script/schemas/zarr_metadata.d.ts +10 -4
- package/script/schemas/zarr_metadata.d.ts.map +1 -1
- package/script/schemas/zarr_metadata.js +23 -2
- package/script/types/array_interface.d.ts +7 -0
- package/script/types/array_interface.d.ts.map +1 -0
- package/script/types/array_interface.js +2 -0
- package/script/types/hcs.d.ts +70 -0
- package/script/types/hcs.d.ts.map +1 -0
- package/script/types/hcs.js +233 -0
- package/script/types/methods.d.ts.map +1 -1
- package/script/types/methods.js +2 -0
- package/script/types/multiscales.d.ts.map +1 -1
- package/script/types/ngff_image.d.ts +6 -3
- package/script/types/ngff_image.d.ts.map +1 -1
- package/script/types/ngff_image.js +13 -1
- package/script/types/rfc4.d.ts +94 -0
- package/script/types/rfc4.d.ts.map +1 -0
- package/script/types/rfc4.js +143 -0
- package/script/types/units.d.ts +1 -1
- package/script/types/units.d.ts.map +1 -1
- package/script/types/zarr_metadata.d.ts +14 -5
- package/script/types/zarr_metadata.d.ts.map +1 -1
- package/script/utils/create_queue.d.ts +6 -0
- package/script/utils/create_queue.d.ts.map +1 -0
- package/script/utils/create_queue.js +17 -0
- package/script/utils/factory.d.ts +1 -1
- package/script/utils/factory.d.ts.map +1 -1
- package/script/utils/factory.js +39 -7
- package/script/utils/method_metadata.d.ts +10 -0
- package/script/utils/method_metadata.d.ts.map +1 -0
- package/script/utils/method_metadata.js +40 -0
- package/script/utils/validation.d.ts.map +1 -1
- package/esm/schemas/lazy_array.d.ts +0 -8
- package/esm/schemas/lazy_array.d.ts.map +0 -1
- package/esm/schemas/lazy_array.js +0 -7
- package/esm/types/lazy_array.d.ts +0 -18
- package/esm/types/lazy_array.d.ts.map +0 -1
- package/esm/types/lazy_array.js +0 -27
- package/script/schemas/lazy_array.d.ts +0 -8
- package/script/schemas/lazy_array.d.ts.map +0 -1
- package/script/schemas/lazy_array.js +0 -10
- package/script/types/lazy_array.d.ts +0 -18
- package/script/types/lazy_array.d.ts.map +0 -1
- package/script/types/lazy_array.js +0 -31
package/esm/schemas/units.d.ts
CHANGED
|
@@ -1,9 +1,74 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const SupportedDimsSchema: z.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export declare const SupportedDimsSchema: z.ZodEnum<{
|
|
3
|
+
c: "c";
|
|
4
|
+
x: "x";
|
|
5
|
+
y: "y";
|
|
6
|
+
z: "z";
|
|
7
|
+
t: "t";
|
|
8
|
+
}>;
|
|
9
|
+
export declare const SpatialDimsSchema: z.ZodEnum<{
|
|
10
|
+
x: "x";
|
|
11
|
+
y: "y";
|
|
12
|
+
z: "z";
|
|
13
|
+
}>;
|
|
14
|
+
export declare const AxesTypeSchema: z.ZodEnum<{
|
|
15
|
+
time: "time";
|
|
16
|
+
space: "space";
|
|
17
|
+
channel: "channel";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const SpaceUnitsSchema: z.ZodEnum<{
|
|
20
|
+
angstrom: "angstrom";
|
|
21
|
+
attometer: "attometer";
|
|
22
|
+
centimeter: "centimeter";
|
|
23
|
+
decimeter: "decimeter";
|
|
24
|
+
exameter: "exameter";
|
|
25
|
+
femtometer: "femtometer";
|
|
26
|
+
foot: "foot";
|
|
27
|
+
gigameter: "gigameter";
|
|
28
|
+
hectometer: "hectometer";
|
|
29
|
+
inch: "inch";
|
|
30
|
+
kilometer: "kilometer";
|
|
31
|
+
megameter: "megameter";
|
|
32
|
+
meter: "meter";
|
|
33
|
+
micrometer: "micrometer";
|
|
34
|
+
mile: "mile";
|
|
35
|
+
millimeter: "millimeter";
|
|
36
|
+
nanometer: "nanometer";
|
|
37
|
+
parsec: "parsec";
|
|
38
|
+
petameter: "petameter";
|
|
39
|
+
picometer: "picometer";
|
|
40
|
+
terameter: "terameter";
|
|
41
|
+
yard: "yard";
|
|
42
|
+
yoctometer: "yoctometer";
|
|
43
|
+
yottameter: "yottameter";
|
|
44
|
+
zeptometer: "zeptometer";
|
|
45
|
+
zettameter: "zettameter";
|
|
46
|
+
}>;
|
|
47
|
+
export declare const TimeUnitsSchema: z.ZodEnum<{
|
|
48
|
+
attosecond: "attosecond";
|
|
49
|
+
centisecond: "centisecond";
|
|
50
|
+
day: "day";
|
|
51
|
+
decisecond: "decisecond";
|
|
52
|
+
exasecond: "exasecond";
|
|
53
|
+
femtosecond: "femtosecond";
|
|
54
|
+
gigasecond: "gigasecond";
|
|
55
|
+
hectosecond: "hectosecond";
|
|
56
|
+
hour: "hour";
|
|
57
|
+
kilosecond: "kilosecond";
|
|
58
|
+
megasecond: "megasecond";
|
|
59
|
+
microsecond: "microsecond";
|
|
60
|
+
millisecond: "millisecond";
|
|
61
|
+
minute: "minute";
|
|
62
|
+
nanosecond: "nanosecond";
|
|
63
|
+
petasecond: "petasecond";
|
|
64
|
+
picosecond: "picosecond";
|
|
65
|
+
second: "second";
|
|
66
|
+
terasecond: "terasecond";
|
|
67
|
+
yoctosecond: "yoctosecond";
|
|
68
|
+
yottasecond: "yottasecond";
|
|
69
|
+
zeptosecond: "zeptosecond";
|
|
70
|
+
zettasecond: "zettasecond";
|
|
71
|
+
}>;
|
|
7
72
|
export declare const UnitsSchema: z.ZodUnion<[
|
|
8
73
|
typeof SpaceUnitsSchema,
|
|
9
74
|
typeof TimeUnitsSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/schemas/units.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/schemas/units.ts"],"names":[],"mappings":"AA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schemas/units.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) Fideus Labs LLC
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
1
3
|
import { z } from "zod";
|
|
2
4
|
import { spaceUnits, supportedDims, timeUnits, } from "../types/units.js";
|
|
3
|
-
export const SupportedDimsSchema = z.enum([
|
|
4
|
-
"c",
|
|
5
|
-
"x",
|
|
6
|
-
"y",
|
|
7
|
-
"z",
|
|
8
|
-
"t",
|
|
9
|
-
]);
|
|
5
|
+
export const SupportedDimsSchema = z.enum(["c", "x", "y", "z", "t"]);
|
|
10
6
|
export const SpatialDimsSchema = z.enum(["x", "y", "z"]);
|
|
11
|
-
export const AxesTypeSchema = z.enum([
|
|
12
|
-
"time",
|
|
13
|
-
"space",
|
|
14
|
-
"channel",
|
|
15
|
-
]);
|
|
7
|
+
export const AxesTypeSchema = z.enum(["time", "space", "channel"]);
|
|
16
8
|
export const SpaceUnitsSchema = z.enum([
|
|
17
9
|
"angstrom",
|
|
18
10
|
"attometer",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AxesTypeSchema, SupportedDimsSchema, UnitsSchema } from "./units.js";
|
|
3
|
+
import { AnatomicalOrientationSchema } from "./rfc4.js";
|
|
3
4
|
export declare const AxisSchema: z.ZodObject<{
|
|
4
5
|
name: typeof SupportedDimsSchema;
|
|
5
6
|
type: typeof AxesTypeSchema;
|
|
6
7
|
unit: z.ZodOptional<typeof UnitsSchema>;
|
|
8
|
+
orientation: z.ZodOptional<typeof AnatomicalOrientationSchema>;
|
|
7
9
|
}>;
|
|
8
10
|
export declare const IdentitySchema: z.ZodObject<{
|
|
9
11
|
type: z.ZodLiteral<"identity">;
|
|
@@ -16,10 +18,7 @@ export declare const TranslationSchema: z.ZodObject<{
|
|
|
16
18
|
translation: z.ZodArray<z.ZodNumber>;
|
|
17
19
|
type: z.ZodLiteral<"translation">;
|
|
18
20
|
}>;
|
|
19
|
-
export declare const TransformSchema: z.
|
|
20
|
-
typeof ScaleSchema,
|
|
21
|
-
typeof TranslationSchema
|
|
22
|
-
]>;
|
|
21
|
+
export declare const TransformSchema: z.ZodType<unknown>;
|
|
23
22
|
export declare const DatasetSchema: z.ZodObject<{
|
|
24
23
|
path: z.ZodString;
|
|
25
24
|
coordinateTransformations: z.ZodArray<typeof TransformSchema>;
|
|
@@ -38,6 +37,11 @@ export declare const OmeroChannelSchema: z.ZodObject<{
|
|
|
38
37
|
export declare const OmeroSchema: z.ZodObject<{
|
|
39
38
|
channels: z.ZodArray<typeof OmeroChannelSchema>;
|
|
40
39
|
}>;
|
|
40
|
+
export declare const MethodMetadataSchema: z.ZodType<{
|
|
41
|
+
description: string;
|
|
42
|
+
method: string;
|
|
43
|
+
version: string;
|
|
44
|
+
}>;
|
|
41
45
|
export declare const MetadataSchema: z.ZodObject<{
|
|
42
46
|
axes: z.ZodArray<typeof AxisSchema>;
|
|
43
47
|
datasets: z.ZodArray<typeof DatasetSchema>;
|
|
@@ -45,5 +49,7 @@ export declare const MetadataSchema: z.ZodObject<{
|
|
|
45
49
|
omero: z.ZodOptional<typeof OmeroSchema>;
|
|
46
50
|
name: z.ZodDefault<z.ZodString>;
|
|
47
51
|
version: z.ZodDefault<z.ZodString>;
|
|
52
|
+
type: z.ZodOptional<z.ZodString>;
|
|
53
|
+
metadata: z.ZodOptional<typeof MethodMetadataSchema>;
|
|
48
54
|
}>;
|
|
49
55
|
//# sourceMappingURL=zarr_metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zarr_metadata.d.ts","sourceRoot":"","sources":["../../src/schemas/zarr_metadata.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zarr_metadata.d.ts","sourceRoot":"","sources":["../../src/schemas/zarr_metadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,c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,SAAS,CAAC,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACjC,QAAQ,EAAE,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAC;CACtD,CASC,CAAC"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) Fideus Labs LLC
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
1
3
|
import { z } from "zod";
|
|
2
4
|
import { AxesTypeSchema, SupportedDimsSchema, UnitsSchema } from "./units.js";
|
|
5
|
+
import { AnatomicalOrientationSchema } from "./rfc4.js";
|
|
6
|
+
import { CoordinateTransformationSchema } from "./coordinate_systems.js";
|
|
7
|
+
// Enhanced Axis schema that supports RFC4 orientation
|
|
3
8
|
export const AxisSchema = z.object({
|
|
4
9
|
name: SupportedDimsSchema,
|
|
5
10
|
type: AxesTypeSchema,
|
|
6
11
|
unit: UnitsSchema.optional(),
|
|
12
|
+
// RFC4: Optional orientation for space axes
|
|
13
|
+
orientation: AnatomicalOrientationSchema.optional(),
|
|
7
14
|
});
|
|
15
|
+
// Legacy schemas for backward compatibility
|
|
8
16
|
export const IdentitySchema = z.object({
|
|
9
17
|
type: z.literal("identity"),
|
|
10
18
|
});
|
|
@@ -16,7 +24,13 @@ export const TranslationSchema = z.object({
|
|
|
16
24
|
translation: z.array(z.number()),
|
|
17
25
|
type: z.literal("translation"),
|
|
18
26
|
});
|
|
19
|
-
|
|
27
|
+
// Enhanced transform schema that includes all RFC5 transformations
|
|
28
|
+
export const TransformSchema = z.union([
|
|
29
|
+
ScaleSchema,
|
|
30
|
+
TranslationSchema,
|
|
31
|
+
IdentitySchema,
|
|
32
|
+
CoordinateTransformationSchema,
|
|
33
|
+
]);
|
|
20
34
|
export const DatasetSchema = z.object({
|
|
21
35
|
path: z.string(),
|
|
22
36
|
coordinateTransformations: z.array(TransformSchema),
|
|
@@ -37,6 +51,11 @@ export const OmeroChannelSchema = z.object({
|
|
|
37
51
|
export const OmeroSchema = z.object({
|
|
38
52
|
channels: z.array(OmeroChannelSchema),
|
|
39
53
|
});
|
|
54
|
+
export const MethodMetadataSchema = z.object({
|
|
55
|
+
description: z.string(),
|
|
56
|
+
method: z.string(),
|
|
57
|
+
version: z.string(),
|
|
58
|
+
});
|
|
40
59
|
export const MetadataSchema = z.object({
|
|
41
60
|
axes: z.array(AxisSchema),
|
|
42
61
|
datasets: z.array(DatasetSchema),
|
|
@@ -44,4 +63,6 @@ export const MetadataSchema = z.object({
|
|
|
44
63
|
omero: OmeroSchema.optional(),
|
|
45
64
|
name: z.string().default("image"),
|
|
46
65
|
version: z.string().default("0.4"),
|
|
66
|
+
type: z.string().optional(),
|
|
67
|
+
metadata: MethodMetadataSchema.optional(),
|
|
47
68
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array_interface.d.ts","sourceRoot":"","sources":["../../src/types/array_interface.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Multiscales } from "./multiscales.js";
|
|
2
|
+
import type { PlateAcquisition, PlateColumn, PlateRow, PlateWell, WellImage } from "../schemas/index.js";
|
|
3
|
+
export interface LRUCacheOptions {
|
|
4
|
+
maxSize: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class LRUCache<K, V> {
|
|
7
|
+
private cache;
|
|
8
|
+
private readonly maxSize;
|
|
9
|
+
constructor(options: LRUCacheOptions);
|
|
10
|
+
get(key: K): V | undefined;
|
|
11
|
+
set(key: K, value: V): void;
|
|
12
|
+
has(key: K): boolean;
|
|
13
|
+
clear(): void;
|
|
14
|
+
}
|
|
15
|
+
export interface PlateMetadata {
|
|
16
|
+
columns: PlateColumn[];
|
|
17
|
+
rows: PlateRow[];
|
|
18
|
+
wells: PlateWell[];
|
|
19
|
+
version: string;
|
|
20
|
+
acquisitions?: PlateAcquisition[] | undefined;
|
|
21
|
+
field_count?: number | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface WellMetadata {
|
|
25
|
+
images: WellImage[];
|
|
26
|
+
version: string;
|
|
27
|
+
}
|
|
28
|
+
export interface HCSPlateOptions {
|
|
29
|
+
store: string | object;
|
|
30
|
+
metadata: PlateMetadata;
|
|
31
|
+
wellCacheSize?: number | undefined;
|
|
32
|
+
imageCacheSize?: number | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface HCSWellOptions {
|
|
35
|
+
store: string | object;
|
|
36
|
+
wellPath: string;
|
|
37
|
+
plateMetadata: PlateWell;
|
|
38
|
+
wellGroupMetadata: WellMetadata;
|
|
39
|
+
imageCacheSize?: number | undefined;
|
|
40
|
+
}
|
|
41
|
+
export declare class HCSWell {
|
|
42
|
+
private readonly store;
|
|
43
|
+
readonly path: string;
|
|
44
|
+
readonly plateMetadata: PlateWell;
|
|
45
|
+
readonly metadata: WellMetadata;
|
|
46
|
+
private readonly _images;
|
|
47
|
+
constructor(options: HCSWellOptions);
|
|
48
|
+
get rowIndex(): number;
|
|
49
|
+
get columnIndex(): number;
|
|
50
|
+
get images(): WellImage[];
|
|
51
|
+
getImage(fieldIndex?: number): Promise<Multiscales | null>;
|
|
52
|
+
getImageByAcquisition(acquisitionId: number, fieldIndex?: number): Promise<Multiscales | null>;
|
|
53
|
+
static fromStore(store: string | object, wellPath: string, wellMetadata: PlateWell, imageCacheSize?: number | undefined): HCSWell;
|
|
54
|
+
}
|
|
55
|
+
export declare class HCSPlate {
|
|
56
|
+
private readonly store;
|
|
57
|
+
readonly metadata: PlateMetadata;
|
|
58
|
+
private readonly _wells;
|
|
59
|
+
private readonly imageCacheSize;
|
|
60
|
+
constructor(options: HCSPlateOptions);
|
|
61
|
+
get name(): string | undefined;
|
|
62
|
+
get rows(): PlateRow[];
|
|
63
|
+
get columns(): PlateColumn[];
|
|
64
|
+
get wells(): PlateWell[];
|
|
65
|
+
get acquisitions(): PlateAcquisition[] | undefined;
|
|
66
|
+
get fieldCount(): number | undefined;
|
|
67
|
+
getWell(rowName: string, columnName: string): HCSWell | null;
|
|
68
|
+
getWellByIndices(rowIndex: number, columnIndex: number): HCSWell | null;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=hcs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hcs.d.ts","sourceRoot":"","sources":["../../src/types/hcs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,EACV,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,QAAQ,CAAC,CAAC,EAAE,CAAC;IACxB,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,eAAe;IAKpC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAU1B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAc3B,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAIpB,KAAK,IAAI,IAAI;CAGd;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,KAAK,EAAE,SAA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,CAAC,WAAW,GAAG,IAAI,CAAC;IAiB9B,MAAM,CAAC,SAAS,CACd,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,SAAS,EACvB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO;CAkBX;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,SAAgB,QAAQ,EAAE,aAAa,CAAC;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;gBAExC,OAAO,EAAE,eAAe;IAmBpC,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,IAAI,QAAQ,EAAE,CAErB;IAED,IAAI,OAAO,IAAI,WAAW,EAAE,CAE3B;IAED,IAAI,KAAK,IAAI,SAAS,EAAE,CAEvB;IAED,IAAI,YAAY,IAAI,gBAAgB,EAAE,GAAG,SAAS,CAIjD;IAED,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAEnC;IAED,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IA+B5D,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;CAcxE"}
|
package/esm/types/hcs.js
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
export class LRUCache {
|
|
2
|
+
cache;
|
|
3
|
+
maxSize;
|
|
4
|
+
constructor(options) {
|
|
5
|
+
this.cache = new Map();
|
|
6
|
+
this.maxSize = options.maxSize;
|
|
7
|
+
}
|
|
8
|
+
get(key) {
|
|
9
|
+
const value = this.cache.get(key);
|
|
10
|
+
if (value !== undefined) {
|
|
11
|
+
// Move to end (most recently used)
|
|
12
|
+
this.cache.delete(key);
|
|
13
|
+
this.cache.set(key, value);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
set(key, value) {
|
|
18
|
+
if (this.cache.has(key)) {
|
|
19
|
+
// Update existing item
|
|
20
|
+
this.cache.delete(key);
|
|
21
|
+
}
|
|
22
|
+
else if (this.cache.size >= this.maxSize) {
|
|
23
|
+
// Remove least recently used item
|
|
24
|
+
const firstKey = this.cache.keys().next().value;
|
|
25
|
+
if (firstKey !== undefined) {
|
|
26
|
+
this.cache.delete(firstKey);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
this.cache.set(key, value);
|
|
30
|
+
}
|
|
31
|
+
has(key) {
|
|
32
|
+
return this.cache.has(key);
|
|
33
|
+
}
|
|
34
|
+
clear() {
|
|
35
|
+
this.cache.clear();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export class HCSWell {
|
|
39
|
+
store;
|
|
40
|
+
path;
|
|
41
|
+
plateMetadata;
|
|
42
|
+
metadata;
|
|
43
|
+
_images;
|
|
44
|
+
constructor(options) {
|
|
45
|
+
this.store = options.store;
|
|
46
|
+
this.path = options.wellPath;
|
|
47
|
+
this.plateMetadata = { ...options.plateMetadata };
|
|
48
|
+
this.metadata = {
|
|
49
|
+
images: [...options.wellGroupMetadata.images],
|
|
50
|
+
version: options.wellGroupMetadata.version,
|
|
51
|
+
};
|
|
52
|
+
const imageCacheSize = options.imageCacheSize ?? 100;
|
|
53
|
+
this._images = new LRUCache({
|
|
54
|
+
maxSize: imageCacheSize,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
get rowIndex() {
|
|
58
|
+
return this.plateMetadata.rowIndex;
|
|
59
|
+
}
|
|
60
|
+
get columnIndex() {
|
|
61
|
+
return this.plateMetadata.columnIndex;
|
|
62
|
+
}
|
|
63
|
+
get images() {
|
|
64
|
+
return [...this.metadata.images];
|
|
65
|
+
}
|
|
66
|
+
async getImage(fieldIndex = 0) {
|
|
67
|
+
if (fieldIndex < 0 || fieldIndex >= this.metadata.images.length) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const imageMeta = this.metadata.images[fieldIndex];
|
|
71
|
+
const imagePath = `${this.path}/${imageMeta.path}`;
|
|
72
|
+
// Check cache first
|
|
73
|
+
const cached = this._images.get(imagePath);
|
|
74
|
+
if (cached) {
|
|
75
|
+
return cached;
|
|
76
|
+
}
|
|
77
|
+
// Load the image using fromNgffZarr
|
|
78
|
+
const { fromNgffZarr } = await import("../io/from_ngff_zarr.js");
|
|
79
|
+
let fullImagePath;
|
|
80
|
+
if (typeof this.store === "string") {
|
|
81
|
+
// If store is a path string, append the image path
|
|
82
|
+
fullImagePath = `${this.store}/${this.path}/${imageMeta.path}`;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// For other store types, we need to handle differently
|
|
86
|
+
// This would need to be adapted based on the specific store type
|
|
87
|
+
throw new Error("Non-string store types not yet implemented for HCS");
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
const multiscales = await fromNgffZarr(fullImagePath);
|
|
91
|
+
this._images.set(imagePath, multiscales);
|
|
92
|
+
return multiscales;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error(`Failed to load image at ${fullImagePath}:`, error);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
getImageByAcquisition(acquisitionId, fieldIndex = 0) {
|
|
100
|
+
// Find images for the specified acquisition
|
|
101
|
+
const acquisitionImages = this.metadata.images.filter((img) => img.acquisition === acquisitionId);
|
|
102
|
+
if (fieldIndex < 0 || fieldIndex >= acquisitionImages.length) {
|
|
103
|
+
return Promise.resolve(null);
|
|
104
|
+
}
|
|
105
|
+
// Find the actual image index in the full list
|
|
106
|
+
const targetImage = acquisitionImages[fieldIndex];
|
|
107
|
+
const actualIndex = this.metadata.images.indexOf(targetImage);
|
|
108
|
+
return this.getImage(actualIndex);
|
|
109
|
+
}
|
|
110
|
+
static fromStore(store, wellPath, wellMetadata, imageCacheSize) {
|
|
111
|
+
// Simplified implementation - we'll improve this when implementing the IO functions
|
|
112
|
+
const wellGroupMetadata = {
|
|
113
|
+
images: [
|
|
114
|
+
{ path: "0", acquisition: 0 },
|
|
115
|
+
{ path: "1", acquisition: 0 },
|
|
116
|
+
],
|
|
117
|
+
version: "0.4",
|
|
118
|
+
};
|
|
119
|
+
return new HCSWell({
|
|
120
|
+
store,
|
|
121
|
+
wellPath,
|
|
122
|
+
plateMetadata: wellMetadata,
|
|
123
|
+
wellGroupMetadata,
|
|
124
|
+
imageCacheSize,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export class HCSPlate {
|
|
129
|
+
store;
|
|
130
|
+
metadata;
|
|
131
|
+
_wells;
|
|
132
|
+
imageCacheSize;
|
|
133
|
+
constructor(options) {
|
|
134
|
+
this.store = options.store;
|
|
135
|
+
this.metadata = {
|
|
136
|
+
columns: [...options.metadata.columns],
|
|
137
|
+
rows: [...options.metadata.rows],
|
|
138
|
+
wells: [...options.metadata.wells],
|
|
139
|
+
version: options.metadata.version,
|
|
140
|
+
acquisitions: options.metadata.acquisitions
|
|
141
|
+
? [...options.metadata.acquisitions]
|
|
142
|
+
: undefined,
|
|
143
|
+
field_count: options.metadata.field_count,
|
|
144
|
+
name: options.metadata.name,
|
|
145
|
+
};
|
|
146
|
+
this.imageCacheSize = options.imageCacheSize;
|
|
147
|
+
const wellCacheSize = options.wellCacheSize ?? 500;
|
|
148
|
+
this._wells = new LRUCache({ maxSize: wellCacheSize });
|
|
149
|
+
}
|
|
150
|
+
get name() {
|
|
151
|
+
return this.metadata.name;
|
|
152
|
+
}
|
|
153
|
+
get rows() {
|
|
154
|
+
return [...this.metadata.rows];
|
|
155
|
+
}
|
|
156
|
+
get columns() {
|
|
157
|
+
return [...this.metadata.columns];
|
|
158
|
+
}
|
|
159
|
+
get wells() {
|
|
160
|
+
return [...this.metadata.wells];
|
|
161
|
+
}
|
|
162
|
+
get acquisitions() {
|
|
163
|
+
return this.metadata.acquisitions
|
|
164
|
+
? [...this.metadata.acquisitions]
|
|
165
|
+
: undefined;
|
|
166
|
+
}
|
|
167
|
+
get fieldCount() {
|
|
168
|
+
return this.metadata.field_count;
|
|
169
|
+
}
|
|
170
|
+
getWell(rowName, columnName) {
|
|
171
|
+
const wellPath = `${rowName}/${columnName}`;
|
|
172
|
+
// Check if well exists in metadata
|
|
173
|
+
const wellMeta = this.metadata.wells.find((well) => well.path === wellPath);
|
|
174
|
+
if (!wellMeta) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
// Check cache first
|
|
178
|
+
const cached = this._wells.get(wellPath);
|
|
179
|
+
if (cached) {
|
|
180
|
+
return cached;
|
|
181
|
+
}
|
|
182
|
+
// Load the well
|
|
183
|
+
try {
|
|
184
|
+
const well = HCSWell.fromStore(this.store, wellPath, wellMeta, this.imageCacheSize);
|
|
185
|
+
this._wells.set(wellPath, well);
|
|
186
|
+
return well;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
console.error(`Failed to load well at ${wellPath}:`, error);
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
getWellByIndices(rowIndex, columnIndex) {
|
|
194
|
+
if (rowIndex < 0 ||
|
|
195
|
+
rowIndex >= this.metadata.rows.length ||
|
|
196
|
+
columnIndex < 0 ||
|
|
197
|
+
columnIndex >= this.metadata.columns.length) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
const rowName = this.metadata.rows[rowIndex].name;
|
|
201
|
+
const columnName = this.metadata.columns[columnIndex].name;
|
|
202
|
+
return this.getWell(rowName, columnName);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/types/methods.ts"],"names":[],"mappings":"
|
|
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"}
|
package/esm/types/methods.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiscales.d.ts","sourceRoot":"","sources":["../../src/types/multiscales.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"multiscales.d.ts","sourceRoot":"","sources":["../../src/types/multiscales.ts"],"names":[],"mappings":"AAEA,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,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,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
|
|
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:
|
|
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:
|
|
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":"
|
|
1
|
+
{"version":3,"file":"ngff_image.d.ts","sourceRoot":"","sources":["../../src/types/ngff_image.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AACh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EAAE,gBAAgB,EAAE,CAAC;gBAE1C,OAAO,EAAE,gBAAgB;IAarC,QAAQ,IAAI,MAAM;CA8BnB"}
|
package/esm/types/ngff_image.js
CHANGED
|
@@ -5,6 +5,7 @@ export class NgffImage {
|
|
|
5
5
|
translation;
|
|
6
6
|
name;
|
|
7
7
|
axesUnits;
|
|
8
|
+
axesOrientations;
|
|
8
9
|
computedCallbacks;
|
|
9
10
|
constructor(options) {
|
|
10
11
|
this.data = options.data;
|
|
@@ -13,19 +14,30 @@ export class NgffImage {
|
|
|
13
14
|
this.translation = { ...options.translation };
|
|
14
15
|
this.name = options.name ?? "image";
|
|
15
16
|
this.axesUnits = options.axesUnits ? { ...options.axesUnits } : undefined;
|
|
17
|
+
this.axesOrientations = options.axesOrientations
|
|
18
|
+
? { ...options.axesOrientations }
|
|
19
|
+
: undefined;
|
|
16
20
|
this.computedCallbacks = [...(options.computedCallbacks ?? [])];
|
|
17
21
|
}
|
|
18
22
|
toString() {
|
|
19
23
|
const axesUnitsStr = this.axesUnits
|
|
20
24
|
? JSON.stringify(this.axesUnits)
|
|
21
25
|
: "None";
|
|
26
|
+
const axesOrientationsStr = this.axesOrientations
|
|
27
|
+
? JSON.stringify(this.axesOrientations)
|
|
28
|
+
: "None";
|
|
29
|
+
// Create array string representation using zarr.Array properties
|
|
30
|
+
const path = this.data.path || this.name;
|
|
31
|
+
const chunks = this.data.chunks.join(", ");
|
|
32
|
+
const arrayStr = `Array(name=${path}, shape=(${this.data.shape.join(", ")}), dtype=${this.data.dtype}, chunksize=(${chunks}), chunktype=TypedArray)`;
|
|
22
33
|
return `NgffImage(
|
|
23
|
-
data=${
|
|
34
|
+
data=${arrayStr},
|
|
24
35
|
dims=[${this.dims.map((d) => `'${d}'`).join(", ")}],
|
|
25
36
|
scale=${JSON.stringify(this.scale)},
|
|
26
37
|
translation=${JSON.stringify(this.translation)},
|
|
27
38
|
name='${this.name}',
|
|
28
39
|
axes_units=${axesUnitsStr},
|
|
40
|
+
axes_orientations=${axesOrientationsStr},
|
|
29
41
|
computed_callbacks=[${this.computedCallbacks.length} callbacks]
|
|
30
42
|
)`;
|
|
31
43
|
}
|