00001 #ifndef rgrl_feature_region_h_ 00002 #define rgrl_feature_region_h_ 00003 //: 00004 // \file 00005 // \brief Base class for feature associated with a region 00006 // \author Gehua yang 00007 // \date 21 Oct. 2004 00008 00009 #include <vcl_vector.h> 00010 #include <vnl/vnl_vector.h> 00011 00012 class rgrl_transformation; 00013 00014 //: Represents a feature ("data point") used by the registration algorithms. 00015 // 00016 class rgrl_feature_region 00017 { 00018 public: 00019 // default ctor 00020 rgrl_feature_region() : pixel_coordinates_cached_( false ) {} 00021 00022 // destructor 00023 virtual ~rgrl_feature_region() {} 00024 00025 #if 0 00026 // Defines type-related functions 00027 rgrl_type_macro( rgrl_feature_region, rgrl_feature ); 00028 #endif // 0 00029 00030 virtual const vcl_vector< vnl_vector<int> >& 00031 pixel_coordinates(); 00032 00033 //: get pixels coordinates within the region 00034 virtual const vcl_vector< vnl_vector<int> >& 00035 pixel_coordinates_ratio( vnl_vector< double > const& spacing_ratio ); 00036 00037 //: generate pixels coordinates within the region 00038 virtual void 00039 generate_pixel_coordinates( vnl_vector< double > const& spacing_ratio ) = 0; 00040 00041 protected: 00042 // The pixel coordinates in the image are computed the first time 00043 // they are needed and then cached. This is safe the location of 00044 // the feature does not change. 00045 bool pixel_coordinates_cached_; 00046 vcl_vector< vnl_vector<int> > pixel_coordinates_; 00047 vnl_vector< double > spacing_ratio_; 00048 }; 00049 00050 #endif