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="generateSummary()">Generate Summary</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) {
- // Flagged interpretations and protocol recommendations for CZ
- case "CZ EO Alpha":
- interpretation += "<b>CZ Eyes Open Alpha:</b> Indicates the amplitude of alpha waves during eyes open condition.<br>";
- break;
- case "EC Alpha":
- interpretation += "<b>CZ Eyes Closed Alpha:</b> Indicates the amplitude of alpha waves during eyes closed condition.<br>";
- break;
- case "Percent change EO to EC Alpha > 30%":
- if (d.value > 30) {
- interpretation += "<b>Flagged Interpretation:</b> Percent change in alpha amplitude from eyes open to eyes closed condition is greater than 30%.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "EO Alpha Recovery":
- interpretation += "<b>Alpha Recovery:</b> Indicates the recovery of alpha amplitude after eyes open condition.<br>";
- break;
- case "% difference EO Alpha from initial EO after EC < 25%":
- if (d.value < 25) {
- interpretation += "<b>Flagged Interpretation:</b> Percent difference in alpha amplitude from initial eyes open after eyes closed is less than 25%.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Theta Amplitude EO":
- interpretation += "<b>Theta Amplitude Eyes Open:</b> Indicates the amplitude of theta waves during eyes open condition.<br>";
- break;
- case "Beta Amplitude EO":
- interpretation += "<b>Beta Amplitude Eyes Open:</b> Indicates the amplitude of beta waves during eyes open condition.<br>";
- break;
- case "EO Theta/Beta < 2.2":
- if (d.value < 2.2) {
- interpretation += "<b>Flagged Interpretation:</b> Theta/Beta ratio during eyes open condition is less than 2.2.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Theta Amplitude Under Task UT":
- interpretation += "<b>Theta Amplitude Under Task (UT):</b> Indicates the amplitude of theta waves during a task.<br>";
- break;
- case "Beta Amplitude UT":
- interpretation += "<b>Beta Amplitude Under Task (UT):</b> Indicates the amplitude of beta waves during a task.<br>";
- break;
- case "Theta/Beta UT < 2.2":
- if (d.value < 2.2) {
- interpretation += "<b>Flagged Interpretation:</b> Theta/Beta ratio during task condition is less than 2.2.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Percent change T/B EO to T/B EO UT < 15%":
- if (d.value < 15) {
- interpretation += "<b>Flagged Interpretation:</b> Percent change in theta/beta ratio from eyes open to under task condition is less than 15%.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "% Beta Increase UT < 15%":
- if (d.value < 15) {
- interpretation += "<b>Flagged Interpretation:</b> Percent beta increase under task condition is less than 15%.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Total Amplitude < 60":
- if (d.value < 60) {
- interpretation += "<b>Flagged Interpretation:</b> Total amplitude of brain waves is less than 60.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Theta Amplitude preceding Omni":
- interpretation += "<b>Theta Amplitude preceding Omni:</b> Indicates the amplitude of theta waves preceding a certain event.<br>";
- break;
- case "Theta Amplitude with Omni":
- interpretation += "<b>Theta Amplitude with Omni:</b> Indicates the amplitude of theta waves with a certain event.<br>";
- break;
- case "Percent change in Theta with Omni > -5%":
- if (d.value > -5) {
- interpretation += "<b>Flagged Interpretation:</b> Percent change in theta amplitude with a certain event is greater than -5%.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Alpha Peak Frequency EC >9.5":
- if (d.value > 9.5) {
- interpretation += "<b>Flagged Interpretation:</b> Alpha peak frequency during eyes closed condition is greater than 9.5 Hz.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Alpha Peak Frequency EO >9.5":
- if (d.value > 9.5) {
- interpretation += "<b>Flagged Interpretation:</b> Alpha peak frequency during eyes open condition is greater than 9.5 Hz.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Theta/SMR EC < 3":
- if (d.value < 3) {
- interpretation += "<b>Flagged Interpretation:</b> Theta/SMR ratio during eyes closed condition is less than 3.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- // Add more interpretations for CZ here...
- // Flagged interpretations and protocol recommendations for O1
- case "O1 Alpha EO":
- interpretation += "<b>O1 Eyes Open Alpha:</b> Indicates the amplitude of alpha waves at O1 electrode during eyes open condition.<br>";
- break;
- case "Alpha EC":
- interpretation += "<b>O1 Eyes Closed Alpha:</b> Indicates the amplitude of alpha waves at O1 electrode during eyes closed condition.<br>";
- break;
- case "% Change in Alpha EO to EC > 50%":
- if (d.value > 50) {
- interpretation += "<b>Flagged Interpretation:</b> Percent change in alpha amplitude from eyes open to eyes closed condition is greater than 50%.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "EO Alpha Recovery":
- interpretation += "<b>Alpha Recovery:</b> Indicates the recovery of alpha amplitude after eyes open condition.<br>";
- break;
- case "% change EO Alpha to EO Alpha after EC < 25%":
- if (d.value < 25) {
- interpretation += "<b>Flagged Interpretation:</b> Percent change in alpha amplitude from initial eyes open after eyes closed is less than 25%.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Theta Amplitude EO":
- interpretation += "<b>Theta Amplitude Eyes Open:</b> Indicates the amplitude of theta waves during eyes open condition.<br>";
- break;
- case "Beta Amplitude EO":
- interpretation += "<b>Beta Amplitude Eyes Open:</b> Indicates the amplitude of beta waves during eyes open condition.<br>";
- break;
- case "Theta/Beta EO 1.8 - 2.2":
- if (d.value >= 1.8 && d.value <= 2.2) {
- interpretation += "<b>Theta/Beta ratio during eyes open condition:</b> Indicates a balanced state between theta and beta waves.<br>";
- }
- break;
- case "Theta Amplitude EC":
- interpretation += "<b>Theta Amplitude Eyes Closed:</b> Indicates the amplitude of theta waves during eyes closed condition.<br>";
- break;
- case "Beta Amplitude EC":
- interpretation += "<b>Beta Amplitude Eyes Closed:</b> Indicates the amplitude of beta waves during eyes closed condition.<br>";
- break;
- case "Theta/Beta EC 1.8 - 2.2":
- if (d.value >= 1.8 && d.value <= 2.2) {
- interpretation += "<b>Theta/Beta ratio during eyes closed condition:</b> Indicates a balanced state between theta and beta waves.<br>";
- }
- break;
- case "% change EO to EC T/B ratio > 25%":
- if (d.value > 25) {
- interpretation += "<b>Flagged Interpretation:</b> Percent change in theta/beta ratio from eyes open to eyes closed condition is greater than 25%.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Alpha Peak Frequency EC > 9.5":
- if (d.value > 9.5) {
- interpretation += "<b>Flagged Interpretation:</b> Alpha peak frequency during eyes closed condition is greater than 9.5 Hz.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- case "Alpha Peak Frequency EO > 9.5":
- if (d.value > 9.5) {
- interpretation += "<b>Flagged Interpretation:</b> Alpha peak frequency during eyes open condition is greater than 9.5 Hz.<br><b>Protocol:</b> Further investigation recommended.<br><br>";
- }
- break;
- // Add more interpretations for O1 here...
- // Flagged interpretations and protocol recommendations for F3 and F4
- case "F3 and F4 Theta/Beta Ratio":
- interpretation += "<b>Theta/Beta Ratio at F3 or F4:</b> Indicates the ratio of theta (3-7 Hz) to beta (16-25 Hz) waves at F3 or F4 electrodes.<br>";
- break;
- case "Negative Percentage Difference Theta/Beta F3-F4":
- interpretation += "<b>Negative Percentage Difference Theta/Beta F3-F4:</b> Indicates the negative percentage difference between theta/beta ratios at F3 and F4 electrodes.<br>";
- break;
- case "Alpha Increase Eyes Closed F4":
- interpretation += "<b>Alpha Increase Eyes Closed at F4:</b> Indicates an increase in alpha (8-12 Hz) amplitude during eyes closed condition at F4 electrode.<br>";
- break;
- case "Beta Difference F4-F3":
- interpretation += "<b>Beta Difference between F4 and F3:</b> Indicates the difference in beta (16-25 Hz) amplitude between F4 and F3 electrodes.<br>";
- break;
- case "Alpha Difference F3-F4":
- interpretation += "<b>Alpha Difference between F3 and F4:</b> Indicates the difference in alpha (8-12 Hz) amplitude between F3 and F4 electrodes.<br>";
- break;
- case "Theta/Beta Ratio above 2.2 with Percentage Change":
- interpretation += "<b>Theta/Beta Ratio above 2.2 with Percentage Change:</b> Indicates theta/beta ratio above 2.2 with a percentage change greater than 15% at F3 or F4 electrodes.<br>";
- break;
- case "Theta/Beta Ratio Difference above Threshold":
- interpretation += "<b>Theta/Beta Ratio Difference above Threshold:</b> Indicates a difference in theta/beta ratio above a specific threshold (e.g., 20%) between F3 and F4 electrodes.<br>";
- break;
- case "Alpha Increase Eyes Closed F3-F4":
- interpretation += "<b>Alpha Increase Eyes Closed F3-F4:</b> Indicates an increase in alpha (8-12 Hz) amplitude during eyes closed condition between F3 and F4 electrodes.<br>";
- break;
- case "Lower Theta/Beta Ratio":
- interpretation += "<b>Lower Theta/Beta Ratio at F3 or F4:</b> Suggests lowering theta/beta ratio (3-7 Hz / 16-25 Hz) to below 2.2 to address cognitive deficiencies, impulse control, and emotional volatility.<br>";
- break;
- case "Train Alpha Eyes Closed F4":
- interpretation += "<b>Train Alpha Eyes Closed at F4:</b> Train alpha (8-12 Hz) during eyes closed condition at F4 electrode to between 1.2-1.6 for frontal alpha ADD and improved focus and organization.<br>";
- break;
- case "Reduce Theta/Beta Percentage Difference":
- interpretation += "<b>Reduce Theta/Beta Percentage Difference:</b> Reduce percentage difference between theta and beta amplitudes at F3 and F4 electrodes to address emotional volatility and anger management.<br>";
- break;
- case "Beta Range":
- interpretation += "<b>Beta Range (16-25 Hz):</b> Associated with active thinking, problem-solving, and focus.<br>";
- break;
- case "HiBetaGamma Range":
- interpretation += "<b>HiBetaGamma Range (28-40 Hz):</b> Linked to heightened mental activity and alertness.<br>";
- break;
- // Flagged interpretations and protocol recommendations for FZ
- case "HiBeta/Beta Ratio below Threshold":
- interpretation += "<b>HiBeta/Beta Ratio below Threshold:</b> Indicates hi-beta/beta ratio (28-40 Hz / 16-25 Hz) below 0.45 at FZ, suggesting excessive passivity.<br>";
- break;
- case "HiBeta/Beta Ratio above Threshold":
- interpretation += "<b>HiBeta/Beta Ratio above Threshold:</b> Indicates hi-beta/beta ratio (28-40 Hz / 16-25 Hz) above 0.55 at FZ, associated with stubborn behavior, obsessive-compulsive tendencies, or anxiety.<br>";
- break;
- case "Sum of HiBeta + Beta above Value":
- interpretation += "<b>Sum of HiBeta + Beta above Value:</b> Indicates sum of hi-beta and beta amplitudes above a specific value (e.g., 15) at FZ, suggesting perseverative behavior.<br>";
- break;
- case "LoAlpha/HiAlpha Ratio below Threshold":
- interpretation += "<b>LoAlpha/HiAlpha Ratio below Threshold:</b> Indicates lo-alpha/hi-alpha ratio (8-9 Hz / 11-12 Hz) below 1.5 at FZ, suggesting cognitive inefficiency, age-related deficits, or sleep disorders.<br>";
- break;
- case "Train HiBeta/Beta Ratio":
- interpretation += "<b>Train HiBeta/Beta Ratio at FZ:</b> Train hi-beta/beta ratio (28-40 Hz / 16-25 Hz) at FZ to between 0.45-0.55 to relieve passivity or stubborn behavior.<br>";
- break;
- case "Decrease Sum of HiBeta + Beta":
- interpretation += "<b>Decrease Sum of HiBeta + Beta at FZ:</b> Decrease sum of hi-beta and beta amplitudes at FZ to below 15 to address perseverative behavior.<br>";
- break;
- case "Lower LoAlpha/HiAlpha Ratio":
- interpretation += "<b>Lower LoAlpha/HiAlpha Ratio at FZ:</b> Lower lo-alpha/hi-alpha ratio (8-9 Hz / 11-12 Hz) at FZ to below 1.5 to improve cognitive efficiency and sleep disorders.<br>";
- break;
- case "Alpha Range":
- interpretation += "<b>Alpha Range (8-12 Hz):</b> Associated with relaxation, creativity, and mental imagery.<br>";
- break;
- case "HiAlpha Range":
- interpretation += "<b>HiAlpha Range (11-12 Hz):</b> Linked to deep relaxation, meditation, and mental integration.<br>";
- break;
- case "Beta Range":
- interpretation += "<b>Beta Range (16-25 Hz):</b> Related to active thinking, problem-solving, and concentration.<br>";
- break;
- default:
- break;
- }
- });
- return interpretation;
- }
- function generateSummary() {
- const data = document.getElementById("dataInput").value;
- const parsedData = parseData(data);
- const interpretation = interpretData(parsedData);
- document.getElementById("interpretation").innerHTML = interpretation;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement