]> Creatis software - creaMaracasVisu.git/commitdiff
#3470 merge vtk8itk5wx3-mingw64
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 10 Sep 2021 12:40:16 +0000 (14:40 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 10 Sep 2021 12:40:16 +0000 (14:40 +0200)
1  2 
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx

index 9e394c065b74c3ce4d7d795e80bb9135e3de138a,89d6ed18e7b68e447e1f41f28a9471364ddea780..58198eef1edbc9d72a39225f21f0233a5b166916
@@@ -44,7 -44,7 +44,7 @@@ manualViewBaseContour::manualViewBaseCo
        _contourVtkActor        = NULL;
        _bboxMapper                     = NULL;
        _range                          = 1;
-       _sizePointsContour      = 100;
+       _sizePointsContour      = 500;
        _spc[0]                         = 1;
        _spc[1]                         = 1;
        _spc[2]                         = 1;
@@@ -314,12 -314,12 +314,12 @@@ void manualViewBaseContour::ConstructVT
  //EED 2017-01-01 Migration VTK7
  #if VTK_MAJOR_VERSION <= 5
        _bboxMapper->SetInput(_pd);
 +      _bboxMapper->ImmediateModeRenderingOn();
  #else
        _bboxMapper->SetInputData(_pd);
  #endif
  
  
 -      _bboxMapper->ImmediateModeRenderingOn();
        _contourVtkActor->SetMapper(_bboxMapper);
        _contourVtkActor->GetProperty()->BackfaceCullingOff();
  
@@@ -355,7 -355,7 +355,7 @@@ void manualViewBaseContour::InitTextAct
  //    _textActor->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
  
        vtkTextProperty *tprop = _textActor->GetTextProperty();
-       tprop->SetFontSize(14);
+       tprop->SetFontSize(12);
        tprop->SetFontFamilyToArial();
        tprop->SetColor(1, 1, 0);
  
  //    _textActor2->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
  
        vtkTextProperty *tprop2 = _textActor2->GetTextProperty();
-       tprop2->SetFontSize(14);
+       tprop2->SetFontSize(12);
        tprop2->SetFontFamilyToArial();
        tprop2->SetColor(1, 1, 0);
  
@@@ -649,10 -649,11 +649,11 @@@ double* manualViewBaseContour::GetVecto
        double pp[3];
        int i,size = _sizePointsContour;
        double *vx = (double*)malloc(sizeof(double)*size);
-       for (i=0;i<size;i++){
+       for (i=0;i<size;i++)
+       {
                _pts->GetPoint(i,pp);
                vx[i]=pp[0];
-       }
+       } // for i
        return vx;
  }
  // ----------------------------------------------------------------------------
@@@ -661,10 -662,11 +662,11 @@@ double* manualViewBaseContour::GetVecto
        double pp[3];
        int i,size = _sizePointsContour;
        double *vy = (double*)malloc(sizeof(double)*size);
-       for (i=0;i<size;i++){
+       for (i=0;i<size;i++)
+       {
                _pts->GetPoint(i,pp);
                vy[i]=pp[1];
-       }
+       } // for i
        return vy;
  }
  // ----------------------------------------------------------------------------
@@@ -673,10 -675,11 +675,11 @@@ double* manualViewBaseContour::GetVecto
        double pp[3];
        int i,size = _sizePointsContour;
        double *vz = (double*)malloc(sizeof(double)*size);
-       for (i=0;i<size;i++){
+       for (i=0;i<size;i++)
+       {
                _pts->GetPoint(i,pp);
                vz[i]=pp[2];
-       }
+       } // for i
        return vz;
  }
  // ----------------------------------------------------------------------------
@@@ -687,10 -690,11 +690,11 @@@ void manualViewBaseContour::Refresh() /
                RefreshContour();
        }
        int i,size=_lstViewPoints.size();
-       for (i=0;i<size;i++){
+       for (i=0;i<size;i++)
+       {
                UpdateViewPoint(i);
                _lstViewPoints[i]->UpdateColorActor();
-       }
+       } // for i
        UpdateColorActor();
  
        if (_show_text==true)
