forked from r03ert0/reorient
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
249 lines (225 loc) · 8.54 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
248
249
<html>
<!-- Do not add doctype here, it breaks the css -->
<head>
<title>Reorient</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='rgba(0, 80, 170,0.8)'/%3E%3C/svg%3E"
>
</head>
<body>
<style>
#menu {
float: right;
margin-right: 10px;
}
#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;
margin: 0 0 5px 5px;
}
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;
}
</style>
<style>
.box_uploading,
.box_error {
display: none;
}
.box {
position: relative;
color: white;
outline: 2px dashed white;
outline-offset: -10px;
width: 100%;
height: 100%;
text-align: center;
font-family: "Roboto Mono", monospace;
font-size: 14px;
font-weight: 100;
}
.box_input {
position: absolute;
top: 50%;
left: 50%;
transform: translate( -50%, -50% );
}
.box.is-dragover {
background-color: #333;
}
.box.is-uploading .box_input,
.box.is-error .box_input {
visibility: hidden;
}
.box_icon {
margin-bottom: 20px;
fill: white;
}
.box.is-uploading .box_uploading,
.box.is-error .box_error {
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate( -50%, -50% );
}
.box_uploading {
font-style: italic;
}
.box {
display: none;
}
.init .box {
display: block;
}
</style>
<div id="header">
<!-- Top-right menu bar -->
<div id="menu">
<a href="doc.html" target="_blank"><img id="doc" class="button" style="margin-left:9px;" title="documentation" src="img/doc.svg"/></a>
<a href="https://github.com/neuroanatomy/reorient/issues" target="_blank"><img id="bug" class="button" title="report a bug" src="img/bug.svg"/></a>
<a href="https://github.com/neuroanatomy/reorient" 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="https://neuroanatomy.github.io" target="_blank" ><img src="./img/naat-bw.svg" style="width:30px;position:relative;top:12.5px;" /></a>
<a href="/" style="text-decoration:none">
<img style="height:28px;vertical-align:middle;padding-left:12px;;" src="img/reorient-logo.svg"/>
</a>
</div>
</div>
<div style="display: flex">
<div id="panel-left" style="flex:0 0 220px">
<!-- Tools -->
<div id="tools" class="mui-chose" style="width:200px">
<div class="mui mui-pressed" title="Translate" style="padding:1.2% 0">
Translate
</div>
<div class="mui" title="Rotate" style="padding:1.2% 0">
Rotate
</div>
<div class="mui" title="Select" style="padding:1.2% 0">
Select
</div>
</div>
<br />
<!-- Buttons -->
<div id="buttons" class="init" style="background:#222">
<!-- Open file -->
<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 .nii.gz or a .nii file or drag it here.
</div>
<div class="box_uploading">Uploading…</div>
<div class="box_error">Error!<span></span>.</div>
</div>
<div id="loadMatrix" class="mui mui-push" style="padding:1.2% 0">Load New Rotation Matrix</div>
<div id="appendMatrix" class="mui mui-push" style="padding:1.2% 0">Append Rotation Matrix</div>
<div id="saveMatrix" class="mui mui-push" style="padding:1.2% 0">Save Rotation Matrix</div>
<div id="loadSelection" class="mui mui-push" style="padding:1.2% 0">Load Selection Box</div>
<div id="saveSelection" class="mui mui-push" style="padding:1.2% 0">Save Selection Box</div>
<div id="resetMatrix" class="mui mui-push" style="padding:1.2% 0">Reset Matrix</div>
<div id="resetSelection" class="mui mui-push" style="padding:1.2% 0">Reset Selection</div>
<div id="saveNifti" class="mui mui-push" style="padding:1.2% 0">Save Nifti</div>
</div>
<!-- Information -->
<div id="info">
<span class="mui mui-label">Volume shape</span>
<div id="info1"></div>
<span class="mui mui-label">World to voxel</span>
<div id="info2"></div>
<span class="mui mui-label">Voxel to world</span>
<div id="info3"></div>
<span class="mui mui-label">Crop box</span>
<div id="info4"></div>
</div>
</div>
<div id="panel-right" style="flex:1">
<div id="info0"></div>
<div id="viewer1">
</div>
<div id="viewer2">
</div>
<div id="viewer3">
</div>
</div>
</div>
<!-- footer -->
<div id="footer">
Made with 🤍 Katja Heuer and Roberto Toro (2020). Reorient: A Web tool for reorienting and cropping MRI data. Journal of Open Source Software, 5(53), 2670. <a href="https://joss.theoj.org/papers/10.21105/joss.02670" target="_blank" style="color:white; border-bottom: thin dotted white;text-decoration:none;">https://doi.org/10.21105/joss.02670.</a>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<!-- <script src="http://localhost/libs/jquery/3.1.1/jquery.min.js"></script> -->
<script src="https://cdn.jsdelivr.net/gh/r03ert0/[email protected]/mriviewer.js"></script>
<!-- <script src="http://localhost/mriviewerjs-r03ert0/mriviewer.js"></script> -->
<script src="https://cdn.jsdelivr.net/gh/r03ert0/muijs/mui.js"></script>
<!-- <script>window.MUI || document.write('<script src="http://localhost/muijs/mui.js"><\/script>')</script> -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/r03ert0/muijs/mui.css" />
<!-- <link rel="stylesheet" type="text/css" href="http://localhost/muijs/mui.css" /> -->
<link rel="stylesheet" type="text/css" href="reorient.css" />
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:100" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Montserrat:200,500" rel="stylesheet" />
<script src="reorient.js"></script>
<script>
initUI(MUI);
let 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) {
init(file[0])
.catch(loadNiftiFailedMessage);
}
});
</script>
</body>
</html>