-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
392 lines (307 loc) · 12.7 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
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="./gfx/favicon.png">
<title>BOOSTLET.js</title>
<style>
a {
color: #007ec6;
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #fff;
padding: 20px;
text-align: center;
}
.header-content {
margin: 0 auto;
padding: 0 20px;
display: flex;
align-items: center;
}
h1 {
font-family: 'Roboto', sans-serif;
font-weight: 700;
font-size: 28px;
margin: 0;
}
.content {
max-width: 800px;
margin: 0 auto;
padding: 20px;
font-size: 20px;
}
.buttons {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
text-align: center;
}
.button {
background-color: white;
color: black;
border: 2px solid black;
padding: 10px 20px;
border-radius: 10px;
cursor: pointer;
font-size: 20px;
font-weight: bolder;
}
.button:hover {
background-color: black;
color: white;
}
.logo {
background-color: black;
color: white;
border: none;
padding: 10px 30px;
cursor: pointer;
border-radius: 10px;
width: 150px;
height: 60px;
}
.logodiv {
font-size: 28px;
vertical-align: middle;
}
img {
max-width: 100%;
}
.websites {
text-align: center;
padding-left: 100px;
}
.websites img {
width: 300px;
}
.image-container {
position: relative;
margin: 0px;
width: 300px;
float:left;
}
.overlay {
position: absolute;
top: 0;
left: 0;
width: 290px;
height: 243px;
background-color: rgba(0, 0, 0, 0.5);
color: white;
justify-content: center;
align-items: center;
opacity: 0;
/* transition: opacity 0.3s;*/
z-index: 1000;
margin: 5px;
}
.image-container:hover .overlay {
/* transition: opacity 0.3s;*/
opacity: 1;
}
.image-container:hover img {
opacity: 0.5;
}
.sitename {
padding-top:30%;
display: block;
font-size: 16px;
font-weight: bold;
}
.tech {
font-size: 14px;
color: lightgray;
display: block;
font-weight: bold;
}
#faq {
margin-top:20px;
margin-bottom: 200px;
width: 100%;
float: left;
}
.question {
cursor: pointer;
font-weight: bold;
margin-bottom: 10px;
}
.answer {
display: none;
margin-bottom: 20px;
}
.answer.visible {
display: block;
}
/* Responsive */
@media (max-width: 600px) {
.header-content {
flex-direction: column;
}
h1 {
font-size: 20px;
padding-top: 10px;
}
.logo {
height: 50px;
}
}
</style>
<script type="text/javascript">
// https://raw.githubusercontent.com/mpsych/boostlet/main/examples/sobel.js
//load_boostlet("https://raw.githubusercontent.com/mpsych/boostlet/main/examples/sobel.js", function(e) {compile_boostlet('sobel',e)})
function load_boostlet(url, callback) {
let xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
// request done
callback( xhr.response );
return;
}
}
xhr.send(null)
}
// FROM https://caiorss.github.io/bookmarklet-maker/
function compile_boostlet (code){
var output = "javascript:" + encodeURIComponent("(function(){" + code.trim() + "})();");
return output;
}
function setup_boostlet_button(id, url) {
var link = document.getElementById(id);
load_boostlet(url, function(code) {
output = compile_boostlet(code);
link.href = output;
});
}
window.onload = function() {
var examples = ['sobel.js', 'segmentanything.js', 'imageCaptioning.js', 'plotly.js', 'trako.js', 'melanoma.js', 'webllm.js'];
// var baseurl = 'https://raw.githubusercontent.com/mpsych/boostlet/main/examples/';
var baseurl = 'https://raw.githubusercontent.com/gaiborjosue/boostlet/webllm/examples/';
// var baseurl = 'http://localhost:5500/examples/';
// var baseurl = 'http://localhost:8000/examples/';
// var baseurl = 'https://raw.githubusercontent.com/shrutivarade/boostlet/main/examples/';
for (e in examples) {
var current_example = examples[e];
setup_boostlet_button(current_example, baseurl+current_example);
}
// var codeurl = 'http://localhost:5500/examples/';
// var codeurl = 'https://github.com/shrutivarade/boostlet/blob/main/examples/';
var codeurl = 'https://github.com/mpsych/boostlet/blob/main/examples/';
for (e in examples) {
var current_example = examples[e];
var codelink = document.getElementById(current_example+'-code');
codelink.href = codeurl+current_example;
}
}
function toggleAnswer(index) {
const answer = document.getElementById(`answer${index}`);
answer.classList.toggle('visible');
}
</script>
</head>
<body>
<header>
<div class="header-content">
<a href='https://boostlet.org/'><img src='gfx/boostlet.png' alt='Logo' class='logo'></a>
<h1>image processing plugins for the web</h1>
</div>
</header>
<main>
<div class="content">
<!-- gfx from https://fontmeme.com/comic-fonts/ -->
<img src='gfx/1.png' class='imgtext'>
<div class="buttons">
<div><a href='' id='sobel.js'><button class="button">Sobel Filter</button></a><br><div style='margin:2px'><a href='' id='sobel.js-code' target='_blank'><img src='gfx/badge.svg'></a></div></div>
<div><a href='' id='segmentanything.js'><button id='segmentanything.js' class="button">Segment Anything</button></a><br><div style='margin:2px'><a href='' id='segmentanything.js-code' target='_blank'><img src='gfx/badge.svg'></a></div></div>
<div><a href='' id='plotly.js'><button id='plotly.js' class="button">Plotly Histogram</button></a><br><div style='margin:2px'><a href='' id='plotly.js-code' target='_blank'><img src='gfx/badge.svg'></a></div></div>
<div><a href='' id='imageCaptioning.js'><button id='imageCaptioning.js' class="button">Image Captioning </button></a><br><div style='margin:2px'><a href='' id='imageCaptioning.js-code' target='_blank'><img src='gfx/badge.svg'></a></div></div>
</div>
<div class="buttons">
<div><a href='' id='trako.js'><button id='trako.js' class="button">Trako (NiiVue only!)</button></a><br><div style='margin:2px'><a href='' id='trako.js-code' target='_blank'><img src='gfx/badge.svg'></a></div></div>
<div><a href='' id='melanoma.js'><button id='melanoma.js' class="button">Melanoma Predictor</button></a><br><div style='margin:2px'><a href='' id='melanoma.js-code' target='_blank'><img src='gfx/badge.svg'></a></div></div>
<div><a href='' id='webllm.js'><button id='webllm.js' class="button">LLM Chat</button></a><br><div style='margin:2px'><a href='' id='webllm.js-code' target='_blank'><img src='gfx/badge.svg'></a></div></div>
</div>
<img src='gfx/2.png' class='imgtext'>
<div class="websites">
<div class="image-container">
<a href="https://viewer.imaging.datacommons.cancer.gov/viewer/1.3.6.1.4.1.14519.5.2.1.6279.6001.224985459390356936417021464571?seriesInstanceUID=1.2.276.0.7230010.3.1.3.0.57823.1553343864.578877,1.3.6.1.4.1.14519.5.2.1.6279.6001.273525289046256012743471155680" target="_blank">
<img src="gfx/idc.png" alt="NCI Imaging Data Commons">
<div class='overlay'>
<span class='sitename'>NCI Imaging Data Commons</span>
<span class='tech'>Cornerstone2D.js</span>
</div>
</a>
</div>
<div class="image-container">
<a href="https://openneuro.org/datasets/ds004697/versions/1.0.1/file-display/sub-003:ses-1:anat:sub-003_ses-1_T1w.nii.gz" target="_blank">
<img src="gfx/openneuro.png" alt="OpenNeuro.org">
<div class='overlay'>
<span class='sitename'>OpenNeuro.org</span>
<span class='tech'>NiiVue.js</span>
</div>
</a>
</div>
<div class="image-container">
<a href="https://mpsych.github.io/CACTAS/?data=https://danielhaehn.com/brain.nii" target="_blank">
<img src="gfx/cactas.png" alt="CACTAS">
<div class='overlay'>
<span class='sitename'>CACTAS Tool</span>
<span class='tech'>NiiVue.js</span>
</div>
</a>
</div>
<div class="image-container">
<a href="https://haehn.github.io/axo/web/viewer.html?W255B" target="_blank">
<img src="gfx/openseadragon.png" alt="Axoweb">
<div class='overlay'>
<span class='sitename'>AXOweb</span>
<span class='tech'>openseadragon.js</span>
</div>
</a>
</div>
<div class="image-container">
<a href="https://gaiborjosue.github.io/API_Images/xtk.html" target="_blank">
<img src="gfx/xtk.png" alt="xtk">
<div class='overlay'>
<span class='sitename'>XTK Demo</span>
<span class='tech'>xtk.js 2D Slice</span>
</div>
</a>
</div>
<div class="image-container">
<a href="https://gaiborjosue.github.io/API_Images/papaya.html" target="_blank">
<img src="gfx/papaya.png" alt="papaya">
<div class='overlay'>
<span class='sitename'>Papaya Demo</span>
<span class='tech'>papaya.js</span>
</div>
</a>
</div>
</div>
<br><br>
<div id='faq'>
<img src='gfx/faq.png' style='width:100px'><br>
<ol>
<li class="question" onclick="toggleAnswer(1)">Which visualization frameworks are supported?</li>
<li class="answer" id="answer1">Currently <a href='https://cornerstonejs.org' target='_blank'>Cornerstone2D.js</a> and <a href='https://github.com/niivue/niivue' target='_blank'>NiiVue.js</a>. Others like <a href='https://cornerstonejs.org' target='_blank'>openseadragon.js, <a href='https://slicedrop.com' target='_blank'>slicedrop.com</a>, <a href='https://rii-mango.github.io/Papaya/' target='_blank'>Papaya</a> are in the works! <a href="http://brainchop.org">BrainChop</a> we are coming for you - j/k :))))</li>
<li class="question" onclick="toggleAnswer(2)">What can BOOSTLETs really do?</li>
<li class="answer" id="answer2">Any processing with any library is possible! The examples above use plotly.js or ONNX.js. BOOSTLETs provide methods that allow data access and interaction across different frameworks through JS injection. This is all client-side, unless you send some requests to a server.</li>
<li class="question" onclick="toggleAnswer(3)">Do the algorithms work on the real data?</li>
<li class="answer" id="answer3">If the visualization framework supports it, we access the real data. If not, we fall back to canvas imagedata but we are working with the developers of the frameworks to fix that :)</li>
<li class="question" onclick="toggleAnswer(4)">How can I write my own BOOSTLET?</li>
<li class="answer" id="answer4">Check out the code for the examples above - there is always the top block that imports boostlet.min.js and then a run method for the processing. It is pretty straight forward (especially the <a href="https://github.com/mpsych/boostlet/blob/main/examples/sobel.js" target="_blank">sobel.js</a> and <a href="https://github.com/mpsych/boostlet/blob/main/examples/plotly.js" target="_blank">plotly.js</a> examples) and any library or processing is possible.</li>
<li class="question" onclick="toggleAnswer(5)">How can I contribute to BOOSTLET development?</li>
<li class="answer" id="answer5">Fork the <a href="https://github.com/mpsych/boostlet/" target="_blank">repo</a> :) We use parcel.js as the build system. PRs are very welcome :)</li>
</ol>
</div>
</div>
</main>
</body>
</html>