OpenEphys settings¶
All of the plugins that sit in the OpenEphys signal chain are parsed out from the settings.xml file and take a similar format. They are available as the 'processors' OrderedDict of the Settings class.
trial.settings.processors.keys()
odict_keys(['Acquisition Board 100', 'Bandpass Filter 107', 'LFP Viewer 102', 'TrackMe 103', 'Tracking Visual 105', 'StimControl 109', 'StimControl 110'])
The settings for each RecordNode is similarly avaialble as an OrderedDict in the 'record_nodes' attribute:
Record nodes¶
The settings for the Record Nodes are saved as a dataclass:
ephysiopy.openephys2py.OESettings.RecordNode(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0), path: str = str(), engine: str = str(), recordEvents: IntConversion = IntConversion(default=0), recordSpikes: IntConversion = IntConversion(default=0), isMainStream: IntConversion = IntConversion(default=0), sync_line: IntConversion = IntConversion(default=0), source_node_id: IntConversion = IntConversion(default=0), recording_state: str = str())
dataclass
¶
Bases: OEPlugin
Documents the RecordNode plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
The file path associated with the RecordNode. |
engine |
str
|
The engine used by the RecordNode. |
recordEvents |
IntConversion
|
Indicates if events are recorded, converted from a string. |
recordSpikes |
IntConversion
|
Indicates if spikes are recorded, converted from a string. |
isMainStream |
IntConversion
|
Indicates if this is the main stream, converted from a string. |
sync_line |
IntConversion
|
The sync line, converted from a string. |
source_node_id |
IntConversion
|
The source node ID, converted from a string. |
recording_state |
str
|
The recording state of the RecordNode. |
The settings for OpenEphys data are saved to a settings.xml file. This is loaded automatically when an OpenEphys trial object is created. Each OpenEphys plugin derives from the OEPlugin dataclass:
OpenEphys plugins¶
ephysiopy.openephys2py.OESettings.OEPlugin(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0))
dataclass
¶
Bases: ABC
Documents an OE plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the plugin. |
insertionPoint |
IntConversion
|
The insertion point of the plugin, converted from a string. |
pluginName |
str
|
The name of the plugin. |
type |
IntConversion
|
The type of the plugin, converted from a string. |
index |
IntConversion
|
The index of the plugin, converted from a string. |
libraryName |
str
|
The name of the library. |
libraryVersion |
str
|
The version of the library. |
processorType |
IntConversion
|
The type of processor, converted from a string. |
nodeId |
IntConversion
|
The node ID, converted from a string. |
channel_count |
IntConversion
|
The number of channels, converted from a string. |
stream |
Stream
|
The data stream associated with the plugin. |
sample_rate |
FloatConversion
|
The sample rate, converted from a string. |
It should be straightforawrd to create new classes that derive from OEPlugin when new plugins become available.
ephysiopy.openephys2py.OESettings.RhythmFPGA(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0), channel_info: list[Channel] = list())
dataclass
¶
Bases: OEPlugin
Documents the Rhythm FPGA plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
channel_info |
list of Channel
|
A list containing information about each channel. |
ephysiopy.openephys2py.OESettings.NeuropixPXI(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0), channel_info: list[Channel] = list())
dataclass
¶
Bases: OEPlugin
Documents the Neuropixels-PXI plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
channel_info |
list of Channel
|
A list containing information about each channel. |
ephysiopy.openephys2py.OESettings.AcquisitionBoard(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0), LowCut: FloatConversion = FloatConversion(default=0), HighCut: FloatConversion = FloatConversion(default=0))
dataclass
¶
Bases: OEPlugin
Documents the Acquisition Board plugin
Attributes:
| Name | Type | Description |
|---|---|---|
LowCut |
FloatConversion
|
The low cut-off frequency for the acquisition board. |
HighCut |
FloatConversion
|
The high cut-off frequency for the acquisition board. |
ephysiopy.openephys2py.OESettings.BandpassFilter(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0), channels: list[int] = list(), low_cut: FloatConversion = FloatConversion(default=0), high_cut: FloatConversion = FloatConversion(default=0))
dataclass
¶
Bases: OEPlugin
Documents the Bandpass Filter plugin
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the plugin. |
pluginName |
str
|
The display name of the plugin. |
pluginType |
int
|
The type identifier for the plugin. |
libraryName |
str
|
The library name of the plugin. |
channels |
list of int
|
The list of channels to which the filter is applied. |
low_cut |
FloatConversion
|
The low cut-off frequency for the bandpass filter. |
high_cut |
FloatConversion
|
The high cut-off frequency for the bandpass filter. |
ephysiopy.openephys2py.OESettings.TrackingPort(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0))
dataclass
¶
Bases: OEPlugin
Documents the Tracking Port plugin which uses Bonsai input and Tracking Visual plugin for visualisation within OE
Methods:
| Name | Description |
|---|---|
load |
Load Tracking Port data from a specified path. |
load_times |
Load timestamps from a specified path. |
ephysiopy.openephys2py.OESettings.PosTracker(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: IntConversion = IntConversion(default=30), Brightness: IntConversion = IntConversion(default=20), Contrast: IntConversion = IntConversion(default=20), Exposure: IntConversion = IntConversion(default=20), LeftBorder: IntConversion = IntConversion(default=0), RightBorder: IntConversion = IntConversion(default=800), TopBorder: IntConversion = IntConversion(default=0), BottomBorder: IntConversion = IntConversion(default=600), AutoExposure: bool = False, OverlayPath: bool = False)
dataclass
¶
Bases: OEPlugin
Documents the PosTracker plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
Brightness |
IntConversion
|
Brightness setting for the tracker, default is 20. |
Contrast |
IntConversion
|
Contrast setting for the tracker, default is 20. |
Exposure |
IntConversion
|
Exposure setting for the tracker, default is 20. |
LeftBorder |
IntConversion
|
Left border setting for the tracker, default is 0. |
RightBorder |
IntConversion
|
Right border setting for the tracker, default is 800. |
TopBorder |
IntConversion
|
Top border setting for the tracker, default is 0. |
BottomBorder |
IntConversion
|
Bottom border setting for the tracker, default is 600. |
AutoExposure |
bool
|
Auto exposure setting for the tracker, default is False. |
OverlayPath |
bool
|
Overlay path setting for the tracker, default is False. |
sample_rate |
IntConversion
|
Sample rate setting for the tracker, default is 30. |
Methods:
| Name | Description |
|---|---|
load |
Load Tracking Port data from a specified path. |
load_times |
Load timestamps from a specified path. |
ephysiopy.openephys2py.OESettings.TrackMe(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0))
dataclass
¶
Bases: OEPlugin
Documents the TrackMe plugin.
Methods:
| Name | Description |
|---|---|
load |
Load TrackMe data from a specified path. |
load_times |
Load timestamps from a specified path. |
load_frame_count |
Load frame count data from a specified path. |
load_ttl_times |
Load TTL times from a specified path. |
load(path2data: Path) -> np.ndarray
¶
Load TrackMe data from a specified path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path2data
|
Path
|
The path to the directory containing the data file. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
A 2D numpy array with the TrackMe data. |
load_frame_count(path2data: Path) -> np.ndarray
¶
Load frame count data from a specified path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path2data
|
Path
|
The path to the directory containing the data file. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
A numpy array containing the frame count data. |
ephysiopy.openephys2py.OESettings.StimControl(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0), Device: IntConversion = IntConversion(default=0), Duration: IntConversion = IntConversion(default=0), Interval: IntConversion = IntConversion(default=0), Gate: IntConversion = IntConversion(default=0), Output: IntConversion = IntConversion(default=0), Start: IntConversion = IntConversion(default=0), Stop: IntConversion = IntConversion(default=0), Trigger: IntConversion = IntConversion(default=0))
dataclass
¶
Bases: OEPlugin
Documents the StimControl plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
Device |
IntConversion
|
Device setting for the StimControl, default is 0. |
Duration |
IntConversion
|
Duration setting for the StimControl, default is 0. |
Interval |
IntConversion
|
Interval setting for the StimControl, default is 0. |
Gate |
IntConversion
|
Gate setting for the StimControl, default is 0. |
Output |
IntConversion
|
Output setting for the StimControl, default is 0. |
Start |
IntConversion
|
Start setting for the StimControl, default is 0. |
Stop |
IntConversion
|
Stop setting for the StimControl, default is 0. |
Trigger |
IntConversion
|
Trigger setting for the StimControl, default is 0. |
ephysiopy.openephys2py.OESettings.RippleDetector(name: str = str(), insertionPoint: IntConversion = IntConversion(default=0), pluginName: str = str(), type: IntConversion = IntConversion(default=0), index: IntConversion = IntConversion(default=0), libraryName: str = str(), libraryVersion: str = str(), processorType: IntConversion = IntConversion(default=0), nodeId: IntConversion = IntConversion(default=0), channel_count: IntConversion = IntConversion(default=0), stream: Stream = Stream(), sample_rate: FloatConversion = FloatConversion(default=0), Ripple_Input: IntConversion = IntConversion(default=(-1)), Ripple_Out: IntConversion = IntConversion(default=(-1)), Ripple_save: IntConversion = IntConversion(default=(-1)), ripple_std: FloatConversion = FloatConversion(default=(-1)), time_thresh: FloatConversion = FloatConversion(default=(-1)), refr_time: FloatConversion = FloatConversion(default=(-1)), rms_samples: FloatConversion = FloatConversion(default=(-1)), ttl_duration: FloatConversion = FloatConversion(default=(-1)), ttl_percent: FloatConversion = FloatConversion(default=(-1)), mov_detect: IntConversion = IntConversion(default=(-1)), mov_input: IntConversion = IntConversion(default=(-1)), mov_out: IntConversion = IntConversion(default=(-1)), mov_std: FloatConversion = FloatConversion(default=(-1)), min_time_st: FloatConversion = FloatConversion(default=(-1)), min_time_mov: FloatConversion = FloatConversion(default=(-1)))
dataclass
¶
Bases: OEPlugin
Documents the Ripple Detector plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
Ripple_Input |
IntConversion
|
Input setting for the Ripple Detector, default is -1. |
Ripple_Out |
IntConversion
|
Output setting for the Ripple Detector, default is -1. |
Ripple_save |
IntConversion
|
Save setting for the Ripple Detector, default is -1. |
ripple_std |
FloatConversion
|
Standard deviation setting for the Ripple Detector, default is -1. |
time_thresh |
FloatConversion
|
Time threshold setting for the Ripple Detector, default is -1. |
refr_time |
FloatConversion
|
Refractory time setting for the Ripple Detector, default is -1. |
rms_samples |
FloatConversion
|
RMS samples setting for the Ripple Detector, default is -1. |
ttl_duration |
FloatConversion
|
TTL duration setting for the Ripple Detector, default is -1. |
ttl_percent |
FloatConversion
|
TTL percent setting for the Ripple Detector, default is -1. |
mov_detect |
IntConversion
|
Movement detection setting for the Ripple Detector, default is -1. |
mov_input |
IntConversion
|
Movement input setting for the Ripple Detector, default is -1. |
mov_out |
IntConversion
|
Movement output setting for the Ripple Detector, default is -1. |
mov_std |
FloatConversion
|
Movement standard deviation setting for the Ripple Detector, default is -1. |
min_time_st |
FloatConversion
|
Minimum time setting for the Ripple Detector, default is -1. |
min_time_mov |
FloatConversion
|
Minimum movement time setting for the Ripple Detector, default is -1. |
Methods:
| Name | Description |
|---|---|
load_ttl |
Load TTL data from a specified path and trial start time. |
load_ttl(path2TTL: Path, trial_start_time: float) -> dict
¶
Load TTL data from a specified path and trial start time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path2TTL
|
Path
|
The path to the directory containing the TTL data files. |
required |
trial_start_time
|
float
|
The start time of the trial. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
A dictionary containing the TTL timestamps and other related data. |
There are some helper classes for doing string to int and float conversions:
ephysiopy.openephys2py.OESettings.IntConversion(*, default)
¶
Descriptor class for converting attribute values to integers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default
|
int
|
The default value to return if the attribute is not set. |
required |
Methods:
| Name | Description |
|---|---|
__set_name__ |
Sets the internal name for the attribute. |
__get__ |
Retrieves the attribute value, returning the default if not set. |
__set__ |
Sets the attribute value, converting it to an integer. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default
|
int
|
The default value to return if the attribute is not set. |
required |
ephysiopy.openephys2py.OESettings.FloatConversion(*, default)
¶
Descriptor class for converting attribute values to floats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default
|
float
|
The default value to return if the attribute is not set. |
required |
Methods:
| Name | Description |
|---|---|
__set_name__ |
Sets the internal name for the attribute. |
__get__ |
Retrieves the attribute value, returning the default if not set. |
__set__ |
Sets the attribute value, converting it to a float. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default
|
float
|
The default value to return if the attribute is not set. |
required |