(variable) Frequency-based Layer Identification Procedure (FLIP and vFLIP) for spectrolaminar analysis
Data files
Nov 07, 2023 version files 806.35 MB
-
data.mat
805.01 MB
-
FLIP_Algorithm_Introduction.pdf
94.96 KB
-
FLIPAnalysis.m
25.74 KB
-
main_FLIP_script.m
4.81 KB
-
Published_main_FLIP_script.pdf
1.21 MB
-
README.md
4.09 KB
Jan 17, 2024 version files 806.35 MB
-
data.mat
805.01 MB
-
FLIP_Algorithm_Introduction.pdf
94.96 KB
-
FLIPAnalysis.m
25.74 KB
-
main_FLIP_script.m
4.88 KB
-
Published_main_FLIP_script.pdf
1.21 MB
-
README.md
4.03 KB
Nov 04, 2025 version files 1.51 GB
-
data.mat
805.01 MB
-
FLIP_Algorithm_Introduction.pdf
94.96 KB
-
FLIPAnalysis.m
25.74 KB
-
main_FLIP_script.m
4.88 KB
-
Published_main_FLIP_script.pdf
1.21 MB
-
README.md
6.45 KB
-
relpow_from_rawLFP.m
3.84 KB
-
vFLIP2_Description.pdf
455.53 KB
-
vFLIP2_readme.mlx
554.10 KB
-
vFLIP2_testdata.mat
701.85 MB
-
vFLIP2_Tutorial.pdf
345.57 KB
-
vFLIP2.m
43.67 KB
Abstract
The mammalian cerebral cortex is anatomically organized into a six-layer motif. In this dataset and associated paper (Mendoza-Halliday et al., 2023) we show that a corresponding laminar motif of neuronal activity patterns exists across the cortex in the power of local field potentials (LFP). Using laminar probes, we recorded LFPs in five macaque monkeys in 14 cortical areas across the cortical hierarchy. The laminar locations of recordings were histologically identified via electrolytic lesions. Across all areas, we found a ubiquitous spectrolaminar pattern characterized by an increasing deep-to-superficial layer gradient of high-frequency power peaking in layers 2/3 and an increasing superficial-to-deep gradient of alpha-beta power peaking in layers 5/6. Our results suggest the existence of a canonical layer- and frequency-based mechanism for cortical computation. To facilitate the detection of these spectrolaminar patterns, we are releasing data associated with "Study 1" and "Study 2" as reported in Mendoza-Halliday et al., 2023. This comprises relative power of LFPs recorded in 4 macaque monkeys from areas V4, 7A, MT, MST, LIP, and LPFC. The FLIP and vFLIP algorithms were created to facilitate electrophysiological characterization of cortical layers based on power analysis of the local field potential recordings (LFP) that are provided in these datasets. The algorithms can also be used to perform the same analysis on any other multi-channel LFP dataset. We have verified that the spectrolaminar pattern is highly preserved in macaque monkeys, marmosets, and humans, but is more dissimilar in mouse. In a follow-up study, we developed vFLIP2, an updated and optimized version of the vFLIP algorithm for automatic identification of spectrolaminar motif from LFP data. vFLIP2 improves on previous versions by using a laminar data-driven method to define frequency bands, reducing computational complexity and increasing robustness. vFLIP2 also introduces omega, a new metric that quantifies the quality of the spectrolaminar motif, allowing for improved detectability and reliability.
https://doi.org/10.5061/dryad.9w0vt4bnp
FLIP Algorithm File Descriptions
Getting Started
There are three files available for download: FLIPAnalysis.m, main_FLIP_script, and data.mat
The only file necessary to perform the FLIP algorithm on an existing non-normalized powermatrix is FLIPAnalysis.m. The provided tutorial details how to utilize FLIP. Two supplementary files are provided:
data.mat contains the data used in the paper, and main_FLIP_script.m is a script that interact with the FLIPAnalysis function.
main_FLIP_script is helpful in demonstrating how FLIP can be used in data analysis.
File and function Descriptions
Published_main_FLIP_script.pdf
This PDF contains the author's run of main_FLIP_script.m and associated figures produced by that script, so that users can verify they are getting the expected figure outputs when they run main_FLIP_script.m themselves.
data.mat
This data file contains a struct that encompasses the data recorded in experimentation.
There are five fields contained in the struct: CSD, relpow, meta, example1_vlPFC_lfp, and example2_7A_lfp
- CSD: Current Source Density data contained in a three-dimensional matrix, the first dimension represents each probe, the second dimension represents each channel, and the third dimension represents each time point (from -0.1s pre-stimulus to +0.5s post-stimulus) included in the analysis. The units of CSD are z-score change from baseline (using the standard error across trials to perform the z-score at each point in time). Positive values denote sources and negative values denote sinks.
- relpow: Relative Power data is contained in a three-dimensional matrix, like CSD, the first dimension represents each probe, the second dimension represents each channel, and the third dimension represents each frequency (from 1-150 Hz) included in the analysis. The units of the relpow data are normalized units between 0 and 1 (1=the channel with the highest power at that frequency).
- example1_vIPFC_lfp: a sample LFP dataset, a three-dimensional matrix, the first dimension represents probe channels, the second dimension represents trials, and the third dimension represents time. Units of these local field potentials (LFP) are in microvolts by time (sampling rate = 1,000 Hz)
- example2_7A_lfp: also a sample LFP dataset, a three-dimensional matrix, the first dimension represents probe channels, the second dimension represents trials, and the third dimension represents time. Units of these local field potentials (LFP) are in microvolts by time (sampling rate = 1,000 Hz)
- meta: Metadata about each probe used in the analysis. The rows of meta correspond to the rows of CSD and relpow. Filename: The filename of the associated session, including the date of recording. probenumber: The probenumber on that session. study_number refers to study 1/2 reported in Mendoza-Halliday et al., 2023. monkey_number identifies the research subject. brain_area_num identifies the brain area numerically. interchannel_distance identifies the distance between contacts on a probe in units of microns. brain_area denotes each area's name. crossover_default is the cross identified by the FLIP algorithm with default settings. crossover_VFLIP is cross-identified by the vFLIP algorithm. CSD_sink_channel is the channel corresponding to the "early" current sink identified with a manual inspection method.
FLIPAnalysis.m
This file contains the FLIP and vFLIP algorithms.
main_FLIP_script.m
This file contains a few sample interactions with the FLIPAnalysis function.
To use this file, ensure the data.mat and FLIPAnalysis.m files are downloaded. Additionally, ensure it is in the same folder as FLIPAnalysis.m or add FLIPAnalysis.m to the path.
FLIP Algorithm Introduction.pdf
A step-by-step tutorial that reviews how to use the FLIP and vFLIP algorithms for spectrolaminar analysis.
variable Frequency-based Layer Identification Procedure, version 2 (vFLIP2)
vFLIP2 Algorithm File Descriptions
Getting Started
Open vFLIP2_readme.mlx for an interactive, hands-on walkthrough showcasing how vFLIP2.m analyzes laminar LFP data from vFLIP2_testdata.mat.To better understand the logic behind the pipeline and its parameters, explore vFLIP2_Description.pdf and vFLIP2_Tutorial.pdf, which unpack the algorithm’s steps and data structure in detail.
File and function Descriptions
vFLIP2.m
Main MATLAB function implementing the vFLIP2 pipeline for analyzing functional LFP interactions.
vFLIP2_readme.mlx
MATLAB Live Script providing an interactive walk-through of the vFLIP2 analysis workflow.
vFLIP2_testdata.mat
The dataset comprises three primary fields, trialcut, power_example, and raw, each representing a distinct level of preprocessing of the local field potential (LFP) data. These fields can be analyzed using vFLIP2, as detailed in the accompanying documentation file vFLIP2_readme.mlx. Variables:
- The power_example field is a two-dimensional matrix of size 31 × 250. It represents example power spectra calculated from 31 recording channels and across 250 Frequency bins (from 1-250 Hz).
- The trialcut field is a three-dimensional matrix with dimensions 16 × 5501 × 521. It contains time-segmented LFP trials, where each of the 16 entries along the first dimension corresponds to an individual recording channel. The second dimension (5501 samples) represents the time samples within each trial, and the third dimension (521) indexes the number of trials.
- The raw field consists of a large two-dimensional matrix with dimensions 16 × 2,866,021. It contains the continuous, unsegmented LFP recordings obtained from 16 electrodes before any trial segmentation or preprocessing.
vFLIP2_Description.pdf
Documentation detailing vFLIP2 algorithm logic and steps of analysis.
vFLIP2_Tutorial.pdf
Documentation detailing vFLIP2 input/output structure, and key parameters.
relpow_from_rawLFP.m
MATLAB script for computing laminar relative power from raw LFP data.
Code/software
The vFLIP2 code was developed using MATLAB R2023a. To run the code, you must download the following dependencies:
- Signal Processing Toolbox.
- Statistics and Machine Learning Toolbox.
Mulit-channel electrode arrays were implanted into different areas of the primate visual cortex. Local field potentials were acquired, and processed for their spectral power in frequencies ranging from 1–150Hz spanning gamma (50–150 Hz) and alpha/beta (10–30 Hz) ranges. A relative power metric was computed and analyzed for the spectrolaminar pattern across layers. This pattern defines the anatomical position of layers 2/3 (peak of gamma relative power), layers 5/6 (peak of alpha/beta relative power), and layer 4 (cross-over between gamma and alpha/beta).
Changes after Nov 7, 2023:
The original release includes the following files:
FLIP_Algorithm_Introduction.pdf: An description of the FLIP analysis code.
FLIPAnalysis.m: Matlab function to perform FLIP or vFLIP analysis.
data.mat: Example data including two laminar electrophysiological recordings from macaque cortex.
main_FLIP_script.m: An example Matlab script that uses the FLIPAnalysis.m function to perform FLIP or vFLIP analysis on the example data provided (data.mat) and generate results and figures.
Published_main_FLIP_script.pdf: A PDF file displaying the text in main_FLIP_script.m.
relpow_from_rawLFP.m: Matlab function that produces a normalized laminar power spectrum (a.k.a. normalized laminar power map or “relpow” map) from the example data provided (data.mat).
Changes after Jan 17, 2024:
Variable Frequency-based Layer Identification Procedure, version 2 (vFLIP2)
The new release includes MATLAB code for vFLIP2, comprehensive documentation (vFLIP2_Description.pdf, vFLIP2_Tutorial.pdf, vFLIP2_readme.mlx), and an example recording (vFLIP2_testdata.mat) containing continuous, segmented, and frequency-domain LFP data. Author list updated with new authors and author metadata. Abstract updated.
- Mendoza-Halliday, Diego; Major, Alex J.; Lee, Noah et al. (2022). A ubiquitous spectrolaminar motif of local field potential power across the primate cortex [Preprint]. Cold Spring Harbor Laboratory. https://doi.org/10.1101/2022.09.30.510398
- Mendoza-Halliday, Diego; Major, Alex James; Lee, Noah et al. (2024). A ubiquitous spectrolaminar motif of local field potential power across the primate cortex. Nature Neuroscience. https://doi.org/10.1038/s41593-023-01554-7
- Major, Alex James; Abdaltawab, Ahmed; Phillips, Jessica M. et al. (2025). A. J. Major et al. reply. Nature Neuroscience. https://doi.org/10.1038/s41593-025-02168-x
