class_docstr: Activity-based voxel selection component of FCMA
  
  Parameters
  ----------
  
  data: 4D array in shape [brain 3D + epoch]
      contains the averaged and normalized brain data epoch by epoch.
      It is generated by .io.prepare_searchlight_mvpa_data
  
  mask: 3D array
  
  labels: 1D array
      contains the labels of the epochs.
      It is generated by .io.prepare_searchlight_mvpa_data
  
  num_folds: int
      the number of folds to be conducted in the cross validation
  
  sl: Searchlight
      the distributed Searchlight object
docstr: run activity-based voxel selection
  
  Sort the voxels based on the cross-validation accuracy
  of their activity vectors within the searchlight
  
  Parameters
  ----------
  clf: classification function
      the classifier to be used in cross validation
  
  Returns
  -------
  result_volume: 3D array of accuracy numbers
      contains the voxelwise accuracy numbers obtained via Searchlight
  results: list of tuple (voxel_id, accuracy)
      the accuracy numbers of all voxels, in accuracy descending order
      the length of array equals the number of voxels
docstr_tok: ["run","activity-based","voxel","selection","Sort","the","voxels","based","on","the","cross-validation","accuracy","of","their","activity","vectors","within","the","searchlight","Parameters","--","--","--","--","--","clf",":","classification","function","the","classifier","to","be","used","in","cross","validation","Returns","--","--","--","-","result_volume",":","3D","array","of","accuracy","numbers","contains","the","voxelwise","accuracy","numbers","obtained","via","Searchlight","results",":","list","of","tuple","(","voxel_id",",","accuracy",")","the","accuracy","numbers","of","all","voxels",",","in","accuracy","descending","order","the","length","of","array","equals","the","number","of","voxels"]
code: def run(self, clf):
      """run activity-based voxel selection
  
      Sort the voxels based on the cross-validation accuracy
      of their activity vectors within the searchlight
  
      Parameters
      ----------
      clf: classification function
          the classifier to be used in cross validation
  
      Returns
      -------
      result_volume: 3D array of accuracy numbers
          contains the voxelwise accuracy numbers obtained via Searchlight
      results: list of tuple (voxel_id, accuracy)
          the accuracy numbers of all voxels, in accuracy descending order
          the length of array equals the number of voxels
      """
      rank = MPI.COMM_WORLD.Get_rank()
      if rank == 0:
          logger.info(
              "running activity-based voxel selection via Searchlight"
          )
      self.sl.distribute([self.data], self.mask)
      self.sl.broadcast((self.labels, self.num_folds, clf))
      if rank == 0:
          logger.info("data preparation done")
  
      # obtain a 3D array with accuracy numbers
      result_volume = self.sl.run_searchlight(_sfn)
      # get result tuple list from the volume
      result_list = result_volume[self.mask]
      results = []
      if rank == 0:
          for idx, value in enumerate(result_list):
              if value is None:
                  value = 0
              results.append((idx, value))
          # Sort the voxels
          results.sort(key=lambda tup: tup[1], reverse=True)
          logger.info(
              "activity-based voxel selection via Searchlight is done"
          )
      return result_volume, results
  
file_path: brainiak/brainiak/fcma/mvpa_voxelselector.py
imports: import numpy
  from sklearn import model_selection
  import logging
  from mpi4py import MPI
label_desc: Use image node_id 2 for calling the MVPAVoxelSelector obj's underlying member method code with example usage: obj.run(clf) and returns: result_volume,  results