pycartool.spi.SourceSpace#

class pycartool.spi.SourceSpace(names, coordinates, subject=None, filename=None)[source]#

Container for source space data.

Parameters:
nameslist of str

The solutions point names. Length (n_sources).

coordinatesndarray

The solutions point names coordinates. Shape(n_sources, 3).

subjectstr

Subject from who the source space was created.

filenamestr or file-like

If loaded from a file, the corresponding filename.

Attributes:
n_sourcesint

Number of sources.

nameslist of str

The solutions point names. Length n_sources.

coordinatesarray
The solutions point names coordinates.

Shape(n_sources, 3)

subjectstr

Subject from who the source space was created.

filenamestr or file-like

If loaded from a file, the corresponding filename.

Methods

get_center_of_mass([method])

Compute the center of mass of the Source Space.

get_coordinates()

Return a copy of sources coordinates.

get_names()

Return a copy of sources names.

save(filename)

Write SourceSpace to .spi file.

get_center_of_mass(method='mean')[source]#

Compute the center of mass of the Source Space.

Parameters:
methodstr

The method to use. Can be ‘mean’, or ‘median’.

Returns:
center_of_massarray

The x,y,z coordinates of the center of mass.

get_coordinates()[source]#

Return a copy of sources coordinates.

Returns:
coordinatesarray

The solutions point names coordinates. shape(n_sources, 3).

get_names()[source]#

Return a copy of sources names.

Returns:
nameslist of str

The solutions point names. Length n_sources.

save(filename)[source]#

Write SourceSpace to .spi file.

Parameters:
filenamestr or file-like

The .spi file to write.