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 87128406 authored by Jean-Loup Haberbusch's avatar Jean-Loup Haberbusch
Browse files

UPDATED Code formatted according CGL astyle command

parent 3c8ef521
......@@ -46,10 +46,10 @@ class ITKFILTER_API AnisotropicDiffusion : public camitk::Action {
public:
/// Define the possible implementations of Gaussian filtering
enum AnisoDiffType {GRADIENT, CURVATURE};
// prefers Q_ENUM to Q_ENUMS if possible (Qt >= 5.5)
Q_ENUMS( AnisoDiffType )
Q_ENUMS(AnisoDiffType)
/// Default Constructor
AnisotropicDiffusion(camitk::ActionExtension*);
......
......@@ -44,8 +44,8 @@ class ITKFILTER_API Derivative : public camitk::Action {
Q_OBJECT
/// Enumerations
Q_ENUMS( derivativeOrder )
Q_ENUMS( derivativeDirection )
Q_ENUMS(derivativeOrder)
Q_ENUMS(derivativeDirection)
public:
/// The 3 different possible derivative orders
......
......@@ -87,8 +87,8 @@ GaussianFilter::GaussianType GaussianFilter::getType() {
// --------------- apply -------------------
Action::ApplyStatus GaussianFilter::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -180,15 +180,15 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcessStandardGaussian(vtkSmar
vtkToItkFilter->SetInput(img);
// For the filter itself
castFilter->SetInput(vtkToItkFilter->GetOutput());
castFilter->AddObserver( itk::ProgressEvent(), observerCast );
castFilter->AddObserver(itk::ProgressEvent(), observerCast);
filter->SetInput( castFilter->GetOutput());
filter->AddObserver( itk::ProgressEvent(), observerBlur );
filter->SetVariance( this->variance );
filter->SetUseImageSpacing( property("Use Image Spacing").toBool() );
filter->SetInput(castFilter->GetOutput());
filter->AddObserver(itk::ProgressEvent(), observerBlur);
filter->SetVariance(this->variance);
filter->SetUseImageSpacing(property("Use Image Spacing").toBool());
rescaleFilter->SetInput(filter->GetOutput());
rescaleFilter->AddObserver( itk::ProgressEvent(), observerRescale );
rescaleFilter->AddObserver(itk::ProgressEvent(), observerRescale);
// From ITK to VTK
......@@ -244,7 +244,7 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcessIIRGaussian(vtkSmartPoin
observerX->SetCoef(50.0);
observerY->SetCoef(50.0);
observerX->SetStartValue( 0.0);
observerX->SetStartValue(0.0);
observerY->SetStartValue(50.0);
}
else { // dim == 3
......@@ -254,7 +254,7 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcessIIRGaussian(vtkSmartPoin
observerY->SetCoef(33.3);
observerZ->SetCoef(33.3);
observerX->SetStartValue( 0.0);
observerX->SetStartValue(0.0);
observerY->SetStartValue(33.3);
observerZ->SetStartValue(66.6);
}
......@@ -272,21 +272,21 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcessIIRGaussian(vtkSmartPoin
filterX = FilterType::New();
filterX->SetDirection(0);
filterX->SetSigma(this->variance);
filterX->SetOrder( FilterType::ZeroOrder );
filterX->AddObserver( itk::ProgressEvent(), observerX );
filterX->SetOrder(FilterType::ZeroOrder);
filterX->AddObserver(itk::ProgressEvent(), observerX);
filterY = FilterType::New();
filterY->SetDirection(1);
filterY->SetSigma(this->variance);
filterY->SetOrder( FilterType::ZeroOrder );
filterY->AddObserver( itk::ProgressEvent(), observerY );
filterY->SetOrder(FilterType::ZeroOrder);
filterY->AddObserver(itk::ProgressEvent(), observerY);
if (dim == 3) {
filterZ = FilterType::New();
filterZ->SetDirection(2);
filterZ->SetOrder( FilterType::ZeroOrder );
filterZ->SetOrder(FilterType::ZeroOrder);
filterZ->SetSigma(this->variance);
filterZ->AddObserver( itk::ProgressEvent(), observerZ );
filterZ->AddObserver(itk::ProgressEvent(), observerZ);
}
......
......@@ -44,7 +44,7 @@ class ITKFILTER_API GaussianFilter : public camitk::Action {
Q_OBJECT
/// Enumerations
Q_ENUMS( GaussianType )
Q_ENUMS(GaussianType)
public:
......
......@@ -52,8 +52,8 @@ GradientMagnitude::GradientMagnitude(ActionExtension* extension) : Action(extens
// --------------- apply -------------------
Action::ApplyStatus GradientMagnitude::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -62,7 +62,7 @@ Action::ApplyStatus GradientMagnitude::apply() {
void GradientMagnitude::process(ImageComponent* comp) {
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_gradient");
......@@ -109,12 +109,12 @@ vtkSmartPointer<vtkImageData> GradientMagnitude::itkProcess(vtkSmartPointer<vtkI
// --------------------- Plug filters and parameters ---------------------------
// From VTK to ITK
vtkToItkFilter->SetInput(img);
vtkToItkFilter->AddObserver(itk::ProgressEvent(), observer );
vtkToItkFilter->AddObserver(itk::ProgressEvent(), observer);
vtkToItkFilter->Update();
observer->Reset();
gradientFilter->SetInput(vtkToItkFilter->GetOutput());
gradientFilter->AddObserver(itk::ProgressEvent(), observer );
gradientFilter->AddObserver(itk::ProgressEvent(), observer);
gradientFilter->Update();
observer->Reset();
......
......@@ -60,7 +60,7 @@ GradientMagnitudeRecursiveGaussian::GradientMagnitudeRecursiveGaussian(ActionExt
this->addTag("Smoothing");
// Setting parameters default values
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."), "");
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);
......@@ -74,8 +74,8 @@ GradientMagnitudeRecursiveGaussian::~GradientMagnitudeRecursiveGaussian() {
// --------------- apply -------------------
Action::ApplyStatus GradientMagnitudeRecursiveGaussian::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -87,7 +87,7 @@ void GradientMagnitudeRecursiveGaussian::process(ImageComponent* comp) {
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_smoothedGradient");
......@@ -134,13 +134,13 @@ vtkSmartPointer<vtkImageData> GradientMagnitudeRecursiveGaussian::itkProcess(vtk
// --------------------- Plug filters and parameters ---------------------------
// From VTK to ITK
vtkToItkFilter->SetInput(img);
vtkToItkFilter->AddObserver(itk::ProgressEvent(), observer );
vtkToItkFilter->AddObserver(itk::ProgressEvent(), observer);
vtkToItkFilter->Update();
observer->Reset();
gradientFilter->SetInput(vtkToItkFilter->GetOutput());
gradientFilter->SetSigma(sigma);
gradientFilter->AddObserver(itk::ProgressEvent(), observer );
gradientFilter->AddObserver(itk::ProgressEvent(), observer);
gradientFilter->Update();
observer->Reset();
......
......@@ -68,8 +68,8 @@ Laplacian::~Laplacian() {
// --------------- apply -------------------
Action::ApplyStatus Laplacian::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -81,7 +81,7 @@ void Laplacian::process(ImageComponent* comp) {
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_laplacian");
// consider frame policy on new image created
......
......@@ -57,7 +57,7 @@ LaplacianRecursiveGaussian::LaplacianRecursiveGaussian(ActionExtension* extensio
Property* keepOrgVoxelTypeProperty = new Property(tr("Keep original voxel type?"), true, tr("Does the output image have the same voxel type as the input one?"), "");
addParameter(keepOrgVoxelTypeProperty);
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."), "");
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);
......@@ -72,8 +72,8 @@ LaplacianRecursiveGaussian::~LaplacianRecursiveGaussian() {
// --------------- apply -------------------
Action::ApplyStatus LaplacianRecursiveGaussian::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -86,7 +86,7 @@ void LaplacianRecursiveGaussian::process(ImageComponent* comp) {
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_LoG");
......
......@@ -56,8 +56,8 @@ LaplacianSharpening::LaplacianSharpening(ActionExtension* extension) : Action(ex
// --------------- apply -------------------
Action::ApplyStatus LaplacianSharpening::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -66,7 +66,7 @@ Action::ApplyStatus LaplacianSharpening::apply() {
void LaplacianSharpening::process(ImageComponent* comp) {
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_sharpened");
// consider frame policy on new image created
......
......@@ -89,8 +89,8 @@ MeanFilter::~MeanFilter() {
// --------------- apply -------------------
Action::ApplyStatus MeanFilter::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -103,7 +103,7 @@ void MeanFilter::process(ImageComponent* comp) {
this->halfNeighborhoodSizeZ = property("Half neighborhood size along Z").toInt();
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_mean");
// consider frame policy on new image created
......
......@@ -89,8 +89,8 @@ MedianFilter::~MedianFilter() {
// --------------- apply -------------------
Action::ApplyStatus MedianFilter::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -104,7 +104,7 @@ void MedianFilter::process(ImageComponent* comp) {
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_median");
......
......@@ -63,11 +63,11 @@ MorphologicalOperators::MorphologicalOperators(ActionExtension* extension) : Act
addParameter(structuringElementSizeProperty);
Property* morphoTypeProperty = new Property(tr("Image scalar type"), GREY_LEVEL, tr("The image scalar type."), "");
morphoTypeProperty->setEnumTypeName("MorphoType",this);
morphoTypeProperty->setEnumTypeName("MorphoType", this);
addParameter(morphoTypeProperty);
Property* morphoOperationProperty = new Property(tr("Type of operation"), EROSION, tr("Select the desired morphological operation."), "");
morphoOperationProperty->setEnumTypeName("MorphoOperation",this);
morphoOperationProperty->setEnumTypeName("MorphoOperation", this);
addParameter(morphoOperationProperty);
}
......@@ -86,8 +86,8 @@ MorphologicalOperators::MorphoOperation MorphologicalOperators::getMorphoOperati
// --------------- apply -------------------
Action::ApplyStatus MorphologicalOperators::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -99,7 +99,7 @@ void MorphologicalOperators::process(ImageComponent* comp) {
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + suffix);
......@@ -211,10 +211,10 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::binaryErosionFilter(vtkSma
vtkToItkFilter->SetInput(img);
// For the filter itself
filter->SetInput(vtkToItkFilter->GetOutput());
filter->AddObserver ( itk::ProgressEvent(), observer );
filter->AddObserver(itk::ProgressEvent(), observer);
StructuringElementType structuringElement;
structuringElement.SetRadius( structuringElementSize );
structuringElement.SetRadius(structuringElementSize);
structuringElement.CreateStructuringElement();
filter->SetKernel(structuringElement);
......@@ -276,10 +276,10 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::binaryDilationFilter(vtkSm
vtkToItkFilter->SetInput(img);
// For the filter itself
filter->SetInput(vtkToItkFilter->GetOutput());
filter->AddObserver ( itk::ProgressEvent(), observer );
filter->AddObserver(itk::ProgressEvent(), observer);
StructuringElementType structuringElement;
structuringElement.SetRadius( structuringElementSize );
structuringElement.SetRadius(structuringElementSize);
structuringElement.CreateStructuringElement();
filter->SetKernel(structuringElement);
......@@ -348,16 +348,16 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::binaryClosureFilter(vtkSma
vtkToItkFilter->SetInput(img);
// For the filter itself
StructuringElementType structuringElement;
structuringElement.SetRadius( structuringElementSize );
structuringElement.SetRadius(structuringElementSize);
structuringElement.CreateStructuringElement();
dilationFilter->SetInput(vtkToItkFilter->GetOutput());
dilationFilter->AddObserver ( itk::ProgressEvent(), observerDilation );
dilationFilter->AddObserver(itk::ProgressEvent(), observerDilation);
dilationFilter->SetKernel(structuringElement);
dilationFilter->Update();
erosionFilter->SetInput(dilationFilter->GetOutput());
erosionFilter->AddObserver( itk::ProgressEvent(), observerErosion );
erosionFilter->AddObserver(itk::ProgressEvent(), observerErosion);
erosionFilter->SetKernel(structuringElement);
erosionFilter->Update();
......@@ -428,16 +428,16 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::binaryOpeningFilter(vtkSma
vtkToItkFilter->SetInput(img);
// For the filter itself
StructuringElementType structuringElement;
structuringElement.SetRadius( structuringElementSize );
structuringElement.SetRadius(structuringElementSize);
structuringElement.CreateStructuringElement();
erosionFilter->SetInput(vtkToItkFilter->GetOutput());
erosionFilter->AddObserver( itk::ProgressEvent(), observerErosion );
erosionFilter->AddObserver(itk::ProgressEvent(), observerErosion);
erosionFilter->SetKernel(structuringElement);
erosionFilter->Update();
dilationFilter->SetInput(erosionFilter->GetOutput());
dilationFilter->AddObserver ( itk::ProgressEvent(), observerDilation );
dilationFilter->AddObserver(itk::ProgressEvent(), observerDilation);
dilationFilter->SetKernel(structuringElement);
dilationFilter->Update();
......@@ -502,10 +502,10 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::greyLevelErosionFilter(vtk
vtkToItkFilter->SetInput(img);
// For the filter itself
filter->SetInput(vtkToItkFilter->GetOutput());
filter->AddObserver ( itk::ProgressEvent(), observer );
filter->AddObserver(itk::ProgressEvent(), observer);
StructuringElementType structuringElement;
structuringElement.SetRadius( structuringElementSize );
structuringElement.SetRadius(structuringElementSize);
structuringElement.CreateStructuringElement();
filter->SetKernel(structuringElement);
filter->Update();
......@@ -568,10 +568,10 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::greyLevelDilationFilter(vt
vtkToItkFilter->SetInput(img);
// For the filter itself
filter->SetInput(vtkToItkFilter->GetOutput());
filter->AddObserver ( itk::ProgressEvent(), observer );
filter->AddObserver(itk::ProgressEvent(), observer);
StructuringElementType structuringElement;
structuringElement.SetRadius( structuringElementSize );
structuringElement.SetRadius(structuringElementSize);
structuringElement.CreateStructuringElement();
filter->SetKernel(structuringElement);
filter->Update();
......@@ -638,16 +638,16 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::greyLevelClosureFilter(vtk
vtkToItkFilter->SetInput(img);
// For the filter itself
StructuringElementType structuringElement;
structuringElement.SetRadius( structuringElementSize );
structuringElement.SetRadius(structuringElementSize);
structuringElement.CreateStructuringElement();
dilationFilter->SetInput(vtkToItkFilter->GetOutput());
dilationFilter->AddObserver ( itk::ProgressEvent(), observerDilation );
dilationFilter->AddObserver(itk::ProgressEvent(), observerDilation);
dilationFilter->SetKernel(structuringElement);
dilationFilter->Update();
erosionFilter->SetInput(dilationFilter->GetOutput());
erosionFilter->AddObserver( itk::ProgressEvent(), observerErosion );
erosionFilter->AddObserver(itk::ProgressEvent(), observerErosion);
erosionFilter->SetKernel(structuringElement);
erosionFilter->Update();
......@@ -716,16 +716,16 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::greyLevelOpeningFilter(vtk
vtkToItkFilter->SetInput(img);
// For the filter itself
StructuringElementType structuringElement;
structuringElement.SetRadius( structuringElementSize );
structuringElement.SetRadius(structuringElementSize);
structuringElement.CreateStructuringElement();
erosionFilter->SetInput(vtkToItkFilter->GetOutput());
erosionFilter->AddObserver( itk::ProgressEvent(), observerErosion );
erosionFilter->AddObserver(itk::ProgressEvent(), observerErosion);
erosionFilter->SetKernel(structuringElement);
erosionFilter->Update();
dilationFilter->SetInput(erosionFilter->GetOutput());
dilationFilter->AddObserver ( itk::ProgressEvent(), observerDilation );
dilationFilter->AddObserver(itk::ProgressEvent(), observerDilation);
dilationFilter->SetKernel(structuringElement);
dilationFilter->Update();
......
......@@ -48,13 +48,13 @@ class ITKFILTER_API MorphologicalOperators : public camitk::Action {
public:
/// Define the possible types of morphological operations
enum MorphoType {GREY_LEVEL, BINARY};
Q_ENUMS( MorphoType )
Q_ENUMS(MorphoType)
/// Define the possible morphological operations
enum MorphoOperation {EROSION, DILATION, OPENING, CLOSING};
Q_ENUMS( MorphoOperation )
Q_ENUMS(MorphoOperation)
/// Default Constructor
MorphologicalOperators(camitk::ActionExtension*);
......
......@@ -74,8 +74,8 @@ ManualThreshold::~ManualThreshold() {
// --------------- apply -------------------
Action::ApplyStatus ManualThreshold::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -89,8 +89,8 @@ void ManualThreshold::process(ImageComponent* comp) {
// ITK filter implementation using templates
vtkSmartPointer<vtkImageData> inputImage = comp->getImageData();
vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);
vtkSmartPointer<vtkImageData> outputImage = implementProcess(inputImage);
ImageComponent* outputComp = new ImageComponent(outputImage, comp->getName() + "_threshold");
// consider frame policy on new image created
......@@ -137,7 +137,7 @@ vtkSmartPointer<vtkImageData> ManualThreshold::itkProcess(vtkSmartPointer<vtkIma
vtkToItkFilter->SetInput(img);
// For the filter itself
filter->SetInput(vtkToItkFilter->GetOutput());
filter->AddObserver ( itk::ProgressEvent(), observer );
filter->AddObserver(itk::ProgressEvent(), observer);
filter->SetLowerThreshold(lowThreshold);
filter->SetUpperThreshold(highThreshold);
......
......@@ -79,8 +79,8 @@ OtsuFilter::~OtsuFilter() {
// --------------- apply -------------------
Action::ApplyStatus OtsuFilter::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*> ( comp );
foreach (Component* comp, getTargets()) {
ImageComponent* input = dynamic_cast<ImageComponent*>(comp);
process(input);
}
return SUCCESS;
......@@ -289,7 +289,7 @@ vtkSmartPointer<vtkImageData> OtsuFilter::itkProcess(vtkSmartPointer<vtkImageDat
// For the filter itself
filter->SetInput(vtkToItkFilter->GetOutput());
filter->AddObserver ( itk::ProgressEvent(), observer );
filter->AddObserver(itk::ProgressEvent(), observer);
filter->SetOutsideValue(this->outsideValue);
filter->SetInsideValue(this->insideValue);
......
......@@ -59,7 +59,7 @@ RegionGrowing::RegionGrowing(ActionExtension* extension) : Action(extension) {
this->addTag("Growing Region");
this->addTag("Seed Point");
this->addTag("Region Growing");
// Setting the widget containing the parameters
theWidget = NULL;
......@@ -73,16 +73,16 @@ RegionGrowing::~RegionGrowing() {
// --------------- getWidget --------------
QWidget* RegionGrowing::getWidget() {
RegionGrowingWidget* rgWidget = dynamic_cast<RegionGrowingWidget*> (theWidget);
RegionGrowingWidget* rgWidget = dynamic_cast<RegionGrowingWidget*>(theWidget);
//-- create the widget if needed
if (!rgWidget) {
theWidget = new RegionGrowingWidget(this);
rgWidget = dynamic_cast<RegionGrowingWidget*> (theWidget);
rgWidget = dynamic_cast<RegionGrowingWidget*>(theWidget);
}
//-- update the widget with a PickedPixelMap param
rgWidget->updateComponent (dynamic_cast<ImageComponent*> (getTargets().last()));
rgWidget->updateComponent(dynamic_cast<ImageComponent*>(getTargets().last()));
return theWidget;
......@@ -91,9 +91,9 @@ QWidget* RegionGrowing::getWidget() {
// --------------- apply -------------------
Action::ApplyStatus RegionGrowing::apply() {
// check the widget
RegionGrowingWidget* rgWidget = dynamic_cast<RegionGrowingWidget*> (theWidget);
RegionGrowingWidget* rgWidget = dynamic_cast<RegionGrowingWidget*>(theWidget);
// Get the image
ImageComponent* input = dynamic_cast<ImageComponent*> (getTargets().last());
ImageComponent* input = dynamic_cast<ImageComponent*>(getTargets().last());
// this call works only with a GUI (i.e. if theWidget exists)
if ((input == NULL) || (rgWidget == NULL)) {
......@@ -117,7 +117,7 @@ Action::ApplyStatus RegionGrowing::apply() {
Action::ApplyStatus RegionGrowing::apply(int lowThreshold, int highThreshold, QList<QVector3D>* seedPoints,
bool filterBefore, int nbIterations, double timeStep) {
// Get the image
ImageComponent* input = dynamic_cast<ImageComponent*> (getTargets().last());
ImageComponent* input = dynamic_cast<ImageComponent*>(getTargets().last());
// Get the parameters
this->lowThreshold = lowThreshold;
......@@ -135,7 +135,7 @@ Action::ApplyStatus RegionGrowing::apply(int lowThreshold, int highThreshold, QL
void RegionGrowing::process(ImageComponent* comp) {