de.unihalle.informatik.MiToBo.segmentation.snakes.optimize.termination
Class MTBTermination

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.segmentation.snakes.optimize.termination.MTBTermination
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
MTBTermAreaDiff, MTBTermAreaDiffSlidingOffset, MTBTermMaxIterations, MTBTermMotionDiff

@ALDParametrizedClass
public abstract class MTBTermination
extends java.lang.Object
implements java.lang.Cloneable

Class for checking termination criteria of the current snake iteration. Termination criteria can be defined by several methods, which can be found in the derived classes in detail.

Author:
misiak

Field Summary
protected  SnakeOptimizerSingle optimizer
          Current snake optimizer with all its parameters and fields.
protected  SnakeOptimizer.Snake_status status
          Status of current snake.
protected  boolean verbose
          Flag to turn display of additional information on/off.
 
Constructor Summary
MTBTermination()
           
 
Method Summary
abstract  MTBTermination clone()
          Clones this object.
abstract  boolean init(SnakeOptimizerSingle opt)
          Initializing routine which is called once before the termination is actually used.
abstract  SnakeOptimizer.Snake_status terminate()
          Method to check termination status of the snake.
abstract  java.lang.String toString()
          Method for short termination description name.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

optimizer

protected SnakeOptimizerSingle optimizer
Current snake optimizer with all its parameters and fields.

Parameters and fields include, e.g., the current snake, old snake, gamma values and energies.


status

protected SnakeOptimizer.Snake_status status
Status of current snake.

Termination status can be SNAKE_DONE or SNAKE_SUCCESS.


verbose

@ALDClassParameter(label="Verbose",
                   dataIOOrder=100)
protected boolean verbose
Flag to turn display of additional information on/off.

Constructor Detail

MTBTermination

public MTBTermination()
Method Detail

clone

public abstract MTBTermination clone()
                              throws java.lang.CloneNotSupportedException
Clones this object.

Note that all internal variables should be cloned. As this is not possible for the SnakeOptimizerSingle object the internal reference should be left to null. It will be properly initialized later when SnakeOptimizerSingle.initOptimizer() is invoked.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

init

public abstract boolean init(SnakeOptimizerSingle opt)
Initializing routine which is called once before the termination is actually used.

In this routine global parameter settings can be handled or other initialization stuff be done. The SnakeOptimizer will call this routine once before the actual use of the termination strategy. If no stuff needs to be done in advance the routine should at least return true.

Parameters:
opt - calling snake optimizer
Returns:
True if init was successful.

terminate

public abstract SnakeOptimizer.Snake_status terminate()
Method to check termination status of the snake. Necessary for all subclasses.

Returns:
Status of the current snake.

toString

public abstract java.lang.String toString()
Method for short termination description name.

Overrides:
toString in class java.lang.Object