]> Creatis software - creaRigidRegistration.git/blobdiff - lib/Convolution.cxx
Merge remote-tracking branch 'origin/vtk8itk5wx3-mingw64' into vtk8itk5wx3-macos
[creaRigidRegistration.git] / lib / Convolution.cxx
index 796a0597d1d20e4b397d9796e178008369ac0032..6014ecd5132ebbe84cebba1f8c96dc38a3f5574d 100644 (file)
@@ -32,9 +32,9 @@
 //------------------------------------------------------------
 Convolution::Convolution()
 {
-       _image=NULL;
-       _convolve = vtkImageConvolve::New();
-       _cast = vtkImageCast::New();
+       _image          = NULL;
+       _convolve       = vtkImageConvolve::New();
+       _cast           = vtkImageCast::New();
 }
 
 /*
@@ -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,8 @@ 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 +76,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 +89,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);
@@ -99,5 +98,5 @@ void Convolution::Run()
 #endif
                _cast->SetOutputScalarType(_image->GetScalarType());
                _cast->Update();
-       }       
+       } // if _on
 }