]> Creatis software - creaContours.git/commitdiff
Merge remote-tracking branch 'origin/vtk8itk5wx3-mingw64' into vtk8itk5wx3-macos
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 9 Dec 2021 10:38:03 +0000 (11:38 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 9 Dec 2021 10:38:03 +0000 (11:38 +0100)
29 files changed:
appli/wxContourGUIExample/wxContourGUIExample.cxx
bbtk/src/bbCreaContournDimensions.cxx
bbtk/src/bbCreaContournDimensions.h
bbtk/src/bbcreaContoursGetWxVtkBaseView.cxx [new file with mode: 0644]
bbtk/src/bbcreaContoursGetWxVtkBaseView.h [new file with mode: 0644]
bbtk/src/bbcreaContoursOnSave.cxx [new file with mode: 0644]
bbtk/src/bbcreaContoursOnSave.h [new file with mode: 0644]
bbtk/src/bbcreaContoursSetColorLayerImage.cxx [new file with mode: 0644]
bbtk/src/bbcreaContoursSetColorLayerImage.h [new file with mode: 0644]
bbtk/src/bbcreaContoursSetFileLocation.cxx [new file with mode: 0644]
bbtk/src/bbcreaContoursSetFileLocation.h [new file with mode: 0644]
bbtk/src/bbcreaContoursSetViewerPosition.cxx [new file with mode: 0644]
bbtk/src/bbcreaContoursSetViewerPosition.h [new file with mode: 0644]
lib/Interface_Icons_NDimensions/interfDeleteMenu.cxx
lib/Interface_Icons_NDimensions/interfDeleteMenu.h
lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.h
lib/Interface_Icons_NDimensions/interfSegmentationPanels.cxx
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/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.h
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.h
lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx

index 680976430b23750464569d472ffacdc433109505..420a8941a80ee2620a13aca2d6a72550befbabfb 100644 (file)
 
 #include "wxContourGUIExample.h"
 #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"
index 143cd5e471bf1174c66cce88cab4ab1737d5baa0..6d8890d131b6ac676bbd9fce8acaf3a9dad45cdd 100644 (file)
@@ -32,16 +32,14 @@ namespace bbcreaContours
 
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,nDimensions)
 BBTK_BLACK_BOX_IMPLEMENTATION(nDimensions,bbtk::WxBlackBox);
+
 void nDimensions::Process()
 {
        double **vectx = 0, **vecty = 0, **vectz = 0;
-
        std::vector< void * > vectortemp;
        std::vector<int> size;
        vtkImageData **mask = 0, **value = 0;
-
        vtkImageData* img = bbGetInputIn();
-
        std::vector<vtkImageData*> selectedimages;
        if(img!=NULL && currentimg!=img)
        {
@@ -49,20 +47,25 @@ void nDimensions::Process()
                currentimg=img;
                selectedimages.push_back(img);
                wxContourMainFrame::getInstance()->setVectImages(selectedimages);
-       }
+       } // if img
 
-       if(currentimg != NULL){
+       if(currentimg != NULL)
+   {
                int contourtype = bbGetInputContourType();
                //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size);
                //wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype);
-       }
-
-       bbSetOutputX(vectx);
-       bbSetOutputY(vecty);
-       bbSetOutputZ(vectz);
-       bbSetOutputSizeContour(size);
-       bbSetOutputMask(*mask);
-       bbSetOutputValue(*value);
+       } // if currentimg
+
+    wxContourMainFrame::getInstance()->RefreshInterface();
+
+
+    bbSetOutputwxContourMainFrame( wxContourMainFrame::getInstance() );
+//     bbSetOutputX(vectx);
+//     bbSetOutputY(vecty);
+//     bbSetOutputZ(vectz);
+//     bbSetOutputSizeContour(size);
+//     bbSetOutputMask(*mask);
+//     bbSetOutputValue(*value);
 }
 
 //-----------------------------------------------------------------
@@ -96,12 +99,13 @@ printf("EED WARNING Verify that GetDllAppPath in  nDimensions::CreateWidget bbCr
 #endif // MACOSX       
        
        
-       printf("EED nDimensions::CreateWidget path=%s\n",datadir.c_str() );
+//printf("EED nDimensions::CreateWidget path=%s\n",datadir.c_str() );
 
-       wxPanel* panel = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
+       wxContourMainFrame* wxcontourmainframe = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
        wxContourMainFrame::getInstance()->ShowToolsPanel(false);
-//EED  bbSetOutputWidget( panel );
-               bbSetOutputWidget( new wxPanel(parent,-1) );
+
+//             bbSetOutputWidget( new wxPanel(parent,-1) );
+               bbSetOutputWidget( wxcontourmainframe    );
 }
 
 //-----------------------------------------------------------------
index fac3b34808d7719e1af31733200d5bb0ce3921c1..616a70ccd8c06e2635cf4f77fcfb7beab8e78b1f 100644 (file)
@@ -63,6 +63,7 @@ class /*BBTK_EXPORT*/ nDimensions
   BBTK_DECLARE_OUTPUT(Y,double**);
   BBTK_DECLARE_OUTPUT(Z,double**);
   BBTK_DECLARE_OUTPUT(SizeContour,std::vector <int>);
+  BBTK_DECLARE_OUTPUT(wxContourMainFrame,wxContourMainFrame*);
 
 private:
        //wxContourMainFrame* frame;
@@ -71,20 +72,21 @@ private:
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(nDimensions, bbtk::WxBlackBox);
-BBTK_NAME("nDimensions");
-BBTK_AUTHOR("car-prie@uniandes.edu.co");
-BBTK_DESCRIPTION("With a given image, the box shows the nDimension application");
-BBTK_CATEGORY("contours");
-BBTK_INPUT(nDimensions,WorkDir,"Working data directory where config and data files are located",std::string,"");
-BBTK_INPUT(nDimensions,In,"Image to be shown",vtkImageData*,"");
-BBTK_INPUT(nDimensions,ContourType,"Contour type to be exported: ",int,"");
+  BBTK_NAME("nDimensions");
+  BBTK_AUTHOR("car-prie@uniandes.edu.co");
+  BBTK_DESCRIPTION("With a given image, the box shows the nDimension application");
+  BBTK_CATEGORY("contours");
+  BBTK_INPUT(nDimensions,WorkDir,"Working data directory where config and data files are located",std::string,"");
+  BBTK_INPUT(nDimensions,In,"Image to be shown",vtkImageData*,"");
+  BBTK_INPUT(nDimensions,ContourType,"(default 0) Contour type to be exported: ",int,"");
 
-BBTK_OUTPUT(nDimensions, Mask, "Mask of the contours",vtkImageData*,"");
-BBTK_OUTPUT(nDimensions, Value, "Value of the contours",vtkImageData*,"");
-BBTK_OUTPUT(nDimensions, X, "Array of arrays that contains the X coordinates of each contour", double**, "");
-BBTK_OUTPUT(nDimensions, Y, "Array of arrays that contains the Y coordinates of each contour", double**, "");
-BBTK_OUTPUT(nDimensions, Z, "Array of arrays that contains the Z coordinates of each contour", double**, "");
-BBTK_OUTPUT(nDimensions, SizeContour, "Vector that contains the coordinates of each contour", std::vector <int>, "");
+  BBTK_OUTPUT(nDimensions, Mask, "Mask of the contours",vtkImageData*,"");
+  BBTK_OUTPUT(nDimensions, Value, "Value of the contours",vtkImageData*,"");
+  BBTK_OUTPUT(nDimensions, X, "Array of arrays that contains the X coordinates of each contour", double**, "");
+  BBTK_OUTPUT(nDimensions, Y, "Array of arrays that contains the Y coordinates of each contour", double**, "");
+  BBTK_OUTPUT(nDimensions, Z, "Array of arrays that contains the Z coordinates of each contour", double**, "");
+  BBTK_OUTPUT(nDimensions, SizeContour, "Vector that contains the coordinates of each contour", std::vector <int>, "");
+  BBTK_OUTPUT(nDimensions, wxContourMainFrame, "wxContourMainFrame", wxContourMainFrame*, "");
 
 BBTK_END_DESCRIBE_BLACK_BOX(nDimensions);
 }
