mpicbg.models
Class ElasticMovingLeastSquaresMesh<M extends AbstractModel<M>>

java.lang.Object
  extended by mpicbg.models.TransformMesh
      extended by mpicbg.models.MovingLeastSquaresMesh<M>
          extended by mpicbg.models.ElasticMovingLeastSquaresMesh<M>
Type Parameters:
M - local model
All Implemented Interfaces:
Serializable, CoordinateTransform, InverseCoordinateTransform, InvertibleCoordinateTransform

public class ElasticMovingLeastSquaresMesh<M extends AbstractModel<M>>
extends MovingLeastSquaresMesh<M>

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected  double alpha
           
protected  HashSet<Tile<M>> fixedTiles
           
 
Fields inherited from class mpicbg.models.MovingLeastSquaresMesh
error, modelClass, pt
 
Fields inherited from class mpicbg.models.TransformMesh
av, defaultPointFactory, defaultPointMatchFactory, height, va, width
 
Constructor Summary
ElasticMovingLeastSquaresMesh(Class<M> modelClass, int numX, double width, double height, double alpha)
           
ElasticMovingLeastSquaresMesh(Class<M> modelClass, int numX, int numY, double width, double height, double alpha)
           
 
Method Summary
 void fixTile(Tile<M> t)
           
 Shape illustratePointMatchDisplacements()
          Create a Shape that illustrates the displacements of PointMatches.
 Shape illustratePointMatches()
          Create a Shape that illustrates the PointMatches.
 void optimize(double maxError, int maxIterations, int maxPlateauwidth)
          Minimize the displacement of all PointMatches of all tiles.
 void optimizeByStrength(double maxError, int maxIterations, int maxPlateauwidth, ByteProcessor ipPlot, ImagePlus impPlot)
          Minimize the displacement of all PointMatches of all tiles.
 void optimizeIteration()
          Performs one optimization iteration.
 void optimizeIteration(ErrorStatistic observer)
          Performs one optimization iteration and writes its error into the ErrorStatistics
 void update(double amount)
          Update all PointMatches in all tiles and estimate the average displacement by weight of the PointMatch.
 
Methods inherited from class mpicbg.models.MovingLeastSquaresMesh
addMatchWeightedByDistance, apply, findClosest, getError, getModelClass, getVerticeModelMap, getVertices, numVertices, updateModels, weigh
 
Methods inherited from class mpicbg.models.TransformMesh
addTriangle, apply, applyInPlace, applyInverse, applyInverseInPlace, bounds, createInverse, findClosestSourcePoint, findClosestTargetPoint, getAV, getHeight, getVA, getWidth, illustrateBestRigidSVG, illustrateMesh, illustrateMeshSVG, illustrateTriangle, init, isInConvexTargetPolygon, isInSourcePolygon, numY, scale, updateAffine, updateAffines
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fixedTiles

protected final HashSet<Tile<M extends AbstractModel<M>>> fixedTiles

alpha

protected final double alpha
Constructor Detail

ElasticMovingLeastSquaresMesh

public ElasticMovingLeastSquaresMesh(Class<M> modelClass,
                                     int numX,
                                     int numY,
                                     double width,
                                     double height,
                                     double alpha)

ElasticMovingLeastSquaresMesh

public ElasticMovingLeastSquaresMesh(Class<M> modelClass,
                                     int numX,
                                     double width,
                                     double height,
                                     double alpha)
Method Detail

update

public final void update(double amount)
Update all PointMatches in all tiles and estimate the average displacement by weight of the PointMatch.


optimizeIteration

public final void optimizeIteration(ErrorStatistic observer)
                             throws NotEnoughDataPointsException,
                                    IllDefinedDataPointsException
Performs one optimization iteration and writes its error into the ErrorStatistics

Parameters:
observer - collecting the error after update
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

optimizeIteration

public final void optimizeIteration()
                             throws NotEnoughDataPointsException,
                                    IllDefinedDataPointsException
Performs one optimization iteration.

Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

fixTile

public void fixTile(Tile<M> t)

optimize

public final void optimize(double maxError,
                           int maxIterations,
                           int maxPlateauwidth)
                    throws NotEnoughDataPointsException,
                           IllDefinedDataPointsException
Minimize the displacement of all PointMatches of all tiles.

Parameters:
maxError - 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 slope in an interval of this size is 0.0 (in double accuracy). This prevents the algorithm from stopping at plateaus smaller than this value.
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

optimizeByStrength

public final void optimizeByStrength(double maxError,
                                     int maxIterations,
                                     int maxPlateauwidth,
                                     ByteProcessor ipPlot,
                                     ImagePlus impPlot)
                              throws NotEnoughDataPointsException,
                                     IllDefinedDataPointsException
Minimize the displacement of all PointMatches of all tiles.

Parameters:
maxError - 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 slope in an interval of this size is 0.0 (in double accuracy). This prevents the algorithm from stopping at plateaus smaller than this value.
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

illustratePointMatches

public final Shape illustratePointMatches()
Create a Shape that illustrates the PointMatches.

Returns:
the illustration

illustratePointMatchDisplacements

public final Shape illustratePointMatchDisplacements()
Create a Shape that illustrates the displacements of PointMatches.

Returns:
the illustration


Copyright © 2007-2016 Fiji. All Rights Reserved.