]> Creatis software - creaContours.git/commitdiff
#3322 creaContours Feature New Normal - Show reference contour Befor After actual...
authorEduardo DAVILA <davila@ei-ed-606.univ-lyon1.fr>
Tue, 10 Dec 2019 14:28:28 +0000 (15:28 +0100)
committerEduardo DAVILA <davila@ei-ed-606.univ-lyon1.fr>
Tue, 10 Dec 2019 14:28:28 +0000 (15:28 +0100)
bbtk/src/bbcreaContoursSetViewerPosition.cxx
bbtk/src/bbcreaContoursSetViewerPosition.h
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.h
lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
lib/Interface_Icons_NDimensions/interfToolsPanels.h
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/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx

index 67c824e97ed35ed887514f7a6dd10a804e3dbd30..365c4a0973eda1ea94297c6cde112cb2b55e55c4 100644 (file)
@@ -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);
   
 }
index d279eda5ba76332a98b03818348150ba712d68c6..af6e6eb18ce49b56261fe26bb7ebd79592f89783 100644 (file)
@@ -22,6 +22,7 @@ class bbcreaContours_EXPORT SetViewerPosition
 //===== 
   BBTK_DECLARE_INPUT(wxContourMainFrame,wxContourMainFrame*);
   BBTK_DECLARE_INPUT(Position,std::vector<int>);
+  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<int>,"");
+  BBTK_INPUT(SetViewerPosition,Direction,"(default 0) 0:XYZ 1:XZY 2:YZX",int,"");
 
   //BBTK_OUTPUT(SetViewerPosition,Out,"First output",double,"");
 
index 3f17f76490f9f79ed8a07c08aac7487e6f1e8d9b..c54ec1191508657b7eef8590fcd912fe3167bd9e 100644 (file)
@@ -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");
 }
 
 
index 4513de238b78d2c0183ea9ed4745506c4172e6be..c9267a7a3e7a6f6ab134d1099d5c1c9fa290b82b 100644 (file)
@@ -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();
index 263d4e7078c0bc46d438b0c3ee2fc13a7252e1e5..b26ed89371a5082d90fdeefa08c73995f5f21e93 100644 (file)
@@ -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
 **/
index 4ee437e05a7b5201d38e04bd05dae17cf471149b..d5c7815df87aa2d7ca06f68b7d648846949736bd 100644 (file)
@@ -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
index 5f3aeae73e9f417bf750f2296c57ea16961f447e..f780b86c741d31df73826895a236ef25cc0acdf7 100644 (file)
@@ -140,10 +140,10 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
        #elif defined(__GNUC__)
                std::string str_home(getenv("HOME"));
        #endif
-       std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
-       std::vector<std::string> conceptNameVect;
-       std::vector<int> conceptSizeVect;
-       notebook = this->createNotebook();
+       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 );
@@ -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<int> instantVector;
        _instantPanel->getInstant( instantVector );
+
+       std::vector<int> tempVector;
+       getInstantVector( tempVector );
+       manModelContour->SetLabel2( std::to_string(tempVector[1]) );
+
        std::string theName = kernelManager->createOutline(manModelContour, instantVector);
        /*std::vector<int> 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<std::string>)_theViewPanel->getSceneManager()->GetlstContoursNameActualSlice() );
+
+       std::vector<int> tempVector;
+       getInstantVector( tempVector );
+       deleteContours( getOutlinesName( tempVector[1] ) );
+//     deleteContours( (std::vector<std::string>)_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<int>& tempVector)
 {
-       printf("wxContourMainFrame::getInstantVector   Warning!!  Methon not implemented ... \n");
        _instantPanel->getInstant( tempVector );
 }
 
index d752f4ac857294ef8f874f0882971df63c7fd9d0..cceebd807b59ba75a1b6c77df7d56832b4181a2a 100644 (file)
@@ -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();
index f0d33dd4656755af22c7b25f9ca7ff6b874ebc86..de7b90660a8eb27c230f8b4a4736f2bcbef7fbeb 100644 (file)
@@ -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<int> tempVector;
                wxContourMainFrame::getInstance()->getInstantVector( tempVector );
 
-               // Contours Befor
-               std::vector<std::string> 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<std::string> lstNameAfter = wxContourMainFrame::getInstance()->getOutlinesName(tempVector[1]+10);
-               size = lstNameAfter.size();
-               for(i = 0; i < size;i++)
+                       std::vector<std::string> 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<std::string> lstNameAfter;
+                       // Contours After
+                       int ext[6];
+                       getImageData()->GetExtent(ext);
+                       int dimZ=ext[5]-ext[4]+1;
+                       for (i=tempVector[1]+1; i<dimZ; i++)
+                       {
+                               lstNameAfter = wxContourMainFrame::getInstance()->getOutlinesName( 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<std::string> 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<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ )
        {
                _sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ);
index 59011577de3225012eadad1e7c8e0558595fffd3..3e134a984796d68c63f56dd52bb8e5b93c6968ac 100644 (file)
@@ -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<std::string> 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<double> *vecX, std::vector<double> *vecY, std::vector<double> *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)
index 3edce32a41f4b4b81d45ad16beb41ba2bd6779b5..a1cf210c43e803ddcbeec536e969fc3e31b72a11 100644 (file)
@@ -108,7 +108,7 @@ void KernelManagerContour::setVectImages(std::vector<vtkImageData*> 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();