de.unihalle.informatik.MiToBo.segmentation.activecontours.datatypes
Class MTBSetWeightedEnergy<T>

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.segmentation.activecontours.datatypes.MTBSetWeightedEnergy<T>

@ALDParametrizedClass
public class MTBSetWeightedEnergy<T>
extends java.lang.Object

Container data type for energies in PDE approaches.

Objects of this class contain a set of energies. With each energy an individual weight is associated which allows application-dependent energy combinations. Per default the weights of all energies in the set are set to 1.0.

Author:
moeller

Field Summary
protected  java.util.Vector<T> energies
          List of snake energies.
protected  java.util.Vector<java.lang.Double> weights
          List of energy weights.
 
Constructor Summary
MTBSetWeightedEnergy()
          Default contructor for empty set.
MTBSetWeightedEnergy(java.util.Vector<T> es)
          Constructor for a given vector of energies.
MTBSetWeightedEnergy(java.util.Vector<T> es, java.util.Vector<java.lang.Double> ws)
          Constructor with energies and weights.
 
Method Summary
 void addEnergy(T e)
          Append another energy to the list with default weight 1.0.
 void addEnergy(T e, double w)
          Append another energy to the list.
 T getEnergy(int i)
          Returns element i of the energy list.
 java.util.Vector<T> getEnergyList()
          Returns the list of energies.
 java.lang.Double getWeight(int i)
          Returns element i of the weight list.
 java.util.Vector<java.lang.Double> getWeights()
          Returns the list of weights.
 void setEnergyList(java.util.Vector<T> es)
          Specify a new set of energies, all weights are reset to 1.0.
 void setWeights(java.util.Vector<java.lang.Double> ws)
          Specify new weights.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

energies

@ALDClassParameter(label="energies",
                   mode=STANDARD,
                   dataIOOrder=-10)
protected java.util.Vector<T> energies
List of snake energies.


weights

@ALDClassParameter(label="weights",
                   mode=STANDARD,
                   dataIOOrder=-5)
protected java.util.Vector<java.lang.Double> weights
List of energy weights.

Constructor Detail

MTBSetWeightedEnergy

public MTBSetWeightedEnergy()
Default contructor for empty set.


MTBSetWeightedEnergy

public MTBSetWeightedEnergy(java.util.Vector<T> es)
Constructor for a given vector of energies.

Parameters:
es - Vector with energies.

MTBSetWeightedEnergy

public MTBSetWeightedEnergy(java.util.Vector<T> es,
                            java.util.Vector<java.lang.Double> ws)
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor with energies and weights.

Both vectors must have the same size, otherwise an exception is thrown.

Parameters:
es - Vector of energies.
ws - Vector of weights.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

addEnergy

public void addEnergy(T e)
Append another energy to the list with default weight 1.0.

Parameters:
e - New energy to be appended.

addEnergy

public void addEnergy(T e,
                      double w)
Append another energy to the list.

Parameters:
e - New energy.
w - Weight for the energy.

getEnergy

public T getEnergy(int i)
Returns element i of the energy list.

Parameters:
i - Index of energy to be returned.
Returns:
Requested energy object.

getEnergyList

public java.util.Vector<T> getEnergyList()
Returns the list of energies.

Returns:
List of energies.

getWeight

public java.lang.Double getWeight(int i)
Returns element i of the weight list.

Returns:
Requested element of weight list.

getWeights

public java.util.Vector<java.lang.Double> getWeights()
Returns the list of weights.

Returns:
List of current weights.

setEnergyList

public void setEnergyList(java.util.Vector<T> es)
Specify a new set of energies, all weights are reset to 1.0.

Parameters:
es - New vector of energies.

setWeights

public void setWeights(java.util.Vector<java.lang.Double> ws)
Specify new weights.

Note that it is assumed that the size of the weight vector matches the size of the current energy set.

Parameters:
ws - List of energy weights.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object