From ad68e76374c9325c830d0ba56655073b02d7bfca Mon Sep 17 00:00:00 2001
From: Cedric <cedric.traizet@c-s.fr>
Date: Thu, 10 Jan 2019 11:21:52 +0100
Subject: [PATCH] ENH: added log in the application

---
 .../AppHyperspectral/app/otbEndmemberNumberEstimation.cxx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Modules/Applications/AppHyperspectral/app/otbEndmemberNumberEstimation.cxx b/Modules/Applications/AppHyperspectral/app/otbEndmemberNumberEstimation.cxx
index 2636aab914..0ab2645baa 100644
--- a/Modules/Applications/AppHyperspectral/app/otbEndmemberNumberEstimation.cxx
+++ b/Modules/Applications/AppHyperspectral/app/otbEndmemberNumberEstimation.cxx
@@ -101,7 +101,7 @@ private:
     SetMaximumParameterFloatValue("algo.vd.far",1);
     SetDefaultParameterFloat( "algo.vd.far" , 1.0E-3 );
     SetParameterDescription( "algo.vd.far" , 
-        "False alarm rate for the virtual dimensionality algorithm");
+      "False alarm rate for the virtual dimensionality algorithm");
 
     AddParameter(ParameterType_Int,"number","Number of endmembers");
     SetParameterDescription("number", "Estimated number of endmembers");
@@ -109,7 +109,8 @@ private:
 
     // Doc example parameter settings
     SetDocExampleParameterValue("in", "cupriteSubHsi.tif");
-    SetDocExampleParameterValue("algo", "elm");
+    SetDocExampleParameterValue("algo", "vd");
+    SetDocExampleParameterValue("algo.vd.far", "1.0E-3");
 
     SetOfficialDocLink();
   }
@@ -121,6 +122,7 @@ private:
 
   void DoExecute() override
   {
+    otbAppLogINFO("Computing statistics on input image");
     auto statisticsFilter = StreamingStatisticsVectorImageFilterType::New();
     statisticsFilter->SetInput(GetParameterImage("in"));
 
@@ -129,6 +131,7 @@ private:
     const std::string algorithm = GetParameterString("algo");
     if (algorithm=="elm")
       {
+      otbAppLogINFO("Estimation algorithm : Eigenvalue Likelihood Maximization");
       auto elm = EigenvalueLikelihoodMaximisationType::New();
       elm->SetCovariance(statisticsFilter->GetCovariance().GetVnlMatrix());
       elm->SetCorrelation(statisticsFilter->GetCorrelation().GetVnlMatrix());
@@ -138,6 +141,7 @@ private:
       }
     else if (algorithm=="vd")
       {
+      otbAppLogINFO("Estimation algorithm : Virtual Dimensionality");
       auto vd = VirtualDimensionalityType::New();
       vd->SetCovariance(statisticsFilter->GetCovariance().GetVnlMatrix());
       vd->SetCorrelation(statisticsFilter->GetCorrelation().GetVnlMatrix());
-- 
GitLab