@@@ -976,8 -980,8 +980,8 @@@ void manualViewBaseContour::SetShowText
        _show_text = ok;
        if (_show_text==false && _textActor!=NULL)
        {
-               _textActor->SetInput("00");
-               _textActor2->SetInput("00");
+               _textActor->SetInput("");
+               _textActor2->SetInput("");
        }
  }
  // ----------------------------------------------------------------------------
index 81a146e69d73b00930652ca291cc8f9060b001f2,b18d582c3334587e964397a1d35f6375c6f5ebd0..2e0e2d62ffbd1e27132a160caa931f75e55df9a2
@@@ -60,7 -60,6 +60,6 @@@ wxVtkBaseView::~wxVtkBaseView(
  //-------------------------------------------------------------------
  crea::wxVTKRenderWindowInteractor* wxVtkBaseView::GetWxVTKRenderWindowInteractor() throw (char*)
  {
        if(_iren==NULL)
        {
                throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren cwxVTKRenderWindowInteractorPlus =NULL";
@@@ -117,7 -116,7 +116,7 @@@ void wxVtkBaseView::TransCoordScreenToW
        GetRenderer()->DisplayToWorld();
        double fP[4];
        GetRenderer()->GetWorldPoint( fP );
 -      if ( fP[3] ){
 +    if ( fP[3] ){
                fP[0] /= fP[3];
                fP[1] /= fP[3];
                fP[2] /= fP[3];
@@@ -149,7 -148,7 +148,7 @@@ void wxVtkBaseView::TransFromCoordScree
  
        X = xx;
        Y = yy;
 -      Z=zz;
 +      Z = zz;
  
  // EEDx5
        //JCP 13/05/2009
        if (type!=2)
        {
                Z=fP[2];
 -      } 
 +      }
 +
  }
  
  //---------------------------------------------------------------------------
index e93a929c13f929e37590b9d358028d9ddb2e6ed8,bbb02ec611eaa1866393db0d064aea43ffcf52d1..0b3e8ea32a1001b66bfa264262acf0c6adaced7a
@@@ -120,11 -120,11 +120,11 @@@ void wxVtkMPR2DView::Configure(
  //EED 2017-01-01 Migration VTK7
  #if VTK_MAJOR_VERSION <= 5
                _lineAMapper->SetInput(_pdA);
 +              _lineAMapper->ImmediateModeRenderingOn();
  #else
                _lineAMapper->SetInputData(_pdA);
  #endif
  
 -              _lineAMapper->ImmediateModeRenderingOn();
                _lineAActor->SetMapper(_lineAMapper);
        }
  
  //EED 2017-01-01 Migration VTK7
  #if VTK_MAJOR_VERSION <= 5
        _lineBMapper->SetInput(_pdB);
 +      _lineBMapper->ImmediateModeRenderingOn();
  #else
        _lineBMapper->SetInputData(_pdB);
  #endif
  
 -      _lineBMapper->ImmediateModeRenderingOn();
        if(_imageViewer2XYZ)
        {
                _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
  
  void wxVtkMPR2DView::SetVisibleAxis(bool ok)
  {
-       if (ok!=_visibleAxis)
+       if (ok != _visibleAxis)
        {
-               _visibleAxis=ok;
+               _visibleAxis = ok;
                if (_visibleAxis==true)
                {
                        _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
        } // ok
  }
  
+ //-------------------------------------------------------------------
+ void wxVtkMPR2DView::ResetBackXYZ()
+ {
+       _backX = -9999;
+       _backY = -9999;
+       _backZ = -9999;
+ }
  //-------------------------------------------------------------------
  void wxVtkMPR2DView::Refresh()
  {
                y2 += origin[1];
                z1 += origin[2];
                z2 += origin[2];
-               xx1 =           x1*spc[0];
-               yy1 =           y1*spc[1];
-               zz1 =           z1*spc[2];
-               xx2 =           x2*spc[0];
-               yy2 =           y2*spc[1];
-               zz2 =           z2*spc[2];
+               xx1 = x1*spc[0];
+               yy1 = y1*spc[1];
+               zz1 = z1*spc[2];
+               xx2 = x2*spc[0];
+               yy2 = y2*spc[1];
+               zz2 = z2*spc[2];
                x1      = (int)(x1*spc[0]);
                y1      = (int)(y1*spc[1]);
                z1      = (int)(z1*spc[2]);
                xx      = (int)(GetVtkmprbasedata()->GetX());
                yy      = (int)(GetVtkmprbasedata()->GetY());
                zz      = (int)(GetVtkmprbasedata()->GetZ());
- //EED 02/08/2013
- //            x =  round(xx*spc[0]);
- //            y =  round(yy*spc[1]);
- //            z =  round(zz*spc[2]);
                x       =  xx*spc[0];
                y       =  yy*spc[1];
                z       =  zz*spc[2];
                                //_ptsA->SetPoint(1, x2, y2  , z );
                                //_ptsB->SetPoint(0, x2, y   , z1);
                                //_ptsB->SetPoint(1, x2, y   , z2);
-                               _ptsA->SetPoint(0, xx2, yy1  , z  );
-                               _ptsA->SetPoint(1, xx2, yy2  , z  );
-                               _ptsB->SetPoint(0, xx2, y    , zz1);
-                               _ptsB->SetPoint(1, xx2, y    , zz2);
+                               _ptsA->SetPoint(0, xx2+1, yy1  , z  );
+                               _ptsA->SetPoint(1, xx2+1, yy2  , z  );
+                               _ptsB->SetPoint(0, xx2+1, y    , zz1);
+                               _ptsB->SetPoint(1, xx2+1, y    , zz2);
                                position[1]             = y;    
                                position[2]             = z;    
                                focalpoint[1]   = y;    
                                //_ptsA->SetPoint(1, x2 , y2 , z );
                                //_ptsB->SetPoint(0, x  , y2 , z1);
                                //_ptsB->SetPoint(1, x  , y2 , z2);
-                           _ptsA->SetPoint(0, xx1 , y1 , z  );
-                               _ptsA->SetPoint(1, xx2 , y1 , z  );
-                               _ptsB->SetPoint(0, x   , y1 , zz1);
-                               _ptsB->SetPoint(1, x   , y1 , zz2);
+                           _ptsA->SetPoint(0, xx1 , y1-1 , z  );
+                               _ptsA->SetPoint(1, xx2 , y1-1 , z  );
+                               _ptsB->SetPoint(0, x   , y1-1 , zz1);
+                               _ptsB->SetPoint(1, x   , y1-1 , zz2);
                                position[0]             = x;    
                                position[2]             = z;    
                                focalpoint[0]   = x;    
                                //_ptsA->SetPoint(1, x2 , y , z2 );
                                //_ptsB->SetPoint(0, x  , y1, z2 );
                                //_ptsB->SetPoint(1, x  , y2, z2 );
-                               _ptsA->SetPoint(0, xx1 , y  , z1 );
-                               _ptsA->SetPoint(1, xx2 , y  , z1 );
-                               _ptsB->SetPoint(0, x   , yy1, z1 );
-                               _ptsB->SetPoint(1, x   , yy2, z1 );
+                               _ptsA->SetPoint(0, xx1 , y  , z1-1 );
+                               _ptsA->SetPoint(1, xx2 , y  , z1-1 );
+                               _ptsB->SetPoint(0, x   , yy1, z1-1 );
+                               _ptsB->SetPoint(1, x   , yy2, z1-1 );
+                               
                                position[0]             = x;    
                                position[1]             = y;    
                                focalpoint[0]   = x;    
                        } // if GetFixAxis2D
                        _lineAActor->GetProperty()->SetOpacity( opacityAxis );
                        _lineBActor->GetProperty()->SetOpacity( opacityAxis );
+                       SetOpacityText( opacityAxis );
                        _backX                  = xx;
                        _backY                  = yy;
                        _backZ                  = zz;
        imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() );
  //EED 01nov2012
                UpdateColorWindowLevel();
+ //EED 05juin2019
+               UpdateCameraParallelScale();
                wxVtkBaseView::Refresh();
        }
  }
index b82f52a52c4ec01d628e9c99687dadfab8302c0e,80af2e1c15246effa43e1c4eb76070f7e08092ac..23b6ce1ad4b199dde4a41aa3525362bc8b08d38b
@@@ -41,7 -41,6 +41,7 @@@
  #include "vtkCellPicker.h"
  #include "vtkInteractorStyleBaseView.h"
  #include <vtkImageReslice.h>
 +#include "vtkTexture.h"
  
  
  
@@@ -143,14 -142,17 +143,17 @@@ wxVtkMPR3DView::wxVtkMPR3DView( wxVtk3D
  wxVtkMPR3DView::~wxVtkMPR3DView()
  {
        VisiblePointWidget( false );
-       VisiblePlaneWidget( false );
-       if(_pointWidget!=NULL){
+ //    VisiblePlaneWidget( false );
+       if(_pointWidget!=NULL)
+       {
                _pointWidget->Delete();
        }
-       if(_planeWidget!=NULL){
+       if(_planeWidget!=NULL)
+       {
                _planeWidget->Delete();
        }
-       if(_vtkplane!=NULL){
+       if(_vtkplane!=NULL)
+       {
                _vtkplane->Delete();
                _probe->Delete();
                _contourMapper->Delete();
@@@ -328,22 -330,74 +331,74 @@@ void wxVtkMPR3DView::SetImage(
        // -- Plane widget
        _probe->SetSource( imageData );
  #else
+ //    double colorWindow      = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow();
+ //    double colorLevel       = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel();
+       double spc[3];
+       vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+       if(image)
+       {
+               image->GetSpacing(spc);
+       }else{
+               spc[0] = 0;
+               spc[1] = 0;
+               spc[2] = 0;
+       }
+       double x = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
+       double y = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
+       double z = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
+ /*
+       if (mchange==NULL)
+       {
+               mchange = vtkImageChangeInformation::New();
+               mchange->SetInputData( imageData );
+               mchange->Modified();    //important
+               mchange->Update();    //important
+               _planeWidgetX->SetInputData( mchange->GetOutput() );
+               _planeWidgetY->SetInputData( mchange->GetOutput() );
+               _planeWidgetZ->SetInputData( mchange->GetOutput() );
+       } else {
+               mchange->SetInputData( imageData );
+               mchange->Modified();    //important
+               mchange->Update();    //important
+       }
+       
+ */
        _planeWidgetX->SetInputData( imageData );
        _planeWidgetY->SetInputData( imageData );
        _planeWidgetZ->SetInputData( imageData );
+ //EED 2021-06-23      
+ //    _planeWidgetX->SetWindowLevel(colorLevel,colorWindow,1);
+ //    _planeWidgetY->SetWindowLevel(colorLevel,colorWindow,1);
+ //    _planeWidgetY->SetWindowLevel(colorLevel,colorWindow,1);
+       _planeWidgetX->SetSlicePosition( x*spc[0] );
+       _planeWidgetY->SetSlicePosition( y*spc[1] );
+       _planeWidgetZ->SetSlicePosition( z*spc[2] );
+       _planeWidgetX->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
+       _planeWidgetY->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
+       _planeWidgetZ->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
        // -- Plane widget
        _probe->SetSourceData( imageData );
  #endif
        _vtkmpr3Ddataviewer->SetImage();
  }
  
  //-------------------------------------------------------------------
  vtkImagePlaneWidget* wxVtkMPR3DView::GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker)
  {
-       vtkProperty* prop1                                      = 0;
-       vtkImagePlaneWidget* planeWidget        = 0;
-       planeWidget                                                     = vtkImagePlaneWidget::New();
+       vtkProperty* prop1                                      = NULL;
+       vtkImagePlaneWidget* planeWidget        = vtkImagePlaneWidget::New();
        planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
        planeWidget->EnabledOff();
        vtkImageData *image                                     = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
@@@ -459,7 -513,7 +514,7 @@@ void wxVtkMPR3DView::FreePlaneInteracti
                        _planeWidgetY->InteractionOff();
                        _planeWidgetZ->InteractionOff();
                }
-       } // if _planeWidgetX
+       } // if _planeWidgetXVisiblePointWidget
  }
  
  
@@@ -485,7 -539,6 +540,6 @@@ void wxVtkMPR3DView::RefreshView()   /
  {
        double spc[3];
        vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
        if(image)
        {
                image->GetSpacing(spc);
                spc[1] = 0;
                spc[2] = 0;
        }
  //    GetVtkMPR3DDataViewer()->Configure();
  
        //double nx=1,ny=0,nz=0; // JPRx
        Refresh();
-       double x=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
-       double y=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
-       double z=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
-       SetColorWindow( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow() );
-       SetColorLevel( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel() );
+       double x = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
+       double y = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
+       double z = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
  
        double normal[3];
        // FreePlaneX
        {
                _planeWidgetX->SetSlicePosition( x*spc[0] );
  //EED 2016/02/19
 -//            _planeWidgetX->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
 +              _planeWidgetX->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
                _planeWidgetX->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
        }
        // FreePlaneY
                _planeWidgetZ->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
                _planeWidgetZ->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
        }
 -
++    
+       SetWindowColorLevel(_vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow() , _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel() );
 -
++    
        x = x*spc[0];
        y = y*spc[1];
        z = z*spc[2];
  #else
                _probe->Update();
  #endif
-       }
+       } //_pointWidget
  
        if (_wxvtkmpr3DviewCntrlPanel!=NULL)
        {
@@@ -595,7 -646,8 +647,8 @@@ wxVtk3DBaseView* wxVtkMPR3DView::GetWxv
  //-------------------------------------------------------------------
  
  //-------------------------------------------------------------------
- void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible){
+ void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible)
+ {
        /*if(visible == false)
                printf("CPR: wxVtkMPR3DView::VisibleImageActor-> visibleActor == false \n");
        else
        }
        */
        if (visible!=_vtkmpr3Ddataviewer->GetVisiblePosition(idPosition)){
-               if (visible==false){
+               if (visible==false)
+               {
                        _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _vtkmpr3Ddataviewer->GetImageActor(idPosition)  );
                } else {
  //EED 21/07/2013
  // This works in ViewerNV with nTymeView=6
  // Because the others modules (5) generate also more actors with an OutLineFilter -> Actor
  //showOutlineActor(false);
                        // step 1, step 2
                        vtkActorCollection *tmpCollection    = vtkActorCollection::New();
                        vtkActorCollection *collectionActors =  _wxvtk3Dbaseview->GetRenderer()->GetActors();
                                tmpCollection->AddItem ( (vtkActor*)collectionActors->GetItemAsObject(0)  );                    
                                _wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
                        } // for
                        // step 3
                        _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(idPosition)  );
                        // step 4
                         for (i=0; i<size; i++)
                        {
                                _wxvtk3Dbaseview->GetRenderer()->AddActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
                        } // for
                        tmpCollection->Delete();
                        // step 5 Refresh
                        _wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render();
                } // if visible
                _vtkmpr3Ddataviewer->SetVisiblePosition(idPosition,visible);
        } // if visible 
@@@ -670,7 -718,6 +719,6 @@@ void wxVtkMPR3DView::VisiblePlaneWidget
                {
                        _planeWidget->On();
                        _contourPlaneActor->VisibilityOn();
                } else {
                        _planeWidget->Off();
                        _contourPlaneActor->VisibilityOff();                    
  }
  
  //CPR: Method added 30 Nov 2009
- void wxVtkMPR3DView::showOutlineActor(bool value)
+ void wxVtkMPR3DView::showOutlineBoxActor(bool value)
  {
        vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
        if(value == true)
        } // value
  }
  
