Which CP version has a switch for executing multi-threaded jobs in headless mode?

I am finding that the run time performance per job is quite different between the headless and GUI modes. The threading engine in the GUI when given an 80 thread pool yields run times on the order of 4-6 minutes per 3D z-stack when batched with around 68 z-stack jobs. However, the version of CP on our cluster only runs each 3D stack on a single CPU. This leads to run times of 4-8 hours per stack. I think Allen was able to implement a switch so that the number of threads to use can be passed in for headless mode jobs. Which CP version should we update our cluster version to so we get support for multi-threaded jobs?

I apologize for the delay. I was on vacation last week.

From my perspective, there’re two solutions:

CellProfiler, when it’s run from the command-line interface, is thread-safe so you’re encouraged to use your preferred software to batch CellProfiler processes. For example, you could use GNU parallel to process multiple images (“z-stacks”) in parallel. @bcimini does this with success.

There’s also a multi-thread branch of CellProfiler where a number of modules are parallelized so a single image (or “z-stack”) is computed across multiple processors:


This branch tracks master so it’s up-to-date with recent changes. In our experience, it’s been mostly bug free and it’s usable from either the command-line or graphical interface. However, not every module has been parallelized. I suspect we’ll ship (or merge) this branch in the next month or two. If you tell me the modules you’re currently using, it’d help our prioritize parallelization effort. Alternatively, patches are encouraged. Most stuff is easily parallelized by calling computational expensive functions with skimage.util.apply_parallel. It’s a task that I’d encourage anybody who is interested in getting involved with CellProfiler development to help with!

Hi Allen,

Here is the list of modules that I am using in the 3D spinning disk confocal pipeline. Could you please check that they can be updated to be thread safe for executing parallel jobs in headless mode?

FYI, the workaround which I currently implemented to process 3D image stacks with CP 2D segmentation methods uses maximum intensity projected nuclei seeds generated in the primary nuclei segmentation step which are shrunk to a single pixel. These MIP 1 pixel nuclei seed input objects are then used to find the cell membrane boundary with the “Watershed - Image” setting for the inverted CellMask channel in a downstream IdentifySecondaryObjects module. This pipeline does a pretty good job locating the membrane boundary between cells. The problem I am finding is that there is not a robust way to find the bottom and tops of the cells since each stack has colonies with different levels of staining intensity. If the stack does not have a bottom and top z-clipping plane rules then the cell membrane segmentation goes from Z=1 to the top of the stack due to the MIP nuclei seeds. Do you happen to know of a way I might be able to set clipping planes QC rules which are a variable such as cell membrane channel mean intensity-2SD which would then scale with CellMask staining levels that tend to decrease during an imaging session? Thanks for suggestions!


[ 1] [LoadData]
[ 2] [Smooth]
[ 3] [CorrectIlluminationApply]
[ 4] [EnhanceOrSuppressFeatures]
[ 5] [Morph]
[ 6] [RescaleIntensity]
[ 7] [RescaleIntensity]
[ 8] [GrayToColor]
[ 9] [MakeProjection]
[ 10] [IdentifyPrimaryObjects]
[ 12] [MeasureObjectSizeShape]
[ 15] [ExpandOrShrinkObjects]
[ 17] [IdentifySecondaryObjects]
[ 21] [MeasureImageQuality]
[ 22] [MeasureImageAreaOccupied]
[ 23] [FlagImage]
[ 24] [MeasureObjectIntensity]
[ 25] [MeasureObjectSizeShape]
[ 26] [FilterObjects]
[ 27] [RelateObjects]
[ 28] [ReassignObjectNumbers]
[ 31] [MeasureObjectIntensity]
[ 32] [TrackObjects]
[ 33] [ColorToGray]
[ 34] [ImageMath]
[ 35] [SaveImages]
[ 48] [ClassifyObjects]
[ 50] [ConvertObjectsToImage]
[ 52] [OverlayOutlines]
[ 53] [DisplayDataOnImage]
[ 56] [SaveImages]
[ 68] [ExportToSpreadsheet]