A library for writing/reading HDF5/XML datasets of Fiji BigDataViewer/BigStitcher format as numpy arrays.
Run pip install npy2bdv
in the command line. Use import npy2bdv
in the code.
For a quick start, see examples in the Jupyter
notebook
.
API documentation.
- compression methods
None
,gzip
,lzf
(None
by default). - downsampling options:
- any number of mipmap levels
- computed via averaging, compatible with BigDataViewer/BigStitcher convention.
- user-defined block sizes for H5 storage (default
4,256,256
) - any number of time points, illuminations, channels, tiles, angles.
- arbitrary affine transformation for each individual view (e.g. translation, rotation, shear).
- arbitrary voxel calibration for each view, to account for spatial anisotropy.
- individual views can differ in dimensions, voxel size, voxel units, exposure time, and exposure units.
- missing views are labeled in XML automatically.
- support of additional meta-information:
- camera properties:
name
,exposureTime
,exposureUnits
microscope
(name and version),user
- camera properties:
- writing virtual stacks of arbitrary size, by plane or sub-stack. Handy when your stack is larger than your RAM.
- virtual stacks can be written with multiple subsampling levels and compression.
See Recent changes
Currently speeds betewen 150 - 320 MB/s were achieved with confidence. Speeds of up to 2300 MB/s reported in earlier versions are likely due to bugs in testing methods in notebook examples_h5writing.ipynb
. More tesing is underway.
This code was inspired by Talley Lambert's code and improved by generous input from Adam Glaser, VolkerH, Doug Shepherd, Peter H, Mike Taormina and Pradeep Rajasekhar.
To report issues or bugs please use the issues tool.
You can cite it like so
If you find this library useful, send me some love 😊
It will give me some dopamine and motivation to keep improving it ❤️