Howdy, Stranger!

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

Supported by

[solved] Aligment does not seem to be in the center

edited March 2014 in OpenSesame

Dear all,

For a simple experiment participant view a fixation cross (400ms), a word (1000ms) and make eye movements (smooth puruit plug-in) for several seconds. I have (text) aligned the fixation cross and the word to the center. However, the fixationcross+word differ from their screen position with the eye movements. In my opinion the eye movements seem to be displayed in the center of the screen, but the fixation cross+word are presented a little above the center of the screen. The experiment's resolution matches the desktop's, so I am not sure why this discrepancy is present. Any tips would be very welcome.

Thank in advance!

Comments

  • edited 3:58AM

    Hi Kevin,

    Could you explain in more detail how you are presenting the fixation cross and word? Are you using a sketchpad, an inline_script, or something else, and do you have a code snippet to illustrate the problem?

    However, the fixationcross+word differ from their screen position with the eye movements.

    This confused me a bit, but with 'eye movements' you mean the moving stimulus of the smooth pursuit plug-in, right?

    Cheers,
    Sebastiaan

  • Hi Sebastiaan,

    I am using text display to present it. I'm not sure what you mean with a code snippet. I meant to say that I present a fixation cross followed by a word (both in 'text displays'). After that participants make eye movements (following the smooth pursuit dot). The dot seems to be centered. The cross and word do not seem to be. I figured out though that when I hit 'ENTER' three times in the text display that cross, word and dot align. This seems a silly way to do so.

    Also, do you know how I can log the duration of each specific presented element in a sequence?

  • edited 3:58AM

    I meant to say that I present a fixation cross followed by a word (both in 'text displays').

    Right, I see. The text_display plug-in is in deprecated in favor of forms, but neither are really suitable for what you want to do. I would just use a sketchpad item to present the fixation cross and the word, because a sketchpad will allow you to precisely indicate the position of your stimuli. Does that solve your problem?

    Also, do you know how I can log the duration of each specific presented element in a sequence?

    The timestamp of an item is automatically stored as the variable time_[item name], as described here:

    image

    Cheers and happy Holidays!

  • edited 3:58AM

    Hi Sebastiaan,

    This does solve my 'centering' problem.

    I'm still struggling with the duration. A time stamp does not seem to be that useful. In my experiment I am using the following sequence: fixation cross (400ms), target presentation (1s), operation A (24s) or B (24s), intertrial interval (400ms). Operation A or B is a within subjects manipulation and is selected based on each item's defined (A or B) operation in the loop. It seems a lot of work to determine whether each element has been presented for the defined amount of time. Is it also possible to have OS log the duration of each element individually?

  • edited January 2014

    The timestamps would actually be very useful for what you want to do. Suppose you have a sequence of three items: X, Y, and Z. The timestamp of Y minus the timestamp of X will give you the duration of X.

    So, in your case, you could add a blank sketchpad with a duration of 0 directly after operation A and B. In this case, the onset of the blank timestamp minus the onset of either A of B (depending on which one was presented) would give you the duration of that operation.

    In stead of the blank sketchpad, you could of course use an item that is in your sequence and directly after A and B, which seems to be the intertrial interval (ITI) in your experiment.

    This needn't be "a lot of work", as is illustrated by the following code snippet that you could easily put in an inline_script directly after the ITI.

    # get the timestamps
    opstart = exp.get("time_operationA")
    opend = exp.get("time_interval")
    
    # calculate difference
    opduration = opend - opstart
    
    # save as an OpenSesame variable
    exp.set("opduration", opduration)
    

    Note that you will need to change the item names (e.g. "operationA" in time_operationA in line 2) to names that are appropriate for your experiment.

    Good luck!

  • edited 3:58AM

    Hi Edwin,

    Thanks for your helpful reply. I tried the sketchpad and that does indeed work. I wanted to go for the inline, because it saves work in the long run. Therefore, I also tried the inline and that worked once. Then the experiment crashed (before I could save unfortunately), and now the same inline does not seem to work any more. I am a little confused about this.

    I changed the time_operationA (line2), time_interval (line 3) to the required names. However, it does not work any more. I am not sure why not. Any ideas?

  • edited 3:58AM

    Hi Kevin,

    Good to hear that you've managed to get something going. On your crash: it could be anything. From a polar bear sitting on your PC, to a problem with the placement of your script, or a silly little typo. I don't mean to be rude, but what I mean is that we're going to need a more elaborate description of your error than a simple "it does not work any more".

    Usually, an error message pops up when something goes wrong. If not, there is a very good chance that an error message is visible in the Debug Window. Please do copy this error message to the forum. Also, it would be a big help to post your experiment script here. If you're not comfortable with placing the entire thing online, you could also provide screenshots of the relevant bits of your experiment (i.e.: the trial sequence, and the items that are involved in the bit where the error occurs). Another possibility is emailing the script (but do keep the discussion on the forum, as others might benefit from this when facing a similar problem).

    Cheers!

    Edwin

  • edited January 2014

    Hi Edwin,

    Rest assured no polar bears here, but I understand what you mean. The problem is that usually OS gives no error. It simply does not save the defined variable (as stated in the inline). However, I received these errors a second ago. I'm not sure whether this has anything to do with it.

    image
    image

    The debug window states the following after my latest test:

    Python 2.7.5
    Type "help()", "copyright()", "credits()" or "license()" for more information.
    Type "modules()" for details about installed modules and version information.
    Use the "print [msg]" statement in inline_script items to print to this debug window.
    >>> 
    openexp._canvas.legacy.init_display(): enabling hardware surface
    openexp._canvas.legacy.init_display(): enabling double buffering
    openexp._canvas.legacy.init_display(): video mode ok
    openexp.sampler._legacy.init_sound(): sampling freq = 48000, buffer size = 512
    openexp.sampler._legacy.init_sound(): mixer already initialized, closing
    experiment.init_log(): using '//soliscom.uu.nl/uu/Users/Schie006/My Documents/Desktop/OpenSesame/subject-212.csv' as logfile (utf-8)
    experiment.run(): experiment started at Thu Jan 09 09:18:56 2014
    experiment.run(): experiment finished at Thu Jan 09 09:19:31 2014
    >>> 
    

    I've sent you the script by e-mail. Perhaps it is some sort of typo.

    Regards,

    Kevin

  • edited 3:58AM

    Hi Kevin,

    Thanks, this is exactly what I meant! Regrettably, yours is a very generic error, indicating a very hard crash. From your screenshot, I can infer that you're using a university PC (although I didn't know Utrecht switched to Google Chrome?).

    What my be causing the error, is that you're trying to save directly to your U-drive. Could you try keeping things local? What I mean by that is saving your experiment file to the computer itself (e.g. on the G: or H: drive), or on a USB drive. Also, when prompted, save the data file there. If you're using the Portable version, please also make sure that it runs from a USB (or external HDD) or locally on the computer.

    Although these things might be causing a problem, there is still a fairly big chance that your error persists (especially since it used to run properly). I received your script, and I will try to have a look at it when I have time, which will hopefully be somewhere before the end of this weekend.

    Cheers!

  • edited 3:58AM

    Hi Kevin,

    Just a quick tip: It seems like OpenSesame crashes when you launch the experiment, right? So not while working in the GUI? To avoid bringing the entire program down when this happens, you can select 'Run experiment in a different process' under preferences (for 0.27.4 and before), or make use of the new 'Multiprocess runner' functionality in the latest pre-release of 2.8.0:

    Cheers,
    Sebastiaan

  • edited 3:58AM

    Hi Edwin,

    I saved the experiment on my USB (no change though). I'm not sure whether UU switched browsers, but it's my prefered brower. Thanks for looking over the experiment during the weekends. Looking forward to hearing from you.

    @Sebastiaan; thanks for the tip! I adjusted it immediatly. As memory serves the error popped up just after running the experiment, but I could be wrong ofc.

  • edited January 2014

    ITA

  • edited 3:58AM

    Hi Edwin,

    Did you have time to look through the experiment?

    Kevin

  • edited January 2014

    Yes, I did. Was quite a hassle to actually read it, as you saved it as a RTF. Next time, could you simply send the experiment script in its original file type? (That's .opensesame)

    After getting it to open, I couldn't reproduce the error. The script seems to run just fine (of course, I don't know what it should do exactly, but there are no errors). All items do have incredibly short durations, but I assume you did this for testing purposes?

    I've send you the script and the example output (see your email). Could you confirm that these work? (or not).

    Testing conditions: Win7, 1920x1080 (did not adjust experiment resolution, though). Standard installation of OpenSesame 0.27.3, using the newest version of the smooth_pursuit plug-in (as you can download from GitHub: click 'Download ZIP', unzip, copy 'saccade' and 'smooth_pursuit' to plugins folder); back-end was set to legacy.

  • edited 3:58AM

    Hi Edwin,

    I'm sorry, I thought you meant the plain text script.

    All items are on short duration for testing purposes yes. Maybe I'm interpreting the output wrong then. When I first used the inline, it produced an extra variable in the output sheet called 'ESduration'. This variable is absent now, while it is the variable I am interested in. Am I overlooking something in the output or is it simply not there?

  • edited 3:58AM

    Well, to log it, you should either set the logger to "automatically log all variables", of you should explicitly indicate that you want to log that variable by checking it in the logger's list of variables.

    Do I understand correctly that the experiment does not crash anymore?

  • edited 3:58AM

    Hi Edwin,

    Yes, thanks! The experiment is running smoothly now. Apologies for not addressing that. Logging works fine, but only for the ES trials. When I try adding a similar inline for EM trials the experiment crashes, probably because I use sequential lists and the experiment always starts with an ES trial. The first logged datum for EM states 'not applicable'. I am assuming something goes wrong there. Is there a way to work around this?

  • edited 3:58AM

    Hi all,

    Is there anyone who can help me out with this problem?

    Thanks in advance,

    Kevin

  • edited 3:58AM

    Hi Kevin,

    When I try adding a similar inline for EM trials the experiment crashes, probably because I use sequential lists and the experiment always starts with an ES trial.

    Can you be a bit more specific? What exactly are you doing, and in what sense does the experiment crash (e.g. what's the output in the debug window)?

    Cheers,
    Sebastiaan

  • edited January 2014

    Hi Sebastiaan,

    My debug window states the following. Though I am not sure whether it is informative. I also added another error screen OS provides.

    Python 2.7.5  
    Type "help()", "copyright()", "credits()" or "license()" for more information.
    Type "modules()" for details about installed modules and version information.
    Use the "print [msg]" statement in inline_script items to print to this debug window.
    

    image

    What I am trying to do is the following in procedural terms: participants view a fixation cross (400ms), a word (1000ms) and make eye movements (EM; smooth puruit plug-in) for several seconds or keep their eye stationary (ES). A trial ends with a inter-trial interval. Lists of EM/ES are randomized offline, so the list order is sequential in OS. What I need to know is how long EM/ES periods take. I received help from Edwin for this earlier. He provided me with an inline script, which worked (see above). However, I think this only works for ES trials. When I try adding a similar inline for EM trials the experiment crashes, probably because I use sequential lists and the experiment always starts with an ES trial. The first logged datum for EM states 'not applicable'. I think something goes wrong there.

  • edited 3:58AM

    Does anyone have any suggestions?

  • edited 3:58AM

    Hi Kevin,

    Could you post your full script to pastebin, or some similar service? The error is in itself not very informative. Basically, it seems like you're trying to use a variable before it has been defined, but without the script and I cannot tell what and how exactly.

    Cheers,
    Sebastiaan

  • edited 3:58AM

    Hi Sebastiaan,

    I am assuming this is what you mean, right? http://pastebin.com/RqM2Kkgb

  • edited 3:58AM

    Hi Kevin,

    That's indeed what I mean, but this is not the script that gives the error you posted above, right? Because it contains neither a reference to the variable time_EM nor an item named Experiment (with a capital).

    Cheers,
    Sebastiaan

  • edited 3:58AM

    Ah apologies. I've sent you the one wherein I deleted that section.

    http://pastebin.com/Ht1yepNU Here

  • edited 3:58AM

    Right, in the sequence EMES_seq, you're running either the item EM or the item ES, using these run-if statements:

    [Procedure] = EMproc # for EM
    [Procedure] = ESproc # for ES
    

    However, you're always using the timestamps of both ES and EM (i.e. the variables time_ES and time_EM) in the inline_script Inline.

    # (...)
    # get the timestampES
    opstart = exp.get("time_ES")
    # (...)
    # get the timestampEM
    opstartEM = exp.get("time_EM")
    # (...)
    

    This will give an error if one of these has not been defined, because either ES or EM hasn't been executed yet. The easiest solution is probably to give both variables an initial value, by inserting the following inline_script at the start of the experiment:

    exp.set('time_ES', 0)
    exp.set('time_EM', 0)
    

    I would also recommend walking through a basic Python tutorial. You don't need any Python wizardry, but a basic knowledge of Python will give you a lot more freedom!

    Cheers,
    Sebastiaan

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