Optimize RSVP script


Author
Message
bkennedy
bkennedy
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 7, Visits: 83
Fantastic, thanks heaps!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
> Is there any way to use the setstimulustime to present two items at once (the rectangle and the image on top of it)?

Yes. You do

/ ontrialbegin = [if (values.t_streamposition==3) {trial.rsvp.setstimulustime(shape.border,200); trial.rsvp.insertstimulustime(picture.target, 200)}; ]
...

> And relatedly, is there a way to timeout the border so that it only presents with the target image (and not with the fillers)?  
> I assume I will have to make some kind of invisible rectangle to put around the fillers that the "border" disappears behind?

Yes. You need to make sure the border gets overwritten by a subsequent stimulus. You can simply put a shape with its color set to the screencolor behind every filler in your /stimulustimes.

/ stimulustimes = [0=bgshape, f00; 100=bgshape, f100; 200=bgshape, f200; 300=bgshape, f300; 400=bgshape, f400; ...]

For reference, see the "How to erase stimuli" topic in the documentation.

bkennedy
bkennedy
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 7, Visits: 83
Hi, Dave -

Thanks heaps for your help - that works very well.  I do have a remaining question that I can't figure out.  I have a blue border that I want to appear around the target image.  I made a blue rectangle shape, and then presented the target image on top of it in the last way that I wrote it.  Is there any way to use the setstimulustime to present two items at once (the rectangle and the image on top of it)?  And relatedly, is there a way to timeout the border so that it only presents with the target image (and not with the fillers)?  I assume I will have to make some kind of invisible rectangle to put around the fillers that the "border" disappears behind?  Thank you so much for your help - couldn't do it without you.

Best,

Briana
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
To present the filler images and target in a single trial set up the timings as needed

/ stimulustimes = [0=f00; 100=f100; 200=f200; 300=f300; 400=f400; ...]

where f000 is a filler image at timepoint 0, f100 is a filler at time 100, etc.

Determine the target image's position in the stream /ontrialbegin and replace the corresponding filler with the target image.

/ ontrialbegin = [if (values.t_streamposition==3) trial.rsvp.setstimulustime(picture.target,200); ]
/ ontrialbegin = [if (values.t_streamposition==4) trial.rsvp.setstimulustime(picture.target,300); ]
...

At the end of the trial, return the stimulus presentation sequence to its original state:

/ ontrialend = [trial.rsvp.resetstimulusframes(); ]

This , by the way,

> [...] I can see the monitor drawing the images on the screen [...]

is suggestive of an issue with the display system on that machine, most likely the graphics card driver or some background application hooking into the display system causing interference (e.g. screen sharing or video conferencing software). I'd recommend (1) updating the driver to the latest one available from the vendor and (2) shutting down any unneeded applications running in the background.

Edited 9 Years Ago by Dave
bkennedy
bkennedy
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 7, Visits: 83
Hello!  My apologies for another question.  I am writing a task with a rapid serial visual presentation (RSVP) where 9 320x240 images come up on the screen one at a time at 100ms per picture.  One of the images is a "target" image (and comes from a different bank of images) and the other images are "fillers".  The target image comes on at jittered serial positions in the stream (positions 3-6).  I've used code from the Attentional Blink task from the Test Library, but it seems that Inquisit is having a hard time loading the images at this speed - the timing is off and I can see the monitor drawing the images on the screen.  My guess is that I need to optimize the script to preload the images in order and then have them display during a single trial, but I am struggling to find a way to do so.  I'm still learning Inquisit, but from what I've found on the web, it seems there may be a way to use "setstimulusframe" or some similar command to set up images ontrialbegin.  If anyone can help me optimize this code, I'd really appreciate your help!!

<trial RSVP>
/ontrialbegin = [values.streamelement_count += 1]
/branch = [if (values.streamelement_count == values.t_streamposition) trial.RSVP_targetimage]
/stimulusframes = [1=filler]
/timeout = values.stimuluspresentation
/recorddata = false
/branch = [if (values.streamelement_count == values.max_streamelements) surveypage.emotionalratingsSU else trial.RSVP]
</trial>

<trial RSVP_targetimage>
/stimulusframes = [1=border, target]
/timeout = values.stimuluspresentation
/branch = [trial.RSVP]
</trial>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search