contrib/rpl/rgrl/rgrl_initializer_prior.h
Go to the documentation of this file.
00001 #ifndef rgrl_initializer_prior_h_
00002 #define rgrl_initializer_prior_h_
00003 //:
00004 // \file
00005 // \brief Generate initial estimates based on a single prior transformation.
00006 // \author Chuck Stewart
00007 // \date 25 Nov 2002
00008 
00009 #include <vcl_vector.h>
00010 
00011 #include "rgrl_initializer.h"
00012 #include "rgrl_estimator_sptr.h"
00013 #include "rgrl_mask.h"
00014 #include "rgrl_transformation_sptr.h"
00015 
00016 //: Generate initial estimates based on a single prior transformation.
00017 class rgrl_initializer_prior
00018   : public rgrl_initializer
00019 {
00020  public:
00021   //: Initialize with a view
00022   rgrl_initializer_prior( rgrl_view_sptr            prior_view,
00023                           rgrl_scale_sptr           prior_scale = 0);
00024 
00025   //: Initialize with a set of information without packing everything into a view
00026   rgrl_initializer_prior(  rgrl_mask_sptr             const& from_image_roi,
00027                            rgrl_mask_sptr             const& to_image_roi,
00028                            rgrl_mask_box              const& init_from_region_roi,
00029                            rgrl_estimator_sptr        xform_estimator,
00030                            rgrl_transformation_sptr   xform_estimate,
00031                            unsigned                   resolution,
00032                            rgrl_scale_sptr            prior_scale = 0);
00033 
00034   //: Initialize with a set of information, assuming that registration applies to \a from_image_roi always
00035   rgrl_initializer_prior(  rgrl_mask_sptr             const& from_image_roi,
00036                            rgrl_mask_sptr             const& to_image_roi,
00037                            rgrl_estimator_sptr        xform_estimator,
00038                            rgrl_transformation_sptr   xform_estimate,
00039                            unsigned                   resolution = 0,
00040                            rgrl_scale_sptr            prior_scale = 0);
00041 
00042   //: Initialize with a set of information, assuming that registration applies to \a from_image_roi always;
00043   //  And \a from_image_roi and \a to_image_roi are the same
00044   rgrl_initializer_prior(  rgrl_mask_sptr             const& from_image_roi,
00045                            rgrl_estimator_sptr        xform_estimator,
00046                            rgrl_transformation_sptr   xform_estimate,
00047                            unsigned                   resolution = 0,
00048                            rgrl_scale_sptr            prior_scale = 0);
00049 
00050   //: Add more potential prior transformations
00051   void add_prior_xform( rgrl_transformation_sptr   xform_estimate );
00052 
00053   //: Get next initial estimate when first called, but return false thereafter.
00054   bool next_initial( rgrl_view_sptr           & view,
00055                      rgrl_scale_sptr          & prior_scale );
00056 
00057   void reset_xform_index( ) { xform_index_ = 0; }
00058 
00059   //: return number of initializations
00060   //  It is always 1 for prior
00061   virtual int size() const 
00062   { return 1; }
00063 
00064   // Defines type-related functions
00065   rgrl_type_macro( rgrl_initializer_prior, rgrl_initializer );
00066 
00067  protected:
00068   rgrl_view_sptr           init_view_;
00069   rgrl_scale_sptr          prior_scale_;
00070   vcl_vector< rgrl_view_sptr > views_;
00071   unsigned int xform_index_;
00072 };
00073 
00074 #endif