MAX_IMAGE_PIXELS error

I’m running CellProfiler headless to analyze large stitched image files. I seem to be maxing out some pixel limit part way through the analysis, causing the job to exit (see below). Is there a way to manually adjust the pixel limit? Thanks!
maria

my output when things go wrong:

Tue Mar 3 14:03:56 2020: Image # 1, module MeasureObjectSizeShape # 38: CPU_time = 1181.60 secs, Wall_time = 1180.83 secs
Tue Mar 3 14:23:36 2020: Image # 1, module MeasureObjectIntensity # 39: CPU_time = 41.89 secs, Wall_time = 41.85 secs
Tue Mar 3 14:24:18 2020: Image # 1, module MeasureObjectIntensity # 40: CPU_time = 23.32 secs, Wall_time = 23.31 secs
Error detected during run of module DisplayDataOnImage
Traceback (most recent call last):
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/cellprofiler/pipeline.py”, line 1782, in run_with_yield
self.run_module(module, workspace)
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/cellprofiler/pipeline.py”, line 2034, in run_module
module.run(workspace)
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/cellprofiler/modules/displaydataonimage.py”, line 345, in run
pixel_data = figure_to_image(fig, dpi=fig.dpi)
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/cellprofiler/gui/tools.py”, line 22, in figure_to_image
image = scipy.misc.imread(fd)
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/numpy/lib/utils.py”, line 101, in newfunc
return func(*args, **kwds)
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/scipy/misc/pilutil.py”, line 164, in imread
im = Image.open(name)
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/PIL/Image.py”, line 2672, in open
im = _open_core(fp, filename, prefix)
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/PIL/Image.py”, line 2659, in _open_core
_decompression_bomb_check(im.size)
File “/home/mikedis/cellprofiler318/local/lib/python2.7/site-packages/PIL/Image.py”, line 2593, in _decompression_bomb_check
(pixels, 2 * MAX_IMAGE_PIXELS))
DecompressionBombError: Image size (194341875 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.
Tue Mar 3 14:24:42 2020: Image # 1, module DisplayDataOnImage # 41: CPU_time = 121.38 secs, Wall_time = 121.33 secs

It looks from the stack trace like it’s an issue in scipy via PIL. We’ve updated that particular function already in CellProfiler 4 so this shouldn’t happen again.

For now, unless you’re running CellProfiler from source, you’ll need to wait ~ a month for our next release, if you ARE running from source you can just import PIL and set the limit in the gui/tools file.