Ejemplo n.º 1
0
    def pbHeadModel_Callback(self):
        
        options = QtGui.QFileDialog.DontResolveSymlinks | QtGui.QFileDialog.ShowDirsOnly
        HMdir = QtGui.QFileDialog.getExistingDirectory(self.pbHeadModel,
                "Select a Head Model Directory.",
                self.pbHeadModel.text(), options=options)    
                
        import os 
        from braink import read_lfm                 
        import config                
        import glob 
   
        lfm_fname = glob.glob(HMdir+'/*.lfm')
        if os.path.exists(HMdir+'/fdmForwardMatrixOriented'):          
            K  = read_lfm.forward(HMdir+'/fdmForwardMatrixOriented', config.nE)  
            print("fdmForwardMatrixOriented is loaded. ")            
        elif len(lfm_fname) > 0:  # elif os.path.exists(HMdir+'/Leadfield.lfm'): 
            K  = read_lfm.lfm(lfm_fname[0], config.nE)                          
            print("Leadfield.lfm is loaded. ")      
        else: 
            print("Either fdmForwardMatrixOriented or *.lfm are not loaded. ")            
        
#        nV = K.shape[1]
        config.K = K    
        config.nV = K.shape[1]    
        
        return K
Ejemplo n.º 2
0
    def pbHM_Callback(self):
        
        options = QtWidgets.QFileDialog.DontResolveSymlinks | QtWidgets.QFileDialog.ShowDirsOnly
        HMdir = QtWidgets.QFileDialog.getExistingDirectory(self.pbHM,
                "Select a Head Model Directory.",
                self.pbHM.text(), options=options)    
                
        import os 
        from braink import read_lfm                 
        import config                
        
        nE = config.nE
        nC = nE + 1
        if os.path.exists(HMdir+'/fdmForwardMatrixOriented'):          
            K  = read_lfm.forward(HMdir+'/fdmForwardMatrixOriented', config.nE)  
            print K 
            print("fdmForwardMatrixOriented is loaded. ")            
        elif os.path.exists(HMdir+'/Leadfield.lfm'): 
            K  = read_lfm.lfm(HMdir+'/Leadfield.lfm', config.nE)                          
            print("Leadfield.lfm is loaded. ")      
            print K 
        else:
            print("LFM is not loaded. ")            
        
        nV = K.shape[1]
        config.K = K    
        config.nV = nV    
        config.nC = nC    
        
        os.system("open /Applications/EAV/EAV.app")

        return  
Ejemplo n.º 3
0
    def pbHeadModel_Callback(self):

        options = QtGui.QFileDialog.DontResolveSymlinks | QtGui.QFileDialog.ShowDirsOnly
        HMdir = QtGui.QFileDialog.getExistingDirectory(
            self.pbHeadModel,
            "Select a Head Model Directory.",
            self.pbHeadModel.text(),
            options=options)

        import os
        from braink import read_lfm
        import config
        import glob

        lfm_fname = glob.glob(HMdir + '/*.lfm')
        if os.path.exists(HMdir + '/fdmForwardMatrixOriented'):
            K = read_lfm.forward(HMdir + '/fdmForwardMatrixOriented',
                                 config.nE)
            print("fdmForwardMatrixOriented is loaded. ")
        elif len(
                lfm_fname) > 0:  # elif os.path.exists(HMdir+'/Leadfield.lfm'):
            K = read_lfm.lfm(lfm_fname[0], config.nE)
            print("Leadfield.lfm is loaded. ")
        else:
            print("Either fdmForwardMatrixOriented or *.lfm are not loaded. ")

#        nV = K.shape[1]
        config.K = K
        config.nV = K.shape[1]

        return K
Ejemplo n.º 4
0
    def pbHM_Callback(self):

        options = QtWidgets.QFileDialog.DontResolveSymlinks | QtWidgets.QFileDialog.ShowDirsOnly
        HMdir = QtWidgets.QFileDialog.getExistingDirectory(
            self.pbHM,
            "Select a Head Model Directory.",
            self.pbHM.text(),
            options=options)

        import os
        from braink import read_lfm
        import config

        nE = config.nE
        nC = nE + 1
        if os.path.exists(HMdir + '/fdmForwardMatrixOriented'):
            K = read_lfm.forward(HMdir + '/fdmForwardMatrixOriented',
                                 config.nE)
            print K
            print("fdmForwardMatrixOriented is loaded. ")
        elif os.path.exists(HMdir + '/Leadfield.lfm'):
            K = read_lfm.lfm(HMdir + '/Leadfield.lfm', config.nE)
            print("Leadfield.lfm is loaded. ")
            print K
        else:
            print("LFM is not loaded. ")

        nV = K.shape[1]
        config.K = K
        config.nV = nV
        config.nC = nC

        os.system("open /Applications/EAV/EAV.app")

        return
Ejemplo n.º 5
0
Created on Tue May 19 11:04:41 2015

@author: jesong1126
"""

import os 
from braink import read_lfm                 
import glob 

        
HMdir = '/Users/jesong1126/Python27/GeoPy/data/108_HM'
nE = 256
 
lfm_fname = glob.glob(HMdir+'/*.lfm')
if os.path.exists(HMdir+'/fdmForwardMatrixOriented'):          
    K  = read_lfm.forward(HMdir+'/fdmForwardMatrixOriented', nE)  
    print("fdmForwardMatrixOriented is loaded. ")            
elif len(lfm_fname) > 0:  # elif os.path.exists(HMdir+'/Leadfield.lfm'): 
    K  = read_lfm.lfm(lfm_fname[0], nE)                          
    print("Leadfield.lfm is loaded. ")      
else: 
    print("Either fdmForwardMatrixOriented or *.lfm are not loaded. ")            

nV = K.shape[1]

os.system("open /Applications/EAV/EAV.app")
#os.system("open /Users/jesong1126/Desktop/EAV.app")
from RabbitMQ import Connection  
SampleTime = 0 

c = Connection.Connection('localhost')