Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyPI - Version PyPI - Python Version PyPI - License PyPI - Downloads PyPI DownloadsTests Documentation Status

FlowReg logo napari-FlowReg-Formats

This repository contains the file format support for the Flow-Registration toolbox in napari. It reads and writes the microscopy formats used across the FlowRegSuite through the pyflowreg and flowreg3d I/O layers, so a recording that opens here opens identically in the motion correction pipeline.

Everything works out of the box. Drag a recording into napari and it opens: TIFF (including ScanImage, OME-TIFF, ImageJ hyperstacks and BigTIFF), HDF5, MATLAB MAT in both the classic and the v7.3 container, and Sutter MDF. MAT and HDF5 videos work in both 2D and 3D, including multi-channel recordings, volumetric time series, and the MATLAB axis order that older Flow-Registration data is written in. The structure is detected from the file itself, so no configuration is needed for the common cases.

Recordings load lazily, so a volumetric stack larger than memory can be inspected frame by frame. An import dialog covers what automatic detection cannot settle on its own: 2D against 3D interpretation, axis order, which datasets are channels, and folding a flat ScanImage page sequence into (T, Z, Y, X) volumes.

The publication for the underlying toolbox can be found here and the project website with video results here.

Read the Documentation

Related projects

Fig1

Installation via pip and conda

To install the plugin via conda, you can create a new environment and install napari along with the plugin:

conda create -n flowreg -c conda-forge python=3.11
conda activate flowreg

You can then install napari-flowreg-formats via [pip]:

pip install napari[all] napari-flowreg-formats

or directly from the GitHub repository:

pip install git+https://github.com/FlowRegSuite/napari-flowreg-formats.git

napari is not a runtime dependency of this package, following napari plugin practice, so install it alongside as shown above.

The plugin depends on pyflowreg and flowreg3d, which are currently published as pre-releases. The dependency specifiers name those pre-releases explicitly, so a plain pip install resolves them and no --pre flag is needed.

Supported formats

Family Extensions 2D 3D Lazy Auto-detected
TIFF .tif .tiff yes yes yes series axes, ImageJ hyperstack structure
BigTIFF .btf .tf8 .tf2 yes yes yes as above, without the 4 GB limit
OME-TIFF .ome.tif .ome.tiff yes yes yes OME axes, physical pixel size
ScanImage TIFF .tif yes yes yes slices per volume, frames per slice, channels, z step, frame rate
HDF5 .h5 .hdf5 .hdf yes yes yes dataset discovery, writer provenance, stored axis order
MATLAB MAT .mat (v5/v7 and v7.3) yes yes v7.3 only variable discovery, MATLAB axis order and dimension reversal
Sutter MDF .mdf yes no acquisition metadata; Windows only

Extension matching is case-insensitive, so .TIF, .H5 and .MAT work as written. See the supported formats reference for the full matrix, including the formats this plugin deliberately leaves to others.

Usage

Drag a recording into napari. For extensions that napari's built-in reader also claims, such as .tif and .h5, napari shows a reader chooser; select FlowReg Formats and tick the box to remember that choice for the extension.

For explicit control over dimensions, channels and TIFF reshaping, open File > FlowReg Import or Plugins > FlowReg Formats > FlowReg Import. The dialog reports the detected structure, lets you override every field, and loads off the Qt event loop so the viewer stays responsive.

FlowReg Import dialog in napari

Above, a flat ScanImage page sequence has been probed: the volume structure was read from the acquisition metadata, the recording was identified as a volumetric time series, and the 16 slices per volume were filled in automatically. Load applies it; Copy as Python emits the equivalent script.

Layers are written back with File > Save Selected Layers, or through File > FlowReg Export for control over the dataset naming pattern, MATLAB axis order, the MAT container version and compression. Selected layers become the channels of one recording.

FlowReg Export dialog in napari

The same import is available from a script, with no GUI:

import napari
from napari_flowreg_formats import ImportSpec, load

viewer = napari.Viewer()

# automatic: the structure is detected from the file
viewer.open("recording.tif", plugin="napari-flowreg-formats")

# explicit: fold a flat ScanImage page sequence into volumes
for data, meta, layer_type in load(
    "scanimage_volumes.tif",
    ImportSpec(is_3d=True, slices_per_volume=30, frames_per_slice=1, lazy="always"),
):
    viewer._add_layer_from_data(data, meta, layer_type)

napari.run()

The Copy as Python button in the import dialog emits exactly this call for the settings currently on screen, so an interactive import is always reproducible.

Two synthetic sample recordings are available under File > Open Sample > FlowReg Formats, so the plugin can be tried without any data on disk.

Citation

Details on the original method and video results can be found here.

If you use parts of this code or the plugin for your work, please cite

"Pyflowreg," (in preparation), 2025.

and

P. Flotho, S. Nomura, B. Kuhn and D. J. Strauss, "Software for Non-Parametric Image Registration of 2-Photon Imaging Data," J Biophotonics, 2022. doi:https://doi.org/10.1002/jbio.202100330

BibTeX entry

@article{flotea2022a,
    author = {Flotho, P. and Nomura, S. and Kuhn, B. and Strauss, D. J.},
    title = {Software for Non-Parametric Image Registration of 2-Photon Imaging Data},
    year = {2022},
  journal = {J Biophotonics},
  doi = {https://doi.org/10.1002/jbio.202100330}
}

License

Distributed under the MIT License. See LICENSE.txt.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari_flowreg_formats-0.1.0a1.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napari_flowreg_formats-0.1.0a1-py3-none-any.whl (85.8 kB view details)

Uploaded Python 3

File details

Details for the file napari_flowreg_formats-0.1.0a1.tar.gz.

File metadata

  • Download URL: napari_flowreg_formats-0.1.0a1.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for napari_flowreg_formats-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 95b1fc514e88fc84d92dc661a43dfb105f7fb847a7729f02eb9721b046d89a5b
MD5 762cf7bef72e3995f15b65a42fed448d
BLAKE2b-256 6d41d245da5541155bc84a8ca4b23c13f0722e13e11e9d8f6e1bccb09c0c27f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_flowreg_formats-0.1.0a1.tar.gz:

Publisher: pypi-release.yml on FlowRegSuite/napari-flowreg-formats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file napari_flowreg_formats-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_flowreg_formats-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb09496a552615831dc602508b487560de1aec7a4c75355779209ea938ddcb45
MD5 aa3e6bceab85222ad9ebc9b9e76cc6c2
BLAKE2b-256 33852227c601ccf437d2152cafbfa8059e49e2ce01ff98a62626d88c3c637bcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_flowreg_formats-0.1.0a1-py3-none-any.whl:

Publisher: pypi-release.yml on FlowRegSuite/napari-flowreg-formats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page