]> Creatis software - creaContours.git/commitdiff
*** empty log message ***
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Tue, 31 Mar 2009 14:53:10 +0000 (14:53 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Tue, 31 Mar 2009 14:53:10 +0000 (14:53 +0000)
bbtk/CMakeLists.txt
bbtk/src/bbCreaContournDimensions.cxx
bbtk/src/bbCreaContournDimensions.h
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h

index 247713a5718cde75b234fedd6e9929efbc2d37b6..3c8c76d702f9415acf592bd87d97f52bb764a326 100644 (file)
@@ -36,7 +36,7 @@ SET(${BBTK_PACKAGE_NAME}_BUILD_VERSION 0)
 #===========================================================================
 # UNCOMMENT EACH LIBRARY NEEDED (WILL BE FOUND AND USED AUTOMATICALLY)
  SET(${BBTK_PACKAGE_NAME}_USE_VTK  ON)
-# SET(${BBTK_PACKAGE_NAME}_USE_ITK  ON)
+ SET(${BBTK_PACKAGE_NAME}_USE_ITK  ON)
 # SET(${BBTK_PACKAGE_NAME}_USE_GDCM ON)
 # SET(${BBTK_PACKAGE_NAME}_USE_GSMIS ON)
  SET(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS ON)
index 85b23a0fbcc9298b4ccacdf0ae1cf8b4ef36d8a9..52aeb2882d3a524ae491283d12666f4ff74fa558 100644 (file)
@@ -12,8 +12,20 @@ void nDimensions::Process()
        std::vector<int> size;
        vtkImageData *mask, *value;
 
+       vtkImageData* img = bbGetInputIn();
+
+       std::vector<vtkImageData*> selectedimages;
+       if(img!=NULL && currentimg!=img){
+
+               currentimg=img;
+               selectedimages.push_back(img);
+               frame->setVectImages(selectedimages);
+       }
+
+
+
        if(bbGetInputGet()==1){
-               bbSetInputGet(0);
+               bbSetInputGet(0);               
                //eventHandler->checkInformationPanel();
                //eventHandler->getValuesXYZ(vectx, vecty, vectz, &size);       
                //eventHandler->getMaskValue(mask, value);
@@ -34,13 +46,15 @@ void nDimensions::CreateWidget(wxWindow* parent)
        std::vector<vtkImageData*> selectedimages;
        //selectedimages.push_back(img);
 
-       wxFrame* frame1 = new wxFrame(parent, wxID_ANY, wxT("ROI Application  -    Evaluation version, 23 Oct 2008 "), wxPoint(400,50), wxSize(800, 600) );
-       frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages );
+       //wxFrame* frame1 = new wxFrame(parent, wxID_ANY, wxT("ROI Application  -    Evaluation version, 23 Oct 2008 "), wxPoint(400,50), wxSize(800, 600) );
+       //frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages );      
        //new wxContourMainFrame( frame1, wxID_ANY, _T(""), wxPoint(50,50), wxSize(800, 600),selectedimages ); 
-       frame1->CreateStatusBar();
-
+       //frame1->CreateStatusBar();
+       //bbSetOutputWidget( frame1 ); 
+       frame = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages );
+       bbSetOutputWidget( frame ); 
        
-   bbSetOutputWidget( frame1 ); 
+   
 
     
   
@@ -49,6 +63,7 @@ void nDimensions::bbUserConstructor()
 {
 
        bbSetInputGet(0);
+       bbSetInputIn(NULL);
 
 }
 void nDimensions::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
index 9c3587e1f74f08d85635b22e83d89979b1c38876..1f9989ccee3fd23bc4daf7ce1535e780daacb9b2 100644 (file)
@@ -47,6 +47,7 @@ virtual void bbUserDestructor();
 
 private:
        wxContourMainFrame* frame;
+       vtkImageData* currentimg;
        //wxContourEventHandler * eventHandler;
 
 };
index cfa1e02f9c3605c5797664bfc0ad1b173cae1e9f..4cfa08134be989b9946325c498bb01b7ab4ca905 100644 (file)
@@ -72,19 +72,8 @@ char wxContourMainFrame::COPY = 'C';
                m_mgr.SetManagedWindow(this);
                _creatingContoursActive         = false;
                _theViewPanel                           = NULL;
-//             _modelManager                           = NULL;
-               _instantPanel                           = NULL;
-//             _buttonsBar                                     = NULL;
-//             _gridPanel                                      = NULL; 
-//             _drawToolsPanel                         = NULL;
-//             _operationsToolsPanel           = NULL;
-//             _autoFormsPanel                         = NULL; 
-//             _standardToolsPanel                     = NULL;
-//             _editionToolsPanel                      = NULL;
-//             _listViewPanel                          = NULL;
-//             _sceneManager                           = NULL;
-//             _actualInstant                          = NULL;
 
+               _instantPanel                           = NULL;
                _refLineControl                         = NULL;
                _refLineModel                           = NULL;
                _refLineView                            = NULL;
@@ -93,57 +82,48 @@ char wxContourMainFrame::COPY = 'C';
                m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
                m_notebook_theme = 0;   
                //wxContour_ActionCommandsID a;
-               _numberOfVariablesStatistics = 6+1;
-
+               _numberOfVariablesStatistics = 7;
 
-               _performingOperation                    = new PerformingOperation();
-//JCP 17 - 10 - 2008
+               _datadir = datadir;
 
