Note
Go to the end to download the full example code.
Texture example in slam¶
# Authors:
# Guillaume Auzias <guillaume.auzias@univ-amu.fr>
# Julien Barrès <julien.barres@etu.univ-amu.fr>
# License: MIT
# sphinx_gallery_thumbnail_number = 2
Importation of slam modules
import numpy as np
from slam import texture
from slam import io as sio
tex = sio.load_texture("../examples/data/example_texture.gii")
print(tex)
print(tex.metadata)
print(tex.shape)
print(tex.dtype)
print(tex.min())
print(tex.max())
<slam.texture.TextureND object at 0x7f5eca164a00>
{'gifticlib-version': 'gifti library version 1.08, 8 March, 2010', 'processed': True}
(1, 2328)
float32
-0.051712357
0.071442835
darray = np.zeros((2, 3))
tex2 = texture.TextureND(darray=darray)
print(tex2.metadata)
print(tex2)
print(tex2.shape)
print(tex2.dtype)
print(tex2.min())
print(tex2.max())
sio.write_texture(tex2, "test.gii")
{'processed': True}
<slam.texture.TextureND object at 0x7f5eca5513a0>
(2, 3)
float64
0.0
0.0
Total running time of the script: (0 minutes 0.003 seconds)