ENH: Add TriangularMesh data structure [BIAP9]#1257
Open
effigies wants to merge 8 commits intonipy:masterfrom
Open
ENH: Add TriangularMesh data structure [BIAP9]#1257effigies wants to merge 8 commits intonipy:masterfrom
effigies wants to merge 8 commits intonipy:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1257 +/- ##
==========================================
+ Coverage 92.19% 92.22% +0.02%
==========================================
Files 99 99
Lines 12458 12496 +38
Branches 2560 2565 +5
==========================================
+ Hits 11486 11524 +38
Misses 648 648
Partials 324 324 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c5458a3 to
107ead6
Compare
effigies
commented
Sep 22, 2023
Comment on lines
+219
to
+220
| def add_coordinates(self, name, coordinates): | ||
| self._coords[name] = coordinates |
Member
Author
There was a problem hiding this comment.
This is simple but perhaps a little clunky. We could also do:
Suggested change
| def add_coordinates(self, name, coordinates): | |
| self._coords[name] = coordinates | |
| def add_coordinates(self, *args, **kwargs): | |
| self._coords.update(dict(*args, **kwargs)) |
This would allow it to take any inputs that would generate a dict, which might be a bit more ergonomic. I'm not 100% on this, so I haven't made the change.
…are shared after with_name()
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.
#1251 Added
PointsetandGrid. #1090 also proposesTriangularMesh, but with the refactoring seen in #1251, that seemed like a bit of extra work for minimal benefit to the transformations use-case. This PR re-adds triangular meshes.Overall, the approach of multiple names feels clunky and pushes the concerns of surface families into pointsets. #1251 removed that, and this PR extends this by keeping
TriangularMeshfocused on the base data structure and movesTriangularMeshFamilylogic into aCoordinateFamilyMixinclass that permits swapping out coordinates with a.with_name()method (open to bikeshedding). Hence, we would change:to:
It also follows the lead of
Gridand gets rid of the omni-__init__in favor of targeted factory classmethods.Notes from previous discussion:
nibabel/nibabel/freesurfer/io.py
Lines 145 to 168 in 590b226