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

Update generate meshgrid #168

Merged
merged 4 commits into from
Nov 10, 2020
Merged

Update generate meshgrid #168

merged 4 commits into from
Nov 10, 2020

Conversation

po09i
Copy link
Member

@po09i po09i commented Nov 10, 2020

Description

The function generate_meshgrid allows to generate coordinates according to an affine transformation.

This PR fixes several problems with generate_meshgrid:

  • The dot product was reversed, this is fixed by using np.apply_affine which does the dot product correctly. See generate_meshgrid bug for some affine transformations #167
  • Casts np.zeros_like to floats to avoid rounding errors
  • Fixes the test in test_siemens_basis to correct for the rounding errors
  • Creates a test for generate_meshgrid

Linked issues

Fixes #167

@po09i po09i self-assigned this Nov 10, 2020
@po09i po09i added the bug Something isn't working label Nov 10, 2020
Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

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

i haven't tested but LGTM 👍

@po09i po09i merged commit 0a320ad into master Nov 10, 2020
@po09i po09i deleted the ad/167-generate-meshgrid-bug branch November 10, 2020 22:52
kousu pushed a commit that referenced this pull request Mar 20, 2021
* Use apply_affine to reduce error, cast as floats and use np.arange

* Fix test that was broken due to casting as floats (there was an error since it was ints)

* Create new test for generate_meshgrid

* Remove TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

generate_meshgrid bug for some affine transformations
2 participants