time_stacker
creates a time-stack image show from a video or animated gif. This type of picture is best used to showcase the passage of time where the background is static and the focal object moves in a non-overlapping trajectory (e.g. ball bouncing down a hallway).
General programs:
- FFmpeg [4.3.1 ]
--> Download FFmpeg: https://ffmpeg.org/download.html
--> Download and install Homebrew: https://docs.brew.sh/Installation
--> Install ffmpeg using Homebrew: https://formulae.brew.sh/formula/ffmpeg
Python modules:
- argparse [1.1 ]
- ffmpeg-python [0.2.0 ]
- matplotlib [3.1.3 ]
- numpy [1.18.1]
- pip [20.0.2]
- sys [standard]
- os [standard]
- datetime [standard]
NOTE: time_stacker is tested in a Python3.6 virtual environment. I noticed issues with ffmpeg
in later Python versions with packages used in a separate program, but not all of those are used here. All this to say, the versioning of these packages should not really affect time\_stacker
's performance.
I recommend running this package in an Anaconda-based virtual environment. Anaconda can be downloaded here.
Make sure conda
is installed (should return something like conda 4.7.11
):
conda -V
Update conda if needed (press y
when prompted):
conda update conda
Create a Python 3 virtual environment (replace python36
with your name of choice):
conda create -n python36 python=3.6 anaconda
NOTE: See note above about Python 3.6 vs. 3.7
Activate your virtual environment:
conda activate python36
OR (if that doesn't work):
source activate python36
For more details about creating a conda virtual environment, see here. Once the environment is set up and activated, we can install the dependencies listed in the Requirements
section above.
Download the script files (can be done with git clone
if user is familiar with git
or by directly downloading the .py
files into a single folder)
Cloning the git repository:
cd <folder of interest>
git clone https://github.com/adamspierer/time_stacker.git
NOTE: As of now, the platform itself is not callable as a module and these steps merely download the dependencies. The script files must be directly referenced when running the program. See our tutorial for usage instructions.
drosophila.mov
- video of fruit flies climbing in vials
test.tiff
- output fromdrosophila.mov
The following is a general overview of the program's usage. For detailed instructions, please see our tutorial page.
Make sure the time_stacker scripts are downloaded and in a folder on your computer. Navigate to the time\_stacker
directory and type:
cd <path_to_time_stacker>
Type and run (placeholder to generate the current ./output/test.tiff
file):
python ./script/time_stacker.py --input_file ./example/drosophila.mov --output_file ./output/test.tiff --method min --interval 20
time_stacker.py
- Creates a time-stack photo from a video or animated gif
We encourage you to to visit our Tutorial page for a more thorough walk-through, description, and various caveats.
1.0 - Program works with some necessary frills.
This software has only been tested on a Mac OS X (Sierra 10.15.7) but is likely not limited to this OS.
Contributors can fork from the repository and submit a pull request when modifications are ready. Please document the changes you made and any pertinent information that will help in the review of changes.
I plan to release maintenance updates as needed, though am unlikely to modify the platform's main functionality.
This script was written for generating figures for the following manuscript.
This work is licensed under the MIT license.
Written by Adam Spierer.