Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5832654
[ADD] describing fields in `event.json` file for the REQUIRED onset a…
JuliusWelzel May 27, 2024
9860744
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 27, 2024
b1ef7fe
fix line length <88
JuliusWelzel May 27, 2024
208885b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 27, 2024
8895caf
remove column position from description
JuliusWelzel May 27, 2024
74566f2
Merge branch 'main' into main
sappelhoff May 28, 2024
61030eb
only provide description and onset for the json
JuliusWelzel May 28, 2024
3e31c6b
refine description of sample
JuliusWelzel May 28, 2024
6ade344
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 28, 2024
64ec71a
satisfy contributing guidelines
JuliusWelzel May 28, 2024
eb984b7
Merge branch 'main' of https://github.com/JuliusWelzel/mne-bids
JuliusWelzel May 28, 2024
37faafc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 28, 2024
3a37466
move author to correct position in CITATION.cff
JuliusWelzel May 28, 2024
a693a4e
[ADD] adapt the config file to include motion data type
JuliusWelzel Aug 25, 2025
5026015
Merge branch 'main' of https://github.com/JuliusWelzel/mne-bids
JuliusWelzel Aug 25, 2025
31fe43c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 25, 2025
5780de7
[ADD] include tracking_system in ENTITY_VALUE_TYPE and BIDSPath class
JuliusWelzel Aug 26, 2025
1bbc42b
Merge branch 'main' of https://github.com/JuliusWelzel/mne-bids
JuliusWelzel Aug 26, 2025
49b5c02
fix tests
drammock Aug 27, 2025
2bcb5b2
[FIX] update spelling of 'tracking-system' in test_path.py with corre…
JuliusWelzel Sep 8, 2025
c5a18a1
[ADD] include 'tracking-system' in the list of valid entity values in…
JuliusWelzel Sep 8, 2025
973f536
Merge branch 'main' into main
JuliusWelzel Sep 8, 2025
60e7661
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 8, 2025
0373d18
[FIX] correct spelling of 'tracking-system' to 'tracking_system' in A…
JuliusWelzel Sep 8, 2025
46d1e63
Merge branch 'main' of https://github.com/JuliusWelzel/mne-bids
JuliusWelzel Sep 8, 2025
c581f89
[FIX] update entity name from 'tracking-system' to 'tracking_system' …
JuliusWelzel Sep 8, 2025
8f1ff0e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 8, 2025
be2b713
Merge branch 'main' into main
JuliusWelzel Sep 10, 2025
734b427
Merge branch 'main' into main
JuliusWelzel Sep 28, 2025
b508ff4
fix whats_new.rst
JuliusWelzel Sep 28, 2025
14069fb
FIX: tracking_system update in BIDSPath class
JuliusWelzel Sep 28, 2025
35ab863
FIX: correct path reference for BIDSPath initialization in whats_new.rst
JuliusWelzel Sep 28, 2025
8849b22
FEAT: add tracking_system parameter to _filter_fnames function
JuliusWelzel Sep 28, 2025
7124242
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 28, 2025
04bbe04
fix whats_new.rst to ref BIDSPath
JuliusWelzel Sep 28, 2025
2b4a3d2
Merge branch 'main' of https://github.com/JuliusWelzel/mne-bids
JuliusWelzel Sep 28, 2025
c235ca2
fix whats_new.rst to ref BIDSPath
JuliusWelzel Sep 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ Please also cite one of the following papers to credit BIDS, depending on which
- [EEG-BIDS](https://doi.org/10.1038/s41597-019-0104-8)
- [iEEG-BIDS](https://doi.org/10.1038/s41597-019-0105-7)
- [NIRS-BIDS](https://doi.org/10.31219/osf.io/7nmcp)
- [Motion-BIDS](https://doi.org/10.1038/s41597-024-03559-8)
1 change: 1 addition & 0 deletions doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@
.. _Tom Donoghue: https://github.com/TomDonoghue
.. _William Turner: https://bootstrapbill.github.io/
.. _Yorguin Mantilla: https://github.com/yjmantilla
.. _Julius Welzel: https://github.com/JuliusWelzel
2 changes: 2 additions & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ The following authors contributed for the first time. Thank you so much! 🤩
* `Arne Gottwald`_
* `Matthias Dold`_
* `Harrison Ritz`_
* `Julius Welzel`_
* `Nathan Azrak`_


The following authors had contributed before. Thank you for sticking around! 🤘

* `Stefan Appelhoff`_
Expand Down
16 changes: 14 additions & 2 deletions mne_bids/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from mne import io
from mne.io.constants import FIFF

BIDS_VERSION = "1.7.0"
BIDS_VERSION = "1.9.0"

PYBV_VERSION = "0.7.3"
EEGLABIO_VERSION = "0.0.2"
Expand All @@ -15,17 +15,19 @@

EPHY_ALLOWED_DATATYPES = ["meg", "eeg", "ieeg", "nirs"]

ALLOWED_DATATYPES = EPHY_ALLOWED_DATATYPES + ["anat", "beh"]
ALLOWED_DATATYPES = EPHY_ALLOWED_DATATYPES + ["anat", "beh", "motion"]

MEG_CONVERT_FORMATS = ["FIF", "auto"]
EEG_CONVERT_FORMATS = ["BrainVision", "auto"]
IEEG_CONVERT_FORMATS = ["BrainVision", "auto"]
NIRS_CONVERT_FORMATS = ["auto"]
MOTION_CONVERT_FORMATS = ["tsv", "auto"]
CONVERT_FORMATS = {
"meg": MEG_CONVERT_FORMATS,
"eeg": EEG_CONVERT_FORMATS,
"ieeg": IEEG_CONVERT_FORMATS,
"nirs": NIRS_CONVERT_FORMATS,
"motion": MOTION_CONVERT_FORMATS,
}

# Orientation of the coordinate system dependent on manufacturer
Expand Down Expand Up @@ -147,12 +149,17 @@
".snirf", # SNIRF
]

allowed_extensions_motion = [
".tsv", # Tab-separated values
]

Comment on lines +152 to +155
Copy link
Collaborator

@scott-huberty scott-huberty Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the line causing the issue, which makes sense because the EEG BIDS datasets have sidecar files that are just text files. So adding .tsv to the allowed datafile extensions seems to be confusing some of mne_bids internal functions..

Motion data might be the first modality with data that are stored in simple text files that we are trying to add into MNE-BIDS, which is why we are hitting this problem now. But I know that Eye-tracking BIDS will have the same issue.. So supporting these data might require more refactoring of the codebase.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a grumpy sidenote, I never understood why BIDS encourages storing some modalities of data in text files... !

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without having looked into it too deeply, that could be something that needs refactoring, yes.

# allowed extensions (data formats) in BIDS spec
ALLOWED_DATATYPE_EXTENSIONS = {
"meg": allowed_extensions_meg,
"eeg": allowed_extensions_eeg,
"ieeg": allowed_extensions_ieeg,
"nirs": allowed_extensions_nirs,
"motion": allowed_extensions_motion,
}

# allow additional extensions that are not BIDS
Expand Down Expand Up @@ -190,6 +197,7 @@
"physio",
"stim", # behavioral
"nirs",
"motion", # motion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant comment

Suggested change
"motion", # motion
"motion",

]

# converts suffix to known path modalities
Expand Down Expand Up @@ -227,6 +235,7 @@
"description",
"suffix",
"extension",
"tracking_system",
)
ALLOWED_PATH_ENTITIES_SHORT = {
"sub": "subject",
Expand All @@ -239,6 +248,7 @@
"recording": "recording",
"split": "split",
"desc": "description",
"tracksys": "tracking_system",
}

# Annotations to never remove during reading or writing
Expand Down Expand Up @@ -316,6 +326,7 @@
ALLOWED_SPACES["ieeg"] = BIDS_SHARED_COORDINATE_FRAMES + BIDS_IEEG_COORDINATE_FRAMES
ALLOWED_SPACES["anat"] = None
ALLOWED_SPACES["beh"] = None
ALLOWED_SPACES["motion"] = None

# See: https://bids-specification.readthedocs.io/en/latest/appendices/entity-table.html#encephalography-eeg-ieeg-and-meg # noqa: E501
ENTITY_VALUE_TYPE = {
Expand All @@ -331,6 +342,7 @@
"description": "label",
"suffix": "label",
"extension": "label",
"tracking_system": "label",
}

# mapping from supported BIDs coordinate frames -> MNE
Expand Down
5 changes: 4 additions & 1 deletion mne_bids/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def __init__(
space=None,
split=None,
description=None,
tracking_system=None,
root=None,
suffix=None,
extension=None,
Expand Down Expand Up @@ -881,7 +882,9 @@ def fpath(self):
if self.suffix is None or self.suffix in ALLOWED_DATATYPES:
# now only use valid datatype extension
if self.extension is None:
valid_exts = sum(ALLOWED_DATATYPE_EXTENSIONS.values(), [])
valid_exts = ALLOWED_DATATYPE_EXTENSIONS.get(
self.datatype, sum(ALLOWED_DATATYPE_EXTENSIONS.values(), [])
)
else:
valid_exts = [self.extension]
matching_paths = [
Expand Down
2 changes: 2 additions & 0 deletions mne_bids/tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ def test_get_entities_from_fname(fname):
"recording",
"split",
"description",
"tracking_system",
]


Expand Down Expand Up @@ -537,6 +538,7 @@ def test_get_entities_from_fname_errors(fname):
"recording",
"split",
"description",
"tracking_system",
]

assert params["subject"] == "01"
Expand Down
Loading