diff --git a/bbtk/src/bbcreaContoursGetWxVtkBaseView.cxx b/bbtk/src/bbcreaContoursGetWxVtkBaseView.cxx
new file mode 100644 (file)
index 0000000..09ad218
--- /dev/null
@@ -0,0 +1,81 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbcreaContoursGetWxVtkBaseView.h"
+#include "bbcreaContoursPackage.h"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,GetWxVtkBaseView)
+BBTK_BLACK_BOX_IMPLEMENTATION(GetWxVtkBaseView,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetWxVtkBaseView::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+    
+       if (bbGetInputWxContourMainFrame()!=NULL)
+       { 
+                       bbSetOutputOut( bbGetInputWxContourMainFrame()->GetWxVtkBaseView() );
+       } // if Instance
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetWxVtkBaseView::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+//   bbSetInputIn(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetWxVtkBaseView::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetWxVtkBaseView::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaContours
+
+
diff --git a/bbtk/src/bbcreaContoursGetWxVtkBaseView.h b/bbtk/src/bbcreaContoursGetWxVtkBaseView.h
new file mode 100644 (file)
index 0000000..09bf74a
--- /dev/null
@@ -0,0 +1,52 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbcreaContoursGetWxVtkBaseView_h_INCLUDED__
+#define __bbcreaContoursGetWxVtkBaseView_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "wxVtkBaseView.h"
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT GetWxVtkBaseView
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(GetWxVtkBaseView,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(WxContourMainFrame,wxContourMainFrame*);
+  BBTK_DECLARE_OUTPUT(Out,wxVtkBaseView* );
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(GetWxVtkBaseView,bbtk::AtomicBlackBox);
+  BBTK_NAME("GetWxVtkBaseView");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+  
+  BBTK_INPUT(GetWxVtkBaseView,WxContourMainFrame,"wxContourMainFrame",wxContourMainFrame*,"");
+
+  BBTK_OUTPUT(GetWxVtkBaseView,Out,"wxVtkBaseView",wxVtkBaseView*,"");
+  
+BBTK_END_DESCRIBE_BLACK_BOX(GetWxVtkBaseView);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbcreaContours
+
+#endif // __bbcreaContoursGetWxVtkBaseView_h_INCLUDED__
+
diff --git a/bbtk/src/bbcreaContoursOnSave.cxx b/bbtk/src/bbcreaContoursOnSave.cxx
new file mode 100644 (file)
index 0000000..b067e6e
--- /dev/null
@@ -0,0 +1,84 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbcreaContoursOnSave.h"
+#include "bbcreaContoursPackage.h"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,OnSave)
+BBTK_BLACK_BOX_IMPLEMENTATION(OnSave,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void OnSave::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+  
+
+
+               if (wxContourMainFrame::getInstance()!=NULL)
+               {
+                       if ( wxContourMainFrame::getInstance()->GetFileLocation().empty()==false )
+                       {
+                               wxContourMainFrame::getInstance()->onSave();
+                       } // if FileLocation
+               } // if getInstance
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void OnSave::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+//   bbSetInputIn(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void OnSave::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void OnSave::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaContours
+
+
diff --git a/bbtk/src/bbcreaContoursOnSave.h b/bbtk/src/bbcreaContoursOnSave.h
new file mode 100644 (file)
index 0000000..afcf663
--- /dev/null
@@ -0,0 +1,48 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbcreaContoursOnSave_h_INCLUDED__
+#define __bbcreaContoursOnSave_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT OnSave
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(OnSave,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+//  BBTK_DECLARE_INPUT(Active,bool);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(OnSave,bbtk::AtomicBlackBox);
+  BBTK_NAME("OnSave"); 
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+//  BBTK_INPUT(OnSave,Active,"(default false) true/false",bool,"");
+
+//  BBTK_OUTPUT(OnSave,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(OnSave);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbcreaContours
+
+#endif // __bbcreaContoursOnSave_h_INCLUDED__
+
diff --git a/bbtk/src/bbcreaContoursSetColorLayerImage.cxx b/bbtk/src/bbcreaContoursSetColorLayerImage.cxx
new file mode 100644 (file)
index 0000000..c9dc9f8
--- /dev/null
@@ -0,0 +1,84 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbcreaContoursSetColorLayerImage.h"
+#include "bbcreaContoursPackage.h"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,SetColorLayerImage)
+BBTK_BLACK_BOX_IMPLEMENTATION(SetColorLayerImage,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetColorLayerImage::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+       if (wxContourMainFrame::getInstance()!=NULL)
+       { 
+               if (bbGetInputIn()!=NULL) 
+               {
+                       wxContourMainFrame *wxcontourmainframe=wxContourMainFrame::getInstance();
+                       wxcontourmainframe->SetColorLayerImage( bbGetInputIn() );
+               } // InputIn
+       } // if Instance
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetColorLayerImage::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn(NULL);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetColorLayerImage::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetColorLayerImage::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaContours
+
+
diff --git a/bbtk/src/bbcreaContoursSetColorLayerImage.h b/bbtk/src/bbcreaContoursSetColorLayerImage.h
new file mode 100644 (file)
index 0000000..8d93241
--- /dev/null
@@ -0,0 +1,53 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbcreaContoursSetColorLayerImage_h_INCLUDED__
+#define __bbcreaContoursSetColorLayerImage_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT SetColorLayerImage
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(SetColorLayerImage,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+
+//  BBTK_DECLARE_INPUT(wxContourMainFrame,wxContourMainFrame*);
+  BBTK_DECLARE_INPUT(In,vtkImageData*);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(SetColorLayerImage,bbtk::AtomicBlackBox);
+  BBTK_NAME("SetColorLayerImage");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+//  BBTK_INPUT(SetColorLayerImage,wxContourMainFrame,"wxContourMainFrame",wxContourMainFrame*,"");
+  BBTK_INPUT(SetColorLayerImage,In,"Input image",vtkImageData*,"");
+//  BBTK_OUTPUT(SetColorLayerImage,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(SetColorLayerImage);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbcreaContours
+
+#endif // __bbcreaContoursSetColorLayerImage_h_INCLUDED__
+
diff --git a/bbtk/src/bbcreaContoursSetFileLocation.cxx b/bbtk/src/bbcreaContoursSetFileLocation.cxx
new file mode 100644 (file)
index 0000000..84c73b2
--- /dev/null
@@ -0,0 +1,90 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbcreaContoursSetFileLocation.h"
+#include "bbcreaContoursPackage.h"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,SetFileLocation)
+BBTK_BLACK_BOX_IMPLEMENTATION(SetFileLocation,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetFileLocation::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+
+       if (wxContourMainFrame::getInstance()!=NULL)
+       { 
+               if (wxContourMainFrame::getInstance()->GetFileLocation().empty()==true)
+               {
+                       wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
+               }else {
+                       wxContourMainFrame::getInstance()->onSave();
+                       wxContourMainFrame::getInstance()->deleteAllContours();
+                       wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
+               } // if FileLocaton
+
+               wxContourMainFrame::getInstance()->onLoad();
+               wxContourMainFrame::getInstance()->RefreshInterface();
+       } // if Instance
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetFileLocation::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputFileLocation("");
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetFileLocation::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetFileLocation::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaContours
+
+
diff --git a/bbtk/src/bbcreaContoursSetFileLocation.h b/bbtk/src/bbcreaContoursSetFileLocation.h
new file mode 100644 (file)
index 0000000..e04452c
--- /dev/null
@@ -0,0 +1,49 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbcreaContoursSetFileLocation_h_INCLUDED__
+#define __bbcreaContoursSetFileLocation_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT SetFileLocation
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(SetFileLocation,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(FileLocation, std::string);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(SetFileLocation,bbtk::AtomicBlackBox);
+  BBTK_NAME("SetFileLocation");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+  BBTK_INPUT(SetFileLocation,FileLocation,"File Location",std::string,"");
+
+//  BBTK_OUTPUT(SetFileLocation,Out,"First output",double,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(SetFileLocation);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbcreaContours
+
+#endif // __bbcreaContoursSetFileLocation_h_INCLUDED__
+
diff --git a/bbtk/src/bbcreaContoursSetViewerPosition.cxx b/bbtk/src/bbcreaContoursSetViewerPosition.cxx
new file mode 100644 (file)
index 0000000..5f0f233
--- /dev/null
@@ -0,0 +1,127 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbcreaContoursSetViewerPosition.h"
+#include "bbcreaContoursPackage.h"
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,SetViewerPosition)
+BBTK_BLACK_BOX_IMPLEMENTATION(SetViewerPosition,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetViewerPosition::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+  
+
+       if (bbGetInputPosition().size()==3 )
+       {
+               int x = bbGetInputPosition()[0];
+               int y = bbGetInputPosition()[1];
+               int z = bbGetInputPosition()[2];
+               if ((backX!=x) || (backY!=y) || (backZ!=z) )   // this prevent to finish contour before start  :-)
+               {
+                       if (bbGetInputwxContourMainFrame()!=NULL)
+                       {
+                               double                  slice;
+                               vtkImageData    *img            = bbGetInputwxContourMainFrame()->getImageData();
+                               int                     ext[6];
+                               img->GetExtent(ext);
+                               int dimY=ext[3]-ext[2]+1;
+                               if (bbGetInputDirection()==0)
+                               {
+                                       slice = z;
+                                       slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
+                                       bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
+                                       bbGetInputwxContourMainFrame()->SetXY(x,y);
+                               } // if Direction1
+
+                               if (bbGetInputDirection()==1)
+                               {
+                                       slice = y;
+                                       slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
+                                       bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
+                                       bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1);
+                               } // if Direction1
+
+                               if (bbGetInputDirection()==2)
+                               {
+                                       slice = x;
+                                       slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
+                                       bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
+                                       bbGetInputwxContourMainFrame()->SetXY(dimY-z-1,y);
+                               } // if Direction1
+                               bbGetInputwxContourMainFrame()->showAxis(true);
+                               bbGetInputwxContourMainFrame()->changeInstant();
+                               bbGetInputwxContourMainFrame()->RefreshInterface();
+                               backX=x;
+                               backY=y;
+                               backZ=z;
+                       } // if bbGetInputPosition
+               } // if bbGetInputwxContourMainFrame
+       } // if backX  backY  backZ
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetViewerPosition::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+       bbSetInputDirection(0);
+       bbSetInputJump(1);
+       bbSetInputShift(0);
+       bbSetInputwxContourMainFrame(NULL);
+
+       backX=-9999;
+       backY=-9999;
+       backZ=-9999;
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetViewerPosition::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SetViewerPosition::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaContours
+
+
diff --git a/bbtk/src/bbcreaContoursSetViewerPosition.h b/bbtk/src/bbcreaContoursSetViewerPosition.h
new file mode 100644 (file)
index 0000000..c22c97e
--- /dev/null
@@ -0,0 +1,60 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbcreaContoursSetViewerPosition_h_INCLUDED__
+#define __bbcreaContoursSetViewerPosition_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT SetViewerPosition
+        :public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(SetViewerPosition,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(wxContourMainFrame,wxContourMainFrame*);
+  BBTK_DECLARE_INPUT(Position,std::vector<int>);
+  BBTK_DECLARE_INPUT(Direction,int);
+  BBTK_DECLARE_INPUT(Jump,int);
+  BBTK_DECLARE_INPUT(Shift,int);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+
+  int backX, backY, backZ;
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(SetViewerPosition,bbtk::AtomicBlackBox);
+  BBTK_NAME("SetViewerPosition");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+  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_INPUT(SetViewerPosition,Jump,"Slice jump+shift",int,"");
+  BBTK_INPUT(SetViewerPosition,Shift,"Slice jump+shift",int,"");
+
+  //BBTK_OUTPUT(SetViewerPosition,Out,"First output",double,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(SetViewerPosition);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbcreaContours
+
+#endif // __bbcreaContoursSetViewerPosition_h_INCLUDED__
+
index 72935f23a8c991bbceafafe95a22c395ecc15466..20f99ce54371982f617eebc51c49926ffd8f01de 100644 (file)
@@ -61,13 +61,18 @@ interfDeleteMenu::~interfDeleteMenu()
 }
 
 
-void interfDeleteMenu::onDeleteContour(wxCommandEvent& event){
-       interfMainPanel::getInstance()->onDeleteContour();
-}
-void interfDeleteMenu::onDeleteContoursActSlice(wxCommandEvent& event){
+void interfDeleteMenu::onDeleteContoursActSlice(wxCommandEvent& event)
+{
        interfMainPanel::getInstance()->onDeleteContoursActSlice();
 }
-void interfDeleteMenu::onDeleteAllContours(wxCommandEvent& event){
+
+void interfDeleteMenu::onDeleteContour(wxCommandEvent& event)
+{
+       interfMainPanel::getInstance()->onDeleteContour();
+}
+
+void interfDeleteMenu::onDeleteAllContours(wxCommandEvent& event)
+{
        interfMainPanel::getInstance()->onDeleteAllContours();
 }
 
index 73d4c119d5395a2c8e3278e5e7b1b03235ba8f6c..d80b90ce07450f94d1f9cf0084d9e0c16b4e61db 100644 (file)
@@ -36,18 +36,15 @@ class interfDeleteMenu
 public:
        interfDeleteMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir = "data/Icons");          
        ~interfDeleteMenu();
-
     virtual void initButtons(wxEvtHandler* evtHandler) ;
-
 private:
        /**
        **  This methods are in charge of responding to the events of button click by the delete panel
        **  @params wxCommandEvent& the event that call the function
        **/
-       void onDeleteContour(wxCommandEvent& event);
        void onDeleteContoursActSlice(wxCommandEvent& event);
+       void onDeleteContour(wxCommandEvent& event);
        void onDeleteAllContours(wxCommandEvent& event);
-       
 };
 
 #endif
index 32f8294fb85bb165cd83153bf196f8ea7a1d70e1..371e7fb2b6c692eced96373dc68d1b39cf212b7e 100644 (file)
@@ -46,23 +46,9 @@ interfImageToolsMenu::interfImageToolsMenu(wxWindow * parent, int sizex, int siz
 
 void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler) 
 {
-printf("EED interfImageToolsMenu::initButtons start\n");
        std::vector<std::string> path, nom;
        std::vector<wxObjectEventFunction> funct;
 
-/*EED Borrame
-       path.push_back(datadir + "/Segmentation.png");
-       nom.push_back("Find shapes by automatic segmentation");
-       funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressed);
-
-       path.push_back(datadir + "/ITK.png");
-       nom.push_back("Find shapes by automatic segmentation with ITK");
-       funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressedITK);
-
-       path.push_back(datadir + "/snake.png");
-       nom.push_back("Find shapes using border snake interaction");
-       funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSnakePressed);
-*/
        path.push_back(datadir + "/pignon.png");
        nom.push_back("Configuration of the window");
        funct.push_back((wxObjectEventFunction) &interfImageToolsMenu:: onConfigurationPressed);
@@ -86,7 +72,6 @@ printf("EED interfImageToolsMenu::initButtons start\n");
        this->addButtons(path, nom);    
        this->setVectorFunction(funct);
        this->connectEvents(evtHandler);
-printf("EED interfImageToolsMenu::initButtons End\n");
 }
 
 interfImageToolsMenu::~interfImageToolsMenu()
@@ -119,9 +104,7 @@ 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 3f17f76490f9f79ed8a07c08aac7487e6f1e8d9b..4aeacae0a2034e9e341c9cd3ab4c7e5ed30b3f27 100644 (file)
@@ -23,8 +23,9 @@
 #  knowledge of the CeCILL-B license and that you accept its terms.
 # ------------------------------------------------------------------------ */
 
-#include "interfMainPanel.h"
+#include <wx/msgdlg.h>
 
+#include "interfMainPanel.h"
 
 interfMainPanel        *interfMainPanel::interfmainpanel       = NULL;
 wxFrame                        *interfMainPanel::_newframe                     = NULL;
@@ -146,10 +147,11 @@ 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);
+       _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(450,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER);
+       _newframe->SetMinSize( wxSize(200,200) );
        if(interfmainpanel == NULL)
        {
-               interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler, datadir);
+               interfmainpanel = new interfMainPanel(_newframe, 450, 900, evtHandler, datadir);
        }
        _newframe->Show(TRUE);
        return interfmainpanel;
@@ -157,10 +159,11 @@ 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 );
+       _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(450,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER);
+       _newframe->SetMinSize( wxSize(200,200) );
        if(interfmainpanel == NULL)
        {
-               interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler);
+               interfmainpanel = new interfMainPanel(_newframe, 450, 900, evtHandler);
        }
        _newframe->Show(TRUE);
        return interfmainpanel;
@@ -403,22 +406,30 @@ void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull)
        wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
 }
 
-void interfMainPanel::onDeleteContour()
+void interfMainPanel::onDeleteContoursActSlice()
 {
        wxContourMainFrame::getInstance()->showAxis(false);
-       wxContourMainFrame::getInstance()->onDeleteContour();
+       wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
 }
 
-void interfMainPanel::onDeleteContoursActSlice()
+void interfMainPanel::onDeleteContour()
 {
        wxContourMainFrame::getInstance()->showAxis(false);
-       wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
+       wxContourMainFrame::getInstance()->onDeleteContour();
 }
 
 void interfMainPanel::onDeleteAllContours()
 {
-       wxContourMainFrame::getInstance()->showAxis(false);
-       wxContourMainFrame::getInstance()->onDeleteAllContours();
+    wxMessageDialog *dial;
+       dial=new wxMessageDialog(       NULL,
+                                                               wxT("Delete all contours of the system?"), 
+                                                               wxT("Warnning!"), 
+                                                               wxOK | wxCANCEL | wxICON_QUESTION   );
+       if (dial->ShowModal()==wxID_OK)
+       {
+               wxContourMainFrame::getInstance()->showAxis(false);
+               wxContourMainFrame::getInstance()->onDeleteAllContours();
+       } // if OK
 }
 
 void interfMainPanel::onCopy()
@@ -595,6 +606,21 @@ void interfMainPanel::onInterpolation(bool interpolate)
        wxContourMainFrame::getInstance()->onInterpolation(interpolate);
 }
 
