-
Notifications
You must be signed in to change notification settings - Fork 39
/
Settings.html
239 lines (204 loc) · 13.6 KB
/
Settings.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ClearMap.Settings — ClearMap 0.9.2 documentation</title>
<link rel="stylesheet" href="../../_static/clearmap.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '0.9.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</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/copybutton.js"></script>
<link rel="top" title="ClearMap 0.9.2 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
<script type="text/javascript">
// intelligent scrolling of the sidebar content
$(window).scroll(function() {
var sb = $('.sphinxsidebarwrapper');
var win = $(window);
var sbh = sb.height();
var offset = $('.sphinxsidebar').position()['top'];
var wintop = win.scrollTop();
var winbot = wintop + win.innerHeight();
var curtop = sb.position()['top'];
var curbot = curtop + sbh;
// does sidebar fit in window?
if (sbh < win.innerHeight()) {
// yes: easy case -- always keep at the top
sb.css('top', $u.min([$u.max([0, wintop - offset - 10]),
$(document).height() - sbh - 200]));
} else {
// no: only scroll if top/bottom edge of sidebar is at
// top/bottom edge of window
if (curtop > wintop && curbot > winbot) {
sb.css('top', $u.max([wintop - offset - 10, 0]));
} else if (curtop < wintop && curbot < winbot) {
sb.css('top', $u.min([winbot - sbh - offset - 20,
$(document).height() - sbh - 200]));
}
}
});
</script>
</head>
<body role="document">
<div style="background-color: #e2e8e9; text-align: left; padding: 10px 10px 15px 15px">
<p style="font-size: 30px; color: color: #11557C"> <a href="../../index.html" style="color: #11557C; font-weight: bold">ClearMap iDISCO+ Toolbox Documentation</a></p>
<a href="../../index.html"><img src="../../_static/brain_bw_small.jpg" height=50px width=150% border="0" alt="ClearMap"/></a>
</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="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">home</a>| </li>
<li><a href="../../search.html">search</a>| </li>
<li><a href="../../api/ClearMap.html">documentation </a> »</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</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 class="toctree-l1"><a class="reference internal" href="../../introduction.html">Overview of ClearMap</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../imageanalysis.html">ClearMap Image Analysis Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../roadmap.html">Roadmap</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../issues.html">Issues</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../api/ClearMap.html">ClearMap package</a></li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</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">
<h1>Source code for ClearMap.Settings</h1><div class="highlight"><pre>
<span class="c"># -*- coding: utf-8 -*-</span>
<span class="sd">"""</span>
<span class="sd">Module to set *ClearMap's* internal parameter and paths to external programs.</span>
<span class="sd">Notes:</span>
<span class="sd"> Edit the :func:`setup` routine to point to the ilastik and elastix paths </span>
<span class="sd"> for specific hosts</span>
<span class="sd">See Also:</span>
<span class="sd"> * :const:`IlastikPath`</span>
<span class="sd"> * :const:`ElastixPath`</span>
<span class="sd"> * :mod:`~ClearMap.Parameter`</span>
<span class="sd">"""</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">socket</span>
<span class="n">IlastikPath</span> <span class="o">=</span> <span class="s">'/usr/local/ilastik-1.1.9-Linux'</span><span class="p">;</span>
<span class="sd">"""str: Absolute path to the Ilastik 0.5 installation</span>
<span class="sd">Notes:</span>
<span class="sd"> `Ilastik Webpage <http://ilastik.org/>`_</span>
<span class="sd"> </span>
<span class="sd"> `Ilastik 0.5 Download <http://old.ilastik.org/>`_</span>
<span class="sd">"""</span>
<span class="c">#path to eastix installation</span>
<span class="n">ElastixPath</span> <span class="o">=</span> <span class="s">'/usr/local/elastix'</span><span class="p">;</span>
<span class="sd">"""str: Absolue path to the elastix installation</span>
<span class="sd">Notes:</span>
<span class="sd"> `Elastix Webpage <http://elastix.isi.uu.nl/>`_</span>
<span class="sd">"""</span>
<div class="viewcode-block" id="setup"><a class="viewcode-back" href="../../api/ClearMap.Settings.html#ClearMap.Settings.setup">[docs]</a><span class="k">def</span> <span class="nf">setup</span><span class="p">():</span>
<span class="sd">"""Setup ClearMap for specific hosts</span>
<span class="sd"> </span>
<span class="sd"> Notes:</span>
<span class="sd"> Edit this routine to include special setttings for specific hosts</span>
<span class="sd"> </span>
<span class="sd"> See Also:</span>
<span class="sd"> :const:`IlastikPath`, :const:`ElastixPath`</span>
<span class="sd"> """</span>
<span class="k">global</span> <span class="n">IlastikPath</span><span class="p">,</span> <span class="n">ElastixPath</span>
<span class="n">hostname</span> <span class="o">=</span> <span class="n">socket</span><span class="o">.</span><span class="n">gethostname</span><span class="p">();</span>
<span class="k">if</span> <span class="n">hostname</span> <span class="o">==</span> <span class="s">'kagalaska.nld'</span><span class="p">:</span> <span class="c">#Christophs Laptop </span>
<span class="n">IlastikPath</span> <span class="o">=</span> <span class="s">'/home/ckirst/programs/ilastik-1.1.9-Linux'</span><span class="p">;</span>
<span class="n">ElastixPath</span> <span class="o">=</span> <span class="s">'/home/ckirst/programs/elastix/'</span><span class="p">;</span>
<span class="k">elif</span> <span class="n">hostname</span> <span class="o">==</span> <span class="s">'mtllab-Ubuntu'</span><span class="p">:</span> <span class="c">#MTL workstation</span>
<span class="n">IlastikPath</span> <span class="o">=</span> <span class="s">'/usr/local/ilastik-1.1.9-Linux'</span><span class="p">;</span>
<span class="n">ElastixPath</span> <span class="o">=</span> <span class="s">'/usr/local/elastix'</span><span class="p">;</span>
<span class="c">## insert your hostname specific settings here ##</span>
<span class="c">#elif hostname == 'your-host-name':</span>
<span class="c"># IlastikPath = 'path-to-ilastik';</span>
<span class="c"># ElastixPath = 'path-to-elastix'; </span>
<span class="c">##</span>
<span class="c"># check existence:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">ElastixPath</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">ElastixPath</span><span class="p">):</span>
<span class="c">#raise RuntimeWarning('Settings: elastix path %s does not exists, cf. Settings.py or type help(Settings) for details.' % ElastixPath);</span>
<span class="k">print</span> <span class="s">'Settings: elastix path </span><span class="si">%s</span><span class="s"> does not exists, cf. Settings.py or type help(Settings) for details.'</span> <span class="o">%</span> <span class="n">ElastixPath</span><span class="p">;</span>
<span class="n">ElastixPath</span> <span class="o">=</span> <span class="bp">None</span><span class="p">;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">IlastikPath</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">IlastikPath</span><span class="p">):</span>
<span class="c">#raise RuntimeWarning('Settings: ilastik path %s does not exists, cf. Settings.py or type help(Settings) for details.' % IlastikPath);</span>
<span class="k">print</span> <span class="s">'Settings: ilastik path </span><span class="si">%s</span><span class="s"> does not exists, cf. Settings.py or type help(Settings) for details.'</span> <span class="o">%</span> <span class="n">IlastikPath</span><span class="p">;</span>
<span class="n">IlastikPath</span> <span class="o">=</span> <span class="bp">None</span><span class="p">;</span></div>
<span class="n">setup</span><span class="p">();</span>
<div class="viewcode-block" id="clearMapPath"><a class="viewcode-back" href="../../api/ClearMap.Settings.html#ClearMap.Settings.clearMapPath">[docs]</a><span class="k">def</span> <span class="nf">clearMapPath</span><span class="p">():</span>
<span class="sd">"""Returns root path to the ClearMap software</span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> str: root path to ClearMap</span>
<span class="sd"> """</span>
<span class="n">fn</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">__file__</span><span class="p">)</span>
<span class="n">fn</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">fn</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
<span class="k">return</span> <span class="n">fn</span><span class="p">;</span></div>
<span class="n">ClearMapPath</span> <span class="o">=</span> <span class="n">clearMapPath</span><span class="p">();</span>
<span class="sd">"""str: Absolute path to the ClearMap root folder"""</span>
</pre></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="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">home</a>| </li>
<li><a href="../../search.html">search</a>| </li>
<li><a href="../../api/ClearMap.html">documentation </a> »</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2016 Christoph Kirst.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
</body>
</html>