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

ENH: improve dipole plotting with MRI #2995

Open
2 of 4 tasks
agramfort opened this issue Mar 8, 2016 · 31 comments
Open
2 of 4 tasks

ENH: improve dipole plotting with MRI #2995

agramfort opened this issue Mar 8, 2016 · 31 comments
Assignees

Comments

@agramfort
Copy link
Member

agramfort commented Mar 8, 2016

see fieldtrip ft_plot_dipole.m and ft_plot_slice.m

see their tuto at : http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting

EDIT:

Enhancements to plot_dipole_mri_orthoview (#3966):

@dengemann
Copy link
Member

good idea.

@larsoner
Copy link
Member

larsoner commented Mar 8, 2016

@kambysese is this the sort of thing XFit does, too?

@larsoner
Copy link
Member

larsoner commented Mar 8, 2016

Now that nibabel has a slice viewer we could use that. Or should we use nilearn?

@agramfort
Copy link
Member Author

agramfort commented Mar 8, 2016 via email

@kingjr
Copy link
Member

kingjr commented Mar 8, 2016

And nilearn is not going to support interactive viewing any time soon. So
+1 for the nibabel viewer.

On 8 March 2016 at 10:09, Alexandre Gramfort [email protected]
wrote:

I think nibabel would be more adapted. We already have a weak dep on
nibabel


Reply to this email directly or view it on GitHub
#2995 (comment)
.

@ktavabi
Copy link
Contributor

ktavabi commented Mar 8, 2016

@Eric89GXL yes regional/spatiotemporal or moving dipole fits that may be exported as ASCII or binary files. The ASCII files contain a header block followed by >1 lines of fit data per dipole; I'll upload the ASCII files you asked for shortly.

@joewalter
Copy link
Member

I really like the idea. While improving the plotting for dipolar sources, we should also think of modifying the sparse source reconstruction methods, which we have in mne-python, to give dipole output (and stc?), so that we can use the same plot functions for sparse imaging, dipole mapping, and RAP-MUSIC. That would also make it easier to compare these methods.

@agramfort
Copy link
Member Author

agramfort commented Mar 9, 2016 via email

@larsoner
Copy link
Member

I'll probably take this on soonish, unless someone else was planning to.

@larsoner larsoner added this to the 0.13 milestone May 11, 2016
@larsoner larsoner self-assigned this May 11, 2016
@joewalter
Copy link
Member

@Eric89GXL have you made any progress on this issue?
Are there already ideas how to generalize the representation of sparse stcs and dipoles?

@larsoner
Copy link
Member

larsoner commented Jul 26, 2016 via email

@joewalter
Copy link
Member

I think that showing the dipoles on MRI slices is a good idea as this is what people are used to see from other toolboxes.

Maybe it is also a good idea to combine both of your approaches. We could have four axes, three showing orthogonal MRI slices with dipoles and a fourth axes showing a glas brain with the dipoles and orthogonal planes indicating the slices. This fourth plot could then be used e.g. to control the crosshair for the other three axes (e.g. to navigate between dipoles). Furthermore, the glass brain could be used to demonstrate the variability of the source orientation over time by adding a time index (for this a fifth axes showing the time courses could be useful too).

@larsoner
Copy link
Member

larsoner commented Jul 27, 2016 via email

@agramfort
Copy link
Member Author

agramfort commented Jul 27, 2016 via email

@larsoner
Copy link
Member

larsoner commented Aug 1, 2016

Those are... not the most aesthetically pleasing. Hopefully we can do better :)

Didn't know nilearn had a glass brain. Neuromag software also has one in a FIF that I asked about re-using. We can hopefully provide multiple options. should be fairly easy to do that.

But in any case, giving orthoview MRI cuts and a complementary glass brain (probably a different window) should get us a good start.

@ktavabi
Copy link
Contributor

ktavabi commented Aug 4, 2016

+1e7

@larsoner
Copy link
Member

This probably needs something like #3527

@larsoner larsoner removed this from the 0.13 milestone Sep 8, 2016
@ktavabi
Copy link
Contributor

ktavabi commented Sep 8, 2016

