random stimulus presentation between movies and images

175 views
Skip to first unread message

JohnnyKL

unread,
Jul 14, 2016, 7:25:33 AM7/14/16
to psychopy-users
Dear experienced users/experts,

I am a new user trying to start programming my task in the Builder view aided with codes whenever necessary. 

My experiment starts with a fixation, followed by randomised (stimulus) presentation of either a movie clip or an image, then an occasional rating task (e,g, 10% of all trials), and ended with a response task (in all trials). There is a list of 20 movies and a list of 20 images altogether.

Summary of the sequence of each trial:
Fixation --> movie/OR image --> (occasional rating in a few trials) --> Response

I have a couple of questions regarding the design/programming of the task. First, how can stimuli be presented from lists of movies and images randomly? That is when a movie is presented, there wouldn't be an image stimulus in the same current trial. It may be like when the movie stim loop is on, the image stim loop will be switched off. However, I can't get my head around how this can be done. 

Second, how can we randomly present an object (e.g. an image/text of a question for a rating task) for only a subset of the trials (say 10%).

Really sorry if answers have already been provided in similar posts but I haven't really managed yet to find the relevant solutions I need. I will be really grateful if someone can shed some lights or let me know where I can look for the solutions to my questions.

Thanks a lot!

Johnny

Michael MacAskill

unread,
Jul 14, 2016, 6:00:27 PM7/14/16
to psychop...@googlegroups.com
Dear Johnny,

You hit it on the head with this:
It may be like when the movie stim loop is on, the image stim loop will be switched off.

I would suggest that you arrange your conditions file like this:

showMovie showImage stimulusFile
0 1 dog.jpg
1 0 cat.mov
0 1 woof.jpg
1 0 miaow.mov
etc

Separate your trial into four separate, consecutive routines:

(1) Show fixation
(2) Show movie
(3) Show image
(4) Show rating

Surround all four routines with an outer loop that is connected to your conditions file. In the "movie file" field of your movie component, and the "image" field of your image component, put '$stimulusFile'

Around each of the movie and image routines, insert a second loop (i.e., nested within the outer loop but separate from each other). These two loops are not connected to the conditions file. In the nReps for one, put "showMovie" and in the other, "showImage".

This should achieve your goal of switching on one routine (nReps=1) while the other is switched off (nReps=0) on each iteration of the loop.

One could do something similar for displaying the rating routine, but you don't give any details of how you want that randomisation implemented (otherwise though, this was an excellently described question).

Regards,

Michael
 



-- 
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND

Senior Research Fellow, michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph:   +64 3 3786 072
University of Otago, Christchurch http://www.nzbri.org/macaskill

JohnnyKL

unread,
Jul 15, 2016, 2:25:14 PM7/15/16
to psychopy-users
Hi Michael,

Bravo! Thank you so much for your help and suggestions. They are clear and much simpler than I thought. I originally thought we needed some 'if - else' codes at the beginning of each routine before a stimulus component.

My second question - "randomly present an object (e.g. an image/text of a question for a rating task) for only a subset of the trials (say 10%)"
What I meant was that I want to show a rating question after presentation of a stimulus in only some of the trials (e.g. 10% of the whole experiment). If I have 60 trials altogether, I only want this question to appear in 6 random trials. I don't have a specific agenda on how this randomisation would be done as I am not really interested in this on-line rating (at least in my case). I just want to make sure the participants pay attention to the stimulus presentation.

Anyway, I think I can simply create a separate column called 'showrating' in the conditions file and assign '1' for showing the question and '0' for not showing. Then I just need to use a separate script or whatsoever to randomise this column before actually starting the experiment. Then the rest of the procedures will be similar to what you suggested - create a separate routine for this rating task, use a loop to wrap round it and set the nReps field with $showrating

Thank you so much again for your reply and suggestions!!

Johnny
Reply all
Reply to author
Forward
0 new messages