contrib/gel/gevd/gevd_region_proc.h
Go to the documentation of this file.
00001 #ifndef gevd_region_proc_h_
00002 #define gevd_region_proc_h_
00003 //---------------------------------------------------------------------
00004 //:
00005 // \file
00006 // \brief a processor for extracting expanded resolution regions
00007 //
00008 // edgel_regions uses a flood fill algorithm and is thus
00009 // region labeling is only as localized as one pixel.
00010 // In the CAD application, we need sub-pixel details. So
00011 // In this algorithm the original image resolution is
00012 // expanded using Gaussian interpolation, typically by
00013 // a factor of two. Then the resulting regions are
00014 // transformed back to original image coordinates.
00015 //
00016 // \author
00017 //  J.L. Mundy - April 11, 2001
00018 //
00019 // \verbatim
00020 // Modifications
00021 //  8 May 2002 - Peter Vanroose - class name changed from region_proc to gevd_region_proc
00022 // \endverbatim
00023 //
00024 //-------------------------------------------------------------------------
00025 #include <vcl_vector.h>
00026 #include <gevd/gevd_bufferxy.h>
00027 #include <vil1/vil1_image.h>
00028 #include <vdgl/vdgl_digital_region.h>
00029 #include <gevd/gevd_region_proc_params.h>
00030 
00031 class gevd_region_proc : public gevd_region_proc_params
00032 {
00033 public:
00034   //Constructors/destructor
00035   gevd_region_proc();
00036 
00037   ~gevd_region_proc();
00038   //Accessors
00039   void set_image(vil1_image& image);
00040 //  void set_roi_proc(lung_roi_proc_ref& roi_proc){roi_proc_ = roi_proc;}
00041 
00042   // vector<gevd_poly_intensity_face_sptr>& get_regions(){return regions_;}
00043   vcl_vector<vdgl_digital_region *>& get_regions(){return regions_;}
00044 
00045   //Utility Methods
00046   void extract_regions();
00047   void clear();
00048 
00049   void set_expand_scale(float scale){expand_scale_=scale;}
00050 
00051   //Debug methods
00052   void set_debug(){debug_ = true;}
00053   void clear_debug(){debug_ = false;}
00054 
00055 protected:
00056   //protected methods
00057   gevd_bufferxy* get_image_buffer(vil1_image& image);
00058   gevd_bufferxy* get_float_buffer(gevd_bufferxy* b);
00059   gevd_bufferxy* put_float_buffer(gevd_bufferxy* fbuf);
00060   vil1_image buffer_to_image(gevd_bufferxy* buf);
00061   void restore_image_rois();
00062   //members
00063   bool debug_;//debug flag
00064   bool regions_valid_;      //process state flag
00065   float expand_scale_;
00066   float burt_adelson_factor_;
00067   vil1_image image_;  //input image
00068   gevd_bufferxy* buf_;
00069   //lung_roi_proc_ref roi_proc_; //Lung roi processor
00070   //vector<gevd_poly_intensity_face_ref> regions_; //resulting intensity faces
00071   vcl_vector<vdgl_digital_region *> regions_; //resulting digital regions
00072 };
00073 #endif // gevd_region_proc_h_