@Eric89GXL have you made any progress on this (I see milestone been removed 😟)? BTW why do you think this requires warping?

@larsoner
Copy link
Member

larsoner commented Sep 8, 2016 via email

@ktavabi
Copy link
Contributor

ktavabi commented Sep 9, 2016

Yes that would be tremendous help. I don't have individual MRIs but (still dealing) with case where I need to plot either scatter or group level dipole coordinates on slices of an average MRI template. Overall I understand how this issue, in particular localization benefits from warping, but in terms of visualization it's difficult to show multiple slices that may contain dipoles from more than one subject or condition. It's hard to imagine how anything other than a glass brain in standardized space approach could be more informative or tidy.

@larsoner
Copy link
Member

larsoner commented Sep 9, 2016

Hmm... I was asking if the have-individualized-MRI case would be helpful, but it sounds like you're talking about the case where you do not have those available. So to be clear, you need the case without individualized MRIs, where you want the data coregistered to some template, right?

That is the harder one to get right, as we need some way to coregister the frames. Elekta does something reasonable and maybe not too difficult, but from talking to Jukka about it, I'm inclined to use warping if possible.

@ktavabi
Copy link
Contributor

ktavabi commented Sep 9, 2016

The have-individualized-MRI case should be most generally useful, but in the case of no-individual-MRIs, which is often the case with infant and toddler data, some related way to viz dipole localization e.g., using individual spherical conductor models is useful.

I am not sure if I understand what you mean by coregistering the frames, but if you recall on your last visit to SEA we used translation & scaling to transform dipole locations (coregister frames?) in template MRI space. In this case, given spheres and head shapes alone without MRI data, I presume warping or linear transform makes little difference in the end result.

In either case, I think for viz multiple slices the glass brain approach (from Alex's examples above) may be most reasonable esp for ms illustrations.

@ktavabi
Copy link
Contributor

ktavabi commented Sep 9, 2016

ecd localization-200

@Eric89GXL in hope of making sense I am thinking whether it maybe possible to use localization data shown above as M+SEM scatter, to create a mask image for nilearn.plotting.plot_glass_brain? What I don't know is whether it's possible/necessary to make a glass brain based on MRI template I am using?

@larsoner
Copy link
Member

larsoner commented Sep 9, 2016

In this case, given spheres and head shapes alone without MRI data, I presume warping or linear transform makes little difference in the end result.

It probably won't make a big difference for plotting. But it would be good to have for surrogate subjects at some point, so I'd like to get that going if possible instead of using a stand-in method now that might require deprecation later.

@larsoner
Copy link
Member

Just a note on this topic that in addition to using a glass head with translucent brain, we could add cut-plane MRI slices using Mayavi (which I didn't know was possible).

@larsoner larsoner changed the title plot dipole locations with MRI slices ENH: dipole plotting with MRI Mar 1, 2017
@larsoner larsoner changed the title ENH: dipole plotting with MRI ENH: improve dipole plotting with MRI Mar 21, 2017
@larsoner larsoner added this to the 0.21 milestone Apr 27, 2020
@larsoner larsoner assigned hoechenberger and unassigned larsoner Apr 27, 2020
@hoechenberger
Copy link
Member

:D

@ktavabi
Copy link
Contributor

ktavabi commented Apr 27, 2020

Mayavi...swell 😐

@larsoner larsoner removed this from the 0.21 milestone Sep 1, 2020
@larsoner
Copy link
Member

larsoner commented Jan 7, 2021

@agramfort to modernize this issue, I would probably make vtkImagePlaneWidget support to Brain, and then add dipole plotting to brain. It seems better than adding a mayavi or 3D backend to plot_dipole_mri_orthoview.

@agramfort
Copy link
Member Author

agramfort commented Jan 7, 2021 via email

@larsoner
Copy link
Member

larsoner commented Jan 7, 2021

  • Brain.add_mri to add the slicer
  • Brain.add_dipoles to add a Dipole instance

@agramfort
Copy link
Member Author

agramfort commented Jan 7, 2021 via email

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

No branches or pull requests

7 participants