Module org.scijava.ops.image
Class GuoHallThinningStrategy
- java.lang.Object
-
- org.scijava.ops.image.morphology.thin.Abstract3x3NeighbourhoodThinning
-
- org.scijava.ops.image.morphology.thin.GuoHallThinningStrategy
-
- All Implemented Interfaces:
ThinningStrategy
public class GuoHallThinningStrategy extends Abstract3x3NeighbourhoodThinning
Represents the thinning algorithm proposed by Z. Guo and R. W. Hall.- Author:
- Andreas Burger, University of Konstanz
- Implementation Note:
- thinningstrategy names='GuoHall'
-
-
Field Summary
-
Fields inherited from class org.scijava.ops.image.morphology.thin.Abstract3x3NeighbourhoodThinning
m_background, m_foreground
-
-
Constructor Summary
Constructors Constructor Description GuoHallThinningStrategy()GuoHallThinningStrategy(boolean foreground)Create a new Guo-Hall thinning strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.-
Methods inherited from class org.scijava.ops.image.morphology.thin.Abstract3x3NeighbourhoodThinning
afterCycle, findPatternSwitches, getNeighbourhood, randomAccess
-
-
-
-
Constructor Detail
-
GuoHallThinningStrategy
public GuoHallThinningStrategy()
-
GuoHallThinningStrategy
public GuoHallThinningStrategy(boolean foreground)
Create a new Guo-Hall thinning strategy. The passed boolean will represent the foreground-value of the image.- Parameters:
foreground- Value determining the boolean value of foreground pixels.
-
-
Method Detail
-
removePixel
public boolean removePixel(long[] position, RandomAccessible<BitType> accessible, int iteration)Description copied from interface:ThinningStrategyThis 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
public int getIterationsPerCycle()
Description copied from interface:ThinningStrategyReturns 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.- Specified by:
getIterationsPerCyclein interfaceThinningStrategy- Overrides:
getIterationsPerCyclein classAbstract3x3NeighbourhoodThinning- Returns:
- The number of iterations per cycle.
-
copy
public ThinningStrategy copy()
Description copied from interface:ThinningStrategyReturns a separate copy of this strategy.- Returns:
- A new instance of this strategy with the same values.
-
-