|
From: Slavin, J. <js...@cf...> - 2014-10-14 14:32:31
|
Hi all,
In my work lately I have often wanted to browse through a series of
images. This means displaying the image(s), looking at it/them and then
continuing. I have coded this in a few different ways, but it is generally
pretty slow -- which is to say that the image display takes more than a
couple seconds (~4) after I tell it to continue to the next image. I
tested the loop without image display and it was a factor of ~80 times
faster than it was with image display, so it's doesn't have anything to do
with reading the images from disk. My latest approach is basically:
first = True
fig = plt.figure()
for file in imagefiles:
# read in image data (fits files)
if first:
ax = fig.add_suplot(1,1,1)
im = ax.imshow(image)
else:
im.set_data(image)
ans = raw_input('continue?')
if ans == 'n':
break
Is there a more efficient way to do this?
Regards,
Jon
--
________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
js...@cf... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
fax: (617) 496-7577 USA
________________________________________________________
|