Expand description
OME-TIFF writer: BigTIFF container (via the tiff crate) plus an OME-XML 2016-06
document in the first IFD’s ImageDescription. Every export is written to a temporary
file, read back plane by plane and hash-compared to the source before it is renamed
into place. The source file is never opened for writing.
OME-TIFF is the open microscopy exchange format: an ordinary (here: Big)TIFF file with one page per plane and the full acquisition metadata as OME-XML, readable by Fiji, napari, QuPath, Bio-Formats and most image software.
§Example
use std::path::Path;
use openreadout_core::{Dataset, Result};
use openreadout_ometiff::{Codec, ExportOptions, export_ome_tiff};
/// Write channel 0 of every image of an opened file as LZW-compressed OME-TIFF.
fn channel0_to_ome_tiff(dataset: &mut dyn Dataset, input: &Path) -> Result<()> {
let mut options = ExportOptions::default();
options.select = vec!["c=0".into()];
options.codec = Codec::Lzw;
let report = export_ome_tiff(dataset, input, Path::new("channel0.ome.tiff"), &options)?;
assert!(report.verified); // every plane was read back and hash-compared
Ok(())
}Re-exports§
pub use omexml::WrittenImage;pub use omexml::build_ome_xml;pub use omexml::build_ome_xml_metadata_only;pub use pyramid::PyramidMode;
Modules§
- omexml
- OME-XML (schema 2016-06) document builder for the
ImageDescriptiontag. Spec: https://www.openmicroscopy.org/Schemas/OME/2016-06 (open standard). - pyramid
- Streaming multi-resolution export: a plane (or a rectangle of it) is read block by block and
handed to a
BlockSinklevel by level, so an image of any size is written in bounded memory.
Structs§
- Export
Options - Export options.
- Export
Report - What
exportreports. - Written
Levels - Resolution levels written for one image by a tiled export.
Enums§
- Codec
- Compression codec for the TIFF strips.
Constants§
- DEFAULT_
TILE - Default tile edge of tiled OME-TIFF output.
Functions§
- export_
ome_ tiff - Export
ds(already opened frominput) to an OME-TIFF atoutput. - export_
ome_ tiff_ with export_ome_tiffwith parallel plane decoding and progress reporting: planes are decoded by worker threads (extra handles fromctx.opener) and written sequentially in the same order, so the file is byte-identical whatever the number of threads.- no_
images_ error - The error for an image export of a file that holds no images (a VSI without its folder of
.etspixel files, for example).writernames the export, as inError::unsupported. The file’s first note usually says why, so it goes in the message. - refused_
images - Without
--image, the images whose planes the reader refuses (Dataset::pixels_refused): they are left out of the export and listed. When that would leave nothing, none are left out, so the reader’s error says why.