From 5bf575f9fc106a33dca4a60caf6ea4f90bca26b7 Mon Sep 17 00:00:00 2001
From: Jordi Inglada <jordi.inglada@cesbio.cnes.fr>
Date: Tue, 3 Oct 2017 16:14:39 +0200
Subject: [PATCH] REFAC: rename classes and files and move some of them to the
 application module

---
 .../app/otbImageDimensionalityReduction.cxx   |   4 +-
 .../app/otbTrainDimensionalityReduction.cxx   |   8 +-
 .../app/otbVectorDimensionalityReduction.cxx  |   3 +-
 ...mensionalityReductionTrainAutoencoder.txx} |  11 +-
 .../otbDimensionalityReductionTrainPCA.txx}   |   6 +-
 .../otbDimensionalityReductionTrainSOM.txx}   |   8 +-
 ...inDimensionalityReductionApplicationBase.h | 170 +++++++++++++++++
 ...imensionalityReductionApplicationBase.txx} |  24 +--
 .../include/SOMModelFactory.txx               |   9 +-
 .../include/cbLearningApplicationBaseDR.h     | 171 ------------------
 ...toencoderModel.h => otbAutoencoderModel.h} |   6 +-
 ...coderModel.txx => otbAutoencoderModel.txx} |  22 +--
 ...Factory.h => otbAutoencoderModelFactory.h} |   2 +-
 ...ory.txx => otbAutoencoderModelFactory.txx} |   8 +-
 ... otbDimensionalityReductionModelFactory.h} |   2 +-
 ...tbDimensionalityReductionModelFactory.txx} |  23 +--
 ...> otbImageDimensionalityReductionFilter.h} |   2 +-
 ...otbImageDimensionalityReductionFilter.txx} |   2 +-
 .../include/{PCAModel.h => otbPCAModel.h}     |   2 +-
 .../include/{PCAModel.txx => otbPCAModel.txx} |   0
 ...PCAModelFactory.h => otbPCAModelFactory.h} |   2 +-
 ...odelFactory.txx => otbPCAModelFactory.txx} |   8 +-
 .../include/{SOMModel.h => otbSOMModel.h}     |   2 +-
 .../include/{SOMModel.txx => otbSOMModel.txx} |   0
 ...SOMModelFactory.h => otbSOMModelFactory.h} |   0
 25 files changed, 239 insertions(+), 256 deletions(-)
 rename Modules/{Learning/DimensionalityReductionLearning/include/cbTrainAutoencoder.txx => Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainAutoencoder.txx} (94%)
 rename Modules/{Learning/DimensionalityReductionLearning/include/cbTrainPCA.txx => Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainPCA.txx} (85%)
 rename Modules/{Learning/DimensionalityReductionLearning/include/cbTrainSOM.txx => Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainSOM.txx} (94%)
 create mode 100644 Modules/Applications/AppDimensionalityReduction/include/otbTrainDimensionalityReductionApplicationBase.h
 rename Modules/{Learning/DimensionalityReductionLearning/include/cbLearningApplicationBaseDR.txx => Applications/AppDimensionalityReduction/include/otbTrainDimensionalityReductionApplicationBase.txx} (77%)
 delete mode 100644 Modules/Learning/DimensionalityReductionLearning/include/cbLearningApplicationBaseDR.h
 rename Modules/Learning/DimensionalityReductionLearning/include/{AutoencoderModel.h => otbAutoencoderModel.h} (96%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{AutoencoderModel.txx => otbAutoencoderModel.txx} (96%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{AutoencoderModelFactory.h => otbAutoencoderModelFactory.h} (97%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{AutoencoderModelFactory.txx => otbAutoencoderModelFactory.txx} (86%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{DimensionalityReductionModelFactory.h => otbDimensionalityReductionModelFactory.h} (98%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{DimensionalityReductionModelFactory.txx => otbDimensionalityReductionModelFactory.txx} (86%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{ImageDimensionalityReductionFilter.h => otbImageDimensionalityReductionFilter.h} (98%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{ImageDimensionalityReductionFilter.txx => otbImageDimensionalityReductionFilter.txx} (99%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{PCAModel.h => otbPCAModel.h} (99%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{PCAModel.txx => otbPCAModel.txx} (100%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{PCAModelFactory.h => otbPCAModelFactory.h} (97%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{PCAModelFactory.txx => otbPCAModelFactory.txx} (85%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{SOMModel.h => otbSOMModel.h} (99%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{SOMModel.txx => otbSOMModel.txx} (100%)
 rename Modules/Learning/DimensionalityReductionLearning/include/{SOMModelFactory.h => otbSOMModelFactory.h} (100%)

diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbImageDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbImageDimensionalityReduction.cxx
index a4d00030fe..7543fffb96 100644
--- a/Modules/Applications/AppDimensionalityReduction/app/otbImageDimensionalityReduction.cxx
+++ b/Modules/Applications/AppDimensionalityReduction/app/otbImageDimensionalityReduction.cxx
@@ -23,10 +23,10 @@
 #include "otbStandardWriterWatcher.h"
 #include "otbStatisticsXMLFileReader.h"
 #include "otbShiftScaleVectorImageFilter.h"
-#include "ImageDimensionalityReductionFilter.h"
+#include "otbImageDimensionalityReductionFilter.h"
 #include "otbMultiToMonoChannelExtractROI.h"
 #include "otbImageToVectorImageCastFilter.h"
-#include "DimensionalityReductionModelFactory.h"
+#include "otbDimensionalityReductionModelFactory.h"
 
 namespace otb
 {
diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbTrainDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbTrainDimensionalityReduction.cxx
index 5f94e918b3..dea0331cea 100644
--- a/Modules/Applications/AppDimensionalityReduction/app/otbTrainDimensionalityReduction.cxx
+++ b/Modules/Applications/AppDimensionalityReduction/app/otbTrainDimensionalityReduction.cxx
@@ -13,19 +13,19 @@
 
 #include <fstream> // write the model file
 
-#include "DimensionalityReductionModelFactory.h"
-#include "cbLearningApplicationBaseDR.h"
+#include "otbDimensionalityReductionModelFactory.h"
+#include "otbTrainDimensionalityReductionApplicationBase.h"
 
 
 namespace otb
 {
 namespace Wrapper
 {
-class TrainDimensionalityReduction : public cbLearningApplicationBaseDR<float,float>
+class TrainDimensionalityReduction : public TrainDimensionalityReductionApplicationBase<float,float>
 {
 public:
   typedef TrainDimensionalityReduction Self;
-  typedef cbLearningApplicationBaseDR<float, float> Superclass;
+  typedef TrainDimensionalityReductionApplicationBase<float, float> Superclass;
   typedef itk::SmartPointer<Self> Pointer;
   typedef itk::SmartPointer<const Self> ConstPointer;
 	
diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbVectorDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbVectorDimensionalityReduction.cxx
index 8036bcb32f..43638c4207 100644
--- a/Modules/Applications/AppDimensionalityReduction/app/otbVectorDimensionalityReduction.cxx
+++ b/Modules/Applications/AppDimensionalityReduction/app/otbVectorDimensionalityReduction.cxx
@@ -26,8 +26,7 @@
 #include "otbStatisticsXMLFileReader.h"
 #include "itkListSample.h"
 #include "otbShiftScaleSampleListFilter.h"
-#include "DimensionalityReductionModelFactory.h"
-//#include "DimensionalityReductionModel.h"
+#include "otbDimensionalityReductionModelFactory.h"
 #include <time.h>
 
 namespace otb
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/cbTrainAutoencoder.txx b/Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainAutoencoder.txx
similarity index 94%
rename from Modules/Learning/DimensionalityReductionLearning/include/cbTrainAutoencoder.txx
rename to Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainAutoencoder.txx
index 0da00f85ea..dc787d5d15 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/cbTrainAutoencoder.txx
+++ b/Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainAutoencoder.txx
@@ -2,7 +2,7 @@
 #ifndef cbTrainAutoencoder_txx
 #define cbTrainAutoencoder_txx
 
-#include "cbLearningApplicationBaseDR.h"
+#include "otbTrainDimensionalityReductionApplicationBase.h"
 
 namespace otb
 {
@@ -11,7 +11,7 @@ namespace Wrapper
 
 template <class TInputValue, class TOutputValue>
 void
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::InitAutoencoderParams()
 {
 
@@ -103,9 +103,9 @@ cbLearningApplicationBaseDR<TInputValue,TOutputValue>
 
 template <class TInputValue, class TOutputValue>
 void
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::BeforeTrainAutoencoder(typename ListSampleType::Pointer trainingListSample,
-        std::string modelPath)
+                         std::string modelPath)
 {		
 	std::string TiedWeigth = GetParameterString("model.autoencoder.istied");
 	std::cout << TiedWeigth << std::endl;
@@ -130,8 +130,7 @@ cbLearningApplicationBaseDR<TInputValue,TOutputValue>
 
 template <class TInputValue, class TOutputValue>
 template <typename autoencoderchoice>
-void cbLearningApplicationBaseDR<TInputValue,TOutputValue>
-::TrainAutoencoder(typename ListSampleType::Pointer trainingListSample,std::string modelPath)
+void TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>::TrainAutoencoder(typename ListSampleType::Pointer trainingListSample,std::string modelPath)
 {
 		typename autoencoderchoice::Pointer dimredTrainer = autoencoderchoice::New();
 		itk::Array<unsigned int> nb_neuron;
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/cbTrainPCA.txx b/Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainPCA.txx
similarity index 85%
rename from Modules/Learning/DimensionalityReductionLearning/include/cbTrainPCA.txx
rename to Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainPCA.txx
index d51926469b..003ebb1ccf 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/cbTrainPCA.txx
+++ b/Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainPCA.txx
@@ -2,7 +2,7 @@
 #ifndef cbTrainPCA_txx
 #define cbTrainPCA_txx
 
-#include "cbLearningApplicationBaseDR.h"
+#include "otbTrainDimensionalityReductionApplicationBase.h"
 
 namespace otb
 {
@@ -11,7 +11,7 @@ namespace Wrapper
 
 template <class TInputValue, class TOutputValue>
 void
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::InitPCAParams()
 {
 
@@ -34,7 +34,7 @@ cbLearningApplicationBaseDR<TInputValue,TOutputValue>
 }
 
 template <class TInputValue, class TOutputValue>
-void cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+void TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::TrainPCA(typename ListSampleType::Pointer trainingListSample,std::string modelPath)
 {
 		typename PCAModelType::Pointer dimredTrainer = PCAModelType::New();
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/cbTrainSOM.txx b/Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainSOM.txx
similarity index 94%
rename from Modules/Learning/DimensionalityReductionLearning/include/cbTrainSOM.txx
rename to Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainSOM.txx
index 4c6f5c89f1..61975c9708 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/cbTrainSOM.txx
+++ b/Modules/Applications/AppDimensionalityReduction/include/otbDimensionalityReductionTrainSOM.txx
@@ -1,7 +1,7 @@
 
 #ifndef cbTrainSOM_txx
 #define cbTrainSOM_txx
-#include "cbLearningApplicationBaseDR.h"
+#include "otbTrainDimensionalityReductionApplicationBase.h"
 
 namespace otb
 {
@@ -10,7 +10,7 @@ namespace Wrapper
 
 template <class TInputValue, class TOutputValue>
 void
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::InitSOMParams()
 {
 
@@ -76,7 +76,7 @@ cbLearningApplicationBaseDR<TInputValue,TOutputValue>
 
 template <class TInputValue, class TOutputValue>
 void
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::BeforeTrainSOM(typename ListSampleType::Pointer trainingListSample,
         std::string modelPath)
 {		
@@ -111,7 +111,7 @@ cbLearningApplicationBaseDR<TInputValue,TOutputValue>
 
 template <class TInputValue, class TOutputValue>
 template <typename somchoice>
-void cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+void TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::TrainSOM(typename ListSampleType::Pointer trainingListSample,std::string modelPath)
 {
 		using TemplateEstimatorType = typename somchoice::EstimatorType;
diff --git a/Modules/Applications/AppDimensionalityReduction/include/otbTrainDimensionalityReductionApplicationBase.h b/Modules/Applications/AppDimensionalityReduction/include/otbTrainDimensionalityReductionApplicationBase.h
new file mode 100644
index 0000000000..c14bfd8ca0
--- /dev/null
+++ b/Modules/Applications/AppDimensionalityReduction/include/otbTrainDimensionalityReductionApplicationBase.h
@@ -0,0 +1,170 @@
+#ifndef cbLearningApplicationBaseDR_h
+#define cbLearningApplicationBaseDR_h
+
+#include "otbConfigure.h"
+
+#include "otbWrapperApplication.h"
+
+#include <iostream>
+
+// ListSample
+#include "itkListSample.h"
+#include "itkVariableLengthVector.h"
+
+//Estimator
+#include "otbDimensionalityReductionModelFactory.h"
+
+#include "otbSOMModel.h"
+
+#ifdef OTB_USE_SHARK
+#include "otbAutoencoderModel.h"
+#include "otbPCAModel.h"
+#endif
+
+namespace otb
+{
+namespace Wrapper
+{
+
+/** \class LearningApplicationBase
+ *  \brief LearningApplicationBase is the base class for application that
+ *         use machine learning model.
+ *
+ * This base class offers a DoInit() method to initialize all the parameters
+ * related to machine learning models. They will all be in the choice parameter
+ * named "classifier". The class also offers generic Train() and Classify()
+ * methods. The classes derived from LearningApplicationBase only need these
+ * 3 methods to handle the machine learning model.
+ *
+ * There are multiple machine learning models in OTB, some imported
+ * from OpenCV and one imported from LibSVM. They all have
+ * different parameters. The purpose of this class is to handle the
+ * creation of all parameters related to machine learning models (in
+ * DoInit() ), and to dispatch the calls to specific train functions
+ * in function Train().
+ *
+ * This class is templated over scalar types for input and output values.
+ * Typically, the input value type will be either float of double. The choice
+ * of an output value type depends on the learning mode. This base class
+ * supports both classification and regression modes. For classification
+ * (enabled by default), the output value type corresponds to a class
+ * identifier so integer types suit well. For regression, the output value
+ * should not be an integer type, but rather a floating point type. In addition,
+ * an application deriving this base class for regression should initialize
+ * the m_RegressionFlag to true in their constructor.
+ *
+ * \sa TrainImagesClassifier
+ * \sa TrainRegression
+ *
+ * \ingroup OTBAppClassification
+ */
+template <class TInputValue, class TOutputValue>
+class TrainDimensionalityReductionApplicationBase: public Application
+{
+public:
+	/** Standard class typedefs. */
+  typedef TrainDimensionalityReductionApplicationBase Self;
+  typedef Application             Superclass;
+  typedef itk::SmartPointer<Self> Pointer;
+  typedef itk::SmartPointer<const Self> ConstPointer;
+
+  /** Standard macro */
+  itkTypeMacro(TrainDimensionalityReductionApplicationBase, otb::Application)
+
+  typedef TInputValue                             InputValueType;
+  typedef TOutputValue                            OutputValueType;
+
+  typedef otb::VectorImage<InputValueType>        SampleImageType;
+  typedef typename SampleImageType::PixelType     PixelType;
+
+  typedef otb::DimensionalityReductionModelFactory<
+    InputValueType, OutputValueType>             ModelFactoryType;
+  typedef typename ModelFactoryType::DimensionalityReductionModelTypePointer ModelPointerType;
+  typedef typename ModelFactoryType::DimensionalityReductionModelType        ModelType;
+	  
+  typedef typename ModelType::InputSampleType     SampleType;
+  typedef typename ModelType::InputListSampleType ListSampleType;
+	  
+// Dimensionality reduction models
+
+//typedef SOMMap<TInputValue,itk::Statistics::EuclideanDistanceMetric<itk::VariableLengthVector<TInputValue>>, 2> Map2DType;
+  typedef otb::SOMModel<InputValueType, 2> SOM2DModelType;
+	
+//typedef SOMMap<TInputValue,itk::Statistics::EuclideanDistanceMetric<itk::VariableLengthVector<TInputValue>>, 3> Map3DType;
+  typedef otb::SOMModel<InputValueType, 3> SOM3DModelType;
+	
+//typedef SOMMap<TInputValue,itk::Statistics::EuclideanDistanceMetric<itk::VariableLengthVector<TInputValue>>, 4> Map4DType;
+  typedef otb::SOMModel<InputValueType, 4> SOM4DModelType;
+	
+//typedef SOMMap<TInputValue,itk::Statistics::EuclideanDistanceMetric<itk::VariableLengthVector<TInputValue>>, 5> Map5DType;
+  typedef otb::SOMModel<InputValueType, 5> SOM5DModelType;
+	
+
+#ifdef OTB_USE_SHARK
+
+// typedef shark::Autoencoder< shark::TanhNeuron, shark::LinearNeuron> AutoencoderType;
+  typedef shark::LogisticNeuron NeuronType;
+  typedef otb::AutoencoderModel<InputValueType, NeuronType> AutoencoderModelType;
+/*
+	// typedef shark::TiedAutoencoder< shark::TanhNeuron, shark::LinearNeuron> TiedAutoencoderType;
+	typedef shark::TiedAutoencoder< shark::TanhNeuron, shark::TanhNeuron> TiedAutoencoderType;
+	typedef otb::AutoencoderModel<InputValueType, TiedAutoencoderType> TiedAutoencoderModelType;
+	*/
+  typedef otb::PCAModel<InputValueType> PCAModelType;
+#endif
+  
+protected:
+TrainDimensionalityReductionApplicationBase();
+~TrainDimensionalityReductionApplicationBase();
+
+/** Generic method to train and save the machine learning model. This method
+   * uses specific train methods depending on the chosen model.*/
+void Train(typename ListSampleType::Pointer trainingListSample,
+           std::string modelPath);
+
+/** Generic method to load a model file and use it to classify a sample list*/
+void Reduce(typename ListSampleType::Pointer validationListSample,
+            std::string modelPath);
+
+/** Init method that creates all the parameters for machine learning models */
+void DoInit();
+
+private:
+
+/** Specific Init and Train methods for each machine learning model */
+//@{
+  
+void InitSOMParams();
+template <class somchoice>
+void TrainSOM(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
+void BeforeTrainSOM(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
+
+#ifdef OTB_USE_SHARK
+  void InitAutoencoderParams();
+  void InitPCAParams();
+  
+  void BeforeTrainAutoencoder(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
+  template <class autoencoderchoice>
+  void TrainAutoencoder(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
+  
+  void TrainPCA(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
+  
+ 
+#endif  
+//@}
+};
+
+}
+}
+
+#ifndef OTB_MANUAL_INSTANTIATION
+#include "otbTrainDimensionalityReductionApplicationBase.txx"
+#include "otbDimensionalityReductionTrainSOM.txx"
+
+#ifdef OTB_USE_SHARK
+#include "otbDimensionalityReductionTrainAutoencoder.txx"
+#include "otbDimensionalityReductionTrainPCA.txx"
+#endif
+#endif
+
+#endif
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/cbLearningApplicationBaseDR.txx b/Modules/Applications/AppDimensionalityReduction/include/otbTrainDimensionalityReductionApplicationBase.txx
similarity index 77%
rename from Modules/Learning/DimensionalityReductionLearning/include/cbLearningApplicationBaseDR.txx
rename to Modules/Applications/AppDimensionalityReduction/include/otbTrainDimensionalityReductionApplicationBase.txx
index 19b5e4e414..04065aa97c 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/cbLearningApplicationBaseDR.txx
+++ b/Modules/Applications/AppDimensionalityReduction/include/otbTrainDimensionalityReductionApplicationBase.txx
@@ -17,7 +17,7 @@
 #ifndef cbLearningApplicationBaseDR_txx
 #define cbLearningApplicationBaseDR_txx
 
-#include "cbLearningApplicationBaseDR.h"
+#include "otbTrainDimensionalityReductionApplicationBase.h"
 
 namespace otb
 {
@@ -25,21 +25,21 @@ namespace Wrapper
 {
 
 template <class TInputValue, class TOutputValue>
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
-::cbLearningApplicationBaseDR() 
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
+::TrainDimensionalityReductionApplicationBase() 
 {
 }
 
 template <class TInputValue, class TOutputValue>
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
-::~cbLearningApplicationBaseDR()
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
+::~TrainDimensionalityReductionApplicationBase()
 {
   ModelFactoryType::CleanFactories();
 }
 
 template <class TInputValue, class TOutputValue>
 void
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::DoInit()
 {
   AddDocTag(Tags::Learning);
@@ -60,14 +60,14 @@ cbLearningApplicationBaseDR<TInputValue,TOutputValue>
 
 template <class TInputValue, class TOutputValue>
 void
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::Reduce(typename ListSampleType::Pointer validationListSample,std::string modelPath)
 {
 }
 
 template <class TInputValue, class TOutputValue>
 void
-cbLearningApplicationBaseDR<TInputValue,TOutputValue>
+TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
 ::Train(typename ListSampleType::Pointer trainingListSample,
         std::string modelPath)
 {
@@ -84,10 +84,10 @@ cbLearningApplicationBaseDR<TInputValue,TOutputValue>
  if(modelName == "autoencoder")
     {
 		#ifdef OTB_USE_SHARK
-		BeforeTrainAutoencoder(trainingListSample,modelPath);
-		#else
-		otbAppLogFATAL("Module SharkLearning is not installed. You should consider turning OTB_USE_SHARK on during cmake configuration.");
-		#endif
+    BeforeTrainAutoencoder(trainingListSample,modelPath);
+#else
+    otbAppLogFATAL("Module SharkLearning is not installed. You should consider turning OTB_USE_SHARK on during cmake configuration.");
+#endif
     }
     /*
   if(modelName == "tiedautoencoder")
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/SOMModelFactory.txx b/Modules/Learning/DimensionalityReductionLearning/include/SOMModelFactory.txx
index 396a5f0ac9..a4ea0243b9 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/SOMModelFactory.txx
+++ b/Modules/Learning/DimensionalityReductionLearning/include/SOMModelFactory.txx
@@ -19,11 +19,10 @@
 #define SOMFactory_txx
 
 
-#include "SOMModelFactory.h"
+#include "otbSOMModelFactory.h"
 
 #include "itkCreateObjectFunction.h"
-#include "SOMModel.h"
-//#include <shark/Algorithms/Trainers/PCA.h>
+#include "otbSOMModel.h"
 #include "itkVersion.h"
 
 namespace otb
@@ -39,8 +38,8 @@ SOMModelFactory<TInputValue,TOutputValue,MapDimension>::SOMModelFactory()
                          subclass.c_str(),
                          "SOM DR Model",
                          1,
-                      //   itk::CreateObjectFunction<AutoencoderModel<TInputValue,TOutputValue> >::New());
-						itk::CreateObjectFunction<SOMModel<TInputValue,  MapDimension>>::New());
+
+                         itk::CreateObjectFunction<SOMModel<TInputValue,  MapDimension>>::New());
 }
 
 template <class TInputValue, class TOutputValue, unsigned int MapDimension>
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/cbLearningApplicationBaseDR.h b/Modules/Learning/DimensionalityReductionLearning/include/cbLearningApplicationBaseDR.h
deleted file mode 100644
index 281cc1866b..0000000000
--- a/Modules/Learning/DimensionalityReductionLearning/include/cbLearningApplicationBaseDR.h
+++ /dev/null
@@ -1,171 +0,0 @@
-#ifndef cbLearningApplicationBaseDR_h
-#define cbLearningApplicationBaseDR_h
-
-#include "otbConfigure.h"
-
-#include "otbWrapperApplication.h"
-
-#include <iostream>
-
-// ListSample
-#include "itkListSample.h"
-#include "itkVariableLengthVector.h"
-
-//Estimator
-#include "DimensionalityReductionModelFactory.h"
-
-#include "SOMModel.h"
-
-#ifdef OTB_USE_SHARK
-#include "AutoencoderModel.h"
-#include "PCAModel.h"
-#endif
-
-namespace otb
-{
-namespace Wrapper
-{
-
-/** \class LearningApplicationBase
- *  \brief LearningApplicationBase is the base class for application that
- *         use machine learning model.
- *
- * This base class offers a DoInit() method to initialize all the parameters
- * related to machine learning models. They will all be in the choice parameter
- * named "classifier". The class also offers generic Train() and Classify()
- * methods. The classes derived from LearningApplicationBase only need these
- * 3 methods to handle the machine learning model.
- *
- * There are multiple machine learning models in OTB, some imported
- * from OpenCV and one imported from LibSVM. They all have
- * different parameters. The purpose of this class is to handle the
- * creation of all parameters related to machine learning models (in
- * DoInit() ), and to dispatch the calls to specific train functions
- * in function Train().
- *
- * This class is templated over scalar types for input and output values.
- * Typically, the input value type will be either float of double. The choice
- * of an output value type depends on the learning mode. This base class
- * supports both classification and regression modes. For classification
- * (enabled by default), the output value type corresponds to a class
- * identifier so integer types suit well. For regression, the output value
- * should not be an integer type, but rather a floating point type. In addition,
- * an application deriving this base class for regression should initialize
- * the m_RegressionFlag to true in their constructor.
- *
- * \sa TrainImagesClassifier
- * \sa TrainRegression
- *
- * \ingroup OTBAppClassification
- */
-template <class TInputValue, class TOutputValue>
-class cbLearningApplicationBaseDR: public Application
-{
-public:
-	/** Standard class typedefs. */
-	typedef cbLearningApplicationBaseDR Self;
-	typedef Application             Superclass;
-	typedef itk::SmartPointer<Self> Pointer;
-	typedef itk::SmartPointer<const Self> ConstPointer;
-
-	/** Standard macro */
-	itkTypeMacro(cbLearningApplicationBaseDR, otb::Application)
-
-	typedef TInputValue                             InputValueType;
-	typedef TOutputValue                            OutputValueType;
-
-	typedef otb::VectorImage<InputValueType>        SampleImageType;
-	typedef typename SampleImageType::PixelType     PixelType;
-
-	typedef otb::DimensionalityReductionModelFactory<
-				InputValueType, OutputValueType>             ModelFactoryType;
-	typedef typename ModelFactoryType::DimensionalityReductionModelTypePointer ModelPointerType;
-	typedef typename ModelFactoryType::DimensionalityReductionModelType        ModelType;
-	  
-	typedef typename ModelType::InputSampleType     SampleType;
-	typedef typename ModelType::InputListSampleType ListSampleType;
-	  
-	// Dimensionality reduction models
-
-	//typedef SOMMap<TInputValue,itk::Statistics::EuclideanDistanceMetric<itk::VariableLengthVector<TInputValue>>, 2> Map2DType;
-	typedef otb::SOMModel<InputValueType, 2> SOM2DModelType;
-	
-	//typedef SOMMap<TInputValue,itk::Statistics::EuclideanDistanceMetric<itk::VariableLengthVector<TInputValue>>, 3> Map3DType;
-	typedef otb::SOMModel<InputValueType, 3> SOM3DModelType;
-	
-	//typedef SOMMap<TInputValue,itk::Statistics::EuclideanDistanceMetric<itk::VariableLengthVector<TInputValue>>, 4> Map4DType;
-	typedef otb::SOMModel<InputValueType, 4> SOM4DModelType;
-	
-	//typedef SOMMap<TInputValue,itk::Statistics::EuclideanDistanceMetric<itk::VariableLengthVector<TInputValue>>, 5> Map5DType;
-	typedef otb::SOMModel<InputValueType, 5> SOM5DModelType;
-	
-
-#ifdef OTB_USE_SHARK
-
-	// typedef shark::Autoencoder< shark::TanhNeuron, shark::LinearNeuron> AutoencoderType;
-	typedef shark::LogisticNeuron NeuronType;
-	typedef otb::AutoencoderModel<InputValueType, NeuronType> AutoencoderModelType;
-	/*
-	// typedef shark::TiedAutoencoder< shark::TanhNeuron, shark::LinearNeuron> TiedAutoencoderType;
-	typedef shark::TiedAutoencoder< shark::TanhNeuron, shark::TanhNeuron> TiedAutoencoderType;
-	typedef otb::AutoencoderModel<InputValueType, TiedAutoencoderType> TiedAutoencoderModelType;
-	*/
-	typedef otb::PCAModel<InputValueType> PCAModelType;
-#endif
-  
-protected:
-  cbLearningApplicationBaseDR();
-
-  ~cbLearningApplicationBaseDR() ITK_OVERRIDE;
-
-  /** Generic method to train and save the machine learning model. This method
-   * uses specific train methods depending on the chosen model.*/
-  void Train(typename ListSampleType::Pointer trainingListSample,
-             std::string modelPath);
-
-  /** Generic method to load a model file and use it to classify a sample list*/
-  void Reduce(typename ListSampleType::Pointer validationListSample,
-                std::string modelPath);
-
-  /** Init method that creates all the parameters for machine learning models */
-  void DoInit();
-
-private:
-
-  /** Specific Init and Train methods for each machine learning model */
-  //@{
-  
-  void InitSOMParams();
-  template <class somchoice>
-  void TrainSOM(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
-  void BeforeTrainSOM(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
-
-#ifdef OTB_USE_SHARK
-  void InitAutoencoderParams();
-  void InitPCAParams();
-  
-  void BeforeTrainAutoencoder(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
-  template <class autoencoderchoice>
-  void TrainAutoencoder(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
-  
-  void TrainPCA(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
-  
- 
-#endif  
-  //@}
-};
-
-}
-}
-
-#ifndef OTB_MANUAL_INSTANTIATION
-#include "cbLearningApplicationBaseDR.txx"
-#include "cbTrainSOM.txx"
-
-#ifdef OTB_USE_SHARK
-#include "cbTrainAutoencoder.txx"
-#include "cbTrainPCA.txx"
-#endif
-#endif
-
-#endif
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModel.h b/Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModel.h
similarity index 96%
rename from Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModel.h
rename to Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModel.h
index a8cbe6c0f5..9723a5c27a 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModel.h
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModel.h
@@ -16,8 +16,8 @@ class ITK_EXPORT AutoencoderModel: public  MachineLearningModel<itk::VariableLen
 
 public:
 	
-	typedef AutoencoderModel Self;
-	typedef MachineLearningModel<itk::VariableLengthVector< TInputValue> , itk::VariableLengthVector< TInputValue>> Superclass;
+  typedef AutoencoderModel Self;
+  typedef MachineLearningModel<itk::VariableLengthVector< TInputValue> , itk::VariableLengthVector< TInputValue>> Superclass;
 	typedef itk::SmartPointer<Self> Pointer;
 	typedef itk::SmartPointer<const Self> ConstPointer;
 
@@ -131,7 +131,7 @@ private:
 
 
 #ifndef OTB_MANUAL_INSTANTIATION
-#include "AutoencoderModel.txx"
+#include "otbAutoencoderModel.txx"
 #endif
 
 
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModel.txx b/Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModel.txx
similarity index 96%
rename from Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModel.txx
rename to Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModel.txx
index 88c77dd5ae..e95748ff3c 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModel.txx
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModel.txx
@@ -73,18 +73,18 @@ void AutoencoderModel<TInputValue,NeuronType>::Train()
 
 	/// Training of the first Autoencoder (first and last layer of the FF network)
 	if (m_Epsilon > 0){
-		shark::TrainingProgress<> criterion(5,m_Epsilon);
+        shark::TrainingProgress<> criterion(5,m_Epsilon);
 		
-		OutAutoencoderType net;
-		if (m_Noise[0] != 0)   // Shark doesn't allow to train a layer using a sparsity term AND a noisy input. (shark::SparseAutoencoderError takes an autoen
-		{
-			TrainOneLayer(criterion,net,0 , m_NumberOfHiddenNeurons[0],m_Noise[0],m_Regularization[0], inputSamples,ofs);
-		}
-		else
-		{
-			TrainOneSparseLayer( criterion, net , 0 , m_NumberOfHiddenNeurons[0],m_Rho[0],m_Beta[0],m_Regularization[0],inputSamples, ofs);
-		}
-		criterion.reset();
+        OutAutoencoderType net;
+        if (m_Noise[0] != 0)   // Shark doesn't allow to train a layer using a sparsity term AND a noisy input. (shark::SparseAutoencoderError takes an autoen
+          {
+          TrainOneLayer(criterion,net,0 , m_NumberOfHiddenNeurons[0],m_Noise[0],m_Regularization[0], inputSamples,ofs);
+          }
+        else
+          {
+          TrainOneSparseLayer( criterion, net , 0 , m_NumberOfHiddenNeurons[0],m_Rho[0],m_Beta[0],m_Regularization[0],inputSamples, ofs);
+          }
+        criterion.reset();
 	}
 	
 	else {
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModelFactory.h b/Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModelFactory.h
similarity index 97%
rename from Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModelFactory.h
rename to Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModelFactory.h
index c9c993b57e..5eb6a501ef 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModelFactory.h
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModelFactory.h
@@ -62,7 +62,7 @@ using TiedAutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTa
 
 
 #ifndef OTB_MANUAL_INSTANTIATION
-#include "AutoencoderModelFactory.txx"
+#include "otbAutoencoderModelFactory.txx"
 #endif
 
 #endif
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModelFactory.txx b/Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModelFactory.txx
similarity index 86%
rename from Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModelFactory.txx
rename to Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModelFactory.txx
index 47b4669ab4..73dae93bde 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/AutoencoderModelFactory.txx
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModelFactory.txx
@@ -19,10 +19,10 @@
 #define AutoencoderModelFactory_txx
 
 
-#include "AutoencoderModelFactory.h"
+#include "otbAutoencoderModelFactory.h"
 
 #include "itkCreateObjectFunction.h"
-#include "AutoencoderModel.h"
+#include "otbAutoencoderModel.h"
 #include "itkVersion.h"
 
 namespace otb
@@ -38,8 +38,8 @@ AutoencoderModelFactoryBase<TInputValue,TOutputValue, NeuronType>::AutoencoderMo
                          subclass.c_str(),
                          "Shark AE ML Model",
                          1,
-                      //   itk::CreateObjectFunction<AutoencoderModel<TInputValue,TOutputValue> >::New());
-						itk::CreateObjectFunction<AutoencoderModel<TInputValue,NeuronType > >::New());
+                         //   itk::CreateObjectFunction<AutoencoderModel<TInputValue,TOutputValue> >::New());
+                         itk::CreateObjectFunction<AutoencoderModel<TInputValue,NeuronType > >::New());
 }
 
 template <class TInputValue, class TOutputValue, class NeuronType>
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/DimensionalityReductionModelFactory.h b/Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.h
similarity index 98%
rename from Modules/Learning/DimensionalityReductionLearning/include/DimensionalityReductionModelFactory.h
rename to Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.h
index 16fa0f416d..92603c710d 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/DimensionalityReductionModelFactory.h
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.h
@@ -78,7 +78,7 @@ private:
 } // end namespace otb
 
 #ifndef OTB_MANUAL_INSTANTIATION
-#include "DimensionalityReductionModelFactory.txx"
+#include "otbDimensionalityReductionModelFactory.txx"
 #endif
 
 #endif
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/DimensionalityReductionModelFactory.txx b/Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.txx
similarity index 86%
rename from Modules/Learning/DimensionalityReductionLearning/include/DimensionalityReductionModelFactory.txx
rename to Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.txx
index 130dd13626..775c0842dc 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/DimensionalityReductionModelFactory.txx
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.txx
@@ -18,14 +18,14 @@
 #ifndef DimensionalityReductionModelFactory_txx
 #define DimensionalityReductionFactory_txx
 
-#include "DimensionalityReductionModelFactory.h"
+#include "otbDimensionalityReductionModelFactory.h"
 #include "otbConfigure.h"
 
-#include "SOMModelFactory.h"
+#include "otbSOMModelFactory.h"
 
 #ifdef OTB_USE_SHARK
-#include "AutoencoderModelFactory.h"
-#include "PCAModelFactory.h"
+#include "otbAutoencoderModelFactory.h"
+#include "otbPCAModelFactory.h"
 #endif
 
 #include "itkMutexLockHolder.h"
@@ -34,16 +34,6 @@
 namespace otb
 {
 
-/*
-template <class TInputValue, class TTargetValue>
-// using AutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTargetValue, shark::Autoencoder<shark::TanhNeuron, shark::LinearNeuron>>  ;
-using AutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTargetValue, shark::Autoencoder<shark::TanhNeuron, shark::TanhNeuron>>  ;
-
-
-template <class TInputValue, class TTargetValue>
-// using TiedAutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTargetValue, shark::TiedAutoencoder< shark::TanhNeuron, shark::LinearNeuron>>  ;
-using TiedAutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTargetValue, shark::TiedAutoencoder< shark::TanhNeuron, shark::TanhNeuron>>  ;
-*/
 
 template <class TInputValue, class TTargetValue>
 using AutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTargetValue, shark::LogisticNeuron>  ;
@@ -130,7 +120,7 @@ DimensionalityReductionModelFactory<TInputValue,TOutputValue>
 #ifdef OTB_USE_SHARK
   RegisterFactory(PCAModelFactory<TInputValue,TOutputValue>::New());
   RegisterFactory(AutoencoderModelFactory<TInputValue,TOutputValue>::New());
- // RegisterFactory(TiedAutoencoderModelFactory<TInputValue,TOutputValue>::New());
+  // RegisterFactory(TiedAutoencoderModelFactory<TInputValue,TOutputValue>::New());
 #endif
   
 }
@@ -196,8 +186,7 @@ DimensionalityReductionModelFactory<TInputValue,TOutputValue>
       
 #ifdef OTB_USE_SHARK
 	
-	// Autoencoder
-	AutoencoderModelFactory<TInputValue,TOutputValue> *aeFactory =
+    AutoencoderModelFactory<TInputValue,TOutputValue> *aeFactory =
       dynamic_cast<AutoencoderModelFactory<TInputValue,TOutputValue> *>(*itFac);
     if (aeFactory)
       {
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/ImageDimensionalityReductionFilter.h b/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.h
similarity index 98%
rename from Modules/Learning/DimensionalityReductionLearning/include/ImageDimensionalityReductionFilter.h
rename to Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.h
index 008c57d2a4..415dda921c 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/ImageDimensionalityReductionFilter.h
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.h
@@ -139,7 +139,7 @@ private:
 };
 } // End namespace otb
 #ifndef OTB_MANUAL_INSTANTIATION
-#include "ImageDimensionalityReductionFilter.txx"
+#include "otbImageDimensionalityReductionFilter.txx"
 #endif
 
 #endif
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/ImageDimensionalityReductionFilter.txx b/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.txx
similarity index 99%
rename from Modules/Learning/DimensionalityReductionLearning/include/ImageDimensionalityReductionFilter.txx
rename to Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.txx
index e98a0b79f7..418ecb4fa2 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/ImageDimensionalityReductionFilter.txx
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.txx
@@ -18,7 +18,7 @@
 #ifndef otbImageClassificationFilter_txx
 #define otbImageClassificationFilter_txx
 
-#include "ImageDimensionalityReductionFilter.h"
+#include "otbImageDimensionalityReductionFilter.h"
 #include "itkImageRegionIterator.h"
 #include "itkProgressReporter.h"
 
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/PCAModel.h b/Modules/Learning/DimensionalityReductionLearning/include/otbPCAModel.h
similarity index 99%
rename from Modules/Learning/DimensionalityReductionLearning/include/PCAModel.h
rename to Modules/Learning/DimensionalityReductionLearning/include/otbPCAModel.h
index 82ea0f8443..e39ca88341 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/PCAModel.h
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbPCAModel.h
@@ -75,7 +75,7 @@ private:
 
 
 #ifndef OTB_MANUAL_INSTANTIATION
-#include "PCAModel.txx"
+#include "otbPCAModel.txx"
 #endif
 
 
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/PCAModel.txx b/Modules/Learning/DimensionalityReductionLearning/include/otbPCAModel.txx
similarity index 100%
rename from Modules/Learning/DimensionalityReductionLearning/include/PCAModel.txx
rename to Modules/Learning/DimensionalityReductionLearning/include/otbPCAModel.txx
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/PCAModelFactory.h b/Modules/Learning/DimensionalityReductionLearning/include/otbPCAModelFactory.h
similarity index 97%
rename from Modules/Learning/DimensionalityReductionLearning/include/PCAModelFactory.h
rename to Modules/Learning/DimensionalityReductionLearning/include/otbPCAModelFactory.h
index 56c0b88c6c..a7a5d10491 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/PCAModelFactory.h
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbPCAModelFactory.h
@@ -51,7 +51,7 @@ private:
 
 
 #ifndef OTB_MANUAL_INSTANTIATION
-#include "PCAModelFactory.txx"
+#include "otbPCAModelFactory.txx"
 #endif
 
 #endif
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/PCAModelFactory.txx b/Modules/Learning/DimensionalityReductionLearning/include/otbPCAModelFactory.txx
similarity index 85%
rename from Modules/Learning/DimensionalityReductionLearning/include/PCAModelFactory.txx
rename to Modules/Learning/DimensionalityReductionLearning/include/otbPCAModelFactory.txx
index bfaa4f6f62..d7a06e94dc 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/PCAModelFactory.txx
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbPCAModelFactory.txx
@@ -19,11 +19,10 @@
 #define PCAFactory_txx
 
 
-#include "PCAModelFactory.h"
+#include "otbPCAModelFactory.h"
 
 #include "itkCreateObjectFunction.h"
-#include "PCAModel.h"
-//#include <shark/Algorithms/Trainers/PCA.h>
+#include "otbPCAModel.h"
 #include "itkVersion.h"
 
 namespace otb
@@ -39,8 +38,7 @@ PCAModelFactory<TInputValue,TOutputValue>::PCAModelFactory()
                          subclass.c_str(),
                          "Shark PCA ML Model",
                          1,
-                      //   itk::CreateObjectFunction<AutoencoderModel<TInputValue,TOutputValue> >::New());
-						itk::CreateObjectFunction<PCAModel<TInputValue>>::New());
+                         itk::CreateObjectFunction<PCAModel<TInputValue>>::New());
 }
 
 template <class TInputValue, class TOutputValue>
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/SOMModel.h b/Modules/Learning/DimensionalityReductionLearning/include/otbSOMModel.h
similarity index 99%
rename from Modules/Learning/DimensionalityReductionLearning/include/SOMModel.h
rename to Modules/Learning/DimensionalityReductionLearning/include/otbSOMModel.h
index c9553cd9c3..06307b0b8d 100644
--- a/Modules/Learning/DimensionalityReductionLearning/include/SOMModel.h
+++ b/Modules/Learning/DimensionalityReductionLearning/include/otbSOMModel.h
@@ -132,7 +132,7 @@ private:
 
 
 #ifndef OTB_MANUAL_INSTANTIATION
-#include "SOMModel.txx"
+#include "otbSOMModel.txx"
 #endif
 
 
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/SOMModel.txx b/Modules/Learning/DimensionalityReductionLearning/include/otbSOMModel.txx
similarity index 100%
rename from Modules/Learning/DimensionalityReductionLearning/include/SOMModel.txx
rename to Modules/Learning/DimensionalityReductionLearning/include/otbSOMModel.txx
diff --git a/Modules/Learning/DimensionalityReductionLearning/include/SOMModelFactory.h b/Modules/Learning/DimensionalityReductionLearning/include/otbSOMModelFactory.h
similarity index 100%
rename from Modules/Learning/DimensionalityReductionLearning/include/SOMModelFactory.h
rename to Modules/Learning/DimensionalityReductionLearning/include/otbSOMModelFactory.h
-- 
GitLab