+void interfMainPanel::onBeforAfterContour(bool before, bool after)
+{
+       wxContourMainFrame::getInstance()->onBeforeAfterContour(before,after);
+}
+
+void interfMainPanel::onJumpSlice(int step, int shift)
+{
+       wxContourMainFrame::getInstance()->onJumpSlice(step,shift);
+}
+
+void interfMainPanel::onShowTextContour(bool show)
+{
+       wxContourMainFrame::getInstance()->onShowTextContour(show);
+}
+
 
 void interfMainPanel::onConfigurationPressed()
 {
@@ -672,51 +698,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 +738,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 +754,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 +766,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..25a0fdacadcf299a639fedfb6cdc905709d33f34 100644 (file)
@@ -131,8 +131,8 @@ public:
 
        void onCreateContoursBullEye(wxPanel* panBull);
        /////////////////////////////////
-       void onDeleteContour();
        void onDeleteContoursActSlice();
+       void onDeleteContour();
        void onDeleteAllContours();
        /////////////////////////
        void onCopy();
@@ -169,6 +169,9 @@ public:
        int getWindowLevel();
        void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
        void onInterpolation(bool interpolate);
+       void onShowTextContour(bool show);
+       void onBeforAfterContour(bool before, bool after);
+       void onJumpSlice(int step,int shift);
        void onSpreadPressed();
        void onConfigurationPressed();
        void resetAppend();
index 46fb279043e0fdc75f50db7f168d8eabe252f071..55786964888d67ad28a41497a99f431c14a7ec38 100644 (file)
@@ -113,19 +113,19 @@ void  interfSegmentationPanelVTK::onSegmentationPressedITK(wxCommandEvent& event
 
 void interfSegmentationPanelVTK::onSegmentationOneSlice( wxCommandEvent& event )
 {
-       int isovalue = _isovalue->GetValue();
-       int sampling = _sampling->GetValue();
-       int method = methodRadiobox->GetSelection();
+       int isovalue    = _isovalue->GetValue();
+       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();
+       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); 
 }
 
index 263d4e7078c0bc46d438b0c3ee2fc13a7252e1e5..671047dda4d1abd67e819701e4e58df8bb692e59 100644 (file)
@@ -51,9 +51,25 @@ 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("Interpolation") );
        _interpolationCheckBox->SetValue(true);
 
+       _showTextContourCheckBox                                = new wxCheckBox(this, -1, _T("Labels") );
+       _showTextContourCheckBox->SetValue(true);
+
+       _beforContourCheckBox                                   = new wxCheckBox(this, -1, _T("Befor Contour") );
+       _beforContourCheckBox->SetValue(false);
+
+       _afterContourCheckBox                                   = new wxCheckBox(this, -1, _T("After Contour") );
+       _afterContourCheckBox->SetValue(false);
+
+       wxButton        *jumpBackwareSlice                      = new wxButton(this,-1,_T("-"),wxDefaultPosition, wxDefaultSize);
+       wxButton        *jumpFordwareSlice                      = new wxButton(this,-1,_T("+"),wxDefaultPosition, wxDefaultSize);
+                               _jumpSpinCtrl                           = new wxSpinCtrl(this,-1,wxString("10") );
+                               _jumpSpinCtrl->SetRange(1,100);
+                               _shiftSpinCtrl                          = new wxSpinCtrl(this,-1,wxString("0") );
+                               _shiftSpinCtrl->SetRange(0,99);
+
        Connect( _withOfContourLine->GetId(),     wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
        Connect( _withOfContourLine->GetId(),     wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
 
@@ -62,20 +78,44 @@ 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( _showTextContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnShowTextContour);
+       Connect( _beforContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour);
+       Connect( _afterContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour);
+       Connect( jumpBackwareSlice->GetId(),    wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfConfigurationPanel::OnBackwareSlice );
+       Connect( jumpFordwareSlice->GetId(),    wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfConfigurationPanel::OnFordwareSlice );
+
+
+       wxFlexGridSizer * sizerA                                        = new wxFlexGridSizer(1);
+       sizerA -> Add( new wxStaticText(this,-1, _T("Contour width"))  , 1, wxGROW );
+       sizerA -> Add( _withOfContourLine               , 1, wxGROW );
+       sizerA -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
+       sizerA -> Add( new wxStaticText(this,-1, _T("Window level"))  , 1, wxGROW );
+       sizerA -> Add( _brithtnessWindowLevel   , 1, wxGROW );
+       sizerA -> Add( new wxStaticText(this,-1, _T("Color level"))  , 1, wxGROW );
+       sizerA -> Add( _brithtnessColorLevel    , 1, wxGROW );
+       sizerA -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
+
+       wxFlexGridSizer * sizerB1                                       = new wxFlexGridSizer(2);
+       sizerB1-> Add( jumpBackwareSlice                , 1, wxGROW );
+       sizerB1 -> Add( jumpFordwareSlice               , 1, wxGROW );
+
+       wxFlexGridSizer * sizerB                                        = new wxFlexGridSizer(1);
+       sizerB -> Add( _interpolationCheckBox   , 1, wxGROW );
+       sizerB -> Add( new wxStaticText(this    ,-1, _T(" "))  , 1, wxGROW );
+       sizerB -> Add( _showTextContourCheckBox , 1, wxGROW );
+       sizerB -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
+       sizerB -> Add( _beforContourCheckBox    , 1, wxGROW );
+       sizerB -> Add( _afterContourCheckBox    , 1, wxGROW );
+       sizerB -> Add( new wxStaticText(this,-1, _T(" "))  , 1, wxGROW );
+       sizerB -> Add( sizerB1                                  , 1, wxGROW );
+       sizerB -> Add( _jumpSpinCtrl                    , 1, wxGROW );
+       sizerB -> Add( _shiftSpinCtrl                   , 1, wxGROW );
+       
 
-       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( _brithtnessWindowLevel            , 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 );
+       wxFlexGridSizer * sizer                                         = new wxFlexGridSizer(3);
+       sizer -> Add( sizerA            , 1, wxGROW );
+       sizer -> Add( new wxStaticText(this,-1, _T("       "))  , 1, wxGROW );
+       sizer -> Add( sizerB            , 1, wxGROW );
 
        this->SetSizer( sizer );
        //JCP 13-10-08
@@ -91,8 +131,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 +140,35 @@ 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() );
+}
+
+void interfConfigurationPanel::OnShowTextContour(wxCommandEvent& event)
+{
+       interfMainPanel::getInstance()->onShowTextContour(_showTextContourCheckBox->GetValue() );
+}
 
+void interfConfigurationPanel::OnBackwareSlice(wxCommandEvent& event)
+{
+       interfMainPanel::getInstance()->onJumpSlice( -_jumpSpinCtrl->GetValue(), _shiftSpinCtrl->GetValue() );
 }
 
+void interfConfigurationPanel::OnFordwareSlice(wxCommandEvent& event)
+{
+       interfMainPanel::getInstance()->onJumpSlice( _jumpSpinCtrl->GetValue(), _shiftSpinCtrl->GetValue() );
+}
+
+
 /**
 ** Begin of the spread panel
 **/
index 6279a6bd6442211753e7d212a4303dccdc1e87d9..0d125bd123304bae7c22846712eabb17444f9ca6 100644 (file)
@@ -37,23 +37,23 @@ class interfConfigurationPanel
 public:
        interfConfigurationPanel(wxWindow * parent);
        ~interfConfigurationPanel();
-
-
-
 private:
-
        void onWidthOfContour(wxScrollEvent& event);
-
        void onBrigthnessColorWindowLevel(wxScrollEvent& event);
-
        void OnInterpolation(wxCommandEvent& event);
-
-
-       wxSlider* _withOfContourLine;
-       wxSlider* _brithtnessWindowLevel;
-       wxSlider* _brithtnessColorLevel;
+       void OnShowTextContour(wxCommandEvent& event);
+       void OnBeforAfterContour(wxCommandEvent& event);
+       void OnBackwareSlice(wxCommandEvent& event);
+       void OnFordwareSlice(wxCommandEvent& event);
+       wxSlider*       _withOfContourLine;
+       wxSlider*       _brithtnessWindowLevel;
+       wxSlider*       _brithtnessColorLevel;
        wxCheckBox* _interpolationCheckBox;
-
+       wxCheckBox* _showTextContourCheckBox;
+       wxCheckBox* _beforContourCheckBox;
+       wxCheckBox* _afterContourCheckBox;
+       wxSpinCtrl*     _jumpSpinCtrl;
+       wxSpinCtrl*     _shiftSpinCtrl;
 };
 
 class interfSpreadPanel
@@ -62,22 +62,16 @@ class interfSpreadPanel
 public:
        interfSpreadPanel(wxWindow * parent);
        ~interfSpreadPanel();
-
     void appendStringSpread(std::string val);
        void setStringSpread(std::string stringtemp);
 private:
-
        wxRadioBox      *_spreadMethodRadiobox;
        wxStaticText    *_staticTextSpread;
        wxTextCtrl      *_wxtextctrlSpread;
-
        void onSpreadReset(wxCommandEvent& event);
        void onSpreadAdd(wxCommandEvent& event);
        void onSpreadAddAll(wxCommandEvent& event);
        void onSpreadGo(wxCommandEvent& event);
-
-
-
 };
 
 class interfInformationPanel
index 764feea43abd60fdcdf67f197c9b64f3aa5fbf94..48c038b0a87b3279d93362d81e89b534ac091673 100644 (file)
@@ -52,7 +52,7 @@ using namespace std;
        // Constructors & Destructors
        //------------------------------------------------------------------------------------------------------------
 
-wxContourMainFrame* wxContourMainFrame:: instance = NULL;
+wxContourMainFrame* wxContourMainFrame::instance=NULL;
 char wxContourMainFrame::COPY = 'C';
 
        wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style)
@@ -94,7 +94,6 @@ char wxContourMainFrame::COPY = 'C';
                _viewThresholdImage                     = NULL;
                _viewThresholdImagePanel        = NULL;
                _viewColorLayerImagePanel       = NULL;
-
                _frameShowResultImages          = NULL;
        }
 
@@ -140,10 +139,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 );
@@ -162,28 +161,29 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
 
        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 )
        {
-               if(instance == NULL){
-                       instance = new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir);
+               if(instance == NULL)
+               {
+                       instance=new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir);
                }
                return instance;
        }
 
-       std::vector<vtkImageData*> wxContourMainFrame ::getVectImages()
+       std::vector<vtkImageData*> wxContourMainFrame::getVectImages()
        {
                return kernelManager->getVectImages();
        }
 
-       wxContourMainFrame* wxContourMainFrame :: getInstance()
+       wxContourMainFrame* wxContourMainFrame::getInstance()
        {
                return instance;
        }
 
-       void wxContourMainFrame :: resetInstance()
+       void wxContourMainFrame::resetInstance()
        {
                instance->Destroy();
        }
 
-       wxContourMainFrame :: ~wxContourMainFrame()
+       wxContourMainFrame::~wxContourMainFrame()
        {
                delete _contourextractdata;
                deleteAllContours();
@@ -212,7 +212,7 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
        // Creational and initialization methods using WxAui
        //------------------------------------------------------------------------------------------------------------
        //
-       wxAuiNotebook * wxContourMainFrame :: createNotebook()
+       wxAuiNotebook * wxContourMainFrame::createNotebook()
        {
                wxSize client_size = GetClientSize();
                wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
@@ -224,7 +224,7 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
        //------------------------------------------------------------------------------------------------------------
        // Creational and initialization methods
        //------------------------------------------------------------------------------------------------------------
-       bool wxContourMainFrame :: configurePanels( )
+       bool wxContourMainFrame::configurePanels( )
        {
                bool configured = _theViewPanel!=NULL;
 
@@ -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
@@ -725,13 +736,14 @@ void wxContourMainFrame::updateInstantImageData()
        _instantPanel->getInstant(inst);
 
        vtkImageData* img = kernelManager->getImageAtInstant(inst);
-       if(img!=NULL){
+       if(img!=NULL)
+       {
                _theViewPanel->changeImage(img);
                showAxis(false);
        }else{
                int z = _instantPanel->getConceptDataOf("Axe Depth")->getActualValue();
                _theViewPanel->setImageSlice(z);
-       }
+       } // if img
 }
 
 void wxContourMainFrame::updateInstantAxes()
@@ -840,7 +852,7 @@ void wxContourMainFrame :: createMirrorContourOf ( std::string anExistingKName,
                mp->SetPointX( vecOut[0] );
                mp->SetPointY( vecOut[1] );
                mp->SetPointZ( vecOut[2] );
-       }
+       } // for i
 
        _theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append );
 }
@@ -851,7 +863,6 @@ void wxContourMainFrame ::loadState(std::string filename)
        onLoadContours(filename,false);
 }
 
-
 void wxContourMainFrame::onLoad()
 {
        std::string fileNameContourROI = GetFileLocation();
@@ -868,20 +879,17 @@ void wxContourMainFrame::onLoad()
                if (dialog.ShowModal() == wxID_OK)
                {
                        fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
-               }
-       }
-
+               } // if dialog
+       } // if FileLocation
        onLoadContours(fileNameContourROI,true);
 }
 
-
 void  wxContourMainFrame::SetZForAllContours(int pz)
 {
        //-- Normal Contours
        std::vector< std::string > lstNameThings;       
        int i,sizeLstNameThings;
-       int ii,sizeLstPoints;
-       
+       int ii,sizeLstPoints;   
        lstNameThings           = kernelManager->GetLstNameThings();
        sizeLstNameThings       = lstNameThings.size(); 
        for (i=0 ; i<sizeLstNameThings ; i++)
@@ -953,27 +961,18 @@ void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool int
                        readDimSpc(pFile,false);                // DimSpc interactive OFF
                        openContours(pFile,pFileData,true);     // Load StaticContours
                        SetZForAllContours(-900);
-               }
-               //AD:02-06-09
-               else if (version=="1.0.1")
-               {
+               } else if (version=="1.0.1") { //AD:02-06-09
                        openContours(pFile,pFileData,false); //Skips ImageDimensions and ImageSpacing
                        openContours(pFile,pFileData,true); //Load StaticContours, skips ImageDimensions and ImageSpacing
-               }
-
-               //AD:02-06-09
-               else if (version=="1.0.0")
-               {
+               } else if (version=="1.0.0") { //AD:02-06-09
                        openContours(pFile,pFileData,false); //Skips ImageDimensions and ImageSpacing
                }
