Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
dotsStimulus Class Reference

dotsStimulus simple variable coherence dots stimulus, inherits from baseStimulus More...

Detailed Description

dotsStimulus simple variable coherence dots stimulus, inherits from baseStimulus

Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md

Inheritance diagram for dotsStimulus:

Public Member Functions

function dotsStimulus (in varargin)
 Class constructor.
 
function setup (in me, in sM)
 Setup the stimulus object.
 
function set_xPositionOut (in me, in value)
 
function set_yPositionOut (in me, in value)
 
function set_sizeOut (in me, in value)
 
function set_dotSizeOut (in me, in value)
 
function set_densityOut (in me, in value)
 
function update (in me)
 Update object We update the object once per trial (if we change parameters for example)
 
function draw (in me)
 Draw our stimulus structure.
 
function animate (in me)
 Animate this object by one frame.
 
function reset (in me)
 reset the object, deleting the temporary .Out properties
 
function set density (in me, in value)
 density set method
 
function get nDots (in me)
 nDots is dependant property, this get method also caches the value in me.nDots_ fo speed
 
- Public Member Functions inherited from baseStimulus
virtual setup (in runObject)
 ALL Children must implement these 5 methods!
 
function baseStimulus (in varargin)
 Class constructor.
 
function set colour (in me, in value)
 colour set method Allow 1 (R=G=B) 3 (RGB) or 4 (RGBA) value colour
 
function set alpha (in me, in value)
 alpha set method
 
function get delta (in me)
 delta Get method delta is the normalised number of pixels per frame to move a stimulus
 
function get dX (in me)
 dX Get method X position increment for a given delta and angle
 
function get dY (in me)
 dY Get method Y position increment for a given delta and angle
 
function show (in me)
 Method to set isVisible=true.
 
function hide (in me)
 Method to set isVisible=false.
 
function setOffTime (in me, in time)
 set offTime
 
function setDelayTime (in me, in time)
 set delayTime
 
function resetTicks (in me)
 reset the various tick counters for our stimulus
 
function getMousePosition (in me)
 get mouse position we make sure this is only called once per animation tick to improve performance and ensure all stimuli that are following mouse position have consistent X and Y per frame update This sets mouseX and mouseY and mouseValid if mouse is within PTB screen (useful for mouse override positioning for stimuli)
 
function run (in me, in benchmark, in runtime, in s, in forceScreen, in showVBL)
 Run stimulus in a window to preview it.
 
function makePanel (in me, in parent)
 make a GUI properties panel for this object
 
function selectFilePanel (in me, in varargin)
 read values from a GUI properties panel for this object
 
function readPanel (in me, in varargin)
 read values from a GUI properties panel for this object
 
function showPanel (in me)
 show GUI properties panel for this object
 
function hidePanel (in me)
 hide GUI properties panel for this object
 
function closePanel (in me, in varargin)
 close GUI panel for this object
 
function cleanHandles (in me, in ignoredArg)
 clean any handles
 
function getP (in me, in name, in range)
 gets a property copy or original property
 
function setP (in me, in name, in value)
 sets a property copy or original property
 
function updateXY (in me, in x, in y, in useDegrees)
 Update only position info, faster and doesn't reset image etc.
 
- Public Member Functions inherited from optickaCore
function optickaCore (in varargin)
 Class constructor.
 
function get fullName (in me)
 
function getALF (in me, in subject, in sessionPrefix, in lab, in create)
 
function findAttributes (in me, in attrName, in attrValue)
 
function findAttributesandType (in me, in attrName, in attrValue, in type)
 find properties of object with specific attributes, for example all properties whose GetAcccess attribute is public and type is logical.
 
function findPropertyDefault (in me, in propName)
 
function clone (in me)
 Use this syntax to make a deep copy of the object, i.e. OBJ_OUT has the same field values, but will not behave as a handle-copy of me anymore.
 
function checkSuperclasses (in List)
 
function editProperties (in me, in properties)
 method to modify a set of properties
 
function setProp (in me, in property, in value)
 method to fast change a particular value. This is useful for use in anonymous functions, like in the state machine.
 
function initialiseGlobals (in me, in doReset, in doOpen)
 
function initialiseSaveFile (in me)
 Initialise Save prefix.
 
function checkPaths (in me)
 checks the paths are valid
 

Public Attributes

Property type
 dot type, only simple supported at present
 
Property density
 dots per degree
 
Property colourType
 how to colour the dots: simple, random, randomN, randomBW, randomNBW, binary
 
Property dotSize
 width of dot (deg)
 
Property coherence
 dot coherence from 0 - 1, non-coherent dots are given a random direction
 
Property angleProbability
 what proportion of dots are in the same direction, other dots are given the opposite direction
 
Property kill
 fraction of dots to kill each frame (limited lifetime)
 
Property dotType
 
Property mask
 whether to use a circular mask or not
 
Property maskIsProcedural
 whether to use a procedural (true) or texture (false) mask
 
Property maskColour
 colour of the mask, empty sets mask colour to = background of screen
 
