Compute sensitivity map. Such maps are used to know how much sources are visible by a type of sensor, and how much projections shadow some sources. Parameters ---------- fwd : Forward The forward operator. projs : list List of projection vectors. ch_type
(
fwd, projs=None, ch_type="grad", mode="fixed", exclude=(), *, verbose=None
)
| 378 | |
| 379 | @verbose |
| 380 | def sensitivity_map( |
| 381 | fwd, projs=None, ch_type="grad", mode="fixed", exclude=(), *, verbose=None |
| 382 | ): |
| 383 | """Compute sensitivity map. |
| 384 | |
| 385 | Such maps are used to know how much sources are visible by a type |
| 386 | of sensor, and how much projections shadow some sources. |
| 387 | |
| 388 | Parameters |
| 389 | ---------- |
| 390 | fwd : Forward |
| 391 | The forward operator. |
| 392 | projs : list |
| 393 | List of projection vectors. |
| 394 | ch_type : ``'grad'`` | ``'mag'`` | ``'eeg'`` |
| 395 | The type of sensors to use. |
| 396 | mode : ``'free'`` | ``'fixed'`` | ``'ratio'`` | ``'radiality'`` | ``'angle'`` | ``'remaining'`` | ``'dampening'`` |
| 397 | |
| 398 | Which sensitivity quantity to compute: |
| 399 | |
| 400 | - 'free' : Maximum obtainable signal over all source orientations. |
| 401 | - 'fixed' : Signal from sources constrained to be normal to the |
| 402 | cortical surface. |
| 403 | - 'ratio' : Ratio of 'fixed' sensitivity to the 'free' |
| 404 | (maximum-over-orientations) sensitivity. |
| 405 | - 'radiality' : Ratio of signal from sources normal to the cortex |
| 406 | to the maximum signal among all orientations. |
| 407 | - 'angle' : Subspace angle with the noise subspace. |
| 408 | - 'remaining' : Fraction of signal remaining after the projection |
| 409 | (e.g., after SSS/SSP). |
| 410 | - 'dampening' : Fraction of signal dampening due to the projection. |
| 411 | exclude : list of str | str |
| 412 | List of channels to exclude. If empty do not exclude any (default). |
| 413 | If ``'bads'``, exclude channels in ``fwd['info']['bads']``. |
| 414 | %(verbose)s |
| 415 | |
| 416 | Returns |
| 417 | ------- |
| 418 | stc : SourceEstimate | VolSourceEstimate |
| 419 | The sensitivity map as a SourceEstimate or VolSourceEstimate instance |
| 420 | for visualization. |
| 421 | |
| 422 | Notes |
| 423 | ----- |
| 424 | When mode is ``'fixed'`` or ``'free'``, the sensitivity map is normalized |
| 425 | by its maximum value. |
| 426 | """ # noqa: E501 |
| 427 | # check strings |
| 428 | _check_option("ch_type", ch_type, ["eeg", "grad", "mag"]) |
| 429 | _check_option( |
| 430 | "mode", |
| 431 | mode, |
| 432 | ["free", "fixed", "ratio", "radiality", "angle", "remaining", "dampening"], |
| 433 | ) |
| 434 | |
| 435 | # check forward |
| 436 | if is_fixed_orient(fwd, orig=True): |
| 437 | raise ValueError("fwd should must be computed with free orientation") |