]> Creatis software - creaMaracasVisu.git/commitdiff
#3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Mon, 24 Jul 2017 14:22:22 +0000 (16:22 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Mon, 24 Jul 2017 14:22:22 +0000 (16:22 +0200)
19 files changed:
lib/GUI/Base/VolumeRenderer/volumerendererdata.cxx
lib/GUI/Base/VolumeRenderer/volumerendererdata.h
lib/Kernel/VTKObjects/ViewerWidgets/imageplanewidget.cxx
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.cxx
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx
lib/maracasVisuLib/src/CutModule/interface/vtkInteractorStyleCutter.h
lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourCrownWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ContourView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/LineView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/PointView.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/vtkClipping3DDataViewer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClosePolyData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClosePolyData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractor.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractorEditContour.h

index 52e7c866cd7c2fc47b79919ef6ec187d1bb3f831..74ee8a75c7839fafbe2d17c5580eaaa5d982714d 100644 (file)
 #include "volumerendererdata.h"
 #include "vtkObjectFactory.h"
 
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
 vtkCxxRevisionMacro(VolumeRendererData, "$Revision: 1.11 $");
+#else
+  //...
+#endif
+
 vtkStandardNewMacro(VolumeRendererData);
 
 VolumeRendererData::VolumeRendererData()
