Displaying a series of images interactively using Holoviews
If you have a series of images, like a time series or a z-stack, it might be helpful to display them in a code notebook for exploration or reference.
Microscopy images may have characteristics that make them difficult to view using generic tools, such as Preview in MacOS. These include proprietary file formats and non-standard bit-depth. There are several free and open-source software applications that can be used for image viewing and analysis, such as ImageJ/Fiji, but if you want to use Python for analysis, it can be advantageous to also display your images alongside your transformations and feature extractions.
In this notebook, we demonstrate how to use Holoviews to display a series of images with an interactive slider for ease of browsing through the images. Holoviews is a Python library that allows you to plot data by describing it semantically. It supports multiple plotting libraries: Bokeh, Plotly, and Matplotlib. By using Holoviews with Bokeh, we can easily create an interactive display that takes advantage of Javascript without having the write an Javascript or create any callbacks.
The microscopy data in our demonstration were originally from the following manuscript, via the Cell Tracking Challenge:
Neumann, B., et al. (2010). Phenotypic profiling of the human genome by time-lapse microscpy reveals cell division genes. Nature, 464, 721-727.
After loading in our image series as a Mantle image_directory
data entity, we read in the images using scikit-image. Then, we construct a Holoviews HoloMap of Holoviews Image plots that display our images.