List of implemented IO modules#

neo.io provides classes for reading and/or writing electrophysiological data files.

Note that if the package dependency is not satisfied for one io, it does not raise an error but a warning.

neo.io.iolist provides a list of successfully imported io classes.

Functions:

neo.io.get_io(file_or_folder, *args, **kwargs)#

Return a Neo IO instance, guessing the type based on the filename suffix.

neo.io.list_candidate_ios(file_or_folder, ignore_patterns=['*.ini', 'README.txt', 'README.md'])#

Identify neo IO that can potentially load data in the file or folder

Parameters#

file_or_folder (str, pathlib.Path)

Path to the file or folder to load

ignore_patterns (list)

List of patterns to ignore when scanning for known formats. See pathlib.PurePath.match(). Default: [‘ini’]

Returns#

list

List of neo io classes that are associated with the file extensions detected

Classes:

class neo.io.AlphaOmegaIO(filename, lsx_files=None, prune_channels=True)#

AlphaOmega MPX file format 4 reader. Handles several segments. A segment is a continuous recording (when recording starts/stops). Only files in current dirname are loaded, subfolders are not explored.

Parameters#

dirname: str | Path

The folder from which the data will be loaded

lsx_files: list[str] | None, default: None

List of lsx files in dirname referencing mpx files to load (optional) If None all mpx files will be read

prune_channels: bool, default: True

If True removes the empty channels

Notes#

Because channels must be gathered into coherent streams, channels names must be the default channel names in AlphaRS or Alpha LAB SNR software.

extensions = ['lsx', 'mpx']#
class neo.io.AsciiImageIO(file_name=None, nb_frame=None, nb_row=None, nb_column=None, units=None, sampling_rate=None, spatial_scale=None, **kwargs)#

IO class for reading ImageSequence in a text file

Usage:
>>> from neo import io
>>> import quantities as pq
>>> r = io.AsciiImageIO(file_name='File_asciiimage_1.txt',nb_frame=511, nb_row=100,
...                     nb_column=100,units='mm', sampling_rate=1.0*pq.Hz,
...                     spatial_scale=1.0*pq.mm)
>>> block = r.read_block()
read block
creating segment
returning block
>>> block
Block with 1 segments
file_origin: 'File_asciiimage_1.txt
# segments (N=1)
0: Segment with 1 imagesequences # analogsignals (N=0)
extensions = []#
class neo.io.AsciiSignalIO(filename=None, delimiter='\t', usecols=None, skiprows=0, timecolumn=None, sampling_rate=array(1.) * Hz, t_start=array(0.) * s, units=UnitQuantity('volt', 1.0 * J / C, 'V'), time_units=UnitTime('second', 's'), method='genfromtxt', signal_group_mode='split-all', metadata_filename=None)#

Class for reading signals in generic ascii format. Columns represent signals. They all share the same sampling rate. The sampling rate is externally known or the first column could hold the time vector.

