Class ShapeSimilarity
java.lang.Object
gov.nih.mipav.view.renderer.WildMagic.ProstateFramework.ShapeSimilarity.ShapeSimilarity
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BufferedReader(package private) EVENT[](package private) EVENT[]static int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcomparePolygon(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) voidintmin(int x, int y) doublenext_t()(package private) voidpoly_to_turn_rep(poly p, TURN_REP t) (package private) intintreinit_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) voiddoubledoubledoubledoubledoubledoubledoubleturn(double a, double base)
-
Field Details
-
Constructor Details
-
ShapeSimilarity
public ShapeSimilarity()
-
-
Method Details
-
tr_n
-
tr_i
-
tr_len
-
tr_s
-
tr_smt
-
tr_theta
-
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) -
poly_to_turn_rep
-
rotate_turn_rep
-
init_vals
-
reinit_vals
-
reinit_interval
-
add_event
-
next_event
-
next_t
public double next_t() -
init_events
-
h_t0min
-
comparePolygon
-
test
-
read_poly
-