]> Creatis software - creaMaracasVisu.git/blobdiff - lib/Kernel/VTKObjects/ViewerWidgets/imageplanewidget.cxx
#3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaMaracasVisu.git] / lib / Kernel / VTKObjects / ViewerWidgets / imageplanewidget.cxx
index 3e044e99c19a4e7343687ef8938eb4e5625807f5..fd7b1212bdc5297136157fde3e2e0db692187c5f 100644 (file)
@@ -80,21 +80,43 @@ bool ImagePlaneWidget::showImageActors(bool show){
 
 void ImagePlaneWidget::initializeImageActors(){
 
-    int *w_ext = _img->GetWholeExtent();
     //cout<<w_ext[0]<<" "<<w_ext[1]<<" "<<w_ext[2]<<" "<<w_ext[3]<<" "<<w_ext[4]<<" "<<w_ext[5]<<" "<<endl;
     _imageactorx = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+    int *w_ext = _img->GetWholeExtent();
     _imageactorx->SetInput(_img);
+#else
+    int *w_ext = _img->GetExtent();
+    _imageactorx->SetInputData(_img);
+#endif
+
     xslice =  (w_ext[4] + w_ext[5])/2;
     _imageactorx->SetDisplayExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], xslice, xslice);
 
 
     _imageactory = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     _imageactory->SetInput(_img);
+#else
+    _imageactory->SetInputData(_img);
+#endif
+
     yslice =  (w_ext[2] + w_ext[3])/2;
     _imageactory->SetDisplayExtent(w_ext[0], w_ext[1], yslice, yslice, w_ext[4], w_ext[5]);
 
     _imageactorz = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     _imageactorz->SetInput(_img);
+#else
+    _imageactorz->SetInputData(_img);
+#endif
+
     zslice =  (w_ext[0] + w_ext[1])/2;
     _imageactorz->SetDisplayExtent(zslice, zslice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
 
@@ -112,7 +134,14 @@ void ImagePlaneWidget::setImage(vtkImageData* img){
 
     // Set input X,Y and Z plane
     _xwidget->Off( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     _xwidget->SetInput( _img );
+#else
+    _xwidget->SetInputData( _img );
+#endif
+
     _xwidget->SetPlaneOrientationToXAxes( );
     _xwidget->SetSliceIndex( sliceX );
     _xwidget->TextureInterpolateOff();
@@ -122,7 +151,14 @@ void ImagePlaneWidget::setImage(vtkImageData* img){
     _xwidget->GetTextProperty()->SetColor(0.3, 0.3, 0.3);
 
     _ywidget->Off( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     _ywidget->SetInput( _img );
+#else
+    _ywidget->SetInputData( _img );
+#endif
+
     _ywidget->SetPlaneOrientationToYAxes( );
     _ywidget->SetSliceIndex( sliceY );
     _ywidget->TextureInterpolateOff();
@@ -132,7 +168,16 @@ void ImagePlaneWidget::setImage(vtkImageData* img){
     _ywidget->On( );
 
     _zwidget->Off( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     _zwidget->SetInput( _img );
+#else
+    _zwidget->SetInputData( _img );
+#endif
+
+
     _zwidget->SetPlaneOrientationToZAxes( );
     _zwidget->SetSliceIndex( sliceZ );
     _zwidget->TextureInterpolateOff();
@@ -167,7 +212,8 @@ void ImagePlaneWidget::showPlanes(bool show){
 }
 
 
-void ImagePlaneWidget::invariant(){
+void ImagePlaneWidget::invariant()
+{
     if(_img == NULL){
         throw "Image data is not initialized";
     }
@@ -177,20 +223,44 @@ void ImagePlaneWidget::invariant(){
 }
 
 
-void ImagePlaneWidget::setSliceXImageActor(int value){
+void ImagePlaneWidget::setSliceXImageActor(int value)
+{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     int *w_ext = _img->GetWholeExtent();
+#else
+    int *w_ext = _img->GetExtent();
+#endif
+
     xslice = value;
     _imageactorx->SetDisplayExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], xslice, xslice);
     m_Interactor->Render();
 }
-void ImagePlaneWidget::setSliceYImageActor(int value){
+
+void ImagePlaneWidget::setSliceYImageActor(int value)
+{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     int *w_ext = _img->GetWholeExtent();
+#else
+    int *w_ext = _img->GetExtent();
+#endif
     yslice = value;
     _imageactory->SetDisplayExtent(w_ext[0], w_ext[1], yslice, yslice, w_ext[4], w_ext[5]);
     m_Interactor->Render();
 }
-void ImagePlaneWidget::setSliceZImageActor(int value){
+
+
+void ImagePlaneWidget::setSliceZImageActor(int value)
+{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     int *w_ext = _img->GetWholeExtent();
+#else
+    int *w_ext = _img->GetExtent();
+#endif
+
     zslice = value;
     _imageactorz->SetDisplayExtent(zslice, zslice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
     m_Interactor->Render();