Corrects local, non-linear drift in tissue by estimating dense optical flow and using it for warping images forward and backward from and to a selectable key frame.
It comes as command line tool for Python >= 3.6
Undrift can be used to remove breathing deformations in live imaging.
Left (magenta) original z-stack; right (green) undrift result:
undrift_breathe.mp4
This example used the following command
undrift original.tif --smooth_xy 0.7 --smooth_t 0 --winsize 31 --poly_n 5 --poly_sigma 1.1 --levels 1 --key_frame 20 --pre_reg
The input image tif needs to be single or multi-channel z-stack or 2D movie.
pip install git+https://git.ista.ac.at/csommer/undrift.git
-
Clone repository to
<path>
-
With (Ananconda) command line
cd <path>/undrift
-
Pip install undrift with:
pip install -e .
Required python packages are installed automatically
Basic command:
undrift <movie_tif_file> [<more_tif_files>...]
Command line help:
undrift --help
to use undrift with spatial smoothing of 50 px for all tif files in a folder recursively on Windows, use
for /r %i in (*.tif) do undrift --smooth_xy 50 "%i"
in the (Anaconda) command prompt