Go to the documentation of this file.00001 #ifndef rgrl_feature_set_location_masked_h_
00002 #define rgrl_feature_set_location_masked_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <rgrl/rgrl_feature_set.h>
00017 #include <rgrl/rgrl_mask_sptr.h>
00018
00019
00020
00021 class rgrl_feature_set_location_masked
00022 : public rgrl_feature_set
00023 {
00024 public:
00025
00026 rgrl_feature_set_location_masked( rgrl_feature_set_sptr const& fea_set,
00027 rgrl_mask_sptr mask )
00028 : rgrl_feature_set( fea_set->all_features(), fea_set->label() ),
00029 fea_set_sptr_( fea_set ),
00030 mask_( mask )
00031 {}
00032
00033 ~rgrl_feature_set_location_masked() {}
00034
00035
00036 feature_vector const&
00037 all_features( ) const
00038 { return fea_set_sptr_->all_features(); }
00039
00040
00041 rgrl_mask_box
00042 bounding_box() const;
00043
00044
00045 virtual
00046 const vcl_type_info&
00047 type() const
00048 { return fea_set_sptr_->type(); }
00049
00050 void
00051 features_in_region( feature_vector& final_results, rgrl_mask_box const& roi ) const;
00052
00053
00054 void
00055 features_within_radius( feature_vector& final_results, vnl_vector<double> const& center, double radius ) const;
00056
00057
00058 rgrl_feature_sptr
00059 nearest_feature( rgrl_feature_sptr const& feature ) const;
00060
00061
00062 rgrl_feature_sptr
00063 nearest_feature( const vnl_vector<double>& loc ) const;
00064
00065
00066 void
00067 features_within_radius( feature_vector& results, rgrl_feature_sptr const& feature, double distance ) const;
00068
00069
00070 void
00071 k_nearest_features( feature_vector& results, const vnl_vector<double>& loc, unsigned int k ) const;
00072
00073
00074 void
00075 k_nearest_features( feature_vector& results, rgrl_feature_sptr const& feature, unsigned int k ) const;
00076
00077
00078 rgrl_type_macro( rgrl_feature_set_location_masked, rgrl_feature_set);
00079
00080 private:
00081 rgrl_feature_set_sptr fea_set_sptr_;
00082 rgrl_mask_sptr mask_;
00083 };
00084
00085 #endif