1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
.. _custom_viz:
Customizing the Visualization
=============================
One advantage to PySurfer over Tksurfer is that you are not
limited to a single look for the visualization. Of course, being
built on Mayavi, PySurfer is in theory completely customizable.
However, we also offer a few preset options so that you do not
have to delve into the underlying engine to get a different look.
Changing the display background
-------------------------------
The display background can take any valid matplotlib color.
Changing the curvature color scheme
-----------------------------------
By default, a new :class:`Brain` instance displays the binarized
cortical curvature values, so you can see which patches of cortex
are gyri and which are sulci (pass ``curv=False`` to the
:class:`Brain` constructor, or use the ``-no-curv`` switch in the
command-line interface to turn this off). There are four preset
themes for the curvature color scheme: ``classic``, ``bone``,
``high_contrast``, and ``low_contrast``:
.. image:: ../_static/cortex_options.png
Note that, in each theme, the darker color signifies sulci.
Changing the display size
-------------------------
The default display window is 800px by 800px, but this is also
customizable. You may use any positive number for the size
(subject, possibly, to Mayavi/hardware limitations we are not
aware of). The viewing window is always square, so just give one
number and it will be used for both width and height.
How to use these themes
-----------------------
These options can be set in three places. The first is in your
config file. Set your preferred visualization theme there, and it
will be used automatically whenever you start PySurfer. You may
also override this theme for any individual visualization session.
If using the Python ``surfer`` library, you may pass a
``config_opts`` dictionary to the :class:`Brain` constructor,
which will override any values you have set in your config file.
If using the command-line interface, there are parameters for each
of the above options. Regardless of method, the key names are
``background``, ``cortex``, and ``size``.
For example:
.. sourcecode:: ipython
In [1]: from surfer import Brain
In [2]: b = Brain('fsaverage', 'lh', 'inflated', config_opts={'cortex':'bone'})
or::
pysurfer fsaverage lh inflated -background slategray -size 400
in your shell terminal.
|