Skip to content

Commit

Permalink
Add reader for ANT Neuro format (mne-tools#12792)
Browse files Browse the repository at this point in the history
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
3 people authored Aug 21, 2024
1 parent 966121b commit ab69d3e
Show file tree
Hide file tree
Showing 14 changed files with 577 additions and 45 deletions.
27 changes: 14 additions & 13 deletions doc/api/reading_raw_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,34 @@ Reading raw data

anonymize_info
read_raw
read_raw_ant
read_raw_artemis123
read_raw_bdf
read_raw_boxy
read_raw_brainvision
read_raw_bti
read_raw_cnt
read_raw_ctf
read_raw_curry
read_raw_edf
read_raw_eeglab
read_raw_egi
read_raw_eximia
read_raw_eyelink
read_raw_bdf
read_raw_fieldtrip
read_raw_fif
read_raw_fil
read_raw_gdf
read_raw_hitachi
read_raw_kit
read_raw_nedf
read_raw_nicolet
read_raw_hitachi
read_raw_nirx
read_raw_snirf
read_raw_eeglab
read_raw_brainvision
read_raw_egi
read_raw_fif
read_raw_eximia
read_raw_fieldtrip
read_raw_boxy
read_raw_persyst
read_raw_nihon
read_raw_fil
read_raw_nirx
read_raw_nsx
read_raw_neuralynx
read_raw_persyst
read_raw_snirf

Base class:

Expand Down
1 change: 1 addition & 0 deletions doc/changes/devel/12792.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add reader for ANT Neuro files in the ``*.cnt`` format with :func:`~mne.io.read_raw_ant`, by `Mathieu Scheltienne`_ and `Eric Larson`_.
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
"EpochsFIF": "mne.Epochs",
"EpochsEEGLAB": "mne.Epochs",
"EpochsKIT": "mne.Epochs",
"RawANT": "mne.io.Raw",
"RawBOXY": "mne.io.Raw",
"RawBrainVision": "mne.io.Raw",
"RawBTi": "mne.io.Raw",
Expand Down
2 changes: 2 additions & 0 deletions mne/io/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ __all__ = [
"read_fiducials",
"read_info",
"read_raw",
"read_raw_ant",
"read_raw_artemis123",
"read_raw_bdf",
"read_raw_boxy",
Expand Down Expand Up @@ -59,6 +60,7 @@ from ._fiff_wrap import (
write_info,
)
from ._read_raw import read_raw
from .ant import read_raw_ant
from .array import RawArray
from .artemis123 import read_raw_artemis123
from .base import BaseRaw, concatenate_raws, match_channel_orders
Expand Down
44 changes: 34 additions & 10 deletions mne/io/_read_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def _read_unsupported(fname, **kwargs):
# supported read file formats
def _get_supported():
from . import (
read_raw_ant,
read_raw_artemis123,
read_raw_bdf,
read_raw_boxy,
Expand All @@ -35,6 +36,7 @@ def _get_supported():
read_raw_eeglab,
read_raw_egi,
read_raw_eximia,
read_raw_eyelink,
read_raw_fieldtrip,
read_raw_fif,
read_raw_fil,
Expand All @@ -44,6 +46,8 @@ def _get_supported():
read_raw_nicolet,
read_raw_nihon,
read_raw_nirx,
read_raw_nsx,
read_raw_persyst,
read_raw_snirf,
)

Expand All @@ -57,7 +61,7 @@ def _get_supported():
".fif": dict(FIF=read_raw_fif),
".fif.gz": dict(FIF=read_raw_fif),
".set": dict(EEGLAB=read_raw_eeglab),
".cnt": dict(CNT=read_raw_cnt),
".cnt": dict(CNT=read_raw_cnt, ANT=read_raw_ant),
".mff": dict(EGI=read_raw_egi),
".nxe": dict(eximia=read_raw_eximia),
".hdr": dict(NIRx=read_raw_nirx),
Expand All @@ -82,6 +86,10 @@ def _get_supported():
".cef": dict(CURRY=read_raw_curry),
# NEDF
".nedf": dict(NEDF=read_raw_nedf),
# EyeLink
".asc": dict(EyeLink=read_raw_eyelink),
".ns3": dict(NSx=read_raw_nsx),
".lay": dict(Persyst=read_raw_persyst),
}


Expand Down Expand Up @@ -118,15 +126,31 @@ def read_raw(fname, *, preload=False, verbose=None, **kwargs) -> BaseRaw:
The following readers are currently supported:
`~mne.io.read_raw_artemis123`, `~mne.io.read_raw_bdf`,
`~mne.io.read_raw_boxy`, `~mne.io.read_raw_brainvision`,
`~mne.io.read_raw_cnt`, `~mne.io.read_raw_ctf`, `~mne.io.read_raw_edf`,
`~mne.io.read_raw_eeglab`, `~mne.io.read_raw_egi`,
`~mne.io.read_raw_eximia`, `~mne.io.read_raw_fieldtrip`,
`~mne.io.read_raw_fif`, `~mne.io.read_raw_gdf`, `~mne.io.read_raw_kit`,
`~mne.io.read_raw_fil`,
`~mne.io.read_raw_nicolet`, `~mne.io.read_raw_nirx`,
`~mne.io.read_raw_curry`, and `~mne.io.read_raw_nedf`.
* `~mne.io.read_raw_ant`
* `~mne.io.read_raw_artemis123`
* `~mne.io.read_raw_bdf`
* `~mne.io.read_raw_boxy`
* `~mne.io.read_raw_brainvision`
* `~mne.io.read_raw_cnt`
* `~mne.io.read_raw_ctf`
* `~mne.io.read_raw_curry`
* `~mne.io.read_raw_edf`
* `~mne.io.read_raw_eeglab`
* `~mne.io.read_raw_egi`
* `~mne.io.read_raw_eximia`
* `~mne.io.read_raw_eyelink`
* `~mne.io.read_raw_fieldtrip`
* `~mne.io.read_raw_fif`
* `~mne.io.read_raw_fil`
* `~mne.io.read_raw_gdf`
* `~mne.io.read_raw_kit`
* `~mne.io.read_raw_nedf`
* `~mne.io.read_raw_nicolet`
* `~mne.io.read_raw_nihon`
* `~mne.io.read_raw_nirx`
* `~mne.io.read_raw_nsx`
* `~mne.io.read_raw_persyst`
* `~mne.io.read_raw_snirf`
Parameters
----------
Expand Down
5 changes: 5 additions & 0 deletions mne/io/ant/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Authors: The MNE-Python contributors.
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.

from .ant import read_raw_ant
Loading

0 comments on commit ab69d3e

Please sign in to comment.