.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/example_screenshot_for_QC.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_example_screenshot_for_QC.py: .. _example_screenshot_for_QC: =================================== Examples of the use of plot for automatic screenshot e.g. for implementing visual quality check =================================== .. GENERATED FROM PYTHON SOURCE LINES 8-15 .. code-block:: Python # Authors: # Guillaume Auzias # License: MIT # sphinx_gallery_thumbnail_number = 2 .. GENERATED FROM PYTHON SOURCE LINES 16-17 importation of slam modules .. GENERATED FROM PYTHON SOURCE LINES 17-20 .. code-block:: Python import slam.io as sio import slam.plot as splt .. GENERATED FROM PYTHON SOURCE LINES 21-22 Load a mesh .. GENERATED FROM PYTHON SOURCE LINES 22-38 .. code-block:: Python mesh_file = "../examples/data/example_mesh.gii" mesh = sio.load_mesh(mesh_file) mesh_data = { "vertices": mesh.vertices, "faces": mesh.faces, "title": "subject ID", # figure title, default is None } fig1 = splt.plot_mesh( mesh_data=mesh_data, show_two_sides=True, ) fig1.show() fig1 .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 39-41 To save the figure as png on the disc fig1.write_image("example_figure1.png", width=1300, height=900) .. GENERATED FROM PYTHON SOURCE LINES 43-44 Example with a texture, here the DPF* .. GENERATED FROM PYTHON SOURCE LINES 44-70 .. code-block:: Python # Load a texture tex = sio.load_texture("../examples/data/example_dpf_star.gii") # set the parameters of the figure intensity_data = { "values": tex.darray[0], "mode": "vertex", # default is "cell" "cmin": -0.01, # default is automatic value "cmax": 0.01, } display_settings = { "colorscale": "ylgnbu_r", # color scale, default is Turbo "colorbar_label": "DPF*", # colorbar label, default is None } fig2 = splt.plot_mesh( mesh_data, intensity_data, display_settings, show_two_sides=True, ) fig2.show() fig2 .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 71-75 To save the figure as png on the disc fig2.write_image("example_figure2.png", width=1300, height=900) save the figure as an interactive HTML file fig1.write_html(SAVE_DIR) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 5.737 seconds) .. _sphx_glr_download_auto_examples_example_screenshot_for_QC.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_screenshot_for_QC.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_screenshot_for_QC.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: example_screenshot_for_QC.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_