};
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
//------------------------------------------------------------
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()
void Convolution::setFactor(double factor)
{
- _factor = (factor/100.0)*5.0;
+
+// _factor = (factor/100.0)*5.0;
+ _factor = factor;
}
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);
#endif
//_cast->SetOutputScalarTypeToDouble();
_cast->Update();
- }
- else
- {
+ } else {
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_cast->SetInput(_image);