Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pierre-Alexandre Broux
s4dl
Commits
194cc697
Commit
194cc697
authored
Mar 27, 2019
by
Sulfyderz
Browse files
[Error Update]:Improving automaton Boundary Create Action.
parent
6d30be00
Changes
1
Hide whitespace changes
Inline
Side-by-side
s4dl/Show.py
View file @
194cc697
...
...
@@ -1368,6 +1368,17 @@ class Show(object):
# permet de savoir si on fait les traitements pour des segments avec des mauvaises frontieres
perfectBoundary
=
False
listHypRefSegment
=
list
()
for
y
in
valueTmp
:
if
Segment
.
intersection
(
y
,
valueRef
)
is
not
None
:
if
tolerance
==
0
:
listHypRefSegment
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
#NEW LALA
if
not
y
[
'start'
]
>=
(
valueRef
[
'stop'
]
-
tolerance
):
#NEW LALA
listHypRefSegment
.
append
(
y
)
# si frontiere parfaite
if
len
(
listHypRefSegment
)
==
1
and
DiarTools
.
boundariesInTolerance
(
boundarySegment
=
listHypRefSegment
[
0
],
segment
=
valueRef
,
tolerance
=
tolerance
):
actionsSegmentationNothingThr
.
append
(
copy
.
deepcopy
(
listHypRefSegment
[
0
]))
...
...
@@ -1380,12 +1391,12 @@ class Show(object):
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if
z
[
'stop'
]
>
(
valueRef
[
'stop'
]
+
tolerance
):
#NEW LALA
if
not
z
[
'start'
]
>=
(
valueRef
[
'stop'
]
-
tolerance
):
#NEW LALA
actionsSegmentationBoundaryCreateThr
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryCreateThrTurn
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
valueTmp
=
DiarTools
.
splitSegment
(
z
,
valueTmp
,
valueRef
[
'stop'
])
#
if not z['start']>=(valueRef['stop']-tolerance):
#
#NEW LALA
actionsSegmentationBoundaryCreateThr
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryCreateThrTurn
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
valueTmp
=
DiarTools
.
splitSegment
(
z
,
valueTmp
,
valueRef
[
'stop'
])
if
tolerance
!=
0
:
valueTmp2
=
copy
.
deepcopy
(
valueTmp
)
...
...
@@ -2268,6 +2279,17 @@ class Show(object):
else
:
# permet de savoir si on fait les traitements pour des segments avec des mauvaises frontieres
perfectBoundary
=
False
listHypRefSegment
=
list
()
for
y
in
valueTmp
:
if
Segment
.
intersection
(
y
,
valueRef
)
is
not
None
:
if
tolerance
==
0
:
listHypRefSegment
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
#NEW LALA
if
not
y
[
'start'
]
>=
(
valueRef
[
'stop'
]
-
tolerance
):
#NEW LALA
listHypRefSegment
.
append
(
y
)
# si frontiere parfaite
if
len
(
listHypRefSegment
)
==
1
and
DiarTools
.
boundariesInTolerance
(
boundarySegment
=
listHypRefSegment
[
0
],
segment
=
valueRef
,
tolerance
=
tolerance
):
actionsSegmentationNothingThr
.
append
(
copy
.
deepcopy
(
listHypRefSegment
[
0
]))
...
...
@@ -2285,12 +2307,12 @@ class Show(object):
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if
z
[
'stop'
]
>
(
valueRef
[
'stop'
]
+
tolerance
):
#NEW LALA
if
not
z
[
'start'
]
>=
(
valueRef
[
'stop'
]
-
tolerance
):
#NEW LALA
actionsSegmentationBoundaryCreateThr
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryCreateThrTurn
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
valueTmp
=
DiarTools
.
splitSegment
(
z
,
valueTmp
,
valueRef
[
'stop'
])
#
if not z['start']>=(valueRef['stop']-tolerance):
#
#NEW LALA
actionsSegmentationBoundaryCreateThr
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryCreateThrTurn
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
valueTmp
=
DiarTools
.
splitSegment
(
z
,
valueTmp
,
valueRef
[
'stop'
])
# Enleve les segments compris dans la marge tolérance (+ ou - tolérance)
if
tolerance
!=
0
:
...
...
@@ -3004,6 +3026,17 @@ class Show(object):
# permet de savoir si on fait les traitements pour des segments avec des mauvaises frontieres
perfectBoundary
=
False
listHypRefSegment
=
list
()
for
y
in
valueTmp
:
if
Segment
.
intersection
(
y
,
valueRef
)
is
not
None
:
if
tolerance
==
0
:
listHypRefSegment
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
#NEW LALA
if
not
y
[
'start'
]
>=
(
valueRef
[
'stop'
]
-
tolerance
):
#NEW LALA
listHypRefSegment
.
append
(
y
)
# si frontiere parfaite
if
len
(
listHypRefSegment
)
==
1
and
DiarTools
.
boundariesInTolerance
(
boundarySegment
=
listHypRefSegment
[
0
],
segment
=
valueRef
,
tolerance
=
tolerance
):
actionsSegmentationNothingThr
.
append
(
copy
.
deepcopy
(
listHypRefSegment
[
0
]))
...
...
@@ -3016,12 +3049,12 @@ class Show(object):
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if
z
[
'stop'
]
>
(
valueRef
[
'stop'
]
+
tolerance
):
#NEW LALA
if
not
z
[
'start'
]
>=
(
valueRef
[
'stop'
]
-
tolerance
):
#NEW LALA
actionsSegmentationBoundaryCreateThr
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryCreateThrTurn
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
valueTmp
=
DiarTools
.
splitSegment
(
z
,
valueTmp
,
valueRef
[
'stop'
])
#
if not z['start']>=(valueRef['stop']-tolerance):
#
#NEW LALA
actionsSegmentationBoundaryCreateThr
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryCreateThrTurn
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
valueTmp
=
DiarTools
.
splitSegment
(
z
,
valueTmp
,
valueRef
[
'stop'
])
if
tolerance
!=
0
:
valueTmp2
=
copy
.
deepcopy
(
valueTmp
)
...
...
@@ -3998,6 +4031,17 @@ class Show(object):
else
:
# permet de savoir si on fait les traitements pour des segments avec des mauvaises frontieres
perfectBoundary
=
False
listHypRefSegment
=
list
()
for
y
in
valueTmp
:
if
Segment
.
intersection
(
y
,
valueRef
)
is
not
None
:
if
tolerance
==
0
:
listHypRefSegment
.
append
(
y
)
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
#NEW LALA
if
not
y
[
'start'
]
>=
(
valueRef
[
'stop'
]
-
tolerance
):
#NEW LALA
listHypRefSegment
.
append
(
y
)
# si frontiere parfaite
if
len
(
listHypRefSegment
)
==
1
and
DiarTools
.
boundariesInTolerance
(
boundarySegment
=
listHypRefSegment
[
0
],
segment
=
valueRef
,
tolerance
=
tolerance
):
actionsSegmentationNothingThr
.
append
(
copy
.
deepcopy
(
listHypRefSegment
[
0
]))
...
...
@@ -4013,12 +4057,12 @@ class Show(object):
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if
z
[
'stop'
]
>
(
valueRef
[
'stop'
]
+
tolerance
):
#NEW LALA
if
not
z
[
'start'
]
>=
(
valueRef
[
'stop'
]
-
tolerance
):
#NEW LALA
actionsSegmentationBoundaryCreateThr
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryCreateThrTurn
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
valueTmp
=
DiarTools
.
splitSegment
(
z
,
valueTmp
,
valueRef
[
'stop'
])
#
if not z['start']>=(valueRef['stop']-tolerance):
#
#NEW LALA
actionsSegmentationBoundaryCreateThr
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryCreateThrTurn
.
append
(
copy
.
deepcopy
([
z
,
valueRef
[
'stop'
]]))
valueTmp
=
DiarTools
.
splitSegment
(
z
,
valueTmp
,
valueRef
[
'stop'
])
# Enleve les segments compris dans la marge tolérance (+ ou - tolérance)
if
tolerance
!=
0
:
...
...
Write
Preview
Supports
Markdown
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