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;
8 //contourevent = (wxContourEventHandler*)evtHandler;
12 segmentPanelITK = NULL;
14 //eventHandler = evtHandler;
19 void interfSegmentationMenu::initButtons(wxEvtHandler* evtHandler) {
21 std::vector<std::string> path, nom;
22 std::vector<wxObjectEventFunction> funct;
24 path.push_back(datadir + "/Segmentation.png");
25 nom.push_back("Find shapes by automatic segmentation");
26 funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressed);
28 path.push_back(datadir + "/ITK.png");
29 nom.push_back("Find shapes by automatic segmentation with ITK");
30 funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressedITK);
32 path.push_back(datadir + "/snake.png");
33 nom.push_back("Find shapes using border snake interaction");
34 funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSnakePressed);
36 this->addButtons(path, nom);
37 this->setVectorFunction(funct);
39 this->connectEvents(evtHandler);
44 interfSegmentationMenu::~interfSegmentationMenu()
49 ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
50 ** of the button corresponding to the method that has to be executed,
51 ** it uses attribute eventHandler to call the methods define by the application.
52 ** see setEventHandler(wxEventHandler*)
56 void interfSegmentationMenu::onSegmentationPressed(wxCommandEvent& event){
58 interfMainPanel::getInstance()->onSegmentationPressed();
63 void interfSegmentationMenu::onSegmentationPressedITK(wxCommandEvent& event){
65 interfMainPanel::getInstance()->onSegmentationPressedITK();
70 void interfSegmentationMenu::onSnakePressed(wxCommandEvent& event){
72 interfMainPanel::getInstance()->onSnakePressed();
76 //------------------------------------------------------------------------------------------------------------