code: def get_unique_R(self, R):
          
          unique_R = []
          inds = []
          for d in np.arange(self.n_dim):
              tmp_unique, tmp_inds = np.unique(R[:, d], return_inverse=True)
              unique_R.append(tmp_unique)
              inds.append(tmp_inds)
          return unique_R, inds
docs: Get unique vlaues from coordinate matrix
  
          Parameters
          ----------
          R :  2D array
             The coordinate matrix of a subject's fMRI data
  
          Return
          ------
  
          unique_R : a list of array,
              Each element contains unique value in one dimension of
              coordinate matrix R.
  
          inds : a list of array,
              Each element contains the indices to reconstruct one
              dimension of original cooridnate matrix from the unique
              array.