@@ -23,3 +23,88 @@ Alternatively, you can install ``netneurotools`` directly from PyPi with:
2323.. code-block :: bash
2424
2525 pip install netneurotools
26+
27+ Optional installation for surface plotting
28+ ------------------------------------------
29+
30+ In order to use surface plotting functionality like
31+ :py:func: `netneurotools.plotting.plot_fsaverage `, you will need a working
32+ ``vtk ``/``mayavi ``/``pysurfer `` installation. These can generally be installed
33+ with the following command:
34+
35+ .. code-block: bash
36+
37+ pip install vtk mayavi pysurfer
38+
39+ However, we include instructions below for installing the bleeding-edge version
40+ of the dependencies. Note: if you already have a working ``mayavi ``/``pysurfer ``
41+ installation, there is generally no need to follow these instructions!
42+
43+ - Install Qt
44+
45+ - Installing Jupyterlab using conda (``conda install jupyterlab ``)
46+ should automatically install the required qt/pyqt packages.
47+ - If otherwise, using ``pip install PyQt5 `` should also work as
48+ suggested by
49+ `here <http://docs.enthought.com/mayavi/mayavi/installation.html#latest-stable-release >`__
50+ and `here <https://github.com/enthought/mayavi#installation >`__
51+ - If not working, search for the error prompts like
52+ `this <https://askubuntu.com/questions/308128/failed-to-load-platform-plugin-xcb-while-launching-qt5-app-on-linux-without >`__.
53+
54+ - Install VTK
55+
56+ - Official wheels for the latest VTK9 are available for download
57+ `here <https://vtk.org/download/ >`__.
58+ - For Python>=3.9, official wheel is `not available at the
59+ moment <https://discourse.vtk.org/t/python-3-9/4369/3> `__.
60+ Following
61+ `here <https://docs.pyvista.org/extras/building_vtk.html >`__ and
62+ `here <https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md#python-wheels >`__,
63+ it’s possible to build the wheel. See the example code below.
64+
65+ .. code :: bash
66+
67+ git clone https://github.com/Kitware/VTK
68+ cd VTK
69+
70+ mkdir build
71+ cd build
72+ PYBIN=< PATH TO YOUR PYTHON EXECUTABLE>
73+ cmake -GNinja -DVTK_BUILD_TESTING=OFF -DVTK_WHEEL_BUILD=ON -DVTK_PYTHON_VERSION=3 -DVTK_WRAP_PYTHON=ON -DPython3_EXECUTABLE=$PYBIN ../
74+
75+ # optionally, apt install ninja
76+ ninja
77+ $PYBIN setup.py bdist_wheel
78+
79+ # to install
80+ pip install dist/vtk-* .whl
81+
82+ - Install mayavi
83+
84+ - Install from source
85+ ``pip install git+https://github.com/enthought/mayavi.git ``
86+
87+ - Install pysurfer
88+
89+ - Install from source
90+ ``pip install git+https://github.com/nipy/PySurfer.git ``
91+
92+ - Install netneurotools
93+
94+ - Install from source
95+ ``pip install git+https://github.com/netneurolab/netneurotools.git ``
96+
97+ Troubleshooting
98+ ~~~~~~~~~~~~~~~
99+
100+ - Error related to ``from tvtk.vtk_module import VTK_MAJOR_VERSION ``
101+
102+ - `Currently not
103+ fixed <https://github.com/enthought/mayavi/issues/939#issuecomment-747266625> `__
104+ - Temporary workaround: adding ``VTK_MAJOR_VERSION = 9 `` to
105+ ``mayavi/tvtk/vtk_module.py ``
106+
107+ - Error related to GLX
108+
109+ - Try ``glxgears `` or ``glxinfo ``
110+ - Check display driver compatibility
0 commit comments