mne_nirs.statistics.ContrastResults#

class mne_nirs.statistics.ContrastResults(info, data, design)[source]#

Class containing GLM contrast results.

Parameters:
infomne.Info

Info.

datadict

Dictionary.

designdataframe

Design matrix.

Returns:
glm_estResultsGLM,

Result class.

Attributes:
ch_names

Return the channel names.

compensation_grade

The current gradient compensation grade.

data

Methods

copy()

Return a copy of the GLM results.

get_channel_types([picks, unique, only_data_chs])

Get a list of channel type for each channel.

plot_topo([figsize, sphere])

Plot topomap GLM contrast data.

save(fname[, overwrite])

Save GLM results to disk.

scatter([conditions, exclude_no_interest, ...])

Scatter plot of the GLM results.

to_dataframe([order])

Return a tidy dataframe representing the GLM results.

__contains__(ch_type)#

Check channel type membership.

Parameters:
ch_typestr

Channel type to check for. Can be e.g. 'meg', 'eeg', 'stim', etc.

Returns:
inbool

Whether or not the instance contains the given channel type.

Examples

Channel type membership can be tested as:

>>> 'meg' in inst  
True
>>> 'seeg' in inst  
False
__hash__ = None#
property ch_names#

Return the channel names.

Returns:
namesarray

The channel names.

property compensation_grade#

The current gradient compensation grade.

copy()#

Return a copy of the GLM results.

Returns:
instinstance of ResultsGLM

A copy of the object.

get_channel_types(picks=None, unique=False, only_data_chs=False)#

Get a list of channel type for each channel.

Parameters:
picksstr | array-like | slice | None

Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g., ['meg', 'eeg']) will pick channels of those types, channel name strings (e.g., ['MEG0111', 'MEG2623'] will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick all channels. Note that channels in info['bads'] will be included if their names or indices are explicitly provided.

uniquebool

Whether to return only unique channel types. Default is False.

only_data_chsbool

Whether to ignore non-data channels. Default is False.

Returns:
channel_typeslist

The channel types.

plot_topo(figsize=(12, 7), sphere=None)[source]#

Plot topomap GLM contrast data.

Parameters:
figsizenumbers

TODO: Remove this, how does MNE usually deal with this.

spherenumbers

As specified in MNE.

Returns:
figfigure

Figure of each design matrix component for hbo (top row) and hbr (bottom row).

save(fname, overwrite=False)#

Save GLM results to disk.

Parameters:
fnamestr

The filename to use to write the HDF5 data. Should end in 'glm.h5'.

overwritebool

If True (default False), overwrite the destination file if it exists.

scatter(conditions=[], exclude_no_interest=True, axes=None, no_interest=None)#

Scatter plot of the GLM results.

Parameters:
conditionslist

List of condition names to plot. By default plots all regressors of interest.

exclude_no_interestbool

Exclude regressors of no interest from the figure.

axesAxes

Optional axes on which to plot the data.

no_interestlist

List of regressors that are of no interest. If none are specified then conditions starting with [“drift”, “constant”, “short”, “Short”] will be excluded.

Returns:
pltmatplotlib.Figure

Scatter plot.

to_dataframe(order=None)#

Return a tidy dataframe representing the GLM results.

Parameters:
orderlist

Order in which the rows should be returned by channel name.

Returns:
tidypandas.DataFrame

Dataframe containing GLM results.

Examples using mne_nirs.statistics.ContrastResults#

GLM Analysis (Measured)

GLM Analysis (Measured)