Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@CaptainAshis
Created September 19, 2018 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CaptainAshis/91456a5216f53c6c5d8896f28c2c03c5 to your computer and use it in GitHub Desktop.
Save CaptainAshis/91456a5216f53c6c5d8896f28c2c03c5 to your computer and use it in GitHub Desktop.
pl_dihedral
def dihedral(x, dih):
""" Perform any of 8 permutations of 90-degrees rotations or flips for image x. """
x = np.rot90(x, dih%4)
return x if dih<4 else np.fliplr(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment