Skip to content

Commit

Permalink
Clean up submodule and add remarks
Browse files Browse the repository at this point in the history
- Add remarks for ProbeConfiguration variables
- Add Category attributes to Neuropixels properties
- Remove submodule and reference OpenEphys.ProbeInterface directly from NuGet
- Remove AnyCPU options
  • Loading branch information
bparks13 committed Aug 14, 2024
1 parent a5aff1b commit 35b02e4
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 43 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "OpenEphys.ProbeInterface"]
path = OpenEphys.ProbeInterface
url = https://github.com/open-ephys/OpenEphys.ProbeInterface
4 changes: 2 additions & 2 deletions OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Windows.Forms;
using ZedGraph;
using System;
using OpenEphys.ProbeInterface;
using OpenEphys.ProbeInterface.NET;
using System.Collections.Generic;

namespace OpenEphys.Onix1.Design
Expand All @@ -19,7 +19,7 @@ public abstract partial class ChannelConfigurationDialog : Form
/// <summary>
/// Local variable that holds the channel configuration in memory until the user presses Okay
/// </summary>
ProbeGroup ChannelConfiguration;
internal ProbeGroup ChannelConfiguration;

internal readonly List<int> ReferenceContacts = new();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using OpenEphys.ProbeInterface;
using OpenEphys.ProbeInterface.NET;
using ZedGraph;