index 4d6f3e4ca7bc05dfe1f47ad15e08a8fe88760043..67194c75782681cab59b335178267e87807a0ed7 100644 (file)
@@ -37,7 +37,14 @@ class VolumeRendererData : public vtkObject
 {
 public:
     static VolumeRendererData *New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     vtkTypeRevisionMacro(VolumeRendererData,vtkObject);
+#else
+    vtkTypeMacro(VolumeRendererData,vtkObject);
+#endif
+
     //
 
     vtkSetObjectMacro(ImageData, vtkImageData);
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();
index 27c4d2be6e4173fbafcaa0fbe3a8f6a67d3bd591..4931d51876ba5d43680e40b94595a25280a1e477 100644 (file)
@@ -111,12 +111,26 @@ int VolumeRendererManager::addVolume(vtkImageData* img, vtkRenderWindowInteracto
 
 
         vtkSmartPointer< vtkImageLuminance > luminance = vtkSmartPointer< vtkImageLuminance >::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         luminance->SetInput(img);
+#else
+        luminance->SetInputData(img);
+#endif
+
         luminance->Update();
 
         vtkSmartPointer< vtkImageAppendComponents > append = vtkSmartPointer< vtkImageAppendComponents >::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         append->SetInput(0, img);
         append->SetInput(1, luminance->GetOutput());
+#else
+        append->SetInputData(0, img);
+        append->SetInputData(1, luminance->GetOutput());
+#endif
+
         append->Update();
 
 
@@ -301,12 +315,19 @@ void VolumeRendererManager::GetImages(vtkImageData* img, vector<vtkImageData* >&
 
     for(unsigned i = 0; i < img->GetNumberOfScalarComponents(); i++){
         vectimg.push_back(vtkImageData::New());
-        vectimg[i]->SetNumberOfScalarComponents(1);
         vectimg[i]->SetExtent(img->GetExtent());
         vectimg[i]->SetSpacing(img->GetSpacing());
         vectimg[i]->SetOrigin(img->GetOrigin());
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+        vectimg[i]->SetNumberOfScalarComponents(1);
         vectimg[i]->SetScalarType(img->GetScalarType());
         vectimg[i]->AllocateScalars();
+#else
+        vectimg[i]->AllocateScalars(img->GetScalarType(),1);
+#endif
+
     }
 
     int *extent = img->GetExtent();
@@ -446,7 +467,13 @@ vtkImageData* VolumeRendererManager::getImageData(std::string filename){
                 vtkImageData* img = reader->GetOutput();
 
                 vtkImageCast* cast = vtkImageCast::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                 cast->SetInput(img);
+#else
+                cast->SetInputData(img);
+#endif
+
                 cast->SetOutputScalarTypeToUnsignedShort();
                 cast->Update();
                 //reader->Delete();
index 00d115b0bc25ab3b531f42af412fb8dd40c615e2..fcfd3c3b9763ce94658e96783e7b25d9a1bc01ae 100644 (file)
 
 #include <vtkVolumeRayCastMapper.h>
 
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+  //...
+#else
+#include <vtkGPUVolumeRayCastMapper.h>
+#endif
+
 // EED This is code for Juan Carlos Prieto TESTES
 //#if VTK_MAJOR_VERSION >= 5
 //    #if VTK_MINOR_VERSION >= 6
@@ -164,7 +172,15 @@ void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string datana
 #endif
        VolumeMapper->SetClippingPlanes( _volumePlanes );
        _newvol->SetMapper(VolumeMapper );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        VolumeMapper->SetInput( _vol );
+#else
+       VolumeMapper->SetInputData( _vol );
+#endif
+
+
        VolumeMapper->Update();
        _newvol->Update();
 }
@@ -212,7 +228,13 @@ void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* int
         BoxWidget->SetInteractor( interactor );
         BoxWidget->SetPlaceFactor(1.01);
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         BoxWidget->SetInput( _vol );
+#else
+        BoxWidget->SetInputData( _vol );
+#endif
+
         BoxWidget->InsideOutOn();
         BoxWidget->PlaceWidget();
 
index 2dc81e89689295ef70e1c2141c3a594ba62cf067..18600cf6eabd7ce54bebaf7741efeff858c69ff5 100644 (file)
@@ -60,7 +60,15 @@ public:
   // Description:
   // Instantiate the object.
   static vtkInteractorStyleCutter *New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
   vtkTypeRevisionMacro(vtkInteractorStyleCutter, vtkInteractorStyle);
+#else
+  vtkTypeMacro(vtkInteractorStyleCutter, vtkInteractorStyle);
+#endif
+
+
   void PrintSelf(ostream& os, vtkIndent indent);
   bool Finished();
   
index 3ab512b57199daf2bb825554452667a0bbcdfce9..010ec0c533cb3ca0b73357c5e14b7ed894ab3a2d 100644 (file)
@@ -122,11 +122,22 @@ void wxMaracasCoutourTool::Init(wxVtkBaseView *wxvtkbaseview, vtkImageData* imag
        table->SetRampToLinear();
        table->Build();
        
-       vtkImageMapToColors  *mapperImage = vtkImageMapToColors::New();
+       vtkImageMapToColors  *mapperImage       = vtkImageMapToColors::New();
+       vtkImageActor *actorImage                       = vtkImageActor::New();
+
        mapperImage->SetLookupTable(table);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        mapperImage->SetInput( imagedataMaskResult );
-       vtkImageActor *actorImage       = vtkImageActor::New();
        actorImage->SetInput( mapperImage->GetOutput() );
+#else
+       mapperImage->SetInputData( imagedataMaskResult );
+       actorImage->SetInputData( mapperImage->GetOutput() );
+#endif
+
+
        actorImage->SetOpacity(1);
        
        wxvtkbaseview->GetRenderer()->AddActor(actorImage);     
@@ -488,17 +499,31 @@ void wxMaracasCoutourTool::InitVtkImagesResult()
 
          imagedataValueResult = vtkImageData::New();
 //       imagedataValueResult->SetScalarType(scalartype);
-         imagedataValueResult->SetScalarTypeToUnsignedShort();
          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
+
 
          imagedataMaskResult  = vtkImageData::New();
 //       imagedataMaskResult->SetScalarType(scalartype);
-         imagedataMaskResult->SetScalarTypeToUnsignedShort();
          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 a0cfd9ae1e2cb27a3ffcf29866f95e0da7fc886a..2947bdc03f6586de3c99d7f84d4e5ec81bb47340 100644 (file)
@@ -51,7 +51,14 @@ void ContourExtractData::SetImage( vtkImageData* imagedata)
 
        // RaC 20-11-09 Changes in InitLstContoursLinesYPoints
        int ext[6];
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        this->imagedata->GetWholeExtent(ext);
+#else
+       this->imagedata->GetExtent(ext);
+#endif
+
        _sizeImageY = ext[3]-ext[2]+1;
 
        // init vtk image result : valuesImage maskImage  
@@ -460,8 +467,15 @@ void ContourExtractData::CalculateImageResult()
 
                imagedataValueResult->Modified();
                imagedataMaskResult->Modified();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                imagedataValueResult->Update();
                imagedataMaskResult->Update();
+#else
+  //...
+#endif
+
        } // if
 
 }
@@ -559,10 +573,17 @@ void ContourExtractData::InitVtkImagesResult()
        }
        imagedataValueResult = vtkImageData::New();
        //        imagedataValueResult->SetScalarType(scalartype);
-       imagedataValueResult->SetScalarTypeToUnsignedShort();
        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)
        {
@@ -570,10 +591,17 @@ void ContourExtractData::InitVtkImagesResult()
        }
        imagedataMaskResult  = vtkImageData::New();
        //        imagedataMaskResult->SetScalarType(scalartype);
-       imagedataMaskResult->SetScalarTypeToUnsignedShort();
        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 a7580682e1bbfd8a4a771afd741564784bab3bef..d79354eedaa0441fdcf71fea82fca1e58decbb0e 100644 (file)
@@ -69,7 +69,15 @@ void ContourView::CreateNewContour(vtkPolyData *contour, int type)
        contour_mapped.push_back(vtkPolyDataMapper::New());
        contour_mapped.back()->ImmediateModeRenderingOn();
        contour_mapped.back()->ScalarVisibilityOff( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        contour_mapped.back()->SetInput(contour);
+#else
+       contour_mapped.back()->SetInputData(contour);
+#endif
+
 
        contour_actor.push_back(vtkActor::New());
        contour_actor.back()->SetMapper(contour_mapped.back());
index c4fd4408662f8c1710fe8fa4d2e0c1b5944c52ab..253fa58ab8f1e021f41c8308b5ea309b9c76b8f0 100644 (file)
@@ -85,9 +85,14 @@ void LineView::CreateNewLine(double x1, double y1, double z1, double x2, double
        aLineGrid->Allocate(1,1);
        aLineGrid->InsertNextCell(aLine->GetCellType(),aLine->GetPointIds());
        aLineGrid->SetPoints(pointsLine);
-
        
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        contour_mapped.back()->SetInput(aLineGrid);
+#else
+       contour_mapped.back()->SetInputData(aLineGrid);
+#endif
+
        contour_mapped.back()->ImmediateModeRenderingOn();
 
        contour_actor.back()->SetMapper(contour_mapped.back());
index 476902d8af88a62a2154625a8a48ad8416e3aaa3..7c17ffb89f0b09f299b72727a635b631a5f31fdf 100644 (file)
@@ -71,7 +71,14 @@ void PointView::CreateNewPoint(double x, double y, int type)
        point_mapped.push_back(vtkPolyDataMapper::New());
 //     point_mapped.back()->ImmediateModeRenderingOn();
        //point_mapped.back()->ScalarVisibilityOff( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        point_mapped.back()->SetInput(aSphere->GetOutput());
+#else
+       point_mapped.back()->SetInputData(aSphere->GetOutput());
+#endif
 
        point_actor.push_back(vtkActor::New());
        point_actor.back()->SetMapper(point_mapped.back());
index 299b737dc7a1a2605446d95a3a43972bd744e0a5..76fa42b2c456e4c1e2547fc354499dbcf542ad4a 100644 (file)
@@ -446,7 +446,16 @@ printf("EED ColorLayerImageView::ConfigLookupTable   Make something with transpa
 //----------------------------------------------------------------------------
 int ColorLayerImageView::GrayLevel_TO_colorTableIndex( double VALUE )
 {
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
   GetImage()->Update();
+#else
+  //...
+#endif
+
+
+
 
 //EED 20 oct 2015
 //  GetImage()->GetScalarRange(_range);
index f625d57174f484f40986fe6e4afc9f8692e238f4..1e402d3b35785d86341c215e7f797ca9285c2487 100644 (file)
@@ -191,8 +191,15 @@ void LayerImageBase::SetImage(vtkImageData* image)
        spcBase[5]=0;
 
        _image = image;
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _image->Update();
        _image->GetWholeExtent(ext);
+#else
+       _image->GetExtent(ext);
+#endif
+
        dimensionOriginalLayer[0] = ext[1]-ext[0]+1;
        dimensionOriginalLayer[1] = ext[3]-ext[2]+1;
        dimensionOriginalLayer[2] = ext[5]-ext[4]+1;
@@ -205,7 +212,14 @@ void LayerImageBase::SetImage(vtkImageData* image)
                vtkImageData    *imagebase              =       GetwxVtkBaseView()->GetVtkBaseData()->GetImageData();
                if (imagebase!=NULL) 
                {       
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        imagebase->GetWholeExtent(ext);
+#else
+                       imagebase->GetExtent(ext);
+#endif
+
                        dimBase[0]=ext[1]-ext[0]+1;                             
                        dimBase[1]=ext[3]-ext[2]+1;                             
                        dimBase[2]=ext[5]-ext[4]+1;                             
@@ -223,7 +237,14 @@ void LayerImageBase::SetImage(vtkImageData* image)
        _image->GetScalarRange( _range );
        _thresholdTable = vtkLookupTable::New();
 
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _imageChangeInformation->SetInput(_image);
+#else
+       _imageChangeInformation->SetInputData(_image);
+#endif
+
 }
 
 //------------------------------------------------------------------------------
@@ -474,7 +495,14 @@ void LayerImageBase::onThreshold()
                }  // !GetActorPresent()
 
                ConfigLookupTable();  // virtual method
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _imageReslicer->SetInput( GetImage() );
+#else
+               _imageReslicer->SetInputData( GetImage() );
+#endif
+
                _imageReslicer->SetInformationInput( GetImage() );
 
                if (directionViewer==0)
@@ -506,9 +534,24 @@ void LayerImageBase::onThreshold()
 //             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
+               _thresholdActor->SetInputData( _thresholdMapper->GetOutput() );
+#endif
+
                
                _scalarbarActor->SetLookupTable( _thresholdTable );
 //             _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
index b9f838613aa9859363c6c55b850fa51caee9b8b2..8f094a6c6bb0f4530ba772a176882492e1f2292f 100644 (file)
@@ -241,7 +241,14 @@ void WidgetShowNPoints::AddVtkPoint()
        //NTU: For updating points
        lstSourceSphere.push_back(vtksphere);
        vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        sphereMapper->SetInput( vtksphere->GetOutput() );
+#else
+       sphereMapper->SetInputData( vtksphere->GetOutput() );
+#endif
+
        vtkActor *sphereActor   = vtkActor::New();
        sphereActor->SetMapper(sphereMapper);
        sphereActor->SetOrigin(0, 0, 0);
index a888215dc78262188dcaa7fade05be4dc4b72176..1e723a13e09b5973e0d1cbf9aa096a721d2c89ac 100644 (file)
@@ -209,9 +209,19 @@ void vtkClipping3DDataViewer::SetImage()
        vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
        for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _mCubes[i]->SetInput( imagedata );
+#else
+               _mCubes[i]->SetInputData( imagedata );
+#endif
        } // for
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _volumeMapper->SetInput( imagedata );
+#else
+       _volumeMapper->SetInputData( imagedata );
+#endif
        _volumerendererdata->SetImageData( imagedata );
 }
 
@@ -226,21 +236,50 @@ void vtkClipping3DDataViewer::Configure_Tissue()
        {
                // Visualisation - original volume
                _mCubes[i] = vtkMarchingCubes::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _mCubes[i]->SetInput( imagedata );
+#else
+               _mCubes[i]->SetInputData( imagedata );
+#endif
+
                _mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 );
 //             _mCubes[i]->SetValue( 0, 1500 );
            _tissueStripper[i] = vtkStripper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
            _tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
+#else
+           _tissueStripper[i]->SetInputData( _mCubes[i]->GetOutput( ) );
+#endif
+
                _tissuePlanes[i]  = vtkPlanes::New();
                int x1,x2,y1,y2,z1,z2;
                imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
                _tissuePlanes[i]->SetBounds  (x1,x2,y1,y2,z1,z2);
                _tissueClipper[i] = vtkClipPolyData::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
+#else
+               _tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() );
+#endif
+
                _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
                _tissueClipper[i]->InsideOutOn( );
                _tissueMapper[i] = vtkPolyDataMapper::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
