mpicbg.models
Class PointMatch

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

public class PointMatch
extends Object
implements Serializable

A link between two Points that are expected to be ideally at the same location in the world coordinate space. The link is directed, such that each link touches only p1.

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected  Point p1
           
protected  Point p2
           
protected  double strength
           
protected  double weight
           
protected  double[] weights
           
 
Constructor Summary
PointMatch(Point p1, Point p2)
          Constructor Create a PointMatch without weight.
PointMatch(Point p1, Point p2, double weight)
          Constructor Create a PointMatch with one weight.
PointMatch(Point p1, Point p2, double[] weights)
          Constructor Create a PointMatch with an Array of weights.
PointMatch(Point p1, Point p2, double[] weights, double strength)
          Constructor Create a PointMatch with an Array of weights and a strength.
PointMatch(Point p1, Point p2, double weight, double strength)
          Constructor Create a PointMatch with one weight and strength.
 
Method Summary
static void apply(Collection<? extends PointMatch> matches, CoordinateTransform t)
          Apply a CoordinateTransform to p1 a Collection of PointMatches, update their distances.
 void apply(CoordinateTransform t)
          Apply a CoordinateTransform to p1, update distance.
 void apply(CoordinateTransform t, double amount)
          Apply a CoordinateTransform to p1 with a given amount, update distance.
protected  void calculateWeight()
           
static void cloneSourcePoints(Collection<PointMatch> matches, Collection<Point> sourcePoints)
           
static void cloneTargetPoints(Collection<PointMatch> matches, Collection<Point> targetPoints)
           
static Collection<PointMatch> flip(Collection<PointMatch> matches)
          Flip symmetrically, weights remains unchanged.
static void flip(Collection<PointMatch> matches, Collection<PointMatch> flippedMatches)
          Flip all PointMatches from matches symmetrically and fill flippedMatches with them, weights remain unchanged.
 double getDistance()
           
 Point getP1()
           
 Point getP2()
           
 double getWeight()
           
 double[] getWeights()
           
static double maxDistance(Collection<PointMatch> matches)
           
static double meanDistance(Collection<PointMatch> matches)
           
 double popWeight()
          Get the last weights element and remove it from the list.
 void pushWeight(double w)
          Append a new element to the right side of the weights list.
 void setWeight(int index, double weight)
           
 void setWeights(double[] weights)
           
 double shiftWeight()
          Get the first weights element and remove it from the list.
static void sourcePoints(Collection<PointMatch> matches, Collection<Point> sourcePoints)
           
static void targetPoints(Collection<PointMatch> matches, Collection<Point> targetPoints)
           
 void unshiftWeight(double w)
          Append a new element to the left side of the weights list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strength

protected double strength

p1

protected final Point p1

p2

protected final Point p2

weights

protected double[] weights

weight

protected double weight
Constructor Detail

PointMatch

public PointMatch(Point p1,
                  Point p2,
                  double[] weights,
                  double strength)
Constructor Create a PointMatch with an Array of weights and a strength. The Array of weights will be copied. Strength gives the amount of application: strength = 0 means p1 will not be transferred, strength = 1 means p1 will be fully transferred

Parameters:
p1 - Point 1
p2 - Point 2
weights - Array of weights
strength - how much should #apply(Model, double) affect p1

PointMatch

public PointMatch(Point p1,
                  Point p2,
                  double[] weights)
Constructor Create a PointMatch with an Array of weights. The Array of weights will be copied.

Parameters:
p1 - Point 1
p2 - Point 2
weights - Array of weights

PointMatch

public PointMatch(Point p1,
                  Point p2,
                  double weight)
Constructor Create a PointMatch with one weight.

Parameters:
p1 - Point 1
p2 - Point 2
weight - Weight

PointMatch

public PointMatch(Point p1,
                  Point p2,
                  double weight,
                  double strength)
Constructor Create a PointMatch with one weight and strength. Strength gives the amount of application: strength = 0 means p1 will not be transferred, strength = 1 means p1 will be fully transferred

Parameters:
p1 - Point 1
p2 - Point 2
weight - Weight
strength - how much should #apply(Model, double) affect p1

PointMatch

public PointMatch(Point p1,
                  Point p2)
Constructor Create a PointMatch without weight.

Parameters:
p1 - Point 1
p2 - Point 2
weights - Weight
Method Detail

getP1

public Point getP1()

getP2

public Point getP2()

calculateWeight

protected void calculateWeight()

getWeights

public double[] getWeights()

setWeights

public void setWeights(double[] weights)

getWeight

public double getWeight()

setWeight

public void setWeight(int index,
                      double weight)

popWeight

public double popWeight()
Get the last weights element and remove it from the list. In case that only one element is in the list, the element is not removed but set to 1.0.

Returns:

pushWeight

public void pushWeight(double w)
Append a new element to the right side of the weights list.

Parameters:
w -

shiftWeight

public double shiftWeight()
Get the first weights element and remove it from the list. In case that only one element is in the list, the element is not removed but set to 1.0.

Returns:

unshiftWeight

public void unshiftWeight(double w)
Append a new element to the left side of the weights list.

Parameters:
w -

getDistance

public double getDistance()

apply

public void apply(CoordinateTransform t)
Apply a CoordinateTransform to p1, update distance.

Parameters:
t -

apply

public void apply(CoordinateTransform t,
                  double amount)
Apply a CoordinateTransform to p1 with a given amount, update distance.

Parameters:
t -
amount -

apply

public static void apply(Collection<? extends PointMatch> matches,
                         CoordinateTransform t)
Apply a CoordinateTransform to p1 a Collection of PointMatches, update their distances.

Parameters:
matches -
t -

flip

public static final void flip(Collection<PointMatch> matches,
                              Collection<PointMatch> flippedMatches)
Flip all PointMatches from matches symmetrically and fill flippedMatches with them, weights remain unchanged.

Parameters:
matches - original set
flippedMatches - result set

flip

public static final Collection<PointMatch> flip(Collection<PointMatch> matches)
Flip symmetrically, weights remains unchanged.

Parameters:
matches -
Returns:

sourcePoints

public static final void sourcePoints(Collection<PointMatch> matches,
                                      Collection<Point> sourcePoints)

cloneSourcePoints

public static final void cloneSourcePoints(Collection<PointMatch> matches,
                                           Collection<Point> sourcePoints)

targetPoints

public static final void targetPoints(Collection<PointMatch> matches,
                                      Collection<Point> targetPoints)

cloneTargetPoints

public static final void cloneTargetPoints(Collection<PointMatch> matches,
                                           Collection<Point> targetPoints)

meanDistance

public static double meanDistance(Collection<PointMatch> matches)

maxDistance

public static double maxDistance(Collection<PointMatch> matches)


Copyright © 2007-2016 Fiji. All Rights Reserved.