+ vtkProperty* prop1 = NULL;
+ vtkImagePlaneWidget* planeWidget = vtkImagePlaneWidget::New();
+ planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
+ planeWidget->EnabledOff();
+ vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+ int xMin = 0, xMax = 0, yMin = 0, yMax = 0, zMin = 0, zMax = 0;
+ double xSpacing = 0, ySpacing = 0, zSpacing = 0;
+ if(image)
+ {
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ planeWidget->SetInput( image );
+#else
+ planeWidget->SetInputData( image );
+#endif
+ image->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax);
+ image->GetSpacing(xSpacing, ySpacing, zSpacing);
+ }
+
+ if (activationkey=='x')
+ {
+ planeWidget->SetPlaneOrientationToXAxes();
+ planeWidget->SetSlicePosition((xMax+xMin)/2.*xSpacing);
+ }
+
+ if (activationkey=='y')
+ {
+ planeWidget->SetPlaneOrientationToYAxes();
+ planeWidget->SetSlicePosition((yMax+yMin)/2.*ySpacing);
+ }
+
+ if (activationkey=='z')
+ {
+ planeWidget->SetPlaneOrientationToZAxes();
+ planeWidget->SetSlicePosition((zMax+zMin)/2.*zSpacing);
+ }
+
+ planeWidget->DisplayTextOn();
+ planeWidget->SetPicker(picker);
+ planeWidget->SetKeyPressActivationValue(activationkey);
+ prop1 = planeWidget->GetPlaneProperty();
+ prop1->SetColor(r, g, b);
+ return planeWidget;
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::SetFreePlanesOrtho()
+{
+ _planeWidgetX->SetPlaneOrientationToXAxes();
+ _planeWidgetY->SetPlaneOrientationToYAxes();
+ _planeWidgetZ->SetPlaneOrientationToZAxes();
+ vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)GetWxvtk3Dbaseview()->GetInteractorStyleBaseView();
+ isbv->SetParent_refresh_waiting();
+ isbv->EvaluateToRefresh();
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::FreePlaneVisible(int plane, bool ok)
+{
+ if(_planeWidgetX)
+ {
+ if (ok==true)
+ {
+//EED 21/07/2013
+// 1. Make backup of actors
+// 2. Putting out all the actors
+// 3. Add vtkImagageActor in first place
+// 4. Putting again the originals actors
+// 5. Refresh
+
+ // step 1, step 2
+ vtkActorCollection *tmpCollection = vtkActorCollection::New();
+ vtkActorCollection *collectionActors = _wxvtk3Dbaseview->GetRenderer()->GetActors();
+ int i,size=collectionActors->GetNumberOfItems();
+ for (i=0; i<size; i++)
+ {
+ tmpCollection->AddItem ( (vtkActor*)collectionActors->GetItemAsObject(0) );
+ _wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
+ } // for
+
+ // step 3
+ if ((plane==1) && (ok==true)) _planeWidgetX->EnabledOn();
+ if ((plane==2) && (ok==true)) _planeWidgetY->EnabledOn();
+ if ((plane==3) && (ok==true)) _planeWidgetZ->EnabledOn();
+
+ // 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 ok
+ if ((plane==1) && (ok==false)) _planeWidgetX->EnabledOff();
+ if ((plane==2) && (ok==false)) _planeWidgetY->EnabledOff();
+ if ((plane==3) && (ok==false)) _planeWidgetZ->EnabledOff();
+ } // if _planeWidgetX
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::FreePlaneInteraction(bool ok)
+{
+ if(_planeWidgetX)
+ {
+ if (ok==true)
+ {
+ _planeWidgetX->InteractionOn();
+ _planeWidgetY->InteractionOn();
+ _planeWidgetZ->InteractionOn();
+ } else {
+ _planeWidgetX->InteractionOff();
+ _planeWidgetY->InteractionOff();
+ _planeWidgetZ->InteractionOff();
+ }
+ } // if _planeWidgetXVisiblePointWidget
+}
+
+
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::setColorTransferFunction(vtkColorTransferFunction* colortable)
+{
+ GetVtkMPR3DDataViewer ()->setColorTransferFunction(colortable);