Usage:
>>> from neo import io
>>> r = io.AsciiSignalIO(filename='File_asciisignal_2.txt')
>>> seg = r.read_segment()
>>> print seg.analogsignals
[<AnalogSignal(array([ 39.0625    ,   0.        ,   0.        , ..., -26.85546875 ...
Arguments relevant for reading and writing:
delimiter:

column delimiter in file, e.g. ‘ ‘, one space, two spaces, ‘,’, ‘;’

timecolumn:

None or a valid integer that identifies which column contains the time vector (counting from zero, within the list of selected columns, see also usecols argument)

units:

units of AnalogSignal can be a str or directly a Quantity

time_units:

where timecolumn is specified, the time units must be specified as a string or Quantity

metadata_filename:

the path to a JSON file containing metadata

Arguments relevant only for reading:
usecols:

if None take all columns otherwise a list for selected columns (counting from zero)

skiprows:

skip n first lines in case they contains header informations

sampling_rate:

the sampling rate of signals. Ignored if timecolumn is not None

t_start:

time of the first sample (Quantity). Ignored if timecolumn is not None

signal_group_mode:

if ‘all-in-one’, load data as a single, multi-channel AnalogSignal, if ‘split-all’ (default for backwards compatibility) load data as separate, single-channel AnalogSignals

method:

‘genfromtxt’, ‘csv’, ‘homemade’ or a user-defined function which takes a filename and usecolumns as argument and returns a 2D NumPy array.

If specifying both usecols and timecolumn, the latter should identify the column index _after_ removing the unused columns.

The methods are as follows:
  • ‘genfromtxt’ use numpy.genfromtxt

  • ‘csv’ use csv module

  • ‘homemade’ use an intuitive, more robust but slow method

If metadata_filename is provided, the parameters for reading/writing the file (“delimiter”, “timecolumn”, “units”, etc.) will be read from that file. IF a metadata filename is not provided, the IO will look for a JSON file in the same directory with a matching filename, e.g. if the datafile was named “foo.txt” then the IO would automatically look for a file called “foo_about.json” If parameters are specified both in the metadata file and as arguments to the IO constructor, the former will take precedence.

Example metadata file:

{
    "filename": "foo.txt",
    "delimiter": " ",
    "timecolumn": 0,
    "units": "pA",
    "time_units": "ms",
    "sampling_rate": {
        "value": 1.0,
        "units": "kHz"
    },
    "method": "genfromtxt",
    "signal_group_mode": 'all-in-one'
}
extensions = ['txt', 'asc', 'csv', 'tsv']#
class neo.io.AsciiSpikeTrainIO(filename=None)#

Class for reading/writing SpikeTrains in a text file. Each Spiketrain is a line.

Usage:
>>> from neo import io
>>> r = io.AsciiSpikeTrainIO( filename = 'File_ascii_spiketrain_1.txt')
>>> seg = r.read_segment()
>>> print seg.spiketrains     
[<SpikeTrain(array([ 3.89981604,  4.73258781,  0.608428  ,  4.60246277,  1.23805797,
...
extensions = ['txt']#
class neo.io.AxographIO(filename='', force_single_segment=False)#

IO class for reading AxoGraph files (.axgd, .axgx)

Args:
filename (string):

File name of the AxoGraph file to read.

force_single_segment (bool):

Episodic files are normally read as multi-Segment Neo objects. This parameter can force AxographIO to put all signals into a single Segment. Default: False.

Example:
>>> import neo
>>> r = neo.io.AxographIO(filename=filename)
>>> blk = r.read_block(signal_group_mode='split-all')
>>> display(blk)
>>> # get signals
>>> seg_index = 0  # episode number
>>> sigs = [sig for sig in blk.segments[seg_index].analogsignals
...         if sig.name in channel_names]
>>> display(sigs)
>>> # get event markers (same for all segments/episodes)
>>> ev = blk.segments[0].events[0]
>>> print([ev for ev in zip(ev.times, ev.labels)])
>>> # get interval bars (same for all segments/episodes)
>>> ep = blk.segments[0].epochs[0]
>>> print([ep for ep in zip(ep.times, ep.durations, ep.labels)])
>>> # get notes
>>> print(blk.annotations['notes'])
extensions = ['axgd', 'axgx', '']#
class neo.io.AxonaIO(filename)#
extensions = ['bin', 'set', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32']#
class neo.io.AxonIO(filename)#

Class for reading data from pCLAMP and AxoScope files (.abf version 1 and 2), developed by Molecular device/Axon technologies.

  • abf = Axon binary file

  • atf is a text file based format from axon that could be read by AsciiIO (but this file is less efficient.)

Here an important note from erikli@github for user who want to get the : With Axon ABF2 files, the information that you need to recapitulate the original stimulus waveform (both digital and analog) is contained in multiple places.

  • AxonIO._axon_info[‘protocol’] – things like number of samples in episode

  • AxonIO.axon_info[‘section’][‘ADCSection’] | AxonIO.axon_info[‘section’][‘DACSection’] – things about the number of channels and channel properties

  • AxonIO._axon_info[‘protocol’][‘nActiveDACChannel’] – bitmask specifying which DACs are actually active

  • AxonIO._axon_info[‘protocol’][‘nDigitalEnable’] – bitmask specifying which set of Epoch timings should be used to specify the duration of digital outputs

  • AxonIO._axon_info[‘dictEpochInfoPerDAC’] – dict of dict. First index is DAC channel and second index is Epoch number (i.e. information about Epoch A in Channel 2 would be in AxonIO._axon_info[‘dictEpochInfoPerDAC’][2][0])

  • AxonIO._axon_info[‘EpochInfo’] – list of dicts containing information about each Epoch’s digital out pattern. Digital out is a bitmask with least significant bit corresponding to Digital Out 0

  • AxonIO._axon_info[‘listDACInfo’] – information about DAC name, scale factor, holding level, etc

  • AxonIO._t_starts – start time of each sweep in a unified time basis

  • AxonIO._sampling_rate

The current AxonIO.read_protocol() method utilizes a subset of these. In particular I know it doesn’t consider nDigitalEnable, EpochInfo, or nActiveDACChannel and it doesn’t account for different types of Epochs offered by Clampex/pClamp other than discrete steps (such as ramp, pulse train, etc and encoded by nEpochType in the EpochInfoPerDAC section). I’m currently parsing a superset of the properties used by read_protocol() in my analysis scripts, but that code still doesn’t parse the full information and isn’t in a state where it could be committed and I can’t currently prioritize putting together all the code that would parse the full set of data. The AxonIO._axon_info[‘EpochInfo’] section doesn’t currently exist.

extensions = ['abf']#
class neo.io.BCI2000IO(filename)#

Class for reading data from a BCI2000 .dat file, either version 1.0 or 1.1

extensions = ['dat']#
class neo.io.BiocamIO(filename)#

Class for reading data from a Biocam h5 file.

Parameters#

filename: str, default: ‘’

The *.h5 file to be read

Examples#

>>> import neo.rawio
>>> r = neo.rawio.BiocamRawIO(filename='biocam.h5')
>>> r.parse_header()
>>> print(r)
>>> raw_chunk = r.get_analogsignal_chunk(block_index=0,
                                         seg_index=0,
                                         i_start=0,
                                         i_stop=1024,
                                         channel_names=channel_names)
>>> float_chunk = r.rescale_signal_raw_to_float(raw_chunk,
                                                dtype='float64',
                                                channel_indexes=[0, 3, 6])
extensions = ['h5', 'brw']#
class neo.io.BlackrockIO(filename, **kargs)#

Supplementary class for reading BlackRock data using only a single nsx file.

extensions = ['ns1', 'ns2', 'ns3', 'ns4', 'ns5', 'ns6', 'nev', 'sif', 'ccf']#
class neo.io.BlkIO(file_name=None, units=None, sampling_rate=None, spatial_scale=None, **kwargs)#

Neo IO module for optical imaging data stored as BLK file

Usage:
>>> from neo import io
>>> import quantities as pq
>>> r = io.BlkIO("file_blk_1.BLK",units='V',sampling_rate=1.0*pq.Hz,
...              spatial_scale=1.0*pq.Hz)
>>> block = r.read_block()
reading the header
reading block
returning block
>>> block
Block with 6 segments
file_origin: 'file_blk_1.BLK'
# segments (N=6)
0: Segment with 1 imagesequences description: 'stim nb:0' # analogsignals (N=0)
1: Segment with 1 imagesequences description: 'stim nb:1' # analogsignals (N=0)
2: Segment with 1 imagesequences description: 'stim nb:2' # analogsignals (N=0)
3: Segment with 1 imagesequences description: 'stim nb:3' # analogsignals (N=0)
4: Segment with 1 imagesequences description: 'stim nb:4' # analogsignals (N=0)
5: Segment with 1 imagesequences description: 'stim nb:5' # analogsignals (N=0)

Many thanks to Thomas Deneux for the MATLAB code on which this was based.

extensions = []#
class neo.io.BrainVisionIO(filename)#

Class for reading data from the BrainVision product.

extensions = ['vhdr']#
class neo.io.BrainwareDamIO(filename=None)#

Class for reading Brainware raw data files with the extension ‘.dam’.

The read_block method returns the first Block of the file. It will automatically close the file after reading. The read method is the same as read_block.

Note:

The file format does not contain a sampling rate. The sampling rate is set to 1 Hz, but this is arbitrary. If you have a corresponding .src or .f32 file, you can get the sampling rate from that. It may also be possible to infer it from the attributes, such as “sweep length”, if present.

Usage:
>>> from neo.io.brainwaredamio import BrainwareDamIO
>>> damfile = BrainwareDamIO(filename='multi_500ms_mulitrep_ch1.dam')
>>> blk1 = damfile.read()
>>> blk2 = damfile.read_block()
>>> print blk1.segments
>>> print blk1.segments[0].analogsignals
>>> print blk1.units
>>> print blk1.units[0].name
>>> print blk2
>>> print blk2[0].segments
extensions = ['dam']#
class neo.io.BrainwareF32IO(filename=None)#

Class for reading Brainware Spike ReCord files with the extension ‘.f32’

The read_block method returns the first Block of the file. It will automatically close the file after reading. The read method is the same as read_block.

The read_all_blocks method automatically reads all Blocks. It will automatically close the file after reading.

The read_next_block method will return one Block each time it is called. It will automatically close the file and reset to the first Block after reading the last block. Call the close method to close the file and reset this method back to the first Block.

The isopen property tells whether the file is currently open and reading or closed.

Note 1:

There is always only one Group.

Usage:
>>> from neo.io.brainwaref32io import BrainwareF32IO
>>> f32file = BrainwareF32IO(filename='multi_500ms_mulitrep_ch1.f32')
>>> blk1 = f32file.read()
>>> blk2 = f32file.read_block()
>>> print blk1.segments
>>> print blk1.segments[0].spiketrains
>>> print blk1.units
>>> print blk1.units[0].name
>>> print blk2
>>> print blk2[0].segments
extensions = ['f32']#
class neo.io.BrainwareSrcIO(filename=None)#

Class for reading Brainware Spike ReCord files with the extension ‘.src’

The read_block method returns the first Block of the file. It will automatically close the file after reading. The read method is the same as read_block.

The read_all_blocks method automatically reads all Blocks. It will automatically close the file after reading.

The read_next_block method will return one Block each time it is called. It will automatically close the file and reset to the first Block after reading the last block. Call the close method to close the file and reset this method back to the first Block.

The _isopen property tells whether the file is currently open and reading or closed.

Note 1:

The first Unit in each Group is always UnassignedSpikes, which has a SpikeTrain for each Segment containing all the spikes not assigned to any Unit in that Segment.

Note 2:

The first Segment in each Block is always Comments, which stores all comments as an Event object.

Note 3:

The parameters from the BrainWare table for each condition are stored in the Segment annotations. If there are multiple repetitions of a condition, each repetition is stored as a separate Segment.

Note 4:

There is always only one Group.

Usage:
>>> from neo.io.brainwaresrcio import BrainwareSrcIO
>>> srcfile = BrainwareSrcIO(filename='multi_500ms_mulitrep_ch1.src')
>>> blk1 = srcfile.read()
>>> blk2 = srcfile.read_block()
>>> blks = srcfile.read_all_blocks()
>>> print blk1.segments
>>> print blk1.segments[0].spiketrains
>>> print blk1.groups
>>> print blk1.groups[0].name
>>> print blk2
>>> print blk2[0].segments
>>> print blks
>>> print blks[0].segments
extensions = ['src']#
class neo.io.CedIO(filename, entfile=None, posfile=None)#

Class for reading data from CED (Cambridge Electronic Design) spike2.

Parameters#

filename: str, default: ‘’

The *.smr or *.smrx file to load

take_ideal_sampling_rate: bool, default: False

If true use the GetIdealRate function from sonpy package

Notes#

  • This internally uses the sonpy package which is closed source.

  • This IO reads smr and smrx files

extensions = ['smr', 'smrx']#
class neo.io.EDFIO(filename='')#

IO for reading edf and edf+ files.

extensions = ['edf']#
class neo.io.ElanIO(filename, entfile=None, posfile=None)#

Class for reading data from Elan.

Elan is software for studying time-frequency maps of EEG data.

Elan is developed in Lyon, France, at INSERM U821

https://elan.lyon.inserm.fr

Args:
filename (string) :

Full path to the .eeg file

entfile (string) :

Full path to the .ent file (optional). If None, the path to the ent file is inferred from the filename by adding the “.ent” extension to it

posfile (string) :

Full path to the .pos file (optional). If None, the path to the pos file is inferred from the filename by adding the “.pos” extension to it

extensions = ['eeg']#
class neo.io.IgorIO(filename=None, parse_notes=None)#

Class for reading Igor Binary Waves (.ibw) or Packed Experiment (.pxp) files written by WaveMetrics’ IGOR Pro software.

It requires the igor2 Python package.

Usage:
>>> from neo import io
>>> r = io.IgorIO(filename='...ibw')
extensions = ['ibw', 'pxp']#
class neo.io.IntanIO(filename)#

Class for reading rhd and rhs Intan data

Parameters#

filename: str, default: ‘’

name of the ‘rhd’ or ‘rhs’ data file

Notes#

  • Intan reader can handle two file formats ‘rhd’ and ‘rhs’. It will automatically

check for the file extension and will gather the header information based on the extension. Additionally it functions with RHS v 1.0 and RHD 1.0, 1.1, 1.2, 1.3, 2.0, 3.0, and 3.1 files.

  • Intan files contain amplifier channels labeled ‘A’, ‘B’ ‘C’ or ‘D’

depending on the port in which they were recorded along with the following additional channels. 0: ‘RHD2000’ amplifier channel 1: ‘RHD2000 auxiliary input channel’, 2: ‘RHD2000 supply voltage channel’, 3: ‘USB board ADC input channel’, 4: ‘USB board digital input channel’, 5: ‘USB board digital output channel’

  • Due to the structure of the digital input and output channels these can be accessed

as one long vector, which must be post-processed.

Examples#

>>> import neo.rawio
>>> reader = neo.rawio.IntanRawIO(filename='data.rhd')
>>> reader.parse_header()
>>> raw_chunk = reader.get_analogsignal_chunk(block_index=0,
                                              seg_index=0
                                              stream_index=0)
>>> float_chunk = reader.rescale_signal_raw_to_float(raw_chunk, stream_index=0)
extensions = ['rhd', 'rhs', 'dat']#
class neo.io.KlustaKwikIO(dirname, sampling_rate=30000.0)#

Reading and writing from KlustaKwik-format files.

extensions = ['fet', 'clu', 'res', 'spk']#
class neo.io.KwikIO(filename)#

Class for “reading” experimental data from a .kwik file.

Generates a Segment with a AnalogSignal

extensions = ['kwik']#
class neo.io.MEArecIO(filename, load_spiketrains=True, load_analogsignal=True)#

Class for “reading” simulated data from a MEArec file.

Parameters#

filenamestr, default: ‘’

The filename of the MEArec file to read.

load_spiketrainsbool, default: True

Whether or not to load spike train data.

load_analogsignalbool, default: True

Whether or not to load continuous recording data.

Examples#

>>> import neo.rawio
>>> r = neo.rawio.MEArecRawIO(filename='mearec.h5', load_spiketrains=True)
>>> r.parse_header()
>>> print(r)
>>> raw_chunk = r.get_analogsignal_chunk(block_index=0,
                                         seg_index=0,
                                         i_start=0,
                                         i_stop=1024,
                                         channel_names=channel_names)
>>> float_chunk = reader.rescale_signal_raw_to_float(raw_chunk,
                                                    dtype='float64',
                                                    channel_indexes=[0, 3, 6])
>>> spike_timestamp = reader.spike_timestamps(unit_index=0, t_start=None, t_stop=None)
>>> spike_times = reader.rescale_spike_timestamp(spike_timestamp, 'float64')
extensions = ['h5']#
class neo.io.MaxwellIO(filename)#
extensions = ['h5']#
class neo.io.MedIO(dirname=None, password=None, keep_original_times=False)#

IO for reading MED datasets.

extensions = ['medd', 'rdat', 'ridx']#
class neo.io.MicromedIO(filename)#

Class for reading/writing data from Micromed files (.trc).

extensions = ['trc', 'TRC']#
class neo.io.NeoMatlabIO(filename=None)#

Class for reading/writing Neo objects in MATLAB format (.mat) versions 5 to 7.2.

This module is a bridge for MATLAB users who want to adopt the Neo object representation. The nomenclature is the same but using Matlab structs and cell arrays. With this module MATLAB users can use neo.io to read a format and convert it to .mat.

Rules of conversion:
  • Neo classes are converted to MATLAB structs. e.g., a Block is a struct with attributes “name”, “file_datetime”, …

  • Neo one_to_many relationships are cellarrays in MATLAB. e.g., seg.analogsignals[2] in Python Neo will be seg.analogsignals{3} in MATLAB.

  • Quantity attributes are represented by 2 fields in MATLAB. e.g., anasig.t_start = 1.5 * s in Python will be anasig.t_start = 1.5 and anasig.t_start_unit = 's' in MATLAB.

  • classes that inherit from Quantity (AnalogSignal, SpikeTrain, …) in Python will have 2 fields (array and units) in the MATLAB struct. e.g.: AnalogSignal( [1., 2., 3.], 'V') in Python will be anasig.array = [1. 2. 3] and anasig.units = 'V' in MATLAB.

1 - Scenario 1: create data in MATLAB and read them in Python

This MATLAB code generates a block:

block = struct();
block.segments = { };
block.name = 'my block with matlab';
for s = 1:3
    seg = struct();
    seg.name = strcat('segment ',num2str(s));

    seg.analogsignals = { };
    for a = 1:5
        anasig = struct();
        anasig.signal = rand(100,1);
        anasig.signal_units = 'mV';
        anasig.t_start = 0;
        anasig.t_start_units = 's';
        anasig.sampling_rate = 100;
        anasig.sampling_rate_units = 'Hz';
        seg.analogsignals{a} = anasig;
    end

    seg.spiketrains = { };
    for t = 1:7
        sptr = struct();
        sptr.times = rand(30,1)*10;
        sptr.times_units = 'ms';
        sptr.t_start = 0;
        sptr.t_start_units = 'ms';
        sptr.t_stop = 10;
        sptr.t_stop_units = 'ms';
        seg.spiketrains{t} = sptr;
    end

    event = struct();
    event.times = [0, 10, 30];
    event.times_units = 'ms';
    event.labels = ['trig0'; 'trig1'; 'trig2'];
    seg.events{1} = event;

    epoch = struct();
    epoch.times = [10, 20];
    epoch.times_units = 'ms';
    epoch.durations = [4, 10];
    epoch.durations_units = 'ms';
    epoch.labels = ['a0'; 'a1'];
    seg.epochs{1} = epoch;

    block.segments{s} = seg;

end

save 'myblock.mat' block -V7

This code reads it in Python:

import neo
r = neo.io.NeoMatlabIO(filename='myblock.mat')
bl = r.read_block()
print bl.segments[1].analogsignals[2]
print bl.segments[1].spiketrains[4]

2 - Scenario 2: create data in Python and read them in MATLAB

This Python code generates the same block as in the previous scenario:

import neo
import quantities as pq
from scipy import rand, array

bl = neo.Block(name='my block with neo')
for s in range(3):
    seg = neo.Segment(name='segment' + str(s))
    bl.segments.append(seg)
    for a in range(5):
        anasig = neo.AnalogSignal(rand(100)*pq.mV, t_start=0*pq.s,
                                  sampling_rate=100*pq.Hz)
        seg.analogsignals.append(anasig)
    for t in range(7):
        sptr = neo.SpikeTrain(rand(40)*pq.ms, t_start=0*pq.ms, t_stop=10*pq.ms)
        seg.spiketrains.append(sptr)
    ev = neo.Event([0, 10, 30]*pq.ms, labels=array(['trig0', 'trig1', 'trig2']))
    ep = neo.Epoch([10, 20]*pq.ms, durations=[4, 10]*pq.ms, labels=array(['a0', 'a1']))
    seg.events.append(ev)
    seg.epochs.append(ep)

from neo.io.neomatlabio import NeoMatlabIO
w = NeoMatlabIO(filename='myblock.mat')
w.write_block(bl)

This MATLAB code reads it:

load 'myblock.mat'
block.name
block.segments{2}.analogsignals{3}.signal
block.segments{2}.analogsignals{3}.signal_units
block.segments{2}.analogsignals{3}.t_start
block.segments{2}.analogsignals{3}.t_start_units

3 - Scenario 3: conversion

This Python code converts a Spike2 file to MATLAB:

from neo import Block
from neo.io import Spike2IO, NeoMatlabIO

r = Spike2IO(filename='spike2.smr')
w = NeoMatlabIO(filename='convertedfile.mat')
blocks = r.read()
w.write(blocks[0])
extensions = ['mat']#
class neo.io.NestIO(filenames=None)#

Class for reading NEST output files. GDF files for the spike data and DAT files for analog signals are possible.

Usage:
>>> from neo.io.nestio import NestIO
>>> files = ['membrane_voltages-1261-0.dat',
         'spikes-1258-0.gdf']
>>> r = NestIO(filenames=files)
>>> seg = r.read_segment(gid_list=[], t_start=400 * pq.ms,
                     t_stop=600 * pq.ms,
                     id_column_gdf=0, time_column_gdf=1,
                     id_column_dat=0, time_column_dat=1,
                     value_columns_dat=2)
extensions = ['gdf', 'dat']#
class neo.io.NeuralynxIO(dirname='', filename='', use_cache=False, cache_path='same_as_resource', exclude_filename=None, keep_original_times=False)#

Class for reading data from Neuralynx files. This IO supports NCS, NEV, NSE and NTT file formats.

NCS contains signals for one channel NEV contains events NSE contains spikes and waveforms for mono electrodes NTT contains spikes and waveforms for tetrodes

extensions = ['nse', 'ncs', 'nev', 'ntt', 'nvt', 'nrd']#
class neo.io.NeuroExplorerIO(filename)#

Class for reading data from NeuroExplorer (.nex)

extensions = ['nex']#
class neo.io.NeuroScopeIO(filename)#

Reading from Neuroscope format files.

Ref: http://neuroscope.sourceforge.net/

extensions = ['xml', 'dat', 'lfp', 'eeg']#
neo.io.NeuroshareIO#

alias of NeurosharectypesIO

class neo.io.NixIO(filename, mode='rw')#

Class for reading and writing NIX files.

extensions = ['h5', 'nix']#
class neo.io.NWBIO(filename, mode='r', **annotations)#

Class for “reading” experimental data from a .nwb file, and “writing” a .nwb file from Neo

extensions = ['nwb']#
class neo.io.OpenEphysIO(dirname)#
extensions = ['continuous', 'openephys', 'spikes', 'events', 'xml']#
class neo.io.OpenEphysBinaryIO(dirname)#
extensions = ['xml', 'oebin', 'txt', 'dat', 'npy']#
class neo.io.PhyIO(dirname, load_amplitudes=False, load_pcs=False)#
extensions = ['npy', 'mat', 'tsv', 'dat']#
class neo.io.PickleIO(filename: str | Path = None, **kargs)#

A class for reading and writing Neo data from/to the Python “pickle” format.

Note that files in this format may not be readable if using a different version of Neo to that used to create the file. It should therefore not be used for long-term storage, but rather for intermediate results in a pipeline.

extensions = ['pkl', 'pickle']#
class neo.io.PlexonIO(filename)#

Class for reading the old data format from Plexon acquisition system (.plx)

Note that Plexon now use a new format PL2 which is NOT supported by this IO.

Compatible with versions 100 to 106. Other versions have not been tested.

extensions = ['plx']#
class neo.io.Plexon2IO(filename)#

Class for reading data from Plexon PL2 files

The IO is based on the Plexon2RawIO, see comments for memory optimization in neo.rawio.plexon2rawio.Plexon2RawIO

extensions = ['pl2']#
class neo.io.RawBinarySignalIO(filename, dtype='int16', sampling_rate=10000.0, nb_channel=2, signal_gain=1.0, signal_offset=0.0, bytesoffset=0)#

Class for reading/writing data in a raw binary interleaved compact file.

Important release note

Since the version neo 0.6.0 and the neo.rawio API, argmuents of the IO (dtype, nb_channel, sampling_rate) must be given at the __init__ and not at read_segment() because there is no read_segment() in neo.rawio classes.

So now the usage is:
>>>>r = io.RawBinarySignalIO(filename=’file.raw’, dtype=’int16’,

nb_channel=16, sampling_rate=10000.)

extensions = ['raw', 'bin']#
class neo.io.RawMCSIO(filename)#
extensions = ['raw']#
class neo.io.Spike2IO(filename, **kargs)#
extensions = ['smr']#
class neo.io.SpikeGadgetsIO(filename)#
extensions = ['rec']#
class neo.io.SpikeGLXIO(dirname, load_sync_channel=False, load_channel_location=False)#

Class for reading data from a SpikeGLX system

Parameters#

dirname: str, default: ‘’

The spikeglx folder containing meta/bin files

load_sync_channel: bool, default: False

The last channel (SY0) of each stream is a fake channel used for synchronisation

load_channel_location: bool, default: False

If True probeinterface is used to load the channel locations from the directory

Notes#

  • Contrary to other implementations this IO reads the entire folder and subfolders and: deals with several segments based on the _gt0, _gt1, _gt2, etc postfixes deals with all signals “imec0”, “imec1” for neuropixel probes and also external signal like”nidq”. This is the “device”

  • For imec device both “ap” and “lf” are extracted so one device have several “streams”

  • There are several versions depending the neuropixel probe generation (1.x/2.x/3.x)

  • Here, we assume that the meta file has the same structure across all generations.

  • This IO is developed based on neuropixel generation 2.0, single shank recordings.

Examples#

>>> import neo.rawio
>>> reader = neo.rawio.SpikeGLXRawIO(dirname='path/to/data/')
>>> reader.parse_header()
>>> print(reader)
>>> raw_chunk = reader.get_analogsignal_chunk(block_index=0,
                                              seg_index=0,
                                              i_start=None,
                                              i_stop=None,
                                              stream_index=0)
extensions = ['meta', 'bin']#
class neo.io.StimfitIO(filename=None)#

Class for converting a stfio Recording to a Neo object. Provides a standardized representation of the data as defined by the neo project; this is useful to explore the data with an increasing number of electrophysiology software tools that rely on the Neo standard.

stfio is a standalone file i/o Python module that ships with the Stimfit program (http://www.stimfit.org). It is a Python wrapper around Stimfit’s file i/o library (libstfio) that natively provides support for the following file types:

  • ABF (Axon binary file format; pClamp 6–9)

  • ABF2 (Axon binary file format 2; pClamp 10+)

  • ATF (Axon text file format)

  • AXGX/AXGD (Axograph X file format)

  • CFS (Cambridge electronic devices filing system)

  • HEKA (HEKA binary file format)

  • HDF5 (Hierarchical data format 5; only hdf5 files written by Stimfit or stfio are supported)

In addition, libstfio can use the biosig file i/o library as an additional file handling backend (http://biosig.sourceforge.net/), extending support to more than 30 additional file formats (http://pub.ist.ac.at/~schloegl/biosig/TESTED).

Example usage:
>>> import neo
>>> neo_obj = neo.io.StimfitIO("file.abf")
or
>>> import stfio
>>> stfio_obj = stfio.read("file.abf")
>>> neo_obj = neo.io.StimfitIO(stfio_obj)
extensions = ['abf', 'dat', 'axgx', 'axgd', 'cfs']#
class neo.io.TdtIO(dirname)#

Class for reading data from from Tucker Davis TTank format.

Terminology: TDT holds data with tanks (actually a directory). And tanks hold sub blocks (sub directories). Tanks correspond to Neo Blocks and TDT blocks correspond to Neo Segments.

extensions = ['tbk', 'tdx', 'tev', 'tin', 'tnt', 'tsq', 'sev', 'txt']#
class neo.io.TiffIO(directory_path=None, units=None, sampling_rate=None, spatial_scale=None, **kwargs)#

Neo IO module for optical imaging data stored as a folder of TIFF images.

Usage:
>>> from neo import io
>>> import quantities as pq
>>> r = io.TiffIO("dir_tiff",spatial_scale=1.0*pq.mm, units='V',
...               sampling_rate=1.0*pq.Hz)
>>> block = r.read_block()
read block
creating segment
returning block
>>> block
Block with 1 segments
file_origin: 'test'
# segments (N=1)
0: Segment with 1 imagesequences
    annotations: {'tiff_file_names': ['file_tif_1_.tiff',
        'file_tif_2.tiff',
        'file_tif_3.tiff',
        'file_tif_4.tiff',
        'file_tif_5.tiff',
        'file_tif_6.tiff',
        'file_tif_7.tiff',
        'file_tif_8.tiff',
        'file_tif_9.tiff',
        'file_tif_10.tiff',
        'file_tif_11.tiff',
        'file_tif_12.tiff',
        'file_tif_13.tiff',
        'file_tif_14.tiff']}
    # analogsignals (N=0)
extensions = []#
class neo.io.WinEdrIO(filename)#

Class for reading data from WinEdr, a software tool written by John Dempster.

WinEdr is free: http://spider.science.strath.ac.uk/sipbs/software.htm

extensions = ['EDR', 'edr']#
class neo.io.WinWcpIO(filename)#

Class for reading data from WinWCP, a software tool written by John Dempster.

WinWCP is free: http://spider.science.strath.ac.uk/sipbs/software.htm

extensions = ['wcp']#