Changeset 4288


Ignore:
Timestamp:
Feb 5, 2020 5:00:20 AM (21 months ago)
Author:
vondreele
Message:

add import of Dectris Eiger 1M tif images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2img_1TIF.py

    r4112 r4288  
    6868        self.Comments,self.Data,self.Npix,self.Image = GetTifData(filename)
    6969        if self.Npix == 0:
    70             G2fil.G2Print("GetTifData failed to read "+str(filename)+" Trying SciPy")
    71             import scipy.misc
    72             self.Image = scipy.misc.imread(filename,flatten=True)
     70            G2fil.G2Print("GetTifData failed to read "+str(filename)+" Trying PIL")
     71#            import scipy.misc
     72#            self.Image = scipy.misc.imread(filename,flatten=True)
     73            import PIL.Image as PI
     74            self.Image = PI.open(filename,mode='r')
     75           
    7376            # for scipy 1.2 & later  scipy.misc.imread will be removed
    7477            # with note to use imageio.imread instead
     
    348351        dt = dt.newbyteorder(byteOrd)
    349352        image = np.array(np.frombuffer(File.read(Npix*4),dtype=dt),dtype=np.int32)
     353    elif sizexy == [3070,1102]:
     354        G2fil.G2Print ('Read Dectris Eiger 1M tiff file: '+filename)
     355        pixy = [75.,75.]
     356        File.seek(8)
     357        dt = np.dtype(np.float32)
     358        dt = dt.newbyteorder(byteOrd)
     359        image = np.array(np.frombuffer(File.read(Npix*4),dtype=np.uint32),dtype=np.int32)
    350360#    elif sizexy == [960,960]:
    351361#        tiftype = 'PE-BE'
Note: See TracChangeset for help on using the changeset viewer.