-
Notifications
You must be signed in to change notification settings - Fork 0
/
preprocessing.html
220 lines (208 loc) · 14.5 KB
/
preprocessing.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
<!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>Pre-Processing Query Results — CoCoTools 0.0.1 documentation</title>
<link rel="stylesheet" href="_static/sphinxdoc.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.0.1',
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>
<link rel="top" title="CoCoTools 0.0.1 documentation" href="index.html" />
<link rel="up" title="Processing Pipeline in Detail" href="details.html" />
<link rel="next" title="Applying Coordinate-Free Registration" href="coordinatefreereg.html" />
<link rel="prev" title="Querying" href="querying.html" />
</head>
<body>
<div class="related">
<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 class="right" >
<a href="coordinatefreereg.html" title="Applying Coordinate-Free Registration"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="querying.html" title="Querying"
accesskey="P">previous</a> |</li>
<li><a href="index.html">CoCoTools 0.0.1 documentation</a> »</li>
<li><a href="documentation.html" >CoCoTools’s documentation</a> »</li>
<li><a href="details.html" accesskey="U">Processing Pipeline in Detail</a> »</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Pre-Processing Query Results</a><ul>
<li><a class="reference internal" href="#do-you-need-to-pre-process">Do you need to Pre-Process?</a></li>
<li><a class="reference internal" href="#pre-processing-steps">Pre-Processing Steps</a></li>
<li><a class="reference internal" href="#clean-the-mapping-data">1. Clean the mapping data</a></li>
<li><a class="reference internal" href="#remove-hierarchies-from-the-output-space">2. Remove hierarchies from the output space</a></li>
<li><a class="reference internal" href="#deduce-new-mapping-relationships">3. Deduce new mapping relationships</a></li>
<li><a class="reference internal" href="#full-pre-processing-example">Full Pre-Processing Example</a></li>
<li><a class="reference internal" href="#references">References</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="querying.html"
title="previous chapter">Querying</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="coordinatefreereg.html"
title="next chapter">Applying Coordinate-Free Registration</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/preprocessing.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<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">
<div class="section" id="pre-processing-query-results">
<h1>Pre-Processing Query Results<a class="headerlink" href="#pre-processing-query-results" title="Permalink to this headline">¶</a></h1>
<div class="section" id="do-you-need-to-pre-process">
<span id="detail-preproc"></span><h2>Do you need to Pre-Process?<a class="headerlink" href="#do-you-need-to-pre-process" title="Permalink to this headline">¶</a></h2>
<p>For users just interested in interrogating query results from a specific study or set of studies, the MapGraph and ConGraphs derived from querying is all that you may need.</p>
<p>However, most most users’ ultimate goal with CoCoTools will be to agregate connectivity results from several studies into a single connectivity matrix.
In this case, the mapping and connectivity data that was gathered during the query step, will serve as input to CoCoTools’ coordinate-free registration machinery.</p>
<p>For the best registration outcomes, users will need to <em>pre-process</em> this mapping and connectivity input data.</p>
</div>
<div class="section" id="pre-processing-steps">
<h2>Pre-Processing Steps<a class="headerlink" href="#pre-processing-steps" title="Permalink to this headline">¶</a></h2>
<p>Pre-Processing is performed in three steps in CoCoTools</p>
</div>
<div class="section" id="clean-the-mapping-data">
<h2>1. Clean the mapping data<a class="headerlink" href="#clean-the-mapping-data" title="Permalink to this headline">¶</a></h2>
<p>We have identified various ommisions and errors in the CoCoMac database. You can fix these issues using:</p>
<blockquote>
<div><a class="reference internal" href="api.html#cocotools.MapGraph.clean_data" title="cocotools.MapGraph.clean_data"><tt class="xref py py-meth docutils literal"><span class="pre">cocotools.MapGraph.clean_data()</span></tt></a></div></blockquote>
<p>This process is a method of <a class="reference internal" href="api.html#cocotools.MapGraph" title="cocotools.MapGraph"><tt class="xref py py-class docutils literal"><span class="pre">cocotools.MapGraph</span></tt></a> . It adds and removes specific edges from your mapgraph. It only fixes issues we have identified. <em>To see the list of edges, and our comments, view the mapgraph.py</em></p>
<p><strong>Example</strong>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">mapg</span><span class="o">.</span><span class="n">clean_data</span><span class="p">()</span> <span class="c">#mapg is the name of your MapGraph</span>
</pre></div>
</div>
</div>
<div class="section" id="remove-hierarchies-from-the-output-space">
<h2>2. Remove hierarchies from the output space<a class="headerlink" href="#remove-hierarchies-from-the-output-space" title="Permalink to this headline">¶</a></h2>
<p>The coordinate-free registration algorithms that we have implemented require that the output data is represented at one resolution and that all regions within the output map are mutually disjoint (lest the algorithm crashes or produce errors). This is not the case for many studies in CoCoMac.
Thus you will want to run the following <a class="reference internal" href="api.html#cocotools.MapGraph" title="cocotools.MapGraph"><tt class="xref py py-class docutils literal"><span class="pre">cocotools.MapGraph</span></tt></a> method to ensure that hierarchies and overlaps are removed:</p>
<blockquote>
<div><a class="reference internal" href="api.html#cocotools.MapGraph.keep_only_one_level_of_resolution" title="cocotools.MapGraph.keep_only_one_level_of_resolution"><tt class="xref py py-meth docutils literal"><span class="pre">cocotools.MapGraph.keep_only_one_level_of_resolution()</span></tt></a></div></blockquote>
<p>To resolve this problem, this MapGraph method:</p>
<ul class="simple">
<li>builds a hierarchy for each map based on its spatial relationships</li>
<li>removes from each map all but one level of resolution. This ensures that the areas kept in the graph are disjoint.</li>
<li>By default, this command keeps the level with the most anatomical connections, and then translates connections from the other levels to the one that is retained.</li>
<li>takes as input, a <a class="reference internal" href="api.html#cocotools.ConGraph" title="cocotools.ConGraph"><tt class="xref py py-class docutils literal"><span class="pre">cocotools.ConGraph</span></tt></a> , <em>TargetMap</em></li>
</ul>
<p><strong>Example</strong>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cong</span><span class="o">=</span><span class="n">mapg</span><span class="o">.</span><span class="n">keep_only_one_level_of_resolution</span><span class="p">(</span><span class="n">cong</span><span class="p">,</span> <span class="s">'PHT00'</span><span class="p">)</span> <span class="c">#'PHT00' is the space we want to register to (i.e. output space)</span>
</pre></div>
</div>
</div>
<div class="section" id="deduce-new-mapping-relationships">
<h2>3. Deduce new mapping relationships<a class="headerlink" href="#deduce-new-mapping-relationships" title="Permalink to this headline">¶</a></h2>
<p>Only a fraction of all possible mapping relationships have been explicitly stated in the literature and recorded in CoCoMac. However, a very large set of new mapping relationships can be logically deduced using these mapping relationships.
This process is explained by Stephan et al. (2000)[1]_ . After making the insight that spatial relationships between areas can be represented as a mathematical graph (as in the MapGraph), Stephan et al. (2000) applied a classic technique from graph theory, Floyd’s algorithm (Floyd, 1962), to infer chains of relationships among brain areas. Depending on the relationships in each chain, they can be used to deduce a single RC between the area at the beginning of each chain and the one at the end.
CoCoTools implements this procedure (and updates from Kotter & Wanke, 2005)[2]_ with the:</p>
<blockquote>
<div><a class="reference internal" href="api.html#cocotools.MapGraph.deduce_edges" title="cocotools.MapGraph.deduce_edges"><tt class="xref py py-meth docutils literal"><span class="pre">cocotools.MapGraph.deduce_edges()</span></tt></a></div></blockquote>
<p>Chains of relationships can be reduced to single RCs with variable levels of ambiguity, but in CoCoTools we allow new relationships to be added to the graph only in unambiguous cases. When different chains imply a relationship between the same two areas, we keep the RC implied by the chain with the fewest areas.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">The <strong>deduce_edges</strong> step can take a very long time to run. With the entire CoCoMac corpus, it can take <strong>days</strong> to run on standard laptop computers (as of 2012). Floyd’s algorithm requires approximately N<sup>3</sup> computations, with N being the number of nodes.
However this step is essential; adding a huge number of unstated mapping relationships (numbering in the hundreds of thousands).
Without these deduced relationships, many translations would be impossible.</p>
</div>
<p><strong>Example</strong>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">mapg</span><span class="o">.</span><span class="n">deduce_edges</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="full-pre-processing-example">
<h2>Full Pre-Processing Example<a class="headerlink" href="#full-pre-processing-example" title="Permalink to this headline">¶</a></h2>
<p>Here is a quick example that puts all the cocotools pre-processing commands together:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">mapg</span><span class="o">.</span><span class="n">clean_data</span><span class="p">()</span>
<span class="n">cong</span><span class="o">=</span><span class="n">mapg</span><span class="o">.</span><span class="n">keep_only_one_level_of_resolution</span><span class="p">(</span><span class="n">cong</span><span class="p">,</span> <span class="s">'PHT00'</span><span class="p">)</span>
<span class="n">mapg</span><span class="o">.</span><span class="n">deduce_edges</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="references">
<h2>References<a class="headerlink" href="#references" title="Permalink to this headline">¶</a></h2>
<table class="docutils footnote" frame="void" id="id1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td>Stephan, K E, Zilles, K., & Kotter, R. (2000). Coordinate-independent mapping of structural and functional data by objective relational transformation (ORT). Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 355(1393), 37 thru 54.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id2" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[2]</td><td>Kotter, R., & Wanke, E. (2005). Mapping brains without coordinates. Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 360(1456), 751 thru 766.</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<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 class="right" >
<a href="coordinatefreereg.html" title="Applying Coordinate-Free Registration"
>next</a> |</li>
<li class="right" >
<a href="querying.html" title="Querying"
>previous</a> |</li>
<li><a href="index.html">CoCoTools 0.0.1 documentation</a> »</li>
<li><a href="documentation.html" >CoCoTools’s documentation</a> »</li>
<li><a href="details.html" >Processing Pipeline in Detail</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2011, Daniel Bliss, Rob Blumenfeld and Fernando Perez.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>