Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>EEG Data Visualization and Interpretation</title>
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
- </head>
- <body>
- <textarea id="dataInput" rows="10" cols="50" placeholder="Paste EEG data here..."></textarea>
- <button onclick="generateChart()">Generate Chart</button>
- <div style="width:600px; margin-top:20px;">
- <canvas id="eegChart"></canvas>
- </div>
- <div id="interpretation" style="margin-top:20px;"></div>
- <script>
- function parseData(data) {
- const lines = data.split('\n');
- const parsedData = lines.map(line => {
- const parts = line.split('\t').map(part => part.trim());
- return {
- label: parts[0],
- value: parseFloat(parts[1]),
- ratio: parseFloat(parts[2])
- };
- });
- return parsedData.filter(d => !isNaN(d.value)); // Filter out non-numerical entries
- }
- function interpretData(parsedData) {
- let interpretation = "";
- parsedData.forEach(d => {
- switch(d.label) {
- // Interpretations for CZ
- case "CZ Theta (3-7 Hz) increase during Eyes Closed":
- if (d.value > 0) {
- interpretation += "Indicates a visual processing problem, poor retention of information, or short-term memory issues.<br>";
- }
- break;
- case "CZ Theta (3-7 Hz) decrease during Eyes Open":
- if (d.value > 0) {
- interpretation += "Suggests foggy thinking.<br>";
- }
- break;
- case "CZ Theta/Beta ratio (3-7 Hz / 16-25 Hz) above 2.2":
- if (d.value > 2.2) {
- interpretation += "May indicate attention deficit issues (CADD).<br>";
- }
- break;
- case "CZ Theta/Beta ratio (3-7 Hz / 16-25 Hz) above 2.2 during Up Training (UT)":
- if (d.value > 2.2) {
- interpretation += "May suggest CADD if ratio drops. If ratio is above 3.0, it may indicate ADHD.<br>";
- }
- break;
- case "CZ Delta (1.5-2.5 Hz) increase during Eyes Closed above 9.0":
- if (d.value > 9.0) {
- interpretation += "May suggest cognitive deficits such as concentration problems, forgetfulness, and comprehension issues.<br>";
- }
- break;
- case "CZ Theta/Beta ratio (3-7 Hz / 16-25 Hz) above 2.2 and percentage change > 15%":
- if (d.value > 2.2) {
- interpretation += "May indicate attention-related issues.<br>";
- }
- break;
- case "CZ Total amplitude (Theta + Alpha + Beta) above a specific range (e.g., 70)":
- if (d.value > 70) {
- interpretation += "May suggest excessive brainwave activity.<br>";
- }
- break;
- case "CZ Total amplitude at CZ above 60":
- if (d.value > 60) {
- interpretation += "May indicate developmental delay, autistic spectrum behavior, or marked cognitive deficits.<br>";
- }
- break;
- case "CZ Increase Eyes Open to Eyes Closed Alpha difference by more than 30% (8-12 Hz)":
- if (d.value > 30) {
- interpretation += "To improve visual processing and memory.<br>";
- }
- break;
- case "CZ Decrease Eyes Open Theta/Beta ratio (3-7 Hz / 16-25 Hz) to below 2.2":
- if (d.value < 2.2) {
- interpretation += "To reduce inattention.<br>";
- }
- break;
- case "CZ Train Eyes Open Theta/Beta ratio to under 2.2":
- if (d.value < 2.2) {
- interpretation += "For improved reading comprehension and retention.<br>";
- }
- break;
- case "CZ Consider ADD and reading difficulties if CZ Eyes Open Theta/Beta is above 2.2 and CZ Eyes Open T/B is below 2.2":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "CZ Consider ADHD if CZ Eyes Open Theta/Beta is above 2.2 and CZ Eyes Open T/B is above 3.0":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "CZ Theta (3-7 Hz) range":
- interpretation += "Indicates a relaxed or meditative state.<br>";
- break;
- case "CZ Alpha (8-12 Hz) range":
- interpretation += "Associated with a calm and focused state of mind.<br>";
- break;
- case "CZ Beta (16-25 Hz) range":
- interpretation += "Related to active thinking, problem-solving, and concentration.<br>";
- break;
- case "CZ High Beta (28-40 Hz) range":
- interpretation += "May indicate heightened alertness or anxiety.<br>";
- break;
- // Interpretations for O1
- case "O1 Increase in Eyes Closed Alpha (8-12 Hz) of less than 50% or negative change, along with similar pattern at CZ":
- if (d.value < 50) {
- interpretation += "May suggest traumatic stress.<br>";
- }
- break;
- case "O1 Percentage change of Alpha (8-12 Hz) greater than 25% during Eyes Open":
- if (d.value > 25) {
- interpretation += "May indicate foggy thinking.<br>";
- }
- break;
- case "O1 Theta/Beta ratio (3-7 Hz / 16-25 Hz) during Eyes Open below 1.8":
- if (d.value < 1.8) {
- interpretation += "May indicate poor stress tolerance, racing thoughts, and anxiety.<br>";
- }
- break;
- case "O1 Theta/Beta ratio (3-7 Hz / 16-25 Hz) during Eyes Open above 3.0":
- if (d.value > 3.0) {
- interpretation += "May be associated with cognitive deficiencies or Asperger's patterns. Consider examining F4/F3 Beta as well.<br>";
- }
- break;
- case "O1 Theta/Beta ratio (3-7 Hz / 16-25 Hz) during both Eyes Closed and Eyes Open around or below 1.5":
- if (d.value <= 1.5) {
- interpretation += "May indicate sleep disturbance.<br>";
- }
- break;
- case "O1 Theta/Beta ratio (3-7 Hz / 16-25 Hz) during Eyes Open below 1.8 and a percentage change greater than 3.0":
- if (d.value < 1.8 && d.ratio > 3.0) {
- interpretation += "May be associated with cognitive deficiencies or Asperger's patterns.<br>";
- }
- break;
- case "O1 Increase O1 Eyes Open Theta/Beta ratio (3-7 Hz / 16-25 Hz) to between 1.8-2.2":
- if (d.value >= 1.8 && d.value <= 2.2) {
- interpretation += "To address stress tolerance, racing thoughts, and anxiety.<br>";
- }
- break;
- case "O1 Decrease O1 Eyes Open Theta/Beta ratio to below 1.8":
- if (d.value < 1.8) {
- interpretation += "To address self-medicating behaviors and depression.<br>";
- }
- break;
- case "O1 Balance O1 Eyes Closed and Eyes Open Theta/Beta ratio to 1.5":
- if (d.value === 1.5) {
- interpretation += "To improve sleep disturbance.<br>";
- }
- break;
- case "O1 Increase Peak Alpha Frequency Eyes Open at O1 (8-12 Hz)":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "O1 Theta (3-7 Hz) range":
- interpretation += "Associated with deep relaxation and daydreaming.<br>";
- break;
- case "O1 Alpha (8-12 Hz) range":
- interpretation += "Linked to a relaxed and calm state of mind.<br>";
- break;
- case "O1 SMR (12-15 Hz) range":
- interpretation += "Associated with focused attention and sensorimotor integration.<br>";
- break;
- // Interpretations for F3 and F4
- case "F3 and F4 Theta/Beta ratio (3-7 Hz / 16-25 Hz) above 2.2":
- if (d.value > 2.2) {
- interpretation += "May suggest cognitive deficiencies, impulse control issues, or emotional volatility.<br>";
- }
- break;
- case "F3 and F4 Negative percentage difference between Theta/Beta ratio (3-7 Hz / 16-25 Hz)":
- if (d.value > 20) {
- interpretation += "May indicate emotional volatility, anger management problems, or emotional impulse control issues.<br>";
- }
- break;
- case "F3 and F4 Alpha (8-12 Hz) increase during Eyes Closed at F4":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "F3 and F4 Beta (16-25 Hz) difference between F4 and F3":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "F3 and F4 Alpha (8-12 Hz) difference between F3 and F4":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "F3 and F4 Theta/Beta ratio (3-7 Hz / 16-25 Hz) above 2.2 and percentage change greater than 15%":
- if (d.value > 2.2) {
- interpretation += "May suggest cognitive deficiencies, impulse control issues, or emotional volatility.<br>";
- }
- break;
- case "F3 and F4 Difference between Theta/Beta ratio (3-7 Hz / 16-25 Hz) at F3 and F4 above a specific threshold (e.g., 20%)":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "F3 and F4 Alpha (8-12 Hz) increase during Eyes Closed at F3 or F4 within a specific range (e.g., 1.2-1.6)":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "F3 and F4 Lower Theta/Beta ratio at F3 or F4 (3-7 Hz / 16-25 Hz) to below 2.2":
- if (d.value < 2.2) {
- interpretation += "To address cognitive deficiencies, impulse control, and emotional volatility.<br>";
- }
- break;
- case "F3 and F4 Train Alpha Eyes Closed at F4 (8-12 Hz) to between 1.2-1.6":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "F3 and F4 Reduce F3/F4 Theta and Beta percentage difference":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- // Interpretations for FZ
- case "FZ HiBeta/Beta ratio (28-40 Hz / 16-25 Hz) below 0.45":
- if (d.value < 0.45) {
- interpretation += "May indicate excessive passivity.<br>";
- }
- break;
- case "FZ HiBeta/Beta ratio (28-40 Hz / 16-25 Hz) above 0.55":
- if (d.value > 0.55) {
- interpretation += "May be associated with stubborn behavior, obsessive-compulsive tendencies, perseveration in autistic spectrum behaviors, or anxiety.<br>";
- }
- break;
- case "FZ Sum of HiBeta + Beta above 15":
- if (d.value > 15) {
- interpretation += "May indicate perseverative behavior.<br>";
- }
- break;
- case "FZ LoAlpha/HiAlpha ratio (8-9 Hz / 11-12 Hz) below 1.5":
- if (d.value < 1.5) {
- interpretation += "May suggest cognitive inefficiency, age-related deficits in memory and cognitive processing, or sleep disorders.<br>";
- }
- break;
- case "FZ Train HiBeta/Beta ratio at FZ (28-40 Hz / 16-25 Hz) to between 0.45-0.55":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "FZ Decrease Sum of HiBeta + Beta at FZ to below 15":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "FZ Lower LoAlpha/HiAlpha ratio at FZ (8-9 Hz / 11-12 Hz) to below 1.5":
- // No specific interpretation provided
- interpretation += "<br>";
- break;
- case "FZ Alpha (8-12 Hz) range":
- interpretation += "Associated with relaxation, creativity, and mental imagery.<br>";
- break;
- case "FZ HiAlpha (11-12 Hz) range":
- interpretation += "Associated with focused attention and sensorimotor integration.<br>";
- break;
- }
- });
- // Check if interpretation is not empty before returning
- return interpretation.trim() !== "" ? interpretation : "No flagged interpretations.";
- }
- function generateChart() {
- const dataInput = document.getElementById('dataInput').value;
- const parsedData = parseData(dataInput);
- // Generate chart
- const ctx = document.getElementById('eegChart').getContext('2d');
- const labels = parsedData.map(d => d.label);
- const values = parsedData.map(d => d.value);
- const chart = new Chart(ctx, {
- type: 'bar',
- data: {
- labels: labels,
- datasets: [{
- label: 'EEG Data',
- data: values,
- backgroundColor: 'rgba(54, 162, 235, 0.2)',
- borderColor: 'rgba(54, 162, 235, 1)',
- borderWidth: 1
- }]
- },
- options: {
- scales: {
- y: {
- beginAtZero: true
- }
- }
- }
- });
- // Display interpretations
- const interpretationDiv = document.getElementById('interpretation');
- interpretationDiv.innerHTML = interpretData(parsedData);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement