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

iRecAnalysis offers a set of methods to load, parse & plot raw CSV files. It understands opticka trials (where CSV messages INT start a trial and 255 ends a trial by default) so can parse eye data and plot it for trial groups. You can also manually find microsaccades, and perform ROI/TOI filtering on the eye movements. More...

Detailed Description

iRecAnalysis offers a set of methods to load, parse & plot raw CSV files. It understands opticka trials (where CSV messages INT start a trial and 255 ends a trial by default) so can parse eye data and plot it for trial groups. You can also manually find microsaccades, and perform ROI/TOI filtering on the eye movements.

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

Inheritance diagram for iRecAnalysis:

Public Member Functions

function iRecAnalysis (in varargin)
 
function load (in me, in force)
 
function parseSimple (in me)
 
function parse (in me)
 
function parseSaccades (in me)
 parse saccade related data
 
function pruneNonRTTrials (in me)
 remove trials from correct list that did not use a rt start or end message
 
function updateCorrectIndex (in me, in idx)
 update correct index list
 
function pruneTrials (in me, in num)
 prunetrials – very rarely (n=1) we lose a trial strobe in the plexon data and thus when we try to align the plexon trial index and CSV trial index they are off-by-one, this function is used once the index of the trial is know to prune it out of the CSV data set and recalculate the indexes.
 
function plot (in me, in select, in type, in seperateVars, in name, in handle)
 give a list of trials and it will plot both the raw eye position and the events
 
function clickMe (in src, in ignoredArg)
 
function spawnMe (in src, in ignoredArg)
 
function parseROI (in me)
 
function parseTOI (in me)
 
function plotROI (in me)
 
function clickMeROI (in src, in ignoredArg)
 
function plotTOI (in me)
 
function clickMeTOI (in src, in ignoredArg)
 
function get ppd (in me)
 
function fixVarNames (in me)
 
function removeRawData (in me)
 
function reparseVars (in me)
 
function plotNH (in me, in trial, in handle)
 
function explore (in me, in close)
 
function exploreNext (in src, in ignoredArg)
 
function explorePrevious (in src, in ignoredArg)
 
function exploreClose (in src, in ignoredArg)
 
- Public Member Functions inherited from analysisCore
function analysisCore (in varargin)
 Class constructor.
 
function checkPaths (in me, in varargin)
 checkPaths: if we've saved an object then load it on a new machine paths to source files may be wrong. If so then allows us to find a new directory for the source files.
 
function showEyePlots (in me, in varargin)
 showEyePlots if we have a linked eyelink file show the raw data plots
 
function showInfo (in me, in varargin)
 showInfo shows the info box for the plexon parsed data
 
function setStats (in me, in varargin)
 setStats set up the stats structure used in many Fieldtrip analyses
 
function set baselineWindow (in me, in in)
 
function optimiseSize (in me)
 optimiseSize remove the raw matrices etc. to reduce memory
 
function GUI (in me, in varargin)
 show a GUI if available for analysis object
 
function initialise (in me, in varargin)
 
function setTimeFreqOptions (in me, in varargin)
 setTimeFreqOptions for Fieldtrip time freq analysis of LFP data
 
- 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 fileName
 file name
 
Property trialStartMessageName
 which message contains the trial start tag
 
Property variableMessageName
 which message contains the variable name or value
 
Property trialEndMessage
 message name to signal end of the trial
 
Property rtStartMessage
 
Property rtEndMessage
 CSV message name to end the stimulus presentation or subject repsonse.
 
Property rtOverrideMessage
 override the rtStart time with a custom message?
 
Property minSaccadeDistance
 minimum saccade distance in degrees
 
Property VFAC
 relative velocity threshold
 
Property MINDUR
 minimum saccade duration
 
Property tS
 the temporary experiement structure which contains the eyePos recorded from opticka
 
Property excludeIncorrect
 exclude incorrect trials when indexing (trials contain an idx and correctedIdx value and you can use either)
 
Property ROI
 region of interest?
 
Property TOI
 time of interest?
 
Property verbose
 verbose output?
 
Property pixelsPerCm
 screen resolution
 
Property distance
 screen distance
 
Property resolution
 screen resolution
 
Property ETparams
 For Dee's analysis edit these settings.
 
Property relativeMarkers
 
Property SYNCTIME
 
Property END_FIX
 
Property END_RT
 
Property END_EXP
 
Property correctValue
 
Property incorrectValue
 
