Commit 6474f6ca authored by Stephane Dallongeville's avatar Stephane Dallongeville
Browse files

small fix

parent 7f869b1c
...@@ -648,21 +648,6 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block ...@@ -648,21 +648,6 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
if (iteration > 0) if (iteration > 0)
System.out.println("[Active Contours] converged current contours on frame " + t + " in " + iteration System.out.println("[Active Contours] converged current contours on frame " + t + " in " + iteration
+ " iterations"); + " iterations");
// no more contours for this time point ?
if (iteration == -1)
{
// detection of new objects disable ?
if (!tracking_newObjects.getValue().booleanValue() || (inputData.getSizeZ() != 1))
{
// no ROIs to work with in future ? --> we can stop process here
if(!hasFutureRois(t))
{
storeResult(t);
break;
}
}
}
if (Thread.currentThread().isInterrupted()) if (Thread.currentThread().isInterrupted())
break; break;
...@@ -678,6 +663,23 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block ...@@ -678,6 +663,23 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
System.out.println("=> evolving new contours..."); System.out.println("=> evolving new contours...");
// evolve new contours // evolve new contours
iteration = evolveContours(t, field); iteration = evolveContours(t, field);
// no more contours for this time point ?
if (iteration == -1)
{
// detection of new objects disable ?
if (!tracking_newObjects.getValue().booleanValue() || (inputData.getSizeZ() != 1))
{
// no ROIs to work with in future ? --> we can stop process here
if (!hasFutureRois(t))
{
storeResult(t);
break;
}
}
}
// log info
if (iteration > 0) if (iteration > 0)
System.out.println( System.out.println(
"[Active Contours] converged new contours on frame " + t + " in " + iteration + " iterations"); "[Active Contours] converged new contours on frame " + t + " in " + iteration + " iterations");
...@@ -1007,7 +1009,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block ...@@ -1007,7 +1009,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
{ {
if (isHeadLess()) if (isHeadLess())
return false; return false;
// take sequence ROI // take sequence ROI
rois = inputData.getROIs(); rois = inputData.getROIs();
} }
...@@ -1017,16 +1019,18 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block ...@@ -1017,16 +1019,18 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
return false; return false;
// only pick ROI for current frame // only pick ROI for current frame
for (ROI roi: rois) for (ROI roi : rois)
{ {
if (roi instanceof ROI2D) if (roi instanceof ROI2D)
{ {
// we have new ROI for this time point or in future // we have new ROI for this time point or in future
if (((ROI2D) roi).getT() >= t) return true; if (((ROI2D) roi).getT() >= t)
return true;
} }
else if (roi instanceof ROI3D) else if (roi instanceof ROI3D)
{ {
if (((ROI3D) roi).getT() >= t) return true; if (((ROI3D) roi).getT() >= t)
return true;
} }
} }
...@@ -1423,7 +1427,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block ...@@ -1423,7 +1427,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
// maximum number of iteration allowed raised ? // maximum number of iteration allowed raised ?
if (iter >= convergence_nbIter.getValue()) if (iter >= convergence_nbIter.getValue())
{ {
// consider that all current evolving contours converged here // consider that all current evolving contours converged here
for (ActiveContour contour : evolvingContoursAtTimeT) for (ActiveContour contour : evolvingContoursAtTimeT)
contour.setLastConvergedFrame(t); contour.setLastConvergedFrame(t);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment