Changeset 2829 for trunk/imports/G2img_1TIF.py
- Timestamp:
- May 11, 2017 9:46:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/imports/G2img_1TIF.py
r2817 r2829 226 226 print 'Read ImageJ tiff file: ',filename 227 227 # image = ar.array('H',File.read(2*Npix)) 228 image = File.read(2*Npix,dtype=np.uint16) 229 if '>' in byteOrd: 230 image.byteswap() 231 image = np.array(np.frombuffer(image),dtype=np.int32) 228 # image = File.read(2*Npix,dtype=np.uint16) 229 image = File.read(4*Npix) 230 # if '>' in byteOrd: 231 # image.byteswap() 232 image = np.array(np.frombuffer(image,dtype=np.int),dtype=np.int32) 233 # image = np.array(np.frombuffer(image),dtype=np.int32) 232 234 # image = np.array(np.asarray(image,dtype='H'),dtype=np.int32) 233 235 elif 262 in IFD and IFD[262][2][0] > 4: … … 319 321 # image = np.fromfile(File,dtype=np.int16,count=2*Npix)[:Npix] 320 322 # image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32) 323 elif sizexy == [391,380]: 324 pixy = [109.92,109.92] 325 File.seek(8) 326 image = np.array(np.frombuffer(File.read(2*Npix),dtype=np.int16),dtype=np.int32) 327 elif sizexy == [380,391]: 328 File.seek(110) 329 pixy = [109.92,109.92] 330 image = np.array(np.frombuffer(File.read(Npix),dtype=np.uint8),dtype=np.int32) 331 elif sizexy == [825,830]: 332 pixy = [109.92,109.92] 333 File.seek(8) 334 image = np.array(np.frombuffer(File.read(Npix),dtype=np.uint8),dtype=np.int32) 335 elif sizexy == [1800,1800]: 336 pixy = [109.92,109.92] 337 File.seek(110) 338 image = np.array(np.frombuffer(File.read(Npix),dtype=np.uint8),dtype=np.int32) 321 339 # elif sizexy == [960,960]: 322 340 # tiftype = 'PE-BE'
Note: See TracChangeset
for help on using the changeset viewer.