Integrate face anonymization for photogrammetry scans #170
Open
harmening wants to merge 22 commits into
Open
Conversation
Squashed from PR #166. Original implementation by Mahmoud Abdeen.
…ize_scan to keep xarrays and pints
…arks -> align_to_ctf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrate face anonymization for photogrammetry scans (builds on #166)
Builds on @Mah-diaa's #166, which contributed the whole face-anonymization algorithm and its test suite. Thanks a lot for that work!
This PR mostly wires it into cedalion's conventions and tightens a few edge cases; the method is unchanged.
What changed vs #166
pipeline.pyis now a thinanonymize_scanorchestrator, shared helpers are consolidated in_utils.py, all mask logic (including the landmark carve-outs) lives inmask.py, and preprocessing owns the framing steps.points.apply_transformandaffine_transform_from_numpy. Transforms carry their CRS:revert_to_einstar_frametakes anAffineTransformand derives the target frame from it instead of a hardcoded string.anonymize_scanvalidates that surface and landmarks share the same CRS.normalize_axes->orient_y_anteriorandalign_axes_from_landmarks->align_to_ctf, 4×4 transforms throughout, and cap parameters grouped into a frozenCapDetectionParams.ValueErroron degenerate landmarks (LPA==RPA, Nz on the ear axis);RuntimeErrorif masking removes most of the mesh.Original implementation: @Mah-diaa (#166).