from functions_recorder import load_csv, plot_inputs_vr, plot_inputs_miniscope import tkFileDialog from paths import sync_path from Tkinter import Tk def get_tk_file(initial_path): root = Tk() root.withdraw() return tkFileDialog.askopenfilenames(initialdir=initial_path, filetypes=(("csv files", "*.csv"),))[0] # select the sync file to visualize file_path = get_tk_file(sync_path) # load the data in the file sync_data = load_csv(file_path) # determine whether it's a miniscope or VR file and plot accordingly if 'syncVR' in file_path: plot_inputs_vr(sync_data) else: plot_inputs_miniscope(sync_data) # root.destroy()
# close the opened applications create_and_send(paths.bonsai_ip, paths.bonsai_port, paths.bonsai_address, [1]) create_and_send(paths.unity_ip, paths.unity_port, paths.unity_address, [1]) sleep(2) bonsai_process.kill() # plot the timing # load the frame_list print(duration) frame_list = load_csv(current_path_sync) plot_inputs_vr(frame_list) # ask the user for the suffix (animal, result, notes) suffix = get_filename_suffix() # add the suffix to all the file names file_list = [csvName, videoName, current_path_sync] failed_files, _ = replace_name_part(file_list, 'suffix', suffix) print(failed_files) # do the same for the bonsai files unity_file = [paths.unity_temp_path] failed_unity, _ = replace_name_part(unity_file, 'suffix', '_'.join( (time_name, suffix))) print(failed_unity)