On one slide, show different images, loaded from a list
liwenna
liwenna at gmail.com
Thu Mar 11 12:49:04 UTC 2010
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
> > > > > > stimuluspictures. In your slide you'll have nine imageobjects: make
> > > > > > each one of them refer to a different stimulus attribute: [stim1]
> > > > > > [stim2] ... [targetstim].
>
> > > > > Yep, thought of that option too, but there is one problem to it: we
> > > > > want the images to appear completely at random (so in each trial with
> > > > > 9 images there is 1 target, 4 distractors(type1) and 4
> > > > > distractors(type2). Each item can be at 9 different positions. Which
> > > > > would make (ok, I might be wrong here, I don't remember very well the
> > > > > correct chance calculations) something like... a lot (!!!!) of
> > > > > combinations, no? Or is there some way to tell E-Prime to randomize 9
> > > > > attributes (9 columns basically)?
>
> > > > > > So far so good: now you'll have different collections of stimpictures
> > > > > > on each run (as many different 'collections' as you have made
> > > > > > different levels in your list). If you need them to be placed in
> > > > > > different spatial arrangement on each trial you should start out with
> > > > > > creating the number of different arrangements that you want to use.
> > > > > > For each arrangement write down the x and y values of each of the
> > > > > > imageobjects. (so: imageobject 1 showing [stim1] has x = 500 and y=68
> > > > > > in arrangement 1 and x = 950 and y =780 in arrangement 2 for
> > > > > > instance). Into the list with stimuluspictures nest a second list that
> > > > > > holds the different arrangements. This list will have 9x2=18
> > > > > > attributes: stim1x, stim1y, stim2x, stim2y, stim3x... targetstimy. Go
> > > > > > back to your slide and now tell the slideobjects to find their x and y
> > > > > > values in the corresponding attributes, just like they find their
> > > > > > pictures: [stim1x] [stim1y] [stim2x] etc etc.
> > > > > > Now... you'll have spent a lot of time but you will have a random
> > > > > > combination of a collection of target and distractorpictures with one
> > > > > > of the different spatial arrangements on each trial.
>
> > > > > :D Like you said, I will for sure have spent a lot of time! :) But it
> > > > > might be some kind of solution maybe, I will have to think of it. But
> > > > > then again, I think that
> > > > > there will be too many combinations possible.
>
> > > > > > Alternatively.... I say it should be possible to use 'complete array'
> > > > > > pictures that you make in for instance photoshop or even paint....
> > > > > > pictures that have the size of the screen and show all nine stimuli at
> > > > > > once... you could tell e-prime to show one of those pictures on each
> > > > > > trial and locate a single 'transparant empty' imagobject over the
> > > > > > location of the targetstimulus (you should fiddle around a bit with a
> > > > > > non-transparant coloured object to find the exact location needed for
> > > > > > each 'array picture' and actually place this imageobject UNDER the
> > > > > > arraypicture and not in front).This imageobject will then be the
> > > > > > object to which you point your dohittest script (assuming that that's
> > > > > > what you will use? have your subjects click the mouse on the target?).
> > > > > > Not sure if that will work.. think it should.
>
> > > > > Yep, have been thinking of that too, but it for sure isn't the most
> > > > > elegant solution, as the random again will be more or less
> > > > > "biased" (one can only make so many combinations).
>
> > > > > > I hope the above stuff will get you started again, if not, please let
> > > > > > me know.
>
> > > > > Yep, thanks for the reflexions! :) As I said, it sure helps to know
> > > > > that other people have thought of this too. :) For the moment I am
> > > > > working on a (although I am an absolute beginner as far as programming
> > > > > is concerned) solution with an inline script. I was thinking that
> > > > > maybe I can tell Eprime to load 3 numbers into this column where
> > > > > normally pictures would be, randomize the whole and then maybe
> > > > > according to the numbers Eprime could load some corresponding images?
>
> > > > > I however just still don't want to believe that this could be the only
> > > > > solution (especially because "my problem" is working fine when you
> > > > > replace the images on the slide by text and tell Eprime to randomly
> > > > > load strings (words) from a nested file). Ah well...
>
> > > > > Thanks a lot anyway for replying and if I find a solution, I will let
> > > > > you know. :)
>
> > > > > Greetings,
>
> > > > > Vera
>
> > > > > > Best
>
> > > > > > liw
>
> > > > > > On Mar 10, 5:45 pm, Vera <vera.d... at googlemail.com> wrote:
>
> > > > > > > Hi forum members!
>
> > > > > > > I sure hope I will get some help here! I am trying to construct a
> > > > > > > visual search task in which participants have to find let's say a
> > > > > > > "yellow triangle" within "blue triangles" and "yellow triangles".
>
> > > > > > > For this, I created a list with different conditions (like number of
> > > > > > > items on the grid, target present or not) and I was actually counting
> > > > > > > on using a slide with (let's say) 9 images, on which I would each of
> > > > > > > the 9 images randomly from a nested list.
>
> > > > > > > So I made my nested list with images (.png's) and I of course made
> > > > > > > sure to have the image-objects on the slide point first to the
> > > > > > > procedure list and then to the nested list (I think I read about all
> > > > > > > the messages concerning this topic, including this onehttp://groups.google.com/group/e-prime/browse_thread/thread/84c742b85...
> > > > > > > (thanks a lot for the work-around, it was a good thing for me to see
> > > > > > > if I did it right, which I did, but it still will not load the right
> > > > > > > pictures).
>
> > > > > > > So the problem is: It seems that the "point to the nested list
> > > > > > > function" is working, but then it seems impossible to load 9 DIFFERENT
> > > > > > > images (it will show me 9 times the same image, at least therewith
> > > > > > > confirming that it points to the correct nested list).
>
> > > > > > > And I tried every option I could think of (like putting the 9 images
> > > > > > > in one line of the nested list, but then I get other errors). :-( I am
> > > > > > > now believing that I should maybe really write to the developers,
> > > > > > > simply because this "functionality" seems to be absent.
>
> > > > > > > Now I will probably have to code it (which is were the real problem
> > > > > > > starts, because I am an absolute no-programmer ;-) ) and the institute
> > > > > > > where I am currently working actually bought E-Prime because it should
> > > > > > > be
>
> ...
>
> 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