]> Creatis software - creaContours.git/commitdiff
#3216 creaContours Feature New Normal - vtk8itk4wx3-mingw64
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 7 Aug 2018 13:46:37 +0000 (15:46 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 7 Aug 2018 13:46:37 +0000 (15:46 +0200)
23 files changed:
appli/wxContourGUIExample/CMakeLists.txt
appli/wxContourGUIExample/wxContourGUIExample.cxx
bbtk/CMakeLists.txt
bbtk/src/bbCreaContournDimensions.cxx
lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_Icons_NDimensions/interfMenuBar.h
lib/Interface_Icons_NDimensions/interfNewContourMenu.cxx
lib/Interface_Icons_NDimensions/interfSegmentationPanels.cxx
lib/Interface_Icons_NDimensions/interfSegmentationPanels.h
lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
lib/Interface_Icons_NDimensions/interfToolsPanels.h
lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h
lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx
lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.h
lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.h
lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx
lib/kernel_ManagerContour_NDimensions/ParserOsirix/OsirixParser.cxx
lib/kernel_ManagerContour_NDimensions/itkVTKImageToImageFilter.txx

index 5cfc3e06e569d881eaffeb07818d303171e90bc1..8820fed5e03ce051655d3a3096348a8b1f634dd4 100644 (file)
 IF(WIN32)
   #MESSAGE("WIN32")
   ADD_EXECUTABLE(creaContourApp WIN32 wxContourGUIExample.cxx)  
-  SET_TARGET_PROPERTIES(creaContourApp PROPERTIES LINK_FLAGS /subsystem:console )
+
+   IF(MINGW)
+       SET_TARGET_PROPERTIES(creaContourApp PROPERTIES LINK_FLAGS -mconsole )
+  ELSE(MINGW)
+       SET_TARGET_PROPERTIES(creaContourApp PROPERTIES LINK_FLAGS /subsystem:console )
+  ENDIF(MINGW)
+  
 ELSE(WIN32)
   ADD_EXECUTABLE(creaContourApp MACOSX_BUNDLE wxContourGUIExample)
 ENDIF(WIN32)
@@ -52,3 +59,9 @@ TARGET_LINK_LIBRARIES( creaContourApp
                      )
 
 INSTALL_TARGETS(/bin/ creaContourApp )
+
+
+
+
+
+
index 46c896e3b8c4c41e118a0938c7dcf7e8d53bff83..4c3a29628e0ffc4dd425b2c9347a1b60fc8fc8c5 100644 (file)
 #include "wxContourMainFrame.h"
 //#include "OutlineModelManager.h"
 //#include "wxContourEventHandler.h"
-
 //#include <creaImageIOWxGimmickDialog.h>
 //#include <creaImageIOWxGimmickReaderDialog.h>
 #include <creaImageIOWxSimpleDlg.h>
-
 #include <creaImageIOSystem.h>
-
 #include <creaVtkBasicSlicer.h>
 //#include "wxContourMainPanel.h"
-
 #include "vtkMetaImageReader.h"
 #include <map>
 #include "vtkImageData.h"
-
 #include "wx/artprov.h"
 #include <wx/filedlg.h>
 
-
-/* EED EraseMe
-//#include "OutlineModelBuilder.h"
-//#include "ContourThing.h"
-//#include "AxeThing.h"
-//#include "ImageSourceThing.h"
-//#include "ImageSectionThing.h"
-//#include "SomeEnvironment.h"
-//#include "ReaderEnvironment.h"
-
-//#include "interfMainPanel.h"
-
-#if defined(MACOSX) // assume this is OSX
-# include <sys/param.h>
-# include <mach-o/dyld.h> // _NSGetExecutablePath : must add -framework CoreFoundation to link line
-# include <string.h>
-# ifndef PATH_MAX
-#  define PATH_MAX MAXPATHLEN
-# endif
-#endif // MACOSX
-*/
-
 #ifndef PATH_MAX // If not defined yet : do it
 #  define PATH_MAX 2048
 #endif
-
 #if defined(WIN32)
   #include <direct.h>
 #else
    #include <dirent.h>
 #endif
-
 #include <stdlib.h>
 
-
-
 wxContourMainFrame* wxTheApplication::frame = 0;
 
 //----------------------------------------------------------------------------------------------------------------
 // This macro implements the entry point (main function) for the application
 //----------------------------------------------------------------------------------------------------------------
 
-
-
-
-
-
 //=========================================================================
 //=========================================================================
 IMPLEMENT_APP( wxTheApplication );
@@ -115,14 +79,11 @@ void wxAppConsole::OnAssertFailure(char const *,int,char const *,char const *,ch
 }
 #endif
 
-
-
-bool wxTheApplication :: OnInit()
+bool wxTheApplication::OnInit()
 {
        vtkOutputWindowCreaContour *outputWindowCreaContour= vtkOutputWindowCreaContour::New();
        vtkOutputWindow::SetInstance( outputWindowCreaContour );
        outputWindowCreaContour->Delete();
-
        wxString infoImage;
        wxInitAllImageHandlers();
 
@@ -131,7 +92,6 @@ bool wxTheApplication :: OnInit()
 //EED01Juin2010        int output_dim = NATIVE;
 //EED01Juin2010        int threads = 1;
 
-
 //EED 1Juin2010
       creaImageIO::WxSimpleDlg w(0,_T("Select your image"),"creaContours_Descriptor.dscp","creatisContours DB");
       w.ShowModal();
@@ -150,78 +110,33 @@ bool wxTheApplication :: OnInit()
 //                                                                             threads);
 //     w.ShowModal();
 
-
 //JCP
        //std::string datadir(  crea::wx2std(GetExecutablePath()) );
        std::string datadir(  crea::System::GetExecutablePath() );
 //JCP
-
            #ifdef LINUX /* assume this is OSX */
                    datadir=datadir+"/../share/creaContours";
            #endif // MACOSX
-
                #ifdef MACOSX /* assume this is OSX */
                        datadir=datadir+"/../../../../share/creaContours";
                #endif // MACOSX
-
-
                if(w.GetReturnCode() == wxID_OK)
                {
-                               std::vector<std::string> s;
-//EED 01Juin2010                               w.GetSelectedFiles(s);
-
-
-//EED                  std::vector<std::string>::iterator i;
-//                             for (i=s.begin();i!=s.end();++i)
-//                             {
-//                                     std::cout << *i << std::endl;
-//                             }
-//                             std::cout << "$$$$ "<<std::endl;
-                               //w.GetSelectedImages(images);
-
-//EED31mai2010                         w.GetSelectedImages(images,output_dim);
-
-
-//EED 1Juin2010
-//                             std::vector<creaImageIO::OutStrGimmick> out;
-//                             std::vector<std::string> attr;
-////                           attr.push_back("D0028_0010");
-////                           attr.push_back("D0008_0023");
-////                           attr.push_back("D0008_1070");
-//                             w.getSelected(out, attr,true,"");
-////                           std::cout<<out.size()<<std::endl;
-////                           crea::VtkBasicSlicer(out.front().img);
-//                             int size=out.size();
-//                             int ii;
-//                             for (ii=0;ii<size;ii++)
-//                             {
-//                                     images.push_back(out[ii].img);
-//                             }
-
-//EED 1Juin2010
-//                             printf("EED creaContours wxTheApplication :: OnInit  %d\n", w.getImagesSelected().size() );
-                               images    = w.getImagesSelected();
-                               infoImage = w.getInfoImage();
-//                             printf("EED creaContours wxTheApplication :: OnInit  %d\n", images.size() );
-
-               }
-               else if (w.GetReturnCode() == wxID_CANCEL)
+                       std::vector<std::string> s;
+                       images    = w.getImagesSelected();
+                       infoImage = w.getInfoImage();
+               } else if (w.GetReturnCode() == wxID_CANCEL)
                {
-                               vtkMetaImageReader *reader = vtkMetaImageReader::New();
-                               std::string filename= datadir + "/data/hola.mhd";
-                               infoImage=_T("DEFAULT-Image:")+crea::std2wx(filename);
-                               reader->SetFileName( filename.c_str() );
-                               reader->Update();
-                               images.push_back(reader->GetOutput());
-                       }
-                       else
-                       {
-                               return -1;
-                       }
-
-
+                       vtkMetaImageReader *reader = vtkMetaImageReader::New();
+                       std::string filename= datadir + "/data/hola.mhd";
+                       infoImage=_T("DEFAULT-Image:")+crea::std2wx(filename);
+                       reader->SetFileName( filename.c_str() );
+                       reader->Update();
+                       images.push_back(reader->GetOutput());
+               } else {
+                       return -1;
+               }
        wxFrame* frame1 = new wxFrame(NULL, wxID_ANY, wxT("Creatis- ROI Application- Evaluation version,01 Agost 2010 ")+infoImage, wxPoint(400,50), wxSize(800, 600) );
-
        //frame = new wxContourMainFrame( frame1, wxID_ANY, wxString(_T("")), wxPoint(50,50), wxSize(800, 600), images );
        frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(200,50), wxSize(800, 600), images,  wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
        frame1->CreateStatusBar();
@@ -232,9 +147,11 @@ bool wxTheApplication :: OnInit()
 
 #if(WIN32)
 int main(int argc, char* argv[])
-  {
-    return WinMain(::GetModuleHandle(NULL), NULL,
-                  ::GetCommandLine(), SW_SHOWNORMAL);
+  {  
+       char buffer[500];
+       wcstombs(buffer, ::GetCommandLine(), 500);
+    return WinMain(::GetModuleHandle(NULL), NULL, buffer, SW_SHOWNORMAL);
+//    return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
   }
 #else
 #endif
index aa3b7971a3edaf21fc4986710a6f020c4e645c25..172d5214cb78b023f3e32f95fcc21e44e680248c 100644 (file)
@@ -42,7 +42,7 @@ SET(BBTK_PACKAGE_NAME creaContours)
 #===========================================================================
 # PACKAGE AUTHOR
 # !!! NO COMMA ALLOWED !!!
-SET(${BBTK_PACKAGE_NAME}_AUTHOR "InfoTeam CREATIS-LRMN")
+SET(${BBTK_PACKAGE_NAME}_AUTHOR "InfoTeam CREATIS")
 #===========================================================================
 
 #===========================================================================
index 5a02859a7261ca56b4441abaed3cc73b4d2b8b1f..143cd5e471bf1174c66cce88cab4ab1737d5baa0 100644 (file)
@@ -43,14 +43,12 @@ void nDimensions::Process()
        vtkImageData* img = bbGetInputIn();
 
        std::vector<vtkImageData*> selectedimages;
-       if(img!=NULL && currentimg!=img){
-
-               printf("EED nDimensions::Process 02\n");        
+       if(img!=NULL && currentimg!=img)
+       {
                wxContourMainFrame::getInstance()->ShowToolsPanel(true);
                currentimg=img;
                selectedimages.push_back(img);
                wxContourMainFrame::getInstance()->setVectImages(selectedimages);
-               printf("EED nDimensions::Process 03\n");        
        }
 
        if(currentimg != NULL){
index c4a5e58abe4500a562cb70177f3abca411ca20de..32f8294fb85bb165cd83153bf196f8ea7a1d70e1 100644 (file)
@@ -44,8 +44,9 @@ interfImageToolsMenu::interfImageToolsMenu(wxWindow * parent, int sizex, int siz
        initButtons(this);
 }
 
-void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler) {
-
+void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler) 
+{
+printf("EED interfImageToolsMenu::initButtons start\n");
        std::vector<std::string> path, nom;
        std::vector<wxObjectEventFunction> funct;
 
@@ -82,13 +83,10 @@ void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler) {
        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);
-          
-
+printf("EED interfImageToolsMenu::initButtons End\n");
 }
 
 interfImageToolsMenu::~interfImageToolsMenu()
@@ -121,7 +119,9 @@ void  interfSegmentationMenu::onSnakePressed(wxCommandEvent& event)
 
 void  interfImageToolsMenu::onInformationPressed(wxCommandEvent& event)
 {
+printf("EED interfImageToolsMenu::onInformationPressed start\n");
        interfMainPanel::getInstance()->onInformationPressed();
+printf("EED interfImageToolsMenu::onInformationPressed end\n");
 }
 
 void  interfImageToolsMenu::onConfigurationPressed(wxCommandEvent& event)
index d1dd92247c4b9b43bb1287db150bc2a07678445d..293100824fc8faa5a3d5b56397aa861c7e27a4fe 100644 (file)
 #include "interfMainPanel.h"
 
 
-interfMainPanel* interfMainPanel::interfmainpanel=NULL;
-wxFrame* interfMainPanel::_newframe=NULL;
+interfMainPanel        *interfMainPanel::interfmainpanel       = NULL;
+wxFrame                        *interfMainPanel::_newframe                     = NULL;
 
 interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
 : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
 {
-
        PANEL                                   = "New Contour";
        PANEL1                                  = "I/O";
        PANEL2                                  = "Edit";
@@ -62,16 +61,12 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        panelAux = NULL;
 //--------------------------------------------------------------------------------
        splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
-
        splitterwindow->SetMinimumPaneSize( 10 );
        sizey = sizey/8;
-
        wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T("")));
-
-       wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1);
+       wxFlexGridSizer* flexsizer = new wxFlexGridSizer(20,2,1,1);
        toolpanel->SetSizer(flexsizer, true);
        toolpanel->SetAutoLayout( true );
-
        wxButton* b = getButton(toolpanel);
        b->SetClientData(&PANEL);
        wxButton* b1 = getButton(toolpanel);
@@ -87,8 +82,6 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
 //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("")));
        wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
@@ -97,7 +90,6 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        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);
        menubar2 = new interfEditMenu        (mentex2, sizex, sizey, evtHandler, datadir);
@@ -105,7 +97,6 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        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);
        statictext2 = getText(mentex2, PANEL2);
@@ -113,41 +104,31 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        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);
-
        flexsizer->Add(b1, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex1, menubar1,statictext1), wxFIXED_MINSIZE);
-
        flexsizer->Add(b2, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex2, menubar2,statictext2), wxFIXED_MINSIZE);
-
        flexsizer->Add(b3, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex3, menubar3,statictext3), wxFIXED_MINSIZE);
-
        flexsizer->Add(b4, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex4, menubar4,statictext4), wxFIXED_MINSIZE);
-
        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, 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);
 //EED  splitterwindow->SetSashPosition(600);
        splitterwindow->SetSashSize(5);
-       splitterwindow->SplitHorizontally(toolpanel, infoPanel,9*73);
-
+       splitterwindow->SplitHorizontally(toolpanel, infoPanel,8*73);
        Connect(b->GetId(),  wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
        Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
        Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
@@ -155,7 +136,6 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        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();
 }
 
@@ -167,8 +147,8 @@ interfMainPanel::~interfMainPanel(void)
 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler)
 {
        _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT);
-
-       if(interfmainpanel == NULL){
+       if(interfmainpanel == NULL)
+       {
                interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler, datadir);
        }
        _newframe->Show(TRUE);
@@ -177,10 +157,9 @@ interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string data
 
 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler)
 {
-
        _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT );
-
-       if(interfmainpanel == NULL){
+       if(interfmainpanel == NULL)
+       {
                interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler);
        }
        _newframe->Show(TRUE);
@@ -207,19 +186,14 @@ void interfMainPanel :: resetInstance()
 wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler)
 {
        wxPanel* panel = new wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN, wxString(_T("Spread")));
-
        wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2)       ;
        panel->SetSizer(flexsizer, true);
        panel->SetAutoLayout( true );
-
-       interfToolsMenu* menu = new interfToolsMenu(panel, sizex, sizey, evtHandler);
-       toolspread = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
-
+       interfToolsMenu *menu           = new interfToolsMenu(panel, sizex, sizey, evtHandler);
+                                       toolspread      = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
        flexsizer->Add(menu, wxFIXED_MINSIZE);
        flexsizer->Add(toolspread, wxFIXED_MINSIZE);
-
        panel->Layout();
-
        return panel;
 }
 
@@ -307,14 +281,11 @@ wxButton* interfMainPanel::getButton(wxWindow* parent)
 
 wxPanel* interfMainPanel::setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text)
 {
-
        wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2);
        parent->SetSizer(flexsizer, true);
        parent->SetAutoLayout( true );
-
        flexsizer->Add(text, wxFLEX_GROWMODE_ALL);
        flexsizer->Add(panel, wxFLEX_GROWMODE_ALL);
-
        parent->Layout();
        return (wxPanel*)parent;
 }
