siibra.features.connectivity.regional_connectivity
Module Contents
Classes
Parcellation-averaged connectivity, providing one or more matrices of a |
- class siibra.features.connectivity.regional_connectivity.RegionalConnectivity(cohort: str, modality: str, regions: list, connector: siibra.retrieval.repositories.RepositoryConnector, decode_func: Callable, filename: str, anchor: siibra.features.anchor.AnatomicalAnchor, description: str = '', datasets: list = [], subject: str = 'average', feature: str = None, id: str = None)
-
Parcellation-averaged connectivity, providing one or more matrices of a given modality for a given parcellation.
- property data: pandas.DataFrame
Returns a matrix as a pandas dataframe.
- Returns:
A square matrix with region names as the column and row names.
- Return type:
pd.DataFrame
- property feature
If applicable, returns the type of feature for which the matrix represents.
- property name
Returns a short human-readable name of this feature.
- property subject
Returns the subject identifiers for which the matrix represents.
- __len__()
- __str__()
Return str(self).
- compute_centroids(space)
Computes the list of centroid coordinates corresponding to matrix rows, in the given reference space.
- get_profile(region: str | siibra.core.region.Region, min_connectivity: float = 0, max_rows: int = None, direction: Literal[column, row] = 'column')
Extract a regional profile from the matrix, to obtain a tabular data feature with the connectivity as the single column. Rows are be sorted by descending connection strength.
- Parameters:
min_connectivity (float, default: 0) – Regions with connectivity less than this value are discarded.
max_rows (int, default: None) – Max number of regions with highest connectivity.
direction (str, default: 'column') – Choose the direction of profile extraction particularly for non-symmetric matrices. (‘column’ or ‘row’)
- get_profile_colorscale(region: str | siibra.core.region.Region, min_connectivity: float = 0, max_rows: int = None, direction: Literal[column, row] = 'column', colorgradient: str = 'jet') Iterator[Tuple[siibra.core.region.Region, Tuple[int, int, int]]]
Extract the colorscale corresponding to the regional profile from the matrix sorted by the values. See get_profile for further details.
Note:
Requires plotly.
- param region:
- type region:
str, Region
- param min_connectivity:
Regions with connectivity less than this value are discarded.
- type min_connectivity:
float, default: 0
- param max_rows:
Max number of regions with highest connectivity.
- type max_rows:
int, default: None
- param direction:
Choose the direction of profile extraction particularly for non-symmetric matrices. (‘column’ or ‘row’)
- type direction:
str, default: ‘column’
- param colorgradient:
The gradient used to extract colorscale.
- type colorgradient:
str, default: ‘jet’
- returns:
Color values are in RGB 255.
- rtype:
Iterator[Tuple[_region.Region, Tuple[int, int, int]]]
- plot(regions: str | siibra.core.region.Region | List[str | siibra.core.region.Region] = None, min_connectivity: float = 0, max_rows: int = None, direction: Literal[column, row] = 'column', logscale: bool = False, *args, backend='matplotlib', **kwargs)
- Parameters:
regions (Union[str, _region.Region], None) – If None, returns the full connectivity matrix. If a region is provided, returns the profile for that region. If list of regions is provided, returns the matrix for the selected regions.
min_connectivity (float, default 0) – Only for region profile.
max_rows (int, default None) – Only for region profile.
direction ('column' or 'row', default: 'column') – Only for matrix.
logscale (bool, default: False) –
backend (str, default: "matplotlib" for profiles and "nilearn" for matrices) –