contrib/brl/bseg/segv/segv_vil_menus.cxx
Go to the documentation of this file.
00001 #include "segv_vil_menus.h"
00002 //:
00003 // \file
00004 #include <vgui/vgui.h>
00005 #include <vgui/vgui_key.h>
00006 #include <vgui/vgui_menu.h>
00007 #include "segv_vil_segmentation_manager.h"
00008 
00009 // Static menu callback functions
00010 
00011 void segv_vil_menus::quit_callback()
00012 {
00013   segv_vil_segmentation_manager::instance()->quit();
00014 }
00015 
00016 
00017 void segv_vil_menus::load_image_callback()
00018 {
00019   segv_vil_segmentation_manager::instance()->load_image();
00020 }
00021 
00022 void segv_vil_menus::save_image_callback()
00023 {
00024   segv_vil_segmentation_manager::instance()->save_image();
00025 }
00026 
00027 void segv_vil_menus::save_camera_callback()
00028 {
00029   segv_vil_segmentation_manager::instance()->save_nitf_camera();
00030 }
00031 
00032 void segv_vil_menus::remove_image_callback()
00033 {
00034   segv_vil_segmentation_manager::instance()->remove_image();
00035 }
00036 
00037 
00038 void segv_vil_menus::convert_to_grey_callback()
00039 {
00040   segv_vil_segmentation_manager::instance()->convert_to_grey();
00041 }
00042 
00043 void segv_vil_menus::set_range_params_callback()
00044 {
00045   segv_vil_segmentation_manager::instance()->set_range_params();
00046 }
00047 
00048 void segv_vil_menus::clear_display_callback()
00049 {
00050   segv_vil_segmentation_manager::instance()->clear_display();
00051 }
00052 
00053 void segv_vil_menus::threshold_image_callback()
00054 {
00055   segv_vil_segmentation_manager::instance()->threshold_image();
00056 }
00057 
00058 void segv_vil_menus::gradient_mag_angle_callback()
00059 {
00060   segv_vil_segmentation_manager::instance()->gradient_mag_angle();
00061 }
00062 
00063 void segv_vil_menus::fft_callback()
00064 {
00065   segv_vil_segmentation_manager::instance()->fft();
00066 }
00067 
00068 void segv_vil_menus::harris_corners_callback()
00069 {
00070   segv_vil_segmentation_manager::instance()->harris_corners();
00071 }
00072 
00073 void segv_vil_menus::nonmaximal_suppression_callback()
00074 {
00075   segv_vil_segmentation_manager::instance()->nonmaximal_suppression();
00076 }
00077 
00078 void segv_vil_menus::vd_edges_callback()
00079 {
00080   segv_vil_segmentation_manager::instance()->vd_edges();
00081 }
00082 
00083 void segv_vil_menus::third_order_edges_callback()
00084 {
00085   segv_vil_segmentation_manager::instance()->third_order_edges();
00086 }
00087 
00088 void segv_vil_menus::fit_lines_callback()
00089 {
00090   segv_vil_segmentation_manager::instance()->fit_lines();
00091 }
00092 
00093 void segv_vil_menus::fit_conics_callback()
00094 {
00095   segv_vil_segmentation_manager::instance()->fit_conics();
00096 }
00097 
00098 void segv_vil_menus::fit_overlay_conics_callback()
00099 {
00100   segv_vil_segmentation_manager::instance()->fit_overlay_conics();
00101 }
00102 
00103 void segv_vil_menus::mser_conics_callback()
00104 {
00105   segv_vil_segmentation_manager::instance()->mser_conics();
00106 }
00107 
00108 
00109 void segv_vil_menus::regions_callback()
00110 {
00111   segv_vil_segmentation_manager::instance()->regions();
00112 }
00113 
00114 void segv_vil_menus::rotate_image_callback()
00115 {
00116   segv_vil_segmentation_manager::instance()->rotate_image();
00117 }
00118 
00119 void segv_vil_menus::reduce_image_callback()
00120 {
00121   segv_vil_segmentation_manager::instance()->reduce_image();
00122 }
00123 
00124 void segv_vil_menus::reduce_image_bicubic_callback()
00125 {
00126   segv_vil_segmentation_manager::instance()->reduce_image_bicubic();
00127 }
00128 
00129 void segv_vil_menus::expand_image_callback()
00130 {
00131   segv_vil_segmentation_manager::instance()->expand_image();
00132 }
00133 
00134 void segv_vil_menus::expand_image_bicubic_callback()
00135 {
00136   segv_vil_segmentation_manager::instance()->expand_image_bicubic();
00137 }
00138 
00139 void segv_vil_menus::flip_image_lr_callback()
00140 {
00141   segv_vil_segmentation_manager::instance()->flip_image_lr();
00142 }
00143 
00144 void segv_vil_menus::display_images_as_color_callback()
00145 {
00146   segv_vil_segmentation_manager::instance()->display_images_as_color();
00147 }
00148 
00149 void segv_vil_menus::add_images_callback()
00150 {
00151   segv_vil_segmentation_manager::instance()->add_images();
00152 }
00153 
00154 void segv_vil_menus::subtract_images_callback()
00155 {
00156   segv_vil_segmentation_manager::instance()->subtract_images();
00157 }
00158 
00159 void segv_vil_menus::negate_image_callback()
00160 {
00161   segv_vil_segmentation_manager::instance()->negate_image();
00162 }
00163 
00164 void segv_vil_menus::extrema_callback()
00165 {
00166   segv_vil_segmentation_manager::instance()->extrema();
00167 }
00168 
00169 void segv_vil_menus::rot_extrema_callback()
00170 {
00171   segv_vil_segmentation_manager::instance()->rot_extrema();
00172 }
00173 
00174 void segv_vil_menus::beaudet_callback()
00175 {
00176   segv_vil_segmentation_manager::instance()->beaudet();
00177 }
00178 
00179 void segv_vil_menus::parallel_coverage_callback()
00180 {
00181   segv_vil_segmentation_manager::instance()->parallel_coverage();
00182 }
00183 
00184 void segv_vil_menus::entropy_callback()
00185 {
00186   segv_vil_segmentation_manager::instance()->entropy();
00187 }
00188 
00189 void segv_vil_menus::minfo_callback()
00190 {
00191   segv_vil_segmentation_manager::instance()->minfo();
00192 }
00193 
00194 void segv_vil_menus::max_trace_scale_callback()
00195 {
00196   segv_vil_segmentation_manager::instance()->max_trace_scale();
00197 }
00198 
00199 void segv_vil_menus::color_order_callback()
00200 {
00201   segv_vil_segmentation_manager::instance()->color_order();
00202 }
00203 
00204 void segv_vil_menus::inline_viewer_callback()
00205 {
00206   segv_vil_segmentation_manager::instance()->inline_viewer();
00207 }
00208 
00209 void segv_vil_menus::intensity_profile_callback()
00210 {
00211   segv_vil_segmentation_manager::instance()->intensity_profile();
00212 }
00213 
00214 void segv_vil_menus::intensity_histogram_callback()
00215 {
00216   segv_vil_segmentation_manager::instance()->intensity_histogram();
00217 }
00218 
00219 // JIM PROJECT POINTS
00220 void segv_vil_menus::project_points_callback()
00221 {
00222   segv_vil_segmentation_manager::instance()->project_points();
00223 }
00224 
00225 void segv_vil_menus::image_as_vrml_points_callback()
00226 {
00227   segv_vil_segmentation_manager::instance()->image_as_vrml_points();
00228 }
00229 
00230 void segv_vil_menus::line_image_callback()
00231 {
00232   segv_vil_segmentation_manager::instance()->draw_line_image();
00233 }
00234 void segv_vil_menus::display_roi_callback()
00235 {
00236   segv_vil_segmentation_manager::instance()->display_roi();
00237 }
00238 void segv_vil_menus::create_roi_callback()
00239 {
00240   segv_vil_segmentation_manager::instance()->create_roi();
00241 }
00242 void segv_vil_menus::crop_image_callback()
00243 {
00244   segv_vil_segmentation_manager::instance()->crop_image();
00245 }
00246 void segv_vil_menus::gaussian_callback()
00247 {
00248   segv_vil_segmentation_manager::instance()->gaussian();
00249 }
00250 
00251 void segv_vil_menus::abs_value_callback()
00252 {
00253   segv_vil_segmentation_manager::instance()->abs_value();
00254 }
00255 
00256 //segv_vil_menus definition
00257 vgui_menu segv_vil_menus::get_menu()
00258 {
00259   vgui_menu menubar;
00260   vgui_menu menufile;
00261   vgui_menu menuview;
00262   vgui_menu menuedit;
00263   vgui_menu menuops;
00264   //file menu entries
00265   menufile.add( "Quit", quit_callback,(vgui_key)'q', vgui_CTRL);
00266   menufile.add( "Load Image", load_image_callback,(vgui_key)'l', vgui_CTRL);
00267   menufile.add( "Save Image", save_image_callback);
00268   menufile.add( "Save NITF Camera", save_camera_callback);
00269 
00270   //view menu entries
00271   menuview.add("Remove Image", remove_image_callback);
00272   menuview.add("Clear Spatial Objects", clear_display_callback);
00273   menuview.add("Display ROI", display_roi_callback);
00274   menuview.add("Intensity Profile", intensity_profile_callback);
00275   menuview.add("Set Range Params", set_range_params_callback);
00276   menuview.add("Inline Histogram Viewer", inline_viewer_callback);
00277   menuview.add("Histogram Plot ", intensity_histogram_callback);
00278   menuview.add("RotateImage ", rotate_image_callback);
00279   menuview.add("ReduceImage(Burt)", reduce_image_callback);
00280   menuview.add("ReduceImage(bicubic)", reduce_image_bicubic_callback);
00281   menuview.add("ExpandImage(Burt) ", expand_image_callback);
00282   menuview.add("ExpandImage(bicubic) ", expand_image_bicubic_callback);
00283   menuview.add("Flip Image (LR)", flip_image_lr_callback);
00284   menuview.add("Images as Color", display_images_as_color_callback);
00285   menuview.add("Project Points RPC", project_points_callback);
00286   menuview.add("Image as VRML Points", image_as_vrml_points_callback);
00287 
00288   //edit menu entries
00289 
00290   menuedit.add("Threshold", threshold_image_callback);
00291   menuedit.add("Harris", harris_corners_callback);
00292   menuedit.add("Beaudet", beaudet_callback);
00293   menuedit.add("Parallel Coverage", parallel_coverage_callback);
00294 
00295   menuedit.add("VD Edges", vd_edges_callback);
00296   menuedit.add("Third Order Edges", third_order_edges_callback);
00297   menuedit.add("Line Segments", fit_lines_callback);
00298   menuedit.add("Conic Segments", fit_conics_callback);
00299   menuedit.add("Overlay Conic Segments", fit_overlay_conics_callback);
00300   menuedit.add("MSER Conic Regions", mser_conics_callback);
00301   menuedit.add("Edgel Regions", regions_callback);
00302   menuedit.add("Non-Maximal Suppression", nonmaximal_suppression_callback);
00303   menuedit.add("Load Line Image", line_image_callback);
00304 
00305   //operation menu entries
00306   menuops.add("Create ROI:" , create_roi_callback);
00307   menuops.add("Convert To Greyscale:", convert_to_grey_callback);
00308   menuops.add("Crop Image:", crop_image_callback);
00309   menuops.add("Add Images:", add_images_callback);
00310   menuops.add("Subtract Images:", subtract_images_callback);
00311   menuops.add("Negate Image:", negate_image_callback);
00312   menuops.add("Gaussian Smoothing:", gaussian_callback);
00313   menuops.add("Absolute Value:", abs_value_callback);
00314   menuops.add("Entropy", entropy_callback);
00315   menuops.add("Mutal Information", minfo_callback);
00316   menuops.add("Max Trace Scale",  max_trace_scale_callback);
00317   menuops.add("Color Order",  color_order_callback);
00318   menuops.add("Extrema", extrema_callback);
00319   menuops.add("Rotational Extrema", rot_extrema_callback);
00320   menuops.add("GradMagAngle", gradient_mag_angle_callback);
00321   menuops.add("FFT", fft_callback);
00322   //Top level menu layout
00323   menubar.add( "File", menufile);
00324   menubar.add( "View", menuview);
00325   menubar.add( "Edit", menuedit);
00326   menubar.add( "Image Ops", menuops);
00327   return menubar;
00328 }
00329