Property breakFixValue
 
Property trialsToPrune
 
Property rtLimits
 these are used for spikes spike saccade time correlations
 
Property rtDivision
 
Property trialOverride
 trial list from the saved behavioural data, used to fix trial name bug in old files
 
Property xCenter
 screen X center in pixels
 
Property yCenter
 screen Y center in pixels
 
Property override573
 57.3 bug override
 
Property downSample
 downsample the data for plotting
 
Property excludeTrials
 
- Public Attributes inherited from analysisCore
Property doPlots
 generate plots?
 
Property baselineWindow
 +- time window (s) for baseline estimation/removal [-0.2 0]
 
Property measureRange
 default range (s) to measure values from
 
Property plotRange
 default range to plot data
 
Property rootDirectory
 root directory to check for data if files can't be found
 
Property gd
 getDensity stats object, used for group comparisons
 
Property options
 various stats values in a structure for different analyses
 
Property openUI
 is the UI opened?
 
- 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 closeUI (in me, in varargin)
 
function makeUI (in me, in varargin)
 
function updateUI (in me, in varargin)
 
function notifyUI (in me, in varargin)
 
function parseEvents (in me)
 main parse loop for CSV events, has to be one big serial loop
 
function parseAsVars (in me)
 
function parseSecondaryEyePos (in me)
 
function parseFixationPositions (in me)
 
function toDegrees (in me, in in)
 
function toPixels (in me, in in)
 
function computeFullSaccades (in me)
 
function computeMicrosaccades (in me)
 
function vecvel (in xx, in SAMPLING, in TYPE)
 
function microsacc (in x, in vel, in VFAC, in MINDUR)
 
function binsacc (in sacl, in sacr)
 
function saccpar (in bsac)
 
function getTrialDef (in me)
 
- Protected Member Functions inherited from analysisCore
virtual function makeUI (in me)
 make the UI for the analysis object
 
virtual function closeUI (in me)
 close the UI for the analysis object
 
virtual function updateUI (in me)
 update the UI for the analysis object
 
function initialiseOptions (in me)
 initialise settings for fieldtrip time frequency analysis
 
function inheritPlxReader (in me, in p)
 Allows two analysis objects to share a single plxReader object. This is important in cases where for e.g. an LFPAnalysis object uses the same plexon file as its spikeAnalysis child used for spike-LFP anaysis.
 
function setSelection (in me, in in)
 set trials / var parsing from outside, override dialog, used when yoked to another analysis object, for example when spikeAnalysis is a child of LFPAnalysis
 
function initialiseStats (in me)
 initialise the statistics options, see setStats()
 
function formatByClass (in me, in dp, in dn)
 format data for ROC
 
function roc (in me, in data)
 ROC see http://www.subcortex.net/research/code/area_under_roc_curve.
 
function auc (in me, in data, in alpha, in flag, in nboot, in varargin)
 Area under ROC.
 
function aucBootstrap (in me, in data, in nboot, in flag, in H0)
 AUC bootstrap.
 
- 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

- Static Public Member Functions inherited from analysisCore
static function doFFT (in p, in fs, in ff, in normalise, in useHanning)
 phaseDifference basic phase diff measurement
 
static function phaseDifference (in x, in y)
 phaseDifference basic phase diff measurement
 
static function phase (in x)
 phase basic phase measurement
 
static function subselectFieldTripTrials (in ft, in idx)
 subselectFieldTripTrials sub-select trials where the ft function fails to use cfg.trials
 
static function findNearest (in in, in value)
 find nearest value in a vector, if more than 1 index return the first
 
static function linearFit (in x, in y)
 
static function var2SE (in var, in dof)
 convert variance to standard error
 
static function rad2ang (in alphain, in rect, in rot)
 
static function ang2rad (in alpha)
 
static function stderr (in data, in type, in onlyerror, in alpha, in dim, in avgfn)
 
static function areabar (in xv, in yv, in ev, in c1, in alpha, in varargin)
 
static function pupilConversion (in value, in cal, in calSize)
 
static function cellArray2Num (in data)
 
static function optimalLayout (in len)
 calculates preferred row col layout for multiple plots
 
static function optimalColours (in n_colors, in bg, in func)
 make optimally different colours for plots Copyright 2010-2011 by Timothy E. Holy
 
static function parsecolor (in s)
 
static function colorstr2rgb (in c)
 
- 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 analysisCore
Property panels
 UI panels.
 
