Howdy, Stranger!

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

Supported by

Logging fMRI TR signals

Hi everyone,

Our group is trying to implement an auditory experiment that uses interrupted acquisitions on fMRI. In order to check that all stimuli are synchronized with the duration of the TRs, we would like to register in the log all TR onsets.

In our particular scanner, at each TR the machine sends a signal that is connected to the computer via USB, and is registered as a 't' keypress. We would like to log all occurrences of said keypress (or any other way of registering the signal), and the time when it happens, without blocking the code.

I checked the io.TriggerInput() setting but don't really understand how to set it up to do this. Is there a way to log all occurrences of 't' keypresses? If not, how to set up the TriggerInput object in order to do this?

Thank you very much!

Juan Jesus Torre

Comments

  • Hi there,

    if you use USB triggers (keyboard emulation), then indeed you cannot use the TriggerInput, since this expects a serial or parallel port as interface.

    Getting all triggers without blocking the code is very tricky. You could do this in an additional thread (or process), but that could affect the timing in your main thread (your experiment).

    The first thing to think about is whether logging each trigger is really needed. If you expect the clock of your scanner to be accurate, then you know when your triggers will come in, if you know your TR. So most of the time there is no need for actually log it and syncing once in the beginning of the experiment is enough.

    Sometimes, however, the trigger helps to time your design (if it is not free running). What I often do is a combination of knowing when the trigger should come, and then briefly wait for it (we often need this for real-time fMRI). For instance, if your TR is 2000, then you can basically do stuff for most of that time, and only in the end briefly wait for the next trigger. It of course depends on what else you are doing in your experiment, but I often have code similar like this:

    while last_trigger_time < TR - 100:
        # do stuff
    exp.keyboard.wait()  # wait for next trigger
    last_trigger_time = exp.clock.time
    

    Also keep in mind that the log time of the audio stimulus is not s accurate as that of a visual stimulus! (see http://docs.expyriment.org/Timing.html#audio for more information).

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