Go to the documentation of this file.00001 #ifndef rgrl_matcher_pseudo_3d_h_
00002 #define rgrl_matcher_pseudo_3d_h_
00003
00004
00005
00006
00007
00008
00009
00010 #include <rgrl/rgrl_matcher.h>
00011 #include <rgrl/rgrl_feature_set.h>
00012 #include <rgrl/rgrl_view.h>
00013 #include <rgrl/rgrl_transformation.h>
00014 #include <rgrl/rgrl_scale.h>
00015 #include <rgrl/rgrl_feature_sptr.h>
00016 #include "rgrl_evaluator.h"
00017 #include <rgrl/rgrl_mask_sptr.h>
00018 #include <rgrl/rgrl_mask.h>
00019 #include <vil3d/vil3d_image_view.h>
00020 #include <vnl/vnl_double_3.h>
00021 #include <vnl/vnl_int_3.h>
00022 #include "rgrl_evaluator_sptr.h"
00023 #if 0
00024 #include <itkImage.h>
00025 #endif
00026
00027
00028
00029
00030
00031 template < class PixelType >
00032 class rgrl_matcher_pseudo_3d
00033 : public rgrl_matcher
00034 {
00035 public:
00036
00037 class rgrl_mapped_pixel_type
00038 {
00039 public:
00040 vnl_int_3 location;
00041 double intensity;
00042 double weight;
00043 };
00044
00045 typedef vcl_vector< rgrl_mapped_pixel_type > rgrl_mapped_pixel_vector_type;
00046
00047
00048
00049 rgrl_matcher_pseudo_3d( vil3d_image_view<PixelType> const& from_image,
00050 vil3d_image_view<PixelType> const& to_image,
00051 vnl_vector< double > const& from_spacing_ratio,
00052 vnl_vector< double > const& to_spacing_ratio,
00053 rgrl_evaluator_sptr evaluator,
00054 rgrl_mask_sptr mask = 0 );
00055
00056
00057
00058
00059 rgrl_match_set_sptr
00060 compute_matches( rgrl_feature_set const& from_features,
00061 rgrl_feature_set const& to_features,
00062 rgrl_view const& current_view,
00063 rgrl_transformation const& current_xform,
00064 rgrl_scale const& current_scale,
00065 rgrl_match_set_sptr const& old_matches = 0 );
00066
00067
00068 rgrl_type_macro( rgrl_matcher_pseudo_3d, rgrl_matcher);
00069
00070 private:
00071
00072 void
00073 map_region_intensities( rgrl_transformation const& trans,
00074 rgrl_feature_sptr feature_sptr,
00075 rgrl_mapped_pixel_vector_type & mapped_pixels ) const;
00076
00077
00078 void
00079 map_region_intensities( vcl_vector< vnl_vector<int> > const& pixel_locations,
00080 rgrl_transformation const& trans,
00081 rgrl_feature_sptr feature_sptr,
00082 rgrl_mapped_pixel_vector_type & mapped_pixels) const;
00083
00084 void
00085 match_mapped_region( rgrl_feature_sptr mapped_feature,
00086 rgrl_mapped_pixel_vector_type const& mapped_pixels,
00087 rgrl_scale const& current_scale,
00088 vcl_vector< rgrl_feature_sptr > & matched_to_features,
00089 vcl_vector< double > & match_weights ) const;
00090
00091 double compute_response( vnl_double_3 const& mapped_location,
00092 rgrl_mapped_pixel_vector_type const& mapped_pixels,
00093 vnl_double_3 const& shift ) const;
00094
00095 private:
00096 #if 0
00097 typedef itkImage< PixelType, Dimension > ImageType;
00098 #endif
00099
00100
00101
00102 vil3d_image_view<PixelType> from_image_;
00103 vil3d_image_view<PixelType> to_image_;
00104
00105
00106
00107
00108
00109
00110
00111 rgrl_mask_sptr mask_;
00112 rgrl_evaluator_sptr evaluator_;
00113
00114
00115
00116 vnl_double_3 from_spacing_ratio_;
00117 vnl_double_3 to_spacing_ratio_;
00118 };
00119
00120 #endif // rgrl_matcher_pseudo_3d_h_