get_parent_id#
- brainglobe_atlasapi.atlas_generation.structure_json_to_csv.get_parent_id(structure_id_path, root=997)[source]#
Get the parent ID of a given structure.
Given a path (as a list of structure IDs) to a specific structure, return the ID of its parent structure.
- Parameters:
structure_id_path (list of int) – A list of integers defining the hierarchical path to a region, where the last element is the ID of the region itself.
root (int, optional) – The ID value for the root (whole brain) structure, which has no parent. By default, 997.
- Returns:
The ID of the parent structure, or None if the input structure is the root (has no parent).
- Return type:
int or None