-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
796 lines (669 loc) · 46.6 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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tissue Microarray De-Arraying Tool</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
<link href="./style2.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jszip.min.js"></script>
<!-- Include Box CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn01.boxcdn.net/platform/elements/19.0.0/en-US/picker.css" />
</head>
<body class="bg-gray-100">
<div class="body-container mx-auto px-4 lg:ma">
<header class="px-1 py-1 shadow-sm relative">
<div class="container mx-auto flex justify-between items-center">
<a href="./" class="flex items-center hover:bg-inherit">
<img src="./icons/Logo.webp" alt="Your Logo" class="h-8 w-8 mr-2 rounded-full">
<h1 class="text-3xl font-light text-gray-800">TMA-Grid</h1>
</a>
<!-- Mobile Menu Button -->
<button id="menuBtn" class="z-20 md:hidden block text-gray-800 focus:outline-none">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16m-7 6h7">
</path>
</svg>
</button>
<!-- Mobile Dropdown Menu -->
<div id="navMenuMobile"
class="hidden absolute z-10 right-10 mt-1 w-24 bg-gray-100 shadow-md py-2 rounded-md transform translate-x-0 transition-transform duration-300 ease-out"
style="top: 30%">
<a href="./"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">Home</a>
<a href="https://github.com/episphere/tma-grid"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">GitHub</a>
<a href="https://github.com/episphere/tma-grid/issues"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">Issues</a>
<a href="https://youtu.be/miajqyw4BVk"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">Tutorial</a>
<a href="#"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">Manuscript</a>
<button id="helpButtonMobile" class="actionButton px-4">?</button> <!-- Add this line -->
</div>
<!-- Desktop Navigation Menu -->
<nav class="hidden md:flex items-center space-x-4">
<a href="./"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">Home</a>
<a href="https://github.com/episphere/tma-grid"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">GitHub</a>
<a href="https://github.com/episphere/tma-grid/issues"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">Issues</a>
<a href="https://youtu.be/miajqyw4BVk"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">Tutorial</a>
<a href="#"
class="text-sm text-gray-800 hover:underline transition-colors duration-200 block px-4 py-2">Manuscript</a>
<button id="helpButton" class="actionButton px-4">?</button> <!-- Add this line -->
</nav>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const menuBtn = document.getElementById('menuBtn');
const navMenuMobile = document.getElementById('navMenuMobile');
menuBtn.addEventListener('click', () => {
navMenuMobile.classList.toggle('hidden');
});
});
</script>
</header>
<div id="app">
<section id="upload" class="py-5 ">
<div class="instructions-container space-y-4">
<button class="close-instructions text-right">✕</button>
<h2 class="text-xl font-semibold">Uploading an Image</h2>
<p>
Start by uploading an <span class="span-file-type">.svs</span>, <span
class="span-file-type">.tiff</span>, or <span class="span-file-type">.ndpi</span> image for
optimal results. While
you can use <span class="span-file-type">.png</span> or <span class="span-file-type">.jpg</span>
files, please note that virtual
gridding functionality may be limited with these formats.
</p>
<p>Once the image has been successfully uploaded, click the <span
class="span-button-proceed">Proceed</span>
button to continue to image segmentation.</p>
</div>
<div class="bg-white p-6 rounded-lg shadow-lg">
<nav class="flex mb-5 border-b justify-center">
<button
class="active upload-option-tab px-6 py-2 text-gray-800 border-b-2 border-blue-500 hover:text-gray-800 hover:border-blue-500 focus:outline-none focus:text-gray-800 focus:border-blue-500"
data-target="direct-upload">Direct Upload</button>
<button
class="upload-option-tab px-6 py-2 text-gray-600 border-b-2 border-transparent hover:text-gray-800 hover:border-blue-500 focus:outline-none focus:text-gray-800 focus:border-blue-500"
data-target="url-upload">Image URL</button>
<button
class="upload-option-tab px-6 py-2 text-gray-600 border-b-2 border-transparent hover:text-gray-800 hover:border-blue-500 focus:outline-none focus:text-gray-800 focus:border-blue-500"
data-target="box-upload">Box Integration</button>
</nav>
<div class="preview-image">
<img src="./icons/Placeholder_view_vector.svg" alt="Uploaded Image"
class="mx-auto w-96 h-64 mb-6" id="previewImage">
<div id="loadingSpinner" style="display: none;">
<div class="spinner"></div>
</div>
</div>
<div id="imageLoadStatus" class="load-status neutral-message">
No image uploaded.
</div>
<div id="tab-contents" class="mb-20">
<div id="direct-upload" class="tab-content active">
<div id="drop-area">
<form class="my-form">
<p>Drag and drop files here</p>
<p>or</p>
<label class="browse-button" for="fileInput">Browse Files</label>
<input type="file" id="fileInput" accept="image/*,.svs, .ndpi, .tiff"
style="display: none;">
</form>
</div>
<div id="file-info" class="hidden width-90-middle">
<img src="./icons/image-file-icon.svg" alt="File icon" id="file-icon" class="file-icon">
<div id="file-details">
<span id="file-name">screenshot.png</span>
<span id="file-size">(2MB)</span>
</div>
<button type="button" id="remove-file" class="remove-button">×</button>
</div>
</div>
<div id="url-upload" class="tab-content flex hidden gap-5 lg:gap-10 md:gap-5 sm:gap-5">
<input type="text" id="imageUrlInput" class="form-input"
style="flex-grow: 1; margin-top: 0; border-radius: 4px; border: 1px solid #ccc; padding: 10px; font-size: 16px;"
placeholder="Enter Image URL"
value="https://storage.googleapis.com/imagebox_test/TMAs/HE_Hamamatsu.tiff">
<button id="loadImageUrlBtn" type="button" class="standard-button"
style="height: 100%; padding: 10px 0px; margin: auto;">Load</button>
</div>
<div id="box-upload" class="tab-content hidden">
<button id="boxLoginBtn"
class="btn-box-connect flex justify-center bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mx-auto">Connect
to Box</button>
<div id="boxFilesContainer" class="box-files-container width-90-middle">
<!-- Dynamically loaded Box files will go here -->
</div>
</div>
</div>
<div class="mt-6 width-90-middle" style="display: none;">
<label class="block text-sm font-semibold text-gray-700">Optional Metadata File:</label>
<div class="file-upload-wrapper">
<input type="file" id="metadataFile" class="file-input" accept=".csv,.json,.xlsx, .xls"
onchange="displayFileInfo(this)">
<label for="metadataFile" class="file-upload-button">Choose files</label>
<button class="skip-button" id="useTemplate" onclick="">Use Template</button>
</div>
<div id="metadata-file-info" class="hidden width-90-middle"
style="width: 100%; margin-top: 20px;">
<img src="./icons/image-file-icon.svg" alt="File icon" id="file-icon" class="file-icon">
<div id="metadata-file-details">
<span id="metadata-file-name"></span>
<span id="metadata-file-size"></span>
</div>
<button type="button" id="metadata-remove-file" class="remove-button">×</button>
</div>
</div>
<div id="metadataLoadStatus" class="load-status neutral-message" style="display: none;">
No metadata uploaded.
</div>
<script>
function displayFileInfo(input) {
if (input.files && input.files[0]) {
var size = (input.files[0].size / 1024).toFixed(2); // size in KB
var name = input.files[0].name;
document.getElementById('metadata-file-name').textContent = name;
document.getElementById('metadata-file-size').textContent = '(' + size + ' KB)';
document.getElementById('metadata-file-info').classList.remove('hidden');
}
}
</script>
</div>
<div class="flex justify-end mt-6">
<button
class="btn-proceed px-6 py-2 bg-green-500 hover:bg-green-700 text-white font-bold rounded focus:outline-none shadow-lg">Proceed</button>
</div>
</section>
<section id="segmentation" class="hidden py-12">
<div class="instructions-container space-y-4">
<button class="close-instructions text-right">✕</button>
<h2 class="text-xl font-semibold">Completing Core Segmentation</h2>
<p>Adjust segmentation parameters in the left-hand menu to optimize core detection. If necessary,
make manual edits to ensure all cores are accurately captured.</p>
<p>Once you're satisfied with the segmentation, click the <span
class="span-button-proceed">Proceed</span>
button to proceed to the Gridding tab.</p>
</div>
<div class="instructions-container mt-4 space-y-4">
<button class="close-instructions text-right">✕</button>
<h2 class="text-xl font-semibold">Interactive Core Editing</h2>
<p><kbd>Click</kbd> on the image to add a core.</p>
<p><kbd>Shift-click</kbd> a core to remove it.</p>
</div>
<div class="flex flex-wrap-mx-4">
<!-- Sidebar -->
<aside id="segmentation-sidebar"
class="bg-gray-50 rounded-lg shadow-lg p-1 transition-all duration-300 transform md:translate-x-0 sm:block collapsed">
<fieldset>
<div class="text-xl font-semibold mb-4 parameters-header">
<h2 class="title">Segmentation Parameters</h2>
<div class="window-controls">
<button class="close-button" onclick="toggleSidebarSegmentation()">×</button>
</div>
</div>
<div class="space-y-3">
<label for="maskAlphaSlider" class="text-sm font-medium text-gray-700 block">Mask
Alpha: <span id="maskAlphaValue">0.2</span></label>
<input type="range" id="maskAlphaSlider" min="0" max="1" step="0.025" value="0.2"
class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
<label for="thresholdSlider"
class="text-sm font-medium text-gray-700 block">Sensitivity:
<span id="thresholdValue">0.5</Wspan></label>
<input type="range" id="thresholdSlider" min="0.01" max="0.99" step="0.0025" value="0.5"
class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
<label for="minAreaInput" class="text-sm font-medium text-gray-700 block">Min
Area:</label>
<input type="number" id="minAreaInput" value="20" step="1" min="1"
class="w-full border-gray-300 rounded-md shadow-sm">
<label for="maxAreaInput" class="text-sm font-medium text-gray-700 block">Max
Area:</label>
<input type="number" id="maxAreaInput" value="3000" step="1" min="1"
class="w-full border-gray-300 rounded-md shadow-sm">
<label for="disTransformMultiplierInput"
class="text-sm font-medium text-gray-700 block">Distance
Transform
Multiplier:</label>
<input type="number" id="disTransformMultiplierInput" value="0.5" step="0.025"
min="0.025" max="1" class="w-full border-gray-300 rounded-md shadow-sm">
</div>
<button type="button" id="applySegmentation"
class="mt-4 w-full bg-blue-600 text-white rounded-lg py-2 font-medium hover:bg-blue-700 focus:outline-none focus:ring focus:ring-blue-300 transition duration-150 ease-in-out">
Apply
</button>
</fieldset>
</aside>
<!-- Sidebar Toggle Icon -->
<div id="segmentationSidebarIcon" class="parameterSidebar" onclick="toggleSidebarSegmentation()">
<!-- Menu Icon (three horizontal lines) -->
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 6h16M4 12h16M4 18h16" />
</svg>
</div>
<div id="ImageSegmentation" class="flex-grow sm:block sm:w-full">
<img id="originalImage" src="#" alt="Original Tissue" class="hidden">
<canvas id="segmentationResultsCanvas" alt="Processed Tissue" class="mx-auto w-4/5"></canvas>
</div>
</div>
<div class="flex justify-between items-center mt-8">
<button
class="btn-back px-6 py-2 bg-red-500 hover:bg-red-700 text-white font-bold rounded focus:outline-none focus:ring-4 focus:ring-red-300 shadow-lg">Back</button>
<button id="finalizeSegmentation"
class="btn-proceed px-6 py-2 bg-green-500 hover:bg-green-700 text-white font-bold rounded focus:outline-none focus:ring-4 focus:ring-green-300 shadow-lg">Proceed</button>
</div>
</section>
<script>
// Function to toggle the sidebar
function toggleSidebarSegmentation() {
var sidebar = document.getElementById('segmentation-sidebar');
var segmentationSidebarIcon = document.getElementById('segmentationSidebarIcon');
sidebar.classList.toggle('collapsed');
segmentationSidebarIcon.classList.toggle('hidden');
console.log("Hidden")
}
</script>
<section id="gridding" class="hidden">
<div id="rawDataLoadingSpinner" style="display: none;">
<div class="spinner"></div>
</div>
<div class="instructions-container mb-4">
<button class="close-instructions text-right">✕</button>
<h2 class="text-lg font-semibold">Gridding Instructions</h2>
<p>Open the menu on the left to adjust the gridding settings and key hyperparameters such as
as the image's rotation. Please ensure that the image is rotated correctly. If not, adjust the
image rotation parameter.</p>
<p>Once you're satisfied with the gridding, click the <span
class="span-button-proceed">Proceed</span>
button to proceed to the Virtual Grid section.</p>
<p><strong>Ensure that you assign your green marker cores row and column values, or else they will
not be available for download in the Virtual Grid Tab!</strong></p>
</div>
<div class="instructions-container mb-4">
<button class="close-instructions text-right">✕</button>
<h2 class="text-lg font-semibold">Editing Cores</h2>
<p>You can move the core by dragging it to the desired location.</p>
<p><kbd>Click</kbd> the core, then drag the corner anchor points to resize.</p>
<p><kbd>Double-click</kbd> the core to open the edit menu and change its metadata. </p>
<p><kbd>Shift-click</kbd> the core to toggle its status as real/imaginary. </p>
</div>
<div class="instructions-container mb-4">
<button class="close-instructions text-right">✕</button>
<h2 class="text-lg font-semibold">Adding Cores</h2>
<p>Click the <span class="span-button">Add Core</span> button in the top left corner, then drag to
set the core's location and size.</p>
</div>
<div class="flex flex-wrap lg:flex-nowrap">
<!-- Sidebar Toggle Icon -->
<div id="griddingSidebarIcon" class="parameterSidebar" onclick="toggleSidebarGridding()">
<!-- Menu Icon (three horizontal lines) -->
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 6h16M4 12h16M4 18h16" />
</svg>
</div>
<!-- Sidebar -->
<aside id="gridding-sidebar"
class="w-1/3 sm:w-full md:w-1/4 lg:w-1/3 bg-white p-2 rounded-lg shadow transition-all duration-300 collapsed">
<form id="hyperparameters-form" class="space-y-6 gridding-sidebar-content">
<div class="text-xl font-semibold mb-4 parameters-header">
<h2 class="title">Configure Parameters</h2>
<div class="window-controls">
<button class="close-button" onclick="toggleSidebarGridding()">×</button>
</div>
</div>
<!-- Image Parameters Section -->
<fieldset class="p-6 bg-gray-100 rounded-lg shadow-sm">
<legend class="font-semibold text-l text-gray-900 mb-4">Image Parameters</legend>
<div class="flex-col space-y-4 mt-2">
<label for="userRadius" class="block">
Core Radius: <output id="radiusValue" for="userRadius">20</output>
</label>
<input type="range" id="userRadius" name="userRadius" min="1" max="100" value="20"
class="w-full">
</div>
</fieldset>
<!-- Traveling Algorithm Section -->
<fieldset class="p-6 bg-gray-100 rounded-lg shadow-sm">
<legend class="font-semibold text-l text-gray-900 mb-4">Traveling Algorithm Parameters
</legend>
<div class="flex-col space-y-4 mt-2">
<label for="originAngle" title="Rotation of the image in degrees">
Image Rotation: <output id="originAngleValue" for="originAngle">0</output>
</label>
<input type="range" id="originAngle" name="originAngle" min="-90" max="90" value="0"
class="w-full">
</div>
</fieldset>
<fieldset>
<legend class="font-semibold text-l text-gray-900 mb-4">Display Parameters</legend>
<!-- Check box for whether adjacent cores should be connected by lines -->
<div class="checkbox-group">
<input type="checkbox" id="connectCoresCheckbox" name="connectCores" checked>
<label for="connectCoresCheckbox">Connect Cores</label>
</div>
<div class="checkbox-group">
<input type="checkbox" id="flagMisalignmentCheckbox" name="flagMisalignmentCheckbox"
checked>
<label for="flagMisalignmentCheckbox">Flag Misaligned Cores</label>
</div>
</fieldset>
<!-- Advanced Settings Toggle -->
<div class="mt-4">
<label for="advanced-settings" class="items-center cursor-pointer">
<input type="checkbox" id="advanced-settings" class="toggle-checkbox">
<span class="text-gray-700">Advanced Settings</span>
</label>
</div>
<!-- Advanced Settings Content -->
<!-- Wrap hidden fieldsets in a div -->
<div id="advanced-settings-content" class="hidden">
<!-- More Traveling Algorithm Parameters -->
<fieldset class="p-6 bg-gray-100 rounded-lg shadow-sm">
<legend class="font-semibold text-l text-gray-900 mb-4">Traveling Algorithm
Parameters</legend>
<label for="radiusMultiplier"
title="Multiplier for the radius used in the traveling algorithm">Radius
Multiplier</label>
<input type="number" id="radiusMultiplier" name="radiusMultiplier" step="0.1"
value="0.6">
<label for="gridWidth"
title="Width of one square in the grid used in the traveling algorithm">Grid
Width</label>
<input type="number" id="gridWidth" name="gridWidth" step="1" value="70">
<label for="gamma"
title="Distance after the the core with the greatest X value to stop the traveling algorithm">Stopping
Distance</label>
<input type="number" id="gamma" name="gamma" step="1" value="60">
<label for="multiplier"
title="Multiplier for the grid width calculation in the traveling algorithm">Multiplier
for Grid Width</label>
<input type="number" id="multiplier" name="multiplier" step="0.1" value="1.5">
<label for="imageWidth"
title="Width of the entire gird used in the traveling algorithm">Image
Width</label>
<input type="number" id="imageWidth" name="imageWidth" step="1" value="1024">
<label for="searchAngle" title="Angle to search in the traveling algorithm">Search
Angle</label>
<input type="number" id="searchAngle" name="searchAngle" step="1" value="5">
</fieldset>
<!-- Edge Detection Section -->
<fieldset class="p-6 bg-gray-100 rounded-lg shadow-sm">
<legend class="font-semibold text-l text-gray-900 mb-4">Edge Detection Parameters
</legend>
<label for="thresholdMultiplier"
title="Multiplier for the median absolute deviation to filter edges by length">Length
Threshold Multiplier</label>
<input type="number" id="thresholdMultiplier" name="thresholdMultiplier" step="0.1"
value="1.2">
<label for="thresholdAngle"
title="The angle within which edges are considered valid">Threshold
Angle</label>
<input type="number" id="thresholdAngle" name="thresholdAngle" step="1" value="10">
</fieldset>
<!-- Image Rotation Section -->
<fieldset class="p-6 bg-gray-100 rounded-lg shadow-sm">
<legend class="font-semibold text-l text-gray-900 mb-4">Image Rotation Parameters
</legend>
<label for="minAngle" title="Minimum angle to test for image rotation">Minimum
Angle</label>
<input type="number" id="minAngle" name="minAngle" step="1" value="0">
<label for="maxAngle" title="Maximum angle to test for image rotation">Maximum
Angle</label>
<input type="number" id="maxAngle" name="maxAngle" step="1" value="5">
<label for="angleStepSize"
title="Incremental step size for testing angles during image rotation">Angle
Step Size</label>
<input type="number" id="angleStepSize" name="angleStepSize" step="1" value="5">
<label for="angleThreshold"
title="Angle threshold used when filtering edges by angle for image rotation">Angle
Threshold</label>
<input type="number" id="angleThreshold" name="angleThreshold" step="1" value="20">
</fieldset>
</div>
<button type="button" id="apply-hyperparameters"
class="px-4 py-2 bg-blue-500 hover:bg-blue-700 text-white font-bold rounded">Apply</button>
</form>
</aside>
<!-- Main Content -->
<main class="mx-auto w-full">
<!-- Main content goes here -->
<div class="flex" id="main-container">
<!-- Image Viewer or other main content -->
<div id="osdViewer" style="margin:auto"></div>
</div>
<div class="edit-sidebar" id="editSidebar">
<div class="sidebar-header draggable-area">
<h2 class="title">Edit Core</h2>
<div class="window-controls">
<button class="close-button" id="closeEditCoreButton">×</button>
</div>
</div>
<form id="editCoreForm" class="main-content">
<div class="checkbox-group">
<input type="checkbox" id="editIsMarkerInput" name="editIsMarkerInput">
<label for="editIsMarkerInput">Is a Marker</label>
</div>
<label for="editRowInput">Row:</label>
<input type="number" id="editRowInput" name="editRowInput" disabled>
<label for="editColumnInput">Column:</label>
<input type="number" id="editColumnInput" name="editColumnInput" disabled>
<div class="checkbox-group" style="display: none;">
<input type="checkbox" id="editAutoUpdateColumnsCheckbox"
name="editAutoUpdateColumnsCheckbox" checked>
<label for="editAutoUpdateColumnsCheckbox">Auto Assign Columns</label>
</div>
<label for="editXInput">X Position:</label>
<input type="number" id="editXInput" name="editXInput">
<label for="editYInput">Y Position:</label>
<input type="number" id="editYInput" name="editYInput">
<label for="editRadiusInput">Radius:</label>
<input type="number" id="editRadiusInput" name="editRadiusInput" step="0.1">
<label for="editAnnotationsInput">Annotations:</label>
<textarea type="text" id="editAnnotationsInput" name="editAnnotationsInput"></textarea>
<div class="radio-group">
<input type="radio" id="editRealInput" name="coreType" value="real">
<label for="editRealInput" class="radio-button">Normal</label>
<input type="radio" id="editImaginaryInput" name="coreType" value="imaginary">
<label for="editImaginaryInput" class="radio-button">Missing</label>
</div>
<div class="button-group">
<button type="button" id="saveCoreEdits">Save</button>
<button type="button" id="removeCoreButton">Remove</button>
</div>
</form>
</div>
</main>
</div>
<section style="padding-top: 10px;">
<h2 class="text-lg font-semibold">Core Color Legend</h2>
<div class="flex flex-wrap justify-around">
<div class="flex items-center m-2">
<div class="w-4 h-4 rounded-full bg-green-500 mr-2"></div>
<span>Marker cores.</span>
</div>
<div class="flex items-center m-2">
<div class="w-4 h-4 rounded-full bg-blue-500 mr-2"></div>
<span>Normal cores.</span>
</div>
<div class="flex items-center m-2">
<div class="w-4 h-4 rounded-full bg-red-500 mr-2"></div>
<span>Misaligned cores.</span>
</div>
<div class="flex items-center m-2">
<div class="w-4 h-4 rounded-full bg-yellow-500 mr-2"></div>
<span>Imaginary cores.</span>
</div>
</div>
</section>
<div class="flex justify-between items-center mt-8">
<button
class="btn-back px-4 py-2 bg-red-500 hover:bg-red-700 text-white font-bold rounded focus:outline-none shadow transition-colors duration-150">Back</button>
<button id="create-virtual-grid"
class="btn-proceed px-4 py-2 bg-green-500 hover:bg-green-700 text-white font-bold rounded focus:outline-none shadow transition-colors duration-150">Proceed</button>
</div>
</section>
<script>
// Function to toggle the sidebar
function toggleSidebarGridding() {
var sidebar = document.getElementById('gridding-sidebar');
var griddingSidebarIcon = document.getElementById('griddingSidebarIcon');
sidebar.classList.toggle('collapsed');
griddingSidebarIcon.classList.toggle('hidden');
}
</script>
<section id="virtual-grid" class="py-5 hidden">
<script>
// Function to toggle the sidebar
function toggleSidebarVirtual() {
var sidebar = document.getElementById('virtual-grid-sidebar');
var virtualSidebarIcon = document.getElementById('virtualGridSidebarIcon');
sidebar.classList.toggle('collapsed');
virtualSidebarIcon.classList.tog
}
</script>
<div class="instructions-container space-y-4">
<button class="close-instructions text-right">✕</button>
<h2 class="text-xl font-semibold">Utilizing the virtual grid</h2>
<p>Select a core in the right-hand grid to edit its metadata. Remember to click <span
class="span-button">Update Metadata</span> to save your changes.
</p>
<p>Click the <span class="span-button-green">Add Field</span> button to add a column to your
associated metadata file.
</p>
<p>To export a single core at full resolution, <kbd>Double-click</kbd> it. To export all cores,
click
the <span class="span-button">Export Grid</span> button. Note that core exporting is only
enabled for
<span class="span-file-type">.svs</span> files
</p>
</div>
<div class="flex h-full">
<aside id="virtual-grid-sidebar"
class="w-full md:w-2/3 lg:w-1/3 bg-gray-50 p-4 rounded-lg shadow-lg mr-2 overflow-y-auto"
style="max-height: 90vh;">
<div class="flex justify-between items-center">
<h2 class="text-lg md:text-xl font-semibold">Edit Metadata</h2>
<button class="close-button" style="display:none"
onclick="toggleSidebarVirtual()">×</button>
</div>
<form id="editMetadataForm" class="mt-4" novalidate>
Please select a core to begin editing.
</form>
<fieldset class="mt-4 hidden">
<div class="grid grid-cols-1 gap-4">
<label for="horizontalSpacing">Horizontal Spacing:</label>
<input type="range" id="horizontalSpacing" name="horizontalSpacing" min="1" max="200"
value="100">
<output for="horizontalSpacing" id="horizontalSpacingValue">50</output>
<label for="verticalSpacing">Vertical Spacing:</label>
<input type="range" id="verticalSpacing" name="verticalSpacing" min="1" max="200"
value="100">
<output for="verticalSpacing" id="verticalSpacingValue">50</output>
<label for="startingX">Starting X:</label>
<input type="range" id="startingX" name="startingX" min="0" max="200" value="0">
<output for="startingX" id="startingXValue">0</output>
<label for="startingY">Starting Y:</label>
<input type="range" id="startingY" name="startingY" min="0" max="200" value="0">
<output for="startingY" id="startingYValue">0</output>
</div>
<button type="button" id="applyVirtualGridSettings"
class="mt-4 w-full text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 transition duration-150 ease-in-out">Apply</button>
</fieldset>
</aside>
<!-- Virtual Grid Display and Interaction -->
<main class="flex-1 w-full mx-auto">
<div id="VirtualGrid" class="tabcontent">
<div class="flex">
<div id="virtualGridSidebarIcon" class="parameterSidebar hidden"
onclick="toggleSidebarVirtual()">
<!-- Menu Icon (three horizontal lines) -->
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 6h16M4 12h16M4 18h16" />
</svg>
</div>
<canvas id="virtualGridCanvas" width="1024" height="1024" style="border:none;"
class="w-full"></canvas>
<!-- Put other virtual grid related content here -->
<div id="VirtualGridSVSContainer"></div>
</div>
</div>
</main>
<!-- Progress Overlay -->
<div id="progressOverlay">
<div class="progress-dialog">
<h2 class="progress-title">Export Progress</h2>
<div id="progressBarContainer">
<div id="progressBar"></div>
</div>
<p id="progressText">Initializing...</p>
</div>
</div>
</div>
<div class="flex justify-between mt-6">
<button
class="btn-back px-4 py-2 bg-red-500 hover:bg-red-700 text-white font-bold rounded focus:outline-none shadow-lg">
Back
</button>
<div class="flex flex-col sm:flex-row gap-4 mt-4">
<button type="button"
class="px-6 py-2 inline-flex items-center justify-center bg-green-600 hover:bg-green-700 text-white rounded-md focus:ring-2 focus:ring-green-500 focus:ring-opacity-50 shadow px-4 py-2 text-base transition duration-150 ease-in-out"
id="saveResultsAsJson">Metadata JSON</button>
<button type="button"
class="px-6 py-2 inline-flex items-center justify-center bg-green-600 hover:bg-green-700 text-white rounded-md focus:ring-2 focus:ring-green-500 focus:ring-opacity-50 shadow px-4 py-2 text-base transition duration-150 ease-in-out"
id="saveResultsAsCsv">Metadata CSV</button>
<button id="downloadAllCoresButton"
class="px-6 py-2 bg-blue-500 hover:bg-blue-700 text-white font-bold rounded focus:outline-none shadow-lg">Export
Grid</button>
</div>
</div>
</section>
</div>
<!-- Carousel controls for the sections -->
<div class="carousel-controls flex justify-center space-x-1 md:space-x-3 p-4 mb-10">
<button id="imageUploadTabButton"
class="carousel-control active w-3 h-3 md:w-4 md:h-4 rounded-full bg-gray-300 hover:bg-gray-400 focus:outline-none transition duration-150 ease-in-out"
data-step="1"></button>
<button id="imageSegmentationTabButton"
class="carousel-control w-3 h-3 md:w-4 md:h-4 rounded-full bg-gray-300 hover:bg-gray-400 focus:outline-none transition duration-150 ease-in-out"
data-step="2" disabled></button>
<button id="rawDataTabButton"
class="carousel-control w-3 h-3 md:w-4 md:h-4 rounded-full bg-gray-300 hover:bg-gray-400 focus:outline-none transition duration-150 ease-in-out"
data-step="3" disabled></button>
<button id="virtualGridTabButton"
class="carousel-control w-3 h-3 md:w-4 md:h-4 rounded-full bg-gray-300 hover:bg-gray-400 focus:outline-none transition duration-150 ease-in-out"
data-step="4" disabled></button>
<!-- ... Add more buttons if you have more steps -->
</div>
<footer class="py-5">
<p class="text-center text-sm text-gray-500">© 2024 Tissue Microarray De-Arraying Tool</p>
</footer>
</div>
</div>
<script src="./javascript/app.js"></script>
<!-- MAIN.JS -->
<script type="module" src="./javascript/main2.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/4.1.0/openseadragon.js" crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/gh/openseadragon/svg-overlay/openseadragon-svg-overlay.js"
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script
src="https://cdn.jsdelivr.net/gh/episphere/GeoTIFFTileSource-JPEG2k@ed333822e17a52dbaf151312ec29c29b5b1d4da5/GeoTIFFTileSource.js"
type="module" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@techstark/[email protected]/dist/opencv.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<!-- Box Content Picker Script -->
<script src="https://cdn01.boxcdn.net/platform/elements/19.0.0/en-US/picker.js"></script>
</body>
</html>