From: trillos Date: Thu, 15 Oct 2009 11:28:07 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: CREATOOLS.2-0-3~43 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a0ae9765a70eedd429f4865158c75501e72951a0;p=creaRigidRegistration.git *** empty log message *** --- diff --git a/lib/Convolution.cxx b/lib/Convolution.cxx index ac83f16..450df87 100644 --- a/lib/Convolution.cxx +++ b/lib/Convolution.cxx @@ -37,12 +37,26 @@ void Convolution::setFactor(double factor) _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 diff --git a/lib/Convolution.h b/lib/Convolution.h index 5de8819..3be90f8 100644 --- a/lib/Convolution.h +++ b/lib/Convolution.h @@ -17,6 +17,7 @@ class Convolution void setImage(vtkImageData *image); void setFactor(double factor); + void setOn(bool on); void Run(); @@ -34,5 +35,6 @@ class Convolution //Casting Filter vtkImageCast *_cast; -}; + bool _on; +}; \ No newline at end of file