visual stimulus generation icn, ucl session 5, 18 jan 2007 matlab for cognitive neuroscience

13
Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Upload: jeffery-ferguson

Post on 26-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Visual stimulus generation

ICN, UCL

Session 5, 18 Jan 2007

MATLAB for Cognitive Neuroscience

Page 2: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Outline

• Display parameters

• Stimulus parameters

• Cogent 2000– Photographs and pictures– Text

• Cogent Graphics– Photographs and pictures– Text– Costume graphics

Page 3: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Display parameters

Reminder from previous session

thanks to Christian Ruff

config_display(screenMode, screenRes, black ,white, fontName, fontSize, number_of_buffers);

screenMode = 0; % 0 for small window, 1 for full screen, 2 for second screen if attachedscreenRes = 2; % 800 x 600 resolutionwhite = [1 1 1]; % foreground colour (optional)black = [0 0 0]; % background colour (optional)fontName = 'Helvetica'; % font parameters (optional)fontSize = 20; number_of_buffers = 5; % how many offscreen buffers to create

Page 4: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

COORDINATE SYSTEM in cogent

Page 5: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Stimulus parameters

• Location• Size• Visibility• Number• Duration

The same parameters could be applied to TEXT stimuli as well

Let’s see a couple of examples

Page 6: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Limitations of Cogent 2000

• loadpict( filename, buff, x, y, w, h )

• preparestring( text, buff, x, y )

• t = drawpict(imageBufferNumber)• Gives control over location, timing, size and

number• Not flexible for: drawing shapes, generating noise,

changing contrast

Solution: use Cogent Graphics

Page 7: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience
Page 8: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Let’s see an example

Page 10: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

start_cogent

config_display(screenMode, screenRes, black ,white, fontName, fontSize, number_of_buffers);

Onscreen

Offscreen

Page 11: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Ons

cree

n

cgflip(0,0,0); cgflip(0,0,0);

cgtext(word,wordX,wordY);

plunge

t1 = cgflip;

Off

scre

en

plunge

Page 12: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

Direct drawing on the buffer versus using Sprites

plunge

plunge

plunge

plunge

plunge

sprite

Page 13: Visual stimulus generation ICN, UCL Session 5, 18 Jan 2007 MATLAB for Cognitive Neuroscience

why Sprites?• Complicated graphics

(do once, use many times)

• Multiple items to be place in different locations

• Animations