NeuroAnalysis - Neural Signal Analysis
API Reference
NeuroAnalysis.ColorMaps
— ConstantPredefined ColorMaps
NeuroAnalysis.CondDCh
— ConstantDefault digital input channels
NeuroAnalysis.SecondPerUnit
— ConstantTime Unit set to millisecond by default.
Base.range
— MethodGenerates linearly interpolated colors between key colors inclusively.
return an Array
of colors.
NeuroAnalysis.alphablend
— Methodalpha weighted average of foreground and background colors
NeuroAnalysis.alphamask
— MethodMasking alpha channel of an image, match the implementation in Experica
shaders.
NeuroAnalysis.assignlayer
— MethodTry to locate cell's layer.
- coordinate of cell on the axis perpendicular to layers
- layers definition
NeuroAnalysis.bandmean
— MethodWeighted average of banded masked matrix
NeuroAnalysis.cas
— Method2D cas
function defined as $cas(x+y) = cos(x+y) + sin(x+y)$
- kx: Frequency in cycle/unit_x
- ky: Frequency in cycle/unit_y
- phase: Phase of a cycle in [0, 1] scale
- isnorm: scale
cas
in [-√2, √2] to [-1, 1]
NeuroAnalysis.cas
— Methodcas
function defined as $cas(x) = cos(x) + sin(x)$
- f: Frequency in cycle/unit_x
- phase: Phase of a cycle in [0, 1] scale
- isnorm: scale
cas
in [-√2, √2] to [-1, 1]
NeuroAnalysis.cas2sin
— Method2D cas
to 2D sin gratingf
NeuroAnalysis.cas2sin
— Methodcas
phase to sin
phase, phase is in [0, 1] scale
$cas(x) = √2 sin(x + π/4)$
NeuroAnalysis.checklayer!
— MethodCheck layer boundaries, make sure no gap and overlap between layers. Layers are reversely ordered in layer names in ln
, and start boundary is set to the same as the stop boundary of previous layer.
NeuroAnalysis.checkprojection!
— MethodCheck projection consistency, choose among duplicates and conflicts with maximum extrema
NeuroAnalysis.chmasknp
— MethodLogical mask for Neuropixels
channels in probe shape 1 2 3 4 5 6 ...
NeuroAnalysis.chpositionnp
— Functionprobe shape channel positions
NeuroAnalysis.chshapenp
— MethodMap linear channel index to probe shape indices
NeuroAnalysis.circtuningfeature
— MethodProperties of Circular Tuning
- Prefered Angle with Peak Response
- Half Width at Half Peak-to-Trough
- Selectivity Index
- version 1: (PeakResponse - OpposingResponse) / PeakResponse
- version 2: (PeakResponse - OpposingResponse) / (PeakResponse + OpposingResponse)
- x: angles in radius
- y: responses
- od: opposing angle distance to prefered angle, e.g. π for DSI, 0.5π for OSI
- fn: factor name
NeuroAnalysis.clamproi
— MethodConfine ROI(odd pixels) so that it is not out of the image
NeuroAnalysis.clampscale
— Methodclamp x
value in median ± nsd*sd
, and linearly map the range to [0, 1]
NeuroAnalysis.clampscale
— Methodclamp x
value in [min, max]
, and linearly map range [min, max]
to [0, 1]
NeuroAnalysis.clampscale
— Methodclamp x
value in extrema(x)
, and linearly map the range to [0, 1]
NeuroAnalysis.clampscale
— Methodclamp x
value in [percentile(low),percentile(high)]
, and linearly map the range to [0, 1]
NeuroAnalysis.coherencespectrum
— MethodMulti-Taper channel pair-wise coherence spectrum estimation
NeuroAnalysis.complexmap
— MethodComplex sumation of angles and corresponding image responses
- image response for each angle
- angles in radius
- nsd: median ± nsd*sd for clamping
- rsign: increasing/decreasing(+/-) response
- mnorm: whether clampscale magnitude map
return complex map, angle map[0,2π) and magnitude map([0,1] if mnorm)
NeuroAnalysis.condfactor
— MethodGet factor names excluding reserved names
NeuroAnalysis.condin
— MethodFind unique conditions of condition tests, with number of repeat for each condition and condition test indices for each repeat.
NeuroAnalysis.condresponse
— MethodGet Mean
and SEM
of repeated responses for each condition
- rs: response of each condition test
- ci: condition test indices of repeats for each condition
NeuroAnalysis.condresponse
— MethodGet Mean
and SEM
of repeated image responses for each condition
- rs: response of each condition test [height, width, ncondtest]
- ci: condition test indices of repeats for each condition
NeuroAnalysis.condstring
— MethodString representation of a condition
NeuroAnalysis.condtest
— MethodGet CondTest
DataFrame
NeuroAnalysis.condtestcond
— MethodGet CondTestCond
DataFrame
NeuroAnalysis.correlogram
— MethodNormalized(coincidence/spike), condition and trial averaged Cross-Correlogram of two simultaneous binary spike sequences (bins x trials).
Correction:
(shuffle=true), "all-way" nonsimultaneous trials shuffle(default)
(Bair, W., Zohary, E., and Newsome, W.T. (2001). Correlated Firing in Macaque Visual Area MT: Time Scales and Relationship to Behavior. J. Neurosci. 21, 1676-1697.)
(shufflejitter=true, l=25), shuffle jittered spikes across trials in consecutive intervals of length l ms
(Smith, Matthew A., and Adam Kohn (2008). Spatial and Temporal Scales of Neuronal Correlation in Primary Visual Cortex. J. Neurosci. 28.48 : 12591-12603.)
NeuroAnalysis.correlogramprojection
— Methodestimate projections among simultaneously recorded spiking units based on cross-correlogram
NeuroAnalysis.csd
— Function1D Current Source Density for voltage traces from a equidistant linear array of electrodes.
data: ch x sample or ch x sample x epoch(volts)
method:
CSD: finite difference approximation of second spatial derivatives of potentials, C = - ∇⋅σ∇ϕ, σ is conductivity tensor, ϕ is potential. (Nicholson & Freeman, 1975, J Neurophysiol, 38(2): 356-68)
iCSD: solve C -> ϕ forward model, then get Ĉ by the inverse transformation matrix, here C is modeled by δ-source, i.e. infinitely thin current source disc of radius r. (Petterson et al., 2006, J Neurosci Methods, 154(1-2):116-33)
kCSD: kernal CSD ()
h: channel spacing(micrometer)
c: conductivity of extracellular medium(siemans/meter)
r: radius(micrometer) of δ-source
return: CSD(amps/meter^3)
NeuroAnalysis.ctctc
— MethodGet CondTest
and CondTestCond
DataFrame
NeuroAnalysis.dft
— MethodDiscrete Fourier Transform at frequencies
\[DFT[k] = \sum_{n=0}^{N-1} x[n] e^{\frac{-i2\pi kn}{N}}, k=0:N-1, N=length(x), fₛ=SamplingFreq(x), fₖ=fₛ/N=FreqResolution(DTFT)\]
- x: signal
- fs: simpling frequency of signal
- f...: at which frequencies DFT are directly evaluated
NeuroAnalysis.digitalbit
— MethodParse bit event time and value.
NeuroAnalysis.digitaldata
— MethodGet digital channel time and value.
NeuroAnalysis.dirsigtest
— MethodDirection tuning significance using dot product with empirical orientation preference This function calculates the probability that the "true" direction tuning vector of a neuron has non-zero length. It performs this by empirically determing the unit orientation vector, and then computing the dot product of the direction vector for each trial onto the overall orientation vector, and then looking to see if the average is non-zero.
Inputs: ANGLES is a vector of direction angles at which the response has been measured. RATES is the response of the neuron in to each angle; each row should contain responses from a different trial. Output: P the probability that the "true" direction tuning vector is non-zero.
See: Mazurek, Kagan, Van Hooser 2014; Frontiers in Neural Circuits
NeuroAnalysis.dogcontour
— Methodconcentric circular dog contour
NeuroAnalysis.dogenvelope
— Method2D concentric circular dog envelope
NeuroAnalysis.dogenvelopemask
— Method2D concentric circular dog envelope binary mask
NeuroAnalysis.dogf
— Method2D Difference of Gaussians
function
NeuroAnalysis.dogf
— MethodDifference of Gaussians
function
NeuroAnalysis.dropmatdim!
— MethodDrop array dims according to MATLAB
convention.
- scalar: scalar instead of 1x1 array
- rvector: vector instead of 1xN array
- cvector: vector instead of Nx1 array
NeuroAnalysis.edogcontour
— Methodconcentric orientated elliptical dog contour
NeuroAnalysis.edogenvelope
— Method2D concentric orientated elliptical dog envelope
NeuroAnalysis.edogenvelopemask
— Method2D concentric orientated elliptical dog envelope binary mask
NeuroAnalysis.ellipsef
— MethodEllipse
function
NeuroAnalysis.epoch2sampleindex
— MethodConvert epochs in time to sample index
NeuroAnalysis.epochsample
— MethodEpochs of Channel Sample.
NeuroAnalysis.epochsamplenp
— MethodEpochs of Neuropixels
data stream (Channels x Samples), optionally gain corrected(voltage), line noise(60,120,180Hz) removed, bandpass filtered and common average referenced
NeuroAnalysis.epochspiketrain
— MethodEpochs of a Spike Train in between binedges
NeuroAnalysis.epochspiketrain
— MethodEpoch of a Spike Train x
, where min <= x[i] < max
.
kwargs isminzero
, ismaxzero
and shift
set epoch zero value to min+shift
or max+shift
.
return:
- y: epoch of the Spike Train
- n: number of elements in the epoch, or divided by duration(max-min) of the epoch, based on kwargs
israte
- w: epoch window(min,max)
- i: indices of epoch elements in the original Spike Train, such that y = x[i]
See also: epochspiketrains
, epochspiketrainresponse
NeuroAnalysis.epochspiketrainresponse
— MethodResponse of each epoch of a Spike Train, could be mean firing rate or number of spikes based on kwarg israte
.
See also: epochspiketrainresponse_ono
NeuroAnalysis.epochspiketrainresponse_ono
— MethodResponse of each epoch of a Spike Train, could be mean firing rate or number of spikes based on kwarg israte
.
This is a faster(~500x) version compared to epochspiketrainresponse
, but only works when x
, mins
and maxs
are ascendingly ordered, and each maxs-mins
range are none-overlapping.
NeuroAnalysis.epochspiketrains
— MethodEpochs for each Spike Trains
NeuroAnalysis.exchmasknp
— MethodLogical mask for Neuropixels
excluded channels in probe shape
NeuroAnalysis.exd
— Methodextrema value of max abs amplitude and it's delay index
NeuroAnalysis.expericafileregex
— MethodRegular Expression to match Experica
data file name
NeuroAnalysis.f1orisf
— MethodEstimate the F1 Ori and SpatialFreq of an image from its 2D powerspectrum.
- x: 2D powerspectrum
- freq1: frequencies of dim 1
- freq2: frequencies of dim 2
return:
- ori: Orientation in radius[0,π), 0 is -, increase counter-clock wise
- sf: SpatialFreq along the line perpendicular to ori
NeuroAnalysis.factoraxis
— MethodGet each factor name and its levels as the axes of factor space
NeuroAnalysis.factorresponse
— MethodGet Mean
and SEM
of repeated responses for each condition in factor space
- rs: response of each condition test
- fi: condition test indices of repeats for each condition in factor space
NeuroAnalysis.factorresponsefeature
— MethodTuning properties of factor response
fl: factor levels
fr: factor responses for each level
Angle, Orientation and Direction follow the same convention such that 0 is -/→, then increase counter-clock wise.
For cases where Orientation and Direction are interlocked(drifting grating):
- when Orientation is -(0), then Direction is ↑(90)
- when Direction is →(0), then Orientation is |(-90)
NeuroAnalysis.factorspace
— MethodMap a variable of conditions into factor space
NeuroAnalysis.fill2mask
— Methodfill data in the shape of mask, where masked channels are replaced with local average
NeuroAnalysis.finalfactor
— MethodExclude Non-Final version of factor names
NeuroAnalysis.findclosestangle
— Methodfind closest angle distance and its index in α, between α and every β. (α and β in radius)
NeuroAnalysis.findcond
— MethodFind condition index with kwargs: Factor = level
NeuroAnalysis.fitmodel
— MethodFit 1D model to data
NeuroAnalysis.fitmodel2
— MethodFit 2D model to image
NeuroAnalysis.flatspiketrains
— MethodFlat Spike Trains to Vector of SpikeTimes and Trials
NeuroAnalysis.flatspiketrains
— MethodFlat Spike Trains to Vector of SpikeTimes and Trials
NeuroAnalysis.flin
— MethodFind unique levels for each factor from condition tests, with number of repeat for each level and condition test indices for each repeat.
NeuroAnalysis.frameresponse
— MethodGet single frame response from sequence of frames
- frames: [Height, Width, nframe]
- is: indices of response frames
- bis: indices of baseline response frames
NeuroAnalysis.gaborcontour
— Methodgabor
contour
NeuroAnalysis.gaborenvelope
— Method2D gabor
envelope
NeuroAnalysis.gaborenvelopemask
— Method2D gabor
envelope binary mask
NeuroAnalysis.gaborf
— Method2D Gabor
function
NeuroAnalysis.gaborf
— MethodGabor
function
NeuroAnalysis.gaincorrectnp
— MethodConvert raw Neuropixels
data to gain-corrected voltages. The saved-channel id subset in data will be used to get corresponding gain.
The full conversion with gain is:
$dataVolts = dataInt * fi2v / gain$
Note that each channel may have its own gain.
- y: the saved data stream, excluding the last Sync channel.
- meta: corresponding meta for y
NeuroAnalysis.gaussiancontour
— MethodGaussian
contour
NeuroAnalysis.gaussianenvelope
— Method2D Gaussian
envelope
NeuroAnalysis.gaussianenvelopemask
— Method2D Gaussian
envelope binary mask
NeuroAnalysis.gaussianf
— Method2D Gaussian
function
NeuroAnalysis.gaussianf
— MethodGaussian
function
NeuroAnalysis.getdatafile
— MethodGet matched file names in path
NeuroAnalysis.getexpericafile
— MethodGet matched Experica
files in directory
NeuroAnalysis.getoifile
— MethodGet Optical Imaging VDAQ
matched files in directory
NeuroAnalysis.goodnessoffit
— MethodGoodness of Fit Metrics:
- r: Pearson Correlation Coefficient
- mae: Mean Absolute Error
- rmse: Root Mean Squared Error
- rae: Relative Absolute Error
- rse: Relative Squared Error
- r2: R Squared
- adjr2: Adjusted-R²
- s: Residual Standard Error
- aic: Akaike Information Criterion
- bic: Bayesian Information Criterion
- y: responses
- ŷ: model predictions
- n: sample size
- e: errors(y - ŷ)
- k: number of model parameters
- df: degree of freedom(n - k)
NeuroAnalysis.grating
— MethodGenerate Grating Image, match the implementation in Experica
grating shader.
- θ: Orientation (radius), 0 is -, increase counter-clock wise
- sf: SpatialFreq (cycle/deg)
- tf: TemporalFreq (cycle/sec)
- t: Time (second)
- phase: Phase of a cycle in [0, 1] scale
- size: Tuple of image size in degree
- ppd: pixel per degree
- isnorm: return image in [0, 1] or [-1, 1]
NeuroAnalysis.gratingf
— Method2D sin
grating function
- μ₁: x offset
- μ₂: y offset
- θ: Orientation in radius, 0 is -, increase counter-clock wise
- f: Frequency in cycle/unit_distance orthogonal to orientation
- phase: Phase of a cycle in [0, 1] scale
NeuroAnalysis.gratingf
— Methodsin
grating function
- μ: x offset
- f: Frequency in cycle/unit_x
- phase: Phase of a cycle in [0, 1] scale
NeuroAnalysis.gvmf
— MethodGeneralized von Mises
function [1]
\[f(α) = βe^{κ₁cos(α - μ₁) + κ₂cos2(α - μ₂)}\]
Gatto, R., and Jammalamadaka, S.R. (2007). The generalized von Mises distribution. Statistical Methodology 4, 341–353.
NeuroAnalysis.halfwidth
— Methodleft and right half width at v
around y[ci]
, -Inf/Inf when no v
is found.
- ci: index of
y
at which the center of the width locates - v: value on
y
where width is cut - circ: whether
y
is defined on circular domain and thus width can wrap around - x: domain of
y
, return width whenx
provided, otherwise return indices
NeuroAnalysis.hartley
— MethodGenerate gratings in Hartley space (PL)
- kx, ky: wavenumber along x, y axis
- bw: black and white (phase) flip
- stisize: stimulus size in visual angle (degree); note that sz[1]=sz[2]
if norm=true,Return image in [0,1], otherwise return image in [-1,1]
NeuroAnalysis.hartleysubspace
— MethodGenerate Hartley Subspace, where k is frequency in cycle/unit_x/y. [1]
- kbegin: k >= kbegin
- kend: k <= kend
- dk: Δk, step on k axis
- phase: phase in [0, 1] scale, default 0.
- shape:
:square
or:circle
shape subspace - addhalfcycle: add half cycle shifted hartleys
- blank: the element of hartley as blank, default uniform gray.
- nblank: number of blanks to add
Ringach, D.L., Sapiro, G., and Shapley, R. (1997). A subspace reverse-correlation technique for the study of visual neurons. Vision Research 37, 2455–2464.
NeuroAnalysis.hlpass
— MethodHigh pass and low pass filtering
NeuroAnalysis.hotellingt2test
— FunctionHotelling's T-Squared test for one multivariate sample.
Performs Hotelling's T^2 test on multivariate samples X to determine if the data have mean MU. X should be a NxP matrix with N observations of P-dimensional data, and the mean MU to be tested should be 1xP. the significance level α is 0.05 by default.
H is 1 if the null hypothesis (that the mean of X is equal to MU) can be rejected at significance level α. P is the actual P value.
The code is based on HotellingT2.m by A. Trujillo-Ortiz and R. Hernandez-Walls.
NeuroAnalysis.ismodulative
— MethodCheck if any group in response
is significently different from at least one other group in response
NeuroAnalysis.isresponsive
— MethodCheck if fun
of a spatial-temporal kernal within response time window significently higher than that of the baseline time window
NeuroAnalysis.isresponsive
— MethodCheck if any sub group of response
is significently different from baseline
by Wilcoxon Signed Rank Test
NeuroAnalysis.isresponsive
— MethodCheck if response
is significently different from baseline
by Wilcoxon Signed Rank Test
NeuroAnalysis.loadimageset
— MethodLoad images in directory
NeuroAnalysis.localcoherence
— FunctionWeighted average of local channel pair coherences for each channel
NeuroAnalysis.localcontrast
— Methodlocal contrast of each image, highlighting local structure regions
NeuroAnalysis.localpairweight
— Methodlocal channel pairs and gaussian weights within a circle centered for each channel
NeuroAnalysis.maptodatatime
— MethodMap time to data timeline, optionally add latency.
NeuroAnalysis.matchfile
— MethodGet matched file names in directory, optionally join directory to get file path
NeuroAnalysis.matdictarray2df
— Methodconvert Matlab
struct of array to DataFrame
NeuroAnalysis.mdsd
— FunctionWeighted average of SD and Absolute Deviation of MEAN relative to Baseline
NeuroAnalysis.meanse
— MethodMean
and SEM
of an Array along dims
, optionally apply sfun
on each slice along dims
before and mfun
on mean after.
NeuroAnalysis.normalized
— MethodNormalize values of an array to be between -1 and 1
original sign of the array values is maintained.
NeuroAnalysis.oifileregex
— MethodRegular Expression to match Optical Imaging VDAQ
block file name
NeuroAnalysis.pairtest
— MethodHypothesis test for pair of samples
- rs1: sample 1 [Height, Width, nsample1]
- rs2: sample 2 [Height, Width, nsample2]
NeuroAnalysis.pairtest
— MethodHypothesis test for pair of repeated condition responses
- rs: condition test responses [Height, Width, ncondtest]
- i1: indices of repeated responses for first condition
- i2: indices of repeated responses for second condition
NeuroAnalysis.pairtest
— MethodHypothesis test for pair of samples
- rs1: sample 1, Vector of Matrix
- rs2: sample 2, Vector of Matrix
NeuroAnalysis.parsedigitalinanalog
— FunctionGet digital rising and falling edges in a analog stream return di: edges index dv: edges active/inactive state
NeuroAnalysis.peakroi
— MethodROI(odd pixels) encompass peak value and its delay index
NeuroAnalysis.plotanalog
— MethodPlot Analog Signals
NeuroAnalysis.plotcondresponse
— MethodPlot Mean
and SEM
of repeated responses for each condition
NeuroAnalysis.plothartleysubspace
— Methodplot hartley subspace
NeuroAnalysis.plotspiketrain
— Methodscatter plot of spike trains
NeuroAnalysis.plotspiketrain
— Methodscatter plot of spikes
NeuroAnalysis.poissonspiketrain
— MethodGenerate a Homogeneous Poisson Spike Train
NeuroAnalysis.poissonspiketrain
— MethodGenerate a Inhomogeneous Poisson Spike Train
NeuroAnalysis.powerspectrum
— MethodMulti-Taper power spectrum estimation
NeuroAnalysis.powerspectrum2
— Method2D powerspectrum of an image.
NeuroAnalysis.powerspectrums2
— Method2D powerspectrums of images in same size.
NeuroAnalysis.prepare
— MethodRead and Prepare Dataset in MATLAB
MAT File
NeuroAnalysis.prepare_experica!
— MethodPrepare Experica
Experiment Data
NeuroAnalysis.prepare_oi!
— MethodPrepare Optical Imaging
Block Data
NeuroAnalysis.prepare_ripple!
— MethodPrepare Ripple
Data
NeuroAnalysis.projectionfromcorrelogram
— Methodputative {0, 1, 2} number of excitatory and inhibitory projections between two spiking units based on cross-correlogram
NeuroAnalysis.psthspiketrains
— MethodPSTH of Spike Trains
NeuroAnalysis.readmat
— MethodRead variables of a MATLAB
MAT file into a Dictionary
- f: MAT file path
- vars: variable names in the varset to read
- varset: variable names to select in vars
- scalar: scalar instead of 1x1 matrix
- rvector: vector instead of 1xN matrix
- cvector: vector instead of Nx1 matrix
NeuroAnalysis.readmeta
— MethodRead DataExport
Metadata MAT File
NeuroAnalysis.readrawim_Mono8
— MethodRead list of files encoding raw mono 8bit image
NeuroAnalysis.ref2sync
— FunctionMap time between ref and target, according to the timing diff between target and ref of the same sync signal
NeuroAnalysis.refchmasknp
— MethodLogical mask for Neuropixels
reference channels in probe shape
NeuroAnalysis.rmline
— MethodRemove line noise and its harmonics by notch filter
NeuroAnalysis.roccurve
— MethodThis function calculates the ROC curve, which represents the 1-specificity and sensitivity of two classes of data, (i.e., class1 and class2).
The function also returns all the needed quantitative parameters: threshold position, distance to the optimum point, sensitivity, specificity, accuracy, area under curve (AROC), positive and negative predicted values (PPV, NPV), false negative and positive rates (FNR, FPR), false discovery rate (FDR), false omission rate (FOR), F1 score, Matthews correlation coefficient (MCC), Informedness (BM) and Markedness; as well as the number of true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN).
Rewrite from Víctor Martínez-Cagigal (2020). ROC Curve, MATLAB Central File Exchange. Retrieved February 11, 2020.
NeuroAnalysis.roiwindow
— MethodGet ROI(odd pixels) from region indices
NeuroAnalysis.sampleindex2time
— Methodsample index to time
NeuroAnalysis.sbxexd
— MethodFind the extreme value
NeuroAnalysis.sbxjoinhartleyFourier
— MethodPeichao:
Join the results from differernt Hartleys after hartleyFourier analysis
NeuroAnalysis.sbxpeakroi
— Methodpeak ROI region and its delay
NeuroAnalysis.searchclosest
— Methodsearch in vs
the index of the value closest to v
, -Inf/Inf when no v
is found.
- start: starting index in
vs
for searching - step: index stepping(≠0) for searching
- circ: whether
vs
is defined on circular domain and thus searching can wrap around
NeuroAnalysis.sftuningfeature
— MethodProperties of Spatial Frequency Tuning
- Prefered Spatial Frequency with Peak Response
- Half Width at Half Peak-to-Trough
- Frequency Passing Type {A:All Pass, H:High Pass, L:Low Pass, B:Band Pass}
- Bandwidth $log2(H_{cut}/L_{cut})$
- Frequency Passwidth at Half Peak-to-Trough constrained by
low/high
frequency limits
- x: sf in cycle/degree
- y: responses
NeuroAnalysis.shufflejitter
— MethodThe probability distribution of the jitter-resampled spike sequences.
(Xiaoxuan Jia, et.al. (2022). Multi-regional module-based signal transmission in mouse visual cortex)
(Matthew T. Harrison, Stuart Geman (2009). A Rate and History-Preserving Resampling Algorithm for Neural Spike Trains. Neural Comput. 21 (5): 1244-1258.)
(Smith, Matthew A., Adam Kohn (2008). Spatial and Temporal Scales of Neuronal Correlation in Primary Visual Cortex. J. Neurosci. 28.48 : 12591-12603.)
NeuroAnalysis.shufflejitter
— MethodShuffle spikes of bined(1ms) spike trains bst
(nbin x ntrial) between trials in fixed jitter windows of length l
(>0ms)
(Smith, Matthew A., and Adam Kohn (2008). Spatial and Temporal Scales of Neuronal Correlation in Primary Visual Cortex. J. Neurosci. 28.48 : 12591-12603.)
NeuroAnalysis.sin2cas
— Method2D sin gratingf
to 2D cas
NeuroAnalysis.sin2cas
— Methodsin
phase to cas
phase, phase is in [0, 1] scale
$cas(x) = √2 sin(x + π/4)$
NeuroAnalysis.spikejitter
— MethodIndependently and uniformly jitters the spike times in st
over jitter windows of length l
(>0). This is repeated n
times with the kth
jittered spike train stored in jst[:,k]
.
- win:
- :center - the jitter window for st[k] is st[k] + [-l/2, l/2]
- :fix - the jitter window for st[k] is floor(st[k]/l)*l + [0, l]
- sort: if sorting jittered spike trains
NeuroAnalysis.sta
— MethodSpike Triggered Average of Images based on linear model of response,
\[yᵢ = KᵀXᵢ + ϵᵢ, ϵᵢ ~ N(0, σ²)\]
then the maximum likelihood estimator and least square estimator have the same analytical form.
\[K̂ₘₗ = argmax[P(Y|X,K)] = (XᵀX)⁻¹XᵀY = K̂ₗₛ\]
- x: Matrix where each row is one image
- y: Vector of image response
- norm: normalization factor, default no normalization. it could be $sum(y)$ if y is number of spike or spike rate, then STA would be spiking probability.
- whiten: whiten factor, default no whiten. it could be $(XᵀX)⁻¹$ or inverse of covariance matrix, that decorrelate STA.
NeuroAnalysis.statetime
— MethodExtract state time of condtest
NeuroAnalysis.stfilter
— MethodSpatial and Temporal filter of data stream
NeuroAnalysis.time2sampleindex
— Methodtime to sample index
NeuroAnalysis.unitspike_kilosort
— MethodOrganize each spiking unit from Kilosort
result.
NeuroAnalysis.unitspike_kilosort3
— MethodOrganize each spiking unit from Kilosort3
result.
NeuroAnalysis.vlabregex
— MethodRegular expression to match VLab
data file names
NeuroAnalysis.vmf
— Methodvon Mises
function [1]
\[f(α) = βe^{κ(cos(n(α - μ)) - 1)}\]
- β: amplitude at μ
- μ: angle of peak
- κ: width parameter
- n: frequency parameter
Swindale, N.V. (1998). Orientation tuning curves: empirical description and estimation of parameters. Biol Cybern 78, 45–56.
PlotUtils.cgrad
— MethodGenerates linearly interpolated ColorGradient
PlotUtils.cgrad
— MethodGenerates linearly interpolated ColorGradient
between key colors.
Index
NeuroAnalysis.ColorMaps
NeuroAnalysis.CondDCh
NeuroAnalysis.SecondPerUnit
NeuroAnalysis.alphablend
NeuroAnalysis.alphamask
NeuroAnalysis.assignlayer
NeuroAnalysis.bandmean
NeuroAnalysis.cas
NeuroAnalysis.cas
NeuroAnalysis.cas2sin
NeuroAnalysis.cas2sin
NeuroAnalysis.checklayer!
NeuroAnalysis.checkprojection!
NeuroAnalysis.chmasknp
NeuroAnalysis.chpositionnp
NeuroAnalysis.chshapenp
NeuroAnalysis.circtuningfeature
NeuroAnalysis.clamproi
NeuroAnalysis.clampscale
NeuroAnalysis.clampscale
NeuroAnalysis.clampscale
NeuroAnalysis.clampscale
NeuroAnalysis.coherencespectrum
NeuroAnalysis.complexmap
NeuroAnalysis.condfactor
NeuroAnalysis.condin
NeuroAnalysis.condresponse
NeuroAnalysis.condresponse
NeuroAnalysis.condstring
NeuroAnalysis.condtest
NeuroAnalysis.condtestcond
NeuroAnalysis.correlogram
NeuroAnalysis.correlogramprojection
NeuroAnalysis.csd
NeuroAnalysis.ctctc
NeuroAnalysis.dft
NeuroAnalysis.digitalbit
NeuroAnalysis.digitaldata
NeuroAnalysis.dirsigtest
NeuroAnalysis.dogcontour
NeuroAnalysis.dogenvelope
NeuroAnalysis.dogenvelopemask
NeuroAnalysis.dogf
NeuroAnalysis.dogf
NeuroAnalysis.dropmatdim!
NeuroAnalysis.edogcontour
NeuroAnalysis.edogenvelope
NeuroAnalysis.edogenvelopemask
NeuroAnalysis.ellipsef
NeuroAnalysis.epoch2sampleindex
NeuroAnalysis.epochsample
NeuroAnalysis.epochsamplenp
NeuroAnalysis.epochspiketrain
NeuroAnalysis.epochspiketrain
NeuroAnalysis.epochspiketrainresponse
NeuroAnalysis.epochspiketrainresponse_ono
NeuroAnalysis.epochspiketrains
NeuroAnalysis.exchmasknp
NeuroAnalysis.exd
NeuroAnalysis.expericafileregex
NeuroAnalysis.f1orisf
NeuroAnalysis.factoraxis
NeuroAnalysis.factorresponse
NeuroAnalysis.factorresponsefeature
NeuroAnalysis.factorspace
NeuroAnalysis.fill2mask
NeuroAnalysis.finalfactor
NeuroAnalysis.findclosestangle
NeuroAnalysis.findcond
NeuroAnalysis.fitmodel
NeuroAnalysis.fitmodel2
NeuroAnalysis.flatspiketrains
NeuroAnalysis.flatspiketrains
NeuroAnalysis.flin
NeuroAnalysis.frameresponse
NeuroAnalysis.gaborcontour
NeuroAnalysis.gaborenvelope
NeuroAnalysis.gaborenvelopemask
NeuroAnalysis.gaborf
NeuroAnalysis.gaborf
NeuroAnalysis.gaincorrectnp
NeuroAnalysis.gaussiancontour
NeuroAnalysis.gaussianenvelope
NeuroAnalysis.gaussianenvelopemask
NeuroAnalysis.gaussianf
NeuroAnalysis.gaussianf
NeuroAnalysis.getdatafile
NeuroAnalysis.getexpericafile
NeuroAnalysis.getoifile
NeuroAnalysis.goodnessoffit
NeuroAnalysis.grating
NeuroAnalysis.gratingf
NeuroAnalysis.gratingf
NeuroAnalysis.gvmf
NeuroAnalysis.halfwidth
NeuroAnalysis.hartley
NeuroAnalysis.hartleysubspace
NeuroAnalysis.hlpass
NeuroAnalysis.hotellingt2test
NeuroAnalysis.ismodulative
NeuroAnalysis.isresponsive
NeuroAnalysis.isresponsive
NeuroAnalysis.isresponsive
NeuroAnalysis.loadimageset
NeuroAnalysis.localcoherence
NeuroAnalysis.localcontrast
NeuroAnalysis.localpairweight
NeuroAnalysis.maptodatatime
NeuroAnalysis.matchfile
NeuroAnalysis.matdictarray2df
NeuroAnalysis.mdsd
NeuroAnalysis.meanse
NeuroAnalysis.normalized
NeuroAnalysis.oifileregex
NeuroAnalysis.pairtest
NeuroAnalysis.pairtest
NeuroAnalysis.pairtest
NeuroAnalysis.parsedigitalinanalog
NeuroAnalysis.peakroi
NeuroAnalysis.plotanalog
NeuroAnalysis.plotcondresponse
NeuroAnalysis.plothartleysubspace
NeuroAnalysis.plotspiketrain
NeuroAnalysis.plotspiketrain
NeuroAnalysis.poissonspiketrain
NeuroAnalysis.poissonspiketrain
NeuroAnalysis.powerspectrum
NeuroAnalysis.powerspectrum2
NeuroAnalysis.powerspectrums2
NeuroAnalysis.prepare
NeuroAnalysis.prepare_experica!
NeuroAnalysis.prepare_oi!
NeuroAnalysis.prepare_ripple!
NeuroAnalysis.projectionfromcorrelogram
NeuroAnalysis.psthspiketrains
NeuroAnalysis.readmat
NeuroAnalysis.readmeta
NeuroAnalysis.readrawim_Mono8
NeuroAnalysis.ref2sync
NeuroAnalysis.refchmasknp
NeuroAnalysis.rmline
NeuroAnalysis.roccurve
NeuroAnalysis.roiwindow
NeuroAnalysis.sampleindex2time
NeuroAnalysis.sbxexd
NeuroAnalysis.sbxjoinhartleyFourier
NeuroAnalysis.sbxpeakroi
NeuroAnalysis.searchclosest
NeuroAnalysis.sftuningfeature
NeuroAnalysis.shufflejitter
NeuroAnalysis.shufflejitter
NeuroAnalysis.sin2cas
NeuroAnalysis.sin2cas
NeuroAnalysis.spikejitter
NeuroAnalysis.sta
NeuroAnalysis.statetime
NeuroAnalysis.stfilter
NeuroAnalysis.time2sampleindex
NeuroAnalysis.unitspike_kilosort
NeuroAnalysis.unitspike_kilosort3
NeuroAnalysis.vlabregex
NeuroAnalysis.vmf