Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- def plot_1020_electrodes():
- fig, ax = plt.subplots(figsize=(8, 8))
- ax.set_aspect('equal')
- ax.axis('off')
- # Set up electrode locations
- electrode_locations = {
- 'CZ': (0, 0),
- 'O1': (-2.11, -3.04),
- 'F3': (-2, 2),
- 'F4': (2, 2),
- 'FZ': (0, 2),
- 'PZ': (0, -2),
- 'C3': (-1, 0),
- 'C4': (1, 0),
- 'P3': (-1, -2),
- 'P4': (1, -2),
- 'OZ': (0, -3),
- 'T5': (-2, -1),
- 'T6': (2, -1),
- 'PO7': (-2.5, -1.5),
- 'PO8': (2.5, -1.5),
- 'FP1': (-2, 3),
- 'FP2': (2, 3),
- 'AFZ': (0, 3),
- 'CPZ': (0, -1)
- }
- # Plot modified head outline
- head_outline = plt.Circle((0, 0), radius=4, edgecolor='black', facecolor='white', linewidth=1.5)
- ax.add_artist(head_outline)
- # Plot electrode spots and text
- electrode_texts = {}
- for electrode, (x, y) in electrode_locations.items():
- ax.plot(x, y, 'o', markersize=10, markerfacecolor='white', markeredgecolor='white', markeredgewidth=1.5)
- electrode_texts[electrode] = ax.text(x, y, electrode, ha='center', va='center', fontsize=16, color='blue')
- # Electrode area information
- areas = {
- 'CZ': {
- 'Clinical Q': 'Vertex',
- '10-20 System': 'CZ',
- 'Brodmann Area': 'Areas 4 and 6',
- 'Function': 'Motor cortex, supplementary motor area',
- 'Functional Info': 'Areas 4 and 6 in the vertex region are involved in motor control and supplementary motor functions.',
- 'Mental Health Issues': 'Disruptions in this area may affect motor coordination, movement disorders, and be associated with motor-related mental health issues.'
- },
- 'O1': {
- 'Clinical Q': 'Left Occipital',
- '10-20 System': 'O1',
- 'Brodmann Area': 'Area 17',
- 'Function': 'Primary visual cortex',
- 'Functional Info': 'Area 17 in the left occipital lobe is involved in primary visual processing.',
- 'Mental Health Issues': 'Imbalances in this area may impact visual perception, visual processing, and be associated with visual-related mental health issues.'
- },
- 'F3': {
- 'Clinical Q': 'Left Frontal',
- '10-20 System': 'F3',
- 'Brodmann Area': 'Area 6',
- 'Function': 'Motor cortex, language production',
- 'Functional Info': 'Area 6 in the left frontal lobe is involved in motor control and language production.',
- 'Mental Health Issues': 'Disruptions in this area may affect motor coordination, language production, and be associated with motor and language-related mental health issues.'
- },
- 'F4': {
- 'Clinical Q': 'Right Frontal',
- '10-20 System': 'F4',
- 'Brodmann Area': 'Area 6',
- 'Function': 'Motor cortex, language production',
- 'Functional Info': 'Area 6 in the right frontal lobe is involved in motor control and language production.',
- 'Mental Health Issues': 'Disruptions in this area may affect motor coordination, language production, and be associated with motor and language-related mental health issues.'
- },
- 'FZ': {
- 'Clinical Q': 'Midline Frontal',
- '10-20 System': 'FZ',
- 'Brodmann Area': 'Areas 9 and 10',
- 'Function': 'Prefrontal cortex, attention, emotional processing',
- 'Functional Info': 'Areas 9 and 10 in the midline frontal region are involved in prefrontal cortex functions, attention, and emotional processing.',
- 'Mental Health Issues': 'Imbalances in this area may impact attention, emotional processing, and be associated with prefrontal cortex-related mental health issues.'
- },
- 'PZ': {
- 'Clinical Q': 'Midline Parietal',
- '10-20 System': 'PZ',
- 'Brodmann Area': 'Areas 5 and 7',
- 'Function': 'Somatosensory cortex, spatial awareness',
- 'Functional Info': 'Areas 5 and 7 in the midline parietal region are involved in somatosensory processing and spatial awareness.',
- 'Mental Health Issues': 'Disruptions in this area may affect somatosensory processing, spatial awareness, and be associated with somatosensory-related mental health issues.'
- },
- 'C3': {
- 'Clinical Q': 'Left Central',
- '10-20 System': 'C3',
- 'Brodmann Area': 'Areas 3 and 4',
- 'Function': 'Motor cortex, sensorimotor integration',
- 'Functional Info': 'Areas 3 and 4 in the left central region are involved in motor control and sensorimotor integration.',
- 'Mental Health Issues': 'Disruptions in this area may affect motor coordination, movement disorders, and be associated with sensorimotor processing deficits.'
- },
- 'C4': {
- 'Clinical Q': 'Right Central',
- '10-20 System': 'C4',
- 'Brodmann Area': 'Areas 3 and 4',
- 'Function': 'Motor cortex, sensorimotor integration',
- 'Functional Info': 'Areas 3 and 4 in the right central region are involved in motor control and sensorimotor integration.',
- 'Mental Health Issues': 'Disruptions in this area may affect motor coordination, movement disorders, and be associated with sensorimotor processing deficits.'
- },
- 'P3': {
- 'Clinical Q': 'Left Parietal',
- '10-20 System': 'P3',
- 'Brodmann Area': 'Areas 5 and 7',
- 'Function': 'Somatosensory cortex, spatial awareness',
- 'Functional Info': 'Areas 5 and 7 in the left parietal region are involved in somatosensory processing and spatial awareness.',
- 'Mental Health Issues': 'Disruptions in this area may affect somatosensory processing, spatial awareness, and be associated with somatosensory-related mental health issues.'
- },
- 'P4': {
- 'Clinical Q': 'Right Parietal',
- '10-20 System': 'P4',
- 'Brodmann Area': 'Areas 5 and 7',
- 'Function': 'Somatosensory cortex, spatial awareness',
- 'Functional Info': 'Areas 5 and 7 in the right parietal region are involved in somatosensory processing and spatial awareness.',
- 'Mental Health Issues': 'Disruptions in this area may affect somatosensory processing, spatial awareness, and be associated with somatosensory-related mental health issues.'
- },
- 'OZ': {
- 'Clinical Q': 'Midline Occipital',
- '10-20 System': 'OZ',
- 'Brodmann Area': 'Areas 17 and 18',
- 'Function': 'Visual cortex, visual processing',
- 'Functional Info': 'Areas 17 and 18 in the midline occipital region are involved in visual processing and visual cortex functions.',
- 'Mental Health Issues': 'Imbalances in this area may impact visual perception, visual processing, and be associated with visual-related mental health issues.'
- },
- 'T5': {
- 'Clinical Q': 'Left Temporal',
- '10-20 System': 'T5',
- 'Brodmann Area': 'Areas 21 and 22',
- 'Function': 'Auditory cortex, language processing',
- 'Functional Info': 'Areas 21 and 22 in the left temporal lobe are involved in auditory processing and language-related functions.',
- 'Mental Health Issues': 'Disruptions in this area may affect auditory perception, language processing, and be associated with language-related mental health issues.'
- },
- 'T6': {
- 'Clinical Q': 'Right Temporal',
- '10-20 System': 'T6',
- 'Brodmann Area': 'Areas 21 and 22',
- 'Function': 'Auditory cortex, language processing',
- 'Functional Info': 'Areas 21 and 22 in the right temporal lobe are involved in auditory processing and language-related functions.',
- 'Mental Health Issues': 'Disruptions in this area may affect auditory perception, language processing, and be associated with language-related mental health issues.'
- },
- 'PO7': {
- 'Clinical Q': 'Left Occipital Parietal',
- '10-20 System': 'PO7',
- 'Brodmann Area': 'Areas 19 and 39',
- 'Function': 'Visual association cortex, language processing',
- 'Functional Info': 'Areas 19 and 39 in the left occipital parietal region are involved in visual association and language-related functions.',
- 'Mental Health Issues': 'Imbalances in this area may impact visual association, language processing, and be associated with visual and language-related mental health issues.'
- },
- 'PO8': {
- 'Clinical Q': 'Right Occipital Parietal',
- '10-20 System': 'PO8',
- 'Brodmann Area': 'Areas 19 and 39',
- 'Function': 'Visual association cortex, language processing',
- 'Functional Info': 'Areas 19 and 39 in the right occipital parietal region are involved in visual association and language-related functions.',
- 'Mental Health Issues': 'Imbalances in this area may impact visual association, language processing, and be associated with visual and language-related mental health issues.'
- },
- 'FP1': {
- 'Clinical Q': 'Left Frontopolar',
- '10-20 System': 'FP1',
- 'Brodmann Area': 'Areas 9 and 10',
- 'Function': 'Prefrontal cortex, attention, emotional processing',
- 'Functional Info': 'Areas 9 and 10 in the left frontopolar region are involved in prefrontal cortex functions, attention, and emotional processing.',
- 'Mental Health Issues': 'Imbalances in this area may impact attention, emotional processing, and be associated with prefrontal cortex-related mental health issues.'
- },
- 'FP2': {
- 'Clinical Q': 'Right Frontopolar',
- '10-20 System': 'FP2',
- 'Brodmann Area': 'Areas 9 and 10',
- 'Function': 'Prefrontal cortex, attention, emotional processing',
- 'Functional Info': 'Areas 9 and 10 in the right frontopolar region are involved in prefrontal cortex functions, attention, and emotional processing.',
- 'Mental Health Issues': 'Imbalances in this area may impact attention, emotional processing, and be associated with prefrontal cortex-related mental health issues.'
- },
- 'AFZ': {
- 'Clinical Q': 'Midline Frontopolar',
- '10-20 System': 'AFZ',
- 'Brodmann Area': 'Areas 9 and 10',
- 'Function': 'Prefrontal cortex, attention, emotional processing',
- 'Functional Info': 'Areas 9 and 10 in the midline frontopolar region are involved in prefrontal cortex functions, attention, and emotional processing.',
- 'Mental Health Issues': 'Imbalances in this area may impact attention, emotional processing, and be associated with prefrontal cortex-related mental health issues.'
- },
- 'CPZ': {
- 'Clinical Q': 'Midline Centroparietal',
- '10-20 System': 'CPZ',
- 'Brodmann Area': 'Areas 5 and 7',
- 'Function': 'Somatosensory cortex, spatial awareness',
- 'Functional Info': 'Areas 5 and 7 in the midline centroparietal region are involved in somatosensory processing and spatial awareness.',
- 'Mental Health Issues': 'Disruptions in this area may affect somatosensory processing, spatial awareness, and be associated with somatosensory-related mental health issues.'
- }
- }
- # Function to handle click events
- def on_click(event):
- for electrode_text in electrode_texts.values():
- if electrode_text.contains(event)[0]:
- electrode = electrode_text.get_text()
- if electrode in areas:
- area_info = areas[electrode]
- info_text = f"10-20 System: {area_info['10-20 System']}\n\n" \
- f"Clinical Q: {area_info['Clinical Q']}\n\n" \
- f"Brodmann Area: {area_info['Brodmann Area']}\n\n" \
- f"Function: {area_info['Function']}\n\n" \
- f"Functional Info: {area_info['Functional Info']}\n\n" \
- f"Mental Health Issues: {area_info['Mental Health Issues']}"
- plt.figure()
- plt.text(0.5, 0.5, info_text, horizontalalignment='center', verticalalignment='center',
- fontsize=12)
- plt.axis('off')
- plt.show()
- break
- fig.canvas.mpl_connect('button_press_event', on_click)
- plt.show()
- plot_1020_electrodes()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement