anatomy.regions_transition_matrix
anatomy.regions_transition_matrix(ba=None, mapping=None)Computes transition matrices between brain regions based on vertical adjacency.
This function calculates how brain regions are spatially connected to each other by analyzing transitions between regions along the dorsal-ventral axis. It creates a matrix where each element (i,j) represents the number of voxel transitions from region i to region j when moving along the dorsal-ventral direction.
Args: ba (ClassifierAtlas, optional): Brain atlas object to use for the computation. If None, a new ClassifierAtlas instance will be created. mapping (str, optional): The region mapping to use (e.g., ‘Allen’, ‘Cosmos’, ‘Beryl’). Defaults to ‘Cosmos’ if None.
Returns: tuple: A tuple containing: - state_transitions (numpy.ndarray): A square matrix where element (i,j) represents the number of voxel transitions from region i to region j along the dorsal-ventral axis. - voxel_occurences (numpy.ndarray): A vector containing the count of voxels for each region in the mapping. - region_ids (numpy.ndarray): The region IDs corresponding to the rows/columns in the transition matrix.