Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support variable time windows for epochs metadata creation #874

Merged
merged 7 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
5 changes: 4 additions & 1 deletion docs/source/v1.7.md.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### :new: New features & enhancements

- Epochs metadata creation now supports variable time windows by specifying the names of events via [`epochs_metadata_tmin`][mne_bids_pipeline._config.epochs_metadata_tmin] and [`epochs_metadata_tmax`][mne_bids_pipeline._config.epochs_metadata_tmax]. (#873 by @hoechenberger)
hoechenberger marked this conversation as resolved.
Show resolved Hide resolved
- Improved logging message during cache invalidation: We now print the selected
[`memory_file_method`][mne_bids_pipeline._config.memory_file_method] ("hash" or "mtime").
Previously, we'd always print "hash". (#876 by @hoechenberger)
Expand All @@ -12,7 +13,9 @@

[//]: # (- Whatever (#000 by @whoever))

[//]: # (### :package: Requirements)
### :package: Requirements

- The minimum required version of MNE-Python is now 1.7.0.
hoechenberger marked this conversation as resolved.
Show resolved Hide resolved

[//]: # (- Whatever (#000 by @whoever))

Expand Down
26 changes: 20 additions & 6 deletions mne_bids_pipeline/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,15 +916,29 @@
April 1st, 2021.
"""

epochs_metadata_tmin: float | None = None
epochs_metadata_tmin: float | str | list[str] | None = None
"""
The beginning of the time window for metadata generation, in seconds,
relative to the time-locked event of the respective epoch. This may be less
than or larger than the epoch's first time point. If `None`, use the first
time point of the epoch.
The beginning of the time window used for epochs metadata generation. This setting
controls the `tmin` value passed to
[`mne.epochs.make_metadata`](https://mne.tools/stable/generated/mne.epochs.make_metadata.html).

If a float, the time in seconds relative to the time-locked event of the respective
epoch. Negative indicate times before, positive values indicate times after the
time-locked event.

If a string or a list of strings, the name(s) of events marking the start of time
window.

If `None`, use the first time point of the epoch.

???+ info
Note that `None` here behaves differently than `tmin=None` in
`mne.epochs.make_metadata`. To achieve the same behavior, pass the name(s) of the
time-locked events instead.

"""

epochs_metadata_tmax: float | None = None
epochs_metadata_tmax: float | str | list[str] | None = None
"""
Same as `epochs_metadata_tmin`, but specifying the **end** of the time
window for metadata generation.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies = [
"pyvistaqt",
"openpyxl",
"autoreject",
"mne[hdf5] >=1.2",
"mne[hdf5] >=1.7",
"mne-bids[full]",
"filelock",
]
Expand Down
Loading