Skip to content

ENH: support MRI viewer #2829

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

Closed
kingjr opened this issue Jan 30, 2016 · 12 comments
Closed

ENH: support MRI viewer #2829

kingjr opened this issue Jan 30, 2016 · 12 comments

Comments

@kingjr
Copy link
Member

kingjr commented Jan 30, 2016

I need an MRI viewer to detect (or rather infer) the locations of intracranial electrodes and add some fitting routing to help the user.

I think the MNE C has this functionality (for the coregistration) but this is not the case in MNE-Python, right?

I tried to see whether it'd be possible to use nilearn plotting functions, but they are not really up for interactive plotting and redirected me to a useful, although pretty dead rep: pynax

I think the MRI viewer will be useful for several use cases, so it might be worth adding such thing in the future. The TODO list to complete pynax would be:

  • plot in mm space instead of voxel space (using nilearn.affine?)
  • have buttons to adjust contrast, luminosity and zoom
  • have a 4th panel (on top of x, y z MRI slices) showing the BEM in 3D with the 3 planes of 2D view.
    In parallel, I'll try to work on specifically on methods to help electrode locations. This is likely to push intracranial people to MNE, because the current methods based on MR (and not CT) are just aweful (I'm just coming back from a tutorial based on a combination of Excel sheet, mricron, FSL and Freesurfer simultaneously opened).

Do you think we should try to work on this in MNE, or have a separate rep?

@choldgraf

@choldgraf
Copy link
Contributor

How common is it to use only MR-based methods? I don't think I've ever seen an ECoG case that had an MR but no CT. Either way, this would be useful for any intracranial people. It'd be useful to include some electrode selection tool as well (as a first pass maybe you can supply a list of channel names and it will let you specify the location for each one?)

@kingjr
Copy link
Member Author

kingjr commented Jan 30, 2016

They don't have any CT at NYU (one of the largest intracranial center), and neither did they in Paris (pretty small intracranial center).

Also, the good thing with MR location is that you can check online that the electrodes are on the surface of the cortex.

It'd be useful to include some electrode selection tool as well (as a first pass maybe you can supply a list of channel names and it will let you specify the location for each one?)

Absolutely, I was thinking of having a button that increment a list of electrode arrays. You would add an array by specifying the number and arrangements of electrodes (e.g. 1 strip of 8 electrodes interspaced by 10 mm, or a grid of 4 * 8) and indicate whether it is rigid (depth electrode) or flexible (surface) so has to fit a line of a spline to automatically propose all the location of the array from 2 or 3 inputs.

@choldgraf
Copy link
Contributor

Interesting - I didn't realize that they don't use CT scans. What do you mean you can check "online"? As in, intraoperatively?

Re: electrode selection, that sounds good to me. Could be worth implementing a Grid and Depth class, if anything just to be containers for the proper information for each set of channels. I think it could be useful for handling the viz / surface snapping stuff, though maybe is overkill for the MNE package more generally.

@agramfort
Copy link
Member

agramfort commented Jan 30, 2016 via email

@larsoner
Copy link
Member

larsoner commented Feb 1, 2016

Also nibabel almost had some level of visualization support for viewing slices:

nipy/nibabel#251

I wonder if we should start our own separate package for this sort of thing.

@dgwakeman
Copy link
Contributor

This would be a good project to coordinate with @aestrivex and Noam Peled. @aestrivex has built a tool with visualizes and even autodetects intracranial electrodes (there is a manuscript in prep).

@larsoner larsoner changed the title EHN: support MRI viewer ENH: support MRI viewer Feb 3, 2016
@kingjr
Copy link
Member Author

kingjr commented Feb 12, 2016

Thanks @Eric89GXL for the link. I eventually used your viewer, as it was cleaner. (The main difficulty is to go back and forth from head coordinates to image coordinates.)

I've started a separate rep here https://github.com/kingjr/ecoggui as this seemed a bit too disjoint from MNE. It is still preliminary, but it works (on my computer..).

The main blocker is that my electrode fitting is way too slow, but I implemented my own loss function, so I expect that it improvable by several orders of magnitudes... (if there is any optimization experts in the room... ... ... too busy? ok.)

@choldgraf Let me know whether you're still up for helping ;).

@kingjr kingjr closed this as completed Feb 12, 2016
@choldgraf
Copy link
Contributor

@kingjr my workload should lighten up in a few weeks or so...keep me in the loop and I will help out once I've got the time!

@kingjr
Copy link
Member Author

kingjr commented Feb 13, 2016

Sure. Here's an animated gif to persuade you to join in earlier than later.

ecoggui_animation

Isn't that persuasive? :]

@choldgraf
Copy link
Contributor

hehe - is that one of the new matplotlib colormaps I see? That is
compelling indeed :)

Also, this is the first I've seen someone selecting electrode positions
based on the MRI dropout. Cool!

On Fri, Feb 12, 2016 at 9:16 PM, Jean-Rémi KING [email protected]
wrote:

Sure. Here's an animated gif to persuade you to join in earlier than later.

[image: ecoggui_animation]
https://cloud.githubusercontent.com/assets/4881164/13026019/ab1e9600-d1e6-11e5-80c2-bc0431a5b109.gif

Isn't that persuasive? :]


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

@kingjr
Copy link
Member Author

kingjr commented Feb 15, 2016

maybe we should write a paper then ;)

On 13 February 2016 at 13:14, Chris Holdgraf [email protected]
wrote:

hehe - is that one of the new matplotlib colormaps I see? That is
compelling indeed :)

Also, this is the first I've seen someone selecting electrode positions
based on the MRI dropout. Cool!

On Fri, Feb 12, 2016 at 9:16 PM, Jean-Rémi KING [email protected]
wrote:

Sure. Here's an animated gif to persuade you to join in earlier than
later.

[image: ecoggui_animation]
<
https://cloud.githubusercontent.com/assets/4881164/13026019/ab1e9600-d1e6-11e5-80c2-bc0431a5b109.gif

Isn't that persuasive? :]


Reply to this email directly or view it on GitHub
<
#2829 (comment)

.


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

@choldgraf
Copy link
Contributor

Actually for a long time I've wanted to write a "best practices in ECoG"
kind of paper (or set of blog posts, or something)...right now it seems
like everybody just goes with whatever works best for them :P

On Mon, Feb 15, 2016 at 11:13 AM, Jean-Rémi KING [email protected]
wrote:

maybe we should write a paper then ;)

On 13 February 2016 at 13:14, Chris Holdgraf [email protected]
wrote:

hehe - is that one of the new matplotlib colormaps I see? That is
compelling indeed :)

Also, this is the first I've seen someone selecting electrode positions
based on the MRI dropout. Cool!

On Fri, Feb 12, 2016 at 9:16 PM, Jean-Rémi KING <
[email protected]>
wrote:

Sure. Here's an animated gif to persuade you to join in earlier than
later.

[image: ecoggui_animation]
<

https://cloud.githubusercontent.com/assets/4881164/13026019/ab1e9600-d1e6-11e5-80c2-bc0431a5b109.gif

Isn't that persuasive? :]


Reply to this email directly or view it on GitHub
<

#2829 (comment)

.


Reply to this email directly or view it on GitHub
<
#2829 (comment)

.


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

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

5 participants