question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

set_eeg_reference to multiple channel types

See original GitHub issue

Issue

I am analyzing data sets consisting of both ECoG and SEEG channels. One of our preprocessing step is to apply CAR the ecog and seeg channels. In order to ensure comparability between the different electrodes (regardless of whether they are seeg or ecog), we need to apply CAR to all ecog and seeg channels at once, the average to apply also being across seeg and ecog channels. While the set_eeg_reference enables to state which channels should be taken to compute the average, it is only possible to set one channel type as which channels to apply it to.

I have been doing it sequentially at first:

raw.set_eeg_reference(projection=False, ref_channels=ref_channels, ch_type='seeg')

then:

raw_sig.set_eeg_reference(projection=False, ref_channels=ref_channels, ch_type='ecog')

(ref_channels being all seeg and ecog channels here)

This is obviously wrong, as when the second statement is reached, CAR has already been applied to the seeg channels, making the second round of CAR wrong.

Proposed implementation

Would it be possible to pass a list of channel type instead of a single string.

Alternatively, would it be possible to pass a list of channels to apply the CAR to?

Additional comments

Apologies if this a misunderstanding of how things work, I am still rather new to mne. I would offer to handle it myself and do a PR, I am however very uncertain that my programming skill fullfil the mne standards.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
larsonercommented, Mar 5, 2021

We should allow ch_type to be a list of str to support this use case. This seems like a fairly small change, with little risk of users shooting themselves in the foot (they have to explicitly pass such a list, so presumably know what they want).

I would offer to handle it myself and do a PR, I am however very uncertain that my programming skill fullfil the mne standards.

We all start somewhere, and we’re happy to help you along. And if you get stuck or run out of time to work on it, maintainers can push commits to your branch. So a PR would be welcome if you’re up for it!

0reactions
drammockcommented, Aug 11, 2021

closed by #9637

Read more comments on GitHub >

github_iconTop Results From Across the Web

Terms & Conditions - Southeast Toyota Finance
"We," "us," and "our" refer to SETF, its affiliates, agents and service providers or any authorized assignee of the foregoing. "You" and "User" ......
Read more >
Choose a team type to collaborate in Microsoft Teams
Learn more about the different types of teams you can create at your school in Microsoft Teams. Choose the team type that's right...
Read more >
go/types - Go Packages
Package types declares the data types and implements the algorithms for type-checking of Go packages.
Read more >
Channels in Go - Go 101
All channel types are comparable types. From the article value parts, we know that non-nil channel values are multi-part values. If one channel...
Read more >
Define Omni-Channel Unit | Salesforce Trailhead
A true omni-channel customer service center allows your customers to connect seamlessly with your support staff using multiple channels. At the same time, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found