1 package mpi
.fruitfly
.registration
;
3 import java
.util
.ArrayList
;
4 import java
.util
.Collection
;
6 public class SimPoint2DMatch
11 private float distance
;
12 private float xDistance
;
13 private float yDistance
;
14 private float rDistance
;
16 final public float getDistance(){ return distance
; }
17 final public float getXDistance(){ return xDistance
; }
18 final public float getYDistance(){ return yDistance
; }
19 final public float getRDistance(){ return rDistance
; }
21 public SimPoint2DMatch(
28 distance
= SimPoint2D
.distance( s1
, s2
);
31 final public void apply( Model model
)
34 distance
= SimPoint2D
.distance( s1
, s2
);
37 final public static ArrayList
< SimPoint2DMatch
> fromMatches( Collection
< Match
> matches
)
39 ArrayList
< SimPoint2DMatch
> list
= new ArrayList
< SimPoint2DMatch
>();
40 float weight
= 1.0f
/ ( float )matches
.size();
41 for ( Match match
: matches
)
59 final public static ArrayList
< Match
> toMatches( Collection
< SimPoint2DMatch
> matches
)
61 ArrayList
< Match
> list
= new ArrayList
< Match
>();
62 for ( SimPoint2DMatch match
: matches
)
66 new float[]{ match
.s1
.getWtx(), match
.s1
.getWty() },
67 new float[]{ match
.s2
.getWtx(), match
.s2
.getWty() },
69 match
.s2
.getWeight() ) );
74 final public static ArrayList
< SimPoint2DMatch
> flip( Collection
< SimPoint2DMatch
> matches
)
76 ArrayList
< SimPoint2DMatch
> list
= new ArrayList
< SimPoint2DMatch
>();
77 for ( SimPoint2DMatch match
: matches
)