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

GUI Manager for runExperiment() class. More...

Detailed Description

GUI Manager for runExperiment() class.

Opticka is an object-oriented experiment manager wrapping the Psychophysics toolbox; see http://iandol.github.com/opticka/ for more details. This class builds and controls the GUI that manages interaction with runExperiment and other classes (screenManager, metaStimulus, taskSequence, stateMachine etc.)

Todo:

expose maskStimulus settings in the optickaGUI

more flexible tweaking of arduino settings

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

Inheritance diagram for opticka:

Public Member Functions

function opticka (in varargin)
 Class constructor.
 
function amIRemote (in me)
 Check if we are remote by checking existance of UI.
 
function connectToOmniplex (in me)
 
function sendOmniplexStimulus (in me, in sendLog)
 
function initialiseUI (in me)
 Start the UI.
 
function getScreenVals (in me)
 
function getTaskVals (in me, in randomise)
 
function getStateInfo (in met, in kind)
 
function clearStimulusList (in me)
 
function clearVariableList (in me)
 
function addStimulus (in me)
 
function deleteStimulus (in me)
 
function readPanel (in me, in src, in varargin)
 
function editStimulus (in me)
 
function modifyStimulus (in me)
 
function addVariable (in me)
 addVariable Gets the settings from th UI and updates our runExperiment object
 
function updateVariable (in me)
 updateVariable Gets the values from the UI and updates that var
 
function editVariable (in me)
 editVariable Gets the settings from the UI and updates our runExperiment object
 
function deleteVariable (in me)
 deleteVariable Gets the settings from the UI and updates our runExperiment object
 
function copyVariable (in me)
 copyVariable Gets the settings from the UI and updates our runExperiment object
 
function loadCalibration (in me)
 Load calibration file, better that this is manual...
 
function saveCalibration (in me)
 
function loadPrefs (in me)
 loadPrefs Load prefs better left local to the machine
 
function savePrefs (in me)
 savePrefs Save prefs better left local to the machine
 
function router (in me, in in, in vars)
 Route to private methods.
 
function deleteProtocol (in me)
 Delete Protocol Delete Protocol.
 
function saveProtocol (in me, in copyIt)
 Save Protocol Save Protocol.
 
function saveData (in me)
 Save Data Save data, by cloning a copy of the opticka object and saving this.
 
function loadProtocol (in me, in useList)
 Load Protocol Load Protocol.
 
function refreshProtocolsList (in me, in ppath)
 Refresh the UI list of Protocols Refresh the UI list of Protocols.
 
- 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
 

Static Public Member Functions

static function loadobj (in in)
 loadobj To be backwards compatible to older saved protocols, we have to parse structures / objects specifically during object load
 
static function ping (in rAddress)
 ping – ping a network address We send a single packet and wait only 10ms to ensure we have a fast connection
 
static function gs (in inhandle, in value)
 gs (getstring)
 
static function gi (in inhandle)
 gi (getitems) items of a dropdown menu
 
static function gp (in inhandle)
 gi (getposition) 1st position of selection in dropdown menu
 
static function gd (in inhandle)
 gd (getdouble)
 
static function gn (in inhandle)
 gn (getnumber)
 
static function ge (in inhandle)
 get string but eval to variable
 
static function gv (in inhandle)
 gv (getvalue)
 
static function gl (in inhandle)
 gl (getlogical)
 
static function centerGUI (in uihandle)
 move GUI to center of screen
 
static function cellAsString (in c, in addBrackets)
 convert a cell into a string to display in UI that we can eval back to a cell array. It collapses nested cells.
 
static function resizeFigure (in position, in size, in mult)
 position and size figure
 
- 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.
 

Public Attributes

Property optickaVersion
 version number
 
Property remote
 is this a remote instance?
 
Property r
 this is the main runExperiment object
 
Property verbose
 run in verbose mode?
 
Property store
 general store for misc properties
 
Property initUI
 initialise UI?
 
Property ui
 all of the handles to the opticka_ui GUI
 
Property oc
 omniplex connection, via TCP
 
Property me
 
Property if
 
Property else
 
- 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.
 

Additional Inherited Members

- 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.
 
- 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

◆ opticka()

opticka::opticka ( in  varargin)

Class constructor.

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

Member Function Documentation

◆ addStimulus()

opticka::addStimulus ( in  me)

Run when we've added a new stimulus

Parameters
<br>

◆ addVariable()

function opticka::addVariable ( in  me)

addVariable Gets the settings from th UI and updates our runExperiment object

Parameters
<br>

◆ amIRemote()

opticka::amIRemote ( in  me)

Check if we are remote by checking existance of UI.

◆ cellAsString()

opticka::cellAsString ( in  c,
in  addBrackets 
)
static

convert a cell into a string to display in UI that we can eval back to a cell array. It collapses nested cells.

Parameters
ccell array of strings
addBrackets;add { } around string or not?
Returns
s the string representation

◆ centerGUI()

static function opticka::centerGUI ( in  uihandle)
static

move GUI to center of screen

Parameters
inhandlehandle to UI element

◆ clearStimulusList()

opticka::clearStimulusList ( in  me)

Erase any stimuli in the list.

Parameters
<br>

◆ clearVariableList()

function opticka::clearVariableList ( in  me)

◆ connectToOmniplex()

opticka::connectToOmniplex ( in  me)

Gets the settings from the UI and connects to omniplex

◆ copyVariable()

function opticka::copyVariable ( in  me)

copyVariable Gets the settings from the UI and updates our runExperiment object

