AbstractHigh-density microelectrode arrays have opened new possibilities for systems neuroscience, but brain motion relative to the array poses challenges for downstream analyses. We introduce DREDge (Decentralized Registration of Electrophysiology Data), a robust algorithm for the registration of noisy, nonstationary extracellular electrophysiology recordings. In addition to estimating motion from action potential data, DREDge enables automated, high-temporal-resolution motion tracking in local field potential data. In human intraoperative recordings, DREDge’s local field potential-based tracking reliably recovered evoked potentials and single-unit spike sorting. In recordings of deep probe insertions in nonhuman primates, DREDge tracked motion across centimeters of tissue and several brain regions while mapping single-unit electrophysiological features. DREDge reliably improved motion correction in acute mouse recordings, especially in those made with a recent ultrahigh-density probe. Applying DREDge to recordings from chronic implantations in mice yielded stable motion tracking despite changes in neural activity between experimental sessions. These advances enable automated, scalable registration of electrophysiological data across species, probes and drift types, providing a foundation for downstream analyses of these rich datasets.
This is a preview of subscription content, access via your institution
Access options
Access through your institution
Change institution
Buy or subscribe
Access Nature and 54 other Nature Portfolio journals
Get Nature+, our best-value online-access subscription
$29.99 / 30 days
cancel any time
Learn more
Subscribe to this journal
Receive 12 print issues and online access
$259.00 per year
only $21.58 per issue
Learn more
Buy this article
Purchase on SpringerLink
Instant access to full article PDF
Buy now
Prices may be subject to local taxes which are calculated during checkout
Additional access options:
Log in
Learn about institutional subscriptions
Read our FAQs
Contact customer support
Fig. 1: DREDge is a robust motion estimation algorithm for electrophysiology recordings in both the AP and LFP bands.Fig. 2: Correcting for motion in human spiking data.Fig. 3: Correcting for motion in human LFP data.Fig. 4: Monitoring long-range drift during a deep probe insertion.Fig. 5: State-of-the-art registration in acute mouse NP recordings.Fig. 6: Tracking drift across weeks in chronic recordings.
Data availability
Human data are available for download at Dryad (https://doi.org/10.5061/dryad.d2547d840) and DANDI (https://dandiarchive.org/dandiset/000397) from MGH13 and at Dryad (https://doi.org/10.7272/Q6ST7N3B) from the UCSF14. IBL data for the reproducible electrophysiology experiment are publicly available and can be downloaded via AWS Open Data at https://registry.opendata.aws/ibl-reproducible-ephys/ or by following the instructions under Data at https://www.internationalbrainlab.com/repro-ephys/ and using the tag 2022_Q2_IBL_et_al_RepeatedSite35. The NP1 and NP2 imposed motion datasets here (dataset 1) can be downloaded at Figshare (https://doi.org/10.6084/m9.figshare.14024495.v1)6. The NP Ultra imposed motion datasets are available at DANDI (https://dandiarchive.org/dandiset/000957/)36. Neuroseeker recordings in ketamine–xylazine-anesthetized rat data are available on G-node (https://gin.g-node.org/UlbertLab/High_Resolution_Cortical_Spikes/) and described in a data descriptor record42. The NP1-NHP insertion datasets are available at DANDI (https://dandiarchive.org/dandiset/001282/) and the fast-motion NHP dataset of Extended Data Fig. 3 is available at DANDI (https://dandiarchive.org/dandiset/001290/).
Code availability
DREDge’s motion estimation and interpolation tools are available to run via open-source Python 3 code via the SpikeInterface library (https://spikeinterface.readthedocs.io/, versions after 0.101.0; available under the MIT license); more demos and tools are available at https://github.com/evarol/dredge/ (MIT license). Additional tools for motion-correction interpolation, as used in the analyses of Figs. 2 and 3 above, are available in an open-source MATLAB-based toolkit at https://github.com/williamunoz/InterpolationAfterDREDge/ (CC0-1.0 license). DREDge is implemented in Python 3, and it relies on PyTorch’s convolution routines (BSD-3-Clause license) to implement GPU-accelerated normalized cross-correlations80, on SciPy for its bundled linear system solvers and interpolation routines81 (BSD-3-Clause license) and on SpikeInterface17 for its electrophysiology data readers and preprocessing routines, some of which were implemented as part of this work. Code for running KS 2.5 with an extended set of adjustable parameters is available at https://github.com/cwindolf/Kilosort/tree/modded-v2.5/; KS uses the GLP-3.0 license. Code for the analyses of human data described in this paper has been made available at https://github.com/Center-For-Neurotechnology/HumanNeuropixelsPipeline/, which includes links to other useful repositories not maintained by authors of this paper (with the exceptions of https://github.com/evarol/dredge/ and https://github.com/williamunoz/InterpolationAfterDREDge/). LFP motion-corrected interpolation required the removal of low-frequency peaks in the signal using Zapline-plus (https://github.com/MariusKlug/zapline-plus/; GPL-3.0 license). For all the NP data, open-source acquisition software was used to acquire the neural data, which include SpikeGLX Release v.20201103-phase30 (http://billkarsh.github.io/SpikeGLX/, available under the Janelia Research Campus Software Copyright 1.2) and OpenEphys (https://open-ephys.org/gui; GPL-3.0 license). Single-unit sorting was performed using KS 2.5 (https://github.com/MouseLand/Kilosort/) as well as Phy2 (https://github.com/cortex-lab/phy/; BSD-3-Clause license). Custom MATLAB (version R2021a) and Python 3 code in combination with open-source code from the Fieldtrip toolbox76 (http://www.fieldtriptoolbox.org/; GPL-3.0 license) was used for the majority of the analyses. Some code involving manual alignment is available on GitHub (https://github.com/Center-For-Neurotechnology/CorticalNeuropixelProcessingPipeline/). The burst suppression ratio was computed using an automated method available at https://github.com/drasros/bs_detector_icueeg/. Psychtoolbox-3 (http://psychtoolbox.org/) with io64 parallel port drivers and MATLAB functions was used to drive TTL trigger pulses for alignment and run the visual task. Simulated data were generated via MEArec version 1.8.0 (https://mearec.readthedocs.io/en/latest/; GLP-3.0 license). Code for the generation and analysis of simulated data in this paper was adapted from previous work31, and is available at https://github.com/cwindolf/mearec_drift_simulations/ under the MIT license.
ReferencesFrey, U. et al. Switch-matrix-based high-density microelectrode array in CMOS technology. IEEE J. Solid-State Circuits 45, 467–482 (2010).Article
Google Scholar
Raducanu, B. C. et al. Time multiplexed active neural probe with 1356 parallel recording sites. Sensors 17, 2388 (2017).Jun, J. J. et al. Fully integrated silicon probes for high-density recording of neural activity. Nature 551, 232–236 (2017).Article
PubMed
PubMed Central
CAS
Google Scholar
Fiáth, R. et al. Fine-scale mapping of cortical laminar activity during sleep slow oscillations using high-density linear silicon probes. J. Neurosci. Methods 316, 58–70 (2019).Article
PubMed
Google Scholar
Angotzi, G. N. et al. SiNAPS: an implantable active pixel sensor CMOS-probe for simultaneous large-scale neural recordings. Biosens. Bioelectron. 126, 355–364 (2019).Article
PubMed
CAS
Google Scholar
Steinmetz, N. A. et al. Neuropixels 2.0: A miniaturized high-density probe for stable, long-term brain recordings. Science 372, eabf4588 (2021).Article
PubMed
PubMed Central
CAS
Google Scholar
Jia, X. et al. High-density extracellular probes reveal dendritic backpropagation and facilitate neuron classification. J. Neurophysiol. 121, 1831–1847 (2019).Article
PubMed
Google Scholar
Trepka, E. B., Zhu, S., Xia, R., Chen, X. & Moore, T. Functional interactions among neurons within single columns of macaque V1. eLife 11, e79322 (2022).Article
PubMed
PubMed Central
CAS
Google Scholar
Trautmann, E. M. et al. Accurate estimation of neural population dynamics without spike sorting. Neuron 103, 292–308 (2019).Article
Google Scholar
Inagaki, H. K. et al. A midbrain-thalamus-cortex circuit reorganizes cortical dynamics to initiate movement. Cell 185, 1065–1081 (2022).Article
Google Scholar
Chettih, S. N., Mackevicius, E. L., Hale, S. & Aronov, D. Barcoding of episodic memories in the hippocampus of a food-caching bird. Cell 187, 1922–1935 (2024).Article
Google Scholar
Steinmetz, N. A., Zatka-Haas, P., Carandini, M. & Harris, K. D. Distributed coding of choice, action and engagement across the mouse brain. Nature 576, 266–273 (2019).Article
PubMed
PubMed Central
CAS
Google Scholar
Paulk, A. C. et al. Large-scale neural recordings with single neuron resolution using neuropixels probes in human cortex. Nat. Neurosci. 25, 252–263 (2022).Article
PubMed
CAS
Google Scholar
Chung, J. E. et al. High-density single-unit human cortical recordings using the Neuropixels probe. Neuron 110, 2409–2421 (2022).Steinmetz, N. A., Koch, C., Harris, K. D. & Carandini, M. Challenges and opportunities for large-scale electrophysiology with neuropixels probes. Curr. Opin. Neurobiol. 50, 92–100 (2018).Article
PubMed
PubMed Central
CAS
Google Scholar
Pachitariu, M., Steinmetz, N., Kadir, S., Carandini, M. & Harris, K. D. Kilosort: realtime spike-sorting for extracellular electrophysiology with hundreds of channels. Preprint at bioRxiv https://doi.org/10.1101/061481 (2016).Buccino, A. P. et al. Spikeinterface, a unified framework for spike sorting. eLife 9, e61834 (2020).Article
PubMed
PubMed Central
CAS
Google Scholar
International Brain Laboratory. Spike sorting pipeline for the International Brain Laboratory. Figshare https://doi.org/10.6084/m9.figshare.19705522.v4 (2022).Ashburner, J. A fast diffeomorphic image registration algorithm. Neuroimage 38, 95–113 (2007).Article
PubMed
Google Scholar
Sotiras, A., Davatzikos, C. & Paragios, N. Deformable medical image registration: a survey. IEEE Trans. Med. Imaging 32, 1153–1190 (2013).Article
PubMed
PubMed Central
Google Scholar
Arganda-Carreras, I. et al. Consistent and elastic registration of histological sections using vector-spline regularization. In Proceedings of the Second ECCV International Conference on Computer Vision Approaches to Medical Image Analysis, CVAMIA ’06, 85–95 https://doi.org/10.1007/11889762_8 (Springer-Verlag, 2006).AVANTS, B., EPSTEIN, C., GROSSMAN, M. & GEE, J. Symmetric diffeomorphic image registration with cross-correlation: Evaluating automated labeling of elderly and neurodegenerative brain. Med. Image Anal. 12, 26–41 (2008).Article
PubMed
CAS
Google Scholar
Feydy, J., Charlier, B., Vialard, F. -X. & Peyré, G. Optimal transport for diffeomorphic registration. In Medical Image Computing and Computer Assisted Intervention 2017: 20th International Conference, Quebec City, QC, Canada, September 11–13, 2017, Proceedings, Part I, 291–299 https://doi.org/10.1007/978-3-319-66182-7_34 (Springer-Verlag, 2017).Kutten, K. S. et al. A large deformation diffeomorphic approach to registration of clarity images via mutual information. In Descoteaux, M. et al. (eds.) Medical Image Computing and Computer Assisted Intervention 2017, 275–282 (Springer, 2017).Dubbs, A., Guevara, J. & Yuste, R. moco: fast motion correction for calcium imaging. Front. Neuroinform. 10, 6 (2016).Article
PubMed
PubMed Central
Google Scholar
Pnevmatikakis, E. A. & Giovannucci, A. NormCoRRe: an online algorithm for piecewise rigid motion correction of calcium imaging data. J. Neurosci. Methods 291, 83–94 (2017).Article
PubMed
CAS
Google Scholar
Pachitariu, M. et al. Suite2p: beyond 10,000 neurons with standard two-photon microscopy. Preprint at bioRxiv https://doi.org/10.1101/061507 (2017).Archip, N. et al. Non-rigid alignment of preoperative mri, fmri, and dt-mri with intra-operative mri for enhanced visualization and navigation in image-guided neurosurgery. Neuroimage 35, 609–624 (2007).Article
PubMed
Google Scholar
Pachitariu, M., Sridhar, S., Pennington, J. & Stringer, C. Spike sorting with Kilosort4. Nat. Methods 21, 914–921 (2024).Article
PubMed
PubMed Central
CAS
Google Scholar
Lewis, J. Fast template matching. Vision Interface 10, 120–123 (1995).Garcia, S. et al. A modular implementation to handle and benchmark drift correction for high-density extracellular recordings. eNeuro ENEURO.0229–23.2023 https://doi.org/10.1523/ENEURO.0229-23.2023 (2024).Varol, E. et al. Decentralized motion inference and registration of neuropixel data. In ICASSP 2021–2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 1085–1089 (2021).Windolf, C. et al. Robust online multiband drift estimation in electrophysiology data. In ICASSP 2023–2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 1–5 (2023).Trautmann, E. M. et al. Large-scale high-density brain-wide neural recording in nonhuman primates. Preprint at bioRxiv https://doi.org/10.1101/2023.02.01.526664 (2023).International Brain Laboratory, et al. Reproducibility of in vivo electrophysiological measurements in mice. eLife 13, RP100840 (2024).Ye, Z. et al. Ultra-high density electrodes improve detection, yield, and cell type specificity of brain recordings. Preprint at bioRxiv https://doi.org/10.1101/2023.08.23.554527 (2023).Boussard, J. et al. DARTsort: a modular drift tracking spike sorter for high-density multi-electrode probes. Preprint at bioRxiv https://doi.org/10.1101/2023.08.11.553023 (2023).Boussard, J., Varol, E., Lee, H. D., Dethe, N. & Paninski, L. Three-dimensional spike localization and improved motion correction for Neuropixels recordings. In (eds. Ranzato, M. et al.) Advances in Neural Information Processing Systems, 34, 22095–22105 https://proceedings.neurips.cc/paper_files/paper/2021/file/b950ea26ca12daae142bd74dba4427c8-Paper.pdf (Curran Associates, 2021).Mechler, F., Victor, J. D., Ohiorhenuan, I., Schmid, A. M. & Hu, Q. Three-dimensional localization of neurons in cortical tetrode recordings. J. Neurophysiol. 106, 828–848 (2011).Article
PubMed
PubMed Central
Google Scholar
Hurwitz, C., Xu, K., Srivastava, A., Buccino, A. & Hennig, M. Scalable spike source localization in extracellular recordings using amortized variational inference. In Wallach, H. et al. (eds.) Advances in Neural Information Processing Systems, 32 https://proceedings.neurips.cc/paper_files/paper/2019/file/f12f2b34a0c3174269c19e21c07dee68-Paper.pdf (Curran Associates, 2019).Buccino, A. P. et al. Combining biophysical modeling and deep learning for multielectrode array neuron localization and classification. J. Neurophysiol. 120, 1212–1232 (2018).Article
PubMed
Google Scholar
Horváth, C., Tóth, L. F., Ulbert, I. & Fiáth, R. Dataset of cortical activity recorded with high spatial resolution from anesthetized rats. Sci. Data https://doi.org/10.1038/s41597-021-00970-3 (2021-07).Tal, I. & Abeles, M. Cleaning MEG artifacts using external cues. J. Neurosci. Methods 217, 31–38 (2013).Article
PubMed
CAS
Google Scholar
Klug, M. & Kloosterman, N. A. Zapline-plus: a zapline extension for automatic and adaptive removal of frequency-specific noise artifacts in M/EEG. Human Brain Mapp. 43, 2743–2758 (2022).Article
Google Scholar
de Cheveigné, A. ZapLine: a simple and effective method to remove power line artifacts. NeuroImage 207, 116356 (2020).Article
PubMed
Google Scholar
Ulbert, I., Halgren, E., Heit, G. & Karmos, G. Multiple microelectrode-recording system for human intracortical applications. J. Neurosci. Methods 106, 69–79 (2001).Article
PubMed
CAS
Google Scholar
Csercsa, R. et al. Laminar analysis of slow wave activity in humans. Brain 133, 2814–2829 (2010).Article
PubMed
PubMed Central
Google Scholar
Baudena, P., Halgren, E., Heit, G. & Clarke, J. M. Intracerebral potentials to rare target and distractor auditory and visual stimuli. III. frontal cortex. Electroencephal. Clin. Neurophysiol. 94, 251–264 (1995).Article
CAS
Google Scholar
Fabo, D. et al. The role of superficial and deep layers in the generation of high frequency oscillations and interictal epileptiform discharges in the human cortex. Sci. Rep. https://doi.org/10.1038/s41598-022-22497-2 (2023).Lewis, L. D. et al. Local cortical dynamics of burst suppression in the anaesthetized brain. Brain 136, 2727–2737 (2013).Article
PubMed
PubMed Central
Google Scholar
Westover, M. B. et al. Real-time segmentation of burst suppression patterns in critical care EEG monitoring. J. Neurosci. Methods 219, 131–141 (2013).Article
PubMed Central
Google Scholar
Salami, P., Borzello, M., Kramer, M. A., Westover, M. B. & Cash, S. S. Quantifying seizure termination patterns reveals limited pathways to seizure end. Neurobiol. Dis. 165, 105645 (2022).Article
PubMed
PubMed Central
Google Scholar
Wei, Y. et al. Associations between in vitro, in vivo and in silico cell classes in mouse primary visual cortex. Nat. Commun. 14, 2344 (2023).Article
PubMed
PubMed Central
CAS
Google Scholar
Buccino, A. P. & Einevoll, G. T. MEArec: a fast and customizable testbench simulator for ground-truth extracellular spiking activity. Neuroinformatics 19, 185–204 (2021).Article
PubMed
Google Scholar
Choi, J. et al. Optimal adaptive electrode selection to maximize simultaneously recorded neuron yield. In Larochelle, H. et al. (eds.) Advances in Neural Information Processing Systems, 33, 6160–6171 https://proceedings.neurips.cc/paper/2020/hash/445e1050156c6ae8c082a8422bb7dfc0-Abstract.html (Curran Associates, 2020).Melin, M. D. et al. Large scale, simultaneous, chronic neural recordings from multiple brain areas. Preprint at bioRxiv https://doi.org/10.1101/2023.12.22.572441 (2024).Hill, D. N., Mehta, S. B. & Kleinfeld, D. Quality metrics to accompany spike sorting of extracellular signals. J. Neurosci. 31, 8699–8705 (2011).Article
PubMed
PubMed Central
CAS
Google Scholar
Yuan, A. et al. Multi-day neuron tracking in high density electrophysiology recordings using EMD. eLife https://doi.org/10.7554/eLife.92495.2 (2024).van Beest, E. H., Bimbard, C., Fabre, J. M. J. et al. Tracking neurons across days with high-density probes. Nat. Methods https://doi.org/10.1038/s41592-024-02440-1 (2024).Savitzky, B. H. et al. Image registration of low signal-to-noise cryo-STEM data. Ultramicroscopy 191, 56–65 (2018).Article
PubMed
CAS
Google Scholar
Paninski, L. et al. A new look at state-space models for neural data. J. Comput. Neurosci. 29, 107–126 (2009).Article
PubMed
PubMed Central
Google Scholar
McInnes, L., Healy, J. & Astels, S. hdbscan: hierarchical density based clustering. J. Open Source Softw. 2, 205 (2017).Article
Google Scholar
Lee, J. et al. Yass: Yet another spike sorter applied to large-scale multi-electrode array recordings in primate retina. Preprint at bioRxiv https://doi.org/10.1101/2020.03.18.997924 (2020).Gold, C., Girardin, C. C., Martin, K. A. & Koch, C. High-amplitude positive spikes recorded extracellularly in cat visual cortex. J. Neurophysiol. 102, 3340–3351 (2009).Article
PubMed
PubMed Central
Google Scholar
Barry, J. M. Axonal activity in vivo: technical considerations and implications for the exploration of neural circuits in freely moving animals. Front. Neurosci. 9, 153 (2015).Article
PubMed
PubMed Central
Google Scholar
Paulk, A. C. et al. Microscale physiological events on the human cortical surface. Cereb. Cortex 31, 3678–3700 (2021).Article
PubMed
PubMed Central
Google Scholar
Jamali, M. et al. Dorsolateral prefrontal neurons mediate subjective decisions and their variation in humans. Nat. Neurosci. 22, 1010–1020 (2019).Article
PubMed
PubMed Central
CAS
Google Scholar
Yang, J. C. et al. Microscale dynamics of electrophysiological markers of epilepsy. Clin. Neurophysiol. 132, 2916–2931 (2021).Article
PubMed
PubMed Central
Google Scholar
Lopez, C. M. et al. A neural probe with up to 966 electrodes and up to 384 configurable channels in 0.13 μm SOI CMOS. IEEE Trans. Biomed. Circuits Syst. 11, 510–522 (2017).Article
Google Scholar
Siegle, J. H. et al. Open Ephys: an open-source, plugin-based platform for multichannel electrophysiology. J. Neural Eng. 14, 045003 (2017).Article
PubMed
Google Scholar
Brainard, D. H. The psychophysics toolbox. Spatial Vis. 10, 433–436 (1997).Article
CAS
Google Scholar
Reid, R. C., Victor, J. D. & Shapley, R. M. The use of m-sequences in the analysis of visual neurons: linear receptive field properties. Vis. Neurosci. 14, 1015–1027 (1997).Article
PubMed
CAS
Google Scholar
Sutter, E. E. Imaging visual function with the multifocal m-sequence technique. Vision Res. 41, 1241–1255 (2001).Article
PubMed
CAS
Google Scholar
Buračas, G. T. & Boynton, G. M. Efficient design of event-related fMRI experiments using m-sequences. NeuroImage 16, 801–813 (2002).Article
PubMed
Google Scholar
Tabuchi, H. et al. Study of the visual evoked magnetic field with the m-sequence technique. Invest. Ophthalmol. Vis. Sci. 43, 2045–2054 (2002).PubMed
Google Scholar
Oostenveld, R., Fries, P., Maris, E. & Schoffelen, J.-M. FieldTrip: open source software for advanced analysis of MEG, EEG, and invasive electrophysiological data. Comput. Intellig. Neurosci. 2011, 156869 (2011).Article
Google Scholar
Fiáth, R. et al. A silicon-based neural probe with densely-packed low-impedance titanium nitride microelectrodes for ultrahigh-resolution in vivo recordings. Biosens. Bioelectron. 106, 86–92 (2018).Article
PubMed
Google Scholar
Movshon, J. A., Kiorpes, L., Hawken, M. J. & Cavanaugh, J. R. Functional maturation of the macaque’s lateral geniculate nucleus. J. Neurosci. 25, 2712–2722 (2005).Article
PubMed
PubMed Central
CAS
Google Scholar
Yang, L., Lee, K., Villagracia, J. & Masmanidis, S. C. Open source silicon microprobes for high throughput neural recording. J. Neural Eng. 17, 016036 (2020).Article
PubMed
PubMed Central
Google Scholar
Paszke, A. et al. Pytorch: an imperative style, high-performance deep learning library. In Wallach, H. et al. (eds.) Advances in Neural Information Processing Systems 32, 8024–8035 http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf (Curran Associates, 2019).Virtanen, P. et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat. Methods 17, 261–272 (2020).Article
PubMed
PubMed Central
CAS
Google Scholar
Download referencesAcknowledgementsWe thank Y. Chou, D. Soper, A. Tripp, F. Minidio, A. Zhang, A. O’Donnell and M. Okun for their help in data collection. We especially thank the patients for participating in this research. We thank M. Carandini, J. Colonell, O. Winter, A. Zimnik and the IBL for helpful discussions and data coordination. We thank A. Buccino, G. Chapuis, S. Garcia and P. Yger, and also the Simons Collaboration on the Global Brain Spike Sorting Working group for many useful discussions. We also thank M. Vöröslakos and G. Buzsáki (NYU Grossman School of Medicine) for helpful feedback and additional test datasets not analyzed here. This research was supported by the ECOR and K24-NS088568 (to S.S.C.) and the Tiny Blue Dot Foundation (to S.S.C. and A.C.P.) and National Institutes of Health (NIH) grant U01NS121616 (to Z.M.W.). This research was also supported by the Howard Hughes Medical Institute at Stanford University (to E.M.T.). E.M.T. is supported by the Grossman center and the Brain and Behavior Research Foundation. C.W., H.Y., J.B., E.V. and L.P. are funded by Simons Foundation grant 344 543023, NSF Neuronex Award DBI-1707398 and the Gatsby Charitable Foundation. E.V. is also supported by R00MH128772. The rat brain in vivo data have been recorded within the Hungarian Brain Research Program Grant (NAP2022-I-2/2022). D.M. is also supported by the OTKA Hungarian postdoctoral grant (PD143582). W.M. is supported by the NIH Neuroscience Resident Research Program R25NS065743. This research was also supported by the Simons Collaboration on the Global Brain and NIH R01 DC019354 (to M.A.L.). E.F.C. is supported by the CZI Foundation. Z.Y., J.S. and N.A.S. were supported by the NIH BRAIN Initiative (U01NS113252), the Pew Biomedical Scholars Program and the Klingenstein-Simons Fellowship in Neuroscience. The views and conclusions contained in this paper are those of the authors and do not represent the official policies, either expressed or implied, of the funding sources. The funders had no role in the study design, data collection, analysis, decision to publish, or preparation of the manuscript.Author informationAuthors and AffiliationsDepartment of Statistics, Columbia University, New York City, NY, USACharlie Windolf, Julien Boussard, Liam Paninski & Erdem VarolZuckerman Institute, Columbia University, New York City, NY, USACharlie Windolf, Han Yu, Julien Boussard, Eric Trautmann, Michael N. Shadlen, Mark M. Churchland, Liam Paninski & Erdem VarolDepartment of Electrical Engineering, Columbia University, New York City, NY, USAHan YuDepartment of Neurology, Center for Neurotechnology and Neurorecovery, Massachusetts General Hospital, Harvard Medical School, Boston, MA, USAAngelique C. Paulk, Domokos Meszéna, Richard Hardstone, Brian Coughlin & Sydney S. CashInstitute of Cognitive Neuroscience and Psychology, HUN-REN Research Centre for Natural Sciences, Budapest, HungaryDomokos Meszéna, Csaba Horváth, Richárd Fiáth & István UlbertDepartment of Neurosurgery, Massachusetts General Hospital, Harvard Medical School, Boston, MA, USAWilliam Muñoz, Irene Caprara, Mohsen Jamali, Yoav Kfir, Jeffrey S. Schweitzer & Ziv M. WilliamsWeill Institute for Neurosciences, University of California, San Francisco, San Francisco, CA, USADuo Xu, Kristin K. Sellers & Edward F. ChangDepartment of Neurological Surgery, University of California, San Francisco, San Francisco, CA, USADuo Xu, Jason E. Chung, Kristin K. Sellers & Edward F. ChangDepartment of Neurobiology and Biophysics, University of Washington, Seattle, WA, USAZhiwen Ye, Jordan Shaker & Nicholas A. SteinmetzCortexlab, University College London, London, UKAnna LebedevaCenter for Neural Science, New York University, New York City, NY, USART Raghavan & J. Anthony MovshonDepartment of Neuroscience, Columbia University Medical Center, New York City, NY, USAEric Trautmann, Mark M. Churchland & Liam PaninskiGrossman Center for the Statistics of Mind, Columbia University, New York City, NY, USAEric Trautmann, Mark M. Churchland & Liam PaninskiCTRL-Labs at Reality Labs, Seattle, WA, USAEric TrautmannDepartment of Neurological Surgery, University of California, Davis, Davis, CA, USAEric TrautmannDavid Geffen School of Medicine, University of California, Los Angeles, Los Angeles, CA, USAMax Melin, João Couto & Anne K. ChurchlandCentre National de la Recherche Scientifique, Centre de Recherche en Neurosciences de Lyon, Lyon, FranceSamuel GarciaNYU Neuroscience Institute and Department of Otolaryngology, New York University Langone Medical Center, New York City, NY, USMargot Elmaleh & Michael A. LongDepartment of Neurosurgery, University of Iowa Hospitals and Clinics, Iowa City, IA, USADavid Christianson & Jeremy D. W. GreenleeDepartment of Information Technology and Bionics, Péter Pázmány Catholic University, Budapest, HungaryIstván UlbertDepartment of Neurosurgery and Neurointervention, Faculty of Medicine, Semmelweis University, Budapest, HungaryIstván UlbertHoward Hughes Medical Institute, Chevy Chase, MD, USAMichael N. ShadlenKavli Institute for Brain Science, Columbia University, New York City, NY, USAMark M. ChurchlandDepartment of Computer Science & Engineering, New York University, New York City, NY, USAErdem VarolAuthorsCharlie WindolfView author publicationsYou can also search for this author in
PubMed Google ScholarHan YuView author publicationsYou can also search for this author in
PubMed Google ScholarAngelique C. PaulkView author publicationsYou can also search for this author in
PubMed Google ScholarDomokos MeszénaView author publicationsYou can also search for this author in
PubMed Google ScholarWilliam MuñozView author publicationsYou can also search for this author in
PubMed Google ScholarJulien BoussardView author publicationsYou can also search for this author in
PubMed Google ScholarRichard HardstoneView author publicationsYou can also search for this author in
PubMed Google ScholarIrene CapraraView author publicationsYou can also search for this author in
PubMed Google ScholarMohsen JamaliView author publicationsYou can also search for this author in
PubMed Google ScholarYoav KfirView author publicationsYou can also search for this author in
PubMed Google ScholarDuo XuView author publicationsYou can also search for this author in
PubMed Google ScholarJason E. ChungView author publicationsYou can also search for this author in
PubMed Google ScholarKristin K. SellersView author publicationsYou can also search for this author in
PubMed Google ScholarZhiwen YeView author publicationsYou can also search for this author in
PubMed Google ScholarJordan ShakerView author publicationsYou can also search for this author in
PubMed Google ScholarAnna LebedevaView author publicationsYou can also search for this author in
PubMed Google ScholarRT RaghavanView author publicationsYou can also search for this author in
PubMed Google ScholarEric TrautmannView author publicationsYou can also search for this author in
PubMed Google ScholarMax MelinView author publicationsYou can also search for this author in
PubMed Google ScholarJoão CoutoView author publicationsYou can also search for this author in
PubMed Google ScholarSamuel GarciaView author publicationsYou can also search for this author in
PubMed Google ScholarBrian CoughlinView author publicationsYou can also search for this author in
PubMed Google ScholarMargot ElmalehView author publicationsYou can also search for this author in
PubMed Google ScholarDavid ChristiansonView author publicationsYou can also search for this author in
PubMed Google ScholarJeremy D. W. GreenleeView author publicationsYou can also search for this author in
PubMed Google ScholarCsaba HorváthView author publicationsYou can also search for this author in
PubMed Google ScholarRichárd FiáthView author publicationsYou can also search for this author in
PubMed Google ScholarIstván UlbertView author publicationsYou can also search for this author in
PubMed Google ScholarMichael A. LongView author publicationsYou can also search for this author in
PubMed Google ScholarJ. Anthony MovshonView author publicationsYou can also search for this author in
PubMed Google ScholarMichael N. ShadlenView author publicationsYou can also search for this author in
PubMed Google ScholarMark M. ChurchlandView author publicationsYou can also search for this author in
PubMed Google ScholarAnne K. ChurchlandView author publicationsYou can also search for this author in
PubMed Google ScholarNicholas A. SteinmetzView author publicationsYou can also search for this author in
PubMed Google ScholarEdward F. ChangView author publicationsYou can also search for this author in
PubMed Google ScholarJeffrey S. SchweitzerView author publicationsYou can also search for this author in
PubMed Google ScholarZiv M. WilliamsView author publicationsYou can also search for this author in
PubMed Google ScholarSydney S. CashView author publicationsYou can also search for this author in
PubMed Google ScholarLiam PaninskiView author publicationsYou can also search for this author in
PubMed Google ScholarErdem VarolView author publicationsYou can also search for this author in
PubMed Google ScholarContributionsC.W., J.B., L.P. and E.V. conceptualized the method. A.C.P., D.M., W.M., R.H., I.C., M.J., Y.K., D.X., J.E.C., K.K.S., Z.Y., J.S., A.L., R.R., E.T., M.D.M., J.C., B.C., M.E., D.C., J.D.W.G., C.H., R.F. and J.S.S. collected data. C.W., H.Y., A.C.P., D.M., W.M., R.H., I.C., M.J., Y.K. and M.E. conducted data analysis. C.W., H.Y., A.C.P., W.M., J.B., R.H., Y.K. and S.G. developed software. C.W., H.Y., A.C.P., D.M., W.M., J.B., R.H., I.C., M.J., Y.K., A.L., R.R. and S.G. tested software and evaluated methods. C.W., H.Y., A.C.P., D.M., W.M., J.B., R.H., L.P. and E.V. wrote the manuscript. C.W., A.C.P., D.M., W.M., R.H., L.P. and E.V. edited and revised the manuscript. C.W., H.Y., A.C.P., W.M., J.B., R.H., L.P. and E.V. visualized data and analyses. M.A.L., M.M.C., A.K.C., N.A.S., E.F.C., Z.M.W., S.S.C., L.P. and E.V. supervised aspects of the work. A.C.P., I.U., M.A.L., J.M., M.N.S., M.M.C., A.K.C., N.A.S., E.F.C., Z.M.W., S.S.C., L.P. and E.V. obtained funding.Corresponding authorCorrespondence to
Charlie Windolf.Ethics declarations
Competing interests
The MGH Translational Research Center has clinical research support agreements with Neuralink, Paradromics and Synchron, for which S.S.C. provides consultative input. E.M.T. works for Meta Platform’s Reality Lab, but the work presented here was performed in E.M.T.’s prior role at Columbia. None of these entities listed are involved with this research or the NP device. The remaining authors declare no competing interests.
Peer review
Peer review information
Nature Methods thanks Ueli Rutishauser and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. Primary Handling Editor: Nina Vogt, in collaboration with the Nature Methods team. Peer reviewer reports are available.
Additional informationPublisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.Extended dataExtended Data Fig. 1 Measuring DREDge’s run time in AP and LFP.a, Tukey boxplots demonstrating run time breakdown in n = 8 ≈ 1hr (left, 76 ± 18 min) acute recordings made by the IBL35. Right, filtering indicates the IBL’s raw data pipeline18; peaks and localization include peak detection, denoising, and localization steps37,38. DREDge indicates the time spent computing cross-correlations and optimizing tracked motion. b, boxplots of run times in n = 7 10min (10.4 ± 1.8min, left) human tip-layout recordings13. Online nonrigid motion estimation at 250Hz temporal resolution ran at roughly one quarter of real time (right). These benchmarks were conducted on academic cluster hardware: a, Intel Skylake 6148 processors and NVIDIA V100 GPU; b, Intel Xeon Gold 6126 processors and NVIDIA V100 GPU. All box limits and notch are quartiles, whiskers extend at most 1.5IQR.Extended Data Fig. 2 Motion tracking comparisons.a, Manual tracking method using tracing in Blender to track voltage changes in the LFP through time. b, Motion traces tracked manually (black lines) versus those used with DREDge (blue) in three data sets; Pearson correlations between manual and DREDge motion traces per participant, p < 10−6 in all cases. Top row: full traces of the data through time. Bottom row: zoomed-in views from the grey-outlined boxes shown in the top row. c, Power spectra of the motion traces tracked manually (black lines) versus those used with DREDge (blue) in three data sets. Top row: full power spectra of the motion track through time. Bottom row: zoomed-in views from the grey-outlined boxes shown in the top row. d, Motion tracked using video of the brain movements during a Neuropixels recording and an open craniotomy. Left: video of the intraoperative recording and the pumping evident in the CSF surrounding the electrode was tracked through time. Right: video-tracked movements in the same patient (Pt. 03) at two different scales. e, Power spectrum of the motion tracked using video of the brain movements during a Neuropixels recording and an open craniotomy. Top spectrum: zoomed-out view. Bottom power spectrum plot: zoomed-in view of the video motion tracked overlaid on the same spectra of the DREDge and manual motion tracked for the same case (Pt03).Extended Data Fig. 3 Spline registration.a Spike raster before registration, with AP DREDge displacement estimate overlaid in red. b Spike raster after registration (grey). Colored spikes represent high amplitude spikes that were clustered by HDBSCAN using their registered positions and amplitudes. c Left, centered positions of the clustered spikes (blue) with the spline fit, that captures the sub-second displacement, overlaid in red. Right, zoom of this time-series between times 100 and 110 seconds. d Top, AP registered spike raster. Bottom, AP registered spike raster corrected using the spline estimate of sub-second displacement. e Localizations of detected spikes after AP DREDge registration (left), and spline correction (right).Extended Data Fig. 4 Nonrigid motion correction is beneficial in human and mouse recordings.a The effect of nonrigid correction is visualized by plotting a detail (top) of the unregistered spike activity overlaid with DREDge-LFP’s nonrigid (blue) and rigid (green) motion traces. Left column, a human dataset14; right column, an IBL recording35. b shares the same layout, showing a detail of an IBL Neuropixels 1 recording. c In three human recordings, the spike activity stability metric (top row, higher is better) is shown under nonrigid correction (blue) and rigid correction (green); visualized by sliding means and standard deviations in windows of length 61s (n = 61 bins). Bottom row: visualizations of the drift trace across nonrigid bins (bottom row; darker colors indicate bins closer to brain surface). In d, consistent correlation metric traces (top panels) and nonrigid motion traces (bottom panels) in 9 IBL Neuropixels recordings selected from a diverse set of brain regions; top row’s sliding confidence intervals as in c.Extended Data Fig. 5 Clustering before and after corrections.a, A subset of spike detections and sorted units (with different single unit clusters color coded as dots) across channels before (top) and after (bottom) registration with an optimized DREDge motion estimate (black line). b, Average spatial distribution of spike clusters when non-interpolated (left) and 250 Hz-interpolated (middle) from Fig. 2.g, where a single slice taken from the middle time range (dotted lines in the left) is then compared across clusters for the amplitude relative to the spatial spread (right plot). The average amplitudes and standard error of the mean (SEM) curves of the spike amplitudes for the raw data versus the motion corrected data set were compared using a two-sided two sample t-test at each distance from center, Bonferroni corrected with a threshold of p < 0.05. Red ‘x’ markers indicate the distance from the peak center waveform where the motion corrected spike waveforms are higher than the raw sampled waveforms. Blue ‘o’ markers indicate the distance from the peak center waveform where the raw spike waveforms are higher than the motion corrected sampled waveforms.Extended Data Fig. 6 Motion estimation in non-Neuropixels human recordings.a Probe geometry icon: 16μm-diameter circular electrodes are arranged in a staggered grid with vertical and horizontal pitches of 50 and 43.3μm. b-d DREDge’s LFP and AP-based tracking in three human awake recordings made with a 128-channel probe with a 30μm pitch. In each panel, the top left graphic shows spike localizations with DREDge’s rigid AP (blue) and LFP (green) tracking overlaid, with a detail zoom inset into these motion traces overlaid over a corresponding period of LFP activity (top right), showing the finer time resolution of the LFP-based tracking. Below, spike positions corrected by DREDge-AP (left) and DREDge-LFP (right).Extended Data Fig. 7 Effects of motion correction interpolation and Zapline-plus applied to LFP on average visually evoked potentials in human brain activity.a, Responses to the onset of white shapes (n=50 trials) in raw spontaneous LFP (left), raw data with Zapline-plus correction of low-frequency peaks (second column), motion-correction interpolation of LFP without Zapline-plus correction (third column), motion-correction interpolation of LFP with Zapline-plus correction (fourth column). b, Responses to the onset of black shapes (n=50 trials) in raw spontaneous LFP (left), raw data with Zapline-plus correction of low-frequency peaks (second column), motion-correction interpolation of LFP without Zapline-plus correction (third column), motion-correction interpolation of LFP with Zapline-plus correction (fourth column).Extended Data Fig. 8 Effects of interpolation and Zapline-plus steps on detected burst sup- pression signals during general anesthesia.a, Raw spontaneous detected bursts (red dots) in the common median LFP (top) relative to the activity across channels (bottom two rows) for the raw LFP (left), raw data with Zapline-plus correction of low-frequency peaks (second column), motion- correction interpolation of LFP without Zapline-plus correction (third column), motion-correction in- terpolation of LFP with Zapline-plus correction (fourth column), (N=1, Pt01). b, Raw spontaneous detected bursts (red dots) in the common median LFP (top) relative to the activity across channels (bottom two rows) for the raw LFP (left), raw data with Zapline-plus correction of low-frequency peaks (second column), motion-correction interpolation of LFP without Zapline-plus correction (third column), motion-correction interpolation of LFP with Zapline-plus correction (fourth column), (N=1, Pt03). c, Raw spontaneous detected bursts (red dots) in the common median LFP (top) relative to the activity across channels (bottom two rows) for the raw LFP (left), raw data with Zapline-plus correction of low-frequency peaks (second column), motion-correction interpolation of LFP without Zapline-plus correction (third column), motion-correction interpolation of LFP with Zapline-plus correction (fourth column), (N=1, Pt03). This example includes a detected epileptiform IID.Extended Data Fig. 9 Spike feature scatter plots.Spatial scatter plots of the spike features of Fig. 4.f, visualizing the individual spikes whose features were averaged to create that panel.Extended Data Table 1 Parameters listing for DREDge and KS 2.5Full size tableSupplementary informationSupplementary InformationSupplementary Text and Supplementary Figs. 1–18.Reporting SummaryPeer Review FileSupplementary Video 1Movement of the cortex relative to the NP probe.Rights and permissionsSpringer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.Reprints and permissionsAbout this articleCite this articleWindolf, C., Yu, H., Paulk, A.C. et al. DREDge: robust motion correction for high-density extracellular recordings across species.
Nat Methods (2025). https://doi.org/10.1038/s41592-025-02614-5Download citationReceived: 31 October 2023Accepted: 24 January 2025Published: 06 March 2025DOI: https://doi.org/10.1038/s41592-025-02614-5Share this articleAnyone you share the following link with will be able to read this content:Get shareable linkSorry, a shareable link is not currently available for this article.Copy to clipboard
Provided by the Springer Nature SharedIt content-sharing initiative