From b13d5fc346334fa875520c47c219a7092e80d09d Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Wed, 7 Jul 2010 14:35:51 +0000 Subject: [PATCH] *** empty log message *** --- .../interfEditMenu.cxx | 22 ++-- .../interfEditMenu.h | 1 - .../interfImageToolsMenu.cxx | 123 ++++++++++++++++++ .../interfImageToolsMenu.h | 58 +++++++++ .../interfMainPanel.cxx | 101 ++++++++------ .../interfMainPanel.h | 37 +++--- .../interfSegmentationMenu.cxx | 53 ++++---- .../interfSegmentationMenu.h | 23 ++-- .../interfToolsMenu.cxx | 61 ++++----- .../interfToolsMenu.h | 14 +- .../wxContourMainFrame.cxx | 27 ++++ .../wxContourMainFrame.h | 17 ++- .../OutlineModelManager.cxx | 2 + 13 files changed, 377 insertions(+), 162 deletions(-) create mode 100644 lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx create mode 100644 lib/Interface_Icons_NDimensions/interfImageToolsMenu.h diff --git a/lib/Interface_Icons_NDimensions/interfEditMenu.cxx b/lib/Interface_Icons_NDimensions/interfEditMenu.cxx index 2aea262..8e23882 100644 --- a/lib/Interface_Icons_NDimensions/interfEditMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfEditMenu.cxx @@ -30,11 +30,6 @@ void interfEditMenu::initButtons(wxEvtHandler* evtHandler) { nom.push_back("Redo ctrl + y"); funct.push_back((wxObjectEventFunction) &interfEditMenu:: onRedo); -//CMRU 17-08-09 ------------------------------------------------------------------ - path.push_back(datadir + "/Letter.PNG"); - nom.push_back("Insert a Label"); - funct.push_back((wxObjectEventFunction)&interfEditMenu::onPrintLabel); -//------------------------------------------------------------------------------- this->addButtons(path, nom); this->setVectorFunction(funct); @@ -47,22 +42,25 @@ void interfEditMenu::initButtons(wxEvtHandler* evtHandler) { this->connectEvents(evtHandler); } -void interfEditMenu::onCopy(wxCommandEvent& event){ +void interfEditMenu::onCopy(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onCopy(); } -void interfEditMenu::onPaste(wxCommandEvent& event){ +void interfEditMenu::onPaste(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onPaste(); } -void interfEditMenu::onUndo(wxCommandEvent& event){ + +void interfEditMenu::onUndo(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onUndo(); } -void interfEditMenu::onRedo(wxCommandEvent& event){ + +void interfEditMenu::onRedo(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onRedo(); } -void interfEditMenu::onPrintLabel(wxCommandEvent& event){ - interfMainPanel::getInstance()->onPrintLabel(); -} interfEditMenu::~interfEditMenu() { diff --git a/lib/Interface_Icons_NDimensions/interfEditMenu.h b/lib/Interface_Icons_NDimensions/interfEditMenu.h index 58100b5..17582f0 100644 --- a/lib/Interface_Icons_NDimensions/interfEditMenu.h +++ b/lib/Interface_Icons_NDimensions/interfEditMenu.h @@ -19,7 +19,6 @@ public: void onPaste(wxCommandEvent& event); void onUndo(wxCommandEvent& event); void onRedo(wxCommandEvent& event); - void onPrintLabel(wxCommandEvent& event); }; diff --git a/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx b/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx new file mode 100644 index 0000000..8e8e474 --- /dev/null +++ b/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx @@ -0,0 +1,123 @@ +#include "interfImageToolsMenu.h" +#include "interfMainPanel.h" + +interfImageToolsMenu::interfImageToolsMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir) + : interfMenuBar(parent, sizex, sizey) +{ + this->datadir = datdir; + //contourevent = (wxContourEventHandler*)evtHandler; + +/*Borrame + infoWin = NULL; + configPanel = NULL; + spreadPanel = NULL; + segmentPanelITK = NULL; +*/ + + //eventHandler = evtHandler; + + initButtons(this); +} + +void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler) { + + std::vector path, nom; + std::vector funct; + +/*EED Borrame + path.push_back(datadir + "/Segmentation.png"); + nom.push_back("Find shapes by automatic segmentation"); + funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressed); + + path.push_back(datadir + "/ITK.png"); + nom.push_back("Find shapes by automatic segmentation with ITK"); + funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressedITK); + + path.push_back(datadir + "/snake.png"); + nom.push_back("Find shapes using border snake interaction"); + funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSnakePressed); +*/ + path.push_back(datadir + "/pignon.png"); + nom.push_back("Configuration of the window"); + funct.push_back((wxObjectEventFunction) &interfImageToolsMenu:: onConfigurationPressed); + + path.push_back(datadir + "/info.png"); + nom.push_back("Information of the contours in the scene"); + funct.push_back((wxObjectEventFunction) &interfImageToolsMenu:: onInformationPressed); + + path.push_back(datadir + "/Threshold.png"); + nom.push_back("Superpose a 'Red Image' to the selected Image Threshold"); + funct.push_back((wxObjectEventFunction)&interfImageToolsMenu::onThreshold); + + path.push_back(datadir + "/Threshold.png"); + nom.push_back("Superpose a Color Image"); + funct.push_back((wxObjectEventFunction)&interfImageToolsMenu::onColorLayerImage); + + path.push_back(datadir + "/Help.png"); + nom.push_back("Show help page with information about the tools"); + funct.push_back((wxObjectEventFunction) &interfImageToolsMenu:: onHelpPressed); + + + this->addButtons(path, nom); + this->setVectorFunction(funct); + + this->connectEvents(evtHandler); + + +} + +interfImageToolsMenu::~interfImageToolsMenu() +{ +} + +/** + ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name + ** of the button corresponding to the method that has to be executed, + ** it uses attribute eventHandler to call the methods define by the application. + ** see setEventHandler(wxEventHandler*) + **/ + +/*EED Borrame +void interfSegmentationMenu::onSegmentationPressed(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onSegmentationPressed(); +} + +void interfSegmentationMenu::onSegmentationPressedITK(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onSegmentationPressedITK(); +} + +void interfSegmentationMenu::onSnakePressed(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onSnakePressed(); +} +*/ + +void interfImageToolsMenu::onInformationPressed(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onInformationPressed(); +} + +void interfImageToolsMenu::onConfigurationPressed(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onConfigurationPressed(); +} + +void interfImageToolsMenu::onThreshold(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onThresholdPressed(); +} + +void interfImageToolsMenu::onColorLayerImage(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onColorLayerImagePressed(); +} + +void interfImageToolsMenu::onHelpPressed(wxCommandEvent& event) +{ + wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/site/fr/EndUserGuide"), 0); +} + +//------------------------------------------------------------------------------------------------------------ + diff --git a/lib/Interface_Icons_NDimensions/interfImageToolsMenu.h b/lib/Interface_Icons_NDimensions/interfImageToolsMenu.h new file mode 100644 index 0000000..08068e9 --- /dev/null +++ b/lib/Interface_Icons_NDimensions/interfImageToolsMenu.h @@ -0,0 +1,58 @@ +#ifndef __interfImageToolsMenuH__ +#define __interfImageToolsMenuH__ + +#include + + +#include "interfMenuBar.h" + +class interfImageToolsMenu + : public interfMenuBar +{ +public: + interfImageToolsMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir = "data/Icons"); + ~interfImageToolsMenu(); + + virtual void initButtons(wxEvtHandler* evtHandler) ; + + /** + ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name + ** of the button corresponding to the method that has to be executed, + ** it uses attribute eventHandler to call the methods define by the application. + ** see setEventHandler(wxEventHandler*) + **/ + +/*EED Borrame + void onSegmentationPressed(wxCommandEvent& event); + void onSegmentationPressedITK(wxCommandEvent& event); + void onSnakePressed(wxCommandEvent& event); +*/ + void onInformationPressed(wxCommandEvent& event); + void onConfigurationPressed(wxCommandEvent& event); + void onThreshold(wxCommandEvent& event); + void onColorLayerImage(wxCommandEvent& event); + void onHelpPressed(wxCommandEvent& event); + +private: + + //wxContourEventHandler* contourevent; +//EED wxPanel* configPanel; +//EED wxWindow* infoWin; + +//EED wxPanel* spreadPanel; +//EED wxPanel* segmentPanelITK; +//EED bool axisshown; + +//EED wxPanel* getSegmentationPanel(wxWindow* parent); + +//EED void onSegmentationOneSlice( wxCommandEvent& event ); + +//EED void onSegmentationAllSlice( wxCommandEvent& event ); + + + +}; + +#endif + + diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx index f3e4129..d9c4e6c 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx @@ -1,15 +1,5 @@ #include "interfMainPanel.h" -/* -#include "interfNewContourMenu.h" -#include "interfIOMenu.h" -#include "interfEditMenu.h" -#include "interfDeleteMenu.h" -#include "interfToolsMenu.h" -#include "interfToolsSpreadPanel.h" -#include "interfMenuBar.h" -#include "interfSegmentationMenu.h" -*/ interfMainPanel* interfMainPanel::interfmainpanel=NULL; wxFrame* interfMainPanel::_newframe=NULL; @@ -18,24 +8,28 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN) { - PANEL = "New Contour"; - PANEL1 = "I/O"; - PANEL2 = "Edit"; - PANEL3 = "Delete"; - PANEL4 = "Tools"; - PANEL5 = "Segmentation"; - segmentPanel = NULL; - segmentPanelITK = NULL; - configPanel = NULL; - spreadPanel = NULL; - infoWin = NULL; - infoPanel = NULL; - infoPanelMask = NULL; - informationPanel = NULL; - mirrorPanel = NULL; - thresholdPanel = NULL; - currentWindow = NULL; - testPanel = NULL; + PANEL = "New Contour"; + PANEL1 = "I/O"; + PANEL2 = "Edit"; + PANEL3 = "Delete"; + PANEL4 = "Contour Tools"; + PANEL5 = "Segmentation"; +//EED 07/07/2010 + PANEL6 = "Image Tools"; + + segmentPanel = NULL; + segmentPanelITK = NULL; + configPanel = NULL; + spreadPanel = NULL; + infoWin = NULL; + infoPanel = NULL; + infoPanelMask = NULL; + informationPanel = NULL; + mirrorPanel = NULL; + thresholdPanel = NULL; + colorImageLayerPanel = NULL; + currentWindow = NULL; + testPanel = NULL; //CMRU 17-08-09 ------------------------------------------------------------------ infoPanelCalibration = NULL; @@ -46,7 +40,7 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH splitterwindow->SetMinimumPaneSize( 10 ); sizey = sizey/8; - wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); + wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T(""))); wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1); toolpanel->SetSizer(flexsizer, true); @@ -64,6 +58,10 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH b4->SetClientData(&PANEL4); wxButton* b5 = getButton(toolpanel); b5->SetClientData(&PANEL5); +//EED 07/07/2010 + wxButton* b6 = getButton(toolpanel); + b6->SetClientData(&PANEL6); + wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); @@ -71,6 +69,8 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH wxPanel* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); wxPanel* mentex5 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); +//EED 07/07/2010 + wxPanel* mentex6 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); menubar = new interfNewContourMenu (mentex, sizex, sizey, evtHandler, datadir); menubar1 = new interfIOMenu (mentex1, sizex, sizey, evtHandler, datadir); @@ -78,6 +78,7 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH menubar3 = new interfDeleteMenu (mentex3, sizex, sizey, evtHandler, datadir); menubar4 = new interfToolsMenu (mentex4, sizex ,sizey, evtHandler, datadir); menubar5 = new interfSegmentationMenu(mentex5, sizex, sizey, evtHandler, datadir); + menubar6 = new interfImageToolsMenu(mentex6, sizex, sizey, evtHandler, datadir); statictext = getText(mentex, PANEL); statictext1 = getText(mentex1, PANEL1); @@ -85,6 +86,7 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH statictext3 = getText(mentex3, PANEL3); statictext4 = getText(mentex4, PANEL4); statictext5 = getText(mentex5, PANEL5); + statictext6 = getText(mentex6, PANEL6); flexsizer->Add(b, wxFIXED_MINSIZE); flexsizer->Add(setMenuTextSizer(mentex, menubar,statictext), wxFIXED_MINSIZE); @@ -103,17 +105,21 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH flexsizer->Add(b5, wxFIXED_MINSIZE); flexsizer->Add(setMenuTextSizer(mentex5, menubar5,statictext5), wxFIXED_MINSIZE); + flexsizer->Add(b6, wxFIXED_MINSIZE); + flexsizer->Add(setMenuTextSizer(mentex6, menubar6,statictext6), wxFIXED_MINSIZE); toolpanel->Update(); toolpanel->Layout(); - infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T(""))); + infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T(""))); wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2); infoPanel->SetSizer(infosizer, true); infoPanel->SetAutoLayout( true ); splitterwindow->Initialize(toolpanel); splitterwindow->SetSashGravity(1); + splitterwindow->SetSashPosition(500); + splitterwindow->SetSashSize(5); splitterwindow->SplitHorizontally(toolpanel, infoPanel); Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1); @@ -122,6 +128,7 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH Connect(b3->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1); Connect(b4->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1); Connect(b5->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1); + Connect(b6->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1); this->Layout(); } @@ -237,6 +244,9 @@ void interfMainPanel::onActionButtonPressed1( wxCommandEvent& event ) }else if(dstring.compare(PANEL5)==0){ dmenu = menubar5; text = statictext5; + }else if(dstring.compare(PANEL6)==0){ + dmenu = menubar6; + text = statictext6; } if(wxStrcmp(b->GetLabel(),_T("+"))==0 ){ @@ -867,12 +877,30 @@ void interfMainPanel::onMirrorChangeWidth(int width) wxContourMainFrame::getInstance()->refLineChangeWidth(width); } - +//EED 07/07/2010 +void interfMainPanel::onColorLayerImagePressed() +{ + // Color Image Layer view control panel + if(colorImageLayerPanel == NULL){ + colorImageLayerPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T(""))); + wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1); + colorImageLayerPanel->SetSizer(flexsizer, true); + colorImageLayerPanel->SetAutoLayout( true ); + //configPanel->SetEventHandler(this->contourevent); + wxPanel *panel = wxContourMainFrame::getInstance()->getThresholdImageViewPanel( colorImageLayerPanel ); + wxStaticText* stattext = new wxStaticText(colorImageLayerPanel, -1, wxString(_T(" Color Image Layer ")), wxDefaultPosition, + wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T(""))); + flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE); + flexsizer->Add(panel, wxEXPAND); + colorImageLayerPanel->Layout(); + } + showPanel(colorImageLayerPanel); + wxContourMainFrame::getInstance()->changeInstant(); +} //EED01 void interfMainPanel::onThresholdPressed() -{ - +{ // Threshold view control panel if(thresholdPanel == NULL){ thresholdPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T(""))); @@ -880,15 +908,12 @@ void interfMainPanel::onThresholdPressed() thresholdPanel->SetSizer(flexsizer, true); thresholdPanel->SetAutoLayout( true ); //configPanel->SetEventHandler(this->contourevent); - wxPanel *panel = wxContourMainFrame::getInstance()->getThresholdImageViewPanel( thresholdPanel ); + wxPanel *panel = wxContourMainFrame::getInstance()->getColorLayerImageViewPanel( thresholdPanel ); wxStaticText* stattext = new wxStaticText(thresholdPanel, -1, wxString(_T(" Threshold segmentation ")), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T(""))); - flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE); - flexsizer->Add(panel, wxEXPAND); - thresholdPanel->Layout(); - + thresholdPanel->Layout(); } showPanel(thresholdPanel); wxContourMainFrame::getInstance()->changeInstant(); diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.h b/lib/Interface_Icons_NDimensions/interfMainPanel.h index 5881936..cea3b74 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.h +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.h @@ -14,8 +14,9 @@ #include "interfToolsSpreadPanel.h" #include "interfSegmentationMenu.h" #include "interfMenuBar.h" -#include "interfSegmentationPanels.h" #include "interfToolsPanels.h" +#include "interfSegmentationPanels.h" +#include "interfImageToolsMenu.h" #include #include @@ -133,6 +134,7 @@ public: void onMirrorAxisHide(); void onMirrorChangeWidth(int width); void onThresholdPressed(); + void onColorLayerImagePressed(); void setLabelSegmentationPanelVTK(wxString tmpString); void onSegmentationPressed(); void onSegmentationPressedITK(); @@ -209,6 +211,7 @@ private: wxPanel* menubar3; wxPanel* menubar4; wxPanel* menubar5; + wxPanel* menubar6; wxWindow* currentWindow; wxSplitterWindow* splitterwindow; @@ -240,6 +243,7 @@ private: wxStaticText* statictext3; wxStaticText* statictext4; wxStaticText* statictext5; + wxStaticText* statictext6; std::string PANEL; std::string PANEL1; @@ -247,24 +251,25 @@ private: std::string PANEL3; std::string PANEL4; std::string PANEL5; - - wxPanel* segmentPanel; - wxPanel* segmentationPanel; - wxPanel* segmentPanelITK; - wxPanel* configPanel; - wxPanel* spreadPanel; - interfSpreadPanel* panelSpread; - wxWindow* infoWin; - wxPanel* informationPanel; + std::string PANEL6; + + wxPanel *segmentPanel; + wxPanel *segmentationPanel; + wxPanel *segmentPanelITK; + wxPanel *configPanel; + wxPanel *spreadPanel; + interfSpreadPanel *panelSpread; + wxWindow *infoWin; + wxPanel *informationPanel; - wxPanel *testPanel; - interfTestPanel *panelTest; - - wxPanel* mirrorPanel; - interfMirrorPanel* panelMirror; + wxPanel *testPanel; + interfTestPanel *panelTest; + wxPanel *mirrorPanel; + interfMirrorPanel *panelMirror; - wxPanel* thresholdPanel; + wxPanel *thresholdPanel; + wxPanel *colorImageLayerPanel; bool axisshown; bool refLineShown; diff --git a/lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx b/lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx index 8ec2fa7..892ab26 100644 --- a/lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx @@ -4,14 +4,17 @@ interfSegmentationMenu::interfSegmentationMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir) : interfMenuBar(parent, sizex, sizey) { - this->datadir = datdir; - //contourevent = (wxContourEventHandler*)evtHandler; - infoWin = NULL; - configPanel = NULL; - spreadPanel = NULL; + this->datadir = datdir; + +/*EED Borrame + //contourevent = (wxContourEventHandler*)evtHandler; + infoWin = NULL; + configPanel = NULL; + spreadPanel = NULL; segmentPanelITK = NULL; - //eventHandler = evtHandler; + //eventHandler = evtHandler; +*/ initButtons(this); } @@ -33,14 +36,11 @@ void interfSegmentationMenu::initButtons(wxEvtHandler* evtHandler) { nom.push_back("Find shapes using border snake interaction"); funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSnakePressed); - path.push_back(datadir + "/Mirror.png"); - nom.push_back("Create an Axis and select a contour to mirror it accordingly"); - funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onMirrorPressed); - +/*EED Borrame path.push_back(datadir + "/Threshold.png"); nom.push_back("Superpose a 'Red Image' to the selected Image Threshold"); funct.push_back((wxObjectEventFunction)&interfSegmentationMenu::onThreshold); - +*/ this->addButtons(path, nom); this->setVectorFunction(funct); @@ -61,37 +61,28 @@ interfSegmentationMenu::~interfSegmentationMenu() **/ -void interfSegmentationMenu::onSegmentationPressed(wxCommandEvent& event){ - +void interfSegmentationMenu::onSegmentationPressed(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onSegmentationPressed(); } -void interfSegmentationMenu::onSegmentationPressedITK(wxCommandEvent& event){ - - interfMainPanel::getInstance()->onSegmentationPressedITK(); - - +void interfSegmentationMenu::onSegmentationPressedITK(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onSegmentationPressedITK(); } -void interfSegmentationMenu::onSnakePressed(wxCommandEvent& event){ - +void interfSegmentationMenu::onSnakePressed(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onSnakePressed(); - -} - -void interfSegmentationMenu::onMirrorPressed(wxCommandEvent& event){ - - interfMainPanel::getInstance()->onMirrorPressed(); - } -void interfSegmentationMenu::onThreshold(wxCommandEvent& event){ - +/*EED Borrame +void interfSegmentationMenu::onThreshold(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onThresholdPressed(); - } - +*/ //------------------------------------------------------------------------------------------------------------ diff --git a/lib/Interface_Icons_NDimensions/interfSegmentationMenu.h b/lib/Interface_Icons_NDimensions/interfSegmentationMenu.h index b8a334a..92d732e 100644 --- a/lib/Interface_Icons_NDimensions/interfSegmentationMenu.h +++ b/lib/Interface_Icons_NDimensions/interfSegmentationMenu.h @@ -22,32 +22,25 @@ public: ** see setEventHandler(wxEventHandler*) **/ - void onSegmentationPressed(wxCommandEvent& event); - - void onSegmentationPressedITK(wxCommandEvent& event); - - void onSnakePressed(wxCommandEvent& event); - - void onMirrorPressed(wxCommandEvent& event); - - void onThreshold(wxCommandEvent& event); + void onSegmentationPressed(wxCommandEvent& event); + void onSegmentationPressedITK(wxCommandEvent& event); + void onSnakePressed(wxCommandEvent& event); +//EED Borrame void onThreshold(wxCommandEvent& event); private: - //wxContourEventHandler* contourevent; + +/*EED Borrame wxPanel* configPanel; - wxWindow* infoWin; - + wxWindow* infoWin; wxPanel* spreadPanel; wxPanel* segmentPanelITK; bool axisshown; wxPanel* getSegmentationPanel(wxWindow* parent); - void onSegmentationOneSlice( wxCommandEvent& event ); - void onSegmentationAllSlice( wxCommandEvent& event ); - +*/ }; diff --git a/lib/Interface_Icons_NDimensions/interfToolsMenu.cxx b/lib/Interface_Icons_NDimensions/interfToolsMenu.cxx index 069bb24..7037eff 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfToolsMenu.cxx @@ -6,13 +6,16 @@ interfToolsMenu::interfToolsMenu(wxWindow * parent, int sizex, int sizey,wxEvtHa { this->datadir = datdir; //contourevent = (wxContourEventHandler*)evtHandler; - //infoWin = NULL; - configPanel = NULL; - segmentPanel = NULL; - spreadPanel = NULL; + //infoWin = NULL; + +/*EED Borrame + configPanel = NULL; + segmentPanel = NULL; + spreadPanel = NULL; segmentPanelITK = NULL; // eventHandler = evtHandler; +*/ initButtons(this); } @@ -30,17 +33,16 @@ void interfToolsMenu::initButtons(wxEvtHandler* evtHandler) { nom.push_back("Select more than one contour and find the contours between them"); funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onSpreadPressed); - path.push_back(datadir + "/pignon.png"); - nom.push_back("Configuration of the window"); - funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onConfigurationPressed); + path.push_back(datadir + "/Mirror.png"); + nom.push_back("Create an Axis and select a contour to mirror it accordingly"); + funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onMirrorPressed); + +//CMRU 17-08-09 ------------------------------------------------------------------ + path.push_back(datadir + "/Letter.PNG"); + nom.push_back("Insert a Label"); + funct.push_back((wxObjectEventFunction)&interfToolsMenu::onPrintLabel); +//------------------------------------------------------------------------------- - path.push_back(datadir + "/info.png"); - nom.push_back("Information of the contours in the scene"); - funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onInformationPressed); - - path.push_back(datadir + "/Help.png"); - nom.push_back("Show help page with information about the tools"); - funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onHelpPressed); this->addButtons(path, nom); this->setVectorFunction(funct); @@ -62,34 +64,23 @@ interfToolsMenu::~interfToolsMenu() ** it uses attribute eventHandler to call the methods define by the application. ** see setEventHandler(wxEventHandler*) **/ -void interfToolsMenu::onRigidPressed(wxCommandEvent& event){ +void interfToolsMenu::onRigidPressed(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onRigidPressed(); } -void interfToolsMenu::onSpreadPressed(wxCommandEvent& event){ - +void interfToolsMenu::onSpreadPressed(wxCommandEvent& event) +{ interfMainPanel::getInstance()->onSpreadPressed(); - - -} - - -void interfToolsMenu::onInformationPressed(wxCommandEvent& event){ - - interfMainPanel::getInstance()->onInformationPressed(); - - } -void interfToolsMenu::onConfigurationPressed(wxCommandEvent& event){ - - interfMainPanel::getInstance()->onConfigurationPressed(); - +void interfToolsMenu::onMirrorPressed(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onMirrorPressed(); } -void interfToolsMenu::onHelpPressed(wxCommandEvent& event){ - - wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/creatools/node/25"), 0); - +void interfToolsMenu::onPrintLabel(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onPrintLabel(); } diff --git a/lib/Interface_Icons_NDimensions/interfToolsMenu.h b/lib/Interface_Icons_NDimensions/interfToolsMenu.h index 86a51ba..54b67aa 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsMenu.h +++ b/lib/Interface_Icons_NDimensions/interfToolsMenu.h @@ -23,24 +23,20 @@ public: ** see setEventHandler(wxEventHandler*) **/ void onRigidPressed(wxCommandEvent& event); - - void onSpreadPressed(wxCommandEvent& event); - - void onInformationPressed(wxCommandEvent& event); - - void onConfigurationPressed(wxCommandEvent& event); - - void onHelpPressed(wxCommandEvent& event); + void onSpreadPressed(wxCommandEvent& event); + void onMirrorPressed(wxCommandEvent& event); + void onPrintLabel(wxCommandEvent& event); private: +/*EED Borrame //wxContourEventHandler* contourevent; wxPanel* configPanel; wxPanel* segmentPanel; wxPanel* spreadPanel; wxPanel* segmentPanelITK; bool axisshown; - +*/ }; diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 83863e8..499121e 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -2908,8 +2908,10 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef // Image Value vtkMetaImageWriter *writerValueImage = vtkMetaImageWriter::New( ); writerValueImage->SetInput( value ); + writerValueImage->SetInput( value ); writerValueImage->SetFileName( (const char *)filename.mb_str() ); writerValueImage->SetFileDimensionality( 3 ); + writerValueImage->SetCompression(false); writerValueImage->Write( ); // Image Mask @@ -2929,6 +2931,7 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef writerMaskImage->SetInput( mask ); writerMaskImage->SetFileName( (const char *)filename.mb_str() ); writerMaskImage->SetFileDimensionality( 3 ); + writerValueImage->SetCompression(false); writerMaskImage->Write( ); interfMainPanel::getInstance()->setStringInfoPanel( _T("") ); @@ -3020,6 +3023,30 @@ wxPanel *wxContourMainFrame::getMaskImageViewPanel(wxWindow *parent) return _viewMaskImagePanel; } + +wxPanel *wxContourMainFrame::getColorLayerImageViewPanel(wxWindow *parent) +{ + if (_viewColorLayerImagePanel==NULL) + { + _viewColorLayerImagePanel = new wxPanel(parent, -1); +/*EED Borrame + double range[2]; + _theViewPanel->getImageData()->GetScalarRange(range); + int min = (int)floor (range[0]); + int max = (int)ceil (range[1]); + _viewColorLayerImagePanel = new ThresholdImageViewPanel( parent, min, max , 1); + _viewThresholdImage = new ThresholdImageView(); + _viewThresholdImage->SetImage( _theViewPanel->getImageData() ); + _viewThresholdImage->SetminMaxValue( min, max); + _viewThresholdImage->SetBaseColor( 1,0,0 ); + _viewThresholdImagePanel->SetThresholdImageView( _viewThresholdImage ); + _viewThresholdImage->SetwxVtkBaseView( _theViewPanel->getWxVtkBaseView() ); +*/ + } + return _viewColorLayerImagePanel; +} + + wxPanel *wxContourMainFrame::getThresholdImageViewPanel(wxWindow *parent) { if (_viewThresholdImagePanel==NULL) diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h index b412f66..4b6ac62 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h @@ -38,6 +38,8 @@ #include "ThresholdImageView.h" #include "ThresholdImageViewPanel.h" +//EED #include "ColorLayerImageView.h" +//EED #include "ColorLayerImageViewPanel.h" //#include "ContourThing.h" @@ -321,6 +323,7 @@ class wxContourMainFrame : public wxPanel { wxPanel *getMaskImageViewPanel(wxWindow *parent); void SetContourGroup(int contourGroup); wxPanel *getThresholdImageViewPanel(wxWindow *parent); + wxPanel *getColorLayerImageViewPanel(wxWindow *parent); //CMRU 17-08-09----------------------------------------------------------------------------------------------- @@ -417,14 +420,18 @@ private: // Contour Image Mask - ThresholdImageView *_viewMaskImage; - ThresholdImageViewPanel *_viewMaskImagePanel; + ThresholdImageView *_viewMaskImage; + ThresholdImageViewPanel *_viewMaskImagePanel; // Threshold Image - ThresholdImageView *_viewThresholdImage; - ThresholdImageViewPanel *_viewThresholdImagePanel; - + ThresholdImageView *_viewThresholdImage; + ThresholdImageViewPanel *_viewThresholdImagePanel; + // Color Layer Image +//EED ColorLayerImageView *_viewColorLayerImage; +//EED ColorLayerImageViewPanel *_viewColorLayerImagePanel; + wxPanel *_viewColorLayerImagePanel; + std::vector _images; bool _actorPresent; diff --git a/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.cxx b/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.cxx index c2301ce..6b2e68b 100644 --- a/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.cxx +++ b/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.cxx @@ -771,7 +771,9 @@ void OutlineModelManager::SaveThingName( FILE *pFile, FILE *pFileData, std::string nameThing ) { std::vector< Instant * > *lstInstants; +printf("EED OutlineModelManager::SaveThingName %s\n",nameThing.c_str() ); lstInstants = outlinesEnvironment->getInstantsOfThing( nameThing ); +printf("EED OutlineModelManager::SaveThingName %d\n", (*lstInstants).size() ); Instant *instant = (*lstInstants)[0]; std::vector *vecInst =instant->getInstant(); int i,sizeVecInst = vecInst->size(); -- 2.47.1