Skip to content

MRG+1: plot_trans: add MRI fiducials - #3999

Merged
larsoner merged 12 commits into
mne-tools:masterfrom
christianbrodbeck:coreg2
Feb 21, 2017
Merged

larsoner merged 12 commits into
mne-tools:masterfrom
christianbrodbeck:coreg2

Conversation

@christianbrodbeck

Copy link
Copy Markdown
Member

@Eric89GXL first component of #3466

I made them smaller but same color as head fiducials to indicate the correspondence, do you think that works? Maybe slightly bigger?

The testing data has no fiducials file, if we would add one (should be very small) we could add a test...

fid

@larsoner

Copy link
Copy Markdown
Member

For testing purposes you can just make up a file, right? Use _TempDir, create dict, write with write_dig, etc.

@larsoner

Copy link
Copy Markdown
Member

I think the color is fine. But we should probably try to get in #3991, it already unifies some of these bits of code

@codecov-io

codecov-io commented Feb 16, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #3999 into master will decrease coverage by -0.09%.
The diff coverage is 75.47%.

@@            Coverage Diff             @@
##           master    #3999      +/-   ##
==========================================
- Coverage   86.12%   86.04%   -0.09%     
==========================================
  Files         349      349              
  Lines       62809    62850      +41     
  Branches     9592     9605      +13     
==========================================
- Hits        54097    54081      -16     
- Misses       6030     6088      +58     
+ Partials     2682     2681       -1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc09675...e88c6fd. Read the comment docs.

@larsoner

Copy link
Copy Markdown
Member

Should be ready for rebase now

@agramfort

Copy link
Copy Markdown
Member

if @Eric89GXL and Cis are happy I am happy.

Comment thread mne/viz/_3d.py Outdated

head_alpha = 1.
if mri_fiducials:
from ..coreg import _fiducial_coords # avoid circular import

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.

to avoid the circularity, put the helper in here instead

@christianbrodbeck

Copy link
Copy Markdown
Member Author

@Eric89GXL HPI-color is missing from defaults, is there no previous default?

@larsoner

Copy link
Copy Markdown
Member

I didn't transcribe all of them. It looks like it is (0., 1., 0.).

@christianbrodbeck

christianbrodbeck commented Feb 20, 2017 via email

Copy link
Copy Markdown
Member Author

@larsoner

Copy link
Copy Markdown
Member

Yeah I think it's okay

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Yellow? Is it intentional that the head is now transparent even if not showing any surface inside the head?

screen shot 2017-02-20 at 12 35 30 pm

@larsoner

Copy link
Copy Markdown
Member

Yellow?

We do use these for sources in source space. But maybe that's okay.

Is it intentional that the head is now transparent even if not showing any surface inside the head?

No :(

@christianbrodbeck

Copy link
Copy Markdown
Member Author

This is where head alpha comes from:

    alphas = (4 - np.arange(len(skull) + 1)) * (0.5 / 4.)
    head_alpha = alphas[0]

Should I just substitute 1 if len(skull) is 0?

@larsoner

Copy link
Copy Markdown
Member

I think the value of 0.5 should be 1.0 in the case that there is nothing inside the skull surfaces (no src and no brain).

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Do you think this works? Or Cyan? Magenta?

screen shot 2017-02-20 at 1 12 37 pm

screen shot 2017-02-20 at 1 03 44 pm

@larsoner

Copy link
Copy Markdown
Member

I find the doubled yellow a bit distracting. Cyan or magenta are fine by me

@larsoner larsoner 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.

Otherwise LGTM

Comment thread mne/viz/_3d.py Outdated
defaults['extra_scale'], defaults['ecog_scale']]
for kind, loc in (('dig', car_loc), ('mri', fid_loc)):
if len(loc) > 0:
datas.extend(loc[np.newaxis, i, :] for i in range(3))

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.

This is the same as datas.exend(loc[:, np.newaxis])

@christianbrodbeck

Copy link
Copy Markdown
Member Author

screen shot 2017-02-20 at 2 59 32 pm

screen shot 2017-02-20 at 2 59 34 pm

@larsoner

Copy link
Copy Markdown
Member

LGTM, +1 for merge

@agramfort or @jaeilepp any opinion?

@larsoner larsoner changed the title ENH plot_trans: add MRI fiducials MRG+1: plot_trans: add MRI fiducials Feb 20, 2017
Comment thread mne/viz/_3d.py
If True, plot the digitization points.
dig : bool | 'fiducials'
If True, plot the digitization points. "fiducials" to plot fiducial
points only.

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.

"fiducials" to plot fiducial points only.
->
Use "mri_fiducials" to plot fiducial points only.

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.

I think it would be Use "fiducials" to ... since fiducials are separate from mri_fiducials

@agramfort

agramfort commented Feb 20, 2017 via email

Copy link
Copy Markdown
Member

@larsoner

Copy link
Copy Markdown
Member

@jaeilepp want to look? If you don't have enough time then we have enough +1 for merge

@jaeilepp jaeilepp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Otherwise LGTM.

Comment thread mne/coreg.py Outdated
from numpy import dot

from .io import read_fiducials, write_fiducials
from .io.constants import FIFF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to be removed.

@larsoner

Copy link
Copy Markdown
Member

I killed Travis because it's been waiting 3 hours for an OSX CI, but we should be okay.

Thanks @christianbrodbeck

@larsoner
larsoner merged commit b1786b2 into mne-tools:master Feb 21, 2017
@christianbrodbeck
christianbrodbeck deleted the coreg2 branch February 22, 2017 17:59
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.

5 participants