def
bullseye_plot
(
ax
,
,
seg_bold
=
None
,
=
"viridis"
,
=
None
):
"""
Bullseye representation for the left ventricle.
Parameters
----------
ax : Axes
data : list[float]
The intensity values for each of the 17 segments.
seg_bold : list[int], optional
A list with the segments to highlight.
cmap : colormap, default: "viridis"
Colormap for the data.
norm : Normalize or None, optional
Normalizer for the data.
Notes
-----
This function creates the 17 segment model for the left ventricle according
to the American Heart Association (AHA) [1]_
References
----------
.. [1] M. D. Cerqueira, N. J. Weissman, V. Dilsizian, A. K. Jacobs,
S. Kaul, W. K. Laskey, D. J. Pennell, J. A. Rumberger, T. Ryan,
and M. S. Verani, "Standardized myocardial segmentation and
nomenclature for tomographic imaging of the heart",
Circulation, vol. 105, no. 4, pp. 539-542, 2002.
"""
=
(
)
if
seg_bold
is
None
:
seg_bold
=
[]
if
is
None
:
=
(
vmin
=
.
min
(),
vmax
=
.
max
())
r
=
(
0.2
,
1
,
4
)
ax
.
set
(
ylim
=
(
0
,
1
),
xticklabels
=
[],
yticklabels
=
[])
ax
.
grid
(
False
)
for
start
,
stop
,
r_in
,
r_out
in
[
(
0
,
6
,
r
[
2
],
r
[
3
]),
(
6
,
12
,
r
[
1
],
r
[
2
]),
(
12
,
16
,
r
[
0
],
r
[
1
]),
(
16
,
17
,
0
,
r
[
0
]),
]:
n
=
stop
-
start
dtheta
=
2
*
/
n
ax
.
bar
(
(
n
)
*
dtheta
+
/
2
,
r_out
-
r_in
,
dtheta
,
r_in
,
color
=
(
(
[
start
:
stop
])))
for
start
,
stop
,
r_in
,
r_out
in
[
(
0
,
6
,
r
[
2
],
r
[
3
]),
(
6
,
12
,
r
[
1
],
r
[
2
]),
(
12
,
16
,
r
[
0
],
r
[
1
]),
]:
n
=
stop
-
start
dtheta
=
2
*
/
n
ax
.
bar
(
(
n
)
*
dtheta
+
/
2
,
r_out
-
r_in
,
dtheta
,
r_in
,
clip_on
=
False
,
color
=
"none"
,
edgecolor
=
"k"
,
linewidth
=
[
4
if
i
+
1
in
seg_bold
else
2
for
i
in
range
(
start
,
stop
)])
ax
.
plot
(
(
0
,
2
*
),
(
r
[
0
],
r
[
0
]),
"k"
,
linewidth
=
(
4
if
17
in
seg_bold
else
2
))
=
(
17
)
+
1
=
(
figsize
=
(
10
,
5
),
layout
=
"constrained"
)
()
.
set
(
wspace
=
.1
,
w_pad
=
.2
)
=
(
1
,
3
,
subplot_kw
=
dict
(
projection
=
'polar'
))
.
canvas
.
manager
.
set_window_title
(
'Left Ventricle Bulls Eyes (AHA)'
)
=
[
"viridis"
]
=
(
vmin
=
1
,
vmax
=
17
)
(
(
=
,
=
),
cax
=
[
0
]
.
inset_axes
([
0
,
-
.15
,
1
,
.1
]),
orientation
=
'horizontal'
,
label
=
'Some units'
)
=
[
"cool"
]
=
(
vmin
=
1
,
vmax
=
17
)
(
(
=
,
=
),
cax
=
[
1
]
.
inset_axes
([
0
,
-
.15
,
1
,
.1
]),
orientation
=
'horizontal'
,
label
=
'Some other units'
)
=
([
'r'
,
'g'
,
'b'
,
'c'
],
over
=
'0.35'
,
under
=
'0.75'
)
=
[
2
,
3
,
7
,
9
,
15
]
=
(
,
)
(
(
=
,
=
),
cax
=
[
2
]
.
inset_axes
([
0
,
-
.15
,
1
,
.1
]),
extend
=
'both'
,
ticks
=
,
spacing
=
'proportional'
,
orientation
=
'horizontal'
,
label
=
'Discrete intervals, some other units'
)
bullseye_plot
(
[
0
],
,
=
,
=
)
[
0
]
.
set_title
(
'Bulls Eye (AHA)'
)
bullseye_plot
(
[
1
],
,
=
,
=
)
[
1
]
.
set_title
(
'Bulls Eye (AHA)'
)
bullseye_plot
(
[
2
],
,
seg_bold
=
[
3
,
5
,
6
,
11
,
12
,
16
],
=
,
=
)
[
2
]
.
set_title
(
'Segments [3, 5, 6, 11, 12, 16] in bold'
)
()
Total running time of the script: (0 minutes 2.935 seconds)