]> Creatis software - bbtk.git/commitdiff
#3107 BBTK Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Thu, 20 Jul 2017 16:59:11 +0000 (18:59 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Thu, 20 Jul 2017 16:59:11 +0000 (18:59 +0200)
13 files changed:
packages/vtk/src/bbtkSimpleUtilities.h
packages/vtk/src/bbvtkAutoCrop.cxx
packages/vtk/src/bbvtkBinaryOperations.cxx
packages/vtk/src/bbvtkCSVReader.cxx
packages/vtk/src/bbvtkCleanExternalPlane.cxx
packages/vtk/src/bbvtkConcatImages.cxx
packages/vtk/src/bbvtkCreateImage.cxx
packages/vtk/src/bbvtkExtractVtkImageFilter.cxx
packages/vtk/src/bbvtkFlip.cxx
packages/vtk/src/bbvtkImageBoundaries.cxx
packages/vtk/src/bbvtkImageCastToUShort.cxx
packages/vtk/src/bbvtkImagePlanes.cxx
packages/vtk/src/bbvtkImageVtkProperties.cxx

index 067af425a2743d138bdd84c447aa921d08c5b9b9..f0b0372b60487c58ef9d7d73fe3b005b9ff072df 100755 (executable)
@@ -68,11 +68,20 @@ public:
                //Se pregunta al OS el tamanio de la palabra de un apuntador
                int palabra = sizeof(T);
                db = vtkImageData::New();
-               db->SetScalarType(Memcache::darTipo(palabra));
                db->SetDimensions(x,y,z);
                db->SetOrigin(0, 0, 0);
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+               db->SetScalarType(Memcache::darTipo(palabra));
                db->AllocateScalars();
                db->Update();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               db->AllocateScalars(Memcache::darTipo(palabra),1);
