Error with LoadImage Module

Hi ,
I am trying to use CellProfiler v2 to measure fluorescence intensity from neurons of different regions of rat hippocampus acquired as a whole montage.
My work flow is as follows:-
I have created masks (created as gray scale) for different regions of hippocampus using Photoshop.

  1. Load the image montage to CP.
  2. Resize the image
  3. Load the mask for the region of interest and convert to binary using ApplyThreshold
  4. Identify primary objects (nuclei) , secondary objects (cells) and tertiary objects (cytoplasm).
  5. Measure object intensity and object shape.
  6. Save image and export to spreadsheet.

However, when I try to run it by clicking ‘analyze images’, or run in the test mode, I get the following error message and the pipeline stalls.

Traceback (most recent call last):
File “cellprofiler\gui\pipelinecontroller.pyc”, line 932, in do_step
File “cellprofiler\modules\loadimages.pyc”, line 2074, in run
File “cellprofiler\modules\loadimages.pyc”, line 2781, in provide_image
File “cellprofiler\cpimage.pyc”, line 84, in init
File “cellprofiler\cpimage.pyc”, line 142, in set_image

i am also attaching the pipeline and the images for your reference.

How can I make it work? I will be grateful for any of your suggestions.
NKCC1 Rev.1 For Testing.cp (179 KB)

The memory error is due to the fact that the template image is 10416 x 6784 pixels which is larger than CellProfiler can handle. In addition, the NKCC image is color (but the the RBG channels are identical making it look grayscale), which makes it larger than it has to be.

Some comments:

  • If the NKCC image is made grayscale to begin with, you will save memory since CellProfiler doesn’t have to deal with the 3 color channels.
  • It doesn’t seem that the template needs to be as large as it is. Is it possible to downsample it with whatever program you are using to create it?
  • Aside from the above point, the mask template is not an multiple of the original image size (2529 x 1187). Your pipeline is using Resize to downsample both images by 0.2 rather than just downsampling one of them to the same size as the other. If you do not make the images sizes match, you will run into an error in MaskImage.


Hi Mark,

Thank you very much for a prompt response. I will follow the suggestions and let you know how it goes. I was wondering if there is a comprehensive resource on trouble shooting CP error messages?

Thanks again,


Hi Melvi,

Unfortunately, there is no comprehensive error resource, because users find so many creative ways to make CP fail :smiley: But in all seriousness, some persistent/critical issues and questions are addressed on our FAQ.

Otherwise, the source of the error is typically inferred by the message itself, and we put prompts in place if necessary. So for example, in your case, you should have seen a message warning that your images were different sizes, precisely to alert the user to the type of sizing error that you would have (eventually) run into in MaskImage.