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 @@ ...@@ -24,11 +24,17 @@
****************************************************************************/ ****************************************************************************/
#include "GradientMagnitudeRecursiveGaussian.h" #include "GradientMagnitudeRecursiveGaussian.h"
// CamiTK includes
#include <Application.h> #include <Application.h>
#include <ItkProgressObserver.h> #include <ItkProgressObserver.h>
#include <Property.h>
// Qt includes
#include <QMessageBox> #include <QMessageBox>
#include <QString> #include <QString>
#include <QTextStream> #include <QTextStream>
// ITK includes
#include <itkImageToVTKImageFilter.h> #include <itkImageToVTKImageFilter.h>
#include <itkVTKImageToImageFilter.h> #include <itkVTKImageToImageFilter.h>
#include <itkGradientMagnitudeRecursiveGaussianImageFilter.h> #include <itkGradientMagnitudeRecursiveGaussianImageFilter.h>
...@@ -42,10 +48,11 @@ GradientMagnitudeRecursiveGaussian::GradientMagnitudeRecursiveGaussian(ActionExt ...@@ -42,10 +48,11 @@ GradientMagnitudeRecursiveGaussian::GradientMagnitudeRecursiveGaussian(ActionExt
// Setting name, description and input component // Setting name, description and input component
setName("Gradient Magnitude With Smoothing"); setName("Gradient Magnitude With Smoothing");
setDescription("<br>Differentiation is an ill-defined operation over digital data.<br> \ 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> \ 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> \ 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> \ 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> 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> \ <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>"); <i>(source: ITK Developer's Guide)</i><br>");
setComponent("ImageComponent"); setComponent("ImageComponent");
...@@ -58,7 +65,11 @@ GradientMagnitudeRecursiveGaussian::GradientMagnitudeRecursiveGaussian(ActionExt ...@@ -58,7 +65,11 @@ GradientMagnitudeRecursiveGaussian::GradientMagnitudeRecursiveGaussian(ActionExt
this->addTag("Smoothing"); this->addTag("Smoothing");
// Setting parameters default values // 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 ------------------- // --------------- destructor -------------------
...@@ -77,7 +88,7 @@ Action::ApplyStatus GradientMagnitudeRecursiveGaussian::apply() { ...@@ -77,7 +88,7 @@ Action::ApplyStatus GradientMagnitudeRecursiveGaussian::apply() {
void GradientMagnitudeRecursiveGaussian::process(ImageComponent * comp) { void GradientMagnitudeRecursiveGaussian::process(ImageComponent * comp) {
// Get the parameters // Get the parameters
sigma = property("sigma").toDouble(); sigma = property("Standard deviation").toDouble();
// ITK filter implementation using templates // ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData(); 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