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

Add example using with MNE #146

Merged
merged 3 commits into from
Apr 4, 2019
Merged

Add example using with MNE #146

merged 3 commits into from
Apr 4, 2019

Conversation

TomDonoghue
Copy link
Member

@TomDonoghue TomDonoghue commented Mar 2, 2019

This is a draft of an example for using NDSP together with MNE, related to a suggestion on the JOSS review, and as mentioned in #143

The broad outline is straightforward (grab the MNE sample data, and start messing with it), but I realized it's not so obvious what to do / show in this example.

So far this is a fairly trivial example of extracting a channel of interest, and checking for bursts.

The main thing we would want to show, though, is using NDSP + MNE across multiple channels, and probably in an event related manner, and focusing on custom and interesting NDSP specialties (not showing things that MNE already does well, such as filtering).

So, what quick & straightforward analyses with NDSP would be most useful / interesting to show with an MNE organization / dataset? Ideally a specific but cool analysis on epoched data, across multiple electrodes (channel clusters).

The example data is an audio-visual whereby subjects detect a visual stimulus presentation:
https://martinos.org/mne/stable/manual/sample_dataset.html

Copy link
Contributor

@voytek voytek left a comment

Choose a reason for hiding this comment

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

Simple and straightforward. Nice!

@TomDonoghue
Copy link
Member Author

@voytek I think this probably does need at least a little more, perhaps just showing the burst analysis across multiple channels. There are some questions above in the original post about what is most useful to show, because this is very bare bones at the moment.

@voytek
Copy link
Contributor

voytek commented Mar 4, 2019

Right, but I see all our examples and tutorials as works in progress. My review of the PR isn't "this is what I ultimately want to see" but rather "yes! this is where I want to see it go."

@TomDonoghue
Copy link
Member Author

TomDonoghue commented Mar 14, 2019

So this is the main thing for the NDSP paper - and I do need some feedback / answers on how to finish it, from the questions in the original post. As is, it's not finished, and needs some input on what to do.

Copy link
Contributor

@voytek voytek left a comment

Choose a reason for hiding this comment

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

Looks good

@srcole
Copy link
Contributor

srcole commented Mar 15, 2019

Agree burst detection is a good start. I would say shape analysis would be a good next step, but I guess we're not in bycycle ;)

  • Sliding window matching is 1 possibility:
    Use MNE to source-localize / ICA / whatever processing needed in order to get desired time series. Then identify the kernel with SWM. Though, this is probably just a worse version of multivariate alphacsc

  • Simulate data and put it into an MNE object and then analyze it in MNE?

  • Compute lagged coherence (or SCV) to get an index of rhythmicity at each node. Then plot that on a brain using MNE.

@TomDonoghue
Copy link
Member Author

@srcole

Yeh - I agree an example with ByCycle & MNE would be good - but that would live over in ByCycle! (Once this version is done, we can use it as a template, and add something somewhat analogous to ByCycle).

I don't want this example to get too complex (doing things like source projection), because that all gets a bit over the top - really the main purpose would be to show the core of using NDSP + MNE, and then you can always follow MNE examples to add things like source projection. Putting synthetic data into MNE objects feels a little weird.

I do think the SCV or lagged coherence would be good. I hacked a bit at applying those measures to the sample data, but wasn't sure how to interpret the somewhat messy outputs. I think I'll go back to that - follow up on the bursting by running across multiple channels, and try and add a lagged coherence thing, and hopefully leave it at that for now.

@rdgao
Copy link
Contributor

rdgao commented Mar 16, 2019

I'd not touch SCV - no idea how to to interpret, at least officially.
Lag coherence is good, we're also moving some stuff over from ByCycle right?
Spectral histogram is a pretty easy thing, and you get a viz for free, though that's single channel operation.
Alternatively, you can take the example data and do rotate_powerlaw on it, and see how that changes the time series?

@TomDonoghue TomDonoghue changed the base branch from spectral to master March 16, 2019 19:18
@voytek
Copy link
Contributor

voytek commented Apr 1, 2019

Can we merge this? Since this is the last thing JOSS needs?

@TomDonoghue
Copy link
Member Author

It needs a little more to be a complete tutorial I think.

I'll bump it up the ToDo list - from the discussion above a little bit more stuff with bursts and/or sliding windows should finish it out enough for a first version of this tutorial, to merge & finish up for JOSS.

@TomDonoghue TomDonoghue changed the title WIP: Add example using with MNE Add example using with MNE Apr 3, 2019
@TomDonoghue
Copy link
Member Author

TomDonoghue commented Apr 3, 2019

Okay, I extended this a bit, adding a lagged coherence analysis that shows some reasonable but I think sorta cool things, and plotting the results, and this I think makes it all good enough to merge as first version that demonstrates the main points.

This shouldn't need much more than a quick check through / once over - and then it can be merged.

SideNote: this took a bit of a battle to some of the plotting and colorbars working relatively well together... if anyone knows the dark secrets of adding custom colorbars to MNE topo-plots, please share your magic spells, because I spent forever trying to tweak things (if you don't know how to fix it, you are also forbidden from making any comments about the placement or otherwise of the colorbars :))

@neurodsp-tools neurodsp-tools deleted a comment from codecov-io Apr 3, 2019
@TomDonoghue TomDonoghue requested review from voytek and rdgao and removed request for srcole and rdgao April 3, 2019 04:45
@TomDonoghue TomDonoghue merged commit 9ea29be into master Apr 4, 2019
@TomDonoghue TomDonoghue deleted the mne branch April 4, 2019 06:16
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.

None yet

4 participants