Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit ddeb2a2a 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@1619 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 67ceed0d
......@@ -75,15 +75,15 @@ The <b>parameters</b> are the size of the neighborhood along X, Y and Z directio
addParameter(halfNeighborhoodSizeProp_X);
Property* halfNeighborhoodSizeProp_Y = new Property(tr("Half neighborhood size along Y"), 1, tr("Half the size of the Y direction of the neighborhood taken into account for the mean computation. \nFor instance, a value of 2 will create a windows of size 4 along the Y direction."), "");
halfNeighborhoodSizeProp_X->setAttribute("minimum", 1);
halfNeighborhoodSizeProp_X->setAttribute("maximum", 100);
halfNeighborhoodSizeProp_X->setAttribute("singleStep", 1);
halfNeighborhoodSizeProp_Y->setAttribute("minimum", 1);
halfNeighborhoodSizeProp_Y->setAttribute("maximum", 100);
halfNeighborhoodSizeProp_Y->setAttribute("singleStep", 1);
addParameter(halfNeighborhoodSizeProp_Y);
Property* halfNeighborhoodSizeProp_Z = new Property(tr("Half neighborhood size along Z"), 1, tr("Half the size of the Z direction of the neighborhood taken into account for the mean computation. \nFor instance, a value of 2 will create a windows of size 4 along the Z direction."), "");
halfNeighborhoodSizeProp_X->setAttribute("minimum", 1);
halfNeighborhoodSizeProp_X->setAttribute("maximum", 100);
halfNeighborhoodSizeProp_X->setAttribute("singleStep", 1);
halfNeighborhoodSizeProp_Z->setAttribute("minimum", 1);
halfNeighborhoodSizeProp_Z->setAttribute("maximum", 100);
halfNeighborhoodSizeProp_Z->setAttribute("singleStep", 1);
addParameter(halfNeighborhoodSizeProp_Z);
}
......
......@@ -22,13 +22,18 @@
*
* $CAMITK_LICENCE_END$
****************************************************************************/
// CamiTK includes
#include "MedianFilter.h"
#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 <itkMedianImageFilter.h>
......@@ -63,9 +68,23 @@ The <b>parameters</b> are the size of the neighborhood along X, Y and Z directio
this->addTag("Neighborhood Filter");
// Setting parameters default values
setProperty("halfNeighborhoodSizeX", QVariant(1));
setProperty("halfNeighborhoodSizeY", QVariant(1));
setProperty("halfNeighborhoodSizeZ", QVariant(1));
Property* halfNeighborhoodSizeProp_X = new Property(tr("Half neighborhood size along X"), 1, tr("Half the size of the X direction of the neighborhood taken into account for the mean computation. \nFor instance, a value of 2 will create a windows of size 4 along the X direction."), "");
halfNeighborhoodSizeProp_X->setAttribute("minimum", 1);
halfNeighborhoodSizeProp_X->setAttribute("maximum", 100);
halfNeighborhoodSizeProp_X->setAttribute("singleStep", 1);
addParameter(halfNeighborhoodSizeProp_X);
Property* halfNeighborhoodSizeProp_Y = new Property(tr("Half neighborhood size along Y"), 1, tr("Half the size of the Y direction of the neighborhood taken into account for the mean computation. \nFor instance, a value of 2 will create a windows of size 4 along the Y direction."), "");
halfNeighborhoodSizeProp_Y->setAttribute("minimum", 1);
halfNeighborhoodSizeProp_Y->setAttribute("maximum", 100);
halfNeighborhoodSizeProp_Y->setAttribute("singleStep", 1);
addParameter(halfNeighborhoodSizeProp_Y);
Property* halfNeighborhoodSizeProp_Z = new Property(tr("Half neighborhood size along Z"), 1, tr("Half the size of the Z direction of the neighborhood taken into account for the mean computation. \nFor instance, a value of 2 will create a windows of size 4 along the Z direction."), "");
halfNeighborhoodSizeProp_Z->setAttribute("minimum", 1);
halfNeighborhoodSizeProp_Z->setAttribute("maximum", 100);
halfNeighborhoodSizeProp_Z->setAttribute("singleStep", 1);
addParameter(halfNeighborhoodSizeProp_Z);
}
// --------------- destructor -------------------
......@@ -84,9 +103,9 @@ Action::ApplyStatus MedianFilter::apply() {
void MedianFilter::process(ImageComponent * comp) {
// Get the parameters
halfNeighborhoodSizeX = property("halfNeighborhoodSizeX").toInt();
halfNeighborhoodSizeY = property("halfNeighborhoodSizeY").toInt();
halfNeighborhoodSizeZ = property("halfNeighborhoodSizeZ").toInt();
this->halfNeighborhoodSizeX = property("Half neighborhood size along X").toInt();
this->halfNeighborhoodSizeY = property("Half neighborhood size along Y").toInt();
this->halfNeighborhoodSizeZ = property("Half neighborhood size along Z").toInt();
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
......
Markdown is supported
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