Thinking like an image analyst, Part V: Making measurements and exporting the data for analysis

November 12, 2021

Pearl V. Ryder

In the previous posts in this series, I explained how I approached an image analysis project to segment extracellular fibrils, giving an overview of the project (Part I), showing how I removed bright debris from the images (Part II), enhanced the fiber brightness and reduced background intensity (Part III), and then segmented the fibers (Part IV). In this section, I’ll walk through the final steps in making this pipeline: adding measurement modules and exporting the data. If you’d like to follow along in CellProfiler, the pipeline and images for this project are available here.

Adding measurement modules

After I was satisfied with segmentation of my objects of interest, I wanted to add relevant measurement modules. Since our collaborators were interested in changes to morphology of the fibers, I added a MeasureObjectSizeShape module, which captures measurements such as area, width, and length. I also added a MeasureImageAreaOccupied module to measure the percentage of an image that contains fibrils.

The MeasureObjectSizeShape module approximates the length of an object by first fitting an ellipse to each object and then getting the major axis length of that ellipse. For that reason, the length of objects that curve won’t be accurately measured by this metric. This example shows how useful it is to read the CellProfiler help manuals to understand the details of how each measurement works. Since the MeasureObjectSizeShape module won’t accurately measure length for curved fibers, I added a MeasureObjectSkeleton module. Doing so requires first converting the fibril objects into a binary image using ConvertObjectsToImage, skeletonizing (shrinking the objects to a one-pixel wide line) the binary image using MorphologicalSkeleton, and then creating seeds for the MeasureObjectSkeleton module by shrinking the fibrils to a single point using ExpandOrShrinkObjects. The fibril skeleton can then be measured using MeasureObjectSkeleton.

One thing I discovered when creating this pipeline is that small, round objects will have a skeleton length of zero, which reflects the thinning process thinning evenly from all sides. In the data analysis I did downstream of CellProfiler for this project, I chose to filter out any skeleton lengths of 0, since it’s probably not an accurate approximation of length. When working with fibrillar data and measuring length with MeasureObjectSkeleton, you may want to check for objects of skeleton length 0.

Understanding the sorts of artifacts or unintended limits that can be generated during your image analysis workflow is often crucial for proper quantitative analysis of CellProfiler measurements - a maximum object diameter cutoff that is too low can lead to missing larger cells and a phenotype of cell growth, for example. It’s therefore always important to a) create outline images showing which objects were found in your image and examine them at the end of each run b) think carefully about what phenotype(s) you hope to find in your image and how the modules you use may help (or hurt!) in finding them.

Exporting the data

I chose to export the data for this pipeline using the ExportToSpreadsheet module, which produces CSV files. In this case, I chose to export all measurements. Even if you’re uncertain if you’ll need all of the measurements, it can be helpful to have them all available in case you decide you want to analyze those measurements later on.

Data analysis

With the pipeline complete, I applied it to the dataset by clicking “Analyze Images”. The resulting measurements can be analyzed using software of your choice: Excel, Prism, R, Python, etc.

Concluding thoughts

I hope this overview of how I approached this image analysis project is helpful. We’re grateful to Louis Widom and Tom Gaborski for sharing their data for this blog post. Finally, please reach out to connect with the CellProfiler team and imaging community via the Scientific Community Image Forum at image.sc!