-
                fclose(pFile);
-
                if(pFileData != NULL)
                {
                        fclose(pFileData);
                } // if
-       }
+       } // pFile
        _theViewPanel->getSceneManager()->removeSceneContours();
        changeInstant();
 }
@@ -993,7 +992,8 @@ void wxContourMainFrame::onImport()
                filename = dialog.GetPath().mb_str();
                filenamecontours = kernelManager->parseOsirixFile(filename);
 
-               if(filenamecontours.compare("") != 0){
+               if(filenamecontours.compare("") != 0)
+               {
                        onLoadContours(filenamecontours,true);
                } // if
        } // if
@@ -1008,7 +1008,6 @@ void wxContourMainFrame::onTest()
 #else
        wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxFD_OPEN );
 #endif
-
        if (dialog.ShowModal() == wxID_OK)
        {
                filename = dialog.GetPath().mb_str();
@@ -1016,9 +1015,9 @@ void wxContourMainFrame::onTest()
        } // if
 }
 
-
 //AD: 29-05-09
-void wxContourMainFrame::onSave(){
+void wxContourMainFrame::onSave()
+{
 //CMRU 03-09-09-----------------------------------------------------------------------------------------------
        if(GetFileLocation().empty())
        {
@@ -1035,10 +1034,7 @@ void wxContourMainFrame::onSave(){
                        kernelManager->setCurrentFileName(fileNameContourROI);
                        saveFileWithContours( fileNameContourROI );
                }
-       }
-//CMRU 03-09-09-----------------------------------------------------------------------------------------------
-       else
-       {
+       } else {//CMRU 03-09-09-----------------------------------------------------------------------------------------------
                std::cout<<"Nombre del archivo: "<<GetFileLocation()<<std::endl;
                std::string fileNameContourROI = GetFileLocation();
                std::cout<<"Nombre del archivo: "<<fileNameContourROI<<std::endl;
@@ -1178,12 +1174,14 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption)
                {
                        wxDialog* dial = new wxDialog (this,-1,_T("Tools"),wxDefaultPosition, wxSize(460,360));
                        wxSizer* buttonsSizer = dial->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
-                       wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL);
+//                     wxBoxSizer              *dialSizer = new wxBoxSizer(wxVERTICAL);
+                       wxFlexGridSizer *dialSizer = new wxFlexGridSizer(1);
 
-                       wxString lstOptOperation[2];
-                       lstOptOperation[0]=_T("By Dimension");
-                       lstOptOperation[1]=_T("By Spacing");
-                       wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,45), 2 , lstOptOperation,  2, wxRA_SPECIFY_COLS);
+                       wxString lstOptOperation[3];
+                       lstOptOperation[0]=_T("By Dimension (XY)");
+                       lstOptOperation[1]=_T("By Spacing   (XY)");
+                       lstOptOperation[2]=_T("By Spacing   (XYZ)");
+                       wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(370,200), 3 , lstOptOperation,  3, wxRA_SPECIFY_ROWS);
 
                        dialSizer->Add( new wxStaticText(dial,-1,_T("The image resolution is not compatible with the "))  , 0, wxGROW );
                        dialSizer->Add( new wxStaticText(dial,-1,_T("selected Roi file. Do you want to tranform it?"))  , 0, wxGROW );
@@ -1195,7 +1193,7 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption)
                        dial->Layout();
                        dial->ShowModal();
 
-                       int _tmpReadFileTypeOfTransformation = -1;
+                       _tmpReadFileTypeOfTransformation = -1;
 //EED                  bool transform = false;
 
                        if (dial->GetReturnCode() == wxID_OK)
@@ -1213,7 +1211,7 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption)
 //AD:04-06-09
 void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool staticContour )
 {
-
+printf ("EED wxContourMainFrame::openContours Start \n");
        char tmp[255];
 
        vtkImageData    *image = _images[0];
@@ -1331,14 +1329,22 @@ void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool static
                 //nothing to do..
             } else if (_tmpReadFileTypeOfTransformation==0){
                 double transX, transY;
-                transX = (double) imageDim[0]/_tmpReadFileImageDim[0];
-                transY = (double) imageDim[1]/_tmpReadFileImageDim[1];
-                manModelContour->Transform_Ax_Plus_B(transX,0,transY,0);
+                transX = (double) imageDim[0]/_tmpReadFileImageDim[0];                    // X
+                transY = (double) imageDim[1]/_tmpReadFileImageDim[1];                    // Y
+                manModelContour->Transform_Ax_Plus_B(transX,0,transY,0);                
             } else if (_tmpReadFileTypeOfTransformation==1) {
                 double transX, transY;
-                transX = (double) _tmpReadFileImageSpac[0]/imageDim[0];
-                transY = (double) _tmpReadFileImageSpac[1]/imageDim[1];
+                transX = (double) _tmpReadFileImageSpac[0]/imageSpac[0];                  // X
+                transY = (double) _tmpReadFileImageSpac[1]/imageSpac[1];                  // Y
+                manModelContour->Transform_Ax_Plus_B(transX,0,transY,0); 
+            } else if (_tmpReadFileTypeOfTransformation==2) {  // with Z include
+                double transX, transY;
+                transX = (double) _tmpReadFileImageSpac[0]/imageSpac[0];                   // X
+                transY = (double) _tmpReadFileImageSpac[1]/imageSpac[1];                   // Y 
+                instantVector[1]=instantVector[1]*_tmpReadFileImageSpac[2]/imageSpac[2];   // Z
                 manModelContour->Transform_Ax_Plus_B(transX,0,transY,0);
+            }else {
+                   printf ("EED Warnning! wxContourMainFrame::openContours _tmpReadFileTypeOfTransformation not set. \n");
             }
 
                        fscanf(pFile,"%s",tmp); // TypeView
@@ -1367,6 +1373,8 @@ void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool static
 
 /*     }    */
 
+printf ("EED wxContourMainFrame::openContours END \n");
+
 }
 
 void wxContourMainFrame::RefreshInterface()
