-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[MRG] Improve docstring format and support floats for conductivity in make_bem_model #12020
Merged
Merged
Changes from 29 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
c728bd7
start changing coreg GUI to support inst directly
mscheltienne 99670f6
fix style
mscheltienne bedf004
support conductivity as float
mscheltienne bb44491
better format
mscheltienne 165c9d2
better format
mscheltienne b3e5eb7
better style
mscheltienne acf4932
fix type
mscheltienne 238a462
better bib style
mscheltienne d9ab5f4
better bib style
mscheltienne 2d01909
add r to docstring
mscheltienne 6093719
Revert "start changing coreg GUI to support inst directly"
mscheltienne 2959a10
use constrained_layout for plot_white
mscheltienne f4a8f62
fix style in covariance tutorial
mscheltienne 66f19b6
improve citation style
mscheltienne fa7404f
better style
mscheltienne 44d22ef
add ref to overview doc
mscheltienne 3b36277
update link to something useful
mscheltienne 1b44318
use note and code-block
mscheltienne 9d950be
Update doc/_includes/bem_model.rst
mscheltienne c7dfecc
add x-ref [ci skip]
mscheltienne a9673ca
Merge branch 'dev' of https://github.com/mscheltienne/mne-python into…
mscheltienne 13effea
include perma-link [ci skip]
mscheltienne f9462d9
add x-ref [ci skip]
mscheltienne 5087b42
add x-ref [ci skip]
mscheltienne 5356d09
better doc [ci skip]
mscheltienne 651b031
fix typo [ci skip]
mscheltienne 95035ce
add argument n_jobs to setup_volume_source_space [ci skip]
mscheltienne 495b771
rm backslashes for bibliography
mscheltienne e41951a
Update mne/cov.py
mscheltienne e6c83b3
rm unneeded r"""
mscheltienne 42044bf
Merge branch 'main' into dev
mscheltienne 719c952
improvements to SourceSpaces
mscheltienne 3317fac
fix style
mscheltienne 866d9c3
check for constrained layout
mscheltienne d82af6e
Merge branch 'dev' of https://github.com/mscheltienne/mne-python into…
mscheltienne a721bb4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0ca563a
fix typo
mscheltienne 7f31f6a
apply suggestion from larsoner [ci skip]
mscheltienne aae79b9
remove layout section
mscheltienne 66ed3d2
Merge branch 'dev' of https://github.com/mscheltienne/mne-python into…
mscheltienne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1653,6 +1653,8 @@ def setup_volume_source_space( | |
add_interpolator=True, | ||
sphere_units="m", | ||
single_volume=False, | ||
n_jobs=None, | ||
*, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Second code change, add the argument
mscheltienne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
verbose=None, | ||
): | ||
"""Set up a volume source space with grid spacing or discrete source space. | ||
|
@@ -1662,12 +1664,12 @@ def setup_volume_source_space( | |
subject : str | None | ||
Subject to process. If None, the path to the MRI volume must be | ||
absolute to get a volume source space. If a subject name | ||
is provided the T1.mgz file will be found automatically. | ||
is provided the ``T1.mgz`` file will be found automatically. | ||
Defaults to None. | ||
pos : float | dict | ||
Positions to use for sources. If float, a grid will be constructed | ||
with the spacing given by ``pos`` in mm, generating a volume source | ||
space. If dict, pos['rr'] and pos['nn'] will be used as the source | ||
space. If dict, ``pos['rr']`` and ``pos['nn']`` will be used as the source | ||
space locations (in meters) and normals, respectively, creating a | ||
discrete source space. | ||
|
||
|
@@ -1679,21 +1681,24 @@ def setup_volume_source_space( | |
volume source space can then be morphed onto the MRI volume | ||
using this interpolator. If pos is a dict, this cannot be None. | ||
If subject name is provided, ``pos`` is a float or ``volume_label`` | ||
are not provided then the ``mri`` parameter will default to 'T1.mgz' | ||
are not provided then the ``mri`` parameter will default to ``'T1.mgz'`` | ||
or ``aseg.mgz``, respectively, else it will stay None. | ||
sphere : ndarray, shape (4,) | ConductorModel | None | ||
Define spherical source space bounds using origin and radius given | ||
by (ox, oy, oz, rad) in ``sphere_units``. | ||
by ``(Ox, Oy, Oz, rad)`` in ``sphere_units``. | ||
Only used if ``bem`` and ``surface`` are both None. Can also be a | ||
spherical ConductorModel, which will use the origin and radius. | ||
None (the default) uses a head-digitization fit. | ||
bem : path-like | None | ConductorModel | ||
Define source space bounds using a BEM file (specifically the inner | ||
skull surface) or a ConductorModel for a 1-layer of 3-layers BEM. | ||
skull surface) or a :class:`~mne.bem.ConductorModel` for a 1-layer of 3-layers | ||
BEM. See :func:`~mne.make_bem_model` and :func:`~mne.make_bem_solution` to | ||
create a :class:`~mne.bem.ConductorModel`. If provided, ``surface`` must be | ||
None. | ||
surface : path-like | dict | None | ||
Define source space bounds using a FreeSurfer surface file. Can | ||
also be a dictionary with entries ``'rr'`` and ``'tris'``, such as | ||
those returned by :func:`mne.read_surface`. | ||
those returned by :func:`mne.read_surface`. If provided, ``bem`` must be None. | ||
mindist : float | ||
Exclude points closer than this distance (mm) to the bounding surface. | ||
exclude : float | ||
|
@@ -1725,6 +1730,7 @@ def setup_volume_source_space( | |
when many labels are used. | ||
|
||
.. versionadded:: 0.21 | ||
%(n_jobs)s | ||
mscheltienne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
%(verbose)s | ||
|
||
Returns | ||
|
@@ -1781,7 +1787,7 @@ def setup_volume_source_space( | |
) | ||
|
||
if bem is not None and surface is not None: | ||
raise ValueError('Only one of "bem" and "surface" should be ' "specified") | ||
raise ValueError("Only one of 'bem' and 'surface' should be specified.") | ||
|
||
if mri is None and subject is not None: | ||
if volume_label is not None: | ||
|
@@ -1908,6 +1914,7 @@ def setup_volume_source_space( | |
mindist, | ||
mri, | ||
volume_label, | ||
n_jobs=n_jobs, | ||
vol_info=vol_info, | ||
single_volume=single_volume, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First code-change in this PR, supporting floats directly for
conductivity
instead of array of shape(1, )
for single-layer model.