Changeset 56 for trunk/GSASII.py


Ignore:
Timestamp:
Apr 29, 2010 5:04:39 PM (12 years ago)
Author:
vondreel
Message:

major modification for images - not stored in project file. Now read as needed in plotting routine. Reduces .gpx file size from 10s of MB to 10s of kb.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r55 r56  
    378378        try:
    379379            if dlg.ShowModal() == wx.ID_OK:
    380                 self.imagefile = dlg.GetPath()
     380                imagefile = dlg.GetPath()
    381381                self.dirname = dlg.GetDirectory()
    382                 ext = ospath.splitext(self.imagefile)[1]
    383                 Comments = []
    384                 if ext == '.tif':
    385                     Comments,Data,Size,Image = G2IO.GetTifData(self.imagefile)
    386                 elif ext == '.img':
    387                     Comments,Data,Size,Image = G2IO.GetImgData(self.imagefile)
    388                     Image[0][0] = 0
    389                 elif ext == '.mar3450' or ext == '.mar2300':
    390                     Comments,Data,Size,Image = G2IO.GetMAR345Data(self.imagefile)
    391                 elif ext in ['.sum','.avg']:
    392                     Comments,Data,Size,Image = G2IO.GetGEsumData(self.imagefile)
     382                Comments,Data,Size,Image = G2IO.GetImageData(imagefile)
    393383                if Comments:
    394                     Id = self.PatternTree.AppendItem(parent=self.root,text='IMG '+ospath.basename(self.imagefile))
     384                    Id = self.PatternTree.AppendItem(parent=self.root,text='IMG '+ospath.basename(imagefile))
    395385                    self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Comments'),Comments)
    396386                    Imax = np.amax(Image)
     
    421411                    Data['range'] = [(Imin,Imax),[Imin,Imax]]
    422412                    self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Image Controls'),Data)
    423                     self.PatternTree.SetItemPyData(Id,[Size,Image])
     413                    self.PatternTree.SetItemPyData(Id,[Size,imagefile])
    424414                    self.PickId = Id
    425415                    self.Image = Id
Note: See TracChangeset for help on using the changeset viewer.