From: Juan Prieto Date: Tue, 31 Mar 2009 14:53:10 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: EED.02Oct2009~57 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=fce8424fdb8d78a343ccc1dd9551bbded44ab5fe;p=creaContours.git *** empty log message *** --- diff --git a/bbtk/CMakeLists.txt b/bbtk/CMakeLists.txt index 247713a..3c8c76d 100644 --- a/bbtk/CMakeLists.txt +++ b/bbtk/CMakeLists.txt @@ -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) diff --git a/bbtk/src/bbCreaContournDimensions.cxx b/bbtk/src/bbCreaContournDimensions.cxx index 85b23a0..52aeb28 100644 --- a/bbtk/src/bbCreaContournDimensions.cxx +++ b/bbtk/src/bbCreaContournDimensions.cxx @@ -12,8 +12,20 @@ void nDimensions::Process() std::vector size; vtkImageData *mask, *value; + vtkImageData* img = bbGetInputIn(); + + std::vector 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 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) diff --git a/bbtk/src/bbCreaContournDimensions.h b/bbtk/src/bbCreaContournDimensions.h index 9c3587e..1f9989c 100644 --- a/bbtk/src/bbCreaContournDimensions.h +++ b/bbtk/src/bbCreaContournDimensions.h @@ -47,6 +47,7 @@ virtual void bbUserDestructor(); private: wxContourMainFrame* frame; + vtkImageData* currentimg; //wxContourEventHandler * eventHandler; }; diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index cfa1e02..4cfa081 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -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 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 conceptNameVect; std::vector 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 images, long style,std::string datadir ){ diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h index b48f08a..6259baf 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h @@ -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 images, long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,std::string datadir=""); + wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector images, long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,std::string datadir="C:/Creatis/creaContoursBin/RelWithDebInfo/"); ~wxContourMainFrame(); //------------------------------------------------------------------------------------------------------------ // Creational and initialization methods //------------------------------------------------------------------------------------------------------------ + + void setVectImages( std::vector 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 images, long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, std::string datadir=""); + static wxContourMainFrame* getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector 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;