Csv psychopy events file

Dear team!!

I am trying to use the psychopy csv file given after an experiment to obtain the events of an EEG corresponding to this experiment. My question is regarding if this is the proper way to do so.

My guess the csv file is not in the same format you expect it to be in brainstorm.

How can I obtain or create this csv based on my psychopy experiment.

Thank you for all the help in advance!!

This post addresses your question:

1 Like

I would like to create form my data a CSV with label and time. I'm not sure if my epochs have more than one sample. Therefore I'm not sure if I need to use duration column.

Let's say my events are defined by tapping left or right based on a screen sign every 10 seconds in a finger tapping task but I have the time in which the key left or key right was tapped. I have then

label time
left 5
left 16
right 24
left 35
right 46
right 54

Is that alright?

What scenario would I need to use duration?

Thank you for your inavluable help!!!

As CSV the values must be comma-separated. Also, do not include the column headers, thus the file content should be something like:

left, 5
left, 16
right, 24
left, 35
right, 46
right, 54

This depends on how you plan to analyze your data. E.g., you may want to compute a feature only for the time the subject was pressing the key, then you may want to import the duration of the press.

Brainstorm allows making operations with events, for example, if you have the press and lift times, you can add both as simple events in the CSV file, and then combine them in Brainstorm to have an event with the pressing duration. Another way to do it would be to add events with duration in the CSV file, and then convert those to press and lift in Brainstorm. Which way to go? Well, it depends on which CSV file is easier for you to generate.

:bulb: During the analysis of the data, it is easier to delete events that you do not need, than re-doing you processing to add missing events

1 Like

ah ok! thank you. No headers then.

another question would be regarding duration. If I have a time window of 10 s to choose left or right keys and then 5s later from starting this period is when the subject presses the key, so, I shall use

left, 5, 10

or

left, 5

The use of duration or not in the CSV depends on the format of your experiment and the questions that you will explore, there is not a correct answer.

  • left, 5, 10 This does not seems correct, it indicates that an event happened (i.e., started) at 5s and lasted for 10s, thus it ended at 5s.

If you want to have also the selection window, you can make something like

selection_window, 0, 10
left_press, 5, 0

Notes:

  • In one .csv file all the events must be of the same kind, either simple or extended.
  • It is possible to create and import events from more than one .csv file. E.g, one file with simple and one file with extended events.
1 Like

thank you very much!!