format | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Peter Sobolewski (he/him)
Systems Analyst, Imaging Applications
Research IT
- Introduction to CellProfiler
- Overview of basic CellProfiler concepts
- projects, pipelines, modules
- User Interface (UI) Walk-through
- Hands-on Segmentation Tutorial
- Hands-on Input Modules Tutorial
CellProfiler is an open-source image analysis program
Key feature:
CellProfiler has a graphical user interface (GUI
) for assembling image processing and analysis workflows (called pipelines
) using a sequence of modular analysis modules
- project started in 2003 by Anne Carpenter and Thouis Jones at MIT
- currently developed by the Beth Cimini lab at the Broad Institute
- >17000 publications citing CellProfiler
- Many shared
pipelines
: https://cellprofiler.org/published-pipelines
- Many shared
-
It was designed for batch image analysis using reproducible workflows—without scripting
-
It includes advanced algorithms for image (pre)processing, segmentation, etc. as modular
modules
-
It includes in-app documentation for
module
parameters plus extensive help menu -
End-to-end workflows: images go in, data tables go out
- Limited viewing capabilities:
- single planes, single channels only
- No annotation tools
- Limited out-of-memory performance
- lacking support for multiscale ("pyramidal") images
- lacking built-in tiling/chunking
- Limited OMERO support
- Problematic OME.TIFF handling
- Create a
project
that has an associated image file list of locations and an associatedpipeline
- Use the GUI to add a sequence of
modules
to implement your analysis—these form apipeline
- Start with input images and end with measurements in a spreadsheet (
.csv
) or a MySQL database
- Start with input images and end with measurements in a spreadsheet (
- run in batches over large number of images
- analyze measurement data in the downstream tool of your choice (Python, R, Excel, etc.)
projects
contain a list of the locations of your image files plus an associated CellProfiler analysispipeline
projects
will also contain some cached computed results
pipelines
can be exported, but do not contain image locations—this is ideal for sharing or reuseing workflows
- start with setting up
Input
modules - Add
Image Processing
modules to facillitate segmentation - Add
Object Processing
modules to segment the image (identify objects) and manipulate objects - Add
Measurement
modules to get quantified information you're interested in - Finish with
Data Tools
andFile Processing
to export data or images
{fig-alt="Screenshot of empty CellProfiler UI with menu bar"}
{fig-alt="Screenshot of empty CellProfiler UI with menu bar. At the top right, the Notes box is emphasized with red text. Below, in the middle-right, the Image list drag-and-drop is emphasized with red text."}
{fig-alt="Screenshot of empty CellProfiler UI with menu bar. In the top left, the four Input modules are highlighted with a red box and red text."}
{fig-alt="Screenshot of empty CellProfiler UI with menu bar. On the middle-left, the area for adding pipeline modules is highlighted with red text. Below, the module buttons are highlighted with a red box."}
{fig-alt="Screenshot of CellProfiler UI with menu bar and a single module (ColorToGrey) open. At the top, the Test menu is open and the Start Test Mode
option is highlighted with a red box. At the bottom left, the Start Test Mode
button is highlighted with a red box."}
{fig-alt="Screenshot of CellProfiler UI with menu bar and a single module (ColorToGrey) open. Test mode is now active. At the top of the modules area, the Test mode buttons next to the ColorToGrey module are highlighted with a red box. At the bottom left, the Run and Step buttons are highlighted with a red box."}
{fig-alt="Screenshot of CellProfiler UI with menu bar and a single module (ColorToGrey) open. Test mode is now active. At the top, the Test menu is open and the Image set menu items are highlighted with a red box. At the bottom left, the Next Image Set
button is highlighted with a red box."}
{fig-alt="Screenshot of CellProfiler UI with menu bar and a single module (ColorToGrey) open. In the middle right, the ColorToGrey module options are showing with the input image selection and output image naming highlighted with red boxes."}
- ensure image inputs are properly set up (
NamesAndTypes
) and that they and intermediate step outputs have meaningful names - use
Test
mode to see the outputs of individualmodulues
(pipeline
steps) one-at-a-time- let's you test parameters on a single image or any number of images (even a randomly selected one)
- can run the whole
pipeline
or just individualmodules
-
Online manual: https://cellprofiler.org/manuals
-
Extensive tutorials: https://tutorials.cellprofiler.org/
-
Extensive examples: https://cellprofiler.org/examples
-
Image.sc forum: https://forum.image.sc/tag/cellprofiler
- Ensure you have the tutorial materials downloaded. If not, download the
.zip file
- Inside the folder is a PDF walkthrough, if you want to follow along on your own
- Inside the folder are also two
.cppipe
files, which define the CellProfiler pipelinessegmentation_start.cppipe
is our starting point, it handles the initial image importing and set up.- Drag-and-drop it onto the Pipeline Modules section (middle left pane) to import it.
:::{.callout-tip}
The segmentation_final.cppipe
is the final pipeline, which you can use to see the completed analysis pipeline!
:::
- Import the images by drag-and-dropping the
images_Illum-corrected
folder onto the central image list pane - Click on
Apply filters to the file list
to filter out non-images
:::{.callout-tip} Double-click an image in the list to open and view it :::
{fig-alt="Screenshot of CellProfiler UI with menu bar and the segmentation_start pipeline imported. The image list is populated with images and an example is open."}
This tutorial will introduce you to Input Modules in CellProfiler: Images
, Metadata
, NamesAndTypes
, and Groups
. These modules are crucial for loading and organizing your input data so CellProfiler manages it properly in the analysis pipeline.
:::{.callout-important} Setting up Input Modules properly is crucial to being able to analyze your data! :::
Images
module: set where your images are located, apply filters to include/exclude certain filesMetadata
module [optional]: extract and associate metadata with your images, e.g. well plate layout, treatment, time pointsNamesAndTypes
module: give each image a meaningful name by which modules in the analysis pipeline will refer to itGroups
module [optional]: group images together to be analyzed independently, typically by field-of-view, e.g. z-stack, time course
- Ensure you have the tutorial materials downloaded. We will use a sub of the official CellProfiler Input Modules Tutorial materials. You can download the
.zip file
. - There is a blog post walkthrough this tutorial if you want to follow along on your own.
:::{.callout-tip}
Each example has .cppipe
file, which has the "solution"
:::
- The https://regex101.com/ website is great! Just ensure you have one of the
PCRE
flavors selected. - Copy-paste the file name you want to parse into the
test string
box - Capture groups are always of the format:
(?P<Name>[what]{how many})
Name
is what you will refer to in theMetadata
modulewhat
can be digits, e.g. 0-9, or capital letters, e.g. A-Z, etc.how many
is an integer, e.g. 1, 2, 3, etc.
.
is a wildcard for any character*
is a quantifier for 0 or more consecutive of the preceding character/token, e.g.:[A-Z]*
to match any number of capital letters^
is an anchor for the start of the string$
is an anchor for the end of the string--don't forget about extensions!\
is an escape character, e.g.\.
to match a period, rather than any character