forked from r03ert0/thresholdmann
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
247 lines (225 loc) · 9.29 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Thresholdmann</title>
<link
rel="icon"
sizes="any"
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='5' fill='LightPink'/%3E%3C/svg%3E"
>
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:100,500" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat:200,500" rel="stylesheet">
</head>
<body>
<div id="header">
<!-- Top-right menu bar -->
<div id="menu">
<a href="doc.html" target="_blank"><img id="doc" class="button" title="documentation" src="img/doc.svg"/></a>
<a href="https://github.com/neuroanatomy/thresholdmann/issues" target="_blank"><img id="bug" class="button" title="report a bug" src="img/bug.svg"/></a>
<a href="https://github.com/neuroanatomy/thresholdmann" target="_blank"><img id="github" class="button" title="join our github project" style="width:15px;height:15px" src="img/github.svg"/></a>
</div>
<!-- Left-top logo -->
<div style="display:inline-block;margin:10px;">
<a href="https://neuroanatomy.github.io" target="_blank" ><img src="./img/naat-bw.svg" style="width:46px;position:relative;top:-7px;" /></a>
<a href="/" style="text-decoration:none;">
<span style="font-family: 'Montserrat', sans-serif;color:white;font-size:24px; font-weight:200;padding-left:6px;vertical-align:top;">Thresholdmann</span>
</a>
</div>
</div>
<!-- Upload box -->
<div id="upload-box" class="init">
<div class="box_input">
<svg class="box_icon" xmlns="http://www.w3.org/2000/svg" width="50" height="43" viewbox="0 0 50 43">
<path d="M48.4 26.5c-.9 0-1.7.7-1.7 1.7v11.6h-43.3v-11.6c0-.9-.7-1.7-1.7-1.7s-1.7.7-1.7 1.7v13.2c0 .9.7 1.7 1.7 1.7h46.7c.9 0 1.7-.7 1.7-1.7v-13.2c0-1-.7-1.7-1.7-1.7zm-24.5 6.1c.3.3.8.5 1.2.5.4 0 .9-.2 1.2-.5l10-11.6c.7-.7.7-1.7 0-2.4s-1.7-.7-2.4 0l-7.1 8.3v-25.3c0-.9-.7-1.7-1.7-1.7s-1.7.7-1.7 1.7v25.3l-7.1-8.3c-.7-.7-1.7-.7-2.4 0s-.7 1.7 0 2.4l10 11.6z"></path>
</svg>
<br />
<strong id="loadNifti" class="mui mui-push mui-no-border" style="font-weight:500;font-size:16px">Choose</strong> a .nii.gz or a .nii file or drag it here. <br/><br/>
Or try with this <strong id="loadDemoData" class="mui mui-push mui-no-border" style="font-weight:500;font-size:16px">MRI from a Sloth bear</strong>.
</div>
<div class="box_uploading">Uploading…</div>
<div class="box_error">Error! <span></span>.</div>
</div>
<div id="panels">
<div id="panel-left" style="flex:0 0 230px">
<!-- Buttons -->
<div id="buttons" style="background:#222">
<!-- Tools -->
<div id="tools"
class="mui-chose" style="width:200px"
>
<div
class="mui mui-pressed"
title="Select"
style="padding:1.2% 0"
>
<u>S</u>elect
</div>
<div
class="mui"
title="Move"
style="padding:1.2% 0"
>
<u>M</u>ove
</div>
<div
class="mui mui"
title="Add"
style="padding:1.2% 0"
>
<u>A</u>dd
</div>
<div
class="mui"
title="Remove"
style="padding:1.2% 0"
>
<u>R</u>emove
</div>
</div>
<br />
<div id="direction"
class="mui-chose" style="width:200px"
>
<div class="mui mui-pressed"
title="SelectUp"
style="padding:1.2% 0"
>
Select Up
</div>
<div class="mui mui"
title="SelectDown"
style="padding:1.2% 0"
>
Select Down
</div>
</div>
<br />
<div id="overlay"
class="mui-chose"
style="width:200px"
>
<div class="mui mui-pressed"
title="Threshold Mask"
style="padding:1.2% 0"
>
Threshold Mask
</div>
<div class="mui mui"
title="Threshold Value"
style="padding:1.2% 0"
>
Threshold Value
</div>
</div>
<br />
<div id="render3D"
class="mui mui-push"
title="Render 3D"
style="width:200px"
>
Render 3D
</div>
<br />
<div id="loadControlPoints"
class="mui mui-push"
title="Load control points from a text file"
style="width:200px"
>
Load Control Points
</div>
<div id="saveControlPoints"
class="mui mui-push"
title="Save control points to a text file"
style="width:200px"
>
Save Control Points
</div>
<div id="saveMask"
class="mui mui-push"
title="Save the threshold mask in Nifti format"
style="width:200px"
>
Save Mask
</div>
<br />
<div id="image-adjust">
<img class="adjustsicon" src="./img/alpha.svg" width="16px"/><input type="range" min="0" max="100" value="50" style="width: 180px" oninput="changeAlpha(event)"><br />
<img class="adjustsicon" src="./img/adjust.svg" width="16px"/><input type="range" min="0" max="200" value="100" style="width: 180px" oninput="changeContrast(event)"><br />
<img class="adjustsicon" src="./img/sun-o.svg" width="16px"/><input type="range" min="0" max="200" value="100" style="width: 180px" oninput="changeBrightness(event)"><br />
</div>
<br />
<div id="info">
</div>
</div>
</div>
<div id="panel-middle" style="flex:1">
<div id="viewer"></div>
<div id="progress"></div>
</div>
<div id="panel-right">
<div style="flex:0 1 30px">
<table>
<thead>
<tr>
<th class="ijk">I</th>
<th class="ijk">J</th>
<th class="ijk">K</th>
<th class="value" colspan="2">Value</th>
</tr>
</thead>
</table>
</div>
<div id="control" style="flex:1; overflow: scroll">
<table id="control-table">
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<!-- footer -->
<div id="footer">
Made with 🤍 Katja Heuer, Nicolas Traut & and Roberto Toro (2024). Thresholdmann: A Web tool for interactively creating adaptive thresholds to segment MRI data. Journal of Open Source Software, 9(97), 6336. <a href="https://joss.theoj.org/papers/10.21105/joss.06336" target="_blank" style="color:white; border-bottom: thin dotted white;text-decoration:none;">https://doi.org/10.21105/joss.06336.</a>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/r03ert0/[email protected]/mriviewer.js"></script>
<script src="https://cdn.jsdelivr.net/gh/r03ert0/muijs/mui.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/r03ert0/muijs/mui.css" />
<link rel="stylesheet" type="text/css" href="thresholdmann.css" />
<script src="thresholdmann.js"></script>
<script>
let file = false;
for (const event of ["drag", "dragstart", "dragend", "dragover", "dragenter", "dragleave", "drop"]) {
document.querySelector("#upload-box").addEventListener(event, function(e) {
e.preventDefault();
e.stopPropagation();
});
}
for (const event of ["dragover", "dragenter"]) {
document.querySelector("#upload-box").addEventListener(event, function(e) {
document.querySelector("#upload-box").classList.add("is-dragover");
});
}
for (const event of ["dragleave", "dragend", "drop"]) {
document.querySelector("#upload-box").addEventListener(event, function(e) {
document.querySelector("#upload-box").classList.remove("is-dragover");
});
}
document.querySelector("#upload-box").addEventListener("drop", function(e) {
file = e.dataTransfer.files;
if (document.querySelector("#upload-box").classList.contains("is-uploading")) {
return false;
}
document.querySelector("#upload-box").classList.add("is-uploading");
document.querySelector("#upload-box").classList.remove("is-error");
e.preventDefault();
if (file) {
console.log(file[0]);
init(file[0]);
}
});
MUI.push(document.querySelector('#loadNifti'), loadNifti);
MUI.push(document.querySelector('#loadDemoData'), loadDemoData);
</script>
</body>
</html>