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

FIX: Implement AFNI's deoblique operations #117

Merged
merged 17 commits into from
Feb 28, 2022
Merged

Conversation

oesteban
Copy link
Collaborator

@oesteban oesteban commented Jul 2, 2021

Finalize the interpretation in I/O of AFNI's linear matrices when reference
or moving data are oblique w.r.t. the canonical axes.

Resolves: #45.

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2021

Codecov Report

Merging #117 (4d4e3d9) into master (6fbcbc1) will increase coverage by 0.70%.
The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #117      +/-   ##
==========================================
+ Coverage   97.88%   98.59%   +0.70%     
==========================================
  Files          13       13              
  Lines        1184     1208      +24     
  Branches      183      184       +1     
==========================================
+ Hits         1159     1191      +32     
+ Misses         18       10       -8     
  Partials        7        7              
Flag Coverage Δ
travis 96.77% <52.08%> (-1.04%) ⬇️
unittests 98.54% <95.83%> (+0.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
nitransforms/io/afni.py 98.29% <95.83%> (+9.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fbcbc1...4d4e3d9. Read the comment docs.

@pep8speaks
Copy link

pep8speaks commented Feb 16, 2022

Hello @oesteban! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-02-28 17:39:08 UTC

@oesteban
Copy link
Collaborator Author

Okay, this is as far as I can go for the moment (see afni/afni#353). I'm going to focus on other things while I wait for more feedback from AFNI folks.

/cc @effigies @matthew-brett

With the generous support from Paul Taylor <@mrneont> and his answers in
afni/afni#353, I have managed to get all tests to PASS.

I am not resolving the problem of oblique datasets for displacements
fields this time.

Resolves: #45.
Resolves: #150.
Continues: #157.
@oesteban oesteban marked this pull request as ready for review February 25, 2022 16:10
@oesteban oesteban requested a review from effigies February 25, 2022 16:11
@oesteban oesteban linked an issue Feb 25, 2022 that may be closed by this pull request
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

The notebooks don't run all the way through. Was hoping to use them to guide my review.

@oesteban
Copy link
Collaborator Author

oesteban commented Feb 25, 2022 via email

@effigies
Copy link
Member

If they're not necessary, that's fine. Just assumed that with their changes they were intended to curate the situation.

@oesteban
Copy link
Collaborator Author

oesteban commented Feb 25, 2022 via email

@oesteban
Copy link
Collaborator Author

Okay, I think now the notebooks are in much better shape. LMKWYT.

@oesteban
Copy link
Collaborator Author

I would imagine you are really up to your eyeballs @effigies - should I wait for review or can I go ahead and maybe you can catch up later when the integration with nibabel starts?

@effigies
Copy link
Member

Was just starting to have a quick look before our call, and planned to finish up after. I'm okay if you want to go ahead and merge, but I did want to suggest that it might make sense to think of affines generally as T @ R_O @ R_C @ Z @ S where R_C is the cardinal rotation and R_O is an additional oblique rotation <90deg. I haven't thought through the details, so it might be too cumbersome, but it seems like this conceptualization could allow us to write code that is more similar across tools and make the specific deviations of AFNI clear in the algebra, rather than via special functions.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

Okay, the code makes sense once I worked through the algebra, which I coded up as a docstring so others don't have to do it again. I read the tests with an eye to get the gist, but did not verify that all comments correctly described what was being done. This looks reasonable to me.

Co-authored-by: Chris Markiewicz <[email protected]>
@oesteban oesteban merged commit 7b3640e into master Feb 28, 2022
@oesteban oesteban deleted the enh/afni-deoblique branch February 28, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement AFNI's "deoblique" operation Implement AFNI affines on oblique datasets
4 participants