.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_make_gif.py: ============================= Make gif ============================= In this example, we load in a single subject example, remove electrodes that exceed a kurtosis threshold (in place), load a model, and predict activity at all model locations. We then convert the reconstruction to a nifti and plot 3 consecutive timepoints first with the plot_glass_brain and then create .png files and compile as a gif. .. code-block:: python # Code source: Lucy Owen & Andrew Heusser # License: MIT # load 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) # print out info on new brain object reconstructed_bo.info() # convert to nifti reconstructed_nifti = reconstructed_bo.to_nii(template='gray', vox_size=20) # make gif, default time window is 0 to 10, but you can specifiy by setting a range with index # reconstructed_nifti.make_gif('/your/path/to/gif/', index=np.arange(100), name='sample_gif') **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_make_gif.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: make_gif.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: make_gif.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_