OME-TIFF
Prerequisites
Before starting this lesson, you should be familiar with:
Learning Objectives
After completing this lesson, learners should be able to:
Understand the basic concept of the TIFF image data format
Understand that there are various TIFF variants, such as ImageJ-TIFF and OME-TIFF
Create OME-TIFF files
Convert other image data into OME-TIFF files
Inspect OME-TIFF image data and metadata
Motivation
- Representing microscopy image data on disk is essential
- Understanding the pros and cons as well how to work with different image data formats is essential
- TIFF is among the most wide-spread microscopy image file formats
- TIFF is tricky, because the internal content of a .tiff file can vary substantially
- OME-TIFF is an attempt to create a TIFF standard for bioimaging
Concept map
Figure
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.
Activities
Open OME-TIFF
- Download the OME-TIFF image file xy_xyc__two_images.ome.tiff
- Open the OME-XML metadata of this file and try to understand it
- Interesting entries entail:
PixelPhysicalSize
Show activity for:
Fiji Bio-Formats GUI
- 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
Python/BioIO
Save as OME-TIFF
Save an image as OME-TIFF.
Show activity for:
Fiji Bio-Formats GUI
- Open Fiji
- [ File › Open Samples › Fluorescent Cells ]
- Add a sensible spatial calibration
- [ Image > Properties ]
- Set the pixel size to 0.1 micrometer (or so)
- Save as OME-TIFF
- [ Plugins › Bio-Formats › Bio-Formats Exporter ]
- File Name:
fluo_cells.ome.tif
- It is critical to add the
ome.tif
orome.tiff
extension!- Files of Type: Due to inconsistent behaviour (e.g., PNG extension is automatically added, OME-TIFF extensions are not added) we recommended not to select anything here, but rather manually specify the respective extension in the “File Name”
- Observe that there are useful options, allowing you to
- split the image into multiple files
- compress the image data
- Open the file again in Fiji and check which metadata has been preserved
- For us, the channel LUTs were not preserved (January 2025)
Python/BioIO
Convert an image file to OME-TIFF
- Open the LIF or CZI image files
- Observe that the LIF and CZI files contain multiple independent images
- Observe that the images in the LIF file have different dimensions
- Take note of important metadata, such as the spatial calibration
- Convert the files to OME-TIFF
- Open the OME-TIFFs
- Check whether the image data and metadata have been preserved
Data
Download the image files image.lif
and xyz__multiple_images.czi to a convenient local directory.
For example: ~/image_data_course/data/czi/xyz__multiple_images.czi
Show activity for:
NGFF-Converter
This activity uses the NGFF Converter to convert a LIF image data set into an OME-TIFF image data set; and it uses Fiji to inspect the content of both the LIF and the OME-TIFF.
- Inspect LIF using Fiji:
- Drag and drop the LIF image onto Fiji
- The Bio-Formats Importer will open
[X]
Display OME-XML metadata- [ OK ]
- Select all images
- [ OK ]
- Take note of
- Number of images
- For each image note its dimensions and spatial calibration
- Inspect the OME-XML metadata and note down some values that you deem important
- Convert LIF to OME-TIFF using the NGFF converter:
- Open the NGFF converter; tool website
- Drag and drop the LIF file onto it
- A dialog will open:
- Output format: OME-TIFF
- Output location: As you wish
- [ Apply ]
- [ Run Jobs ]
- Inspect OME-TIFF using Fiji:
- Drag and drop the created OME-TIFF onto Fiji
- Repeat the same steps as for the original LIF file
- Check whether all image data and metadata has been preserved
Key points
- The NGFF converter is a nice tool to create OME-TIFF
- OME-TIFF can contain multiple image data sets
- OME-TIFF can contain resolution pyramids
Python/BioIO
bfconvert
This activity uses the
bfconvert
tool to convert a czi image data set to the OME-TIFF format; and it uses Fiji to inspect the content of the OME-TIFF data.Note that bfconvert is capable of generating a variety of other formats (in addition to OME-TIFF) such as tiff, png, jpeg, OME-XML, etc., although we will focus on the OME-TIFF in this activity.
Before starting, make sure you have downloaded the
xyz__multiple_images.czi
somewhere convenient. We refer to this input path as/path/to/xyz__multiple_images.czi
. Also create an output folder for OME-TIFF. We refer to this output folder as/path/to/OME-TIFFs
Basic conversion
bfconvert /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images.ome.tiff
This will create an OME-TIFF containing two images. Often, this is not convenient, and we would prefer to specify a single series for conversion.
Select one series and convert
bfconvert -series 1 /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images_s1.ome.tiff
Specify compression
bfconvert -series 1 -compression "JPEG-2000 Lossy" /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images_s1_compressed.ome.tiff
Check output size
du -sh /path/to/OME-TIFFs/* # unix
Select one series and specify z-range
Use the option-range START END
bfconvert -series 0 -range 0 0 /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images_s0_range0-0.ome.tiff
Crop in 3-D
Use the option-crop x,y,WIDTH,HEIGHT
bfconvert -series 0 -range 0 0 -crop 20,30,100,100 /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images_s0_crop3D.ome.tiff
Inspect the output OME-TIFFs using Fiji:
- Drag and drop the created OME-TIFFs onto Fiji
- Repeat the same steps as for the original czi file
- Check whether all image data and metadata have been preserved
Assessment
Fill in the blanks
- TODO ___ .
- TODO ___ .
Solution
- TODO
- TODO
Follow-up material
Recommended follow-up modules:
Learn more: