Commit 36b8c944 authored by shadow_walker's avatar shadow_walker
Browse files

Merge branch 'read-image'

parents 0c129aa2 764e7a69
...@@ -2977,6 +2977,15 @@ def db_read_image(self, fsp, *parms, **kparms): ...@@ -2977,6 +2977,15 @@ def db_read_image(self, fsp, *parms, **kparms):
#if lsxcache==None or lsxcache.path!=fsp: lsxcache=LSXFile(fsp,True) #if lsxcache==None or lsxcache.path!=fsp: lsxcache=LSXFile(fsp,True)
#return lsxcache.read_image(parms[0]) #return lsxcache.read_image(parms[0])
fsp, idxs = parse_infile_arg(fsp)
if len(parms) > 0 and parms[0]:
idx = idxs[parms[0]]
else:
idx = idxs[0]
parms = idx, *parms[1:]
if len(kparms) != 0: if len(kparms) != 0:
if 'img_index' not in kparms: if 'img_index' not in kparms:
kparms['img_index'] = 0 kparms['img_index'] = 0
......
...@@ -354,20 +354,6 @@ class TestSpiderIO(ImageIOTester): ...@@ -354,20 +354,6 @@ class TestSpiderIO(ImageIOTester):
e.process_inplace('testimage.sinewave', {'wavelength':20}) e.process_inplace('testimage.sinewave', {'wavelength':20})
e.set_attr('SPIDER.title', 'The fourth image in the stack') e.set_attr('SPIDER.title', 'The fourth image in the stack')
e.write_image('test.spi', 3) e.write_image('test.spi', 3)
f = EMData()
#read the overall herder
f.read_image('test.spi', -1, True)
d = f.get_attr_dict()
img_num = d['SPIDER.maxim']
#read the individual image from a stack
for i in range(img_num):
f.read_image('test.spi', i)
self.assertEqual(f.is_complex(), False)
self.assertEqual(f.get_xsize(), 100)
self.assertEqual(f.get_ysize(), 100)
self.assertEqual(f.get_zsize(), 1)
finally: finally:
testlib.safe_unlink('test.spi') testlib.safe_unlink('test.spi')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment