code: def eeg_microstates_relabel(method, results, microstates_labels, reverse_microstates=None):
      
  
      microstates = list(method['microstates'])
  
      for index, microstate in enumerate(method['microstates']):
  
          if microstate in list(reverse_microstates.keys()):
              microstates[index] = reverse_microstates[microstate]
              method["data"][index] = -1*method["data"][index]
  
          if microstate in list(microstates_labels.keys()):
              microstates[index] = microstates_labels[microstate]
  
      method['microstates'] = np.array(microstates)
  
      return(results, method)
docs: Relabel the microstates.