neurone_loader.neurone¶
Functions¶
neurone_loader.neurone.get_n1_event_format () |
Define the format for the events in a neurone recording. |
neurone_loader.neurone.read_neurone_data (fpath) |
Read the NeurOne signal data from a binary file. |
neurone_loader.neurone.read_neurone_data_info (fpath) |
Read the sample and channel count from a NeurOne signal binary file. |
neurone_loader.neurone.read_neurone_events (fpath) |
Read the NeurOne events from a binary file. |
neurone_loader.neurone.read_neurone_protocol (fpath) |
Read the measurement protocol from an XML file. |
Contains functions for reading data recorded with a Bittium NeurOne device. This module currently supports reading of data and events.
-
neurone_loader.neurone.
get_n1_event_format
()[source]¶ Define the format for the events in a neurone recording.
Arguments: None.
- Returns:
- A Struct (from the construct library) describing the event format.
-
neurone_loader.neurone.
read_neurone_data
(fpath, session_phase=1, protocol=None)[source]¶ Read the NeurOne signal data from a binary file.
- Arguments:
- fpath: the path to the directory holding the
- NeurOne measurement (i.e., the directory Protocol.xml and Session.xml files.
- session_phase:
- The phase of the measurement. Currently only reading of the first phase (1) is supported.
- protocol:
- The dictionary obtained using the function read_neurone_protocol. This argument is optional and if not given, the protocol is automatically read.
- Returns:
- A numpy ndarray with the data, where each columns stores the data for one channel.
-
neurone_loader.neurone.
read_neurone_data_info
(fpath, session_phase=1, protocol=None)[source]¶ Read the sample and channel count from a NeurOne signal binary file.
- Arguments:
- fpath: the path to the directory holding the
- NeurOne measurement (i.e., the directory Protocol.xml and Session.xml files.
- session_phase:
- The phase of the measurement. Currently only reading of the first phase (1) is supported.
- protocol:
- The dictionary obtained using the function read_neurone_protocol. This argument is optional and if not given, the protocol is automatically read.
- Returns:
Returns: - a named tuple containing (i) the number of channels
and (ii) the number of samples in the recording.( n_samples, n_channels )
-
neurone_loader.neurone.
read_neurone_events
(fpath, session_phase=1, sampling_rate=None)[source]¶ Read the NeurOne events from a binary file.
- Arguments:
- fpath: the path to the directory holding the
- NeurOne measurement (i.e., the directory Protocol.xml and Session.xml files.
- sampling_rate:
- The sampling rate of the recording. This argument is optional and if not given, the protocol is automatically read.
- session_phase:
- The phase of the measurement. Currently only reading of the first phase (1) is supported.
- Returns:
- A dict containing the events and the data type for the events.
{“events” : <numpy structured array with the events>, “events_dtype” : <array with the numpy dtype for the events>}
-
neurone_loader.neurone.
read_neurone_protocol
(fpath)[source]¶ Read the measurement protocol from an XML file.
- Arguments:
- fpath: the path to the directory holding the
- NeurOne measurement (i.e., the directory Protocol.xml and Session.xml files.
- Returns:
- a dictionary containing (i) the names of the channels in the recording and (ii) meta information (recording start/stop times, sampling rate).
{“meta” : <dict with metadata>, “channels” : <array with channel names>}