SciPy 2023

image analysis and visualization in Python with scikit-image, napari, and friends
07-10, 08:00–12:00 (America/Chicago), Classroom 202

Between telescopes and satellite cameras and MRI machines and microscopes, scientists are producing more images than they can realistically look at. They need specialized viewers for multi-dimensional images, and automated tools to help process those images into knowledge. In this tutorial, we will cover the fundamentals of algorithmic image analysis, starting with how to think of images as NumPy arrays, moving on to basic image filtering, and finishing with a complete workflow: segmenting a 3D image into regions and making measurements on those regions. At every step, we will visualize and understand our work using matplotlib and napari.


Between telescopes and satellite cameras and MRI machines and microscopes, scientists are producing more images than they can realistically look at. They need specialized viewers for multi-dimensional images, and automated tools to help process those images into knowledge.

This tutorial is aimed at folks who have some experience in scientific computing with Python, but are new to image analysis. To get the most out of it, they should have done some work with NumPy arrays — no need to be an expert! — but they don't need to know an image from a pipe. We will cover the fundamentals of working with images in scientific Python. The tutorial will be split into four parts, of about 45 minutes each, plus breaks:

  • Images are just NumPy arrays. In this section we will cover the basics: how to think of images not as things we can see but numbers we can analyze.
  • Changing the structure of images with image filtering. In this section we will define filtering, a fundamental operation on signals (1D), images (2D), and higher-dimensional images (3D+). We will use filtering to find various structures in images, such as blobs and edges. Putting NumPy, SciPy, scikit-image, and scikit-learn together, we'll show how these fundamental filters are related to modern convolutional neural networks.
  • Finding regions in images and measuring their properties. In this section we will define image segmentation — splitting up images into regions. We will show how segmentation is commonly represented in the scientific Python ecosystem, some basic and advanced methods to do it, and use it to take measurements of segmented objects in our images. We will use scikit-image for some basics, and to make object measurements, but we'll also demonstrate how to use a modern, neural-network-based library to find our imaged objects quickly and get on with our science: measuring the things we've imaged.
  • Q&A/Quick tour of advanced features. This section will be more freestyle and will depend on the audience. We may do a guided tour of other advanced image analysis topics, answer lingering questions about the previous sections, or walk around the room and help people apply what they've learned to their own data of interest.

Attendees will leave understanding how to work with images in Python, knowing some of the main libraries that can help them do that, and knowing where to get more help if they need it.


Prerequisites

Attendees should have basic knowledge of:
- Python (imports, if clauses, list indexing, for loops, function definition and return statements)
- Python environments — they should be able to make a new Python environment for the tutorial
- Jupyter notebooks: they should know how to launch a Jupyter notebook, enter code in cells, and execute the code
- NumPy arrays and simple array arithmetic

Installation Instructions

https://github.com/scipy-2023-image-analysis/tutorial/#readme

I'm a research scientist helping other scientists get insights from their image data using Python. I've been using Python since 2008, and the main scientific Python ecosystem (NumPy, SciPy, & co) since 2010. In 2012, on a whim, I went to my first SciPy (US) conference, and it changed my life! I realised that "open source" didn't mean just posting the code online. It meant actively collaborating on code with other scientists, across vast distances and at different times. Before you could say "import numpy as np", I had joined the scikit-image team, written a paper about it, written a whole book on SciPy (!), started new collaborative, open source libraries, and just generally been all-in on Scientific Python. I've been coming back to SciPy as often as I can to pay it forward for new folks in our community! 😊

This speaker also appears in: