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
Bioimage Analysis
Active Contour
Commits
05225f41
Commit
05225f41
authored
Sep 29, 2021
by
Stéphane DALLONGEVILLE
Browse files
Force stay into bounds field otherwise we can get infinite derivation which are really annoying..
parent
29af64ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/plugins/adufour/activecontours/Polygon2D.java
View file @
05225f41
...
...
@@ -1128,7 +1128,7 @@ public class Polygon2D extends ActiveContour
// FIXME: it appears to be better to always apply model force but just reducing it (Stephane)
if
((
boundField
==
null
)
||
boundField
.
contains
(
p
.
x
,
p
.
y
,
0
,
0
,
0
))
{
if
(
modelForces
[
index
]
!=
null
)
if
(
(
modelForces
[
index
]
!=
null
)
&&
(
nearBounds
!=
null
))
{
// close from border of "bound field" ? --> reduce model forces
if
((
p
.
x
<
nearBounds
.
getMinX
())
||
(
p
.
x
>
nearBounds
.
getMaxX
()))
...
...
@@ -1139,11 +1139,16 @@ public class Polygon2D extends ActiveContour
}
else
{
//
reduce
model force
//
inhibit
model force
if
(
modelForces
[
index
]
!=
null
)
modelForces
[
index
].
scale
(
0.1
);
// reduce feedback force
feedbackForces
[
index
].
scale
(
0.25
);
modelForces
[
index
].
scale
(
0
);
// inhibit feedback force
feedbackForces
[
index
].
scale
(
0
);
// // reduce model force
// if (modelForces[index] != null)
// modelForces[index].scale(0.1);
// // reduce feedback force
// feedbackForces[index].scale(0.25);
}
// set initial model force
...
...
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