Ejemplo n.º 1
0
    def OnPerFrame(self, event):
        import numpy as np
        import os
        from PYME.IO.FileUtils import nameUtils
        
        filename = wx.FileSelector("Choose a per frame variable to open", 
                                   nameUtils.genResultDirectoryPath(), 
                                   default_extension='npy', 
                                   wildcard='Saved numpy array (*.npy)|*.npy')

        #print filename
        if not filename == '':
            #open file
            var = np.load(filename).astype('f')
            
            dlg = wx.TextEntryDialog(self.visFr, 'What do you want the new variable to be called?', 'Enter variable name', os.path.split(filename)[-1])
            
            if dlg.ShowModal() == wx.ID_OK:
                varname = dlg.GetValue().encode()
                pipeline = self.visFr.pipeline
                
                #perform lookup            
                values = var[pipeline.selectedDataSource['t'].astype('i')]
                
                #add looked up values to input mapping
                pipeline.addColumn(varname,  values)

                #regenerate the pipeline
                pipeline.Rebuild()
Ejemplo n.º 2
0
    def OnOpenFile(self, event):
        filename = wx.FileSelector("Choose a file to open", 
                                   nameUtils.genResultDirectoryPath(), 
                                   wildcard='All supported formats|*.h5r;*.txt;*.mat;*.csv;*.hdf|PYME Results Files (*.h5r)|*.h5r|Tab Formatted Text (*.txt)|*.txt|Matlab data (*.mat)|*.mat|Comma separated values (*.csv)|*.csv|HDF Tabular (*.hdf)|*.hdf')

        #print filename
        if not filename == '':
            self.OpenFile(filename)
Ejemplo n.º 3
0
    def OnOpenChannel(self, event):
        filename = wx.FileSelector("Choose a file to open", 
                                   nameUtils.genResultDirectoryPath(), 
                                   default_extension='h5r', 
                                   wildcard='PYME Results Files (*.h5r)|*.h5r|Tab Formatted Text (*.txt)|*.txt')

        #print filename
        if not filename == '':
            self.OpenChannel(filename)
Ejemplo n.º 4
0
def load_fiducial_info_from_second_file(pipeline):
    msg = '''New analyses should fit fiducials at the same time as the localisations and not use this function.
    When using this function, the raw localizations of all fiducials should be loaded and not a pre-filtered version'''
    if wx.MessageBox(msg, 'Info', style=wx.OK|wx.CANCEL) != wx.OK:
        return
    
    filename = wx.FileSelector("Choose a file to open",
                               nameUtils.genResultDirectoryPath(),
                               default_extension='h5r',
                               wildcard='PYME Results Files (*.h5r)|*.h5r|Tab Formatted Text (*.txt)|*.txt|Matlab data (*.mat)|*.mat|Comma separated values (*.csv)|*.csv')
    
    #print filename
    if not filename == '':
        pipeline.OpenChannel(filename, channel_name='Fiducials')