|
| 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> |
0 commit comments