Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
|
Manager for multiple stimuli. More...
Manager for multiple stimuli.
METASTIMULUS manages a collection of stimuli, wrapped in one object. It allows you to treat this group of heterogenous stimuli as if they are a single stimulus (draw, update,animate,reset), so for example animate(metaStimulus) will run the animate method for all stimuli in the group without having to call it for each stimulus. You can also pick individual stimuli by using cell indexing of this object. So for example metaStimulus{2} actually calls metaStimulus.stimuli{2}.
You can also pass a mask stimulus set, and when you toggle showMask, the mask stimuli will be drawn instead of the stimuli themselves.
This manager also allows you to build "sets" of stimuli (set stimulusSets to e.g [2 4 7] would be stimuli 2 4 and 7), and you can quickly switch between sets. For example you could have a set of fixation cross alone, and another of fixation cross and a distractor stimulus and use showSet() to quickly switch between these sets. There are also show([index]) and hide([index]) to show and hide stimuli directly.
Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md
Public Member Functions | |
function | metaStimulus (in varargin) |
Class constructor. | |
function | setup (in me, in s) |
setup wrapper | |
function | update (in me, in choice) |
update wrapper | |
function | draw (in me, in choice) |
draw wrapper | |
function | animate (in me, in choice) |
animate wrapper | |
function | resetTicks (in me, in choice) |
reset ticks wrapper | |
function | resetLog (in me) |
reset log wrapper | |
function | updateVerbosity (in me) |
update verbosity | |
function | addTag (in me, in tag) |
add tag wrapper | |
function | reset (in me) |
reset wrapper | |
function | randomise (in me) |
randomise wrapper | |
function | show (in me, in choice) |
show sets isVisible=true. | |
function | hide (in me, in choice) |
hide sets isVisible=false. | |
function | showSet (in me, in set) |
Toggle show/hide for particular sets of stimuli. | |
function | edit (in me, in stims, in var, in value, in mask) |
Edit – fast change a particular value. | |
function | getFixationPositions (in me) |
Return the stimulus fixation positions based on fixationChoice. | |
function | getExclusionPositions (in me) |
Return the stimulus exclusion positions. | |
function | getStimulusPositions (in me, in ignoreVisible, in toDegrees) |
Find the stimulus positions, setting stimulusPositions structure. | |
function | run (in me, in benchmark, in runtime, in s, in forceScreen, in showVBL) |
Run Stimuli in a window to quickly preview them. | |
function | runSingle (in me, in choice, in varargin) |
Run single stimulus in a window to preview. | |
function | printChoice (in me) |
print current choice if only single stimulus drawn | |
function get | n (in me) |
get n dependent method | |
function get | nMask (in me) |
get nMask dependent method | |
function | getTypes (in me) |
getTypes | |
function set | stimuli (in me, in in) |
set stimuli sanity checker | |
function | subsref (in me, in s) |
subsref allow {} to call stimuli cell array directly | |
function | subsasgn (in me, in s, in val) |
subsasgn allow {} to assign to the stimuli cell array | |
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 | stimuli |
cell array of opticka stimuli to manage | |
Property | maskStimuli |
cell array of mask stimuli | |
Property | showMask |
do we draw the mask stimuli instead? | |
Property | stimulusSets |
sets of stimuli, e.g. [[1 2 3], [2 3], [1 3]] | |
Property | setChoice |
which set of stimuli to display when calling showSet() | |
Property | fixationChoice |
which stimuli should getFixationPositions() return the positions for? | |
Property | exclusionChoice |
which stimuli should etExclusionPositions() return the positions for? | |
Property | stimulusTable |
Property | tableChoice |
choice for table | |
Property | controlTable |
Property | verbose |
verbose? | |
Property | choice |
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 Attributes | |
Property | screen |
screenManager handle | |
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 | |
Additional Inherited Members | |
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 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. | |
function metaStimulus::metaStimulus | ( | in | varargin | ) |
Class constructor.
varargin | are passed as a structure of properties which is parsed. |
function metaStimulus::addTag | ( | in | me, |
in | tag | ||
) |
add tag wrapper
return
function metaStimulus::animate | ( | in | me, |
in | choice | ||
) |
animate wrapper
choice | allow a single selected stimulus |
function metaStimulus::draw | ( | in | me, |
in | choice | ||
) |
draw wrapper
choice | override a single choice |
function metaStimulus::edit | ( | in | me, |
in | stims, | ||
in | var, | ||
in | value, | ||
in | mask | ||
) |
Edit – fast change a particular value.
@params stims array of stimuli to edit @params var the variable to edit @params the value to assign @params mask whether to edit a mask or notmal stimulus
function metaStimulus::getExclusionPositions | ( | in | me | ) |
Return the stimulus exclusion positions.
Use the exclusionChoice value to find the X and Y positions of these stimuli, returns x and y positions and also sets the lastXExclusion and lastXExclusion parameters
function metaStimulus::getFixationPositions | ( | in | me | ) |
Return the stimulus fixation positions based on fixationChoice.
Using fixationChoice parameter, return the x and y positions of each stimulus
function metaStimulus::getStimulusPositions | ( | in | me, |
in | ignoreVisible, | ||
in | toDegrees | ||
) |
Find the stimulus positions, setting stimulusPositions structure.
Loop through all stimuli and get the X, Y and size of each stimulus. This is added to stimulusPositions structure and is used to pass to the eyetracker so it can draw the stimuli locations on the eyetracker interface
ignoreVisible | [false] ignore the visibility status of stims |
function metaStimulus::getTypes | ( | in | me | ) |
getTypes
return typeList types of stimuli
function metaStimulus::hide | ( | in | me, |
in | choice | ||
) |
hide sets isVisible=false.
choice | a numeric array of stimulus numbers, e.g. [1 3] |
function get metaStimulus::n | ( | in | me | ) |
get n dependent method
return n number of stimuli
function get metaStimulus::nMask | ( | in | me | ) |
get nMask dependent method
return nMask number of mask stimuli
function metaStimulus::printChoice | ( | in | me | ) |
print current choice if only single stimulus drawn
return
function metaStimulus::randomise | ( | in | me | ) |
randomise wrapper
if stimulusTable is set, then we use the table to assign stimulus values to each stimulus
function metaStimulus::reset | ( | in | me | ) |
reset wrapper
return
function metaStimulus::resetLog | ( | in | me | ) |
reset log wrapper
return
function metaStimulus::resetTicks | ( | in | me, |
in | choice | ||
) |
reset ticks wrapper
return
function metaStimulus::run | ( | in | me, |
in | benchmark, | ||
in | runtime, | ||
in | s, | ||
in | forceScreen, | ||
in | showVBL | ||
) |
Run Stimuli in a window to quickly preview them.
function metaStimulus::runSingle | ( | in | me, |
in | choice, | ||
in | varargin | ||
) |
Run single stimulus in a window to preview.
function metaStimulus::setup | ( | in | me, |
in | s | ||
) |
setup wrapper
return
function metaStimulus::show | ( | in | me, |
in | choice | ||
) |
show sets isVisible=true.
choice | a numeric array of stimulus numbers, e.g. [1 3] |
function metaStimulus::showSet | ( | in | me, |
in | set | ||
) |
Toggle show/hide for particular sets of stimuli.
set | which set to show, note all other stimuli are hidden |
function set metaStimulus::stimuli | ( | in | me, |
in | in | ||
) |
set stimuli sanity checker
in | a stimuli group |
function metaStimulus::subsasgn | ( | in | me, |
in | s, | ||
in | val | ||
) |
subsasgn allow {} to assign to the stimuli cell array
s | is the subsref struct |
val | is the value to assign |
function metaStimulus::subsref | ( | in | me, |
in | s | ||
) |
subsref allow {} to call stimuli cell array directly
s | is the subsref struct |
function metaStimulus::update | ( | in | me, |
in | choice | ||
) |
update wrapper
choice | override a single choice |
function metaStimulus::updateVerbosity | ( | in | me | ) |
update verbosity
return
Property metaStimulus::choice |
choice allows to 'filter' a subset of stimulus in the group when calling draw, update, animate and reset
Property metaStimulus::controlTable |
control table for keyboard changes, again allows you to dynamically change variables during training sessions
Property metaStimulus::exclusionChoice |
which stimuli should etExclusionPositions() return the positions for?
Property metaStimulus::fixationChoice |
which stimuli should getFixationPositions() return the positions for?
Property metaStimulus::maskStimuli |
cell array of mask stimuli
|
protected |
screenManager handle
Property metaStimulus::setChoice |
which set of stimuli to display when calling showSet()
Property metaStimulus::showMask |
do we draw the mask stimuli instead?
Property metaStimulus::stimuli |
cell array of opticka stimuli to manage
Property metaStimulus::stimulusSets |
sets of stimuli, e.g. [[1 2 3], [2 3], [1 3]]
Property metaStimulus::stimulusTable |
variable randomisation table to apply to a stimulus, most useful during training tasks
Property metaStimulus::tableChoice |
choice for table
Property metaStimulus::verbose |
verbose?