Howdy, Stranger!

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

Supported by

[solved] Unable to set backdrop in Eyelink 1000 using OS portable 0.27.3

edited July 2014 in OpenSesame

Hi, everyone. First of all, thank you for such a fine and useful experimental solution.
I'm trying to set a simple eye tracking experiment using OS; and, while everything seems to be working fine, I'm not managing to set the stimuli presented with a sketchpad to appear in the host PC, or to be saved to the EDF file.

I'm completely new to eye tracking and OS, and fairly new to python, so I might be doing something wrong.

I've added a couple of inline scripts. One, just after the sketchpad (image_pair) I want to set as backdrop, prepares said sketchpad to be set as backdrop. it goes like this:

eye_canv = self.copy_sketchpad("image_pair")
prepared_canv = exp.eyelink.prepare_backdrop(eye_canv)

The other one, just before the sketchpad, only executes in the run phase, and is simply:

exp.eyelink.set_backdrop(prepared_canv)

The experiment runs fine, but nothing is displayed in the host computer. What am I doing wrong?

I'm using OS portable 0.27.3 with the eyelink plugin (2.8.1 with pygaze gave me a "The Eyelink cannot handle filenames longer than 8 characters" exception), together with an Eyelink 1000.

Comments

  • edited 4:18AM

    Hi gerardo,

    You need to call the set_backdrop() function before you have called eyelink.start_recording() or before the eyelink_start_recording item is executed. Somehow the backdrop is not shown if you call the set_backdrop() function during recording of eye movements. Also, this method is very slow, so make sure using backdrop functionalities does not impact your response measurements.

    Buy Me A Coffee

  • edited June 2014

    Hi, Daniel, thank you for your fast answer. I've tried doing as you said, moving the set_backdrop() line before the eyelink_start_recording item in the trial sequence, but still, the stimuli are not displayed in the host pc. Everything seems to work fine, and the program gives no exception; but the canvas is not converted and/or sent to the host pc. I fear I might be doing something wrong, but I don't know what. My trial sequence is:

    eyelink_drift_correct set_canv (inline script with just the line I mentioned in my first post)

    eyelink_start_recording

    log_stim (a message to the log)

    image_pair (a canvas consisting in two random bmp images over a grey background)

    eyelink_stop_recording

    blank (a blank canvas)

    prepare_canv (inline script that copies image_pair canvas and prepares it to be set)

    logger

    I've tried writing all the backdrop code in the run phase before eyelink_start_recording, which doesn't result in any visible change; and to directly copy and set the backdrop without using prepare_backdrop(). The documentation seems to suggest that this is possible, but I get an bad argument exception. In my case, it seems that the set_backdrop() doesn't accept an unprepared canvas.

    So, this is my situation. Do you have any idea what might be happening now? Could you give me an example of an experiment using the backdrop functionalities, so I can check if I've done everything right?

    Thanks for your help!

  • edited 4:18AM

    Hi Gerardo,

    last time I did it, this experiment structure worked:

    in stimulus_display, I create a canvas in the prepare phase and when I have finished drawing I prepare it as a backdrop image with the following line at the bottom of the script:

    exp.bd = exp.eyelink.prepare_backdrop(canvas)
    

    Then as the first thing in the run phase, I send the backdrop to the Eyelink. In set_backdrop in the run (!) phase I call:

    exp.eyelink.set_backdrop(exp.bd)
    

    I don't think it matters if you do this before or after drift_correct (I did it before in this example) as long as you do it before you start recording. I don't know why it doesn't work for your eyelink installation. Is it a very old one? What type of Eyelink is it?

    Buy Me A Coffee

  • edited 4:18AM

    Thanks again. I will try in a few hours to see if I manage to make it work. I'm working with a desktop mount of an Eyelink 1000. I was not here when they bought it and installed, so I really don't know more about it.

    The only difference I can see from your experiment is that you create your own canvas while I use a sketchpad item that then I copy with self.copy_sketchpad(). I might try creating a simple canvas just to see if that has anything to do with it.

  • edited 4:18AM

    No luck :/
    My experiment was set exactly as yours, even with the

    exp.eyelink.set_backdrop()

    instruction in the run phase before the drift correction, at the beginning of the trial.

    I've also tried directly coding a new canvas, with no luck. I've tried one of the example experiments provided by eyelink with their own software, and the backdrop is properly displayed; so it must be something on the OS end. Could you by any chance send me your working experiment (or part of it), so I can see if the problem remains?

    I'm using an eyelink 1000 with the 4.51 version of the host pc software. I believe it was purchased 2-4 years ago. No one has ever used it before (which is a shame), so I really don't know if they did something wrong when installing it; but everything else works fine. Gaze is recorded, stimuli are displayed in the display pc, edf files are created and stored in both pcs...

    I'm using OS portable 0.27.3. I've finally solved my silly problem with OS 2.8.1; but still, every time a test is aborted, 2.8.1 kind of freezes (you can close OS and even save the experiment when prompted, but everything is greyed out and the GUI doesn't respond to any input). On the other hand, 0.27.3 requires 2 fixations to proceed when in drift_correct, I don't know why. 2.8.1 or the examples provided by eyelink don't show this behaviour. In neither of these two versions does setting the backdrop work. Do you think that running from source might solve the problem?

    I really don't know what else to do. I went with OS because I wanted to save time and keep my colleagues' pc clean, without unneeded installations. I'm still happy with the choice, but it is frustrating not to be able to set the backdrop. In any case, as it is not a vital part of my experiment, I might end up just forgetting about it, but it would be nice if we could figure out what's wrong.

    Anyway, thanks for your time.

  • edited 4:18AM

    I also had such problems here. We have several Eyelink installations, some of which are also of different models and makes. The backdrop functionality is a really 'iffy' feature of the Eyelink software, which is also badly implemented (sloooww!). Because of these differences in behaviour per system, it is really hard to pinpoint any problems.

    The last thing I can do, is send you an experiment of mine, of which I know the backdrop functionality worked for me. If it doesn't work for you, you know it is your setup. If it does work, you must be doing something slightly different in your experiment which breaks the backdrop stuff altogether.

    Regarding the problem you describe in your middle paragraph: this seems like a different or new problem altogether, and maybe it is a good idea to open a separate forum topic for this.

    I also noticed that you described that you are not running OpenSesame from source. I thought the whole eyelink plugin only worked when you ran OpenSesame from source and was not available for the packaged OS versions. Due to licensing restrictions, it is not allowed to package pylink (the python eyelink module) with OpenSesame, so you should not be able to work with the eyelink at all with the packaged version. Regardless of this, it is worth a try to use a portable version of OpenSesame, which basically is the same thing as running from source.

    Buy Me A Coffee

  • edited 4:18AM

    Well, I have to apologize for my misuse of computing jargon. I'm indeed running the portable versions of OS; and, therefore, kind of running from source already. So, checking your experiment seems to be the best (and only?) option. I've made my e-mail visible in my profile, so you can send me the file to that address.

    At the moment, I want to focus on this issue (and not to overload the forum with silly questions :) ). I'll be looking at these other problems I mentioned and, if they persist, I will create a new topic.

  • edited 4:18AM

    Hi Gerardo, I've been trying to find an appropriate experiment, but most I have readily available involve large image sets which I can't easily send along. I will try to create a simpler experiment that uses backdrops and see if it works here before I send it to you.

    Buy Me A Coffee

  • edited 4:18AM

    Thank you, Daniel, I'll wait for it.

    In the meanwhile, I've decided to move on and do the pilot testing without the backdrop functionality. Everything else has worked fine, except for a few quirks that I'll write about in a different post this afternoon, if I have the time.

  • edited June 2014

    Hi, Daniel,
    I was thinking about it and I realized that, when I first run OpenSesame 0.27.3, I had to remove line 898 from libeyelink.py, as it was negating the if statement and causing the program to crash:

    if hasattr(el,"bitmap2DBackdrop"):
        send_backdrop = el.bitmap2DBackdrop
    else:
        send_backdrop = el.bitmapBackdrop
    send_backdrop = el.bitmap2DBackdrop
    

    I think this might be related to my problems with set_backdrop. Could it be that el.bitmapBackdrop, or the lack of el.bitmap2DBackdrop, is causing it?

  • edited 4:18AM

    Hi Gerardo,

    of course, you're right. I forgot all about a conversation a while ago with the SR helpdesk during which they built a custom pylink module for me. It is weird that they haven't implemented these changes of my custom module in the main version of pylink, but I guess their maintenance is quite lacking anyway as there hasn't been an update to the main pylink version for a long while now.

    If I get back to work on Monday I will send you my pylink module, which will hopefully make things work for you.

    Buy Me A Coffee

  • edited 4:18AM

    Hi Gerardo and Daniel,

    I'm facing the same problem with 2.8.1 version.
    I'm trying to connect an Eyelink 1000 with a OS experiment which consists of a unique (big) inline_script component.
    When I put the PyGaze components (calibration, start recording, log, stop recording) in the Experiment sequence without the inline_script component, it gives me the error: "The EyeLink cannot handle filenames longer than eight characters". How did you solve it?
    Then, when I also put the inline_script component (after calibration), OS simply ignores the calibration component, do not show the error above and starts my experiment.
    Can you help me?

    Thanks, Ambra

  • edited 4:18AM

    Hi Ambra,

    When I put the PyGaze components (calibration, start recording, log, stop recording) in the Experiment sequence without the inline_script component, it gives me the error: "The EyeLink cannot handle filenames longer than eight characters". How did you solve it?

    The error message basically says it all: The filename (without the .csv extension) should be eight characters or less. So subject-0.csv is ok (8 characters), but subject-10.csv is not (9 characters).

    Cheers,
    Sebastiaan

  • edited July 2014

    Hi Sebastiaan,

    thanks for your reply, we fixed the error "The EyeLink cannot handle filenames longer than eight characters".
    We are now able to open the connection with the Eyelink. In the Experiment there are few components in this order:

    1. pygaze_init
    2. pygaze_start_recording
    3. inline_script (with my whole experiment in python language)
    4. pygaze_log
    5. pygaze_stop_recording.

    Calibration and validation work fine, then the program asks for 'q' press to go back to menu. We press it once, then the stimulation PC display turns black and we don't see our experiment running. We are using PsychoPy back end. We also tried the example called pygaze_plugins provided in WinPython-OpenSesame-2.8.1\OpenSesame\opensesame-2.8.1\examples, it uses legacy back end and it works properly.

    Do you have any suggestions about this issue?

    Cheers, Stefania and Ambra

  • edited 4:18AM

    Have you tried pressing 'q' a second time? The blank screen you are seeing might well be the menu, which is not drawn due to some underlying error. To confirm this theory, either press 'q' a second time, or press 'Enter' after pressing 'q' the first time (this should show you the eye image; pressing 'Enter' again should make you return to the visible menu).

  • edited 4:18AM

    Hi Edwin,
    thank for your reply, we finally succeeded in running the experiment! We have to press the 'q' a second time to start the inline_script that follows calibration. Then everything works properly.
    Cheers, Ambra

  • edited October 2017

    Hi all,

    I don't know if anyone is still following this, but I also have the problem of unable to set the backdrop. I inserted an inline_script based on functions from the old Pygaze and it worked for both pygame and expyriment backend (didn't try on psychopy, tho)

    The code basically reads an image file from the filepool and send it to the host PC. So before the experiment loop starts:

    import pylink
    from PIL import Image
    import numpy as np
    
    def prepare_backdrop(im):
        # open image
        # for some weird reason the image is not displayed in its original color
        # perhaps a transparency issue (images of texts were exported from PowerPoint)
        img = Image.open(im).convert('I') 
        # convert image
        img_arr = np.array(img).tolist()
    
        return (img_arr,exp.width,exp.height)
    
    
    def set_backdrop(backdrop):
        starttime = exp.time()
    
        # call prepare_backdrop to convert image
        backdrop = prepare_backdrop(backdrop)
    
        # check if format is correct
        if type(backdrop)==tuple:
            if len(backdrop) != 3 or type (backdrop[0]) != list or \
            type(backdrop[1]) != int or type (backdrop[2]) != int:
                print 'hahahah', type (backdrop[0]),type(backdrop[1]),type(backdrop[2])
                raise Exception('Invalid tuple format')
            else:
                el = pylink.getEYELINK()
                # the other option "el.bitmap2DBackdrop" do not work for me
                send_backdrop = el.bitmapBackdrop
                img = backdrop[0]
                width = backdrop[1]
                height = backdrop[2]
                send_backdrop(width,height,img,0,0,width,height,0,0,pylink.BX_MAXCONTRAST)
        else:
            raise Exception(u'Unable to send backdrop')
    
        return exp.time() - starttime
    

    Then, within the experiment loop (in the prepare tab, before drift correction and start_recording) do the following:

    path = exp.pool[var.pic]
    lag = set_backdrop(path)
    

    I did notice a non-trivial lag. For Pygame it was about >200ms for expyriment it was about 100~200ms. However, because the image was sent to the host PC during the prepare phase in each trial it shouldn't affect too much (@sebastiaan is this correct?). Before the stimulus shows up, I also have a buffer blank image for 250ms after "start_recording", to equalize potential lags resulted from these communications. For most of the time, the image would first show up on the host PC.

    Hope this helps,
    Han

  • However, because the image was sent to the host PC during the prepare phase in each trial it shouldn't affect too much (@sebastiaan is this correct?)

    That's correct—in that case it only causes a lag between trials.

    And thanks for sharing your code!

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