namespace OpenEphys.Onix1.Design
Expand Down Expand Up @@ -57,6 +57,10 @@ internal override ProbeGroup DefaultChannelLayout()
internal override void LoadDefaultChannelLayout()
{
ProbeConfiguration = new(ProbeConfiguration.Probe, ProbeConfiguration.Reference);
ChannelConfiguration = ProbeConfiguration.ChannelConfiguration;

DrawProbeGroup();
RefreshZedGraph();

OnFileOpenHandler();
}
Expand Down
4 changes: 2 additions & 2 deletions OpenEphys.Onix1.Design/OpenEphys.Onix1.Design.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bonsai.Design" Version="2.8.1" />
<PackageReference Include="Bonsai.Design" Version="2.8.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="OpenEphys.ProbeInterface.NET" Version="0.1.0" />
<PackageReference Include="ZedGraph" Version="5.1.7" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\OpenEphys.Onix1\OpenEphys.Onix1.csproj" />
<ProjectReference Include="..\OpenEphys.ProbeInterface\OpenEphys.ProbeInterface\OpenEphys.ProbeInterface.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 0 additions & 20 deletions OpenEphys.Onix1.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenEphys.ProbeInterface", "OpenEphys.ProbeInterface\OpenEphys.ProbeInterface\OpenEphys.ProbeInterface.csproj", "{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|Any CPU.ActiveCfg = Debug|x64
{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|Any CPU.Build.0 = Debug|x64
{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|x64.ActiveCfg = Debug|x64
{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|x64.Build.0 = Debug|x64
{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|Any CPU.ActiveCfg = Release|x64
{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|Any CPU.Build.0 = Release|x64
{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|x64.ActiveCfg = Release|x64
{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|x64.Build.0 = Release|x64
{149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|Any CPU.ActiveCfg = Debug|x64
{149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|Any CPU.Build.0 = Debug|x64
{149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|x64.ActiveCfg = Debug|x64
{149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|x64.Build.0 = Debug|x64
{149E86EC-B865-463D-81A8-8290CA7F8871}.Release|Any CPU.ActiveCfg = Release|x64
{149E86EC-B865-463D-81A8-8290CA7F8871}.Release|Any CPU.Build.0 = Release|x64
{149E86EC-B865-463D-81A8-8290CA7F8871}.Release|x64.ActiveCfg = Release|x64
{149E86EC-B865-463D-81A8-8290CA7F8871}.Release|x64.Build.0 = Release|x64
{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}.Debug|x64.ActiveCfg = Debug|Any CPU
{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}.Debug|x64.Build.0 = Debug|Any CPU
{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}.Release|Any CPU.Build.0 = Release|Any CPU
{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}.Release|x64.ActiveCfg = Release|Any CPU
{CDC8058A-48DD-49FE-BFC8-9F12F353D29D}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
14 changes: 14 additions & 0 deletions OpenEphys.Onix1/ConfigureNeuropixelsV2e.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public ConfigureNeuropixelsV2e(ConfigureNeuropixelsV2e configureNode)
/// <summary>
/// Gets or sets the electrode configuration for Probe A.
/// </summary>
/// <remarks>
/// Configuration is accomplished using a GUI to aid in channel selection and relevant configuration properties.
/// To open a probe configuration GUI, select the ellipses next the <see cref="ProbeConfigurationA"/> variable
/// in the property pane, or double-click <see cref="ConfigureNeuropixelsV2eHeadstage"/> to configure both
/// probes and the <see cref="ConfigureNeuropixelsV2eBno055"/> simultaneously.
/// </remarks>
[Category(ConfigurationCategory)]
[Description("Probe A electrode configuration.")]
[Editor("OpenEphys.Onix1.Design.NeuropixelsV2eProbeConfigurationEditor, OpenEphys.Onix1.Design", typeof(UITypeEditor))]
Expand All @@ -63,6 +69,7 @@ public ConfigureNeuropixelsV2e(ConfigureNeuropixelsV2e configureNode)
/// Each probe must be provided with a gain calibration file that contains calibration data
/// specific to each probe. This file is mandatory for accurate recordings.
/// </remarks>
[Category(ConfigurationCategory)]
[FileNameFilter("Gain calibration files (*_gainCalValues.csv)|*_gainCalValues.csv")]
[Description("Path to the gain calibration file for probe A.")]
[Editor("Bonsai.Design.OpenFileNameEditor, Bonsai.Design", DesignTypes.UITypeEditor)]
Expand All @@ -71,6 +78,12 @@ public ConfigureNeuropixelsV2e(ConfigureNeuropixelsV2e configureNode)
/// <summary>
/// Gets or sets the electrode configuration for Probe B.
/// </summary>
/// <remarks>
/// Configuration is accomplished using a GUI to aid in channel selection and relevant configuration properties.
/// To open a probe configuration GUI, select the ellipses next the <see cref="ProbeConfigurationB"/> variable
/// in the property pane, or double-click <see cref="ConfigureNeuropixelsV2eHeadstage"/> to configure both
/// probes and the <see cref="ConfigureNeuropixelsV2eBno055"/> simultaneously.
/// </remarks>
[Category(ConfigurationCategory)]
[Description("Probe B electrode configuration.")]
[Editor("OpenEphys.Onix1.Design.NeuropixelsV2eProbeConfigurationEditor, OpenEphys.Onix1.Design", typeof(UITypeEditor))]
Expand All @@ -83,6 +96,7 @@ public ConfigureNeuropixelsV2e(ConfigureNeuropixelsV2e configureNode)
/// Each probe must be provided with a gain calibration file that contains calibration data
/// specific to each probe. This file is mandatory for accurate recordings.
/// </remarks>
[Category(ConfigurationCategory)]
[FileNameFilter("Gain calibration files (*_gainCalValues.csv)|*_gainCalValues.csv")]
[Description("Path to the gain calibration file for probe B.")]
[Editor("Bonsai.Design.OpenFileNameEditor, Bonsai.Design", DesignTypes.UITypeEditor)]
Expand Down
2 changes: 2 additions & 0 deletions OpenEphys.Onix1/ConfigureNeuropixelsV2eBeta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public ConfigureNeuropixelsV2eBeta()
/// Each probe must be provided with a gain calibration file that contains calibration data
/// specific to each probe. This file is mandatory for accurate recordings.
/// </remarks>
[Category(ConfigurationCategory)]
[FileNameFilter("Gain calibration files (*_gainCalValues.csv)|*_gainCalValues.csv")]
[Description("Path to the gain calibration file for probe A.")]
[Editor("Bonsai.Design.OpenFileNameEditor, Bonsai.Design", DesignTypes.UITypeEditor)]
Expand All @@ -73,6 +74,7 @@ public ConfigureNeuropixelsV2eBeta()
/// Each probe must be provided with a gain calibration file that contains calibration data
/// specific to each probe. This file is mandatory for accurate recordings.
/// </remarks>
[Category(ConfigurationCategory)]
[FileNameFilter("Gain calibration files (*_gainCalValues.csv)|*_gainCalValues.csv")]
[Description("Path to the gain calibration file for probe B.")]
[Editor("Bonsai.Design.OpenFileNameEditor, Bonsai.Design", DesignTypes.UITypeEditor)]
Expand Down
18 changes: 9 additions & 9 deletions OpenEphys.Onix1/NeuropixelsV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ internal static BitArray[] GenerateShankBits(NeuropixelsV2QuadShankProbeConfigur
{
BitArray[] shankBits =
{
new(NeuropixelsV2.RegistersPerShank, false),
new(NeuropixelsV2.RegistersPerShank, false),
new(NeuropixelsV2.RegistersPerShank, false),
new(NeuropixelsV2.RegistersPerShank, false)
new(RegistersPerShank, false),
new(RegistersPerShank, false),
new(RegistersPerShank, false),
new(RegistersPerShank, false)
};


Expand All @@ -69,7 +69,7 @@ internal static BitArray[] GenerateShankBits(NeuropixelsV2QuadShankProbeConfigur
shankBits[3][1285] = true;
}

const int PixelOffset = (NeuropixelsV2.ElectrodePerShank - 1) / 2;
const int PixelOffset = (ElectrodePerShank - 1) / 2;
const int ReferencePixelOffset = 3;
foreach (var c in probe.ChannelMap)
{
Expand All @@ -89,8 +89,8 @@ internal static BitArray[] GenerateBaseBits(NeuropixelsV2QuadShankProbeConfigura
{
BitArray[] baseBits =
{
new(NeuropixelsV2.ChannelCount * NeuropixelsV2.BaseBitsPerChannel / 2, false),
new(NeuropixelsV2.ChannelCount * NeuropixelsV2.BaseBitsPerChannel / 2, false)
new(ChannelCount * BaseBitsPerChannel / 2, false),
new(ChannelCount * BaseBitsPerChannel / 2, false)
};

var referenceBit = probe.Reference switch
Expand All @@ -103,10 +103,10 @@ internal static BitArray[] GenerateBaseBits(NeuropixelsV2QuadShankProbeConfigura
_ => throw new InvalidOperationException("Invalid reference selection."),
};

for (int i = 0; i < NeuropixelsV2.ChannelCount; i++)
for (int i = 0; i < ChannelCount; i++)
{
var configIndex = i % 2;
var bitOffset = (382 - i + configIndex) / 2 * NeuropixelsV2.BaseBitsPerChannel;
var bitOffset = (382 - i + configIndex) / 2 * BaseBitsPerChannel;
baseBits[configIndex][bitOffset + 0] = false; // standby bit
baseBits[configIndex][bitOffset + referenceBit] = true;
}
Expand Down
2 changes: 1 addition & 1 deletion OpenEphys.Onix1/NeuropixelsV2eProbeGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using OpenEphys.ProbeInterface;
using OpenEphys.ProbeInterface.NET;

namespace OpenEphys.Onix1
{
Expand Down
5 changes: 1 addition & 4 deletions OpenEphys.Onix1/OpenEphys.Onix1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
<PackageReference Include="Bonsai.Core" Version="2.8.5" />
<PackageReference Include="clroni" Version="6.1.2" />
<PackageReference Include="OpenCV.Net" Version="3.4.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\OpenEphys.ProbeInterface\OpenEphys.ProbeInterface\OpenEphys.ProbeInterface.csproj" />
<PackageReference Include="OpenEphys.ProbeInterface.NET" Version="0.1.0" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion OpenEphys.ProbeInterface
Submodule OpenEphys.ProbeInterface deleted from 524b4c

0 comments on commit 35b02e4

Please sign in to comment.