mne.
VolSourceEstimate
(data, vertices=None, tmin=None, tstep=None, subject=None, verbose=None)[source]¶Container for volume source estimates.
Parameters: | data : array of shape (n_dipoles, n_times) | 2-tuple (kernel, sens_data)
vertices : array
tmin : scalar
tstep : scalar
subject : str | None
verbose : bool, str, int, or None
|
---|
Notes
New in version 0.9.0.
Attributes
data |
Numpy array of source estimate data. |
shape |
Shape of the data. |
subject | (str | None) The subject name. |
times | (array of shape (n_times,)) The time vector. |
vertices | (array of shape (n_dipoles,)) The indices of the dipoles in the source space. |
Methods
__add__ (a) |
Add source estimates. |
__div__ (a) |
Divide source estimates. |
__hash__ () <==> hash(x) |
|
__mul__ (a) |
Multiply source estimates. |
__neg__ () |
Negate the source estimate. |
__sub__ (a) |
Subtract source estimates. |
as_volume (src[, dest, mri_resolution]) |
Export volume source estimate as a nifti object. |
bin (width[, tstart, tstop, func]) |
Return a SourceEstimate object with data summarized over time bins. |
copy () |
Return copy of SourceEstimate instance. |
crop ([tmin, tmax]) |
Restrict SourceEstimate to a time interval. |
get_peak ([tmin, tmax, mode, vert_as_index, …]) |
Get location and latency of peak amplitude. |
mean () |
Make a summary stc file with mean power between tmin and tmax. |
resample (sfreq[, npad, window, n_jobs, verbose]) |
Resample data. |
save (fname[, ftype, verbose]) |
Save the source estimates to a file. |
save_as_volume (fname, src[, dest, …]) |
Save a volume source estimate in a NIfTI file. |
sqrt () |
Take the square root. |
time_as_index (times[, use_rounding]) |
Convert time to indices. |
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. |
__hash__
() <==> hash(x)¶as_volume
(src, dest=’mri’, mri_resolution=False)[source]¶Export volume source estimate as a nifti object.
Parameters: | src : list
dest : ‘mri’ | ‘surf’
mri_resolution: bool
|
---|---|
Returns: | img : instance Nifti1Image
|
Notes
New in version 0.9.0.
bin
(width, tstart=None, tstop=None, func=<function mean>)[source]¶Return 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
|
crop
(tmin=None, tmax=None)[source]¶Restrict SourceEstimate to a time interval.
Parameters: | tmin : float | None
tmax : float | None
|
---|
data
¶Numpy array of source estimate data.
get_peak
(tmin=None, tmax=None, mode=’abs’, vert_as_index=False, time_as_index=False)[source]¶Get location and latency of peak amplitude.
Parameters: | tmin : float | None
tmax : float | None
mode : {‘pos’, ‘neg’, ‘abs’}
vert_as_index : bool
time_as_index : bool
|
---|---|
Returns: | pos : int
latency : float
|
mean
()[source]¶Make a summary stc file with mean power between tmin and tmax.
Returns: | stc : instance of SourceEstimate
|
---|
resample
(sfreq, npad=’auto’, window=’boxcar’, n_jobs=1, verbose=None)[source]¶Resample data.
Parameters: | sfreq : float
npad : int | str
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.
save
(fname, ftype=’stc’, verbose=None)[source]¶Save the source estimates to a file.
Parameters: | fname : string
ftype : string
verbose : bool, str, int, or None
|
---|
save_as_volume
(fname, src, dest=’mri’, mri_resolution=False)[source]¶Save a volume source estimate in a NIfTI file.
Parameters: | fname : string
src : list
dest : ‘mri’ | ‘surf’
mri_resolution: bool
|
---|---|
Returns: | img : instance Nifti1Image
|
Notes
New in version 0.9.0.
sfreq
¶Sample rate of the data.
shape
¶Shape of the data.
sqrt
()[source]¶Take the square root.
Returns: | stc : instance of SourceEstimate
|
---|
time_as_index
(times, use_rounding=False)[source]¶Convert time to indices.
Parameters: | times : list-like | float | int
use_rounding : boolean
|
---|---|
Returns: | index : ndarray
|
to_data_frame
(picks=None, index=None, scale_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: | 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)[source]¶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)[source]¶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).