-
Notifications
You must be signed in to change notification settings - Fork 12
FIX, DOC: Pipeline methods shouldn't accept just any instance of raw #213
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9afe0fe
FIX, DOC: Pipeline methods shouldn't accept just any instance of raw
scott-huberty 9354f88
Apply suggestions from Christian O'Reilly code review
scott-huberty 2a747c2
FIX: cruft
scott-huberty da58c7b
DOC: improve docstring a little
scott-huberty 56a2242
DOC, FIX: add example to docstring and explicitly call pick
scott-huberty 38eb0d1
TST: OK codecov here is your test :)
scott-huberty 404bf7d
STY: 2 lines bt functions
scott-huberty c03a3fb
API: make epochs=None the default find_outlier_chs(epochs=None)
scott-huberty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -771,16 +771,36 @@ def _flag_volt_std(self, flag_dim, threshold=5e-5, picks="eeg"): | |||
| self.flags[flag_dim].add_flag_cat("volt_std", above_threshold, epochs) | ||||
|
|
||||
| def find_outlier_chs(self, inst, picks="eeg"): | ||||
| """Detect outlier Channels to leave out of rereference.""" | ||||
| """Detect outlier Channels to leave out of rereference. | ||||
|
|
||||
| Parameters | ||||
| ---------- | ||||
| inst : mne.Epochs | ||||
scott-huberty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| an instance of mne.Epochs. | ||||
| picks : str (default "eeg") | ||||
| Channels to include in the outlier detection process. You can pass any | ||||
| argument that is valid for the :meth:`~mne.Epochs.pick` method, but | ||||
| you should avoid passing a mix of channel types with differing units of | ||||
| measurement (e.g. EEG and MEG), as this would likely lead to incorrect | ||||
| outlier detection (e.g. all MEG channels would be flagged as outliers). | ||||
|
|
||||
| Returns | ||||
| ------- | ||||
| list | ||||
| a list of channel names that are considered outliers. | ||||
|
|
||||
| Notes | ||||
| ----- | ||||
| - This method is used to detect channels that are so noisy that they | ||||
| should be left out of the robust average rereference process. | ||||
| """ | ||||
| # TODO: Reuse _detect_outliers here. | ||||
| logger.info("🔍 Detecting channels to leave out of reference.") | ||||
| if isinstance(inst, mne.Epochs): | ||||
| epochs = inst | ||||
scott-huberty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| elif isinstance(inst, mne.io.Raw): | ||||
| epochs = self.get_epochs(rereference=False, picks=picks) | ||||
| else: | ||||
| raise TypeError( | ||||
scott-huberty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| "inst must be an MNE Raw or Epochs object," f" but got {type(inst)}." | ||||
| "inst must be an instance of mne.Epochs," f" but got {type(inst)}." | ||||
|
||||
| "inst must be an instance of mne.Epochs," f" but got {type(inst)}." |
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed in 2a747c2 🙂
scott-huberty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
scott-huberty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.