#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];