dotsTheScreen

dotsTheScreen is used for setting up your monitors mgl display profile and calling the drawing screen to open during an experiment. dotsTheScreen is a sub-class of dotsAllSingletonObjects. A default profile is created using dotsTheMachineConfiguration.

If you create a new script and enter in the code

sc = dotsTheScreen.theObject
sc.open;
pause(2);
sc.close;

What you should see is a small black rectangle appear on screen for 2 seconds. This is because the default property value of displayIndex is set to 0, a useful setting for debugging purposes. More on properties below.

Properties

width (cm)

height (cm)

distance (cm)

displayIndex

displayPixels

bitdepth

multisample

windowRect

windowFrameRate;

The refresh rate for the current screen as measured in Hz. The screen refreshes this many times in a second. This number will almost always be either 59,60, or 144.

pixelsPerDegree

foregroundColor

backgroundColor

sc = dotsTheScreen.theObject
sc.backgroundColor = [255 0 0];
sc.open
pause(2);
sc.close;
    

clockFunction

gammaTableFile

Static methods

These static methods can be used to access the current state of your dotsTheScreen configuration.These methods can be accessed either using the screen variable or by direct access.

function obj = theObject(varargin)

This function is used to create a screen object. As seen in the examples below you would use this to create a Matlab variable that can be used to open or close the Screen.

sc = dotsTheScreen.theObject

function reset(varagin)

Restores the current instance to a fresh state.

function g = gui()

This function simply allows you to check the parameters of your drawing window in a gui. Its the same information as if you simply typed in "sc" or "dotsTheScreen.theObject" into the command window.

sc.gui();

or

dotsTheScreen.gui();

function hostFile = getHostGammaTableFilename()

This function grabs the GammaTable that is currently being used by the computer. If there isn't any, it will use default settings and give the name of the default hostname.

hostname = sc.getHostGammaTableFilename()

will return

hostname = dots_hntvlan554_GammaTable.mat

function displayNumber = getDisplayNumber()

Returns the display used for drawing IF a drawing window is currently open. Otherwise it will return "-1"

function openWindow()

Opens the screen. Again, this can be used with either your display variable or directly accessed.

dotstheScreen.openWindow()

should open the same window as

sc.openWindow()

function closeWindow()

Closes the display window. The same applies for closeWindow as openWindow

Methods

These non-static methods can only be accessed when dotsTheScreen.theObject is assigned to a variable. For the examples below we will have

sc = dotsTheScreen.theObject

function initialize(self)

This will reset the current window to a fresh state, closing the window.

function open(self)

This will open a drawing window.

sc.open();

function close(self0

This will close the drawing window.

sc.close();

function frameInfo = nextFrame(self, doClear)

This function flushes the drawing commands and swaps frame buffers. If doClear is false it should allow future drawings to accumulate as they are not cleared after each frame. Generally this function will not be manipulated directly. As most of the drawing commands in drawables access this method or call for their own frame swaps, using say sc.nextFrame(false) will not work. If you'd like let drawable objects accumulate on screen, there are easier ways to control this property. However, keeping objects on screen by simply not clearing the buffer can cause objects to flicker. It is not an advisable method.

function frameInfo = blank(self)

This function is to let the frame buffers swap twice without drawing. This function calls for a clear of the frame buffers and will cause any previous drawing commands to be processed but not shown. Similar to the function nextFrame, there can be conflicts between drawing commands that take it upon themselves to manipulate the frame buffers. There are easier ways to clear the screen.

function gammaTableToMatFile(self, fileWithPath)

This saves gamma-correction data in stimulusGammaTable to a .mat file. The fileWithPath tells the function where to save the gamma table. The gamma table also seems to take the name of end file pathway. So in this case you should see a file named blah.mat.

sc.gammaTableToMatFile('Users/Matlab/blah/')

function gammaTableFromMatFile(self, fileWithPath)

Loads gamma-correction data from a .mat file into stimulusGammaTable. If you check out your current gamma file it should probably be something to the effect of dotscomputernamegammaTable.mat. If you use the command

sc.gammaTableFromMatFile('User/Matlab/blah/');
sc

you will see that the new gammaTableFile has been loaded.