Howdy, Stranger!

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

Supported by

Create 30sec run of flickering images

Hi there,

I'm trying to create an experiment where I flicker between two jpg images at a given rate. The images are actually a checkerboard, but I'm not confident to create these in Psychopy, so I've just created an inverse images that I want to present in alternating order, for example at 100 ms per stimulus:

-checkerboard1 (100 ms)

-checkerboard2 (100ms)

and repeat for 30 seconds. In between each block of 30 sec checkerboard flicker I'll just have a simple baseline with empty screen with a fixation point.

I've done some reading on timing and I'm using Expyriment backend to take advantage of V-Sync and Blocking flip (I think these are automatically utilised here?).

Originally I built my task with a block Loop with a variable 'stim' that defined which jpg image to show on the sketchpad. This loop had 200 rows (check1.jpg, check2.jpg, check1.jpg, etc etc such that a single sequence would last 30 sec).

Then the trial sequence just had a single sketchpad with an image defined by the 'stim' variable, with duration 100 ms.

I also had a second block look with a single sketchpad wiht a fiation point and this had duration 30000 ms.

The task worked, except of course for the glitchiness of having to call the new sequence each loop.

So after reading about timing, I tested out a different approach. Here I removed the 'stim' variable in the Block loop. Instead I had multiple sketchpads in the trial sequence: sketchpad 1, sketchpad 2, sketchpad 1, etc. The sketchpads with check1.jpg added were all linked, and similarly the sketchpads with check2.jpg added were all linked.

The flicker was much smother (I also changed the sketchpad durations to 95 ms to allow for meeting the refresh deadline). But the task keeps crashing with an 'unknown' error. To test it out I actually 'only' added 30 sketchpads (15 for check1.jpg, 15 for check2.jpg) . So I'm guessing this is making the task a bit unstable? Of course, at 100 ms per stimulus, this only gives me 3 seconds for the block duration, and I need 30 sec!

So hoping there's a much more efficient way to get this task to run?

Comments

  • Hi @rlaycock,

    If you need flickering for that long, using individual sketchpads might be a bit unstable indeed (just a hunch not something that I "know").

    I would go for a presentation within an inline_script, as for example demonstrated here.

    So, essentially use a while loop to control the timing.

    check1_cv = Canvas()
    check2_cv = Canvas()
    fix_cv = Canvas()
    check1 = exp.pool['check1.jpg']
    check2 = exp.pool['check2.jpg']
    
    check1_cv['img'] = Image(check1)
    check2_cv['img'] = Image(check2)
    check2_cv['img'] = Fixdot()
    
    stim_dur = 30000
    frame_dur = 95
    fix_dur = 10000
    
    # Create a keyboard object
    kb = Keyboard(timeout=0)
    
    start_time = check1_cv.show()
    while clock.time() - start_time < stim_dur:
        # allow to escape the loop
        if kb.get_key() is not None:
             break
        
        clock.sleep(frame_dur)
        check2_cv.show()
        clock.sleep(frame_dur) 
        check1_cv.show()
    
    fix_cv.show(fix_dur)
    
    

    Hope this helps,

    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