.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/example_remeshing.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. 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_example_remeshing.py: .. _example_remeshing: =================================== Remeshing example in slam =================================== .. GENERATED FROM PYTHON SOURCE LINES 8-17 .. code-block:: default # Authors: # Guillaume Auzias # Julien Barrès # License: BSD (3-clause) # sphinx_gallery_thumbnail_number = 2 .. GENERATED FROM PYTHON SOURCE LINES 18-19 Importation of slam modules .. GENERATED FROM PYTHON SOURCE LINES 19-23 .. code-block:: default import slam.plot as splt import slam.io as sio import slam.remeshing as srem .. GENERATED FROM PYTHON SOURCE LINES 24-25 Source object files .. GENERATED FROM PYTHON SOURCE LINES 25-29 .. code-block:: default source_mesh_file = "../examples/data/example_mesh.gii" source_texture_file = "../examples/data/example_texture.gii" source_spherical_mesh_file = "../examples/data/example_mesh_spherical.gii" .. GENERATED FROM PYTHON SOURCE LINES 30-31 Target object files .. GENERATED FROM PYTHON SOURCE LINES 31-44 .. code-block:: default target_mesh_file = "../examples/data/example_mesh_2.gii" target_spherical_mesh_file = "../examples/data/example_mesh_2_spherical.gii" source_mesh = sio.load_mesh(source_mesh_file) source_tex = sio.load_texture(source_texture_file) source_spherical_mesh = sio.load_mesh(source_spherical_mesh_file) target_mesh = sio.load_mesh(target_mesh_file) target_spherical_mesh = sio.load_mesh(target_spherical_mesh_file) interpolated_tex_values = srem.spherical_interpolation_nearest_neigbhor( source_spherical_mesh, target_spherical_mesh, source_tex.darray[0] ) .. GENERATED FROM PYTHON SOURCE LINES 45-46 Plot .. GENERATED FROM PYTHON SOURCE LINES 46-67 .. code-block:: default visb_sc = splt.visbrain_plot( mesh=source_mesh, tex=source_tex.darray[0], caption="source with curvature", cblabel="curvature", ) visb_sc = splt.visbrain_plot( mesh=source_spherical_mesh, tex=source_tex.darray[0], caption="spherical source mesh", cblabel="curvature", visb_sc=visb_sc, ) visb_sc = splt.visbrain_plot( mesh=target_mesh, tex=interpolated_tex_values, caption="target mesh with curvature " "from source mesh", cblabel="curvature", visb_sc=visb_sc, ) visb_sc.preview() .. image:: /auto_examples/images/sphx_glr_example_remeshing_001.png :alt: example remeshing :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.754 seconds) .. _sphx_glr_download_auto_examples_example_remeshing.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_remeshing.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_remeshing.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_