Howdy, Stranger!

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

Supported by

[open] Pictures to pool

edited December 2015 in OpenSesame

Greetings !

I'm conducting an experiment which includes about 400 pictures divided into two groups.
The pictures on the first group suppose to appear throughout the experiment randomly and without repetition (i.e. a pic that has been presented from this group will not be presented again), and the pictures from the 2nd group will be presented randomly and each one of them will be shown twice throughout the experiment. it would be best if I could place two folders each containing one group's pictures into the pool, but since it's impossible (cannot save the project while folders are in the pool) my questions are :

  1. Whether it's possible to program opensesame to approach a certain folder (inside or outside the pool) whenever it encounters a certain condition and each time pick a photo from there, without my having to drag 400 pics into the pool and give each a different name ?
  2. What instructions should I use to guide it to pick randomly without repetition from one group's folder, and randomly with 1 repetition per photo on the other group's folder ?

thanks in advance for supporting
:)

Comments

  • edited December 2015

    Hi Marina,

    As long as the files are in the same folder as is the experiment, you don't have to drag them into the file pool. When calling exp.get_image(filename), you should be able to access the images. (e.g. like so: (my_canvas.image(exp.get_file('my_image.png'))).

    To pick the right images in a correct way, I recommend using an inline_script and prepare lists with the file names in beginning. That makes it easier to pick the right images later. Something along these lines should work;

    import random
    group1 = ['imagesg11.png','imagesg12.png',...,'last_image.png']
    group2 = ['imagesg21.png','imagesg22.png',...,'last_image.png']
    trials = []
    
    random.shuffle(group1)
    random.shuffle(group2)
    
    no_trials = 400
    for i in range(no_trials):
        trials.append(group1.pop(0)
        trials.append(random.choice(group2))
        trials.append(group2.pop(0))
    

    So, the list trials will contain all the file names for your images. You just have to loop over the list a present every image.

    Does this make sense?

    Eduard

    Buy Me A Coffee

  • edited 6:54AM

    Hi Eduard,
    Thank you so much for your response,
    I will try and run it as you suggest and let you know if it is solved.

    Thank you ;;)

  • edited 6:54AM

    Hi Eduard,

    I've been trying to place my pictures in the same folder as the experiment,
    but within the opensesame folder on my computer there are no folders which contain my experiment. Trying to trace the source of the pool folder leads me to C:\Users\User\appdata\Local\Temp
    which is a location I cannot reach on my computer, and within it the program opens
    a temporary folder that disappears as I close the program and does not save any files I add to it, so I cannot use any pictures I place in it.
    Further, since I'm unable to reach the experiment's folders,
    how would I be able to move it to another computer on which I'm supposed to conduct my experiment once it's ready ?

    Sorry, some of this stuff is new to me so I'm a bit confused,
    once again thank you for your support

    Marina

  • edited 6:54AM

    Hi Marina,

    In theory you should be able to save the experiment wherever you want. When you save it, just select the folder you want it to be saved in (Desktop, Documents, whatever). Once it is stored there, you can put the images in there. The default location to save the experiment, might be somewhere in C:\Users\appdata\,,,, but you once you save it to a more accessible location, you should be fine.

    Can you try and tell us whether this solved it?

    Eduard

    Buy Me A Coffee

  • edited December 2015

    Hi Eduard,

    so - I placed all the picture files at the correct folder and run them randomly,
    and after some adjustments it started running pretty much as it should.
    the main problem is that after about 50-60 trials the experiment stops
    and gives an 'error: Out of memory ' message is I run it on the quick run window,
    and, strangely, it keeps running much longer if I run it on a full screen mode, but still stops after couple hundred steps.
    following Sebastian's recommendations on former posts I made sure I'm using xpyriment back end (although my experiment is time sensitive), and that I run the experiment in a separate process, but the problem still occurs.
    My experiment contains of 2 target stimuli pictures (square & circle) and 2 frames pictures. on each trial one frame and one target stimuli appears simultaneously , for 600 trials. in addition, on 348 of the trials some other picture appears for a short while before the target stimuli + frame appears. I'm not using the pool and all my pictures are gathered on the same folder where the experiment is.
    Before my block loop I placed this initial_script on the prepare phase :

    import random

    Negative_group = []

    Neutral_group = []

    Negative_folder = "D:\GNG_SST_experiment\All_Negative_ordered\"

    Neutral_folder = "D:\GNG_SST_experiment\All_Neutral_ordered\"

    for i in range (1, 73):

    Negative_group.append("%d.jpg" % i)
    

    for i in range (73, 100):

    Negative_group.append("%d.bmp" % i)
    

    for i in range (100, 213):

    Neutral_group.append("%d.jpg" % i)
    

    for i in range (213, 230):

    Neutral_group.append("%d.bmp" % i)
    

    random.shuffle(Negative_group)

    random.shuffle(Neutral_group)

    and after the trial sequence I placed a second inline_script also on prepare phase:

    print (var.Picture)

    if (var.Picture == "Negative"):

    var.Pic_path = Negative_folder + Negative_group.pop(0)
    
    print(var.Pic_path)
    

    if (var.Picture == "Neutral"):

    var.Pic_path = Neutral_folder + Neutral_group.pop(0)
    
    print(var.Pic_path)
    

    print

    So I'll be grateful for any idea of the cause of failure.
    I added a pic of the experiment's so far (the practice phase is not yet set).
    Additionally, I'm not sure how should I make all the pictures to be presented on the same size without cropping them (some of them are of different sizes and I'd like them all to be presented uniformly)
    should I use PIL ?

    Sorry if some questions are weird, I'm not a pro on this as you can probably tell :]

    Thank you and a happy new year,

    Marina

    image

    http://img.cogsci.nl/?q=56805f341fbdc

  • edited 6:54AM

    here's the error message ;

    The experiment did not finish normally for the following reason:

    Unexpected error
    Details

    item-stack: experiment[run].Experimantal_loop[run].Experimemtal_Block[run].Block_loop[run].Trial_sequance_1[prepare].Picture[prepare]
    exception message: Out of memory
    time: Sun Dec 27 20:58:56 2015
    exception type: error
    Traceback (also in debug window)

  • edited January 2016

    Hi Marina,

    Sorry for the late response.

    Just from your description, I can't see what the problem could be. Everything seems to be fine. Would you mind uploading the experiment (e.g. to file dropper). Maybe then we can find the problem.

    Thanks,

    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