]> Creatis software - creaMaracasVisu.git/commitdiff
#3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Wed, 2 Aug 2017 15:18:51 +0000 (17:18 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Wed, 2 Aug 2017 15:18:51 +0000 (17:18 +0200)
13 files changed:
lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.cxx
lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.h
lib/Kernel/VTKObjects/SurfaceRenderer/wxMaracasSurfaceRenderingManagerData.cxx
lib/Kernel/VTKObjects/SurfaceRenderer/wxMaracasSurfaceRenderingManagerDataMhd.cxx
lib/maracasVisuLib/src/CutModule/interface/vtkInteractorStyleCutter.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelPolygon.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageInfoUR.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.cxx
lib/maracasVisuLib/src/kernel/marDynData.cpp
lib/maracasVisuLib/src/kernel/vtkSTLExtractor.cpp

index 5b7473843715a932269b3da5b6cd45cdca4a5485..15d7bdb1cdbdda2840ffc356199232dcac428456 100644 (file)
@@ -50,18 +50,29 @@ void SurfaceRenderingImageStencilExport::Update(){
 
 void SurfaceRenderingImageStencilExport::Execute(vtkImageData *data){
 
-    vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
-
     vtkSmartPointer<vtkPolyDataToImageStencil> polytostencil = vtkSmartPointer<vtkPolyDataToImageStencil>::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+    vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
     polytostencil->SetInput(polydata);
+#else
+    vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
+    polytostencil->SetInputData(polydata);
+#endif
     polytostencil->Update();
 
     double *bounds = polydata->GetBounds();
     vtkSmartPointer<vtkImageData> imagein = vtkSmartPointer<vtkImageData>::New();
 
     imagein->SetExtent(bounds[0] - 1, bounds[1] + 1, bounds[2] - 1, bounds[3] + 1, bounds[4] - 1, bounds[5] + 1);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     imagein->SetScalarTypeToUnsignedShort();    
     imagein->AllocateScalars();
+#else
+    imagein->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
 
 
     int* extent = imagein->GetExtent();
@@ -76,8 +87,16 @@ void SurfaceRenderingImageStencilExport::Execute(vtkImageData *data){
     }
 
     vtkSmartPointer<vtkImageStencil> stencil = vtkSmartPointer<vtkImageStencil>::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
     stencil->SetInput(imagein);
     stencil->SetStencil(polytostencil->GetOutput());
+#else
+    stencil->SetInputData(imagein);
+    stencil->SetStencilData(polytostencil->GetOutput());
+#endif
+
     stencil->ReverseStencilOn();
     stencil->SetBackgroundValue(128);
     stencil->Update();
index 94b8ee3dfd8a943f3d0f66486540a94286e6e914..86d4f7d9347bd0e9125385948f8d371fb8c74548 100644 (file)
 #ifndef SURFACERENDERINGIMAGESTENCILEXPORT_H
 #define SURFACERENDERINGIMAGESTENCILEXPORT_H
 
-#include <vtkDataSetToImageFilter.h>
+
+#include <vtkImageData.h>
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+  #include <vtkDataSetToImageFilter.h>
+#else
+  // ..
+#endif
+
 #include <vtkSmartPointer.h>
 #include <vtkPolyDataToImageStencil.h>
 #include <vtkImageStencil.h>
-#include <vtkImageData.h>
 #include <vtkPolyData.h>
 
 class SurfaceRenderingImageStencilExport : public vtkDataSetToImageFilter
index 18ff1c1097c340ad3cbd5a20da5917c0acb245df..8214c12af211f56254e8d59247e0d9e8aeb9bdfc 100644 (file)
@@ -91,7 +91,13 @@ vtkProp3D* wxMaracasSurfaceRenderingManagerData::getProp3D(std::string filename)
         }
 
         _dataMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         _dataMapper->SetInput(polydata);
+#else
+        _dataMapper->SetInputData(polydata);
+#endif
 
         vtkActor* dataActor = vtkActor::New();
         dataActor->SetMapper(_dataMapper);
@@ -195,20 +201,35 @@ void wxMaracasSurfaceRenderingManagerData::saveProp3DSTL(const char* filename){
             vtkSmartPointer<vtkPLYWriter> plywriter =
             vtkSmartPointer<vtkPLYWriter>::New();
               plywriter->SetFileName(filename);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
               plywriter->SetInput(_dataMapper->GetInput());
+#else
+              plywriter->SetInputData(_dataMapper->GetInput());
+#endif
               plywriter->Write();
         }else if(ext.compare(STL) == 0){
             vtkSmartPointer<vtkSTLWriter> stlWriter =
             vtkSmartPointer<vtkSTLWriter>::New();
               stlWriter->SetFileName(filename);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
               stlWriter->SetInput(_dataMapper->GetInput());
+#else
+              stlWriter->SetInputData(_dataMapper->GetInput());
+#endif
               stlWriter->SetFileTypeToBinary();
               stlWriter->Write();
         }else if(ext.compare(VTK) == 0){
             vtkSmartPointer<vtkPolyDataWriter> polydataWriter =
             vtkSmartPointer<vtkPolyDataWriter>::New();
               polydataWriter->SetFileName(filename);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
               polydataWriter->SetInput(_dataMapper->GetInput());
+#else
+              polydataWriter->SetInputData(_dataMapper->GetInput());
+#endif
               polydataWriter->SetFileTypeToBinary();
               polydataWriter->Write();
         }else{
@@ -224,13 +245,23 @@ void wxMaracasSurfaceRenderingManagerData::enableBoxWidget(bool enable){
 void wxMaracasSurfaceRenderingManagerData::exportImageStencil(const char* filename){
     if(_dataMapper){
         vtkSmartPointer< SurfaceRenderingImageStencilExport> stencilexport = vtkSmartPointer< SurfaceRenderingImageStencilExport >::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         stencilexport->SetInput( _dataMapper->GetInput());
+#else
+        stencilexport->SetInputData( _dataMapper->GetInput());
+#endif
         stencilexport->Update();
         vtkImageData* imgstencil = stencilexport->GetOutput();
 
         vtkSmartPointer<vtkMetaImageWriter> metawriter = vtkSmartPointer<vtkMetaImageWriter>::New();
         metawriter->SetFileName(filename);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         metawriter->SetInput(imgstencil);
+#else
+        metawriter->SetInputData(imgstencil);
+#endif
         metawriter->Write();
     }else{
         cout<<"No poly data set to data mapper."<<endl;
index 2e3f64ff3286cba702d61e439300cc8f2109ecf9..5396f21bca18be4ebce31c87e12c456d9673cbda 100644 (file)
@@ -39,22 +39,42 @@ wxMaracasSurfaceRenderingManagerDataMhd::wxMaracasSurfaceRenderingManagerDataMhd
        _prop3D=NULL;                   
 
         _tresholdFilter = vtkImageThreshold::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         _tresholdFilter->SetInput(this->_imagedata);
+#else
+        _tresholdFilter->SetInputData(this->_imagedata);
+#endif
         _tresholdFilter->SetInValue(255);        
         _tresholdFilter->SetOutValue(0);
 
 
        _cubesFilter = vtkMarchingCubes::New(); 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         _cubesFilter->SetInput(_tresholdFilter->GetOutput());
+#else
+        _cubesFilter->SetInputData(_tresholdFilter->GetOutput());
+#endif
         //_cubesFilter->ComputeGradientsOn();
         _cubesFilter->ComputeScalarsOn();
         _cubesFilter->ComputeNormalsOn();
         _cubesFilter->SetNumberOfContours( 1 );
        _cleanFilter = vtkCleanPolyData::New();         
-       _cleanFilter->SetInput ( _cubesFilter->GetOutput() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       _cleanFilter->SetInput( _cubesFilter->GetOutput() );
+#else
+       _cleanFilter->SetInputData( _cubesFilter->GetOutput() );
+#endif
 
         _smooth = vtkSmoothPolyDataFilter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         _smooth->SetInput(_cleanFilter->GetOutput());
+#else
+        _smooth->SetInputData(_cleanFilter->GetOutput());
+#endif
         _smooth->SetNumberOfIterations(6);
         _smooth->SetRelaxationFactor(0.3);
         //_smooth->FeatureEdgeSmoothingOff();
@@ -70,16 +90,31 @@ wxMaracasSurfaceRenderingManagerDataMhd::wxMaracasSurfaceRenderingManagerDataMhd
             _boxWidgetS1->SetInteractor( interactor );
             _boxWidgetS1->SetPlaceFactor(1.25);
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
             _boxWidgetS1->SetInput( this->_imagedata );
+#else
+            _boxWidgetS1->SetInputData( this->_imagedata );
+#endif
             _boxWidgetS1->PlaceWidget();
             boxSurfaceObserver* observer = boxSurfaceObserver::New();
 
             vtkStripper* striper = vtkStripper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
             striper->SetInput( _smooth->GetOutput() );
+#else
+            striper->SetInputData( _smooth->GetOutput() );
+#endif
             //striper->SetInput( _cleanFilter->GetOutput() );
 
             striper->Update();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
             _boxWidgetS1->SetInput(striper->GetOutput());
+#else
+            _boxWidgetS1->SetInputData(striper->GetOutput());
+#endif
             //_boxWidgetS1->PlaceWidget();
 
 
@@ -94,10 +129,20 @@ wxMaracasSurfaceRenderingManagerDataMhd::wxMaracasSurfaceRenderingManagerDataMhd
             _boxWidgetS1->GetPlanes( _tissuePlanes );
 
             _tissueClipper = vtkClipPolyData::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
             _tissueClipper->SetInput( striper->GetOutput() );
+#else
+            _tissueClipper->SetInputData( striper->GetOutput() );
+#endif
             _tissueClipper->SetClipFunction( _tissuePlanes );
             _tissueClipper->InsideOutOn( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
             _dataMapper->SetInput( _tissueClipper->GetOutput() );
+#else
+            _dataMapper->SetInputData( _tissueClipper->GetOutput() );
+#endif
             observer->SetPlanes( _tissuePlanes );
             observer->SetActor( dataActor );
             _boxWidgetS1->AddObserver( vtkCommand::InteractionEvent             , observer );
@@ -107,7 +152,12 @@ wxMaracasSurfaceRenderingManagerDataMhd::wxMaracasSurfaceRenderingManagerDataMhd
             _boxWidgetS1->EnabledOff();
        }else{          
                 //_dataMapper->SetInput(_cleanFilter->GetOutput());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
             _dataMapper->SetInput(_smooth->GetOutput());
+#else
+            _dataMapper->SetInputData(_smooth->GetOutput());
+#endif
        }
        
        dataActor->SetMapper(_dataMapper);      
index 10b680f881591961e3cf2a6b84aad0861d19574c..b118ce09a032292da29a0b5023e5a51f9313df1a 100644 (file)
 #include <vtkProperty2D.h>
 #include <vtkCamera.h>
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
 vtkCxxRevisionMacro(vtkInteractorStyleCutter, "$Revision: 1.2 $");
+#else
+// ..
+#endif
 vtkStandardNewMacro(vtkInteractorStyleCutter);
 
 //----------------------------------------------------------------------------
@@ -72,7 +77,12 @@ vtkInteractorStyleCutter::vtkInteractorStyleCutter()
   pd->SetLines( Lines );
    
   vtkPolyDataMapper2D *bboxMapper = vtkPolyDataMapper2D::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
   bboxMapper->SetInput( pd );
+#else
+  bboxMapper->SetInputData( pd );
+#endif
    
   this->BboxActor = vtkActor2D::New();
   this->BboxActor->SetMapper( bboxMapper );
index 95e1234b460b7390183964a3a7751c98e6f65203..ccd36989a479e62849484c255e0a17ff5b793999 100644 (file)
@@ -168,12 +168,29 @@ void CutModelData::ShowViewBox(bool check)throw( CutModelException){
 void CutModelData::ChangeShape(int selection)throw( CutModelException){
        checkInvariant();
        
-       if(selection == 0){
+       if(selection == 0)
+       {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _Mapper->SetInput(_spherefigure->getPolyData());
+#else
+               _Mapper->SetInputData(_spherefigure->getPolyData());
+#endif
        }else if(selection == 1){
+
+#if VTK_MAJOR_VERSION <= 5
                _Mapper->SetInput(_cylinderfigure->getPolyData());
+#else
+               _Mapper->SetInputData(_cylinderfigure->getPolyData());
+#endif
+
        }else if(selection == 2){
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _Mapper->SetInput(_cubefigure->getPolyData());
+#else
+               _Mapper->SetInputData(_cubefigure->getPolyData());
+#endif
        }else{
                throw CutModelException("Shape type not found");
        }
index 17c633a2d85df361d7174369edb3541c1f352e3f..05e92d879559024a916ed787b3334c773ca60227 100644 (file)
@@ -84,8 +84,12 @@ void CutModelManager::setImageData(vtkImageData* img){
                _img2 = vtkImageData::New();
                _img2->SetExtent(_img->GetExtent());
                _img2->SetSpacing(_img->GetSpacing());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _img2->AllocateScalars();
-
+#else
+  //...
+#endif
                _img2->DeepCopy(_img);
        }
        else
@@ -98,7 +102,12 @@ void CutModelManager::setImageData(vtkImageData* img){
                _img = vtkImageData::New();
                _img->SetExtent(_img2->GetExtent());
                _img->SetSpacing(_img2->GetSpacing());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _img->AllocateScalars();
+#else
+  //...
+#endif
 
                _img->DeepCopy(_img2);
        }
@@ -401,13 +410,23 @@ void CutModelManager::UpdatePolygon(bool mode)
                        sample->CappingOn();                    
 
                        contour = vtkContourFilter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        contour->SetInput((vtkDataObject *)sample->GetOutput());
+#else
+                       contour->SetInputData((vtkDataObject *)sample->GetOutput());
+#endif
                        contour->SetValue(0,1);
 
                        actor = contour->GetOutput();
 
                        actor3D = vtkActor::New();                      
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        mapper->SetInput(actor);                         
+#else
+                       mapper->SetInputData(actor);                     
+#endif
                        mapper->SetScalarModeToUseCellData();
                        actor3D->SetMapper( mapper);
                        _render->AddActor(actor3D);                     
index 4908c725a1d176a09b904027b9f69174689b55d7..1f7482fc50dab29386a3bfd147df03cba095f487 100644 (file)
@@ -115,7 +115,12 @@ void CutModelPolygon::cutInputImage(std::vector<double> vectorOutX,std::vector<d
        initializeOutputImage();
 
        int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _inImage->GetWholeExtent(ext);
+#else
+       _inImage->GetExtent(ext);
+#endif
        int dimX=ext[1]-ext[0]+1;
        int dimY=ext[3]-ext[2]+1;
        int dimZ=ext[5]-ext[4]+1;
@@ -183,7 +188,12 @@ void CutModelPolygon::cutInputImage(std::vector<double> vectorOutX,std::vector<d
        }// for i
 
        _inImage->Modified();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _inImage->Update();
+#else
+       // ..
+#endif
 
 }
 
index 46b6fe6fc001581f3eaaec6b45133bf28df64dd5..06c9eeafdb0b1386c2d41451f2d3d6b90260507f 100644 (file)
@@ -67,7 +67,14 @@ CutModelSaveBinInfo::~CutModelSaveBinInfo(){
 void CutModelSaveBinInfo::savePolyData(vtkPolyData* polydata){
        vtkPolyDataWriter * writer = vtkPolyDataWriter ::New();
        writer->SetFileName(_stdFilename.c_str());      
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        writer->SetInput(polydata);
+#else
+       writer->SetInputData(polydata);
+#endif
+
        writer->SetFileTypeToBinary();
        writer->Write();
        writer->Delete();
@@ -80,7 +87,12 @@ vtkTransform* CutModelSaveBinInfo::getPolyDataTransform()throw( CutModelExceptio
        vtkPolyData* poly = reader->GetOutput();
 
        vtkPolyDataMapper* mapper       = vtkPolyDataMapper::New();     
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        mapper->SetInput(poly);
+#else
+       mapper->SetInputData(poly);
+#endif
        vtkActor* actor = vtkActor::New();
        actor->SetMapper(mapper);
        vtkMatrix4x4* actmatrix = actor->GetMatrix();
index 1945d318318644aafea2def163daea17ef27ff67..3e39e532942506600d6d26e3760dddad875f0881 100755 (executable)
@@ -91,13 +91,30 @@ void ImageInfoUR::LoadImagesToMemory(const StringType& gPath) {
                        VTKMetaImageReaderPointerType::New();
        readerUndo->SetFileName(undoImagePath.c_str());
        this->m_UndoImage = readerUndo->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        this->m_UndoImage->Update();
+#else
+       // ..
+#endif
        //Loading Redo Image
        VTKMetaImageReaderPointerType readerRedo =
                        VTKMetaImageReaderPointerType::New();
        readerRedo->SetFileName(redoImagePath.c_str());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       // ..
+#else
+       readerRedo->Update();
+#endif
+
        this->m_RedoImage = readerRedo->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        this->m_RedoImage->Update();
+#else
+       // ...
+#endif
        //Updating status
        this->m_OnMemory = true;
 }
@@ -135,7 +152,12 @@ void ImageInfoUR::RemoveImagesFromDisk(const StringType& gPath) {
 void ImageInfoUR::SaveImageAsMHD(const StringType& filename,
                VTKImageDataPointerType image) {
        VTKMetaImageWriterPointerType w = VTKMetaImageWriterPointerType::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        w->SetInput(image);
+#else
+       w->SetInputData(image);
+#endif
        w->SetCompression(false);
        w->SetFileDimensionality(image->GetDataDimension());
        w->SetFileName(filename.c_str());
index ab2219edbe40fe24aaaef4fd9efb43b7578f71e0..4e981c4e89e18d2bb35d4e7efd1be201636324db 100755 (executable)
@@ -70,7 +70,14 @@ void ImageUndoRedo::Redo( )
 void ImageUndoRedo::SetImage( VTKImageDataPointerType image )
 {
        this->m_CurrentImage = image;
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        this->m_CurrentImage->Update( );
+#else
+       // ..
+#endif
+
        this->UpdateUndoImage( );
 }
 // ----------------------------------------------------------------------------------
@@ -97,10 +104,20 @@ void ImageUndoRedo::SetURImages( ImageMManagerType* imMManager )
 // ----------------------------------------------------------------------------------
 void ImageUndoRedo::UpdateUndoImage( )
 {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        this->m_CurrentImage->Update( );
+#else
+       // ...
+#endif
        this->m_UndoImage = VTKImageDataPointerType::New( );
        this->m_UndoImage->DeepCopy( m_CurrentImage );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        this->m_UndoImage->Update( );
+#else
+       // ..
+#endif
 }
 // ----------------------------------------------------------------------------------
 ImageUndoRedo::VTKImageDataPointerType ImageUndoRedo::GetImageRegion(
@@ -110,9 +127,21 @@ ImageUndoRedo::VTKImageDataPointerType ImageUndoRedo::GetImageRegion(
        extract->SetVOI( region.minX, region.maxX, region.minY, region.maxY,
                region.minZ, region.maxZ );
        extract->SetSampleRate( 1, 1, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        extract->SetInput( img );
+#else
+       extract->SetInputData( img );
+#endif
        VTKImageDataPointerType imgResult = extract->GetOutput( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        imgResult->Update( );
+#else
+       // ..
+#endif
+
        return ( imgResult );
 }
 // ----------------------------------------------------------------------------------
index 8ef4b5f483a69ea248de28a2f66024f7303f18c3..663036071f571def1353848c349f826b96543d04 100644 (file)
@@ -69,7 +69,12 @@ void marDynData::loadData( kVolume* vol, int* voi )
    reset( );
  
    vtkExtractVOI *crop = vtkExtractVOI::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
    crop->SetInput( vol->castVtk( ) );
+#else
+   crop->SetInputData( vol->castVtk( ) );
+#endif
 
    crop->SetVOI( voi );
    //crop->SetSampleRate( getParameters( )->getVoxelSize( ), getParameters( )->getVoxelSize( ), getParameters( )->getVoxelSize( ));
@@ -82,13 +87,23 @@ void marDynData::loadData( kVolume* vol, int* voi )
 //     RescalaIntercept        = 0;
 
    vtkImageShiftScale *scale = vtkImageShiftScale::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
    scale->SetInput( crop->GetOutput( ) );
+#else
+   scale->SetInputData( crop->GetOutput( ) );
+#endif
    scale->SetScale(RescalaSlope);
    scale->SetShift(0);
    scale->SetOutputScalarTypeToShort();
    scale->Update();
    vtkImageShiftScale *shift = vtkImageShiftScale::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
    shift->SetInput( scale->GetOutput( ) );
+#else
+   shift->SetInputData( scale->GetOutput( ) );
+#endif
    shift->SetScale(1); 
    shift->SetShift(RescalaIntercept);
    shift->SetOutputScalarTypeToShort();
@@ -96,7 +111,12 @@ void marDynData::loadData( kVolume* vol, int* voi )
 
 
    vtkImageThreshold *threshold = vtkImageThreshold::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
    threshold->SetInput( shift->GetOutput( ) );
+#else
+   threshold->SetInputData( shift->GetOutput( ) );
+#endif
    threshold->ThresholdByUpper (-10000); 
    threshold->ThresholdByLower (-1); 
    threshold->SetInValue(0);   
@@ -105,7 +125,12 @@ void marDynData::loadData( kVolume* vol, int* voi )
    threshold->SetOutputScalarTypeToUnsignedShort();
    
    vtkImageResample* ir = vtkImageResample::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
    ir->SetInput( threshold->GetOutput( ) );
+#else
+   ir->SetInputData( threshold->GetOutput( ) );
+#endif
    ir->SetDimensionality( 3 );
    double voxelSize= getParameters( )->getVoxelSize( );
    ir->SetAxisOutputSpacing( 0, voxelSize );
@@ -127,7 +152,13 @@ void marDynData::loadData( kVolume* vol, int* voi )
    * Before we were using kgfoCrop which assume extent start at 0,0,0
    */
    vtkImageChangeInformation* change = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
    change->SetInput( ir->GetOutput() );
+#else
+   change->SetInputData( ir->GetOutput() );
+#endif
+
    change->SetExtentTranslation( -ext[0], -ext[2], -ext[4] );
    change->SetOutputSpacing ( voxelSize , voxelSize , voxelSize );
    change->Update();    //important
index 586a801a6e33db7e29c8c194a4b0c35a8215589c..4b3981c9adb66973fdd7d98c834a00e2c95df8c6 100644 (file)
@@ -84,12 +84,22 @@ void vtkSTLExtractor::calculate(){
                //  1. CALCULATING THE INNER SURFACE
                // ------------------------------------------------------------------------
            vtkImageGaussianSmooth *gaussFilter = vtkImageGaussianSmooth::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         gaussFilter->SetInput(volume);
+#else
+        gaussFilter->SetInputData(volume);
+#endif
         gaussFilter->SetDimensionality(3);
        gaussFilter->SetStandardDeviation(sigmaLevel);
     
         vtkMarchingCubes *cubesFilter = vtkMarchingCubes::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         cubesFilter->SetInput(gaussFilter->GetOutput());
+#else
+        cubesFilter->SetInputData(gaussFilter->GetOutput());
+#endif
         cubesFilter->SetValue(0,marchingCubesLevel);
                cubesFilter->ComputeGradientsOn ();
         cubesFilter->ComputeScalarsOn ();
@@ -97,11 +107,21 @@ void vtkSTLExtractor::calculate(){
            
                // Unir puntos duplicados y remover primitivas degeneradas
                vtkCleanPolyData *cleanFilter = vtkCleanPolyData::New();
-        cleanFilter->SetInput ( cubesFilter->GetOutput() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+        cleanFilter->SetInput( cubesFilter->GetOutput() );
+#else
+        cleanFilter->SetInputData( cubesFilter->GetOutput() );
+#endif
                
                // crea poligonos triangulares
         vtkTriangleFilter *triangleFilter = vtkTriangleFilter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
         triangleFilter->SetInput( cleanFilter->GetOutput() );
+#else
+        triangleFilter->SetInputData( cleanFilter->GetOutput() );
+#endif
         triangleFilter->Update();
 
                innerSurface->DeepCopy(triangleFilter->GetOutput());
@@ -111,9 +131,19 @@ void vtkSTLExtractor::calculate(){
                //  2. CALCULATING THE OUTER SURFACE
                // ------------------------------------------------------------------------
                vtkImageContinuousDilate3D *dilateFilter = vtkImageContinuousDilate3D ::New();
-        dilateFilter->SetInput (volume);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+        dilateFilter->SetInput(volume);
+#else
+        dilateFilter->SetInputData(volume);
+#endif
                dilateFilter->SetKernelSize (3, 3, 3);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                gaussFilter->SetInput( dilateFilter->GetOutput());
+#else
+               gaussFilter->SetInputData( dilateFilter->GetOutput());
+#endif
         triangleFilter->Update();
                
            outerSurface->DeepCopy(triangleFilter->GetOutput());