+#endif
+
+
        }
        void* get(int x, int y, int z)
        {
index 00635e9c4db318a9be60f7af24b44f693e53b223..26d928e04905630fd6421513f4c31981d74f79d8 100644 (file)
@@ -58,9 +58,17 @@ void AutoCrop::Process()
        int sizeX,sizeY,sizeZ;
 
        if (bbGetInputIn()!=NULL){
-               bbGetInputIn()->Update();
                int ext[6];
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+               bbGetInputIn()->Update();
                bbGetInputIn()->GetWholeExtent(ext);
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               bbGetInputIn()->GetExtent(ext);
+#endif
+
                sizeX=ext[1]-ext[0]+1;
                sizeY=ext[3]-ext[2]+1;
                sizeZ=ext[5]-ext[4]+1;
@@ -71,12 +79,23 @@ void AutoCrop::Process()
 //             {
                        _newImage = vtkImageData::New();
                        _newImage->Initialize();
-                       _newImage->SetScalarType( bbGetInputIn()->GetScalarType() );
                        _newImage->SetSpacing( bbGetInputIn()->GetSpacing() );
-                       _newImage->SetNumberOfScalarComponents( bbGetInputIn()->GetNumberOfScalarComponents() );
                        _newImage->SetDimensions(  sizeX,sizeY,sizeZ );
+
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                    _newImage->SetWholeExtent(0,sizeX-1,0,sizeY-1,0,sizeZ-1);
+                       _newImage->SetNumberOfScalarComponents( bbGetInputIn()->GetNumberOfScalarComponents() );
+                       _newImage->SetScalarType( bbGetInputIn()->GetScalarType() );
                        _newImage->AllocateScalars();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+                   _newImage->SetExtent(0,sizeX-1,0,sizeY-1,0,sizeZ-1);
+                       _newImage->AllocateScalars(bbGetInputIn()->GetScalarType(),1);
+#endif
+
+
 //             }
        
 
index f58c6ecd642af8bb16c110e4717fcb350b54d98a..106ceb27eb8c33530d01012d2f4e9c746fa2c363 100644 (file)
@@ -54,15 +54,25 @@ void BinaryOperations::Process()
                return;
        }
 
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
        ope->SetInput1((vtkDataObject*)bbGetInputIn1());
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       ope->SetInput1Data((vtkDataObject*)bbGetInputIn1());
+#endif
 
        if (bbGetInputIn2() != NULL)
        {
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                ope->SetInput2((vtkDataObject*)bbGetInputIn2());
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               ope->SetInput2Data((vtkDataObject*)bbGetInputIn2());
+#endif
 
-       }
-       else
-       {
+       } else {
            std::cout << "Set In2" << std::endl;
         return;
        }
index 6db94bb551ef20b5a29c65a184556565d6c1b137..e7db21ea400e158b50d43b562d8c3ecdc3e6865c 100755 (executable)
@@ -121,7 +121,6 @@ vtkImageData* CSVReader::createImage(std::vector< std::vector<double> > info, in
        //original->GetOrigin(origin);
        //original->GetDimensions(newDim);
 
-       final->SetScalarType(scalar_type);
 
        //final->SetSpacing(space);
        newDim[0] = x;
@@ -133,8 +132,17 @@ vtkImageData* CSVReader::createImage(std::vector< std::vector<double> > info, in
        origin[2] = 0;
        final->SetOrigin(origin);
 
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+       final->SetScalarType(scalar_type);
        final->AllocateScalars();
        final->Update();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       final->AllocateScalars(scalar_type,1);
+#endif
+
 
        for (int i=0; i<newDim[0]; i++){
                for (int j=0; j<newDim[1]; j++){
index 618f2b0eace65dc9d16e913cdda2f6ecde7c0f1c..80caf30829cf4c1e742028bb48cf54ee7f9ddb0d 100644 (file)
@@ -44,7 +44,14 @@ void CleanExternalPlane::CleanTypeA(vtkImageData* image)
                int i,j;
                int ext[6];
                int dim[3];
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                image->GetWholeExtent(ext);
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               image->GetExtent(ext);
+#endif
                
                dim[0]=ext[1]-ext[0]+1;
                dim[1]=ext[3]-ext[2]+1;
@@ -85,11 +92,17 @@ void CleanExternalPlane::CleanTypeA(vtkImageData* image)
 //----------------------------------------------------------------------
 void CleanExternalPlane::CleanTypeB()
 {
-
        int             ext[6]; 
        int             dimA[3];        
        int             dimB[3];        
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
        bbGetInputIn()->GetWholeExtent(ext);
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       bbGetInputIn()->GetExtent(ext);
+#endif
 
        dimA[0] =       ext[1]-ext[0]+1;
        dimA[1] =       ext[3]-ext[2]+1;
@@ -101,10 +114,17 @@ void CleanExternalPlane::CleanTypeB()
 
        
        imageoutput->Initialize();
-       imageoutput->SetScalarType( bbGetInputIn()->GetScalarType() );  
        imageoutput->SetSpacing( bbGetInputIn()->GetSpacing() );
        imageoutput->SetDimensions(  dimB[0], dimB[1], dimB[2] );
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+       imageoutput->SetScalarType( bbGetInputIn()->GetScalarType() );  
        imageoutput->AllocateScalars();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       imageoutput->AllocateScalars( bbGetInputIn()->GetScalarType() , 1);
+#endif
        
 
        int j,k;
@@ -115,9 +135,18 @@ void CleanExternalPlane::CleanTypeB()
                for (k=0;k<dimA[2];k++)
                {
                        memcpy(   imageoutput->GetScalarPointer(1,j+1,k+1) , bbGetInputIn()->GetScalarPointer(0,j,k) , sizeBlock );
-               }
-       }
+               } // for k
+       } // for j
+
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
        imageoutput->Update();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       // ..
+#endif
+
        imageoutput->Modified();
 }
 
index 1367ec761bf1ad6fa23e6274539ac27d1cfde41c..cac0843f01cb91aa90a33871e55978adfb3ec9fc 100644 (file)
@@ -89,17 +89,17 @@ namespace bbvtk
  ///  - supposes *all* the images are consistent (same type, same number of components, same pixel type)
  ///  - if images in the vector are already 3D, exports only the first one. ?!?  // JPR
  ///
-   void ConcatImages::Process()
-   {
-        int dim[3];
-        int curDim[3];
+void ConcatImages::Process()
+{
+       int dim[3];
+       int curDim[3];
        int nbComponents;
        int scalarType;
        int nb = (unsigned int)bbGetInputIn().size();
 //     int consistentNb(nb);
        int newSizeZ;
 
-        if (nb == 0) {
+    if (nb == 0) {
           // ??? JPR
        } 
        
@@ -111,40 +111,36 @@ namespace bbvtk
           mConcat = bbGetInputIn()[0];
           //mConcat->PrintSelf(std::cout, vtkIndent(2));
        } else {
-          // We suppose *all* the images within the directory are consistent (same sizeS, same pixel Type?...)
-          vtkImageData * firstImage = bbGetInputIn()[0];
+               // We suppose *all* the images within the directory are consistent (same sizeS, same pixel Type?...)
+               vtkImageData * firstImage = bbGetInputIn()[0];
           
-                 //std::cout << "--------PrintSelf firstImage " << std::endl;
-                 // firstImage->PrintSelf(std::cout, vtkIndent(2));       
+               //std::cout << "--------PrintSelf firstImage " << std::endl;
+               // firstImage->PrintSelf(std::cout, vtkIndent(2));         
           
-           nbComponents = firstImage->GetNumberOfScalarComponents();
-           mConcat->SetNumberOfScalarComponents(nbComponents);
-          
-          mConcat->SetScalarType(firstImage->GetScalarType( ));
-          scalarType = firstImage->GetScalarType( );
-          mConcat->SetScalarType(scalarType);
+               nbComponents = firstImage->GetNumberOfScalarComponents();
+               scalarType = firstImage->GetScalarType( );
           
-          mConcat->SetSpacing(firstImage->GetSpacing());
+               mConcat->SetSpacing(firstImage->GetSpacing());
           
-          firstImage->GetDimensions(dim);
-          newSizeZ=0;
-          // brute way to perform an ultra-mini consistency check :
-          // First image is supposed to be the reference image,
-          // any unconsistent image is just discarted...
-          for(int i=0; i<nb; i++)
-          {
+               firstImage->GetDimensions(dim);
+               newSizeZ=0;
+               // brute way to perform an ultra-mini consistency check :
+               // First image is supposed to be the reference image,
+               // any unconsistent image is just discarted...
+               for(int i=0; i<nb; i++)
+               {
 
 //EED 2013 oct 29 
 //EED        if ( !CheckConsistency(firstImage, dim, nbComponents, scalarType))
 //EED          consistentNb--;
 
              if ( CheckConsistency(bbGetInputIn()[i], dim, nbComponents, scalarType))
-               {
-                       bbGetInputIn()[i]->GetDimensions(curDim);
-                       newSizeZ = newSizeZ + curDim[2];
-               } // if
+                       {
+                               bbGetInputIn()[i]->GetDimensions(curDim);
+                               newSizeZ = newSizeZ + curDim[2];
+                       } // if
                
-          }    // for
+               }    // for
 
           dim[2]=newSizeZ;
 
@@ -152,8 +148,17 @@ namespace bbvtk
           mConcat->SetDimensions(dim);
           mConcat->SetExtent(0, dim[0]-1, 0, dim[1]-1, 0, dim[2]-1);
                   
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+       mConcat->SetNumberOfScalarComponents(nbComponents);
+          mConcat->SetScalarType(scalarType);
           mConcat->AllocateScalars();
           mConcat->Update();      
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+          mConcat->AllocateScalars(scalarType,nbComponents);
+#endif
                     
           int index_image;
 
@@ -195,8 +200,9 @@ namespace bbvtk
 
    // Devrait etre dans bbUserFinalizeProcessing() ? On n'y entre jamais // JPR        
    bbSetOutputOut(mConcat);    
-   }              
+}                 
 
+//---------------------------------------------------
 bool ConcatImages::CheckConsistency( vtkImageData *curImage, int dim[], int nbComponents, int scalarType )
 {
    assert (curImage);
index 074e9de8a37d013d7a1f10b8ae6963035ab529ff..cb9d77bf0d920e156f4de703db005274e643e7f3 100644 (file)
@@ -53,13 +53,10 @@ void CreateImage::Process()
 //    * TYPE is the C++ type of the input/output
 //      (the one provided in the attribute 'type' of the tag 'input')
 
-       
-
        double  spc[6];
        int             dim[3]; 
        int             outputformat = VTK_UNSIGNED_SHORT;
        
-
        if (bbGetInputOutputFormat()=="VTK_BIT")                                        outputformat = VTK_BIT;                 // 1
        else if (bbGetInputOutputFormat()=="VTK_CHAR")                          outputformat = VTK_CHAR;                                // 2
        else if (bbGetInputOutputFormat()=="MET_CHAR")                          outputformat = VTK_CHAR;                                // 2
@@ -84,7 +81,6 @@ void CreateImage::Process()
        else if (bbGetInputOutputFormat()=="MET_DOUBLE")                        outputformat = VTK_DOUBLE;              // 11  
 
 
-
        spc[0] = bbGetInputSpacing()[0];
        spc[1] = bbGetInputSpacing()[1];
        spc[2] = bbGetInputSpacing()[2];
@@ -94,37 +90,50 @@ void CreateImage::Process()
        dim[2] =  bbGetInputDimensions()[2];
        
        imageoutput->Initialize();
-       imageoutput->SetScalarType( outputformat );     
        imageoutput->SetSpacing( spc );
        imageoutput->SetDimensions(  dim[0], dim[1], dim[2] );
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+       imageoutput->SetScalarType( outputformat );     
        imageoutput->AllocateScalars();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       imageoutput->AllocateScalars( outputformat,1 );
+#endif
        
 
-               int i,j,k;
-               long sizeBlock; 
-
-               for (i=0; i<dim[0]; i++)
-               {
-                       imageoutput->SetScalarComponentFromDouble(i,0,0, 0, bbGetInputInitialValue() );
-               }
-               
-               sizeBlock= dim[0] * imageoutput->GetScalarSize();
-                for (j=1; j<dim[1]; j++)
-               {
-                       memcpy(  imageoutput->GetScalarPointer(0,j,0), imageoutput->GetScalarPointer()  , sizeBlock );
-               }               
-
-               sizeBlock= dim[0] * dim[1] * imageoutput->GetScalarSize();
-               for (k=0; k<dim[2]; k++)
-               {
-                       memcpy(  imageoutput->GetScalarPointer(0,0,k) ,imageoutput->GetScalarPointer()  , sizeBlock );
-               } // for k
-
-               imageoutput->Update();
-               imageoutput->Modified();
-               bbSetOutputOut(imageoutput);
-
+       int i,j,k;
+       long sizeBlock; 
 
+       for (i=0; i<dim[0]; i++)
+       {
+               imageoutput->SetScalarComponentFromDouble(i,0,0, 0, bbGetInputInitialValue() );
+       } // for i
+       
+       sizeBlock= dim[0] * imageoutput->GetScalarSize();
+    for (j=1; j<dim[1]; j++)
+       {
+               memcpy(  imageoutput->GetScalarPointer(0,j,0), imageoutput->GetScalarPointer()  , sizeBlock );
+       } // for j              
+
+       sizeBlock= dim[0] * dim[1] * imageoutput->GetScalarSize();
+       for (k=0; k<dim[2]; k++)
+       {
+               memcpy(  imageoutput->GetScalarPointer(0,0,k) ,imageoutput->GetScalarPointer()  , sizeBlock );
+       } // for k
+
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+       imageoutput->Update();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       // ..
+#endif
+
+       imageoutput->Modified();
+       bbSetOutputOut(imageoutput);
 }      
        
 //===== 
index efbbe227e7eb91a17ed86c540eda84e5d8d409dc..21934235fe84b9e2126d4c9dfa11f49160fcd170 100644 (file)
@@ -49,7 +49,14 @@ void ExtractVtkImageFilter::Process()
        voi[4] = bbGetInputIndex()[2];
        voi[5] = bbGetInputIndex()[2]+bbGetInputSize()[2]-1;
        
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
        _extract->SetInput( bbGetInputIn() );
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       _extract->SetInputData( bbGetInputIn() );
+#endif
+
        _extract->SetVOI(voi);  
        _extract->UpdateWholeExtent();
        _extract->Modified();
index a252888c5a04d9bffdaddef6a76f19e3dab1f7b8..8ec173cf705ed77ca42c8608d625389b9cb9db6e 100644 (file)
@@ -100,16 +100,31 @@ void Flip::Process()
        
                mImageOut = vtkImageData::New();  // Alloc depends on  bbGetInputIn().size()  
                mImageOut->Initialize();
-               mImageOut->SetScalarType(  bbGetInputIn()->GetScalarType() );
                mImageOut->SetSpacing(   bbGetInputIn()->GetSpacing()  );
                mImageOut->SetDimensions(   bbGetInputIn()->GetDimensions()  );
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+               mImageOut->SetScalarType(  bbGetInputIn()->GetScalarType() );
                mImageOut->SetNumberOfScalarComponents( bbGetInputIn()->GetNumberOfScalarComponents() );
                mImageOut->AllocateScalars();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               mImageOut->AllocateScalars(bbGetInputIn()->GetScalarType() , bbGetInputIn()->GetNumberOfScalarComponents());
+#endif
        
                int inputdims[3];
                //   int outputdims[3];
                bbGetInputIn()->GetDimensions (inputdims);
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                bbGetInputIn()->Update();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               // ..
+#endif
+
                int nbScalComp  = bbGetInputIn()->GetNumberOfScalarComponents();
                int scalarSize  = bbGetInputIn()->GetScalarSize();
                int lineSize    = inputdims[0]*scalarSize*nbScalComp;      
index c74a6ec2462f96bf76803d200e51c697be995f48..e947bb36046a60fc60f98339f0f070825d5a1b6f 100644 (file)
@@ -46,7 +46,14 @@ void ImageBoundaries::Process()
                int ext[6];
                double value;
                
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                bbGetInputIn()->GetWholeExtent(ext);
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               bbGetInputIn()->GetExtent(ext);
+#endif
+
                int maxX        = ext[1]-ext[0]+1;
                int maxY        = ext[3]-ext[2]+1;
                int maxZ        = ext[5]-ext[4]+1;
index 6543e0620e721bbb2e5a3ada7b9177460b4d4b04..b27dbb6c5f2a789d13a433962bc033b7c742e17e 100644 (file)
@@ -48,7 +48,15 @@ void ImageCastToUShort::Process()
 //      (the one provided in the attribute 'type' of the tag 'input') 
 
        vtkImageData* img = bbGetInputIn();     
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
        cast->SetInput(img);
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+       cast->SetInputData(img);
+#endif
+
        cast->SetOutputScalarTypeToUnsignedShort();
        cast->Modified();
        cast->Update();
index 92476f5e19b8a01a00719c3c671d8a3063169404..ab91a12db3043fd45badc797730e0ed508ce73cf 100644 (file)
@@ -207,24 +207,56 @@ namespace bbvtk
           // EED MPR view orientation correction..
      vtkImageFlip  *flipYFilter = vtkImageFlip::New();
      flipYFilter->SetFilteredAxis(1); // flip y axis
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
      flipYFilter->SetInput( planeWidgetX->GetResliceOutput() );
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+     flipYFilter->SetInputData( planeWidgetX->GetResliceOutput() );
+#endif
+
      flipYFilter->Update();
 
           vtkImageChangeInformation *image = vtkImageChangeInformation::New();
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
           image->SetInput(  planeWidgetY->GetResliceOutput()  );
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+          image->SetInputData(  planeWidgetY->GetResliceOutput()  );
+#endif
+
           image->SetOutputSpacing( 1,1,1 );       
           image->CenterImageOn();
           image->Update();
           _imageTransform = vtkTransform::New();
           vtkImageReslice *slicer =vtkImageReslice::New();
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
           slicer->SetInput( image->GetOutput() );
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+          slicer->SetInputData( image->GetOutput() );
+#endif
+
           slicer->SetInformationInput( image->GetOutput() );
           slicer->SetResliceTransform( _imageTransform );
           slicer->SetOutputOrigin(0 , 0 , 0 );
           slicer->SetInterpolationModeToNearestNeighbor();
           slicer->Update();       
           vtkImageChangeInformation *imageResult = vtkImageChangeInformation::New();
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
           imageResult->SetInput( slicer->GetOutput() );
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+          imageResult->SetInputData( slicer->GetOutput() );
+#endif
+
           double spc[3];
            planeWidgetY->GetResliceOutput()->GetSpacing(spc);
           imageResult->SetOutputSpacing( spc[1], spc[0], spc[2] ); 
@@ -284,7 +316,14 @@ namespace bbvtk
        {
                int dim[3];
                int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                bbGetOutputPlaneX()->GetResliceOutput()->GetWholeExtent(ext);
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               bbGetOutputPlaneX()->GetResliceOutput()->GetExtent(ext);
+#endif
+
                dim[0] = ext[1]-ext[0]+1;
                dim[1] = ext[3]-ext[2]+1;
                dim[2] = ext[5]-ext[4]+1;
@@ -304,7 +343,14 @@ namespace bbvtk
                        double xSpacing, ySpacing, zSpacing;
                        bbGetInputIn()->GetSpacing(xSpacing, ySpacing, zSpacing);
 
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                        bbGetOutputPlaneX()->SetInput(bbGetInputIn());
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+                       bbGetOutputPlaneX()->SetInputData(bbGetInputIn());
+#endif
+
                        bbGetOutputPlaneX()->SetPlaneOrientationToXAxes();       
                        bbGetOutputPlaneX()->SetSlicePosition((xMax+xMin)/2.*xSpacing);
 
@@ -312,11 +358,25 @@ namespace bbvtk
                        //                 bbGetOutputPlaneX()->SetPoint1( 0*xSpacing, 146*ySpacing, 186*zSpacing);
                        //                 bbGetOutputPlaneX()->SetPoint2( 126*xSpacing, 146*ySpacing, 0*zSpacing);
 
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                        bbGetOutputPlaneY()->SetInput(bbGetInputIn());
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+                       bbGetOutputPlaneY()->SetInputData(bbGetInputIn());
+#endif
+
                        bbGetOutputPlaneY()->SetPlaneOrientationToYAxes();
                        bbGetOutputPlaneY()->SetSlicePosition((yMax+yMin)/2.*ySpacing);
 
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                        bbGetOutputPlaneZ()->SetInput(bbGetInputIn());
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+                       bbGetOutputPlaneZ()->SetInputData(bbGetInputIn());
+#endif
+
                        bbGetOutputPlaneZ()->SetPlaneOrientationToZAxes();
                        bbGetOutputPlaneZ()->SetSlicePosition((zMax+zMin)/2.*zSpacing);
 
@@ -347,9 +407,15 @@ namespace bbvtk
                bbGetOutputPlaneZ()->SetResliceInterpolate( bbGetInputInterpolation() );
 
                
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                bbGetOutputPlaneX()->GetResliceOutput()->Update();
                bbGetOutputPlaneY()->GetResliceOutput()->Update(); 
                bbGetOutputPlaneZ()->GetResliceOutput()->Update();               
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               // ...
+#endif
                
                std::vector<int> pointsx = bbGetInputPointsX();
                std::vector<int> pointsy = bbGetInputPointsY();
@@ -390,7 +456,15 @@ namespace bbvtk
 
        //for the plane widgets
                        vtkImagePlaneWidget* plane3pts = (vtkImagePlaneWidget*)bbGetOutputPlane3Pts();
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                        plane3pts->SetInput(bbGetInputIn());                    
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+                       plane3pts->SetInputData(bbGetInputIn());                        
+#endif
+
                        double xSpacing, ySpacing, zSpacing;
                        bbGetInputIn()->GetSpacing(xSpacing, ySpacing, zSpacing);
                        plane3pts->SetOrigin(pointsx[0]*xSpacing,pointsy[0]*ySpacing,pointsz[0]*zSpacing);      
@@ -400,7 +474,15 @@ namespace bbvtk
                        plane3pts->SetPoint2((origin[0]+vect2[0]*factor)*xSpacing,
                                                                        (origin[1]+vect2[1]*factor)*ySpacing,
                                                                        (origin[2]+vect2[2]*factor)*zSpacing);
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                        plane3pts->GetResliceOutput()->Update();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+                       // ..
+#endif
+
 //To get the slice of image out of the selected volume
                        if (_imageReslicer==NULL){
                                _imageReslicer = vtkImageReslice::New();                                        
@@ -409,15 +491,34 @@ namespace bbvtk
                                _matrix = vtkMatrix4x4::New();  
                        }
                        _imageReslicer->SetInterpolationMode( bbGetInputInterpolation() );
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                        _imageReslicer->SetInput( bbGetInputIn() );
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+                       _imageReslicer->SetInputData( bbGetInputIn() );
+#endif
+
+
                        _imageReslicer->SetInformationInput(bbGetInputIn());    
                        //fill out the information with the created vectors and using the spacing of the image
                        _imageReslicer->SetResliceAxesDirectionCosines(newx[0]*xSpacing,newx[1]*xSpacing,newx[2]*xSpacing,
                                                                        vect2[0]*ySpacing,vect2[1]*ySpacing,vect2[2]*ySpacing,
                                                                        crossp[0]*zSpacing,crossp[1]*zSpacing,crossp[2]*zSpacing);                      
                        _imageReslicer->SetResliceAxesOrigin(origin[0]*xSpacing,origin[1]*ySpacing,origin[2]*zSpacing);
+
+
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
                        _imageReslicer->GetOutput()->Update();
                        _imageReslicer->GetOutput()->UpdateInformation();
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+                       // ..
+#endif
+
+
 
                        bbSetOutputImage3Pts(_imageReslicer->GetOutput());
 
index f9d8b7d1c958362386a3b0471ae5ed9537e621a1..50506435bc6026d0c686b66b98c97fd684551874 100644 (file)
@@ -53,9 +53,16 @@ void ImageVtkProperties::Process()
        if ( bbGetInputIn() )
        {
                bbGetInputIn()->Modified();
-               bbGetInputIn()->Update();
                
+//EED 2017-01-01 Migration VTK7
+#if (VTK_MAJOR_VERSION <= 5) 
+               bbGetInputIn()->Update();
                bbGetInputIn()->GetWholeExtent(ext);
+#endif
+#if (VTK_MAJOR_VERSION >= 6) 
+               bbGetInputIn()->GetExtent(ext);
+#endif
+
                vsize.push_back(ext[1]-ext[0]+1);
                vsize.push_back(ext[3]-ext[2]+1);
                vsize.push_back(ext[5]-ext[4]+1);