TERM 2 - week 2 Flashcards
Name two functions that open a PTB window
Screen
Psychimaging
What is RGB colour coding
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].
What command skips the sync testing
Screen(‘Preference’, ‘SkipSyncTests’, 1);
How would you define the location and size of your window?
An array of 4 numbers
Where does MATLAB start drawing from e.g. if I were to put [ 0 0 800 600] where would the [0 0] be
top left corner
What function centers one rect over another?
CenterRect(stimRect, winRect)
Command that gets the resolution of a screen?
Screen(‘Resolution ‘ , 0)
- Could store in variable: info = Screen(‘Resolution ‘ , 0)
- 0 here refers to the screen of your choice
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
info = Screen(‘Resolution’ , 0 )
%the width and height are fields in the struct variable ‘info’
width = info.width height = info.height
what function and input parameters open a screen
> > Win = Screen(‘OpenWindow’, 2, [0 0 0] )
Screen(win, ‘Flip’)
- Open Window command
- Screen number
- Colour
- flip
What function and input parameters are needed for draw an oval?
> > 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
What is function flips the contents from the buffer to your visible screen
> > Screen(win, ‘Flip’)
What are the default settings
> > PsychDefaultSetup(1)
|»_space; Screen(‘Preference’ , ‘SkipSyncTests’ , 2)
What function finds the number of screens you have?
getScreens = Screen(‘Screens’)
How do you get the luminance values of the screen?
white = WhiteIndex(chosenScreen); % 255 black = BlackIndex(chosenScreen); % 0 grey = white/2;
How can you open a window using both screen and psychimaging function options?
[window, windowRect] = Screen(‘OpenWindow’, ScreenNumber, [0 0 0] );
[Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, [0 0 0]);
How would you get the size of the screen in pixels?
[screenXpixels, screenYpixels] = Screen(‘WindowSize’, window);
- What information is stored in windowRect here?
- [Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, grey, rect);
The size of the screen in pixels e.g.,
= [0 0 1920 1080]
- In the following code what is ‘ScreenNumber’?
- [Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, grey, rect);
The screen we want the stimuli to flip to
- In the following code what is ‘rect’?
- [Window, windowRect] = PsychImaging(‘OpenWindow’, screenNumber, grey, rect);
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
- 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);
The default size which is full screen [ 0 0 1920 1080]
How can I get the coordinates for the center of the screen?
[centerX, centery] = RectCenter(windowRect)
Now have 2 new variables called centerX and century storing their respected values
- 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)
What variables are now stored in variables t and p?
What is the inter-frame-interval?
The minimum possible time between drawing to the screen
How do you get the inter-frame-interval?
ifi = Screen(‘GetFlipInterval’, window);