R-Map computation#

sphinx_gallery_thumbnail_path = ‘_static/RMAP_figure.png’

Across patient decoding using R-Map optimal connectivity#

ECoG electrode placement is commonly very heterogeneous across patients and cohorts. To still facilitate approaches that are able to perform decoding applications without patient individual training, two across-patient decoding approaches were previously investigated for movement decoding:

  • grid-point decoding

  • optimal connectivity channel decoding

First, the grid-point decoding approach relies on definition of a cortical or subcortical grid. Data from individual grid points is then interpolated onto those common grid points. The approach was also explained in the Grid Point Projection notebook.

R-Map and grid point approach for decoding without patient-individual training

The R-Map decoding approach relies on the other hand on computation of whole brain connectivity. The electrode MNI space locations need to be known, then the following steps can be performed for decoding without patient individual training:

  1. Using the wjn_toolbox wjn_specrical_roi function, the MNI coordinates can be transformed into NIFTI (.nii) files, containing the electrode contact region of interest (ROI):

    wjn_spherical_roi(roiname, mni, 4)
    
  2. For the given ROI.nii files, the LeadDBS LeadMapper tool can be used for functional or structural connectivity estimation.

  3. The py_neuromodulation py module can then compute the R-Map given the contact-individual connectivity fingerprints:

    nm_RMAP.calculate_RMap_numba(fingerprints, performances)
    
  4. The fingerprints from test-set patients can then be correlated with the calculated R-Map:

    nm_RMAP.get_corr_numba(fp, fp_test)
    
  5. The channel with highest correlation can then be selected for decoding without individual training. py contain already leave one channel and leave one patient out cross validation functions:

    nm_RMAP.leave_one_sub_out_cv(l_fps_names, l_fps_dat, l_per, sub_list)
    
  6. The obtained R-Map correlations can then be estimated statistically and plotted against true correlates:

    nm_RMAP.plot_performance_prediction_correlation(per_left_out, per_predict, out_path_save)
    

Total running time of the script: (0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery