Loadimages memory error

Hi,

I am importing an brightfield/grayscale image using loadimages, and get a memory error:

Traceback (most recent call last):
File “cellprofiler\pipeline.pyc”, line 309, in run
File “cellprofiler\modules\loadimages.pyc”, line 1770, in run
File “cellprofiler\modules\loadimages.pyc”, line 2366, in provide_image
File “cellprofiler\cpimage.pyc”, line 80, in init
File “cellprofiler\cpimage.pyc”, line 138, in set_image
MemoryError

The image is a 7MB jpg, I am not sure how it was captured or what file options are available. It is an image of several wells of a microtiter plate, not of cells.

Despite being a less accurate(‘lossy’) format, I am pretty sure that the jpg format will get me the data I need (it is a well-level analysis and requires a single measurement), but have tried resaving to other formats (as per suggestions in the CP manual), which greatly bloat the file size (10-20X). All formats still trigger the memory error.

I am running CP on a Windows laptop, other options exist but this is easiest for me.

Any suggestions on a direct solution or what to ask the colleague who sent me the image about file type/size options?

Thanks,

Steve

Hi Steve,

A few questions:

  • What are the dimensions of your image (i.e., width and height)?
  • Is it color or grayscale?
  • Finally, do you have the option of making the image smaller by acquiring one well per image, rather than multiple wells?

Regards,
-Mark

Hi Mark,

It is grayscale, 6479X12196 pixels. It is an image of a 24-well plate. I am trying to find out more about how the image was captured and what options are available for reducing the image size, including whether capturing individual wells will work.

Cheers,

Steve

On a 32-bit machine, images well over 2000 x 2000 pixels will probably encounter an error. Even with a 64-bit machine, you will probably still hit a memory issue with an image that big. I would say that either downsampling or cropping the image into more manageable pieces are your best (if not only) options.
-Mark

Thanks Mark,

I’ll try working with the group capturing the images to see what can be done to get them pared down to size.

Steve

Hey Mark,

I’m running into the same error with the same type of image. It’s a 24 well plate image:

6479x22392 image that’s about 7mb in size. The color profile is EPSON Gray-Gamma 2.2 (I don’t know if this is relevant).

Would it be possible to have a downsample option in the load images module to automate this process?

John

Hi John,

We do have the Resize module (in the Image Processing category) that does do this. However, whether the resizing is performed in LoadImages or subsequently in Resize, the image has to be loaded in its entirety first, so dealing with the memory issue at the outset is unavoidable, unfortunately. This is why we recommend either cropping the image beforehand, or downsampling from the image acquisition/hardware side of things first.

Regards,
-Mark