Howdy, Stranger!

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

Supported by

Setup an experiment and save data

Hi

I'm new to eye tracking and pygaze . my requirement is to build an experiment to display an image or video file then record eye gaze points and fixations . I have started with pygaze temple in opensesame . I have these questions :

  1. How can I add video file or image to the experiment , I have added using sketchpad , but for video how to make it as long as the video plays ?

  2. After the video file is finished , how the experiment should end and save the data ?

Thanks for help

Comments

  • 1.How can I add video file or image to the experiment , I have added using sketchpad , but for video how to make it as long as the video plays ?

    Yes, with sketchpads you can add images. And with the video plugin, you can present videos. Unless you specify something else, the video will run as long as its duration.

    2.After the video file is finished , how the experiment should end and save the data ?

    Nothing needs to be done. The experiment will stop once no further items needs to be executed. For the data to be written to file you need to add a loggeritem to the experimental sequence. Then every time this logger item is executed, the current trials will be written to the file.

    When eye-tracking, the eyetracker software usually writes a seperate logfile with all the eye position samples. You can either opt for combining these two files after you recorded the data. Or you can send Opensesame variables to the eyetracker and it will be added to the eye logfile right away (at least it does so with the Eyelink eyetrackers)

    Eduard

    Buy Me A Coffee

  • edited February 2017

    Hi, I i'm using this code below to recored data from eyetribe using pygaze .

    when I run the .bat file it just shows ( press space to start calibration ) when I press space just shows a

    white calibration dot and stops the program . what could be the problem ?

    import os
    from constants import *
    from pygaze.display import Display
    from pygaze.screen import Screen
    from pygaze.keyboard import Keyboard
    from pygaze.eyetracker import EyeTracker
    import pygaze.libtime as timer
    
     # Initialise a Display to interact with the monitor
     disp = Display()
    
    # Initialise a Keyboard to collect key presses
    kb = Keyboard(keylist=None, timeout=None)
    
    # Create a Screen for the image task instructions
    inscr = Screen()
    inscr.draw_text(text='Please look at the images. \
    \n\n(Press any key to begin)', fontsize=24)
    
     # Create a Screen with a central fixation cross
     fixscr = Screen()
     fixscr.draw_fixation(fixtype='cross', diameter=8)
    
    # Create a Screen to draw images on later
     imgscr = Screen()
    
    # Initialise a new EyeTracker
     tracker = EyeTracker(disp)
    
    # Calibrate the eye tracker
    tracker.calibrate()
    
    # Feed the instructions to the Display
    disp.fill(inscr)
    # Show the instructions
    disp.show()
    # Wait until the participant presses any key
    # (Allowing them to read the instructions at their own pace)
    kb.get_key()
    
    # Loop through all image names
    for imgname in IMGNAMES:
    
    # Construct the path to the image
    imgpath = os.path.join(IMGDIR, imgname)
    
    # Draw the image on imgscr
    # (clear imgscr first, to be sure it's clean)
    imgscr.clear()
    imgscr.draw_image(imgpath)
    
    # Start recording gaze data
    tracker.start_recording()
    
    # Display a status message on the EyeLink computer
    # (EyeLink only; doesn't do anything for other brands)
    tracker.status_msg('Trial with %s image' % (imgname))
    
    # Log trial start
    tracker.log('TRIALSTART')
    
    # Feed the fixation Screen to the Display
    disp.fill(fixscr)
    # Update the monitor to show the fixation mark
    disp.show()
    # Log the fixation onset to the gaze data file
    tracker.log('fixation_onset')
    # Wait for the right duration
    timer.pause(FIXTIME)
    
    # Feed the image Screen to the Display
    disp.fill(imgscr)
    # Update the monitor to show the image
    disp.show()
    # Log the image onset to the gaze data file
    # Include the image name in the message!
    tracker.log('image_onset, imgname=%s' % (imgname))
    # Wait for the right duration
    timer.pause(IMGTIME)
    
    # Clear the Display
    disp.fill()
    # Update the monitor to show a blank screen
    disp.show()
    # Log the image offset
    tracker.log('image_offset')
    
    # Log the end of the trial
    tracker.log('TRIALEND')
    # Pause recording
    tracker.stop_recording()
    
    # Clear the instructions Screen
    inscr.clear()
    # Write a new message
    inscr.draw_text(text='All done!', fontsize=24)
    # Feed the new message to the Display
    disp.fill(inscr)
    # Show the message
    disp.show()
    # Wait until the participant presses any key
    # (Allowing them to read at their own pace)
    kb.get_key()
    
    # Close the connection to the eye tracker
    # (This will also close the log file!)
    tracker.close()
    
    # Close the Display
    disp.close()
    
  • Hi,

    I'm not sure why but your line, kb.get_key(), is not responding to key presses. For testing purposes, try using a timeout (e.g. 2000 ms), this solved it for me. However, on the long run, you should find out how to initialize a keyboard the proper way. I don't use the pygaze functions myself, so I can't really help there.

    So, use this to check if your experimental sequence is alright: kb.get_key(timeout=2000)

    Eduard

    Buy Me A Coffee

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