X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2FContour%2FContourCrownWidget.cxx;h=d28a6b27c766a2685b0cc229b7d58b535927133c;hb=35a5d83be3d84f9d1544b8d3ad0de044f1e65286;hp=7cb3ac572f084c2cdc082346bb30f172866dbbc2;hpb=8ecc0d5a5b7be549bfb4d344209d0dda900cf862;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx index 7cb3ac5..d28a6b2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx @@ -5,44 +5,15 @@ #include #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")); @@ -103,8 +74,42 @@ } - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ +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];