You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drift is a well known issue for long shank probes. Some datasets, especially from primates and humans,
5
+
can experience very fast motion due to breathing and heart beats. In these cases, the standard motion
6
+
estimation methods that use detected spikes as a basis for motion inference will fail, because there
7
+
are not enough spikes to "follow" such fast drifts.
8
+
9
+
Charlie Windolf and colleagues from the Paninski Lab at Columbia have developed a method to estimate
10
+
the motion using the LFP signal: **DREDge**. (more details about the method in the paper
11
+
`DREDge: robust motion correction for high-density extracellular recordings across species <https://doi.org/10.1101/2023.10.24.563768>`_).
12
+
13
+
This method is particularly suited for the open dataset recorded at Massachusetts General Hospital by Angelique Paulk and colleagues in humans (more details in the [paper](https://doi.org/10.1038/s41593-021-00997-0)). The dataset can be dowloaed from [datadryad](https://datadryad.org/stash/dataset/doi:10.5061/dryad.d2547d840) and it contains recordings on human patients with a Neuropixels probe, some of which with very high and fast motion on the probe, which prevents accurate spike sorting without a proper and adequate motion correction
14
+
15
+
The **DREDge** method has two options: **dredge_lfp** and **dredge_ap**, which have both been ported inside `SpikeInterface`.
16
+
17
+
Here we will demonstrate the **dredge_lfp** method to estimate the fast and high drift on this recording.
18
+
19
+
For each patient, the dataset contains two streams:
20
+
21
+
* a highpass "action potential" (AP), sampled at 30kHz
22
+
* a lowpass "local field" (LF) sampled at 2.5kHz
23
+
24
+
For this demonstration, we will use the LF stream.
25
+
26
+
.. code:: ipython3
27
+
28
+
%matplotlib inline
29
+
%load_ext autoreload
30
+
%autoreload 2
31
+
32
+
.. code:: ipython3
33
+
34
+
from pathlib import Path
35
+
import matplotlib.pyplot as plt
36
+
37
+
import spikeinterface.full as si
38
+
from spikeinterface.sortingcomponents.motion import estimate_motion
Contrary to the **dredge_ap** approach, which needs detected peaks and peak locations, the **dredge_lfp**
65
+
method is estimating the motion directly on traces.
66
+
Importantly, the method requires some additional pre-processing steps:
67
+
* ``bandpass_filter``: to "focus" the signal on a particular band
68
+
* ``phase_shift``: to compensate for the sampling misalignement
69
+
* ``resample``: to further reduce the sampling fequency of the signal and speed up the computation. The sampling frequency of the estimated motion will be the same as the resampling frequency. Here we choose 250Hz, which corresponds to a sampling interval of 4ms.
70
+
* ``directional_derivative``: this optional step applies a second order derivative in the spatial dimension to enhance edges on the traces.
71
+
This is not a general rules and need to be tested case by case.
72
+
* ``average_across_direction``: Neuropixels 1.0 probes have two contacts per depth. This steps averages them to obtain a unique virtual signal along the probe depth ("y" in ``spikeinterface``).
73
+
74
+
After appying this preprocessing chain, the motion can be estimated almost by eyes ont the traces plotted with the map mode.
0 commit comments