Variational optical-flow motion correction for 2-photon microscopy videos and 3D scans
Project description
🚧 Under Development
This project is still in an alpha stage. Expect rapid changes, incomplete features, and possible breaking updates between releases.
- The API may evolve as we stabilize core functionality.
- Documentation and examples are incomplete.
- Feedback and bug reports are especially valuable at this stage.
PyFlowReg
Python bindings for Flow-Registration - variational optical-flow motion correction for 2-photon (2P) microscopy videos and volumetric 3D scans.
Derived from the Flow-Registration toolbox for compensation and stabilization of multichannel microscopy videos. The original implementation spans MATLAB, Java (ImageJ/Fiji plugin), and C++. See the publication and the project website for method details and video results.
Related projects
- Original Flow-Registration repo: https://github.com/FlowRegSuite/flow_registration
- ImageJ/Fiji plugin: https://github.com/FlowRegSuite/flow_registration_IJ
- Napari plugin: https://github.com/FlowRegSuite/napari-flowreg
Requirements
This code requires python 3.10 or higher.
Initialize the environment with
conda create --name pyflowreg python=3.10
conda activate pyflowreg
pip install -r requirements.txt
or on windows
pip install -r requirements.txt
to enable Sutter MDF file support.
Installation via pip and conda
conda create --name pyflowreg python=3.10
pip install pyflowreg
To install the project with full visualization support, you can install the napari plugin:
pip install pyflowreg[vis]
Getting started
This repository contains demo scripts under experiments and
demo notebooks under notebooks. The demos with the jupiter sequence should run out of the box.
The plugin supports most of the commonly used file types such as HDF5, tiff stacks and matlab mat files. To run the motion compensation, the options need to be defined into a OF_options object.
The python version of Flow-Registration aims at full MATLAB compatibility, any missing functionality should be reported as an issue. The API is designed to be similar to the original MATLAB code, with some adjustments for Python conventions.
Dataset
The dataset which we used for our evaluations is available as 2-Photon Movies with Motion Artifacts.
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 for Flow-Registration
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}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyflowreg-0.1.0a2.tar.gz.
File metadata
- Download URL: pyflowreg-0.1.0a2.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a92bbf3f832e6fcf58928197d0bf65b64b63ff967b9ce592daf1c25f45207a7a
|
|
| MD5 |
aa80ade816cadab8c8b78bed2a958dda
|
|
| BLAKE2b-256 |
bb4dd99aa02fa5d21fb277201e1b4989673c29e6128f3b9c0d501712add7e714
|
Provenance
The following attestation bundles were made for pyflowreg-0.1.0a2.tar.gz:
Publisher:
pypi-release.yml on FlowRegSuite/pyflowreg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyflowreg-0.1.0a2.tar.gz -
Subject digest:
a92bbf3f832e6fcf58928197d0bf65b64b63ff967b9ce592daf1c25f45207a7a - Sigstore transparency entry: 428929019
- Sigstore integration time:
-
Permalink:
FlowRegSuite/pyflowreg@0a9278c38dd4d9413bbf64f73cb0757d8889f288 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/FlowRegSuite
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@0a9278c38dd4d9413bbf64f73cb0757d8889f288 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyflowreg-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: pyflowreg-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 86.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
847f4ec02c6f072b30c02e3510603c0a9891c7d1baff44db4f6b05a07123bc7d
|
|
| MD5 |
a7f2fc6f816ee44c50b2eb03a959306e
|
|
| BLAKE2b-256 |
90d3a655ee5c0a131807ba1f7ced3f4b1816709782d3bfcd46a2e8bf607de9d2
|
Provenance
The following attestation bundles were made for pyflowreg-0.1.0a2-py3-none-any.whl:
Publisher:
pypi-release.yml on FlowRegSuite/pyflowreg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyflowreg-0.1.0a2-py3-none-any.whl -
Subject digest:
847f4ec02c6f072b30c02e3510603c0a9891c7d1baff44db4f6b05a07123bc7d - Sigstore transparency entry: 428929022
- Sigstore integration time:
-
Permalink:
FlowRegSuite/pyflowreg@0a9278c38dd4d9413bbf64f73cb0757d8889f288 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/FlowRegSuite
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@0a9278c38dd4d9413bbf64f73cb0757d8889f288 -
Trigger Event:
push
-
Statement type: