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 one
http://groups.google.com/group/e-prime/browse_thread/thread/84c742b85e5a9b7d
(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 more or less "programming-free" (well ok, I understand you cannot
rule it out completely, but the thing I described above should be
possible in my opinion).
I really hope some of you guys have some creative solution for me!
With kind regards,
Vera
I see that you really researched well and you found all the 'elements'
you need, but you didn't use them in a way that works so far. I must
say that e-prime might not be the single most excellent program to
create a visual search task in... although I also wouldn't know what
program to better use.
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!
Forget about the collumn referencing and the pointing towards
procedureslists first and then to nested lists.. you don't need it.
That's exactly the kind of programming that you don't want to use ;)
Do the nine images have the same positions on each trial? Or are they
placed in different 'arrangements' on every trial?
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].
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.
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.
I hope the above stuff will get you started again, if not, please let
me know.
Best
liw
On Mar 10, 5:45 pm, Vera <vera.d...@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...
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
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/b44513145914a543/9a190bab1a34fa8f
I didn't suggest this as I was under the impression that you were
seeking for a programming-free solution.
best,
liw
Hope it helps!
On Mar 11, 12:16 am, liwenna <liwe...@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...
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...@gmail.com> wrote:
> and this thread could be of help too...http://groups.google.com/group/e-prime/browse_thread/thread/e955c2610...
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
> ...
>
> read more »
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.
> ...
>
> read more »
Wow, what a discussion this sparked! I think E-Prime can do what you
want in a quite straightforward way using nested Lists without any
inline code. As hinted at the thread that you cited (http://
groups.google.com/group/e-prime/browse_thread/thread/
58e3ae402de68442 ), the key is "colon syntax". So if you do not
already have this working, here is another homework assignment for
you: Go to the index in the User's Guide that came with E-Prime and
look up "colon syntax", then follow that to the appropriate tutorials
and work through all of those. That might give you enough ideas to
figure it out. But if you remain stuck after that, then refresh this
thread some time next week and I will post more details on this
approach (I need you to struggle a bit first so that the later lesson
will "take").
And don't forget PST Web Support, they like to take these sorts of
questions at http://support.pstnet.com/e%2Dprime/support/login.asp and
they strive to respond to all requests in 24-48 hours (although
reported response time is currently more like 5 days). If you do
contact Web Support then please report back here with the results.
-- David McFarlane, Professional Faultfinder
On Mar 10, 11:45 am, Vera <vera.d...@googlemail.com> wrote:
> 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...
Oh, and one more bit of generic programming advice that I repeat here
from time to time -- If your actual experiment program has any
complexity to it, then set that aside and exercise all your ideas on
smaller demo programs that you make just for that purpose, then when
you get your techniques worked out just apply those back to your
actual experiment program. Everybody (including me) thinks that they
can save time by working out fixes directly in their actual experiment
programs, and everybody (including me) is wrong about that. You save
time by working out the techniques in smaller "exercise" programs,
then applying what you learn back to your actual experiment program.
<editorial>
This becomes especially true when you have to work out the finer
points of E-Prime as "documented" in the online E-Basic Help. As
crucial as the online E-Basic Help is to gaining any real
understanding of E-Prime, in many many places it is at best
misleading, and at worst just plain wrong (not to mention that much of
the example code does not even compile), and PST takes no interest in
fixing that (I have personally posted several corrections to PST and
continue to do so, to almost no avail). So if, like me, you ever have
to understand how E-Prime really works, then you will have to make
many, many small demo programs in order to overcome the rampant
misinformation throughout the documentation.
And BTW, this is where PST Web Support comes in. Many of us have the
old-fashioned notion that Support is a last resort. But as a result
of discussions with PST staff I now understand that PST Web Support is
their substitute for adequate documentation. So once again, I urge
everyone to get over your inhibitions and to consult PST Web Support
every bit as much as you would otherwise consult the documentation.
</editorial>
-- David McFarlane, Professional Faultfinder
My solution is available here with a basic description of what the
script is doing:
http://step.psy.cmu.edu/scripts/Attention/EriksenStJames1986.html
As an aside, I never really figured out how to make that site more
useful for people looking for techniques rather than paradigms; a lot
of techniques that work for one type of experiment crop up elsewhere.
I like to think there are some useful scripts on the site anyway, both
in the stuff I implemented as teaching tools during the beta and in
the stuff that various people have submitted since. Finding the right
ones may take a little time, though.
HTH,
Susan
well about the "I need you to struggle a bit first so that the later
lesson will "take" " I think I definitely have been struggling a lot
already and trying every single solution I could think of (including
scripts, including nested lists, including nested lists with colon
syntax...). :-)
For the colon syntax by the way, I first thought of this solution too
(well after I tried the first solution in which I naively expected E-
Prime to read out 9 different images out of one list (out of one
column so to say) which is apparently not the case) so I wrote into my
list that my images (all with the syntax [Image] as filename (and yes,
I created an attribute "Image" too) should go to the attribute
[ImageInNestedList:9] in the nested list (which of course also I
created with an attribute ImageInNestedList). But the same problem
here too: E-Prime only reads out 1 image out of this list (so one line
at a time) and then replicates that image 9 times (so yep, I end up
with 9 times the same image on the slide).
So for the moment, the only solutions I see are:
1. Define a certain number of combinations (let's say 200) and just
write them into E-Prime.
2. Write some kind of script
3. Make let's say 200 different images (fixed with the 9 images).
The last one is by the way the solution I am going to use for the
moment (a collegue has some script to create 200 random images in no-
time) as time is running out and we need a "quick and dirty" solution
rapidly. However, I will keep on trying to get this right, because
after the pilote-study, this whole test is supposed to communicate
with our driving simulator (I am not programming this!) so that we can
control some driving task with the secondary task.
So I still need to find a solution!!!
:-)
On Mar 11, 3:12 pm, dkmcf <mcfar...@msu.edu> wrote:
thanks for the very long post. I am going to try and implement this
tomorrow (I worked all day with an IT-specialist today, trying to
"code" around the problem) but in the end everything actually even got
worse and we didn't find any solution really) so that this evening
(well, for what is left of my evening) I will let E-Prime be E-Prime
and do something else (watching some brain-dead-thing on the TV sounds
like a perfect idea!!!) before my head explodes! I will look into your
solution tomorrow though (or else this weekend, as tomorrow I will
have to make sure that my "pictures-solution" works more or less so we
can make a quick pilot study next week).
Thanks a lot though for the effort and know that I will study your
lines intensively when I get the opportunity (I am very unhappy with
the generated-images solution we are going to use now).
Greetings, Vera
> ...
>
> read more »
Thanks for the link towards the script. I knew the website, but as you
said, it takes a lot of time (sometimes) to find something actually
useful. I have been going through some scripts though in the hope to
get some clues, ideas and maybe solutions, but I didn't try your
script. I will have a look into it once my head will be fresh again
(in other words: tomorrow or this weekend). :-)
Thanks a lot!
Good. I just needed better assurance that you had some experience
with colon syntax, otherwise nothing else I add here will make
sense. And let me say first that making a number of pre-arranged
combinations is a time-honored way of doing things (think back to the
days of opto-mechanical slide projectors for stimulus presentation),
so if you get that to work then more power to you.
In the meantime, I also tried the example VisualAttention.es that
Susan mentioned. I hope that program does not represent the quality
of the other STEP offerings (especially since I have referred folks
to STEP myself) -- First it has a mistake that causes a runtime error
(though easily fixed), and then the structure seems awfully complex
for what it needs to do. It does indeed show a bit of using colon
syntax to arrange stimuli at random spots in a circle, but then it
only uses text stimuli, and because of a flaw that remains even in
EP2 this may crash when you try using pictures in place of text. Of
course it may well be that I do not correctly understand the tasks
here, so let me present the lesson and you tell me where I get it wrong.
Speaking of text vs. pictures, I need you to first work this out with
text only (no pictures), and then later advance to pictures -- if you
cannot get the structure to work with plain text, then nothing else
matters. Once again, we use the time-honored strategy of "divide and conquer".
So let's simplify this a little more for the sake of
discussion. Let's suppose you have only three spots on the screen,
and you want to randomly assign some text samples to each of those
three spots. And to prepare for pictures later, we might as well use
file names for our example text stimluli (but please, please, do
*not* use actual picture files yet for this exercise!!). We start
with a stimuls Slide in our TrialProc, let's call it StimSlide, with
three SlideText objects that contain the following (and looking ahead
to putting our picture files in a subdirectory, as discussed in other threads):
material/[Stim1].png
material/[Stim2].png
material/[Stim3].png
Next, in our TrialList, we have a nested List plus three attributes
(columns) called Stim1, Stim2, and Stim3, each containing a
colon-syntax reference to the nested List, something like this (this
may not line up well in your reader):
Weight Nested Procedure Stim1 Stim2 Stim3
1 StimList TrialProc [Stim:0] [Stim:1] [Stim:2]
Almost done. Now in the nested StimList we add the attribute Stim
and fill in our actual stimulus items, e.g.,
Stim
circle
square
And we set StimList to Random order.
So how does this all work? E-Prime shuffles the StimList. On each
round, TrialList then picks three new items from StimList, and then
those go right into the three locations in StimSlide. See how simple
that is once you get it all sorted out? And not a line of code! You
just have to grasp the broader underlying concepts and principles of E-Prime.
As I have presented it this should still work for picture files. If
you were instead to use only text stimuli then you could leave out
the extra columns in TrialList and use colon syntax directly in
StimSlide (but as discussed in the earlier thread, this will fail for
the special cases of images and sounds in Slides). Also, you could
replace "Stim:0" everywhere with simply "Stim", but when I use colon
syntax I like to leave it in for clarity.
Whew! You can see why I often have to put people off for awhile,
because I do have other work to do to. So give this a whirl if you
like. Now it is late here in the U.S. midwest, and I have to get
home and get ready for tonight's episode of Survivor (US knockoff of
Expedition Robinson).
-- David McFarlane, Professional Faultfinder
"You got to test that piece of software, You got to test it for yourself,
No one else can test it for you, You got to test it for yourself."
(Apologies to the Fairfield Four)
>--
>You received this message because you are subscribed to the Google
>Groups "E-Prime" group.
>To post to this group, send email to e-p...@googlegroups.com.
>To unsubscribe from this group, send email to
>e-prime+u...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/e-prime?hl=en.
Well, here I am, back after a good night of sleep (or almost, somehow
I woke up several times thinking about columns, lines and
trials...). ;-) We might think that E-Prime is actually getting "into
me". Well, as I had started some programming (as I really figured I
had tried every possible solution, looked at the file Susan sent by
the way, it seems VERY complicated to me and I also have a run-time
error (or was it compilation error??)) which makes I can't actually
run the program, but at least I had a look at the structure and I
think I get the point.
So then after yesterday having been programming the whole day (got
some help from a collegue though as I am completely new to programming
in general) and after some kind of "relevation" this morning (I don't
know why I thought of the solution I found, but it worked) I got a
solution, which I am now very happy (and proud! ;-) ) to post here:
In Eprime itself I made 3 slidestates (one with 9, another one with 16
and another one with 25 images). To each image a dummy image needs to
be attributed - in my case I put a simple dummy.png which is simply a
black square (my background is black too). Yep, it's a lot of work
doing that all by hand, especially because you can't change settings
for all images at once.
In my DesignList I created different attributes ("Target" (filled with
1's and 0's), "Image" (empty), "CorrectResponse (filled with 1's and
2's) and "SlideState" filled with one of the possible slidestates for
each condition.
Then, in my Trial Procedure (the one that follows the DesignList), I
created a script (before the slide) as follows:
'Eprime reads out for every line in the column "SlideState" which
'slidestate it needs to take. It replaces the strings in this column
'by z with a dIfferent number (in this case the number of items:
' 9, 16 or 25).
If c.GetAttrib("Slidestate") = "State09" Then
z = 9
ElseIf c.GetAttrib("Slidestate") = "State16" Then
z = 16
ElseIf c.GetAttrib("Slidestate") = "State25" Then
z = 25
End If
'E-Prime reads out of the column "Target" if a target is present
'or not (in this case 0 indicates the absence of a target, 1
'indicates the presence of a target. After reading out, it transforms
'those values to an y-value.
If c.getAttrib("Target") = 0 then
y = 0
ElseIf c.getAttrib("Target") = 1 then
y = 1
End If
'For the number 1 until z or 1 until (z-y) n case a target is present
-
'which translates into 1 until 25 or 1 until (25-1) when a target is
'present - a sequence is created with numbers from 1 and 2.
For i = 1 to z - y
sequence(i) = Random(1,2)
Next
'And after those random numbers have been generated, a target
'(or not) is added.
If y = 1 then
sequence(z) = 0
End If
'This sequence is then randomized, but only for the array members
'1 until z (take care to do this, because if not, you might possibly
'find 2 or more targets in your trial.
randomizearray sequence, 1, z
'This is done as to get the output of the sequence written into the
'textfile as a string. You don't need to do this for the program to
'work. I just added this so afterwords I could know at which
'position exactly the target had been as well as the position
'of the different distractors. E-Prime just gives out a string
'for exp. 102122111 indicating that there was one target (0)
'on position two and distractors (1) and (2) on the other positions.
s = str(sequence(1))
For i = 2 to z
s = s + Str(sequence(i))
Next
c.setAttrib "Image", s
'SlidePres here gets the information about which slidestate to
'refer to
SlidePres.ActiveState = c.GetAttrib("SlideState")
'Images are generated
Dim images (1 to z) As SlideImage
For i = 1 to z
dim num as string
dim image_name as string
num = Str(i)
num = LTrim$(num)
image_name = "Image" + num
Set images(i) =
CSlideImage(SlidePres.States(SlidePres.ActiveState).Objects(image_name))
Next
'And filled with the right image according to the sequence we
'generated above. Make sure to write two \\ in the path to the
'filename, as if not Eprime (or Visual Basic) interpretes it as
'some kind of operator.
For i = 1 to z
If sequence(i) = 0 then
images(i).Filename = "D:\\EPrime\\yellow_square.png"
ElseIf sequence(i) = 1 then
images(i).Filename = "D:\\EPrime\\yellow_triangle.png"
ElseIf sequence(i) = 2 then
images(i).Filename = "D:\\EPrime\\blue_square.png"
End If
Next
'Images get loaded
For i = 1 to z
images(i).Load
Next
'The slide is drawn
SlidePres.Draw
Voilà!!!! :-) I am really happy it works!!! :-) Thanks a lot for your
help to all of you, I will for sure still try to get working some of
the solutions you proposed (I am still convinced that E-Prime should
work without programming - and for me, although I learend something
and it now works, I still don't like the programming part) and
especially your solutions David and Liwenna, because they seem to be
good ones too. I also didn't abandon my "fix images project" (I had a
programmer here generate 300 different pics for me) so I have a backup
in case all this will finally not work like I imagined. :-)
In the meanwhile, have a nice day and thanks again for all your help!
Vera (very relieved)
> ...
>
> read more »
Glad you got it to work, and thank you for a full presentation of your
solution! But I feel I must provide an editorial reply to your own
editorial comment.
> I am still convinced that E-Prime should work without programming
In this case one solution does not require any code, as I demonstrate
above (unless I just do not fully understand your task). But more
broadly, I just do not understand people who think that giving precise
instructions to a machine with infinite possibilities (i.e., a
Universal Turing Machine, look that up on Wikipedia) should "work
without programming", any more than I would understand anyone who
thinks that scientific publications should "work without science-
speak". I have looked at many other experiment generating systems
that "work without programming", and none of them, without
programming, come close to the capabilities of what E-Prime can do
because of its programming. In fact, my sole reason for endorsing E-
Prime is precisely that it still includes a strong, conventional
programming language. Please see my signature quote below.
-- David McFarlane, Professional Faultfinder
"When all is said and told, the 'naturalness' with which we use our
native tongues boils down to the ease with which we can use them for
making statements the nonsense of which is not obvious." Edsger W.
Dijkstra, "On the foolishness of 'natural language programming'",
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EWD667.html
.
maybe I expressed myself wrongly here: I am still convinced that the
thing I wanted to do should work without programming a single line (or
at least, let's say that is what I expected). Of course I understand
that if you want to do the REAL complicated stuff, E-Prime has its
limits and one needs to program. I am just a little bit, let's call it
"deceived" because I am convinced that my experimental setup is not
very complicated in itself.
This all said, I didn't try the solution you proposed yet and as it
seems, things will function without programming, so maybe I just too
quickly decided to program. But then at some point the "E-Prime
solution" seems so far-fetched that programming appears the simpler
and more elegant solution.
Greetings, Vera
PS: Like the signature. :-)
Mea culpa. I apparently updated a test file instead of the final file
eight years ago. Fixing that one is going to be a bit of a challenge,
although I guess I can attempt to track down a copy of EP 1 (or edit
the text version of the es file) to fix the typo that causes that
runtime error and email it to Brian. I'd do it now, but all I have
is 2.0 Pro. As a note, it would be lovely if people who noticed
problems like that with the STEP scripts would try to fix them and
send the new versions in; that grant ran out in 2003 or thereabouts,
so anything that's still there or is updated is done because Brian and
his lab are trying to be helpful.
The structure of the visual attention file is complex, but it solved
the problem at the time, which was the blocking of number of cued
items and SOA with factorial variation within the trials of lure
position and noise compatibility (and randomized distractors using
colon notation, which was the part I thought might be analogous).
That's not the problem here, and I apologize for suggesting something
needlessly complex. My own orientation is toward examples rather than
explanations, so I thought the additional information might prove
helpful.
Wouldn't it be nice if E-Prime had non-script comments? That might
have made all of the scripts better teaching tools for people learning
E-Prime, rather than just for people trying to teach experimental
psych with E-Prime.
(Vera, sorry to hijack your thread -- I'm glad you got it to work.)
Thanks,
Susan
PhD Student
University of Maryland Psychology
(who no longer uses E-Prime very much at all)
You need merely change [CueSize] to [F_CueSize] on BlockHeader and
the program works. I will make that trivial change with EP1.2 and
send that to you separately, perhaps you can then forward it on.
Thanks for the explanation of the added complexities that that
program was meant to address.
As for "non-script" comments, my own recent brainstorm is to insert
inline code in some places for the sole purpose of adding comments to
explain the program. E.g., at the start of each SessionProc I now
regularly put an inline code object called "ReadMe" where I write a
brief description of the program as a whole, add any needed
implentation notes, date, author, and version notes, and a running
list of dates & version changes. I find this solves a lot of
problems for me, (which is why this is standard practice in any
conventional programming environment). I am ashamed however that it
took me almost a decade of using E-Prime to come upon this simple workaround.
-- David McFarlane, Professional Faultfinder
"You got to test that piece of software, You got to test it for yourself,
No one else can test it for you, You got to test it for yourself."
(Apologies to the Fairfield Four)