1) Sorting seed points
======================
[...]
So what we need is a tool that allows us to add new _unsorted_ seeds on the 3D annulus. Every time you add a new seed, the application sorts them for you to create the 3D loop.
Index: src/CMake/FindOpenGL.cmake =================================================================== --- src/CMake/FindOpenGL.cmake (revision 44506) +++ src/CMake/FindOpenGL.cmake (working copy) @@ -106,14 +106,26 @@ /usr/X11R6/include ) +# ramc: patch suggested by Kristen Zygmunt to fix error at build time +# FIND_LIBRARY(OPENGL_gl_LIBRARY +# NAMES GL MesaGL +# PATHS /usr/lib +# /usr/local/lib +# /opt/graphics/OpenGL/lib +# /usr/openwin/lib +# /usr/X11R6/lib +# /usr/shlib +# ) FIND_LIBRARY(OPENGL_gl_LIBRARY - NAMES GL MesaGL - PATHS /usr/lib - /usr/local/lib - /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/X11R6/lib - /usr/shlib + NAMES GLU MesaGLU + PATHS ${OPENGL_gl_LIBRARY} + /usr/lib + /usr/local/lib + /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/X11R6/lib + /usr/shlib + /usr/lib32 ) # On Unix OpenGL most certainly always requires X11. Index: src/Applications/Seg3D/Seg3DFrame.cc =================================================================== --- src/Applications/Seg3D/Seg3DFrame.cc (revision 44506) +++ src/Applications/Seg3D/Seg3DFrame.cc (working copy) @@ -67,6 +67,7 @@ #include <Applications/Seg3D/GuiCode/movescaletoolpanel.h> #include <Applications/Seg3D/GuiCode/optionlessfilter.h> #include <Applications/Seg3D/GuiCode/polylinetoolpanel.h> +#include <Applications/Seg3D/GuiCode/splinetoolpanel.h> #include <Applications/Seg3D/GuiCode/resampletool.h> #include <Applications/Seg3D/GuiCode/thresholdtoolpanel.h> #include <Applications/Seg3D/GuiCode/windowleveltoolpanel.h> @@ -142,6 +143,7 @@ EVT_MENU(MENU_TOOL_INVERT, Seg3DFrame::ToolInvert) EVT_MENU(MENU_TOOL_RESAMPLE, Seg3DFrame::ToolResample) EVT_MENU(MENU_TOOL_POLYLINE, Seg3DFrame::ToolPolyline) + EVT_MENU(MENU_TOOL_SPLINE, Seg3DFrame::ToolSpline) EVT_MENU(MENU_TOOL_THRESHOLD, Seg3DFrame::ToolThreshold) EVT_MENU(MENU_TOOL_WINDOWLEVEL, Seg3DFrame::ToolWindowLevel) EVT_MENU(MENU_TOOL_MOVESCALE, Seg3DFrame::ToolMoveScale) @@ -282,6 +284,11 @@ tools_sizer->Show(polylinetoolpanel_, false); tools_sizer->Layout(); + splinetoolpanel_ = new SplineToolPanel(toolsPanel_); + tools_sizer->Add(splinetoolpanel_, 0, 0, 0); + tools_sizer->Show(splinetoolpanel_, false); + tools_sizer->Layout(); + thresholdtoolpanel_ = new ThresholdToolPanel(toolsPanel_); tools_sizer->Add(thresholdtoolpanel_, 0, 0, 0); tools_sizer->Show(thresholdtoolpanel_, false); @@ -456,6 +463,7 @@ winMenu->Append(MENU_TOOL_INVERT, _T("&Invert Tool")); winMenu->Append(MENU_TOOL_RESAMPLE, _T("&Resample Tool")); winMenu->Append(MENU_TOOL_POLYLINE, _T("&Polyline Tool")); + winMenu->Append(MENU_TOOL_SPLINE, _T("&Spline Tool")); winMenu->Append(MENU_TOOL_THRESHOLD, _T("&Threshold Tool")); winMenu->Append(MENU_TOOL_WINDOWLEVEL, _T("&Window/Level Tool")); winMenu->Append(MENU_TOOL_MOVESCALE, _T("&Move/Scale Tool")); @@ -1381,6 +1389,12 @@ } void +Seg3DFrame::ToolSpline( wxCommandEvent& WXUNUSED(event) ) +{ + ShowTool(splinetoolpanel_, "Painter::StartSplineTool", "Spline Tool"); +} + +void Seg3DFrame::ToolThreshold( wxCommandEvent& WXUNUSED(event) ) { ShowTool(thresholdtoolpanel_, Index: src/Applications/Seg3D/SplineTool.h =================================================================== --- src/Applications/Seg3D/SplineTool.h (revision 0) +++ src/Applications/Seg3D/SplineTool.h (revision 0) @@ -0,0 +1,71 @@ +// File : SplineTool.h +// Author : Ramon Casero +// Date : Oct 2009 + +#ifndef SEG3D_SplineTool_h +#define SEG3D_SplineTool_h + +#include <sci_defs/insight_defs.h> + +#include <string> +#include <Core/Events/BaseTool.h> + +namespace SCIRun { + +class Painter; +class NrrdVolume; + + +class SplineTool : public virtual BaseTool, public PointerTool +{ +public: + SplineTool(const string &name, Painter *painter); + + propagation_state_e pointer_down(int, int, int, unsigned int, int); + propagation_state_e pointer_up(int, int, int, unsigned int, int); + propagation_state_e pointer_motion(int, int, int, unsigned int, int); + + propagation_state_e process_event(event_handle_t); + + virtual propagation_state_e run_filter(bool erase); + +protected: + typedef vector<Point> seeds_t; + + virtual void draw_gl(SliceWindow &window); + virtual void seed_change_callback(int index); + virtual int compute_nearest_segment_index(const Point &curpos, int axis); + + void compute_bbox(const vector<vector<float> > &seeds, + float &x0, float &y0, + float &x1, float &y1); + + bool check_on_boundary(const vector<vector<float> > &seeds, + float x, float y); + bool check_crossings(const vector<vector<float> > &seeds, + float x, float y); + void rasterize(NrrdDataHandle dnrrd, unsigned int dlabel, + NrrdDataHandle mnrrd, unsigned int mlabel, + const vector<vector<float> > &seeds, + bool erase); + void sort_seeds(string method); + + Painter * painter_; + + seeds_t seeds_; + ThreadLock seed_lock_; + + // For 2D seed operations, do the operation where the seed was put. + SliceWindow *last_seed_window_; + +private: + int last_seed_index_; + seeds_t drag_seeds_; + Point drag_point_; + string sort_; +}; + + +} + +#endif // SplineTool_h Index: src/Applications/Seg3D/SplineTool.cc =================================================================== --- src/Applications/Seg3D/SplineTool.cc (revision 0) +++ src/Applications/Seg3D/SplineTool.cc (revision 0) @@ -0,0 +1,748 @@ +// File : SplineTool.cc +// Author : Ramon Casero +// Date : Tue Oct 13 20:49:00 2009 + +#include <Applications/Seg3D/Painter.h> + +#include <Applications/Seg3D/SplineTool.h> +#include <Core/Geometry/CompGeom.h> +#include <Core/Events/keysyms.h> +#include <sci_gl.h> + + +namespace SCIRun { + +SplineTool:: +SplineTool(const string &name, Painter *painter) : + BaseTool(name), + PointerTool(name), + painter_(painter), + seeds_(), + seed_lock_("SplineTool"), + last_seed_window_(NULL), + last_seed_index_(-1), + sort_("Clicking") +{ +} + + +/** + * pointer_down(): process event when mouse button is clicked (only + * the click itself, not when the button is being held down) + * + * b: which button has been clicked + * x: x-coordinate of pointer + * y: y-coordinate of pointer + * m: modifiers (e.g. CTRL key pressed) + * t: time + **/ +BaseTool::propagation_state_e +SplineTool::pointer_down(int b, int x, int y, unsigned int m, int t) +{ + + // don't do anything if there's no active volume loaded + if (!painter_->current_volume_.get_rep()) { + painter_->set_status("Spline Tool requires an active volume."); + return STOP_E; + } + + if (m & EventModifiers::SHIFT_E) { return CONTINUE_E; } + + last_seed_index_ = -1; + + if (m & EventModifiers::CONTROL_E) + { + // Drag all the points. + seed_lock_.lock(); + drag_seeds_ = seeds_; + seed_lock_.unlock(); + drag_point_ = painter_->pointer_pos_; + return STOP_E; + } + else if (b == 1) + { + // Add a new seed point. + seed_lock_.lock(); + last_seed_window_ = painter_->cur_window_; + seeds_.push_back(painter_->pointer_pos_); + last_seed_index_ = seeds_.size() - 1; + sort_seeds(sort_); + seed_change_callback(last_seed_index_); + + seed_lock_.unlock(); + painter_->redraw_all(); + return STOP_E; + } + else if (b == 3 && seeds_.size()) + { + // Change an existing seed point. + seed_lock_.lock(); + last_seed_window_ = painter_->cur_window_; + const double max_dist2_to_check = 25.0; + double mind2 = max_dist2_to_check + 1.0; + const int axis = last_seed_window_->axis_; + Point curpos = painter_->pointer_pos_; + curpos(axis) = 0.0; + const Point sppos = last_seed_window_->world_to_screen(curpos); + for (size_t i = 0; i < seeds_.size(); i++) + { + Point seed = seeds_[i]; + seed(axis) = 0.0; + const double d2 = + (last_seed_window_->world_to_screen(seed) - sppos).length2(); + if (d2 < mind2 && d2 < max_dist2_to_check) + { + mind2 = d2; + last_seed_index_ = i; + } + } + + if (last_seed_index_ != -1) + { + const double axval = seeds_[last_seed_index_](axis); + seeds_[last_seed_index_] = painter_->pointer_pos_; + seeds_[last_seed_index_](axis) = axval; + seed_change_callback(last_seed_index_); + } + else if (seeds_.size() > 1) + { + last_seed_index_ = compute_nearest_segment_index(curpos, axis); + + if (last_seed_index_ != -1) + { + seeds_.insert(seeds_.begin() + last_seed_index_, + painter_->pointer_pos_); + seed_change_callback(-2); + } + } + + sort_seeds(sort_); + seed_lock_.unlock(); + painter_->redraw_all(); + return STOP_E; + } + else if (b == 2 && seeds_.size()) + { + // Erase an existing seed point. + seed_lock_.lock(); + last_seed_window_ = painter_->cur_window_; + const double max_dist2_to_check = 25.0; + double mind2 = max_dist2_to_check + 1.0; + const int axis = last_seed_window_->axis_; + Point curpos = painter_->pointer_pos_; + curpos(axis) = 0.0; + const Point sppos = last_seed_window_->world_to_screen(curpos); + for (size_t i = 0; i < seeds_.size(); i++) + { + Point seed = seeds_[i]; + seed(axis) = 0.0; + const double d2 = + (last_seed_window_->world_to_screen(seed) - sppos).length2(); + if (d2 < mind2 && d2 < max_dist2_to_check) + { + mind2 = d2; + last_seed_index_ = i; + } + } + + if (last_seed_index_ != -1) + { + seeds_.erase(seeds_.begin() + last_seed_index_); + last_seed_index_ = -1; + seed_change_callback(-1); + } + + sort_seeds(sort_); + seed_lock_.unlock(); + painter_->redraw_all(); + return STOP_E; + } + + return CONTINUE_E;; +} + + +int +SplineTool::compute_nearest_segment_index(const Point &curpos, int axis) +{ + // No seed point near. Check for insertion of new point into an + // existing line segment. + int index = -1; + const double max_dist2_to_check = 25.0; + double mind2 = max_dist2_to_check + 1.0; + const Point sppos = last_seed_window_->world_to_screen(curpos); + + for (size_t i = 0; i < seeds_.size(); i++) + { + const size_t j = (i + 1) % seeds_.size(); + Point seedi = seeds_[i]; + Point seedj = seeds_[j]; + seedi(axis) = 0.0; + seedj(axis) = 0.0; + const Point sseedi = last_seed_window_->world_to_screen(seedi); + const Point sseedj = last_seed_window_->world_to_screen(seedj); + const double d2 = distance_to_line2(sppos, sseedi, sseedj); + + if (d2 < mind2 && d2 < max_dist2_to_check) + { + mind2 = d2; + index = i+1; + } + } + return index; +} + + +BaseTool::propagation_state_e +SplineTool::pointer_motion(int b, int x, int y, unsigned int m, int t) +{ + if (last_seed_index_ != -1) + { + seed_lock_.lock(); + const int axis = last_seed_window_->axis_; + const double axval = seeds_[last_seed_index_](axis); + seeds_[last_seed_index_] = painter_->pointer_pos_; + seeds_[last_seed_index_](axis) = axval; + seed_change_callback(last_seed_index_); + seed_lock_.unlock(); + painter_->redraw_all(); + return STOP_E; + } + else if (drag_seeds_.size()) + { + seed_lock_.lock(); + Vector offset = painter_->pointer_pos_ - drag_point_; + for (size_t i = 0; i < seeds_.size(); i++) + { + seeds_[i] = drag_seeds_[i] + offset; + seed_change_callback(-3); + } + seed_lock_.unlock(); + painter_->redraw_all(); + return STOP_E; + } + + return CONTINUE_E; +} + + +/** + * pointer_up(): process event when mouse button is released (only at + * the moment of release, not when button is left unpressed) + * + * b: which button has been clicked + * x: x-coordinate of pointer + * y: y-coordinate of pointer + * m: modifiers (e.g. CTRL key pressed) + * t: time + **/ +BaseTool::propagation_state_e +SplineTool::pointer_up(int b, int x, int y, unsigned int m, int t) +{ + + // don't do anything if there's no active volume loaded + if (!painter_->current_volume_.get_rep()) { + painter_->set_status("Spline Tool requires an active volume."); + return STOP_E; + } + + last_seed_index_ = -1; + drag_seeds_.clear(); + return CONTINUE_E; +} + + +BaseTool::propagation_state_e +SplineTool::process_event(event_handle_t event) +{ + //RedrawSliceWindowEvent + RedrawSliceWindowEvent *redraw = + dynamic_cast<RedrawSliceWindowEvent *>(event.get_rep()); + if (redraw) { + draw_gl(redraw->get_window()); + } + + if (dynamic_cast<SetLayerEvent *>(event.get_rep())) { + seed_lock_.lock(); + seeds_.clear(); + seed_change_callback(-4); + seed_lock_.unlock(); + painter_->redraw_all(); + } + + if (dynamic_cast<FinishEvent *>(event.get_rep())) { + const bool erase = + painter_->get_vars()->get_bool("Painter::splinetool_erase"); + return run_filter(erase); + } + + // KeyEvent + KeyEvent *keyevent = dynamic_cast<KeyEvent *>(event.get_rep()); + if (keyevent && keyevent->get_keyval() == SCIRun_f) + { + return run_filter(false); + } + if (keyevent && keyevent->get_keyval() == SCIRun_BackSpace) + { + // delete last point placed + seed_lock_.lock(); + last_seed_window_ = painter_->cur_window_; + + int sz = seeds_.size(); + if (sz > 0) + { + last_seed_index_ = sz - 1; + seeds_.erase(seeds_.begin() + last_seed_index_); + seed_change_callback(last_seed_index_); + last_seed_index_ = last_seed_index_ - 1; + sort_seeds( sort_ ); + } + seed_lock_.unlock(); + painter_->redraw_all(); + return STOP_E; + } + + // UpdateSplineToolEvent + UpdateSplineToolEvent *rchange = + dynamic_cast<UpdateSplineToolEvent *>(event.get_rep()); + if (rchange) + { + const string sort = (string)rchange->get_sort(); + sort_ = sort; + sort_seeds( sort_ ); + painter_->redraw_all(); + } + + // return + return CONTINUE_E; +} + + +void +SplineTool::draw_gl(SliceWindow &window) +{ + size_t i; + + // Transform the seeds into window space. + seed_lock_.lock(); + vector<Point> points = seeds_; + seed_lock_.unlock(); + + // Set the color (cyan) + glColor4f(0.3, 1.0, 1.0, 1.0); + + // Draw the line loop. + glLineWidth(2.0); + glBegin(GL_LINES); + { + for (i = 0; i < points.size(); i++) + { + glVertex3d(points[i].x(), points[i].y(), points[i].z()); + if (i > 0 && i < points.size()-1) + { + glVertex3d(points[i].x(), points[i].y(), points[i].z()); + } + } + } + glEnd(); + + glLineWidth(1.0); + + // Draw the implicit close with a different appearance. + if (points.size() > 2) + { + // TODO: Stipple this one. + glBegin(GL_LINES); + glVertex3d(points[points.size()-1].x(), + points[points.size()-1].y(), + points[points.size()-1].z()); + glVertex3d(points[0].x(), points[0].y(), points[0].z()); + glEnd(); + } + + // Draw the control points. + glPointSize(4.0); + + glBegin(GL_POINTS); + for (i = 0; i < points.size(); i++) + { + glVertex3d(points[i].x(), points[i].y(), points[i].z()); + } + glEnd(); + + glPointSize(1.0); + + CHECK_OPENGL_ERROR(); +} + + +void +SplineTool::seed_change_callback(int index) +{ +} + + +BaseTool::propagation_state_e +SplineTool::run_filter(bool erase) +{ + if (!painter_->check_for_active_label_volume("Spline fill")) + { + return STOP_E; + } + + if (seeds_.size() == 0) + { + painter_->set_status("No spline to rasterize."); + return STOP_E; + } + + painter_->volume_lock_.lock(); + + // Get the current volume. + NrrdVolumeHandle &vol = painter_->current_volume_; + vol->lock.lock(); + + if (last_seed_window_ == NULL) return STOP_E; + + // Get the slice. + SliceWindow *window = last_seed_window_; + SLIVR::Plane plane(SLIVR::Point(window->center_.x(), window->center_.y(), + window->center_.z()), SLIVR::Vector(window->normal_.x(), + window->normal_.y(),window->normal_.z())); + VolumeSliceHandle slice = vol->get_volume_slice(plane); + NrrdDataHandle cnrrd = slice->nrrd_handle_; + unsigned int clabel = vol->label_; + + // Get the mask slice if it's set. + VolumeSliceHandle mask_slice; + unsigned int mlabel = 0; + NrrdDataHandle mnrrd; + if (painter_->check_for_valid_mask("Spline fill")) + { + mask_slice = painter_->mask_volume_->get_volume_slice(plane); + mnrrd = mask_slice->nrrd_handle_; + mlabel = painter_->mask_volume_->label_; + } + + vol->lock.unlock(); + painter_->volume_lock_.unlock(); + + // No slice, nothing to do. + if (!slice.get_rep()) { + return CONTINUE_E; + } + + const int axis = slice->get_axis(); + + vector<vector<float> > seeds; + for (size_t i = 0; i < seeds_.size(); i++) + { + vector<double> newseed = vol->point_to_index(seeds_[i]); + vector<float> newseedf; + for (size_t j = 0; j < newseed.size(); j++) + { + if (j != (size_t)axis) { newseedf.push_back(newseed[j] - 0.5); } + } + seeds.push_back(newseedf); + } + + // Rasterize the spline here. + rasterize(cnrrd, clabel, mnrrd, mlabel, seeds, erase); + + // Put this slice back. + painter_->volume_lock_.lock(); + vol->lock.lock(); + + // Clear the content for nrrdSplice + if (vol->nrrd_handle_->nrrd_->content) { + vol->nrrd_handle_->nrrd_->content[0] = 0; + } + + const vector<int> window_center = vol->world_to_index(window->center_); + + NrrdDataHandle undoslice = new NrrdData(); + nrrdSlice(undoslice->nrrd_, vol->nrrd_handle_->nrrd_, + axis, window_center[axis]); + + if (nrrdSplice(vol->nrrd_handle_->nrrd_, + vol->nrrd_handle_->nrrd_, + slice->nrrd_handle_->nrrd_, + axis, window_center[axis])) { + vol->lock.unlock(); + painter_->volume_lock_.unlock(); + char *err = biffGetDone(NRRD); + + cerr << string("Error on line #") + << to_string(__LINE__) + << string(" executing nrrd command: nrrdSplice \n") + << string("Message: ") + << err + << std::endl; + + free(err); + return QUIT_AND_STOP_E; + } + + UndoHandle undo = + new UndoReplaceSlice(painter_, + erase?"Undo Spline Erase":"Undo Spline Fill", + vol, undoslice, + (int)axis, window_center[axis]); + painter_->push_undo(undo); + + // Clear the slice pointers. + slice = 0; + mask_slice = 0; + + vol->set_dirty(); + vol->lock.unlock(); + painter_->volume_lock_.unlock(); + + painter_->extract_all_window_slices(); + painter_->redraw_all(); + + return STOP_E; +} + + +// Boundary conditions +bool +SplineTool::check_on_boundary(const vector<vector<float> > &seeds, + float x, float y) +{ + const float EPSILON = 1.e-6; + + for (size_t i0 = 0; i0 < seeds.size(); i0++) + { + const size_t i1 = (i0+1)%seeds.size(); + + const float x0 = seeds[i0][1]; + const float y0 = seeds[i0][2]; + const float x1 = seeds[i1][1]; + const float y1 = seeds[i1][2]; + + const float d = y0 - y1; + if (fabs(d) < EPSILON) + { + // parallel + if (fabs(y0-y) < EPSILON) + { + if (x0 < x1) + { + if (x > x0-EPSILON && x < x1+EPSILON) return true; + } + else + { + if (x > x1-EPSILON && x < x0+EPSILON) return true; + } + } + continue; + } + else if (y0 < y1) + { + if (y < y0-EPSILON || y > y1+EPSILON) continue; + } + else + { + if (y < y1-EPSILON || y > y0+EPSILON) continue; + } + + // On wrong side. + const float u = (x1 - x0) * (y0 - y) - (y1 - y0) * (x0 - x); + if (fabs(u) < 1.e-6) return true; + } + + return false; +} + + +bool +SplineTool::check_crossings(const vector<vector<float> > &seeds, + float x, float y) +{ + const float EPSILON = 1.e-6; + + int inside = 0; + for (int i = 0; i < 7; i++) + { + int crosses = 0; + const float x3 = x; + const float y3 = y; + const float x4 = x + rand()%17 - 8; + const float y4 = y + rand()%17 - 8; + + for (size_t i0 = 0; i0 < seeds.size(); i0++) + { + const size_t i1 = (i0+1)%seeds.size(); + + const float x1 = seeds[i0][1]; + const float y1 = seeds[i0][2]; + const float x2 = seeds[i1][1]; + const float y2 = seeds[i1][2]; + + const float d = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1); + if (fabs(d) < EPSILON) continue; // parallel + + const float u = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / d; + const float v = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / d; + + if (u < -EPSILON || u > 1+EPSILON) continue; // not on segment + if (v < -EPSILON) continue; // left + + crosses++; + } + if (crosses & 1) inside++; + } + + return (inside > 2); +} + + +void +SplineTool::compute_bbox(const vector<vector<float> > &seeds, + float &x0, float &y0, float &x1, float &y1) +{ + for (size_t i = 0; i < seeds.size(); i++) + { + if (seeds[i][1] < x0) x0 = seeds[i][1]; + if (seeds[i][1] > x1) x1 = seeds[i][1]; + if (seeds[i][2] < y0) y0 = seeds[i][2]; + if (seeds[i][2] > y1) y1 = seeds[i][2]; + } +} + + +void +SplineTool::rasterize(NrrdDataHandle dnrrd, unsigned int dlabel, + NrrdDataHandle mnrrd, unsigned int mlabel, + const vector<vector<float> > &seeds, + bool erase) +{ + // Set up the data pointers. + label_type *dstdata = (label_type *)dnrrd->nrrd_->data; + const bool masking = mnrrd.get_rep() != NULL; + label_type *mskdata = 0; + if (masking) { mskdata = (label_type *)mnrrd->nrrd_->data; } + + const size_t isize = dnrrd->nrrd_->axis[1].size; + const size_t jsize = dnrrd->nrrd_->axis[2].size; + + float x0 = (float)isize; + float y0 = (float)jsize; + float x1 = 0.0; + float y1 = 0.0; + compute_bbox(seeds, x0, y0, x1, y1); + int i0 = (int)floor(x0); + int j0 = (int)floor(y0); + int i1 = (int)ceil(x1) + 1; + int j1 = (int)ceil(y1) + 1; + if (i0 < 0) i0 = 0; + if (j0 < 0) j0 = 0; + if (i1 > (int)isize) i1 = (int)isize; + if (j1 > (int)jsize) j1 = (int)jsize; + for (int j = j0; j < j1; j++) + { + for (int i = i0; i < i1; i++) + { + if (!masking || (mskdata[j * isize + i] & mlabel)) + { + // We're inside the polygon if we cross an odd number of line + // segments to get out. + if (check_crossings(seeds, (float)i, (float)j) || + check_on_boundary(seeds, (float)i, (float)j)) + { + if (erase) + { + dstdata[j * isize + i] &= ~dlabel; + } + else + { + dstdata[j * isize + i] |= dlabel; + } + } + } + } + } +} + + +// Sort seeds using a certain method +// +// method: a string set up in the GUI, in the Spline Tool panel, +// using a radio box +void +SplineTool::sort_seeds(string method) +{ + + if ( seeds_.size() < 4 || method == "Clicking" ) { + // if there are 3 or less seeds to sort, + // then there's no need to sort them (any order gives the same polyline) + // if sorting method is "Clicking", + // then seeds are stored as they are clicked, and there + // shouldn't be any reordering + + // clear status + painter_->set_status(""); + + return; + } + else if ( method == "Azimuth" ) { + // seeds get sorted in the order of their azimuth component + + // clear status + painter_->set_status(""); + + // variables for this function + // vector<double> phi( seeds_.size() ); + Point centroid; // centroid of cloud of seeds + vector< pair<double, size_t> > + phi( seeds_.size() ); // (azimuth-coordinate of seeds, index) + + // compute centroid of all current seeds, as the average of the + // coordinates of all seeds + centroid[0] = 0.0; centroid[1] = 0.0; centroid[2] = 0.0; + for (size_t i = 0; i < seeds_.size(); i++) + { + centroid += seeds_[i]; + } + centroid /= seeds_.size(); + + // compute azimuth (one of the 3 speherical coordinates) for each + // seed, using the centroid as origin of coordinates + for (size_t i = 0; i < seeds_.size(); i++) + { + // azimuth coordinate: phi = atan2( y / x ) + phi[i] = + pair<double, size_t>( + atan2(( seeds_[i][1] - centroid[1] ), + ( seeds_[i][0] - centroid[0] )), // azimuth + i ); // index + } + + // TODO: check that there are no "nan"s in the resulting coordinates + + // sort azimuth in increasing azimuth order; note that this + // automatically sorts the index vector too, so that we can apply + // the same order to another vector + std::sort( phi.begin(), phi.end() ); + + // apply the order found for azimuth values to the seeds vector + seed_lock_.lock(); + vector<Point> sortedseeds = seeds_; + for (size_t i = 0; i < seeds_.size(); i++) + { + sortedseeds[i] = seeds_[phi[i].second]; + } + seeds_ = sortedseeds; + seed_lock_.unlock(); + + return; + } + else { // this should never happen + painter_->set_status("Sort method \"" + method + "\" not implemented."); + return; + } + +} + +} Index: src/Applications/Seg3D/PainterSignalTargets.cc =================================================================== --- src/Applications/Seg3D/PainterSignalTargets.cc (revision 44506) +++ src/Applications/Seg3D/PainterSignalTargets.cc (working copy) @@ -51,6 +51,7 @@ #include <Applications/Seg3D/FloodFillCopyTool.h> #include <Applications/Seg3D/LineTool.h> #include <Applications/Seg3D/PolylineTool.h> +#include <Applications/Seg3D/SplineTool.h> #include <Applications/Seg3D/ThresholdTool.h> #include <Applications/Seg3D/WindowLevelTool.h> #include <Applications/Seg3D/LineTool.h> @@ -132,6 +133,7 @@ REGISTER_CATCHER_TARGET(Painter::StartArithmeticTool); REGISTER_CATCHER_TARGET(Painter::VolumeInformation); REGISTER_CATCHER_TARGET(Painter::StartPolylineTool); + REGISTER_CATCHER_TARGET(Painter::StartSplineTool); REGISTER_CATCHER_TARGET(Painter::StartResampleTool); REGISTER_CATCHER_TARGET(Painter::StartThresholdTool); REGISTER_CATCHER_TARGET(Painter::StartWindowLevelTool); @@ -208,11 +210,13 @@ REGISTER_CATCHER_TARGET(Painter::FloodFillClear); REGISTER_CATCHER_TARGET(Painter::RasterPolyline); + REGISTER_CATCHER_TARGET(Painter::RasterSpline); REGISTER_CATCHER_TARGET(Painter::ResetCLUT); REGISTER_CATCHER_TARGET(Painter::UpdateBrushRadius); REGISTER_CATCHER_TARGET(Painter::UpdateThresholdTool); REGISTER_CATCHER_TARGET(Painter::UpdateWindowLevelTool); + REGISTER_CATCHER_TARGET(Painter::UpdateSplineTool); REGISTER_CATCHER_TARGET(Painter::OpenLabelColorDialog); REGISTER_CATCHER_TARGET(Painter::SetLabelColor); @@ -407,6 +411,14 @@ } +BaseTool::propagation_state_e +Painter::StartSplineTool(event_handle_t &event) +{ + tm_.set_tool(new SplineTool("SplineTool", this), 25); + return CONTINUE_E; +} + + BaseTool::propagation_state_e Painter::StartResampleTool(event_handle_t &event) { @@ -1022,6 +1034,23 @@ +BaseTool::propagation_state_e +Painter::RasterSpline(event_handle_t &event) +{ + SplineTool *tool = + dynamic_cast<SplineTool *>(tm_.get_tool(25).get_rep()); + + if (tool) + { + const bool erase = get_vars()->get_bool("Painter::splinetool_erase"); + tool->run_filter(erase); + } + + return CONTINUE_E; +} + + + BaseTool::propagation_state_e Painter::ResetCLUT(event_handle_t &event) { @@ -1063,6 +1092,18 @@ BaseTool::propagation_state_e +Painter::UpdateSplineTool(event_handle_t &event) +{ + const string sort = + get_vars()->get_string("Painter::splinetool_sort"); + event_handle_t sevent = + new SCIRun::UpdateSplineToolEvent(sort); + tm_.propagate_event(sevent); + return CONTINUE_E; +} + + +BaseTool::propagation_state_e Painter::UpdateThresholdTool(event_handle_t &event) { const double lower = get_vars()->get_double("Painter::thresholdtool_lower"); @@ -1340,7 +1381,6 @@ // Mask the new data. const size_t dsize = VolumeOps::nrrd_elem_count(dnrrd); - const size_t msize = VolumeOps::nrrd_elem_count(mnrrd); ASSERT(dsize == msize); ASSERT(dnrrd->nrrd_->type == LabelNrrdType); ASSERT(mnrrd->nrrd_->type == LabelNrrdType); Index: src/Applications/Seg3D/data/Seg3D.xrc =================================================================== --- src/Applications/Seg3D/data/Seg3D.xrc (revision 44506) +++ src/Applications/Seg3D/data/Seg3D.xrc (working copy) @@ -3734,6 +3734,129 @@ </object> </object> </object> + <object class="wxPanel" name="ID_SPLINETOOL" subclass="SplineToolPanel"> + <title>SplineTool</title> + <font> + <size>10</size> + <family>swiss</family> + <face>Arial</face> + </font> + <object class="wxGridSizer"> + <cols>1</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</flag> + <border>5</border> + <object class="wxGridSizer"> + <cols>1</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxButton" name="CLEAR_SEEDS_BUTTON"> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <label>Clear Seeds</label> + </object> + </object> + </object> + </object> + <object class="sizeritem"> + <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</flag> + <border>5</border> + <object class="wxGridSizer"> + <cols>2</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxButton" name="START_BUTTON"> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <label>Fill</label> + </object> + </object> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxButton" name="ERASE_BUTTON"> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <label>Erase</label> + </object> + </object> + </object> + </object> + <object class="sizeritem"> + <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</flag> + <border>5</border> + <object class="wxGridSizer"> + <cols>1</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxButton" name="CLOSE_BUTTON"> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <label>Close</label> + </object> + </object> + </object> + </object> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</flag> + <border>5</border> + <object class="wxGridSizer"> + <cols>1</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxRadioBox" name="ORDER_RADIOBOX"> + <tooltip>Method to order the seeds (Clicking = in the same order as clicking, Azimuth = by their azimuth coordinate)</tooltip> + <help>Method to order the seeds (Clicking = in the same order as clicking, Azimuth = by their azimuth coordinate)</help> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <style>wxRA_SPECIFY_ROWS</style> + <label>Seed order</label> + <dimension>1</dimension> + <selection>0</selection> + <content> + <item>&Clicking</item> + <item>&Azimuth</item> + </content> + </object> + </object> + </object> + </object> + </object> + </object> <object class="wxPanel" name="ID_THRESHOLDTOOLPANEL" subclass="ThresholdToolPanel"> <size>200,-1</size> <title>ThresholdToolPanel</title> Index: src/Applications/Seg3D/data/main.skin =================================================================== --- src/Applications/Seg3D/data/main.skin (revision 44506) +++ src/Applications/Seg3D/data/main.skin (working copy) @@ -50,6 +50,8 @@ <var name="Painter::IntensityCorrection::edge" type="double" propagate="yes">0.1</var> <var name="Painter::polylinetool_erase" type="bool" propagate="yes">0</var> + <var name="Painter::splinetool_erase" type="bool" propagate="yes">0</var> + <var name="Painter::splinetool_sort" type="string" propagate="yes">"Clicking"</var> <var name="MedianFilterVolume::radius" type="int" propagate="yes">5</var> Index: src/Applications/Seg3D/CMakeLists.txt =================================================================== --- src/Applications/Seg3D/CMakeLists.txt (revision 44506) +++ src/Applications/Seg3D/CMakeLists.txt (working copy) @@ -131,6 +131,7 @@ PanTool.cc PointerToolSelectorTool.cc PolylineTool.cc + SplineTool.cc ProbeTool.cc ResampleTool.cc SeedTool.cc @@ -172,6 +173,7 @@ GuiCode/movescaletoolpanel.cpp GuiCode/optionlessfilter.cpp GuiCode/polylinetoolpanel.cpp + GuiCode/splinetoolpanel.cpp GuiCode/thresholdtoolpanel.cpp GuiCode/windowleveltoolpanel.cpp GuiCode/itkDiscreteGaussianImageFilter.cpp Index: src/Applications/Seg3D/GuiCode/splinetoolpanel.h =================================================================== --- src/Applications/Seg3D/GuiCode/splinetoolpanel.h (revision 0) +++ src/Applications/Seg3D/GuiCode/splinetoolpanel.h (revision 0) @@ -0,0 +1,98 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: splinetoolpanel.h +// Purpose: +// Author: Ramon Casero +// Modified by: +// Created: Wed 09 Apr 2008 16:29:38 MDT +// RCS-ID: +// Copyright: +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _SPLINETOOLPANEL_H_ +#define _SPLINETOOLPANEL_H_ + + +/*! + * Includes + */ + +////@begin includes +#include "wx/xrc/xmlres.h" +////@end includes + +/*! + * Forward declarations + */ + +////@begin forward declarations +////@end forward declarations + +/*! + * Control identifiers + */ + +////@begin control identifiers +#define ID_SPLINETOOL 10012 +#define SYMBOL_SPLINETOOLPANEL_STYLE 0 +#define SYMBOL_SPLINETOOLPANEL_TITLE _("SplineTool") +#define SYMBOL_SPLINETOOLPANEL_IDNAME ID_SPLINETOOL +#define SYMBOL_SPLINETOOLPANEL_SIZE wxSize(200, -1) +#define SYMBOL_SPLINETOOLPANEL_POSITION wxDefaultPosition +////@end control identifiers + + +/*! + * SplineToolPanel class declaration + */ + +class SplineToolPanel: public wxPanel +{ + DECLARE_DYNAMIC_CLASS( SplineToolPanel ) + DECLARE_EVENT_TABLE() + +public: + /// Constructors + SplineToolPanel(); + SplineToolPanel( wxWindow* parent, wxWindowID id = SYMBOL_SPLINETOOLPANEL_IDNAME, const wxPoint& pos = SYMBOL_SPLINETOOLPANEL_POSITION, const wxSize& size = SYMBOL_SPLINETOOLPANEL_SIZE, long style = SYMBOL_SPLINETOOLPANEL_STYLE ); + + /// Creation + bool Create( wxWindow* parent, wxWindowID id = SYMBOL_SPLINETOOLPANEL_IDNAME, const wxPoint& pos = SYMBOL_SPLINETOOLPANEL_POSITION, const wxSize& size = SYMBOL_SPLINETOOLPANEL_SIZE, long style = SYMBOL_SPLINETOOLPANEL_STYLE ); + + /// Destructor + ~SplineToolPanel(); + + /// Initialises member variables + void Init(); + + /// Creates the controls and sizers + void CreateControls(); + void OnClearSeedsButtonClick( wxCommandEvent& event ); + void OnStartButtonClick( wxCommandEvent& event ); + void OnEraseButtonClick( wxCommandEvent& event ); + void OnCloseButtonClick( wxCommandEvent& event ); + void OnOrderRadioBox( wxCommandEvent& event ); + +////@begin SplineToolPanel event handler declarations + +////@end SplineToolPanel event handler declarations + +////@begin SplineToolPanel member function declarations + + /// Retrieves bitmap resources + wxBitmap GetBitmapResource( const wxString& name ); + + /// Retrieves icon resources + wxIcon GetIconResource( const wxString& name ); +////@end SplineToolPanel member function declarations + + /// Should we show tooltips? + static bool ShowToolTips(); + +////@begin SplineToolPanel member variables + wxRadioBox* mSplineSort; +////@end SplineToolPanel member variables +}; + +#endif + // _SPLINETOOLPANEL_H_ Index: src/Applications/Seg3D/GuiCode/Seg3d.pjd =================================================================== --- src/Applications/Seg3D/GuiCode/Seg3d.pjd (revision 44506) +++ src/Applications/Seg3D/GuiCode/Seg3d.pjd (working copy) @@ -20,6 +20,7 @@ <string name="resource_prefix">""</string> <bool name="use_two_step_construction">0</bool> <bool name="use_enums">0</bool> + <bool name="generate_for_xrced">0</bool> <string name="current_platform">"<All platforms>"</string> <string name="target_wx_version">"2.8.4"</string> <string name="cpp_header_comment">"///////////////////////////////////////////////////////////////////////////// @@ -106,6 +107,7 @@ <bool name="archive_all_image_files">0</bool> <bool name="xrc_retain_relative_paths">1</bool> <bool name="xrc_generate_id_tags">0</bool> + <bool name="xrc_use_name_property">0</bool> </header> <data> <document> @@ -128,6 +130,7 @@ <long name="locked">0</long> <string name="template-name">""</string> <bool name="dirty">1</bool> + <long name="makefile-last-written">4286447616</long> <string name="Compiler name">""</string> <string name="Build mode">"Debug"</string> <string name="Unicode mode">"ANSI"</string> @@ -148,6 +151,7 @@ <string name="Compiler location">"%AUTO%"</string> <string name="wxWidgets location">"%AUTO%"</string> <string name="C++ command">"%AUTO%"</string> + <string name="C command">"%AUTO%"</string> <string name="Resource compiler">"%AUTO%"</string> <string name="Make command">"%AUTO%"</string> <string name="Project makefile">"%AUTO%"</string> @@ -159,6 +163,7 @@ <string name="Optimizations">"%AUTO%"</string> <string name="Warnings">"%AUTO%"</string> <string name="Debug flags">"%AUTO%"</string> + <string name="Extra compile flags">"%AUTO%"</string> <string name="Libraries">"%AUTO%"</string> <string name="Library path">"%AUTO%"</string> <string name="Linker flags">"%AUTO%"</string> @@ -169,6 +174,9 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="CFG">""</string> <document> <string name="title">"VC++ Debug"</string> <string name="type">"vc-config-data-document"</string> @@ -180,6 +188,7 @@ <long name="locked">0</long> <string name="template-name">"VC++"</string> <bool name="dirty">1</bool> + <long name="makefile-last-written">4286447616</long> <string name="Compiler name">"VC++"</string> <string name="Build mode">"Debug"</string> <string name="Unicode mode">"ANSI"</string> @@ -200,6 +209,7 @@ <string name="Compiler location">"%AUTO%"</string> <string name="wxWidgets location">"%AUTO%"</string> <string name="C++ command">"%AUTO%"</string> + <string name="C command">"%AUTO%"</string> <string name="Resource compiler">"%AUTO%"</string> <string name="Make command">"%AUTO%"</string> <string name="Project makefile">"%AUTO%"</string> @@ -211,6 +221,7 @@ <string name="Optimizations">"%AUTO%"</string> <string name="Warnings">"%AUTO%"</string> <string name="Debug flags">"%AUTO%"</string> + <string name="Extra compile flags">"%AUTO%"</string> <string name="Libraries">"%AUTO%"</string> <string name="Library path">"%AUTO%"</string> <string name="Linker flags">"%AUTO%"</string> @@ -221,7 +232,10 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> <string name="CFG">""</string> + <string name="Ignore libraries">"%AUTO%"</string> </document> <document> <string name="title">"VC++ Release"</string> @@ -234,6 +248,7 @@ <long name="locked">0</long> <string name="template-name">"VC++"</string> <bool name="dirty">1</bool> + <long name="makefile-last-written">4286447616</long> <string name="Compiler name">"VC++"</string> <string name="Build mode">"Release"</string> <string name="Unicode mode">"ANSI"</string> @@ -254,6 +269,7 @@ <string name="Compiler location">"%AUTO%"</string> <string name="wxWidgets location">"%AUTO%"</string> <string name="C++ command">"%AUTO%"</string> + <string name="C command">"%AUTO%"</string> <string name="Resource compiler">"%AUTO%"</string> <string name="Make command">"%AUTO%"</string> <string name="Project makefile">"%AUTO%"</string> @@ -265,6 +281,7 @@ <string name="Optimizations">"%AUTO%"</string> <string name="Warnings">"%AUTO%"</string> <string name="Debug flags">"%AUTO%"</string> + <string name="Extra compile flags">"%AUTO%"</string> <string name="Libraries">"%AUTO%"</string> <string name="Library path">"%AUTO%"</string> <string name="Linker flags">"%AUTO%"</string> @@ -275,7 +292,10 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> <string name="CFG">""</string> + <string name="Ignore libraries">"%AUTO%"</string> </document> <document> <string name="title">"VC++ Project Debug"</string> @@ -288,6 +308,7 @@ <long name="locked">0</long> <string name="template-name">"VC++ Project"</string> <bool name="dirty">0</bool> + <long name="makefile-last-written">4286447616</long> <string name="Compiler name">"VC++ Project"</string> <string name="Build mode">"Debug"</string> <string name="Unicode mode">"ANSI"</string> @@ -309,6 +330,7 @@ <string name="Compiler location">"%AUTO%"</string> <string name="wxWidgets location">"%AUTO%"</string> <string name="C++ command">"%AUTO%"</string> + <string name="C command">"%AUTO%"</string> <string name="Resource compiler">"%AUTO%"</string> <string name="Make command">"%AUTO%"</string> <string name="Project makefile">"%AUTO%"</string> @@ -320,6 +342,7 @@ <string name="Optimizations">"%AUTO%"</string> <string name="Warnings">"%AUTO%"</string> <string name="Debug flags">"%AUTO%"</string> + <string name="Extra compile flags">"%AUTO%"</string> <string name="Libraries">"%AUTO%"</string> <string name="Library path">"%AUTO%"</string> <string name="Linker flags">"%AUTO%"</string> @@ -330,6 +353,9 @@ <string name="wxWidgets build command">"%AUTO%"</string> <string name="wxWidgets clean command">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string> + <bool name="Suppress source rules">0</bool> + <bool name="Enable makefile generation">1</bool> + <string name="CFG">""</string> <string name="Project make command">"%AUTO%"</string> <string name="Project build command">"%AUTO%"</string> <string name="Project rebuild command">"%AUTO%"</string> @@ -338,7 +364,7 @@ <string name="Pre-build command">"%AUTO%"</string> <string name="Post-build command">"%AUTO%"</string> <string name="Pre-link command">"%AUTO%"</string> - <string name="CFG">""</string> + <string name="Ignore libraries">"%AUTO%"</string> </document> </document> </document> @@ -15592,6 +15618,547 @@ </document> </document> <document> + <string name="title">"SplineToolPanel"</string> + <string name="type">"dialog-document"</string> + <string name="filename">""</string> + <string name="icon-name">"dialog"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbDialogProxy"</string> + <long name="base-id">10000</long> + <bool name="use-id-prefix">0</bool> + <string name="id-prefix">""</string> + <bool name="use-id-suffix">0</bool> + <string name="id-suffix">""</string> + <long name="use-xrc">0</long> + <long name="working-mode">0</long> + <string name="proxy-Id name">"ID_SPLINETOOL"</string> + <long name="proxy-Id value">10012</long> + <string name="proxy-Class">"SplineToolPanel"</string> + <string name="proxy-Base class">"wxPanel"</string> + <string name="proxy-Window kind">"wxPanel"</string> + <string name="proxy-Implementation filename">"splinetoolpanel.cpp"</string> + <string name="proxy-Header filename">"splinetoolpanel.h"</string> + <string name="proxy-XRC filename">"splinetoolpanel.xrc"</string> + <string name="proxy-Title">"SplineTool"</string> + <bool name="proxy-Centre">0</bool> + <string name="proxy-Icon">""</string> + <bool name="proxy-Dialog units">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">"10, wxSWISS, wxNORMAL, wxNORMAL, false, Arial"</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Texture">""</string> + <string name="proxy-Texture style">"Tiled"</string> + <bool name="proxy-wxDEFAULT_DIALOG_STYLE">0</bool> + <bool name="proxy-wxCAPTION">0</bool> + <bool name="proxy-wxRESIZE_BORDER">0</bool> + <bool name="proxy-wxSYSTEM_MENU">0</bool> + <bool name="proxy-wxSTAY_ON_TOP">0</bool> + <bool name="proxy-wxDIALOG_NO_PARENT">0</bool> + <bool name="proxy-wxCLOSE_BOX">0</bool> + <bool name="proxy-wxMAXIMIZE_BOX">0</bool> + <bool name="proxy-wxMINIMIZE_BOX">0</bool> + <bool name="proxy-wxDIALOG_MODAL">0</bool> + <bool name="proxy-wxNO_BORDER">0</bool> + <bool name="proxy-wxSIMPLE_BORDER">0</bool> + <bool name="proxy-wxDOUBLE_BORDER">0</bool> + <bool name="proxy-wxSUNKEN_BORDER">0</bool> + <bool name="proxy-wxRAISED_BORDER">0</bool> + <bool name="proxy-wxSTATIC_BORDER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxCLIP_CHILDREN">0</bool> + <bool name="proxy-wxTAB_TRAVERSAL">0</bool> + <bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool> + <bool name="proxy-wxWS_EX_BLOCK_EVENTS">0</bool> + <bool name="proxy-wxWS_EX_TRANSIENT">0</bool> + <string name="proxy-Custom styles">""</string> + <bool name="proxy-wxDIALOG_EX_CONTEXTHELP">0</bool> + <bool name="proxy-Fit to content">1</bool> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">200</long> + <long name="proxy-Height">-1</long> + <bool name="proxy-AUI manager">0</bool> + <string name="proxy-Event sources">""</string> + <document> + <string name="title">"wxGridSizerProxy"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"sizer"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbGridSizerProxy"</string> + <long name="proxy-Columns">1</long> + <long name="proxy-Rows">1</long> + <long name="proxy-ColumnSpacing">0</long> + <long name="proxy-RowSpacing">0</long> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Platform">"<Any platform>"</string> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <document> + <string name="title">"wxGridSizerProxy"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"sizer"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbGridSizerProxy"</string> + <long name="proxy-Columns">1</long> + <long name="proxy-Rows">1</long> + <long name="proxy-ColumnSpacing">0</long> + <long name="proxy-RowSpacing">0</long> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Platform">"<Any platform>"</string> + <string name="proxy-AlignH">"Expand"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">0</bool> + <bool name="proxy-wxBOTTOM">0</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <document> + <string name="title">"wxButton: CLEAR_SEEDS_BUTTON"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"dialogcontrol"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbButtonProxy"</string> + <string name="proxy-Id name">"CLEAR_SEEDS_BUTTON"</string> + <long name="proxy-Id value">10005</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxButton"</string> + <string name="proxy-Base class">"wxButton"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Label">"Clear Seeds"</string> + <bool name="proxy-Default">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">"8, wxSWISS, wxNORMAL, wxNORMAL, false, Arial"</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <bool name="proxy-wxBU_LEFT">0</bool> + <bool name="proxy-wxBU_RIGHT">0</bool> + <bool name="proxy-wxBU_TOP">0</bool> + <bool name="proxy-wxBU_BOTTOM">0</bool> + <bool name="proxy-wxBU_EXACTFIT">0</bool> + <bool name="proxy-wxNO_BORDER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + </document> + <document> + <string name="title">"wxGridSizerProxy"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"sizer"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbGridSizerProxy"</string> + <long name="proxy-Columns">2</long> + <long name="proxy-Rows">1</long> + <long name="proxy-ColumnSpacing">0</long> + <long name="proxy-RowSpacing">0</long> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Platform">"<Any platform>"</string> + <string name="proxy-AlignH">"Expand"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">0</bool> + <bool name="proxy-wxBOTTOM">0</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <document> + <string name="title">"wxButton: START_BUTTON"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"dialogcontrol"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbButtonProxy"</string> + <string name="proxy-Id name">"START_BUTTON"</string> + <long name="proxy-Id value">10004</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxButton"</string> + <string name="proxy-Base class">"wxButton"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Label">"Fill"</string> + <bool name="proxy-Default">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">"8, wxSWISS, wxNORMAL, wxNORMAL, false, Arial"</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <bool name="proxy-wxBU_LEFT">0</bool> + <bool name="proxy-wxBU_RIGHT">0</bool> + <bool name="proxy-wxBU_TOP">0</bool> + <bool name="proxy-wxBU_BOTTOM">0</bool> + <bool name="proxy-wxBU_EXACTFIT">0</bool> + <bool name="proxy-wxNO_BORDER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + <document> + <string name="title">"wxButton: ERASE_BUTTON"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"dialogcontrol"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbButtonProxy"</string> + <string name="proxy-Id name">"ERASE_BUTTON"</string> + <long name="proxy-Id value">10007</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxButton"</string> + <string name="proxy-Base class">"wxButton"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Label">"Erase"</string> + <bool name="proxy-Default">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">"8, wxSWISS, wxNORMAL, wxNORMAL, false, Arial"</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <bool name="proxy-wxBU_LEFT">0</bool> + <bool name="proxy-wxBU_RIGHT">0</bool> + <bool name="proxy-wxBU_TOP">0</bool> + <bool name="proxy-wxBU_BOTTOM">0</bool> + <bool name="proxy-wxBU_EXACTFIT">0</bool> + <bool name="proxy-wxNO_BORDER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + </document> + <document> + <string name="title">"wxGridSizerProxy"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"sizer"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbGridSizerProxy"</string> + <long name="proxy-Columns">1</long> + <long name="proxy-Rows">1</long> + <long name="proxy-ColumnSpacing">0</long> + <long name="proxy-RowSpacing">0</long> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Platform">"<Any platform>"</string> + <string name="proxy-AlignH">"Expand"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">0</bool> + <bool name="proxy-wxBOTTOM">0</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <document> + <string name="title">"wxButton: CLOSE_BUTTON"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"dialogcontrol"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbButtonProxy"</string> + <string name="proxy-Id name">"CLOSE_BUTTON"</string> + <long name="proxy-Id value">10001</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxButton"</string> + <string name="proxy-Base class">"wxButton"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Label">"Close"</string> + <bool name="proxy-Default">0</bool> + <string name="proxy-Help text">""</string> + <string name="proxy-Tooltip text">""</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">"8, wxSWISS, wxNORMAL, wxNORMAL, false, Arial"</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <bool name="proxy-wxBU_LEFT">0</bool> + <bool name="proxy-wxBU_RIGHT">0</bool> + <bool name="proxy-wxBU_TOP">0</bool> + <bool name="proxy-wxBU_BOTTOM">0</bool> + <bool name="proxy-wxBU_EXACTFIT">0</bool> + <bool name="proxy-wxNO_BORDER">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + </document> + <document> + <string name="title">"wxGridSizerProxy"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"sizer"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbGridSizerProxy"</string> + <long name="proxy-Columns">1</long> + <long name="proxy-Rows">1</long> + <long name="proxy-ColumnSpacing">0</long> + <long name="proxy-RowSpacing">0</long> + <string name="proxy-Member variable name">""</string> + <string name="proxy-Platform">"<Any platform>"</string> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">0</bool> + <bool name="proxy-wxBOTTOM">0</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <document> + <string name="title">"wxRadioBox: ORDER_RADIOBOX"</string> + <string name="type">"dialog-control-document"</string> + <string name="filename">""</string> + <string name="icon-name">"radiobox"</string> + <long name="is-transient">0</long> + <long name="owns-file">1</long> + <long name="title-mode">0</long> + <long name="locked">0</long> + <string name="proxy-type">"wbRadioBoxProxy"</string> + <string name="proxy-Id name">"ORDER_RADIOBOX"</string> + <long name="proxy-Id value">10015</long> + <string name="proxy-Name">""</string> + <string name="proxy-Class">"wxRadioBox"</string> + <string name="proxy-Base class">"wxRadioBox"</string> + <bool name="proxy-External implementation">1</bool> + <bool name="proxy-Separate files">0</bool> + <string name="proxy-Implementation filename">""</string> + <string name="proxy-Header filename">""</string> + <string name="proxy-Member variable name">"mSplineSort"</string> + <string name="proxy-Label">"Seed order"</string> + <long name="proxy-Major dimension count">1</long> + <string name="proxy-Items">"&Clicking|&Azimuth"</string> + <long name="proxy-Initial value">0</long> + <string name="proxy-Help text">"Method to order the seeds (Clicking = in the same order as clicking, Azimuth = by their azimuth coordinate)"</string> + <string name="proxy-Tooltip text">"Method to order the seeds (Clicking = in the same order as clicking, Azimuth = by their azimuth coordinate)"</string> + <string name="proxy-Background colour">""</string> + <string name="proxy-Foreground colour">""</string> + <string name="proxy-Font">"8, wxSWISS, wxNORMAL, wxNORMAL, false, Arial"</string> + <bool name="proxy-Hidden">0</bool> + <bool name="proxy-Enabled">1</bool> + <string name="proxy-Platform">"<Any platform>"</string> + <string name="proxy-Data variable">""</string> + <string name="proxy-Data validator">""</string> + <string name="proxy-Data source">""</string> + <string name="proxy-Data class name">""</string> + <string name="proxy-Data class implementation filename">""</string> + <string name="proxy-Data class header filename">""</string> + <string name="proxy-Data class manager window">""</string> + <bool name="proxy-wxRA_SPECIFY_ROWS">1</bool> + <bool name="proxy-wxRA_SPECIFY_COLS">0</bool> + <bool name="proxy-wxWANTS_CHARS">0</bool> + <bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool> + <bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool> + <string name="proxy-Custom styles">""</string> + <long name="proxy-X">-1</long> + <long name="proxy-Y">-1</long> + <long name="proxy-Width">-1</long> + <long name="proxy-Height">-1</long> + <string name="proxy-AlignH">"Centre"</string> + <string name="proxy-AlignV">"Centre"</string> + <long name="proxy-Stretch factor">0</long> + <long name="proxy-Border">5</long> + <bool name="proxy-wxLEFT">1</bool> + <bool name="proxy-wxRIGHT">1</bool> + <bool name="proxy-wxTOP">1</bool> + <bool name="proxy-wxBOTTOM">1</bool> + <bool name="proxy-wxSHAPED">0</bool> + <bool name="proxy-wxADJUST_MINSIZE">0</bool> + <bool name="proxy-wxFIXED_MINSIZE">0</bool> + <string name="proxy-Custom arguments">""</string> + <string name="proxy-Custom ctor arguments">""</string> + </document> + </document> + </document> + </document> + <document> <string name="title">"ThresholdToolPanel"</string> <string name="type">"dialog-document"</string> <string name="filename">""</string> Index: src/Applications/Seg3D/GuiCode/splinetoolpanel.cpp =================================================================== --- src/Applications/Seg3D/GuiCode/splinetoolpanel.cpp (revision 0) +++ src/Applications/Seg3D/GuiCode/splinetoolpanel.cpp (revision 0) @@ -0,0 +1,225 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: splinetoolpanel.cpp +// Purpose: +// Author: Ramon Casero +// Modified by: +// Created: Wed 09 Apr 2008 16:29:38 MDT +// RCS-ID: +// Copyright: +// Licence: +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" +#include <Applications/Seg3D/Painter.h> + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +////@begin includes +////@end includes + +#include "splinetoolpanel.h" + +////@begin XPM images +////@end XPM images + + +/*! + * SplineToolPanel type definition + */ + +IMPLEMENT_DYNAMIC_CLASS( SplineToolPanel, wxPanel ) + + +/*! + * SplineToolPanel event table definition + */ + +BEGIN_EVENT_TABLE( SplineToolPanel, wxPanel ) + +////@begin SplineToolPanel event table entries +////@end SplineToolPanel event table entries + EVT_BUTTON( XRCID("CLEAR_SEEDS_BUTTON"), SplineToolPanel::OnClearSeedsButtonClick ) + EVT_BUTTON( XRCID("START_BUTTON"), SplineToolPanel::OnStartButtonClick ) + EVT_BUTTON( XRCID("ERASE_BUTTON"), SplineToolPanel::OnEraseButtonClick ) + EVT_BUTTON( XRCID("CLOSE_BUTTON"), SplineToolPanel::OnCloseButtonClick ) + EVT_RADIOBOX( XRCID("ORDER_RADIOBOX"), SplineToolPanel::OnOrderRadioBox ) + +END_EVENT_TABLE() + + +/*! + * SplineToolPanel constructors + */ + +SplineToolPanel::SplineToolPanel() +{ + Init(); +} + +SplineToolPanel::SplineToolPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) +{ + Init(); + Create(parent, id, pos, size, style); +} + + +/*! + * SplineToolPanel creator + */ + +bool SplineToolPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) +{ +////@begin SplineToolPanel creation + SetParent(parent); + CreateControls(); + if (GetSizer()) + { + GetSizer()->SetSizeHints(this); + } +////@end SplineToolPanel creation + return true; +} + + +/*! + * SplineToolPanel destructor + */ + +SplineToolPanel::~SplineToolPanel() +{ +////@begin SplineToolPanel destruction +////@end SplineToolPanel destruction +} + + +/*! + * Member initialisation + */ + +void SplineToolPanel::Init() +{ +////@begin SplineToolPanel member initialisation + mSplineSort = NULL; +////@end SplineToolPanel member initialisation +} + + +/*! + * Control creation for SplineToolPanel + */ + +void SplineToolPanel::CreateControls() +{ +////@begin SplineToolPanel content construction + // Generated by DialogBlocks, Wed 14 Oct 2009 20:54:49 BST (unregistered) + + if (!wxXmlResource::Get()->LoadPanel(this, GetParent(), _T("ID_SPLINETOOL"))) + wxLogError(wxT("Missing wxXmlResource::Get()->Load() in OnInit()?")); + mSplineSort = XRCCTRL(*this, "ORDER_RADIOBOX", wxRadioBox); +////@end SplineToolPanel content construction + + // Create custom windows not generated automatically here. +////@begin SplineToolPanel content initialisation +////@end SplineToolPanel content initialisation +} + + +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for CLEAR_SEEDS_BUTTON + */ +void SplineToolPanel::OnClearSeedsButtonClick( wxCommandEvent& event ) +{ + SCIRun::Painter::ThrowSkinnerSignal("Painter::SetLayer"); +} + +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for START_BUTTON + */ +void SplineToolPanel::OnStartButtonClick( wxCommandEvent& event ) +{ + wxBeginBusyCursor(); + SCIRun::ThrowSkinnerSignalEvent *tsse = + new SCIRun::ThrowSkinnerSignalEvent("Painter::FinishTool"); + tsse->add_var("Painter::splinetool_erase", "0"); + SCIRun::Painter::ThrowSkinnerSignal(tsse); + wxEndBusyCursor(); +} + +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for ERASE_BUTTON + */ +void SplineToolPanel::OnEraseButtonClick( wxCommandEvent& event ) +{ + wxBeginBusyCursor(); + SCIRun::ThrowSkinnerSignalEvent *tsse = + new SCIRun::ThrowSkinnerSignalEvent("Painter::FinishTool"); + tsse->add_var("Painter::splinetool_erase", "1"); + SCIRun::Painter::ThrowSkinnerSignal(tsse); + wxEndBusyCursor(); +} + +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for CLOSE_BUTTON + */ +void SplineToolPanel::OnCloseButtonClick( wxCommandEvent& event ) +{ + SCIRun::Painter::global_seg3dframe_pointer_->HideTool(); +} + + +/*! + * wxEVT_RADIOBOX event handler for ORDER_RADIOBOX + */ +void SplineToolPanel::OnOrderRadioBox( wxCommandEvent& event ) +{ + wxBeginBusyCursor(); + SCIRun::ThrowSkinnerSignalEvent *tsse = + new SCIRun::ThrowSkinnerSignalEvent("Painter::UpdateSplineTool"); + tsse->add_var("Painter::splinetool_sort", + mSplineSort->GetStringSelection().c_str()); + SCIRun::Painter::ThrowSkinnerSignal(tsse); + wxEndBusyCursor(); +} + + +/*! + * Should we show tooltips? + */ + +bool SplineToolPanel::ShowToolTips() +{ + return true; +} + +/*! + * Get bitmap resources + */ + +wxBitmap SplineToolPanel::GetBitmapResource( const wxString& name ) +{ + // Bitmap retrieval +////@begin SplineToolPanel bitmap retrieval + wxUnusedVar(name); + return wxNullBitmap; +////@end SplineToolPanel bitmap retrieval +} + +/*! + * Get icon resources + */ + +wxIcon SplineToolPanel::GetIconResource( const wxString& name ) +{ + // Icon retrieval +////@begin SplineToolPanel icon retrieval + wxUnusedVar(name); + return wxNullIcon; +////@end SplineToolPanel icon retrieval +} Index: src/Applications/Seg3D/GuiCode/splinetoolpanel.xrc =================================================================== --- src/Applications/Seg3D/GuiCode/splinetoolpanel.xrc (revision 0) +++ src/Applications/Seg3D/GuiCode/splinetoolpanel.xrc (revision 0) @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<resource version="2.3.0.1" xmlns="http://www.wxwidgets.org/wxxrc"> + <object class="wxPanel" name="ID_SPLINETOOL" subclass="SplineToolPanel"> + <title>SplineTool</title> + <font> + <size>10</size> + <family>swiss</family> + <face>Arial</face> + </font> + <object class="wxGridSizer"> + <cols>1</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</flag> + <border>5</border> + <object class="wxGridSizer"> + <cols>1</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxButton" name="CLEAR_SEEDS_BUTTON"> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <label>Clear Seeds</label> + </object> + </object> + </object> + </object> + <object class="sizeritem"> + <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</flag> + <border>5</border> + <object class="wxGridSizer"> + <cols>2</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxButton" name="START_BUTTON"> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <label>Fill</label> + </object> + </object> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxButton" name="ERASE_BUTTON"> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <label>Erase</label> + </object> + </object> + </object> + </object> + <object class="sizeritem"> + <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</flag> + <border>5</border> + <object class="wxGridSizer"> + <cols>1</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxButton" name="CLOSE_BUTTON"> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <label>Close</label> + </object> + </object> + </object> + </object> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</flag> + <border>5</border> + <object class="wxGridSizer"> + <cols>1</cols> + <rows>1</rows> + <vgap>0</vgap> + <hgap>0</hgap> + <object class="sizeritem"> + <flag>wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</flag> + <border>5</border> + <object class="wxRadioBox" name="ORDER_RADIOBOX"> + <tooltip>Method to order the seeds (Clicking = in the same order as clicking, Azimuth = by their azimuth coordinate)</tooltip> + <help>Method to order the seeds (Clicking = in the same order as clicking, Azimuth = by their azimuth coordinate)</help> + <font> + <size>8</size> + <family>swiss</family> + <face>Arial</face> + </font> + <style>wxRA_SPECIFY_ROWS</style> + <label>Seed order</label> + <dimension>1</dimension> + <selection>0</selection> + <content> + <item>&Clicking</item> + <item>&Azimuth</item> + </content> + </object> + </object> + </object> + </object> + </object> + </object> +</resource> Index: src/Applications/Seg3D/Painter.h =================================================================== --- src/Applications/Seg3D/Painter.h (revision 44506) +++ src/Applications/Seg3D/Painter.h (working copy) @@ -225,6 +225,7 @@ CatcherFunction_t StartCropTool; CatcherFunction_t StartArithmeticTool; CatcherFunction_t StartPolylineTool; + CatcherFunction_t StartSplineTool; CatcherFunction_t StartResampleTool; CatcherFunction_t StartThresholdTool; CatcherFunction_t StartWindowLevelTool; @@ -300,11 +301,13 @@ CatcherFunction_t FloodFillClear; CatcherFunction_t RasterPolyline; + CatcherFunction_t RasterSpline; CatcherFunction_t ResetCLUT; CatcherFunction_t UpdateBrushRadius; CatcherFunction_t UpdateThresholdTool; CatcherFunction_t UpdateWindowLevelTool; + CatcherFunction_t UpdateSplineTool; CatcherFunction_t OpenLabelColorDialog; CatcherFunction_t SetLabelColor; @@ -434,6 +437,22 @@ }; +class UpdateSplineToolEvent : public BaseEvent +{ + string sort_; // sort method + +public: + UpdateSplineToolEvent(string sort) + : BaseEvent(), sort_(sort) { + } + virtual BaseEvent *clone() + { return new UpdateSplineToolEvent(sort_); } + virtual ~UpdateSplineToolEvent() {} + + string get_sort() { return sort_; } +}; + + class UpdateThresholdToolEvent : public BaseEvent { double lower_; Index: src/Applications/Seg3D/Seg3DFrame.h =================================================================== --- src/Applications/Seg3D/Seg3DFrame.h (revision 44506) +++ src/Applications/Seg3D/Seg3DFrame.h (working copy) @@ -70,6 +70,7 @@ class itkCannyEdgeDetectionImageFilter; class HistoEqFilter; class PolylineToolPanel; +class SplineToolPanel; class ThresholdToolPanel; class WindowLevelToolPanel; class MoveScaleToolPanel; @@ -124,6 +125,7 @@ MENU_TOOL_INVERT, MENU_TOOL_RESAMPLE, MENU_TOOL_POLYLINE, + MENU_TOOL_SPLINE, MENU_TOOL_THRESHOLD, MENU_TOOL_WINDOWLEVEL, MENU_TOOL_MOVESCALE, @@ -258,6 +260,7 @@ void ToolInvert( wxCommandEvent& WXUNUSED(event) ); void ToolResample( wxCommandEvent& WXUNUSED(event) ); void ToolPolyline( wxCommandEvent& WXUNUSED(event) ); + void ToolSpline( wxCommandEvent& WXUNUSED(event) ); void ToolThreshold( wxCommandEvent& WXUNUSED(event) ); void ToolWindowLevel( wxCommandEvent& WXUNUSED(event) ); void ToolMoveScale( wxCommandEvent& WXUNUSED(event) ); @@ -330,6 +333,7 @@ MaskFilter* maskfilter_; MaskLogicalFilter* masklogicalfilter_; PolylineToolPanel *polylinetoolpanel_; + SplineToolPanel *splinetoolpanel_; ThresholdToolPanel *thresholdtoolpanel_; WindowLevelToolPanel *windowleveltoolpanel_; MoveScaleToolPanel *movescaletoolpanel_;
Archive powered by MHonArc 2.6.16.