code: def permutationinverse(perm):
      """
      Function generating inverse of the permutation
  
      Parameters
      ----------
      perm : 1D array
  
      Returns
      -------
      inverse : 1D array
          permutation inverse of the input
      """
  
      inverse = [0] * len(perm)
      for i, p in enumerate(perm):
          inverse[p] = i
      return inverse
  
file_path: dipy/dipy/core/wavelet.py
imports: import numpy
  from dipy.denoise import nlmeans_block
label_desc: Use image node_id 2 for calling a global function with example usage: permutationinverse(perm) and returns: inverse