Property maskSmoothing
 
Property msrcMode
 mask OpenGL blend modes
 
Property mdstMode
 
Property family
 stimulus family
 
Property xy
 row are x and y and columns are each dot
 
Property dxdy
 delta x and y for each dot
 
Property colours
 colour for each dot
 
- Public Attributes inherited from baseStimulus
Property type
 stimulus type
 
Property xPosition
 
Property yPosition
 
Property size
 
Property colour
 
Property alpha
 Alpha (opacity) [0-1], this gets combined with the RGB colour.
 
Property startPosition
 
Property speed
 
Property angle
 angle in degrees (0 - 360)
 
Property delayTime
 
Property offTime
 time to turn stimulus off, relative to stimulus onset
 
Property isVisible
 true or false, whether to draw() this object
 
Property mouseOverride
 override X and Y position with mouse input? Useful for RF mapping
 
Property showOnTracker
 show the position on the Eyetracker display?
 
Property verbose
 Do we log extra details to the command-line?
 
Property xFinal
 
Property yFinal
 
Property mvRect
 
Property szIsPx
 
Property szPx
 computed size in pixels
 
Property szD
 computed size in °
 
Property xFinalD
 X and Y position in °
 
Property yFinalD
 
Property isRect
 
Property tick
 tick updates +1 on each call of draw (even if delay or off is true and no stimulus is drawn, resets on each update
 
Property drawTick
 draw tick only updates when a draw is actually performed, resets on each update
 
Property ppd
 pixels per degree (normally inhereted from screenManager)
 
Property delta
 What our per-frame motion delta is.
 
Property dX
 X update which is computed from our speed and angle.
 
Property dY
 X update which is computed from our speed and angle.
 
- Public Attributes inherited from optickaCore
Property name
 object name
 
Property comment
 comment
 
Property verbose
 verbose logging, subclasses must assign this. This is normally logical true/false
 
Property dateStamp
 clock() dateStamp set on construction
 
Property uuid
 universal ID
 
Property paths
 storage of various paths
 
Property fullName
 The fullName is the object name combined with its uuid and class name.
 

Protected Member Functions

function setRect (in me)
 setRect setRect makes the PsychRect based on the texture and screen values, you should call computePosition() first to get xOut and yOut
 
function updateDots (in me)
 Update the dots based on current variable settings.
 
function makeColours (in me)
 Make colour matrix for dots.
 
function makeMask (in me)
 Make circular mask.
 
- Protected Member Functions inherited from baseStimulus
function addRuntimeProperties (in me)
 These are transient properties that specify actions during runtime.
 
function updateRuntimeProperties (in me)
 Update transient properties that specify actions during runtime.
 
function computePosition (in me)
 compute xFinal and yFinal (in pixels) taking startPosition, xPosition, yPosition and direction/angle into account
 
function setAnimationDelta (in me)
 
function setRect (in me)
 
function toStructure (in me, in tmp)
 Converts properties to a structure.
 
function removeTmpProperties (in me)
 Finds and removes dynamic properties.
 
function delete (in me)
 
- Protected Member Functions inherited from optickaCore
function parseArgs (in me, in args, in allowedProperties)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function addArgs (in me, in args)
 
function setPaths (in me)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function getFonts (in me)
 set paths for object
 
function toStructure (in me)
 Converts properties to a structure.
 
function getType (in me, in in)
 
function logOutput (in me, in in, in message, in override)
 Give a metaproperty return the likely property class.
 
function salutation (in me, in varargin)
 Prints messages dependent on verbosity.
 

Additional Inherited Members

- Public Types inherited from baseStimulus
enum  Events { readPanelUpdate }
 
- Static Public Member Functions inherited from baseStimulus
static function d2r (in degrees)
 degrees2radians
 
static function r2d (in r)
 radians2degrees
 
static function findDistance (in x1, in y1, in x2, in y2)
 findDistance in X and Y coordinates
 
static function updatePosition (in delta, in angle)
 updatePosition returns dX and dY given an angle and delta
 
- Static Public Member Functions inherited from optickaCore
static function makeArgs (in args)
 Converts cell args to structure array.
 
static function addDefaults (in args, in defs)
 add default options to arg input
 
static function hasKey (in in, in key)
 check if a struct / object has a propery / field
 
static function getKeys (in device)
 PTB Get key presses, stops key bouncing.
 
- Protected Attributes inherited from baseStimulus
Property family
 the stimulus family (grating, dots etc.)
 
Property texture
 Our texture pointer for texture-based stimuli.
 
Property handles
 handles for the GUI
 
Property sM
 our screen manager
 
Property animator
 animation manager
 
Property screenVals
 screen settings generated by sM on setup
 
Property isSetup
 
Property isGUI
 is panel constructed?
 
Property dstRect
 initial screen rectangle position [LEFT TOP RIGHT BOTTOM]
 
Property mouseValid
 is mouse position within screen co-ordinates?
 
Property mouseX
 mouse X position
 
Property mouseY
 mouse Y position
 
Property delayTicks
 delay ticks to wait until display
 
Property offTicks
 ticks before stimulus turns off
 
Property inSetup
 are we setting up?
 
Property delta_
 delta cache
 
Property dX_
 dX cache
 
Property dY_
 dY cache
 
Property isInSetColour
 deal with interaction of colour and alpha
 
Property setLoop
 
Property ignorePropertiesBase
 Which properties to ignore cloning when making transient copies in setup.
 
Property ignorePropertiesUIBase
 Which properties to not draw in the UI panel.
 
- Protected Attributes inherited from optickaCore
Property cloning
 are we cloning this from another object
 
Property mversion
 Matlab version number, this is transient so it is not saved.
 
Property sansFont
 sans font
 
Property monoFont
 monoFont
 
Property className
 class name
 
Property savePrefix
 save prefix generated from clock time
 
Property fullName_
 cached full name
 

Constructor & Destructor Documentation

◆ dotsStimulus()

function dotsStimulus::dotsStimulus ( in  varargin)

Class constructor.

More detailed description of what the constructor does.

Parameters
argsare passed as a structure of properties which is parsed.
Returns
instance of class.

Member Function Documentation

◆ animate()

function dotsStimulus::animate ( in  me)
virtual

Animate this object by one frame.

Reimplemented from baseStimulus.

◆ density()

function set dotsStimulus::density ( in  me,
in  value 
)

density set method

We need to update nDots if density is changed

◆ draw()

function dotsStimulus::draw ( in  me)
virtual

Draw our stimulus structure.

Reimplemented from baseStimulus.

◆ makeColours()

function dotsStimulus::makeColours ( in  me)
protected

Make colour matrix for dots.

◆ makeMask()

function dotsStimulus::makeMask ( in  me)
protected

Make circular mask.

◆ nDots()

function get dotsStimulus::nDots ( in  me)

nDots is dependant property, this get method also caches the value in me.nDots_ fo speed

◆ reset()

function dotsStimulus::reset ( in  me)
virtual

reset the object, deleting the temporary .Out properties

Reimplemented from baseStimulus.

◆ set_densityOut()

function dotsStimulus::set_densityOut ( in  me,
in  value 
)

◆ set_dotSizeOut()

function dotsStimulus::set_dotSizeOut ( in  me,
in  value 
)

◆ set_sizeOut()

function dotsStimulus::set_sizeOut ( in  me,
in  value 
)

◆ set_xPositionOut()

function dotsStimulus::set_xPositionOut ( in  me,
in  value 
)

◆ set_yPositionOut()

function dotsStimulus::set_yPositionOut ( in  me,
in  value 
)

◆ setRect()

function dotsStimulus::setRect ( in  me)
protected

setRect setRect makes the PsychRect based on the texture and screen values, you should call computePosition() first to get xOut and yOut

◆ setup()

function dotsStimulus::setup ( in  me,
in  sM 
)

Setup the stimulus object.

Parameters
sMscreenManager object for reference

◆ update()

function dotsStimulus::update ( in  me)
virtual

Update object We update the object once per trial (if we change parameters for example)

Reimplemented from baseStimulus.

◆ updateDots()

function dotsStimulus::updateDots ( in  me)
protected

Update the dots based on current variable settings.

Member Data Documentation

◆ angleProbability

Property dotsStimulus::angleProbability

what proportion of dots are in the same direction, other dots are given the opposite direction

◆ coherence

Property dotsStimulus::coherence

dot coherence from 0 - 1, non-coherent dots are given a random direction

◆ colours

Property dotsStimulus::colours

colour for each dot

◆ colourType

Property dotsStimulus::colourType

how to colour the dots: simple, random, randomN, randomBW, randomNBW, binary

◆ density

Property dotsStimulus::density

dots per degree

◆ dotSize

Property dotsStimulus::dotSize

width of dot (deg)

◆ dotType

Property dotsStimulus::dotType

type of dot (integer, where 0 means filled square, 1 means filled circle, and 2/3 means filled circle with high-quality anti-aliasing)

◆ dxdy

Property dotsStimulus::dxdy

delta x and y for each dot

◆ family

Property dotsStimulus::family

stimulus family

◆ kill

Property dotsStimulus::kill

fraction of dots to kill each frame (limited lifetime)

◆ mask

Property dotsStimulus::mask

whether to use a circular mask or not

◆ maskColour

Property dotsStimulus::maskColour

colour of the mask, empty sets mask colour to = background of screen

◆ maskIsProcedural

Property dotsStimulus::maskIsProcedural

whether to use a procedural (true) or texture (false) mask

◆ maskSmoothing

Property dotsStimulus::maskSmoothing

smooth the alpha edge of the mask by this number of pixels, 0 is off

◆ mdstMode

Property dotsStimulus::mdstMode

◆ msrcMode

Property dotsStimulus::msrcMode

mask OpenGL blend modes

◆ type

Property dotsStimulus::type

dot type, only simple supported at present

◆ xy

Property dotsStimulus::xy

row are x and y and columns are each dot


The documentation for this class was generated from the following file: