Go to the documentation of this file.00001 #ifndef rgrl_trans_quadratic_h_
00002 #define rgrl_trans_quadratic_h_
00003
00004
00005
00006
00007
00008
00009 #include "rgrl_transformation.h"
00010 #include <vcl_iosfwd.h>
00011
00012 class rgrl_trans_quadratic
00013 : public rgrl_transformation
00014 {
00015 public:
00016
00017
00018 rgrl_trans_quadratic( unsigned int dimension = 0);
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 rgrl_trans_quadratic( vnl_matrix<double> const& Q,
00029 vnl_matrix<double> const& A,
00030 vnl_vector<double> const& trans,
00031 vnl_matrix<double> const& covar );
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 rgrl_trans_quadratic( vnl_matrix<double> const& Q,
00044 vnl_matrix<double> const& A,
00045 vnl_vector<double> const& trans );
00046
00047 void
00048 set_from_center( vnl_vector<double> const& from_center );
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 rgrl_trans_quadratic( vnl_matrix<double> const& Q,
00059 vnl_matrix<double> const& A,
00060 vnl_vector<double> const& trans,
00061 vnl_matrix<double> const& covar,
00062 vnl_vector<double> const& from_centre,
00063 vnl_vector<double> const& to_centre );
00064
00065
00066 vnl_matrix<double> transfer_error_covar( vnl_vector<double> const& p ) const;
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 vnl_matrix<double> const& Q() const;
00080
00081
00082 vnl_matrix<double> const& A() const;
00083
00084
00085 vnl_vector<double> const& t() const;
00086
00087
00088 virtual void inv_map( const vnl_vector<double>& to,
00089 bool initialize_next,
00090 const vnl_vector<double>& to_delta,
00091 vnl_vector<double>& from,
00092 vnl_vector<double>& from_next_est) const;
00093
00094
00095 virtual void jacobian_wrt_loc( vnl_matrix<double>& jac, vnl_vector<double> const& from_loc ) const;
00096
00097
00098 virtual rgrl_transformation_sptr scale_by( double scale ) const;
00099
00100
00101 rgrl_type_macro( rgrl_trans_quadratic, rgrl_transformation );
00102
00103
00104 void write(vcl_ostream& os ) const;
00105
00106
00107 bool read(vcl_istream& is );
00108
00109
00110 rgrl_transformation_sptr clone() const;
00111
00112 protected:
00113 void map_loc( vnl_vector<double> const& from,
00114 vnl_vector<double> & to ) const;
00115
00116 void map_dir( vnl_vector<double> const& from_loc,
00117 vnl_vector<double> const& from_dir,
00118 vnl_vector<double> & to_dir ) const;
00119 private:
00120
00121 vnl_vector<double> higher_order_terms(vnl_vector<double> p) const;
00122
00123 private:
00124 vnl_matrix<double> Q_;
00125 vnl_matrix<double> A_;
00126 vnl_vector<double> trans_;
00127 vnl_vector<double> from_centre_;
00128
00129
00130 virtual void inv_map(vnl_vector<double> const&, vnl_vector<double>&) const;
00131 virtual rgrl_transformation_sptr inverse_transform() const;
00132 };
00133
00134 #endif