Skip to content

images.GaussConvFourier and images.GaussConvImage layers rotate in opposite directions #262

Description

@iancze

Describe the bug
The two Gaussian convolution layers, images.GaussConvFourier and images.GaussConvImage, do not yield consistent results when considering elliptical beams with some non-zero rotation value Omega.

It appears the images.GaussConvFourier routine is consistent with our convention expectations (positive Omega is rotated from North towards East, 0 degrees has FWHM_maj aligned with N-S) whileimages.GaussConvImage follows the opposite convention.

See the output of the images.test_GaussConvFourier_rotate and images.test_GaussConvImage_rotate tests.

Screenshots
The routines appear to be consistent for Omega = 0.
convolved_0_deg
convolved_0_deg

But look noticeably different for Omega = 30. Compare the struts/veins in the lower half of the butterflies wings in the right vs. left wings. The GaussConvImage appears to give the expected result, where struts aligned with the beam major axis look sharpest.
convolved_30_deg
convolved_30_deg

Suggested fix

  • Investigate what is flipped inside the GaussConvFourier routine with regards to the beam.
  • Write a new test directly comparing the per-pixel output from images sent through both routines, for some non-zero and non-symmetric rotation.
  • Also, the Omega=0 results look less consistent than expected, so further tests to investigate these discrepancies.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions