npy2bdv

pypi python license doi

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.


Getting started

Install, write a first dataset, open it in Fiji, and read it back.

Getting started
Datasets and views

Time points, channels, illuminations, tiles, angles: how views are organized.

Datasets and views
Writing datasets

Multi-channel and multi-view data, labels, metadata, missing views, tiles.

Writing datasets
Pyramids and compression

Downsampled resolution levels, block sizes, compression, and writing speed.

Pyramids and compression
Virtual stacks

Write datasets larger than RAM, plane by plane or block by block.

Virtual stacks
Pixel types

uint16, uint8 and float32 data, and which Fiji versions open them.

Pixel types
Reading and editing

Read views, crop, and add transformations to existing datasets.

Reading and editing
File format

What is inside the .h5 and .xml files.

File format
API reference

Every class and method with parameters and examples.

API reference
Changelog

Release notes and version history.

Changelog