Repository navigation
[MRG] allow to pass a BEM as an instance not just as a string - #5954
Conversation
|
IIRC you must pass |
|
what I would suggest:
just works out of the box. wdyt? @larsoner ? |
|
Sounds good to me. Though instead of |
Codecov Report
@@ Coverage Diff @@
## master #5954 +/- ##
=========================================
+ Coverage 88.71% 88.8% +0.09%
=========================================
Files 401 401
Lines 72754 72767 +13
Branches 12162 12165 +3
=========================================
+ Hits 64542 64621 +79
+ Misses 5272 5217 -55
+ Partials 2940 2929 -11 |
|
@larsoner let me know what you think |
| (``sphere=(0.0, 0.0, 0.0, 90.0)``) if ``bem`` or ``surface`` is not | ||
| ``None`` then ``sphere`` is ignored. | ||
| If you're going to use a BEM conductor model for forward model | ||
| it is recommended to pass it here. |
There was a problem hiding this comment.
All of this should move to Notes
|
cc @drammock you'll see that it's not documented anywhere how to compute a volume source space. If used in our examples it's using a precomputed volume source space. Can you put this in your todo list? thanks |
FWIW there's an example of this lurking in mne-scripts/sample-data/run_meg_volume_tutorial.py |
drammock
left a comment
There was a problem hiding this comment.
Here are a few things I noticed skimming through the docstring changes.
| model. Both are related to the forward model computation and more | ||
| specifically the definion of the conductor model. The | ||
| boundary element model consists of surfaces such as the inner skull, | ||
| outer skull and outer skill that define compartments of tissues |
There was a problem hiding this comment.
outer skill -> outer skin? or outer scalp?
| # the inner skull surface, the outer skull surface and the outer skill | ||
| # The :term:`BEM` surfaces are the triangulations of the interfaces between | ||
| # different tissues needed for forward computation. These surfaces are for | ||
| # example the inner skull surface, the outer skull surface and the outer skill |
| volume source space can then be morphed onto the MRI volume | ||
| using this interpolator. If pos is a dict, this can be None. | ||
| using this interpolator. If pos is a dict, this cannot be None. | ||
| If subject name is provided then the mri will default to 'T1.mgz' |
| Parameters | ||
| ---------- | ||
| subject : str | None | ||
| Subject to process. If None, the path to the mri volume must be |
| Volume source spaces are related to an MRI image such as T1 and allow to | ||
| visualize source estimates overlaid on MRIs and to morph estimates | ||
| to a template brain for group analysis. Discrete source spaces | ||
| don't allow this. If you provide a subject name the T1 mri will be |
| volume_label is None and isinstance(pos, (float, int))): | ||
| mri = 'T1.mgz' | ||
|
|
||
| if volume_label is not None and mri == 'T1.mgz': |
There was a problem hiding this comment.
I have noticed that this if-statement is similar to the one on 1594 (1572), do you think they can be combined?
|
It works on the sample data perfectly. It raises errors when I provide labels, as far as I get it is the expected behavior. |
75458bf to
98bf00b
Compare
|
Thanks @agramfort @OlehKSS |
Here are a few disturbing facts about the setup_volume_source_space.
mne.setup_volume_source_space(subject, subjects_dir=subjects_dir)returns by default a discrete source space that cannot be use for morphing. Even if i have a BEM computed form the T1 MRI if I pass thebem=bemparameter I get a discrete source space :( To have a volume source space which I assume is what most users want I need to type mri='T1.mgz'.Illustration:
I think we should have better defaults so you don't get trapped so easily as reported by @OlehKSS.
thoughts?