IdentifyPrimaryObjects and excessive objects


Found another problem. This time I’m using the IdentifyPrimaryObjects in an image with a large number of cells (6000+ nuclei identified). Since Cellprofiler complains about memory errors in the subsequent analysis (I’ve tried to use ConserveMemory but that did not help) I’d like to use the option to truncate the number of nuclei segmented. However, if I choose “truncate” as an option on how to handle excessive objects and set a number in the field “maximum number of objects” lower than the number of detected nuclei, Cellprofiler crashes with the following error message:

Traceback (most recent call last):
File “cellprofiler\gui\pipelinecontroller.pyc”, line 932, in do_step
File “cellprofiler\modules\identifyprimaryobjects.pyc”, line 734, in run
File “cellprofiler\modules\identifyprimaryobjects.pyc”, line 834, in limit_object_count
File “mtrand.pyx”, line 591, in mtrand.RandomState.seed (numpy\random\mtrand\mtrand.c:4773)
OverflowError: can’t convert negative value to unsigned long


Hi Karl,

Could you post your pipeline plus an image which produces this error?


Hi Mark,

Here´s a sample pipeline and an image that causes the problem to appear.

The problem seems to be caused by Cellprofiler trying to randomly select objects (in this case 4000) from the set of detected objects (6000+).

Karl (2.05 MB)

Hi Karl,

This is indeed a bug and has been fixed in our source code. If you want, you can download the latest “bleeding edge” version from here (be sure to read all the caveats first).