Skip to content

MRG: Add projection to surface for coreg - #4937

Merged
larsoner merged 4 commits into
mne-tools:masterfrom
larsoner:coreg
Feb 23, 2018
Merged

larsoner merged 4 commits into
mne-tools:masterfrom
larsoner:coreg

Conversation

@larsoner

Copy link
Copy Markdown
Member

This PR:

  1. Adds a button to project EEG electrodes to the scalp in mne coreg.
  2. Fixes a bug where --low-res-head didn't always use a low res head (fixed by first looking for outer_skin.surf if it exists; subject-head.fif is now second, as it can be a dense head).
  3. Adds support for normals when surfaces are loaded, enabling hair growing with e.g. outer_skin.surf files.
  4. Adds support for ~ in the --subjects-dir and --trans paths using expanduser.

@christianbrodbeck do you have time to look and try? Example that shows all of these changes at once:

mne coreg --subjects-dir=~/mne_data/MNE-sample-data/subjects -f ~/mne_data/MNE-sample-data/MEG/sample/sample_audvis_raw.fif --no-guess-mri -s sample --low-res-head --project-eeg

screenshot from 2018-02-13 14-52-21

Closes #3700.

@christianbrodbeck

christianbrodbeck commented Feb 13, 2018 via email

Copy link
Copy Markdown
Member

@larsoner larsoner mentioned this pull request Feb 13, 2018
26 of 29 tasks
@larsoner

Copy link
Copy Markdown
Member Author

It's in the View Options panel

@larsoner

Copy link
Copy Markdown
Member Author

(which I did not make a screenshot of)

@christianbrodbeck

christianbrodbeck commented Feb 13, 2018 via email

Copy link
Copy Markdown
Member

@larsoner

Copy link
Copy Markdown
Member Author

Yes. Though it's also what is done internally in make_forward_solution so it has some use to see where your EEG electrodes are actually assumed to be during forward modeling, too.

@codecov

codecov Bot commented Feb 15, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #4937 into master will decrease coverage by <.01%.
The diff coverage is 80.89%.

@@            Coverage Diff             @@
##           master    #4937      +/-   ##
==========================================
- Coverage   87.85%   87.84%   -0.01%     
==========================================
  Files         353      353              
  Lines       62977    63045      +68     
  Branches    10782    10792      +10     
==========================================
+ Hits        55326    55385      +59     
- Misses       4909     4914       +5     
- Partials     2742     2746       +4

@agramfort agramfort left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok if @christianbrodbeck and CIs are happy

@christianbrodbeck christianbrodbeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good so far, but does not seem to work with MRI scaling. If this was intended it should probably be made explicit (disable projection when scaling is turned on).

screen shot 2018-02-20 at 12 19 35 pm

Comment thread mne/commands/mne_coreg.py
guess_mri_subject=options.guess_mri_subject,
head_opacity=options.head_opacity, head_high_res=head_high_res,
trans=op.expanduser(options.trans), scrollable=True,
project_eeg=options.project_eeg, verbose=options.verbose)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Putting in op.expanduser here leads to an error if the relevant attribute is None

@christianbrodbeck

Copy link
Copy Markdown
Member

(If you are planning on investing some time into overhauling the coregistration model it is probably not worth worrying about the scaled MRI here, since that will be handled better in the new model?)

@larsoner

Copy link
Copy Markdown
Member Author

Argh no that scaling problem is a bug

@larsoner larsoner changed the title MRG: Add projection to surface for coreg WIP: Add projection to surface for coreg Feb 21, 2018
@larsoner larsoner changed the title WIP: Add projection to surface for coreg MRG: Add projection to surface for coreg Feb 21, 2018
@larsoner

Copy link
Copy Markdown
Member Author

Okay @christianbrodbeck this should be fixed

@larsoner larsoner added this to the 0.16 milestone Feb 21, 2018
@larsoner

Copy link
Copy Markdown
Member Author

I'll go ahead and merge since the bug is fixed. @christianbrodbeck I am continuing to work on this so if you look and find other things to fix let me know.

@larsoner
larsoner merged commit a78a355 into mne-tools:master Feb 23, 2018
@larsoner
larsoner deleted the coreg branch February 23, 2018 17:10
britta-wstnr pushed a commit to britta-wstnr/mne-python that referenced this pull request Jul 5, 2018
* ENH: Add projection to surface for coreg

* FIX: Fix grow regression

* STY: Fix

* FIX: Fix scaling and expanduser
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.

Add button to project electrodes onto scalp in mne.gui.coregistration

3 participants