.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/quickflat/plot_dropout.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_quickflat_plot_dropout.py: =================================== Plot dropout regions on the flatmap =================================== A dropout region is a region with very low EPI signal. In pycortex a crosshatch is used to display such dropout regions. The crosshatches are created using the reference nifti image file with a threshold. Setting the `with_dropout=True` parameter in `quickflat.make_figure` takes the reference nifti image file and computes a thresholded version of this using the following formula: FIXME: .. code-block:: python rawdata[rawdata==0] = np.mean(rawdata[rawdata!=0]) normdata = (rawdata - rawdata.min()) / (rawdata.max() - rawdata.min()) normdata = (1 - normdata) ** power .. GENERATED FROM PYTHON SOURCE LINES 21-34 .. image-sg:: /auto_examples/quickflat/images/sphx_glr_plot_dropout_001.png :alt: plot dropout :srcset: /auto_examples/quickflat/images/sphx_glr_plot_dropout_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Failed to get connection ** (inkscape:5219): CRITICAL **: 01:27:52.316: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed ** (inkscape:5219): CRITICAL **: 01:27:52.317: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed ** (inkscape:5219): CRITICAL **: 01:27:52.317: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed | .. code-block:: default import cortex import numpy as np np.random.seed(1234) # Create a random pycortex Volume volume = cortex.Volume.random(subject='S1', xfmname='fullhead') # Plot a flatmap with the data projected onto the surface # Highlight the curvature and dropout regions _ = cortex.quickflat.make_figure(volume, with_curvature=True, with_dropout=True) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 3.200 seconds) .. _sphx_glr_download_auto_examples_quickflat_plot_dropout.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: plot_dropout.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_dropout.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_