Skip to content

Commit

Permalink
Add OME-Zarr performance activity
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Sep 28, 2024
1 parent 0e2a7c7 commit dde48a6
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
6 changes: 6 additions & 0 deletions _includes/ome_tiff/inspect_metadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h4 id="inspect_metadata"><a href="inspect_metadata">Inspect OME-TIFF metadata</a></h4>

- Download the OME-TIFF image file [xy_xyc__two_images.ome.tiff](https://github.com/NEUBIAS/training-resources/raw/master/image_data/xy_xyc__two_images.ome.tiff)
- Open the OME-XML metadata of this file and try to understand it
- Interesting entries entail:
- `PixelPhysicalSize`
9 changes: 9 additions & 0 deletions _includes/ome_tiff/inspect_metadata_fiji_bioformats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- Open Fiji
- Drag and drop the OME-TIFF image onto Fiji
- The Bio-Formats Importer will open
- `[X]` Display OME-XML metadata
- [ OK ]
- Observe that there are only two datasets, but stored at different resolution levels
- Select all images
- [ OK ]
- Inspect the OME-XML metadata
6 changes: 6 additions & 0 deletions _includes/ome_zarr/ome_zarr_performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h4 id="read_performance"><a href="#read_performance">OME-Zarr read performance</a></h4>

Measure how fast you can read OME-Zarr chunks.

References:
- https://forum.image.sc/t/benchmarking-ome-zarr-s3-access/102262
7 changes: 7 additions & 0 deletions _includes/ome_zarr/ome_zarr_performance_vizarr_chrome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- Open the Google Chrome webbrowser
- Open the below web address to launch vizarr to visualise an OME-Zarr image
- `https://hms-dbmi.github.io/vizarr/?source=https://s3.embl.de/yeast-clem/hela/images/ome-zarr/em-overview.ome.zarr`
- Note that you may replace the part after `?source=` with another OME-Zarr URL that you may be interested in testing.
- Google Chrome: [ View > Developer > JavaScript Console ] and then choose the "Network" tab.
- Now, in vizarr, move around, e.g., zoom in and out; this should trigger the loading of additional OME-Zarr chunks, which can be observed in the Network tab, where you can see how large each chunk and how long it took to read it.
- Typical, in our experience, is a few hundred ms for a few hundred KB.
27 changes: 26 additions & 1 deletion _modules/ome_tiff.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ figure_legend: "TIFF is a planar file format, where one TIFF file can contain mu

multiactivities:
- ["ome_tiff/lif2ometiff.md", [["NGFF-Converter", "ome_tiff/lif2ometiff_fiji_ngff-converter.md"]]]
- ["ome_tiff/inspect_metadata.md", [["Fiji Bio-Formats", "ome_tiff/inspect_metadata_fiji_bioformats.md"]]]

assessment: >
Expand All @@ -48,5 +49,29 @@ learn_next:
external_links:
- "[Converting an image series to OME-TIFF](https://forum.image.sc/t/tiff-series-to-ome-ngff/101081/7)"
- "[Wikipedia: TIFF](https://en.wikipedia.org/wiki/TIFF)"
- "[TODO: Add OME-TIFF link]()"
- "[OME-TIFF metadata specification](https://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2016-06/ome_xsd.html#TiffData)"
---

#### General comments

The TIFF file format is already complex and the OME-TIFF variant is adding even more metadata on top. To fully understand everything is way beyond the aim of this training material. We will just scratch the surface to understand the most important concepts.

#### IFDs and image planes

TIFF is a planar image data format. Internally there are always pairs of IFD and data blocks. IFD stands for "Image File Directory" and contains information about where the corresponding image data block can be found in the file, the image width and height, as well as its datatype.

One TIFF file can contain many IFD/data pairs.

The IFD/data pairs may contain images of different sizes and different datatypes.

#### Physical pixel size

The TIFF format does natively support storing pixel size metadata, typically in units of centimetre or inches.

#### Resolution pyramids and chunking

The TIFF format supports the concept of resolution pyramids, and chunked storage of pixels within one plane. However there is no 3-D chunking available. Thus, TIFF can in fact be used as a 2-D big image data format.

#### Channels, z-planes, and time points

The TIFF format does **not** natively support storing information about which channel, z-plane or time-point an IFD/data pair belongs to. This bioimaging specific information is handled by additional metadata of TIFF variants, such as OME-TIFF.

0 comments on commit dde48a6

Please sign in to comment.