Go to the documentation of this file.00001 #ifndef rgrl_invariant_single_landmark_h_
00002 #define rgrl_invariant_single_landmark_h_
00003
00004
00005
00006
00007
00008
00009 #include <vcl_vector.h>
00010 #include <vnl/vnl_double_2.h>
00011
00012 #include "rgrl_transformation_sptr.h"
00013 #include "rgrl_scale_sptr.h"
00014 #include "rgrl_invariant_sptr.h"
00015 #include "rgrl_mask.h"
00016 #include "rgrl_invariant.h"
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class rgrl_invariant_single_landmark
00037 : public rgrl_invariant
00038 {
00039 public:
00040
00041 rgrl_invariant_single_landmark(vnl_vector<double> location,
00042 vnl_vector<double> vessel_dir1,
00043 vnl_vector<double> vessel_dir2,
00044 vnl_vector<double> vessel_dir3,
00045 double width1, double width2, double width3,
00046 double angular_std = 1,
00047 double width_ratio_std = 1);
00048
00049
00050
00051
00052
00053
00054 rgrl_invariant_single_landmark(const rgrl_invariant_single_landmark& copy,
00055 double angular_std = 1,
00056 double width_ratio_std = 1);
00057
00058
00059 const vnl_double_2& location() const;
00060
00061
00062 const vnl_double_2& boundary_point_location(int i) const;
00063
00064
00065 const vnl_double_2& boundary_point_normal(int i) const;
00066
00067
00068 bool estimate(rgrl_invariant_sptr from,
00069 rgrl_transformation_sptr& xform,
00070 rgrl_scale_sptr& scale );
00071
00072
00073 const vnl_vector<double>& cartesian_invariants() const;
00074
00075
00076 const vnl_vector<double>& angular_invariants() const;
00077
00078
00079 rgrl_mask_box region() const;
00080
00081
00082 bool has_region() const {return true;}
00083
00084
00085
00086
00087
00088 const vnl_double_2& center();
00089
00090
00091
00092
00093
00094
00095
00096 bool is_ambiguous() const {return is_ambiguous_;}
00097
00098
00099 rgrl_type_macro( rgrl_invariant_single_landmark, rgrl_invariant );
00100
00101 private:
00102
00103
00104 double ccw_angle_between(vnl_double_2 from, vnl_double_2 to);
00105
00106
00107
00108
00109
00110
00111
00112 void reorder_vessel( vcl_vector<vnl_vector<double> >& directions,
00113 vcl_vector<double>& local_widths,
00114 vcl_vector<double>& angles);
00115
00116 private:
00117 vnl_double_2 location_;
00118 vcl_vector<double> local_widths_;
00119 vcl_vector<vnl_double_2> boundary_points_;
00120 vcl_vector<vnl_double_2> trace_normals_;
00121 vnl_vector<double> cartesian_invariants_;
00122 vnl_vector<double> angular_invariants_;
00123 vnl_double_2 center_;
00124
00125 double radius_;
00126 bool is_ambiguous_;
00127 bool center_set_;
00128 bool is_estimate_set_;
00129 };
00130
00131 #endif // rgrl_invariant_single_landmark_h_