Module org.scijava.ops.image
Interface ThinningStrategy
-
- All Known Implementing Classes:
Abstract3x3NeighbourhoodThinning,GuoHallThinningStrategy,HilditchThinningStrategy,MorphologicalThinningStrategy,ZhangSuenThinningStrategy
public interface ThinningStrategyAn interface for a simple thinning strategy employed by the thinningOp.- Author:
- Andreas Burger, University of Konstanz
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidafterCycle()Called by the ThinningOp after each cycle, and thus exactly getIterationsPerCycle()-times per iteration.ThinningStrategycopy()Returns a separate copy of this strategy.intgetIterationsPerCycle()Returns the minimum number of iterations necessary for the algorithm to run.booleanremovePixel(long[] position, RandomAccessible<BitType> accessible, int iteration)This method should determine whether to keep a foreground pixel or not.
-
-
-
Method Detail
-
removePixel
boolean removePixel(long[] position, RandomAccessible<BitType> accessible, int iteration)This method should determine whether to keep a foreground pixel or not.- Parameters:
position- Long Array containing the current position in the image.accessible- The image to thin.iteration- The iteration number.- Returns:
- True if pixel can be switched to background, false otherwise.
-
getIterationsPerCycle
int getIterationsPerCycle()
Returns the minimum number of iterations necessary for the algorithm to run. This delays termination of the thinning algorithm until the end of the current cycle. If, for example, no changes occur during the second iteration of a 4-iteration-cycle, iterations 3 and 4 still take place.- Returns:
- The number of iterations per cycle.
-
afterCycle
void afterCycle()
Called by the ThinningOp after each cycle, and thus exactly getIterationsPerCycle()-times per iteration. Used for performing different calculations in each step of the cycle.
-
copy
ThinningStrategy copy()
Returns a separate copy of this strategy.- Returns:
- A new instance of this strategy with the same values.
-
-