+       
        inredo = 0;
        inundo = 0;
 
-#if defined(__GNUC__)
-               std::string str_home(getenv("HOME"));
-#elif defined(_WIN32)
-               std::string str_home(getenv("USERPROFILE"));
-#endif
-               std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
-//             std::string command("mkdir "+strCreaContourDataTmp);
-//        system( command.c_str() );
-               
-               kernelManager = new KernelManagerContour( images , datadir+"/data/" , strCreaContourDataTmp );
-       //kernelManager->setVectImages(images);
-       //kernelManager->initializeEnvironment();
-                       
-       //vtkImageData* selectedimage = kernelManager->getVectImages()[0];
-       
-//-------------------------------------------------------------
+       interfMainPanel* pannew = interfMainPanel::getInstance(parent,datadir+"/data/Icons");//, eventHandler);
+       _performingOperation                    = new PerformingOperation();
 
-       /*frame = new wxContourMainFrame(_builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(),  _builder->getContourEnv(),NULL, wxID_ANY, wxT("ROI Application Sample"), wxPoint(50,50), wxSize(800, 600)); 
-       frame->Show(TRUE);*/
 
-       //Creating the evtHandler of the panels
-       //wxContourEventHandler * eventHandler = new wxContourEventHandler();
 
-       //Creating the window that will show the panels
+       if(images.size() > 0){
+               this->setVectImages(images);
+       }
 
-       //Getting the parent for the panels ( using aui )
-       wxAuiNotebook * notebook = this->createNotebook();
+}
+
+void wxContourMainFrame::setVectImages( std::vector<vtkImageData*> images ){
+
+       #if defined(__GNUC__)
+               std::string str_home(getenv("HOME"));
+       #elif defined(_WIN32)
+                       std::string str_home(getenv("USERPROFILE"));
+       #endif
+               std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
 
-       //JCP 17 - 11 - 08
-       //wxInstantChooserPanel * instantPanel                          = new wxInstantChooserPanel( notebook, "Instant Chooser", true);
-       //JCP 17 - 11 - 08
        std::vector<std::string> conceptNameVect;
        std::vector<int> conceptSizeVect;
-       
 
+       wxAuiNotebook * notebook = this->createNotebook();              
 
-       _instantPanel                           = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
-       _theViewPanel                           = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );  
 
+       kernelManager = new KernelManagerContour( images , _datadir+"/data/" , strCreaContourDataTmp );
 
 
-    kernelManager->getConceptsInformation(conceptNameVect, conceptSizeVect);
+       _instantPanel                           = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
+       _theViewPanel                           = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );  
+               
+//-------------------------------------------------------------
+       kernelManager->getConceptsInformation(conceptNameVect, conceptSizeVect);
        _instantPanel->addConcepts(conceptNameVect, conceptSizeVect);
                
 
@@ -154,22 +134,9 @@ char wxContourMainFrame::COPY = 'C';
        //*******************changeInstant();
        _theViewPanel->setVerticalConcept( "Axe Depth", data->getMinValue(), data->getMaxValue(), data->getMinShowedValue(),  data->getMaxShowedValue(), data->getActualValue() );
 
-       //eventHandler->setModelManager( kernelManager->getOutlineModelManager() );
-       //eventHandler->setViewPanel( _theViewPanel );
-       //_theViewPanel->initializeScenceManager();
-       //eventHandler->setInstantChooserPanel( _instantPanel );
-       
-       //bool successConfiuration = eventHandler->configureEventsHandling();
-
-       //successConfiuration &= this->configurePanels( notebook );
        this->configurePanels( notebook );
 
-       interfMainPanel* pannew = interfMainPanel::getInstance(parent,datadir+"/data/Icons");//, eventHandler);
-
-//JCP 17 -10 - 2008
-
-
-       }
+}
 
 
        wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir ){
index b48f08a17e482b05d5fc7a2876045df3d6ddf4e6..6259baff6ae56dbe6f5fbcd6f9dddf2cda2742c0 100644 (file)
@@ -119,13 +119,16 @@ class wxContourMainFrame : public wxPanel {
        
 
        wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
-       wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,std::string datadir="<void>");
+       wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,std::string datadir="C:/Creatis/creaContoursBin/RelWithDebInfo/");
 
        ~wxContourMainFrame();
 
        //------------------------------------------------------------------------------------------------------------
        // Creational and initialization methods
        //------------------------------------------------------------------------------------------------------------
+
+       void setVectImages( std::vector<vtkImageData*> images );
+
        bool configurePanels(wxAuiNotebook * theNoteBook );
 
        void setNotebook( wxAuiNotebook * theNoteBook );
@@ -172,7 +175,7 @@ class wxContourMainFrame : public wxPanel {
        //------------------------------------------------------------------------------------------------------------
        //  Attributes getters and setters
        //------------------------------------------------------------------------------------------------------------
-       static wxContourMainFrame* getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, std::string datadir="<void>");
+       static wxContourMainFrame* getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, std::string datadir="C:/Creatis/creaContoursBin/RelWithDebInfo/");
        static wxContourMainFrame* getInstance();
        //------------------------------------------------------------------------------------------------------------
        //  Other functional methods
@@ -308,6 +311,8 @@ private:
 
        KernelManagerContour* kernelManager;
 
+       std::string _datadir;
+
        wxContourViewPanel* _theViewPanel;
 
        wxInstantChooserPanel * _instantPanel;