@@ -1401,473 +1409,321 @@ void wxContourMainFrame::SegmentationOneSliceITK(int x, int y, int z, wxString d
        int typeofcontour = 1;
        //Image Data
        vtkImageData    *imagedata      = getImageData();
-
        //Tipo de pixeles a utilizar internamente en ITK
        typedef   float  InternalPixelType;
        const     unsigned int    Dimension = 2;
        typedef itk::Image< InternalPixelType, Dimension >  InternalImageType;
-
        //Tipo de pixeles de salida 1
        typedef unsigned char OutputPixelType;
        typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
-
        //Tipo de pixeles de salida 2
        typedef unsigned short OutputPixelType2;
        typedef itk::Image< OutputPixelType2, Dimension > OutputImageType2;
-
        //DefiniciÛn del thresholder
        typedef itk::BinaryThresholdImageFilter<
                                                        InternalImageType,
                                                        OutputImageType    >    ThresholdingFilterType;
-
        //DefiniciÛn del primer filtro de conversiÛn de pixeles
        typedef itk::CastImageFilter<
                                OutputImageType, OutputImageType2 >  CastFilterType;
-
        //DefiniciÛn del segundo tipo de conversiÛn de pixeles
        typedef itk::CastImageFilter<
                                OutputImageType2, InternalImageType >  CastFilterType2;
-
        //Tercer tipo de conversiÛn
        typedef itk::RescaleIntensityImageFilter<
                                                                InternalImageType,
                                                                OutputImageType >   CastFilterType3;
-
        //Cuarto tipo de conversiÛn
        typedef itk::RescaleIntensityImageFilter<
                                                                OutputImageType,
                                                                OutputImageType >   CastFilterType4;
-
        ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New();
-
        thresholder->SetLowerThreshold( 0.0 );
        thresholder->SetUpperThreshold( 128 );
-
        thresholder->SetOutsideValue(  255  );
        thresholder->SetInsideValue(  0 );
-
        //DefinciÛn de conexiÛnes entre VTK e ITK y el writer
        typedef itk::VTKImageToImageFilter<OutputImageType2> ConnectorType;
        typedef itk::ImageToVTKImageFilter<OutputImageType> ConnectorType2;
 //EED10JUIN2011        typedef  itk::ImageFileWriter<  OutputImageType  > WriterType;
-
-       ConnectorType::Pointer connector= ConnectorType::New();
-       ConnectorType2::Pointer connector2= ConnectorType2::New();
-
-
-       CastFilterType::Pointer filter=CastFilterType::New();
-       CastFilterType2::Pointer filter2=CastFilterType2::New();
-
+       ConnectorType::Pointer connector        = ConnectorType::New();
+       ConnectorType2::Pointer connector2      = ConnectorType2::New();
+       CastFilterType::Pointer filter   = CastFilterType::New();
+       CastFilterType2::Pointer filter2 = CastFilterType2::New();
        connector->SetInput( imagedata );
        filter2->SetInput(connector->GetOutput());
-
        typedef   itk::CurvatureAnisotropicDiffusionImageFilter<
                                                                InternalImageType,
                                                                InternalImageType >  SmoothingFilterType;
-
        SmoothingFilterType::Pointer smoothing = SmoothingFilterType::New();
-
        typedef   itk::GradientMagnitudeRecursiveGaussianImageFilter<
                                                                InternalImageType,
                                                                InternalImageType >  GradientFilterType;
-
        typedef   itk::SigmoidImageFilter<
                                                                InternalImageType,
                                                                InternalImageType >  SigmoidFilterType;
-
        GradientFilterType::Pointer  gradientMagnitude = GradientFilterType::New();
-
        SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New();
-
        sigmoid->SetOutputMinimum(  0.0  );
        sigmoid->SetOutputMaximum(  255.0  );
-
-
        typedef  itk::FastMarchingImageFilter<
                                                                InternalImageType,
                                                                InternalImageType >    FastMarchingFilterType;
-
-
        FastMarchingFilterType::Pointer  fastMarching = FastMarchingFilterType::New();
-       
-printf("EED wxContourMainFrame::SegmentationOneSliceITK  Skypping this code.  Not compiling   GeodesicActiveContourLevelSetImageFilter     in fedora 17 with ITK 3.20.1 \n ");
-/*EED 17 sept 2010
- > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > -   Not compiling   GeodesicActiveContourLevelSetImageFilter     in fedora 17 with ITK 3.20.1
        typedef  itk::GeodesicActiveContourLevelSetImageFilter< InternalImageType,
                                        InternalImageType >    GeodesicActiveContourFilterType;
        GeodesicActiveContourFilterType::Pointer geodesicActiveContour =
                                                                                GeodesicActiveContourFilterType::New();
-
        typedef  itk::ZeroCrossingImageFilter<
                                                                InternalImageType,
                                                                InternalImageType >    ZeroCrossingFilterType;
        ZeroCrossingFilterType::Pointer zeroCrossing =
                                                        ZeroCrossingFilterType::New();
-
        const double propagationScaling = atof( crea::wx2std(prop).c_str() );
-
        geodesicActiveContour->SetPropagationScaling( propagationScaling );
        geodesicActiveContour->SetCurvatureScaling( 1.0 );
        geodesicActiveContour->SetAdvectionScaling( 1.0 );
-
        geodesicActiveContour->SetMaximumRMSError( 0.02 );
        int it=atoi(  crea::wx2std(iter).c_str() );
        geodesicActiveContour->SetNumberOfIterations( it );
-
        smoothing->SetInput( filter2->GetOutput() );
        gradientMagnitude->SetInput( smoothing->GetOutput() );
        sigmoid->SetInput( gradientMagnitude->GetOutput() );
        fastMarching->SetInput( sigmoid->GetOutput() );
        geodesicActiveContour->SetInput( fastMarching->GetOutput() );
        geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() );
-
        zeroCrossing->SetInput( geodesicActiveContour->GetOutput() );
        //thresholder->SetInput( zeroCrossing->GetOutput() );
        thresholder->SetInput( geodesicActiveContour->GetOutput() );
        connector2->SetInput( thresholder->GetOutput()  );
-< - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - < - 
-*/
-       
-       
-       
-
        smoothing->SetTimeStep( 0.125 );
        smoothing->SetNumberOfIterations(  5 );
        smoothing->SetConductanceParameter( 9.0 );
-
-
-       const double sigma = atof(  crea::wx2std(sigm).c_str() );
+       const double sigma      = atof(  crea::wx2std(sigm).c_str() );
        gradientMagnitude->SetSigma(  sigma  );
-
-       const double alpha =  atof(  crea::wx2std(alf).c_str() );
-       const double beta  =  atof(  crea::wx2std(bet).c_str() );
-
+       const double alpha      =  atof(  crea::wx2std(alf).c_str() );
+       const double beta       =  atof(  crea::wx2std(bet).c_str() );
        sigmoid->SetAlpha( alpha );
        sigmoid->SetBeta(  beta  );
-
        typedef FastMarchingFilterType::NodeContainer  NodeContainer;
        typedef FastMarchingFilterType::NodeType       NodeType;
-
        NodeContainer::Pointer seeds = NodeContainer::New();
-
        InternalImageType::IndexType  seedPosition;
-       seedPosition[0] = x;
-       seedPosition[1] = y;
-
+       seedPosition[0]         = x;
+       seedPosition[1]         = y;
        const double initialDistance = atof( crea::wx2std(distanc).c_str() );
-
        NodeType node;
-
        const double seedValue = - initialDistance;
-
        node.SetValue( seedValue );
        node.SetIndex( seedPosition );
-
        seeds->Initialize();
        seeds->InsertElement( 0, node );
-
        fastMarching->SetTrialPoints( seeds );
-
        fastMarching->SetSpeedConstant( 1.0 );
-
-       fastMarching->SetOutputSize(
-                       connector->GetOutput()->GetBufferedRegion().GetSize() );
-
+       fastMarching->SetOutputSize( connector->GetOutput()->GetBufferedRegion().GetSize() );
        fastMarching->SetStoppingValue( 800 );
        try
     {
-
-       connector2->Update();
-       vtkImageData *idata = connector2->GetOutput();
-
-       vtkMarchingContourFilter* cntVTK = vtkMarchingContourFilter::New( );
-
-       cntVTK->SetNumberOfContours( 1 );
-       cntVTK->SetValue( 0, 255 );
+//             connector2->Update();
+               vtkImageData *idata = NULL;
+               idata                           = connector2->GetOutput();
+               vtkMarchingContourFilter* cntVTK = vtkMarchingContourFilter::New( );
+               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();
+               cntVTK->SetInput( idata );
+               cntVTK->Update( );
+               cntVTK->UpdateInformation();
 #else
-       cntVTK->SetInputData( idata );
+               cntVTK->SetInputData( idata );
 #endif
-
-       vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
-
+               vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
-       cpd->SetInput( cntVTK->GetOutput( ) );
-       cpd->Update( );
-       cpd->UpdateInformation();
+               cpd->SetInput( cntVTK->GetOutput( ) );
+               cpd->Update( );
+               cpd->UpdateInformation();
 #else
-       cpd->SetInputData( cntVTK->GetOutput( ) );
+               cpd->SetInputData( cntVTK->GetOutput( ) );
 #endif
-
-
-       vtkPolyDataConnectivityFilter* conn = vtkPolyDataConnectivityFilter::New( );
-       conn->SetExtractionModeToLargestRegion( );
+               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();
+               conn->SetInput( cpd->GetOutput( ) );
+               conn->Update( );
+               conn->UpdateInformation();
 #else
-       conn->SetInputData( cpd->GetOutput( ) );
+               conn->SetInputData( cpd->GetOutput( ) );
 #endif
-
-
-       vtkStripper* vtkstripper = vtkStripper::New( );
-
+               vtkStripper* vtkstripper = vtkStripper::New( );
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
-       vtkstripper->SetInput( conn->GetOutput() );
-       vtkstripper->Update();
-       vtkstripper->UpdateInformation();
+               vtkstripper->SetInput( conn->GetOutput() );
+               vtkstripper->Update();
+               vtkstripper->UpdateInformation();
 #else
-       vtkstripper->SetInputData( conn->GetOutput() );
-       cntVTK->Update();
+               vtkstripper->SetInputData( conn->GetOutput() );
+               cntVTK->Update();
 #endif
-
-       vtkPolyData* polyDataResult =  cntVTK->GetOutput();
-       //std::cout<<"Points "<<polyDataResult->GetNumberOfPoints()<<std::endl;
+               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();
+               polyDataResult->Update( );
+               polyDataResult->UpdateInformation();
 #else
        // ..
 #endif
-
-       //EED
-               /*
-       ofstream myfile;
-       myfile.open ("C:/Creatis/example.txt");
-       myfile << "\n";
-       polyDataResult->Print(myfile);
-       myfile << "-------------------------------------\n";
-       polyDataResult->GetLines()->Print(myfile);
-       myfile.close();*/
-
-       cntVTK          -> Delete();
-       cpd                     -> Delete();
-       conn            -> Delete();
-
-
-       //--Calculating control points
-
-       std::vector<double> vecX;
-       std::vector<double> vecY;
-       std::vector<double> vecXo;
-       std::vector<double> vecYo;
-       std::vector<double>::iterator vecXoi;
-       std::vector<double>::iterator vecYoi;
-       std::vector<double> vecZ;
-
-       std::vector<double> vecCtrlPointX;
-       std::vector<double> vecCtrlPointY;
-       std::vector<double> vecCtrlPointZ;
-
-
-       double *p;
-       double xAct=0;
-       double yAct=0;
-       int ii,size=polyDataResult->GetNumberOfPoints();
-       ofstream myfile;
-       myfile.open ("C:/Creatis/example2.txt");
-
-       size=polyDataResult->GetNumberOfPoints();
-       for (ii=0;ii<size;ii++)
-       {
-               if(ii==0)
-               {
-                       xAct=x;
-                       yAct=y;
-               }
-               p       = polyDataResult->GetPoint(ii);
-               double x=p[0];
-               double y=p[1];
-               /*if(fabs(yAct-y)>20)
+               cntVTK          -> Delete();
+               cpd                     -> Delete();
+               conn            -> Delete();
+               //--Calculating control points
+               std::vector<double> vecX;
+               std::vector<double> vecY;
+               std::vector<double> vecXo;
+               std::vector<double> vecYo;
+               std::vector<double>::iterator vecXoi;
+               std::vector<double>::iterator vecYoi;
+               std::vector<double> vecZ;
+               std::vector<double> vecCtrlPointX;
+               std::vector<double> vecCtrlPointY;
+               std::vector<double> vecCtrlPointZ;
+               double *p;
+               double xAct=0;
+               double yAct=0;
+               int ii,size=polyDataResult->GetNumberOfPoints();
+               ofstream myfile;
+               myfile.open ("C:/Creatis/example2.txt");
+               size=polyDataResult->GetNumberOfPoints();
+               for (ii=0;ii<size;ii++)
                {
-                       if((xAct-x)>1 || (xAct-x)<-1)
+                       if(ii==0)
                        {
-                       vecX.push_back( p[0] );
-                       vecY.push_back( p[1] );
-                       myfile <<p[0]<<","<<p[1]<<"\n";
-                       std::cout<<" x Anterior "<<xAct<<" x actual "<<x<<std::endl;
-               std::cout<<" y Anterior "<<yAct<<" y actual "<<y<<std::endl;
-               std::cout<<" x "<<p[0]<<" y "<<p[1]<<std::endl;
-                       vecZ.push_back( 900 );
-                       xAct=x;
-                       yAct=y;
+                               xAct=x;
+                               yAct=y;
                        }
-                       else
+                       p       = polyDataResult->GetPoint(ii);
+                       double x=p[0];
+                       double y=p[1];
+//                     if(fabs(yAct-y)>20)
+//                     {
+//                             if((xAct-x)>1 || (xAct-x)<-1)
+//                             {
+//                                     vecX.push_back( p[0] );
+//                                     vecY.push_back( p[1] );
+//                                     myfile <<p[0]<<","<<p[1]<<"\n";
+//                                     std::cout<<" x Anterior "<<xAct<<" x actual "<<x<<std::endl;
+//                                     std::cout<<" y Anterior "<<yAct<<" y actual "<<y<<std::endl;
+//                                     std::cout<<" x "<<p[0]<<" y "<<p[1]<<std::endl;
+//                                     vecZ.push_back( 900 );
+//                                     xAct=x;
+//                                     yAct=y;
+//                             } else {
+//                                     vecXo.push_back(p[0]);
+//                                     vecYo.push_back(p[1]);
+//                             }
+//                     } else
+
+                       if(fabs(xAct-x)>11)
                        {
                                vecXo.push_back(p[0]);
                                vecYo.push_back(p[1]);
-                       }
-
-               }
-               else*/ if(fabs(xAct-x)>11)
-               {
-                       vecXo.push_back(p[0]);
-                       vecYo.push_back(p[1]);
-               } else {
-                       vecX.push_back( p[0] );
-                       myfile <<p[0]<<","<<p[1]<<"\n";
-                       //std::cout<<" x Anterior "<<xAct<<" x actual "<<x<<std::endl;
-                       //std::cout<<" y Anterior "<<yAct<<" y actual "<<y<<std::endl;
-                       //std::cout<<" x "<<p[0]<<" y "<<p[1]<<std::endl;
-                       vecY.push_back( p[1] );
+                       } else {
+                               vecX.push_back( p[0] );
+                               myfile <<p[0]<<","<<p[1]<<"\n";
+                               //std::cout<<" x Anterior "<<xAct<<" x actual "<<x<<std::endl;
+                               //std::cout<<" y Anterior "<<yAct<<" y actual "<<y<<std::endl;
+                               //std::cout<<" x "<<p[0]<<" y "<<p[1]<<std::endl;
+                               vecY.push_back( p[1] );
 //EED 2017-12-16
-                       vecZ.push_back( -900 );
-                       xAct = x;
-                       yAct = y;
-               } // if xAct
-
+                               vecZ.push_back( -900 );
+                               xAct = x;
+                               yAct = y;
+                       } // if xAct
 
-       }
 
-       while(!vecXo.empty())
-       {
-               vecX.push_back(vecXo.back());
-               //std::cout<<" x Siguiente "<<vecXo.back();
-               vecXo.pop_back();
-//EED 2017-12-16
-               vecZ.push_back( -900 );
-       }
-       while(!vecYo.empty())
-       {
-               vecY.push_back(vecYo.back());
-                       vecYo.pop_back();
-       }
-       myfile.close();
+               } // for
 
-       /*for(int l=0;l<vecX.size();l++)
-       {
-               if(l==0)
+               while(!vecXo.empty())
                {
-            vecXo.push_back(p[0]);
-                       vecYo.push_back(p[1]);
+                       vecX.push_back(vecXo.back());
+                       //std::cout<<" x Siguiente "<<vecXo.back();
+                       vecXo.pop_back();
+       //EED 2017-12-16
+                       vecZ.push_back( -900 );
                }
-               else
+               while(!vecYo.empty())
                {
-                       if(vecXoi[l-1]==)
-                       {
-                       }
+                       vecY.push_back(vecYo.back());
+                               vecYo.pop_back();
                }
+               myfile.close();
+
+//             for(int l=0;l<vecX.size();l++)
+//             {
+//                     if(l==0)
+//                     {
+//               vecXo.push_back(p[0]);
+//                             vecYo.push_back(p[1]);
+//                     } else {
+//                             if(vecXoi[l-1]==)
+//                             {
+//                             }
+//                     } // if
+//             } // for
+
+               ExtractControlPoints2D *extractcontrolpoints2d = new ExtractControlPoints2D();
+               extractcontrolpoints2d->SetContour( &vecX , &vecY , &vecZ );
+
+               int method=2;
+               if (method==0)
+               {
+                       extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               } else if (method==1){
+                       extractcontrolpoints2d->GetControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               } else if (method==2){
+                       extractcontrolpoints2d->SetSamplingControlPoints( 15 );
+                       extractcontrolpoints2d->GetSamplingControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               }
+               //--Adding contour to the system
 
-       }*/
-
-       ExtractControlPoints2D *extractcontrolpoints2d = new ExtractControlPoints2D();
-
-       extractcontrolpoints2d->SetContour( &vecX , &vecY , &vecZ );
-
-       int method=2;
-       if (method==0){
-               extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }
-       else if (method==1){
-               extractcontrolpoints2d->GetControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }
-       else if (method==2){
-               extractcontrolpoints2d->SetSamplingControlPoints( 15 );
-               extractcontrolpoints2d->GetSamplingControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }
-       //--Adding contour to the system
-
-       std::vector<int> actualInstantVector;
-       _instantPanel->getInstant( actualInstantVector );
-       actualInstantVector[1]=z;
+               std::vector<int> actualInstantVector;
+               _instantPanel->getInstant( actualInstantVector );
+               actualInstantVector[1]=z;
 
-       int j,sizeCtrPt = vecCtrlPointX.size();
+               int j,sizeCtrPt = vecCtrlPointX.size();
 
-       manualBaseModel *manModelContour =  kernelManager->factoryManualContourModel( typeofcontour );
-       manModelContour->SetNumberOfPointsSpline( ((sizeCtrPt/100)+1)*100 );
-       if (sizeCtrPt>=3){
-               for (j=0 ; j<sizeCtrPt ; j++)
-               {
-                       manModelContour->AddPoint( vecCtrlPointX[j] , vecCtrlPointY[j] , vecCtrlPointZ[j]  );
-               } // for
-               std::string theName;
-               //theName = _modelManager->createOutline( manModelContour, actualInstantVector );
-               theName = kernelManager->createOutline( manModelContour, actualInstantVector );
-               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->configureViewControlTo(theName, manModelContour, spc, typeofcontour);
-                       //_theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc, typeofcontour ) ;
-               }       // if addedModel
-       } // if sizeCtrPt
+               manualBaseModel *manModelContour =  kernelManager->factoryManualContourModel( typeofcontour );
+               manModelContour->SetNumberOfPointsSpline( ((sizeCtrPt/100)+1)*100 );
+               if (sizeCtrPt>=3){
+                       for (j=0 ; j<sizeCtrPt ; j++)
+                       {
+                               manModelContour->AddPoint( vecCtrlPointX[j] , vecCtrlPointY[j] , vecCtrlPointZ[j]  );
+                       } // for
+                       std::string theName;
+                       //theName = _modelManager->createOutline( manModelContour, actualInstantVector );
+                       theName = kernelManager->createOutline( manModelContour, actualInstantVector );
+                       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->configureViewControlTo(theName, manModelContour, spc, typeofcontour);
+                               //_theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc, typeofcontour ) ;
+                       }       // if addedModel
+               } // if sizeCtrPt
 
