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

MRG, ENH: Extend usability of stc_near_sensors #9396

Merged
merged 4 commits into from
May 15, 2021

Conversation

larsoner
Copy link
Member

I have some fNIRS collaborators who generate figures where the fNIRS electrodes are projected onto the nearest brain areas, like in ECoG:

brain

or:

brain

Yes, I know the units on the colorbar are painful. :) But at least it's clear it's just a proximity-based projection and not actual inverse imaging!

This PR makes this possible by:

  1. Adding a picks argument to stc_near_sensors so that fNIRS electrodes (HbO usually) can be used.
  2. Adding a smoothing_steps=0 meaning "no smoothing steps at all". Even smoothing_steps=1 makes some smooth transitions where discrete ones are really desired. This caused me to shift "nearest" to -1 in the brain interface, which I think is fine.
  3. Adding a mode='weighted' argument to stc_near_sensors that ensures that each STC vertex value is either zero, or a weighted sum of values from the sensors. This is more like what our smoothing/interpolation functions usually do. For example, if all sensors have a value of 1, all STC values are either 1 or 0. The default mode "sum" makes it so that some of these values can be greater than 1, which is a bit wacky (it's probably not a great default in this sense).

cc @rob-luke since you might be interested in this. Like I said it's not the greatest, but people do it (like in ECoG / sEEG) so I think it's probably worth having at least some way to do this.

@rob-luke
Copy link
Member

rob-luke commented May 14, 2021

@larsoner this is amazing! I didn't know this would be possible!

This is a great intermediate step until mne-tools/mne-nirs#62 is completed (if ever, that's lots of work I think).

I can add this to the fNIRS tutorial in another PR. Or did you already plan that? I'm keen to play around with this new feature.

@agramfort agramfort merged commit 052ff01 into mne-tools:main May 15, 2021
@agramfort
Copy link
Member

Thx @larsoner

@larsoner larsoner deleted the fnirs-interp branch May 15, 2021 11:01
@rob-luke
Copy link
Member

@larsoner I have to say this again, this is so cool, I love it. Thanks

@larsoner
Copy link
Member Author

I can add this to the fNIRS tutorial in another PR. Or did you already plan that? I'm keen to play around with this new feature.

Feel free to add it to a tutorial!

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.

3 participants