nd2-rs
Pure Rust library for reading Nikon ND2 microscopy files (v2.0, v2.1, v3.0).
- Metadata:
attributes(),text_info(),experiment(),sizes(),loop_indices() - Pixel access:
read_frame(sequence_index)andread_frame_2d(p, t, c, z) - Encodings: uncompressed and zlib-compressed
ImageDataSeq
Installation
[]
= "0.1.5"
Usage
use ;
CLI
info prints concise dataset shape JSON:
frame supports writing a single channel to 16-bit TIFF by sequence or by (p, t, c, z).
Recent fixes improved compatibility with ND2 files that:
- store channels in-pixel instead of as separate sequence chunks
- use padded uncompressed row strides via
uiWidthBytes - expose
ImageDataSeqchunk sizes in the file map that do not match the on-disk chunk header - number sequence chunks with position as the outer loop and time as the fast loop
Error reporting
Nd2Error is now grouped by source:
Filefor malformed/invalid file contentsInputfor user-provided indices and argumentsInternalfor internal arithmetic/logic issuesUnsupportedfor unsupported ND2/CLX variants
Docs
- DATASTRUCTURE.md – format details and parsing
References
Inspired by the Python nd2 library.
License
MIT OR Apache-2.0