Howdy, Stranger!

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

Supported by

Get X-coordinates of a moving stimulus according to the timestamp

Hello,

I am currently running an experiment of smooth pursuit in which participants have to track a stimulus moving along the horizontal axis (gaze position is recorded thanks to a Tobii X3-120 eyetracker).

I am relatively beginner in python but I succeeded in modifying one of the inline script that I found in the forum :

import math
from openexp.canvas import canvas

amp = 445.5 # Vibration amplitude (pixels)
freq = .5 # Vibration frequency (Hz)
T = 1000. / freq # Vibration duration is derived from frequency
duration = 16000 # Duration  of the smooth pursuit
my_canvas = canvas(exp)

t0 = self.time()
while True:
	# Draw the smooth pursuit target
	t = self.time() - t0
	dx = amp * math.sin(((t % T)/T) * 2 * math.pi)
	my_canvas.clear()
	my_canvas.fixdot(x=0 + dx)
	my_canvas.show()
	
	if t >= duration:
		break

	self.sleep(10)

The task works well and in my output, I get a .tsv file in which I can retrieve the timestamp and the X gaze position of the eye.

I just would like to know whether it is possible to add in the .tsv file (or in another output file) the x position of the target (and potentially the velocity of the eye and of the target) according to the timestamp ?

Thanks in advance for your help,

Best regards,

Alexis

Comments

  • Hi Alexis,

    Do you mean in the same data table as the gaze coordinates? It might be possible, but for that you better ask the Tobii people whether the eye tracking logs can be enhanced with behavioral variables. I know that this is possible for the eyelink eyetracker, so it might be possible for tobii as well.

    Apart from that, you could store on every iteration of your while loop the current time and position of the stimulus. For example:

    import math
    
    amp = 445.5 # Vibration amplitude (pixels)
    freq = .5 # Vibration frequency (Hz)
    T = 1000. / freq # Vibration duration is derived from frequency
    duration = 16000 # Duration  of the smooth pursuit
    my_canvas = Canvas(exp)
    
    stim_info = []
    
    t0 = self.time()
    while True:
    	# Draw the smooth pursuit target
    	t = self.time() - t0
    	dx = amp * math.sin(((t % T)/T) * 2 * math.pi)
    	my_canvas.clear()
    	my_canvas.fixdot(x=0 + dx)
    	my_canvas.show()
            stim_info.append([clock.time(), dx])
    	
    	if t >= duration:
    		break
    
    	self.sleep(10)
    

    The problem here is that your log file will become bit messy for that variable (essentially you are saving a list into a single cell of an excel sheet). So when you analyse the data, you need to spend a bit more effort to get the data. Nothing terribly complicated, but still something to keep in mind.

    Eduard

    Buy Me A Coffee

  • Hello,

    Thank you for your quick reply !

    Yes indeed this is what I want, but you're right, the Tobii people should have this information. But I thank you for your advice and for the modified code!

    Best,

    Alexis

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