Note that there are some explanatory texts on larger screens.

plurals
  1. POmatplotlib RuntimeError: Could not allocate memory for image
    primarykey
    data
    text
    <p>So, I'm receiving "RuntimeError: Could not allocate memory for image" from matplotlib when I try to re-size my image on the canvas. The images are large DICOM (.dcm) files that have been allocated memory using ctypes' PyMem_Malloc. They've been allocated 16 bits per pixel (they need to be Hi-Res). The problem comes after we've re-sized the canvas and attempt to draw the re-sized image using:</p> <pre><code>self.view.canvas.draw() </code></pre> <p>Here's the specific exception being thrown:</p> <pre><code>Traceback (most recent call last): File "C:\Python27\lib\site-packages\matplotlib\backends\backend_wx.py", line 1355, in _onMotion FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=evt) File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 1625, in motion_notify_event self.callbacks.process(s, event) File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 265, in process proxy(*args, **kwargs) File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 191, in __call__ return mtd(*args, **kwargs) File "C:\Python27\lib\site-packages\matplotlib\widgets.py", line 1258, in onmove self.update() File "C:\Python27\lib\site-packages\matplotlib\widgets.py", line 1236, in update self.canvas.restore_region(self.background) File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py", line 384, in restore_region renderer = self.get_renderer() File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py", line 404, in get_renderer self.renderer = RendererAgg(w, h, self.figure.dpi) File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py", line 59, in __init__ self._renderer = _RendererAgg(int(width), int(height), dpi, debug=False) RuntimeError: Could not allocate memory for image </code></pre> <p>The images themselves shouldn't need more allocation, correct? So what could be the problem here? Does matplotlib limit the size in memory that the canvas can hold? Has anyone had this problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload