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

Artifact Detection and BCI-Fit Artifact Report #336

Merged
merged 14 commits into from
Aug 19, 2024
Merged

Conversation

tab-cmd
Copy link
Contributor

@tab-cmd tab-cmd commented Aug 6, 2024

Overview

Added an Artifact Detection class to the signal.evaluate module. Updated the artifact report section to include information about artifacts detected.

Ticket

https://www.pivotaltracker.com/story/show/187526878
https://www.pivotaltracker.com/story/show/187833646

Contributions

  • artifact.py: module added to detect and report on artifacts in EEG data. This replaces the old evaluator and rules modules.
  • report.py: updated the artifact report to extract relevant information and add to the PDF report.

Test

  • make test-all & using the demo_report.py to produce reports.

Documentation

  • Are documentation updates required? In-line, README, or documentation? Added docstrings and extensive documentation to the Evaluate README.

Changelog

  • Is the CHANGELOG.md updated with your detailed changes? TODO

@tab-cmd tab-cmd marked this pull request as ready for review August 7, 2024 18:17
Copy link
Collaborator

@lawhead lawhead left a comment

Choose a reason for hiding this comment

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

This will add some really useful functionality! My comments are optional but would make it easier to extend this with more options.

percent_bad: float = 50.0,
detect_eog: bool = True,
eye_channels: Optional[List[str]] = None,
detect_voltage: bool = True) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than having a of boolean flag for each artifact type it might be more flexible here to have a single parameter that is a list of ArtifactTypes of interest.

extra_labels: Optional[Annotations] = None) -> Annotations:
"""Label the artifacts in the raw data."""
# Create an empty annotations object to store all the annotations
annotations = mne.Annotations(0, 0, 'start')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This class is very large and it might make sense to split up its responsibilities. One option is to introduce the concept of an ArtifactLabeler with a subclass for each type (ex. VoltageLabeler, EOGEventLabeler). Then this method could iterate through the ArtifactTypes of interest, matching each one to a labeler, and combine the results.

@tab-cmd tab-cmd merged commit 586e4d1 into 2.0.0rc4 Aug 19, 2024
6 checks passed
@tab-cmd tab-cmd deleted the artifact-bci-report branch November 4, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants