.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/example_texture.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_texture.py: .. _example_texture: =================================== Texture 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 numpy as np from slam import texture from slam import io as sio .. GENERATED FROM PYTHON SOURCE LINES 25-34 .. code-block:: default 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()) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none {'gifticlib-version': 'gifti library version 1.08, 8 March, 2010', 'processed': True} (1, 2328) float32 -0.051712357 0.071442835 .. GENERATED FROM PYTHON SOURCE LINES 36-45 .. code-block:: default 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") .. rst-class:: sphx-glr-script-out Out: .. code-block:: none {'processed': True} (2, 3) float64 0.0 0.0 .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.003 seconds) .. _sphx_glr_download_auto_examples_example_texture.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_texture.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_texture.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_