Combining CellPose with CellProfiler

Hi there,

I need single-cell image analysis for one of the high throughput screen assays which require segmentation of aggregated cells. Unfortunately, I was unable to get reasonable results from CellProfiler due to uneven DAPI staining and tried CellPose which is working really neat (see attached image).

Due to the number of images involved, I want to run everything within CellProfiler. Has anyone tried running CellPose within CellProfiler (is that possible?). Or perhaps train Ilastik on CellPose and get reasonable results?

You COULD in theory, if you’re running both CellProfiler and CellPose from source, create a “RunCellPose” module that runs CellPose on CellProfiler images, but as far as I know there is not one that currently exists.

Another option would be to run your images through CellPose FIRST, then import the images + CellPose masks into CellProfiler for subsequent measurement generation; that may work entirely out-of-the-box, if not it should be reasonably easy to get working.

1 Like

I have indeed now looked into this, and option 2 DOES work right out of the box, ie if you save out your predictions as label matrices from CellPose, you can load them into CellProfiler as objects by designating them as type “Objects” in the NamesAndTypes module.


Hi Beth,
How do you save CellPose output as label matrices? It usually gives an image made of objects with different pixel values assigned. I use a Fiji Plugin to identify ROIs. Can this be done in CellProfiler?

The image you describe is exactly what you should feed into CellProfiler (as type “object”)- that kind of image is sometimes referred to as a “label matrix”. Sorry for the confusion over the technical term!

Hi Beth, thanks for quick response. Yeah this worked!

I have a lingering question on how CellProfiler is using MeasureObjectIntensity on label matrices. MeasureObjectIntensity module gives options to measure: Integrated Intensity and MeanIntensity among others. However from their description it seems these values are measured per object.

However, when applying the MeasureObjectIntensity module, it returns a single value for each image. How does it calculate a single value for all the objects in an image?

When you execute MeasureObject_ modules in CellProfiler with the “eye” open (and therefore a display window made), what’s shown there is a table with the per-image mean-of-all-objects value for each measurement; when you run in analysis mode with either ExportToSpreadsheet or ExportToDatabase, it then will create a spreadsheet/table with the values for all the objects. I hope that helps clarify!

1 Like