Skip to content

Commit

Permalink
one line less
Browse files Browse the repository at this point in the history
  • Loading branch information
amirDahari1 committed Jun 3, 2024
1 parent 3ab41df commit b804d7a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/porespy/tools/_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,7 @@ def all_to_uniform(im, scale=None):
"""
if scale is None:
scale = [im.min(), im.max()]
argsort_im = np.argsort(im.flatten())
aargsort_im = np.argsort(argsort_im) # twice to get the inverse permutation
aargsort_im = np.argsort(np.argsort(im.flatten())) # twice for the inverse permutation
linspace_im = np.linspace(scale[0], scale[1], len(aargsort_im), endpoint=True)
uniform_flatten_im = linspace_im[aargsort_im]
im = np.reshape(uniform_flatten_im, im.shape)
Expand Down

0 comments on commit b804d7a

Please sign in to comment.