@fideus-labs/fiff 0.1.2 → 0.3.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.
@@ -0,0 +1,84 @@
1
+ /**
2
+ * High-level OME-TIFF writer.
3
+ *
4
+ * Converts an ngff-zarr Multiscales object to a complete OME-TIFF file
5
+ * as an ArrayBuffer. Supports multi-resolution pyramids (via SubIFDs),
6
+ * tiled output, deflate compression, parallel plane reading, and
7
+ * automatic BigTIFF detection.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import { toOmeTiff } from "@fideus-labs/fiff";
12
+ * import type { Multiscales } from "@fideus-labs/ngff-zarr";
13
+ *
14
+ * const buffer = await toOmeTiff(multiscales);
15
+ * // buffer is a valid OME-TIFF ArrayBuffer
16
+ * ```
17
+ */
18
+ import type { Multiscales } from "@fideus-labs/ngff-zarr";
19
+ /** Options for the OME-TIFF writer. */
20
+ export interface WriteOptions {
21
+ /**
22
+ * DimensionOrder for the TIFF IFD layout.
23
+ * Determines the order in which C, Z, T planes are stored.
24
+ * Default: "XYZCT".
25
+ */
26
+ dimensionOrder?: "XYZCT" | "XYZTC" | "XYCTZ" | "XYCZT" | "XYTCZ" | "XYTZC";
27
+ /**
28
+ * Compression to apply to pixel data.
29
+ * - "none": no compression (larger files, faster write)
30
+ * - "deflate": zlib/deflate compression (smaller files, compatible with all readers)
31
+ * Default: "deflate".
32
+ */
33
+ compression?: "none" | "deflate";
34
+ /**
35
+ * Deflate compression level (1-9).
36
+ * Higher values produce smaller files but take longer.
37
+ * Only used when compression is "deflate".
38
+ * Default: 6.
39
+ */
40
+ compressionLevel?: number;
41
+ /** Creator string embedded in the OME-XML. Default: "fiff". */
42
+ creator?: string;
43
+ /** Image name. Falls back to multiscales.metadata.name or "image". */
44
+ imageName?: string;
45
+ /**
46
+ * Tile size in pixels. Images larger than this in either dimension
47
+ * will use tiled output. Must be a multiple of 16.
48
+ * Default: 256 (OME-TIFF convention).
49
+ * Set to 0 to disable tiling (strip-based output).
50
+ */
51
+ tileSize?: number;
52
+ /**
53
+ * Maximum number of planes to read concurrently.
54
+ * Higher values use more memory but can speed up writes when
55
+ * reading from async data sources.
56
+ * Default: 4.
57
+ */
58
+ concurrency?: number;
59
+ /**
60
+ * TIFF format to use.
61
+ * - "auto": Classic TIFF when possible, BigTIFF for files > 4 GB.
62
+ * - "classic": Force classic TIFF (fails if file > 4 GB).
63
+ * - "bigtiff": Force BigTIFF (64-bit offsets).
64
+ * Default: "auto".
65
+ */
66
+ format?: "auto" | "classic" | "bigtiff";
67
+ }
68
+ /**
69
+ * Convert an ngff-zarr Multiscales to an OME-TIFF ArrayBuffer.
70
+ *
71
+ * Writes all resolution levels as SubIFDs (pyramids) if the
72
+ * Multiscales has more than one image. The highest-resolution
73
+ * level goes in the main IFD chain; lower-resolution levels
74
+ * are attached as SubIFDs to each corresponding main IFD.
75
+ *
76
+ * Planes are read with bounded concurrency and tiles are compressed
77
+ * eagerly to minimise peak memory.
78
+ *
79
+ * @param multiscales - The ngff-zarr Multiscales object to write.
80
+ * @param options - Writer options.
81
+ * @returns A complete OME-TIFF file as an ArrayBuffer.
82
+ */
83
+ export declare function toOmeTiff(multiscales: Multiscales, options?: WriteOptions): Promise<ArrayBuffer>;
84
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,wBAAwB,CAAC;AAerE,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EACX,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,CAAC;IAEZ;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CACzC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,SAAS,CAC7B,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,CAuFtB"}
package/dist/write.js ADDED
@@ -0,0 +1,173 @@
1
+ // SPDX-FileCopyrightText: Copyright (c) Fideus Labs LLC
2
+ // SPDX-License-Identifier: MIT
3
+ import * as zarr from "zarrita";
4
+ import { zarrToTiffDtype, bytesPerElement } from "./dtypes.js";
5
+ import { buildOmeXml, extractDimensions } from "./ome-xml-writer.js";
6
+ import { buildTiff, makeImageTags, sliceTiles, DEFAULT_TILE_SIZE, } from "./tiff-writer.js";
7
+ /**
8
+ * Convert an ngff-zarr Multiscales to an OME-TIFF ArrayBuffer.
9
+ *
10
+ * Writes all resolution levels as SubIFDs (pyramids) if the
11
+ * Multiscales has more than one image. The highest-resolution
12
+ * level goes in the main IFD chain; lower-resolution levels
13
+ * are attached as SubIFDs to each corresponding main IFD.
14
+ *
15
+ * Planes are read with bounded concurrency and tiles are compressed
16
+ * eagerly to minimise peak memory.
17
+ *
18
+ * @param multiscales - The ngff-zarr Multiscales object to write.
19
+ * @param options - Writer options.
20
+ * @returns A complete OME-TIFF file as an ArrayBuffer.
21
+ */
22
+ export async function toOmeTiff(multiscales, options = {}) {
23
+ const dimensionOrder = options.dimensionOrder ?? "XYZCT";
24
+ const compression = options.compression ?? "deflate";
25
+ const compressionLevel = options.compressionLevel ?? 6;
26
+ const tileSize = options.tileSize ?? DEFAULT_TILE_SIZE;
27
+ const concurrency = options.concurrency ?? 4;
28
+ const format = options.format ?? "auto";
29
+ const fullResImage = multiscales.images[0];
30
+ const dtype = fullResImage.data.dtype;
31
+ const dims = extractDimensions(multiscales);
32
+ const bpe = bytesPerElement(dtype);
33
+ const tiffDtype = zarrToTiffDtype(dtype);
34
+ // Generate OME-XML for the first IFD
35
+ const omeXml = buildOmeXml(multiscales, dtype, {
36
+ dimensionOrder,
37
+ creator: options.creator,
38
+ imageName: options.imageName,
39
+ });
40
+ const totalPlanes = dims.sizeC * dims.sizeZ * dims.sizeT;
41
+ const numLevels = multiscales.images.length;
42
+ // Build one IFD (with SubIFDs) for a given plane index.
43
+ const buildPlaneIfd = async (ifdIdx) => {
44
+ const { c, z, t } = ifdIndexToPlane(ifdIdx, dims, dimensionOrder);
45
+ // Read + tile the full-resolution plane
46
+ const planeData = await readPlane(fullResImage, dims, c, z, t, bpe);
47
+ const mainTiles = slicePlane(planeData, dims.sizeX, dims.sizeY, bpe, tileSize);
48
+ const isFirst = ifdIdx === 0;
49
+ const tags = makeImageTags(dims.sizeX, dims.sizeY, tiffDtype.bitsPerSample, tiffDtype.sampleFormat, "none", // compression handled by buildTiff
50
+ isFirst ? omeXml : undefined, false, tileSize);
51
+ // Build SubIFDs for pyramid levels (if any)
52
+ const subIfds = [];
53
+ for (let level = 1; level < numLevels; level++) {
54
+ const subImage = multiscales.images[level];
55
+ const subDims = extractLevelDimensions(subImage, dims);
56
+ const subPlane = await readPlane(subImage, subDims, c, z, t, bpe);
57
+ const subTiles = slicePlane(subPlane, subDims.sizeX, subDims.sizeY, bpe, tileSize);
58
+ const subTags = makeImageTags(subDims.sizeX, subDims.sizeY, tiffDtype.bitsPerSample, tiffDtype.sampleFormat, "none", undefined, true, // isSubResolution
59
+ tileSize);
60
+ subIfds.push({ tags: subTags, tiles: subTiles });
61
+ }
62
+ return {
63
+ tags,
64
+ tiles: mainTiles,
65
+ subIfds: subIfds.length > 0 ? subIfds : undefined,
66
+ };
67
+ };
68
+ // Read planes with bounded concurrency
69
+ const mainIfds = new Array(totalPlanes);
70
+ const effectiveConcurrency = Math.max(1, Math.min(concurrency, totalPlanes));
71
+ for (let start = 0; start < totalPlanes; start += effectiveConcurrency) {
72
+ const end = Math.min(start + effectiveConcurrency, totalPlanes);
73
+ const batch = [];
74
+ for (let i = start; i < end; i++) {
75
+ batch.push(buildPlaneIfd(i).then((ifd) => { mainIfds[i] = ifd; }));
76
+ }
77
+ await Promise.all(batch);
78
+ }
79
+ return buildTiff(mainIfds, { compression, compressionLevel, format });
80
+ }
81
+ // ── Internal helpers ────────────────────────────────────────────────
82
+ /**
83
+ * Slice a plane into tiles or return as a single strip.
84
+ * Decides based on whether the image is large enough to warrant tiling.
85
+ */
86
+ function slicePlane(planeBytes, width, height, bpe, tileSize) {
87
+ if (tileSize > 0 && (width > tileSize || height > tileSize)) {
88
+ return sliceTiles(planeBytes, width, height, bpe, tileSize, tileSize);
89
+ }
90
+ // Small image: single strip
91
+ return [planeBytes];
92
+ }
93
+ /**
94
+ * Map a linear IFD index back to (c, z, t) based on DimensionOrder.
95
+ * This is the inverse of getIfdIndex.
96
+ */
97
+ function ifdIndexToPlane(ifdIdx, dims, dimensionOrder) {
98
+ const { sizeC, sizeZ, sizeT } = dims;
99
+ // The DimensionOrder string is XYNNN where NNN are the three varying dims
100
+ // from fastest to slowest (after XY which are always the plane dimensions).
101
+ // e.g. "XYZCT" means Z varies fastest, then C, then T.
102
+ const order = dimensionOrder.slice(2); // e.g. "ZCT"
103
+ // Sizes and names in fastest-to-slowest order
104
+ const sizeMap = { Z: sizeZ, C: sizeC, T: sizeT };
105
+ const sizes = [sizeMap[order[0]], sizeMap[order[1]], sizeMap[order[2]]];
106
+ // Decompose ifdIdx: idx = d0 + sizes[0] * (d1 + sizes[1] * d2)
107
+ const d0 = ifdIdx % sizes[0];
108
+ const d1 = Math.floor(ifdIdx / sizes[0]) % sizes[1];
109
+ const d2 = Math.floor(ifdIdx / (sizes[0] * sizes[1]));
110
+ const result = {};
111
+ result[order[0]] = d0;
112
+ result[order[1]] = d1;
113
+ result[order[2]] = d2;
114
+ return {
115
+ c: result["C"] ?? 0,
116
+ z: result["Z"] ?? 0,
117
+ t: result["T"] ?? 0,
118
+ };
119
+ }
120
+ /**
121
+ * Read a single (c, z, t) plane from an NgffImage as raw bytes.
122
+ * Returns a Uint8Array of little-endian pixel data.
123
+ */
124
+ async function readPlane(image, dims, c, z, t, bpe) {
125
+ const dimNames = image.dims;
126
+ const shape = image.data.shape;
127
+ // Build selection: scalar indices for t, c, z; null for y, x
128
+ const selection = [];
129
+ for (let i = 0; i < dimNames.length; i++) {
130
+ switch (dimNames[i]) {
131
+ case "t":
132
+ selection.push(Math.min(t, shape[i] - 1));
133
+ break;
134
+ case "c":
135
+ selection.push(Math.min(c, shape[i] - 1));
136
+ break;
137
+ case "z":
138
+ selection.push(Math.min(z, shape[i] - 1));
139
+ break;
140
+ default:
141
+ // y, x — take all
142
+ selection.push(null);
143
+ break;
144
+ }
145
+ }
146
+ const result = await zarr.get(image.data, selection);
147
+ const typedArray = result.data;
148
+ // Convert to raw bytes (little-endian)
149
+ return new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
150
+ }
151
+ /**
152
+ * Extract dimension info for a sub-resolution image.
153
+ * Non-spatial dimensions (C, Z, T) are inherited from the full-res dims.
154
+ * Spatial dimensions (X, Y) come from the sub-resolution image's shape.
155
+ */
156
+ function extractLevelDimensions(image, fullDims) {
157
+ const shape = image.data.shape;
158
+ const dimNames = image.dims;
159
+ let sizeX = fullDims.sizeX;
160
+ let sizeY = fullDims.sizeY;
161
+ for (let i = 0; i < dimNames.length; i++) {
162
+ if (dimNames[i] === "x")
163
+ sizeX = shape[i];
164
+ if (dimNames[i] === "y")
165
+ sizeY = shape[i];
166
+ }
167
+ return {
168
+ ...fullDims,
169
+ sizeX,
170
+ sizeY,
171
+ };
172
+ }
173
+ //# sourceMappingURL=write.js.map
@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;IAE3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG;YAAE,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG;YAAE,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO;QACL,GAAG,QAAQ;QACX,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fideus-labs/fiff",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "description": "Present TIFF files as a zarrita.js Zarr store following the NGFF OME-Zarr data model",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,12 +40,22 @@
40
40
  "prepublishOnly": "bun run build"
41
41
  },
42
42
  "dependencies": {
43
- "geotiff": "^3.0.4-beta.1",
43
+ "geotiff": "^3.0.3",
44
+ "pako": "^2.1.0",
44
45
  "zarrita": "^0.6.1"
45
46
  },
47
+ "peerDependencies": {
48
+ "@fideus-labs/ngff-zarr": "^0.8.0"
49
+ },
50
+ "peerDependenciesMeta": {
51
+ "@fideus-labs/ngff-zarr": {
52
+ "optional": true
53
+ }
54
+ },
46
55
  "devDependencies": {
47
56
  "@fideus-labs/ngff-zarr": "^0.8.0",
48
- "@types/bun": "^1.2.15",
57
+ "@types/bun": "^1.3.9",
58
+ "@types/pako": "^2.0.4",
49
59
  "typescript": "^5.9.3"
50
60
  }
51
61
  }