@@ -24,13 +24,31 @@ class WhiteMatterRecordingExtractor(BinaryRecordingExtractor):
2424 A list of channel ids. If None, channel_ids = list(range(num_channels)).
2525 is_filtered : bool or None, default: None
2626 If True, the recording is assumed to be filtered. If None, `is_filtered` is not set.
27- """
27+ gain_to_uV : float | None, default: 0.190734863
28+ Micro-volt conversion factor (ADC count → µV).
29+
30+ Where to look
31+ -------------
32+ • **Head-stage files** (64 neural chan.):
33+ *settingsHeadstages.xml* →
34+ `<CHANNEL … voltsperbit="1.907348633e-7" />`
35+ → 0.190 734 863 µV per count.
36+
37+ • **Analog-panel files** (32 aux chan., ±10 V range in our example):
38+ *settingsAnalogPanel.xml* →
39+ `<CHANNEL … voltsperbit="3.0517578125e-4" />`
40+ → 305.175 781 µV per count.
2841
29- mode = "file"
42+ Use the value from the corresponding XML file when loading data.
43+ If *gain_to_uV* is left as *None* the extractor assumes the
44+ head-stage constant (0.190734863 µV/bit). Different hardware
45+ ranges will have different *voltsperbit* numbers, so always double-check
46+ for your specific setup.
47+ """
3048
3149 # Specific parameters for WhiteMatter format
3250 DTYPE = "int16"
33- GAIN_TO_UV = 6.25e3 / 32768
51+ HEADSTAGE_GAIN_TO_UV = 0.190734863
3452 OFFSET_TO_UV = 0.0
3553 FILE_OFFSET = 8
3654 TIME_AXIS = 0
@@ -45,15 +63,19 @@ def __init__(
4563 num_channels : int ,
4664 channel_ids : Optional [List ] = None ,
4765 is_filtered : Optional [bool ] = None ,
66+ gain_to_uV : Optional [float ] = None ,
4867 ):
68+
69+ gain_to_uV = gain_to_uV if gain_to_uV is not None else self .HEADSTAGE_GAIN_TO_UV
70+
4971 super ().__init__ (
5072 file_paths = [file_path ],
5173 sampling_frequency = sampling_frequency ,
5274 num_channels = num_channels ,
5375 dtype = self .DTYPE ,
5476 time_axis = self .TIME_AXIS ,
5577 file_offset = self .FILE_OFFSET ,
56- gain_to_uV = self . GAIN_TO_UV ,
78+ gain_to_uV = gain_to_uV ,
5779 offset_to_uV = self .OFFSET_TO_UV ,
5880 is_filtered = is_filtered ,
5981 channel_ids = channel_ids ,
@@ -65,6 +87,7 @@ def __init__(
6587 "num_channels" : num_channels ,
6688 "channel_ids" : channel_ids ,
6789 "is_filtered" : is_filtered ,
90+ "gain_to_uV" : gain_to_uV ,
6891 }
6992
7093
0 commit comments