npy2bdv¶
npy2bdv writes numpy arrays into the HDF5/XML format of Fiji BigDataViewer and BigStitcher, and reads them back. It is built for light-sheet and other multi-view microscopy: many time points, channels, illuminations, tiles and angles, fast writing during acquisition, and datasets larger than RAM.
import numpy as np
import npy2bdv
stack = np.random.randint(0, 1000, (64, 256, 256), dtype=np.uint16) # (z, y, x)
writer = npy2bdv.BdvWriter("first_dataset.h5")
writer.append_view(stack)
writer.write_xml()
writer.close()
Open first_dataset.xml in Fiji with Plugins › BigDataViewer › Open XML/HDF5.
Install, write a first dataset, open it in Fiji, and read it back.
Time points, channels, illuminations, tiles, angles: how views are organized.
Multi-channel and multi-view data, labels, metadata, missing views, tiles.
Downsampled resolution levels, block sizes, compression, and writing speed.
Write datasets larger than RAM, plane by plane or block by block.
uint16, uint8 and float32 data, and which Fiji versions open them.
Read views, crop, and add transformations to existing datasets.
What is inside the .h5 and .xml files.
Every class and method with parameters and examples.
Release notes and version history.