Skip to content

Conversation

@richardkoehler
Copy link
Contributor

Related to #8681

What does this implement/fix?

Add "dbs" as new channel type for recordings obtained from deep brain stimulation (DBS) electrodes.
The channel type DBS is referenced to in iEEG-BIDS (https://www.nature.com/articles/s41597-019-0105-7

Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

some brief comments

@richardkoehler do you have some public data we could use for a tutorial? that would be a good way to test that it works for end users


.. _Qianliang Li: https://www.dtu.dk/english/service/phonebook/person?id=126774

.. _Richard Koehler: https://github.com/richardkoehler No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

missing empty line

ch_names, chs = self.info['ch_names'], self.info['chs']
picks = pick_types(self.info, meg=False, eeg=True,
seeg=True, ecog=True)
seeg=True, dbs=True, ecog=True)
Copy link
Member

Choose a reason for hiding this comment

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

put the dbs at the end not just after seeg everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will do!

seeg=False, dipole=False, gof=False, bio=False, ecog=False,
fnirs=False, csd=False, include=(), exclude='bads',
selection=None, verbose=None):
seeg=False, dbs=False, dipole=False, gof=False, bio=False,
Copy link
Member

Choose a reason for hiding this comment

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

dbs just be added just before include to avoid risk of crash if someone passed parameters without names

mne/cov.py Outdated
def __init__(self, info, grad=0.1, mag=0.1, eeg=0.1, seeg=0.1, dbs=0.1,
ecog=0.1, hbo=0.1, hbr=0.1, fnirs_cw_amplitude=0.1,
fnirs_fd_ac_amplitude=0.1, fnirs_fd_phase=0.1, fnirs_od=0.1,
csd=0.1, store_precision=False, assume_centered=False):
Copy link
Member

Choose a reason for hiding this comment

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

same here. You cannot insert a parameter in a list without breaking API unless you put it at the end or you enforce named parameters.

# plotting
raw2.plot()
raw2.plot_psd(tmax=2., average=True, n_fft=1024, spatial_colors=False)
raw2.plot_psd(picks=['meg','eeg'], tmax=2., average=True, n_fft=1024,
Copy link
Member

Choose a reason for hiding this comment

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

why did you have to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was getting an Error during testing, but it was my bad, I revoked this change !

@richardkoehler
Copy link
Contributor Author

some brief comments

@richardkoehler do you have some public data we could use for a tutorial? that would be a good way to test that it works for end users

@agramfort Thanks for the comments! I'm working on smoothing out the remaining issues and I will implement your suggestions. I wasn't able to run a full test on my computer, as I kept getting Bus Errors for certain tests (e.g. mne/io/tests/test_pick.py::test_pick_forward_seeg_ecog). I'm happy to provide some public data. Do you want to integrate this in the tests as well or only use it for a tutorial?

richardkoehler and others added 2 commits January 13, 2021 10:55
Adedd gh pull number

Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>
@larsoner
Copy link
Member

larsoner commented Jan 13, 2021

Also note that in #8736 we found a place where seeg was missing, you should check to see if you need a similar change

I'm happy to provide some public data. Do you want to integrate this in the tests as well or only use it for a tutorial?

For tests I think it's enough just to fake DBS data using inst.set_channel_types EDIT: or RawArray with create_info(..., 'dbs')`. Having a tutorial "Working with DBS data" would be cool!

@richardkoehler
Copy link
Contributor Author

Also note that in #8736 we found a place where seeg was missing, you should check to see if you need a similar change

I'm happy to provide some public data. Do you want to integrate this in the tests as well or only use it for a tutorial?

For tests I think it's enough just to fake DBS data using inst.set_channel_types EDIT: or RawArray with create_info(..., 'dbs')`. Having a tutorial "Working with DBS data" would be cool!

Thanks, I added "dbs" to topomap.py as "seeg" in #8736 . I will make a tutorial with DBS data as soon as I have the rest of the PR finalized.

@richardkoehler
Copy link
Contributor Author

@larsoner @agramfort
So, the PR finally passed all checks, although I'm not really sure the tests I added are done the way they should; I tried my best.
Concerning the tutorial, I would need to upload the data to make it publically availabe right? I am already in contact with our data protection office in order to meet all the requirements, but the process might take a while because we might need patient consent. I will also double check if there are any publically available DBS LFP datasets.

@larsoner
Copy link
Member

Concerning the tutorial, I would need to upload the data to make it publically availabe right?

Yes, typically we upload to osf.io though you can use other providers if you want.

Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM, that's a lot of changes!

I think you need a rebase or merge with upstream/master @richardkoehler . Let me know if you need help with it

Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>
Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

let's address the remaining comments from @larsoner and we're good to go!

thx @richardkoehler

@larsoner
Copy link
Member

In it goes, thanks @richardkoehler !

@larsoner larsoner merged commit e4fcd77 into mne-tools:master Jan 15, 2021
@larsoner larsoner mentioned this pull request Feb 19, 2021
larsoner added a commit to vpeterson/mne-python that referenced this pull request Feb 25, 2021
* upstream/master: (66 commits)
  MRG, ENH: Add infant template downloader (mne-tools#8738)
  ENH: add reader for NeuroElectrics .nedf files (mne-tools#8734)
  DOC: improve glossary entry about fiducials (mne-tools#8763)
  MRG, ENH: Add Report.add_custom_css (mne-tools#8762)
  BUG, DOC: read_raw_egi didn't support pathlib.Path; update read_raw() docstring (mne-tools#8759)
  Add "dbs" as new channel type (mne-tools#8739)
  MRG, VIZ: Fix title position in plot_sensors (mne-tools#8752)
  MRG: Support for non-FIFF files in Report.parse_folder (mne-tools#8744)
  MRG, VIZ, FIX: sEEG picking in _prepare_topomap_plot() (mne-tools#8736)
  DOC: don't use single letter variable name in _compute_forward (mne-tools#8727)
  WIP: Fix search [skip github] [skip azp] (mne-tools#8742)
  WIP: Compare Beer-lambert to HOMER (mne-tools#8711)
  MRG: bump spyder version (mne-tools#8020)
  FIX anon with IO round trip (mne-tools#8731)
  fix set_bipolar_reference for Epochs (mne-tools#8728)
  WIP: Add width argument, reduce default (mne-tools#8725)
  ENH: Add toggle-all button to Report (mne-tools#8723)
  fix int/float conversion in nicolet header (mne-tools#8712)
  MRG, BUG: Fix Report.add_bem_to_section n_jobs != 1 (mne-tools#8713)
  MRG, DOC: Make "rank" options in docs more accessible (mne-tools#8707)
  ...
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.

4 participants