-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorials.html
More file actions
282 lines (252 loc) · 9.04 KB
/
tutorials.html
File metadata and controls
282 lines (252 loc) · 9.04 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, minimum-scale=0.5, maximum-scale=5"
/>
<script>
const isAutoTheme = false;
document.documentElement.setAttribute("data-theme", "light");
</script>
<script defer src="/assets/js/main.min.js"></script>
<script defer src="/assets/js/navigation.js"></script>
<link rel="stylesheet" href="/assets/css/main.css" />
<link rel="stylesheet" href="/assets/css/common.css" />
<!-- Prism.js for syntax highlighting -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js"></script>
<title>Tutorials | Fish1 Release</title>
<!-- Python code style with syntax highlighting -->
<style>
pre[class*="language-"] {
background: #2d2d30;
border-radius: 8px;
padding: 1.2rem;
margin: 1rem 0;
overflow-x: auto;
font-size: 0.9rem;
line-height: 1.6;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
code[class*="language-"] {
font-family: "Fira Code", "Consolas", "Monaco", monospace;
text-shadow: none;
}
/* Inline code */
:not(pre) > code {
background: #f5f5f5;
color: #c7254e;
padding: 0.2em 0.4em;
border-radius: 4px;
font-family: "Fira Code", monospace;
font-size: 0.9em;
}
/* Results display style */
.code-results {
background: #f8f9fa;
border-left: 4px solid #28a745;
padding: 1rem 1.2rem;
margin: 1rem 0;
border-radius: 4px;
font-family: "Fira Code", "Consolas", monospace;
font-size: 0.9rem;
line-height: 1.6;
}
.code-results::before {
content: "Output:";
display: block;
font-weight: bold;
color: #28a745;
margin-bottom: 0.5rem;
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.code-results code {
background: transparent;
color: #212529;
padding: 0;
font-size: 0.9em;
}
@media (prefers-color-scheme: dark) {
:not(pre) > code {
background: #2d2d2d;
color: #f08d49;
}
.code-results {
background: #1e1e1e;
border-left-color: #4caf50;
}
.code-results::before {
color: #4caf50;
}
.code-results code {
color: #dcdcdc;
}
}
</style>
</head>
<body>
<header class="site-header">
<div class="branding">
<a class="site-title" aria-label="Fish1 Release" href="/">
Fish1 Release
</a>
</div>
</header>
<div class="content">
<article class="feature-image">
<header
id="main"
style="background-image: url('/assets/img/fish1_banner.png')"
>
<div class="title-padder">
<h1 class="title">Tutorials</h1>
</div>
</header>
<section class="post-content">
<h2 id="tutorials">Programmatic Access to Fish1 Dataset</h2>
<p>
These tutorials guide you through using the
<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10402030/"
>CAVE (Connectome Annotation and Versioning Engine)</a
>
to access and analyze the <strong>Fish1 dataset</strong>.
</p>
<p>
The links below open in the Jupyter Notebook viewer (read-only). To
execute code, download the notebooks from
<a href="https://github.com/VCG/cave-scripts" target="_blank"
>VCG/cave-scripts</a
>
or run them directly in
<a href="https://colab.research.google.com" target="_blank"
>Google Colab</a
>.
</p>
<h3>Setup CAVE</h3>
<p><strong>Local Machine</p></strong>
<ul>
<li>
Download example notebooks from the repository:
<img src="/assets/img/tutorials/github_download.png" alt="" />
</li>
<li>
Install the CAVE client:
Please refer to the <a href="https://github.com/VCG/cave-scripts" target="_blank">cave-scripts page</a> for more details.
<!-- <pre><code class="language-python">pip install caveclient</code></pre> -->
</li>
<li>
Configure your credentials following the
<a
href="https://github.com/seung-lab/CAVEclient"
target="_blank"
>CAVEclient documentation</a
>.
</li>
</ul>
<p><strong>Google Colab</strong></p>
<ol>
<li>
Go to <strong>File → Open Notebook → GitHub</strong> (at the left panel).
<img src="/assets/img/tutorials/github_import.png" alt="" />
</li>
<li>
Search for:
<i>VCG/cave-scripts</i> and open
<i>notebooks/fish1/Setup_CAVE.ipynb</i>.
</li>
<li>
Add code cell and type command to install the CAVEclient package:
<pre><code class="language-python">!pip install caveclient</code></pre>
</li>
</ol>
<h3>Upload your Annotation Table</h3>
<ul>
<li>
Choose a data <a href="https://global.brain-wire-test.org/schema/views/" target="_blank">schema</a> and <a
href="https://nbviewer.org/github/VCG/cave-scripts/blob/master/notebooks/fish1/Create_Tables.ipynb" target="_blank"
>create</a> an annotation table.
</li>
<li>
<a
href="https://nbviewer.org/github/VCG/cave-scripts/blob/master/notebooks/fish1/Upload_Data.ipynb" target="_blank"
>Upload</a>
your custom annotations to the table.
</li>
</ul>
<h3>Query the Dataset</h3>
<ul>
<li>
<a
href="https://nbviewer.org/github/VCG/cave-scripts/blob/master/notebooks/fish1/Query_Materializtion.ipynb" target="_blank"
>Query</a
>
data from materialized annotation table.
</li>
<li>
Explore and analyze <a
href="https://nbviewer.org/github/VCG/cave-scripts/blob/master/notebooks/fish1/Query_Synapses.ipynb" target="_blank"
>synapses</a
> querying by pre-synaptic or post-synaptic cells.
</li>
</ul>
<h3>Use Cases</h3>
<ul>
<li>
<a
href="https://github.com/VCG/cave-scripts/blob/master/notebooks/fish1/Use_Cases.ipynb" target="_blank"
>Lookup</a
> Root ID by Coordinates
<pre><code class="language-python">def get_latest_root_id(x, y, z):
supervoxel_id = cv.download_point(pt=(x, y, z),
size=1,
agglomerate=False,
coord_resolution=resolution)
supervoxel_id = np.int64(supervoxel_id[0, 0, 0, 0])
print(f"supervoxel_id: {supervoxel_id}")
root_id = cggraph.get_root_id(supervoxel_id)
print(f"root_id: {root_id}")
is_latest = cggraph.is_latest_roots([root_id])
if not is_latest:
latest_root_id = cggraph.get_latest_roots(root_id)
print(f"latest_root_id: {latest_root_id}")
else:
latest_root_id = root_id
print("root_id is the latest")
return supervoxel_id, root_id, latest_root_id</code></pre>
<p>Example:</p>
<pre><code class="language-python">supervoxel_id, root_id, latest_root_id = get_latest_root_id(37880, 22443, 4595)</code></pre>
<div class="code-results">
<code>Decompressing: 100%|██████████| 1/1 [00:00<00:00, 389.84it/s] <br />
supervoxel_id: 82407780375333845 <br />
root_id: 864691128652664051 <br />
root_id is the latest</code>
</div>
</li>
<!-- <li>Lookup Latest Root ID
<pre><code class="language-python">
old_root_id = 123456789
latest_root = client.chunkedgraph.get_latest_roots([old_root_id])
print("Latest root ID:", latest_root[0])
</code></pre>
</li> -->
</ul>
</section>
<div class="tag-list"></div>
</article>
</div>
<footer class="site-footer">
<p class="text">
Powered by <a href="https://jekyllrb.com/">Jekyll</a> with
<a href="https://github.com/sylhare/Type-on-Strap">Type on Strap</a>
</p>
<div class="footer-icons">
<ul></ul>
</div>
</footer>
</body>
</html>