Note
Go to the end to download the full example code.
example of differential geometry tools in slam¶
# Authors: Guillaume Auzias <guillaume.auzias@univ-amu.fr>
# License: MIT
# sphinx_gallery_thumbnail_number = 2
importation of slam modules
import slam.io as sio
import slam.sulcal_depth as sdepth
loading an examplar mesh and corresponding texture
mesh_file = "../examples/data/example_mesh.gii"
texture_file = "../examples/data/example_texture.gii"
mesh = sio.load_mesh(mesh_file)
compute the depth potential function
dpf = sdepth.depth_potential_function(mesh)
Calculating vertex normals .... Please wait
Finished calculating vertex normals
Calculating curvature tensors ... Please wait
Finished Calculating curvature tensors
Calculating Principal Components ... Please wait
Finished Calculating principal components
Computing Laplacian
Computing mesh weights of type fem
-edge length threshold needed for 0 values = 0.0 %
-number of Nan in weights: 0 = 0.0 %
-number of Negative values in weights: 936 = 6.706792777300086 %
-nb Nan in Laplacian : 0
-nb Inf in Laplacian : 0
compute the dpf_star
Calculating vertex normals .... Please wait
Finished calculating vertex normals
Calculating curvature tensors ... Please wait
Finished Calculating curvature tensors
Calculating Principal Components ... Please wait
Finished Calculating principal components
Computing Laplacian
Computing mesh weights of type conformal
-edge length threshold needed for 0 values = 0.0 %
-number of Nan in weights: 0 = 0.0 %
-number of Negative values in weights: 936 = 6.706792777300086 %
-nb Nan in Laplacian : 0
-nb Inf in Laplacian : 0
VISUALIZATION USING plotly¶
import slam.plot as splt
display_settings = {}
display_settings['colorbar_label'] = 'dpf_star'
mesh_data = {}
mesh_data['vertices'] = mesh.vertices
mesh_data['faces'] = mesh.faces
mesh_data['title'] = 'dpf_star'
intensity_data = {}
intensity_data['values'] = dpf_star[0]
intensity_data["mode"] = "vertex"
fig = splt.plot_mesh(
mesh_data=mesh_data,
intensity_data=intensity_data,
display_settings=display_settings)
fig.show()
fig
Total running time of the script: (0 minutes 7.335 seconds)