From 1e707e5e46ce73229965b981bc4a2b166b1fd985 Mon Sep 17 00:00:00 2001 From: jonnew Date: Tue, 5 Nov 2024 11:08:40 -0500 Subject: [PATCH 1/3] Add voltage conversion equations to Neuropixels DataFrame docs --- OpenEphys.Onix1/NeuropixelsV1DataFrame.cs | 16 ++++++++++++---- OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs | 8 ++++++++ OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs | 8 ++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/OpenEphys.Onix1/NeuropixelsV1DataFrame.cs b/OpenEphys.Onix1/NeuropixelsV1DataFrame.cs index 5e786c4..8fde0aa 100644 --- a/OpenEphys.Onix1/NeuropixelsV1DataFrame.cs +++ b/OpenEphys.Onix1/NeuropixelsV1DataFrame.cs @@ -37,8 +37,12 @@ public NeuropixelsV1DataFrame(ulong[] clock, ulong[] hubClock, int[] frameCount, /// Gets the spike-band data as a object. /// /// - /// Spike-band data has 384 rows (channels) with columns representing the samples acquired at 30 kHz. Each sample is a - /// 10-bit, offset binary value encoded as a . + /// Spike-band data has 384 electrodes (rows) with columns representing the samples acquired at 30 kHz. + /// Each sample is a 10-bit, offset binary value encoded as a . To convert to + /// microvolts, the following equation can be used: + /// + /// V_electrode (uV) = 1171.875 uV / AP Gain × (ADC result – 512) + /// /// public Mat SpikeData { get; } @@ -46,8 +50,12 @@ public NeuropixelsV1DataFrame(ulong[] clock, ulong[] hubClock, int[] frameCount, /// Gets the LFP band data as a object. /// /// - /// LFP data has 32 rows (channels) with columns representing the samples acquired at 2.5 kHz. Each sample is a - /// 10-bit, offset binary value encoded as a . + /// LFP-band data has 384 electrodes (rows) with columns representing the samples acquired at 2.5 kHz. + /// Each sample is a 10-bit, offset binary value encoded as a . To convert to + /// microvolts, the following equation can be used: + /// + /// V_electrode (uV) = 1171.875 uV / LFP Gain × (ADC result – 512) + /// /// public Mat LfpData { get; } } diff --git a/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs b/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs index e4e35b1..fbadad7 100644 --- a/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs +++ b/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs @@ -25,6 +25,14 @@ public NeuropixelsV2eBetaDataFrame(ulong[] clock, ulong[] hubClock, Mat amplifie /// /// Gets the amplifier data array. /// + /// + /// Wide band (0.5 Hz - 10 kHz) electophysiology data array. Each element is a amplified sample from + /// 384 electrodes (rows) acquired at 30 kHz (columns). Each sample is a 14-bit, offset binary value + /// encoded as a . To convert to microvolts, the following equation can be used: + /// + /// V_electrode (uV) = 0.91553 uV × (ADC result – 8192) + /// + /// public Mat AmplifierData { get; } /// diff --git a/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs b/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs index 3a3ccbc..278f094 100644 --- a/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs +++ b/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs @@ -23,6 +23,14 @@ public NeuropixelsV2eDataFrame(ulong[] clock, ulong[] hubClock, Mat amplifierDat /// /// Gets the amplifier data array. /// + /// + /// Wide band (0.5 Hz - 10 kHz) electophysiology data array. Each element is a amplified sample from + /// 384 electrodes (rows) acquired at 30 kHz (columns). Each sample is a 12-bit, offset binary value + /// encoded as a . To convert to microvolts, the following equation can be used: + /// + /// V_electrode (uV) = 2.44141 uV × (ADC result – 2048) + /// + /// public Mat AmplifierData { get; } internal static unsafe ushort GetProbeIndex(oni.Frame frame) From 32d1da931ec5f4b44de49d4c23b832876a733524 Mon Sep 17 00:00:00 2001 From: cjsha Date: Wed, 18 Dec 2024 12:00:39 -0500 Subject: [PATCH 2/3] Change np2 & np2beta probe conversions according to jseigle - Also fix typos: - electophysiology -> electrophysiology - "is a amplified" -> "is an amplified" --- OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs | 5 +++-- OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs b/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs index fbadad7..f1d635b 100644 --- a/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs +++ b/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs @@ -26,11 +26,12 @@ public NeuropixelsV2eBetaDataFrame(ulong[] clock, ulong[] hubClock, Mat amplifie /// Gets the amplifier data array. /// /// - /// Wide band (0.5 Hz - 10 kHz) electophysiology data array. Each element is a amplified sample from + /// Wide band (0.5 Hz - 10 kHz) electrophysiology data array. Each element is an amplified sample from /// 384 electrodes (rows) acquired at 30 kHz (columns). Each sample is a 14-bit, offset binary value /// encoded as a . To convert to microvolts, the following equation can be used: /// - /// V_electrode (uV) = 0.91553 uV × (ADC result – 8192) + /// V_electrode (µV) = 1e6/80/2^14 µV × (ADC result – 8192) + /// 1e6/80/2^14 = 0.76294 /// /// public Mat AmplifierData { get; } diff --git a/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs b/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs index 278f094..51a0e64 100644 --- a/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs +++ b/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs @@ -24,11 +24,12 @@ public NeuropixelsV2eDataFrame(ulong[] clock, ulong[] hubClock, Mat amplifierDat /// Gets the amplifier data array. /// /// - /// Wide band (0.5 Hz - 10 kHz) electophysiology data array. Each element is a amplified sample from + /// Wide band (0.5 Hz - 10 kHz) electrophysiology data array. Each element is an amplified sample from /// 384 electrodes (rows) acquired at 30 kHz (columns). Each sample is a 12-bit, offset binary value /// encoded as a . To convert to microvolts, the following equation can be used: /// - /// V_electrode (uV) = 2.44141 uV × (ADC result – 2048) + /// V_electrode (µV) = 1e6/80/2^12 µV × (ADC result – 2048) + /// 1e6/80/2^12 = 3.05176 /// /// public Mat AmplifierData { get; } @@ -102,7 +103,7 @@ internal static unsafe void CopyAmplifierBuffer(ushort* amplifierData, ushort[,] { 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255 }, // Data Index 38, ADC 15 { 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, 381, 383 }, // Data Index 39, ADC 23 - }; + }; } [StructLayout(LayoutKind.Sequential, Pack = 1)] From b636ac2ea908b4794cbc5226ed25c55c06787da2 Mon Sep 17 00:00:00 2001 From: cjsha Date: Wed, 18 Dec 2024 13:38:11 -0500 Subject: [PATCH 3/3] Removed the equation and just left decimal number per jonnew's feedback --- OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs | 3 +-- OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs b/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs index f1d635b..3584f65 100644 --- a/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs +++ b/OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs @@ -30,8 +30,7 @@ public NeuropixelsV2eBetaDataFrame(ulong[] clock, ulong[] hubClock, Mat amplifie /// 384 electrodes (rows) acquired at 30 kHz (columns). Each sample is a 14-bit, offset binary value /// encoded as a . To convert to microvolts, the following equation can be used: /// - /// V_electrode (µV) = 1e6/80/2^14 µV × (ADC result – 8192) - /// 1e6/80/2^14 = 0.76294 + /// V_electrode (µV) = 0.76294 µV/bit × (ADC result – 8192) bits /// /// public Mat AmplifierData { get; } diff --git a/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs b/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs index 51a0e64..bd6a7d0 100644 --- a/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs +++ b/OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs @@ -28,8 +28,7 @@ public NeuropixelsV2eDataFrame(ulong[] clock, ulong[] hubClock, Mat amplifierDat /// 384 electrodes (rows) acquired at 30 kHz (columns). Each sample is a 12-bit, offset binary value /// encoded as a . To convert to microvolts, the following equation can be used: /// - /// V_electrode (µV) = 1e6/80/2^12 µV × (ADC result – 2048) - /// 1e6/80/2^12 = 3.05176 + /// V_electrode (µV) = 3.05176 µV/bit × (ADC result – 2048) bits /// /// public Mat AmplifierData { get; }