.. _sphx_glr_auto_examples_plot_predict.py: ============================= Predict unknown location ============================= In this example, we load in a single subject example, remove electrodes that exceed a kurtosis threshold, load a model, and predict activity at all model locations and plot those locations. We then convert the reconstruction to a nifti and plot the reconstruction. .. rst-class:: sphx-glr-horizontal * .. image:: /auto_examples/images/sphx_glr_plot_predict_001.png :scale: 47 * .. image:: /auto_examples/images/sphx_glr_plot_predict_002.png :scale: 47 .. rst-class:: sphx-glr-script-out Out:: Number of electrodes: 274 Recording time in seconds: [ 5.3984375 14.1328125] Sample Rate in Hz: [256, 256] Number of sessions: 2 Date created: Wed Jul 25 20:26:51 2018 Meta data: {} | .. code-block:: python # Code source: Lucy Owen & Andrew Heusser # License: MIT import supereeg as se # load example data bo = se.load('example_data') # load example model model = se.load('example_model') # the default will replace the electrode location with the nearest voxel and reconstruct at all other locations reconstructed_bo = model.predict(bo, force_update=True) # plot locations colored by label reconstructed_bo.plot_locs() # print out info on new brain object reconstructed_bo.info() # save as nifti reconstructed_nii = reconstructed_bo.to_nii(template='gray', vox_size=20) # plot nifti reconstruction reconstructed_nii.plot_glass_brain() **Total running time of the script:** ( 0 minutes 32.736 seconds) .. only :: html .. container:: sphx-glr-footer .. container:: sphx-glr-download :download:`Download Python source code: plot_predict.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_predict.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_