.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_5_example_rmap_computing.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_5_example_rmap_computing.py: R-Map computation ================= .. GENERATED FROM PYTHON SOURCE LINES 8-64 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 :doc:`plot_4_example_gridPointProjection` notebook. .. image:: ../_static/RMAP_figure.png :alt: 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: #. 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): .. code-block:: python wjn_spherical_roi(roiname, mni, 4) #. For the given *ROI.nii* files, the LeadDBS `LeadMapper `_ tool can be used for functional or structural connectivity estimation. #. The py_neuromodulation :class:`~RMAP.py` module can then compute the R-Map given the contact-individual connectivity fingerprints: .. code-block:: python RMAP.calculate_RMap_numba(fingerprints, performances) #. The fingerprints from test-set patients can then be correlated with the calculated R-Map: .. code-block:: python RMAP.get_corr_numba(fp, fp_test) #. The channel with highest correlation can then be selected for decoding without individual training. :class:`~RMAP.py` contain already leave one channel and leave one patient out cross validation functions: .. code-block:: python RMAP.leave_one_sub_out_cv(l_fps_names, l_fps_dat, l_per, sub_list) #. The obtained R-Map correlations can then be estimated statistically and plotted against true correlates: .. code-block:: python RMAP.plot_performance_prediction_correlation(per_left_out, per_predict, out_path_save) sphinx_gallery_thumbnail_path = '_static/RMAP_figure.png' .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_plot_5_example_rmap_computing.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_5_example_rmap_computing.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_5_example_rmap_computing.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_5_example_rmap_computing.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_