Selection and randomization of pictures within a trial


Author
Message
gracethenoob
gracethenoob
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 11, Visits: 85
I am having trouble selecting at random and presenting at random within trials.

For each trial, there is a target image presented at a specific point within a stream of filler images. Example:
1 = filler23
2 = filler17
3 = filler2
4 = target1
5 = filler6
6 = filler19
7 =  filler5
8 = filler4
9 = filler20
10 = filler15
11 = filler8

The constraints are:
(1) The 10 filler images are randomly drawn from a pool of 24 images, cannot repeat within a trial, must be presented in a random order, and must be selected anew each trial.
(2) There are 5 target images and a different one (using random selection) must be presented every trial.

I think the second constraint is straightforward because it works like a regular trial but I cannot figure out how to tackle the first constraint. I have looked at other code in the Inquisit library such as the Simple Attentional Blink code and it seems to have a solution when using single letters but I cannot seem to translate that strategy to pictures. Any tips?

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
What works for <text> elements works for <picture> elements as well. Set up ten filler <picture> elements -- <picture filler01> to <picture filler10> -- and have them select from the same item pool via a <list>; reset that list at the start of each <trial>. Set up a single <picture target> element.

<trial mytrial>
/ ontrialbegin = [list.filleritems.reset(); ]
/ stimulustimes = [0=filler01; 500=filler02; 1000=target; 1500=filler04; 2000=filler05; ...]
...
</trial>

<picture target>
/ items = ("t1.jpg", "t2.jpg", "t3.jpg", "t4.jpg", "t5.jpg")
</picture>

<list filleritems>
/ poolsize = 24
/ selectionrate = always
</list>

<picture filler01>
/ items = fillerimages
/ select = list.filleritems.nextindex
</picture>

<picture filler02>
/ items = fillerimages
/ select = list.filleritems.nextindex
</picture>

<picture filler03>
/ items = fillerimages
/ select = list.filleritems.nextindex
</picture>

<picture filler04>
/ items = fillerimages
/ select = list.filleritems.nextindex
</picture>

<picture filler05>
/ items = fillerimages
/ select = list.filleritems.nextindex
</picture>

...

<item fillerimages>
/ 1 = "f1.jpg"
/ 2 = "f2.jpg"
/ 3 = "f3.jpg"
...
/ 24 = "f24.jpg"
</item>


gracethenoob
gracethenoob
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 11, Visits: 85
Thank you for this assistance! It was very helpful :-)

chenxyu
chenxyu
Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)
Group: Forum Members
Posts: 18, Visits: 252
Hi Dave,
if I have a total of 1000 pictures and want to randomly select 5 from that pool and present them simultaneously for any given trial, does that mean I have to create a <picture> element for each of the 1000 pictures?

Thanks for your help!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
chenxyu - 11/9/2022
Hi Dave,
if I have a total of 1000 pictures and want to randomly select 5 from that pool and present them simultaneously for any given trial, does that mean I have to create a <picture> element for each of the 1000 pictures?

Thanks for your help!

No, you need five <picture> elements, since you want to display five images simultaneously.
chenxyu
chenxyu
Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)
Group: Forum Members
Posts: 18, Visits: 252
Thank you!
A couple of follow-up questions if you don't mind: I attempted to randomly select 5 pictures from a pool of 1000 pictures and another 4 from another pool of 800 pictures with no replacement (so picture will only present once throughout the experiment). This would mean I will need 9 <picture> elements, right?

To do so, I created two lists (List A with 1000 items and List B with 800 items) and within each list, I set /replace = false and /poolsize = 1000 and 800, respectively. Then within those picture elements, I set /selectionrate = experiment. Would this do I what want it to do? I've attached part of the code below if it makes it easier to read.

I also want to randomize the position of these pictures. Can you point me to some resources if this question has been answered elsewhere?

Finally, if I want to repeat this until all stimuli have been exhausted (i.e., a total of 200 trials, each trial has 5 pictures from list A and 4 from list B), what would you recommend?
<item person1-1000>
/1= "person1"
...
/1000="person1000"
</item>

<item name1-800>
/1="name1"
...
/800="name800"
</item>

<list person>
/items=(1,2,....,1000)
/replace=false
/poolsize=1000
</list>

<list name>
/items=(1,2,...,800)
/replace=false
/poolsize=800
<list>

<picture person1>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture person2>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture person3>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture person4>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture person5>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture name1>
/items=name
/select=list.name.nextindex
/selectionrate=experiment
</picture>

<picture name2>
/items=name
/select=list.name.nextindex
/selectionrate=experiment
</picture>

<picture name3>
/items=name
/select=list.name.nextindex
/selectionrate=experiment
</picture>

<picture name4>
/items=name
/select=list.name.nextindex
/selectionrate=experiment
</picture>


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
chenxyu - 11/9/2022
Thank you!
A couple of follow-up questions if you don't mind: I attempted to randomly select 5 pictures from a pool of 1000 pictures and another 4 from another pool of 800 pictures with no replacement (so picture will only present once throughout the experiment). This would mean I will need 9 <picture> elements, right?

