mne.
MixedSourceEstimate
(data, vertices=None, tmin=None, tstep=None, subject=None, verbose=None)¶Container for mixed surface and volume source estimates
Parameters: | data : array of shape (n_dipoles, n_times) | 2-tuple (kernel, sens_data)
vertices : list of arrays
tmin : scalar
tstep : scalar
subject : str | None
verbose : bool, str, int, or None
|
---|---|
Attributes: | subject : str | None
times : array of shape (n_times,)
vertices : list of arrays of shape (n_dipoles,)
data : array of shape (n_dipoles, n_times)
shape : tuple
|
Notes
New in version 0.9.0.
Methods
bin (width[, tstart, tstop, func]) |
Returns a SourceEstimate object with data summarized over time bins |
copy () |
Return copy of SourceEstimate instance |
crop ([tmin, tmax]) |
Restrict SourceEstimate to a time interval |
mean () |
Make a summary stc file with mean power between tmin and tmax. |
plot_surface (src[, subject, surface, hemi, ...]) |
Plot surface source estimates with PySurfer |
resample (sfreq[, npad, window, n_jobs, verbose]) |
Resample data |
sqrt () |
Take the square root |
to_data_frame ([picks, index, scale_time, ...]) |
Export data in tabular structure as a pandas DataFrame. |
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 |
__init__
(data, vertices=None, tmin=None, tstep=None, subject=None, verbose=None)¶bin
(width, tstart=None, tstop=None, func=<function mean>)¶Returns a SourceEstimate 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: | width : scalar
tstart : scalar | None
tstop : scalar | None
func : callable
|
---|---|
Returns: | stc : instance of SourceEstimate
|
copy
()¶Return copy of SourceEstimate instance
crop
(tmin=None, tmax=None)¶Restrict SourceEstimate to a time interval
Parameters: | tmin : float | None
tmax : float | None
|
---|
data
¶Numpy array of source estimate data
mean
()¶Make a summary stc file with mean power between tmin and tmax.
Returns: | stc : instance of SourceEstimate
|
---|
plot_surface
(src, subject=None, surface='inflated', hemi='lh', colormap='auto', time_label='time=%02.f ms', smoothing_steps=10, transparent=None, alpha=1.0, time_viewer=False, config_opts={}, subjects_dir=None, figure=None, views='lat', colorbar=True, clim='auto')¶Plot surface source estimates with PySurfer
Note: PySurfer currently needs the SUBJECTS_DIR environment variable, which will automatically be set by this function. Plotting multiple SourceEstimates with different values for subjects_dir will cause PySurfer to use the wrong FreeSurfer surfaces when using methods of the returned Brain object. It is therefore recommended to set the SUBJECTS_DIR environment variable or always use the same value for subjects_dir (within the same Python session).
Parameters: | src : SourceSpaces
subject : str | None
surface : str
hemi : str, ‘lh’ | ‘rh’ | ‘split’ | ‘both’
colormap : str | np.ndarray of float, shape(n_colors, 3 | 4)
time_label : str
smoothing_steps : int
transparent : bool | None
alpha : float
time_viewer : bool
config_opts : dict
subjects_dir : str
figure : instance of mayavi.core.scene.Scene | None
views : str | list
colorbar : bool
clim : str | dict
|
---|---|
Returns: | brain : Brain
|
resample
(sfreq, npad=100, window='boxcar', n_jobs=1, verbose=None)¶Resample data
Parameters: | sfreq : float
npad : int
window : string or tuple
n_jobs : int
verbose : bool, str, int, or None
|
---|
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.
shape
¶Shape of the data
sqrt
()¶Take the square root
Returns: | stc : instance of SourceEstimate
|
---|
to_data_frame
(picks=None, index=None, scale_time=1000.0, scalings=None, copy=True, start=None, stop=None)¶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: | picks : array-like of int | None
index : tuple of str | None
scale_time : float
scalings : dict | None
copy : bool
start : int | None
stop : int | None
|
---|---|
Returns: | df : instance of pandas.core.DataFrame
|
transform
(func, idx=None, tmin=None, tmax=None, copy=False)¶Apply linear transform
The transform is applied to each source time course independently.
Parameters: | func : callable
idx : array | None
tmin : float | int | None
tmax : float | int | None
copy : bool
|
---|---|
Returns: | stcs : instance of SourceEstimate | list
|
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 “lcmv_epochs” do this automatically (if possible).
transform_data
(func, idx=None, tmin_idx=None, tmax_idx=None)¶Get data after a linear (time) transform has been applied
The transorm is applied to each source time course independently.
Parameters: | func : callable
idx : array | None
tmin_idx : int | None
tmax_idx : int | None
|
---|---|
Returns: | data_t : ndarray
|
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 “lcmv_epochs” do this automatically (if possible).