Changeset 2829


Ignore:
Timestamp:
May 11, 2017 9:46:48 PM (5 years ago)
Author:
vondreele
Message:

update tif reader ti include 4 different versions of LCLS tif images

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2802 r2829  
    44894489                ypix = int(ypos*scaley)
    44904490                Int = 0
    4491                 if (0 <= xpix < sizexy[0]) and (0 <= ypix < sizexy[1]):
     4491                if (0 <= xpix < sizexy[1]) and (0 <= ypix < sizexy[0]):
    44924492                    Int = G2frame.ImageZ[ypix][xpix]
    44934493                tth,azm,D,dsp = G2img.GetTthAzmDsp(xpos,ypos,Data)
  • trunk/imports/G2img_1TIF.py

    r2817 r2829  
    226226            print 'Read ImageJ tiff file: ',filename
    227227#            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)
    232234#            image = np.array(np.asarray(image,dtype='H'),dtype=np.int32)           
    233235    elif 262 in IFD and IFD[262][2][0] > 4:
     
    319321#            image = np.fromfile(File,dtype=np.int16,count=2*Npix)[:Npix]
    320322#            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)
    321339#    elif sizexy == [960,960]:
    322340#        tiftype = 'PE-BE'
Note: See TracChangeset for help on using the changeset viewer.