Property yokedSelection
 do we yoke the selection to the parent object (e.g. LFPAnalysis > spikeAnalysis)
 
Property handles
 handles for the GUI
 
- 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

◆ iRecAnalysis()

function iRecAnalysis::iRecAnalysis ( in  varargin)

Member Function Documentation

◆ binsacc()

function iRecAnalysis::binsacc ( in  sacl,
in  sacr 
)
protected

◆ clickMe()

function iRecAnalysis::clickMe ( in  src,
in  ignoredArg 
)

◆ clickMeROI()

function iRecAnalysis::clickMeROI ( in  src,
in  ignoredArg 
)

◆ clickMeTOI()

function iRecAnalysis::clickMeTOI ( in  src,
in  ignoredArg 
)

◆ closeUI()

function iRecAnalysis::closeUI ( in  me,
in  varargin 
)
protected
Parameters

return

◆ computeFullSaccades()

function iRecAnalysis::computeFullSaccades ( in  me)
protected

◆ computeMicrosaccades()

function iRecAnalysis::computeMicrosaccades ( in  me)
protected

◆ explore()

function iRecAnalysis::explore ( in  me,
in  close 
)
Parameters

return

◆ exploreClose()

function iRecAnalysis::exploreClose ( in  src,
in  ignoredArg 
)

◆ exploreNext()

function iRecAnalysis::exploreNext ( in  src,
in  ignoredArg 
)

◆ explorePrevious()

function iRecAnalysis::explorePrevious ( in  src,
in  ignoredArg 
)

◆ fixVarNames()

function iRecAnalysis::fixVarNames ( in  me)
Parameters

return

◆ getTrialDef()

function iRecAnalysis::getTrialDef ( in  me)
protected

◆ load()

function iRecAnalysis::load ( in  me,
in  force 
)
Parameters

return

◆ makeUI()

function iRecAnalysis::makeUI ( in  me,
in  varargin 
)
protected
Parameters

return

◆ microsacc()

function iRecAnalysis::microsacc ( in  x,
in  vel,
in  VFAC,
in  MINDUR 
)
protected

◆ notifyUI()

function iRecAnalysis::notifyUI ( in  me,
in  varargin 
)
protectedvirtual
Parameters

return

Reimplemented from analysisCore.

◆ parse()

function iRecAnalysis::parse ( in  me)
Parameters

return

◆ parseAsVars()

function iRecAnalysis::parseAsVars ( in  me)
protected
Parameters

return

◆ parseEvents()

function iRecAnalysis::parseEvents ( in  me)
protected

main parse loop for CSV events, has to be one big serial loop

Parameters

return

◆ parseFixationPositions()

function iRecAnalysis::parseFixationPositions ( in  me)
protected
Parameters

return

◆ parseROI()

function iRecAnalysis::parseROI ( in  me)
Parameters

return

◆ parseSaccades()

function iRecAnalysis::parseSaccades ( in  me)

parse saccade related data

Parameters

return

◆ parseSecondaryEyePos()

function iRecAnalysis::parseSecondaryEyePos ( in  me)
protected
Parameters

return

◆ parseSimple()

function iRecAnalysis::parseSimple ( in  me)
Parameters

return

◆ parseTOI()

function iRecAnalysis::parseTOI ( in  me)
Parameters

return

◆ plot()

function iRecAnalysis::plot ( in  me,
in  select,
in  type,
in  seperateVars,
in  name,
in  handle 
)

give a list of trials and it will plot both the raw eye position and the events

Parameters

return

◆ plotNH()

function iRecAnalysis::plotNH ( in  me,
in  trial,
in  handle 
)
Parameters

return

◆ plotROI()

function iRecAnalysis::plotROI ( in  me)
Parameters

return

◆ plotTOI()

function iRecAnalysis::plotTOI ( in  me)
Parameters

return

◆ ppd()

function get iRecAnalysis::ppd ( in  me)
Parameters

return

◆ pruneNonRTTrials()

function iRecAnalysis::pruneNonRTTrials ( in  me)

remove trials from correct list that did not use a rt start or end message

Parameters

return

◆ pruneTrials()

function iRecAnalysis::pruneTrials ( in  me,
in  num 
)

prunetrials – very rarely (n=1) we lose a trial strobe in the plexon data and thus when we try to align the plexon trial index and CSV trial index they are off-by-one, this function is used once the index of the trial is know to prune it out of the CSV data set and recalculate the indexes.

