0
# Source Analysis
1
2
Complete source analysis pipeline including forward modeling, boundary element modeling, minimum norm estimation, beamforming, and dipole fitting for localizing brain activity from MEG/EEG measurements.
3
4
## Capabilities
5
6
### Forward Modeling
7
8
Create forward solutions that model how brain activity propagates to sensors.
9
10
```python { .api }
11
def make_forward_solution(info: Info, trans: Union[str, Transform], src: Union[str, SourceSpaces],
12
bem: Union[str, Dict], meg: bool = True, eeg: bool = True,
13
mindist: float = 0.0, ignore_ref: bool = False,
14
n_jobs: int = 1, verbose: Optional[Union[bool, str, int]] = None) -> Forward:
15
"""
16
Create forward solution from BEM model and source space.
17
18
Parameters:
19
- info: Measurement info
20
- trans: Head<->MRI coordinate transformation
21
- src: Source space or path to source space file
22
- bem: BEM model or path to BEM solution
23
- meg: Include MEG channels
24
- eeg: Include EEG channels
25
- mindist: Minimum distance from sources to inner skull
26
- ignore_ref: Ignore reference channels
27
- n_jobs: Number of parallel jobs
28
- verbose: Verbosity level
29
30
Returns:
31
Forward solution object
32
"""
33
34
def read_forward_solution(fname: str, include: Optional[List[str]] = None,
35
exclude: Optional[List[str]] = None,
36
verbose: Optional[Union[bool, str, int]] = None) -> Forward:
37
"""
38
Read forward solution from file.
39
40
Parameters:
41
- fname: Path to forward solution file
42
- include: Channel types to include
43
- exclude: Channel types to exclude
44
- verbose: Verbosity level
45
46
Returns:
47
Forward solution object
48
"""
49
50
def apply_forward(fwd: Forward, stc: SourceEstimate, info: Info,
51
start: Optional[int] = None, stop: Optional[int] = None,
52
use_cps: bool = True, verbose: Optional[Union[bool, str, int]] = None) -> Evoked:
53
"""
54
Apply forward solution to source estimate.
55
56
Parameters:
57
- fwd: Forward solution
58
- stc: Source estimate
59
- info: Measurement info for output
60
- start: Start sample index
61
- stop: Stop sample index
62
- use_cps: Use complex-valued source estimates
63
- verbose: Verbosity level
64
65
Returns:
66
Evoked object with simulated sensor data
67
"""
68
69
def convert_forward_solution(fwd: Forward, surf_ori: bool = False, force_fixed: bool = False,
70
copy: bool = True, use_cps: bool = True,
71
verbose: Optional[Union[bool, str, int]] = None) -> Forward:
72
"""
73
Convert forward solution between different formats.
74
75
Parameters:
76
- fwd: Forward solution to convert
77
- surf_ori: Use surface-based orientation constraint
78
- force_fixed: Force fixed orientation
79
- copy: Make copy of forward solution
80
- use_cps: Use complex-valued computations
81
- verbose: Verbosity level
82
83
Returns:
84
Converted forward solution
85
"""
86
```
87
88
### Source Spaces
89
90
Create and manipulate source spaces defining locations where brain activity is estimated.
91
92
```python { .api }
93
def setup_source_space(subject: str, spacing: Union[str, int] = 'oct6',
94
surface: str = 'white', subjects_dir: Optional[str] = None,
95
add_dist: bool = True, n_jobs: int = 1,
96
verbose: Optional[Union[bool, str, int]] = None) -> SourceSpaces:
97
"""
98
Set up cortical source space.
99
100
Parameters:
101
- subject: Subject name
102
- spacing: Source spacing ('oct6', 'oct5', 'ico4', etc.)
103
- surface: Cortical surface to use
104
- subjects_dir: FreeSurfer subjects directory
105
- add_dist: Add distance information
106
- n_jobs: Number of parallel jobs
107
- verbose: Verbosity level
108
109
Returns:
110
SourceSpaces object
111
"""
112
113
def setup_volume_source_space(subject: str, pos: Union[float, Dict] = 5.0,
114
mri: Optional[str] = None, sphere: Optional[Tuple[float, float, float, float]] = None,
115
bem: Optional[Union[str, Dict]] = None, surface: Optional[str] = None,
116
mindist: float = 5.0, exclude: float = 0.0,
117
subjects_dir: Optional[str] = None, volume_label: Optional[Union[str, List[str]]] = None,
118
add_interpolator: bool = True, verbose: Optional[Union[bool, str, int]] = None) -> SourceSpaces:
119
"""
120
Set up volume source space.
121
122
Parameters:
123
- subject: Subject name
124
- pos: Source positions (grid spacing or position dictionary)
125
- mri: MRI filename for coordinate system
126
- sphere: Sphere parameters for source space
127
- bem: BEM model for source space boundary
128
- surface: Surface for source space boundary
129
- mindist: Minimum distance from sources to boundary
130
- exclude: Exclusion distance from boundary
131
- subjects_dir: FreeSurfer subjects directory
132
- volume_label: Volume label(s) to restrict sources
133
- add_interpolator: Add volume interpolator
134
- verbose: Verbosity level
135
136
Returns:
137
Volume SourceSpaces object
138
"""
139
140
def read_source_spaces(fname: str, patch_stats: bool = False,
141
verbose: Optional[Union[bool, str, int]] = None) -> SourceSpaces:
142
"""
143
Read source spaces from file.
144
145
Parameters:
146
- fname: Path to source space file
147
- patch_stats: Add patch statistics
148
- verbose: Verbosity level
149
150
Returns:
151
SourceSpaces object
152
"""
153
154
def morph_source_spaces(src_from: SourceSpaces, subject_to: str,
155
surf: str = 'white', subjects_dir: Optional[str] = None,
156
verbose: Optional[Union[bool, str, int]] = None) -> SourceSpaces:
157
"""
158
Morph source space from one subject to another.
159
160
Parameters:
161
- src_from: Source space to morph
162
- subject_to: Target subject
163
- surf: Surface to use for morphing
164
- subjects_dir: FreeSurfer subjects directory
165
- verbose: Verbosity level
166
167
Returns:
168
Morphed SourceSpaces object
169
"""
170
```
171
172
### Boundary Element Modeling (BEM)
173
174
Create and manipulate boundary element models for forward solution computation.
175
176
```python { .api }
177
def make_bem_model(subject: str, ico: Optional[int] = 4, conductivity: Tuple[float, ...] = (0.3, 0.006, 0.3),
178
subjects_dir: Optional[str] = None, verbose: Optional[Union[bool, str, int]] = None) -> List[Dict]:
179
"""
180
Create BEM model surfaces.
181
182
Parameters:
183
- subject: Subject name
184
- ico: Icosahedron subdivision level
185
- conductivity: Conductivity values for each surface
186
- subjects_dir: FreeSurfer subjects directory
187
- verbose: Verbosity level
188
189
Returns:
190
List of BEM surface dictionaries
191
"""
192
193
def make_bem_solution(surfs: List[Dict], verbose: Optional[Union[bool, str, int]] = None) -> Dict:
194
"""
195
Create BEM solution from surfaces.
196
197
Parameters:
198
- surfs: BEM surfaces from make_bem_model
199
- verbose: Verbosity level
200
201
Returns:
202
BEM solution dictionary
203
"""
204
205
def read_bem_solution(fname: str, verbose: Optional[Union[bool, str, int]] = None) -> Dict:
206
"""
207
Read BEM solution from file.
208
209
Parameters:
210
- fname: Path to BEM solution file
211
- verbose: Verbosity level
212
213
Returns:
214
BEM solution dictionary
215
"""
216
217
def make_sphere_model(r0: Tuple[float, float, float] = (0.0, 0.0, 0.04),
218
head_radius: Optional[float] = None,
219
info: Optional[Info] = None, relative_radii: Tuple[float, ...] = (0.90, 0.92, 1.0),
220
sigmas: Tuple[float, ...] = (0.33, 0.004, 0.33),
221
verbose: Optional[Union[bool, str, int]] = None) -> Dict:
222
"""
223
Create spherical head model.
224
225
Parameters:
226
- r0: Head center coordinates
227
- head_radius: Head radius
228
- info: Measurement info for automatic head radius
229
- relative_radii: Relative radii of spherical shells
230
- sigmas: Conductivity values
231
- verbose: Verbosity level
232
233
Returns:
234
Spherical BEM model dictionary
235
"""
236
```
237
238
### Minimum Norm Estimation
239
240
Compute distributed source estimates using minimum norm methods.
241
242
```python { .api }
243
def make_inverse_operator(info: Info, forward: Forward, noise_cov: Covariance,
244
loose: Union[float, str] = 0.2, depth: Optional[float] = 0.8,
245
fixed: bool = False, limit_depth_chs: bool = True,
246
use_cps: bool = True, verbose: Optional[Union[bool, str, int]] = None) -> InverseOperator:
247
"""
248
Create inverse operator for source estimation.
249
250
Parameters:
251
- info: Measurement info
252
- forward: Forward solution
253
- noise_cov: Noise covariance matrix
254
- loose: Loose orientation constraint (0-1)
255
- depth: Depth weighting parameter
256
- fixed: Use fixed orientation constraint
257
- limit_depth_chs: Limit depth weighting to channels
258
- use_cps: Use cortical patch statistics
259
- verbose: Verbosity level
260
261
Returns:
262
InverseOperator object
263
"""
264
265
def apply_inverse(evoked: Evoked, inverse_operator: InverseOperator, lambda2: float,
266
method: str = 'dSPM', pick_ori: Optional[str] = None,
267
prepared: bool = False, label: Optional[Label] = None,
268
method_params: Optional[Dict] = None, return_residual: bool = False,
269
use_cps: bool = True, verbose: Optional[Union[bool, str, int]] = None) -> SourceEstimate:
270
"""
271
Apply inverse operator to evoked data.
272
273
Parameters:
274
- evoked: Evoked data
275
- inverse_operator: Inverse operator
276
- lambda2: Regularization parameter
277
- method: Inverse method ('MNE', 'dSPM', 'sLORETA', 'eLORETA')
278
- pick_ori: Orientation picking ('normal', 'max-power')
279
- prepared: Whether inverse operator is prepared
280
- label: Restrict sources to label
281
- method_params: Additional method parameters
282
- return_residual: Return residual as well
283
- use_cps: Use cortical patch statistics
284
- verbose: Verbosity level
285
286
Returns:
287
SourceEstimate object
288
"""
289
290
def apply_inverse_epochs(epochs: Epochs, inverse_operator: InverseOperator, lambda2: float,
291
method: str = 'dSPM', pick_ori: Optional[str] = None,
292
prepared: bool = False, label: Optional[Label] = None,
293
method_params: Optional[Dict] = None, return_generator: bool = False,
294
use_cps: bool = True, verbose: Optional[Union[bool, str, int]] = None) -> List[SourceEstimate]:
295
"""
296
Apply inverse operator to epochs.
297
298
Parameters:
299
- epochs: Epochs data
300
- inverse_operator: Inverse operator
301
- lambda2: Regularization parameter
302
- method: Inverse method
303
- pick_ori: Orientation picking
304
- prepared: Whether inverse operator is prepared
305
- label: Restrict sources to label
306
- method_params: Additional method parameters
307
- return_generator: Return generator instead of list
308
- use_cps: Use cortical patch statistics
309
- verbose: Verbosity level
310
311
Returns:
312
List of SourceEstimate objects
313
"""
314
315
def compute_source_psd(raw: Raw, inverse_operator: InverseOperator, lambda2: float = 1.0 / 9.0,
316
method: str = 'dSPM', tmin: Optional[float] = None, tmax: Optional[float] = None,
317
fmin: float = 0.0, fmax: float = 200.0, pick_ori: Optional[str] = None,
318
label: Optional[Label] = None, n_fft: int = 2048, overlap: float = 0.5,
319
prepared: bool = False, method_params: Optional[Dict] = None,
320
dB: bool = False, return_sensor: bool = False,
321
bandwidth: str = 'hann', adaptive: bool = False, low_bias: bool = True,
322
normalization: str = 'length', n_jobs: int = 1,
323
verbose: Optional[Union[bool, str, int]] = None) -> SourceEstimate:
324
"""
325
Compute source power spectral density using minimum norm.
326
327
Parameters:
328
- raw: Raw data
329
- inverse_operator: Inverse operator
330
- lambda2: Regularization parameter
331
- method: Inverse method
332
- tmin: Start time
333
- tmax: End time
334
- fmin: Minimum frequency
335
- fmax: Maximum frequency
336
- pick_ori: Orientation picking
337
- label: Restrict to label
338
- n_fft: FFT length
339
- overlap: Overlap fraction
340
- prepared: Whether inverse is prepared
341
- method_params: Method parameters
342
- dB: Return in decibels
343
- return_sensor: Return sensor PSD as well
344
- bandwidth: Multitaper bandwidth
345
- adaptive: Use adaptive weights
346
- low_bias: Reduce bias
347
- normalization: Normalization method
348
- n_jobs: Number of parallel jobs
349
- verbose: Verbosity level
350
351
Returns:
352
SourceEstimate with PSD data
353
"""
354
```
355
356
### Beamforming
357
358
Use beamforming methods for source estimation with spatial filtering.
359
360
```python { .api }
361
def make_lcmv(info: Info, forward: Forward, data_cov: Covariance, reg: float = 0.05,
362
noise_cov: Optional[Covariance] = None, label: Optional[Label] = None,
363
pick_ori: Optional[str] = None, rank: Optional[Union[str, int, Dict]] = None,
364
weight_norm: Optional[str] = 'unit-noise-gain', reduce_rank: bool = False,
365
depth: Optional[float] = None, inversion: str = 'matrix',
366
verbose: Optional[Union[bool, str, int]] = None) -> Dict:
367
"""
368
Compute LCMV (linearly constrained minimum variance) beamformer weights.
369
370
Parameters:
371
- info: Measurement info
372
- forward: Forward solution
373
- data_cov: Data covariance matrix
374
- reg: Regularization parameter
375
- noise_cov: Noise covariance matrix
376
- label: Restrict to label
377
- pick_ori: Orientation constraint
378
- rank: Data rank specification
379
- weight_norm: Weight normalization
380
- reduce_rank: Reduce rank of covariance
381
- depth: Depth weighting
382
- inversion: Matrix inversion method
383
- verbose: Verbosity level
384
385
Returns:
386
Dictionary with beamformer weights and filters
387
"""
388
389
def apply_lcmv(evoked: Evoked, filters: Dict, max_ori_out: str = 'signed',
390
verbose: Optional[Union[bool, str, int]] = None) -> SourceEstimate:
391
"""
392
Apply LCMV beamformer to evoked data.
393
394
Parameters:
395
- evoked: Evoked data to beamform
396
- filters: LCMV filters from make_lcmv
397
- max_ori_out: Maximum orientation output
398
- verbose: Verbosity level
399
400
Returns:
401
SourceEstimate with beamformed data
402
"""
403
404
def apply_lcmv_epochs(epochs: Epochs, filters: Dict, max_ori_out: str = 'signed',
405
return_generator: bool = False, verbose: Optional[Union[bool, str, int]] = None) -> List[SourceEstimate]:
406
"""
407
Apply LCMV beamformer to epochs.
408
409
Parameters:
410
- epochs: Epochs data to beamform
411
- filters: LCMV filters from make_lcmv
412
- max_ori_out: Maximum orientation output
413
- return_generator: Return generator instead of list
414
- verbose: Verbosity level
415
416
Returns:
417
List of SourceEstimate objects
418
"""
419
420
def make_dics(info: Info, forward: Forward, csd: CrossSpectralDensity, reg: float = 0.05,
421
label: Optional[Label] = None, pick_ori: Optional[str] = None,
422
rank: Optional[Union[str, int, Dict]] = None, weight_norm: Optional[str] = 'unit-noise-gain',
423
reduce_rank: bool = False, depth: Optional[float] = None,
424
real_filter: bool = True, inversion: str = 'matrix',
425
verbose: Optional[Union[bool, str, int]] = None) -> Dict:
426
"""
427
Compute DICS (Dynamic Imaging of Coherent Sources) beamformer weights.
428
429
Parameters:
430
- info: Measurement info
431
- forward: Forward solution
432
- csd: Cross-spectral density matrix
433
- reg: Regularization parameter
434
- label: Restrict to label
435
- pick_ori: Orientation constraint
436
- rank: Data rank specification
437
- weight_norm: Weight normalization
438
- reduce_rank: Reduce rank of CSD matrix
439
- depth: Depth weighting
440
- real_filter: Use real-valued filters
441
- inversion: Matrix inversion method
442
- verbose: Verbosity level
443
444
Returns:
445
Dictionary with DICS beamformer weights and filters
446
"""
447
448
def apply_dics_csd(csd: CrossSpectralDensity, filters: Dict, verbose: Optional[Union[bool, str, int]] = None) -> SourceEstimate:
449
"""
450
Apply DICS beamformer to cross-spectral density.
451
452
Parameters:
453
- csd: Cross-spectral density matrix
454
- filters: DICS filters from make_dics
455
- verbose: Verbosity level
456
457
Returns:
458
SourceEstimate with beamformed CSD
459
"""
460
```
461
462
### Dipole Fitting
463
464
Fit equivalent current dipoles to explain sensor measurements.
465
466
```python { .api }
467
def fit_dipole(evoked: Evoked, cov: Covariance, bem: Union[str, Dict], trans: Union[str, Transform],
468
min_dist: float = 5.0, n_jobs: int = 1, pos: Optional[ArrayLike] = None,
469
ori: Optional[ArrayLike] = None, rank: Optional[Union[str, int, Dict]] = None,
470
verbose: Optional[Union[bool, str, int]] = None) -> Tuple[Dipole, ArrayLike]:
471
"""
472
Fit dipoles to evoked data.
473
474
Parameters:
475
- evoked: Evoked data to fit
476
- cov: Noise covariance matrix
477
- bem: BEM model or path to BEM file
478
- trans: Head<->MRI transformation
479
- min_dist: Minimum distance from inner skull
480
- n_jobs: Number of parallel jobs
481
- pos: Initial dipole positions
482
- ori: Initial dipole orientations
483
- rank: Data rank specification
484
- verbose: Verbosity level
485
486
Returns:
487
Tuple of (Dipole object, residual variance)
488
"""
489
490
def read_dipole(fname: str, verbose: Optional[Union[bool, str, int]] = None) -> Dipole:
491
"""
492
Read dipole from file.
493
494
Parameters:
495
- fname: Path to dipole file
496
- verbose: Verbosity level
497
498
Returns:
499
Dipole object
500
"""
501
```
502
503
### Source Estimate Manipulation
504
505
Work with source estimates including morphing between subjects and extracting label time courses.
506
507
```python { .api }
508
def compute_source_morph(src_from: Union[SourceSpaces, SourceEstimate], subject_to: str,
509
spacing: Optional[Union[int, List]] = None, smooth: Optional[int] = None,
510
warn: bool = True, xhemi: bool = False, subjects_dir: Optional[str] = None,
511
verbose: Optional[Union[bool, str, int]] = None) -> SourceMorph:
512
"""
513
Compute morphing between source spaces or subjects.
514
515
Parameters:
516
- src_from: Source space or source estimate to morph from
517
- subject_to: Target subject
518
- spacing: Target spacing
519
- smooth: Smoothing steps
520
- warn: Warn about topology changes
521
- xhemi: Include cross-hemisphere morphing
522
- subjects_dir: FreeSurfer subjects directory
523
- verbose: Verbosity level
524
525
Returns:
526
SourceMorph object
527
"""
528
529
def extract_label_time_course(stcs: Union[SourceEstimate, List[SourceEstimate]], labels: List[Label],
530
src: SourceSpaces, mode: str = 'mean', allow_empty: bool = False,
531
return_generator: bool = False, verbose: Optional[Union[bool, str, int]] = None) -> ArrayLike:
532
"""
533
Extract time course from labels.
534
535
Parameters:
536
- stcs: Source estimate(s)
537
- labels: Labels to extract from
538
- src: Source space
539
- mode: Extraction mode ('mean', 'max', 'pca_flip')
540
- allow_empty: Allow empty labels
541
- return_generator: Return generator
542
- verbose: Verbosity level
543
544
Returns:
545
Label time courses array
546
"""
547
548
def stc_to_label(stc: SourceEstimate, src: SourceSpaces, smooth: bool = True,
549
subjects_dir: Optional[str] = None, connected: bool = False,
550
verbose: Optional[Union[bool, str, int]] = None) -> List[Label]:
551
"""
552
Convert source estimate to labels.
553
554
Parameters:
555
- stc: Source estimate
556
- src: Source space
557
- smooth: Smooth label boundaries
558
- subjects_dir: FreeSurfer subjects directory
559
- connected: Require connected labels
560
- verbose: Verbosity level
561
562
Returns:
563
List of Label objects
564
"""
565
```
566
567
## Usage Examples
568
569
### Forward Solution and Inverse Operator
570
571
```python
572
import mne
573
574
# Load data and create forward solution
575
info = mne.io.read_info('sample_audvis-ave.fif')
576
trans = 'sample-trans.fif'
577
src = mne.read_source_spaces('sample-oct6-src.fif')
578
bem = mne.read_bem_solution('sample-5120-bem-sol.fif')
579
580
# Create forward solution
581
fwd = mne.make_forward_solution(info, trans, src, bem,
582
meg=True, eeg=True, mindist=5.0)
583
584
# Load noise covariance
585
noise_cov = mne.read_cov('sample-cov.fif')
586
587
# Create inverse operator
588
inverse_operator = mne.minimum_norm.make_inverse_operator(
589
info, fwd, noise_cov, loose=0.2, depth=0.8)
590
591
# Apply to evoked data
592
evoked = mne.read_evokeds('sample_audvis-ave.fif', condition='Left Auditory')
593
stc = mne.minimum_norm.apply_inverse(evoked, inverse_operator,
594
lambda2=1.0/9.0, method='dSPM')
595
596
# Visualize source estimate
597
stc.plot(subject='sample', subjects_dir=subjects_dir)
598
```
599
600
### LCMV Beamforming
601
602
```python
603
import mne
604
605
# Load epochs and compute covariance
606
epochs = mne.read_epochs('sample-epo.fiv')
607
data_cov = mne.compute_covariance(epochs, tmin=0.04, tmax=0.15)
608
noise_cov = mne.compute_covariance(epochs, tmin=-0.2, tmax=0.0)
609
610
# Load forward solution
611
fwd = mne.read_forward_solution('sample-fwd.fif')
612
613
# Make LCMV beamformer
614
filters = mne.beamformer.make_lcmv(epochs.info, fwd, data_cov,
615
reg=0.05, noise_cov=noise_cov)
616
617
# Apply to evoked data
618
evoked = epochs.average()
619
stc = mne.beamformer.apply_lcmv(evoked, filters)
620
621
# Plot result
622
stc.plot(subject='sample', subjects_dir=subjects_dir)
623
```
624
625
### DICS Beamforming for Connectivity
626
627
```python
628
import mne
629
from mne.time_frequency import csd_morlet
630
631
# Load epochs
632
epochs = mne.read_epochs('sample-epo.fiv')
633
634
# Compute cross-spectral density in alpha band
635
csd = csd_morlet(epochs, frequencies=[10], n_cycles=7)
636
637
# Load forward solution
638
fwd = mne.read_forward_solution('sample-fwd.fif')
639
640
# Make DICS beamformer
641
filters = mne.beamformer.make_dics(epochs.info, fwd, csd, reg=0.05)
642
643
# Apply to CSD
644
stc = mne.beamformer.apply_dics_csd(csd, filters)
645
646
# Plot alpha power
647
stc.plot(subject='sample', subjects_dir=subjects_dir)
648
```
649
650
### Dipole Fitting
651
652
```python
653
import mne
654
655
# Load evoked data and noise covariance
656
evoked = mne.read_evokeds('sample_audvis-ave.fif', condition='Right Auditory')
657
cov = mne.read_cov('sample-cov.fiv')
658
659
# Load BEM model and transformation
660
bem = mne.read_bem_solution('sample-5120-bem-sol.fiv')
661
trans = 'sample-trans.fif'
662
663
# Fit dipole
664
dipole, residual = mne.fit_dipole(evoked, cov, bem, trans, min_dist=5.0)
665
666
# Plot dipole locations
667
dipole.plot_locations(trans, 'sample', subjects_dir, mode='orthoview')
668
```
669
670
## Types
671
672
```python { .api }
673
class Forward:
674
"""Forward solution container."""
675
sol: Dict # Solution dictionary
676
source_ori: int # Source orientation info
677
src: SourceSpaces # Source space
678
info: Info # Measurement info
679
680
def copy(self) -> 'Forward': ...
681
682
class SourceSpaces:
683
"""Source space container."""
684
def __init__(self, spaces: List[Dict], info: Optional[Dict] = None): ...
685
def plot(self, **kwargs) -> Figure: ...
686
def save(self, fname: str) -> None: ...
687
688
class InverseOperator:
689
"""Inverse operator container."""
690
def __init__(self): ...
691
692
class SourceEstimate:
693
"""Surface source estimate."""
694
data: ArrayLike # Source data (n_sources, n_times)
695
vertices: List[ArrayLike] # Source vertices for each hemisphere
696
tmin: float # Start time
697
tstep: float # Time step
698
subject: Optional[str] # Subject name
699
700
def plot(self, subject: Optional[str] = None, **kwargs) -> Brain: ...
701
def get_peak(self, **kwargs) -> Tuple: ...
702
def save(self, fname: str) -> None: ...
703
704
class SourceMorph:
705
"""Source morphing container."""
706
def apply(self, stc: SourceEstimate) -> SourceEstimate: ...
707
def save(self, fname: str) -> None: ...
708
709
class Dipole:
710
"""Dipole container."""
711
pos: ArrayLike # Dipole positions
712
ori: ArrayLike # Dipole orientations
713
gof: ArrayLike # Goodness of fit
714
amplitude: ArrayLike # Dipole amplitudes
715
times: ArrayLike # Time points
716
717
def plot_locations(self, trans: Transform, subject: str, **kwargs) -> Figure: ...
718
719
class Label:
720
"""Brain surface label."""
721
vertices: ArrayLike # Label vertices
722
pos: ArrayLike # Vertex positions
723
values: ArrayLike # Vertex values
724
hemi: str # Hemisphere ('lh' or 'rh')
725
name: str # Label name
726
subject: str # Subject name
727
728
def center_of_mass(self, subject: str, **kwargs) -> ArrayLike: ...
729
```