[MRG] DOC: update somato example#253
Conversation
|
let me know when I should look! |
Codecov Report
@@ Coverage Diff @@
## master #253 +/- ##
==========================================
- Coverage 52.93% 52.92% -0.01%
==========================================
Files 23 23
Lines 2747 2749 +2
==========================================
+ Hits 1454 1455 +1
- Misses 1293 1294 +1
Continue to review full report at Codecov.
|
|
@jasmainak any idea why I seem to produce an MNE vertex time course (shown below) that looks different from the one on our documentation page? |
different MNE version :-) I don't think we can really guarantee exactly the same result. But it might be worthwhile to check if the source localization looks correct by doing |
After we resolve this, it might be a good idea to plot the dipole in source space for this example to show how we interpret orientation in the HNN framework. Is there an efficient way to do this that doesn't require a fancy graphics backend? |
MNE does have a 'matplotlib' backend for plotting stc. It might be pretty slow though ... and neglected. OpenGL makes it fast. Speed comes at a cost ... always :-P |
|
see here the plot: https://mne.tools/stable/auto_tutorials/source-modeling/plot_visualize_stc.html#volume-source-estimates just above "Volume Source Estimates" |
Can the matplotlib backend render a vector inverse solution? |
honestly don't know, you just have to try ... |
|
Could be some temporary issue. The MPIBackend might be fragile with respect to timings etc. I would actually stick to Did you check if you can even use multiple cores on Circle? If yes, and if MPI helps make the examples faster, we should consider having a function to set the backend globally and then set it in CircleCI so that the user does not see it in the examples and they can just run it without MPI. But anyhow, this is for 0.2 |
|
If it fails again, try to do what I suggest above. But if you really want to stick to MPI, you can make the sphinx output verbose here and then make a push so you see all the outputs not just what is coming from the error log. |
cjayb
left a comment
There was a problem hiding this comment.
I think this looks good and reads well @rythorpe ! I have only one suggestion: consider adding a static image of the pyvista-generated plot, such as:
and adding a 'caption' to it, so non-mne users get an idea of what we're doing here.
@ntolley I'm done here, please merge when @rythorpe has commented on whether he wants to add the figure (either way, great work!)
|
You can press 'i' to toggle the interface and get a cleaner image |
What do you think of 47e0181? I couldn't figure out how to get a formal caption to show up with an in-line figure in a sphinx-generated document, so I added more text to the paragraph prior. Also, I'm thinking that @cjayb's figure will do nicely since it looks very similar to what the user will produce should they run the code (unlike a cleaned-up version of the figure that I might create). Alternatively, we could add these figures (lateral and top view, respectively) if anyone prefers: |
|
I think it looks good. Do you not want to plot on the inflated surface? I can't see the label otherwise ... |
I'm hesitant to plot this on an inflated surface because the whole point of this exercise is to prompt users to observe how real cortical structure can influence the orientation of a dipolar inverse solution. |
|
but you don't lose that information in inflated surface. Sulci and gyri are shown in different colors ... |
This might be a conversation better had over video call. In theory, you're correct. In practice, however, I'm afraid that new users won't think twice about merely plotting a distributed inverse solution on an inflated brain, selecting the most responsive vertex (or mean or principle component vertex) and orienting the time course in HNN independent of known somatotopic organization and corresponding landmarks. |
|
humm ... okay, let's discuss over video. I'll merge this PR when the CI comes green. I also noticed that you used smoothing=0. I know smoothing can be confusing but it's how folks have been plotting MNE solutions for years. If you see patchy dot-like activity at a certain location, it's not because the activity there is truly 0 but rather that point may not have been sampled in the source space. |
|
I think I'm with @rythorpe on not using the inflated surface. However, I just realised my screenshot is actually showing the anterior bank of whatever sulcus is posterior to the post-central one! Is that where the peak vertex is located? It could very well be, although physiologically the source must be on the "next sulcus over", i.e., the posterior bank of the Rolandic fissure, as we describe in the text... This is getting complicated and potentially confusing! We shouldn't draw too much attention to this, it's supposed to be helpful. |
@cjayb since our method extracts the primary principle component time course from the post-central gyrus label, it's hard to tell exactly where the source we model is located. From the literature, you're right that it should be somewhere in area 3b/1 of the hand representation (i.e., the omega-shaped 'ripple' in the CS). I know it's late for you, but I invited you to @jasmainak and my quick zoom call later today if you wish to join. |
|
I'm actually free now if you guys want to talk earlier :)
…On Mon, Feb 1, 2021 at 3:49 PM Ryan Thorpe ***@***.***> wrote:
I think I'm with @rythorpe <https://github.com/rythorpe> on not using the
inflated surface. However, I just realised my screenshot is actually
showing the anterior bank of whatever sulcus is posterior to the
post-central one! Is that where the peak vertex is located? It could very
well be, although physiologically the source must be on the "next sulcus
over", i.e., the posterior bank of the Rolandic fissure, as we describe in
the text...
This is getting complicated and potentially confusing! We shouldn't draw
too much attention to this, it's supposed to be helpful.
@cjayb <https://github.com/cjayb> since our method extracts the primary
principle component time course from the post-central gyrus label, it's
hard to tell exactly where the source we model is located. From the
literature, you're right that it should be somewhere in area 3b/1 of the
hand representation (i.e., the omega-shaped 'ripple' in the CS). I know
it's late for you, but I invited you to @jasmainak
<https://github.com/jasmainak> and my quick zoom call later today if you
wish to join.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADY6FISTW4JGLP3BZ2UAVWLS44HWJANCNFSM4WN44E4A>
.
|
|
I like it!
Mainak
…On Mon, Feb 1, 2021 at 5:14 PM Ryan Thorpe ***@***.***> wrote:
How about these two images showing the label of interest and MNE
activation, respectively.
[image: fig_1]
<https://user-images.githubusercontent.com/20212206/106524603-cfe75c80-64b0-11eb-9607-3415195c3e7a.png>
[image: fig_2]
<https://user-images.githubusercontent.com/20212206/106524542-b514e800-64b0-11eb-835e-497454e75eb9.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADY6FIQAMUCNT44WCRXBD33S44RTRANCNFSM4WN44E4A>
.
|
|
I'm learning that formatting with reStructured text can be frustrating. I've updated the code to produce the figures shown in my previous comment and updated the corresponding links, though I'm open to suggestions for improving the formatting. |
| # Now we run the simulation over 2 trials so that we can plot the average | ||
| # aggregate dipole. As in :ref:`the MPIBackend example | ||
| # <sphx_glr_auto_examples_plot_simulate_mpi_backend.py>`, we can use | ||
| # ``MPIBackend`` to reduce the simulation time by parallizing across cells in |
There was a problem hiding this comment.
I was going to merge but then noticed there are still references to MPIBackend :)
| # |mne_label_fig| | ||
| # |mne_activity_fig| |
There was a problem hiding this comment.
actually if you put this after the commented lines, it would look most natural because the plot should appear after the code. But I won't insist if you disagree ...
|
Thank you @rythorpe ! It took longer than expected but final product looks great! |
|
Looks amazing, really great touch with the figures!! |
| # .. _this MNE-python example: https://mne.tools/stable/auto_examples/inverse/plot_label_source_activations.html#sphx-glr-auto-examples-inverse-plot-label-source-activations-py # noqa | ||
| # .. |mne_label_fig| image:: https://user-images.githubusercontent.com/20212206/106524603-cfe75c80-64b0-11eb-9607-3415195c3e7a.png # noqa | ||
| # :width: 400 | ||
| # .. |mne_activity_fig| image:: https://user-images.githubusercontent.com/20212206/106524542-b514e800-64b0-11eb-835e-497454e75eb9.png # noqa |
There was a problem hiding this comment.
you do this as you don't want to have to setup pyvista + vtk on your CI?
There was a problem hiding this comment.
yes it's not really worth the effort to set up headless 3D rendering at this stage of HNN development cycle. We might do it after the 0.1 release though (which will happen soon)
There was a problem hiding this comment.
Out of curiosity, what is the primary difficulty with setting up the 3D rendering packages on CI?
There was a problem hiding this comment.
OpenGL requires hardware (GPU) which the headless servers don't have/expose. A software emulation layer is needed, which I'm guessing for something as complex as VTK can be a bit of a hassle. Could also be a performance-issue. It's certainly doable (look at mne!), but I'm glad we decided to side-step it for now: there's plenty to work on as it is :)






Goals:
update MNE vertex selectionNetworkconstructor ifadd_drives_from_params is Truecloses #247