00001 // This is mul/vpdfl/vpdfl_axis_gaussian_builder.h 00002 #ifndef vpdfl_axis_gaussian_builder_h 00003 #define vpdfl_axis_gaussian_builder_h 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \author Tim Cootes 00010 // \date 12-Apr-2001 00011 // \brief Class to build vpdfl_axis_gaussian objects 00012 00013 #include <vpdfl/vpdfl_builder_base.h> 00014 #include <vcl_iosfwd.h> 00015 00016 //======================================================================= 00017 00018 class vpdfl_axis_gaussian; 00019 00020 //: Class to build vpdfl_axis_gaussian objects 00021 class vpdfl_axis_gaussian_builder : public vpdfl_builder_base 00022 { 00023 double min_var_; 00024 00025 vpdfl_axis_gaussian& gaussian(vpdfl_pdf_base& model) const; 00026 public: 00027 00028 //: Dflt ctor 00029 vpdfl_axis_gaussian_builder(); 00030 00031 //: Destructor 00032 virtual ~vpdfl_axis_gaussian_builder(); 00033 00034 //: Create empty model 00035 virtual vpdfl_pdf_base* new_model() const; 00036 00037 //: Define lower threshold on variance for built models 00038 virtual void set_min_var(double min_var); 00039 00040 //: Get lower threshold on variance for built models 00041 virtual double min_var() const; 00042 00043 //: Build default model with given mean 00044 virtual void build(vpdfl_pdf_base& model, 00045 const vnl_vector<double>& mean) const; 00046 00047 //: Build model from data 00048 virtual void build(vpdfl_pdf_base& model, 00049 mbl_data_wrapper<vnl_vector<double> >& data) const; 00050 00051 //: Build model from weighted data 00052 virtual void weighted_build(vpdfl_pdf_base& model, 00053 mbl_data_wrapper<vnl_vector<double> >& data, 00054 const vcl_vector<double>& wts) const; 00055 00056 //: Version number for I/O 00057 short version_no() const; 00058 00059 //: Name of the class 00060 virtual vcl_string is_a() const; 00061 00062 //: Does the name of the class match the argument? 00063 virtual bool is_class(vcl_string const& s) const; 00064 00065 //: Create a copy on the heap and return base class pointer 00066 virtual vpdfl_builder_base* clone() const; 00067 00068 //: Print class to os 00069 virtual void print_summary(vcl_ostream& os) const; 00070 00071 //: Save class to binary file stream 00072 virtual void b_write(vsl_b_ostream& bfs) const; 00073 00074 //: Load class from binary file stream 00075 virtual void b_read(vsl_b_istream& bfs); 00076 00077 //: Read initialisation settings from a stream. 00078 // Parameters: 00079 // \verbatim 00080 // { 00081 // min_var: 1.0e-6 00082 // } 00083 // \endverbatim 00084 // \throw mbl_exception_parse_error if the parse fails. 00085 virtual void config_from_stream(vcl_istream & is); 00086 00087 }; 00088 00089 #endif // vpdfl_axis_gaussian_builder_h