mpicbg.models
Class TileConfiguration

java.lang.Object
  extended by mpicbg.models.TileConfiguration
All Implemented Interfaces:
Serializable

public class TileConfiguration
extends Object
implements Serializable

A configuration of tiles. Add all tiles that build a common interconnectivity graph to one configuration, fix at least one of the tiles and optimize the configuration.

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected static DecimalFormat decimalFormat
           
protected static DecimalFormatSymbols decimalFormatSymbols
           
protected  double error
           
protected  HashSet<Tile<?>> fixedTiles
           
protected  double maxError
           
protected  double minError
           
protected  HashSet<Tile<?>> tiles
           
 
Constructor Summary
TileConfiguration()
           
 
Method Summary
 void addTile(Tile<?> t)
          Add a single Tile.
 void addTiles(Collection<? extends Tile<?>> t)
          Add a Collection of Tiles.
 void addTiles(TileConfiguration t)
          Add all Tiles of another TileConfiguration.
protected  void apply()
          Apply the model of each Tile to all its PointMatches.
 void clear()
          Cleanup.
 void fixTile(Tile<?> t)
          Fix a single Tile.
 ArrayList<PointMatch> getConnectingPointMatches(Tile<?> targetTile, Tile<?> referenceTile)
          Returns an ArrayList of PointMatch that connect the targetTile and the referenceTile.
 double getError()
           
 HashSet<Tile<?>> getFixedTiles()
           
 double getMaxError()
           
 double getMinError()
           
 HashSet<Tile<?>> getTiles()
           
 void optimize(double maxAllowedError, int maxIterations, int maxPlateauwidth)
          Minimize the displacement of all Correspondence pairs of all Tiles and tell about it.
 void optimize(double maxAllowedError, int maxIterations, int maxPlateauwidth, double damp)
          Minimize the displacement of all Correspondence pairs of all Tiles and tell about it.
 void optimize(ErrorStatistic observer, double maxAllowedError, int maxIterations, int maxPlateauwidth, double damp)
          Minimize the displacement of all Correspondence pairs of all Tiles and tell about it.
 void optimizeAndFilter(double maxAllowedError, int maxIterations, int maxPlateauwidth, double maxMeanFactor)
           
 void optimizeAndFilter(double maxAllowedError, int maxIterations, int maxPlateauwidth, double damp, double maxMeanFactor)
           
 void optimizeSilently(ErrorStatistic observer, double maxAllowedError, int maxIterations, int maxPlateauwidth)
          Minimize the displacement of all Correspondence pairs of all Tiles
 void optimizeSilentlyConcurrent(ErrorStatistic observer, double maxAllowedError, int maxIterations, int maxPlateauwidth, double damp)
           
 List<Tile<?>> preAlign()
          Computes a pre-alignemnt of all non-fixed Tiles by propagating the pairwise models.
protected  void println(String s)
           
protected  void update()
          Update all Correspondences in all Tiles and estimate the average displacement.
protected  void updateErrors()
          Estimate min/max/average displacement of all PointMatches in all Tiles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decimalFormat

protected static final DecimalFormat decimalFormat

decimalFormatSymbols

protected static final DecimalFormatSymbols decimalFormatSymbols

tiles

protected final HashSet<Tile<?>> tiles

fixedTiles

protected final HashSet<Tile<?>> fixedTiles

minError

protected double minError

maxError

protected double maxError

error

protected double error
Constructor Detail

TileConfiguration

public TileConfiguration()
Method Detail

getTiles

public final HashSet<Tile<?>> getTiles()

getFixedTiles

public final HashSet<Tile<?>> getFixedTiles()

getMinError

public final double getMinError()

getMaxError

public final double getMaxError()

getError

public final double getError()

println

protected void println(String s)

clear

public void clear()
Cleanup.


addTile

public void addTile(Tile<?> t)
Add a single Tile.

Parameters:
t -

addTiles

public void addTiles(Collection<? extends Tile<?>> t)
Add a Collection of Tiles.

Parameters:
t -

addTiles

public void addTiles(TileConfiguration t)
Add all Tiles of another TileConfiguration.

Parameters:
t -

fixTile

public void fixTile(Tile<?> t)
Fix a single Tile.

Parameters:
t -

apply