To do so, I created two lists (List A with 1000 items and List B with 800 items) and within each list, I set /replace = false and /poolsize = 1000 and 800, respectively. Then within those picture elements, I set /selectionrate = experiment. Would this do I what want it to do? I've attached part of the code below if it makes it easier to read.

I also want to randomize the position of these pictures. Can you point me to some resources if this question has been answered elsewhere?

Finally, if I want to repeat this until all stimuli have been exhausted (i.e., a total of 200 trials, each trial has 5 pictures from list A and 4 from list B), what would you recommend?
<item person1-1000>
/1= "person1"
...
/1000="person1000"
</item>

<item name1-800>
/1="name1"
...
/800="name800"
</item>

<list person>
/items=(1,2,....,1000)
/replace=false
/poolsize=1000
</list>

<list name>
/items=(1,2,...,800)
/replace=false
/poolsize=800
<list>

<picture person1>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture person2>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture person3>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture person4>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture person5>
/items=person
/select=list.person.nextindex
/selectionrate=experiment
</picture>

<picture name1>
/items=name
/select=list.name.nextindex
/selectionrate=experiment
</picture>

<picture name2>
/items=name
/select=list.name.nextindex
/selectionrate=experiment
</picture>

<picture name3>
/items=name
/select=list.name.nextindex
/selectionrate=experiment
</picture>

<picture name4>
/items=name
/select=list.name.nextindex
/selectionrate=experiment
</picture>


<values>
/ p1_itemnumber = 1
/ p2_itemnumber = 1
/ p3_itemnumber = 1
/ p4_itemnumber = 1
/ p5_itemnumber = 1

/ n1_itemnumber = 1
/ n2_itemnumber = 1
/ n3_itemnumber = 1
/ n4_itemnumber = 1
</values>

<block exampleblock>
/ trials = [1-200 = exampletrial]
</block>

<list personitemnumbers>
/ poolsize = 1000
/ selectionrate = always
</list>

<list nameitemnumbers>
/ poolsize = 800
/ selectionrate = always
</list>

<trial exampletrial>
/ ontrialbegin = [
    values.p1_itemnumber = list.personitemnumbers.nextindex;
    values.p2_itemnumber = list.personitemnumbers.nextindex;
    values.p3_itemnumber = list.personitemnumbers.nextindex;
    values.p4_itemnumber = list.personitemnumbers.nextindex;
    values.p5_itemnumber = list.personitemnumbers.nextindex;

    values.n1_itemnumber = list.nameitemnumbers.nextindex;
    values.n2_itemnumber = list.nameitemnumbers.nextindex;
    values.n3_itemnumber = list.nameitemnumbers.nextindex;
    values.n4_itemnumber = list.nameitemnumbers.nextindex;
]
/ stimulusframes = [1=person1, person2, person3, person4, person5, name1, name2, name3, name4]
/ validresponse = (57)
</trial>

<picture person1>
/ items = personitems
/ select = values.p1_itemnumber
...
</picture>

<picture person2>
/ items = personitems
/ select = values.p2_itemnumber
...
</picture>

<picture person3>
/ items = personitems
/ select = values.p3_itemnumber
...
</picture>

<picture person4>
/ items = personitems
/ select = values.p4_itemnumber
...
</picture>

<picture person5>
/ items = personitems
/ select = values.p5_itemnumber
...
</picture>

<picture name1>
/ items = nameitems
/ select = values.n1_itemnumber
...
</picture>

<picture name2>
/ items = nameitems
/ select = values.n2_itemnumber
...
</picture>

<picture name3>
/ items = nameitems
/ select = values.n3_itemnumber
...
</picture>

<picture name4>
/ items = nameitems
/ select = values.n4_itemnumber
...
</picture>

<item personitems>
/ 1 = "person_0001.jpg"
/ 2 = "person_0002.jpg"
/ 3 = "person_0003.jpg"
...
/ 998 = "person_0998.jpg"
/ 999 = "person_0999.jpg"
/ 1000 = "person_1000.jpg"
</item>

<item nameitems>
/ 1 = "name_0001.jpg"
/ 2 = "name_0002.jpg"
/ 3 = "name_0003.jpg"
...
/ 798 = "name_0798.jpg"
/ 799 = "name_0799.jpg"
/ 800 = "name_0800.jpg"
</item>


is the way to set this up properly. /selectionrate = experiment makes no sense, you want new selections every trial, not a single selection in all of the experiment. And the lists need to be set to /selectionrate = always, because you need to sample multiple itemnumbers from each list in each trial (5 and 4 per trial, respectively).

Edited 2 Years Ago by Dave
chenxyu
chenxyu
Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)Associate Member (216 reputation)
Group: Forum Members
Posts: 18, Visits: 252
Thank you! I think I figured it out!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search