@@ -326,19 +297,22 @@ void interfMainPanel::showPanel(wxWindow* panel)
 {
        wxContourMainFrame::getInstance()->showAxis(false);
        wxSizer* sizer = infoPanel->GetSizer();
-
-       if(currentWindow != NULL){
+       if(currentWindow != NULL)
+       {
                currentWindow->Hide();
                /// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                sizer->Remove(currentWindow);
-       }
+#else
+               sizer->Detach(currentWindow);
+#endif
+       } // if currentWindow
        sizer->Add(panel);
        currentWindow = panel;
        currentWindow->Show(true);
-
        splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
        splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
-
        infoPanel->Layout();
        infoPanel->Refresh();
        this->Layout();
@@ -352,20 +326,24 @@ void interfMainPanel::hidePanel( )
 {
        wxContourMainFrame::getInstance()->showAxis(false);
        wxSizer* sizer = infoPanel->GetSizer();
-
-       if(currentWindow != NULL){
+       if(currentWindow != NULL)
+       {
                currentWindow->Hide();
                /// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                sizer->Remove(currentWindow);
+#else
+               sizer->Detach(currentWindow);
+#endif
+
        }
        wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
        sizer->Add(emptyPanel);
        currentWindow = emptyPanel;
        currentWindow->Show(true);
-
        splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
        splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
-
        infoPanel->Layout();
        infoPanel->Refresh();
        this->Layout();
@@ -540,26 +518,25 @@ void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString)
 {
     ((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
 }
+
 void interfMainPanel::onSegmentationPressed()
 {
-       if(segmentPanel == NULL){
+       if(segmentPanel == NULL)
+       {
                segmentPanel = new wxPanel(getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                segmentPanel->SetSizer(flexsizer, true);
                segmentPanel->SetAutoLayout(true);
                segmentPanel->SetEventHandler(this);
-
                //wxPanel* panel = contourevent->getSegmentationPanel(segmentPanel);
                segmentationPanel = new interfSegmentationPanelVTK(segmentPanel);
-
-
                wxStaticText* stattext = new wxStaticText(segmentPanel, -1, wxString(_T("   Automatic Segmentation   ")), wxDefaultPosition,
                        wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
 
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(segmentationPanel, wxEXPAND);
                segmentPanel->Layout();
-       }
+       }// if segmentPanel
        showPanel(segmentPanel);
        wxContourMainFrame::getInstance()->showAxis(true);
        axisshown = true;
@@ -567,10 +544,9 @@ void interfMainPanel::onSegmentationPressed()
 
 void interfMainPanel::onSegmentationPressedITK()
 {
-    if(segmentPanelITK == NULL){
+    if(segmentPanelITK == NULL)
+       {
                segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
-
-
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                segmentPanelITK->SetSizer(flexsizer, true);
                segmentPanelITK->SetAutoLayout( true );
@@ -585,7 +561,7 @@ void interfMainPanel::onSegmentationPressedITK()
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panel, wxEXPAND);
                segmentPanelITK->Layout();
-       }
+       }// if segmentPanelITK
        showPanel(segmentPanelITK);
        wxContourMainFrame::getInstance()->showAxis(true);
        axisshown = true;
@@ -622,7 +598,8 @@ void interfMainPanel::onInterpolation(bool interpolate)
 
 void interfMainPanel::onConfigurationPressed()
 {
-       if(configPanel == NULL){
+       if(configPanel == NULL)
+       {
                configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                configPanel->SetSizer(flexsizer, true);
@@ -634,31 +611,27 @@ void interfMainPanel::onConfigurationPressed()
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panel, wxEXPAND);
                configPanel->Layout();
-       }
+       }// if configPanel
        showPanel(configPanel);
 }
 
 void interfMainPanel::onSpreadPressed()
 {
-    if(spreadPanel==NULL){
-
+    if(spreadPanel==NULL)
+       {
                spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                spreadPanel->SetSizer(flexsizer, true);
                spreadPanel->SetAutoLayout( true );
                //spreadPanel->SetEventHandler(this->contourevent);
-
                //wxPanel* panel = contourevent->getSpreadPanel(spreadPanel);
                panelSpread = new interfSpreadPanel(spreadPanel);
-
-
                wxStaticText* stattext = new wxStaticText(spreadPanel, -1, wxString(_T("   Automatic Spread   ")), wxDefaultPosition,
                        wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
-
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panelSpread, wxEXPAND);
                spreadPanel->Layout();
-       }
+       } // spreadPanel
        showPanel(spreadPanel);
        //hideAxis();
 }
@@ -697,39 +670,52 @@ void interfMainPanel::setStringSpread(std::string stringtemp)
 void interfMainPanel::onInformationPressed()
 {
        // Statistics frame
-       if(infoWin ==NULL){
+       if(infoWin ==NULL)
+       {
+printf("EED interfMainPanel::onInformationPressed 0.1\n");
                infoWin                 = new wxFrame (this, -1,_T("  Statistics  "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER  );
+printf("EED interfMainPanel::onInformationPressed 0.2\n");
                infoWin->SetSize( wxSize(825,650) );
 
                wxSize sizepanel(825,675);
+printf("EED interfMainPanel::onInformationPressed 0.3\n");
                informationPanel        = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
+printf("EED interfMainPanel::onInformationPressed 0.3a\n");
 
 // Borrame             wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
                wxFlexGridSizer * sizerPanel            = new wxFlexGridSizer(1);
 
                sizerPanel -> Add( informationPanel, 1, wxEXPAND ,0);
+printf("EED interfMainPanel::onInformationPressed 0.4\n");
 
                infoWin->SetSizer( sizerPanel );
-//             infoWin->SetAutoLayout( true );
+               infoWin->SetAutoLayout( true );
                infoWin->Layout();
+printf("EED interfMainPanel::onInformationPressed 0.43\n");
                infoWin->Show();
        }else {
+printf("EED interfMainPanel::onInformationPressed 0.5\n");
 
                if (infoWin->IsShown()==true)
                {
+printf("EED interfMainPanel::onInformationPressed 0.6\n");
                        infoWin->Show(false);
                } else  {
                        //contourevent->FillGridWithContoursInformation();
+printf("EED interfMainPanel::onInformationPressed 0.7\n");
                        infoWin->Show(true);
                }
        }
 
+printf("EED interfMainPanel::onInformationPressed 1\n");
+
 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
        if(panelAux == NULL)
        {
                panelAux = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
        }
 //------------------------------------------------------------------------------------------------------------
+printf("EED interfMainPanel::onInformationPressed 2\n");
 
        // mask view control panel
        if(infoPanelMask == NULL){
@@ -749,6 +735,7 @@ void interfMainPanel::onInformationPressed()
 
        }
 
+printf("EED interfMainPanel::onInformationPressed 3\n");
 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
        //Calibration panel
        if(infoPanelCalibration == NULL)
@@ -757,7 +744,6 @@ void interfMainPanel::onInformationPressed()
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                infoPanelCalibration->SetSizer(flexsizer, true);
                infoPanelCalibration->SetAutoLayout( true );
-
                wxPanel *panel = new interfCalibrationPanel(infoPanelCalibration);
                wxStaticText* stattext = new wxStaticText(infoPanelCalibration, -1, wxString(_T("              Calibration               ")), wxDefaultPosition,
                                                                                                  wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
@@ -767,20 +753,32 @@ void interfMainPanel::onInformationPressed()
                flexsizer->Add(panel, wxEXPAND);
                infoPanelCalibration->Layout();
        }
+printf("EED interfMainPanel::onInformationPressed 4\n");
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
-       panelAux->SetSizer(sizer, true);
-       panelAux->SetAutoLayout( true );
+#else
+       wxFlexGridSizer* sizer = new wxFlexGridSizer(2);
+#endif
        sizer->Add(infoPanelMask);
+printf("EED interfMainPanel::onInformationPressed 4.1\n");
        sizer->Add(infoPanelCalibration);
-
+printf("EED interfMainPanel::onInformationPressed 4.2\n");
+       panelAux->SetSizer(sizer, true);
+printf("EED interfMainPanel::onInformationPressed 4.3\n");
+       panelAux->SetAutoLayout( true );
+printf("EED interfMainPanel::onInformationPressed 4.4\n");
        showPanel(panelAux);
+printf("EED interfMainPanel::onInformationPressed 4.5\n");
 
 //------------------------------------------------------------------
-
+printf("EED interfMainPanel::onInformationPressed OOJJOOOOOOOOOO......\n");
        wxContourMainFrame::getInstance()->changeInstant();
+printf("EED interfMainPanel::onInformationPressed End\n");
 }
 
+
 void interfMainPanel::getInstantVector(std::vector<int>& tempVector)
 {
        wxContourMainFrame::getInstance()->getInstantVector(tempVector);
@@ -860,27 +858,21 @@ void interfMainPanel::onMirrorPressed(){
                mirrorPanel->SetSizer(flexsizer, true);
                mirrorPanel->SetAutoLayout( true );
                panelMirror = new interfMirrorPanel(mirrorPanel);
-
                wxStaticText* stattext = new wxStaticText(mirrorPanel, -1, wxString(_T("   Mirroring Tool   ")), wxDefaultPosition,
                        wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
 
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panelMirror, wxEXPAND);
                mirrorPanel->Layout();
-
                refLineShown=true;
                wxContourMainFrame::getInstance()->referenceLine();
-       }
-
-       else
-       {
-
+       } else {
                if (!refLineShown)
                {
                        wxContourMainFrame::getInstance()->refLineShow();
                        refLineShown=true;
                }
-       }
+       } // if mirrorPanel
 
        showPanel(mirrorPanel);
 }
index 7ce218c3ce6c4fb58b0afeb595544d1e298dbcaa..d3b054e5c13aea7218f3cbe4bead8e382dc3a009 100644 (file)
@@ -69,12 +69,12 @@ public:
                //RaC 11-09
                //This constructor function as well but it is neccessary to change vpath.size() by 6
                //flexsizer = new wxFlexGridSizer(2,vpath.size(),2,2);
-               flexsizer = new wxFlexGridSizer(6);
+               flexsizer = new wxFlexGridSizer(5);
                this->SetSizer(flexsizer, true);
                this->SetAutoLayout( true );
-               
                //first row of the sizer, the buttons are being added
-               for(int i = 0; i < (int)(vpath.size());i++){
+               for(int i = 0; i < (int)(vpath.size());i++)
+               {
                        std::string p = vpath[i];
                        wxBitmapButton* bitmapbutton = this->getButton(p, sizex, sizey);
                        flexsizer->Add(bitmapbutton,wxFIXED_MINSIZE);
@@ -82,7 +82,8 @@ public:
                }
                //second row of the sizer, the names are being added
                
-               for(int i = 0; i < (int)(vnom.size()); i++){
+               for(int i = 0; i < (int)(vnom.size()); i++)
+               {
                        //sizex = vectbutton[i]->GetSize().GetWidth();
                        std::string n = vnom[i];
                        vectbutton[i]->SetToolTip(wxString(n.c_str(),wxConvUTF8));
@@ -99,10 +100,9 @@ public:
        ** @param int y indicates the y coordinate where the button should be located
        **/
 
-       virtual wxBitmapButton* getButton(std::string imgpath, int sizex, int sizey){
-               vectimgpath.push_back(imgpath);
-                               
-               
+       virtual wxBitmapButton* getButton(std::string imgpath, int sizex, int sizey)
+       {
+               vectimgpath.push_back(imgpath);                         
                wxBitmap* bitmap = new wxBitmap(wxString(imgpath.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
 
                //wxSize(sizex,sizey)
@@ -120,7 +120,8 @@ public:
        **      @param int sizex   size of the text
        **      @param int sizey   size of the text
        **/
-       virtual wxStaticText* getText(std::string nom, int sizex, int sizey){
+       virtual wxStaticText* getText(std::string nom, int sizex, int sizey)
+       {
                vectnom.push_back(nom);
                return new wxStaticText(this, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition, 
                                                                wxSize(sizex,sizey), wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
@@ -130,8 +131,10 @@ public:
        **      they must be ordered in the same way as the vector that contains the image path
        **      and name of the button. See addButton(<vect>, <vect>)
        **/
-       virtual void setVectorFunction(std::vector<wxObjectEventFunction> vectf){
-               for(int i = 0; i < (int)(vectf.size());i++){
+       virtual void setVectorFunction(std::vector<wxObjectEventFunction> vectf)
+       {
+               for(int i = 0; i < (int)(vectf.size());i++)
+               {
                        vectfunct.push_back(vectf[i]);
                }               
        }
index f4435ce878cda33db90a1141b31cca2e7308ffb2..6ac78ab5ffebdf7bce90a06b2cc07a7d6b603136 100644 (file)
@@ -31,77 +31,61 @@ interfNewContourMenu::interfNewContourMenu(wxWindow * parent, int sizex, int siz
 {
        this->datadir = datdir;
        //eventHandler = (wxContourEventHandler*)evtHandler;
-
        panBull = NULL;
        created = false;
-
        initButtons(this);      
 }
 
-void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler) {
-
+void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler) 
+{
        std::vector<std::string> path, nom;
        std::vector<wxObjectEventFunction> funct;
-       std::vector<wxEvtHandler*> hand;
-       
+       std::vector<wxEvtHandler*> hand;        
        path.push_back(datadir + "/Spline.png");
        nom.push_back("Create a contour using splines");        
        funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourSpline);
        hand.push_back(evtHandler);
-
        path.push_back(datadir+"/Rectangle.png");
        nom.push_back("Create a contour using the basic shape of a rectangle");
        funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourRectangle);
        hand.push_back(evtHandler);
-
        path.push_back(datadir + "/Circle.png");
        nom.push_back("Create a contour using the basic shape of a Circle");
        funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourCircle);
        hand.push_back(evtHandler);
-
        path.push_back(datadir + "/bullseye.png");
        nom.push_back("Create a contour using the bulls eye");
        funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourBullseye);
        hand.push_back(this);
-
        path.push_back(datadir + "/Line.png");
        nom.push_back("Create a Line");
        funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
        hand.push_back(this);
-
        // RaC 09-09 ---------------------
        path.push_back(datadir + "/Points.png");
        nom.push_back("Create Points");
        funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPoints);
        hand.push_back(this);
        // RaC 09-09 ---------------------      
-
        // RaC 10-09 ---------------------
        path.push_back(datadir + "/Polygon.png");
        nom.push_back("Create Polygon");
        funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPolygon);
        hand.push_back(this);
        // RaC 10-09 ---------------------      
-
     this->addButtons(path, nom);
-
        this->setVectorFunction(funct); 
        this->setEventHandlers(hand);   
        this->connectEvents();
-
 }
 
-
-
 interfNewContourMenu::~interfNewContourMenu()
 {
 }
 
-void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event){
-
-
+void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event)
+{
        if(!created){
-
                panBull = new PanelBullEyeOptions(interfMainPanel::getInstance()->getInfoPanel(), 
                                                                wxSize(100,200));
                created = true;
@@ -109,30 +93,38 @@ void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event){
        interfMainPanel::getInstance()->onCreateContoursBullEye(panBull);
        //eventHandler->createContourBullsEye(panBull);
        interfMainPanel::getInstance()->showPanel(panBull);
-
 }
 
-void interfNewContourMenu::onCreateContourSpline( wxCommandEvent& event ){
+void interfNewContourMenu::onCreateContourSpline( wxCommandEvent& event )
+{
        interfMainPanel::getInstance()->onCreateContourSpline();
 }
-void interfNewContourMenu::onCreateContourRectangle( wxCommandEvent& event ){
+
+void interfNewContourMenu::onCreateContourRectangle( wxCommandEvent& event )
+{
        interfMainPanel::getInstance()->onCreateContourRectangle();
 }
-void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event ){
+
+void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event )
+{
        interfMainPanel::getInstance()->onCreateContourCircle();
 }
-void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event ){
+
+void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event )
+{
        interfMainPanel::getInstance()->onCreateContourLine();
 }
 
 // RaC 09-09 ---------------------
-void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event ){
+void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event )
+{
        interfMainPanel::getInstance()->onCreateContourPoints();
 }
 // RaC 09-09 ---------------------
 
 // RaC 10-09 ---------------------
-void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event ){
+void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event )
+{
        interfMainPanel::getInstance()->onCreateContourPolygon();
 }
 // RaC 10-09 ---------------------
index e7bb971e5ca0a122979b7f46e89fd189a6127648..46fb279043e0fdc75f50db7f168d8eabe252f071 100644 (file)
@@ -30,17 +30,15 @@ interfSegmentationPanelVTK::interfSegmentationPanelVTK(wxWindow * parent)
 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
 {
        int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
-
        double range[2];
        interfMainPanel::getInstance()->getImageRange(range);
-
        int min = (int)floor (range[0]);
        int max = (int)ceil (range[1]);
 
        wxButton *segmentationOneSliceBtn   = new wxButton(this,-1,_T("Current slice"), wxDefaultPosition, wxSize(200,35) );
        wxButton *segmentationAllSliceBtn   = new wxButton(this,-1,_T("All slices") ,wxDefaultPosition, wxSize(200,35) );
-       _isovalue                           = new wxSlider(this, -1, 40 , min, max, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
-       _sampling                           = new wxSlider(this, -1, 20 , 4, 50, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+       _isovalue                           = new wxSlider(this, -1, 40 , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+       _sampling                           = new wxSlider(this, -1, 20 , 4, 50, wxDefaultPosition,  wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
        wxString lstOptions[3];
        lstOptions[0]=_T("A");
        lstOptions[1]=_T("B");
@@ -48,11 +46,9 @@ interfSegmentationPanelVTK::interfSegmentationPanelVTK(wxWindow * parent)
        methodRadiobox                      = new wxRadioBox(this, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxSize(200,45), 3 , lstOptions,  3, wxRA_SPECIFY_COLS);
        methodRadiobox->SetSelection(2);
        _staticTextSegmentation             = new wxStaticText(this,-1,_T("    "));
-
        _mbarrange                          = new mBarRange(this,70, 65);
        _mbarrange->SetMin(0);
        _mbarrange->SetStart(0);
-
        _mbarrange->SetOrientation( true );
        _mbarrange->setActiveStateTo(true);
        _mbarrange->setVisibleLabels( true );
@@ -62,8 +58,7 @@ interfSegmentationPanelVTK::interfSegmentationPanelVTK(wxWindow * parent)
        _mbarrange->setIfWithActualDrawed( false );
        _mbarrange->SetStart( 0 );
        _mbarrange->SetEnd( sizeZ );  
-
-       wxFlexGridSizer * sizer             = new wxFlexGridSizer(1);
+       wxFlexGridSizer * sizer             = new wxFlexGridSizer(20,1,0,0);
        sizer->Add( new wxStaticText(this, -1, _T("Isovalue (Gray level)")), 1, wxGROW );
        sizer->Add( _isovalue, 1, wxGROW );
        sizer->Add( methodRadiobox , 1, wxGROW );
@@ -74,13 +69,9 @@ interfSegmentationPanelVTK::interfSegmentationPanelVTK(wxWindow * parent)
        sizer->Add( _staticTextSegmentation, 1, wxGROW );
        sizer->Add( segmentationAllSliceBtn, 1, wxGROW );
        sizer->Add( _mbarrange, 1, wxGROW );
-
        this->SetSizer( sizer );
-//             panel->SetSize( sizePanel );
-       this->SetSize( wxDefaultSize );
        this->SetAutoLayout( true );
        this->Layout();
-       
 //_segmentationFrame->SetEventHandler( this );
        //segmentationOneSliceBtn->SetEventHandler( this );
        //segmentationAllSliceBtn->SetEventHandler( this );
@@ -89,7 +80,6 @@ interfSegmentationPanelVTK::interfSegmentationPanelVTK(wxWindow * parent)
        Connect( segmentationAllSliceBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) &interfSegmentationPanelVTK::onSegmentationAllSlice); 
 }
 
-
 interfSegmentationPanelVTK::~interfSegmentationPanelVTK()
 {
 }
@@ -108,9 +98,7 @@ void  interfSegmentationPanelVTK::onSegmentationPressedITK(wxCommandEvent& event
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);    
                segmentPanelITK->SetSizer(flexsizer, true);
                segmentPanelITK->SetAutoLayout( true ); 
-                               
                wxPanel* panel = new wxPanel(this, -1);//contourevent->getSegmentationPanelITK(segmentPanelITK);
-       
                wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T("   Automatic ITK Segmentation   ")), wxDefaultPosition,
                        wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
 
@@ -129,23 +117,23 @@ void interfSegmentationPanelVTK::onSegmentationOneSlice( wxCommandEvent& event )
        int sampling = _sampling->GetValue();
        int method = methodRadiobox->GetSelection();
        interfMainPanel::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
-       
 }
+
 void interfSegmentationPanelVTK::onSegmentationAllSlice( wxCommandEvent& event )
 {
        int minZ=_mbarrange->GetStart();
        int maxZ=_mbarrange->GetEnd();
-
        int isovalue = _isovalue->GetValue();
        int sampling = _sampling->GetValue();
        int method   = methodRadiobox->GetSelection();
-
        interfMainPanel::getInstance()->onSegmentationAllSlice(minZ, maxZ, isovalue, sampling, method); 
 }
 
-void interfSegmentationPanelVTK::setLabel(wxString tmpString){
+void interfSegmentationPanelVTK::setLabel(wxString tmpString)
+{
        _staticTextSegmentation->SetLabel(tmpString);
 }
+
 /**
 ** start of new implementation
 **     interfSegmentationPanelITK
@@ -155,10 +143,8 @@ interfSegmentationPanelITK::interfSegmentationPanelITK(wxWindow * parent)
 {
        double range[2];
        interfMainPanel::getInstance()->getImageRange(range);
-
 //     int min = (int)floor (range[0]);
 //     int max = (int)ceil (range[1]);
-       
        //The labels
        //wxStaticText * distance =    
        new wxStaticText(this, wxID_ANY, wxT("Initial Distance"),   wxPoint(5, 5));
@@ -174,9 +160,7 @@ interfSegmentationPanelITK::interfSegmentationPanelITK(wxWindow * parent)
        new wxStaticText(this, wxID_ANY, wxT("Iterations"),         wxPoint(5, 130));
        //wxStaticText * infStrength = 
        new wxStaticText(this, wxID_ANY, wxT("Inflation Strength"), wxPoint(5, 155));
-
        //Text Controls
-
        _distance =      new wxTextCtrl(this, wxID_ANY, wxT("5.0"),  wxPoint(98,5),   wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
        _sigma =         new wxTextCtrl(this, wxID_ANY, wxT("1.2"),  wxPoint(98,30),  wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
        _alfa =          new wxTextCtrl(this, wxID_ANY, wxT("-1.0"), wxPoint(98,55),  wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);        
@@ -184,46 +168,37 @@ interfSegmentationPanelITK::interfSegmentationPanelITK(wxWindow * parent)
        _propagation =   new wxTextCtrl(this, wxID_ANY, wxT("6.0"),  wxPoint(98,105), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);        
        _iterations =    new wxTextCtrl(this, wxID_ANY, wxT("800"),  wxPoint(98,130), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);        
        _infStrength =   new wxTextCtrl(this, wxID_ANY, wxT("3.0"),  wxPoint(98,155), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
-       
        //El boton
        //wxButton * bot = 
        new wxButton(this, 6, wxT("One Slice"), wxPoint(98, 180), wxSize(70, 25), 0, wxDefaultValidator, wxT("button"));
-
        //Conexion del boton con su respectivo manejador
        Connect(6, wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &interfSegmentationPanelITK::onSegmentationOneSlice);
-       
-       
 }
-interfSegmentationPanelITK::~interfSegmentationPanelITK(){
 
+interfSegmentationPanelITK::~interfSegmentationPanelITK()
+{
 }
 
 void interfSegmentationPanelITK::onSegmentationOneSlice( wxCommandEvent& event )
 {
-       wxString distanc=_distance->GetValue();
-       wxString sigm=_sigma->GetValue();
-       wxString alf=_alfa->GetValue();
-       wxString bet=_beta->GetValue();
-       wxString prop=_propagation->GetValue();
-       wxString iter=_iterations->GetValue();
-       wxString infS=_infStrength->GetValue();
-       
+       wxString distanc        = _distance->GetValue();
+       wxString sigm           = _sigma->GetValue();
+       wxString alf            = _alfa->GetValue();
+       wxString bet            = _beta->GetValue();
+       wxString prop           = _propagation->GetValue();
+       wxString iter           = _iterations->GetValue();
+       wxString infS           = _infStrength->GetValue();     
        interfMainPanel::getInstance()->onSegmentationOneSliceITK(distanc, sigm, alf, bet, prop, iter, infS);
-       
 }
+
 void interfSegmentationPanelITK::onSegmentationAllSlice( wxCommandEvent& event )
 {
-
        /*int minZ=_mbarrange->GetStart();
        int maxZ=_mbarrange->GetEnd();
-
        int                             isovalue        = _isovalue->GetValue();
        int                             sampling        = _sampling->GetValue();
        int method = methodRadiobox->GetSelection();
-
-
        interfMainPanel::getInstance()->onSegmentationAllSlice(minZ, maxZ, isovalue, sampling, method);*/
-       
 }
 
 //------------------------------------------------------------------------------------------------------------
@@ -237,39 +212,33 @@ interfMirrorPanel::interfMirrorPanel(wxWindow* parent)
 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
 {
        _axisStatus = true;
-
        wxButton *axisShowBtn = new wxButton(this,wxID_ANY,_T("Show/Hide Axis"), wxDefaultPosition, wxSize(200,35) );
        wxButton *mirrorGoBtn = new wxButton(this,wxID_ANY,_T("Mirror Contour"), wxDefaultPosition, wxSize(200,35) );
        _thickness = new wxSlider(this, -1, 4, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
-       
        Connect( axisShowBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onAxisShow );
        Connect( mirrorGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onMirrorGo ); 
-
-       wxFlexGridSizer * sizer         = new wxFlexGridSizer(1);
+       wxFlexGridSizer * sizer         = new wxFlexGridSizer(20,1,0,0);
        sizer -> Add( axisShowBtn, 1, wxGROW );
        sizer -> Add( new wxStaticText(this,-1,_T(" "))  , 1, wxGROW );
        sizer -> Add( new wxStaticText(this,-1,_T("Thickness"))  , 1, wxGROW );
        sizer -> Add( _thickness, 1, wxGROW );
        sizer -> Add( mirrorGoBtn, 1, wxGROW );
-
        this->SetSizer( sizer );
        this->SetAutoLayout( true );
        this->Layout();
 }
 
-interfMirrorPanel::~interfMirrorPanel(){
+interfMirrorPanel::~interfMirrorPanel()
+{
 }
 
 void interfMirrorPanel::onAxisShow(wxCommandEvent& event)
 {
-       
        if (!_axisStatus)
        {
                interfMainPanel::getInstance()->onMirrorAxisShow();
                _axisStatus=true;
-       }
-       else
-       {       
+       } else {        
                interfMainPanel::getInstance()->onMirrorAxisHide();
                _axisStatus=false;              
        }
@@ -301,15 +270,12 @@ interfTestPanel::interfTestPanel(wxWindow* parent)
 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
 {
        wxButton *button1 = new wxButton(this,wxID_ANY,_T("Button 1"), wxDefaultPosition, wxSize(200,35) );
-       wxButton *button2 = new wxButton(this,wxID_ANY,_T("Button 2"), wxDefaultPosition, wxSize(200,35) );
-       
+       wxButton *button2 = new wxButton(this,wxID_ANY,_T("Button 2"), wxDefaultPosition, wxSize(200,35) );     
        Connect( button1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfTestPanel::onButton1Pressed );
        Connect( button2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfTestPanel::onButton2Pressed ); 
-       
-       wxFlexGridSizer * sizer         = new wxFlexGridSizer(1);
+       wxFlexGridSizer * sizer         = new wxFlexGridSizer(20);
        sizer -> Add( button1, 1, wxGROW );
        sizer -> Add( button2, 1, wxGROW );
-
        this->SetSizer( sizer );
        this->SetAutoLayout( true );
        this->Layout();
index 3f4550550c8d9fc4288bf420e6da82f26902c794..c1a446882e4fec8929fa33041bdc753eaf8b45ae 100644 (file)
@@ -43,40 +43,27 @@ public:
        **      it uses attribute eventHandler to call the methods define by the application.
        **      see setEventHandler(wxEventHandler*)
        **/
-       
-       void  onSegmentationPressed(wxCommandEvent& event);
-
-       void  onSegmentationPressedITK(wxCommandEvent& event);
-
+       void onSegmentationPressed(wxCommandEvent& event);
+       void onSegmentationPressedITK(wxCommandEvent& event);
        void setLabel(wxString tmpString);
-
 private:
-
        //wxContourEventHandler* contourevent;
-       wxPanel* configPanel;
-       wxWindow* infoWin;
-       wxPanel* segmentPanel;
-       wxPanel* spreadPanel;
-       wxPanel* segmentPanelITK;
-       bool axisshown;
-
-       void hideAxis();
-
-       wxPanel* getSegmentationPanel(wxWindow* parent);
-
-       void onSegmentationOneSlice( wxCommandEvent& event );
-
-       void onSegmentationAllSlice( wxCommandEvent& event );
-
-       wxSlider* _isovalue;
-
-       mBarRange* _mbarrange;
-       
-       wxSlider* _sampling;
-
-       wxStaticText* _staticTextSegmentation;
-
-       wxRadioBox* methodRadiobox;
+       wxPanel         *configPanel;
+       wxWindow        *infoWin;
+       wxPanel         *segmentPanel;
+       wxPanel         *spreadPanel;
+       wxPanel         *segmentPanelITK;
+       bool            axisshown;
+       void            hideAxis();
+       wxSlider        *_isovalue;
+       mBarRange       *_mbarrange;
+       wxSlider        *_sampling;
+       wxStaticText*_staticTextSegmentation;
+       wxRadioBox      *methodRadiobox;
+
+       wxPanel*        getSegmentationPanel(wxWindow* parent);
+       void            onSegmentationOneSlice( wxCommandEvent& event );
+       void            onSegmentationAllSlice( wxCommandEvent& event );
 };
 
 class interfSegmentationPanelITK
@@ -85,14 +72,9 @@ class interfSegmentationPanelITK
 public:
        interfSegmentationPanelITK(wxWindow * parent);          
        ~interfSegmentationPanelITK();
-
-
        void onSegmentationOneSlice( wxCommandEvent& event );
-
        void onSegmentationAllSlice( wxCommandEvent& event );
-       
 private:
-
        wxTextCtrl * _distance;
        wxTextCtrl * _sigma;
        wxTextCtrl * _alfa;
@@ -109,19 +91,12 @@ class interfMirrorPanel
 public:
        interfMirrorPanel(wxWindow * parent);           
        ~interfMirrorPanel();
-
 private:
-
        wxSlider* _thickness;
-
        bool _axisStatus;
-
        void onAxisShow(wxCommandEvent& event);
-
        void onMirrorGo(wxCommandEvent& event);
-
        void onChangeWidth(wxScrollEvent& event);
-
        DECLARE_EVENT_TABLE()
 };
 
index 32284ec4b05e0528c3df47c9b400992f9386df50..263d4e7078c0bc46d438b0c3ee2fc13a7252e1e5 100644 (file)
@@ -194,7 +194,15 @@ void interfSpreadPanel::appendStringSpread(std::string val){
        /* // if */
        wxString newstring;
        //newstring.Printf("%s %d -",_wxtextctrlSpread->GetValue(), actualSlice );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        newstring.append(wxString(_wxtextctrlSpread->GetValue(),wxConvUTF8));
+#else
+       newstring.append( _wxtextctrlSpread->GetValue() );
+#endif
+
+
        newstring.append(wxString(" ",wxConvUTF8));
        newstring.append(wxString(val.c_str(),wxConvUTF8));
        _wxtextctrlSpread->SetValue(newstring);
@@ -215,6 +223,7 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
 //: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
 : wxPanel(parent, -1)
 {
+printf("EED interfInformationPanel::interfInformationPanel Start\n");
        //wxPanel *panel                                                                        = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
        wxString lstOptions[4];
        lstOptions[0]=_T("Current Slice");
@@ -222,7 +231,6 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
 //     lstOptions[2]=_T("All Slices");
        _informationRadiobox     = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions,  2, wxRA_SPECIFY_COLS);
 
-
        wxString lstOptContOperation[5];
        lstOptContOperation[0]=_T("AND");
        lstOptContOperation[1]=_T("OR");
@@ -232,53 +240,73 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        _radiolstboxContourGroup->SetSelection(1);
        Connect( _radiolstboxContourGroup->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &interfInformationPanel::onContourGroup );
 
+printf("EED interfInformationPanel::interfInformationPanel 1\n");
 
-       _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") );
-       _XYZValues->SetValue(true);
 
-       _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
+       _XYZValues      = new wxCheckBox(this, -1, _T("Save Contour Values") );
+       _XYZValues->SetValue(true);
+       _contourImage   = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
        _contourImage->SetValue(true);
-
-       _statistics = new wxCheckBox(this, -1, _T("Save Statistics") );
+       _statistics     = new wxCheckBox(this, -1, _T("Save Statistics") );
        _statistics->SetValue(true);
 
+
        wxButton *informationContourLabelsBtn           = new wxButton(this,-1,_T("Contour labels"),wxDefaultPosition, wxSize(140,35) );
+#if wxMAJOR_VERSION <= 2
        informationContourLabelsBtn->SetEventHandler( this );
+#else
+       //      informationContourLabelsBtn->SetEventHandler( this );
+       printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo informationContourLabelsBtn->SetEventHandler \n");
+#endif
        Connect( informationContourLabelsBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels );
 
        wxButton *statisticsContourBtn                  = new wxButton(this,-1,_T("Contour statistics"),wxDefaultPosition, wxSize(140,35) );
+#if wxMAJOR_VERSION <= 2
        statisticsContourBtn->SetEventHandler( this );
+#else
+       //statisticsContourBtn->SetEventHandler( this );
+       printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo statisticsContourBtn->SetEventHandler \n");
+#endif
        Connect( statisticsContourBtn->GetId(),         wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation );
 
        wxButton *showResultImagesBtn                   = new wxButton(this,-1,_T("Show result images"),wxDefaultPosition, wxSize(140,35) );
+#if wxMAJOR_VERSION <= 2
        showResultImagesBtn->SetEventHandler( this );
+#else
+       //showResultImagesBtn->SetEventHandler( this );
+       printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo showResultImagesBtn->SetEventHandler \n");
+#endif
        Connect( showResultImagesBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages );
 
-
        wxButton *saveResultsBtn                        = new wxButton(this,-1,_T("Save Results"),wxDefaultPosition, wxSize(140,35) );
+#if wxMAJOR_VERSION <= 2
        saveResultsBtn->SetEventHandler( this );
-       Connect( saveResultsBtn->GetId(),               wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
+#else
+//EED  saveResultsBtn->SetEventHandler( this );
+printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo saveResultsBtn->SetEventHandler \n");
+#endif
 
+       Connect( saveResultsBtn->GetId(),               wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
 
        int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
+
        //_theViewPanel->getSceneManager()->GetImageDataSizeZ();
        _mbarrangeSliceInformation                      =  new mBarRange(this,65,65);
        _mbarrangeSliceInformation->SetMin(0);
        _mbarrangeSliceInformation->SetStart(0);
-       _mbarrangeSliceInformation-> SetOrientation( true );
-       _mbarrangeSliceInformation-> setActiveStateTo(true);
-       _mbarrangeSliceInformation-> setVisibleLabels( true );
-       _mbarrangeSliceInformation-> setDeviceEndMargin(10);
-       _mbarrangeSliceInformation-> setRepresentedValues( 0 , sizeZ-1 );
-       _mbarrangeSliceInformation-> setDeviceBlitStart(10,10);
-       _mbarrangeSliceInformation-> setIfWithActualDrawed( false );
-       _mbarrangeSliceInformation-> SetStart( 0 );
-       _mbarrangeSliceInformation-> SetEnd( sizeZ-1 );
-
-
+       _mbarrangeSliceInformation->SetOrientation( true );
+       _mbarrangeSliceInformation->setActiveStateTo(true);
+       _mbarrangeSliceInformation->setVisibleLabels( true );
+       _mbarrangeSliceInformation->setDeviceEndMargin(10);
+       _mbarrangeSliceInformation->setRepresentedValues( 0 , sizeZ-1 );
+       _mbarrangeSliceInformation->setDeviceBlitStart(10,10);
+       _mbarrangeSliceInformation->setIfWithActualDrawed( false );
+       _mbarrangeSliceInformation->SetStart( 0 );
+       _mbarrangeSliceInformation->SetEnd( sizeZ-1 );
 
        double range[2];
        interfMainPanel::getInstance()->getImageRange(range);
+printf("EED interfInformationPanel::interfInformationPanel 2\n");
 
        int min = (int)floor (range[0]);
        int max = (int)ceil (range[1]);
@@ -305,61 +333,89 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
 
 
+printf("EED interfInformationPanel::interfInformationPanel 3\n");
        _staticTextInformation  = new wxStaticText(this,-1,_T("    "));
-
        _grid = new wxGrid( this,
                 wxID_ANY,
                 wxPoint( 0, 0 ),
                 wxSize( 200, 250 ) );
-
        int i,gridCol=10,gridRow=sizeZ+2;
        _grid->CreateGrid( 0, 0 );
        _grid->AppendRows(gridRow);
        _grid->AppendCols(gridCol);
-
        for (i=0;i<gridRow;i++)
        {
                _grid->SetRowLabelValue(i, _T(" ") );
        }
 //                     _grid->SetColLabelSize(0);
-
-
        FillGridWithContoursInformation();
 
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizerSave             = new wxFlexGridSizer(2,2);
+#else
+       wxFlexGridSizer * sizerSave             = new wxFlexGridSizer(2,2,0,0);
+#endif
        sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: "))  , 1, wxGROW );
        sizerSave->Add( _XYZValues,    1, wxALL, 2 );
        sizerSave->Add( _statistics,   1, wxALL, 2 );
        sizerSave->Add( _contourImage, 1, wxALL, 2 );
 
+
+printf("EED interfInformationPanel::interfInformationPanel 4\n");
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizerA                = new wxFlexGridSizer(10);
+#else
+       wxFlexGridSizer * sizerA                = new wxFlexGridSizer(1,10,0,0);
+#endif
        sizerA->Add( _informationRadiobox,     1, wxALL, 2 );
        sizerA->Add( _radiolstboxContourGroup, 1, wxALL, 2 );
        sizerA->Add( sizerSave,                1, wxALL, 2 );
 
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizerB                = new wxFlexGridSizer(10);
+#else
+       wxFlexGridSizer * sizerB                = new wxFlexGridSizer(1,4,0,0);
+#endif
        sizerB->Add( informationContourLabelsBtn, 1, wxALL, 2 );
        sizerB->Add( statisticsContourBtn,        1, wxALL, 2 );
        sizerB->Add( showResultImagesBtn,         1, wxALL, 2 );
        sizerB->Add( saveResultsBtn,              1, wxALL, 2 );
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizer         = new wxFlexGridSizer(1,8);
+#else
+       wxFlexGridSizer * sizer         = new wxFlexGridSizer(20,1,0,0);
+#endif
+printf("EED interfInformationPanel::interfInformationPanel 5\n");
        sizer->Add( sizerA                     , 1, wxALL               , 0 );
-       sizer->Add( new wxStaticText(this      ,-1,_T("Slice Range"))   , 1, wxALL , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.1\n");
+       sizer->Add( new wxStaticText(this      ,1,_T("Slice Range"))    , 1, wxALL , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.2\n");
        sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW        , 2 );
-       sizer->Add( new wxStaticText(this      ,-1,_T("Gray Range"))    , 1, wxALL , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.3\n");
+       sizer->Add( new wxStaticText(this      ,1,_T("Gray Range"))     , 1, wxALL , 0 );
+printf("EED interfInformationPanel::interfInformationPanel 5.4\n");
        sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW        , 2 );
-       sizer->Add( sizerB                     , 1, wxALL|wxGROW                , 0 );
-       sizer->Add( _staticTextInformation     , 1, wxALL|wxGROW                , 0 );
+       
+       
+       sizer->Add( sizerB                     , 1, wxEXPAND            , 0 );
+       sizer->Add( _staticTextInformation     , 1, wxEXPAND            , 0 );
        sizer->Add( _grid                      , 1, wxEXPAND            , 0 );
-
        this->SetSizer( sizer );
-//     this->SetSize( wxSize(1500,1500) );
-//  this->SetBackgroundColour( wxColour(100,100,100) );
+       this->SetSize( wxSize(1500,1500) );
        this->SetAutoLayout( true );
+printf("EED interfInformationPanel::interfInformationPanel 5.10\n");
        this->Layout();
        //return panel;
+
+printf("EED interfInformationPanel::interfInformationPanel End\n");
+
 }
 
 interfInformationPanel::~interfInformationPanel()
@@ -409,7 +465,12 @@ void interfInformationPanel::onExtractInformation(wxCommandEvent& event){
 
 void interfInformationPanel::onSaveResults(wxCommandEvent& event)
 {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxSAVE );
+#else
+       wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxFD_SAVE );
+#endif
        if (dialog.ShowModal() == wxID_OK)
        {
                onExtractInformation( event );
index 23d20119948c876ee7d374f7b375164bbbf6f269..6279a6bd6442211753e7d212a4303dccdc1e87d9 100644 (file)
@@ -86,7 +86,6 @@ class interfInformationPanel
 public:
        interfInformationPanel(wxWindow * parent);
        ~interfInformationPanel();
-
     void setStringInfoPanel(wxString tmpString);
        void setRowLabelInfoPanel(int z,wxString tempString);
        void appendCols(int numcols);
@@ -95,17 +94,15 @@ public:
        void setColLabel(int tmpIntB,wxString tmpTitleString);
        wxString getCellValue(int j,int i);
 private:
-
-       mBarRange* _mbarrangeRangeInformation;
-       mBarRange* _mbarrangeSliceInformation;
-       wxGrid* _grid;
-       wxRadioBox* _informationRadiobox;
-       wxRadioBox* _radiolstboxContourGroup;
-       wxStaticText* _staticTextInformation;
-       wxCheckBox* _XYZValues;
-       wxCheckBox* _contourImage;
-       wxCheckBox* _statistics;
-
+       mBarRange*              _mbarrangeRangeInformation;
+       mBarRange*              _mbarrangeSliceInformation;
+       wxGrid*                 _grid;
+       wxRadioBox*     _informationRadiobox;
+       wxRadioBox*     _radiolstboxContourGroup;
+       wxStaticText*   _staticTextInformation;
+       wxCheckBox*     _XYZValues;
+       wxCheckBox*     _contourImage;
+       wxCheckBox*     _statistics;
        void onInformationContourLabels(wxCommandEvent& event);
        void onExtractInformation(wxCommandEvent& event);
        void onShowResultImages(wxCommandEvent& event);
index ceb3f8a0643ff344f3fe46f9d3e9028ca4dadb07..a205f95a1bccf7d77466cdbc0c30a273bd8b8597 100644 (file)
@@ -45,38 +45,35 @@ DEFINE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE )
        // Constructors & Destructors
        //------------------------------------------------------------------------------------------------------------
        
-       wxConceptControl :: wxConceptControl(wxWindow *parent, bool orientation, int minV, int maxV,  int actualV, std::string &aConceptName, std::string elementsDef )
+       wxConceptControl::wxConceptControl(wxWindow *parent, bool orientation, int minV, int maxV,  int actualV, std::string &aConceptName, std::string elementsDef )
        :wxPanel(parent, -1, wxDefaultPosition, parent->GetSize(), wxTAB_TRAVERSAL)
        {
-
-               minValue = minV;
-               maxValue = maxV;
-               _numCheckBox = 0;
-               
-               showLabels = true;
-
-               wxFlexGridSizer* sizer = new wxFlexGridSizer (1, 3, 15, 15);
-
+               minValue                = minV;
+               maxValue                = maxV;
+               _numCheckBox    = 0;    
+               showLabels              = true;
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+               wxFlexGridSizer* sizer = new wxFlexGridSizer(1, 3, 15, 15);
+#else
+               wxFlexGridSizer* sizer = new wxFlexGridSizer(3);
+#endif
                conceptName = new wxStaticText(this, -1, wxString(aConceptName.c_str(),wxConvUTF8), wxDefaultPosition, wxSize(90,20), wxALIGN_CENTRE );         
                sizer->Add( conceptName, 0, wxALIGN_CENTRE |wxALIGN_CENTER_HORIZONTAL);
-               
                if(orientation)
                {
                        sizer->AddGrowableCol(1);
                        conceptSlider = new wxSlider(this, -1, actualV, minV, maxV, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL| wxSL_AUTOTICKS | wxSL_LABELS, wxDefaultValidator, wxString(aConceptName.c_str(),wxConvUTF8));                    
-               }
-               else
-               {                       
-                       sizer->AddGrowableRow(1);
+               } else {                        
+//                     sizer->AddGrowableRow(1);
                        conceptSlider = new wxSlider(this, -1, actualV, minV, maxV, wxDefaultPosition, wxDefaultSize, wxSL_LEFT| wxSL_AUTOTICKS | wxSL_LABELS, wxDefaultValidator, wxString(aConceptName.c_str(),wxConvUTF8) );                 
                }
                sizer->Add(conceptSlider, 0, wxGROW |wxALL );           
                createElements( sizer, elementsDef );
                SetSizer( sizer );
-
                Connect( conceptSlider->GetId(), wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(wxConceptControl::onSliderTrack));//(wxObjectEventFunction) &wxConceptControl :: onSliderRelease ); 
                Connect( conceptSlider->GetId(),  wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(wxConceptControl::onSliderRelease));//(wxObjectEventFunction) &wxConceptControl :: onSliderTrack );     
-
                this->SetAutoLayout( true );
                this->Layout(); 
        }
@@ -232,11 +229,16 @@ DEFINE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE )
        //------------------------------------------------------------------------------------------------------------
        // Creational and initialization methods
        //------------------------------------------------------------------------------------------------------------
-       void wxConceptControl :: createElements(wxSizer *sizer , std::string elementsDef )
+       void wxConceptControl::createElements(wxSizer *sizer , std::string elementsDef )
        {
                const char * elements = elementsDef.c_str();
                int elementsNum = elementsDef.size();
-               wxFlexGridSizer* checkSizer = new wxFlexGridSizer (1, elementsNum, 5, 5);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+               wxFlexGridSizer* checkSizer = new wxFlexGridSizer(1, elementsNum, 5, 5);
+#else
+               wxFlexGridSizer* checkSizer = new wxFlexGridSizer(elementsNum);
+#endif
                int i,ckecks = 0;
                for( i = 0;*elements!= 0; elements++)
                {                       
@@ -250,8 +252,7 @@ DEFINE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE )
                                }*/
                                createCheckBoxAndAddToSizer( checkSizer, "X", -1, ckecks);
                                ckecks++;
-                       }
-                       else if ( a == 84 || a==116 )// Including T:84 or t t:116 as textCtrl (ASCII)
+                       } else if ( a == 84 || a==116 )// Including T:84 or t t:116 as textCtrl (ASCII)
                        {
 
                        }
index 2077380295561cc75bb6d6ec772a039e30ee2a51..548195cb526aaa76c34da97695a741f0980e1a7d 100644 (file)
@@ -70,13 +70,13 @@ char wxContourMainFrame::COPY = 'C';
 //             _gridPanel                                      = NULL;
 //             _drawToolsPanel                         = NULL;
 //             _operationsToolsPanel           = NULL;
-               //_autoFormsPanel                               = NULL;
+               //_autoFormsPanel                       = NULL;
 //             _standardToolsPanel                     = NULL;
 //             _editionToolsPanel                      = NULL;
 //             _listViewPanel                          = NULL;
 //             _sceneManager                           = NULL;
-               //_actualInstant                                = NULL;
-               _numberOfVariablesStatistics = 6+1;
+               //_actualInstant                        = NULL;
+               _numberOfVariablesStatistics= 6+1;
 
                _refLineControl                         = NULL;
                _refLineModel                           = NULL;
@@ -94,10 +94,11 @@ char wxContourMainFrame::COPY = 'C';
                _viewThresholdImage                     = NULL;
                _viewThresholdImagePanel        = NULL;
                _viewColorLayerImagePanel       = NULL;
+
                _frameShowResultImages          = NULL;
        }
 
-       wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
+       wxContourMainFrame::wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
                : wxPanel(parent, id, pos, size, style)
        {
                m_mgr.SetManagedWindow(this);
@@ -123,7 +124,7 @@ char wxContourMainFrame::COPY = 'C';
                inredo                                          = 0;
                inundo                                          = 0;
                _pannew = interfMainPanel::getInstance(this,datadir+"/data/Icons");//, eventHandler);
-               _performingOperation = new PerformingOperation();
+               _performingOperation        = new PerformingOperation();
                if(images.size() > 0)
                {
                        this->setVectImages(images);
@@ -133,42 +134,29 @@ char wxContourMainFrame::COPY = 'C';
 
 void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
 {
-
        _images = imgs;
-
        #if defined(__GNUC__)
                std::string str_home(getenv("HOME"));
        #elif defined(_WIN32)
-                       std::string str_home(getenv("USERPROFILE"));
+               std::string str_home(getenv("USERPROFILE"));
        #endif
-               std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
-
+       std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
        std::vector<std::string> conceptNameVect;
        std::vector<int> conceptSizeVect;
-
        notebook = this->createNotebook();
-
-
-       kernelManager = new KernelManagerContour( imgs , _datadir+"/data/" , strCreaContourDataTmp );
-
-
-       _instantPanel                           = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
-       _theViewPanel                           = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );
-
+       kernelManager   = new KernelManagerContour( imgs , _datadir+"/data/" , strCreaContourDataTmp );
+       _instantPanel   = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
+       _theViewPanel   = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );
 //-------------------------------------------------------------
        kernelManager->getConceptsInformation(conceptNameVect, conceptSizeVect);
        _instantPanel->addConcepts(conceptNameVect, conceptSizeVect);
-
-
        double val = _theViewPanel->getCurrentDeep();
        _instantPanel->setConceptValue( "Axe Depth", (int)val );
        //JCP _instantPanel->setConceptValue("time", num de imagenes);
        ConceptDataWrap * data = _instantPanel->getConceptDataOf( "Axe Depth" );
        //*******************changeInstant();
        _theViewPanel->setVerticalConcept( "Axe Depth", data->getMinValue(), data->getMaxValue(), data->getMinShowedValue(),  data->getMaxShowedValue(), data->getActualValue() );
-
        this->configurePanels( );
-
 }
 
 
@@ -246,17 +234,13 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
                        notebook->AddPage( _theViewPanel, wxT("       View       ") );
                        m_mgr.Update();
                }
-
-
                if( configured )
                {
                        notebook->AddPage( _instantPanel, wxT("Instant Page") );
                        m_mgr.Update();
                }
-
                m_mgr.AddPane(notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
                m_mgr.Update();
-
                SetMinSize(wxSize(300,300));
                m_mgr.Update();
                return configured;
@@ -337,20 +321,25 @@ void wxContourMainFrame::onCreateContourSpline( ){
        createContour( 1 );
 
 }
-void wxContourMainFrame::onCreateContourRectangle( ){
+
+void wxContourMainFrame::onCreateContourRectangle( )
+{
     //JCP 20-10-08 Undo redo implementation
        saveState();
        //JCP 20-10-08 Undo redo implementation
        createContour( 2 );
 }
-void wxContourMainFrame::onCreateContourCircle( ){
+
+void wxContourMainFrame::onCreateContourCircle( )
+{
     //JCP 20-10-08 Undo redo implementation
        saveState();
        //JCP 20-10-08 Undo redo implementation
        createContour( 3 );
 }
 
-void wxContourMainFrame::onCreateContourLine( ){
+void wxContourMainFrame::onCreateContourLine( )
+{
     //JCP 20-10-08 Undo redo implementation
        saveState();
        //JCP 20-10-08 Undo redo implementation
@@ -358,7 +347,8 @@ void wxContourMainFrame::onCreateContourLine( ){
 }
 
 // RaC 09-09 --------------------------------------
-void wxContourMainFrame::onCreateContourPoints( ){
+void wxContourMainFrame::onCreateContourPoints( )
+{
     //JCP 20-10-08 Undo redo implementation
        saveState();
        //JCP 20-10-08 Undo redo implementation
@@ -367,7 +357,8 @@ void wxContourMainFrame::onCreateContourPoints( ){
 // RaC 09-09 --------------------------------------
 
 // RaC 10-09 --------------------------------------
-void wxContourMainFrame::onCreateContourPolygon( ){
+void wxContourMainFrame::onCreateContourPolygon( )
+{
     //JCP 20-10-08 Undo redo implementation
        saveState();
        //JCP 20-10-08 Undo redo implementation
@@ -402,15 +393,14 @@ void wxContourMainFrame :: onCreateContourBullEye(wxPanel* panel )
                _theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc , 4) ;
        }
 }
+
 void wxContourMainFrame :: createContour( int typeContour )
 {
        //Creating the manualContourModel and including in the model
        manualBaseModel * manModelContour = kernelManager->factoryManualContourModel(typeContour);
-
        std::vector<int> instantVector;
        _instantPanel->getInstant( instantVector );
        std::string theName = kernelManager->createOutline(manModelContour, instantVector);
-
        /*std::vector<int> instantVector;
        _instantPanel->getInstant( instantVector );
        std::string theName;
@@ -424,9 +414,9 @@ void wxContourMainFrame :: createContour( int typeContour )
                //Adding the manualViewContour to interface objects structure
                //_sceneManager->setControlActiveStateOfALL( false );//This call is being done here because if the ROI is created underneath the previously created ROIS will still be active.
                _theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc , typeContour) ;
-       }
-
+       } // if addedModel
 }
+
 manualBaseModel * wxContourMainFrame::factoryManualContourModel(wxPanel* panel){
 
        manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
@@ -459,13 +449,15 @@ manualBaseModel * wxContourMainFrame::factoryManualContourModel(wxPanel* panel){
 
        return manModelContour;
 }
-void wxContourMainFrame :: saveState(){
 
+void wxContourMainFrame :: saveState()
+{
        std::string temp = kernelManager->saveState();
        saveFileWithContours(temp);
 }
 
-void wxContourMainFrame::onDeleteContour(){
+void wxContourMainFrame::onDeleteContour()
+{
        //JCP 20-10-08 Undo redo implementation
                saveState();
                //JCP 20-10-08 Undo redo implementation
@@ -526,7 +518,8 @@ void wxContourMainFrame :: deleteContours( std::vector<std::string>  keyNamesVec
        }
 }
 
-void wxContourMainFrame :: deleteContour( std::string theKeyName ){
+void wxContourMainFrame :: deleteContour( std::string theKeyName )
+{
        /*
        manualContourModel                      * cModel;
        manualViewBaseContour           * cViewer;
@@ -615,17 +608,20 @@ void wxContourMainFrame::deleteAllContours(){
 JCP --08-09-2008 */
 }
 
-void wxContourMainFrame::setConceptValue( std::string name, int value ){
+void wxContourMainFrame::setConceptValue( std::string name, int value )
+{
        _instantPanel->setConceptValue(name, value);
 }
 
 
-ConceptDataWrap* wxContourMainFrame::getLastConceptData(){
+ConceptDataWrap* wxContourMainFrame::getLastConceptData()
+{
        return _instantPanel->getLastConceptData();
 }
 
 
-bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos ){
+bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos )
+{
        return _instantPanel->getIfConceptCheckedAt( name, pos );
 }
 
@@ -674,11 +670,10 @@ void wxContourMainFrame::changeInstant()
                std::vector<int> instantVect;
                _instantPanel->getInstant( instantVect );
                int actualSlice = instantVect[1];
-
                kernelManager->setInstant(instantVect);
-
            // Refresh Mask image
-               if(_viewMaskImage!=NULL){
+               if(_viewMaskImage!=NULL)
+               {
                        _viewMaskImage->SetZ(actualSlice);
                        if (_viewMaskImagePanel->IsVisible()==true)
                        {
@@ -686,17 +681,16 @@ void wxContourMainFrame::changeInstant()
                                getMaskValue(&mask,&value, _contourGroup , 0, -1, -1);
                                _viewMaskImage->onThreshold();
                        }
-               }
-
+               } // if _viewMaskImage
        // Refresh Threshold image
-               if(_viewThresholdImage!=NULL){
+               if(_viewThresholdImage!=NULL)
+               {
                        _viewThresholdImage->SetZ(actualSlice);
-                       if (_viewThresholdImagePanel->IsVisible()==true){
+                       if (_viewThresholdImagePanel->IsVisible()==true)
+                       {
                                _viewThresholdImage->onThreshold();
                        }
-               }
-
-
+               } // if _viewThresholdImage
                updateInstantOutlines();
                updateInstantImageData();
                updateInstantAxes();
@@ -704,7 +698,7 @@ void wxContourMainFrame::changeInstant()
 
 
 
-void wxContourMainFrame :: updateInstantOutlines()
+void wxContourMainFrame::updateInstantOutlines()
 {
        _theViewPanel->removeSceneContours();
        _theViewPanel->addNameWrapperToScene();
@@ -715,10 +709,13 @@ void wxContourMainFrame :: updateInstantOutlines()
        //}
 }
 
-int wxContourMainFrame::getNamesWrappingSize(){
+int wxContourMainFrame::getNamesWrappingSize()
+{
        return kernelManager->getNamesWrappingSize();
 }
-std::string wxContourMainFrame::getNameWrapping(int i){
+
+std::string wxContourMainFrame::getNameWrapping(int i)
+{
        return kernelManager->getNameWrapping(i);
 }
 
@@ -750,7 +747,6 @@ void wxContourMainFrame::onChangeDeep(int val){
 
 void wxContourMainFrame::onCopy(){
        std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects();
-
        std::vector<int> tempVector;
        _instantPanel->getInstant( tempVector );
     _performingOperation->reset();
@@ -759,9 +755,8 @@ void wxContourMainFrame::onCopy(){
        _performingOperation->setKeyNamesOperationElems( currentSelection );
 }
 
-void wxContourMainFrame::onPaste(){
-
-
+void wxContourMainFrame::onPaste()
+{
        char theStartCommand = _performingOperation->getStartCommand();
        if (  theStartCommand == COPY )
        {
@@ -779,7 +774,9 @@ void wxContourMainFrame::onPaste(){
                }
        }
 }
-void wxContourMainFrame::onUndo(){
+
+void wxContourMainFrame::onUndo()
+{
        std::string filename;
        if(kernelManager->onUndoSaveFile(filename)){
                saveFileWithContours(filename);
@@ -848,109 +845,11 @@ void wxContourMainFrame :: createMirrorContourOf ( std::string anExistingKName,
        _theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append );
 }
 
-//EED04
-void wxContourMainFrame ::loadState(std::string filename){
-
+void wxContourMainFrame ::loadState(std::string filename)
+{
        deleteAllContours();
        onLoadContours(filename,false);
-
-       /* EED Borrame
-       char tmp[255];
-       FILE *pFile=fopen(filename.c_str(),"r+");
-
-       fscanf(pFile,"%s",tmp); // --CreaContour--
-
-       fscanf(pFile,"%s",tmp); // Version
-       fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
-
-       deleteAllContours();
-
-       loadContours(pFile, false);
-       loadContours(pFile, true);
-
-       fclose(pFile);
-       */
-}
-
-
-//EED03
-/*EED Borrame
-void wxContourMainFrame::loadContours( FILE *pFile, bool staticContour )
-{
-       char tmp[255];
-
-       if (staticContour==false)
-       {
-               fscanf(pFile,"%s",tmp); // ImageDimensions
-               fscanf(pFile,"%s",tmp); // X
-               fscanf(pFile,"%s",tmp); // Y
-               fscanf(pFile,"%s",tmp); // Z
-
-               fscanf(pFile,"%s",tmp); // ImageSpacing
-               fscanf(pFile,"%s",tmp); // X
-               fscanf(pFile,"%s",tmp); // Y
-               fscanf(pFile,"%s",tmp); // Z
-       }
-
-       fscanf(pFile,"%s",tmp); // NumberOfContours
-       fscanf(pFile,"%s",tmp); // ##
-       int numberOfContours = atoi(tmp);
-
-       std::vector<int> instantVector;
-       int typeContourModel;
-       manualBaseModel *manModelContour;
-       int typeView;
-
-       int i;
-       for (i=0;i<numberOfContours;i++)
-       {
-               instantVector.clear();
-               fscanf(pFile,"%s",tmp); // Instant
-               fscanf(pFile,"%s",tmp); // 1
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 2
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 3
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 4
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 5
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 6
-               instantVector.push_back( atoi(tmp) );
-
-               fscanf(pFile,"%s",tmp); // TypeContourModel
-               fscanf(pFile,"%s",tmp); // ##
-               typeContourModel = atoi(tmp);
-
-               manModelContour =  kernelManager->factoryManualContourModel(typeContourModel);
-               manModelContour->Open(pFile);
-
-               fscanf(pFile,"%s",tmp); // TypeView
-               fscanf(pFile,"%s",tmp); // ##
-               typeView = atoi(tmp);
-
-               std::string theName;
-               theName = kernelManager->createOutline( manModelContour, instantVector );
-               bool addedModel = theName.compare("") != 0;
-               if( addedModel )
-               {
-                       double spc[3];//Si no hay imagen pero hay contornos que spacing se pone por default
-                       _theViewPanel->getSpacing(spc);
-                       //Adding the manualContourControler to interface objects structure
-                       //Adding the manualViewContour to interface objects structure
-                       //_theViewPanel->getSceneManager()->setControlActiveStateOfALL( false );//This call is being done here because if the ROI is created underneath the previously created ROIS will still be active.
-                       _theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc , typeView) ;
-               }
-
-               if (staticContour==true)
-               {
-                       Instant instant(&instantVector);
-                       kernelManager->changeContourOfManager( theName , &instant );
-               }
-       }// for  numberOfContours
 }
-*/
 
 
 void wxContourMainFrame::onLoad()
@@ -960,7 +859,12 @@ void wxContourMainFrame::onLoad()
        if(GetFileLocation().empty())
        {
 //------------------------------------------------------------------------------------------------------------
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxOPEN );
+#else
+               wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxFD_OPEN );
+#endif
                if (dialog.ShowModal() == wxID_OK)
                {
                        fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
@@ -973,9 +877,7 @@ void wxContourMainFrame::onLoad()
 
 void  wxContourMainFrame::SetZForAllContours(int pz)
 {
-
        //-- Normal Contours
-
        std::vector< std::string > lstNameThings;       
        int i,sizeLstNameThings;
        int ii,sizeLstPoints;
@@ -1008,16 +910,11 @@ printf("EED wxContourMainFrame::SetZForAllContours contour=%d \n", i );
        }// for i  list of static things
 }
 
-
-
 void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool interactiveInterface)
 {
        char tmp[255];
        char tmpD[255];
-
        FILE *pFile =fopen(fileNameContourROI.c_str(),"r+");
-
-
 //CMRU 03-09-09- ----------------------------------------------------------------------------------------------
        if(pFile != NULL)
        {
@@ -1036,17 +933,10 @@ void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool int
                        fscanf(pFileData,"%s",tmpD); // NumberOfContours
                        fscanf(pFileData,"%s",tmpD); // #
                }
-
                fscanf(pFile,"%s",tmp); // --CreaContour--
-
                fscanf(pFile,"%s",tmp); // Version
                fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
                std::string version(tmp);
-
-
-printf("EED wxContourMainFrame::onLoadContours  version%s \n", version.c_str() );
-
-
                //AD:02-06-09
         _tmpReadFileTypeOfTransformation=-1;
                if (version=="1.0.3")
@@ -1055,7 +945,6 @@ printf("EED wxContourMainFrame::onLoadContours  version%s \n", version.c_str() )
                        openContours(pFile,pFileData,false);
                        openContours(pFile,pFileData,true);     //Load StaticContours
                }       
-
                if (version=="1.0.2")
                {
 //EED001
@@ -1065,7 +954,6 @@ printf("EED wxContourMainFrame::onLoadContours  version%s \n", version.c_str() )
                        openContours(pFile,pFileData,true);     // Load StaticContours
                        SetZForAllContours(-900);
                }
-
                //AD:02-06-09
                else if (version=="1.0.1")
                {
@@ -1084,18 +972,22 @@ printf("EED wxContourMainFrame::onLoadContours  version%s \n", version.c_str() )
                if(pFileData != NULL)
                {
                        fclose(pFileData);
-               }
+               } // if
        }
        _theViewPanel->getSceneManager()->removeSceneContours();
        changeInstant();
 }
 
 
-
-void wxContourMainFrame::onImport(){
+void wxContourMainFrame::onImport()
+{
        std::string filename, filenamecontours;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog dialog(NULL, _T("Choose a XML Osirix File"), _T(""), _T(""), _T("*.xml"), wxOPEN );
-
+#else
+       wxFileDialog dialog(NULL, _T("Choose a XML Osirix File"), _T(""), _T(""), _T("*.xml"), wxFD_OPEN );
+#endif
        if (dialog.ShowModal() == wxID_OK)
        {
                filename = dialog.GetPath().mb_str();
@@ -1103,19 +995,25 @@ void wxContourMainFrame::onImport(){
 
                if(filenamecontours.compare("") != 0){
                        onLoadContours(filenamecontours,true);
-               }
-
-       }
+               } // if
+       } // if
 }
-void wxContourMainFrame::onTest(){
+
+void wxContourMainFrame::onTest()
+{
        std::string filename, filenamecontours;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxOPEN );
+#else
+       wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxFD_OPEN );
+#endif
 
        if (dialog.ShowModal() == wxID_OK)
        {
                filename = dialog.GetPath().mb_str();
                std::cout << "This is the filename: " << filename << std::endl;
-       }
+       } // if
 }
 
 
@@ -1125,7 +1023,12 @@ void wxContourMainFrame::onSave(){
        if(GetFileLocation().empty())
        {
 //------------------------------------------------------------------------------------------------------------
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxSAVE );
+#else
+               wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.roi"), wxFD_SAVE );
+#endif
                if (dialog.ShowModal() == wxID_OK)
                {
                        std::string fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
@@ -1466,14 +1369,16 @@ void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool static
 
 }
 
-void wxContourMainFrame::RefreshInterface(){
+void wxContourMainFrame::RefreshInterface()
+{
        changeInstant();
        _theViewPanel->RefreshInterface();
        //wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)this->_theViewPanel->getWxVtkBaseView();
        //wxvtk2dbaseview->Refresh();
 }
 
-vtkImageData* wxContourMainFrame::getImageData(){
+vtkImageData* wxContourMainFrame::getImageData()
+{
        return _theViewPanel->getImageData();
 }
 
@@ -1680,33 +1585,63 @@ printf("EED wxContourMainFrame::SegmentationOneSliceITK  Skypping this code.  No
 
        vtkMarchingContourFilter* cntVTK = vtkMarchingContourFilter::New( );
 
-       cntVTK->SetInput( idata );
-
        cntVTK->SetNumberOfContours( 1 );
        cntVTK->SetValue( 0, 255 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       cntVTK->SetInput( idata );
        cntVTK->Update( );
        cntVTK->UpdateInformation();
+#else
+       cntVTK->SetInputData( idata );
+#endif
 
        vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        cpd->SetInput( cntVTK->GetOutput( ) );
        cpd->Update( );
        cpd->UpdateInformation();
+#else
+       cpd->SetInputData( cntVTK->GetOutput( ) );
+#endif
+
 
        vtkPolyDataConnectivityFilter* conn = vtkPolyDataConnectivityFilter::New( );
        conn->SetExtractionModeToLargestRegion( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        conn->SetInput( cpd->GetOutput( ) );
        conn->Update( );
        conn->UpdateInformation();
+#else
+       conn->SetInputData( cpd->GetOutput( ) );
+#endif
+
 
        vtkStripper* vtkstripper = vtkStripper::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        vtkstripper->SetInput( conn->GetOutput() );
        vtkstripper->Update();
        vtkstripper->UpdateInformation();
+#else
+       vtkstripper->SetInputData( conn->GetOutput() );
+       cntVTK->Update();
+#endif
 
        vtkPolyData* polyDataResult =  cntVTK->GetOutput();
        //std::cout<<"Points "<<polyDataResult->GetNumberOfPoints()<<std::endl;
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        polyDataResult->Update( );
        polyDataResult->UpdateInformation();
+#else
+       // ..
+#endif
 
        //EED
                /*
@@ -1967,19 +1902,41 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
 //             y = y*spc[1];
 //             z = z*spc[3];
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        imageReslice->SetInput( imagedata );
+#else
+       imageReslice->SetInputData( imagedata );
+#endif
        imageReslice->SetInformationInput(imagedata);
        imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
        imageReslice->SetResliceAxesOrigin(0,0,z);
        imageReslice->SetOutputDimensionality(2);
        imageReslice->SetInterpolationModeToLinear();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       // ..
+#else
+       imageReslice->Update();
+#endif
+
        imagedata = imageReslice->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        imagedata->Update();
        imagedata->UpdateInformation();
+#else
+       // ..
+#endif
 
        vtkContourFilter* cntVTK = vtkContourFilter::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        cntVTK->SetInput( imagedata );
+#else
+       cntVTK->SetInputData( imagedata );
+#endif
 
        cntVTK->SetNumberOfContours( 1 );
        //cntVTK->SetValue( 0, vmin );
@@ -1990,7 +1947,12 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
        cntVTK->UpdateInformation();
 
        vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        cpd->SetInput( cntVTK->GetOutput( ) );
+#else
+       cpd->SetInputData( cntVTK->GetOutput( ) );
+#endif
        cpd->ConvertLinesToPointsOff( );
        cpd->Update( );
        cpd->UpdateInformation();
@@ -1999,27 +1961,47 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
        conn->SetExtractionModeToClosestPointRegion( );
        //conn->SetMaxRecursionDepth( 3000 );
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        conn->SetInput( cpd->GetOutput( ) );
+#else
+       conn->SetInputData( cpd->GetOutput( ) );
+#endif
 
        conn->SetClosestPoint( x, y, 0 );
        conn->Update( );
        conn->UpdateInformation();
 
        vtkCleanPolyData* cpd2 = vtkCleanPolyData::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        cpd2->SetInput( conn->GetOutput( ) );
+#else
+       cpd2->SetInputData( conn->GetOutput( ) );
+#endif
        cpd2->Update();
        cpd2->UpdateInformation();
 
        vtkStripper* vtkstripper = vtkStripper::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        vtkstripper->SetInput( cpd2->GetOutput() );
+#else
+       vtkstripper->SetInputData( cpd2->GetOutput() );
+#endif
        vtkstripper->Update();
        vtkstripper->UpdateInformation();
 
 
        vtkPolyData* polyDataResult =  vtkstripper->GetOutput();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        polyDataResult->Update( );
        polyDataResult->UpdateInformation();
+#else
+       //...
+#endif
 
 /* EED
 ofstream myfile;
@@ -2366,29 +2348,33 @@ int wxContourMainFrame::getWindowLevel()
        return _theViewPanel->getWindowLevel();
 }
 
-void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
+void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
+{
        _theViewPanel->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
 
        RefreshInterface();
 }
 
-void wxContourMainFrame::onInterpolation(bool interpolate){
+void wxContourMainFrame::onInterpolation(bool interpolate)
+{
        _theViewPanel->onInterpolation(interpolate);
        RefreshInterface();
 }
 
-void wxContourMainFrame::onChangeInstant(std::string name,int actual){
+void wxContourMainFrame::onChangeInstant(std::string name,int actual)
+{
        _instantPanel->setConceptValue( name, actual );
 }
 
 
-void wxContourMainFrame::resetAppend(){
+void wxContourMainFrame::resetAppend()
+{
        kernelManager->resetAppend();
-
 }
 
 
-void wxContourMainFrame::onSpreadAdd(){
+void wxContourMainFrame::onSpreadAdd()
+{
        std::vector<double> vecX;
        std::vector<double> vecY;
        std::vector<double> vecZ;
@@ -2400,7 +2386,8 @@ void wxContourMainFrame::onSpreadAdd(){
 }
 
 
-void wxContourMainFrame::onSpreadAddAll(){
+void wxContourMainFrame::onSpreadAddAll()
+{
 //EED02
        std::vector<int> tempVector;
        _instantPanel->getInstant( tempVector );
@@ -2438,7 +2425,8 @@ void wxContourMainFrame::onSpreadAddAll(){
 }
 
 
-void wxContourMainFrame::onSpreadGo(int type){
+void wxContourMainFrame::onSpreadGo(int type)
+{
        //JCP 20-10-08 Undo redo implementation
        saveState();
        //JCP 20-10-08 Undo redo implementation
@@ -2493,11 +2481,12 @@ void wxContourMainFrame::onSpreadGo(int type){
        //RefreshInterface();
 }
 
-void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector){
-
+void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector)
+{
 }
 
-std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide){
+std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide)
+{
        std::vector<int> tempVector;
        _instantPanel->getInstant(tempVector);
        //Asignation of slide number should be different ex by name
@@ -3091,10 +3080,21 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef
 // Image Value
        
        vtkImageChangeInformation *valueChInfo = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        valueChInfo->SetInput(value);
+#else
+       valueChInfo->SetInputData(value);
+#endif
        valueChInfo->SetSpacingScale(spc);      
        vtkMetaImageWriter *writerValueImage = vtkMetaImageWriter::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        writerValueImage->SetInput( valueChInfo->GetOutput() );
+#else
+       writerValueImage->SetInputData( valueChInfo->GetOutput() );
+#endif
        writerValueImage->SetFileName( (const char *)filename.mb_str() );
        writerValueImage->SetFileDimensionality( 3 );
        writerValueImage->SetCompression(false);
@@ -3110,10 +3110,22 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef
 
 
        vtkImageChangeInformation *maskChInfo = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        maskChInfo->SetInput(mask);
+#else
+       maskChInfo->SetInputData(mask);
+#endif
        maskChInfo->SetSpacingScale(spc);       
        vtkMetaImageWriter *writerMaskImage = vtkMetaImageWriter::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        writerMaskImage->SetInput( maskChInfo->GetOutput() );
+#else
+       writerMaskImage->SetInputData( maskChInfo->GetOutput() );
+#endif
+
        writerMaskImage->SetFileName( (const char *)filename.mb_str() );
        writerMaskImage->SetFileDimensionality( 3 );
        writerMaskImage->SetCompression(false);
@@ -3386,7 +3398,6 @@ void wxContourMainFrame::SetFileLocation(std::string newFileLocation)
 
 void wxContourMainFrame::FlipSelectedContours(int flipDirection)
 {
-       printf("EED wxContourMainFrame::FlipSelectedContours  flipDirection=%d  \n",  flipDirection ); 
        FlipLstOfContours( 
                            (std::vector<std::string>)_theViewPanel->getSceneManager()->getSelectedObjects() , 
                            flipDirection
@@ -3396,7 +3407,6 @@ void wxContourMainFrame::FlipSelectedContours(int flipDirection)
 
 void wxContourMainFrame::FlipActualSliceContours(int flipDirection)
 {
-       printf("EED wxContourMainFrame::FlipActualSliceContours  flipDirection=%d  \n",  flipDirection );       
        FlipLstOfContours( 
                            (std::vector<std::string>)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() , 
                            flipDirection
@@ -3405,7 +3415,6 @@ void wxContourMainFrame::FlipActualSliceContours(int flipDirection)
 
 void wxContourMainFrame::FlipAllContours(int flipDirection)
 {
-       printf("EED wxContourMainFrame::FlipAllContours  flipDirection=%d  \n",  flipDirection );
        FlipLstOfContours( 
                            kernelManager->GetLstNameThings() , 
                            flipDirection
index cd7d202a3fa617c5318364f1b54152887fb8717b..d9445631743d9c1169aaa4358c4dd39bfb127a08 100644 (file)
@@ -96,7 +96,6 @@
 #include "vtkMetaImageWriter.h"
 #include "vtkImageData.h"
 #include "vtkTransform.h"
-
 #include "vtkCamera.h"
 #include "vtkImageActor.h"
 #include <vtkImageMapToColors.h>
@@ -209,19 +208,13 @@ class wxContourMainFrame : public wxPanel {
        void setConceptValue( std::string name, int value );
        ConceptDataWrap* getLastConceptData();
        bool getIfConceptCheckedAt( std::string name, int pos );
-
        void changeInstant();
-
        int getNamesWrappingSize();
-
        std::string getNameWrapping(int i);
-
        void updateInstantOutlines();
        void updateInstantImageData();
        void updateInstantAxes();
-
        void onChangeDeep(int val);
-
 ///////////////////////////
        void onCopy();
        void onPaste();
@@ -235,11 +228,8 @@ class wxContourMainFrame : public wxPanel {
        void onImport();
        void onTest();
        void openContours( FILE *pFile, FILE *pFileData, bool staticContour );
-
        void RefreshInterface();
-
        vtkImageData* getImageData();
-
        void onSegmentationOneSlice(int isovalue,int sampling,int method);
        void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
        void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
@@ -265,7 +255,6 @@ class wxContourMainFrame : public wxPanel {
        void FlipAllContours(int flipDirection);
        void FlipLstOfContours(std::vector<std::string> lstNameThings, int flipDirection);
 
-               
 //====================================================================================================
 
        void showAxis(bool show);
@@ -287,20 +276,19 @@ class wxContourMainFrame : public wxPanel {
        //
        // @param typeContourGroup - int The operation id (AND,OR,XOR,ALL=3)
        //
-       void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax);
-       void onSaveResults(std::string directory,std::string namefile, std::string filename,
-               int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
-       void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
-       void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
-       void onSnakePressed();
-       void saveFileWithContoursAutomatique();
-       void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ );
+       void    onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax);
+       void    onSaveResults(std::string directory,std::string namefile, std::string filename,
+       int     typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
+       void    SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
+       void    onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
+       void    onSnakePressed();
+       void    saveFileWithContoursAutomatique();
+       void    ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ );
        wxPanel *getMaskImageViewPanel(wxWindow *parent);
-       void SetContourGroup(int contourGroup);
+       void    SetContourGroup(int contourGroup);
        wxPanel *getThresholdImageViewPanel(wxWindow *parent);
        wxPanel *getColorLayerImageViewPanel(wxWindow *parent);
 
-
 //CMRU 17-08-09-----------------------------------------------------------------------------------------------
 
        /**
@@ -386,7 +374,7 @@ private:
        int                      _numberOfVariablesStatistics;
 
        // Contour Image Mask
-       ThresholdImageView              *_viewMaskImage;
+       ThresholdImageView                      *_viewMaskImage;
        ThresholdImageViewPanel         *_viewMaskImagePanel;
 
        // Threshold Image
index 52b23e0dbe7c3fa600e6342003dab32c65f7d91d..0115b33cbb411d4947cd29b5b429a575547c1a63 100644 (file)
@@ -52,98 +52,47 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
        //------------------------------------------------------------------------------------------------------------
        // Constructors & Destructors
        //------------------------------------------------------------------------------------------------------------
-       /*{
-
-               showingVID = theShowingImage;
-               int gapH = 20;
-               int gapV = 10;
-               createHorizontalBar(1,80);
-               createVerticalBar(1,200);
-               createViewPanel();
-
-               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(3,1,0,0);
-               panelSizer->AddSpacer(gapV);
-               panelSizer -> AddGrowableCol(1);
-               panelSizer->Add(theViewPanel, 1, wxEXPAND);
-               panelSizer->AddSpacer(gapV);
-
-               wxFlexGridSizer * downSizer = new wxFlexGridSizer(1,3,gapV,gapH);
-               downSizer->Add(_verticalBar, 1, wxEXPAND);
-               //downSizer->AddSpacer(gapH);
-               downSizer -> AddGrowableCol(1);
-               downSizer->Add(panelSizer, 1, wxEXPAND|wxALL|wxCENTER);
-               //downSizer->AddSpacer(gapH);
-               outSizer = new wxFlexGridSizer(3,1,1,1);
-               outSizer->Add(_horizontalBar, 1, wxEXPAND);
-               outSizer -> AddGrowableRow(1);
-               outSizer -> AddGrowableCol(1);
-               outSizer->Add(downSizer, 1, wxEXPAND);
-
-               _horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + gapH, gapV);
-               _horizontalBar->setDeviceEndMargin( gapH+10 );
-
-               //Connecting the events to the horizontal bar
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onActualChange_Bar_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onStartChange_Bar_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onEndChange_Bar_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onSelectionEnd_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onMovedBar_Horizontal );
-
-               //Connecting the events to the vertical bar
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onActualChange_Bar_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onStartChange_Bar_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onEndChange_Bar_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onSelectionEnd_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onMovedBar_Vertical );
-
-
-               this->SetAutoLayout( true );
-               SetSizer( outSizer );
-               this->Layout();
-
-               SetSize(900,700);
-               theViewPanel->SetSize(800,600);
-               theViewPanel->GetWindow(1)->SetSize(800,600);
-
-               outSizer->Fit( this );
-               SetBackgroundColour(wxColour(255,0,0));
-
-       }*/
        //:wxScrolledWindow(parent, -1, pos, size, style)
-       wxContourViewPanel :: wxContourViewPanel ( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
+       wxContourViewPanel::wxContourViewPanel ( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
        :wxPanel(parent, -1, pos, size, style)
        {
                theShowingImage->GetSpacing(last_spacing);
-               showingVID = theShowingImage;
-               int gapH = 20;
-               int gapV = 10;
-               _verticalConceptName = "";
-               _horizontalConceptName = "";
+               showingVID                              = theShowingImage;
+               int gapH                                = 20;
+               int gapV                                = 10;
+               _verticalConceptName    = "";
+               _horizontalConceptName  = "";
                createHorizontalBar(1,80);
                createVerticalBar(1,200);
                createViewPanel();
-               _eventHandler = NULL;
-
-               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1, 4, gapV, gapH);
+               _eventHandler                   = NULL;
+               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1,4,  gapV, gapH);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                panelSizer -> AddGrowableCol(2);
                panelSizer -> AddGrowableRow(2);
-               panelSizer->Add(_verticalBar, 1, wxGROW);
+#else
+               panelSizer -> AddGrowableRow(0,1);
+               panelSizer -> AddGrowableCol(2,1);
+#endif
+               panelSizer->Add(_verticalBar, 0, wxEXPAND);
                panelSizer->AddSpacer(gapV);
-               panelSizer->Add(theViewPanel, 1, wxGROW);
+               panelSizer->Add(theViewPanel, 1, wxEXPAND);
                panelSizer->AddSpacer(gapV);
-
                outSizer = new wxFlexGridSizer(3, 1, gapH, gapV);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                outSizer -> AddGrowableCol(1);
                outSizer -> AddGrowableRow(1);
-               outSizer->Add( _horizontalBar, 1, wxGROW);
-               outSizer->Add( panelSizer, 1, wxGROW);
+#else
+               outSizer -> AddGrowableRow(1,1);
+               outSizer -> AddGrowableCol(0,1);
+#endif
+               outSizer->Add( _horizontalBar, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP);
+               outSizer->Add( panelSizer, 1, wxEXPAND);
                outSizer->AddSpacer(gapH);
-
                _horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + 2*gapH, gapV);
                _horizontalBar->setDeviceEndMargin( 2*gapH+10 );
-
                //Connecting the events to the horizontal bar
                Connect(_horizontalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Horizontal );
                Connect(_horizontalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onActualChange_Bar_Horizontal );
@@ -159,18 +108,13 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                Connect(_verticalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onEndChange_Bar_Vertical );
                Connect(_verticalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onSelectionEnd_Vertical );
                Connect(_verticalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onMovedBar_Vertical );
-
-
                this->SetSizer( outSizer );
                this->SetAutoLayout( true );
                this->Layout();
-
                //SetSize(1900,1900);
                //theViewPanel->SetSize(800,600);
                //theViewPanel->GetWindow(1)->SetSize(800,600);
-
                //outSizer->Fit( this );
-
                initializeScenceManager();
        }
 
@@ -180,25 +124,23 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                delete _sceneManager;
        }
 
-       void wxContourViewPanel::initializeScenceManager(){
-
+       void wxContourViewPanel::initializeScenceManager()
+       {
                //_theViewPanel = theViewPanel;
                //_theViewPanel->setWxEventHandler( this );
-
                double spc[3];
                this->getSpacing(spc);
                _sceneManager           = new wxVtkBaseView_SceneManager ( this->getWxVtkBaseView(), this, spc  );
-
                Connect( this->GetId(), wxINSTANT_CHANGE, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onChangeInstant );
         Connect( wxID_ANY, wxEVT_START_CREATE_MULT_ROI, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onCreateMultipleROI );
                Connect( wxID_ANY, wxEVT_START_CREATE_ROI, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onCreateROI );
                Connect( wxID_ANY, wxEVT_STOP_CREATE_ROI, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onStopCreateROI );
                Connect( wxID_ANY, wxEVT_CHANGED_DEEP, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onChangedDeep );
-               Connect( wxID_ANY,  wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContourViewPanel :: onActionButtonPressed );
-
+               Connect( wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContourViewPanel :: onActionButtonPressed );
        }
 
-       wxVtkBaseView_SceneManager* wxContourViewPanel::getSceneManager(){
+       wxVtkBaseView_SceneManager* wxContourViewPanel::getSceneManager()
+       {
                return _sceneManager;
        }
 
@@ -754,11 +696,13 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                }
        }
 
-       void wxContourViewPanel::removeSceneContours(){
+       void wxContourViewPanel::removeSceneContours()
+       {
                _sceneManager->removeSceneContours();
        }
 
-       void wxContourViewPanel::addNameWrapperToScene(){
+       void wxContourViewPanel::addNameWrapperToScene()
+       {
                int size = wxContourMainFrame::getInstance()->getNamesWrappingSize();
                for(int i = 0; i < size;i++){
                        std::string name = wxContourMainFrame::getInstance()->getNameWrapping(i);
index c8f70333b0200bd5a0c6fb8992bdb39fd3f2278d..60d66f23de40d14d7a6a2087dc6822a639c149b0 100644 (file)
@@ -75,34 +75,24 @@ ViewPanel.h */
 // Class definition
 //------------------------------------------------------------------------------------------------------------
 
-class wxContourViewPanel : public wxPanel {// public wxScrolledWindow {
-
+class wxContourViewPanel : public wxPanel 
+{
        public:
-
        //------------------------------------------------------------------------------------------------------------
        // Constructors & Destructors
        //------------------------------------------------------------------------------------------------------------
-       
        wxContourViewPanel( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos=wxDefaultPosition, const wxSize& size = wxDefaultSize,long style= wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, int vertStart=1, int vertEnd=1, int horzStart=1, int horzEnd=1 );
-
        ~wxContourViewPanel();
-
        //------------------------------------------------------------------------------------------------------------
        // Creational and initialization methods
        //------------------------------------------------------------------------------------------------------------
-       
        void setWxEventHandler( wxEvtHandler * theEventHandler );
-
        void createHorizontalBar(int horzStart, int horzEnd);
-
        void createVerticalBar(int vertStart, int vertEnd);
-
        void createViewPanel();
-
        //------------------------------------------------------------------------------------------------------------
        // Methods for capturing events from the horizontal bar
        //------------------------------------------------------------------------------------------------------------
-       
        /**
        * Handles the event wxEVT_TSBAR from the horizontal bar 
        */
@@ -360,39 +350,33 @@ private:
        //------------------------------------------------------------------------------------------------------------
        // Attributtes
        //------------------------------------------------------------------------------------------------------------
-       wxVtkBaseView_SceneManager_sceneManager;
+       wxVtkBaseView_SceneManager              *_sceneManager;
        /*
        * Represents the outer sizer of the ContourViewPanel
        */
-       wxFlexGridSizeroutSizer;
+       wxFlexGridSizer                                 *outSizer;
 
        /*
        * Represents the panel for viewing
        */
-       wxMaracas_N_ViewersWidget theViewPanel;
+       wxMaracas_N_ViewersWidget               *theViewPanel;
        /*
        * Represents the vertical barrange
        */
-       mBarRange _verticalBar;
+       mBarRange                                               *_verticalBar;
 
        /*
        * Represents the horizontal barrange
        */
-       mBarRange * _horizontalBar;
-
-       vtkImageData * showingVID;      
-
-       std::string _verticalConceptName;
+       mBarRange                                               *_horizontalBar;
+       vtkImageData                                    *showingVID;    
+       std::string                                     _verticalConceptName;
+       std::string                                     _horizontalConceptName;
+       double                                                  last_spacing[3];
+       bool                                                    _useVerticalBar;
+       bool                                                    _useHorizontalBar;
 
-       std::string _horizontalConceptName;
-
-       double last_spacing[3];
-
-       bool _useVerticalBar;
-
-       bool _useHorizontalBar;
-       
-       wxEvtHandler * _eventHandler;
+       wxEvtHandler                                    *_eventHandler;
        
 //EED
 
index a4de255267091ed5b92f9d2eed094029eda0cf5d..e47a1ad1563426eeb050887f96eef944aa5cd065 100644 (file)
@@ -96,7 +96,12 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE )
                setVerticalMaxSelectedNums( groupConfig );
                
                SetSize(size);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                _outSizer = new wxFlexGridSizer ( 1, 10, 10);
+#else
+               _outSizer = new wxFlexGridSizer ( 10);
+#endif
                _orientation = theOrientation;
                initializeResolutionSlider();
                _actualInstant=new std::map<std::string,int>();
@@ -155,13 +160,13 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE )
        //------------------------------------------------------------------------------------------------------------
        void wxInstantChooserPanel :: onResolutionSlider(wxScrollEvent& event)
        {
-               std::string lasConcept = _lastConceptUpdated->getName();
-               int value = _lastConceptUpdated->getActualValue();
-               int min = _lastConceptUpdated->getMinValue();
-               int max = _lastConceptUpdated->getMaxValue();
-               int delta = (int) (pow((double) 2, _resolutionSlider->GetValue() ));
-               int minTmp   = value - delta/2;
-               int maxTmp   = value + delta/2;
+               std::string lasConcept  = _lastConceptUpdated->getName();
+               int value                               = _lastConceptUpdated->getActualValue();
+               int min                                 = _lastConceptUpdated->getMinValue();
+               int max                                 = _lastConceptUpdated->getMaxValue();
+               int delta                               = (int) (pow((double) 2, _resolutionSlider->GetValue() ));
+               int minTmp                      = value - delta/2;
+               int maxTmp                      = value + delta/2;
                if (minTmp<min)
                        {
                                minTmp = min;   
index aac92df99d4bdd62a7cdccd40469018230601430..70fd6293e70d0924a5d4bcadadb73116dc8b625f 100644 (file)
@@ -65,25 +65,21 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
 
        wxVtkBaseView_SceneManager :: wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc )
        {
-               
                _lastInteraction                                = NULL;
-               _lastInteractionName                            = "";
+               _lastInteractionName                    = "";
                _eventHandler                                   = theEventHandler;
                _leftClickCount                                 = 0;
                _rigthClickCount                                = 0;
-               
-               _contours_ViewControl                           = new std::map< std::string, ContourWrap_ViewControl * >();
-               _sceneContours_ViewControl                      = new std::map< std::string, ContourWrap_ViewControl * >();
+               _contours_ViewControl                   = new std::map< std::string, ContourWrap_ViewControl * >();
+               _sceneContours_ViewControl              = new std::map< std::string, ContourWrap_ViewControl * >();
                _workingGroup                                   = new std::map< std::string, ContourWrap_ViewControl * >();
-
                _creatingMULT_ROI                               = false;
-               _editingROI                                     = false;
-               _toIncludeAtInteractionGroup                    = false;
-               _waiting                                        = false;
+               _editingROI                                             = false;
+               _toIncludeAtInteractionGroup    = false;
+               _waiting                                                = false;
                _creatingROI                                    = false;
-               _drawingSelectionROI                            = false;
-               SetWidthContour(1.0);
-               
+               _drawingSelectionROI                    = false;
+               SetWidthContour(1.0);   
                _wxVtk_BaseView = theWxBaseViewToManage;
                if( _wxVtk_BaseView!=NULL )
                {
@@ -93,6 +89,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                }
                configureSelectionROI( spc );
        }
+
        //------------------------------------------------------------------------------------------------------------
        wxVtkBaseView_SceneManager :: ~wxVtkBaseView_SceneManager()
        {
@@ -102,7 +99,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                {
                        _contours_ViewControl->erase( iter );
                        i++;
-               }
+               } // for
                _contours_ViewControl->clear();         
                delete _contours_ViewControl;           
                _workingGroup->clear();
@@ -126,10 +123,9 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                        wxCommandEvent cevent( theEventType );
                        cevent.SetString( wxString( text.c_str(), wxConvUTF8) );
                        _eventHandler->ProcessEvent( cevent );
-               }
+               } // if
        }
 
-
        //------------------------------------------------------------------------------------------------------------
        //  Attributes getters and setters
        //------------------------------------------------------------------------------------------------------------
@@ -137,6 +133,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        {
                _eventHandler = theEventHandler;
        }
+
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: setWxVtkViewBase( wxVtkBaseView * theBaseView )
        {
@@ -148,8 +145,9 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        {
                return _wxVtk_BaseView;
        }
+
        //------------------------------------------------------------------------------------------------------------
-       void wxVtkBaseView_SceneManager :: configureViewControlTo( std::string theKeyName, manualBaseModel * manModelContour, double * spc,int typeContour)
+       void wxVtkBaseView_SceneManager::configureViewControlTo( std::string theKeyName, manualBaseModel * manModelContour, double * spc,int typeContour)
        {
                //setControlActiveStateOfALL( false );
                _creatingROI = true;
@@ -161,11 +159,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                        _lastInteraction->getControler()->SetActive( false );
                        this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
                }
-
-
                manualContourBaseControler *manContourControl;
                manualViewBaseContour           *manViewerContour;
-
                // Creating the view manualViewContour and the manualContourControler
                // NOTE: The model is created in the KernelManagerContour class, factoryManualContourModel method
                if (typeContour==1)
@@ -273,11 +268,12 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                _contours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, newContourWrap ));
                return newContourWrap;
        } 
+
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: desconfigureViewControlOf( std::string theKeyName )
-       {
-               
+       {               
        }
+
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: removeWrap( std::string theKeyName )
        {
@@ -290,6 +286,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
                this->_vtkInteractorStyleBaseView->EvaluateToRefresh();
        } 
+
        //------------------------------------------------------------------------------------------------------------
        ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: getContourWrap_ViewControlOf ( std::string theName )
        {
@@ -298,6 +295,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                return iter->second;
                //return iter->first;
        }
+
        //------------------------------------------------------------------------------------------------------------
        ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: getContourWrap_ViewControlOf ( std::string theName, std::map<std::string, ContourWrap_ViewControl *> * theMap )
        {
@@ -305,46 +303,55 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                iter = theMap->find( theName );
                return iter->second;
        }
+
        //------------------------------------------------------------------------------------------------------------
        manualContourBaseControler * wxVtkBaseView_SceneManager :: getControlerOf( std::string theName )
        {
                return getContourWrap_ViewControlOf ( theName )->getControler();
        }
+
        //------------------------------------------------------------------------------------------------------------
        manualViewBaseContour * wxVtkBaseView_SceneManager :: getViewerOf( std::string theName )
        {
                return getContourWrap_ViewControlOf ( theName )->getViewer();
        }
+
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: set_creatingMULT_ROI( bool condition )
        {
                _creatingMULT_ROI = condition;
        }
+
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: set_editingROI( bool condition )
        {
                _editingROI = condition;
        }
+
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: set_toIncludeAtInteractionGroup( bool condition )
        {
                _toIncludeAtInteractionGroup = condition;
        }
+
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: set_waiting( bool condition )
        {
                _waiting = condition;
        }
+
        //------------------------------------------------------------------------------------------------------------
        bool wxVtkBaseView_SceneManager :: get_creatingMULT_ROI(  )
        {
                return _creatingMULT_ROI;
        }
+
        //------------------------------------------------------------------------------------------------------------
        bool wxVtkBaseView_SceneManager :: get_editingROI(  )
        {
                return _editingROI;
        }
+
        //------------------------------------------------------------------------------------------------------------
        bool wxVtkBaseView_SceneManager :: get_toIncludeAtInteractionGroup(  )
        {
@@ -461,7 +468,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        }
 
        //------------------------------------------------------------------------------------------------------------
-       void wxVtkBaseView_SceneManager :: removeSceneContours( )
+       void wxVtkBaseView_SceneManager::removeSceneContours()
        {
                std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin(); 
                int size = _sceneContours_ViewControl->size();
@@ -471,8 +478,6 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                        iter++;
                }
                _sceneContours_ViewControl->clear();
-
-
                //Removing the selection rectangle to avoid showing when it's innecesary
                _controlerSelectionROI->SetActive( false );             
                _viewerSelectionROI->RemoveCompleteContourActor();      
@@ -751,7 +756,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
 
                bool condition = true;  
                int X,Y;
-               wxVTKRenderWindowInteractor *_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
+               crea::wxVTKRenderWindowInteractor *_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
                _wxVTKiren->GetEventPosition( X , Y );
 
                bool ctrlKey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey() == 1;
@@ -809,9 +814,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                                        size = selectionSize;
                                        iter = _workingGroup->begin();
                                }
-                       }                       
-                       else
-                       {
+                       } else {
                                
                                _toIncludeAtInteractionGroup = false;
                        }
@@ -1120,7 +1123,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                double sg = (double)(start) / CLOCKS_PER_SEC;
 #endif
                int tmpPx,tmpPy;
-               wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
+               crea::wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition( tmpPx , tmpPy );
                fprintf(ff,"::%s (x,y) = (%i, %i) t(sg): %f\n  \n",method.c_str(), tmpPx, tmpPy, sg);
                fclose(ff);
index e565266d28361fdc24c18e89d87c0898ba91949a..ecc6a5111afd3a193d295e287d3d212b35731495 100644 (file)
@@ -209,7 +209,7 @@ class wxVtkBaseView_SceneManager : public InteractorStyleMaracas {
 
        int                       GetImageDataSizeZ();
        void              GetImageDataRange( double *range );
-       void                    SetWidthContour(double width);
+       void              SetWidthContour(double width);
 
 //JCP 21 - 09 - 08
        bool isEditableCControler(std::string theKeyName);
@@ -232,35 +232,34 @@ private:
        // Attributtes
        //------------------------------------------------------------------------------------------------------------
        
-       std::map<std::string, ContourWrap_ViewControl *> * _contours_ViewControl;
-       std::map<std::string, ContourWrap_ViewControl *> * _sceneContours_ViewControl;
-       wxVtkBaseView                           *_wxVtk_BaseView;
-       wxEvtHandler                            *_eventHandler;
-       ContourWrap_ViewControl                 *_lastInteraction;
-       std::string                             _lastInteractionName;
-       std::map<std::string, ContourWrap_ViewControl *> * _workingGroup;
-       bool                                    _creatingMULT_ROI;
-       bool                                    _editingROI;
-       bool                                    _toIncludeAtInteractionGroup;
-       bool                                    _waiting;
-       bool                                    _creatingROI;
-       int                                     _enventID;
-       int                                     _leftClickCount;
-       int                                     _rigthClickCount;
-       int                                     clickX;
-       int                                     clickY;
-       char                                    _lastKeyCode;
-       long int                                onCharCallBackTimeEnd;
-       long int                                onCharNeeded;
-       bool                                    _drawingSelectionROI;
-       manualRoiControler                      *_controlerSelectionROI;
-       manualViewRoi                           *_viewerSelectionROI;
-       manualBaseModel                         *_modelSelectionROI;
-       double                                  _widthOfContour;
-       double                                  _widthOfControlPoint;
-
-       bool _ctrlKey;
-       bool _shiftKey;
+       std::map<std::string, ContourWrap_ViewControl *>        *_contours_ViewControl;
+       std::map<std::string, ContourWrap_ViewControl *>        *_sceneContours_ViewControl;
+       wxVtkBaseView                                                                           *_wxVtk_BaseView;
+       wxEvtHandler                                                                            *_eventHandler;
+       ContourWrap_ViewControl                                                         *_lastInteraction;
+       std::string                                                                                     _lastInteractionName;
+       std::map<std::string, ContourWrap_ViewControl *>        *_workingGroup;
+       bool                                                                                            _creatingMULT_ROI;
+       bool                                                                                            _editingROI;
+       bool                                                                                            _toIncludeAtInteractionGroup;
+       bool                                                                                            _waiting;
+       bool                                                                                            _creatingROI;
+       int                                                                                                     _enventID;
+       int                                                                                                     _leftClickCount;
+       int                                                                                                     _rigthClickCount;
+       int                                                                                                     clickX;
+       int                                                                                                     clickY;
+       char                                                                                            _lastKeyCode;
+       long int                                                                                        onCharCallBackTimeEnd;
+       long int                                                                                        onCharNeeded;
+       bool                                                                                            _drawingSelectionROI;
+       manualRoiControler                                                                      *_controlerSelectionROI;
+       manualViewRoi                                                                           *_viewerSelectionROI;
+       manualBaseModel                                                                         *_modelSelectionROI;
+       double                                                                                          _widthOfContour;
+       double                                                                                          _widthOfControlPoint;
+       bool                                                                                            _ctrlKey;
+       bool                                                                                            _shiftKey;
 };
 #endif // __wxVtkBaseView_SceneManager_HEADER_FILE__
 
index 3f4a144a4ba9afb48eead9f98a17b6835b497922..3edce32a41f4b4b81d45ad16beb41ba2bd6779b5 100644 (file)
 #include "KernelManagerContour.h"
 
 
-KernelManagerContour::KernelManagerContour(){
-
-
+KernelManagerContour::KernelManagerContour()
+{
 /**THIS ALL SHOULD BE IN AN OTHER LIB CALLED PERSISTANCE
 **
 **/
-       inredo = 0;
-       inundo = 0;
-
+       inredo                          = 0;
+       inundo                          = 0;
        time_t seconds;
-       seconds = time (NULL);
-       int time = seconds;
-
-
-       stundoredo = "data/temp"+intToString(time);
-       _currentIndex = 0;
-
+       seconds                         = time (NULL);
+       int time                        = seconds;
+       stundoredo                      = "data/temp"+intToString(time);
+       _currentIndex           = 0;
        _contourPropagation = NULL;
 #if(WIN32)
                mkdir(stundoredo.c_str());
@@ -57,26 +52,20 @@ KernelManagerContour::KernelManagerContour(){
 /**
 **  FINISH PERSISTANCE
 **/
-
 }
+
 KernelManagerContour::KernelManagerContour(std::vector<vtkImageData*> images,std::string datadir,std::string tmpdir)
 {
-
-
 /**THIS ALL SHOULD BE IN AN OTHER LIB CALLED PERSISTANCE
 **
 **/
-       inredo = 0;
-       inundo = 0;
-
+       inredo          = 0;
+       inundo          = 0;
        time_t seconds;
-       seconds = time (NULL);
-       int time = seconds;
-
-
+       seconds         = time (NULL);
+       int time        = seconds;
        stundoredo = tmpdir+"/temp"+intToString(time);
        _currentIndex = 0;
-
        _contourPropagation = NULL;
 #if(WIN32)
        mkdir(tmpdir.c_str());
@@ -91,7 +80,6 @@ KernelManagerContour::KernelManagerContour(std::vector<vtkImageData*> images,std
 **/
        setVectImages(images);        
        initializeEnvironment(datadir);
-
 }
 
 KernelManagerContour::~KernelManagerContour()
@@ -108,32 +96,32 @@ void KernelManagerContour::setVectImages(std::vector<vtkImageData*> vectimg)
 {
        double spc[3];
        std::vector<double> vectspc;
-       
-       for(int i = 0; i < (int)(vectimg.size()); i++){
+       for(int i = 0; i < (int)(vectimg.size()); i++)
+       {
                vtkImageData* img = vectimg[i];
                vtkImageChangeInformation* change = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                change->SetInformationInput(img);
                change->SetInputConnection(img->GetProducerPort());
+#else
+               change->SetInputData(img);
+#endif
                img->GetSpacing(spc);
                change->SetOutputSpacing(1,1,1);
-
 //EED 18 fev 2014
                change->SetOutputOrigin (0, 0, 0);
-
                change->Update();
                vectspc.clear();
-
                vectspc.push_back(spc[0]);
                vectspc.push_back(spc[1]);
                vectspc.push_back(spc[2]);
                vectimagesSpacing.push_back(vectspc);
                vectimg[i] = change->GetOutput();
-       }
-
+       } // for i
        vectimages = vectimg;
 }
 
-
 void KernelManagerContour::GetSpacing(double *vecspc, int iImage)
 {
        vecspc[0]=vectimagesSpacing[iImage][0];
@@ -141,8 +129,8 @@ void KernelManagerContour::GetSpacing(double *vecspc, int iImage)
        vecspc[2]=vectimagesSpacing[iImage][2];
 }
 
-
-void KernelManagerContour::initializeEnvironment(std::string datadir){
+void KernelManagerContour::initializeEnvironment(std::string datadir)
+{
        _datadir = datadir;
        std::string conceptsFN                  =  datadir+"holaConceptsFile.cf";
        std::string imageSourcesFN              =  datadir+"holaImagesInstantsFile.of";
@@ -154,102 +142,121 @@ void KernelManagerContour::initializeEnvironment(std::string datadir){
        std::map<std::string, AxeThing *>* axesMap                                      = new std::map<std::string, AxeThing *>();
        std::map<std::string, ContourThing *>* outlinesMap                      = new std::map<std::string, ContourThing *>();
 
-       for(int i = 0; i < (int)(vectimages.size()); i++){
+       for(int i = 0; i < (int)(vectimages.size()); i++)
+       {
                vtkImageData* selectedimage = vectimages[i];
-               ImageSourceThing * thing                                                                        = new ImageSourceThing(selectedimage);
+               ImageSourceThing * thing                                                                = new ImageSourceThing(selectedimage);
                std::string imgstring = "Source Image "+intToString(i+1);
                sourcesMap->insert(std::pair<std::string, ImageSourceThing *>( imgstring, thing));
-       }
-
+       } // for
 
        OutlineModelBuilder * _builder                                                          = new OutlineModelBuilder( conceptsFN ,datadir);
        _builder->buildImageSource_Envornment( imageSourcesFN, sourcesMap );
        _builder->buildImageSection_Envornment( imageSectionsFN, sectionsMap );
        _builder->buildAxe_Envornment(axeThingsFN, axesMap );
        _builder->buildCountour_Envornment( imageSectionsFN, outlinesMap );
-
        //Creating the objects to manage
        modelManager                            = new OutlineModelManager( _builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(),  _builder->getContourEnv() );
-
        imageSource     = modelManager->getImageSourceThingByKeyName( "Source Image 1" );
-
 }
-vtkImageData* KernelManagerContour::getSourceImage(){
+
+vtkImageData* KernelManagerContour::getSourceImage()
+{
        return imageSource->getSourceImage();
 }
-OutlineModelManager* KernelManagerContour::getOutlineModelManager(){
+
+OutlineModelManager* KernelManagerContour::getOutlineModelManager()
+{
        return modelManager;
 }
 
-std::string KernelManagerContour::createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector){
+std::string KernelManagerContour::createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector)
+{
        return modelManager->createOutline( manModelContour, instantVector );
 }
 
-std::string KernelManagerContour::intToString(int num){
+std::string KernelManagerContour::intToString(int num)
+{
        std::string result;
-       if(num == 0){
+       if(num == 0)
+       {
                result = "0";
        }else{
                int k=num;
-               while (k > 0){
+               while (k > 0)
+               {
                        char temp = k % 10 + 48;
                        k = k / 10;
                        result = temp + result;
-               }
-       }
+               } // while
+       } // if num
        return result;
 }
 
-std::vector<std::string> KernelManagerContour::GetLstNameThingsStatic(){
+std::vector<std::string> KernelManagerContour::GetLstNameThingsStatic()
+{
        return modelManager->GetLstNameThingsStatic();
 }
 
-void KernelManagerContour::SaveThingName(FILE* pFile, FILE *pFileData, std::string name ){
+void KernelManagerContour::SaveThingName(FILE* pFile, FILE *pFileData, std::string name )
+{
        modelManager->SaveThingName(pFile, pFileData, name);
 }
-std::vector<std::string> KernelManagerContour::GetLstNameThings(){
+
+std::vector<std::string> KernelManagerContour::GetLstNameThings()
+{
        return modelManager->GetLstNameThings();
 }
+
 //int KernelManagerContour::IsPartOfStaticList(std::string keyName ){
 //     return modelManager->IsPartOfStaticList(keyName);
 //}
 
-bool KernelManagerContour::IsPartOfStaticList(std::string theKeyName){
+bool KernelManagerContour::IsPartOfStaticList(std::string theKeyName)
+{
        return modelManager->IsPartOfStaticList(theKeyName) == -1;
 }
 
-void KernelManagerContour::deleteCModel(std::string theKeyName){
+void KernelManagerContour::deleteCModel(std::string theKeyName)
+{
        manualBaseModel* cModel         = modelManager->getOutlineByKeyName(theKeyName)->getModel();
        modelManager->removeOutline( theKeyName );
-
        delete cModel;
 }
 
-void KernelManagerContour::removeAllOutlines(){
+void KernelManagerContour::removeAllOutlines()
+{
        modelManager->removeAllOutlines();
 }
 
-std::vector<NameWrapper *> KernelManagerContour::getActualInstantOutlines(){
+std::vector<NameWrapper *> KernelManagerContour::getActualInstantOutlines()
+{
        return modelManager->getActualInstantOutlines();
 }
 
-int KernelManagerContour::getNamesWrappingSize(){
+int KernelManagerContour::getNamesWrappingSize()
+{
        return getActualInstantOutlines().size();
 }
 
-std::string KernelManagerContour::getNameWrapping(int i){
+std::string KernelManagerContour::getNameWrapping(int i)
+{
        return getActualInstantOutlines()[i]->getKeyName();
 }
 
-void KernelManagerContour::setInstant(Instant * theInstant){
+void KernelManagerContour::setInstant(Instant * theInstant)
+{
        modelManager->setInstant(theInstant);
        //_actualInstant = theInstant;
 }
 
-Instant * KernelManagerContour::getCurrentInstant(){
+Instant * KernelManagerContour::getCurrentInstant()
+{
        return modelManager->getInstant();
 }
-void KernelManagerContour::setInstant(std::vector<int> vectInstant){
+
+void KernelManagerContour::setInstant(std::vector<int> vectInstant)
+{
        Instant* act = new Instant ( &vectInstant );
        modelManager->setInstant(act);
 }
@@ -264,36 +271,37 @@ manualBaseModel* KernelManagerContour::getOutlineByKeyName(std::string cloneName
        return modelManager->getOutlineByKeyName (cloneName )->getModel();
 }
 
-bool KernelManagerContour::onRedo(std::string& filename){
-       if(inredo > 0){
+bool KernelManagerContour::onRedo(std::string& filename)
+{
+       if(inredo > 0)
+       {
                inredo--;
                inundo++;
                std::string str = intToString(inundo);
                filename = stundoredo + str + ".roi";
                //loadState(temp);
                return true;
-       }
+       } // inredo
        return false;
 }
 
-bool KernelManagerContour::onUndo(std::string& filename){
-       if(inundo>0){
+bool KernelManagerContour::onUndo(std::string& filename)
+{
+       if(inundo>0)
+       {
                inredo++;
                inundo--;
-
                //char str[9000];
                //itoa(inundo, str, 10);
                std::string str = intToString(inundo);
-
-
                filename = stundoredo + str + ".roi";
-
                return true;//loadState(temp);
        }
        return false;
 }
 
-std::string KernelManagerContour::saveState(){
+std::string KernelManagerContour::saveState()
+{
        inredo=0;
        std::string str = intToString(inundo);
        std::string temp = stundoredo + str + ".roi";
@@ -301,20 +309,20 @@ std::string KernelManagerContour::saveState(){
        return temp;
 }
 
-bool KernelManagerContour::onUndoSaveFile(std::string& filename){
-       if(inundo>0){
-               if(inredo==0){
-
+bool KernelManagerContour::onUndoSaveFile(std::string& filename)
+{
+       if(inundo>0)
+       {
+               if(inredo==0)
+               {
                        //char str[9000];
                        //itoa(inundo, str, 10);
                        std::string str = intToString(inundo);
-
                        filename = stundoredo + str + ".roi";
                        return true;
                        //saveFileWithContours(temp);
-
-               }
-       }
+               }  // if inundo  ==0
+       }  // if inundo > 0
        return false;
 }
 
@@ -338,23 +346,20 @@ std::string KernelManagerContour::onSpreadAdd( std::vector<double> *vecX, std::v
     {
                _contourPropagation = new ContourPropagation();
     }
-
-    if (vecX->size()!=0){
-
+    if (vecX->size()!=0)
+       {
         int i,size=vecZ->size();
         int actualSlice = instants[1];
         for ( i=0 ; i<size ; i++ )
         {
             (*vecZ)[i] = actualSlice;
         } // for
-
         _contourPropagation->appendContour(vecX , vecY , vecZ);
         return intToString(actualSlice);
     }
        return "";
 }
 
-
 void KernelManagerContour::getMaxMinZ(double *minZ,double *maxZ)
 {
     if (_contourPropagation!=NULL)
@@ -363,7 +368,6 @@ void KernelManagerContour::getMaxMinZ(double *minZ,double *maxZ)
        }
 }
 
-
 void KernelManagerContour::CalculeSplinePropagation()
 {
        _contourPropagation->setInterpolationNumber(100);
@@ -374,13 +378,10 @@ manualBaseModel* KernelManagerContour::GetPoints(int z,int type, std::vector<dou
 {
        bool addedModel = false;
        manualBaseModel* manModelContour=NULL;
-
-       if (_contourPropagation->ifSliceKeyContourExist(z)==false){
-
+       if (_contourPropagation->ifSliceKeyContourExist(z)==false)
+       {
                manModelContour = factoryManualContourModel( typeofcontour );
-
                int idTmp = _contourPropagation->FindIdWithZ(z);
-
                if (type==0) // Initial Points
                {
                        _contourPropagation->GetInitialControlPoints( idTmp , vecCtrlPointX,vecCtrlPointY,vecCtrlPointZ);
@@ -401,67 +402,57 @@ manualBaseModel* KernelManagerContour::GetPoints(int z,int type, std::vector<dou
                        manModelContour->AddPoint( (*vecCtrlPointX)[j] , (*vecCtrlPointY)[j] , -900  );
 //--------------------------------------------------------------------
                } // for j
-
                tempVector[1]=z;
                theName = modelManager->createOutline( manModelContour, tempVector );
                addedModel = theName.compare("") != 0;
-               if(!addedModel){
+               if(!addedModel)
+               {
                        manModelContour = NULL;
                }
-
        }// ifSliceKeyContourExist
        return manModelContour;
 }
 
-manualBaseModel * KernelManagerContour::factoryManualContourModel(int typeContour)
+manualBaseModel *KernelManagerContour::factoryManualContourModel(int typeContour)
 {
        manualBaseModel *manModelContour=NULL;
-
        // Creating the model
        // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
-
        // spline
        if (typeContour==0)
        {
                manModelContour = new manualContourModel();
        }
-
        // spline
        if (typeContour==1)
        {
                manModelContour = new manualContourModel();
        }
-
        // rectangle
        if (typeContour==2)
        {
                manModelContour = new manualContourModelRoi();
        }
-
        // circle
        if (typeContour==3)
        {
                manModelContour = new manualContourModelCircle();
        }
-
        // line
        if (typeContour==6)
        {
                manModelContour = new manualContourModelLine();
        }
-
        // points
        if (typeContour==7)
        {
                manModelContour = new manualBaseModel();
        }
-
        // polygon
        if (typeContour==10)
        {
                manModelContour = new manualContourModelPolygon();
        }
-
        return manModelContour;
 }
 
index 03d34261aed9dd5038963afc0b3d0121f7043c92..a503b4e1cb2c9bf085228d76a16b4ff97fbbe84e 100644 (file)
@@ -95,7 +95,12 @@ OsirixParser::OsirixParser(std::string xsdfile, double* spacing, int* extent)
 #ifdef WIN32
 
        char currentPath[_MAX_PATH];    
-       GetModuleFileName(NULL, currentPath, _MAX_PATH);
+       
+    wchar_t currentPath2[512];
+    long result = GetModuleFileName(NULL, currentPath2, _MAX_PATH);
+//     GetModuleFileName(NULL, currentPath, _MAX_PATH);
+       int ret = wcstombs ( currentPath, currentPath2, sizeof(pname) );        
+       
        TEMPIMPORTOSIRIXFILE = currentPath;
 
        TEMPIMPORTOSIRIXFILE = TEMPIMPORTOSIRIXFILE.substr(0,TEMPIMPORTOSIRIXFILE.find_last_of("\\"));
index 585878bdc844b39e63b6ec8441360947f5b674e1..edfb3f402bd9c796ee75b7c4fde32dacddbf5efa 100644 (file)
@@ -103,7 +103,12 @@ void
 VTKImageToImageFilter<TOutputImage>
 ::SetInput( vtkImageData * inputImage )
 {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
   m_Exporter->SetInput( inputImage );
+#else
+  m_Exporter->SetInputData( inputImage );
+#endif
 }