help--alternating text and image stimuli

797 views
Skip to first unread message

Rick O'Gorman

unread,
Apr 28, 2009, 5:07:22 PM4/28/09
to E-Prime
Hi all,

I'm guessing this is easy to do if you know how, but I can't figure a
solution; the manuals are of little help. I am creating an IAT and want
a mix of images and text as stimuli. I thought I could just put the
image file names in the relevant LIST but this doesn't work. I then
realised that slides have either text or image objects, so I figure I'm
goiung to have to mess around with multiple versions of slides--do I use
slidestate? Or can I layer a text object and image object on top of each
other and assume that it is transparent if nothing is called for that
implementation? If you've got something that does this can can share it,
that would be welcome.

Cheers,

Rick
--
Rick O'Gorman, PhD
Psychology, Faculty of Development and Society
Collegiate Crescent Campus,
Sheffield Hallam University,
Sheffield
S10 2BP

Phone: 0114 225 5788 Fax: 0114 225 2430

http://www.shu.ac.uk/psychology/staff/OGorman.html

No passion can survive a woman's seeing her lover hold
his fork in the wrong way.
~Edith Wharton

liwenna

unread,
Apr 28, 2009, 6:43:12 PM4/28/09
to E-Prime
not entirely sure if I got your problem right.. but what about simply
creating bitmaps that show your text stimuli? Indeed file these all in
a list under a variable, for instance called "stimulus" and make a
slide with a imageobject that calls into the stimulus attribute (use
[stimulus] ).

Alternatively overlapping text and imageobjects might work if you set
them to transparent in the image/text object properties... although I
am not entirely sure whether it won't give an error saying that it
can't find the text/image to display (just as you suggest it might do
^.^ )

Regards (and oh yeah, I didn't answer your e-mail yet, will do soon
though)

liwenna

Paul Jackson

unread,
Apr 28, 2009, 6:56:53 PM4/28/09
to e-p...@googlegroups.com
I am completely flat out at the moment so I can't offer to much time BUT I have some code that will do what you want. Basically you add this as an inline element at the start of each trial to prepare the stimulus slide. It assumes that there is a Slide called 'StimulusStates' which contains 2 slide elements 'picStimulus' (SlideImage) and 'txtStimulus' (SlideText). Each trial has an attribute called 'Stimulus'. Basically if the stimulus attribute text ends in '.bmp' it assumes it is a picture and if not that it is text.

The Code:

'Prepare Image or Text
Dim Stimulus As String
Dim theImage As SlideImage
Dim theText As SlideText
Set theImage = CSlideImage(StimulusScreen.States(StimulusScreen.ActiveState).Objects("picStimulus"))
Set theText = CSlideText(StimulusScreen.States(StimulusScreen.ActiveState).Objects("txtStimulus"))

Stimulus=trim(c.GetAttrib("Stimulus"))
If LCase(Right(Stimulus,4))=".bmp" Then
theImage.Width="100%"
theImage.Height="100%"
theImage.Filename=PicsPath & Stimulus
theImage.Load
theText.Width="0"
theText.Height="0"
Else
theImage.Width="0"
theImage.Height="0"
theImage.Clear
theText.Width="100%"
theText.Height="100%"
theText.Text=Stimulus
End If




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Paul R. Jackson

Experimental Programmer
School of Psychology
University of Queensland

E: pa...@psy.uq.edu.au
P: 33656950
W: www.psy.uq.edu.au/~paulj
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.287 / Virus Database: 270.12.7/2085 - Release Date:
> 04/28/09 18:02:00

Paul Jackson

unread,
Apr 28, 2009, 7:02:02 PM4/28/09
to e-p...@googlegroups.com
That code should also finish with:

Set theImage=Nothing
Set theText=Nothing

Also you must have a variable named PicsPath set to something (or delete that from the filename bit).

David McFarlane

unread,
Apr 30, 2009, 5:31:00 PM4/30/09
to e-p...@googlegroups.com
Rick,

I would use a Slide object with multiple states, as you guessed. One
state would use a Text sub-object, and another state would use an
Image sub-object. You would then have to use a bit of inline script
to set the state before running the slide in your procedure, based
either on the value of the attribute that encodes the stimulus, or
using another attribute just to indicate text vs. image. Might be
worth browsing the PST downloads to see if they show how to handle
Slide states, or just make a demo program with any Slide (or better,
a Feedback object, which is just a special type of Slide) and look at
the generated script, that's how I figure out how to manage Slide states.

Good luck,
-- David McFarlane, Professiona Faultfinder

Rick O'Gorman

unread,
May 20, 2009, 2:32:11 PM5/20/09
to e-p...@googlegroups.com
As per an earlier post, sorry to have lagged in my reply to this thread.
Thanks to those who suggested ideas--David McF, Paul J, liwenna. On
seeing Paul's suggestion, using a substantial bit of inline code, I was
inspired to try figuring out the slidestate method, as it seemed simpler. :)

David's email confirmed what I had found--that Slidestate was the
solution, but I did not need to use inline code to tell E-Prime which
slidestate to use. It's simpler than that.

After setting up the alternative slidestates and naming them (you get at
this by right-clicking on the tab at the bottom, which will default to,
err, 'default', then 'default1', etc.), you can tell E-Prime which one
to use in the Slide's general property options. Under the General tab,
there's a setting for Activestate. Instead of choosing one of the
slidestates that you have created, you can instead enter a variable name
in here (e.g., [stimtype]) and then set up which slidestate to use in a
list elsewhere, using one of the slidestate names (in my case, I had
two, one called 'text' and one called 'pic'). So in my relevant list, I
had a variable called slidestate that took either a value of 'pic' or
'text' depending on another variable setting (whether I wanted to
present an image or text as a stimulus). This then told the relevant
slide to use either pic or text, as appropriate.

By the way, when creating multiple slidestates that are variations of
each other, there is a 'clone state' option, which is a nice
labour-saving tool.

Maybe E-Prime will keep me loyal yet. :)

Rick

David McFarlane

unread,
May 21, 2009, 2:54:31 PM5/21/09
to e-p...@googlegroups.com
Rick,

Brilliant use of attribute to control slide state, I had missed that,
thank you SO much for figuring that out and posting back! Also
thanks for hint about cloning slide states.

And I too regain respect for E-Prime when I stumble on things like this.

-- David McFarlane, Professional Faultfinder

Rick O'Gorman

unread,
May 22, 2009, 5:00:33 AM5/22/09
to e-p...@googlegroups.com
You're welcome, glad to contribute something back.

I made a typo in my previous post--toward the end of the long paragraph,
it should read "So in my relevant list, I had a variable called STIMTYPE
that took either a value of 'pic' or 'text' depending on another
variable setting".

Sorry about that,
Reply all
Reply to author
Forward
0 new messages