+    }   catch( itk::ExceptionObject & excep ) {
+               std::cerr << "Exception caught !" << std::endl;
+               std::cerr << excep << std::endl;
+    } // try
 
-/*
-//EED10JUIN2011
-                WriterType::Pointer writer = WriterType::New();
-         CastFilterType3::Pointer caster = CastFilterType3::New();
-
-                caster->SetInput( gradientMagnitude->GetOutput() );
-                writer->SetInput( caster->GetOutput() );
-                writer->SetFileName("Gradient Magnitude.png");
-                caster->SetOutputMinimum(   0 );
-                caster->SetOutputMaximum( 255 );
-                writer->Update();
-
-                CastFilterType3::Pointer caster2 = CastFilterType3::New();
-                WriterType::Pointer writer2 = WriterType::New();
-
-                caster2->SetInput( sigmoid->GetOutput() );
-                writer2->SetInput( caster2->GetOutput() );
-                writer2->SetFileName("Sigmoid.png");
-                caster2->SetOutputMinimum(   0 );
-                caster2->SetOutputMaximum( 255 );
-                writer2->Update();
-
-                CastFilterType3::Pointer caster3 = CastFilterType3::New();
-                WriterType::Pointer writer3 = WriterType::New();
-
-                caster3->SetInput( fastMarching->GetOutput() );
-                writer3->SetInput( caster3->GetOutput() );
-                writer3->SetFileName("FastMarching.bmp");
-                caster3->SetOutputMinimum(   0 );
-                caster3->SetOutputMaximum( 255 );
-                writer3->Update();
-
-                CastFilterType3::Pointer caster4 = CastFilterType3::New();
-                WriterType::Pointer writer4 = WriterType::New();
-
-                caster4->SetInput( geodesicActiveContour->GetOutput() );
-                writer4->SetInput( caster4->GetOutput() );
-                writer4->SetFileName("GeodesicActiveContour.png");
-                caster4->SetOutputMinimum(   0 );
-                caster4->SetOutputMaximum( 255 );
-                writer4->Update();
-
-                CastFilterType3::Pointer caster5 = CastFilterType3::New();
-                WriterType::Pointer writer5 = WriterType::New();
-
-                caster5->SetInput( zeroCrossing->GetOutput() );
-                writer5->SetInput( caster5->GetOutput() );
-                writer5->SetFileName("ZeroCrossing.bmp");
-                caster5->SetOutputMinimum(   0 );
-                caster5->SetOutputMaximum( 255 );
-                writer5->Update();
-*/
-    }
-  catch( itk::ExceptionObject & excep )
-    {
-    std::cerr << "Exception caught !" << std::endl;
-    std::cerr << excep << std::endl;
-    }
 }
 
 void wxContourMainFrame::onSegmentationOneSlice(int isovalue,int sampling,int method){
@@ -1887,20 +1743,21 @@ void wxContourMainFrame::onSegmentationOneSlice(int isovalue,int sampling,int me
 
 void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method )
 {
+
+printf("EED wxContourMainFrame::SegmentationOneSlice Start=%d  %d\n",sampling,method );
+printf("EED wxContourMainFrame::SegmentationOneSlice %d %d %d  \n",x,y,z );
+
        int typeofcontour = 1;
        //--Extracting Contour
-       //vtkImageData  *imagedata      = _theViewPanel->getSceneManager()->GetImageData();
        vtkImageData    *imagedata      = getImageData();
-//             double                  *range          = imagedata->GetScalarRange();
-//             double                  thr                     = 1;
 
        vtkImageReslice *imageReslice = vtkImageReslice::New();
 //EED
-//             double spc[3];
-//             imagedata->GetSpacing(spc);
-//             x = x*spc[0];
-//             y = y*spc[1];
-//             z = z*spc[3];
+               double spc[3];
+               imagedata->GetSpacing(spc);
+               x = x*spc[0];
+               y = y*spc[1];
+               z = z;
 
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
@@ -1910,7 +1767,7 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
 #endif
        imageReslice->SetInformationInput(imagedata);
        imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
-       imageReslice->SetResliceAxesOrigin(0,0,z);
+       imageReslice->SetResliceAxesOrigin(0,0,z*spc[2]);
        imageReslice->SetOutputDimensionality(2);
        imageReslice->SetInterpolationModeToLinear();
 
@@ -1958,7 +1815,15 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
        cpd->UpdateInformation();
 
        vtkPolyDataConnectivityFilter* conn = vtkPolyDataConnectivityFilter::New( );
-       conn->SetExtractionModeToClosestPointRegion( );
+
+//     conn->SetExtractionModeToPointSeededRegions();
+//     conn->SetExtractionModeToCellSeededRegions();
+//     conn->SetExtractionModeToSpecifiedRegions();
+//     conn->SetExtractionModeToLargestRegion();
+//     conn->SetExtractionModeToAllRegions();
+
+       conn->SetExtractionModeToClosestPointRegion();
+
        //conn->SetMaxRecursionDepth( 3000 );
 
 //EED 2017-01-01 Migration VTK7
@@ -1983,11 +1848,15 @@ void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue
        cpd2->UpdateInformation();
 
        vtkStripper* vtkstripper = vtkStripper::New( );
+vtkstripper->SetJoinContiguousSegments(true);
+       vtkstripper->SetMaximumLength(20000);
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        vtkstripper->SetInput( cpd2->GetOutput() );
 #else
        vtkstripper->SetInputData( cpd2->GetOutput() );
+//     vtkstripper->SetInputData( cntVTK->GetOutput() );
+
 #endif
        vtkstripper->Update();
        vtkstripper->UpdateInformation();
@@ -2012,117 +1881,144 @@ myfile << "-------------------------------------\n";
 polyDataResult->GetLines()->Print(myfile);
 myfile.close();
 */
-
-       cntVTK          -> Delete();
-       cpd2            -> Delete();
-       cpd                     -> Delete();
-       conn            -> Delete();
-
+       cntVTK  -> Delete();
+       cpd2    -> Delete();
+       cpd             -> Delete();
+       conn    -> Delete();
 
 //--Calculating control points
-
        std::vector<double> vecX;
        std::vector<double> vecY;
        std::vector<double> vecZ;
-
        std::vector<double> vecCtrlPointX;
        std::vector<double> vecCtrlPointY;
        std::vector<double> vecCtrlPointZ;
 
+printf("EED wxContourMainFrame::SegmentationOneSlice GetNumberOfLines=%d \n",polyDataResult->GetNumberOfLines() );
 
-       double *p;
-       int ii,size=polyDataResult->GetNumberOfPoints();
-       int id;
-       for (ii=1;ii<=size;ii++)
-       {
-               id      = polyDataResult->GetLines()->GetData()->GetValue(ii);
-               p       = polyDataResult->GetPoint(id);
-//             double x=p[0];
-//             double y=p[1];
-               vecX.push_back( p[0] );
-               vecY.push_back( p[1] );
-//EED 2017-12-16
-               vecZ.push_back( -900 );
-//                     vecZ.push_back( p[2] );
-       }
+int numberOfPointsInCell;
+int numberOfcells=polyDataResult->GetNumberOfCells();
+for (int jj=0; jj<numberOfcells ; jj++)
+{
+       vtkCell* vtkcell = polyDataResult->GetCell( jj );
+       numberOfPointsInCell=vtkcell->GetNumberOfPoints();
+       printf("EED wxContourMainFrame::SegmentationOneSlice cell=%d  points=%d \n",jj,numberOfPointsInCell );
+}// for jj
 
+printf("EED wxContourMainFrame::SegmentationOneSlice PrintSelf \n");
 
-       ExtractControlPoints2D *extractcontrolpoints2d = new ExtractControlPoints2D();
-       extractcontrolpoints2d->SetContour( &vecX , &vecY , &vecZ );
+polyDataResult->PrintSelf( std::cout, vtkIndent(0) );
 
-//PROOFS
-       /*if (methodRadiobox->GetSelection()==0){
-               extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }
-       if (methodRadiobox->GetSelection()==1){
-               extractcontrolpoints2d->GetControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }
-       if (methodRadiobox->GetSelection()==2){
-               extractcontrolpoints2d->SetSamplingControlPoints( sampling );
-               extractcontrolpoints2d->GetSamplingControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }*/
 
-       if (method==0){
-               extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }
-       else if (method==1){
-               extractcontrolpoints2d->GetControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }
-       else if (method==2){
-               extractcontrolpoints2d->SetSamplingControlPoints( sampling );
-               extractcontrolpoints2d->GetSamplingControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
-       }
+       if (polyDataResult->GetNumberOfCells()>0)
+       {
+               double *p;
+       printf("EED wxContourMainFrame::SegmentationOneSlice A \n");
+               vtkCell* vtkcell = polyDataResult->GetCell( 0 );
+       printf("EED wxContourMainFrame::SegmentationOneSlice B \n");
+       //      int ii,size=polyDataResult->GetNumberOfPoints();
+               int ii,size=vtkcell->GetNumberOfPoints();
+       printf("EED wxContourMainFrame::SegmentationOneSlice C \n");
+               int id;
+               for (ii=0;ii<size;ii++)
+               {
+       //              id      = polyDataResult->GetLines()->GetData()->GetValue(ii);
+       //              p       = polyDataResult->GetPoint(id);
+                       p       = vtkcell->GetPoints()->GetPoint(ii);
 
-       //--Adding contour to the system
+       printf("EED wxContourMainFrame::SegmentationOneSlice (%d) id=%d  px=%f py=%f\n",ii,id, p[0],p[1]);
+       //              double x=p[0];
+       //              double y=p[1];
+                       vecX.push_back( p[0] );
+                       vecY.push_back( p[1] );
+       //EED 2017-12-16
+                       vecZ.push_back( -900 );
+       //                      vecZ.push_back( p[2] );
+               }
+
+               ExtractControlPoints2D *extractcontrolpoints2d = new ExtractControlPoints2D();
+               extractcontrolpoints2d->SetContour( &vecX , &vecY , &vecZ );
 
-       std::vector<int> actualInstantVector;
-       _instantPanel->getInstant( actualInstantVector );
-       actualInstantVector[1]=z;
+       //PROOFS
+               /*if (methodRadiobox->GetSelection()==0){
+                       extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               }
+               if (methodRadiobox->GetSelection()==1){
+                       extractcontrolpoints2d->GetControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               }
+               if (methodRadiobox->GetSelection()==2){
+                       extractcontrolpoints2d->SetSamplingControlPoints( sampling );
+                       extractcontrolpoints2d->GetSamplingControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               }*/
 
-       int j,sizeCtrPt = vecCtrlPointX.size();
-       manualBaseModel *manModelContour =  kernelManager->factoryManualContourModel( typeofcontour );
-       manModelContour->SetNumberOfPointsSpline( ((sizeCtrPt/100)+1)*100 );
-       if (sizeCtrPt>=3){
-               for (j=0 ; j<sizeCtrPt ; j++)
+               if (method==0)
                {
-                       manModelContour->AddPoint( vecCtrlPointX[j] , vecCtrlPointY[j] , vecCtrlPointZ[j]  );
-               } // for
-               std::string theName;
-               //theName = _modelManager->createOutline( manModelContour, actualInstantVector );
-               theName = kernelManager->createOutline( manModelContour, actualInstantVector );
-               bool addedModel = theName.compare("") != 0;
-               if( addedModel )
+                       extractcontrolpoints2d->GetInitialControlPoints( &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               } else if (method==1){
+                       extractcontrolpoints2d->GetControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               } else if (method==2){
+                       extractcontrolpoints2d->SetSamplingControlPoints( sampling );
+                       extractcontrolpoints2d->GetSamplingControlPoints(  &vecCtrlPointX , &vecCtrlPointY , &vecCtrlPointZ );
+               }
+
+               //--Adding contour to the system
+               std::vector<int> actualInstantVector;
+               _instantPanel->getInstant( actualInstantVector );
+               actualInstantVector[1]=z;
+
+               int j,sizeCtrPt = vecCtrlPointX.size();
+               manualBaseModel *manModelContour =  kernelManager->factoryManualContourModel( typeofcontour );
+               manModelContour->SetNumberOfPointsSpline( ((sizeCtrPt/100)+1)*100 *2 );
+               manModelContour->SetLabel2( std::to_string(z) );
+               if (sizeCtrPt>=3)
                {
-                       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->configureViewControlTo(theName, manModelContour, spc, typeofcontour);
-                       //_theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc, typeofcontour ) ;
-               }       // if addedModel
-       } // if sizeCtrPt
+                       for (j=0 ; j<sizeCtrPt ; j++)
+                       {
+                               manModelContour->AddPoint( vecCtrlPointX[j] / spc[0], vecCtrlPointY[j] / spc[1], vecCtrlPointZ[j] );
+                       } // for
+                       std::string theName;
+                       //theName = _modelManager->createOutline( manModelContour, actualInstantVector );
+                       theName = kernelManager->createOutline( manModelContour, actualInstantVector );
+                       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->configureViewControlTo(theName, manModelContour, spc, typeofcontour);
+                               //_theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc, typeofcontour ) ;
+                       }       // if addedModel
+               } // if sizeCtrPt
+       } // if NumberOfCells > 0
+
+printf("EED wxContourMainFrame::SegmentationOneSlice  End\n");
 }