+#else
+               _tissueMapper[i]->SetInputData( _tissueClipper[i]->GetOutput() );
+#endif
+
+
                _tissueMapper[i]->ScalarVisibilityOff( );
 //             _tissueMapper[i]->Update();
        } // for i  
@@ -351,7 +390,15 @@ void vtkClipping3DDataViewer::Configure_Volume()
        // EED 13/03/2011
 
  // _volumeMapper = vtkVolumeRayCastMapper::New();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
+#else
+       _volumeMapper->SetInputData( this->GetVtkMPRBaseData()->GetImageData() );
+#endif
+
 
     _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
 
@@ -485,7 +532,14 @@ void vtkClipping3DDataViewer::Configure()
   // An outline provides context around the data.
   //
        _outlineData    = vtkOutlineFilter::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     _outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+#else
+    _outlineData->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+#endif
+
        _mapOutline     = vtkPolyDataMapper::New();
 
 //EED 4 nov 2015 Estelle 
@@ -772,7 +826,14 @@ void vtkClipping3DDataViewer::ReadMeshVTK(char *namefile)
        vtkDataSetReader *reader = vtkDataSetReader::New();
        reader->SetFileName(namefile);
        reader->Update();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _tissueStripper[3]->SetInput( reader->GetPolyDataOutput()  );
