- Notifications
You must be signed in to change notification settings - Fork3
Flow-Registration toolbox for 2P motion compensation
phflot/flow_registration
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Flow-Registration: Optical flow based motion compensation / video stabilization / registration for 2-photon imaging data
Toolbox for the compensation and stabilization of multichannel microscopy videos. The code is written in Matlab, Java (IJ Plugin) and C++. The publication for this toolbox can be foundhere and the project website with video resultshere.
To install the toolbox clone the repo or download the most recent release and run theset_path.m
script. Withsavepath
the toolbox will be permanently available in MATLAB.
Pleasecontact us for more details.
To run this toolbox, MATLAB 2018b onwards with configured C++ compiler (checkhere for supported compilers) is required.
This repository contains the demo scriptsdemos/jupiter.m
anddemos/jupiter_minimal_example.m
which run out of the box and compensate the jitter in an amateur recording of a meteor impact on jupiter. The folderdemos/examples
contains examples that illustrate use cases of the toolbox anddemos/reproduce_journal_results
contains scripts that replicate the evaluations from our paper.
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 aOF_options
object such as
options = OF_options(... 'input_file', 'input.hdf', ... % input path 'output_path', results_folder, ... % results folder 'output_format', 'MAT', ... 'alpha', [0.5, 0.5], ... % smoothness parameter 'sigma', [0.5, 0.5, 0.1; ... % gauss kernel size channel 1 0.5, 0.5, 0.1], ... % gauss kernel size channel 2 'weight', [1, 1], ... 'levels', 15, ... % solver levels 'eta', 0.86, ... % pyramid stepsize 'iterations', 25, ... % outer iterations (the larger the better the result, but slower) 'bin_size', 5, ... % binning over 5 frames from the 30 hz data 'buffer_size', 500, ... % size of blocks for the parallel evaluation (larger takes more memory) 'output_typename', [], ... 'reference_frames', 1:5 ... );
The object is then passed tocompensate_recording(options)
to run the motion compensation oninput.hdf
intoresults_folder
. To runcompensate_recording
with default parameters, only the input file and output path need to be specified.
The dataset which we used for our evaluations is available as2-Photon Movies with Motion Artifacts.
Details on the method and video results can be foundhere.
If you use parts of this code or the plugin for your work, please cite
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}}
About
Flow-Registration toolbox for 2P motion compensation