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44LCAwLjI4KSwgYXJyb3dwcm9wcz1kaWN0KGZhY2Vjb2xvcj0nYmxhY2snLCBhcnJvd3N0eWxlPSZxdW90Oy0mZ3Q7JnF1b3Q7KSkKCiMgSGlkZSBheGVzCmF4LmF4aXMoJ29mZicpCgojIFNhdmUgdGhlIGZpZ3VyZSBhcyBhIEpQRUcgaW1hZ2UKcGx0LnNhdmVmaWcoJy9tbnQvZGF0YS9TY2hlbWF0aWNfUGF0aG9waHlzaW9sb2d5X1N0cm9rZS5qcGVnJywgZm9ybWF0PSdqcGVnJykKCiMgRGlzcGxheSB0aGUgZGlhZ3JhbQpwbHQuc2hvdygpCg==
# Create a new figure for the revised pathophysiology diagram
fig, ax = plt.subplots(figsize=(10, 7))
# Title for the diagram
ax.set_title("Schematic Pathophysiology of Stroke", fontsize=16, fontweight='bold')
# Text boxes for different stages of stroke pathophysiology
# Stroke main category
ax.text(0.5, 0.9, 'Stroke (Ischemic or Hemorrhagic)', fontsize=12, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="#FFCCCC"))
# Ischemic stroke path
ax.text(0.2, 0.75, 'Ischemic Stroke (~85% cases)', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="#FFFF99"))
ax.text(0.2, 0.65, 'Thrombotic Stroke (Plaque Build-Up)', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.2, 0.55, 'Embolic Stroke (Embolism)', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.2, 0.45, 'Necrosis (Cell Death)', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.2, 0.35, 'Disruption of Plasma Membrane', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.2, 0.25, 'Excitotoxicity, Free Radical Damage', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.2, 0.15, 'Loss of Neuronal Function', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
# Hemorrhagic stroke path
ax.text(0.8, 0.75, 'Hemorrhagic Stroke (~15% cases)', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="#FF9999"))
ax.text(0.8, 0.65, 'Intracerebral Hemorrhage (ICH)', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.8, 0.55, 'Subarachnoid Hemorrhage', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.8, 0.45, 'Blood Vessel Rupture', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.8, 0.35, 'Blood Accumulation & Pressure', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.8, 0.25, 'Vascular Toxicity, Infarction', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
ax.text(0.8, 0.15, 'Neuronal Damage & Loss of Function', fontsize=10, ha='center', va='center',
bbox=dict(boxstyle="round,pad=0.3", edgecolor="black", facecolor="white"))
# Add arrows for flow
# Ischemic arrows
ax.annotate('', xy=(0.5, 0.87), xytext=(0.2, 0.78), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.2, 0.63), xytext=(0.2, 0.68), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.2, 0.53), xytext=(0.2, 0.58), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.2, 0.43), xytext=(0.2, 0.48), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.2, 0.33), xytext=(0.2, 0.38), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.2, 0.23), xytext=(0.2, 0.28), arrowprops=dict(facecolor='black', arrowstyle="->"))
# Hemorrhagic arrows
ax.annotate('', xy=(0.5, 0.87), xytext=(0.8, 0.78), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.8, 0.63), xytext=(0.8, 0.68), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.8, 0.53), xytext=(0.8, 0.58), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.8, 0.43), xytext=(0.8, 0.48), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.8, 0.33), xytext=(0.8, 0.38), arrowprops=dict(facecolor='black', arrowstyle="->"))
ax.annotate('', xy=(0.8, 0.23), xytext=(0.8, 0.28), arrowprops=dict(facecolor='black', arrowstyle="->"))
# Hide axes
ax.axis('off')
# Save the figure as a JPEG image
plt.savefig('/mnt/data/Schematic_Pathophysiology_Stroke.jpeg', format='jpeg')
# Display the diagram
plt.show()