mne.
SourceEstimate
(data, vertices=None, tmin=None, tstep=None, subject=None, verbose=None)[source]¶Container for surface source estimates.
Parameters: |
|
---|
See also
VectorSourceEstimate
VolSourceEstimate
MixedSourceEstimate
Attributes: |
|
---|
Methods
__add__ (a) |
Add source estimates. |
__div__ (a) |
Divide source estimates. |
__hash__ ($self, /) |
Return hash(self). |
__mul__ (a) |
Multiply source estimates. |
__neg__ () |
Negate the source estimate. |
__sub__ (a) |
Subtract source estimates. |
bin (width[, tstart, tstop, func]) |
Return a source estimate object with data summarized over time bins. |
center_of_mass ([subject, hemi, …]) |
Compute the center of mass of activity. |
copy () |
Return copy of source estimate instance. |
crop ([tmin, tmax]) |
Restrict SourceEstimate to a time interval. |
expand (vertices) |
Expand SourceEstimate to include more vertices. |
extract_label_time_course (labels, src[, …]) |
Extract label time courses for lists of labels. |
get_peak ([hemi, tmin, tmax, mode, …]) |
Get location and latency of peak amplitude. |
in_label (label) |
Get a source estimate object restricted to a label. |
mean () |
Make a summary stc file with mean over time points. |
morph (subject_to[, grade, smooth, …]) |
Warning DEPRECATED: This function is deprecated and will be removed in version 0.18. Use morph = mne.compute_source_morph(…) and morph(stc) |
morph_precomputed (**kwargs) |
Warning DEPRECATED: This function is deprecated and will be removed in version 0.18. Use morph = mne.compute_source_morph(…) and morph(stc) |
plot ([subject, surface, hemi, colormap, …]) |
Plot SourceEstimates with PySurfer. |
resample (sfreq[, npad, window, n_jobs, verbose]) |
Resample data. |
save (fname[, ftype, verbose]) |
Save the source estimates to a file. |
sqrt () |
Take the square root. |
sum () |
Make a summary stc file with sum over time points. |
time_as_index (times[, use_rounding]) |
Convert time to indices. |
to_data_frame ([picks, index, scaling_time, …]) |
Export data in tabular structure as a pandas DataFrame. |
to_original_src (src_orig[, subject_orig, …]) |
Get a source estimate from morphed source to the original subject. |
transform (func[, idx, tmin, tmax, copy]) |
Apply linear transform. |
transform_data (func[, idx, tmin_idx, tmax_idx]) |
Get data after a linear (time) transform has been applied. |
__hash__
($self, /)¶Return hash(self).
bin
(width, tstart=None, tstop=None, func=<function mean>)[source]¶Return a source estimate object with data summarized over time bins.
Time bins of width
seconds. This method is intended for
visualization only. No filter is applied to the data before binning,
making the method inappropriate as a tool for downsampling data.
Parameters: |
|
---|---|
Returns: |
|
center_of_mass
(subject=None, hemi=None, restrict_vertices=False, subjects_dir=None, surf='sphere')[source]¶Compute the center of mass of activity.
This function computes the spatial center of mass on the surface as well as the temporal center of mass as in [1].
Note
All activity must occur in a single hemisphere, otherwise
an error is raised. The “mass” of each point in space for
computing the spatial center of mass is computed by summing
across time, and vice-versa for each point in time in
computing the temporal center of mass. This is useful for
quantifying spatio-temporal cluster locations, especially
when combined with mne.vertex_to_mni()
.
Parameters: |
|
---|---|
Returns: |
|
See also
References
[1] | (1, 2) Larson and Lee, “The cortical dynamics underlying effective switching of auditory spatial attention”, NeuroImage 2012. |
crop
(tmin=None, tmax=None)[source]¶Restrict SourceEstimate to a time interval.
Parameters: |
|
---|
data
¶Numpy array of source estimate data.
expand
(vertices)[source]¶Expand SourceEstimate to include more vertices.
This will add rows to stc.data (zero-filled) and modify stc.vertices to include all vertices in stc.vertices and the input vertices.
Parameters: |
|
---|---|
Returns: |
|
extract_label_time_course
(labels, src, mode='mean_flip', allow_empty=False, verbose=None)[source]¶Extract label time courses for lists of labels.
This function will extract one time course for each label. The way the time courses are extracted depends on the mode parameter.
Parameters: |
|
---|---|
Returns: |
|
See also
extract_label_time_course
Notes
Valid values for mode are:
get_peak
(hemi=None, tmin=None, tmax=None, mode='abs', vert_as_index=False, time_as_index=False)[source]¶Get location and latency of peak amplitude.
Parameters: |
|
---|---|
Returns: |
|
in_label
(label)[source]¶Get a source estimate object restricted to a label.
SourceEstimate contains the time course of activation of all sources inside the label.
Parameters: |
|
---|---|
Returns: |
|
lh_data
¶Left hemisphere data.
lh_vertno
¶Left hemisphere vertno.
mean
()[source]¶Make a summary stc file with mean over time points.
Returns: |
|
---|
morph
(subject_to, grade=5, smooth=None, subjects_dir=None, buffer_size=64, n_jobs=1, subject_from=None, sparse=False, verbose=None)[source]¶Warning
DEPRECATED: This function is deprecated and will be removed in version 0.18. Use morph = mne.compute_source_morph(…) and morph(stc)
Morph a source estimate from one subject to another.
Parameters: |
|
---|---|
Returns: |
|
morph_precomputed
(**kwargs)[source]¶Warning
DEPRECATED: This function is deprecated and will be removed in version 0.18. Use morph = mne.compute_source_morph(…) and morph(stc)
Morph source estimate between subjects using a precomputed matrix.
Parameters: |
|
---|---|
Returns: |
|
plot
(subject=None, surface='inflated', hemi='lh', colormap='auto', time_label='auto', smoothing_steps=10, transparent=True, alpha=1.0, time_viewer=False, subjects_dir=None, figure=None, views='lat', colorbar=True, clim='auto', cortex='classic', size=800, background='black', foreground='white', initial_time=None, time_unit='s', backend='auto', spacing='oct6', title=None, verbose=None)[source]¶Plot SourceEstimates with PySurfer.
By default this function uses mayavi.mlab
to plot the source
estimates. If Mayavi is not installed, the plotting is done with
matplotlib.pyplot
(much slower, decimated source space by default).
Parameters: |
|
---|---|
Returns: |
|
resample
(sfreq, npad='auto', window='boxcar', n_jobs=1, verbose=None)[source]¶Resample data.
Parameters: |
|
---|
Notes
For some data, it may be more accurate to use npad=0 to reduce artifacts. This is dataset dependent – check your data!
Note that the sample rate of the original data is inferred from tstep.
rh_data
¶Right hemisphere data.
rh_vertno
¶Right hemisphere vertno.
save
(fname, ftype='stc', verbose=None)[source]¶Save the source estimates to a file.
Parameters: |
|
---|
sfreq
¶Sample rate of the data.
shape
¶Shape of the data.
sqrt
()[source]¶Take the square root.
Returns: |
|
---|
sum
()[source]¶Make a summary stc file with sum over time points.
Returns: |
|
---|
time_as_index
(times, use_rounding=False)[source]¶Convert time to indices.
Parameters: |
|
---|---|
Returns: |
|
times
¶A timestamp for each sample.
tmin
¶The first timestamp.
to_data_frame
(picks=None, index=None, scaling_time=1000.0, scalings=None, copy=True, start=None, stop=None)[source]¶Export data in tabular structure as a pandas DataFrame.
Columns and indices will depend on the object being converted. Generally this will include as much relevant information as possible for the data type being converted. This makes it easy to convert data for use in packages that utilize dataframes, such as statsmodels or seaborn.
Parameters: |
|
---|---|
Returns: |
|
to_original_src
(src_orig, subject_orig=None, subjects_dir=None, verbose=None)[source]¶Get a source estimate from morphed source to the original subject.
Parameters: |
|
---|---|
Returns: |
|
See also
Notes
New in version 0.10.0.
transform
(func, idx=None, tmin=None, tmax=None, copy=False)[source]¶Apply linear transform.
The transform is applied to each source time course independently.
Parameters: |
|
---|---|
Returns: |
|
Notes
Applying transforms can be significantly faster if the SourceEstimate object was created using “(kernel, sens_data)”, for the “data” parameter as the transform is applied in sensor space. Inverse methods, e.g., “apply_inverse_epochs”, or “apply_lcmv_epochs” do this automatically (if possible).
transform_data
(func, idx=None, tmin_idx=None, tmax_idx=None)[source]¶Get data after a linear (time) transform has been applied.
The transform is applied to each source time course independently.
Parameters: |
|
---|---|
Returns: |
|
Notes
Applying transforms can be significantly faster if the SourceEstimate object was created using “(kernel, sens_data)”, for the “data” parameter as the transform is applied in sensor space. Inverse methods, e.g., “apply_inverse_epochs”, or “apply_lcmv_epochs” do this automatically (if possible).
tstep
¶The change in time between two consecutive samples (1 / sfreq).