Skip to content

Commit

Permalink
Improve documentation and config validation of loose and depth pa…
Browse files Browse the repository at this point in the history
…rameters; drop support for `loose=None` (#915)

Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
  • Loading branch information
hoechenberger and larsoner authored Apr 2, 2024
1 parent 3eccc1d commit 6288770
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
7 changes: 3 additions & 4 deletions docs/source/v1.9.md.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
- The type annotations in the default configuration file are now easier to read: We
replaced `Union[X, Y]` with `X | Y` and `Optional[X]` with `X | None`. (#908, #911 by @hoechenberger)

[//]: # (### :warning: Behavior changes)
### :warning: Behavior changes

[//]: # (- Whatever (#000 by @whoever))
- The [`depth`][mne_bids_pipeline._config.depth] parameter doesn't accept `None`
anymore. Please use `0` instead. (#915 by @hoechenberger)
### :package: Requirements
- We dropped support for Python 3.9. You now need Python 3.10 or newer. (#908 by @hoechenberger)
[//]: # (- Whatever (#000 by @whoever))

### :book: Documentation
- We removed the `Execution` section from configuration options documentation and
Expand Down
37 changes: 23 additions & 14 deletions mne_bids_pipeline/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,24 +1979,33 @@ def mri_landmarks_kind(bids_path):

# ## Inverse solution

loose: float | Literal["auto"] = 0.2
loose: Annotated[float, Interval(ge=0, le=1)] | Literal["auto"] = 0.2
"""
Value that weights the source variances of the dipole components
that are parallel (tangential) to the cortical surface. If `0`, then the
inverse solution is computed with **fixed orientation.**
If `1`, it corresponds to **free orientation.**
The default value, `'auto'`, is set to `0.2` for surface-oriented source
spaces, and to `1.0` for volumetric, discrete, or mixed source spaces,
unless `fixed is True` in which case the value 0. is used.
A value between 0 and 1 that weights the source variances of the dipole components
that are parallel (tangential) to the cortical surface.
If `0`, then the inverse solution is computed with **fixed orientation**, i.e.,
only dipole components perpendicular to the cortical surface are considered.
If `1`, it corresponds to **free orientation**, i.e., dipole components with any
orientation are considered.
The default value, `0.2`, is suitable for surface-oriented source spaces.
For volume or mixed source spaces, choose `1.0`.
!!! info
Support for modeling volume and mixed source spaces will be added in a future
version of MNE-BIDS-Pipeline.
"""

depth: float | dict | None = 0.8
depth: Annotated[float, Interval(ge=0, le=1)] | dict = 0.8
"""
If float (default 0.8), it acts as the depth weighting exponent (`exp`)
to use (must be between 0 and 1). None is equivalent to 0, meaning no
depth weighting is performed. Can also be a `dict` containing additional
keyword arguments to pass to :func:`mne.forward.compute_depth_prior`
(see docstring for details and defaults).
If a number, it acts as the depth weighting exponent to use
(must be between `0` and`1`), with`0` meaning no depth weighting is performed.
Can also be a dictionary containing additional keyword arguments to pass to
`mne.forward.compute_depth_prior` (see docstring for details and defaults).
"""

inverse_method: Literal["MNE", "dSPM", "sLORETA", "eLORETA"] = "dSPM"
Expand Down

0 comments on commit 6288770

Please sign in to comment.