medusa.plots package

Submodules

medusa.plots.brain_plots module

medusa.plots.erp_plots module

medusa.plots.erp_plots.compute_dev_epochs(epochs, measure='C95')[source]
medusa.plots.erp_plots.plot_erp(erp_speller_runs, channel, window=(0, 1000), plot=True)[source]

medusa.plots.mi_plots module

Created on Fri Dec 20 15:34:18 2019 Edited on Mon Jun 13 10:00:00 2022

@author: VICTOR @editor: Sergio Pérez-Velasco

medusa.plots.mi_plots.plot_erd_ers_freq(files, ch_to_plot, order=5, cutoff=[5, 35], btype='bandpass', temp_filt_method='sosfiltfilt', w_epoch_t=(- 1000, 6000), target_fs=128, baseline_mode='trial', w_baseline_t=(- 1000, 0), norm='z', mov_mean_hz=0, welch_seg_len_pct=50, welch_overlap_pct=75, show=True)[source]

This function depicts the ERD/ERS events of MI BCIs over the frequency spectrum. :param files: List of paths pointing to MI files. :type files: list :param ch_to_plot: List with the labels of the channels to plot :type ch_to_plot: list

medusa.plots.mi_plots.plot_erd_ers_time(files, ch_to_plot, order=5, cutoff=[5, 35], btype='bandpass', temp_filt_method='sosfiltfilt', w_epoch_t=(- 1000, 6000), target_fs=128, baseline_mode='trial', w_baseline_t=(- 1000, 0), norm='z', mov_mean_ms=1000, show=True)[source]

Plotting function of ERD/ERS from motor imagery runs of MEDUSA. :param files: List of paths pointing to MI files. :type files: list :param ch_to_plot: List with the labels of the channels to plot :type ch_to_plot: list

medusa.plots.mi_plots.plot_r2_topoplot(files, order=5, cutoff=[5, 35], btype='bandpass', temp_filt_method='sosfiltfilt', w_epoch_t=(- 1000, 6000), target_fs=128, baseline_mode='trial', w_baseline_t=(- 1000, 0), norm='z', welch_seg_len_pct=50, welch_overlap_pct=75, show=True)[source]

medusa.plots.optimal_subplots module

medusa.plots.optimal_subplots.factor(n)[source]

Computes an irreducible factorization of a number.

nint

Number to factorize

Returns

List of factors

Return type

list

medusa.plots.optimal_subplots.optimal_subplot_row_col(n_items)[source]

Computes the optimal arrangement of items in rows and columns.

n_itemsint

Number of items.

Returns

Optimal number of rows and columns, respectively

Return type

int, int

medusa.plots.topographic_plots module

medusa.plots.topographic_plots.compute_nearest_values(coor_add, coor_neigh, val_neigh, k)[source]

This function computes the mean values of the k-nearest neighbors.

Parameters
  • coor_add (XY coordinates of the virtual electrodes.) –

  • coor_neigh (XY coordinates of the real electrodes.) –

  • val_neigh (Values of the real electrodes.) –

  • k (Number of neighbors to consider.) –

medusa.plots.topographic_plots.ear_rho(ear_theta, ellipse_a, ellipse_b)[source]

This function computes the ear coordinates according to an ellipse.

medusa.plots.topographic_plots.plot_topography(channel_set, values=None, head_radius=0.7266, plot_extra=0.29, k=3, make_contour=True, plot_channels=True, plot_skin_in_color=False, plot_clabels=False, plot_contour_ch=False, chcontour_radius=None, interp_points=500, cmap='YlGnBu_r', show=True, clim=None)[source]

The function ‘plot_topography’ depicts a topographical map of the scalp over the desired channel locations.

Parameters
  • channel_set (eeg_standards.EEGChannelSet) – EEG channel set according of class eeg_standards.EEGChannelSet

  • values (list or numpy.ndarray or None) – Numpy array with the channel values. It must be of the same size as channels. If None value, the function only returns a plot of the head and the channels

  • head_radius (float) – Head radius. Default is 0.7266, coinciding with FPz. The nasion and inion are located at r=1.0

  • plot_extra (float) – Extra radius of the plot surface

  • k (int) – Number of nearest neighbors for interpolation

  • make_contour (bool (Optional)) – Boolean that controls if the contour lines should be plotted (default: True)

  • plot_channels (bool (Optional)) – Boolean that controls if the channel points should be plotted (default: True)

  • plot_skin_in_color (bool (Optional)) – Boolean that controls if the skin of the head should be coloured (default: False)

  • plot_clabels (bool (Optional)) – Boolean that controls if the channel labels should be plotted (default: False)

  • plot_contour_ch (bool (Optional)) – Boolean that controls if a contour around each channel should be plotted (default: False)

  • chcontour_radius (float or None) – Radius of the channel contour if plot_contour_ch is set True. If None value, an automatic value is computed, considering the minimum distance between channels (default: None)

  • interp_points (int (Optional)) – No. interpolation points. The lower N, the lower resolution and faster computation (default: 500)

  • cmap (str) – Matplotlib colormap

  • show (bool) – Show matplotlib figure

  • clim (list or None) – Color bar limits. Index 0 contain the lower limit, whereas index 1 must contain the upper limit. if none, min and max values are used

Returns

figure – Figure with the topography plot

Return type

plt.figure

medusa.plots.topographic_plots.pol2cart(rho, phi)[source]

This function converts polar coordinates to cartesian coordinates.

Parameters
  • rho (Array of radii) –

  • phi (Array of angles) –