Learn R Programming

ieegio: IO toolbox for Intracranial Electroencephalography

The goal of ieegio is to provide integrated toolbox for common file formats used in intracranial Electroencephalography (iEEG) and deep-brain stimulation (DBS). Currently the package is under active development.

Installation

You can install the development version of ieegio from GitHub with:

# install.packages("pak")
pak::pak("dipterix/ieegio")

ieegio provides additional sample data. To download them:

# list all the sample data
sample_names <- ieegio::ieegio_sample_data()

lapply(sample_names, ieegio::ieegio_sample_data)

List 1: read formatted ephys data (examples)

The following formats have been (or will be) supported. Please feel free to make a wish-list by posting an issue in this repository.

Electrophysiology

NameCommon ExtensionsReadWrite
EDF(+)/BDF(+) (European Data Format)*.edfread_edfwrite_edf
BrainVision*.vhdr, *.vmrk, *.eeg, *.datread_brainvis
BCI2000*.datread_bci2000
NEV/NSx (BlackRock neural-event/signal)*.nev, *.ns1, *.ns2, ..., *.ns6read_nsx
NWB (Neurodata Without Borders)*.nwbread_nwb*
MEF*.mef

* - NWB format only has low-level support due to its format nature. Please see examples with help(read_nwb)

List 2: read imaging data (examples)

Imaging

NameCommon ExtensionsReadWrite
NIfTI (Neuroimaging Informatics Technology Initiative)*.nii[.gz]read_volume (io_read_nii)write_volume (io_write_nii)
MGH/MGZ (Massachusetts General Hospital format)*.mgh, *.mgzread_volume (io_read_mgz)write_volume (io_write_mgz)
GIfTI (Geometry format under the NIfTI)*.gii[.gz]read_surface (io_read_gii)write_surface (io_write_gii)
FreeSurfer surfacee.g. *h.pial, *h.whiteread_surface (io_read_fs(type="geometry"))write_surface(format="freesurfer", type="geometry")
FreeSurfer node values/weightse.g. *h.curv, *h.sulcread_surface (io_read_fs(type="measurements"))write_surface(format="freesurfer", type="measurements")
Surface annotation*.annotread_surface (io_read_fs(type="annotations"))write_surface(format="freesurfer", type="annotations")
TRK streamlines*.trk, *.trk.gzread_streamlines (io_read_trk)write_streamlines (io_write_trk)
TCK streamlines*.tckread_streamlines (io_read_tck)write_streamlines (io_write_tck)
TT (DSI-Studio) streamlines*.tt, *.tt.gzread_streamlines (io_read_tt)
VTK poly-data (as streamlines)*.vtk, *.vtp, *.vtpbread_streamlines (io_read_vtk_streamlines)read_streamlines (io_write_vtk_streamlines)

List 3: common file formats used for meta data

NameCommon ExtensionsReadWrite
Matlab*.matio_read_matio_write_mat
HDF5*.h5io_read_h5io_write_h5
YAML*.yml, *.yamlio_read_yamlio_write_yaml
JSON*.jsonio_read_jsonio_write_json
INI*.iniio_read_ini
FST*.fstio_read_fstio_write_fst

Copy Link

Version

Install

install.packages('ieegio')

Monthly Downloads

592

Version

0.0.9

License

MIT + file LICENSE

Maintainer

Zhengjia Wang

Last Published

January 27th, 2026

Functions in ieegio (0.0.9)

io_read_ants_transform

Read ANTs transform file
io-trk

Read or write 'TCK' streamlines
imaging-surface

Read and write surface files
io-tt

Read 'TT' streamline file
io-vtk-streamlines

Read or write streamline data in 'VTK' format
imaging-streamlines

Read and write streamlines
io_read_flirt_transform

Read FSL FLIRT transformation matrix
ieegio_sample_data

Download sample files
imaging-volume

Read and write volume data
io_h5_valid

Check whether a 'HDF5' file can be opened for read/write
io_write_h5

Save objects to 'HDF5' file without trivial checks
io_read_fstarray_or_h5

Function try to load 'FST' arrays, if not found, read 'HDF5' arrays
plot.ieegio_volume

Plot '3D' volume in anatomical slices
new_space

Define a coordinate space
pynwb_module

Install 'NWB' via 'pynwb'
merge.ieegio_volume

Merge 'ieegio' volumes
low-level-read-write

Low-level file read and write
merge.ieegio_surface

Merge two 'ieegio' surfaces
io_read_h5

Lazy Load 'HDF5' File via hdf5r-package
read_bci2000

Read 'BCI2000' data file
plot.ieegio_surface

Plot '3D' surface objects
transform_orientation

Create transform between coordinate orientations
resample_volume

Down-sample or super-sample volume
read_nwb

Read 'NWB' format
read_nsx

Read ('BlackRock') 'NEV' 'NSx' data
read_edf

Read 'EDF' or 'BDF' data file
surface_to_surface

Transform surface between coordinate spaces
transform_flirt2ras

Convert FLIRT transform to world (RAS) coordinates
read_brainvis

Read 'BrainVision' data
write_edf

Write to 'EDF' format
volume_to_surface

Create smooth surface from volume mask or data
SignalDataCache

Class definition for signal cache
burn_volume

Burn image at given positions
LazyFST

R6 Class to Load 'FST' Files
convert-fst

Convert 'FST' files to other formats
as_nifti_header

Internal method to extract header information from a 'NIfTI' file
as_ieegio_surface

Convert other surface formats to ieegio surface
as_ieegio_volume

Convert objects to 'ieegio' image volumes
LazyH5

Lazy 'HDF5' file loader
as_ieegio_transform

Convert to ieegio transform
NWBHDF5IO

Creates a NWBHDF5IO file container