Parameters
<br>

◆ deleteProtocol()

function opticka::deleteProtocol ( in  me)

Delete Protocol Delete Protocol.

Parameters
<br>

◆ deleteStimulus()

opticka::deleteStimulus ( in  me)
Parameters
<br>

◆ deleteVariable()

function opticka::deleteVariable ( in  me)

deleteVariable Gets the settings from the UI and updates our runExperiment object

Parameters
<br>

◆ editStimulus()

opticka::editStimulus ( in  me)

Gets the settings from the UI and updates our runExperiment object.

◆ editVariable()

function opticka::editVariable ( in  me)

editVariable Gets the settings from the UI and updates our runExperiment object

Parameters
<br>

◆ gd()

static function opticka::gd ( in  inhandle)
static

gd (getdouble)

Parameters
inhandlehandle to UI element

◆ ge()

static function opticka::ge ( in  inhandle)
static

get string but eval to variable

Parameters
inhandlehandle to UI element

◆ getScreenVals()

opticka::getScreenVals ( in  me)

Gets the settings from the UI and updates our runExperiment object.

Gets the settings from th UI and updates our runExperiment object

Parameters
<br>

◆ getStateInfo()

function opticka::getStateInfo ( in  met,
in  kind 
)

◆ getTaskVals()

opticka::getTaskVals ( in  me,
in  randomise 
)

Gets the settings from the UI and updates our task object.

Parameters
randomisedo we run randomiseTask()? [default=FALSE]

◆ gi()

static function opticka::gi ( in  inhandle)
static

gi (getitems) items of a dropdown menu

Parameters
inhandlehandle to UI element

◆ gl()

static function opticka::gl ( in  inhandle)
static

gl (getlogical)

Parameters
inhandlehandle to UI element

◆ gn()

static function opticka::gn ( in  inhandle)
static

gn (getnumber)

Parameters
inhandlehandle to UI element

◆ gp()

static function opticka::gp ( in  inhandle)
static

gi (getposition) 1st position of selection in dropdown menu

Parameters
inhandlehandle to UI element

◆ gs()

static function opticka::gs ( in  inhandle,
in  value 
)
static

gs (getstring)

Parameters
inhandlehandle to UI element
value

◆ gv()

static function opticka::gv ( in  inhandle)
static

gv (getvalue)

Parameters
inhandlehandle to UI element

◆ initialiseUI()

opticka::initialiseUI ( in  me)

Start the UI.

◆ loadCalibration()

function opticka::loadCalibration ( in  me)

Load calibration file, better that this is manual...

◆ loadobj()

static function opticka::loadobj ( in  in)
static

loadobj To be backwards compatible to older saved protocols, we have to parse structures / objects specifically during object load

Parameters
ininput object/structure

◆ loadPrefs()

function opticka::loadPrefs ( in  me)

loadPrefs Load prefs better left local to the machine

◆ loadProtocol()

opticka::loadProtocol ( in  me,
in  useList 
)

Load Protocol Load Protocol.

Parameters
ui– do we show a uiload dialog?

◆ modifyStimulus()

opticka::modifyStimulus ( in  me)

Gets the settings from the UI and updates our runExperiment object

Parameters
<br>

◆ ping()

static function opticka::ping ( in  rAddress)
static

ping – ping a network address We send a single packet and wait only 10ms to ensure we have a fast connection

Parameters
rAddressremote address
Returns
status is 0 if ping succeded

◆ readPanel()

opticka::readPanel ( in  me,
in  src,
in  varargin 
)
Parameters
srcsource object
varargin

◆ refreshProtocolsList()

function opticka::refreshProtocolsList ( in  me,
in  ppath 
)

Refresh the UI list of Protocols Refresh the UI list of Protocols.

Parameters

◆ resizeFigure()

static function opticka::resizeFigure ( in  position,
in  size,
in  mult 
)
static

position and size figure

◆ router()

opticka::router ( in  me,
in  in,
in  vars 
)

Route to private methods.

Parameters
inswitch to route to correct method.
varsadditional vars to pass.

◆ saveCalibration()

function opticka::saveCalibration ( in  me)

◆ saveData()

function opticka::saveData ( in  me)

Save Data Save data, by cloning a copy of the opticka object and saving this.

◆ savePrefs()

function opticka::savePrefs ( in  me)

savePrefs Save prefs better left local to the machine

◆ saveProtocol()

function opticka::saveProtocol ( in  me,
in  copyIt 
)

Save Protocol Save Protocol.

Parameters
<br>

◆ sendOmniplexStimulus()

opticka::sendOmniplexStimulus ( in  me,
in  sendLog 
)

Gets the settings from the UI and connects to omniplex.

Parameters
sendLogsend the run log [default = false]

◆ updateVariable()

function opticka::updateVariable ( in  me)

updateVariable Gets the values from the UI and updates that var

Parameters
<br>

Member Data Documentation

◆ else

Property opticka::else

◆ if

Property opticka::if

◆ initUI

Property opticka::initUI

initialise UI?

◆ me

Property opticka::me

◆ oc

Property opticka::oc

omniplex connection, via TCP

◆ optickaVersion

Property opticka::optickaVersion

version number

◆ r

Property opticka::r

this is the main runExperiment object

◆ remote

Property opticka::remote

is this a remote instance?

◆ store

Property opticka::store

general store for misc properties

◆ ui

Property opticka::ui

all of the handles to the opticka_ui GUI

◆ verbose

Property opticka::verbose

run in verbose mode?


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