frites.conn.conn_get_pairs#

frites.conn.conn_get_pairs(roi, directed=False, nb_min_suj=- inf, verbose=None)[source]#

Get possible connectivity pairs for multiple subjects.

This function returns a DataFrame that contains all of the necessary informations for managing pairs of brain regions across many subjects.

Parameters
roipython:list

List where each item in this list is an array descriving the brain region names of a single subject.

directedbool | python:False

Specify whether the the returned pairs should be for directed (True) or undirected (default : False) connectivity.

nb_min_sujpython:int | -np.inf

Specify whether the pairs should be represented by a minimum number of subjects.

Returns
df_connpd.DataFrame

A Pandas DataFrame that describes the connectivity informations at the group level. The table contains the following entries :

  • ‘sources’ / ‘targets’ : respectively, the source and target names

  • ‘subjects’ : list of subjects per pair of brain regions

  • ‘#subjects’ : number of subjects per pair of brain regions

  • ‘names’ : name of each pair. If undirected, the names are going to be like ‘roi_0-roi_1’ or ‘roi_0->roi_1’ if directed

  • ‘keep’ : booleans indicating whether the number of subjects per pair of brain regions is over nb_min_suj

df_sujpd.DataFrame

A Pandas DataFrame that describes the connectivity information per subject. The table contains the following entries :

  • ‘subjects’ : subject number

  • ‘keep_roi’ / ‘drop_roi’ : the brain regions respectively to keep and to remove to fit the input parameters nb_min_suj

  • ‘keep_suj’ : boolean describing if the subject should be dropped or conserved

  • ‘conn’ : the 2D boolean connectivity array per subject