+#else
+       _tissueStripper[3]->SetInputData( reader->GetPolyDataOutput()  );
+#endif
+
 }
 
 void vtkClipping3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable){
index 4b0aef797825d3695f89eb07c8d3e1b0885c1ae9..397295f78e440712ac7b19b98653a4b1e9337378 100644 (file)
 #include "vtkAppendPolyData.h"
 #include "vtkCleanPolyData.h"
 
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
 vtkCxxRevisionMacro(vtkClosePolyData, "$Revision: 1.3 $");
+#else
+  //...
+#endif
+
 vtkStandardNewMacro(vtkClosePolyData);
 
 //----------------------------------------------------------------------------
@@ -64,53 +71,67 @@ vtkClosePolyData::~vtkClosePolyData()
 {
 }
 
+
 //----------------------------------------------------------------------------
-// This method is much too long, and has to be broken up!
-// Furthermore we are loosing the normals !!!
-void vtkClosePolyData::Execute()
-{
-  vtkPolyData *input = this->GetInput();
-  vtkPolyData *output = this->GetOutput();
-  
-   //#closing the polydata see : close.py for details
-  vtkFeatureEdges *boundary = vtkFeatureEdges::New();
-  boundary->SetInput( input );
-  boundary->BoundaryEdgesOn ();
-  boundary->FeatureEdgesOff ();
-  boundary->NonManifoldEdgesOff ();
-  boundary->ManifoldEdgesOff ();
-  //boundary->ColoringOff ();
-
-  vtkStripper *stripper = vtkStripper::New();
-  stripper->SetInput( boundary->GetOutput() );
-  stripper->Update(); //important
-  boundary->Delete();
-
-  vtkPolyData *pd = vtkPolyData::New();
-  pd->SetPoints ( stripper->GetOutput()->GetPoints() );
-  pd->SetPolys  ( stripper->GetOutput()->GetLines() );
-  stripper->Delete();
-    
-  //vtkGLUTesselatorTriangleFilter *triangle = vtkGLUTesselatorTriangleFilter::New();
-  vtkTriangleFilter *triangle = vtkTriangleFilter::New();
-  triangle->SetInput( pd );
-  pd->Delete();
-    
-  vtkAppendPolyData *append = vtkAppendPolyData::New();
-  append->AddInput( input );
-  append->AddInput( triangle->GetOutput());
-  triangle->Delete();
-      
-  vtkCleanPolyData *clean = vtkCleanPolyData::New();
-  clean->SetInput( append->GetOutput());
-  append->Delete();
-    
-  // When all optimizations are complete, this squeeze will be unecessary.
-  // (But it does not seem to cost much.)
-  clean->Update();  //important before ShallowCopy
-  output->ShallowCopy( clean->GetOutput() );
-  clean->Delete();
-}
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       // This method is much too long, and has to be broken up!
+       // Furthermore we are loosing the normals !!!
+       void vtkClosePolyData::Execute()
+       {
+         vtkPolyData *input = this->GetInput();
+         vtkPolyData *output = this->GetOutput();
+         
+          //#closing the polydata see : close.py for details
+         vtkFeatureEdges *boundary = vtkFeatureEdges::New();
+         boundary->SetInput( input );
+         boundary->BoundaryEdgesOn ();
+         boundary->FeatureEdgesOff ();
+         boundary->NonManifoldEdgesOff ();
+         boundary->ManifoldEdgesOff ();
+         //boundary->ColoringOff ();
+
+         vtkStripper *stripper = vtkStripper::New();
+         stripper->SetInput( boundary->GetOutput() );
+         stripper->Update(); //important
+         boundary->Delete();
+
+         vtkPolyData *pd = vtkPolyData::New();
+         pd->SetPoints ( stripper->GetOutput()->GetPoints() );
+         pd->SetPolys  ( stripper->GetOutput()->GetLines() );
+         stripper->Delete();
+           
+         //vtkGLUTesselatorTriangleFilter *triangle = vtkGLUTesselatorTriangleFilter::New();
+         vtkTriangleFilter *triangle = vtkTriangleFilter::New();
+         triangle->SetInput( pd );
+         pd->Delete();
+           
+         vtkAppendPolyData *append = vtkAppendPolyData::New();
+         append->AddInput( input );
+         append->AddInput( triangle->GetOutput());
+         triangle->Delete();
+             
+         vtkCleanPolyData *clean = vtkCleanPolyData::New();
+         clean->SetInput( append->GetOutput());
+         append->Delete();
+           
+         // When all optimizations are complete, this squeeze will be unecessary.
+         // (But it does not seem to cost much.)
+         clean->Update();  //important before ShallowCopy
+         output->ShallowCopy( clean->GetOutput() );
+         clean->Delete();
+       }
+
+#else
+       int vtkClosePolyData::ProcessRequest(   vtkInformation *request, 
+                                                                                       vtkInformationVector **inputVector, 
+                                                                                       vtkInformationVector *outputVector)
+       {
+printf("EED Warning ERROR ! vtkClosePolyData::ProcessRequest  not implemented  VTK7 migration")
+       }
+
+#endif
 
 //----------------------------------------------------------------------------
 void vtkClosePolyData::PrintSelf(ostream& os, vtkIndent indent)
index 85e4ad0cebb53d36fbd2a82d3896488c8a4f343d..059efc1bacdef1e94c72b107bf598a4c27343a3a 100644 (file)
 #ifndef __vtkClosePolyData_h
 #define __vtkClosePolyData_h
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
 #include "vtkPolyDataToPolyDataFilter.h"
+#else
+#include "vtkPolyDataAlgorithm.h"
+#endif
+
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
 class vtkClosePolyData : public vtkPolyDataToPolyDataFilter
+#else
+class vtkClosePolyData : public vtkPolyDataAlgorithm
+#endif
 {
 public:
   static vtkClosePolyData *New();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
   vtkTypeRevisionMacro(vtkClosePolyData,vtkPolyDataToPolyDataFilter);
+#else
+  vtkTypeMacro(vtkClosePolyData,vtkPolyDataToPolyDataFilter);
+#endif
   void PrintSelf(ostream& os, vtkIndent indent);
 
 protected:
   vtkClosePolyData();
   ~vtkClosePolyData();
 
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
   // Usual data generation method
   void Execute();
+#else
+  int ProcessRequest(  vtkInformation *request, 
+                                               vtkInformationVector **inputVector, 
+                                               vtkInformationVector *outputVector);    
+#endif
+
 
 private:
   vtkClosePolyData(const vtkClosePolyData&);  // Not implemented.
index 1d2279bc37547c0eedd5e12b64454c95cabf924b..b8eb9ac42cfc243816cc490f2a316b8cbbf40204 100644 (file)
@@ -127,7 +127,15 @@ class wxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInter
                                 const wxSize &size = wxDefaultSize,
                                 long style = wxWANTS_CHARS | wxNO_FULL_REPAINT_ON_RESIZE,
                                 const wxString &name = wxPanelNameStr);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     vtkTypeRevisionMacro(wxVTKRenderWindowInteractor,vtkRenderWindowInteractor);
+#else
+    vtkTypeMacro(wxVTKRenderWindowInteractor,vtkRenderWindowInteractor);
+#endif
+
     static wxVTKRenderWindowInteractor * New();
     void PrintSelf(ostream& os, vtkIndent indent);
 
index 8c13f8b907d4369013f66bc96ef55da00e4ad308..d706e325ce8f256166da2edfbc6946bd98bd6323 100644 (file)
@@ -94,10 +94,18 @@ public:
 
       if (event == vtkCommand::ResetWindowLevelEvent)
         {
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         this->IV->GetInput()->UpdateInformation();
         this->IV->GetInput()->SetUpdateExtent
           (this->IV->GetInput()->GetWholeExtent());
         this->IV->GetInput()->Update();
+#else
+       //..
+#endif
+
         double *range = this->IV->GetInput()->GetScalarRange();
         this->IV->SetColorWindow(range[1] - range[0]);
         this->IV->SetColorLevel(0.5 * (range[1] + range[0]));