Howdy, Stranger!

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

Supported by

fMRI catch trial response messing up timing of presentation

edited June 2018 in OpenSesame

Hi all,

I'm working on an fMRI experiment with a 2000 ms TR in which the first 1000 ms is a scan, and next 1000 ms is a silent gap in which we present auditory stimuli.

At first, I tried using the "absolute timing" script that Sebastiaan provided to make the trials be presented every 2000 ms. This worked for the first block, but because we are using a multiband sequence that takes the scanner 40s to warm up, the "time_to_pad" variable would inevitably get messed up between blocks, and the second block's timing sequence would be off. Instead, it presented consistently presented stimuli every 1700 ms.

I abandoned the absolute timing in favor of having every trial triggered by the "5" keyboard response sent by our scanner to the testing computer. At the beginning of a TR, the scanner sends an emulated "5" keypress to the computer. As such, I put a keyboard response that required a "5" at the beginning of the block sequence to initiate the trial. It is then followed by a 1000 ms advanced delay, so that the audio doesn't start playing during the noisy scan sequence. Following the advanced delay is a sketchpad with a fixation cross that has a duration of 0, then the sampler that plays the auditory sequence, and then a keyboard response. On some trials, the stimulus is played more quietly and we use that as a catch trial to ensure participants are paying attention. Here is what this looks like

I currently have the timeout for the catch_response set at 1000 ms. However, when I look at the timing in my log file for the sampler called "stimulus", I see that trials are lasting 4000 ms instead of 2000 ms.

When I remove the "catch_response" item, the stimuli go back to being presented every 2000 ms and the timing is perfect. However, this breaks our ability to have catch trials.

I'm really struggling with this but I believe it has something to do with the timeout for catch_response. Any help would be much appreciated with this issue, as it will allow our lab to use OpenSesame for all of our future fMRI experiments.

Comments

  • I believe I have found a solution by using Sebastiaan's "absolute timing" script and modifying it so it resets the first trial timestamp for the first trial of each block, instead of trying to continue timing from the very beginning of the experiment.

  • edited July 2018

    Here is a more detailed explanation of what I changed, hopefully this will be useful to others in the future using OpenSesame for fMRI experiments that have breaks in between runs/blocks.

    In the code that Sebastiaan provides for absolute timing, it takes the timestamp of the very first trial and aligns timing to that for every stimulus thereafter. If you have a single, uninterrupted run with no breaks, this works fine. Given the particular scan parameters for my current experiment (multiband sequence), there is 40s of scanner "warmup" at the beginning of each block as it gets ready. This is not an issue for the first block, as the timing script does not mark the first trial timestamp until after the block has begun.

    However, for the remaining 9 blocks in the experiment, it attempts to pad 40s from the last trial of one block to the first trial of the following block. This leads to timing issues every time you transition from one block to another.

    The simple solution is to get the "live row" number of the loop (assuming each block/run of the experiment is its own loop) and have the timing of that block be relative to that, and not relative to the beginning of the experiment.

    Here is my code:

    # Specify how long you want the trial the last. Make sure that trials do not last
    # longer!
    trial_duration = xxxx
    
    # For the first trial, just note the time
    if var.live_row == 0:
            exp.set('first_trial_timestamp', self.time())
            time_to_pad = 0
    
    # For the other trials, wait until the the trial should start, based on the time
    # of the first trial and the trial duration
    else:
            time_to_pad = self.get('first_trial_timestamp') + var.live_row * trial_duration - self.time()
            if time_to_pad > 0:
                    self.sleep(time_to_pad)
    
    # Remember padding time
    exp.set('time_to_pad', time_to_pad)
    
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