]> Creatis software - creaMaracasVisu.git/commitdiff
#3219 creaMaracasVisu Feature New Normal - vtk8itk4wx3-mingw64
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 7 Aug 2018 14:41:26 +0000 (16:41 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 7 Aug 2018 14:41:26 +0000 (16:41 +0200)
19 files changed:
1  2 
bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx
bbtk/src/bbmaracasvisuImageActor.cxx
bbtk/src/bbmaracasvisuImageChangeInformation.cxx
lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualInteractorWindowLevel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx

index d640d8d2a30877d44af57e4d128ffc9a55c6e0ea,40b3f246fecf3c9d9592807c411964badde4d7f5..34c0fd7754dc182e1b025dd1fdf521540ec9812f
@@@ -40,29 -47,87 +47,88 @@@ printf("EED ImageActor::Process Start\n
                vtkRenderer *render                             = bbGetInputRenderer();
                vtkImageData *img                               = bbGetInputIn();
                vtkLinearTransform* transform   = bbGetInputTransform();
 -
 -              if(img != NULL)
++                              
++                              
++      if(img != NULL)
+               {
+                       if (bbGetInputLookupTable()==NULL)
+                       {
+                               imageactor->SetInput( img );    
+                       } else {
+ /*
+                               vtkLookupTable *table = vtkLookupTable::New();
+                               table->SetRange(0, 1000); // image intensity range
+                               table->SetValueRange(0.0, 1.0); // from black to white
+                               table->SetSaturationRange(0.0, 0.0); // no color saturation
+                               table->SetRampToLinear();
+                               table->Build();
+   double rgba[4];
+   table->GetTableValue(0,rgba);
+   rgba[3]=0;
+   table->SetTableValue(0,rgba);
+ */
  
-               if(img != NULL){
-                       
- //EED 2017-01-01 Migration VTK7
- #if VTK_MAJOR_VERSION <= 5
-                       imageshiftscale->SetInput( img );       
- #else
-                       imageshiftscale->SetInputData( img );   
- #endif
-                       imageshiftscale->SetOutputScalarTypeToUnsignedChar();   
- //EED 2017-01-01 Migration VTK7
- #if VTK_MAJOR_VERSION <= 5
-                       imageactor->SetInput( imageshiftscale->GetOutput() );   
- #else
-                       imageshiftscale->Update();
-                       imageactor->SetInputData( imageshiftscale->GetOutput() );       
- #endif
-                       if (transform!=NULL){
+ /*
+       vtkLookupTable *table = vtkLookupTable::New();
+          table->SetTableRange (0, 2000);
+          table->SetHueRange (1, 0);
+          table->SetSaturationRange (1, 1);
+          table->SetValueRange (1, 1);
+          table->Build(); //effective built
+ */
+ /*
+ vtkColorTransferFunction *table = vtkColorTransferFunction::New();
+ table->SetColorSpaceToHSV();
+     table->HSVWrapOff();
+     table->AddHSVSegment(0.0, 0.6, 1.0, 1.0,
+                        1.0, 0.0, 1.0, 1.0);
+     table->SetNanColor(1.0, 0.0, 1.0);
+ */
+ /* 
+ printf("EED ImageActor::Process  Warnning ***************************Not here this code *");
+ vtkLookupTable *table = vtkLookupTable::New();
+   table->SetNumberOfTableValues(1000);
+   table->SetRange(0, 1000);
+   table->Build();
+   double rgba1[4];
+       double rgba2[4];
+       for (int iLookTable = 0; iLookTable<500; iLookTable++)
+                       {
+                               table->GetTableValue(      iLookTable, rgba1);
+                               table->GetTableValue(1000-1-iLookTable, rgba2);
+                               table->SetTableValue(1000-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
+                               table->SetTableValue(      iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
+                       } // for iLookTable     
+   double rgba[4];
+   table->GetTableValue(0,rgba);
+   rgba[3]=0;
+   table->SetTableValue(0,rgba);
+ */
+                               vtkImageMapToColors *color = vtkImageMapToColors::New();
+                               color->SetLookupTable( bbGetInputLookupTable() );
+ //                            color->SetLookupTable( table );
+                               color->PassAlphaToOutputOn();
+ //                            imageshiftscale->SetInput( img );
+ //                            imageshiftscale->SetOutputScalarTypeToUnsignedChar();
+ //                            color->SetInput( imageshiftscale->GetOutput() );
+                               color->SetInput( img );
+                               color->Update();
+                               imageactor->GetMapper()->SetInput( color->GetOutput() );
+                               imageactor->GetProperty()->SetInterpolationTypeToNearest();
+                       }
+                       if (transform!=NULL)
+                       {
                          imageactor->SetUserTransform( transform );    
                        } // transform
-                       if(render != NULL ){
-                               render->AddActor( imageactor );
+                       if(render != NULL )
+                       {
+ //                            render->AddActor( imageactor );
                        } // render
                        bbSetOutputOut(imageactor);
                } // img
index 4a9c2d3967aad942d70d73f6d01df40ab862d8b4,b956413ec6464a5ec823f63f58958306be973b12..f32c600b64234a71e479fa267a9e330576a63b1b
@@@ -43,22 -44,7 +44,14 @@@ void ImageChangeInformation::Process(
                }
                mchange = vtkImageChangeInformation::New();
                img->GetExtent( ext );  
-               double origin[3];
-               origin[0]=0.0;
-               origin[1]=0.0;
-               origin[2]=0.0;
-               img->SetOrigin(origin);         
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                mchange->SetInput( img );
- //EED 2016 15 06
- //            mchange->SetExtentTranslation( -ext[0], -ext[2], -ext[4] );
-               mchange->SetOutputOrigin (0, 0, 0);
 +#else
 +              mchange->SetInputData( img );
 +#endif
 +
                mchange->SetOutputExtentStart(0,0,0);
                if (bbGetInputNewSpacing().size()==3)
                {
                        spc[2] = bbGetInputNewSpacing()[2];
                        mchange->SetOutputSpacing( spc[0] , spc[1] , spc [2] );    //spacing
                }
+               if (bbGetInputNewOrigin().size()==3)
+               {
+                       if ( (bbGetInputNewOrigin()[0]==-1) && (bbGetInputNewOrigin()[1]==-1) && (bbGetInputNewOrigin()[2]==-1) )
+                       {
+                               img->GetOrigin( origin );       
+                       } else {
+                               origin[0] = bbGetInputNewOrigin()[0];
+                               origin[1] = bbGetInputNewOrigin()[1];
+                               origin[2] = bbGetInputNewOrigin()[2];
+                       }
+               } else {
+                       origin[0] = 0;
+                       origin[1] = 0;
+                       origin[2] = 0;
+               }
+               mchange->SetOutputOrigin( origin );
+               mchange->Modified();    //important
                mchange->Update();    //important
                bbSetOutputOut( mchange->GetOutput() );
-       } // img
+       }  // if img
++
  }
  
  void ImageChangeInformation::bbUserSetDefaultValues()
  {
-   mchange = NULL;
-    bbSetOutputOut( NULL);
-    bbSetInputIn(NULL);
+       mchange = NULL;
+       bbSetOutputOut( NULL);
+       bbSetInputIn(NULL);
  }
  
  void ImageChangeInformation::bbUserInitializeProcessing()
index 2947bdc03f6586de3c99d7f84d4e5ec81bb47340,c08f5d977fa6307339d3bcfb6c9b189681d9a98d..801078958158d57a1b217ec054d5fc78c39355d3
@@@ -572,36 -561,29 +575,53 @@@ void ContourExtractData::InitVtkImagesR
                imagedataValueResult->Delete();
        }
        imagedataValueResult = vtkImageData::New();
++<<<<<<< HEAD
 +      //        imagedataValueResult->SetScalarType(scalartype);
++=======
+ //EED 2017-12-18
+       imagedataValueResult->SetScalarType(scalartype);
+       //imagedataValueResult->SetScalarTypeToUnsignedShort();
++>>>>>>> master
        imagedataValueResult->SetSpacing(spc);
        imagedataValueResult->SetDimensions( newDim );
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +      imagedataValueResult->SetScalarTypeToUnsignedShort();
        imagedataValueResult->AllocateScalars();
 +#else
 +      imagedataValueResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
 +#endif
 +
  
        if (imagedataMaskResult!=NULL)
        {
                imagedataMaskResult->Delete();
        }
        imagedataMaskResult  = vtkImageData::New();
++<<<<<<< HEAD
 +      //        imagedataMaskResult->SetScalarType(scalartype);
++=======
+ //EED 2017-12-18
+ //    imagedataMaskResult->SetScalarType(scalartype);
+ //    imagedataMaskResult->SetScalarTypeToUnsignedShort();
+       imagedataMaskResult->SetScalarTypeToUnsignedChar();
++>>>>>>> master
        imagedataMaskResult->SetSpacing(spc);
        imagedataMaskResult->SetDimensions( newDim );
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +      imagedataMaskResult->SetScalarTypeToUnsignedShort();
        imagedataMaskResult->AllocateScalars();
 +#else
 +      imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
 +#endif
 +
  }
  
  
