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]);
// 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();
_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();
_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();
}
-void ImagePlaneWidget::invariant(){
+void ImagePlaneWidget::invariant()
+{
if(_img == NULL){
throw "Image data is not initialized";
}
}
-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();