filter_structures_not_present_in_annotation#
- brainglobe_atlasapi.atlas_generation.wrapup.filter_structures_not_present_in_annotation(structures, annotation)[source]#
Filter out structures not present in the annotation volume.
This function removes structures from the provided list that are not found in the annotation volume, or whose children are also not present. It also prints the names and IDs of the removed structures.
- Parameters:
structures (list of dict) – A list of dictionaries, where each dictionary contains information about a brain structure (e.g., ID, name, parent information).
annotation (np.ndarray) – The annotation volume (3D NumPy array) where each voxel contains a structure ID.
- Returns:
A new list containing only the structure dictionaries that are present in the annotation volume or have descendants present.
- Return type:
list of dict