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
In neurophysiology recordings, data is often stored in raw ADC (Analog-to-Digital Converter) units but at various points in an analysis pipeline the end-user may want to observe their data in physical units.
4
+
In neurophysiology recordings, data is often stored in raw ADC (Analog-to-Digital Converter) integer values but needs to be analyzed in physical units.
5
5
For extracellular recordings, this is typically microvolts (µV), but some recording devices may use different physical units.
6
6
SpikeInterface provides tools to handle both situations.
7
7
8
-
It's important to note that **most spike sorters work fine on raw digital (ADC) units** and scaling is not needed.
8
+
It's important to note that **most spike sorters work fine on raw digital (ADC) units** and scaling is not needed. Going a step further, some sorters, such as Kilosort 3, require their input to be in raw ADC units.
9
+
The specific behavior however depends on the spike sorter, so it's important to understand the specific input requirements in a case per case basis.
10
+
9
11
Many preprocessing tools are also linear transformations, and if the ADC is implemented as a linear transformation which is fairly common, then the overall effect can be preserved.
10
-
That is, **preprocessing steps can often be applied either before or after unit conversion without affecting the outcome.**
12
+
That is, **preprocessing steps can often be applied either before or after unit conversion without affecting the outcome.**. That said, there are rough edges to this approach.
13
+
preprocessing algorithms like filtering, whitening, centering, interpolation and common reference require casting to float within the pipeline. We advise users to experiment
14
+
with different approaches to find the best one for their specific use case.
15
+
11
16
12
-
Therefore, **it is usually safe to work in raw ADC units unless a specific tool or analysis requires physical units**.
17
+
Therefore, **it is usually safe to work in raw ADC integer values unless a specific tool or analysis requires physical units**.
13
18
If you are interested in visualizations, comparability across devices, or outputs with interpretable physical scales (e.g., microvolts), converting to physical units is recommended.
14
19
Otherwise, remaining in raw units can simplify processing and preserve performance.
15
20
@@ -36,13 +41,12 @@ SpikeInterface provides two preprocessing classes for converting recordings to p
36
41
``RecordingExtractor`` class and ensures that the data is returned in physical units when calling `get_traces <https://spikeinterface.readthedocs.io/en/stable/api.html#spikeinterface.core.BaseRecording.get_traces>`_
37
42
38
43
1. ``scale_to_uV``: The primary function for extracellular recordings. SpikeInterface is centered around
39
-
extracellular recordings, and this function is designed to convert the data to microvolts (µV). Many plotting
40
-
and analyzing functions in SpikeInterface expect data in microvolts, so this is the recommended approach for most users.
44
+
extracellular recordings, and this function is designed to convert the data to microvolts (µV).
41
45
2. ``scale_to_physical_units``: A general function for any physical unit conversion. This will allow you to extract the data in any
42
-
physical unit, not just microvolts. This is useful for other types of recordings, such as force measurements in Newtons but should be
43
-
handled with care.
46
+
physical unit, not just microvolts. This is useful for other types of recordings, such as force measurements in Newtons but should be
47
+
handled with care.
44
48
45
-
For most users working with extracellular recordings, ``scale_to_uV`` is the recommended choice:
49
+
For most users working with extracellular recordings, ``scale_to_uV`` is the recommended choice if they want to work in physical units:
46
50
47
51
.. code-block:: python
48
52
@@ -71,7 +75,7 @@ Both preprocessors automatically:
71
75
3. Update the recording properties to reflect that data is now in physical units
72
76
73
77
Setting Custom Physical Units
74
-
---------------------------
78
+
-----------------------------
75
79
76
80
While most extractors automatically set the appropriate ``gain_to_uV`` and ``offset_to_uV`` values,
77
81
there might be cases where you want to set custom physical units. In these cases, you can set
@@ -88,7 +92,7 @@ You need to set these properties for every channel, which allows for the case wh
0 commit comments