]> Creatis software - creaRigidRegistration.git/blobdiff - lib/Convolution.cxx
#3271 creaRigidRegistration Bug New Normal - Convolution
[creaRigidRegistration.git] / lib / Convolution.cxx
index adddb961ec87ce30c678d2d82bfa9d4b1c0101bd..810ec960280e3bda4c825d5b02821a04edaf70d8 100644 (file)
@@ -43,8 +43,8 @@ Convolution::Convolution()
 //------------------------------------------------------------
 Convolution::~Convolution()
 {
-       if (_convolve != NULL ) { _convolve->Delete(); }
-       if (_cast != NULL ) { _cast->Delete(); }
+       if (_convolve   != NULL ) { _convolve->Delete();        }
+       if (_cast               != NULL ) { _cast->Delete();            }
 }
 
 vtkImageData *Convolution::getImage()
@@ -55,12 +55,19 @@ 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)
 {
-       _factor = (factor/100.0)*5.0;   
+
+//     _factor = (factor/100.0)*5.0;   
+       _factor = factor;       
 }
 
 void Convolution::setOn(bool on)
@@ -70,18 +77,26 @@ void Convolution::setOn(bool on)
 
 void Convolution::Run()
 {
-       if(_on)
+       if(_on==true)
        {
                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
-       {
+       } 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();
        }