Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
|
Public Member Functions | |
function | LFPAnalysis (in varargin) |
Constructor. | |
function | getFiles (in me, in force) |
getFiles loads the requisite files before parsing | |
function | parse (in me, in varargin) |
parse is the major first data parsing step. This performs all the steps from checking paths are still correct, parsing the Plexon events (our trial and behavioural data), parsing raw LFPs into the trial structures, and finally converting into a .ft fieldtrip structure. | |
function | reparse (in me, in varargin) |
reparse data after an initial parse, takes less time. | |
function | lazyParse (in me, in varargin) |
This only parses some data if there is no equivalent structure yet. | |
function | toggleSaccadeRealign (in me, in varargin) |
toggle between stimulus=0 and post-stimulus sccade=0 so we can align spikes and LFPs to either event | |
function | parseSpikes (in me, in varargin) |
This LFP object has a spikeAnalysis object as a property so we can use a different spike sort to the parent LFP plexon file. But we have to ensure that the spikeAnalysis is 'locked' or 'yoked' to the LFPAnalysis object settings and selection. This function makes surethis locking occurs... | |
function | useSpikeSelect (in me, in val) |
As we can also select trials from the spikeanalysis object, this function allows us to let the LFPAnalysis use the spikeanalysis selection. | |
function | getFieldTripLFPs (in me, in varargin) |
Parse the Plexon plxReader LFP data (itself parsed into trials) into a fieldtrip structure, stored in the .ft property and also returned to the commandline if needed. | |
function | ftPreProcess (in me, in cfg, in removeLineNoise) |
Uses the Fieldtrip preprocessing functions if need be. This modifies the .ft property structure but not the raw .LFP property. To undo these changes you must use the getFieldTripLFPs() method to regenerate .ft. | |
function | ftTimeLockAnalysis (in me, in cfg, in statcfg) |
Performs a FieldTrip timelock analysis on our parsed data. | |
function | ftBandPass (in me, in order, in downsample, in rectify) |
ftBandPass performs Leopold et al., 2003 type BLP | |
function | ftHilbert (in me) |
ftHilbert | |
function | ftAlphaPhase (in me) |
ftBandPass performs Leopold et al., 2003 type BLP | |
function | ftFrequencyAnalysis (in me, in cfg, in preset, in tw, in cycles, in smth, in width, in toi, in foi) |
function | ftFrequencyStats (in me, in name, in bline, in range) |
function | ftSpikeLFP (in me, in unit, in interpolate) |
function | plotTogether (in me, in varargin) |
function | plot (in me, in varargin) |
function get | nLFPs (in me) |
function get | nSelection (in me) |
function | save (in me, in varargin) |
saves this object as a MAT file, object renamed to 'lfp' | |
function | select (in me, in varargin) |
selects trials/options based on many filters | |
function | createSurrogate (in me, in varargin) |
replaces the LFP signals with a noisy surrogate to test, you can change the surrogate parameters in the code, including randomising phase and having a timelocked burst of a particular frequency to test time frequency algorithms etc. | |
function | makeSurrogate () |
function | plotSurrogates () |
function | chSpectrum (in me, in tapers) |
function set | demeanLFP (in me, in in) |
function set | LFPWindow (in me, in in) |
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 | lfpfile |
plexon file containing the LFP data | |
Property | spikefile |
plexon file containing the spike data | |
Property | dir |
data directory | |
Property | demeanLFP |
remove the mean voltage offset from the individual trials? | |
Property | selectedLFP |
default LFP channel | |
Property | LFPWindow |
time window around the trigger we wish to load | |
Property | selectedBehaviour |
default behavioural type | |
Property | verbose |
plot verbosity | |
Property | p |
LFP plxReader object. | |
Property | sp |
spike analysis object | |
Property | LFPs |
trial parsed LFPs | |
Property | ft |
fieldtrip structure parsed from .LFPs | |
Property | results |
fieldtrip parsed results | |
Property | selectedTrials |
selectedTrials: each cell is a trial list grouping | |
Property | cutTrials |
Property | map |
variable selection map for the analysis groups | |
Property | plotDestination |
external plot destination handle (see LFPMeta for an example) | |
Property | lastFrequencyMethod |
last freq method used | |
Property | bpfreq |
bandpass frequencies | |
Property | bpnames |
bandpass frequency names | |
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 | parseLFPs (in me) |
Parse the LFP signals into trial structures. | |
function | selectTrials (in me) |
selectTrials selects trials based on several filters | |
function | drawTrialLFPs (in me, in h, in sel) |
function | nextChannel (in src, in ignoredArg) |
function | previousChannel (in src, in ignoredArg) |
function | clickMe (in src, in ignoredArg) |
function | drawAverageLFPs (in me) |
function | drawTimelockLFPs (in me) |
function | drawContinuousLFPs (in me) |
function | forwardPlot (in src, in ignoredArg) |
function | backPlot (in src, in ignoredArg) |
function | drawSpikeLFP (in me) |
function | drawBandPass (in me) |
function | drawLFPFrequencies (in me, in varargin) |
function | drawLFPFrequencyStats (in me, in name) |
function | plotpowline (in f, in p, in e, in lc, in ec) |
function | runChronuxAnalysis (in me, in tapers) |
chSpectrum chronux spectrum equivalent | |
function | plot_matrix (in X, in t, in f, in plt, in Xerr, in zlims) |
function | plot_vector (in X, in f, in plt, in Xerr, in c, in w) |
function | getAverageTuningCurve (in me, in idx, in sel, in err) |
function | makeUI (in me, in varargin) |
function | runAnal (in src, in ignoredArg) |
function | togglePlots (in src, in ignoredArg) |
function | closeUI (in me, in varargin) |
function | updateUI (in me, in varargin) |
function | notifyUI (in me, in varargin) |
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. | |
Protected Attributes | |
Property | nLFPs |
number of LFP channels | |
Property | nSelection |
selected LFP channel | |
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 | |
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. | |
function LFPAnalysis::LFPAnalysis | ( | in | varargin | ) |
Constructor.
varargin | see parseArgs for more details |
|
protected |
function LFPAnalysis::chSpectrum | ( | in | me, |
in | tapers | ||
) |
return
|
protected |
|
protected |
return
function LFPAnalysis::createSurrogate | ( | in | me, |
in | varargin | ||
) |
replaces the LFP signals with a noisy surrogate to test, you can change the surrogate parameters in the code, including randomising phase and having a timelocked burst of a particular frequency to test time frequency algorithms etc.
return
function set LFPAnalysis::demeanLFP | ( | in | me, |
in | in | ||
) |
return
|
protected |
return
|
protected |
return
|
protected |
return
|
protected |
return
|
protected |
return
|
protected |
return
|
protected |
return
|
protected |
return
|
protected |
function LFPAnalysis::ftAlphaPhase | ( | in | me | ) |
ftBandPass performs Leopold et al., 2003 type BLP
order | of BP filter to use |
downsample | whether to down/resample after filtering |
rectify | whether to rectify the responses |
function LFPAnalysis::ftBandPass | ( | in | me, |
in | order, | ||
in | downsample, | ||
in | rectify | ||
) |
ftBandPass performs Leopold et al., 2003 type BLP
order | of BP filter to use |
downsample | whether to down/resample after filtering |
rectify | whether to rectify the responses |
function LFPAnalysis::ftFrequencyAnalysis | ( | in | me, |
in | cfg, | ||
in | preset, | ||
in | tw, | ||
in | cycles, | ||
in | smth, | ||
in | width, | ||
in | toi, | ||
in | foi | ||
) |
return
function LFPAnalysis::ftFrequencyStats | ( | in | me, |
in | name, | ||
in | bline, | ||
in | range | ||
) |
return
function LFPAnalysis::ftHilbert | ( | in | me | ) |
ftHilbert
order | of BP filter to use |
downsample | whether to down/resample after filtering |
rectify | whether to rectify the responses |
function LFPAnalysis::ftPreProcess | ( | in | me, |
in | cfg, | ||
in | removeLineNoise | ||
) |
Uses the Fieldtrip preprocessing functions if need be. This modifies the .ft property structure but not the raw .LFP property. To undo these changes you must use the getFieldTripLFPs() method to regenerate .ft.
cfg | a fieldtrip cfg structure |
removeLineNoise | a boolean to remove line noise |
function LFPAnalysis::ftSpikeLFP | ( | in | me, |
in | unit, | ||
in | interpolate | ||
) |
return
function LFPAnalysis::ftTimeLockAnalysis | ( | in | me, |
in | cfg, | ||
in | statcfg | ||
) |
Performs a FieldTrip timelock analysis on our parsed data.
return
|
protected |
return
function LFPAnalysis::getFieldTripLFPs | ( | in | me, |
in | varargin | ||
) |
Parse the Plexon plxReader LFP data (itself parsed into trials) into a fieldtrip structure, stored in the .ft property and also returned to the commandline if needed.
return ft fieldtrip structure
function LFPAnalysis::getFiles | ( | in | me, |
in | force | ||
) |
getFiles loads the requisite files before parsing
force | force us to ask for new filenames |
function LFPAnalysis::lazyParse | ( | in | me, |
in | varargin | ||
) |
This only parses some data if there is no equivalent structure yet.
return
function set LFPAnalysis::LFPWindow | ( | in | me, |
in | in | ||
) |
return
function LFPAnalysis::makeSurrogate | ( | ) |
|
protected |
return
|
protected |
function get LFPAnalysis::nLFPs | ( | in | me | ) |
return
|
protectedvirtual |
function get LFPAnalysis::nSelection | ( | in | me | ) |
return
function LFPAnalysis::parse | ( | in | me, |
in | varargin | ||
) |
parse is the major first data parsing step. This performs all the steps from checking paths are still correct, parsing the Plexon events (our trial and behavioural data), parsing raw LFPs into the trial structures, and finally converting into a .ft fieldtrip structure.
return
|
protected |
Parse the LFP signals into trial structures.
return
function LFPAnalysis::parseSpikes | ( | in | me, |
in | varargin | ||
) |
This LFP object has a spikeAnalysis object as a property so we can use a different spike sort to the parent LFP plexon file. But we have to ensure that the spikeAnalysis is 'locked' or 'yoked' to the LFPAnalysis object settings and selection. This function makes surethis locking occurs...
return
function LFPAnalysis::plot | ( | in | me, |
in | varargin | ||
) |
return
|
protected |
|
protected |
|
protected |
function LFPAnalysis::plotSurrogates | ( | ) |
function LFPAnalysis::plotTogether | ( | in | me, |
in | varargin | ||
) |
return
|
protected |
function LFPAnalysis::reparse | ( | in | me, |
in | varargin | ||
) |
reparse data after an initial parse, takes less time.
return
|
protected |
|
protected |
chSpectrum chronux spectrum equivalent
function LFPAnalysis::save | ( | in | me, |
in | varargin | ||
) |
saves this object as a MAT file, object renamed to 'lfp'
return
function LFPAnalysis::select | ( | in | me, |
in | varargin | ||
) |
selects trials/options based on many filters
return
|
protected |
selectTrials selects trials based on several filters
return
|
protected |
function LFPAnalysis::toggleSaccadeRealign | ( | in | me, |
in | varargin | ||
) |
toggle between stimulus=0 and post-stimulus sccade=0 so we can align spikes and LFPs to either event
return
|
protected |
return
function LFPAnalysis::useSpikeSelect | ( | in | me, |
in | val | ||
) |
As we can also select trials from the spikeanalysis object, this function allows us to let the LFPAnalysis use the spikeanalysis selection.
return
Property LFPAnalysis::bpfreq |
bandpass frequencies
Property LFPAnalysis::bpnames |
bandpass frequency names
Property LFPAnalysis::cutTrials |
trials to remove in reparsing. Our raw data plot allows us to visually remove trials, we can also call fieldtrip preprocessing code too.
Property LFPAnalysis::demeanLFP |
remove the mean voltage offset from the individual trials?
Property LFPAnalysis::dir |
data directory
Property LFPAnalysis::ft |
fieldtrip structure parsed from .LFPs
Property LFPAnalysis::lastFrequencyMethod |
last freq method used
Property LFPAnalysis::lfpfile |
plexon file containing the LFP data
LFPAnalysis Wraps native and fieldtrip analysis around our PLX/PL2 reading, taking our trial selection and behavioural selection into account. As we can do spike-LFP anaysis this asks for a spike data file, it can be the same as the LFP file or different if we resorted the data.
Property LFPAnalysis::LFPs |
trial parsed LFPs
Property LFPAnalysis::LFPWindow |
time window around the trigger we wish to load
Property LFPAnalysis::map |
variable selection map for the analysis groups
|
protected |
number of LFP channels
|
protected |
selected LFP channel
Property LFPAnalysis::p |
LFP plxReader object.
Property LFPAnalysis::plotDestination |
external plot destination handle (see LFPMeta for an example)
Property LFPAnalysis::results |
fieldtrip parsed results
Property LFPAnalysis::selectedBehaviour |
default behavioural type
Property LFPAnalysis::selectedLFP |
default LFP channel
Property LFPAnalysis::selectedTrials |
selectedTrials: each cell is a trial list grouping
Property LFPAnalysis::sp |
spike analysis object
Property LFPAnalysis::spikefile |
plexon file containing the spike data
Property LFPAnalysis::verbose |
plot verbosity