dmirman / gazer

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

parse_edf function deletes message entries on the way #9

Closed juthzi closed 3 years ago

juthzi commented 3 years ago

Hello everyone,

I have just now realized that after using the parse_edf function, a lot of my messages got lost on the way, which means, they are not present in the csv file anymore. This seems to be case whenever there are multiple message logged for ONE timestamp in the EDF/ASC file, like in this example excerpt: ... MSG 1072433 !V TRIAL_VAR condition high_short MSG 1072433 !V TRIAL_VAR item blume MSG 1072433 !V TRIAL_VAR keypress 1 MSG 1072433 !V IAREA RECTANGLE 1 854 385 1066 495 roi_eyes MSG 1072433 !V IAREA RECTANGLE 2 820 213 1100 627 roi_head MSG 1072433 !V IAREA RECTANGLE 3 820 770 1100 1051 roi_object MSG 1072433 TRIAL_RESULT 1072433 497.7 522.0 697.0 127.0 ... ...

Here, all messages in theory are logged with sample 1072433, but only the first message ('!V TRIAL_VAR condition high_short') makes it through the parse_edf function. It makes sense, that the function would not know where to attribute these messages to if not to the following sample. However, I need these messages (at least the 'item' and 'keypress') for analysis. Do you have plans to include this functionality in the function? If not, do you have recommendations for me how to tackle this issue?

Thank you!

jgeller112 commented 3 years ago

You should be able to retrieve all the important message information (!IV strings) with the edf_messages function and merge them with the raw file. The purpose of the messages in the parse_edf is to do onset alignment to a particular stimulus—most the message information output is not relevant to the analysis itself. It is meant to keep the most important messages—usually the start of some event. Are you sending messages at the start of the trial and no where else?

J

Jason Geller, Ph.D. Research Programmer RuCCS, The Center for Cognitive Science 152 Frelinghuysen Roadhttps://www.google.com/maps/search/152+Frelinghuysen+Road?entry=gmail&source=g, A122, Busch Campus Piscataway, New Jersey 08854 Email: Jason.geller@ruccs.rutgers.edu

On Sep 9, 2020, at 9:42 AM, juthzi notifications@github.com wrote:



Hello everyone,

I have just now realized that after using the parse_edf function, a lot of my messages got lost on the way, which means, they are not present in the csv file anymore. This seems to be case whenever there are multiple message logged for ONE timestamp in the EDF/ASC file, like in this example excerpt:

... MSG 1072433 !V TRIAL_VAR condition high_short MSG 1072433 !V TRIAL_VAR item blume MSG 1072433 !V TRIAL_VAR keypress 1 MSG 1072433 !V IAREA RECTANGLE 1 854 385 1066 495 roi_eyes MSG 1072433 !V IAREA RECTANGLE 2 820 213 1100 627 roi_head MSG 1072433 !V IAREA RECTANGLE 3 820 770 1100 1051 roi_object MSG 1072433 TRIAL_RESULT 1072433 497.7 522.0 697.0 127.0 ... ...

Here, all messages in theory are logged with sample 1072433, but only the first message ('!V TRIAL_VAR condition high_short') makes it through the parse_edf function. It makes sense, that the function would not know where to attribute these messages to if not to the following sample. However, I need these messages (at least the 'item' and 'keypress') for analysis. Do you have plans to include this functionality in the function? If not, do you have recommendations for me how to tackle this issue?

Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/dmirman/gazer/issues/9, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEMTQEF6KOYXWWV2474VC7DSE6A2NANCNFSM4RCJFDMQ.

jgeller112 commented 3 years ago

I am not sure what the above will give you as opposed to the approach you tried here: https://github.com/dmirman/gazer/issues/6

juthzi commented 3 years ago

You should be able to retrieve all the important message information (!IV strings) with the edf_messages function and merge them with the raw file. The purpose of the messages in the parse_edf is to do onset alignment to a particular stimulus—most the message information output is not relevant to the analysis itself. It is meant to keep the most important messages—usually the start of some event. Are you sending messages at the start of the trial and no where else?

Thank you very much for the explanation! I was not aware that it does not matter at this point if the behavioural data is not completely present.