Commit 405898d4 authored by saubatn's avatar saubatn
Browse files

FEATURE 193 Properties updated.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@1615 ec899d31-69d1-42ba-9299-647d76f65fb3
parent b4e75674
......@@ -24,11 +24,17 @@
****************************************************************************/
#include "GradientMagnitudeRecursiveGaussian.h"
// CamiTK includes
#include <Application.h>
#include <ItkProgressObserver.h>
#include <Property.h>
// Qt includes
#include <QMessageBox>
#include <QString>
#include <QTextStream>
// ITK includes
#include <itkImageToVTKImageFilter.h>
#include <itkVTKImageToImageFilter.h>
#include <itkGradientMagnitudeRecursiveGaussianImageFilter.h>
......@@ -42,10 +48,11 @@ GradientMagnitudeRecursiveGaussian::GradientMagnitudeRecursiveGaussian(ActionExt
// Setting name, description and input component
setName("Gradient Magnitude With Smoothing");
setDescription("<br>Differentiation is an ill-defined operation over digital data.<br> \
In practice it is convenient to define a scale in which the differentiation should be performed. This is usually done by preprocessing the data with a smoothing filter. <br> \
It has been shown that a Gaussian kernel is the most choice for performing such smoothing. By choosing a particular value for the standard deviation <i>(sigma)</i> of the Gaussian, an associated scale is selected that ignores high frequency content, commonly considered image noise. <br> \
This filter computes the magnitude of the image gradient at each pixel location.<br> \
<b>The computational process is equivalent to first smoothing the image by convolving it with a Gaussian kernel and then applying a differential operator.</b> The user selects the value of <i>sigma</i>. Internally this is done by applying an IIR filter that approximates a convolution with the derivative of the Gaussian kernel. Traditional convolution will produce a more accurate result, but the IIR approach is much faster, especially using large <i>sigma</i>s (Deriche1990,Deriche1993).<br> \
In practice it is convenient to define a scale in which the differentiation should be performed. This is usually done by preprocessing the data with a smoothing filter. <br/><br/> \
It has been shown that a Gaussian kernel is the most choice for performing such smoothing. By choosing a particular value for the standard deviation <i>(sigma)</i> of the Gaussian, an associated scale is selected that ignores high frequency content, commonly considered image noise. <br/><br/> \
This filter computes the magnitude of the image gradient at each pixel location.<br/><br/> \
<b>The computational process is equivalent to first smoothing the image by convolving it with a Gaussian kernel and then applying a differential operator.</b> <br/><br/> \
The user selects the value of <i>sigma</i>. Internally this is done by applying an IIR filter that approximates a convolution with the derivative of the Gaussian kernel. Traditional convolution will produce a more accurate result, but the IIR approach is much faster, especially using large <i>sigma</i>s (Deriche1990,Deriche1993).<br/><br/> \
<i>(source: ITK Developer's Guide)</i><br>");
setComponent("ImageComponent");
......@@ -58,7 +65,11 @@ GradientMagnitudeRecursiveGaussian::GradientMagnitudeRecursiveGaussian(ActionExt
this->addTag("Smoothing");
// Setting parameters default values
setProperty("sigma", QVariant(3.0));
Property* standardDeviationProperty = new Property(tr("Standard deviation"), 3.0 ,tr("The standard deviation <i>(sigma)</i> is used as a parameter of the Gaussian convolution kernel. \nThe higher the deviation is, the blurer the resulting image will be."), "");
standardDeviationProperty->setAttribute("minimum", 0);
standardDeviationProperty->setAttribute("maximum", 100);
standardDeviationProperty->setAttribute("singleStep", 0.1);
addParameter(standardDeviationProperty);
}
// --------------- destructor -------------------
......@@ -77,7 +88,7 @@ Action::ApplyStatus GradientMagnitudeRecursiveGaussian::apply() {
void GradientMagnitudeRecursiveGaussian::process(ImageComponent * comp) {
// Get the parameters
sigma = property("sigma").toDouble();
sigma = property("Standard deviation").toDouble();
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment