Changeset 3159
- Timestamp:
- Nov 22, 2017 12:02:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/imports/G2img_1TIF.py
r3158 r3159 322 322 print ('Read PE 4Kx4K tiff file: '+filename) 323 323 image = np.array(np.frombuffer(File.read(4*Npix),dtype=np.float32)/2.**4,dtype=np.int32) 324 # image = np.fromfile(File,dtype=np.uint,count=4*Npix)[:Npix]325 # if np.max(image) > 2**31:326 # image = np.array(image-2**30,dtype=np.int32)327 # else:328 # image = np.array(image,dtype=np.int32)329 # arry = ar.array('I',File.read(4*Npix))330 # image = np.array(arry)/2**16331 324 elif IFD[273][2][0] == 4096: 332 325 tifType = 'Rayonix' … … 335 328 print ('Read Rayonix MX300HE tiff file: '+filename) 336 329 image = np.array(np.frombuffer(File.read(2*Npix),dtype=np.uint16),dtype=np.int32) 337 # image = np.fromfile(File,dtype=np.int16,count=2*Npix)[:Npix]338 # image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32)339 330 elif sizexy == [391,380]: 340 331 pixy = [109.92,109.92] … … 353 344 File.seek(110) 354 345 image = np.array(np.frombuffer(File.read(Npix),dtype=np.uint8),dtype=np.int32) 346 elif sizexy == [2880,2880]: 347 pixy = [150.,150.] 348 File.seek(8) 349 image = np.array(np.frombuffer(File.read(Npix*4),dtype=np.uint32)//1024,dtype=np.int32) 355 350 # elif sizexy == [960,960]: 356 351 # tiftype = 'PE-BE'
Note: See TracChangeset
for help on using the changeset viewer.