def select_directory(self): """Open a directory selection dialog box""" value = self.item.from_string(to_text_string(self.edit.text())) parent = self.parent_layout.parent child_title = _get_child_title_func(parent) dname = getexistingdirectory(parent, child_title(self.item), value) if dname: self.edit.setText(dname)
def saveCalibrationPickle(stereo_var,calib_var): print '\n# SAVE CALIBRATION' # save data to file app = guidata.qapplication() # get selected directory myDir = getexistingdirectory() with open(myDir+'\calibration.pickle', 'w') as f: pickle.dump([stereo_var,calib_var], f)
def loadCalibrationPickle(): print '\n# LOAD CALIBRATION' # save data to file app = guidata.qapplication() # get selected directory myDir = getexistingdirectory() with open(myDir+'\calibration.pickle') as f: stereo_var,calib_var = pickle.load(f) return stereo_var,calib_var
def getFiles(): app = guidata.qapplication() # get selected directory myDir = getexistingdirectory() # change to selected directory os.chdir(myDir) files = glob.glob("*.tif") print "\n# DATA PATH" print myDir return files
def getFiles(): app = guidata.qapplication() # get selected directory myDir = getexistingdirectory() # change to selected directory os.chdir(myDir) files_name = glob.glob("*.tif") # print calibration path print "\n# CALIBRATION PATH" print myDir return files_name
def _open(self): saved_in, saved_out, saved_err = sys.stdin, sys.stdout, sys.stderr sys.stdout = None dirname = getexistingdirectory(self, _("Open"), "", options=QFileDialog.ShowDirsOnly) sys.stdin, sys.stdout, sys.stderr = saved_in, saved_out, saved_err if dirname: self.data = dwdata.DWObs() self.data.open_dir(dirname) cfeeds.set(self.data.list2choices(self.data.sections.keys())) csections.set( self.data.list2choices(self.data.sections.values()[0])) cpolars.set(self.data.list2choices(self.data.polars)) self.setup_central_widget(MainWidget, self.toolbar) #try: # self.data.dw_io.new_file(dirname, self.data.flist, 4, 8192) #except: # print "file exists" self.mainwidget.open_setup(self.data) self.setWindowTitle(APP_NAME + " - " + dirname)
import os import glob from shutil import copyfile from guidata.qt.compat import getexistingdirectory import guidata _app = guidata.qapplication() image_path = getexistingdirectory(None, 'path to images') #image_path = 'G:/Pictures/04092018-meg/E3-10fps/Separated_tif' num_convert = 2000 fps = 10 FilesNames = glob.glob(image_path + "\*.png") temp_name = FilesNames[0].split('t=') name_root = temp_name[0] + 't=' temp_name = temp_name[1].split('.png') #time_start = float(temp_name[0]) time_start = -3.0 if os.path.exists(image_path + "/temp"): print('temp folder already exists') else: os.mkdir(image_path + '/temp') i = 0 while i <= num_convert: time = time_start + i / fps try: src = name_root + str(round(time, 1)) + '.png' print(src) dst = image_path + '/temp/pic' + '%04d' % i + '.png' copyfile(src, dst) except FileNotFoundError:
@author: kiraz """ #importing libraries import matplotlib.pyplot as plt import numpy as np import pandas as pd from functions import * from guidata.qt.compat import getexistingdirectory """ Read data """ #Select data directory directory = getexistingdirectory() #directory = 'C:/Users/kiraz/Documents/McGill/Data/Espontanea-RD1/20191219/ND4LB/Data0125/Data0125.GUI' #create a pandas data frame with the information coming from the cluster_group file df = pd.read_csv(directory + "/cluster_group.tsv", sep="\t") #Select unique values from data frame labels = df.iloc[:, 0].unique() # Create a column of Boolean values. All the "good" values will have the label True. df['label'] = df['group'] == 'good' #Take the cluster id corresponding to the templates marked as good neurons = df[df['label']].cluster_id.values #load spike data/todos los spike times combinados de todos las neuronas detectadas neuralData = np.load(directory + "/spike_times.npy") #load clusters/son los clusters id ordenados segun la ocurrencia de los spike times, se repiten por cada spike time klusters = np.load(directory + "/spike_clusters.npy") #stack arrays coming from the spikes and klusters/une clusters y spike times en un arreglo np