mpicbg.models
Class MovingLeastSquaresTransform2

java.lang.Object
  extended by mpicbg.models.AbstractMovingLeastSquaresTransform
      extended by mpicbg.models.MovingLeastSquaresTransform2
All Implemented Interfaces:
Serializable, CoordinateTransform

public class MovingLeastSquaresTransform2
extends AbstractMovingLeastSquaresTransform

Alternative implementation of the smooth coordinate transformation interpolating between a set of control points that are maped exactly on top of each other using landmark based deformation by means of Moving Least Squares as described by \citet{SchaeferAl06}.

This implementation stores the control points in double arrays thus being significantly more memory efficient than the object based MovingLeastSquaresTransform. The object count is constant and does not depend on the number of control points.

Note, the AbstractMovingLeastSquaresTransform.apply(double[]) and applyInPlace(double[]) methods are not concurrency safe because they use the same Model instance to execute the local least squares fit.

BibTeX:
 @article{SchaeferAl06,
   author    = {Scott Schaefer and Travis McPhail and Joe Warren},
   title     = {Image deformation using moving least squares},
   journal   = {ACM Transactions on Graphics},
   volume    = {25},
   number    = {3},
   month     = {July},
   year      = {2006},
   issn      = {0730-0301},
   pages     = {533--540},
   publisher = {ACM},
   address   = {New York, NY, USA},
 }
 

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected  float[][] p
           
protected  float[][] q
           
protected  float[] w
           
 
Fields inherited from class mpicbg.models.AbstractMovingLeastSquaresTransform
alpha, model
 
Constructor Summary
MovingLeastSquaresTransform2()
           
 
Method Summary
 void applyInPlace(double[] location)
          Apply the CoordinateTransform to a location.
 void setMatches(Collection<PointMatch> matches)
          Set the control points.
 void setMatches(float[][] p, float[][] q, float[] w)
          Set the control points passing them as arrays that are used by reference.
 
Methods inherited from class mpicbg.models.AbstractMovingLeastSquaresTransform
apply, getAlpha, getModel, setAlpha, setModel, setModel, weigh
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

p

protected float[][] p

q

protected float[][] q

w

protected float[] w
Constructor Detail

MovingLeastSquaresTransform2

public MovingLeastSquaresTransform2()
Method Detail

setMatches

public final void setMatches(Collection<PointMatch> matches)
                      throws NotEnoughDataPointsException,
                             IllDefinedDataPointsException
Set the control points. PointMatches are not stored by reference but their data is copied into internal data buffers.

Specified by:
setMatches in class AbstractMovingLeastSquaresTransform
Parameters:
matches -
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

setMatches

public final void setMatches(float[][] p,
                             float[][] q,
                             float[] w)
                      throws NotEnoughDataPointsException,
                             IllDefinedDataPointsException

Set the control points passing them as arrays that are used by reference. The leading index is dimension which usually results in a reduced object count. E.g. four 2d points are:

 double[][]{
   {x1, x2, x3, x4},
   {y1, y2, y3, y4} }
 

Parameters:
p - source points
q - target points
w - weights
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

applyInPlace

public void applyInPlace(double[] location)
Description copied from interface: CoordinateTransform
Apply the CoordinateTransform to a location.



Copyright © 2007-2016 Fiji. All Rights Reserved.