AllenNeuropixels._phaselockingindex
— MethodCalculate the phase-locking index using the wavelet transform masks stored in each bursts. Drops any bursts that do not have wavelet information at the specified frequency, f
. If centre
is true, the phase of spikes in each burst is centred to the mean phase in each burst. Only consider bursts with at least n_spikes
spikes, and only count channel-neuron pairs that have n_bursts
bursts.
AllenNeuropixels._phaselockingindex
— MethodThe phase-locking index for bursts and an LFP signal
AllenNeuropixels.aggregatefit
— MethodReturns a function that evaluates the Gaussian fits of a collection of bursts at any time and log-frequency value
AllenNeuropixels.burstcurvature!
— Functionthresh
is a proportion of the average gradient of the wavelet spectrum below which a gradie
AllenNeuropixels.burstthreshold!
— MethodThreshold a wavelet spectrum using either a percentile cutoff (method=:percentile
) or a standard deviation cutoff (method=:std
) of either each frequency band (eachfreq=true
) or the entire spectrum. You probably want to FOOOF the spectrum before this
AllenNeuropixels.detectbursts
— MethodDetect bursts from a supplied wavelet spectrum, using thresholding boundingstretch
increases the bounding box slightly so for a more accurate fit. Give as a proportion of the threshold bounding box detection
can be _detectbursts
or mmap_detectbursts
AllenNeuropixels.phaselockingindex
— MethodBuzsaki's phase-locking index ("Gamma rhythm communication between entorhinal cortex and dentate gyrus neuronal assemblies")
AllenNeuropixels.predictionerror
— MethodCalculate the prediction error of variables 1 to variables 2 and vice versa. The output contains prediction errors. If used with spike matrices probably want to transpose those
AllenNeuropixels.randomisebursts
— MethodShuffle times of a burst vector
AllenNeuropixels.rbfdistance
— Methodx and y are vectors containing spike times
AllenNeuropixels.surrogatefilter!
— MethodFilter a vector of bursts based of a vector of surrogate bursts
AllenNeuropixels.thetafeature
— FunctionDetect time series with strong theta events using the automutual information
AllenNeuropixels.thetafeature
— MethodCalculate the thetafeature for each stimulus presentation
AllenNeuropixels.Plots.plotbrain!
— Methodplotbrain!(ax, S::AN.AbstractSession; dotext = :cortex, dostructures = true,
ids = :targets, probestyle = :lines, dark = false, meshparams = ())
Plot a 3D representation of the brain with probes and structures.
Arguments
ax::AbstractPlotting.Axis
: The axis to plot on.S::AN.AbstractSession
: The session object containing the data.dotext::Symbol=:cortex
: Whether to display text labels for the probes or the cortical structures.dostructures::Bool=true
: Whether to plot the brain structures.ids::Symbol=:targets
: Which structures to plot. Can be:all
,:corticaltargets
,:targets
, or a vector of structure IDs.probestyle::Symbol=:lines
: Whether to plot the probes as lines or meshscatter.dark::Bool=false
: Whether to use a dark theme.meshparams::NamedTuple=()
: Additional parameters to pass to themesh!
function.
Returns
- A tuple containing the color observables and the probe plots.
Example
S = ANB.VisualBehavior.Session(1067588044)
f = Figure(; size = (1920, 1080))
ax = Axis3(f[1, 1]; aspect = :data)
c, p = AN.Plots.plotbrain!(ax, S; dark = false)
AllenNeuropixels.Plots.plotbrainstructure!
— Methodplotbrainstructure!(ax, id; hemisphere)
Plot a brain structure with the given ID on the given axis.
Arguments
ax::AbstractPlotting.Axis
: The axis to plot on.id::Int
: The ID of the brain structure to plot.hemisphere::Symbol
: The hemisphere to plot the structure on. Default is:both
.
Example
D = AllenNeuropixels.getstructureidmap()
id = D["root"] # The whole brain
f = Figure(; size = (1920, 1080))
ax = Axis3(f[1, 1]; aspect = :data)
p = AN.Plots.plotbrainstructure!(ax, id; hemisphere=:both)
AllenNeuropixels.Plots.traces
— MethodWe'll plot the columns of this array as traces of their mean values. x
is the lag index of each row, tracez
is the value with which to color each trace (column) and X
is an array of trace data.