![psychopy keypress enter psychopy keypress enter](https://psychopy-hoechenberger.readthedocs.io/en/latest/_static/UoN_Supported_RGB.png)
writer ( outputFile, delimiter = " \t ", dialect = 'excel' ) for row in combLogf : writer. append ( row ) outputFile = open ( 'allLogfiles.output', 'wt' ) #outputFile = open('processed.output','wt') writer = csv. insert ( 0, filename ) #print(logFile) for row in logFile : combLogf. pop ( 0 ) for row in logFile : subtractedTime = float ( row ) - float ( expBeginTime ) #this is the time value that will be used for onsets. startswith ( 'Keypress: quoteleft' ) and expBeginTime = 'empty' : expBeginTime = row # print (expBeginTime) expBeginRow = i i = i + 1 for k in range ( expBeginRow ): #delete everything above the point when experiment starts logFile. excel_tab )) i = 0 expBeginRow = 'empty' expBeginTime = 'empty' for row in logFile : #Find the point when experiment starts if row = 'DATA ' and row. reader ( open ( 'log-files/' + filename, 'rU' ), delimiter = ' \t ', dialect = csv. listdir ( "log-files" ): #takes all logfiles calculates corrected time values, inserts subject info and combines all logfiles logFile = list ( csv. Firat Soylu 2017 - University of Alabama import csv import re import os import fnmatch combLogf = #will include all logfiles for filename in os. # Used to process PsychoPy logfiles to generate onset times, durations, and accuracy. There are three conditions (2 task, 1 baseline) and for each condition you have a separate sublist of names, onsets, and durations. m file (for one subject) should look like.
![psychopy keypress enter psychopy keypress enter](https://aws1.discourse-cdn.com/business7/uploads/psychopy/optimized/2X/7/7db440b14e2936c6948bff6329d34b5886a2a0ca_2_1326x1000.jpeg)
You will need to tweak it a bit before it can work with your logfiles.
#Psychopy keypress enter download
You can download the Python script from the link at the bottom (change the extension to. Even if you don't use PsychoPy you might still benefit from the parts of the script that creates the. Here I present a Python script I put together to extract the onset and duration data from PsychoPy logfiles and to create the. m extension), formatted in a way that Matlab can read and convert into a. To do this you can use a script that takes the log files (from your stimulus presentation software), extracts the onsets and durations, and outputs a txt file (with. mat file that has all the onsets and durations, separately for each subject. If you are using SPM for fMRI data analysis and entering onsets and durations for each condition in the first level manually, then you should consider using the "multiple conditions" option, and input a.