Merged 7 months agoApril 30, 2025
Related#547Removed all internal logic and references related to transforming atlas data to the BrainGlobe orientation, requiring input data to be pre-oriented.
What was done
- The
transformation_matparameter and thetrasform_to_bgkey were removed from thegenerate_metadata_dictfunction inmetadata_utils.py. - All orientation transformation logic was removed from the
wrapup_atlas_from_datafunction inwrapup.py. This included removing calls tomap_stack_toandmap_points_to, and the calculation/storage of a transformation matrix. - An assertion was added to
wrapup_atlas_from_datato enforce that input stacks and meshes are already oriented to "asr". - The
orientationfield was removed from the metadata template indescriptors.py. - Removed the import of
brainglobe_spaceand the instantiation ofAnatomicalSpaceobjects, as they are no longer needed for internal transformations.
Impact
- Atlas generation now strictly expects input data (stacks and meshes) to be in the "asr" (Anterior-Superior-Right) BrainGlobe orientation, making the API simpler but requiring users to pre-orient their data.
- This is a breaking change for atlas generators that previously relied on
brainglobe-atlasapito perform orientation transformations. - Improved clarity in atlas metadata by removing redundant transformation information.
- Minor performance gains during atlas generation due to the removal of transformation computations.
Technical details
- Files touched include
brainglobe_atlasapi/atlas_generation/metadata_utils.py,brainglobe_atlasapi/atlas_generation/wrapup.py, andbrainglobe_atlasapi/descriptors.py. - The
generate_metadata_dictfunction no longer accepts atransformation_matparameter or addstrasform_to_bgto the metadata. - The
wrapup_atlas_from_datafunction was refactored to remove allbrainglobe_spacedependencies and related orientation logic. - The
METADATA_TEMPLATEindescriptors.pywas updated to no longer include an "orientation" field. - The change shifts the responsibility of data orientation to the data provider rather than the atlas packaging utility.
Related issues
- #547
Metadata
- Source: github
- Repo: brainglobe/brainglobe-atlasapi
- URL: https://github.com/brainglobe/brainglobe-atlasapi/pull/555
- Merged: 2025-04-30T12:24:22Z