-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
New feature for removing heart artifacts from EEG or ESG data using a Principal Component Analysis - Optimal Basis Sets (PCA-OBS) algorithm #13037
base: main
Are you sure you want to change the base?
Conversation
Updating master with most recent package features
feat: add initial source code
for more information, see https://pre-commit.ci
…e size of indentation tree
…ove more unused variables and imports, add some types
…et data from, how we call functions, how we assert outputs
Update PCA OBS fork with most recent changes in main MNE repo
…ogging to use mne logger instead of prints, add wrapper method in front of private _pca_obs method to handle parallel processing
… to have consistent patterns
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.
Looks like a good start! A few code cleanup/MNE-ization comments, plus an idea about the API
make fit_ecg_template a private function Co-authored-by: Eric Larson <[email protected]>
fix CircleCI error Co-authored-by: Eric Larson <[email protected]>
improve docstring for PCA-OBS function, adds citation Co-authored-by: Eric Larson <[email protected]>
…_validate_type for ndarray check
…exception type to test parameterization
for more information, see https://pre-commit.ci
…orator, add verbose argument and docstring mention, convert docstring of n_jobs
…, remove redundant test
for more information, see https://pre-commit.ci
After adding the if copy:
return raw and reflected this "optional return" in the function typehinting: @verbose
def apply_pca_obs(
...
) -> Raw | None: Added this as I think it's misleading to return anything if the function modifies the raw instance in-place. Happy to change this though if it clashes with the library patterns |
we usually do return the instance even when modifying in-place, to allow method chaining. So it should always return modified (copy of) orig raw |
…ss of copy kwarg to allow method chaining
Sounds good! Thanks for the feedback. Removed conditional return in d170c39 |
* upstream/main: [DOC] extend documentation for add_channels (mne-tools#13051) Add `combine_tfr` to API (mne-tools#13054) Add `combine_spectrum()` function and allow `grand_average()` to support `Spectrum` data (mne-tools#13058) BUG: Fix bug with helium anon (mne-tools#13056) [ENH] Add option to store and return TFR taper weights (mne-tools#12910)
What does this implement/fix?
Our PR implements the PCA-OBS algorithm for removal of heart-artefacts from EEG or ESG datasets. The PCA-OBS algorithm was originally designed to remove the ballistocardiographic artefact in simultaneous EEG-fMRI. Here, it has been adapted to remove the delay between the detected R-peak and the ballistocardiographic artefact such that the algorithm can be applied to remove the cardiac artefact in EEG (electroencephalogrpahy) and ESG (electrospinography) data.
Positive and negative tests have been implemented for the feature, and we have also included an example script which is implemented using data from
openneuro
(dataset ID:ds004388
).Authors:
Emma Bailey [email protected]
Steinn Hauser Magnusson [email protected]