Python Image Sequence
pip install pimspims: Python Image Sequence
What Problem Does PIMS Solve?
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, accessing a specific range, or dealing with multidimensional files. PIMS can do all of these using a consistent interface, handling the differences between different inputs invisibly.
Formats readable by pims include:
- Directories or zipfiles of still images (most formats, including TIFF, JPEG, PNG, BMP), and TIFF stacks
- Microscope images supported by the Bio-formats project, including Leica, Nikon, Olympus, and Zeiss formats. Requires separate installation; see below.
- Movie formats and codecs supported by ffmpeg, including AVI, QuickTime MOV, and H.264 (MP4). May require separate installation; see below.
- CINE files from Vision Research cameras
- SEQ files from NorPix StreamPix software
PIMS is based on readers by:
- scikit-image
- ffmpeg and PyAV (video formats such as AVI, MOV)
- jpype (interface with Bio-formats)
- Pillow (improved TIFF support)
- tifffile (alterative TIFF support)
- pims_nd2 (improved Nikon .nd2 support)
- imageio (a multi-purpose reader package that reads and writes many formats)
- moviepy (a Python module that supports video editing)
- nd2reader (a Pure Python module for reading Nikon NIS Elements ND2 images and metadata)
Examples & Documentation
Everything is demonstrated in this IPython notebook.