Scientific video can be packaged in various ways: familiar video formats like .AVI and .MOV, folders full of numbered images, or "stacks" of TIFF images. Each of these requires a separate Python module. And, once loaded, they have different methods for accessing individual images, looping through the images in bulk, or access a specific range. PIMS can do all of these using a consistent interface, handling the differences between different inputs invisibly.
Everything is demonstrated in this IPython notebook.
One of the following is required:
- [scikit-image]
- [matplotlib]
- [scipy]
Depending on what file formats you want to read, you will also need:
- ffmpeg (video formats such as AVI, MOV)
- Pillow (improved TIFF support)
- libtiff (alternative TIFF support)
- Tifffile, which is included in PIMS
Installation is simple on Windows, OSX, and Linux, even for Python novices.
To get started with Python on any platform, download and install Anaconda. It comes with the common scientific Python packages built in.
If you are using Windows, I recommend 32-bit Anaconda even if your system is 64-bit. (One of the optional dependencies is not yet compatible with 64-bit Python.)
Open a command prompt. That's "Terminal" on a Mac, and "Start > Applications > Command Prompt" on Windows. Type these lines:
pip install http://github.com/soft-matter/pims/zipball/master
In the command prompt, type
ipython notebook
You will need libtiff, which you can obtain by running the following command in a command prompt:
pip install -e svn+http://pylibtiff.googlecode.com/svn/trunk/
To load video files directly, you need FFmpeg. You can work around this requirement by converting any video files to folders full of images using a utility like ImageJ. Reading folders of images is supported out of the box, without OpenCV.
The code is under active development. To update to the current development version, run this in the command prompt:
pip install --upgrade http://github.com/soft-matter/pims/zipball/master
- Daniel B. Allan
- Thomas A. Caswell (major refacotring, additional formats)
This package was originally developed and maintained by Daniel Allan, as part of his PhD thesis work on microrheology in Robert L. Leheny's group at Johns Hopkins University in Baltimore, MD. The work was supported by the National Science Foundation under grant number CBET-1033985.
Dan can be reached at [email protected].