]> Creatis software - creaRigidRegistration.git/blobdiff - lib/Convolution.cxx
#3271 creaRigidRegistration Bug New Normal - Convolution
[creaRigidRegistration.git] / lib / Convolution.cxx
index 796a0597d1d20e4b397d9796e178008369ac0032..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()
@@ -65,7 +65,9 @@ void Convolution::setImage(vtkImageData *image)
 
 void Convolution::setFactor(double factor)
 {
-       _factor = (factor/100.0)*5.0;   
+
+//     _factor = (factor/100.0)*5.0;   
+       _factor = factor;       
 }
 
 void Convolution::setOn(bool on)
@@ -75,7 +77,7 @@ 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);
@@ -88,9 +90,7 @@ void Convolution::Run()
 #endif
                //_cast->SetOutputScalarTypeToDouble();
                _cast->Update();
-       }
-       else
-       {
+       } else {
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
                _cast->SetInput(_image);