+ //-------------------------------------------------------------------
+ void wxVtkMPR3DView::showOutlinePlaneActor(bool value)
+ {
+       vtkProperty *prop1=NULL;
+       if(value == true)
+       {
+               prop1 = _planeWidgetX ->GetPlaneProperty();
+               prop1->SetOpacity(1);
+               prop1 = _planeWidgetY ->GetPlaneProperty();
+               prop1->SetOpacity(1);
+               prop1 = _planeWidgetZ ->GetPlaneProperty();
+               prop1->SetOpacity(1);           
+       } else {
+               prop1 = _planeWidgetX ->GetPlaneProperty();
+               prop1->SetOpacity(0);
+               prop1 = _planeWidgetY ->GetPlaneProperty();
+               prop1->SetOpacity(0);
+               prop1 = _planeWidgetZ ->GetPlaneProperty();
+               prop1->SetOpacity(0);
+       } // value
+ }
  //-------------------------------------------------------------------
  void wxVtkMPR3DView::SetVtkMPR3DDataViewer(vtkMPR3DDataViewer *vtkmpr3Ddataviewer)
  {
@@@ -704,18 -774,13 +775,13 @@@ void wxVtkMPR3DView::InitOrientationPoi
  }
  
  //-------------------------------------------------------------------
- void wxVtkMPR3DView::SetColorWindow(double colorWindow)
+ void wxVtkMPR3DView::SetWindowColorLevel(double colorWindow , double colorLevel)
  {
-       double colorLevel = _planeWidgetX->GetLevel();
        _planeWidgetX->SetWindowLevel(colorWindow,colorLevel);
+       _planeWidgetY->SetWindowLevel(colorWindow,colorLevel);
+       _planeWidgetZ->SetWindowLevel(colorWindow,colorLevel);
  }
  
