java.lang.Object
gov.nih.mipav.view.renderer.WildMagic.ProstateFramework.ShapeSimilarity.ShapeSimilarity

public class ShapeSimilarity extends 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
  • Field Details

    • HEAP

      EVENT[] HEAP
    • events

      EVENT[] events
    • bufferReader

      private BufferedReader bufferReader
    • n_events

      public static int n_events
  • Constructor Details

    • ShapeSimilarity

      public ShapeSimilarity()
  • Method Details

    • 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)
    • poly_to_turn_rep

      void poly_to_turn_rep(poly p, TURN_REP t)
    • rotate_turn_rep

      void rotate_turn_rep(TURN_REP t, int to, TURN_REP r)
    • 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)
    • reinit_interval

      public int reinit_interval(TURN_REP f, TURN_REP g)
    • add_event

      public void add_event(TURN_REP f, TURN_REP g, int fi, int gi)
    • next_event

      public EVENT next_event()
    • next_t

      public double next_t()
    • init_events

      public void init_events(TURN_REP f, TURN_REP g)
    • 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)
    • comparePolygon

      public void comparePolygon(poly pg, poly pf, double[] result)
    • test

      public void test(String[] args)
    • read_poly

      int read_poly(poly polygon)