]> Creatis software - creaRigidRegistration.git/commitdiff
#3113 crea Rigid Registration Bug New Normal - branch vtk7itk4 compilation with... vtk7itk4 vtk7itk4wx3 vtk7itk4wx3-mingw64 vtk9itk4wx3-macos
authorEduardo DAVILA <davila@localhost.localdomain>
Mon, 7 Aug 2017 14:33:12 +0000 (16:33 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Mon, 7 Aug 2017 14:33:12 +0000 (16:33 +0200)
PackRecalage/src/bbPackRecalageReSlicerBox.cxx
PackRecalage/src/bbPackRecalageResampleBox.cxx
lib/CheckBoard.cpp
lib/Convolution.cxx
lib/MyGridOnImageGenerator.cpp
lib/Substraction.cxx
lib/Surface.cxx
lib/Transparency.cxx

index 984f4549b516ecd42adb04886e9f2f7deecaf3da..c501128b3ad2f2403c7f2889fc4a323dcbfc1a7e 100644 (file)
@@ -81,7 +81,12 @@ void ReSlicerBox::Process()
        if(!bbGetInputOrigin().empty()  && bbGetInputTransform() != NULL)
        {
                //image = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                image->SetInput( bbGetInputIn() );
+#else
+               image->SetInputData( bbGetInputIn() );
+#endif
                image->SetOutputSpacing( 1,1,1 );
 
                if(bbGetInputCentered())
@@ -97,7 +102,12 @@ void ReSlicerBox::Process()
                        GetBackInfo(backInfoA,bbGetInputTransform()->GetMatrix(),bbGetInputOrigin() );
 
                        //slicer =vtkImageReslice::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        slicer->SetInput( image->GetOutput() );
+#else
+                       slicer->SetInputData( image->GetOutput() );
+#endif
                        slicer->SetInformationInput( image->GetOutput() );
                        slicer->SetResliceTransform(bbGetInputTransform());
                        slicer->SetOutputOrigin( -(bbGetInputOrigin()[0]) , -(bbGetInputOrigin()[1]) , -(bbGetInputOrigin()[2]) );
@@ -109,7 +119,12 @@ void ReSlicerBox::Process()
                        slicer->Update();
 
                        //imageResult = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        imageResult->SetInput( slicer->GetOutput() );
+#else
+                       imageResult->SetInputData( slicer->GetOutput() );
+#endif
                        double spc[3];
                        bbGetInputIn()->GetSpacing(spc);
                        imageResult->SetOutputSpacing( spc ); 
index d4d4f78e3f49e6fd1d99ecd7d54b62c81aaf8997..2dd312603e16ac34898b6af1d383e6173e45ea9c 100644 (file)
@@ -36,7 +36,13 @@ void ResampleBox::Process()
     if(bbGetInputIn() != NULL && bbGetInputFactor() != 0)
        {
                double factor = bbGetInputFactor();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                resample->SetInput(bbGetInputIn());
+#else
+               resample->SetInputData(bbGetInputIn());
+#endif
+
                resample->SetAxisMagnificationFactor(0, factor);
                resample->SetAxisMagnificationFactor(1, factor);
                resample->SetAxisMagnificationFactor(2, factor);
index f47c94c180672e44fe78dfb108c8822fc97a8540..08fa729fab2323686e69d07fb9d54ffe9969b048 100644 (file)
@@ -104,31 +104,64 @@ void CheckBoard::calculateImage()
                result = vtkImageData::New();
                if(numPixelsImg1<numPixelsImg2)
                {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        resample->SetInput(image1);
+#else
+                       resample->SetInputData(image1);
+#endif
                        factorX = (double)extImg2[1]/extImg1[1];
                        factorY = (double)extImg2[3]/extImg1[3];
                        resample->SetAxisMagnificationFactor(0,factorX);
                        resample->SetAxisMagnificationFactor(1,factorY);
                        resample->SetInformationInput(image2);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       resample->Update();
+#else
+                       // ..
+#endif
 
                        initialize(dimImg2, spcImg2);
                        result = resample->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        result->Update();
+#else
+                       // ..
+#endif
+
                        createImage(result,image2,dimImg2[0],dimImg2[1]);               
                } //if
                else if (numPixelsImg1>numPixelsImg2)
                {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        resample->SetInput(image2);
+#else
+                       resample->SetInputData(image2);
+#endif
                        factorX = (double)extImg1[1]/extImg2[1];
                        factorY = (double)extImg1[3]/extImg2[3];
                        resample->SetAxisMagnificationFactor(0,factorX);
                        resample->SetAxisMagnificationFactor(1,factorY);
                        resample->SetInformationInput(image1);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       // ..
+#else
+                       resample->Update();
+#endif
 
                        initialize(dimImg1, spcImg1);
                        result = resample->GetOutput();
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        result->Update();
+#else
+                       // ..
+#endif
 
                        createImage(image1,result,dimImg1[0],dimImg1[1]);
                } // else if
@@ -136,17 +169,33 @@ void CheckBoard::calculateImage()
                {
                        //If both images have the same number of pixels, the resultant image will have the 
                        //properties of the first image.
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        resample->SetInput(image2);
+#else
+                       resample->SetInputData(image2);
+#endif
                        factorX = (double)extImg1[1]/extImg2[1];
                        factorY = (double)extImg1[3]/extImg2[3];
                        resample->SetAxisMagnificationFactor(0,factorX);
                        resample->SetAxisMagnificationFactor(1,factorY);
                        resample->SetInformationInput(image1);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       // ..
+#else
+                       resample->Update();
+#endif
 
                        initialize(dimImg1, spcImg1);
 
                        result = resample->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        result->Update();
+#else
+  //...
+#endif
 
                        createImage(image1,result,dimImg1[0],dimImg1[1]);
 
@@ -165,11 +214,18 @@ void CheckBoard::initialize(int dimensions[], double spacing[])
                        newImage->Delete();
        }
        newImage = vtkImageData::New();
-       newImage->SetScalarType(type);
        newImage->SetSpacing(spacing);
        newImage->SetDimensions(dimensions);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       newImage->SetScalarType(type);
        newImage->AllocateScalars();
        newImage->Update();
+#else
+       newImage->AllocateScalars(type,1);
+#endif
+
 }
 
 //------------------------------------------------------------
@@ -279,7 +335,13 @@ void CheckBoard::createImage(vtkImageData *img1, vtkImageData *img2, int sizeX,
        }
 
        //std::cout << "The image has been checkboardized!" << std::endl;
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
    newImage->Update();
+#else
+   newImage->Modified();
+#endif
+
 //   newImage->Modified();
 }
 /**Template used for the different image types
index adddb961ec87ce30c678d2d82bfa9d4b1c0101bd..796a0597d1d20e4b397d9796e178008369ac0032 100644 (file)
@@ -55,7 +55,12 @@ vtkImageData *Convolution::getImage()
 void Convolution::setImage(vtkImageData *image)
 {
        _image = image;
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _convolve->SetInput(_image);
+#else
+       _convolve->SetInputData(_image);
+#endif
 }
 
 void Convolution::setFactor(double factor)
@@ -75,13 +80,23 @@ void Convolution::Run()
                double kernel[] = {0.0,1.0,0.0,1.0,-_factor,1.0,0.0,1.0,0.0};
                _convolve->SetKernel3x3(kernel);
                _convolve->Update();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _cast->SetInput(_convolve->GetOutput());
+#else
+               _cast->SetInputData(_convolve->GetOutput());
+#endif
                //_cast->SetOutputScalarTypeToDouble();
                _cast->Update();
        }
        else
        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                _cast->SetInput(_image);
+#else
+               _cast->SetInputData(_image);
+#endif
                _cast->SetOutputScalarType(_image->GetScalarType());
                _cast->Update();
        }       
index 91e5ff41cd2f57edfd5c4bf734ff6b840f9eeec4..b997d0e39e6cacc8898f50482529ccaad39d232e 100755 (executable)
@@ -91,7 +91,12 @@ vtkImageData* MyGridOnImageGenerator::getGridOnImage( )
 
        vtkImageData* gridImage = vtkImageData::New();
        gridImage->ShallowCopy(image);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        gridImage->Update();
+#else
+       gridImage->Modified();
+#endif
 
        //Get image spacing, size and mix and max values
        gridImage->GetSpacing(spc);
index b6f50690dc612ca1ad2482e2c39673e0cfe174a7..734a06ca6baacb3896fc65b022d1a5ddb8d7e69a 100644 (file)
@@ -120,11 +120,17 @@ void Substraction::substractImage(vtkImageData* imageData1, vtkImageData* imageD
 void Substraction::initialize(int dimensions[], double spacing[])
 {
        //setting image data of the imageResult
-       imageResult->SetScalarType(imageType);
        imageResult->SetSpacing(spacing);
        imageResult->SetDimensions(dimensions);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       imageResult->SetScalarType(imageType);
        imageResult->AllocateScalars();
        imageResult->Update();
+#else
+       imageResult->AllocateScalars(imageType,1);
+#endif
+
 }
 
 /*
index 0933cfdc6c494f201b16687621d1eb8b645d1255..5f4f710c4ac59a7c2fec39802c5fdd7129a2ee8e 100644 (file)
@@ -206,10 +206,20 @@ void Surface::surface(vtkImageData* imageData)
        vtkPolyData* surfaceData = vtkPolyData::New();
        surfaceData->SetPolys(surfaceCells);
        surfaceData->SetPoints(surfacePoints);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        surfaceData->Update();
+#else
+       // ..
+#endif
 
        vtkPolyDataMapper* surfaceMapper = vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        surfaceMapper->SetInput(surfaceData);
+#else
+       surfaceMapper->SetInputData(surfaceData);
+#endif
        surfaceMapper->Update();
 
     surfaceResult->SetMapper(surfaceMapper);
index 15d46fe2abcec7cf42ee27b4736c02f139d9387c..874968555fb68b43109df524653f919f25abfe5c 100644 (file)
@@ -88,7 +88,12 @@ void Transparency::calculateImage()
                vtkImageData *result;
                if(numPixelsImg1<numPixelsImg2)
                {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        resample->SetInput(_image1);
+#else
+                       resample->SetInputData(_image1);
+#endif
                        factorX = (double)extImg2[1]/extImg1[1];
                        factorY = (double)extImg2[3]/extImg1[3];
                        resample->SetAxisMagnificationFactor(0,factorX);
@@ -96,14 +101,31 @@ void Transparency::calculateImage()
                        resample->SetInformationInput(_image2);
 
                        initialize(dimImg2, spcImg2);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       //..
+#else
+                       resample->Update();
+#endif
+
                        result = resample->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        result->Update();
+#else
+                       //...
+#endif
                        createImage(result,_image2,dimImg2[0],dimImg2[1]);              
                        
                } //if
                else if (numPixelsImg1>numPixelsImg2)
                {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        resample->SetInput(_image2);
+#else
+                       resample->SetInputData(_image2);
+#endif
                        factorX = (double)extImg1[1]/extImg2[1];
                        factorY = (double)extImg1[3]/extImg2[3];
                        resample->SetAxisMagnificationFactor(0,factorX);
@@ -111,9 +133,21 @@ void Transparency::calculateImage()
                        resample->SetInformationInput(_image1);
 
                        initialize(dimImg1, spcImg1);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       // ...
+#else
+                       resample->Update();
+#endif
                        result = resample->GetOutput();
                        
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        result->Update();
+#else
+                       result->Modified();
+#endif
 
                        createImage(_image1,result,dimImg1[0],dimImg1[1]);
                } // else if
@@ -121,17 +155,33 @@ void Transparency::calculateImage()
                {
                        //If both images have the same number of pixels, the resultant image will have the 
                        //properties of the first image.
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        resample->SetInput(_image2);
+#else
+                       resample->SetInputData(_image2);
+#endif
                        factorX = (double)extImg1[1]/extImg2[1];
                        factorY = (double)extImg1[3]/extImg2[3];
                        resample->SetAxisMagnificationFactor(0,factorX);
                        resample->SetAxisMagnificationFactor(1,factorY);
                        resample->SetInformationInput(_image1);
-
                        initialize(dimImg1, spcImg1);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                       // ...
+#else
+                       resample->Update();
+#endif
 
                        result = resample->GetOutput();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        result->Update();
+#else
+                       result->Modified();
+#endif
                        
                        createImage(_image1,result,dimImg1[0],dimImg1[1]);
 
@@ -146,11 +196,17 @@ void Transparency::initialize(int dimensions[], double spacing[])
 {
        // Setting the new image
        _newImage = vtkImageData::New();
-       _newImage->SetScalarType(_type);
        _newImage->SetSpacing(spacing);
        _newImage->SetDimensions(dimensions);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       _newImage->SetScalarType(_type);
        _newImage->AllocateScalars();
        _newImage->Update();
+#else
+       _newImage->AllocateScalars(_type,1);
+#endif
+
 
 }
 
@@ -258,7 +314,14 @@ void Transparency::createImage(vtkImageData *img1, vtkImageData *img2, int sizeX
                createImageByType(dataImagePointer1, dataImagePointer2, dataImageResultPointer, img1, img2, sizeX, sizeY);
        }
 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _newImage->Update();
+#else
+       _newImage->Modified();
+#endif
+
+
 }
 
 template <class T>