-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.html
186 lines (177 loc) · 11.9 KB
/
install.html
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>PySurfer Python Neuroimaging Visualization — PySurfer 0.10.0 documentation</title>
<link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/gallery.css" />
<link rel="stylesheet" type="text/css" href="_static/gallery-binder.css" />
<link rel="stylesheet" type="text/css" href="_static/gallery-dataframe.css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Example gallery" href="auto_examples/index.html" />
<link rel="prev" title="What is PySurfer?" href="intro.html" />
<link rel="stylesheet" href="_static/navy.css " type="text/css" />
</head><body>
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="index.html">
<img src="_static/banner.png" alt="PySurfer logo" height=180px width=600px border="0" />
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="auto_examples/index.html" title="Example gallery"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="intro.html" title="What is PySurfer?"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">PySurfer 0.10.0 documentation</a> »</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Installing and Getting Started</a><ul>
<li><a class="reference internal" href="#dependencies">Dependencies</a></li>
<li><a class="reference internal" href="#getting-started">Getting started</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="intro.html"
title="previous chapter">What is PySurfer?</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="auto_examples/index.html"
title="next chapter">Example gallery</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="installing-and-getting-started">
<span id="install"></span><h1>Installing and Getting Started<a class="headerlink" href="#installing-and-getting-started" title="Permalink to this headline">¶</a></h1>
<p>PySurfer can be installed with <a class="reference external" href="http://pypi.python.org/pypi/pip">pip</a>. Note that the package name on PyPi is different from the library name that you import:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">pysurfer</span>
</pre></div>
</div>
<p>If you already have PySurfer installed, you can also use pip to update it:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">U</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">deps</span> <span class="n">pysurfer</span>
</pre></div>
</div>
<p>If you would like to save movies of time course data, it is necessary to include the optional dependency <code class="docutils literal notranslate"><span class="pre">imageio</span></code> with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">pysurfer</span><span class="p">[</span><span class="n">save_movie</span><span class="p">]</span>
</pre></div>
</div>
<p>If you’d like to install the development version, you have two options. You can
install straight from github:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">api</span><span class="o">.</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">repos</span><span class="o">/</span><span class="n">nipy</span><span class="o">/</span><span class="n">PySurfer</span><span class="o">/</span><span class="n">zipball</span><span class="o">/</span><span class="n">master</span>
</pre></div>
</div>
<p>Or you can clone the <a class="reference external" href="https://github.com/nipy/PySurfer">git repository</a> and
install from your local source directory:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="o">.</span>
</pre></div>
</div>
<div class="section" id="dependencies">
<h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h2>
<p>PySurfer works on Python 2.7 and 3.6+.
(Older Python 3 versions will probably work, but are not tested.)</p>
<p>To use PySurfer, you will need to have the following Python packages:</p>
<ul class="simple">
<li><p><a class="reference external" href="http://www.scipy.org/NumPy">numpy</a></p></li>
<li><p><a class="reference external" href="http://www.scipy.org">scipy</a></p></li>
<li><p><a class="reference external" href="http://nipy.sourceforge.net/nibabel/">nibabel</a></p></li>
<li><p><a class="reference external" href="http://mayavi.sourceforge.net/">mayavi</a></p></li>
<li><p><a class="reference external" href="http://matplotlib.sourceforge.net">matplotlib</a></p></li>
</ul>
<p>Some input/output functions also make use of the Python Imaging Library (<a class="reference external" href="http://www.pythonware.com/products/pil/">PIL</a>)
and <code class="docutils literal notranslate"><span class="pre">imageio</span></code>, although they are not mandatory.</p>
</div>
<div class="section" id="getting-started">
<h2>Getting started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
<p>Because PySurfer relies on some complicated dependencies (Mayavi, VTK and a GUI
library), it can be more difficult to get started with than is the case with
other Python libraries. Consider using the <a class="reference external" href="https://store.continuum.io/cshop/anaconda/">Anaconda</a> distribution
or Enthough <a class="reference external" href="https://www.enthought.com/products/canopy/">Canopy</a> environment. The difficulty on these
platforms is generally getting Mayavi and VTK installed; see their
installation instructions for information.</p>
<p>PySurfer generally works out of the box on Linux systems. Getting started on
OSX may be trickier. We have had success using the Anaconda distribution with
the additional step of setting the environment variables <code class="docutils literal notranslate"><span class="pre">QT_API</span></code> and <code class="docutils literal notranslate"><span class="pre">ETS_TOOLKIT</span></code>, e.g.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">export</span> <span class="n">QT_API</span><span class="o">=</span><span class="n">pyqt</span>
<span class="n">export</span> <span class="n">ETS_TOOLKIT</span><span class="o">=</span><span class="n">qt4</span>
</pre></div>
</div>
<p>The values you set should match the GUI library you are using.</p>
<p>You may wish to consult the <a class="reference external" href="http://docs.enthought.com/mayavi/mayavi/installation.html">Mayavi installation docs</a> if you are having
trouble getting things working.</p>
<p>If you are using PySurfer interactively in <a class="reference external" href="http://ipython.scipy.org">IPython</a>/Jupyter, you should
activate one of the GUI event loops so that the Mayavi window runs in a
separate process. After starting IPython (either in the terminal, qtconsole, or
notebook), you have to activate the correct GUI backend, which is probably qt:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span><span class="n">gui</span> <span class="n">qt</span>
</pre></div>
</div>
<p>This will allow you to have an open PySurfer window while still being able to
execute code in the console/notebook.</p>
<p>It is also possible to embed the PySurfer visualization into a Jupyter notebook.
This is achieved by leveraging <a class="reference external" href="https://docs.enthought.com/mayavi/mayavi/tips.html#using-mayavi-in-jupyter-notebooks">Mayavi’s notebook integration</a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">mayavi</span> <span class="k">import</span> <span class="n">mlab</span>
<span class="n">mlab</span><span class="o">.</span><span class="n">init_notebook</span><span class="p">(</span><span class="n">backend</span><span class="o">=</span><span class="s1">'png'</span><span class="p">)</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">backend</span></code> parameter can either be <code class="docutils literal notranslate"><span class="pre">'png'</span></code> to render the visualization
as a static PNG image, or <code class="docutils literal notranslate"><span class="pre">'x3d'</span></code> to render it using
<a class="reference external" href="https://www.x3dom.org">X3D</a> (still experimental).</p>
<p>If you are having trouble getting started using PySurfer, please describe the problem on the <a class="reference external" href="https://mail.python.org/mailman/listinfo/neuroimaging">nipy mailing list</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="auto_examples/index.html" title="Example gallery"
>next</a> |</li>
<li class="right" >
<a href="intro.html" title="What is PySurfer?"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">PySurfer 0.10.0 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2012-2020, Michael Waskom, Alexandre Gramfort, Scott Burns, Martin Luessi, Eric Larson.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.0.0+/4499fda.
</div>
</body>
</html>