- //-------------------------------------------------------------------
- void wxVtkMPR3DView::SetColorLevel(double colorLevel)
- {
-       double colorWindow = _planeWidgetX->GetWindow();
-       _planeWidgetX->SetWindowLevel(colorWindow,colorLevel);
- }
  
  //-------------------------------------------------------------------
  // EED 25 Janvier 2007 testLoic
@@@ -830,13 -895,13 +896,13 @@@ void wxVtkMPR3DView::TestLoic1(
  //EED 2017-01-01 Migration VTK7
  #if VTK_MAJOR_VERSION <= 5
        _3DSliceMapper->SetInput(change->GetOutput( ) );
 +      _3DSliceMapper->ImmediateModeRenderingOn( );
  #else
        _3DSliceMapper->SetInputData(change->GetOutput( ) );
  #endif
  
        _3DSliceMapper->SetLookupTable( _bwlookup );
        _3DSliceMapper->SetScalarRange( _range );
 -      _3DSliceMapper->ImmediateModeRenderingOn( );
  
        vtkActor *_3DSliceActor = vtkActor::New( );
        _3DSliceActor->SetMapper( _3DSliceMapper );
@@@ -962,15 -1027,20 +1028,20 @@@ void wxVtkMPR3DView::SetBackGroundType(
        if (_wxvtk3Dbaseview!=NULL)
        {
                if (type==0)
+               {
+                       _wxvtk3Dbaseview->GetRenderer()->GradientBackgroundOn();
+                       _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.33 , 0.33 , 0.33 );
+                       _wxvtk3Dbaseview->GetRenderer()->SetBackground2( 0.66 , 0.66 , 0.66 );
+               } // if type
+               else if (type==1)
                {
                        _wxvtk3Dbaseview->GetRenderer()->GradientBackgroundOff();
                        _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0 , 0 , 0 );
                } // if type
-               if (type==1)
+               else if (type==2)
                {
-                       _wxvtk3Dbaseview->GetRenderer()->GradientBackgroundOn();
-                       _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.33 , 0.33 , 0.33 );
-                       _wxvtk3Dbaseview->GetRenderer()->SetBackground2( 0.66 , 0.66 , 0.66 );
+                       _wxvtk3Dbaseview->GetRenderer()->GradientBackgroundOff();
+                       _wxvtk3Dbaseview->GetRenderer()->SetBackground( 1 , 1 , 1 );
                } // if type
                _wxvtk3Dbaseview->Refresh();
        }// if _wxvtk3Dbaseview