diff --git a/Example/otbAddition.cxx b/Example/otbAddition.cxx index 592502a5e87818fb6b93d1b588da21f2ba0783fc..619638ac10d0e99b05d59c556d499d063a8c2fb1 100644 --- a/Example/otbAddition.cxx +++ b/Example/otbAddition.cxx @@ -40,8 +40,8 @@ public: private: Addition() { - this->SetName("Addition"); - this->SetDescription("This is a simple application which adds two numbers and print the sum on standard output"); + SetName("Addition"); + SetDescription("This is a simple application which adds two numbers and print the sum on standard output"); } virtual ~Addition() diff --git a/Example/otbSmoothing.cxx b/Example/otbSmoothing.cxx index e7f7eed55eb3d13bab67b864092332f409680f66..e100da3a7c8133eac10ea4d92591afc7588d346e 100644 --- a/Example/otbSmoothing.cxx +++ b/Example/otbSmoothing.cxx @@ -55,8 +55,8 @@ public: private: Smoothing() { - this->SetName("Smoothing"); - this->SetDescription("Apply a smoothing filter to an image"); + SetName("Smoothing"); + SetDescription("Apply a smoothing filter to an image"); } virtual ~Smoothing() @@ -86,7 +86,7 @@ private: SetParameterFloat("type.anidif.timestep", 0.125); SetParameterInt("type.anidif.nbiter", 10); - SetParameterInt("type", 2); + SetParameterString("type", "anidif"); } void DoUpdateParameters() @@ -96,9 +96,9 @@ private: void DoExecute() { - VectorImageType::Pointer inImage = this->GetParameterImage("in"); + VectorImageType::Pointer inImage = GetParameterImage("in"); - switch (this->GetParameterInt("type")) + switch ( GetParameterInt("type") ) { case Smoothing_Mean: { @@ -111,10 +111,11 @@ private: perBand->SetInput(inImage); MeanFilterType::InputSizeType radius; - radius.Fill( this->GetParameterInt("type.mean.radius") ); + radius.Fill( GetParameterInt("type.mean.radius") ); perBand->GetFilter()->SetRadius(radius); + perBand->UpdateOutputInformation(); m_FilterRef = perBand; - this->SetParameterOutputImage("out", perBand->GetOutput()); + SetParameterOutputImage("out", perBand->GetOutput()); } break; case Smoothing_Gaussian: @@ -127,11 +128,12 @@ private: = PerBandDiscreteGaussianFilterType::New(); perBand->SetInput(inImage); - int radius = this->GetParameterInt("type.gaussian.radius"); + int radius = GetParameterInt("type.gaussian.radius"); double variance = static_cast<double>(radius) * radius; perBand->GetFilter()->SetVariance(variance); + perBand->UpdateOutputInformation(); m_FilterRef = perBand; - this->SetParameterOutputImage("out", perBand->GetOutput()); + SetParameterOutputImage("out", perBand->GetOutput()); } break; case Smoothing_Anisotropic: @@ -144,15 +146,15 @@ private: = PerBandGradientAnisotropicDiffusionFilterType::New(); perBand->SetInput(inImage); - int aniDifNbIter = this->GetParameterInt("type.anidif.nbiter"); + int aniDifNbIter = GetParameterInt("type.anidif.nbiter"); perBand->GetFilter()->SetNumberOfIterations(static_cast<unsigned int>(aniDifNbIter)); - float aniDifTimeStep = this->GetParameterFloat("type.anidif.timestep"); + float aniDifTimeStep = GetParameterFloat("type.anidif.timestep"); perBand->GetFilter()->SetTimeStep(static_cast<double>(aniDifTimeStep)); // perBand->GetFilter()->SetConductanceParameter() perBand->UpdateOutputInformation(); m_FilterRef = perBand; - this->SetParameterOutputImage("out", perBand->GetOutput()); + SetParameterOutputImage("out", perBand->GetOutput()); } break; }