protected void apply()
Apply the model of each Tile to all its PointMatches.


updateErrors

protected void updateErrors()
Estimate min/max/average displacement of all PointMatches in all Tiles.


update

protected void update()
Update all Correspondences in all Tiles and estimate the average displacement.


optimizeSilently

public void optimizeSilently(ErrorStatistic observer,
                             double maxAllowedError,
                             int maxIterations,
                             int maxPlateauwidth)
                      throws NotEnoughDataPointsException,
                             IllDefinedDataPointsException
Minimize the displacement of all Correspondence pairs of all Tiles

Parameters:
maxAllowedError - do not accept convergence if error is > max_error
maxIterations - stop after that many iterations even if there was no minimum found
maxPlateauwidth - convergence is reached if the average absolute slope in an interval of this size and half this size is smaller than 0.0001 (in double accuracy). This is assumed to prevent the algorithm from stopping at plateaus smaller than this value.
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

optimizeSilentlyConcurrent

public void optimizeSilentlyConcurrent(ErrorStatistic observer,
                                       double maxAllowedError,
                                       int maxIterations,
                                       int maxPlateauwidth,
                                       double damp)
                                throws NotEnoughDataPointsException,
                                       IllDefinedDataPointsException,
                                       InterruptedException,
                                       ExecutionException
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException
InterruptedException
ExecutionException

optimize

public void optimize(double maxAllowedError,
                     int maxIterations,
                     int maxPlateauwidth,
                     double damp)
              throws NotEnoughDataPointsException,
                     IllDefinedDataPointsException
Minimize the displacement of all Correspondence pairs of all Tiles and tell about it.

Parameters:
maxAllowedError -
maxIterations -
maxPlateauwidth -
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

optimize

public void optimize(double maxAllowedError,
                     int maxIterations,
                     int maxPlateauwidth)
              throws NotEnoughDataPointsException,
                     IllDefinedDataPointsException
Minimize the displacement of all Correspondence pairs of all Tiles and tell about it.

Parameters:
maxAllowedError -
maxIterations -
maxPlateauwidth -
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

optimize

public void optimize(ErrorStatistic observer,
                     double maxAllowedError,
                     int maxIterations,
                     int maxPlateauwidth,
                     double damp)
              throws NotEnoughDataPointsException,
                     IllDefinedDataPointsException
Minimize the displacement of all Correspondence pairs of all Tiles and tell about it.

Parameters:
maxAllowedError -
maxIterations -
maxPlateauwidth -
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

optimizeAndFilter

public void optimizeAndFilter(double maxAllowedError,
                              int maxIterations,
                              int maxPlateauwidth,
                              double damp,
                              double maxMeanFactor)
                       throws NotEnoughDataPointsException,
                              IllDefinedDataPointsException
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

optimizeAndFilter

public void optimizeAndFilter(double maxAllowedError,
                              int maxIterations,
                              int maxPlateauwidth,
                              double maxMeanFactor)
                       throws NotEnoughDataPointsException,
                              IllDefinedDataPointsException
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

preAlign

public List<Tile<?>> preAlign()
                       throws NotEnoughDataPointsException,
                              IllDefinedDataPointsException
Computes a pre-alignemnt of all non-fixed Tiles by propagating the pairwise models. This does not give a correct registration but a very good starting point for the global optimization. This is necessary for models where the global optimization is not guaranteed to converge like the HomographyModel2D, RigidModel3D, ...

Returns:
- a list of Tiles that could not be pre-aligned
Throws:
NotEnoughDataPointsException
{@link - IllDefinedDataPointsException}
IllDefinedDataPointsException

getConnectingPointMatches

public ArrayList<PointMatch> getConnectingPointMatches(Tile<?> targetTile,
                                                       Tile<?> referenceTile)
Returns an ArrayList of PointMatch that connect the targetTile and the referenceTile. The order of the PointMatch is PointMatch.p1 = target, PointMatch.p2 = reference. A Model.fit() will then solve the fit so that target.p1.l is mapped to reference.p2.w.

Parameters:
targetTile - - the Tile for which a Model can fit
referenceTile - - the Tile to which target will map
Returns:
- an ArrayList of all PointMatch that target and reference share


Copyright © 2007-2016 Fiji. All Rights Reserved.