Class ShapeSimilarity
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.ProstateFramework.ShapeSimilarity.ShapeSimilarity
-
public class ShapeSimilarity extends java.lang.Object
Ported to Java from C code from http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/WEBSITE/IMPLEMEN/TURN/IMPLEMEN.HTM May only be used for non-commercial purposes. Implementation of "An Efficiently Computable Metric for Comparing Polygonal Shapes," by Arkin, Chew, Huttenlocher, Kedem, and Mitchel (undated). This expands a little on the cited reference to achieve O(n) space and O(mn log n) run time. This could be improved to O(min m,n) and O(mn log min m,n) by selecting the smallest of the 2 polys to create the initial event heap. See init_events(). Variable names match the article. Implementation (c) Eugene K. Ressler 91, 92 This source may be freely distributed and used for non-commercial purposes, so long as this comment is attached to any code copied or derived from it.- Author:
- Ruida Cheng
-
-
Constructor Summary
Constructors Constructor Description ShapeSimilarity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add_event(TURN_REP f, TURN_REP g, int fi, int gi)
void
comparePolygon(poly pg, poly pf, double[] result)
double
h_t0min(TURN_REP f, TURN_REP g, double hc0, double slope, double alpha, int d_update, double[] theta_star_rtn, EVENT[] e_rtn, double[] hc0_err_rtn, double[] slope_err_rtn)
int
ilog2(int x)
void
init_events(TURN_REP f, TURN_REP g)
(package private) void
init_vals(TURN_REP f, TURN_REP g, double[] ht0_rtn, double[] slope_rtn, double[] a_rtn)
int
min(int x, int y)
EVENT
next_event()
double
next_t()
(package private) void
poly_to_turn_rep(poly p, TURN_REP t)
(package private) int
read_poly(poly polygon)
int
reinit_interval(TURN_REP f, TURN_REP g)
void
reinit_vals(TURN_REP f, TURN_REP g, int fi, int gi, double[] ht0_rtn, double[] slope_rtn)
(package private) void
rotate_turn_rep(TURN_REP t, int to, TURN_REP r)
double
sqr(double x)
void
test(java.lang.String[] args)
double
tr_i(TURN_REP tr, int i)
double
tr_len(TURN_REP tr, int i)
double
tr_n(TURN_REP tr)
double
tr_s(TURN_REP tr, int i)
double
tr_smt(TURN_REP tr, int i, double t)
double
tr_theta(TURN_REP tr, int i)
double
turn(double a, double base)
-
-
-
Method Detail
-
tr_n
public double tr_n(TURN_REP tr)
-
tr_i
public double tr_i(TURN_REP tr, int i)
-
tr_len
public double tr_len(TURN_REP tr, int i)
-
tr_s
public double tr_s(TURN_REP tr, int i)
-
tr_smt
public double tr_smt(TURN_REP tr, int i, double t)
-
tr_theta
public double tr_theta(TURN_REP tr, int i)
-
sqr
public double sqr(double x)
-
min
public int min(int x, int y)
-
ilog2
public int ilog2(int x)
-
turn
public double turn(double a, double base)
-
init_vals
void init_vals(TURN_REP f, TURN_REP g, double[] ht0_rtn, double[] slope_rtn, double[] a_rtn)
-
reinit_vals
public void reinit_vals(TURN_REP f, TURN_REP g, int fi, int gi, double[] ht0_rtn, double[] slope_rtn)
-
next_event
public EVENT next_event()
-
next_t
public double next_t()
-
h_t0min
public double h_t0min(TURN_REP f, TURN_REP g, double hc0, double slope, double alpha, int d_update, double[] theta_star_rtn, EVENT[] e_rtn, double[] hc0_err_rtn, double[] slope_err_rtn)
-
test
public void test(java.lang.String[] args)
-
read_poly
int read_poly(poly polygon)
-
-