Error: duplicate field 'TiffData' #1

Closed
opened 2026-01-03 18:08:47 +01:00 by tscode · 1 comment
tscode commented 2026-01-03 18:08:47 +01:00 (Migrated from github.com)

I have encountered problems when trying to extract the OME metadata from the sample OME-TIFF files at https://docs.openmicroscopy.org/ome-model/5.6.3/ome-tiff/data.html

The issue seems to be that the metadata in question has multiple TiffData elements (often one for each XY plane), while the current implementation of Pixels only allows for an Option<TiffData>.

To reproduce the bug, download (for example) this file https://downloads.openmicroscopy.org/images/OME-TIFF/2016-06/bioformats-artificial/multi-channel.ome.tif and run

use std::path::PathBuf;
use ndbioimage::reader::Reader;

fn main() {
    let path = PathBuf::from("./multi-channel.ome.tif");
    let reader = Reader::new(path, 0).unwrap();
    reader.get_ome().unwrap();
}

Having said that, thanks alot for creating ome-metadata and ndbioimage! These rust packages are extremely useful for my current project :)

I have encountered problems when trying to extract the OME metadata from the sample OME-TIFF files at https://docs.openmicroscopy.org/ome-model/5.6.3/ome-tiff/data.html The issue seems to be that the metadata in question has multiple `TiffData` elements (often one for each XY plane), while the [current implementation](https://github.com/wimpomp/ome-metadata/blob/68281d480932dd8dc74549ae5dff6beef7cf0be2/src/ome.rs#L1820) of `Pixels` only allows for an `Option<TiffData>`. To reproduce the bug, download (for example) this file https://downloads.openmicroscopy.org/images/OME-TIFF/2016-06/bioformats-artificial/multi-channel.ome.tif and run ```rust use std::path::PathBuf; use ndbioimage::reader::Reader; fn main() { let path = PathBuf::from("./multi-channel.ome.tif"); let reader = Reader::new(path, 0).unwrap(); reader.get_ome().unwrap(); } ``` Having said that, thanks alot for creating `ome-metadata` and `ndbioimage`! These rust packages are extremely useful for my current project :)
wimpomp commented 2026-01-04 17:09:03 +01:00 (Migrated from github.com)

Thanks! I replaced Option with Vec in ome-metadata 0.4.0, as well as a few other fields which might cause similar problems. The openmicroscopy examples seem to work now. ndbioimage 2026.1.2 is using the ome-metadata 0.4.0 now.

Thanks! I replaced Option<TiffData> with Vec<TiffData> in ome-metadata 0.4.0, as well as a few other fields which might cause similar problems. The openmicroscopy examples seem to work now. ndbioimage 2026.1.2 is using the ome-metadata 0.4.0 now.
Sign in to join this conversation.