]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx
no message
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / Contour / ContourCrownWidget.cxx
index 7cb3ac572f084c2cdc082346bb30f172866dbbc2..d28a6b27c766a2685b0cc229b7d58b535927133c 100644 (file)
@@ -5,44 +5,15 @@
 #include <vtkImageActor.h>
 
 #include "wxVtk2DBaseView.h"
+#include "vtkLookupTable.h"
 
 //----------------------------------------------------------------------
-  wxMaracasCoutourTool::wxMaracasCoutourTool(wxWindow *parent, wxVtkBaseView *wxvtkbaseview, vtkImageData* imagedata)
+  wxMaracasCoutourTool::wxMaracasCoutourTool(wxWindow *parent)
     : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
   {
-//EED    this->mbbtkContourCrown       = contourcrown;
-    this->imagedata                    = imagedata;
-       this->wxvtkbaseview             = wxvtkbaseview;
        wxPanel *panel                  = this;
     wxSizer *sizer                     = NULL;
        
-       InitVtkImagesResult();
-
-        vtkLookupTable *table = vtkLookupTable::New();
-//      table->SetAlphaRange(128,255);
-     table->SetRange(0, 255); // image intensity range
-//   table->SetValueRange(0.0, 1.0); // from black to white
-     table->SetValueRange(0.0, 255.0); // from black to white
-
-        table->SetTableValue (0, 1.0 , 1.0 , 1.0 , 0.1 );
-        table->SetTableValue (255, 1.0 , 1.0 , 0.0 , 0.1);
-
-//      table->SetTableValue (0, 0.0 , 0.0 , 1.0 , 0.35 );
-//      table->SetTableValue (255, 1.0 , 0.0 , 0.0 , 0.10);
-
-     table->SetSaturationRange(0.0, 0.0); // no color saturation
-     table->SetRampToLinear();
-     table->Build();
-
-       vtkImageMapToColors  *mapperImage = vtkImageMapToColors::New();
-       mapperImage->SetLookupTable(table);
-       mapperImage->SetInput( imagedataMaskResult );
-       vtkImageActor *actorImage       = vtkImageActor::New();
-       actorImage->SetInput( mapperImage->GetOutput() );
-       actorImage->SetOpacity(1);
-
-       wxvtkbaseview->GetRenderer()->AddActor(actorImage);
-
        // Widget interface
        wxButton *btnContourA   = new wxButton( panel, -1, _T("Crown Extern"));
        wxButton *btnContourB   = new wxButton( panel, -1, _T("Crown Intern"));
        }
 
 
-  // ------------------------------------------------------------------------
+       // ------------------------------------------------------------------------
+void wxMaracasCoutourTool::Init(wxVtkBaseView *wxvtkbaseview, vtkImageData* imagedata)
+{
+    this->imagedata                    = imagedata;
+       this->wxvtkbaseview             = wxvtkbaseview;
+       
+       InitVtkImagesResult();
+       
+       vtkLookupTable *table = vtkLookupTable::New();
+       //       table->SetAlphaRange(128,255);
+       table->SetRange(0, 255); // image intensity range
+       //   table->SetValueRange(0.0, 1.0); // from black to white
+       table->SetValueRange(0.0, 255.0); // from black to white
+       
+       table->SetTableValue (0, 1.0 , 1.0 , 1.0 , 0.1 );
+       table->SetTableValue (255, 1.0 , 1.0 , 0.0 , 0.1);
+       
+       //       table->SetTableValue (0, 0.0 , 0.0 , 1.0 , 0.35 );
+       //       table->SetTableValue (255, 1.0 , 0.0 , 0.0 , 0.10);
+       
+       table->SetSaturationRange(0.0, 0.0); // no color saturation
+       table->SetRampToLinear();
+       table->Build();
+       
+       vtkImageMapToColors  *mapperImage = vtkImageMapToColors::New();
+       mapperImage->SetLookupTable(table);
+       mapperImage->SetInput( imagedataMaskResult );
+       vtkImageActor *actorImage       = vtkImageActor::New();
+       actorImage->SetInput( mapperImage->GetOutput() );
+       actorImage->SetOpacity(1);
+       
+       wxvtkbaseview->GetRenderer()->AddActor(actorImage);     
+}
 
+
+  // ------------------------------------------------------------------------
   void wxMaracasCoutourTool::ConfigureVTK()
   {
          double spc[3];