index 316f7851eb5561ed15c7bd9fed4fd6abb2378a97,51409832683b8cddf47972ce4209b37fec09ba04..9078a7e5203fac78717151d040a81f8ef8928ad2
@@@ -536,26 -505,13 +539,27 @@@ void LayerImageBase::onThreshold(
                vtkImageData *img = _imageReslicer->GetOutput();
  //            img->Update();
  //            img->UpdateInformation();
 -
  //            _thresholdTable->Update();
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                _thresholdMapper->SetInput( img );
 +#else
 +              _thresholdMapper->SetInputData( img );
 +#endif
 +
                _thresholdMapper->SetLookupTable( _thresholdTable );
 +
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
 -
 +#else
 +              _thresholdMapper->Update();
 +              _thresholdActor->SetInputData( _thresholdMapper->GetOutput() );
 +#endif
 +              
+               _thresholdActor->SetOpacity(_opacity);
                _scalarbarActor->SetLookupTable( _thresholdTable );
  //            _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
                _scalarbarActor->SetTitle("Value");
index 9e0945604c29068e0e5a131b2d70cace9c7f3aa4,f64909ec676b36ee75168fb100e551a5ec488ecc..8ecfd9e6e32c385c490dec4096200e2682867a84
@@@ -52,18 -52,23 +52,23 @@@ bool manualInteractorWindowLevel::OnMou
        if (_stateWindowLevel==true)
        {
                int tmpPx,tmpPy;
 -              wxVTKRenderWindowInteractor *wxVTKiren;
 +              crea::wxVTKRenderWindowInteractor *wxVTKiren;
                wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition( tmpPx , tmpPy );
                double colorWin;
                double colorLev;
-               
                vtkImageData* imgrange = ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->GetImageData();
-               if(imgrange != NULL){
+               if(imgrange != NULL)
+               {
                        double* scalarrange = imgrange->GetScalarRange();
-                       double scalarr = scalarrange[1] - scalarrange[0];
+                       double scalarr;
+                       if (scalarrange[1] == scalarrange[0])
+                       {
+                               scalarr=scalarrange[1];
+                               if (scalarrange[1]==0) {scalarr=100;}
+                       } else {
+                               scalarr = scalarrange[1] - scalarrange[0];
+                       }
                        //std::cout<<"scalar r="<<scalarr<<std::endl;
                        int w, h;
                        ((wxWindow*)wxVTKiren)->GetSize(&w, &h);                        
index 4156a3d54492d2c5cb7394dd916002e6892a752f,8210bec46e5199ab49af3d6662136d626e43d62c..c1ac0be4a34e87cf4ff9be9940b921a9a507cada
@@@ -46,28 -50,29 +50,45 @@@ FillFilter::~FillFilter(
  void FillFilter::SetImages(vtkImageData *image,vtkImageData *image2) // virtual
  {
        baseFilterManualPaint::SetImages(image,image2);
-       if (_auxImageFill != NULL)
+       
+       if ((_maxX!=_maxXback) || (_maxY!=_maxYback) || (_maxZ!=_maxZback)) 
        {
-               _auxImageFill->Delete();
+               if (_auxImageFill != NULL)
+               {
+                       _auxImageFill->Delete();
+               }
+               _auxImageFill = vtkImageData::New();
+               _auxImageFill->SetDimensions(_maxX + 1, _maxY + 1, _maxZ + 1);
+               _auxImageFill->SetOrigin(0, 0, 0);
+               _auxImageFill->SetExtent(0, _maxX, 0, _maxY, 0, _maxZ);
+               _auxImageFill->SetWholeExtent(0, _maxX, 0, _maxY, 0, _maxZ);
+               _auxImageFill->SetScalarTypeToUnsignedChar();
+               _auxImageFill->AllocateScalars();
+               _ptrAuxImageFill = (unsigned char       *)_auxImageFill->GetScalarPointer();
+               memset(_ptrAuxImageFill, 0, (_maxX+1) * (_maxY+1) * (_maxZ+1) );
        }
++
 +      _auxImageFill = vtkImageData::New();
 +      _auxImageFill->SetDimensions(_maxX + 1, _maxY + 1, _maxZ + 1);
 +      _auxImageFill->SetOrigin(0, 0, 0);
 +      _auxImageFill->SetExtent(0, _maxX, 0, _maxY, 0, _maxZ);
 +
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +      _auxImageFill->SetWholeExtent(0, _maxX, 0, _maxY, 0, _maxZ);
 +      _auxImageFill->SetScalarTypeToUnsignedChar();
 +      _auxImageFill->AllocateScalars();
 +#else
 +      _auxImageFill->AllocateScalars(VTK_UNSIGNED_CHAR,1);
 +#endif
 +
+       _maxXback=_maxX;
+       _maxYback=_maxY;
+       _maxYback=_maxZ;
  }
  
  //---------------------------------------------------------------------------
  void FillFilter::Run() // virtual
  {
index 0ca0de29abf6a7a94ab9f68fbfb2d25b696f9970,3941e84f2b70fc06b6cf214ced36d1b929cff418..909db02c41aac42a13866dfa0ae4dc6c1570361c
@@@ -89,14 -91,8 +91,13 @@@ void baseFilterManualPaint::SetImages(v
  {
        _image  = image;
        _image2 = image2;
        int ext[6];
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
        _image->GetWholeExtent(ext);
 +#else
 +      _image->GetExtent(ext);
 +#endif
        _minX = 0;
        _minY = 0;
        _minZ = 0;
index f35206765b43494bb0fc6c36e5063b224b5656d7,45e4f3869ec476ca0f8295b8eca3fc199be8c3c7..5c4e0c7f98622ae20d7411600b68a06ce5e05848
@@@ -142,16 -141,10 +141,17 @@@ std::vector<double>*     vtkMPR3DDataVi
  //-------------------------------------------------------------------
  void vtkMPR3DDataViewer::SetImage()
  {
 -      _saggitalColors -> SetInput( _vtkmprbasedata->GetImageData() );
 -      _axialColors    -> SetInput( _vtkmprbasedata->GetImageData() );
 -      _coronalColors  -> SetInput( _vtkmprbasedata->GetImageData() );
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +      _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() );
 +      _axialColors->SetInput( _vtkmprbasedata->GetImageData() );
 +      _coronalColors->SetInput( _vtkmprbasedata->GetImageData() );
 +#else
 +      _saggitalColors->SetInputData( _vtkmprbasedata->GetImageData() );
 +      _axialColors->SetInputData( _vtkmprbasedata->GetImageData() );
 +      _coronalColors->SetInputData( _vtkmprbasedata->GetImageData() );
 +#endif
+       _outlineData    -> SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
  }
  
  //-------------------------------------------------------------------
@@@ -182,18 -175,11 +182,16 @@@ void vtkMPR3DDataViewer::Configure(
      _satLut->SetValueRange (1, 1);
  */
  
        double range[2];
        double delta;
-       
        if(_vtkmprbasedata->GetImageData())
        {
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                _vtkmprbasedata->GetImageData()->Update();
 +#else
 +              // ..
 +#endif
                _vtkmprbasedata->GetImageData()->Modified();
                _vtkmprbasedata->GetImageData()->GetScalarRange(range);
                delta = range[1]-range[0];
                        _saggitalColors = vtkImageMapToColors::New();
                }
                _saggitalColors->RemoveAllInputs();
 -              _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() );
++
        //    _saggitalColors->SetLookupTable(_bwLut);
                _saggitalColors->SetLookupTable(_ctfun);
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +              _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() );
 +#else
 +              _saggitalColors->SetInputData( _vtkmprbasedata->GetImageData() );
 +              _saggitalColors->Update();
 +#endif
 +              
 +              
                if(_saggital==NULL)
                {
                        _saggital = vtkImageActor::New();
                {
                        _axialColors = vtkImageMapToColors::New();
                }
                _axialColors->RemoveAllInputs();
 -              _axialColors->SetInput( _vtkmprbasedata->GetImageData() );
        //    _axialColors->SetLookupTable(_hueLut);
                _axialColors->SetLookupTable(_ctfun);
 +
++              
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +              _axialColors->SetInput( _vtkmprbasedata->GetImageData() );
 +#else
 +              _axialColors->SetInputData( _vtkmprbasedata->GetImageData() );
 +              _axialColors->Update();
 +#endif
 +
                if(_axial==NULL)
                {
                        _axial = vtkImageActor::New();
                        _coronalColors = vtkImageMapToColors::New();
                }
                _coronalColors->RemoveAllInputs();
 -              _coronalColors->SetInput( _vtkmprbasedata->GetImageData() );
        //    _coronalColors->SetLookupTable(_satLut);
                _coronalColors->SetLookupTable(_ctfun);
 +
++              
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +              _coronalColors->SetInput( _vtkmprbasedata->GetImageData() );
 +#else
 +              _coronalColors->SetInputData( _vtkmprbasedata->GetImageData() );
 +              _coronalColors->Update();
 +#endif
 +
 +
                if(_coronal==NULL)
                {
                        _coronal = vtkImageActor::New();
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                        _coronal->SetInput(_coronalColors->GetOutput());
 -              }
 +#else
 +                      _coronal->SetInputData(_coronalColors->GetOutput());
 +#endif
 +
 +              } // if _coronal
                
-       
        // An outline provides context around the data.
        //
                if(_outlineData==NULL)
index 393b3f1160bf84c6ea866df1e7bba3c60459cc32,3879377f94e3ba33d93aae257bed0007e9f3e8e8..b705076c09f201f7006ae2b111b2d886b0dd6ad6
@@@ -104,12 -101,10 +101,12 @@@ void wxVtk2DBaseView::ResetView(
        double spx = 0,spy = 0,spz = 0;
        int x1 = 1,x2 = 1,y1 = 1,y2 = 1,z1 = 1,z2 = 1;
        wxVtkBaseView::Configure();
 -      wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
 +      crea::wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
        vtkImageData *imageData = GetVtkBaseData()->GetImageData();
-       if(imageData){
+       if(imageData)
+       {
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                imageData->UpdateInformation();
                imageData->SetUpdateExtent( imageData->GetWholeExtent());
                imageData->Update();
@@@ -154,15 -146,17 +151,22 @@@ printf("//EED wxVtk2DBaseView::ResetVie
  //-------------------------------------------------------------------
  void wxVtk2DBaseView::SetImageToVtkViewer(vtkImageData *imageData)
  {
+       int ext[6];
+       imageData->Update();
+       imageData->GetWholeExtent(ext);
        if (_imageViewer2XYZ!=NULL)
        {
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
+               _imageViewer2XYZ->SetExtentDimension( ext[0],ext[1],ext[2],ext[3],ext[4],ext[5] );
                _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( imageData );
 +#else
 +              _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( imageData );
 +#endif
        } // if _imageViewer2XYZ
+       GetRenderer()->GetActiveCamera()->SetClippingRange(0.01, 1000000);
  }
  
  //-------------------------------------------------------------------
index 87b4fa3d909c507d49fb273a68eb6e5db4f79b17,bf823640f06f8c218929e53493565cf6c1a9cd43..01c7e1400cc3f42652651dfc2c562649779e7fdf
@@@ -160,16 -155,10 +162,17 @@@ void wxVtkMPR2DView::Configure(
        _pdB->SetPoints( _ptsB );
        _pdB->SetLines( linesB );
        linesB->Delete();  //do not delete lines ??
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
        _lineBMapper->SetInput(_pdB);
 +#else
 +      _lineBMapper->SetInputData(_pdB);
 +#endif
 +
        _lineBMapper->ImmediateModeRenderingOn();
-       if(_imageViewer2XYZ){
+       if(_imageViewer2XYZ)
+       {
                _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
                _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor );
                vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera();
@@@ -357,21 -348,23 +362,32 @@@ void wxVtkMPR2DView::Refresh(
                                _ptsA->SetPoint(1, xx2 , y  , z1 );
                                _ptsB->SetPoint(0, x   , yy1, z1 );
                                _ptsB->SetPoint(1, x   , yy2, z1 );
-                               
-                               
+                               position[0]             = x;    
+                               position[1]             = y;    
+                               focalpoint[0]   = x;    
+                               focalpoint[1]   = y;                                    
                        } // if back
++                      
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
 +                              // ..
 +#else
 +                              _ptsA->Modified();
 +                              _ptsB->Modified();
 +#endif
 +
-                       _backX=xx;
-                       _backY=yy;
-                       _backZ=zz;
+                       if (fixAxis2D == true)
+                       {
+                               GetRenderer()->GetActiveCamera()->SetPosition(position);
+                               GetRenderer()->GetActiveCamera()->SetFocalPoint(focalpoint);
+                       } // if GetFixAxis2D
+                       _lineAActor->GetProperty()->SetOpacity( opacityAxis );
+                       _lineBActor->GetProperty()->SetOpacity( opacityAxis );
+                       _backX                  = xx;
+                       _backY                  = yy;
+                       _backZ                  = zz;
+                       _backFixAxis2D  = fixAxis2D;
+                       _backOpacityAxis= opacityAxis;
                } // if image
  
  //EED 2016/02/19
index 7a66d83d0a963ad797aed221182a3485923c2548,aea0d6f8b86a12636d553161f0fda69405e85081..4f5e2267fb61360fa9314c8d4faa7cfb92668cf2
@@@ -62,6 -62,8 +62,10 @@@ private
        int                                                     _backX;
        int                                                     _backY;
        int                                                     _backZ;
++
+       bool                                            _backFixAxis2D;
+       double                                          _backOpacityAxis;
++
        bool                                            _visibleAxis;
        int                                                     _direction;
        vtkPoints                                       *_ptsA;
index d6fb6a53eebbe33672756b43486172ed03026a83,69ffc56b9d505a6dc4c80d0dd9f9cf6df2dbe4ea..3703011e6b5c35dbfc04b34c2d52cf076a99ff3c
@@@ -191,6 -171,15 +171,7 @@@ void wxVtkMPR3DView::Configure(
        // Actors are added to the renderer.
        vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
        _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
 -//    _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(0)  );    // _saggital
 -//    _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(1)  );    // _axial
 -//    _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2)  );    // _coronal
 -      // vtkPointWidget
 -      //if(_myCallback!=NULL){
 -              //_myCallback->Delete();
 -      //}
++
        vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New();
        _myCallback->SetWxVtkMPR3DView(this);
        if(imageData){
                {
                        _planeWidget = vtkPlaneWidget::New();
                }
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                _planeWidget->SetInput( imageData );
 +#else
 +              _planeWidget->SetInputData( imageData );
 +#endif
 +
                _myCallback->SetVtkPlaneWidget(_planeWidget);
                _planeWidget->NormalToXAxisOn();
                _planeWidget->SetResolution(50);
                _planeWidget->SetRepresentationToOutline();
                int pz=(dim[2]/2);
                int dd=20;
                _planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
--              if(_vtkplane==NULL){
 -                      _vtkplane = vtkPolyData::New();
 -                      _probe = vtkProbeFilter::New();
++              if(_vtkplane==NULL)
++              {
 +                      _vtkplane               = vtkPolyData::New();
 +                      _probe                  = vtkProbeFilter::New();
 +                      _contourMapper  = vtkPolyDataMapper::New();
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                        _probe->SetInput(_vtkplane);
 -                      _contourMapper = vtkPolyDataMapper::New();
                        _contourMapper->SetInput( _probe->GetPolyDataOutput() );
 +#else
 +                      _myCallback->SetVtkPolyData(_vtkplane);
 +                      _myCallback->SetVtkProbeFilter(_probe);
 +                      _planeWidget->GetPolyData(_vtkplane);
 +                      _probe->SetInputData(_vtkplane);
 +                      _probe->SetSourceData(imageData);
 +//                    _probe->Update();
 +                      _contourMapper->SetInputData( _probe->GetPolyDataOutput() );
 +#endif
 +
                        _contourPlaneActor = vtkActor::New();
                        _contourPlaneActor->SetMapper(_contourMapper);
                        _contourPlaneActor->VisibilityOff();
                        _planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
                        _planeWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
                        _planeWidget->Off();
                        _wxvtk3Dbaseview->GetRenderer()->AddActor( _contourPlaneActor );
                }
                _planeWidget->GetPolyData(_vtkplane);
 +
 +//EED 2017-01-01 Migration VTK7
 +#if VTK_MAJOR_VERSION <= 5
                _probe->SetSource( imageData );
 +#else
 +              _probe->SetSourceData( imageData );
 +#endif
                _contourMapper->SetScalarRange( imageData->GetScalarRange() );
        ConfigureFreePlanes();
        }
  
@@@ -725,8 -638,7 +689,7 @@@ void wxVtkMPR3DView::showOutlineActor(b
                _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
        } else {
                _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor );
 -      }
 +      } // value
  }
  
  //-------------------------------------------------------------------
index 4d42b26342bcdebb9ca990a465bd4d7d10e3bfbc,c1a639f78a503d69512d00f05ce7c82d1863aee1..5ab97aab8a567c76b03aa70a38567a5e3eb85f70
@@@ -67,15 -63,10 +63,11 @@@ public
        // EED 25 Janvier 2007 testLoic
        void                            TestLoic1();
        void                            TestLoic2();
-       void RemoveActor(vtkActor* actor);
+       void                            RemoveActor(vtkActor* actor);
  //EED 27/05/2013
  //    void ResetCamera(int *ext=NULL,double* spc=NULL);
        void setColorTransferFunction(vtkColorTransferFunction* colortable);
 +
        //Free planes
        //-------------------------------------------------------------------
        void ConfigureFreePlanes();
        void FreePlaneVisible(int plane, bool ok);
        void FreePlaneInteraction(bool ok);
        void SetFreePlanesOrtho();
-       
        void SetColorWindow(double colorWindow);
        void SetColorLevel(double colorLevel);
 +
  private:
        wxVtk3DBaseView                                 *_wxvtk3Dbaseview;
        vtkMPR3DDataViewer                              *_vtkmpr3Ddataviewer;
index 33294b4fd304add2ba24d1f761b99aba9e6d0e2c,dd182d53d77602d5b2ce074cfcb70e8523e8d502..253a6837fa1802b849ab19a624d45619a4ee70c6
@@@ -141,8 -140,8 +140,9 @@@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DVie
        //      wxBoxSizer *sizerH4 = new wxBoxSizer(wxHORIZONTAL);
        
        //CPR: If-else statements added 30 Nov 2009
 +      wxFlexGridSizer *sizerV1;
        wxFlexGridSizer *sizerH4;
+       wxFlexGridSizer *sizerH4a;
        wxFlexGridSizer *sizerH5;
        wxFlexGridSizer *sizerH6;
  
        {
                sizer   = new wxFlexGridSizer(4);
                sizerH4 = new wxFlexGridSizer(3);
-                               
-               sizerH4->Add( new wxStaticText(panel, -1,_T(" "))       , 1, wxALL|wxEXPAND, 0);
-               sizerH4->Add( new wxStaticText(panel, -1,_T("GL"))      , 1, wxALL|wxEXPAND, 0);
-               sizerH4->Add( new wxStaticText(panel, -1,_T("Color   "))        , 1, wxALL|wxEXPAND, 0);
-               
-               sizerH4->Add( _positionX ,1,wxGROW                          , 0 );
-               sizerH4->Add( _ckFreePlaneX,            1, wxALL|wxEXPAND, 0);
-               sizerH4->Add( _ckBoxX     ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED, 0 );
-               
-               sizerH4->Add( _positionY ,1,wxGROW, 0 );
-               sizerH4->Add( _ckFreePlaneY,            1, wxALL|wxEXPAND, 0);
-               sizerH4->Add( _ckBoxY     ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED, 0 );
++
+               sizerH4a = new wxFlexGridSizer(3);
                
-               sizerH4->Add( _positionZ ,1,wxGROW, 0 );
-               sizerH4->Add( _ckFreePlaneZ,            1, wxALL|wxEXPAND, 0);
-               sizerH4->Add( _ckBoxZ     ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED, 0 );
+               sizerH4->Add( new wxStaticText(panel, -1,_T(" "))               ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( new wxStaticText(panel, -1,_T("GL"))              ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( new wxStaticText(panel, -1,_T("Color   ")),1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( _positionX                                                                ,1,     wxGROW                                          , 0);
+               sizerH4->Add( _ckFreePlaneX                                                             ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( _ckBoxX                                                                   ,0,     wxALIGN_CENTER_VERTICAL|wxSHAPED        , 0);
+               sizerH4->Add( _positionY                                                                ,1,     wxGROW                                                          , 0);
+               sizerH4->Add( _ckFreePlaneY                                                             ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( _ckBoxY                                                                   ,0,     wxALIGN_CENTER_VERTICAL|wxSHAPED        , 0);
+               sizerH4->Add( _positionZ                                                                ,1,     wxGROW                                                          , 0);
+               sizerH4->Add( _ckFreePlaneZ                                                             ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( _ckBoxZ                                                                   ,0,     wxALIGN_CENTER_VERTICAL|wxSHAPED        , 0);
  
  //EED 2016/02/19              
-               sizerH4->Add( _ckBoxInterpolate                         , 1, wxALL|wxEXPAND, 0);
-               sizerH4->Add( new wxStaticText(panel, -1,_T(" "))       , 1, wxALL|wxEXPAND, 0);
-               sizerH4->Add( new wxStaticText(panel, -1,_T(" "))       , 1, wxALL|wxEXPAND, 0);
-                               
+               sizerH4->Add( _ckBoxInterpolate                                                 ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( new wxStaticText(panel, -1,_T(" "))               ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( new wxStaticText(panel, -1,_T(" "))               ,1, wxALL|wxEXPAND                                              , 0);
+ //            sizerH4->Add( _ckBoxXYZ                                                                 ,1, wxALL|wxEXPAND                                              , 0);
+ //            sizerH4->Add( new wxStaticText(panel, -1,_T(" "))               ,1, wxALL|wxEXPAND                                              , 0);
+ //            sizerH4->Add( new wxStaticText(panel, -1,_T(" "))               ,1, wxALL|wxEXPAND                                              , 0);
+ //            sizerH4a->Add( new wxStaticText(panel, -1,_T("Axis 2D:")),1, wxALL|wxEXPAND                                             , 0);
+               sizerH4a->Add( _ckBoxXYZ                                                                ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4a->Add( _ckBoxFixAxis2D                                                  ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4a->Add( _opacityAxis                                                             ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( sizerH4a                                                                  ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( new wxStaticText(panel, -1,_T(" "))               ,1, wxALL|wxEXPAND                                              , 0);
+               sizerH4->Add( new wxStaticText(panel, -1,_T(" "))               ,1, wxALL|wxEXPAND                                              , 0);
+               
+                       
+               
                sizerH5 = new wxFlexGridSizer(1);
-               sizerH5->Add( _ckBoxXYZ                                 , 1, wxALL|wxEXPAND, 0);
-               sizerH5->Add( _ckBoxPlane                               , 1, wxALL|wxEXPAND, 0);                
-               sizerH5->Add( new wxStaticText(panel, -1,_T("      "))  , 1, wxALL|wxEXPAND, 0);
- ////EED 05Nov2012             sizerH5->Add( _ckBox_BW_Color_Plane                                     , 1, wxALL|wxEXPAND, 0);
-               sizerH5->Add( _ckFreePlaneInteraction , 1, wxALL|wxEXPAND, 0);
-               sizerH5->Add( btnFreePlanesOrtho       , 0, wxALIGN_CENTER_VERTICAL|wxSHAPED, 0 );
-               sizerH5->Add( new wxStaticText(panel, -1,_T(" "))       , 1, wxALL|wxEXPAND, 0);
-               sizerH5->Add( btnColorTable                         , 0, wxALIGN_CENTER_VERTICAL|wxSHAPED, 0 );
-               sizerH5->Add( new wxStaticText(panel, -1,_T(" "))       , 1, wxALL|wxEXPAND, 0);
-               sizerH5->Add( _cbStereo, 1, wxALL|wxEXPAND, 0);
+               sizerH5->Add( new wxStaticText(panel, -1,_T("      "))  , 1, wxALL|wxEXPAND                                             , 0);
+               sizerH5->Add( _ckBoxPlane                                                               , 1, wxALL|wxEXPAND                                             , 0);           
+               sizerH5->Add( new wxStaticText(panel, -1,_T("      "))  , 1, wxALL|wxEXPAND                                             , 0);
+ ////EED 05Nov2012             sizerH5->Add( _ckBox_BW_Color_Plane             , 1, wxALL|wxEXPAND                                             , 0);
+               sizerH5->Add( _ckFreePlaneInteraction                                   , 1, wxALL|wxEXPAND                                             , 0);
+               sizerH5->Add( btnFreePlanesOrtho                                        , 0, wxALIGN_CENTER_VERTICAL|wxSHAPED   , 0);
+               sizerH5->Add( new wxStaticText(panel, -1,_T(" "))               , 1, wxALL|wxEXPAND                                             , 0);
+               sizerH5->Add( btnColorTable                             , 0, wxALIGN_CENTER_VERTICAL|wxSHAPED   , 0);
+               sizerH5->Add( new wxStaticText(panel, -1,_T(" "))               , 1, wxALL|wxEXPAND                                             , 0);
+               sizerH5->Add( _cbStereo                                                                 , 1, wxALL|wxEXPAND                                             , 0);
                
                sizerH6 = new wxFlexGridSizer(1);
-               sizerH6->Add( _ckBoxOutline                                     , 1, wxALL|wxEXPAND, 0);
-               sizerH6->Add( _ckBoxBackGroundBlack                     , 1, wxALL|wxEXPAND, 0);
+               sizerH6->Add( _ckBoxOutline                                                             , 1, wxALL|wxEXPAND                                             , 0);
+               sizerH6->Add( _ckBoxBackGroundBlack                                             , 1, wxALL|wxEXPAND                                             , 0);
  
 -
 -              sizer->Add( sizerH4                                                                             ,  1, wxALL|wxGROW,     2);
 +              sizer->Add( sizerH4,  1, wxALL|wxGROW,  2);
                sizer->Add( sizerH5,  1, wxALL|wxEXPAND,2);
                sizer->Add( sizerH6,  1, wxALL|wxEXPAND,2);
 -              
 -              
 +                      
        }       else    {
                sizer    = new wxFlexGridSizer(1);
  
@@@ -750,18 -719,27 +763,32 @@@ void wxVtkMPR3DViewCntrlPanel::OnBackGr
  void wxVtkMPR3DViewCntrlPanel::OnInterpolate(wxCommandEvent& event)
  {
        _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetInterpolate(  _ckBoxInterpolate->GetValue() );
        _wxvtkmpr3Dview->Refresh();
+       wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+       _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+ }
  
+ //-------------------------------------------------------------------
+ void wxVtkMPR3DViewCntrlPanel::OnFixAxis2D(wxCommandEvent& event)
+ {
+       _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetFixAxis2D(    _ckBoxFixAxis2D->GetValue() );
+       _wxvtkmpr3Dview->Refresh();
        wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
 +#if wxMAJOR_VERSION <= 2
        _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
 +#else
 +      _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
 +#endif
+ }
  
+ //-------------------------------------------------------------------
+ void wxVtkMPR3DViewCntrlPanel::OnOpacityAxis(wxCommandEvent& event)
+ {
+       _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetOpacityAxis(  _opacityAxis->GetValue()/100.0 );
+       _wxvtkmpr3Dview->Refresh();
+       wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+       _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
  }