-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwonambi.attr.chan.html
408 lines (379 loc) · 31.2 KB
/
wonambi.attr.chan.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>wonambi.attr.chan module — wonambi 7.11 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="shortcut icon" href="../_static/wonambi.ico"/>
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="wonambi.bids package" href="wonambi.bids.html" />
<link rel="prev" title="wonambi.attr.annotations module" href="wonambi.attr.annotations.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home"> wonambi
<img src="../_static/wonambi.png" class="logo" alt="Logo"/>
</a>
<div class="version">
7.11
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../introduction.html">WONAMBI</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#features">Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#installation">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#run-it">Run it!</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#documentation">Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#change-log">Change Log</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#optional-requirements">Optional Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#status">Status</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#license">License</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation.html#linux-mac-os-x">Linux / Mac OS X</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation.html#windows">Windows</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../analysis/index.html">Tutorial / Analysis</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../analysis/tutorial.html">Get Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../analysis/spectrum.html">Frequency Domain</a></li>
<li class="toctree-l2"><a class="reference internal" href="../analysis/plot3d.html">Plot 3D images</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../cmd.html">Command Line</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../cmd.html#wonambi">wonambi</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cmd.html#won-convert">won_convert</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../gui/index.html">Graphical User Interface</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../gui/open.html">Open Dataset</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gui/labels.html">Edit Labels</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gui/channels.html">Plot Channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gui/traces.html">Navigation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gui/notes.html">Annotations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gui/detect.html">Event detection</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gui/methods.html">Detection methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gui/analysis.html">Analysis console</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gui/screenshot.html">Screenshot</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="wonambi.html">Modules, classes, functions</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="wonambi.html#subpackages">Subpackages</a></li>
<li class="toctree-l2"><a class="reference internal" href="wonambi.html#submodules">Submodules</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../testing.html">Development</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#prepare-test-environment">Prepare Test Environment</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#get-files">1. Get Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#run-the-tests">2. Run the Tests</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#coverage">3. Coverage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#documentation">4. Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#release">5. Release</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#tips-and-tricks">Tips and Tricks</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Change Log</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-7">Version 7</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-6">Version 6</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-5">Version 5</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-4">Version 4</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-3">Version 3</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-2">Version 2</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-1">Version 1</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../todo.html">TODO</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">wonambi</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a></li>
<li class="breadcrumb-item"><a href="wonambi.html">wonambi package</a></li>
<li class="breadcrumb-item"><a href="wonambi.attr.html">wonambi.attr package</a></li>
<li class="breadcrumb-item active">wonambi.attr.chan module</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="module-wonambi.attr.chan">
<span id="wonambi-attr-chan-module"></span><h1>wonambi.attr.chan module<a class="headerlink" href="#module-wonambi.attr.chan" title="Permalink to this heading"></a></h1>
<p>Module to work with channels.</p>
<p>It provides a general class to work with channels. Channels is the general term
that refers to the points where signal comes from, it’s an abstract concept.
Electrodes, magnetometer, axiometers and gradiometers are the actual recording
devices measuring the signal. For example, in the case of EEG, you need two
electrodes to have one signal, where one signal is the difference between the
two electrodes.</p>
<p>In other words, the channel is where you want to plot the signal.</p>
<dl class="py class">
<dt class="sig sig-object py" id="wonambi.attr.chan.Chan">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">wonambi.attr.chan.</span></span><span class="sig-name descname"><span class="pre">Chan</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xyz</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#Chan"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.Chan" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Provide class Chan, for individual channels.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>label</strong> (<em>str</em>) – name of the channel</p></li>
<li><p><strong>xyz</strong> (<em>numpy.ndarray</em><em> or </em><em>list</em><em> or </em><em>tuple</em>) – 1d vector of 3 elements</p></li>
<li><p><strong>chtype</strong> (<em>str</em><em>, </em><em>optional</em>) – channel type (can be any string)</p></li>
<li><p><strong>unit</strong> (<em>str</em><em>, </em><em>optional</em>) – units, using SI</p></li>
<li><p><strong>attr</strong> (<em>dict</em>) – dictionary where you can store additional information per channel. Use
chan.attr.update({‘new_key’: new_value})</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="wonambi.attr.chan.Channels">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">wonambi.attr.chan.</span></span><span class="sig-name descname"><span class="pre">Channels</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#Channels"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.Channels" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Provide class Chan, generic class for channel location.</p>
<p>You can read from a file, and then you pass only one argument.
Or you can directly assign the chan names and the coordinates.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>chan</strong> (<em>list</em><em> of </em><em>instance</em><em> of </em><a class="reference internal" href="#wonambi.attr.chan.Chan" title="wonambi.attr.chan.Chan"><em>Chan</em></a>) – list of channels (which are instances of Chan)</p></li>
<li><p><strong>chan_input</strong> (<em>various formats</em>) – information about the channels</p></li>
<li><p><strong>labels</strong> (<em>list</em><em> of </em><em>str</em>) – the name of the channel</p></li>
<li><p><strong>coords</strong> (<em>numpy.ndarray</em>) – location in 3D, with shape (n_chan, 3)</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="wonambi.attr.chan.Channels.chan">
<span class="sig-name descname"><span class="pre">chan</span></span><a class="headerlink" href="#wonambi.attr.chan.Channels.chan" title="Permalink to this definition"></a></dt>
<dd><p>list of channels</p>
<dl class="field-list simple">
<dt class="field-odd">Type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list of instance of <a class="reference internal" href="#wonambi.attr.chan.Chan" title="wonambi.attr.chan.Chan">wonambi.attr.chan.Chan</a></p>
</dd>
</dl>
</dd></dl>
<dl class="field-list simple">
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="wonambi.utils.exceptions.html#wonambi.utils.exceptions.UnrecognizedFormat" title="wonambi.utils.exceptions.UnrecognizedFormat"><strong>UnrecognizedFormat</strong></a> – If the format is not recognized</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>chan_input can be a csv file without header and with format:
label, x-pos, y-pos, z-pos
or an sfp file without header and with format:
label x-pos y-pos z-pos</p>
<dl class="py method">
<dt class="sig sig-object py" id="wonambi.attr.chan.Channels.export">
<span class="sig-name descname"><span class="pre">export</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">elec_file</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#Channels.export"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.Channels.export" title="Permalink to this definition"></a></dt>
<dd><p>Export channel name and location to file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>elec_file</strong> (<a class="reference internal" href="wonambi.widgets.utils.html#wonambi.widgets.utils.Path" title="wonambi.widgets.utils.Path"><em>Path</em></a><em> or </em><em>str</em>) – path to file where to save csv</p>
</dd>
</dl>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="wonambi.attr.chan.Channels.n_chan">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">n_chan</span></span><a class="headerlink" href="#wonambi.attr.chan.Channels.n_chan" title="Permalink to this definition"></a></dt>
<dd><p>Returns the number of channels.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="wonambi.attr.chan.Channels.return_attr">
<span class="sig-name descname"><span class="pre">return_attr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">labels</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#Channels.return_attr"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.Channels.return_attr" title="Permalink to this definition"></a></dt>
<dd><p>return the attributes for each channels.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>attr</strong> (<em>str</em>) – attribute specified in Chan.attr.keys()</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="wonambi.attr.chan.Channels.return_label">
<span class="sig-name descname"><span class="pre">return_label</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#Channels.return_label"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.Channels.return_label" title="Permalink to this definition"></a></dt>
<dd><p>Returns the labels for all the channels.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p><em>list of str</em> – list of the channel labels.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="wonambi.attr.chan.Channels.return_xy">
<span class="sig-name descname"><span class="pre">return_xy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">labels</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#Channels.return_xy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.Channels.return_xy" title="Permalink to this definition"></a></dt>
<dd><p>Returns the location in xy for some channels.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>labels</strong> (<em>list</em><em> of </em><em>str</em><em>, </em><em>optional</em>) – the names of the channels.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><em>numpy.ndarray</em> – a 2xn vector with the position of a channel.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>Simplest implementation. We should at least use project onto a 2D plane</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="wonambi.attr.chan.Channels.return_xyz">
<span class="sig-name descname"><span class="pre">return_xyz</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">labels</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#Channels.return_xyz"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.Channels.return_xyz" title="Permalink to this definition"></a></dt>
<dd><p>Returns the location in xy for some channels.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>labels</strong> (<em>list</em><em> of </em><em>str</em><em>, </em><em>optional</em>) – the names of the channels.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><em>numpy.ndarray</em> – a 3xn vector with the position of a channel.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="wonambi.attr.chan.assign_region_to_channels">
<span class="sig-prename descclassname"><span class="pre">wonambi.attr.chan.</span></span><span class="sig-name descname"><span class="pre">assign_region_to_channels</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">channels</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">anat</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parc_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'aparc'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_approx</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exclude_regions</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#assign_region_to_channels"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.assign_region_to_channels" title="Permalink to this definition"></a></dt>
<dd><p>Assign a brain region based on the channel location.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>channels</strong> (<em>instance</em><em> of </em><a class="reference internal" href="#wonambi.attr.chan.Channels" title="wonambi.attr.chan.Channels"><em>wonambi.attr.chan.Channels</em></a>) – channels to assign regions to</p></li>
<li><p><strong>anat</strong> (<em>instance</em><em> of </em><a class="reference internal" href="wonambi.attr.anat.html#wonambi.attr.anat.Freesurfer" title="wonambi.attr.anat.Freesurfer"><em>wonambi.attr.anat.Freesurfer</em></a>) – anatomical information taken from freesurfer.</p></li>
<li><p><strong>parc_type</strong> (<em>str</em>) – ‘aparc’, ‘aparc.a2009s’, ‘BA’, ‘BA.thresh’, or ‘aparc.DKTatlas40’
‘aparc.DKTatlas40’ is only for recent freesurfer versions</p></li>
<li><p><strong>max_approx</strong> (<em>int</em><em>, </em><em>optional</em>) – approximation to define position of the electrode.</p></li>
<li><p><strong>exclude_regions</strong> (<em>list</em><em> of </em><em>str</em><em> or </em><em>empty list</em>) – do not report regions if they contain these substrings. None means
that it does not exclude any region. For example, to exclude white
matter regions and unknown regions you can use
exclude_regions=(‘White’, ‘WM’, ‘Unknown’)</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><em>instance of wonambi.attr.chan.Channels</em> – same instance as before, now Chan have attr ‘region’</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="wonambi.attr.chan.create_sphere_around_elec">
<span class="sig-prename descclassname"><span class="pre">wonambi.attr.chan.</span></span><span class="sig-name descname"><span class="pre">create_sphere_around_elec</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xyz</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">template_mri</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">distance</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">8</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">freesurfer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#create_sphere_around_elec"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.create_sphere_around_elec" title="Permalink to this definition"></a></dt>
<dd><p>Create an MRI mask around an electrode location,</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xyz</strong> (<em>ndarray</em>) – 3x0 array</p></li>
<li><p><strong>template_mri</strong> (<em>path</em><em> or </em><em>str</em><em> (</em><em>as path</em><em>) or </em><em>nibabel.Nifti</em>) – (path to) MRI to be used as template</p></li>
<li><p><strong>distance</strong> (<em>float</em>) – distance in mm between electrode and selected voxels</p></li>
<li><p><strong>freesurfer</strong> (<em>instance</em><em> of </em><a class="reference internal" href="wonambi.attr.anat.html#wonambi.attr.anat.Freesurfer" title="wonambi.attr.anat.Freesurfer"><em>Freesurfer</em></a>) – to adjust RAS coordinates, see Notes</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><em>3d bool ndarray</em> – mask where True voxels are within selected distance to the electrode</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>Freesurfer uses two coordinate systems: one for volumes (“RAS”) and one for
surfaces (“tkReg”, “tkRAS”, and “Surface RAS”), so the electrodes might be
stored in one of the two systems. If the electrodes are in surface
coordinates (f.e. if you can plot surface and electrodes in the same space),
then you need to convert the coordinate system. This is done by passing an
instance of Freesurfer.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="wonambi.attr.chan.detect_format">
<span class="sig-prename descclassname"><span class="pre">wonambi.attr.chan.</span></span><span class="sig-name descname"><span class="pre">detect_format</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#detect_format"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.detect_format" title="Permalink to this definition"></a></dt>
<dd><p>Detect file format of the channels based on extension.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>filename</strong> (<a class="reference internal" href="wonambi.widgets.utils.html#wonambi.widgets.utils.Path" title="wonambi.widgets.utils.Path"><em>Path</em></a>) – name of the filename</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><em>str</em> – file format</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="wonambi.attr.chan.find_chan_in_region">
<span class="sig-prename descclassname"><span class="pre">wonambi.attr.chan.</span></span><span class="sig-name descname"><span class="pre">find_chan_in_region</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">channels</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">anat</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">region_name</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#find_chan_in_region"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.find_chan_in_region" title="Permalink to this definition"></a></dt>
<dd><p>Find which channels are in a specific region.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>channels</strong> (<em>instance</em><em> of </em><a class="reference internal" href="#wonambi.attr.chan.Channels" title="wonambi.attr.chan.Channels"><em>wonambi.attr.chan.Channels</em></a>) – channels, that have locations</p></li>
<li><p><strong>anat</strong> (<em>instance</em><em> of </em><a class="reference internal" href="wonambi.attr.anat.html#wonambi.attr.anat.Freesurfer" title="wonambi.attr.anat.Freesurfer"><em>wonambi.attr.anat.Freesurfer</em></a>) – anatomical information taken from freesurfer.</p></li>
<li><p><strong>region_name</strong> (<em>str</em>) – the name of the region, according to FreeSurferColorLUT.txt</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>chan_in_region</strong> (<em>list of str</em>) – list of the channels that are in one region.</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="wonambi.attr.chan.find_channel_groups">
<span class="sig-prename descclassname"><span class="pre">wonambi.attr.chan.</span></span><span class="sig-name descname"><span class="pre">find_channel_groups</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chan</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/wonambi/attr/chan.html#find_channel_groups"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#wonambi.attr.chan.find_channel_groups" title="Permalink to this definition"></a></dt>
<dd><p>Channels are often organized in groups (different grids / strips or
channels in different brain locations), so we use a simple heuristic to
get these channel groups.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>chan</strong> (<em>instance</em><em> of </em><a class="reference internal" href="#wonambi.attr.chan.Channels" title="wonambi.attr.chan.Channels"><em>Channels</em></a>) – channels to group</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>groups</strong> (<em>dict</em>) – channel groups: key is the common string, and the item is a list of
labels</p>
</dd>
</dl>
</dd></dl>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="wonambi.attr.annotations.html" class="btn btn-neutral float-left" title="wonambi.attr.annotations module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="wonambi.bids.html" class="btn btn-neutral float-right" title="wonambi.bids package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2013-2022, Gio Piantoni / Jordan O'Byrne.</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(false);
});
</script>
</body>
</html>