pycartool.io package¶
Submodules¶
pycartool.io.montage module¶
pycartool.io.sef module¶
pycartool.io.roi module¶
-
pycartool.io.roi.
read_roi
(filename)[source]¶ Read Cartool region of interest (.rois) files.
- Parameters
filename (str) – The roi file to read
- Returns
Rois –
- The Rois info info. Keys are:
- nameslist of str
the rois names.
- elements :list of int
the indices of elements belonging to each rois (indice start to 1).
- Return type
dict of str
Warning
Indexes start from 1, not 0 as Cartools does. When using with combination of source space, you way need to tranform to 0 base indices.
pycartool.io.source_space module¶
-
pycartool.io.source_space.
read_spi
(filename)[source]¶ Read Cartool spi file.
- Parameters
filename (str) – The spi file to read.
- Returns
coord (ndarray, shape (n_sources, 3)) – the source coordinates.
names (list, shape (n_sources))
-
pycartool.io.source_space.
write_spi
(filename, solution_points)[source]¶ Write Cartool spi file.
- Parameters
filename (str) – The spi file to write.
solution_points (dict of str) –
- The solution points info. Keys are:
- nameslist of str
the solutions point names.
- coordinatesnp.array, shape (n_solutions_points, 3)
the x,y,z coordinates of each solution point.
pycartool.io.inverse_solution module¶
-
pycartool.io.inverse_solution.
read_is
(filename)[source]¶ Read Cartool inverse solution (.is) file.
- Parameters
filename (str) – the is file to read.
- Returns
the inverse solution matrices. n_dim=1 if solutions are scalar or n_dim=3 for vectorial solutions.
- Return type
ndarray, shape (n_regularizations, n_dim, n_solutionpoints, n_channels)
-
pycartool.io.inverse_solution.
read_ris
(filename)[source]¶ Read Cartool Results of Inverse Solution computation (.ris) file.
- Parameters
filename (str) – the ris file to read.
- Returns
results_of_is –
- Keys are:
- ris_typestr
magic should always be ‘RI01’.
- is_scalarbool
True if solution is scalar, else False (vectorial).
- sfreqfloat
sampling frequency (in Hz).
- datanp.ndarray, shape(n_timeframes, n_dim, n_solutionpoints)
time course of each solution point.
- Return type
dict of str
-
pycartool.io.inverse_solution.
write_ris
(path, data, sfreq)[source]¶ Short summary.
- Parameters
path (str) – Path of the exported inverse solution computation.
data (np.ndarray, shape(n_timeframes, n_dim, n_solutionpoints)) – time course of each solution point.
sfreq (float) – sampling frequency (in Hz).