Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Pygaze_log variables in EDF dataviewer?

Hello,

I'm trying to figure out how to find/call the sketchpad item names from my OS file in the EDF dataviewer 'sample report' output. The only variables that I get in the EDF output csv under 'sample_message' are 'start_trial' and 'stop_trial', which correspond to the 'pygaze_start_recording' and 'pygaze_stop_recording' plugins respectively. I have the 'automatically log all variables' button checked for the pygaze plugin, but are the variables being logged only referring to the pygaze plugins?

I had hoped that I could also log stimuli presentations to the EDF file - is this possible? Perhaps I am missing something obvious.

The reason I am trying to do this is that the sketchpad names correspond to different parts of the trial and I would like to be able to trim the pupil data based on specific onsets (although the timing is constant, there is slight variablility (2-4ms) in presentation times which makes it problematic to simply trim based on the sample # or timestamp).

Any assistance would be greatly appreciated!
Thanks,
Mikael

Comments

  • Hi Mikael,

    If you use the pygaze_log plugin, and enable 'Automatically log all variables', then the EDF will contain all experimental variables. You probably don't see them because they are not in the format that the EDF dataviewer expects. They are logged as messages in the following format:

        var [name] [value]
    

    You can specify this somewhere in the settings of the dataviewer. But I don't know exactly where, because I don't have or use that program myself. But in case, the data should be there!

    Cheers,
    Sebastiaan

  • Hi Sebastiaan,

    Okay great, thank you!

  • Isn't the syntax

    !V TRIAL_VAR [name] [value]
    

    to log variables for the Eyelink Dataviewer?

    Buy Me A Coffee

  • edited July 2016

    By default, yes. But that's not the syntax used by pygaze_log, so you need to explicitly indicate the PyGaze format in the Dataviewer. Maybe this should be made configurable in PyGaze though.

  • So I checked the ascii file of the edf output, and even though the pygaze_log 'log all variables' box is checked, in the ascii file they are not in the !V TRIAL_VAR [name] [value] format.
    Does that mean I need to manually add an inline_script item after the pygaze_log (or before?) with the !V TRIAL_VAR [name] [value] for each variable I want logged to the edf file?

    Thank you!

  • So I checked the ascii file of the edf output, and even though the pygaze_log 'log all variables' box is checked, in the ascii file they are not in the !V TRIAL_VAR [name] [value] format.

    Right, because (as I said) that's the format used by pygaze_log. But that's fine, because you can indicate in the EyeLink DataViewer that it should look for lines with var instead of !V TRIAL_VAR.

  • Hi Sebastiaan,

    I contacted SR-research and while I can indeed indicate to look for lines with var: "DataViewer needs the !V Data Viewer command to be parsed and actively interpreted. Otherwise, the contents is not flagged as something that Data Viewer should regard any differently than a pure text message." I apologize if that wasn't clear. While I can use a batch fix on the data I already collected to append !V as a prefix to var, I was trying to figure out how to add the !V part within OpenSesame - I realize that wasn't completely clear from the previous post and apologize for the confusion.

    Thank you for your patience and your help!

    Mikael

  • Hello,

    So I have an updated (and more informed, hopefully) question.

    If I want to log all (or as many variables) as possible within the !V TRIAL_VAR [name] [value], I understand how to do this for variables that are in the workflow (like sketchpad items, keyboard responses etc.), but I am not sure how to concisely also include variables from loop & merge (so I have a column named congruence with incon and con values - do I need a separate line for !V TRIAL_VAR congruence incon and !V TRIAL_VAR congruence con? Or is there a straightforward solution I am missing).

    Also, if there is any way to append !V to the pygaze log files that would be amazing (but my understanding is that there is not?)

    Thank you again!
    Mikael

  • edited September 2016

    Hi Mikael,

    What exactly do you mean with "variables from loop & merge"? To my knowledge, using !V TRIAL_VAR [name] [value] should work for all types of variables. So, if you have defined a variable in your loop table that is called congruence, which can have the values incon and con on different trials, you just log the variable congruence and the respective value will be written to the edf file. Does this make sense?

    By the way, not sure whether it helps you, but you can also send those variables to the eyetracker from within an inline_script, like so:

    exp.pygaze_eyetracker.log("!V TRIAL_VAR var %s" % var) 
    

    Hope this helped.

    Eduard

    Buy Me A Coffee

  • You could even be fancy and log all variables like so:

    for var in vars:
        eyetracker.log('IV TRIAL_VAR %s %s' % (var, vars[var]))
        clock.sleep(2)
    

    See also:

  • Hi Eduard,
    So I have tried the inline script and the py_gaze widget manual messages and I seem to get the same issue both times.
    For my inline script I use:
    exp.pygaze_eyetracker.log("!V TRIAL_VAR congruence %s" % var)
    For my py_gaze log message I use:
    !V TRIAL_VAR congruence [var]
    The variable congruence appears in the sample output report for dataviewer, but when I export the variables in both cases the column is filled with:
    <libopensesame.var_store.var_store object at 0x032BDB30>

    I also tested it with a 'count' variable that is automatically generated by OS:
    exp.pygaze_eyetracker.log("!V TRIAL_VAR count_Target_1 %s" % var)
    and I got the same result of:
    <libopensesame.var_store.var_store object at 0x032BDB30>

    It seems like there is some issue with using 'var' to call the value for whatever variable I specify (i.e. so if I specify the variable congruence using 'var' doesn't seem to get me the values for congruence (incon and con)). I'm really not familiar with python so I tried a few syntactical variations like or [var] but it didn't work out. Do you have any further thoughts?

    Thank you!
    Mikael

    P.S. Sebastiaan I tried your suggestion as well, and also used exp.pygaze_eyetracker.log as the function but in both cases got the error: TypeError: 'builtin_function_or_method' object is not iterable which leads me to further suspect some issue with called 'var'.

  • Hi Mikael,

    Just to be sure, did you see your actual variable names, or literally "var"?
    So, if congruence is the variable you want to record, you have to use:

    exp.pygaze_eyetracker.log("!V TRIAL_VAR congruence %s" % congruence)
    

    where the first congruence, specifies the name the variable will have in your edf file, and the second is providing the actual value.

    However, if you copied Sebastiaan's code literally, I don't understand why it didn't work for you.

    Eduard

    Buy Me A Coffee

  • Theres an error in Sebastiaans snippet. It says IV instead of !V at the start

    Buy Me A Coffee

  • Hi Eduard,

    I was using 'var'. I tried the actual variable name in both places: exp.pygaze_eyetracker.log("!V TRIAL_VAR congruence %s" % congruence) but it gives me the error: NameError: name 'congruence' is not defined This also holds true for OS generated variables likecount_Target`.

    Hi Daniel, I caught that as well, but it didn't seem to make any difference. The only thing I noticed is that vars in my snippet is in blue, whereas in Sebastiaan's it is white (which means it is a defined variable?). Is that meaningful or not?

    Am I potentially missing a plugin or something? I get all the eye tracking data just fine...it's only difficulty logging variables in the !V TRIAL_VAR format, from OS, that is giving me trouble.

    Thanks for all your help, sorry for the difficulty.

  • Did you define congruence in the loop table? If so, you have to use var.congruence. The same is true for OS defined variables. In inline_scripts they need to be called with var., where is the actual variable name.

    Eduard

    Buy Me A Coffee

  • Ahh, that did it, thank you so much!!

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games