@fideus-labs/ngff-zarr 0.2.8 → 0.4.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/esm/browser-mod.d.ts +5 -3
- package/esm/browser-mod.d.ts.map +1 -1
- package/esm/browser-mod.js +4 -4
- package/esm/browser-mod.js.map +1 -1
- package/esm/io/from_ngff_zarr.d.ts.map +1 -1
- package/esm/io/from_ngff_zarr.js +34 -116
- package/esm/io/from_ngff_zarr.js.map +1 -1
- package/esm/io/rfc9_zip.d.ts +80 -0
- package/esm/io/rfc9_zip.d.ts.map +1 -0
- package/esm/io/rfc9_zip.js +337 -0
- package/esm/io/rfc9_zip.js.map +1 -0
- package/esm/io/to_ngff_zarr-browser.d.ts +26 -0
- package/esm/io/to_ngff_zarr-browser.d.ts.map +1 -1
- package/esm/io/to_ngff_zarr-browser.js +37 -6
- package/esm/io/to_ngff_zarr-browser.js.map +1 -1
- package/esm/io/to_ngff_zarr.d.ts +76 -0
- package/esm/io/to_ngff_zarr.d.ts.map +1 -1
- package/esm/io/to_ngff_zarr.js +129 -7
- package/esm/io/to_ngff_zarr.js.map +1 -1
- package/esm/io/to_ngff_zarr_ozx_common.d.ts +51 -0
- package/esm/io/to_ngff_zarr_ozx_common.d.ts.map +1 -0
- package/esm/io/to_ngff_zarr_ozx_common.js +126 -0
- package/esm/io/to_ngff_zarr_ozx_common.js.map +1 -0
- package/esm/methods/itkwasm-browser.d.ts.map +1 -1
- package/esm/methods/itkwasm-browser.js +262 -4
- package/esm/methods/itkwasm-browser.js.map +1 -1
- package/esm/methods/itkwasm-node.d.ts.map +1 -1
- package/esm/methods/itkwasm-node.js +262 -4
- package/esm/methods/itkwasm-node.js.map +1 -1
- package/esm/methods/itkwasm-shared.d.ts +6 -0
- package/esm/methods/itkwasm-shared.d.ts.map +1 -1
- package/esm/methods/itkwasm-shared.js +6 -0
- package/esm/methods/itkwasm-shared.js.map +1 -1
- package/esm/mod.d.ts +7 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +6 -0
- package/esm/mod.js.map +1 -1
- package/esm/process/to_multiscales-shared.d.ts.map +1 -1
- package/esm/process/to_multiscales-shared.js +3 -2
- package/esm/process/to_multiscales-shared.js.map +1 -1
- package/esm/types/supported_versions.d.ts +20 -0
- package/esm/types/supported_versions.d.ts.map +1 -0
- package/esm/types/supported_versions.js +31 -0
- package/esm/types/supported_versions.js.map +1 -0
- package/esm/types/zarr_metadata.d.ts +43 -1
- package/esm/types/zarr_metadata.d.ts.map +1 -1
- package/esm/types/zarr_metadata.js +40 -0
- package/esm/types/zarr_metadata.js.map +1 -1
- package/esm/utils/compute_omero.d.ts +89 -0
- package/esm/utils/compute_omero.d.ts.map +1 -0
- package/esm/utils/compute_omero.js +541 -0
- package/esm/utils/compute_omero.js.map +1 -0
- package/esm/utils/factory.d.ts +3 -2
- package/esm/utils/factory.d.ts.map +1 -1
- package/esm/utils/factory.js +6 -2
- package/esm/utils/factory.js.map +1 -1
- package/esm/utils/from_zarr_attrs.d.ts +21 -0
- package/esm/utils/from_zarr_attrs.d.ts.map +1 -0
- package/esm/utils/from_zarr_attrs.js +326 -0
- package/esm/utils/from_zarr_attrs.js.map +1 -0
- package/esm/utils/parse_metadata.d.ts +27 -0
- package/esm/utils/parse_metadata.d.ts.map +1 -0
- package/esm/utils/parse_metadata.js +138 -0
- package/esm/utils/parse_metadata.js.map +1 -0
- package/esm/utils/rfc4_validation.d.ts +20 -0
- package/esm/utils/rfc4_validation.d.ts.map +1 -0
- package/esm/utils/rfc4_validation.js +98 -0
- package/esm/utils/rfc4_validation.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to_multiscales-shared.js","sourceRoot":"","sources":["../../src/process/to_multiscales-shared.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,+BAA+B;AAU/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACd,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAiBhE;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAgB,EAChB,OAA6B,EAC7B,iBAAqC;IAErC,MAAM,EACJ,YAAY,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EACrB,MAAM,GAAG,OAAO,CAAC,gBAAgB,EACjC,MAAM,EAAE,OAAO,GAChB,GAAG,OAAO,CAAC;IAEZ,IAAI,MAAmB,CAAC;IAExB,iDAAiD;IACjD,IACE,MAAM,KAAK,OAAO,CAAC,gBAAgB;QACnC,MAAM,KAAK,OAAO,CAAC,kBAAkB;QACrC,MAAM,KAAK,OAAO,CAAC,mBAAmB,EACtC,CAAC;QACD,6CAA6C;QAC7C,MAAM,SAAS,GAAG,MAAM,KAAK,OAAO,CAAC,gBAAgB;YACnD,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,kBAAkB;gBACvC,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,aAAa,CAAC;QAElB,MAAM,GAAG,MAAM,iBAAiB,CAC9B,KAAK,EACL,YAAmD,EACnD,SAAS,CACV,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,gEAAgE;QAChE,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"to_multiscales-shared.js","sourceRoot":"","sources":["../../src/process/to_multiscales-shared.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,+BAA+B;AAU/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACd,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,C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
|
+
V01 = "0.1",
|
|
6
|
+
V02 = "0.2",
|
|
7
|
+
V03 = "0.3",
|
|
8
|
+
V04 = "0.4",
|
|
9
|
+
V05 = "0.5",
|
|
10
|
+
LATEST = "0.5"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Supported NGFF specification versions
|
|
14
|
+
*/
|
|
15
|
+
export declare const SUPPORTED_VERSIONS: readonly NgffVersion[];
|
|
16
|
+
/**
|
|
17
|
+
* Check if a version string is supported
|
|
18
|
+
*/
|
|
19
|
+
export declare function isSupportedVersion(version: string): version is NgffVersion;
|
|
20
|
+
//# sourceMappingURL=supported_versions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported_versions.d.ts","sourceRoot":"","sources":["../../src/types/supported_versions.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,MAAM,QAAQ;CACf;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAM3C,CAAC;AAEX;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,WAAW,CAE1E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (c) Fideus Labs LLC
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
/**
|
|
4
|
+
* Constants for ngff-zarr package.
|
|
5
|
+
*/
|
|
6
|
+
export var NgffVersion;
|
|
7
|
+
(function (NgffVersion) {
|
|
8
|
+
NgffVersion["V01"] = "0.1";
|
|
9
|
+
NgffVersion["V02"] = "0.2";
|
|
10
|
+
NgffVersion["V03"] = "0.3";
|
|
11
|
+
NgffVersion["V04"] = "0.4";
|
|
12
|
+
NgffVersion["V05"] = "0.5";
|
|
13
|
+
NgffVersion["LATEST"] = "0.5";
|
|
14
|
+
})(NgffVersion || (NgffVersion = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Supported NGFF specification versions
|
|
17
|
+
*/
|
|
18
|
+
export const SUPPORTED_VERSIONS = [
|
|
19
|
+
NgffVersion.V01,
|
|
20
|
+
NgffVersion.V02,
|
|
21
|
+
NgffVersion.V03,
|
|
22
|
+
NgffVersion.V04,
|
|
23
|
+
NgffVersion.V05,
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Check if a version string is supported
|
|
27
|
+
*/
|
|
28
|
+
export function isSupportedVersion(version) {
|
|
29
|
+
return Object.values(NgffVersion).includes(version);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=supported_versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported_versions.js","sourceRoot":"","sources":["../../src/types/supported_versions.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,+BAA+B;AAE/B;;GAEG;AAEH,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,6BAAc,CAAA;AAChB,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA2B;IACxD,WAAW,CAAC,GAAG;IACf,WAAW,CAAC,GAAG;IACf,WAAW,CAAC,GAAG;IACf,WAAW,CAAC,GAAG;IACf,WAAW,CAAC,GAAG;CACP,CAAC;AAEX;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,OAAsB,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import type { AxesType, SupportedDims, Units } from "./units.js";
|
|
2
|
+
import { NgffVersion } from "./supported_versions.js";
|
|
3
|
+
import type { NgffImage } from "./ngff_image.js";
|
|
4
|
+
import type { AnatomicalOrientation } from "./rfc4.js";
|
|
5
|
+
/**
|
|
6
|
+
* Orientation metadata for spatial axes (RFC 4).
|
|
7
|
+
* This interface represents the serialized form in the zarr metadata.
|
|
8
|
+
*/
|
|
9
|
+
export interface AxisOrientation {
|
|
10
|
+
type: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
2
13
|
export interface Axis {
|
|
3
14
|
name: SupportedDims;
|
|
4
15
|
type: AxesType;
|
|
5
16
|
unit: Units | undefined;
|
|
17
|
+
orientation?: AxisOrientation | AnatomicalOrientation | undefined;
|
|
6
18
|
}
|
|
7
19
|
export interface Identity {
|
|
8
20
|
type: "identity";
|
|
@@ -41,7 +53,10 @@ export interface MethodMetadata {
|
|
|
41
53
|
method: string;
|
|
42
54
|
version: string;
|
|
43
55
|
}
|
|
44
|
-
|
|
56
|
+
/**
|
|
57
|
+
* OME-Zarr Metadata interface for data transfer
|
|
58
|
+
*/
|
|
59
|
+
export interface MetadataInterface {
|
|
45
60
|
axes: Axis[];
|
|
46
61
|
datasets: Dataset[];
|
|
47
62
|
coordinateTransformations: Transform[] | undefined;
|
|
@@ -51,6 +66,33 @@ export interface Metadata {
|
|
|
51
66
|
type?: string;
|
|
52
67
|
metadata?: MethodMetadata;
|
|
53
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Result from parsing zarr attributes
|
|
71
|
+
*/
|
|
72
|
+
export interface FromZarrAttrsResult {
|
|
73
|
+
metadata: MetadataInterface;
|
|
74
|
+
images: NgffImage[];
|
|
75
|
+
}
|
|
76
|
+
export type Metadata = MetadataInterface;
|
|
77
|
+
/**
|
|
78
|
+
* Result from parsing zarr attributes
|
|
79
|
+
*/
|
|
80
|
+
export interface FromZarrAttrsResult {
|
|
81
|
+
metadata: MetadataInterface;
|
|
82
|
+
images: NgffImage[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Supported dimension names for backward compatibility
|
|
86
|
+
*/
|
|
87
|
+
export declare const SUPPORTED_DIMS: readonly SupportedDims[];
|
|
88
|
+
/**
|
|
89
|
+
* Create a Metadata object with the specified version
|
|
90
|
+
*/
|
|
91
|
+
export declare function createMetadataWithVersion(metadata: MetadataInterface, targetVersion: string | NgffVersion): MetadataInterface;
|
|
92
|
+
/**
|
|
93
|
+
* Get dimension names from metadata axes
|
|
94
|
+
*/
|
|
95
|
+
export declare function getDimensionNames(metadata: MetadataInterface): string[];
|
|
54
96
|
export declare function validateColor(color: string): void;
|
|
55
97
|
export declare function createScale(scale: number[]): Scale;
|
|
56
98
|
export declare function createTranslation(translation: number[]): Translation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zarr_metadata.d.ts","sourceRoot":"","sources":["../../src/types/zarr_metadata.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"zarr_metadata.d.ts","sourceRoot":"","sources":["../../src/types/zarr_metadata.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,GAAG,qBAAqB,GAAG,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IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAGD,MAAM,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAMzC,CAAC;AAEX;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,MAAM,GAAG,WAAW,GAClC,iBAAiB,CAoBnB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAEvE;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"}
|
|
@@ -1,3 +1,43 @@
|
|
|
1
|
+
import { NgffVersion } from "./supported_versions.js";
|
|
2
|
+
/**
|
|
3
|
+
* Supported dimension names for backward compatibility
|
|
4
|
+
*/
|
|
5
|
+
export const SUPPORTED_DIMS = [
|
|
6
|
+
"t",
|
|
7
|
+
"c",
|
|
8
|
+
"z",
|
|
9
|
+
"y",
|
|
10
|
+
"x",
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Create a Metadata object with the specified version
|
|
14
|
+
*/
|
|
15
|
+
export function createMetadataWithVersion(metadata, targetVersion) {
|
|
16
|
+
const version = typeof targetVersion === "string"
|
|
17
|
+
? targetVersion
|
|
18
|
+
: targetVersion;
|
|
19
|
+
if (version === NgffVersion.V04) {
|
|
20
|
+
return {
|
|
21
|
+
...metadata,
|
|
22
|
+
version: "0.4",
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
else if (version === NgffVersion.V05) {
|
|
26
|
+
return {
|
|
27
|
+
...metadata,
|
|
28
|
+
version: "0.5",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
throw new Error(`Unsupported version conversion: ${metadata.version} -> ${version}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get dimension names from metadata axes
|
|
37
|
+
*/
|
|
38
|
+
export function getDimensionNames(metadata) {
|
|
39
|
+
return metadata.axes.map((ax) => ax.name);
|
|
40
|
+
}
|
|
1
41
|
export function validateColor(color) {
|
|
2
42
|
if (!/^[0-9A-Fa-f]{6}$/.test(color)) {
|
|
3
43
|
throw new Error(`Invalid color '${color}'. Must be 6 hex digits.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zarr_metadata.js","sourceRoot":"","sources":["../../src/types/zarr_metadata.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zarr_metadata.js","sourceRoot":"","sources":["../../src/types/zarr_metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAmGtD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAA6B;IACtD,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;CACK,CAAC;AAEX;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAA2B,EAC3B,aAAmC;IAEnC,MAAM,OAAO,GAAG,OAAO,aAAa,KAAK,QAAQ;QAC/C,CAAC,CAAE,aAA6B;QAChC,CAAC,CAAC,aAAa,CAAC;IAElB,IAAI,OAAO,KAAK,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,OAAO;YACL,GAAG,QAAQ;YACX,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;SAAM,IAAI,OAAO,KAAK,WAAW,CAAC,GAAG,EAAE,CAAC;QACvC,OAAO;YACL,GAAG,QAAQ;YACX,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,mCAAmC,QAAQ,CAAC,OAAO,OAAO,OAAO,EAAE,CACpE,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAA2B;IAC3D,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,0BAA0B,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAe;IACzC,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,WAAqB;IACrD,OAAO,EAAE,WAAW,EAAE,CAAC,GAAG,WAAW,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { NgffImage } from "../types/ngff_image.js";
|
|
2
|
+
import type { Multiscales } from "../types/multiscales.js";
|
|
3
|
+
import type { Omero } from "../types/zarr_metadata.js";
|
|
4
|
+
/**
|
|
5
|
+
* Glasbey color palette from colorcet's glasbey_hv.
|
|
6
|
+
* Extended from HoloViews default colors using the Glasbey algorithm
|
|
7
|
+
* for maximum distinguishability across 256 categorical colors.
|
|
8
|
+
* See: https://colorcet.holoviz.org/user_guide/Categorical.html
|
|
9
|
+
*/
|
|
10
|
+
export declare const GLASBEY_COLORS: readonly string[];
|
|
11
|
+
/**
|
|
12
|
+
* Get default colors for channels.
|
|
13
|
+
*
|
|
14
|
+
* For a single channel, returns white (FFFFFF).
|
|
15
|
+
* For multiple channels, uses the Glasbey color progression.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getDefaultColors(nChannels: number): string[];
|
|
18
|
+
/**
|
|
19
|
+
* Options for computing OMERO metadata.
|
|
20
|
+
*/
|
|
21
|
+
export interface ComputeOmeroOptions {
|
|
22
|
+
/** Tuple of (low, high) quantile values for the display window. Default is [0.02, 0.98]. */
|
|
23
|
+
quantiles?: [number, number];
|
|
24
|
+
/** Optional list of hex color strings (without #) for each channel. */
|
|
25
|
+
colors?: string[];
|
|
26
|
+
/** Optional list of label strings for each channel. */
|
|
27
|
+
labels?: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Compute OMERO metadata from an NgffImage.
|
|
31
|
+
*
|
|
32
|
+
* This function computes visualization parameters (OMERO metadata) from image data:
|
|
33
|
+
* - min/max: The actual data range
|
|
34
|
+
* - start/end: Display window based on quantiles (default 2% and 98%)
|
|
35
|
+
*
|
|
36
|
+
* For multi-channel images (with 'c' dimension), statistics are computed
|
|
37
|
+
* separately for each channel, resulting in per-channel OMERO windows.
|
|
38
|
+
*
|
|
39
|
+
* Memory requirements: This function loads the entire image data into memory
|
|
40
|
+
* for statistics computation. For large images, use the lowest resolution
|
|
41
|
+
* image from a multiscales pyramid.
|
|
42
|
+
*
|
|
43
|
+
* Edge cases:
|
|
44
|
+
* - If all values in a channel are NaN, the statistics will be NaN.
|
|
45
|
+
* - If a channel has constant values, min/max/start/end will all be the same.
|
|
46
|
+
*
|
|
47
|
+
* @param image - The NgffImage to compute metadata for
|
|
48
|
+
* @param options - Optional configuration for quantiles, colors, and labels
|
|
49
|
+
* - quantiles: Tuple of (low, high) quantile values. Must be between 0 and 1,
|
|
50
|
+
* with low < high. Default is [0.02, 0.98] for 2% and 98% quantiles.
|
|
51
|
+
* - colors: List of hex color strings (without #) for each channel.
|
|
52
|
+
* Must be 6-digit hexadecimal strings (e.g., "FF0000" for red).
|
|
53
|
+
* If not provided, uses white for single channel or Glasbey
|
|
54
|
+
* progression for multi-channel.
|
|
55
|
+
* - labels: List of label strings for each channel.
|
|
56
|
+
* If not provided, uses empty strings.
|
|
57
|
+
* @returns Promise resolving to Omero metadata with computed window parameters
|
|
58
|
+
* @throws {Error} If quantiles are invalid, colors are invalid format,
|
|
59
|
+
* or not enough colors/labels provided.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const omero = await computeOmeroFromNgffImage(image);
|
|
64
|
+
* multiscales.metadata.omero = omero;
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function computeOmeroFromNgffImage(image: NgffImage, options?: ComputeOmeroOptions): Promise<Omero>;
|
|
68
|
+
/**
|
|
69
|
+
* Options for computing OMERO metadata from multiscales.
|
|
70
|
+
*/
|
|
71
|
+
export interface ComputeOmeroFromMultiscalesOptions extends ComputeOmeroOptions {
|
|
72
|
+
/**
|
|
73
|
+
* If true (default), use the lowest resolution (smallest) image for faster computation.
|
|
74
|
+
* If false, use the highest resolution (largest) image for more accurate statistics.
|
|
75
|
+
*/
|
|
76
|
+
useLowestResolution?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Compute OMERO metadata from a Multiscales object.
|
|
80
|
+
*
|
|
81
|
+
* This is a convenience function that computes OMERO metadata from the
|
|
82
|
+
* highest or lowest resolution image in a multiscales pyramid.
|
|
83
|
+
*
|
|
84
|
+
* @param multiscales - The Multiscales object to compute metadata for
|
|
85
|
+
* @param options - Optional configuration for quantiles, colors, labels, and resolution
|
|
86
|
+
* @returns Promise resolving to Omero metadata with computed window parameters
|
|
87
|
+
*/
|
|
88
|
+
export declare function computeOmeroFromMultiscales(multiscales: Multiscales, options?: ComputeOmeroFromMultiscalesOptions): Promise<Omero>;
|
|
89
|
+
//# sourceMappingURL=compute_omero.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute_omero.d.ts","sourceRoot":"","sources":["../../src/utils/compute_omero.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EACV,KAAK,EAGN,MAAM,2BAA2B,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAiQlC,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAS5D;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4FAA4F;IAC5F,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAwJD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,SAAS,EAChB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,KAAK,CAAC,CAqFhB;AAED;;GAEG;AACH,MAAM,WAAW,kCACf,SAAQ,mBAAmB;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;GASG;AACH,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE,kCAAuC,GAC/C,OAAO,CAAC,KAAK,CAAC,CAwBhB"}
|