Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Cittena
cittena
Commits
f147772e
Commit
f147772e
authored
Jan 04, 2017
by
Niels-Oliver Walkowski
Browse files
implement markers for UnivariatePlots
parent
86c0b389
Changes
2
Hide whitespace changes
Inline
Side-by-side
itten/visuals.py
View file @
f147772e
...
...
@@ -3,6 +3,7 @@
import
matplotlib.pyplot
as
plt
import
matplotlib.ticker
as
plticker
import
numpy
as
np
class
SequencePlot
(
object
):
...
...
@@ -92,7 +93,6 @@ class MultivariatePlot(SequencePlot):
x
=
view
[:,
0
]
y
=
view
[:,
1
]
value
=
view
[:,
2
]
print
(
'x: {0} | y: {1} | value: {2}'
.
format
(
x
,
y
,
value
))
thickness
=
list
([
int
((
v
-
view
.
_threshold
)
/
4000
)
for
v
in
value
])
self
.
_ax
,
axt
=
self
.
ittenstyle
(
self
.
_ax
,
view
)
...
...
@@ -118,13 +118,26 @@ class UnivariatePlot(SequencePlot):
self
.
fig
=
plt
.
figure
()
self
.
_ax
=
plt
.
axes
()
self
.
_ax
,
self
.
_axt
=
self
.
ittenstyle
(
self
.
_ax
,
view
)
self
.
plot
(
view
)
def
plot
(
self
,
view
):
def
plot
(
self
,
view
,
mark_gt
=
False
,
mark_lt
=
False
):
# Interpolation mit savitzky_golay funktioniert nicht
# contrast_points = savitzky_golay(np.array(contrast_points), 51, 7)
self
.
_axt
.
plot
(
self
.
_x
,
view
,
label
=
view
.
feature
)
self
.
_axt
.
plot
(
self
.
_x
,
view
,
label
=
view
.
feature
)
# TODO Überführbar in Superclass?
# evtl. auch eher feature drer View Klasse
# TODO self._x sollte eine array sein
npx
=
np
.
array
(
self
.
_x
)
if
mark_gt
:
poss
=
npx
[
view
>
mark_gt
]
for
pos
in
poss
:
self
.
_ax
.
axvline
(
pos
,
color
=
'#f3f315'
,
alpha
=
0.3
,
linewidth
=
3
)
elif
mark_lt
:
poss
=
npx
[
view
>
mark_gt
]
for
pos
in
poss
:
self
.
_ax
.
axvline
(
pos
,
color
=
'#f3f315'
,
alpha
=
0.3
,
linewidth
=
3
)
self
.
_axt
.
legend
()
return
self
.
fig
testing/bootstrap.py
View file @
f147772e
...
...
@@ -3,12 +3,12 @@ from itten.views import UnivariateSequence
from
itten.visuals
import
UnivariatePlot
movie
=
Movie
(
prefix
=
'rec_'
,
folder
=
'../DHd-2017/Data/Frames/Rec/'
)
#
movie._frames.start = 367
#
movie._frames.end = 784
movie
.
_frames
.
start
=
367
movie
.
_frames
.
end
=
784
cont
=
UnivariateSequence
(
movie
.
_frames
,)
cont
.
seqmean
(
frm_stp
=
3
,
ctrst
=
'saturation'
)
viz
=
UnivariatePlot
(
cont
)
#
viz.plot(cont)
viz
.
plot
(
cont
,
mark_gt
=
140
)
cont
.
seqmad
(
frm_stp
=
3
,
ctrst
=
'saturation'
)
viz
.
plot
(
cont
)
viz
.
saveplt
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment