Opticka 2.18.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
timeLogger Class Reference
Inheritance diagram for timeLogger:

Public Member Functions

function timeLogger (in varargin)
 Constructor.
 
function preAllocate (in me, in n, in m)
 Preallocate timing and message storage.
 
function plot (in me)
 Plot timing summaries and, when present, the message log.
 
function logStim (in me, in name, in tick)
 Mark whether the stimulus was active for a frame tick.
 
function addMessage (in me, in tick, in startTime, in exitTime, in message, in timeType, in HED)
 Append a timestamped message to the event log.
 
function printRunLog (in me)
 Plot raw timing, frame deltas, timing offsets, and misses.
 
function plotMessages (in me)
 Show the message log in a UI table.
 
function build_gui ()
 
function messageTable (in me)
 Export the message log as a sorted table.
 
function toDateTime (in posixT)
 
function calculateMisses (in me, in miss, in stimTime)
 Count missed frames that occurred during stimulus display.
 
function removeEmptyValues (in me)
 Trim unused preallocated values and normalise old log formats.
 
- Public Member Functions inherited from optickaCore
function optickaCore (in varargin)
 Class constructor.
 
function get fullName (in me)
 
function getALF (in me, in subject, in lab, in create)
 get the ALF path
 
function makeReport (in me, in rpt)
 Generate a detailed report for the opticka object.
 
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)
 Return the declared default value for a class property.
 
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 initialiseSaveFile (in me, in varargin)
 just get date fragment for backwards compatibility
 
function checkPaths (in me)
 checks the paths are valid
 

Static Public Member Functions

static function loadobj (in s)
 Rebuild a logger object after loading saved state.
 
- Static Public Member Functions inherited from optickaCore
static function initialiseGlobals (in doReset, in doOpen)
 
static function makeArgs (in args)
 Converts cell args to structure array.
 
static function addDefaults (in args, in defs)
 regularises and adds 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 timer
 Log frame timing and event annotations for a task run.
 
Property stimStateNames
 
Property t
 
Property preallocateTimes
 
Property preallocateMessages
 
Property screenLog
 
Property startTime
 
Property lastvbl
 
Property missvbls
 
Property tick
 
Property tickInfo
 
Property startRun
 
Property verbose
 
Property vbl
 
Property show
 
Property flip
 
Property miss
 
Property stimTime
 
- 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 optickaVersion
 version number
 
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

◆ timeLogger()

function timeLogger::timeLogger ( in  varargin)

Constructor.

Parameters
varargin
Returns

Member Function Documentation

◆ addMessage()

function timeLogger::addMessage ( in  me,
in  tick,
in  startTime,
in  exitTime,
in  message,
in  timeType,
in  HED 
)

Append a timestamped message to the event log.

Empty timing inputs fall back to the most recent VBL time or the logger timer. HED payloads are normalised to a stored string path.

Parameters
tickFrame index associated with the message.
startTimeTimestamp of message onset.
exitTimeTimestamp of message completion.
messageText message to store.
timeTypeLabel describing how the timestamp was generated.
HEDOptional HED tag or HED tag object.

◆ build_gui()

function timeLogger::build_gui ( )

◆ calculateMisses()

function timeLogger::calculateMisses ( in  me,
in  miss,
in  stimTime 
)

Count missed frames that occurred during stimulus display.

Parameters
missFrame miss vector.
stimTimeStimulus-on mask for each frame.

◆ loadobj()

static function timeLogger::loadobj ( in  s)
static

Rebuild a logger object after loading saved state.

Parameters
sSaved struct or already-instantiated logger.
Returns
me Reconstructed timeLogger instance.

◆ logStim()

function timeLogger::logStim ( in  me,
in  name,
in  tick 
)

Mark whether the stimulus was active for a frame tick.

Parameters
nameStimulus state name for the current frame.
tickFrame index to update.

◆ messageTable()

function timeLogger::messageTable ( in  me)

Export the message log as a sorted table.

The returned table contains onset, exit, relative time, duration, frame tick, stimulus state, free text message, time type, and HED tag.

Returns
tbl Message log as a MATLAB table.

◆ plot()

function timeLogger::plot ( in  me)

Plot timing summaries and, when present, the message log.

◆ plotMessages()

function timeLogger::plotMessages ( in  me)

Show the message log in a UI table.

Returns
h Struct of UI handles, or empty when there are no messages.

◆ preAllocate()

function timeLogger::preAllocate ( in  me,
in  n,
in  m 
)

Preallocate timing and message storage.

This avoids repeated array growth during a run and resets the message write index to the start of the buffers.

Parameters
nNumber of frame timing entries to reserve.
mNumber of message entries to reserve.

◆ printRunLog()

function timeLogger::printRunLog ( in  me)

Plot raw timing, frame deltas, timing offsets, and misses.

Returns
h Figure handle or empty when no timing data is available.

◆ removeEmptyValues()

function timeLogger::removeEmptyValues ( in  me)

Trim unused preallocated values and normalise old log formats.

This method collapses legacy message layouts into the current schema, removes missing entries, and ensures optional fields exist.

◆ toDateTime()

function timeLogger::toDateTime ( in  posixT)

Member Data Documentation

◆ flip

Property timeLogger::flip

◆ lastvbl

Property timeLogger::lastvbl

◆ miss

Property timeLogger::miss

◆ missvbls

Property timeLogger::missvbls

◆ preallocateMessages

Property timeLogger::preallocateMessages

◆ preallocateTimes

Property timeLogger::preallocateTimes

◆ screenLog

Property timeLogger::screenLog

◆ show

Property timeLogger::show

◆ startRun

Property timeLogger::startRun

◆ startTime

Property timeLogger::startTime

◆ stimStateNames

Property timeLogger::stimStateNames

◆ stimTime

Property timeLogger::stimTime

◆ t

Property timeLogger::t

◆ tick

Property timeLogger::tick

◆ tickInfo

Property timeLogger::tickInfo

◆ timer

Property timeLogger::timer

Log frame timing and event annotations for a task run.

The class stores per-frame timing values such as VBL, draw, flip, miss, and stimulus state, together with timestamped messages that can include time type metadata and optional HED annotations. The logged data can be normalised, plotted, and exported as a table for later inspection. We use pre-allocated arrays as this is much faster...

◆ vbl

Property timeLogger::vbl

◆ verbose

Property timeLogger::verbose

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