]> Creatis software - creaRigidRegistration.git/commitdiff
#3271 creaRigidRegistration Bug New Normal - Convolution
authorEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Wed, 3 Jul 2019 14:27:43 +0000 (16:27 +0200)
committerEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Wed, 3 Jul 2019 14:27:43 +0000 (16:27 +0200)
PackRecalage/src/bbPackRecalageImageConvolution.h
lib/Convolution.cxx

index 5e1754324814693c8417e9871746207d8dd96ea7..873805c2f1e2e342344f961bae0b432652f20afe 100644 (file)
@@ -53,14 +53,17 @@ class bbPackRecalage_EXPORT ImageConvolution
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageConvolution,bbtk::AtomicBlackBox);
-BBTK_NAME("ImageConvolution");
-BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
-BBTK_DESCRIPTION("Processes an image through different convolution matrix (Edge detect)");
-BBTK_CATEGORY("filter");
-BBTK_INPUT(ImageConvolution,In,"Image to be filetered",vtkImageData*,"");
-BBTK_INPUT(ImageConvolution,Factor,"Factor by how the edges will be represented",double,"");
-BBTK_INPUT(ImageConvolution,On,"Boolean that represents if the filter is turned on. True = On.",bool,"");
-BBTK_OUTPUT(ImageConvolution,Out,"Filtered Image",vtkImageData*,"");
+  BBTK_NAME("ImageConvolution");
+  BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
+  BBTK_DESCRIPTION("Processes an image through different convolution matrix (Edge detect)");
+  BBTK_CATEGORY("filter");
+
+  BBTK_INPUT(ImageConvolution,In,"Image to be filetered",vtkImageData*,"");
+  BBTK_INPUT(ImageConvolution,Factor,"Factor by how the edges will be represented",double,"");
+  BBTK_INPUT(ImageConvolution,On,"(default false) Boolean that represents if the filter is turned on. True = On.",bool,"");
+
+  BBTK_OUTPUT(ImageConvolution,Out,"Filtered Image",vtkImageData*,"");
+
 BBTK_END_DESCRIBE_BLACK_BOX(ImageConvolution);
 }
 // EO namespace bbPackRecalage
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);