def rebuild(self, event=None): self.tree.DeleteRoot() self.root = self.tree.AddRoot("Metadata") self.tree.SetItemText(self.root, "root", 0) nmdh = NestedClassMDHandler(self.mdh) self.addEntries(nmdh, self.root) self.tree.ExpandAll(self.root)
def OnGenEvents(self, event): from PYMEnf.Simulation import locify #from PYME.Acquire.Hardware.Simulator import wormlike2 from PYME.Analysis.LMVis import inpFilt from PYME.Analysis.LMVis.visHelpers import ImageBounds import pylab #wc = wormlike2.wormlikeChain(100) pipeline = self.visFr.pipeline pipeline.filename='Simulation' pylab.figure() pylab.plot(self.xp, self.yp, 'x') #, lw=2) if isinstance(self.source, WormlikeSource): pylab.plot(self.xp, self.yp, lw=2) res = locify.eventify(self.xp, self.yp, self.meanIntensity, self.meanDuration, self.backgroundIntensity, self.meanEventNumber, self.scaleFactor, self.meanTime) pylab.plot(res['fitResults']['x0'],res['fitResults']['y0'], '+') pipeline.selectedDataSource = inpFilt.mappingFilter(inpFilt.fitResultsSource(res)) pipeline.imageBounds = ImageBounds.estimateFromSource(pipeline.selectedDataSource) pipeline.dataSources.append(pipeline.selectedDataSource) from PYME.Acquire.MetaDataHandler import NestedClassMDHandler pipeline.mdh = NestedClassMDHandler() pipeline.mdh['Camera.ElectronsPerCount'] = 1 pipeline.mdh['Camera.TrueEMGain'] = 1 pipeline.mdh['Camera.CycleTime'] = 1 pipeline.mdh['voxelsize.x'] = .110 try: pipeline.filterKeys.pop('sig') except: pass self.visFr.RegenFilter() self.visFr.SetFit()
# region : Initialize parameters # > Input parameter numFramesToAnalyze = 1 fitMod = 'LatGaussFitFR' threshold = 1.0 bIndiceRange = [-20, 0] # > File names # filename = r'data\1004x1002.tif' filename = r'data\100x140x170.tif' # > Metadata metadata = NestedClassMDHandler() metadata.setEntry('voxelsize.x', 0.08) metadata.setEntry('voxelsize.y', 0.08) metadata.setEntry('voxelsize.z', 0.2) metadata.setEntry('voxelsize.units', 'um') metadata.setEntry('Camera.ADOffset', 0) metadata.setEntry('Camera.ReadNoise', 0) metadata.setEntry('Camera.NoiseFactor', 1) metadata.setEntry('Camera.ElectronsPerCount', 1) metadata.setEntry('Camera.TrueEMGain', 1) metadata.setEntry('Analysis.FitModule', fitMod) # > Runtime arguments
def __init__(self, parent, mdh, editable=True, refreshable=True): self.mdh=mdh wx.Panel.__init__(self, parent, -1) #self.Bind(wx.EVT_SIZE, self.OnSize) sizer1 = wx.BoxSizer(wx.VERTICAL) self.tree = gizmos.TreeListCtrl(self, -1, style = wx.TR_DEFAULT_STYLE #| wx.TR_HAS_BUTTONS #| wx.TR_TWIST_BUTTONS #| wx.TR_ROW_LINES #| wx.TR_EDIT_LABELS | wx.TR_COLUMN_LINES #| wx.TR_NO_LINES | wx.TR_FULL_ROW_HIGHLIGHT ) # create some columns self.tree.AddColumn("Entry") self.tree.AddColumn("Value") self.tree.SetMainColumn(0) # the one with the tree in it... self.tree.SetColumnWidth(0, 300) self.tree.SetColumnWidth(1, 300) self.root = self.tree.AddRoot("Metadata") self.tree.SetItemText(self.root, "root", 0) self.paths = {} nmdh = NestedClassMDHandler(mdh) self.addEntries(nmdh, self.root) if editable: self.editableCols = [1] else: self.editableCols = [] #entryNames = self.mdh.getEntryNames() # for k in nmdh.__dict__.keys(): # #txt = "Item %d" % x # child = self.tree.AppendItem(self.root, k) # self.tree.SetItemText(child, txt + "(c1)", 1) self.tree.ExpandAll(self.root) self.tree.GetMainWindow().Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown) self.tree.GetMainWindow().Bind(wx.EVT_RIGHT_UP, self.OnRightUp) self.tree.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnEndEdit) self.tree.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnBeginEdit) #self.tree.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnActivate) sizer1.Add(self.tree, 1, wx.EXPAND, 0) if refreshable == True: bRefresh = wx.Button(self, -1, 'Refresh') bRefresh.Bind(wx.EVT_BUTTON, self.rebuild) sizer1.Add(bRefresh, 0, wx.ALL|wx.ALIGN_RIGHT, 5) self.SetSizerAndFit(sizer1)
# name = 'Andor IXon DV97' # ADOffset = 1100 #counts (@ T ~ -70, em gain ~ 150) # ReadNoise = 109.8 #electrons # noiseFactor = 1.41 # electronsPerCount = 27.32 # # #class MetaData: # def __init__(self, voxSize, CCDMD = None): # self.voxelsize = voxSize # self.CCD = CCDMD # ##FIXME - THIS SHOULD ALL BE EXTRACTED FROM LOG FILES OR THE LIKE #TIRFDefault = MetaData(VoxelSize(0.07, 0.07, 0.2), CCDMetaDataIXonDefault()) TIRFDefault = NestedClassMDHandler() #voxelsize TIRFDefault.setEntry('voxelsize.x',0.07) TIRFDefault.setEntry('voxelsize.y',0.07) TIRFDefault.setEntry('voxelsize.z',0.2) TIRFDefault.setEntry('voxelsize.units','um') #camera properties - for Andor camera - see above #TIRFDefault.setEntry('Camera.ADOffset',1100) TIRFDefault.setEntry('Camera.ReadNoise',109.8) TIRFDefault.setEntry('Camera.NoiseFactor',1.41) TIRFDefault.setEntry('Camera.ElectronsPerCount',27.32) TIRFDefault.setEntry('Camera.TrueEMGain',20) #mostly use gain register setting of 150 - this will hopefully be overwitten ConfocDefault = NestedClassMDHandler()
from PYME.FileUtils import nameUtils from PYME.misc import TextCtrlAutoComplete from PYME.SampleDB2 import populate #just to setup the Django environment from PYME.SampleDB2.samples import models lastCreator = nameUtils.getUsername() lastSlideRef = '' currentSlide = [None] WantSlideChangeNotification = [] from PYME.Acquire.MetaDataHandler import NestedClassMDHandler slideMD = NestedClassMDHandler() class AutoWidthListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): def __init__(self, parent, ID, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0): wx.ListCtrl.__init__(self, parent, ID, pos, size, style) listmix.ListCtrlAutoWidthMixin.__init__(self) class VirtList(wx.ListCtrl): def __init__(self,
# name = 'Andor IXon DV97' # ADOffset = 1100 #counts (@ T ~ -70, em gain ~ 150) # ReadNoise = 109.8 #electrons # noiseFactor = 1.41 # electronsPerCount = 27.32 # # #class MetaData: # def __init__(self, voxSize, CCDMD = None): # self.voxelsize = voxSize # self.CCD = CCDMD # ##FIXME - THIS SHOULD ALL BE EXTRACTED FROM LOG FILES OR THE LIKE #TIRFDefault = MetaData(VoxelSize(0.07, 0.07, 0.2), CCDMetaDataIXonDefault()) TIRFDefault = NestedClassMDHandler() #voxelsize TIRFDefault.setEntry('voxelsize.x', 0.07) TIRFDefault.setEntry('voxelsize.y', 0.07) TIRFDefault.setEntry('voxelsize.z', 0.2) TIRFDefault.setEntry('voxelsize.units', 'um') #camera properties - for Andor camera - see above #TIRFDefault.setEntry('Camera.ADOffset',1100) TIRFDefault.setEntry('Camera.ReadNoise', 109.8) TIRFDefault.setEntry('Camera.NoiseFactor', 1.41) TIRFDefault.setEntry('Camera.ElectronsPerCount', 27.32) TIRFDefault.setEntry( 'Camera.TrueEMGain', 20 ) #mostly use gain register setting of 150 - this will hopefully be overwitten
# endregion : Utilities # region : Initialize parameters # > Input parameter numFramesToAnalyze = 5 fitMod = 'LatGaussFitFR' threshold = 0.6 bIndiceRange = [-20, 0] # > File names filename = r'data\100x140x170.tif' # > Metadata metadata = NestedClassMDHandler() metadata.setEntry('voxelsize.x', 0.08) metadata.setEntry('voxelsize.y', 0.08) metadata.setEntry('voxelsize.z', 0.2) metadata.setEntry('voxelsize.units', 'um') metadata.setEntry('Camera.ADOffset', 0) metadata.setEntry('Camera.ReadNoise', 0) metadata.setEntry('Camera.NoiseFactor', 1) metadata.setEntry('Camera.ElectronsPerCount', 1) metadata.setEntry('Camera.TrueEMGain', 1) metadata.setEntry('Analysis.FitModule', fitMod) # > Runtime arguments