_factor = (factor/100.0)*5.0;
}
-void Convolution::Run()
+void Convolution::setOn(bool 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();
+ _on = on;
}
+void Convolution::Run()
+{
+ 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
void setImage(vtkImageData *image);
void setFactor(double factor);
+ void setOn(bool on);
void Run();
//Casting Filter
vtkImageCast *_cast;
-};
+ bool _on;
+};
\ No newline at end of file