1 #include "interfSegmentationMenu.h"
2 #include "interfMainPanel.h"
4 interfSegmentationMenu::interfSegmentationMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir)
5 : interfMenuBar(parent, sizex, sizey)
7 this->datadir = datdir;
10 //contourevent = (wxContourEventHandler*)evtHandler;
14 segmentPanelITK = NULL;
16 //eventHandler = evtHandler;
22 void interfSegmentationMenu::initButtons(wxEvtHandler* evtHandler) {
24 std::vector<std::string> path, nom;
25 std::vector<wxObjectEventFunction> funct;
27 path.push_back(datadir + "/Segmentation.png");
28 nom.push_back("Find shapes by automatic segmentation");
29 funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressed);
31 path.push_back(datadir + "/ITK.png");
32 nom.push_back("Find shapes by automatic segmentation with ITK");
33 funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressedITK);
35 path.push_back(datadir + "/snake.png");
36 nom.push_back("Find shapes using border snake interaction");
37 funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSnakePressed);
40 path.push_back(datadir + "/Threshold.png");
41 nom.push_back("Superpose a 'Red Image' to the selected Image Threshold");
42 funct.push_back((wxObjectEventFunction)&interfSegmentationMenu::onThreshold);
44 this->addButtons(path, nom);
45 this->setVectorFunction(funct);
47 this->connectEvents(evtHandler);
52 interfSegmentationMenu::~interfSegmentationMenu()
57 ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
58 ** of the button corresponding to the method that has to be executed,
59 ** it uses attribute eventHandler to call the methods define by the application.
60 ** see setEventHandler(wxEventHandler*)
64 void interfSegmentationMenu::onSegmentationPressed(wxCommandEvent& event)
66 interfMainPanel::getInstance()->onSegmentationPressed();
71 void interfSegmentationMenu::onSegmentationPressedITK(wxCommandEvent& event)
73 interfMainPanel::getInstance()->onSegmentationPressedITK();
76 void interfSegmentationMenu::onSnakePressed(wxCommandEvent& event)
78 interfMainPanel::getInstance()->onSnakePressed();
82 void interfSegmentationMenu::onThreshold(wxCommandEvent& event)
84 interfMainPanel::getInstance()->onThresholdPressed();
87 //------------------------------------------------------------------------------------------------------------