]> Creatis software - creaRigidRegistration.git/blobdiff - lib/Convolution.cxx
*** empty log message ***
[creaRigidRegistration.git] / lib / Convolution.cxx
index 08b32cf4c1eac3f0f1e60a7cb5949567cb0a1cd8..02bf6009be3080c759a21bf238de24e84658424d 100644 (file)
@@ -37,11 +37,26 @@ void Convolution::setFactor(double factor)
        _factor = (factor/100.0)*5.0;   
 }
 
+void Convolution::setOn(bool on)
+{
+       _on = on;
+}
+
 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();
-       _cast->SetInput(_convolve->GetOutput());
-       _cast->SetOutputScalarTypeToDouble();
+       if(_on)
+       {
+               double kernel[] = {0.0,1.0,0.0,1.0,-_factor,1.0,0.0,1.0,0.0};
+               _convolve->SetKernel3x3(kernel);
+               _convolve->Update();
+               _cast->SetInput(_convolve->GetOutput());
+               //_cast->SetOutputScalarTypeToDouble();
+               _cast->Update();
+       }
+       else
+       {
+               _cast->SetInput(_image);
+               _cast->SetOutputScalarType(_image->GetScalarType());
+               _cast->Update();
+       }       
 }
\ No newline at end of file