Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert between LPS/RAS coordinate systems #32

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

kaitj
Copy link
Contributor

@kaitj kaitj commented Sep 7, 2023

Proposed changes
Adds a method that takes in one AfidSet in either "LPS" or "RAS" coordinate system and returns a new AfidSet in the opposite coordinate system. Open to moving this as a method of AfidSet, but opted for a separate function as a first pass.

One thing that needs to be checked is if the coordinates need to be in a certain system to work with the affine pulled via nibabel in the world / voxel functions, but that should be done in a separate PR if an update is needed.

Types of changes
What types of changes does your code introduce? Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (if none of the other choices apply)

Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you are unsure about any of the choices, don't hesitate to ask!

  • Changes have been tested to ensure that fix is effective or that a feature works.
  • Changes pass the unit tests
  • Code has been run through the poe quality task
  • I have included necessary documentation or comments (as necessary)
  • Any dependent changes have been merged and published

Notes
All PRs will undergo the unit testing before being reviewed. You may be requested to explain or make additional changes before the PR is accepted.

@kaitj kaitj added the enhancement New feature or request label Sep 7, 2023
@kaitj kaitj linked an issue Sep 7, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #32 (78c975c) into main (d1ba3af) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #32   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          503       529   +26     
=========================================
+ Hits           503       529   +26     
Components Coverage Δ
afids_utils/afids.py ∅ <ø> (∅)
afids_utils/ext 100.00% <ø> (ø)
afids_utils/transforms.py 100.00% <100.00%> (ø)
📢 Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=afids).

Copy link
Contributor

@tkkuehn tkkuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, just a few nitpicky style comments

afids_utils/transforms.py Outdated Show resolved Hide resolved
afids_utils/transforms.py Show resolved Hide resolved
afids_utils/transforms.py Outdated Show resolved Hide resolved
afids_utils/tests/test_transforms.py Outdated Show resolved Hide resolved
- make use of attrs.evolve to create new instances with modifications
- use zipped list for interating and comparing new vs old afids
- return same instance of intended coordinate system is the same as
  original
@kaitj kaitj requested a review from tkkuehn September 7, 2023 19:58
@kaitj
Copy link
Contributor Author

kaitj commented Sep 7, 2023

Implemented the suggested changes and also took the opportunity to update the docs (minor update includes adding AfidVoxel to the documentation)

@kaitj kaitj merged commit b596b6d into afids:main Sep 7, 2023
8 checks passed
@kaitj kaitj deleted the enh/lps_ras_xfm branch September 7, 2023 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] Handling of different coordinate systems
2 participants