<br><br><div><span class="gmail_quote">On 10/28/05, <b class="gmail_sendername">Phil Thompson</b> &lt;<a href="mailto:phil@riverbankcomputing.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">phil@riverbankcomputing.co.uk
</a>&gt; wrote:</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Yes there is. What do you mean by &quot;doesn't work&quot;.<br></blockquote>
</div><br>
&nbsp; Sorry for not replying sooner, I was on vacation last week. By doesn't work I mean returns the following error message: <br>
<br>
<div style="margin-left: 40px;">TypeError: too many arguments to QPixmap(), 0 at most expected<br>
<br>
</div>
Anyway, I found out why the code doesn't work: scipy.toimage returns a PIL image object, not a QImage, silly me. The<br>
function converting a scipy array into a QImage is not in the scipy library, but in Qwt: qwt.toQImage. The following code<br>
does work:<br>
<br>
<div style="margin-left: 40px;"><span class="q">import scipy<br>
import qwt<br>
from qt import *<br>
<br>
# imgList is a list of scipy arrays<br>
</span><span class="q">pixmapList = [ QPixmap(qwt.toQImage(img)) for img in imgList ]<br>
</span></div>
<span class="q"></span>
<br>The typo in my first post was only in the post, not in my code, I used &quot;from scipy import *&quot; there, just<br>
thought it'd be clearer here to add the module name.<br clear="all"><br>-- <br>Alex Borghgraef