plots.get_color_br
plots.get_color_br(pid_ch_df, br, mapping='Allen')Generate colors for brain regions.
This function extracts brain region IDs from a DataFrame and maps them to their corresponding RGB colors from the brain regions atlas.
Args: pid_ch_df (pd.DataFrame): DataFrame containing brain region mapping columns (e.g., “Allen_id”). br (iblatlas.atlas.BrainRegions): BrainRegions object containing region information and colors. mapping (str, optional): Brain region mapping system to use. Defaults to “Allen”.
Returns: np.ndarray: Array of RGB colors normalized to [0, 1] range.
Note: The function looks for a column named “{mapping}_id” in the DataFrame and uses the brain regions atlas to map these IDs to RGB colors.