From b804d7aeafdc2b1cc1d1ed504026ddf3c2ab5adf Mon Sep 17 00:00:00 2001 From: amirDahari1 Date: Mon, 3 Jun 2024 18:21:42 +0100 Subject: [PATCH] one line less --- src/porespy/tools/_funcs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/porespy/tools/_funcs.py b/src/porespy/tools/_funcs.py index ac8f01082..1d7684d19 100644 --- a/src/porespy/tools/_funcs.py +++ b/src/porespy/tools/_funcs.py @@ -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)