-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
221 lines (203 loc) · 7.03 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Thresholdmann</title>
<link href='https://fonts.googleapis.com/css?family=Roboto+Mono:100,500' rel='stylesheet'>
<link href="https://fonts.googleapis.com/css?family=Montserrat:200" rel="stylesheet">
<style>
#menu {
float: right;
/* margin-top: 10px; */
margin-right: 10px;
display: inline-block;
}
#menu img {
margin-left: 15px;
}
.mui {
font-family: 'Montserrat', sans-serif;
font-size: 14px;
font-weight: 200;
}
pre {
font-family: 'Roboto Mono', monospace;
font-size: 14px;
font-weight: 100;
color: white;
}
img.button {
width: 0.9rem;
height: 0.9rem;
margin: 8px 2px;
vertical-align: middle;
cursor: pointer;
}
img.button:hover {
opacity: 0.5;
}
img.icon {
width: 1rem;
height: 1rem;
margin: 4px 2px;
vertical-align: middle;
cursor: pointer;
}
.box_uploading,
.box_error {
display: none;
}
.box {
position: relative;
color: white;
outline: 2px dashed white;
outline-offset: -10px;
width: 500px;
padding: 100px 20px;
text-align: center;
font-family: 'Roboto Mono', monospace;
font-size: 14px;
font-weight: 100;
}
.box.is-dragover {
background-color: #333;
}
.box.is-uploading .box_input {
visibility: hidden;
}
.box.is-uploading .box_uploading {
display: block;
}
.box_icon {
margin-bottom: 20px;
fill: white;
}
.box.is-uploading .box_uploading,
.box.is-error .box_error {
display: block;
position: absolute;
top: 50%;
right: 0;
left: 0;
transform: translateY( -50% );
}
.box_uploading {
font-style: italic;
}
.box {
display: none;
}
.init .box {
display: block;
}
</style>
</head>
<body>
<div id="header">
<!-- Top-right menu bar -->
<div id="menu">
<img id="doc" class="button" title="documentation" src='img/doc.svg'/>
<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>
<!-- Small left-top logo -->
<div style="display:inline-block;margin:10px">
<a href='/' style="text-decoration:none">
<span style="font-family: 'Montserrat', sans-serif;color:white;font-size:24px">Thresholdmann</span>
<!--
<img style='height:28px;vertical-align:middle' src='img/thresholdmann-logo.svg'/>
-->
</a>
</div>
</div>
<div style='display: flex'>
<div id='panel-left' style='flex:0 0 220px'>
<!-- Buttons -->
<div id='buttons' class='init' style='background:#222'>
<!-- Upload box -->
<div class='box'>
<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 <pre style="display:inline-block">.nii.gz</pre> file or drag it here.
</div>
<div class="box_uploading">Uploading…</div>
<div class="box_error">Error! <span></span>.</div>
</div>
<!-- Tools -->
<div id='tools' class='mui-chose' style='width:200px'>
<div class='mui mui-pressed' title='Select' style='padding:1.2% 0'>
Select
</div>
<div class='mui mui' title='Add' style='padding:1.2% 0'>
Add
</div>
<div class='mui' title='Remove' style='padding:1.2% 0'>
Remove
</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='loadControlPoints' class='mui mui-push' style='width:200px'>Load Control Points</div>
<div id='saveControlPoints' class='mui mui-push' style='width:200px'>Save Control Points</div>
<div id='saveMask' class='mui mui-push' style='width:200px'>Save Mask</div>
</div>
</div>
<div id='panel-right' style='flex:1'>
<table>
<tr>
<td>
<div id='viewer'></div>
<div id='progress'></div>
</td>
<td id='control'>
</td>
</table>
</div>
</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='http://localhost/mriviewerjs/mriviewer.js'></script> -->
<script src='https://cdn.jsdelivr.net/gh/r03ert0/muijs/mui.js'></script>
<script src='/thresholdmann/rbf/node_modules/numeric/numeric-1.2.6.min.js'></script>
<script src='/thresholdmann/rbf/index.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>
var file = false;
$('.box')
.on('drag dragstart dragend dragover dragenter dragleave drop', function(e) {
e.preventDefault();
e.stopPropagation();
})
.on('dragover dragenter', function() {
$('.box').addClass('is-dragover');
})
.on('dragleave dragend drop', function() {
$('.box').removeClass('is-dragover');
})
.on('drop', function(e) {
file = e.originalEvent.dataTransfer.files;
if ($('.box').hasClass('is-uploading')) {
return false;
}
$('.box').addClass('is-uploading').removeClass('is-error');
e.preventDefault();
if (file) {
console.log(file[0]);
init(file[0]);
}
});
</script>
</body>
</html>