TERM 2 - week 2 Flashcards

1
Q

Name two functions that open a PTB window

A

Screen

Psychimaging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is RGB colour coding

A

In Psychtoolbox, color is defined with 3 numbers in the range 0-255, with one value for each of the three channels (red, green, blue).

We call this RGB colour coding.

e.g. red would be [255 0 0].

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What command skips the sync testing

A

Screen(‘Preference’, ‘SkipSyncTests’, 1);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How would you define the location and size of your window?

A

An array of 4 numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where does MATLAB start drawing from e.g. if I were to put [ 0 0 800 600] where would the [0 0] be

A

top left corner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What function centers one rect over another?

A

CenterRect(stimRect, winRect)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Command that gets the resolution of a screen?

A

Screen(‘Resolution ‘ , 0)

  • Could store in variable: info = Screen(‘Resolution ‘ , 0)
  • 0 here refers to the screen of your choice
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Once you have the resolution of the screen stored in a variable

e.g., info = Screen(‘Resolution ‘ , 0)

How could you store the values of the height and width of the screen

A

info = Screen(‘Resolution’ , 0 )

%the width and height are fields in the struct variable ‘info’

width = info.width
height = info.height
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what function and input parameters open a screen

A

> > Win = Screen(‘OpenWindow’, 2, [0 0 0] )
Screen(win, ‘Flip’)

  • Open Window command
  • Screen number
  • Colour
  • flip
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What function and input parameters are needed for draw an oval?

A

> > Win = Screen(‘OpenWindow’, 2, [0 0 0] )
Screen(‘FillOval’ , win, [255 0 0] , thisRect)
Screen(win, ‘Flip’)

  • Need a window to draw shape on
  • Draw shape using ‘FillOval’ command – input parameters are the function,. Window, colour and the rectangle for the oval
  • flip
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is function flips the contents from the buffer to your visible screen

A

> > Screen(win, ‘Flip’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the default settings

A

> > PsychDefaultSetup(1)

|&raquo_space; Screen(‘Preference’ , ‘SkipSyncTests’ , 2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What function finds the number of screens you have?

A

getScreens = Screen(‘Screens’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you get the luminance values of the screen?

A
white = WhiteIndex(chosenScreen); % 255
black = BlackIndex(chosenScreen); % 0 
grey = white/2;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How can you open a window using both screen and psychimaging function options?

A

[window, windowRect] = Screen(‘OpenWindow’, ScreenNumber, [0 0 0] );

[Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, [0 0 0]);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How would you get the size of the screen in pixels?

A

[screenXpixels, screenYpixels] = Screen(‘WindowSize’, window);

17
Q
  • What information is stored in windowRect here?

- [Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, grey, rect);

A

The size of the screen in pixels e.g.,

= [0 0 1920 1080]

18
Q
  • In the following code what is ‘ScreenNumber’?

- [Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, grey, rect);

A

The screen we want the stimuli to flip to

19
Q
  • In the following code what is ‘rect’?

- [Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, grey, rect);

A

Telling MATLAB the size you want the screen
Rect = [] % means it’s the default (full screen)
Rect = [0 0 800 600] %y this would be half screen

20
Q
  • If I take out the rect variable from the second line what would value would be represented by ‘windowRect’?
  • rect = [0 0 800 600]
  • [Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, grey, rect);
A

The default size which is full screen [ 0 0 1920 1080]

21
Q

How can I get the coordinates for the center of the screen?

A

[centerX, centery] = RectCenter(windowRect)

Now have 2 new variables called centerX and century storing their respected values

22
Q
  • To get the center coordinates we need the function
  • [centerX, centery] = RectCenter(windowRect)
  • what happens if I changed the output names to
  • [t, p] = RectCenter(windowRect)
A

What variables are now stored in variables t and p?

23
Q

What is the inter-frame-interval?

A

The minimum possible time between drawing to the screen

24
Q

How do you get the inter-frame-interval?

A

ifi = Screen(‘GetFlipInterval’, window);

25
What is the refresh rate of the monitor and whats its relationship with the inter frame interval?
hertz = FrameRate(window); | The relationship between the two is: ifi = 1 / hertz
26
What would a refresh rate of 60 Hz mean?
The number of frames that can be drawn in 1 second
27
What function positions a rectangle on the center of our screen?
rectPosition = CenterRectOnPointd(stimRect, centerX, centerY)
28
Describe the chronological order of drawing a rectangle?
-FIRST define key aspects of the shape: stimRect = [0 0 800 600]; %size color = [255 0 0]; % colour rectPosition = CenterRectOnPointd(stimRect, centerX, centerY) % where -THEN draw it to buffer Screen('OpenWindow' , ScreenNumber, color, rectPosition); - THEN flip it to screen Screen('Flip' , window) % flip the buffer screen NOT windowRect (the external screen)
29
what does kbStrokeWait do?
Waits for keyboard press before continuing
30
>> Screen('Preference' , 'SkipSyncTests' , 2) What do different numbers mean here I put 0, 1 or 2?
0 means don’t skip | 1 and 2 mean do
31
What function and parameters do you need to specify when creating a box outline?
function Screen('FrameRect' .... * Outline of the box * The colour * The width * The position
32
What function and parameters do you need to specify when creating a fixation point?
function Screen('DrawLines'...... * Size of the lines – ideally clarified relative to the size of the rectangle * Colour * Width * Position
33
what colour is black and white using the RGB colour coding system
black is [0 0 0], white is [255 255 255]