Howdy, Stranger!

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

Supported by

canvas stimuli problem

Hello,
I’m currently working to present more than one stimuli on the screen (rectangle and circle) with two trial in one block. My purpose is to create more than one blocks with more trials. As Fladd suggest :
With canvas I tried :
`block_one = expyriment.design.Block(name="1")
trial_one = expyriment.design.Trial()
stim1 = expyriment.stimuli.Rectangle([150,150], position = [-100,0], colour = expyriment.misc.constants.C_YELLOW)
stim1.plot(canvas)
stim2 = expyriment.stimuli.Circle(radius = 100, position = [100,0], colour = expyriment.misc.constants.C_GREEN)
stim2.plot(canvas)
trial_one.add_stimulus(canvas)
corr_res = 122
label_id = 'rectangle-circle'
trial_two = expyriment.design.Trial()
stim2 = expyriment.stimuli.Circle(radius = 100, position = [100,0], colour = expyriment.misc.constants.C_GREEN)
stim2.plot(canvas)
stim3 = expyriment.stimuli.Rectangle([150,150], position = [-100,0], colour = expyriment.misc.constants.C_GREEN)
stim3.plot(canvas)
trial_two.add_stimulus(canvas)
corr_res = 109
label_id = 'circle-rectangle'
block_one.add_trial(trial_one)
block_one.add_trial(trial_two)
block_one.shuffle_trials()
exp.add_block(block_one)

expyriment.control.start(skip_ready_screen=True)
fixation_cross = expyriment.stimuli.FixCross()
fixation_cross.preload()
blankscreen = expyriment.stimuli.BlankScreen()
blankscreen.preload()

for block in exp.blocks:
for trial in block.trials:
trial.stimuli[0].preload()
fixation_cross.present()
exp.clock.wait(dur)
trial.stimuli[0].present()
canvas.present()
exp.clock.reset_stopwatch()
key, rt = exp.keyboard.wait(keys=[expyriment.misc.constants.K_m,
expyriment.misc.constants.K_z])
expyriment.control.end()`
There is no error, two trial presented as squences, fixation poin not missing, however only last stimuli presented.

Other solution, I tried :
`block_one = expyriment.design.Block(name="1")
var_one = expyriment.design.Trial()
stim1 = expyriment.stimuli.Rectangle([150,150], position = [-100,0], colour = expyriment.misc.constants.C_YELLOW)
stim2 = expyriment.stimuli.Circle(radius = 100, position = [100,0], colour = expyriment.misc.constants.C_GREEN)
var_one.add_stimulus(stim1)
var_one.add_stimulus(stim2)
corr_res = 122
label_id = 'rectangle-circle'
var_two = expyriment.design.Trial()
stim3 = expyriment.stimuli.Circle(radius = 100, position = [100,0], colour = expyriment.misc.constants.C_GREEN)
stim4 = expyriment.stimuli.Rectangle([150,150], position = [-100,0], colour = expyriment.misc.constants.C_GREEN)
var_two.add_stimulus(stim3)
var_two.add_stimulus(stim4)
corr_res = 109
label_id = 'circle-rectangle'
block_one.add_trial(var_one)
block_one.add_trial(var_two)
block_one.shuffle_trials()
exp.add_block(block_one)

expyriment.control.start(skip_ready_screen=True)
fixation_cross = expyriment.stimuli.FixCross()
fixation_cross.preload()
blankscreen = expyriment.stimuli.BlankScreen()
blankscreen.preload()

for block in exp.blocks:
for trial in block.trials:
fixation_cross.present()
trial.stimuli[0].preload()
trial.stimuli[0].present(update=False)
trial.stimuli[1].present(clear=False)
exp.clock.reset_stopwatch()
key,rt = exp.keyboard.wait(keys=[expyriment.misc.constants.K_m,
expyriment.misc.constants.K_z])
expyriment.control.end()`

All stimuli can be presented, but there is no fixation point and swap between rectangle-circle or circle-rectangle. Any help or suggest would be appreciated and sorry for the code.

Thanks
Tanto

Comments

  • Dear tanto,

    the code you provided does not run. Can you post a running example?

  • Apologize for that. This is my code and should work
    Hope this help

    Many thanks
    Tanto

  • So from what I can see is that you are adding all 6 stimuli to the same canvas. From your description above this is not what you want...
    Simply creating a canvas stimulus in each trial, would solve this.

    #block1
    block_one = expyriment.design.Block(name="1")
    trial_one = expyriment.design.Trial()
    canvas = expyriment.stimuli.Canvas(size=(500,500))
    stim1 = expyriment.stimuli.Rectangle([150,150], position = [-100,0], colour = expyriment.misc.constants.C_YELLOW)
    stim1.plot(canvas)
    stim2 = expyriment.stimuli.Circle(radius = 100, position = [100,0], colour = expyriment.misc.constants.C_GREEN)
    stim2.plot(canvas)
    trial_one.add_stimulus(canvas)
    corr_res = 122
    label_id = 'rectangle-circle'
    trial_two = expyriment.design.Trial()
    canvas = expyriment.stimuli.Canvas(size=(500,500))
    stim2 = expyriment.stimuli.Circle(radius = 100, position = [100,0], colour = expyriment.misc.constants.C_GREEN)
    stim2.plot(canvas)
    stim3 = expyriment.stimuli.Rectangle([150,150], position = [-100,0], colour = expyriment.misc.constants.C_GREEN)
    stim3.plot(canvas)
    trial_two.add_stimulus(canvas)
    corr_res = 109
    label_id = 'rectangle-circle'
    trial_three = expyriment.design.Trial()
    canvas = expyriment.stimuli.Canvas(size=(500,500))
    stim3 = expyriment.stimuli.Rectangle([150,150], position = [-100,0], colour = expyriment.misc.constants.C_GREEN)
    stim3.plot(canvas)
    stim4 = expyriment.stimuli.Circle(radius = 100, position = [100,0], colour = expyriment.misc.constants.C_YELLOW)
    stim4.plot(canvas)
    trial_three.add_stimulus(canvas)
    corr_ress = 122
    label_id = 'rectangle-circle'
    trial_four = expyriment.design.Trial()
    canvas = expyriment.stimuli.Canvas(size=(500,500))
    stim5 = expyriment.stimuli.Circle(radius = 100, position = [100,0], colour = expyriment.misc.constants.C_YELLOW)
    stim5.plot(canvas)
    stim6 = expyriment.stimuli.Rectangle([150,150], position = [-100,0], colour = expyriment.misc.constants.C_YELLOW)
    stim6.plot(canvas)
    trial_four.add_stimulus(canvas)
    corr_res = 109
    label_id = 'circle-rectangle'
    block_one.add_trial(trial_one)
    block_one.add_trial(trial_two)
    block_one.add_trial(trial_three)
    block_one.add_trial(trial_four)
    block_one.shuffle_trials()
    exp.add_block(block_one)
    
  • Thanks Fladd for your fast answer. Now it works like what I expected. Also an embarrassing problem from my code is I accidentally put the exact position for the both stimuli, which make them not swaping from trial to trial.
    I'm really apologize for the obscurity.
    Best Regard

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