Skip to content

Commit 8c9b762

Browse files
authored
Deprecate loadBioformatsZarr function. Point users to loadOmeZarr instead (#939)
* Deprecate loadBioformatsZarr fn * Formatting * Format * Update avivator labels
1 parent c01b301 commit 8c9b762

File tree

9 files changed

+56
-39
lines changed

9 files changed

+56
-39
lines changed

.changeset/clean-tires-lie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vivjs/loaders": minor
3+
---
4+
5+
Rename loadBioformatsZarr to DEPRECATED_loadBioformatsZarr to reduce confusion. Update its description to point users to loadOmeZarr instead.

packages/loaders/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export { loadOmeTiff, loadMultiTiff } from './tiff';
2-
export { loadBioformatsZarr, loadOmeZarr } from './zarr';
2+
export { loadOmeZarr, DEPRECATED_loadBioformatsZarr } from './zarr';
33

44
export { default as TiffPixelSource } from './tiff/pixel-source';
55
export { default as ZarrPixelSource } from './zarr/pixel-source';

packages/loaders/src/zarr/index.ts

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,30 @@ interface ZarrOptions {
99
fetchOptions: RequestInit;
1010
}
1111

12+
/**
13+
* Opens root of multiscale OME-Zarr via URL.
14+
*
15+
* @param source url
16+
* @param options
17+
* @return data source and associated OME-Zarr metadata.
18+
*/
19+
export async function loadOmeZarr(
20+
source: string,
21+
options: Partial<ZarrOptions & { type: 'multiscales' }> = {}
22+
) {
23+
const store = new FetchStore(source, options.fetchOptions);
24+
25+
if (options?.type !== 'multiscales') {
26+
throw Error('Only multiscale OME-Zarr is supported.');
27+
}
28+
29+
return loadOme(store);
30+
}
31+
1232
/**
1333
* Internal helper to load bioformats zarr with specified metadata and zarr directory paths.
1434
*/
15-
async function _loadBioformatsZarrWithPaths(
35+
async function _DEPRECATED_loadBioformatsZarrWithPaths(
1636
source: string | (File & { path: string })[],
1737
metadataPath: string,
1838
zarrDir: string,
@@ -58,53 +78,41 @@ async function _loadBioformatsZarrWithPaths(
5878
}
5979

6080
/**
61-
* Opens root directory generated via `bioformats2raw`. Uses OME-XML metadata,
62-
* and assumes that the source url is the root for a single image.
63-
* This function is the zarr-equivalent to using loadOmeTiff - but
64-
* somewhat deprecated now in favour of `loadOmeZarr` for OME-NGFF compliant images.
81+
* DEPRECATED: This function is designed to load Zarr data generated by an old version of bioformats2raw
82+
* (circa 2022 and pre-v0.5.0). You are probably looking for the loadOmeZarr function instead,
83+
* which is designed to load modern OME-Zarr data following the OME-NGFF specifications,
84+
* which is also the current (as of 2026) bioformats2raw output format.
6585
*
66-
* Supports both old and new bioformats2raw formats:
67-
* - Old format: METADATA.ome.xml at root, data.zarr/ directory
68-
* - New format: OME/METADATA.ome.xml, root zarr directory
86+
* OLD DESCRIPTION: Opens root directory generated via
87+
* `bioformats2raw --file_type=zarr`.
88+
* Uses OME-XML metadata, and assumes first image.
89+
* This function is the zarr-equivalent to using loadOmeTiff.
90+
*
91+
* Supports both METADATA.ome.xml and OME/METADATA.ome.xml
6992
*
7093
* @param source url
7194
* @param options
7295
* @return data source and associated OMEXML metadata.
7396
*/
74-
export async function loadBioformatsZarr(
97+
export async function DEPRECATED_loadBioformatsZarr(
7598
source: string | (File & { path: string })[],
7699
options: Partial<ZarrOptions> = {}
77100
) {
78101
// Try both old and new formats in parallel, return the first successful result
79102
// Old format: METADATA.ome.xml at root, data.zarr/ directory
80103
// New format: OME/METADATA.ome.xml, root zarr directory
81104
return Promise.any([
82-
_loadBioformatsZarrWithPaths(
105+
_DEPRECATED_loadBioformatsZarrWithPaths(
83106
source,
84107
'METADATA.ome.xml',
85108
'data.zarr',
86109
options
87110
),
88-
_loadBioformatsZarrWithPaths(source, 'OME/METADATA.ome.xml', '', options)
111+
_DEPRECATED_loadBioformatsZarrWithPaths(
112+
source,
113+
'OME/METADATA.ome.xml',
114+
'',
115+
options
116+
)
89117
]);
90118
}
91-
92-
/**
93-
* Opens root of multiscale OME-Zarr via URL.
94-
*
95-
* @param source url
96-
* @param options
97-
* @return data source and associated OME-Zarr metadata.
98-
*/
99-
export async function loadOmeZarr(
100-
source: string,
101-
options: Partial<ZarrOptions & { type: 'multiscales' }> = {}
102-
) {
103-
const store = new FetchStore(source, options.fetchOptions);
104-
105-
if (options?.type !== 'multiscales') {
106-
throw Error('Only multiscale OME-Zarr is supported.');
107-
}
108-
109-
return loadOme(store);
110-
}

sites/avivator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ static site in production.
4747

4848
## Instructions for use
4949

50-
To use Avivator to visualize your own imaging data, use the URL input in the web application to provide a URL to an OME-TIFF/Bioformats-Zarr.
50+
To use Avivator to visualize your own imaging data, use the URL input in the web application to provide a URL to an OME-TIFF/OME-Zarr.
5151

52-
To learn more about working with OME-TIFF files or Bioformats-Zarr stores, please visit the [tutorial](../tutorial/README.md).
52+
<!--To learn more about working with OME-TIFF files or OME-Zarr stores, please visit the [tutorial](../tutorial/README.md).-->

sites/avivator/src/components/Controller/components/Menu.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function Header(props) {
124124
>
125125
<TextField
126126
id="ome-input"
127-
label="OME-TIFF/Bioformats-Zarr URL"
127+
label="OME-TIFF/OME-Zarr URL"
128128
variant="filled"
129129
size="small"
130130
fullWidth

sites/avivator/src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { useEffect, useState } from 'react';
55
import {
66
AdditiveColormap3DExtensions,
77
ColorPalette3DExtensions,
8+
DEPRECATED_loadBioformatsZarr,
89
RENDERING_MODES,
910
getChannelStats,
10-
loadBioformatsZarr,
1111
loadMultiTiff,
1212
loadOmeTiff,
1313
loadOmeZarr
@@ -228,7 +228,7 @@ export async function createLoader(
228228
let source;
229229
try {
230230
source = await Promise.any([
231-
loadBioformatsZarr(urlOrFile),
231+
DEPRECATED_loadBioformatsZarr(urlOrFile),
232232
(async () => {
233233
// Transform OME-Zarr result to match bioformats format
234234
const res = await loadOmeZarr(urlOrFile, { type: 'multiscales' });

sites/docs/documentation.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,5 @@ toc:
4444
- name: Loaders
4545
- loadOmeTiff
4646
- loadOmeZarr
47-
- loadBioformatsZarr
4847
- loadMultiTiff
4948
- name: Misc

sites/docs/src/API_STRUCTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Viv wraps both Tiff- and Zarr-based data sources in a unified `PixelSource` inte
4343
source can be thought of as a multi-dimensional "stack" of image data with labeled
4444
dimensions (usually `["t", "c", "z", "y", "x"]`). A multiscale image is represented as list
4545
of pixel sources decreasing in shape. Viv provides several helper functions to intialize a
46-
loader via url: `loadOmeTiff`, `loadBioformatsZarr`, `loadOmeZarr`, and `loadMultiTiff`.
46+
loader via url: `loadOmeTiff`, `loadOmeZarr`, and `loadMultiTiff`.
4747
Each function returns a `Promise` for an object of shape `{ data: PixelSouce[], metadata: M }`,
4848
where `M` is a JavaScript object containing the format-specific metadata for the image.
4949
For OME-TIFF and Bioformats-Zarr, and MultiTiff the metadata is identical (OME-XML representation),

sites/docs/tutorial/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
NOTE (AS OF JAN 2026): This tutorial was written in 2022, and is now quite outdated.
2+
It was written before the OME-NGFF specification was published and therefore refers to bioformats2raw v0.5.0 or before which generated a zarr data representation that was a precursor to OME-NGFF/OME-Zarr.
3+
4+
5+
16
This guide demonstrates how to generate a pyramidal OME-TIFF [with Bio-Formats](https://www.glencoesoftware.com/blog/2019/12/09/converting-whole-slide-images-to-OME-TIFF.html) that can be viewed with
27
[Avivator](http://avivator.gehlenborglab.org). Viv also supports [OME-NGFF](https://github.com/ome/ngff), but tooling to generate the format remains limited as the specification matures. We will update this tutorial accordingly when a method for generating OME-NGFF is endorsed by the Open Microscopy Environment.
38

0 commit comments

Comments
 (0)