-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhuman
More file actions
42 lines (39 loc) · 1.58 KB
/
human
File metadata and controls
42 lines (39 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import anatomogram
import matplotlib.pyplot as plt
fig,ax=plt.subplots(figsize=(6,10))
anatomogram2 = pyanatomogram.Anatomogram('homo_sapiens.female')
anatomogram2.highlight_tissues({'heart': 0, 'lung': 2, 'brain': 3, 'colon': 1, 'liver': 4, 'breast':5,
'stomach':6,'esophagus':7, 'ovary':8, 'uterus':9, 'pancreas':10,
'lymph node':11,'gall bladder':12, 'skin':13, 'thyroid gland':14,'kidney':15,
'uterine cervix':16, 'bronchus':17}, cmap='twilight_shifted')
anatomogram2.to_matplotlib(ax=ax)
annotations = {
'lung': ((0, 0), (48, 44)),
'heart': ((0, 10), (52, 48)),
'brain': ((25, 0), (50, 5)),
'colon': ((0,95), (43, 85)),
'liver': ((0, 53), (43, 65)),
'breast': ((100, 30), (62, 50)),
'stomach': ((100, 62), (51, 70)),
'esophagus': ((80, 20), (51, 40)),
'ovary': ((95, 78), (50.5, 88.5)),
'uterus': ((90, 88), (58, 90.75)),
'pancreas': ((93, 50), (62, 64)),
'lymph node': ((75, 0), (56, 27)),
'gall bladder':((0,62),(49,70)),
'skin':((10,120),(45,125)),
'thyroid gland':((22,10),(52,31)),
'kidney':((0,85),(45,72))
}
# Add annotations with arrows and text boxes
for organ, ((x_text, y_text), (x_arrow, y_arrow)) in annotations.items():
ax.annotate(
organ.capitalize(),
xy=(x_arrow, y_arrow)
xytext=(x_text, y_text)
arrowprops=dict(facecolor='black', arrowstyle='->'),
bbox=dict(boxstyle='round,pad=0.3', fc='white', ec='black', lw=1),
fontsize=8
)
plt.show()
fig.savefig('highlighted_woman.svg')