Skip to content

Commit 8c2c430

Browse files
committed
add marking tables
1 parent 51baef4 commit 8c2c430

File tree

5 files changed

+597
-3
lines changed

5 files changed

+597
-3
lines changed

apps/collection/viewer.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@
154154
.download{
155155
background-color: #00cc99 !important;
156156
}
157+
158+
.marking{
159+
background-color: #cc0092 !important;
160+
}
157161
</style>
158162
</head>
159163
<body>
@@ -247,6 +251,12 @@
247251
workflow_url = `../labeling/downloadTable.html?collectionId=${d._id.$oid}`
248252
card.classList.add("download");
249253
}
254+
255+
if (d.task == "marking"){
256+
workflow_title = "Marking";
257+
workflow_url = `../labeling/roiMarkingTable.html?collectionId=${d._id.$oid}`
258+
card.classList.add("marking");
259+
}
250260
if (d.task == "proficiency"){
251261
workflow_title = "Proficency";
252262
workflow_url = `../labeling/profTable.html?collectionId=${d._id.$oid}`

apps/labeling/labelingSimpleAnnotationViewer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,3 +481,4 @@
481481
document.addEventListener("DOMContentLoaded", initialize);
482482
</script>
483483
</html>
484+

apps/labeling/mark_roi_pick.html

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="keywords" content="camicroscope, quip" />
5+
<meta charset="utf-8" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
9+
<title>caMicroscope</title>
10+
<!-- google material icons css sheet -->
11+
<link
12+
rel="stylesheet"
13+
type="text/css"
14+
media="all"
15+
href="../../iconfont/material-icons.css"
16+
/>
17+
<!-- css sheet -->
18+
<link
19+
rel="stylesheet"
20+
type="text/css"
21+
media="all"
22+
href="../../css/style.css"
23+
/>
24+
<link
25+
rel="stylesheet"
26+
type="text/css"
27+
media="all"
28+
href="../../components/loading/loading.css"
29+
/>
30+
<script
31+
type="text/javascript"
32+
src="../../components/loading/loading.js"
33+
></script>
34+
<script type="text/javascript" src="../../common/ajv.js"></script>
35+
<script type="text/javascript" src="../../common/SHA256.js"></script>
36+
<script type="text/javascript" src="../../common/util.js"></script>
37+
<script type="text/javascript" src="../../core/Validation.js"></script>
38+
<script type="text/javascript" src="../../core/Store.js"></script>
39+
<style type="text/css">
40+
.modalbox-footer button {
41+
font-weight: bold;
42+
border: none;
43+
background-color: #ffffff;
44+
outline: none;
45+
cursor: pointer;
46+
padding: 5px 10px;
47+
margin: 5px 0;
48+
color: #365f9c;
49+
}
50+
51+
.modalbox-footer button:disabled {
52+
border: 1px solid #7f7f7f;
53+
background-color: #bfbfbf;
54+
}
55+
</style>
56+
</head>
57+
<body>
58+
<h1 id="message" style="color: black">Loading...</h1>
59+
</body>
60+
<script type="text/javascript">
61+
62+
function shuffleArray(array) {
63+
for (var i = array.length - 1; i > 0; i--) {
64+
var j = Math.floor(Math.random() * (i + 1));
65+
var temp = array[i];
66+
array[i] = array[j];
67+
array[j] = temp;
68+
}
69+
}
70+
71+
const params = getUrlVars();
72+
const slideId = params.slideId;
73+
const cid = params.collectionId;
74+
async function initialize() {
75+
const store = new Store("../../data/");
76+
const creator = getUserId();
77+
const rois = await store.findLabeling({
78+
"provenance.image.slide": slideId,
79+
"provenance.analysis.computation": "label",
80+
});
81+
let vtas = await store.findLabelingAnnotation({
82+
"provenance.image.slide": slideId,
83+
"provenance.analysis.computation": "annotation",
84+
"provenance.analysis.type": "simple",
85+
creator,
86+
});
87+
done_rois = vtas.map(x => x.parent);
88+
all_rois = rois.map(x=>x._id.$oid);
89+
todo_rois = all_rois.filter(x=>done_rois.indexOf(x)==-1 )
90+
console.log(done_rois, all_rois, todo_rois)
91+
92+
if (todo_rois.length == 0){
93+
// All Done
94+
redirect(
95+
`./roiMakingTable.html?collectionId=${cid}`,
96+
"Redirecting...",
97+
0
98+
);
99+
} else {
100+
shuffleArray(todo_rois)
101+
console.log(todo_rois)
102+
r = todo_rois[0]
103+
console.log(`label ID :${r}`);
104+
window.location.href = `./roiMarking.html?labelId=${r}&slideId=${slideId}&collectionId=${cid}`;
105+
return;
106+
}
107+
108+
109+
//window.location.href = `../collection/viewer.html?collectionId=${cid}`;
110+
}
111+
document.addEventListener("DOMContentLoaded", initialize);
112+
</script>
113+
</html>

apps/labeling/roiMarking.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ async function saveAnnotation(annotation) {
484484
// .then((d)=>d);
485485
// remove listener
486486
window.removeEventListener('beforeunload', beforeUnloadHandler);
487-
window.location.href = `./roi_pick.html?slideId=${$D.params.slideId}&collectionId=${$D.params.collectionId}`;
487+
window.location.href = `./mark_roi_pick.html?slideId=${$D.params.slideId}&collectionId=${$D.params.collectionId}`;
488488
Loading.close();
489489
} else {
490490
alert(JSON.stringify(rs));
@@ -530,7 +530,7 @@ function enableFeedbackForm() {
530530
const feedback = document.getElementById('feedback');
531531
const next = document.getElementById('next');
532532
next.addEventListener('click', ()=>{
533-
window.location.href = `./roi_pick.html?slideId=${$D.params.slideId}&collectionId=${$D.params.collectionId}`;
533+
window.location.href = `./mark_roi_pick.html?slideId=${$D.params.slideId}&collectionId=${$D.params.collectionId}`;
534534
});
535535
feedback.style.display = 'block';
536536
next.style.display = 'block';
@@ -644,7 +644,7 @@ async function loadingData() {
644644
if (x.length>0){
645645
alert("You've already done this label.")
646646
window.removeEventListener('beforeunload', beforeUnloadHandler);
647-
window.location.href = `./roi_pick.html?slideId=${$D.params.slideId}&collectionId=${$D.params.collectionId}`;
647+
window.location.href = `./mark_roi_pick.html?slideId=${$D.params.slideId}&collectionId=${$D.params.collectionId}`;
648648
}
649649
});
650650
//

0 commit comments

Comments
 (0)