From d8ae77db08ab2e951c0e984c20fc47b615744abb Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 10 Dec 2019 15:28:28 +0100 Subject: [PATCH] #3322 creaContours Feature New Normal - Show reference contour Befor After actual slice --- bbtk/src/bbcreaContoursSetViewerPosition.cxx | 21 ++++- bbtk/src/bbcreaContoursSetViewerPosition.h | 2 + .../interfMainPanel.cxx | 34 ++------ .../interfMainPanel.h | 1 + .../interfToolsPanels.cxx | 32 +++++--- .../interfToolsPanels.h | 9 ++- .../wxContourMainFrame.cxx | 33 ++++++-- .../wxContourMainFrame.h | 1 + .../wxContourViewPanel.cxx | 77 ++++++++++++------- .../wxContourViewPanel.h | 36 ++------- .../KernelManagerContour.cxx | 2 +- 11 files changed, 137 insertions(+), 111 deletions(-) diff --git a/bbtk/src/bbcreaContoursSetViewerPosition.cxx b/bbtk/src/bbcreaContoursSetViewerPosition.cxx index 67c824e..365c4a0 100644 --- a/bbtk/src/bbcreaContoursSetViewerPosition.cxx +++ b/bbtk/src/bbcreaContoursSetViewerPosition.cxx @@ -42,8 +42,24 @@ void SetViewerPosition::Process() img->GetExtent(ext); int dimY=ext[3]-ext[2]+1; - bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", y ); - bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1); + if (bbGetInputDirection()==0) + { + bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", z ); + bbGetInputwxContourMainFrame()->SetXY(x,y); + } // if Direction1 + + if (bbGetInputDirection()==1) + { + bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", y ); + bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1); + } // if Direction1 + + if (bbGetInputDirection()==2) + { + bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", x ); + bbGetInputwxContourMainFrame()->SetXY(dimY-z-1,y); + } // if Direction1 + bbGetInputwxContourMainFrame()->showAxis(true); bbGetInputwxContourMainFrame()->changeInstant(); @@ -60,6 +76,7 @@ void SetViewerPosition::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 + bbSetInputDirection(0); bbSetInputwxContourMainFrame(NULL); } diff --git a/bbtk/src/bbcreaContoursSetViewerPosition.h b/bbtk/src/bbcreaContoursSetViewerPosition.h index d279eda..af6e6eb 100644 --- a/bbtk/src/bbcreaContoursSetViewerPosition.h +++ b/bbtk/src/bbcreaContoursSetViewerPosition.h @@ -22,6 +22,7 @@ class bbcreaContours_EXPORT SetViewerPosition //===== BBTK_DECLARE_INPUT(wxContourMainFrame,wxContourMainFrame*); BBTK_DECLARE_INPUT(Position,std::vector); + BBTK_DECLARE_INPUT(Direction,int); // BBTK_DECLARE_OUTPUT(Out,double); BBTK_PROCESS(Process); void Process(); @@ -38,6 +39,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(SetViewerPosition,bbtk::AtomicBlackBox); BBTK_INPUT(SetViewerPosition,wxContourMainFrame,"wxContourMainFrame",wxContourMainFrame*,""); BBTK_INPUT(SetViewerPosition,Position,"vector px py pz",std::vector,""); + BBTK_INPUT(SetViewerPosition,Direction,"(default 0) 0:XYZ 1:XZY 2:YZX",int,""); //BBTK_OUTPUT(SetViewerPosition,Out,"First output",double,""); diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx index 3f17f76..c54ec11 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx @@ -595,6 +595,11 @@ void interfMainPanel::onInterpolation(bool interpolate) wxContourMainFrame::getInstance()->onInterpolation(interpolate); } +void interfMainPanel::onBeforAfterContour(bool before, bool after) +{ + wxContourMainFrame::getInstance()->onBeforeAfterContour(before,after); +} + void interfMainPanel::onConfigurationPressed() { @@ -672,51 +677,36 @@ void interfMainPanel::onInformationPressed() // Statistics frame 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->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){ infoPanelMask = new wxPanel(panelAux, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T(""))); @@ -727,15 +717,11 @@ printf("EED interfMainPanel::onInformationPressed 2\n"); wxPanel *panel = wxContourMainFrame::getInstance()->getMaskImageViewPanel( infoPanelMask ); wxStaticText* stattext = new wxStaticText(infoPanelMask, -1, wxString(_T(" Mask segmentation ")), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T(""))); - flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE); - flexsizer->Add(panel, wxEXPAND); infoPanelMask->Layout(); - } -printf("EED interfMainPanel::onInformationPressed 3\n"); //CMRU 29-08-09----------------------------------------------------------------------------------------------- //Calibration panel if(infoPanelCalibration == NULL) @@ -747,13 +733,10 @@ printf("EED interfMainPanel::onInformationPressed 3\n"); 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(""))); - flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE); - 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 @@ -762,20 +745,13 @@ printf("EED interfMainPanel::onInformationPressed 4\n"); 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"); } diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.h b/lib/Interface_Icons_NDimensions/interfMainPanel.h index 4513de2..c9267a7 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.h +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.h @@ -169,6 +169,7 @@ public: int getWindowLevel(); void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel); void onInterpolation(bool interpolate); + void onBeforAfterContour(bool before, bool after); void onSpreadPressed(); void onConfigurationPressed(); void resetAppend(); diff --git a/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx b/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx index 263d4e7..b26ed89 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx +++ b/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx @@ -51,9 +51,16 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent) _brithtnessWindowLevel = new wxSlider(this, -1, windowlevel , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); _brithtnessColorLevel = new wxSlider(this, -1, colorwindow , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); - _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image interpolation") ); + _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image Interpolation") ); _interpolationCheckBox->SetValue(true); + _beforContourCheckBox = new wxCheckBox(this, -1, _T("Befor Contour") ); + _beforContourCheckBox->SetValue(false); + + _afterContourCheckBox = new wxCheckBox(this, -1, _T("After Contour") ); + _afterContourCheckBox->SetValue(false); + + Connect( _withOfContourLine->GetId(), wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour); Connect( _withOfContourLine->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour); @@ -62,20 +69,21 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent) Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel); Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel); Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnInterpolation); + Connect( _beforContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour); + Connect( _afterContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour); wxFlexGridSizer * sizer = new wxFlexGridSizer(1); sizer -> Add( new wxStaticText(this,-1, _T("Contour width")) , 1, wxGROW ); sizer -> Add( _withOfContourLine , 1, wxGROW ); sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T("Brightness of the image")) , 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T("--Window level--")) , 1, wxGROW ); + sizer -> Add( new wxStaticText(this,-1, _T("Window level")) , 1, wxGROW ); sizer -> Add( _brithtnessWindowLevel , 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T("--Color level--")) , 1, wxGROW ); + sizer -> Add( new wxStaticText(this,-1, _T("Color level")) , 1, wxGROW ); sizer -> Add( _brithtnessColorLevel, 1, wxGROW ); sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); sizer -> Add( _interpolationCheckBox , 1, wxGROW ); + sizer -> Add( _beforContourCheckBox , 1, wxGROW ); + sizer -> Add( _afterContourCheckBox , 1, wxGROW ); this->SetSizer( sizer ); //JCP 13-10-08 @@ -91,8 +99,8 @@ interfConfigurationPanel::~interfConfigurationPanel() { } -void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event){ - +void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event) +{ double width = (double)_withOfContourLine->GetValue() / 2.0; interfMainPanel::getInstance()->onWidthOfContour(width); } @@ -100,18 +108,20 @@ void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event){ void interfConfigurationPanel::onBrigthnessColorWindowLevel(wxScrollEvent& event){ int colorwindow = _brithtnessColorLevel->GetValue(); int windowlevel = _brithtnessWindowLevel->GetValue(); - interfMainPanel::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel); - } void interfConfigurationPanel::OnInterpolation(wxCommandEvent& event) { interfMainPanel::getInstance()->onInterpolation(_interpolationCheckBox->GetValue()); +} - +void interfConfigurationPanel::OnBeforAfterContour(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onBeforAfterContour(_beforContourCheckBox->GetValue() , _afterContourCheckBox->GetValue() ); } + /** ** Begin of the spread panel **/ diff --git a/lib/Interface_Icons_NDimensions/interfToolsPanels.h b/lib/Interface_Icons_NDimensions/interfToolsPanels.h index 4ee437e..d5c7815 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsPanels.h +++ b/lib/Interface_Icons_NDimensions/interfToolsPanels.h @@ -41,10 +41,13 @@ private: void onWidthOfContour(wxScrollEvent& event); void onBrigthnessColorWindowLevel(wxScrollEvent& event); void OnInterpolation(wxCommandEvent& event); - wxSlider* _withOfContourLine; - wxSlider* _brithtnessWindowLevel; - wxSlider* _brithtnessColorLevel; + void OnBeforAfterContour(wxCommandEvent& event); + wxSlider* _withOfContourLine; + wxSlider* _brithtnessWindowLevel; + wxSlider* _brithtnessColorLevel; wxCheckBox* _interpolationCheckBox; + wxCheckBox* _beforContourCheckBox; + wxCheckBox* _afterContourCheckBox; }; class interfSpreadPanel diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 5f3aeae..f780b86 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -140,10 +140,10 @@ void wxContourMainFrame::setVectImages(std::vector imgs) #elif defined(__GNUC__) std::string str_home(getenv("HOME")); #endif - std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/"; - std::vector conceptNameVect; - std::vector conceptSizeVect; - notebook = this->createNotebook(); + std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/"; + std::vector conceptNameVect; + std::vector 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 ); @@ -394,12 +394,17 @@ void wxContourMainFrame :: onCreateContourBullEye(wxPanel* panel ) } } -void wxContourMainFrame :: createContour( int typeContour ) +void wxContourMainFrame::createContour( int typeContour ) { //Creating the manualContourModel and including in the model manualBaseModel * manModelContour = kernelManager->factoryManualContourModel(typeContour); std::vector instantVector; _instantPanel->getInstant( instantVector ); + + std::vector tempVector; + getInstantVector( tempVector ); + manModelContour->SetLabel2( std::to_string(tempVector[1]) ); + std::string theName = kernelManager->createOutline(manModelContour, instantVector); /*std::vector instantVector; _instantPanel->getInstant( instantVector ); @@ -548,11 +553,17 @@ void wxContourMainFrame :: deleteContour( std::string theKeyName ) //JCP 21 - 11 - 08 } -void wxContourMainFrame::onDeleteContoursActSlice(){ +void wxContourMainFrame::onDeleteContoursActSlice() +{ //JCP 20-10-08 Undo redo implementation saveState(); //JCP 20-10-08 Undo redo implementation - deleteContours( (std::vector)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() ); + + std::vector tempVector; + getInstantVector( tempVector ); + deleteContours( getOutlinesName( tempVector[1] ) ); +// deleteContours( (std::vector)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() ); + } void wxContourMainFrame::onDeleteAllContours(){ //JCP 20-10-08 Undo redo implementation @@ -2390,6 +2401,13 @@ void wxContourMainFrame::onInterpolation(bool interpolate) RefreshInterface(); } +void wxContourMainFrame::onBeforeAfterContour(bool before,bool after) +{ + _theViewPanel->onBeforeAfterContour(before,after); + RefreshInterface(); +} + + void wxContourMainFrame::onChangeInstant(std::string name,int actual) { _instantPanel->setConceptValue( name, actual ); @@ -2512,7 +2530,6 @@ void wxContourMainFrame::onSpreadGo(int type) void wxContourMainFrame::getInstantVector(std::vector& tempVector) { - printf("wxContourMainFrame::getInstantVector Warning!! Methon not implemented ... \n"); _instantPanel->getInstant( tempVector ); } diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h index d752f4a..cceebd8 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h @@ -264,6 +264,7 @@ class wxContourMainFrame : public wxPanel { int getWindowLevel(); void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel); void onInterpolation(bool interpolate); + void onBeforeAfterContour(bool before, bool after); void onChangeInstant(std::string name,int actual); void resetAppend(); void onSpreadAdd(); diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx index f0d33dd..de7b906 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx @@ -58,6 +58,8 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) { theShowingImage->GetSpacing(last_spacing); showingVID = theShowingImage; + _before = false; + _after = false; int gapH = 20; int gapV = 10; _verticalConceptName = ""; @@ -717,40 +719,51 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) _sceneManager->addToScene(name, true, true, true, false, false ); } // for i - -printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n"); -printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n"); -printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n"); -printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n"); -printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n"); -printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code ...\n"); -//EED 2019-12-05 -// falta buscar slice antes y despues para encontrar elementos -// falta cambiar de colores para antes y despues -// falta un flag que active y desactive esta opcion - std::vector tempVector; wxContourMainFrame::getInstance()->getInstantVector( tempVector ); - // Contours Befor - std::vector lstNameBefor = wxContourMainFrame::getInstance()->getOutlinesName(tempVector[1]-10); - size = lstNameBefor.size(); - for(i = 0; i < size;i++) + if (_before==true) { - // ctrol active showCtr - _sceneManager->addToScene(lstNameBefor[i], true, true, false, false, false ); - } // for i - - // Contours After - std::vector lstNameAfter = wxContourMainFrame::getInstance()->getOutlinesName(tempVector[1]+10); - size = lstNameAfter.size(); - for(i = 0; i < size;i++) + std::vector lstNameBefor; + // Contours Befor + for (i=tempVector[1]-1; i>=0; i--) + { + lstNameBefor = wxContourMainFrame::getInstance()->getOutlinesName( i ); + size = lstNameBefor.size(); + if (size!=0) + { + i=-1; + } //if size + } // for + for(i = 0; i < size;i++) + { + // ctrol active showCtr + _sceneManager->addToScene(lstNameBefor[i], true, true, false, false, false ); + } // for i + } // if _before Contour + + if (_after==true) { - // ctrol active showCtr - _sceneManager->addToScene(lstNameAfter[i], true, true, false, false, false ); - } // for i - - + std::vector lstNameAfter; + // Contours After + int ext[6]; + getImageData()->GetExtent(ext); + int dimZ=ext[5]-ext[4]+1; + for (i=tempVector[1]+1; igetOutlinesName( i ); + size = lstNameAfter.size(); + if (size!=0) + { + i=dimZ; + } //if size + } // for + for(i = 0; i < size;i++) + { + // ctrol active showCtr + _sceneManager->addToScene(lstNameAfter[i], true, true, false, false, false ); + } // for i + } // if _after Contour } std::vector wxContourViewPanel::getSelectedObjects(){ @@ -814,6 +827,12 @@ printf("EED \wxContourViewPanel::addNameWrapperToScene Clean this part of code wxvtk2dbaseview->SetInterpolate( interpolate ); } + void wxContourViewPanel::onBeforeAfterContour(bool before, bool after) + { + _before = before; + _after = after; + } + void wxContourViewPanel::GetPointsOfActualContour( std::vector *vecX, std::vector *vecY, std::vector *vecZ ) { _sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ); diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.h b/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.h index 5901157..3e134a9 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.h @@ -280,17 +280,12 @@ class wxContourViewPanel : public wxPanel * @return _verticalConcept The name of the concept for setting at the vertical bar */ std::string getVerticalConceptName( ); - //------------------------------------------------------------------------------------------------------------ // Other functional methods //------------------------------------------------------------------------------------------------------------ - void getSpacing( double * spacing ); - wxVtkBaseView* getWxVtkBaseView(); - double getCurrentDeep(); - void SetVisibleAxis(bool ok); int GetX(); int GetY(); @@ -313,43 +308,26 @@ class wxContourViewPanel : public wxPanel void onStopCreateROI (wxCommandEvent& event); void onChangedDeep (wxCommandEvent& event); void onActionButtonPressed(wxCommandEvent& event); - void removeSceneContours(); void addNameWrapperToScene(); - std::vector getSelectedObjects(); - void RefreshInterface(); - vtkImageData* getImageData(); - void configureViewControlTo(std::string theName,manualBaseModel* manModelContour,double* spc,int typeofcontour); - - int GetImageDataSizeZ(); - + int GetImageDataSizeZ(); void GetImageDataRange(double *range); - void SetWidthContour(double width ); - - int getColorWindow(); - - int getWindowLevel(); - + int getColorWindow(); + int getWindowLevel(); void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel); - void onInterpolation(bool interpolate); - + void onBeforeAfterContour(bool before, bool after); void GetPointsOfActualContour( std::vector *vecX, std::vector *vecY, std::vector *vecZ ); - void changeImage(vtkImageData* img); - void changeDeep(); - void setImageSlice(int z); - -private: - +private: //------------------------------------------------------------------------------------------------------------ // Attributtes //------------------------------------------------------------------------------------------------------------ @@ -380,6 +358,8 @@ private: bool _useHorizontalBar; wxEvtHandler *_eventHandler; + bool _before; + bool _after; //EED @@ -389,7 +369,7 @@ private: - wxVtkMPR2DView * GetwxVtkMPR2DView(); + wxVtkMPR2DView *GetwxVtkMPR2DView(); // DECLARE_CLASS(wxContourViewPanel) diff --git a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx index 3edce32..a1cf210 100644 --- a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx +++ b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx @@ -108,7 +108,7 @@ void KernelManagerContour::setVectImages(std::vector vectimg) change->SetInputData(img); #endif img->GetSpacing(spc); - change->SetOutputSpacing(1,1,1); +// change->SetOutputSpacing(1,1,1); //EED 18 fev 2014 change->SetOutputOrigin (0, 0, 0); change->Update(); -- 2.45.1