Update index.html
Browse files- index.html +149 -425
index.html
CHANGED
|
@@ -2,451 +2,175 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<
|
|
|
|
| 6 |
<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web@1.18.0/dist/ort.min.js"></script>
|
|
|
|
|
|
|
|
|
|
| 7 |
<style>
|
| 8 |
:root {
|
| 9 |
-
--bg: #
|
| 10 |
-
--
|
| 11 |
-
--
|
| 12 |
-
--
|
| 13 |
-
--
|
| 14 |
-
--
|
| 15 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
| 17 |
-
* { box-sizing: border-box; margin: 0; padding: 0; }
|
| 18 |
-
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
|
| 19 |
-
|
| 20 |
-
header { background: var(--panel); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; }
|
| 21 |
-
header h1 { font-size: 18px; color: #4da6ff; display: flex; align-items: center; gap: 8px; }
|
| 22 |
-
#model-status { font-size: 13px; padding: 4px 10px; border-radius: 12px; background: #2b2e3d; color: #ffb74d; }
|
| 23 |
-
|
| 24 |
-
.main { display: flex; flex: 1; height: calc(100vh - 57px); }
|
| 25 |
-
|
| 26 |
-
/* Left Toolbar */
|
| 27 |
-
.sidebar { width: 340px; background: var(--panel); border-right: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
|
| 28 |
-
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #8892b0; margin-bottom: 6px; }
|
| 29 |
-
.btn { background: var(--accent); color: #fff; border: none; padding: 10px 14px; border-radius: 6px; font-weight: 600; cursor: pointer; width: 100%; transition: 0.2s; }
|
| 30 |
-
.btn:hover { background: #0056b3; }
|
| 31 |
-
.btn:disabled { background: #3a3f52; cursor: not-allowed; opacity: 0.6; }
|
| 32 |
-
|
| 33 |
-
.control-group { background: #161820; padding: 10px; border-radius: 6px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
|
| 34 |
-
.slider-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
|
| 35 |
-
.slider-row input[type="range"] { width: 150px; }
|
| 36 |
-
select { background: #232634; color: var(--text); border: 1px solid var(--border); padding: 8px; border-radius: 6px; width: 100%; font-size: 13px; }
|
| 37 |
-
|
| 38 |
-
/* Center Canvas Viewport */
|
| 39 |
-
.viewport { flex: 1; background: #0a0b0e; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
|
| 40 |
-
#canvas-container { position: relative; cursor: crosshair; }
|
| 41 |
-
#ceph-image { display: block; max-height: 85vh; max-width: 100%; user-select: none; }
|
| 42 |
-
#overlay-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
|
| 43 |
-
|
| 44 |
-
/* Right Analysis Table */
|
| 45 |
-
.analysis-panel { width: 440px; background: var(--panel); border-left: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
|
| 46 |
-
table { width: 100%; border-collapse: collapse; font-size: 12px; }
|
| 47 |
-
th { text-align: left; padding: 8px; color: #8892b0; border-bottom: 1px solid var(--border); }
|
| 48 |
-
td { padding: 8px; border-bottom: 1px solid #232736; }
|
| 49 |
-
.status-badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
|
| 50 |
-
.badge-normal { background: rgba(0, 230, 118, 0.15); color: var(--normal); }
|
| 51 |
-
.badge-dev { background: rgba(255, 82, 82, 0.15); color: var(--deviated); }
|
| 52 |
-
</style>
|
| 53 |
-
</head>
|
| 54 |
-
<body>
|
| 55 |
-
|
| 56 |
-
<header>
|
| 57 |
-
<h1>🦷 Orthodontic Cephalometric ABO Auto-Tracer</h1>
|
| 58 |
-
<div id="model-status">Loading ONNX Neural Network...</div>
|
| 59 |
-
</header>
|
| 60 |
-
|
| 61 |
-
<div class="main">
|
| 62 |
-
<!-- Left Sidebar Controls -->
|
| 63 |
-
<div class="sidebar">
|
| 64 |
-
<div>
|
| 65 |
-
<div class="section-title">1. Patient Radiograph</div>
|
| 66 |
-
<input type="file" id="file-input" accept="image/*" class="btn" style="background: #232634; font-size: 12px; padding: 8px;">
|
| 67 |
-
</div>
|
| 68 |
-
|
| 69 |
-
<button id="run-ai-btn" class="btn" disabled>⚡ Run AI Auto-Tracing</button>
|
| 70 |
-
|
| 71 |
-
<div>
|
| 72 |
-
<div class="section-title">2. Manual Landmark Adjustment</div>
|
| 73 |
-
<div class="control-group">
|
| 74 |
-
<label style="font-size: 12px;">Select Landmark to Move:</label>
|
| 75 |
-
<select id="landmark-select">
|
| 76 |
-
<option value="">None (View Only)</option>
|
| 77 |
-
<option value="S">Sella (S)</option>
|
| 78 |
-
<option value="N">Nasion (N)</option>
|
| 79 |
-
<option value="Po">Porion (Po)</option>
|
| 80 |
-
<option value="Or">Orbitale (Or)</option>
|
| 81 |
-
<option value="A">Point A (Subspinale)</option>
|
| 82 |
-
<option value="B">Point B (Supramentale)</option>
|
| 83 |
-
<option value="Pog">Pogonion (Pog)</option>
|
| 84 |
-
<option value="Me">Menton (Me)</option>
|
| 85 |
-
<option value="Go">Gonion (Go)</option>
|
| 86 |
-
<option value="UIT">Upper Incisor Tip (UIT)</option>
|
| 87 |
-
<option value="UIA">Upper Incisor Apex (UIA)</option>
|
| 88 |
-
<option value="LIT">Lower Incisor Tip (LIT)</option>
|
| 89 |
-
<option value="LIA">Lower Incisor Apex (LIA)</option>
|
| 90 |
-
<option value="Pn">Pronasale (Pn)</option>
|
| 91 |
-
<option value="Ls">Labrale Superius (Ls)</option>
|
| 92 |
-
<option value="Li">Labrale Inferius (Li)</option>
|
| 93 |
-
<option value="Pog_soft">Soft Pogonion (Pog')</option>
|
| 94 |
-
<option value="CAL1">📐 Set Ruler Point 1 (0 mm)</option>
|
| 95 |
-
<option value="CAL2">📐 Set Ruler Point 2 (10 mm)</option>
|
| 96 |
-
</select>
|
| 97 |
-
<span style="font-size: 11px; color: #8892b0;">Select a landmark above, then click its exact position on the x-ray.</span>
|
| 98 |
-
</div>
|
| 99 |
-
</div>
|
| 100 |
-
|
| 101 |
-
<div>
|
| 102 |
-
<div class="section-title">3. Image Adjustments</div>
|
| 103 |
-
<div class="control-group">
|
| 104 |
-
<div class="slider-row">
|
| 105 |
-
<span>Brightness</span>
|
| 106 |
-
<input type="range" id="brightness" min="0.5" max="2.0" step="0.05" value="1.0">
|
| 107 |
-
</div>
|
| 108 |
-
<div class="slider-row">
|
| 109 |
-
<span>Contrast</span>
|
| 110 |
-
<input type="range" id="contrast" min="0.5" max="2.5" step="0.05" value="1.0">
|
| 111 |
-
</div>
|
| 112 |
-
<div class="slider-row">
|
| 113 |
-
<span>Invert Film</span>
|
| 114 |
-
<input type="checkbox" id="invert">
|
| 115 |
-
</div>
|
| 116 |
-
</div>
|
| 117 |
-
</div>
|
| 118 |
-
</div>
|
| 119 |
-
|
| 120 |
-
<!-- Center Radiograph Viewport -->
|
| 121 |
-
<div class="viewport">
|
| 122 |
-
<div id="canvas-container">
|
| 123 |
-
<img id="ceph-image" src="" alt="" style="display: none;">
|
| 124 |
-
<svg id="overlay-svg"></svg>
|
| 125 |
-
</div>
|
| 126 |
-
</div>
|
| 127 |
-
|
| 128 |
-
<!-- Right Analysis Table -->
|
| 129 |
-
<div class="analysis-panel">
|
| 130 |
-
<div class="section-title">Official ABO Analysis Summary</div>
|
| 131 |
-
<table>
|
| 132 |
-
<thead>
|
| 133 |
-
<tr>
|
| 134 |
-
<th>Metric</th>
|
| 135 |
-
<th>Norm</th>
|
| 136 |
-
<th>Measured</th>
|
| 137 |
-
<th>Status</th>
|
| 138 |
-
</tr>
|
| 139 |
-
</thead>
|
| 140 |
-
<tbody id="abo-rows">
|
| 141 |
-
<tr><td colspan="4" style="text-align: center; color: #8892b0; padding: 20px;">Upload a ceph to view ABO metrics</td></tr>
|
| 142 |
-
</tbody>
|
| 143 |
-
</table>
|
| 144 |
-
</div>
|
| 145 |
-
</div>
|
| 146 |
-
|
| 147 |
-
<script>
|
| 148 |
-
// -------------------------------------------------------------
|
| 149 |
-
// 1. Model & Landmark Definitions
|
| 150 |
-
// -------------------------------------------------------------
|
| 151 |
-
const MODEL_URL = "https://huggingface.co/MuhammadNabeelSh/cephalometry-landmarks/resolve/main/landmarks-cepha29.onnx";
|
| 152 |
-
|
| 153 |
-
const LM_INDICES = {
|
| 154 |
-
"A": 0, "ANS": 1, "B": 3, "Gn": 5, "Go": 6, "LIA": 7, "LIT": 8,
|
| 155 |
-
"Li": 11, "Ls": 12, "Me": 13, "N": 14, "Or": 16, "Pn": 18,
|
| 156 |
-
"Po": 19, "Pog": 20, "Pog_soft": 21, "S": 23, "UIA": 25, "UIT": 26
|
| 157 |
-
};
|
| 158 |
-
|
| 159 |
-
const ABO_NORMS = [
|
| 160 |
-
{ id: "SNA", name: "SNA Angle", norm: 82.0, sd: 2.0, unit: "°" },
|
| 161 |
-
{ id: "SNB", name: "SNB Angle", norm: 80.0, sd: 2.0, unit: "°" },
|
| 162 |
-
{ id: "ANB", name: "ANB Difference", norm: 2.0, sd: 2.0, unit: "°" },
|
| 163 |
-
{ id: "FMA", name: "FMA (FH to MP)", norm: 25.0, sd: 4.0, unit: "°" },
|
| 164 |
-
{ id: "SNMP", name: "SN to MP Angle", norm: 32.0, sd: 5.0, unit: "°" },
|
| 165 |
-
{ id: "IMPA", name: "IMPA (L1 to MP)", norm: 90.0, sd: 5.0, unit: "°" },
|
| 166 |
-
{ id: "U1SN", name: "U1 to SN Angle", norm: 102.0, sd: 5.0, unit: "°" },
|
| 167 |
-
{ id: "U1NA_deg", name: "U1 to NA Angle", norm: 22.0, sd: 4.0, unit: "°" },
|
| 168 |
-
{ id: "U1NA_mm", name: "U1 to NA (mm)", norm: 4.0, sd: 2.0, unit: "mm" },
|
| 169 |
-
{ id: "L1NB_deg", name: "L1 to NB Angle", norm: 25.0, sd: 4.0, unit: "°" },
|
| 170 |
-
{ id: "L1NB_mm", name: "L1 to NB (mm)", norm: 4.0, sd: 2.0, unit: "mm" },
|
| 171 |
-
{ id: "IIA", name: "Interincisal Angle", norm: 130.0, sd: 6.0, unit: "°" },
|
| 172 |
-
{ id: "UL_E", name: "Upper Lip to E-Line", norm: -3.0, sd: 2.0, unit: "mm" },
|
| 173 |
-
{ id: "LL_E", name: "Lower Lip to E-Line", norm: -1.0, sd: 2.0, unit: "mm" }
|
| 174 |
-
];
|
| 175 |
-
|
| 176 |
-
let session = null;
|
| 177 |
-
let coords = {};
|
| 178 |
-
let pxPerMm = 10.0;
|
| 179 |
-
let calPt1 = null;
|
| 180 |
-
|
| 181 |
-
const imgElem = document.getElementById("ceph-image");
|
| 182 |
-
const svgElem = document.getElementById("overlay-svg");
|
| 183 |
-
const statusElem = document.getElementById("model-status");
|
| 184 |
-
const runAiBtn = document.getElementById("run-ai-btn");
|
| 185 |
-
const container = document.getElementById("canvas-container");
|
| 186 |
-
|
| 187 |
-
// -------------------------------------------------------------
|
| 188 |
-
// 2. Load ONNX Web Model
|
| 189 |
-
// -------------------------------------------------------------
|
| 190 |
-
async function initModel() {
|
| 191 |
-
try {
|
| 192 |
-
ort.env.wasm.numThreads = 1;
|
| 193 |
-
session = await ort.InferenceSession.create(MODEL_URL, { executionProviders: ['wasm'] });
|
| 194 |
-
statusElem.innerText = "● Model Ready (Free Browser Compute)";
|
| 195 |
-
statusElem.style.color = "#00e676";
|
| 196 |
-
if (imgElem.src) runAiBtn.disabled = false;
|
| 197 |
-
} catch (err) {
|
| 198 |
-
statusElem.innerText = "Error loading weights: " + err.message;
|
| 199 |
-
statusElem.style.color = "#ff5252";
|
| 200 |
-
}
|
| 201 |
-
}
|
| 202 |
-
initModel();
|
| 203 |
-
|
| 204 |
-
// -------------------------------------------------------------
|
| 205 |
-
// 3. Image Loading & Filters
|
| 206 |
-
// -------------------------------------------------------------
|
| 207 |
-
document.getElementById("file-input").addEventListener("change", (e) => {
|
| 208 |
-
const file = e.target.files[0];
|
| 209 |
-
if (!file) return;
|
| 210 |
-
const reader = new FileReader();
|
| 211 |
-
reader.onload = (evt) => {
|
| 212 |
-
imgElem.onload = () => {
|
| 213 |
-
svgElem.setAttribute("viewBox", `0 0 ${imgElem.naturalWidth} ${imgElem.naturalHeight}`);
|
| 214 |
-
svgElem.setAttribute("width", imgElem.clientWidth);
|
| 215 |
-
svgElem.setAttribute("height", imgElem.clientHeight);
|
| 216 |
-
if (session) runAiBtn.disabled = false;
|
| 217 |
-
};
|
| 218 |
-
imgElem.src = evt.target.result;
|
| 219 |
-
imgElem.style.display = "block";
|
| 220 |
-
coords = {};
|
| 221 |
-
renderAnalysis();
|
| 222 |
-
};
|
| 223 |
-
reader.readAsDataURL(file);
|
| 224 |
-
});
|
| 225 |
-
|
| 226 |
-
function applyFilters() {
|
| 227 |
-
const b = document.getElementById("brightness").value;
|
| 228 |
-
const c = document.getElementById("contrast").value;
|
| 229 |
-
const inv = document.getElementById("invert").checked ? 1 : 0;
|
| 230 |
-
imgElem.style.filter = `brightness(${b}) contrast(${c}) invert(${inv})`;
|
| 231 |
-
}
|
| 232 |
-
document.getElementById("brightness").addEventListener("input", applyFilters);
|
| 233 |
-
document.getElementById("contrast").addEventListener("input", applyFilters);
|
| 234 |
-
document.getElementById("invert").addEventListener("change", applyFilters);
|
| 235 |
-
|
| 236 |
-
// -------------------------------------------------------------
|
| 237 |
-
// 4. Run AI Inference (Browser Side)
|
| 238 |
-
// -------------------------------------------------------------
|
| 239 |
-
runAiBtn.addEventListener("click", async () => {
|
| 240 |
-
if (!session || !imgElem.src) return;
|
| 241 |
-
runAiBtn.disabled = true;
|
| 242 |
-
statusElem.innerText = "Running Landmark Detection...";
|
| 243 |
-
|
| 244 |
-
// Resize to 768x768 for the network
|
| 245 |
-
const offCanvas = document.createElement("canvas");
|
| 246 |
-
offCanvas.width = 768;
|
| 247 |
-
offCanvas.height = 768;
|
| 248 |
-
const ctx = offCanvas.getContext("2d");
|
| 249 |
-
ctx.drawImage(imgElem, 0, 0, 768, 768);
|
| 250 |
-
const imgData = ctx.getImageData(0, 0, 768, 768).data;
|
| 251 |
-
|
| 252 |
-
// Preprocess: NCHW format + ImageNet Normalization
|
| 253 |
-
const floatArr = new Float32Array(3 * 768 * 768);
|
| 254 |
-
const mean = [0.485, 0.456, 0.406];
|
| 255 |
-
const std = [0.229, 0.224, 0.225];
|
| 256 |
-
|
| 257 |
-
for (let i = 0; i < 768 * 768; i++) {
|
| 258 |
-
const r = imgData[i * 4] / 255.0;
|
| 259 |
-
const g = imgData[i * 4 + 1] / 255.0;
|
| 260 |
-
const b = imgData[i * 4 + 2] / 255.0;
|
| 261 |
-
floatArr[i] = (r - mean[0]) / std[0];
|
| 262 |
-
floatArr[768 * 768 + i] = (g - mean[1]) / std[1];
|
| 263 |
-
floatArr[2 * 768 * 768 + i] = (b - mean[2]) / std[2];
|
| 264 |
-
}
|
| 265 |
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
let maxVal = -Infinity;
|
| 277 |
-
let maxIdx = 0;
|
| 278 |
-
const offset = ch * 192 * 192;
|
| 279 |
-
for (let j = 0; j < 192 * 192; j++) {
|
| 280 |
-
if (heatmaps[offset + j] > maxVal) {
|
| 281 |
-
maxVal = heatmaps[offset + j];
|
| 282 |
-
maxIdx = j;
|
| 283 |
-
}
|
| 284 |
}
|
| 285 |
-
const py = Math.floor(maxIdx / 192);
|
| 286 |
-
const px = maxIdx % 192;
|
| 287 |
-
coords[name] = {
|
| 288 |
-
x: (px / 192) * origW,
|
| 289 |
-
y: (py / 192) * origH
|
| 290 |
-
};
|
| 291 |
-
}
|
| 292 |
-
|
| 293 |
-
statusElem.innerText = "● Tracing & Analysis Complete";
|
| 294 |
-
runAiBtn.disabled = false;
|
| 295 |
-
renderAnalysis();
|
| 296 |
-
});
|
| 297 |
-
|
| 298 |
-
// -------------------------------------------------------------
|
| 299 |
-
// 5. Click to Adjust Landmark or Calibrate
|
| 300 |
-
// -------------------------------------------------------------
|
| 301 |
-
container.addEventListener("click", (e) => {
|
| 302 |
-
const selectedLm = document.getElementById("landmark-select").value;
|
| 303 |
-
if (!selectedLm || !imgElem.naturalWidth) return;
|
| 304 |
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
if (d > 0) pxPerMm = d / 10.0;
|
| 317 |
}
|
| 318 |
-
} else {
|
| 319 |
-
coords[selectedLm] = { x: clickX, y: clickY };
|
| 320 |
-
}
|
| 321 |
-
|
| 322 |
-
renderAnalysis();
|
| 323 |
-
});
|
| 324 |
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
const v1 = { x: p1.x - v.x, y: p1.y - v.y };
|
| 331 |
-
const v2 = { x: p2.x - v.x, y: p2.y - v.y };
|
| 332 |
-
const dot = v1.x * v2.x + v1.y * v2.y;
|
| 333 |
-
const mag1 = Math.hypot(v1.x, v1.y);
|
| 334 |
-
const mag2 = Math.hypot(v2.x, v2.y);
|
| 335 |
-
return (Math.acos(Math.max(-1, Math.min(1, dot / (mag1 * mag2 + 1e-7)))) * (180 / Math.PI)).toFixed(1);
|
| 336 |
-
}
|
| 337 |
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
|
|
|
|
|
|
| 349 |
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
const cross = lineVec.x * (pt.y - l1.y) - lineVec.y * (pt.x - l1.x);
|
| 356 |
-
return (cross / lineLen / pxPerMm).toFixed(1);
|
| 357 |
-
}
|
| 358 |
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
|
|
|
| 365 |
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
l.setAttribute("stroke", col); l.setAttribute("stroke-width", w);
|
| 372 |
-
svgElem.appendChild(l);
|
| 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 |
-
const iia = getLineAngle(coords.UIT, coords.UIA, coords.LIT, coords.LIA);
|
| 414 |
-
const ul_e = getPerpDist(coords.Ls, coords.Pn, coords.Pog_soft);
|
| 415 |
-
const ll_e = getPerpDist(coords.Li, coords.Pn, coords.Pog_soft);
|
| 416 |
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 422 |
|
| 423 |
-
|
| 424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 425 |
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
|
|
|
| 430 |
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
statusHtml = isNormal
|
| 436 |
-
? `<span class="status-badge badge-normal">Normal</span>`
|
| 437 |
-
: `<span class="status-badge badge-dev">${val > metric.norm ? 'High' : 'Low'}</span>`;
|
| 438 |
}
|
| 439 |
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
}
|
| 450 |
-
</script>
|
| 451 |
-
</body>
|
| 452 |
-
</html>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>OrthoCeph Pro | Automated ABO Cephalometric Analysis</title>
|
| 7 |
<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web@1.18.0/dist/ort.min.js"></script>
|
| 8 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 9 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
| 11 |
<style>
|
| 12 |
:root {
|
| 13 |
+
--bg-dark: #0b0f19;
|
| 14 |
+
--surface-dark: #111827;
|
| 15 |
+
--surface-card: #1f293d;
|
| 16 |
+
--surface-border: #2e3b55;
|
| 17 |
+
--accent: #2563eb;
|
| 18 |
+
--accent-hover: #1d4ed8;
|
| 19 |
+
--accent-glow: rgba(37, 99, 235, 0.25);
|
| 20 |
+
--text-main: #f8fafc;
|
| 21 |
+
--text-muted: #94a3b8;
|
| 22 |
+
--status-green: #10b981;
|
| 23 |
+
--status-red: #f43f5e;
|
| 24 |
+
--status-amber: #f59e0b;
|
| 25 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
| 28 |
+
body {
|
| 29 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
| 30 |
+
background-color: var(--bg-dark);
|
| 31 |
+
color: var(--text-main);
|
| 32 |
+
height: 100vh;
|
| 33 |
+
display: flex;
|
| 34 |
+
flex-direction: column;
|
| 35 |
+
overflow: hidden;
|
| 36 |
+
-webkit-font-smoothing: antialiased;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
/* Modern Top Navigation Bar */
|
| 40 |
+
header {
|
| 41 |
+
background: var(--surface-dark);
|
| 42 |
+
border-bottom: 1px solid var(--surface-border);
|
| 43 |
+
height: 64px;
|
| 44 |
+
padding: 0 24px;
|
| 45 |
+
display: flex;
|
| 46 |
+
align-items: center;
|
| 47 |
+
justify-content: space-between;
|
| 48 |
+
flex-shrink: 0;
|
| 49 |
+
z-index: 10;
|
|
|
|
| 50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
+
.brand {
|
| 53 |
+
display: flex;
|
| 54 |
+
align-items: center;
|
| 55 |
+
gap: 12px;
|
| 56 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
.brand-icon {
|
| 59 |
+
width: 36px;
|
| 60 |
+
height: 36px;
|
| 61 |
+
background: linear-gradient(135deg, #3b82f6, #1d4ed8);
|
| 62 |
+
border-radius: 8px;
|
| 63 |
+
display: flex;
|
| 64 |
+
align-items: center;
|
| 65 |
+
justify-content: center;
|
| 66 |
+
font-weight: 700;
|
| 67 |
+
font-size: 18px;
|
| 68 |
+
color: white;
|
| 69 |
+
box-shadow: 0 0 16px var(--accent-glow);
|
| 70 |
+
}
|
| 71 |
|
| 72 |
+
.brand-title {
|
| 73 |
+
font-size: 16px;
|
| 74 |
+
font-weight: 700;
|
| 75 |
+
letter-spacing: -0.02em;
|
| 76 |
+
}
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
.brand-subtitle {
|
| 79 |
+
font-size: 11px;
|
| 80 |
+
color: var(--text-muted);
|
| 81 |
+
font-weight: 500;
|
| 82 |
+
text-transform: uppercase;
|
| 83 |
+
letter-spacing: 0.05em;
|
| 84 |
+
}
|
| 85 |
|
| 86 |
+
.header-actions {
|
| 87 |
+
display: flex;
|
| 88 |
+
align-items: center;
|
| 89 |
+
gap: 16px;
|
| 90 |
+
}
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
+
#status-badge {
|
| 93 |
+
display: flex;
|
| 94 |
+
align-items: center;
|
| 95 |
+
gap: 8px;
|
| 96 |
+
font-size: 12px;
|
| 97 |
+
font-weight: 500;
|
| 98 |
+
background: rgba(30, 41, 59, 0.8);
|
| 99 |
+
border: 1px solid var(--surface-border);
|
| 100 |
+
padding: 6px 14px;
|
| 101 |
+
border-radius: 20px;
|
| 102 |
+
color: var(--text-muted);
|
| 103 |
+
}
|
| 104 |
|
| 105 |
+
#status-badge .indicator {
|
| 106 |
+
width: 8px;
|
| 107 |
+
height: 8px;
|
| 108 |
+
border-radius: 50%;
|
| 109 |
+
background-color: var(--status-amber);
|
| 110 |
+
box-shadow: 0 0 8px var(--status-amber);
|
| 111 |
+
}
|
| 112 |
|
| 113 |
+
/* Main Workspace Layout */
|
| 114 |
+
.workspace {
|
| 115 |
+
display: flex;
|
| 116 |
+
flex: 1;
|
| 117 |
+
height: calc(100vh - 64px);
|
| 118 |
+
overflow: hidden;
|
| 119 |
+
}
|
| 120 |
|
| 121 |
+
/* Left Control Sidebar */
|
| 122 |
+
.sidebar {
|
| 123 |
+
width: 330px;
|
| 124 |
+
background: var(--surface-dark);
|
| 125 |
+
border-right: 1px solid var(--surface-border);
|
| 126 |
+
padding: 20px;
|
| 127 |
+
display: flex;
|
| 128 |
+
flex-direction: column;
|
| 129 |
+
gap: 20px;
|
| 130 |
+
overflow-y: auto;
|
| 131 |
+
flex-shrink: 0;
|
| 132 |
+
}
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
+
.section-header {
|
| 135 |
+
font-size: 11px;
|
| 136 |
+
font-weight: 700;
|
| 137 |
+
text-transform: uppercase;
|
| 138 |
+
letter-spacing: 0.08em;
|
| 139 |
+
color: var(--text-muted);
|
| 140 |
+
margin-bottom: 10px;
|
| 141 |
+
display: flex;
|
| 142 |
+
justify-content: space-between;
|
| 143 |
+
align-items: center;
|
| 144 |
+
}
|
| 145 |
|
| 146 |
+
.card {
|
| 147 |
+
background: var(--surface-card);
|
| 148 |
+
border: 1px solid var(--surface-border);
|
| 149 |
+
border-radius: 10px;
|
| 150 |
+
padding: 14px;
|
| 151 |
+
display: flex;
|
| 152 |
+
flex-direction: column;
|
| 153 |
+
gap: 10px;
|
| 154 |
+
}
|
| 155 |
|
| 156 |
+
.form-group {
|
| 157 |
+
display: flex;
|
| 158 |
+
flex-direction: column;
|
| 159 |
+
gap: 4px;
|
| 160 |
+
}
|
| 161 |
|
| 162 |
+
.form-group label {
|
| 163 |
+
font-size: 11px;
|
| 164 |
+
font-weight: 500;
|
| 165 |
+
color: var(--text-muted);
|
|
|
|
|
|
|
|
|
|
| 166 |
}
|
| 167 |
|
| 168 |
+
.input-field {
|
| 169 |
+
background: #0f172a;
|
| 170 |
+
border: 1px solid var(--surface-border);
|
| 171 |
+
border-radius: 6px;
|
| 172 |
+
padding: 8px 12px;
|
| 173 |
+
color: var(--text-main);
|
| 174 |
+
font-size: 13px;
|
| 175 |
+
outline: none;
|
| 176 |
+
transition
|
|
|
|
|
|
|
|
|
|
|
|