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

Manager for multiple stimuli. More...

Detailed Description

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

Inheritance diagram for metaStimulus:

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.
 

Constructor & Destructor Documentation

◆ metaStimulus()

function metaStimulus::metaStimulus ( in  varargin)

Class constructor.

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

Member Function Documentation

◆ addTag()

function metaStimulus::addTag ( in  me,
in  tag 
)

add tag wrapper

Parameters

return

◆ animate()

function metaStimulus::animate ( in  me,
in  choice 
)

animate wrapper

Parameters
choiceallow a single selected stimulus
Returns

◆ draw()

function metaStimulus::draw ( in  me,
in  choice 
)

draw wrapper

Parameters
choiceoverride a single choice
Returns

◆ edit()

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

◆ getExclusionPositions()

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

◆ getFixationPositions()

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

◆ getStimulusPositions()

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

Parameters
ignoreVisible[false] ignore the visibility status of stims
Returns
out copy of the stimulusPositions structure

◆ getTypes()

function metaStimulus::getTypes ( in  me)

getTypes

Parameters

return typeList types of stimuli

◆ hide()

function metaStimulus::hide ( in  me,
in  choice 
)

hide sets isVisible=false.

Parameters
choicea numeric array of stimulus numbers, e.g. [1 3]

◆ n()

function get metaStimulus::n ( in  me)

get n dependent method

Parameters

return n number of stimuli

◆ nMask()

function get metaStimulus::nMask ( in  me)

get nMask dependent method

Parameters

return nMask number of mask stimuli

◆ printChoice()

function metaStimulus::printChoice ( in  me)

print current choice if only single stimulus drawn

Parameters

return

◆ randomise()

function metaStimulus::randomise ( in  me)

randomise wrapper

if stimulusTable is set, then we use the table to assign stimulus values to each stimulus

◆ reset()

function metaStimulus::reset ( in  me)

reset wrapper

Parameters

return

◆ resetLog()

function metaStimulus::resetLog ( in  me)

reset log wrapper

Parameters

return

◆ resetTicks()

function metaStimulus::resetTicks ( in  me,
in  choice 
)

reset ticks wrapper

Parameters

return

◆ run()

function metaStimulus::run ( in  me,
in  benchmark,
in  runtime,
in  s,
in  forceScreen,
in  showVBL 
)

Run Stimuli in a window to quickly preview them.

◆ runSingle()

function metaStimulus::runSingle ( in  me,
in  choice,
in  varargin 
)

Run single stimulus in a window to preview.

◆ setup()

function metaStimulus::setup ( in  me,
in  s 
)

setup wrapper

Parameters

return

◆ show()

function metaStimulus::show ( in  me,
in  choice 
)

show sets isVisible=true.

Parameters
choicea numeric array of stimulus numbers, e.g. [1 3]

◆ showSet()

function metaStimulus::showSet ( in  me,
in  set 
)

Toggle show/hide for particular sets of stimuli.

Parameters
setwhich set to show, note all other stimuli are hidden

◆ stimuli()

function set metaStimulus::stimuli ( in  me,
in  in 
)

set stimuli sanity checker

Parameters
ina stimuli group
Returns

◆ subsasgn()

function metaStimulus::subsasgn ( in  me,
in  s,
in  val 
)

subsasgn allow {} to assign to the stimuli cell array

Parameters
sis the subsref struct
valis the value to assign
Returns
me object

◆ subsref()

function metaStimulus::subsref ( in  me,
in  s 
)

subsref allow {} to call stimuli cell array directly

Parameters
sis the subsref struct
Returns
varargout any output for the reference

◆ update()

function metaStimulus::update ( in  me,
in  choice 
)

update wrapper

Parameters
choiceoverride a single choice
Returns

◆ updateVerbosity()

function metaStimulus::updateVerbosity ( in  me)

update verbosity

Parameters

return

Member Data Documentation

◆ choice

Property metaStimulus::choice

choice allows to 'filter' a subset of stimulus in the group when calling draw, update, animate and reset

◆ controlTable

Property metaStimulus::controlTable

control table for keyboard changes, again allows you to dynamically change variables during training sessions

◆ exclusionChoice

Property metaStimulus::exclusionChoice

which stimuli should etExclusionPositions() return the positions for?

◆ fixationChoice

Property metaStimulus::fixationChoice

which stimuli should getFixationPositions() return the positions for?

◆ maskStimuli

Property metaStimulus::maskStimuli

cell array of mask stimuli

◆ screen

Property metaStimulus::screen
protected

screenManager handle

◆ setChoice

Property metaStimulus::setChoice

which set of stimuli to display when calling showSet()

◆ showMask

Property metaStimulus::showMask

do we draw the mask stimuli instead?

◆ stimuli

Property metaStimulus::stimuli

cell array of opticka stimuli to manage

◆ stimulusSets

Property metaStimulus::stimulusSets

sets of stimuli, e.g. [[1 2 3], [2 3], [1 3]]

◆ stimulusTable

Property metaStimulus::stimulusTable

variable randomisation table to apply to a stimulus, most useful during training tasks

◆ tableChoice

Property metaStimulus::tableChoice

choice for table

◆ verbose

Property metaStimulus::verbose

verbose?


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