MeasurePopulationContext Plugin Error - Local Cell Density


I am trying to run the MeasurePopulationContext plugin on CellProfiler to calculate local cell density but keep getting the following error:
“ValueError: NumPy Boolean array indexing assignment cannot assign 61 input values to the 32 output values where the mask is true”

The log reports an issue with line 154 of the plugin:
ii[ii>half_shape[0]] =shape[0] -ii

So far, I have identified my nuclei as objects (there are 61 in my ROI). I tried increasing/decreasing the search radius and/or object diameter, but it doesn’t help.

Any ideas what the problem might be? Thanks!

Hey folks,

I am running into the same issue on this module using CP4. Anyone got any ideas?


Hi @Edward_Law,

As this isn’t a core CP4 plugin the current version is not fully tested. If you could send a pipeline and image set we could take a look at what’s going on with this bug and see if there’s an easy fix?

Hi @DStirling,

Thanks for your reply! I’ve attached a pipeline but I can’t upload any images as they’re too large. I’ve removed the exporttodatabase module but the error should still arise. If it helps, they’re large images (63MB) that have been stitched together from multiple widefield fluorescent microscopy tiles, using a single fluorescent probe. They look similar to the ones from Anne Carpenter’s paper here, though I think probably larger:

Looks like that attachment didn’t upload properly

CP4_pipeline_measurepopcontext_troubleshoot.cppipe (13.7 KB)

Oops! Sorry. This one should work.