-int wxContourMainFrame::GetImageDataSizeZ(){
+
+int wxContourMainFrame::GetImageDataSizeZ()
+{
        return _theViewPanel->GetImageDataSizeZ();
 }
 
-void wxContourMainFrame::GetImageDataRange(double *range){
+void wxContourMainFrame::GetImageDataRange(double *range)
+{
        _theViewPanel->GetImageDataRange(range);
 }
 
-void wxContourMainFrame::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method){
+void wxContourMainFrame::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method)
+{
        //JCP 20-10-08 Undo redo implementation
        saveState();
        //JCP 20-10-08 Undo redo implementation
 
        wxBusyCursor wait;
-       int                                     x                                       = _theViewPanel->GetX();
-       int                                     y                                       = _theViewPanel->GetY();
-       int z;
-       double porcent;
-       wxString tmpString;
-       double totalZ = maxZ-minZ+1;
+       int                                     x = _theViewPanel->GetX();
+       int                                     y = _theViewPanel->GetY();
+       int                             z;
+       double                          porcent;
+       wxString                        tmpString;
+       double                          totalZ = maxZ-minZ+1;
        for( z=minZ ; z<=maxZ ; z++ )
        {
                porcent = 100.0* (z-minZ)/totalZ;
@@ -2361,18 +2257,44 @@ void wxContourMainFrame::onInterpolation(bool interpolate)
        RefreshInterface();
 }
 
+void wxContourMainFrame::onBeforeAfterContour(bool before,bool after)
+{
+       _theViewPanel->onBeforeAfterContour(before,after);
+       RefreshInterface();
+}
+
+void wxContourMainFrame::onJumpSlice(int step, int shift)
+{
+       std::vector<int> tempVector;
+       _instantPanel->getInstant( tempVector );
+       int ss  = abs(step);
+       int pos         = tempVector[1];
+       int maxZ        = interfMainPanel::getInstance()->GetImageDataSizeZ();
+       pos=(pos/ss)*ss+step+shift;
+       if ((pos>=0) && (pos<maxZ)) 
+       {
+               tempVector[1]=pos;
+               _instantPanel->setInstant( tempVector );
+               RefreshInterface();
+       } // if pos     
+}
+
+void wxContourMainFrame::onShowTextContour(bool show)
+{
+       _theViewPanel->onShowTextContour(show);
+       RefreshInterface();
+}
+
 void wxContourMainFrame::onChangeInstant(std::string name,int actual)
 {
        _instantPanel->setConceptValue( name, actual );
 }
 
-
 void wxContourMainFrame::resetAppend()
 {
        kernelManager->resetAppend();
 }
 
-
 void wxContourMainFrame::onSpreadAdd()
 {
        std::vector<double> vecX;
@@ -2483,6 +2405,7 @@ void wxContourMainFrame::onSpreadGo(int type)
 
 void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector)
 {
+       _instantPanel->getInstant( tempVector );
 }
 
 std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide)
@@ -3087,6 +3010,7 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef
        valueChInfo->SetInputData(value);
 #endif
        valueChInfo->SetSpacingScale(spc);      
+       valueChInfo->Update();  
        vtkMetaImageWriter *writerValueImage = vtkMetaImageWriter::New( );
 
 //EED 2017-01-01 Migration VTK7
@@ -3117,6 +3041,7 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef
        maskChInfo->SetInputData(mask);
 #endif
        maskChInfo->SetSpacingScale(spc);       
+       maskChInfo->Update();   
        vtkMetaImageWriter *writerMaskImage = vtkMetaImageWriter::New( );
 
 //EED 2017-01-01 Migration VTK7
@@ -3173,7 +3098,9 @@ void wxContourMainFrame::onSnakePressed(){
 
 }
 
-void wxContourMainFrame::saveFileWithContoursAutomatique(){
+void wxContourMainFrame::saveFileWithContoursAutomatique()
+{
+printf("EED wxContourMainFrame::saveFileWithContoursAutomatique \n");
        std::string filename = kernelManager->getCurrentFileName();
        if(filename.compare("")!=0){
                saveFileWithContours(filename);
@@ -3181,7 +3108,8 @@ void wxContourMainFrame::saveFileWithContoursAutomatique(){
                onSave();
        }
 }
-void wxContourMainFrame::ShowToolsPanel(bool show){
+void wxContourMainFrame::ShowToolsPanel(bool show)
+{
        _pannew->Show(show);
 }
 
@@ -3261,6 +3189,18 @@ wxPanel *wxContourMainFrame::getColorLayerImageViewPanel(wxWindow *parent)
        return _viewColorLayerImagePanel;
 }
 
+void wxContourMainFrame::SetColorLayerImage(vtkImageData* img)
+{
+       if (_viewColorLayerImagePanel!=NULL) 
+       {
+               if (img!=NULL)
+               {
+                       _viewColorLayerImagePanel->SetActive(true);
+                       _viewColorLayerImagePanel->SetImage( img );
+//                     RefreshInterface();
+               } // img
+       } // _viewColorLayerImagePanel
+}
 
 wxPanel *wxContourMainFrame::getThresholdImageViewPanel(wxWindow *parent)
 {
@@ -3268,13 +3208,14 @@ wxPanel *wxContourMainFrame::getThresholdImageViewPanel(wxWindow *parent)
        {
                double range[2];
                _theViewPanel->getImageData()->GetScalarRange(range);
-               int min = (int)floor (range[0]);
-               int max = (int)ceil (range[1]);
-               int start= (max+min)/2 - (max-min)*0.25; 
-               int end= (max+min)/2 + (max-min)*0.25; 
-               _viewThresholdImagePanel = new ThresholdImageViewPanel( parent, min, max, start, end , 1);
-               _viewThresholdImage = new ThresholdImageView();
+               int min                                         = (int)floor (range[0]);
+               int max                                         = (int)ceil (range[1]);
+               int start                                       = (max+min)/2 - (max-min)*0.25; 
+               int end                                         = (max+min)/2 + (max-min)*0.25; 
+               _viewThresholdImagePanel        = new ThresholdImageViewPanel( parent, min, max, start, end , 1);
+               _viewThresholdImage             = new ThresholdImageView();
                _viewThresholdImage->SetminMaxValue(start,end);
+//             _viewThresholdImage->SetminMaxValue(range[0],range[1]);
                _viewThresholdImage->SetImage( _theViewPanel->getImageData() );
                std::vector<int> colorbarposition;
                colorbarposition.push_back( 10 );
@@ -3386,6 +3327,9 @@ void wxContourMainFrame::SetFileLocation(std::string newFileLocation)
 {
        _fileLocation = newFileLocation;
        std::cout<<"GETFILELOCATION:"<<_fileLocation<<std::endl;
+
+//EED 2019-12-17
+       kernelManager->setCurrentFileName(_fileLocation);
 }
 //------------------------------------------------------------------------------------------------------------
 
@@ -3435,7 +3379,6 @@ void wxContourMainFrame::FlipLstOfContours(std::vector<std::string> lstNameThing
        sizeLstNameThings       = lstNameThings.size(); 
        for (i=0 ; i<sizeLstNameThings ; i++)
        {
-               printf("EED wxContourMainFrame::FlipAllContours contour=%d \n", i );
                manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(lstNameThings[i]);
                if (flipDirection==0)
                {
@@ -3463,8 +3406,6 @@ void wxContourMainFrame::FlipLstOfContours(std::vector<std::string> lstNameThing
 
 void wxContourMainFrame::FlipContours(int typeContourFlip, int flipDirection)
 {
-       printf("EED wxContourMainFrame::FlipContours( %d , %d ) \n",typeContourFlip,  flipDirection );
-
        saveState();
        
        if (typeContourFlip==0) // 
@@ -3484,7 +3425,20 @@ void wxContourMainFrame::FlipContours(int typeContourFlip, int flipDirection)
        RefreshInterface();
 }
 
+void wxContourMainFrame::SetXY(int x, int y)
+{
+       _theViewPanel->SetXY(x,y);
+}
 
+wxVtkBaseView* wxContourMainFrame::GetWxVtkBaseView()
+{
+       if (_theViewPanel!=NULL)
+       {
+               return _theViewPanel->getWxVtkBaseView();;
+       } else {
+               return NULL;
+       }
+}
 
 
 
index d9445631743d9c1169aaa4358c4dd39bfb127a08..aa7a947df3139d0dbebe42c5eaaf3de4ceef4731 100644 (file)
@@ -82,6 +82,9 @@
 
 //EED10JUIN2011  #include "itkImageFileWriter.h"
 
+//EED2020-03-18
+#undef Success
+
 #include "itkImageToVTKImageFilter.h"
 #include "itkVTKImageToImageFilter.h"
 
 //------------------------------------------------------------------------------------------------------------
 class interfMainPanel;
 class wxContourMainFrame : public wxPanel {
-
        public:
-
        //------------------------------------------------------------------------------------------------------------
        // Constructors & Destructors
        //------------------------------------------------------------------------------------------------------------
-
-
        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="C:/Creatis/creaContoursBin/RelWithDebInfo/");
-
        ~wxContourMainFrame();
-
        //------------------------------------------------------------------------------------------------------------
        // Creational and initialization methods
        //------------------------------------------------------------------------------------------------------------
-
        void setVectImages(std::vector<vtkImageData*> imgs);
-
        bool configurePanels( );
-
        bool addNewPanel(wxPanel* panel);
-
        wxAuiNotebook * createNotebook();
-
        void createInstantChooserPanel(wxAuiNotebook * parent);
-
        void createViewPanel(wxAuiNotebook * parent);
-
        void createInstantChooserPanel(wxWindow * parent);
-
        void createViewPanel(wxWindow * parent);
-
+       wxVtkBaseView* GetWxVtkBaseView();
        void setInstantChooserPanel(  wxInstantChooserPanel * theInstantChooserPanel );
-
        void getMaskValue(vtkImageData ** mask,vtkImageData ** value,int typeContourGroup, int selection, int minZ, int maxZ);
-
        void SaveImageResult(std::string directory,std::string namefile, vtkImageData* mask,vtkImageData* value);
-
        void ShowToolsPanel(bool show);
-
-
        ////------------------------------------------------------------------------------------------------------------
        //// Methods for capturing events
        ////------------------------------------------------------------------------------------------------------------
 
-
        ////------------------------------------------------------------------------------------------------------------
        ////  Model management methods
        ////------------------------------------------------------------------------------------------------------------
 
-
        //------------------------------------------------------------------------------------------------------------
        //  Attributes getters and setters
        //------------------------------------------------------------------------------------------------------------
@@ -264,6 +246,9 @@ class wxContourMainFrame : public wxPanel {
        int getWindowLevel();
        void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
        void onInterpolation(bool interpolate);
+       void onShowTextContour(bool show);
+       void onBeforeAfterContour(bool before, bool after);
+       void onJumpSlice(int step,int shift);
        void onChangeInstant(std::string name,int actual);
        void resetAppend();
        void onSpreadAdd();
@@ -288,6 +273,7 @@ class wxContourMainFrame : public wxPanel {
        void    SetContourGroup(int contourGroup);
        wxPanel *getThresholdImageViewPanel(wxWindow *parent);
        wxPanel *getColorLayerImageViewPanel(wxWindow *parent);
+       void    SetColorLayerImage(vtkImageData*);
 
 //CMRU 17-08-09-----------------------------------------------------------------------------------------------
 
@@ -338,11 +324,13 @@ class wxContourMainFrame : public wxPanel {
 //------------------------------------------------------------------------------------------------------------
 
        void SetScalarRange(int grayRangeMin, int grayRangeMax);
-
        std::string GetStringTypeImage( vtkImageData* image);
 
 //------------------------------------------------------------------------------------------------------------
 
+       void SetXY(int x,int y);
+
+
 private:
        //------------------------------------------------------------------------------------------------------------
        //  Private methods
@@ -353,7 +341,7 @@ private:
        // Attributtes
        //------------------------------------------------------------------------------------------------------------
 
-       int _contourGroup;
+       int                                             _contourGroup;
        static wxContourMainFrame   *instance;
        KernelManagerContour        *kernelManager;
        interfMainPanel             *_pannew;
@@ -369,9 +357,9 @@ private:
 
        wxAuiManager                m_mgr;
        wxAuiNotebook               *notebook;
-       long                    m_notebook_style;
-       long                    m_notebook_theme;
-       int                      _numberOfVariablesStatistics;
+    long                                               m_notebook_style;
+    long                       m_notebook_theme;
+    int                         _numberOfVariablesStatistics;
 
        // Contour Image Mask
        ThresholdImageView                      *_viewMaskImage;
index 0115b33cbb411d4947cd29b5b429a575547c1a63..85952db7722110586daf1ed22d76099a95e6f558 100644 (file)
@@ -58,6 +58,8 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
        {
                theShowingImage->GetSpacing(last_spacing);
                showingVID                              = theShowingImage;
+               _showBeforeContour              = false;
+               _showAfterContour               = false;
                int gapH                                = 20;
                int gapV                                = 10;
                _verticalConceptName    = "";
@@ -224,6 +226,13 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                return  GetwxVtkMPR2DView()->GetVtkmprbasedata()->GetZ();
        }
 
+       //------------------------------------------------------------------------------------------------------------
+       void wxContourViewPanel::SetXY(int x, int y)
+       {
+               GetwxVtkMPR2DView()->GetVtkmprbasedata()->SetX(x);
+               GetwxVtkMPR2DView()->GetVtkmprbasedata()->SetY(y);
+       }
+
        //------------------------------------------------------------------------------------------------------------
        void wxContourViewPanel::Refresh()
        {
@@ -703,22 +712,76 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
 
        void wxContourViewPanel::addNameWrapperToScene()
        {
-               int size = wxContourMainFrame::getInstance()->getNamesWrappingSize();
-               for(int i = 0; i < size;i++){
+               int i,size = wxContourMainFrame::getInstance()->getNamesWrappingSize();
+               for(i = 0; i < size;i++)
+               {
                        std::string name = wxContourMainFrame::getInstance()->getNameWrapping(i);
                        _sceneManager->addToScene(name, true, true, true, false, false );
-               }
+               } // for i
+
+               _sceneManager->SetLabelNumberOfContours( "contours:"+std::to_string(size) );
+
+               std::vector<int> tempVector;
+               wxContourMainFrame::getInstance()->getInstantVector( tempVector );
+
+               if (_showBeforeContour==true)
+               {
+                       size=0;
+                       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 (_showAfterContour==true)
+               {
+                       size=0;
+                       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(){
+       std::vector<std::string> wxContourViewPanel::getSelectedObjects()
+       {
                return _sceneManager->getSelectedObjects();
        }
 
-       void wxContourViewPanel::RefreshInterface(){
+       void wxContourViewPanel::RefreshInterface()
+       {
                getWxVtkBaseView()->Refresh();
        }
 
-       vtkImageData* wxContourViewPanel::getImageData(){
+       vtkImageData* wxContourViewPanel::getImageData()
+       {
                return _sceneManager->GetImageData();
        }
 
@@ -771,12 +834,24 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                wxvtk2dbaseview->SetInterpolate( interpolate );
        }
 
+       void wxContourViewPanel::onBeforeAfterContour(bool before, bool after)
+       {
+               _showBeforeContour      = before;
+               _showAfterContour       = after;
+       }
+
+       void wxContourViewPanel::onShowTextContour(bool show)
+       {
+               _sceneManager->SetShowTextContour( show );
+       }
+
        void wxContourViewPanel::GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ )
        {
                _sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ);
        }
 
-       void wxContourViewPanel::setImageSlice(int z){
+       void wxContourViewPanel::setImageSlice(int z)
+       {
                vtkInteractorStyleBaseView* stylebaseview = (vtkInteractorStyleBaseView*) _sceneManager->getWxVtkViewBase()->GetInteractorStyleBaseView();
                wxVtk2DBaseView* baseview = (wxVtk2DBaseView*)stylebaseview->GetWxVtk2DBaseView();
                baseview->SetActualSlice(z);
index 60d66f23de40d14d7a6a2087dc6822a639c149b0..1ea6f2679af5a1a94340fc6952cd9ba0aa97d610 100644 (file)
@@ -279,23 +279,19 @@ class wxContourViewPanel : public wxPanel
        * Gets the vertical concept name
        * @return _verticalConcept The name of the concept for setting at the vertical bar
        */
-       std::string  getVerticalConceptName(  );
-
+       std::string     getVerticalConceptName(  );
        //------------------------------------------------------------------------------------------------------------
        //  Other functional methods
        //------------------------------------------------------------------------------------------------------------
-
-       void getSpacing( double * spacing );
-
-       wxVtkBaseView* getWxVtkBaseView();
-
-       double getCurrentDeep();
-       
-       void    SetVisibleAxis(bool ok);
-       int             GetX();
-       int             GetY();
-       int             GetZ();
-       void    Refresh();
+       void                    getSpacing( double * spacing );
+       wxVtkBaseView*  getWxVtkBaseView();
+       double                  getCurrentDeep();
+       void                    SetVisibleAxis(bool ok);
+       int                             GetX();
+       int                             GetY();
+       int                             GetZ();
+       void                    SetXY(int x, int y);
+       void                    Refresh();
 
 
 //this method should be deleted
@@ -312,41 +308,27 @@ 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 onShowTextContour(bool show);
+       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
        //------------------------------------------------------------------------------------------------------------
@@ -377,6 +359,8 @@ private:
        bool                                                    _useHorizontalBar;
 
        wxEvtHandler                                    *_eventHandler;
+       bool                                                    _showBeforeContour;
+       bool                                                    _showAfterContour;
        
 //EED
 
@@ -386,7 +370,7 @@ private:
 
        
        
-       wxVtkMPR2DView * GetwxVtkMPR2DView();
+       wxVtkMPR2DView *GetwxVtkMPR2DView();
 
 
 //     DECLARE_CLASS(wxContourViewPanel)
index 1f930e7d8884d3297a4e7711fd0a911d040f9c29..4deb5c15b867570544a276b78a6d9aa7044ac4cf 100644 (file)
@@ -119,37 +119,21 @@ class wxInstantChooserPanel : public wxPanel {
        //------------------------------------------------------------------------------------------------------------
        
        void setInstant(std::vector<int> choiceInstant);
-       
        void setInstant(std::map<std::string,int>* _actualInstant );
-
        void getInstant(std::vector<int> & choiceInstant);
-
        void getInstantData(std::map<std::string,int> & choiceInstantData);
-
        std::map<std::string,int>* getInstantData();
-
        void setResolutionRangeWithLasUpdate();
-
        void refreshConceptLabels();
-
        void setConfiguration(std::string aConfiguration);
-
        std::string getConfiguration();
-       
        void setResolutionOverAll( bool condition );
-
        bool getIfResolutionOverAll();
-
        void setConceptValue( std::string theConceptName, int theValue );
-
        int getConceptValue( std::string theConceptName );
-
        ConceptDataWrap * getConceptDataOf( std::string theConceptName );
-
        bool getIfConceptCheckedAt( std::string theConceptName, int atChecksPosition );
-
        void onChangeInstant( wxCommandEvent& event );
-
        void addConcepts(std::vector<std::string> conceptNameVect,std::vector<int> conceptSizeVect);
 
        private:
@@ -157,40 +141,26 @@ class wxInstantChooserPanel : public wxPanel {
        //  Private methods
        //------------------------------------------------------------------------------------------------------------
        void initializeResolutionSlider();
-
        void changeResolutionAtConceptControl( wxConceptControl * theConceptToUpdate );
-
        void setVerticalMaxSelectedNums( std::string groupMaxVertNums );
 
        //------------------------------------------------------------------------------------------------------------
        // Attributtes
        //------------------------------------------------------------------------------------------------------------
 
-       std::vector<wxConceptControl *> * _concepts;
-
-       wxConceptControl * _lastConceptUpdated;
-
-       wxSlider * _resolutionSlider;
-
-       wxFlexGridSizer * _outSizer;
-
-       bool _orientation;
-
-       bool _resolutionOverALL;
-       
-       std::map<std::string,int>* _actualInstant;
-
-       std::vector<int> _verticalMaxSelected;
-       
-       wxEvtHandler * _eventHandler;
-
-       std::string _configuration;
+       std::vector<wxConceptControl *> *_concepts;
+       wxConceptControl                                *_lastConceptUpdated;
+       wxSlider                                                *_resolutionSlider;
+       wxFlexGridSizer                                 *_outSizer;
+       bool                                                    _orientation;
+       bool                                                    _resolutionOverALL;
+       std::map<std::string,int>               *_actualInstant;
+       std::vector<int>                                _verticalMaxSelected;
+       wxEvtHandler                                    *_eventHandler;
+       std::string                                     _configuration;
     
-
        //DECLARE_CLASS(wxInstantChooserPanel)
        // any class wishing to process wxWindows events must use this macro
        //DECLARE_EVENT_TABLE()
-
 };
-
 #endif 
index 70fd6293e70d0924a5d4bcadadb73116dc8b625f..7d9c22cb8222b1524c5891e5d5537b6a14f1eee1 100644 (file)
@@ -79,6 +79,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                _waiting                                                = false;
                _creatingROI                                    = false;
                _drawingSelectionROI                    = false;
+               _showTextContour                                = true;
                SetWidthContour(1.0);   
                _wxVtk_BaseView = theWxBaseViewToManage;
                if( _wxVtk_BaseView!=NULL )
@@ -88,6 +89,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                        SetVtkInteractorStyleBaseView( theInteractorStyleBaseView );                    
                }
                configureSelectionROI( spc );
+               configureTextNumberOfContour();
        }
 
        //------------------------------------------------------------------------------------------------------------
@@ -237,9 +239,9 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                manViewerContour->RefreshContour();                     
                addToScene( theKeyName );
        }
-       //------------------------------------------------------------------------------------------------------------
-       void wxVtkBaseView_SceneManager :: configureSelectionROI( double * spc )
-       {
+//------------------------------------------------------------------------------------------------------------
+void wxVtkBaseView_SceneManager :: configureSelectionROI( double * spc )
+{
                _controlerSelectionROI = new manualRoiControler();
                _viewerSelectionROI = new manualViewRoi();
                _modelSelectionROI = new manualContourModel();
@@ -255,10 +257,34 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                _controlerSelectionROI->SetModelView( _modelSelectionROI , _viewerSelectionROI );
                ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _controlerSelectionROI );
                _controlerSelectionROI->SetActive(false);
-       }
+}
 
-       //------------------------------------------------------------------------------------------------------------
-       ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: insertWrap( std::string theKeyName, manualContourBaseControler * manContourControl, manualViewBaseContour  * manViewerContour )
+//------------------------------------------------------------------------------------------------------------
+void wxVtkBaseView_SceneManager::configureTextNumberOfContour()
+{
+       // Text Window Level
+       vtkTextActor *textActor = vtkTextActor::New();
+       textActor->SetDisplayPosition(10, 85);
+       textActor->SetInput("contours:--");
+       // Set coordinates to match the old vtkScaledTextActor default value
+       textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
+       textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
+       vtkTextProperty *tprop = textActor->GetTextProperty();
+       tprop->SetFontSize(14);
+       tprop->SetFontFamilyToArial();
+       tprop->SetColor(1, 1, 0);
+       _wxVtk_BaseView->GetRenderer()->AddActor2D(textActor);
+       _numberOfContoursTextActor=textActor;
+}
+
+//------------------------------------------------------------------------------------------------------------
+void wxVtkBaseView_SceneManager::SetLabelNumberOfContours( std::string label )
+{
+       _numberOfContoursTextActor->SetInput( label.c_str() );
+}
+
+//------------------------------------------------------------------------------------------------------------
+ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: insertWrap( std::string theKeyName, manualContourBaseControler * manContourControl, manualViewBaseContour  * manViewerContour )
        {       
                ContourWrap_ViewControl * newContourWrap = new ContourWrap_ViewControl(manContourControl, manViewerContour);
                if(_contours_ViewControl == NULL)
@@ -522,22 +548,34 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                if( !append )
                {
                        removeSceneContours();                  
-               }               
+               } // if !append
+
                _sceneContours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, contourWRP ) );             
-               if ( visualization )
+
+               if ( visualization==true )
                {
                        contourWRP->getViewer()->AddCompleteContourActor( ifShowCtrlPoints );
-               }
+               } // if visualization
 
-               if( control )
+               if( control==true )
                {
                        ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( contourWRP->getControler() );
-               }
-               if( ifActive )
+               } // if contour
+
+               if( !control )
+               {
+                       contourWRP->getViewer()->SetColorNormalContour(1,0,0);
+               } else {
+                       contourWRP->getViewer()->SetColorNormalContour(0,0,1);
+               } // if !contour
+
+               if( ifActive==true )
                {
                        contourWRP->getControler()->SetActive( true );  
                        contourWRP->getViewer()->RemoveTextActor();
-               }
+               } // if ifActive
+
+               contourWRP->getViewer()->SetShowText(_showTextContour);
        }
 
        //------------------------------------------------------------------------------------------------------------
@@ -1233,6 +1271,11 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                } // if 
        }
 
+       void wxVtkBaseView_SceneManager::SetShowTextContour(bool show)
+       {
+               _showTextContour = show;
+       }
+
        bool wxVtkBaseView_SceneManager::isEditableCControler(std::string theKeyName){
                
                ContourWrap_ViewControl* ccon = getContourWrap_ViewControlOf(theKeyName);
index ecc6a5111afd3a193d295e287d3d212b35731495..c1591b911d49dfbe94529f4385bccbd2dd78fad9 100644 (file)
@@ -105,7 +105,6 @@ class wxVtkBaseView_SceneManager : public InteractorStyleMaracas {
        // Methods for capturing events
        //------------------------------------------------------------------------------------------------------------
        
-               
        //------------------------------------------------------------------------------------------------------------
        //  Methods for sending events
        //------------------------------------------------------------------------------------------------------------
@@ -210,6 +209,7 @@ class wxVtkBaseView_SceneManager : public InteractorStyleMaracas {
        int                       GetImageDataSizeZ();
        void              GetImageDataRange( double *range );
        void              SetWidthContour(double width);
+       void              SetShowTextContour(bool show);
 
 //JCP 21 - 09 - 08
        bool isEditableCControler(std::string theKeyName);
@@ -217,10 +217,13 @@ class wxVtkBaseView_SceneManager : public InteractorStyleMaracas {
        bool isCtrlPressed();
        bool isShiftPressed();
        char getLastKeyCode();
+       void SetLabelNumberOfContours( std::string label );
+
 private:
        //------------------------------------------------------------------------------------------------------------
        //  Private methods
        //------------------------------------------------------------------------------------------------------------
+       void configureTextNumberOfContour();
 
        
        //------------------------------------------------------------------------------------------------------------
@@ -260,6 +263,8 @@ private:
        double                                                                                          _widthOfControlPoint;
        bool                                                                                            _ctrlKey;
        bool                                                                                            _shiftKey;
+       bool                                                                                            _showTextContour;
+       vtkTextActor                                                                            *_numberOfContoursTextActor;
 };
 #endif // __wxVtkBaseView_SceneManager_HEADER_FILE__
 
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();