Parameters

return

◆ removeRawData()

function iRecAnalysis::removeRawData ( in  me)
Parameters

return

◆ reparseVars()

function iRecAnalysis::reparseVars ( in  me)
Parameters

return

◆ saccpar()

function iRecAnalysis::saccpar ( in  bsac)
protected

◆ spawnMe()

function iRecAnalysis::spawnMe ( in  src,
in  ignoredArg 
)

◆ toDegrees()

function iRecAnalysis::toDegrees ( in  me,
in  in 
)
protected

◆ toPixels()

function iRecAnalysis::toPixels ( in  me,
in  in 
)
protected

◆ updateCorrectIndex()

function iRecAnalysis::updateCorrectIndex ( in  me,
in  idx 
)

update correct index list

Parameters

return

◆ updateUI()

function iRecAnalysis::updateUI ( in  me,
in  varargin 
)
protected
Parameters

return

◆ vecvel()

function iRecAnalysis::vecvel ( in  xx,
in  SAMPLING,
in  TYPE 
)
protected

Member Data Documentation

◆ breakFixValue

Property iRecAnalysis::breakFixValue

◆ correctValue

Property iRecAnalysis::correctValue

◆ distance

Property iRecAnalysis::distance

screen distance

◆ downSample

Property iRecAnalysis::downSample

downsample the data for plotting

◆ END_EXP

Property iRecAnalysis::END_EXP

◆ END_FIX

Property iRecAnalysis::END_FIX

◆ END_RT

Property iRecAnalysis::END_RT

◆ ETparams

Property iRecAnalysis::ETparams

For Dee's analysis edit these settings.

◆ excludeIncorrect

Property iRecAnalysis::excludeIncorrect

exclude incorrect trials when indexing (trials contain an idx and correctedIdx value and you can use either)

◆ excludeTrials

Property iRecAnalysis::excludeTrials

◆ fileName

Property iRecAnalysis::fileName

file name

◆ incorrectValue

Property iRecAnalysis::incorrectValue

◆ MINDUR

Property iRecAnalysis::MINDUR

minimum saccade duration

◆ minSaccadeDistance

Property iRecAnalysis::minSaccadeDistance

minimum saccade distance in degrees

◆ override573

Property iRecAnalysis::override573

57.3 bug override

◆ pixelsPerCm

Property iRecAnalysis::pixelsPerCm

screen resolution

◆ relativeMarkers

Property iRecAnalysis::relativeMarkers

Is measure range relative to start and end markers or absolute to start marker?

◆ resolution

Property iRecAnalysis::resolution

screen resolution

◆ ROI

Property iRecAnalysis::ROI

region of interest?

◆ rtDivision

Property iRecAnalysis::rtDivision

◆ rtEndMessage

Property iRecAnalysis::rtEndMessage

CSV message name to end the stimulus presentation or subject repsonse.

◆ rtLimits

Property iRecAnalysis::rtLimits

these are used for spikes spike saccade time correlations

◆ rtOverrideMessage

Property iRecAnalysis::rtOverrideMessage

override the rtStart time with a custom message?

◆ rtStartMessage

Property iRecAnalysis::rtStartMessage

the CSV message name to start measuring stimulus presentation, and this is the 0 time in the analysis by default, can be overridden by send SYNCTIME or rtOverrideMessage

◆ SYNCTIME

Property iRecAnalysis::SYNCTIME

◆ TOI

Property iRecAnalysis::TOI

time of interest?

◆ trialEndMessage

Property iRecAnalysis::trialEndMessage

message name to signal end of the trial

◆ trialOverride

Property iRecAnalysis::trialOverride

trial list from the saved behavioural data, used to fix trial name bug in old files

◆ trialStartMessageName

Property iRecAnalysis::trialStartMessageName

which message contains the trial start tag

◆ trialsToPrune

Property iRecAnalysis::trialsToPrune

◆ tS

Property iRecAnalysis::tS

the temporary experiement structure which contains the eyePos recorded from opticka

◆ variableMessageName

Property iRecAnalysis::variableMessageName

which message contains the variable name or value

◆ verbose

Property iRecAnalysis::verbose

verbose output?

◆ VFAC

Property iRecAnalysis::VFAC

relative velocity threshold

◆ xCenter

Property iRecAnalysis::xCenter

screen X center in pixels

◆ yCenter

Property iRecAnalysis::yCenter

screen Y center in pixels


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