Class ShapeSimilarity
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.ProstateFramework.ShapeSimilarity.ShapeSimilarity
-
public class ShapeSimilarity extends java.lang.ObjectPorted 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 voidadd_event(TURN_REP f, TURN_REP g, int fi, int gi)voidcomparePolygon(poly pg, poly pf, double[] result)doubleh_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)intilog2(int x)voidinit_events(TURN_REP f, TURN_REP g)(package private) voidinit_vals(TURN_REP f, TURN_REP g, double[] ht0_rtn, double[] slope_rtn, double[] a_rtn)intmin(int x, int y)EVENTnext_event()doublenext_t()(package private) voidpoly_to_turn_rep(poly p, TURN_REP t)(package private) intread_poly(poly polygon)intreinit_interval(TURN_REP f, TURN_REP g)voidreinit_vals(TURN_REP f, TURN_REP g, int fi, int gi, double[] ht0_rtn, double[] slope_rtn)(package private) voidrotate_turn_rep(TURN_REP t, int to, TURN_REP r)doublesqr(double x)voidtest(java.lang.String[] args)doubletr_i(TURN_REP tr, int i)doubletr_len(TURN_REP tr, int i)doubletr_n(TURN_REP tr)doubletr_s(TURN_REP tr, int i)doubletr_smt(TURN_REP tr, int i, double t)doubletr_theta(TURN_REP tr, int i)doubleturn(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)
-
-