pycartool.ris.SourceEstimate#

class pycartool.ris.SourceEstimate(sources_tc, sfreq, source_space=None, subject=None, filename=None)[source]#

Container for source estimate data.

Parameters:
sources_tcarray

The sources time courses. Can be either scalar (ndim=1) or vectorial (ndim=3). shape (n_solution_points, n_dim, n_timeframes).

sfreqfloat

The sampling frequency.

source_spacepycartool.spi.SourceSpace

The SourceSpace corresponding to the source estimate.

subjectstr

The subject used to create the source estimate.

filenamestr

Filename from which the source estimate was imported.

Attributes:
is_scalarbool

True if estimate is scalar, False is estimate is vectorial.

n_sourcesint

Number of sources.

sources_tcarray

The sources time courses. Can be either scalar (ndim=1) or vectorial (ndim=3). shape (n_solution_points, n_dim, n_timeframes).

source_spacepycartool.spi.SourceSpace

The SourceSpace corresponding to the source estimate.

subjectstr

The subject used to create the source estimate.

filenamestr

Filename from which the source estimate was imported.

Methods

compute_rois_tc(region_of_interest[, method])

Compute time course in Region of interest.

compute_tc([method])

Compute time course.

per_roi(region_of_interest)

Get source in specific rois.

save(filename[, export_spi])

Write SourceEstimate to Cartool ris file.

compute_rois_tc(region_of_interest, method='svd')[source]#

Compute time course in Region of interest.

Parameters:
region_of_interestpycartool.rois.RegionsOfInterest

The region of interest used to split the source estimate.

methodstr

The method use to compute the time course. Can be either ‘mean’, ‘median’ or ‘svd’. Default to ‘svd’.

Returns:
Roi_source_estimatepycartool.ris.SourceEstimate

A source estimate instance where each source correspond to a region of interest.

compute_tc(method='svd')[source]#

Compute time course.

Parameters:
methodstr

The method use to compute the time course. Can be either ‘mean’, ‘median’ or ‘svd’. Default to ‘svd’.

Returns:
tcarray

The global source estimate time course. Can be either Vectorial or Scalar depending of the source estimate and the method. shape(n_dim, n_times).

per_roi(region_of_interest)[source]#

Get source in specific rois.

Parameters:
region_of_interestpycartool.rois.RegionsOfInterest

The region of interest used to split the source estimate.

Returns:
rois_source_estimatelist of pycartool.ris.SourceEstimate

A list of Source estimate instance restricted to a Region of interest.

save(filename, export_spi=False)[source]#

Write SourceEstimate to Cartool ris file.

Parameters:
filenamestr or file-like

The ris file to write.

export_spibool

If True, also export the corresponding source space as ris file.