dmirman / gazer

Functions for reading and pre-processing eye tracking data.
43 stars 11 forks source link

function "find_messages_edf()" does not return trial numbers for "TRIALID" #5

Closed juthzi closed 3 years ago

juthzi commented 3 years ago

I would like to extract variables from EDF files using the function find_messages_edf(). However, when using the following code (following the paper on GazeR), I get only NAs for the trial column. The other columns look fine, though. Am I doing something wrong here? Thank you for any advice.

find_messages_edf(file_list = file_list_edf, 
                  varnames = c("TRIALID", "TRIAL_VAR condition", "TRIAL_VAR item", "TRIAL_VAR keypress"), 
                  patterns = c("TRIALID", "!V TRIAL_VAR condition", "!V TRIAL_VAR item", "!V TRIAL_VAR keypress"),
                  output_dir_behave_data)
jgeller112 commented 3 years ago

Without seeing your data, it is hard to tell. One thing I would check is if you have a TRIALID variable in the messages column. Can you post a list of all unique messages in your data?

juthzi commented 3 years ago

Thank you! I guess I can imagine what the problem is. I guess the second entry is supposed to be the trial id. However, I did not specifically make my python code hand over the TRIALID to the eyelink file, which would likely have been necessary in this case. But this should not be much of a problem, since I can create the information regarding the TRIALID myself.

[1] "!MODE RECORD CR 1000 2 1 L\n"
[2] NA
[3] "practice_video_onset"
[4] "practice_gaze_cue_onset"
[5] "practice_gaze_cue_end"
[6] "practice_video_end"
[7] "!V TRIAL_VAR condition practice"
[8] "!V IAREA RECTANGLE 3 820 770 1100 1051 roi_object" [9] "video_onset"
[10] "trial_gaze_cue_onset"
[11] "trial_gaze_cue_end"
[12] "video_end"
[13] "!V TRIAL_VAR condition high_short"
[14] "!V TRIAL_VAR condition low_short"
[15] "!V TRIAL_VAR condition low_long"
[16] "!V TRIAL_VAR condition high_long"
[17] "!V IAREA RECTANGLE 1 854 385 1066 495 roi_eyes"
[18] "!V TRIAL_VAR keypress 2"
[19] "TRIAL_RESULT"
[20] "!V TRIAL_VAR item guertel"
[21] "!V TRIAL_VAR item spargel"
[22] "!V TRIAL_VAR item hammer"
[23] "!V TRIAL_VAR keypress 1"
[24] "!V IAREA RECTANGLE 2 820 213 1100 627 roi_head"
[25] "!V TRIAL_VAR item schreibtisch"

jgeller112 commented 3 years ago

Is there another message that differentiates the trials you can use?

juthzi commented 3 years ago

The message 'item' differentiates the trials. However, the order of items appearing in the different trials is ramdomized. That means, the hammer will not always appear in the Xth trial. Therefore, I think the easiest way for counting trials, will be, if I simply count the rows of the csv files and transfer these values to the trial column.