On one slide, show different images, loaded from a list

liwenna liwenna at gmail.com
Thu Mar 11 12:51:52 UTC 2010


oops... in the comments inbetween the code quite some *'s are
missing...

for instance in this comment:
*tell eprime to repeat the following code up to 'next m' 9 times, with
m = 1, m=2, m=3 etc, m is levelnumber of the triallist that is to be
filled.
for m = 1-9

lines 2 and 3 could use a * and only line 4 is actual code. But I
guess you can figure it out.




On Mar 11, 1:49 pm, liwenna <liwe... at gmail.com> wrote:
> Hey Vera,
>
> I couldn't let go and I kinda overdid it a bit but here is an
> extensive post that I think should help you out.
>
> What you do want to control is the number of times the target appears
> at each location. You have nine locations, so you make 9 levels in
> your triallist and create all the combinations of targetstimulus and
> targetlocations (x and y values) in that list (attributenames:
> targetstim for the picturename, targetx and targety). In this list you
> also create the attribute for the 8 distractorstimpictures (disstim1,
> disstim2 etc) but not fill these cells. Once the x and y of the target
> are defined the distractorstimuli automatically should get the other 8
> x and y values so also create attributes for the x and y values of the
> distractors in this list (dis1x, dis1y, dis2x, dis2y etc.) and fill
> them with the remaining 8 x and y values for each level. Now you can
> have 9 imageobjects in your slide that refer to [targetstim],
> [disstim1], [disstim2] etc. and also to the x and  y values for each
> stim in the list: [targetx] [targety], [dis1x], [dis1y], [dis2x] etc.
>
> The only cells not filled yet are the cells that define the
> picturenames of the distractorstimuli (disstim1, distim2 etc in your
> triallist). These cells can be filled by adjusting the code referred
> to above from a random array. Something like the below thing should
> work (didn't test this one out in e-prime however as I am at home
> today). Place this code in an inline on the procedure on which your
> triallist is.... so... on your experimentprocedure you should make a
> blocklist with a blockprocedure and on the blockprocedure you place
> this in an inline in front of the triallist which you also place on
> the blockprocedure. The inline fills the 9 levels of the triallist and
> then the procedure proceeds to run the triallist. By setting the
> blocklist to repeat a x number of times, the procedure that contains
> the triallist-filling-inline as well as the triallist itself (set the
> triallist to run once but random!) will be run an x number of times
> and on each run the triallist will receive new random distractors.
>
> Explanation of the code:
> disarray is the array that holds the distractorstimulinames and is as
> big as the number of stimuli you have... say you have 4 different
> stimuli (blue circle, yellow circle, blue square, yellow square) this
> is array has 4 levels and because 0 is also a level it is defined as
> disarray(3).
>
> Each level of the array (number between brackets) is filled with a
> filename and then the array is randomized.
>
> Then m refers to level numbers. In the 'codeline' "triallist.SetAttrib
> m", m can be 1, 2, 3 etc up to 9 as we have 9 levels (nine positions
> of the target). The code For m = 1 to 9 makes eprime repeat the code
> that is between that line and the line 'next m' 9 times, each time
> replacing m in the inbetween code.
>
> A similar array is used to randomise the stimattribute into which each
> filename is placed. We have attributes called disstim1, disstim2 etc,
> so we need to manipulate the identifying numbers randomly. For that we
> create an array with 8 levels (randomposarray(7) ) and fill it with
> the numbers 1 to 8.
>
> I understood from your post that in each trial 2 distractors will be
> used four times, so the code fills four of the 'stimx' cells with the
> filename that is in level 0 of the randomized array, and another four
> with the filename that is in level 1 of the array. After filling level
> m = 1 it restarts from 'for m = 1-9' and goes to fill level m=2.  At
> restarting from 'for m = 1 to 9' it rerandomizes the arrays before it
> starts filling the random-n cells of disstim with the new (because
> rerandomizing the array) filenames that are in level 0 and 1 of the
> array.
>
> The two arrays are best created on the usertab of the scriptwindow.
> There you place the following lines:
>
> ************
> *create an array to hold your 4 (? otherwise adjust) distractor
> filenames and another one that holds the 8 identifying numbers of the
> 8 distractor stimuli.
> dim disarray(3) as string
> dim randomposarray(7) as integer
> ************
>
> The rest goes in the inline preceding the triallist. Although
> placement kinda depends on your needs... if you use one target
> troughout the experiment the filling of the arrays can also be done on
> the usertab or you could move both the dim array lines and the filling
> lines to a place in the beginning of your experiment. If you want
> different blocks with different targets  you'll have to refill the
> distractorarray each time the target changes (cause then automatically
> the distractors change too). Just make sure that e-prime does not have
> to repeat the dim-lines, cause it doesn't like that.
>
> *************inlinecode*******
> *fill the distractorarray with the filenames.
> disarray(0) = stimname1.png
> disarray(1)= stimname2.png
> disarray(2)=stimname3.png
> disarray(3)=stimname4.png
>
> * fill randomposarray with the numbers 0 -7
> randomposarray(0) = 1
> randomposarray(1) = 2
> randomposarray(2) = 3
> randomposarray(3) = 4
> randomposarray(4) = 5
> randomposarray(5) = 6
> randomposarray(6) = 7
> randomposarray(7) = 8
>
> *tell eprime to repeat the following code up to 'next m' 9 times, with
> m = 1, m=2, m=3 etc, m is levelnumber of the triallist that is to be
> filled.
> for m = 1-9
>
> *at the beginning of filling each level, first randomize the arrays
> that hold the filenames and the identifying numbers of each
> distractor.
> randomizearray disarray
> randomizearray randomposarray
>
> *Four disstims get the filename that is in level 0 of the array. Which
> four is defined by the randomized randomposarray: first we fill the
> stims that have the numbers that are now in the first *four levels of
> randomposarray (levels 0-3, replaced by n in this line of code)
> for n = 0-3
>
> triallist.SetAttrib m, "disstim" & randomposarray(n), disarray(0)
>
> next n
>
> *the second four disstims (the numbers are given by levels 4 to 7 of
> randomposarray) get the filename that is in level 1 of the
> distractorarray
> for n = 4-7
>
> triallist.SetAttrib m, "disstim" & randomposarray(n), disarray(1)
>
> next n
>
> *when e-prime gets here 1 level (m) of the triallist is filled and it
> goes back to 'for m = 1 to 9' to do the next m.
> next m when all m (9) levels are filled it wil start running the
> triallist (as this is next on the blockprocedure).
> ************endofcode********
>
> That all said... in the old paper and pencil days visual search tasks
> weren't randomized either... -_-
>
> Good luck!
>
> liw
>
> On Mar 11, 1:07 am, Vera <vera.d... at googlemail.com> wrote:
>
> > Thanks a lot Liwenna! :)
>
> > Well I am going to have a look at all this tomorrow, it will for sure
> > go all better with a fresh head. In the meanwhile I started
> > "programming" a bit though (I think there isn't really any other
> > solution here - I am not very happy with this, but ok). I will see how
> > far I get, in the meanwhile, luckily, there is always the forum to get
> > some help. :)
>
> > Take care, Vera
>
> > On Mar 11, 12:31 am, liwenna <liwe... at gmail.com> wrote:
>
> > > and this thread could be of help too...http://groups.google.com/group/e-prime/browse_thread/thread/e955c2610...
> > > it contains the basic code that I used for the experiment with 1
> > > target and 15 distractors .
>
> > > On Mar 11, 12:25 am, liwenna <liwe... at gmail.com> wrote:
>
> > > > and I read your reply a bit hasty at first (as I was
> > > > multitasking... ;) ) but the thing I posted now is pretty much similar
> > > > to your latest idea.
> > > > The thread I posted is about something entirely different though. I
> > > > posted it just for the lines that show how to fill an array and use it
> > > > to fill a triallist.
>
> > > > Hope it helps!
>
> > > > On Mar 11, 12:16 am, liwenna <liwe... at gmail.com> wrote:
>
> > > > > Hey Vera,
>
> > > > > Yes you are totally right about the pseudorandomness of my proposed
> > > > > solution.
>
> > > > > There is a real random way (I use it for a task with 1 target and 15
> > > > > distractors) that involves loading imagenames (I used external .txt
> > > > > files as the list of distractors depends on the targetstimulus and
> > > > > thus I had 15 lists of 15 distractorimages) into an array (you could
> > > > > also fill the array in an inline though), randomising the array and
> > > > > then filling the triallist.
>
> > > > > Parts of the code needed can be found in this thread:http://groups.google.com/group/e-prime/browse_thread/thread/b44513145...
>
> > > > > I didn't suggest this as I was under the impression that you were
> > > > > seeking for a programming-free solution.
>
> > > > > best,
>
> > > > > liw
>
> > > > > On Mar 10, 10:55 pm, Vera <vera.d... at googlemail.com> wrote:
>
> > > > > > Hi Liwenna,
>
> > > > > > first a big, huge thanks for replying!! :) It sure makes one want to
> > > > > > rip out less hair just knowing that you're not alone. ;)
> > > > > > Just a few comments on what you wrote:
>
> > > > > > > One thing that is elemental to understand when using e-prime, is that
> > > > > > > on each run of a procedure one level of each of the nested lists can
> > > > > > > be used. If you need nine different pictures in one 'run of the
> > > > > > > procedure' you can not put them in different rows as e-prime can only
> > > > > > > acces one level of each list on each run. So... you wrote: " like
> > > > > > > putting the 9 images in one line of the nested list, but then I get
> > > > > > > other errors", and you were definitely on the right track!
>
> > > > > > Yep, doesn't work, but it was a nice try! ;)
>
> > > > > > > Do the nine images have the same positions on each trial? Or are they
> > > > > > > placed in different 'arrangements' on every trial?
>
> > > > > > For the moment they are at the same position every time, but thanks
> > > > > > for the instructions below, we might be using that later. :)
>
> > > > > > > What you could do is make one (nested or direct) list that has nine
> > > > > > > attributes on every row containing the nine pictures used in a trial,
> > > > > > > call them for instance stim1, stim2, stim3,...stim8 and targetstim. In
> > > > > > > each level of this list you can make a different combination of
>
> ...
>
> read more »

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list