AllenNeuropixels._phaselockingindexMethod

Calculate 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.

source
AllenNeuropixels.burstthreshold!Method

Threshold 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

source
AllenNeuropixels.detectburstsMethod

Detect 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

source
AllenNeuropixels.predictionerrorMethod

Calculate 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

source
AllenNeuropixels.Plots.plotbrain!Method
plotbrain!(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 the mesh! 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)
source
AllenNeuropixels.Plots.plotbrainstructure!Method
plotbrainstructure!(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)
source
AllenNeuropixels.Plots.tracesMethod

We'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.

source