diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9167f154f92e62ea9542ac85aa672d1007ecceb1..b688cca53ca5b6999c507273e6435f31b3ca58da 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,23 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 # WARNING!
 # OTB uses Git-LFS to store the (large) tests data.
 # Git-LFS is mostly transparent for the user and recent versions
@@ -97,6 +117,19 @@ fast-build:
     - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
     - ccache -s
 
+legal-check:
+  extends: .common
+  only: [merge_requests, develop, headers_check]
+  stage: precheck
+  image: $BUILD_IMAGE_REGISTRY/otb-alpine:3.7
+  variables:
+    GIT_DEPTH: ""
+  allow_failure: true
+  script:
+    - ./CI/contributors_check.sh
+    - ./CI/headers_check.py
+  after_script: []
+
 #------------------------- prepare & build jobs --------------------------------
 debian-build:
   extends: .common-build
diff --git a/.gitlab/issue_templates/documentation_changes.md b/.gitlab/issue_templates/documentation_changes.md
index 37545799bedd8df7497153892c9ddb1f0e41a960..d7189ba97f930404138940cb9d9bef4dcf7a963d 100644
--- a/.gitlab/issue_templates/documentation_changes.md
+++ b/.gitlab/issue_templates/documentation_changes.md
@@ -1,6 +1,6 @@
-### Target documentation ressources
+### Target documentation resources
 
-Can be a combination of Software guide, cookbook, doxygen, blog, applications doc, websites
+Can be a combination of CookBook, doxygen, blog, applications doc, websites
 
 ### Change requested
 
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000000000000000000000000000000000000..6f3917c00964d2aa68c92f38410a85b5a8d39864
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,95 @@
+Alexia Mondot <alexia.mondot@c-s.fr>
+Amit Kulkarni <amitkulz@gmail.com>
+Angelos Tzotsos <tzotsos@gmail.com>
+Antoine Regimbeau <antoine.regimbeau@c-s.fr>
+Antoine Regimbeau <antoine.regimbeau@c-s.fr>              aregimbe <antoine.regimbeau@c-s.fr>
+Antoine Regimbeau <antoine.regimbeau@c-s.fr>              aregimbeau <antoine.regimbeau@c-s.fr>
+Arnaud Jaen <arnaud.jaen@c-s.fr>
+Aurélie Emilien <aurelie.emilien@c-s.fr>                  Aurelie Emilien <aurelie.emilien@c-s.fr>
+Aurélie Emilien <aurelie.emilien@c-s.fr>
+Aurelien Bricier <aurelien.bricier@c-s.fr>
+Bas Couwenberg <sebastic@debian.org>
+Bas Couwenberg <sebastic@debian.org>                      Bas Couwenberg <sebastic@xs4all.nl>
+Caroline Ruffel <caroline.ruffel@c-s.fr>
+Cédric Traizet <cedric.traizet@c-s.fr>                    Cedric <cedric.traizet@c-s.fr>
+Cédric Traizet <cedric.traizet@c-s.fr>                    Cédric Traizet <traizetc@cesbio.cnes.fr>
+Cédric Traizet <cedric.traizet@c-s.fr>                    ctraizet <cedric.traizet@c-s.fr>
+Cédric Traizet <cedric.traizet@c-s.fr>                    Traizet Cedric <cedric.traizet@cesbio.cnes.fr>
+Charles Peyrega <charles.peyrega@c-s.fr>
+Chia Aik Song <crscas@nus.edu.sg>
+Christophe Palmann <christophe.palmann@c-s.fr>
+Conrad Bielski <conrad.bielski@yahoo.com>
+Cyrille Valladeau <cyrille.valladeau@c-s.fr>
+Daniel McInerney <daniel.o.mcinerney@gmail.com>
+Daniel McInerney <daniel.o.mcinerney@gmail.com>           dmci <daniel.o.mcinerney@gmail.com>
+Daphne Deleflie <daphne.deleflie@thalesgroup.com>
+David Youssefi <david.youssefi@cnes.fr>
+Emmanuel Christophe <emmanuel.christophe@gmail.com>
+Emmanuel Christophe <emmanuel.christophe@gmail.com>       Emmanuel Christophe <emmanuel.christophe@nus.edu.sg>
+Emmanuel Christophe <emmanuel.christophe@gmail.com>       Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org>
+Emmanuelle Sarrazin <emmanuelle.sarrazin@cnes.fr>
+Emmanuelle Sarrazin <emmanuelle.sarrazin@cnes.fr>         esarrazin <emmanuelle.sarrazin@cnes.fr>
+Emmanuelle Sarrazin <emmanuelle.sarrazin@cnes.fr>         sarrazin <emmanuelle.sarrazin@cnes.fr>
+Etienne Bougoin <etienne.bougoin@c-s.fr>
+Gaëlle Usseglio <gaelle.usseglio@cnes.fr>                 Gaëlle USSEGLIO <gaelle.usseglio@cnes.fr>
+Grégoire Mercier <gregoire.mercier@telecom-bretagne.eu>   Gregoire Mercier <gregoire.mercier@telecom-bretagne.eu>
+Guilhem Bonnefille <guilhem.bonnefille@c-s.fr>
+Guillaume Borrut <guillaume.borrut@c-s.fr>
+Guillaume Pasero <guillaume.pasero@c-s.fr>
+janestar <janestar92@163.com>
+Jee Roen <jeroen.staab@posteo.de>
+Jonathan Guinet <jonathan.guinet@c-s.fr>
+Jordi Inglada <jordi.inglada@cesbio.eu>
+Jordi Inglada <jordi.inglada@cesbio.eu>                   Jordi Inglada <jordi.inglada@cesbio.cnes.fr>
+Jordi Inglada <jordi.inglada@cesbio.eu>                   Jordi Inglada <jordi.inglada@orfeo-toolbox.org>
+Julien Malik <julien.malik@c-s.fr>
+Julien Malik <julien.malik@c-s.fr>                        Julien Malik <julien.malik@gmail.com>
+Julien Malik <julien.malik@c-s.fr>                        Julien Malik <julien.malik@orfeo-toolbox.org>
+Julien Michel <julien.michel@cnes.fr>
+Julien Michel <julien.michel@cnes.fr>                     Julien Michel <julien.michel@c-s.fr>
+Julien Michel <julien.michel@cnes.fr>                     Julien Michel <julien.michel@orfeo-toolbox.org>
+Laurențiu Nicola <grayshade@gmail.com>
+Laurențiu Nicola <grayshade@gmail.com>                    Laurentiu Nicola <lnicola@dend.ro>
+Luc Hermitte <luc.hermitte@c-s.fr>
+Ludovic Hussonnois <ludovic.hussonnois@c-s.fr>
+Manuel Grizonnet <manuel.grizonnet@cnes.fr>
+Manuel Grizonnet <manuel.grizonnet@cnes.fr>               Grizonnet Manuel <manuel.grizonnet@cnes.fr>
+Manuel Grizonnet <manuel.grizonnet@cnes.fr>               Manuel Grizonnet <manuel.grizonnet@gmail.com>
+Manuel Grizonnet <manuel.grizonnet@cnes.fr>               Manuel Grizonnet <manuel.grizonnet@orfeo-toolbox.org>
+Marina Bertolino <marina.bertolino@c-s.fr>
+Mathieu Deltorre <mathieu.deltorre@c-s.fr>
+Mickaël Savinaud <mickael.savinaud@c-s.fr>
+Mickaël Savinaud <mickael.savinaud@c-s.fr>                Mickael Savinaud <mickael.savinaud@c-s.fr>
+Mickaël Savinaud <mickael.savinaud@c-s.fr>                msavinaud <mickael.savinaud@c-s.fr>
+OTB Bot <otbbot@orfeo-toolbox.org>
+Otmane Lahlou <otmane.lahlou@c-s.fr>
+Patrick Imbo <patrick.imbo@c-s.fr>
+Rashad Kanavath <rashad.kanavath@c-s.fr>
+Rashad Kanavath <rashad.kanavath@c-s.fr>                  Rashad Kanavath <mohammed.rashad-km@cnes.fr>
+Rashad Kanavath <rashad.kanavath@c-s.fr>                  Rashad Kanavath <mohammedrashadkm@gmail.com>
+Rashad Kanavath <rashad.kanavath@c-s.fr>                  Rashad Kanavath <rashad.kanavath.email.com>
+Rashad Kanavath <rashad.kanavath@c-s.fr>                  Rashad Kanavath <rashad.kanvath@c-s.fr>
+Rashad Kanavath <rashad.kanavath@c-s.fr>                  Rashad M <rashad.kanavath@c-s.fr>
+Rémi Cresson <remi.cresson@irstea.fr>                     remicres <remi.cresson@teledetection.fr>
+Rémi Cresson <remi.cresson@irstea.fr>                     Remi Cresson <remi.cresson@irstea.fr>
+Rémi Cresson <remi.cresson@irstea.fr>                     remi cresson <remi.cresson@teledetection.fr>
+Rémi Cresson <remi.cresson@irstea.fr>                     remi <remi.cresson@irstea.fr>
+Rémi Cresson <remi.cresson@irstea.fr>                     Rémi <remi.cresson@teledetection.fr>
+Romain Garrigues <romain.garrigues@c-s.fr>
+Rosa Ruiloba <rosario.ruiloba@c-s.fr>
+Sébastien Dinot <sebastien.dinot@c-s.fr>
+Sébastien Dinot <sebastien.dinot@c-s.fr>                  Sebastien Dinot <sebastien.dinot@c-s.fr>
+Sébastien Dinot <sebastien.dinot@c-s.fr>                  Achille Talon <atalon@dinot.net>
+Sebastien Harasse <sebastien.harasse@c-s.fr>
+Stephane Albert <stephane.albert@c-s.fr>
+Stephane Albert <stephane.albert@c-s.fr>                  Stephane Albert <salbert@dora.si.c-s.fr>
+Stephane Albert <stephane.albert@c-s.fr>                  Stephane ALBERT <stephane.albert@c-s.fr>
+Sylvain Poulain <kikislater@users.noreply.github.com>     Sylvain POULAIN <kikislater@users.noreply.github.com>
+Thomas Feuvrier <thomas.feuvrier@c-s.fr>
+Tishampati Dhar <devnull@localhost>
+Victor Poughon <victor.poughon@cnes.fr>
+Vincent Poulain <vincent.poulain@thalesgroup.com>
+Yannick Tanguy <yannick.tanguy@cnes.fr>                   Yannick TANGUY <yannick.tanguy@cnes.fr>
+Yannick Tanguy <yannick.tanguy@cnes.fr>                   Yannick TANGUY <tanguyy@visu01.sis.cnes.fr>
+Yannick Tanguy <yannick.tanguy@cnes.fr>                   ytanguy <yannick.tanguy@cnes.fr>
+Yin Tiangang <crsyt@nus.edu.sg>
diff --git a/.travis.yml b/.travis.yml
index ec99d4dea9a1ee15fcf3db29a8e2d6244e39ab90..cfa41ecef3e3142d344515ca29dec71c4b39d4bc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,23 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 language: cpp
 
 sudo: false
diff --git a/CI/contributors_check.sh b/CI/contributors_check.sh
new file mode 100755
index 0000000000000000000000000000000000000000..d9a6328d4609b8485825ef5b0799eacb4416388b
--- /dev/null
+++ b/CI/contributors_check.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# This script aims to identify the unreferenced authors to invite the team to
+# check if they have already signed the contributor license agreement (CLA).
+# When this is done, the author must be added to the reference list.
+
+
+GITLAB_PROJECT_URL=https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-devutils
+GIT_CONTRIBUTORS=/tmp/git-contributors.txt
+KNOWN_CONTRIBUTORS=/tmp/known-contributors.txt
+UNKNOWN_CONTRIBUTORS=/tmp/unknown-contributors.txt
+
+# According to the Git documentation, the reference ("HEAD" in the present
+# case) must be passed on the command line when the standard input of "git
+# shortlog" command is not a terminal. Without the reference in such
+# situation, the output of "git shortlog" is empty.
+git shortlog -es HEAD | cut -f 2- \
+    | sort -u > ${GIT_CONTRIBUTORS}
+
+curl -s ${GITLAB_PROJECT_URL}/raw/master/CI/contributors/known-contributors.txt \
+    | sort -u > ${KNOWN_CONTRIBUTORS}
+
+diff ${KNOWN_CONTRIBUTORS} ${GIT_CONTRIBUTORS} > ${UNKNOWN_CONTRIBUTORS}
+if [ "$?" -ne "0" ] ; then
+    echo ""
+    echo "WARNING: ***************************************************************"
+    echo "WARNING: Unknown contributors found:"
+    sed -n -e 's,^> ,WARNING: - ,p' ${UNKNOWN_CONTRIBUTORS}
+    echo "WARNING: Check if they have signed the contributor license agreements."
+    echo "WARNING: ***************************************************************"
+    echo ""
+    exit 1
+else
+    echo "All contributors are already known."
+    exit 0
+fi
diff --git a/CI/deploy.sh b/CI/deploy.sh
index e3621361d210e7d5a1f2e3081ed981768db5025d..87ebabc41a358195c81d637878c4deb2101012ad 100755
--- a/CI/deploy.sh
+++ b/CI/deploy.sh
@@ -1,4 +1,24 @@
 #!/bin/bash
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 # Configure git for tar.xz
 git config tar.tar.xz.command "xz -c"
 
@@ -47,7 +67,7 @@ echo "Pushing binary packages"
 scp OTB-*.{run,zip} otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/.
 # Push doc
 echo "Pushing documentation"
-scp {CookBook-*-html.tar.gz,CookBook-*.pdf,OTB-Doxygen-*.tar.bz2} otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/.
+scp {CookBook-*-html.tar.gz,OTB-Doxygen-*.tar.bz2} otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/.
 
 # Create zip, tar.gz and tar.xy source
 echo "Creating source tarball and zip"
diff --git a/CI/dev_env.bat b/CI/dev_env.bat
index 061c9ee0b528531399a17926e184cb48877b5026..c5091ba9163324016bf1e0d914e238e7457413b4 100644
--- a/CI/dev_env.bat
+++ b/CI/dev_env.bat
@@ -1,3 +1,22 @@
+::
+:: Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+::
+:: This file is part of Orfeo Toolbox
+::
+::     https://www.orfeo-toolbox.org/
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+::     http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+
 @echo off
 :: check input arguments
 if %1.==. (
diff --git a/CI/headers_check.py b/CI/headers_check.py
new file mode 100755
index 0000000000000000000000000000000000000000..c61ef7d8335bded6c249c6d49a385b21e757e747
--- /dev/null
+++ b/CI/headers_check.py
@@ -0,0 +1,314 @@
+#!/usr/bin/python3
+#
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import os, re
+
+# Root search directory
+topdir = '.'
+
+# Header to associate to each file extension
+# - C++ and JavaScript comments are defined by /* ... */ (=> C++ header)
+# - Shell, Python, Perl comments are defubed by # ... (=> Shell header)
+# - Text files must be processed on a case-by-case basis according to their
+#   content and what is done with them
+# - It is complicated to insert a comment in an image file and most of them
+#   were not created by the OTB project (=> no header)
+# - There is no need to insert a copyright header in the generated files or
+#   configuration files (=> no header)
+# - Most of CSS files were not created by the OTB project (=> no header)
+# - etc.
+fileext = {
+    '.cpp': 'cpp',
+    '.cxx': 'cpp',
+    '.txx': 'cpp',
+    '.h': 'cpp',
+    '.hpp': 'cpp',
+    '.hxx': 'cpp',
+    '.h.in': 'cpp',
+    '.includes': 'cpp',
+    '.i': 'cpp',
+    '.js': 'cpp',
+    '.sh': 'shell',
+    '.sh.in': 'shell',
+    '.bash': 'shell',
+    '.profile': 'shell',
+    '.py': 'shell',
+    '.py.in': 'shell',
+    '.cmake': 'shell',
+    '.cmake.in': 'shell',
+    '.yml': 'shell',
+    '.pl': 'shell',
+    '.bat': 'batch',
+    '.bat.in': 'batch',
+    '.png': 'none',
+    '.jpg': 'none',
+    '.tif': 'none',
+    '.xpm': 'none',
+    '.ico': 'none',
+    '.eps': 'none',
+    '.svg': 'none',
+    '.txt': 'none',
+    '.md': 'none',
+    '.rst': 'none',
+    '.xml': 'none',
+    '.html': 'none',
+    '.dox': 'none',
+    '.dox.in': 'none',
+    '.ts': 'none',
+    '.ui': 'none',
+    '.qrc': 'none',
+    '.rc': 'none',
+    '.rc.in': 'none',
+    '.css': 'none'
+}
+
+specialfiles = {
+    'CMakeLists.txt': 'shell',       # i.e. CMake file but Shell like comments
+    'StandaloneWrapper.in': 'shell', # i.e. CMake file but Shell like comments
+    'macx_pkgsetup.in': 'shell',
+    'linux_pkgsetup.in': 'shell'
+}
+
+# Directories to exclude from the header checking for various reasons (third
+# party works, data, patches, ...)
+excludeddirs = set([
+    './.git',
+    './Data',
+    './Modules/ThirdParty',
+    './Packaging/makeself',
+    './SuperBuild/Copyright',
+    './SuperBuild/patches'
+])
+
+# Files to exclude from the header checking for various reasons (full text of
+# licenses, binary archives, ...)
+excludedfiles = set([
+    './.clang-format',
+    './.editorconfig',
+    './.gitattributes',
+    './.gitignore',
+    './.mailmap',
+    './sonar-project.properties',
+    './LICENSE',
+    './NOTICE',
+    './VERSION',
+    './CI/ctest2junit.xsl',
+    './CI/test/README',
+    './CMake/CppcheckTargets.cmake',
+    './CMake/FindGLEW.cmake',
+    './CMake/FindKWStyle.cmake',
+    './CMake/FindLibSVM.cmake',
+    './CMake/FindOpenThreads.cmake',
+    './CMake/Findcppcheck.cmake',
+    './CMake/Findcppcheck.cpp',
+    './CMake/GenerateExportHeaderCustom.cmake',
+    './CMake/InsightValgrind-RHEL6.supp',
+    './CMake/InsightValgrind.supp',
+    './CMake/OTB_CheckCCompilerFlag.cmake',
+    './CMake/PythonCompile.py',
+    './CMake/TopologicalSort.cmake',
+    './CMake/exportheader.cmake.in',
+    './CMake/pre-commit',
+    './CMake/qt.conf.in',
+    './Documentation/Cookbook/Art/residual_registration-figure.tex',
+    './Documentation/Cookbook/rst/Makefile.in',
+    './Documentation/Cookbook/rst/conf.py.in',
+    './Modules/Visualization/Ice/README',
+    './Modules/Wrappers/SWIG/src/numpy.i',
+    './Packaging/Files/Monteverdi.icns',
+    './Packaging/Files/OTB Project.zip',
+    './Packaging/Files/qt.conf',
+    './Packaging/Files/template.app/Contents/Info.plist',
+    './Packaging/LICENSE',
+    './Packaging/howto_update_makeself',
+    './Packaging/otb_update_makeself',
+    './SuperBuild/LICENSE',
+    './Utilities/Data/Icons/LICENSE.TXT',
+    './Utilities/Data/Icons/NOTES',
+    './Utilities/Data/monteverdi.desktop.in',
+    './Utilities/Data/monteverdi2.desktop',
+    './Utilities/Doxygen/doxygen.config.in',
+    './Utilities/Maintenance/BuildHeaderTest.py',
+    './Utilities/Maintenance/fix_typos.sh'
+])
+
+regcppheader = re.compile(
+r'''/\*
+( \* Copyright \(C\) 1999-2011 Insight Software Consortium
+| \* Copyright \(C\) 20\d\d(-20\d\d)? Centre National d'Etudes Spatiales \(CNES\)
+| \* Copyright \(C\) 20\d\d(-20\d\d)? CS Systemes d'Information \(CS SI\)
+| \* Copyright \(C\) 2007-2012 Institut Mines Telecom / Telecom Bretagne
+| \* Copyright \(C\) 20\d\d(-20\d\d)? IRSTEA
+| \* Copyright \(C\) 2008 Jan Wegner
+| \* Copyright \(C\) 2007 Julien Radoux
+)+ \*
+ \* This file is part of Orfeo Toolbox
+ \*
+ \*     https://www\.orfeo-toolbox\.org/
+ \*
+ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);
+ \* you may not use this file except in compliance with the License\.
+ \* You may obtain a copy of the License at
+ \*
+ \*     http://www\.apache\.org/licenses/LICENSE-2\.0
+ \*
+ \* Unless required by applicable law or agreed to in writing, software
+ \* distributed under the License is distributed on an "AS IS" BASIS,
+ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
+ \* See the License for the specific language governing permissions and
+ \* limitations under the License\.
+ \*/
+''', flags=re.MULTILINE)
+
+regshellheader = re.compile(
+r'''(.*
+)+(# Copyright \(C\) 1999-2011 Insight Software Consortium
+|# Copyright \(C\) 20\d\d(-20\d\d)? Centre National d'Etudes Spatiales \(CNES\)
+|# Copyright \(C\) 20\d\d(-20\d\d)? CS Systemes d'Information \(CS SI\)
+|# Copyright \(C\) 2007-2012 Institut Mines Telecom / Telecom Bretagne
+)+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www\.orfeo-toolbox\.org/
+#
+# Licensed under the Apache License, Version 2\.0 \(the "License"\);
+# you may not use this file except in compliance with the License\.
+# You may obtain a copy of the License at
+#
+#     http://www\.apache\.org/licenses/LICENSE-2\.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
+# See the License for the specific language governing permissions and
+# limitations under the License\.
+''', flags=re.MULTILINE)
+
+regbatchheader = re.compile(
+r'''(.*
+)+(:: Copyright \(C\) 1999-2011 Insight Software Consortium
+|:: Copyright \(C\) 20\d\d(-20\d\d)? Centre National d'Etudes Spatiales \(CNES\)
+|:: Copyright \(C\) 20\d\d(-20\d\d)? CS Systemes d'Information \(CS SI\)
+|:: Copyright \(C\) 2007-2012 Institut Mines Telecom / Telecom Bretagne
+)+::
+:: This file is part of Orfeo Toolbox
+::
+::     https://www\.orfeo-toolbox\.org/
+::
+:: Licensed under the Apache License, Version 2\.0 \(the "License"\);
+:: you may not use this file except in compliance with the License\.
+:: You may obtain a copy of the License at
+::
+::     http://www\.apache\.org/licenses/LICENSE-2\.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
+:: See the License for the specific language governing permissions and
+:: limitations under the License\.
+''', flags=re.MULTILINE)
+
+
+debug = False
+returnvalue = 0
+
+
+def verifyheader(filename, category):
+
+    global returnvalue
+
+    if category == 'none':
+        if debug: print('File type ignored ({} style comment): {}'.format(category, filename))
+        return True
+
+    sourceFile = open(filename)
+    sourceContent = sourceFile.read().lstrip()
+    sourceFile.close()
+
+    if category == 'cpp':
+        m = regcppheader.match(sourceContent)
+    elif category == 'shell':
+        m = regshellheader.match(sourceContent)
+    elif category == 'batch':
+        m = regbatchheader.match(sourceContent)
+    else:
+        print('WARNING: Unable to evaluate header ({} style comment): {}'.format(category, filename))
+        returnvalue = 1
+        return False
+
+    if m:
+        if debug: print('Conform header ({} style comment): {}'.format(category, filename))
+        return True
+    else:
+        print('WARNING: Non-compliant header ({} style comment): {}'.format(category, filename))
+        returnvalue = 1
+        return False
+
+
+# Regular expression catching the file extension (with patterns '.xxx' or
+# '.xxx.yyy', like '.cmake' or '.cmake.in')
+# NOTE: '+?' operator is the not greedy / hungry version of '+' operator.
+extreg = re.compile(r'^.+?(\.[^.]+(\.[^.]+)?)$')
+
+for root, dirs, files in os.walk(topdir, topdown=True):
+
+    # "dirs[:]" modify dirs "in-place". In doing so, we can ignore some
+    # directories (here, the directories listed in the 'excludeddirs' set.
+    dirs[:] = [d for d in dirs if os.path.join(root, d) not in excludeddirs]
+
+    for f in sorted(files):
+        fullpathname = os.path.join(root, f)
+        # 1. Exclusion of files in which we do not want to search for the
+        #    copyright header.
+        if fullpathname in excludedfiles:
+            if debug: print('File excluded: {}'.format(fullpathname))
+        # 2. Early identification of files with a misleading extension
+        elif f in specialfiles.keys():
+            verifyheader(fullpathname, specialfiles[f])
+        # 3. Processing of other files according to their extension
+        else:
+            m = extreg.match(f)
+            if m:
+                # NOTE: m.group(0) = Whole string matched by the regular
+                # expression (here, the whole name of the file)
+                ext1 = m.group(1) # '.xxx' or '.xxx.yyy' form
+                ext2 = m.group(2) # '.yyy' form (optional and included in group #1)
+
+                # The test of two extensions (ext1, ext2) rather than only one
+                # make possible to distinguish known extensions, such ".cmake"
+                # or ".cmake.in", from patterns that look like a double
+                # extension, but are not, like ".remote.cmake". So, the
+                # appropriate processing can be applied (".remote.cmake" must
+                # be identified as ".cmake" and not as an unknown extension).
+                if ext1 in fileext.keys():
+                    verifyheader(fullpathname, fileext[ext1])
+                elif ext2 in fileext.keys():
+                    verifyheader(fullpathname, fileext[ext2])
+                else:
+                    print('WARNING: File with an unknown extension: {}'.format(fullpathname))
+                    returnvalue = 1
+            else:
+                print('WARNING: File without extension and not excluded: {}'.format(fullpathname))
+                returnvalue = 1
+
+exit(returnvalue)
diff --git a/CI/otb_coverage.sh b/CI/otb_coverage.sh
index 0b5d4b219fdb1584778edf7d8d321b5eca080e20..97af083aa6d571f9d1ad0e6be6f5494f9e2d61ee 100755
--- a/CI/otb_coverage.sh
+++ b/CI/otb_coverage.sh
@@ -1,4 +1,23 @@
 #!/bin/bash
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 # usage : call CI/otb_coverage.sh from source dir
 OTB_DIR="$(dirname $0)/.."
diff --git a/CI/test/cdash_test.py b/CI/test/cdash_test.py
index d64ce9f26c5975d2968edcf9170851fa5dcac447..b179954e6d1ba9889eb12ab9c83aefa8b1535681 100644
--- a/CI/test/cdash_test.py
+++ b/CI/test/cdash_test.py
@@ -1,3 +1,24 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 import unittest
 import os.path
 import sys
@@ -70,4 +91,4 @@ class TestHandler(unittest.TestCase):
 
 
 if __name__ == '__main__':
-  unittest.main()
\ No newline at end of file
+  unittest.main()
diff --git a/CMake/NamespaceHandler.cmake b/CMake/NamespaceHandler.cmake
index ae23e4e82fea36c0c1c347bea6354b569f2c91aa..d9afe3a37948a904589e212476607261bb7cbbf4 100644
--- a/CMake/NamespaceHandler.cmake
+++ b/CMake/NamespaceHandler.cmake
@@ -53,6 +53,7 @@ function(otb_set_namespace folder ns)
     list(APPEND _files_to_process ${_other_targets})
     file(GLOB _module_files "${folder}/Modules/*.cmake")
     list(APPEND _files_to_process ${_module_files})
+    list(APPEND _files_to_process "${folder}/OTBStandaloneModuleMacros.cmake")
 
     # patch each file
     foreach(_file_path ${_files_to_process})
@@ -87,6 +88,16 @@ function(otb_set_namespace folder ns)
           string(REPLACE ")" " )" _filtered_line "${_filtered_line}")
           ns_filter_line()
           string(REPLACE " )" ")" _filtered_line "${_filtered_line}")
+        elseif(_filtered_line MATCHES "<TARGET_FILE:")
+          set(_t_prefix "TARGET_FILE:")
+          set(_t_suffix ">")
+          ns_filter_line()
+        elseif(_filtered_line MATCHES "add_dependencies")
+          set(_t_prefix " ")
+          set(_t_suffix " ")
+          string(REPLACE ")" " )" _filtered_line "${_filtered_line}")
+          ns_filter_line()
+          string(REPLACE " )" ")" _filtered_line "${_filtered_line}")
         endif()
         list(APPEND _file_filtered_content ${_filtered_line})
       endforeach()
diff --git a/CMake/OTBApplicationMacros.cmake b/CMake/OTBApplicationMacros.cmake
index c4b4fc44b71cee0264fc632f710f78270ef810ae..6e735760fc8e5dadc0bc0ff48f95a0dd3ccddb4f 100644
--- a/CMake/OTBApplicationMacros.cmake
+++ b/CMake/OTBApplicationMacros.cmake
@@ -26,7 +26,7 @@ macro(otb_create_application)
    # Build the library as a MODULE (shared lib even if OTB is built statically)
    include_directories(${APPLICATION_INCLUDE_DIRS})
    add_library(${APPLICATION_TARGET_NAME} MODULE ${APPLICATION_SOURCES})
-   target_link_libraries(${APPLICATION_TARGET_NAME} OTBApplicationEngine ${APPLICATION_LINK_LIBRARIES})
+   target_link_libraries(${APPLICATION_TARGET_NAME} ${APPLICATION_LINK_LIBRARIES})
    if(otb-module)
      otb_module_target_label(${APPLICATION_TARGET_NAME})
    endif()
diff --git a/CMake/otbcli.bat.in b/CMake/otbcli.bat.in
index 3016c022e474338576c20cea114da8662d247045..d9dbaff9a2c40696c6a5e96335fe90ef08ae8ffc 100644
--- a/CMake/otbcli.bat.in
+++ b/CMake/otbcli.bat.in
@@ -1,3 +1,22 @@
+::
+:: Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+::
+:: This file is part of Orfeo Toolbox
+::
+::     https://www.orfeo-toolbox.org/
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+::     http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+
 @echo off
 ::
 :: Autogenerated by OTB installation process
diff --git a/CMake/otbcli.sh.in b/CMake/otbcli.sh.in
index 65bec6865398591429712c71c636bed7b1abdeb6..c16bd6060121483eaa66088981727fb691f30bf3 100644
--- a/CMake/otbcli.sh.in
+++ b/CMake/otbcli.sh.in
@@ -1,4 +1,23 @@
 #!/bin/sh
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 #
 # Autogenerated by OTB installation process
diff --git a/CMake/otbgui.bat.in b/CMake/otbgui.bat.in
index a450ce7881e68eff1a4d718155d1c7e63149fe82..acaf9a41f450a2c1f1172149bab007416702b256 100644
--- a/CMake/otbgui.bat.in
+++ b/CMake/otbgui.bat.in
@@ -1,3 +1,22 @@
+::
+:: Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+::
+:: This file is part of Orfeo Toolbox
+::
+::     https://www.orfeo-toolbox.org/
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+::     http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+
 @echo off
 ::
 :: Autogenerated by OTB installation process
diff --git a/CMake/otbgui.sh.in b/CMake/otbgui.sh.in
index 8633efad8cb9097ab3caf34b9c80a91a18f129d7..6e4d81ea176a5c9d43b3e25253cda87114f68ef6 100644
--- a/CMake/otbgui.sh.in
+++ b/CMake/otbgui.sh.in
@@ -1,4 +1,23 @@
 #!/bin/sh
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 #
 # Autogenerated by OTB installation process
diff --git a/Data/Baseline/OTB-Applications/Images/apTvClPredictRegressionTest_monovar.tif b/Data/Baseline/OTB-Applications/Images/apTvClImageRegressionTest_monovar.tif
similarity index 100%
rename from Data/Baseline/OTB-Applications/Images/apTvClPredictRegressionTest_monovar.tif
rename to Data/Baseline/OTB-Applications/Images/apTvClImageRegressionTest_monovar.tif
diff --git a/Data/Baseline/OTB/Images/apTvChDimensionalityReductionPCA.tif b/Data/Baseline/OTB/Images/apTvChDimensionalityReductionPCA.tif
new file mode 100644
index 0000000000000000000000000000000000000000..c694726c2717746b6b9dbc678830a5f2723bcd0a
--- /dev/null
+++ b/Data/Baseline/OTB/Images/apTvChDimensionalityReductionPCA.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c12364434ffad8319d964d79a467f6eee094c2472a72234bb6b86a9673bec437
+size 180416
diff --git a/Data/Baseline/OTB/Images/bfTvPCAImageFilter3Norm.tif b/Data/Baseline/OTB/Images/bfTvPCAImageFilter3Norm.tif
index 466bd1d886ae000064b0a0208177d079c97f9cf1..2d918a952e15a63f4bf4e6b09e38e533473f8ef9 100644
--- a/Data/Baseline/OTB/Images/bfTvPCAImageFilter3Norm.tif
+++ b/Data/Baseline/OTB/Images/bfTvPCAImageFilter3Norm.tif
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:1cd38ed0a735e6e7e332237b02982d955a44759565c5892381e508a9859f1628
-size 450331
+oid sha256:7f42429c4f3375ba587c64078a8ebfd08f8b864d104fd14efb8bd9285f074b06
+size 360816
diff --git a/Data/Baseline/OTB/Images/bfTvPCAImageFilter4InvNorm.tif b/Data/Baseline/OTB/Images/bfTvPCAImageFilter4InvNorm.tif
index f01499d2690a5498128e939f3b2b499c5c97f10c..884d6b1670fb03a5d108316d832b9af17a3822d2 100644
--- a/Data/Baseline/OTB/Images/bfTvPCAImageFilter4InvNorm.tif
+++ b/Data/Baseline/OTB/Images/bfTvPCAImageFilter4InvNorm.tif
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:3f8a7ac9f4e604573cb693afe0208adfd09af409be9446c42626453574de6993
-size 429742
+oid sha256:5bfcdfb81cff472ceb447e39fc5a6718224805de34106ecb477535fec8506b84
+size 360816
diff --git a/Data/Baseline/OTB/Images/bfTvPCAImageFilter4Norm.tif b/Data/Baseline/OTB/Images/bfTvPCAImageFilter4Norm.tif
index 253afa7ec9d0b3fda9468201a9d08eff61c6430d..6b36f055b2d5745b5e6056b34a052d85f6503dbe 100644
--- a/Data/Baseline/OTB/Images/bfTvPCAImageFilter4Norm.tif
+++ b/Data/Baseline/OTB/Images/bfTvPCAImageFilter4Norm.tif
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b071be1eae39fa5a77f9c0851cfa5b02e459e29b351a13da995db7174c5d4412
-size 181939
+oid sha256:538cd26eb6c8a6da6fff2799f090e6d5ef28cad9aca0d0aa813c35c33507b24d
+size 144332
diff --git a/Documentation/Cookbook/CMake/RunApplicationsRstGenerator.sh.cmake.in b/Documentation/Cookbook/CMake/RunApplicationsRstGenerator.sh.cmake.in
index cf902c1eb10149d74def84663547781abf0dbee4..18463d6cb437180088c2137eb04d6220aa7aeeed 100644
--- a/Documentation/Cookbook/CMake/RunApplicationsRstGenerator.sh.cmake.in
+++ b/Documentation/Cookbook/CMake/RunApplicationsRstGenerator.sh.cmake.in
@@ -1,4 +1,23 @@
 #!/bin/sh
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 #cmake builds with rpath in the binary dir, so we don't need to set LD_LIBRARY_PATH here
 #export LD_LIBRARY_PATH=@CMAKE_BINARY_DIR@/lib:$LD_LIBRARY_PATH
diff --git a/Documentation/Cookbook/CMakeLists.txt b/Documentation/Cookbook/CMakeLists.txt
index 4cda32d6e10e4e9c2f09325f3c28795094bb968c..3fa45410783b13145a0bf6d72be6c4408339ddd9 100644
--- a/Documentation/Cookbook/CMakeLists.txt
+++ b/Documentation/Cookbook/CMakeLists.txt
@@ -45,23 +45,15 @@ mark_as_advanced(SH_INTERP)
 # so in calls to add_custom_target() below, we call them directly.
 # See CMake bug: https://gitlab.kitware.com/cmake/cmake/issues/18302
 
-find_program(LATEX_COMMAND NAMES latex)
-mark_as_advanced(LATEX_COMMAND)
-
 find_program(TAR_COMMAND NAMES tar)
 mark_as_advanced(TAR_COMMAND)
 
-find_program(PDFLATEX_COMMAND NAMES pdflatex )
-mark_as_advanced(PDFLATEX_COMMAND)
-
 find_program(MAKEINDEX_COMMAND NAMES makeindex )
 mark_as_advanced(MAKEINDEX_COMMAND)
 
 # Check that we found everything we need
 foreach(cmd
-    LATEX_COMMAND
     TAR_COMMAND
-    PDFLATEX_COMMAND
     MAKEINDEX_COMMAND
     SH_INTERP)
   if(NOT ${cmd})
@@ -71,13 +63,11 @@ endforeach()
 
 set(RST_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR}/rst)
 set(RST_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR}/rst)
-set(LATEX_DIR       ${CMAKE_CURRENT_BINARY_DIR}/latex)
 set(HTML_DIR        ${CMAKE_CURRENT_BINARY_DIR}/html)
 
 # Print summary of Cookbook configuration
 message(STATUS "RST_SOURCE_DIR = ${RST_SOURCE_DIR}")
 message(STATUS "RST_BINARY_DIR = ${RST_BINARY_DIR}")
-message(STATUS "LATEX_DIR = ${LATEX_DIR}")
 message(STATUS "HTML_DIR = ${HTML_DIR}")
 
 # Clean any existing build
@@ -93,7 +83,6 @@ remove_and_make_directories(
   ${RST_BINARY_DIR}
   ${RST_BINARY_DIR}/Applications/
   ${HTML_DIR}
-  ${LATEX_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}/_static
   )
 
@@ -167,28 +156,3 @@ add_custom_target(CookBookArchive
   DEPENDS CookBookHTML
   COMMENT "Creating archive for html CookBook")
 
- add_custom_target(CookBookTexFromRST
-   COMMAND sphinx-build
-   -b latex
-   ${RST_BINARY_DIR}
-   ${LATEX_DIR}
-   -v
-   -c ${SPHINX_CONF_DIR}
-   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-   DEPENDS CookBookHTML
-   COMMENT "Generating Tex files from rst"
-   VERBATIM)
-
-set(COOKBOOK_TEX CookBook-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH})
-
- add_custom_target(CookBookPDF
-   ALL
-   COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
-   COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
-   COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
-   COMMAND ${MAKEINDEX_COMMAND} -s python.ist "${COOKBOOK_TEX}.idx" || true
-   COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
-   COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
-   WORKING_DIRECTORY ${LATEX_DIR}
-   DEPENDS CookBookTexFromRST
-   COMMENT "Building RST documentation in pdf")
diff --git a/Documentation/Cookbook/Scripts/migrate_sg_tex.py b/Documentation/Cookbook/Scripts/migrate_sg_tex.py
index a4faa2d1aca5836ac2fd5afea499e4f7eedce2dc..27d5a890c0929a6332e6f4ec23e17222661b4233 100644
--- a/Documentation/Cookbook/Scripts/migrate_sg_tex.py
+++ b/Documentation/Cookbook/Scripts/migrate_sg_tex.py
@@ -1,3 +1,24 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 import argparse
 import re
 import os
diff --git a/Documentation/Cookbook/Scripts/otb_warnings.py b/Documentation/Cookbook/Scripts/otb_warnings.py
index 1bace05986cf4cb357b89bd797697d1002695450..053a99f7525cc2ce91a7c476dd0325b78723285b 100644
--- a/Documentation/Cookbook/Scripts/otb_warnings.py
+++ b/Documentation/Cookbook/Scripts/otb_warnings.py
@@ -1,3 +1,24 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 import sys
 import re
 
diff --git a/Documentation/Cookbook/Scripts/rst_utils.py b/Documentation/Cookbook/Scripts/rst_utils.py
index 42cf7683d00ed9e9a0acbb07bb2031dc54268537..760819ae90a7814a0c100710b8328f7430122919 100644
--- a/Documentation/Cookbook/Scripts/rst_utils.py
+++ b/Documentation/Cookbook/Scripts/rst_utils.py
@@ -1,3 +1,23 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 # Regex used to find examples usage
 examples_usage_regex = r"\/\* Example usage:\n(\.\/\w+ (.*?))\*\/"
diff --git a/Documentation/Cookbook/_static/js/versions.js b/Documentation/Cookbook/_static/js/versions.js
index 69e4743c6364964f1f4a2f96a1ca49a60cbb7cb0..1144ae792742eee42c8ad2f3155d6fd0451758fc 100644
--- a/Documentation/Cookbook/_static/js/versions.js
+++ b/Documentation/Cookbook/_static/js/versions.js
@@ -1,3 +1,22 @@
+/*
+ * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 // This piece of javascript is used to display the versions widget at the lower
 // left corner of the html CookBook for OTB
diff --git a/Documentation/Cookbook/rst/C++/FunctorImageFilter.rst b/Documentation/Cookbook/rst/C++/FunctorImageFilter.rst
index 95fd6124f8c02481e07b7313481c677bbabd01ec..9a9e736f0043e6d20befadd75ff595261629d6ec 100644
--- a/Documentation/Cookbook/rst/C++/FunctorImageFilter.rst
+++ b/Documentation/Cookbook/rst/C++/FunctorImageFilter.rst
@@ -142,7 +142,7 @@ This is strictly equivalent to:
 
 .. code-block:: cpp
 
-    void myFreeFunction(const itk::VariableLengthVector<double> & out ,
+    void myFreeFunction(itk::VariableLengthVector<double> & out ,
                         unsigned char a, 
                         const std::complex<float> & b,
                         const itk::VariableLengthVector<short> &c,
diff --git a/Documentation/Cookbook/rst/conf.py.in b/Documentation/Cookbook/rst/conf.py.in
index 3f02cb4fc7edaa321730746c0c273fe596bd4c8a..f4658fb28e98bb46be1f50adad7c9066e65ec49c 100644
--- a/Documentation/Cookbook/rst/conf.py.in
+++ b/Documentation/Cookbook/rst/conf.py.in
@@ -43,8 +43,6 @@ extensions = [
     'sphinx.ext.extlinks',
 ]
 
-imgmath_latex='@LATEX_COMMAND@'
-
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
@@ -207,48 +205,6 @@ html_show_copyright = True
 htmlhelp_basename = 'OTBCookBookdoc'
 
 
-# -- Options for LaTeX output ---------------------------------------------
-
-latex_elements = {
-  'inputenc': '\\usepackage[latin10,utf8]{inputenc}',
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-  'preamble': '\\DeclareUnicodeCharacter{021B}{\\textcommabelow t}'
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-#  author, documentclass [howto, manual, or own class]).
-latex_documents = [
-  ('index', 'CookBook-@OTB_VERSION_MAJOR@.@OTB_VERSION_MINOR@.@OTB_VERSION_PATCH@.tex', u'OTB CookBook Documentation',
-   u'OTB Team', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
 
 # -- Options for manual page output ---------------------------------------
 
@@ -262,30 +218,6 @@ man_pages = [
 # If true, show URL addresses after external links.
 #man_show_urls = False
 
-
-# -- Options for Texinfo output -------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-#  dir menu entry, description, category)
-texinfo_documents = [
-  ('index', 'OTBCookBook', u'OTB CookBook Documentation',
-   u'OTB Team', 'OTBCookBook', 'One line description of project.',
-   'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-# If true, do not generate a @detailmenu in the "Top" node's menu.
-#texinfo_no_detailmenu = False
-
 extlinks = {
     'doxygen': ("http://www.orfeo-toolbox.org/doxygen/classotb_1_1%s.html", "otb::"),
     'doxygen-itk': ("http://www.itk.org/Doxygen/html/classitk_1_1%s.html", "itk::")
diff --git a/Documentation/Cookbook/rst/index.rst b/Documentation/Cookbook/rst/index.rst
index 58b037e61b7ef9c8ec4a45f6577e2460e5a78d8b..86acf4e88184b219f736fb51732477acc14f4a3f 100644
--- a/Documentation/Cookbook/rst/index.rst
+++ b/Documentation/Cookbook/rst/index.rst
@@ -68,6 +68,7 @@ Table of Contents
     recipes/featextract.rst
     recipes/stereo.rst
     recipes/hyperspectral.rst
+    recipes/bandmathX.rst
 
 .. toctree::
     :maxdepth: 1
@@ -76,7 +77,6 @@ Table of Contents
     C++/SystemOverview.rst
     C++/Tutorial.rst
     C++/UserGuide.rst
-    C++/AboutBandMathX.rst
     C++/Examples.rst
 
     C++/DeveloperGuide.rst
diff --git a/Documentation/Cookbook/rst/C++/AboutBandMathX.rst b/Documentation/Cookbook/rst/recipes/bandmathX.rst
similarity index 51%
rename from Documentation/Cookbook/rst/C++/AboutBandMathX.rst
rename to Documentation/Cookbook/rst/recipes/bandmathX.rst
index 0af61d7ea144bc0e35060987e53c846913377940..cb8582a69f360328e3c71d379a63d9c8328d010e 100644
--- a/Documentation/Cookbook/rst/C++/AboutBandMathX.rst
+++ b/Documentation/Cookbook/rst/recipes/bandmathX.rst
@@ -1,74 +1,74 @@
-.. highlight:: c++
+Operations on images with BandMath and BandMathX
+================================================
 
-About BandMathX
-===============
+Simple calculus using BandMath
+------------------------------
 
-This section describes how to use the :doxygen:`BandMathXImageFilter`.
-
-Fundamentals: headers, declaration and instantiation
-----------------------------------------------------
-
-A simple example is given below:
+The *BandMath* application provides a simple and efficient way to
+perform pixel wise operations. It computes a band wise
+operation according to a user defined mathematical expression. The
+following code computes the absolute difference between first bands of
+two images.
 
 ::
 
+    otbcli_BandMath -il input_image_1 input_image_2
+                    -exp "abs(im1b1 - im2b1)"
+                    -out output_image
 
-    #include "otbBandMathImageFilterX.h"
-    #include "otbVectorImage.h"
+The naming convention “im[x]b[y]” designates the yth band of the xth
+input image.
 
+The *BandMath* application embeds built-in operators and functions
+listed in `muparser documentation <https://beltoforion.de/article.php?a=muparser&p=features&s=idDef1#idDef1>`_ thus
+allowing a vast choice of possible operations.
 
-As we can see, the new band math filter works with the class
-otb::VectorImage.
 
-.. _syntax:
+Advanced image operations using BandMathX
+-----------------------------------------
 
-Syntax: first elements
-----------------------
-
-The default prefix name for variables related to the ith input is
-*im(i+1)* (note the indexing from 1 to N, for N inputs). The user has
-the possibility of changing this default behaviour by setting its own
-prefix.
+One limitation of the *BandMath* application is that it can only output mono-band images, because the mu-parser library
+only support scalar expressions. In contrast, the *BandMathX* application based on the *mu-parserX* library can output both mono and
+multi band images, and supports expressions containing scalars, vectors and matrices. The following code compute the difference
+between two images:
 
 ::
 
+    otbcli_BandMathX -il input_image_1 input_image_2
+                    -exp "im1 - im2"
+                    -out output_image
 
-    // All variables related to image1 (input 0) will have the prefix im1
-    filter->SetNthInput(0, image1);
 
-    // All variables related to image2 (input 1) will have the prefix  toulouse
-    filter->SetNthInput(1, image2, "toulouse");
+The output image produced by this application has the same number of bands as the input images, and each resulting band contains
+the difference between the corresponding bands in the input images.
 
-    // All variables related to anotherImage (input 2) will have the prefix im3
-    filter->SetNthInput(2, anotherImage);
 
-In this document, we will keep the default convention. The following list
-summarises the available variables for input #0 (and so on for every
-input).
+Syntax: first elements
+~~~~~~~~~~~~~~~~~~~~~~
 
 Variables and their descriptions:
 
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| Variables             | Description                                                                          | Type     |
-+=======================+======================================================================================+==========+
-| im1                   | a pixel from first input, made of n components/bands (first image is indexed by 1)   | Vector   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| im1bj                 | jth component of a pixel from first input (first band is indexed by 1)               | Scalar   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| im1bjNkxp             | a neighbourhood (”N”) of pixels of the jth component from first input, of size kxp   | Matrix   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| im1bjMini             | global statistic: minimum of the jth band from first input                           | Scalar   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| im1bjMaxi             | global statistic: maximum of the jth band from first input                           | Scalar   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| im1bjMean             | global statistic: mean of the jth band from first input                              | Scalar   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| im1bjSum              | global statistic: sum of the jth band from first input                               | Scalar   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| im1bjVar              | global statistic: variance of the jth band from first input                          | Scalar   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
-| im1PhyX and im1PhyY   | spacing of first input in X and Y directions                                         | Scalar   |
-+-----------------------+--------------------------------------------------------------------------------------+----------+
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| Variables             | Type     | Description                                                                          |
++=======================+==========+======================================================================================+
+| im1                   | Vector   | a pixel from first input, made of n components/bands (first image is indexed by 1)   |
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| im1bj                 | Scalar   | jth component of a pixel from first input (first band is indexed by 1)               |
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| im1bjNkxp             | Matrix   | a neighborhood (”N”) of pixels of the jth component from first input, of size kxp    |
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| im1bjMini             | Scalar   | global statistic: minimum of the jth band from first input                           |
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| im1bjMaxi             | Scalar   | global statistic: maximum of the jth band from first input                           |
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| im1bjMean             | Scalar   | global statistic: mean of the jth band from first input                              |
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| im1bjSum              | Scalar   | global statistic: sum of the jth band from first input                               |
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| im1bjVar              | Scalar   | global statistic: variance of the jth band from first input                          |
++-----------------------+----------+--------------------------------------------------------------------------------------+
+| im1PhyX and im1PhyY   | Scalar   | spacing of first input in X and Y directions                                         |
++-----------------------+----------+--------------------------------------------------------------------------------------+
 
 In addition, we also have the generic variables idxX and idxY that
 represent the indices of the current pixel (scalars).
@@ -88,7 +88,7 @@ represents a pixel of an image made of only one band:
 .. math:: im1+1
 
 A scalar can’t be added to a vector. The right formula is instead (one
-can notice the way that muParserX allows vectors to be defined on the fly):
+can notice the way that *muParserX* allows vectors to be defined on the fly):
 
 .. math:: im1+\{ 1 \}
 
@@ -135,19 +135,23 @@ Concerning division, this operation is not originally defined between
 two vectors (see next section :ref:`operators`).
 
 Now, let’s go back to the first formula: this one specifies the addition
-of two images band to band. With muParserX lib, we can now define such
+of two images band to band. With *muParserX* lib, we can now define such
 operation with only one formula, instead of many formulas (as many as
 the number of bands). We call this new functionality the **batch mode**,
-which directly arises from the introduction of vectors within muParserX
+which directly arises from the introduction of vectors within *muParserX*
 framework.
 
-Finally, let’s say a few words about neighbourhood variables. These
+
+Operations using neighborhoods
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Let’s say a few words about neighborhood variables. These
 variables are defined for each particular input, and for each particular
-band. The two last numbers, kxp, indicate the size of the neighbourhood.
-All neighbourhoods are centred: this means that k and p can only be odd
+band. The two last numbers, kxp, indicate the size of the neighborhood.
+All neighborhoods are centered: this means that k and p can only be odd
 numbers. Moreover, k represents the dimension in the x direction (number
 of columns), and p the dimension in the y direction (number of rows).
-For instance, im1b3N3x5 represents the following neighbourhood:
+For instance, im1b3N3x5 represents the following neighborhood:
 
 +-----+-----+-----+
 | .   | .   | .   |
@@ -162,17 +166,41 @@ For instance, im1b3N3x5 represents the following neighbourhood:
 +-----+-----+-----+
 
 
-Fundamentally, a neighbourhood is represented as a matrix inside the
-muParserX framework; so the remark about mathematically well-defined
+For example, the following code subtract the mean value in a 3x3 neighborhood
+around each pixel to the pixel value, using the first band of the input image:
+
+::
+
+    otbcli_BandMathX -il input_image_1 input_image_2
+                    -exp "im1b1 - mean(im1b1N3x3)"
+                    -out output_image
+
+Fundamentally, a neighborhood is represented as a matrix inside the
+*muParserX* framework; so the remark about mathematically well-defined
 formulas still stands.
 
+Operations involving bit manipulation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sometimes, manipulating bits instead of real numbers is useful. For instance, multiple binary masks are sometime stored altogether
+in a mono-band integer image.
+
+In order to manipulate bit, one need to convert its data into integer (because the data is read as floating point numbers).
+To do so, *muParserX* has a type conversions operator: (int). Prefixing 
+your images with it will allow you to perform such operations.
+
+Example:
+  - ``(int)im1b1 & 0b00000001`` (bitwise and)
+  - ``(int)im1b1 >> 1`` (right shift operator)
+
+
 .. _operators:
 
 New operators and functions
----------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-New operators and functions have been implemented within
-BandMathImageFilterX. These ones can be divided into two categories.
+In addition to the operators and functions available in *muParserX* (https://beltoforion.de/article.php?a=muparserx),
+new ones have been implemented within OTB. These ones can be divided into two categories:
 
 -  adaptation of existing operators/functions, that were not originally
    defined for vectors and matrices (for instance cos, sin, ...). These
@@ -185,7 +213,7 @@ Concerning the last category, here is a list of implemented operators or
 functions (they are all implemented in otbParserXPlugins.h/.cxx files
 `OTB/Modules/Filtering/MathParserX`):
 
-**Operators div and dv** The first operator allows the definition of an
+**Operators div and dv:** The first operator allows the definition of an
 element-wise division of two vectors (and even matrices), provided that
 they have the same dimensions. The second one allows the definition of
 the division of a vector/matrix by a scalar (components are divided by
@@ -193,20 +221,14 @@ the same unique value). For instance:
 
 .. math:: im1 ~ div ~ im2
 
-.. math:: im1 ~ dv ~ 2.0
 
-**Operators mult and mlt** These operators are the duals of the previous
+**Operators mult and mlt:** These operators are the duals of the previous
 ones. For instance:
 
 .. math:: im1 ~  mult ~ im2
 
-.. math:: im1 ~  mlt ~ 2.0
-
-Note that the operator ’\*’ could have been used instead of ’pw’ one.
-But ’pw’ is a little bit more permissive, and can tolerate a
-one-dimensional vector as the right operand.
 
-**Operators pow and pw** The first operator allows the definition of an
+**Operators pow and pw:** The first operator allows the definition of an
 element-wise exponentiation of two vectors (and even matrices), provided
 that they have the same dimensions. The second one allows the definition
 of the division of a vector/matrix by a scalar (components are
@@ -216,7 +238,11 @@ exponentiated by the same unique value). For instance:
 
 .. math:: im1 ~ pw ~ 2.0
 
-**Function bands** This function allows to select specific bands from an
+Note that the operator ’\*’ could have been used instead of ’pw’.
+But ’pw’ is a little bit more permissive, and can tolerate a
+one-dimensional vector as the right operand.
+
+**Function bands:** This function allows to select specific bands from an
 image, and/or to rearrange them in a new vector; for instance:
 
 .. math:: bands(im1,\{1,2,1,1\})
@@ -225,8 +251,8 @@ produces a vector of 4 components made of band 1, band 2, band 1 and
 band 1 values from the first input. Note that curly brackets must be
 used in order to select the desired band indices.
 
-**Function dotpr** This function allows the dot product between two
-vectors or matrices (actually in our case, a kernel and a neighbourhood
+**Function dotpr:** This function allows the dot product between two
+vectors or matrices (actually in our case, a kernel and a neighborhood
 of pixels):
 
 .. math:: \sum_{(i,j)} m_1(i,j)*m_2(i,j)
@@ -236,9 +262,8 @@ For instance:
 .. math:: dotpr(kernel1,im1b1N3x5)
 
 is correct provided that kernel1 and im1b1N3x5 have the same dimensions.
-The function can take as many neighbourhoods as needed in inputs.
 
-**Function mean** This function allows to compute the mean value of a
+**Function mean:** This function allows to compute the mean value of a
 given vector or neighborhood (the function can take as many inputs as
 needed; one mean value is computed per input). For instance:
 
@@ -247,38 +272,38 @@ needed; one mean value is computed per input). For instance:
 Note: a limitation coming from muparserX itself makes it impossible to pass
 all those neighborhoods with a unique variable.
 
-**Function var** This function computes the variance of a given
+**Function var:** This function computes the variance of a given
 vector or neighborhood (the function can take as many inputs as needed;
 one var value is computed per input). For instance:
 
 .. math:: var(im1b1N3x3)
 
-**Function median** This function computes the median value of
+**Function median:** This function computes the median value of
 a given vector or neighborhood (the function can take as many inputs as
 needed; one median value is computed per input). For instance:
 
 .. math:: median(im1b1N3x3)
 
-**Function corr** This function computes the correlation
+**Function corr:** This function computes the correlation
 between two vectors or matrices of the same dimensions (the function
 takes two inputs). For instance:
 
 .. math:: corr(im1b1N3x3,im1b2N3x3)
 
-**Function maj** This function computes the most represented
+**Function maj:** This function computes the most represented
 element within a vector or a matrix (the function can take as many
 inputs as needed; one maj element value is computed per input). For
 instance:
 
 .. math:: maj(im1b1N3x3,im1b2N3x3)
 
-**Function vmin and vmax** These functions calculate the min or
+**Function vmin and vmax:** These functions calculate the min or
 max value of a given vector or neighborhood (only one input, the output is a 1x1 matrix). For
 instance:
 
 .. math:: (vmax(im3b1N3x5)+vmin(im3b1N3x5)) ~ div ~ \{2.0\}
 
-**Function cat** This function concatenates the results of
+**Function cat:** This function concatenates the results of
 several expressions into a multidimensional vector, whatever their
 respective dimensions (the function can take as many inputs as needed).
 For instance:
@@ -289,11 +314,10 @@ Note: the user should prefer the use of semi-colons (;) when setting
 expressions, instead of directly use this function. The filter or the
 application will call the function ’cat’ automatically. For instance:
 
-.. math:: filter->SetExpression("im3b1 ; vmin(im3b1N3x5) ; median(im3b1N3x5) ; vmax(im3b1N3x5)");
+.. math:: im3b1 ; vmin(im3b1N3x5) ; median(im3b1N3x5) ; vmax(im3b1N3x5)
 
-Please, also refer to the next section :ref:`API`. 
 
-**Function ndvi** This function implements the classical normalized
+**Function ndvi:** This function implements the classical normalized
 difference vegetation index; it takes two inputs. For instance:
 
 .. math:: ndvi(im1b1,im1b4)
@@ -301,7 +325,7 @@ difference vegetation index; it takes two inputs. For instance:
 First argument is related to the visible red band, and the second one to
 the near-infrared band.
 
-The table below summarises the different functions and operators.
+The table below summarizes the different functions and operators.
 
 Functions and operators summary:
 
@@ -332,166 +356,54 @@ Functions and operators summary:
 +----------------+-------------------------------------------------------------------------------+
 | pow and pw     | operators                                                                     |
 +----------------+-------------------------------------------------------------------------------+
-| vnorm          | adapation of an existing function to vectors: one input                       |
+| vnorm          | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vabs           | adapation of an existing function to vectors: one input                       |
+| vabs           | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vmin           | adapation of an existing function to vectors: one input                       |
+| vmin           | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vmax           | adapation of an existing function to vectors: one input                       |
+| vmax           | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vcos           | adapation of an existing function to vectors: one input                       |
+| vcos           | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vsin           | adapation of an existing function to vectors: one input                       |
+| vsin           | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vtan           | adapation of an existing function to vectors: one input                       |
+| vtan           | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vtanh          | adapation of an existing function to vectors: one input                       |
+| vtanh          | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vsinh          | adapation of an existing function to vectors: one input                       |
+| vsinh          | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vcosh          | adapation of an existing function to vectors: one input                       |
+| vcosh          | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vlog           | adapation of an existing function to vectors: one input                       |
+| vlog           | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vlog10         | adapation of an existing function to vectors: one input                       |
+| vlog10         | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vexp           | adapation of an existing function to vectors: one input                       |
+| vexp           | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
-| vsqrt          | adapation of an existing function to vectors: one input                       |
+| vsqrt          | adaptation of an existing function to vectors: one input                      |
 +----------------+-------------------------------------------------------------------------------+
 | vect2scal      | one dimensional vector to scalar                                              |
 +----------------+-------------------------------------------------------------------------------+
 
-.. _API: 
-
-Application Programming Interface (API)
----------------------------------------
-
-In this section, we make some comments about the public member functions
-of the new band math filter.
-
-::
+Context and Constant
+~~~~~~~~~~~~~~~~~~~~
 
-    /** Set the nth filter input with or without a specified associated variable name */
-    void SetNthInput( unsigned int idx, const ImageType * image);
-    void SetNthInput( unsigned int idx, const ImageType * image, const std::string& varName);
-
-    /** Return a pointer on the nth filter input */
-    ImageType * GetNthInput(unsigned int idx);
-
-Refer to the section :ref:`syntax`, where the
-two first functions have already been commented. The function
-GetNthInput is quite clear to understand.
-
-::
-
-    /** Set an expression to be parsed */
-    void SetExpression(const std::string& expression);
-
-Each time the function SetExpression is called, a new expression is
-pushed inside the filter. **There are as many outputs as there are
-expressions. The dimensions of the outputs (number of bands) are totally
-dependent on the dimensions of the related expressions (see also last
-remark of the section :ref:`syntax`).** Thus,
-the filter always performs a pre-evaluation of each expression, in order
-to guess how to allocate the outputs.
-
-The concatenation of the results of many expressions (whose results can
-have different dimensions) into one unique output is possible. For that
-purpose, semi-colons (“;”) are used as separating characters. For
-instance:
-
-::
-
-    filter->SetExpression("im1 + im2 ; im1b1*im2b1");
-
-will produce a unique output (one expression) of many bands (actually,
-number of bands of im1 + 1).
-
-::
-
-    /** Return the nth expression to be parsed */
-    std::string GetExpression(int) const;
-
-This function allows the user to get any expression by its ID number.
-
-::
-
-    /** Set a matrix (or a vector) */
-    void SetMatrix(const std::string& name, const std::string& definition);
-
-This function allows the user to set new vectors or matrices. This is
-particularly useful when the user wants to use the dotpr function (see
-previous section). First argument is related to the name of the
-variable, and the second one to the definition of the vector/matrix. The
-definition is done by a string, where first and last elements must be
-curly brackets (“{” and “}”). Different elements of a row are separated
-by commas (“,”), and different rows are separated by semi-colons (“;”).
+Thanks to the `-incontext` one can pass constant value to the application in 
+order to use it in the expression. For the definition
+of constants, the following pattern must be observed: #type name value.
 For instance:
 
 ::
 
-    filter->SetMatrix("kernel1","{ 0.1 , 0.2 , 0.3 ; 0.4 , 0.5 , 0.6 ; \
-    0.7 , 0.8 , 0.9 ; 1.0 , 1.1 , 1.2 ; 1.3 , 1.4 , 1.5 }");
-
-defines the kernel1, whose elements are given as follows:
-
-+-------+-------+-------+
-| 0,1   | 0,2   | 0,3   |
-+=======+=======+=======+
-| 0,4   | 0,5   | 0,6   |
-+-------+-------+-------+
-| 0,7   | 0,8   | 0,9   |
-+-------+-------+-------+
-| 1,0   | 1,1   | 1,2   |
-+-------+-------+-------+
-| 1,3   | 1,4   | 1,5   |
-+-------+-------+-------+
-
-::
-
-    /** Set a constant */
-    void SetConstant(const std::string& name, double value);
-
-This function allows the user to set new constants.
-
-::
-
-    /** Return the variable and constant names */
-    std::vector<std::string> GetVarNames() const;
-
-This function allows the user to get the list of the variable and
-constant names, in the form of a std::vector of strings.
-
-::
-
-      /** Import constants and expressions from a given filename */
-      void ImportContext(const std::string& filename);
-
-This function allows the user to define new constants and/or expressions
-(context) by using a txt file with a specific syntax. For the definition
-of constants, the following pattern must be observed: #type name value.
-For instance:
-
-#F expo 1.1 #M kernel1 { 0.1 , 0.2 , 0.3 ; 0.4 , 0.5 , 0.6 ; 0.7 , 0.8 ,
-0.9 ; 1 , 1.1 , 1.2 ; 1.3 , 1.4 , 1.5 }
+  #F expo 1.1 #M kernel1 { 0.1 , 0.2 , 0.3 ; 0.4 , 0.5 , 0.6 ; 0.7 , 0.8 , 0.9 ; 1 , 1.1 , 1.2 ; 1.3 , 1.4 , 1.5 }
 
 As we can see, #I/#F allows the definition of an integer/float constant,
 whereas #M allows the definition of a vector/matrix. It is also possible
-to define expressions within the same txt file, with the pattern #E
+to define expressions within the same text file, with the pattern #E
 expr. For instance:
 
-#F expo 1.1 #M kernel1 0.1 , 0.2 , 0.3 ; 0.4 , 0.5 , 0.6 ; 0.7 , 0.8 ,
-0.9 ; 1 , 1.1 , 1.2 ; 1.3 , 1.4 , 1.5 #E dotpr(kernel1,im1b1N3x5)
-
 ::
 
-      /** Export constants and expressions to a given filename */
-      void ExportContext(const std::string& filename);
-
-This function allows the user to export a text file that saves its
-favorite constant or expression definitions. Such a file will be
-reusable by the ImportContext function (see above).
-
-Please, also refer to the section dedicated to application.
+  #F expo 1.1 #M kernel1 { 0.1 , 0.2 , 0.3 ; 0.4 , 0.5 , 0.6 ; 0.7 , 0.8 , 0.9 ; 1 , 1.1 , 1.2 ; 1.3 , 1.4 , 1.5 } #E dotpr(kernel1,im1b1N3x5)
diff --git a/Documentation/Cookbook/rst/recipes/improc.rst b/Documentation/Cookbook/rst/recipes/improc.rst
index 0dde3676d984d522e4dda328da7c99912a9e01db..75e8b4768d1cbf643d96a88b05a86532da0cc24f 100644
--- a/Documentation/Cookbook/rst/recipes/improc.rst
+++ b/Documentation/Cookbook/rst/recipes/improc.rst
@@ -1,30 +1,6 @@
 Image processing
 ================
 
-Simple calculus with channels
------------------------------
-
-The *BandMath* application provides a simple and efficient way to
-perform band operations. The command line application and the
-corresponding Monteverdi module (shown in the section [Band:sub:`m`\ ath
-module]) are based on the same standards. It computes a band wise
-operation according to a user defined mathematical expression. The
-following code computes the absolute difference between first bands of
-two images.
-
-::
-
-    otbcli_BandMath -il input_image_1 input_image_2
-                    -exp "abs(im1b1 - im2b1)"
-                    -out output_image
-
-The naming convention “im[x]b[y]” designates the yth band of the xth
-input image.
-
-The *BandMath* application embeds built-in operators and functions
-listed in `muparser documentation <https://beltoforion.de/article.php?a=muparser&p=features&s=idDef1#idDef1>`_ thus
-allowing a vast choice of possible operations.
-
 Images with no-data values
 --------------------------
 
diff --git a/Documentation/Cookbook/rst/recipes/pbclassif.rst b/Documentation/Cookbook/rst/recipes/pbclassif.rst
index 4202066085f000e6ec8f4b1f1eac313f277de09a..dbeeadd8abb8b9b775db2ffb3f65b834fbdea7b0 100644
--- a/Documentation/Cookbook/rst/recipes/pbclassif.rst
+++ b/Documentation/Cookbook/rst/recipes/pbclassif.rst
@@ -853,17 +853,6 @@ element is equal to 3 pixels, which corresponds to a ball included in a
 7 x 7 pixels square. Pixels with more than one majority class keep their
 original labels.
 
-
-
-Regression
-----------
-
-The machine learning models in OpenCV and LibSVM also support a
-regression mode: they can be used to predict a numeric value (i.e. not
-a class index) from an input predictor. The workflow is the same as
-classification. First, the regression model is trained, then it can be
-used to predict output values. The applications to do that are and .
-
 .. |image_61| image:: ../Art/MonteverdiImages/classification_chain_inputimage.jpg
 .. |image_62| image:: ../Art/MonteverdiImages/classification_chain_fancyclassif_CMR_input.png
 .. |image_63| image:: ../Art/MonteverdiImages/classification_chain_fancyclassif_CMR_3.png
@@ -877,144 +866,77 @@ used to predict output values. The applications to do that are and .
 	 
 Figure 6: From left to right: Original image, fancy colored classified image and regularized classification map with radius equal to 3 pixels. 
 
-The input data set for training must have the following structure:
-
--  *n* components for the input predictors
-
--  one component for the corresponding output value
-
-The application supports 2 input formats:
-
--  An image list: each image should have components matching the
-   structure detailed earlier (*n* feature components + 1 output value)
-
--  A CSV file: the first *n* columns are the feature components and the
-   last one is the output value
-
-If you have separate images for predictors and output values, you can
-use the application.
-
-::
 
-    otbcli_ConcatenateImages  -il features.tif  output_value.tif
-                              -out training_set.tif
+Regression
+----------
 
-Statistics estimation
-~~~~~~~~~~~~~~~~~~~~~
+The machine learning models in OpenCV, LibSVM and SharkML also support a
+regression mode: they can be used to predict a numeric value (i.e. not
+a class index) from an input predictor. The workflow is the same as
+classification. First, the regression model is trained, then it can be
+used to predict output values. 
 
-As in classification, a statistics estimation step can be performed
-before training. It allows to normalize the dynamic of the input
-predictors to a standard one: zero mean, unit standard deviation. The
-main difference with the classification case is that with regression,
-the dynamic of output values can also be reduced.
+Two applications are available for training:
 
-The statistics file format is identical to the output file from
-application, for instance:
+- `TrainVectorRegression` can be used to train a classifier with a set of geometries
+  containing a list of features (predictors) and the corresponding output value:
 
-::
+  ::
 
-    <?xml version="1.0" ?>
-    <FeatureStatistics>
-        <Statistic name="mean">
-            <StatisticVector value="198.796" />
-            <StatisticVector value="283.117" />
-            <StatisticVector value="169.878" />
-            <StatisticVector value="376.514" />
-        </Statistic>
-        <Statistic name="stddev">
-            <StatisticVector value="22.6234" />
-            <StatisticVector value="41.4086" />
-            <StatisticVector value="40.6766" />
-            <StatisticVector value="110.956" />
-        </Statistic>
-    </FeatureStatistics>
-
-In the application, normalization of input predictors and output values
-is optional. There are 3 options:
-
--  No statistic file: normalization disabled
-
--  Statistic file with *n* components: normalization enabled for input
-   predictors only
-
--  Statistic file with *n+1* components: normalization enabled for
-   input predictors and output values
-
-If you use an image list as training set, you can run application. It
-will produce a statistics file suitable for input and output
-normalization (third option).
+    otbcli_TrainVectorRegression -io.vd samples.sqlite
+                                 -cfield predicted
+                                 -io.out model.rf
+                                 -classifier rf
+                                 -feat perimeter area width
 
-::
+  The validation set `io.valid` is used to compute the mean square error between the original output value and the value
+  predicted by the computed model. If no validation set is provided the input training sample is used to compute the mean square error.
 
-    otbcli_ComputeImagesStatistics  -il   training_set.tif
-                                    -out  stats.xml
 
-Training
-~~~~~~~~
 
-Initially, the machine learning models in OTB only used classification.
-But since they come from external libraries (OpenCV and LibSVM), the
-regression mode was already implemented in these external libraries. So
-the integration of these models in OTB has been improved in order to
-allow the usage of regression mode. As a consequence , the machine
-learning models have nearly the same set of parameters for
-classification and regression mode.
+- `TrainImagesRegression` can be used to train a classifier from multiple pairs of predictor images and label images. 
+  There are two ways to use this application:
 
-.. |image11| image:: ../Art/MonteverdiImages/classification_chain_inputimage.jpg
-.. |image12| image:: ../Art/MonteverdiImages/QB_1_ortho_MV_C123456_CM.png
-.. |image13| image:: ../Art/MonteverdiImages/classification_chain_inputimage.jpg
-.. |image14| image:: ../Art/MonteverdiImages/QB_1_ortho_DS_V_P_C123456_CM.png
+  It is possible to provide for each input image a vector data file with geometries
+  corresponding to the input locations that will be used for training. This is achieved by using the `io.vd` parameter.
+  The `sample.nt` and `sample.nv` can be used to specify the number of sample extracted from the images, for training and
+  validation, respectively.
 
-.. |image15| image:: ../Art/MonteverdiImages/classification_chain_inputimage.jpg
-             :scale: 88%
+  ::
 
--  Decision Trees
+    otbcli_TrainImagesRegression -io.il inputPredictorImage.tif
+                                -io.ip inputLabelImage.tif
+                                -io.vd trainingData.shp
+                                -classifier rf
+                                -io.out model.txt
+                                -sample.nt 1000
+                                -sample.nv 500
 
--  Gradient Boosted Trees
 
--  Neural Network
 
--  Random Forests
+  Alternatively, if no input vector data is provided, the training samples will be
+  extracted from the full image extent.
 
--  K-Nearest Neighbors
+Two applications are also available for predictions:
 
-The behavior of application is very similar to . From the input data
-set, a portion of the samples is used for training, whereas the other
-part is used for validation. The user may also set the model to train
-and its parameters. Once the training is done, the model is stored in an
-output file.
+- `VectorRegression` uses a regression machine learning model to predict output values based on a
+  list of features:
 
 ::
 
-    otbcli_TrainRegression  -io.il                training_set.tif
-                            -io.imstat            stats.xml
-                            -io.out               model.txt
-                            -sample.vtr           0.5
-                            -classifier           knn
-                            -classifier.knn.k     5
-                            -classifier.knn.rule  median
-
-Prediction
-~~~~~~~~~~
-
-Once the model is trained, it can be used in application to perform the
-prediction on an entire image containing input predictors (i.e. an image
-with only *n* feature components). If the model was trained with
-normalization, the same statistic file must be used for prediction. The
-behavior of with respect to statistic file is identical to:
-
--  no statistic file: normalization off
-
--  *n* components: input only
-
--  *n+1* components: input and output
+    otbcli_VectorRegression
+      -in input_vector_data.shp
+      -feat perimeter  area  width
+      -model model.txt
+      -out predicted_vector_data.shp
 
-The model to use is read from file (the one produced during training).
+- Similarly, `ImageRegression` takes an image of predictors as input and computes the output image using a regression model:
 
 ::
 
-    otbcli_PredictRegression  -in     features_bis.tif
-                              -model  model.txt
-                              -imstat stats.xml
-                              -out    prediction.tif
+    otbcli_ImageRegression
+      -in input_image.tif
+      -model model.txt
+      -out predicted_image.tif
+
 
diff --git a/Modules/Applications/AppChangeDetection/app/otbMultivariateAlterationDetector.cxx b/Modules/Applications/AppChangeDetection/app/otbMultivariateAlterationDetector.cxx
index e5e0c6977a1a184c74f742c57c4fb26330cbb3fd..5044e79fd24ed13e0df4afb5dd38b4457d625d88 100644
--- a/Modules/Applications/AppChangeDetection/app/otbMultivariateAlterationDetector.cxx
+++ b/Modules/Applications/AppChangeDetection/app/otbMultivariateAlterationDetector.cxx
@@ -65,11 +65,9 @@ private:
                           " and even different bands and number of bands between images. \n"
                           " \n"
                           "The application will output all change maps into a single multiband"
-                          " image. If numbers of bands in image 1 and 2 are equal, then change"
-                          " maps are sorted by increasing correlation. If number of bands is"
-                          " different, the change maps are sorted by decreasing correlation. \n"
+                          " image. Change maps are sorted by increasing correlation. \n"
                           " \n"
-                          "The application will also print the following information:\n"
+                          "The application will also print the following information:\n\n"
                           "- Mean1 and Mean2 which are the mean values of bands for both input"
                           " images,\n"
                           "- V1 and V2 which are the two linear transform that are applied to"
@@ -98,7 +96,7 @@ private:
     AddParameter(ParameterType_InputImage,  "in2", "Input Image 2");
     SetParameterDescription("in2","Mutliband image of the scene after perturbations.");
     AddParameter(ParameterType_OutputImage, "out", "Change Map");
-    SetParameterDescription("out","Multiband image containing change maps. Each map will be in the range [-1,1], so a floating point output type is advised.");
+    SetParameterDescription("out","Multiband image containing change maps.");
 
     AddRAMParameter();
 
diff --git a/Modules/Applications/AppClassification/app/CMakeLists.txt b/Modules/Applications/AppClassification/app/CMakeLists.txt
index c981d9ec5bcf06530dae674b5aefa38c109e411a..dec69e29e9145507184f0d6b827e477dc7cceee5 100644
--- a/Modules/Applications/AppClassification/app/CMakeLists.txt
+++ b/Modules/Applications/AppClassification/app/CMakeLists.txt
@@ -71,8 +71,8 @@ otb_create_application(
   LINK_LIBRARIES ${${otb-module}_LIBRARIES})
 
 otb_create_application(
-  NAME           PredictRegression
-  SOURCES        otbPredictRegression.cxx
+  NAME           ImageRegression
+  SOURCES        otbImageRegression.cxx
   LINK_LIBRARIES ${${otb-module}_LIBRARIES})
 
 otb_create_application(
diff --git a/Modules/Applications/AppClassification/app/otbImageClassifier.cxx b/Modules/Applications/AppClassification/app/otbImageClassifier.cxx
index 1900c8e416fbcfb3295891b03d1bac06bf4f11b0..0f883375f0520e84460730da5f89b8e2eda7ab5c 100644
--- a/Modules/Applications/AppClassification/app/otbImageClassifier.cxx
+++ b/Modules/Applications/AppClassification/app/otbImageClassifier.cxx
@@ -84,7 +84,7 @@ private:
 
     SetDocLimitations("The input image must have the same type, order and number of bands as the images used to produce the statistics file and the SVM model file. If a statistics file was used during training by the TrainImagesClassifier, it is mandatory to use the same statistics file for classification. If an input mask is used, its size must match the input image size.");
     SetDocAuthors("OTB-Team");
-    SetDocSeeAlso("TrainImagesClassifier, ValidateImagesClassifier, ComputeImagesStatistics");
+    SetDocSeeAlso("TrainImagesClassifier, ComputeImagesStatistics");
 
     AddDocTag(Tags::Learning);
 
diff --git a/Modules/Applications/AppClassification/app/otbImageRegression.cxx b/Modules/Applications/AppClassification/app/otbImageRegression.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..15f4e7b4d0c664b0bb6a054e76184d690fdf5308
--- /dev/null
+++ b/Modules/Applications/AppClassification/app/otbImageRegression.cxx
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperApplication.h"
+#include "otbWrapperApplicationFactory.h"
+
+#include "itkUnaryFunctorImageFilter.h"
+#include "otbChangeLabelImageFilter.h"
+#include "otbStandardWriterWatcher.h"
+#include "otbStatisticsXMLFileReader.h"
+#include "otbShiftScaleVectorImageFilter.h"
+#include "otbImageClassificationFilter.h"
+#include "otbMultiToMonoChannelExtractROI.h"
+#include "otbImageToVectorImageCastFilter.h"
+#include "otbMachineLearningModelFactory.h"
+
+namespace otb
+{
+namespace Functor
+{
+/**
+ * simple affine function : y = ax+b
+ */
+template <class TInput, class TOutput>
+class AffineFunctor
+{
+public:
+  typedef double InternalType;
+
+  void SetA(InternalType a)
+  {
+    m_A = a;
+  }
+
+  void SetB(InternalType b)
+  {
+    m_B = b;
+  }
+
+  inline TOutput operator()(const TInput& x) const
+  {
+    return static_cast<TOutput>(static_cast<InternalType>(x) * m_A + m_B);
+  }
+
+private:
+  InternalType m_A = 1.0;
+  InternalType m_B = 0.0;
+};
+}
+
+namespace Wrapper
+{
+
+class ImageRegression : public Application
+{
+public:
+  /** Standard class typedefs. */
+  typedef ImageRegression               Self;
+  typedef Application                   Superclass;
+  typedef itk::SmartPointer<Self>       Pointer;
+  typedef itk::SmartPointer<const Self> ConstPointer;
+
+  /** Standard macro */
+  itkNewMacro(Self);
+
+  itkTypeMacro(ImageRegression, otb::Application);
+
+  /** Filters typedef */
+  typedef UInt8ImageType                                                     MaskImageType;
+  typedef itk::VariableLengthVector<FloatVectorImageType::InternalPixelType> MeasurementType;
+  typedef otb::StatisticsXMLFileReader<MeasurementType>                      StatisticsReader;
+  typedef otb::ShiftScaleVectorImageFilter<FloatVectorImageType, FloatVectorImageType> RescalerType;
+  typedef itk::UnaryFunctorImageFilter<FloatImageType, FloatImageType, otb::Functor::AffineFunctor<float, float>> OutputRescalerType;
+  typedef otb::ImageClassificationFilter<FloatVectorImageType, FloatImageType, MaskImageType> ClassificationFilterType;
+  typedef ClassificationFilterType::Pointer   ClassificationFilterPointerType;
+  typedef ClassificationFilterType::ModelType ModelType;
+  typedef ModelType::Pointer                  ModelPointerType;
+  typedef ClassificationFilterType::ValueType ValueType;
+  typedef ClassificationFilterType::LabelType LabelType;
+  typedef otb::MachineLearningModelFactory<ValueType, LabelType> MachineLearningModelFactoryType;
+
+protected:
+  ~ImageRegression() override
+  {
+    MachineLearningModelFactoryType::CleanFactories();
+  }
+
+private:
+  void DoInit() override
+  {
+    SetName("ImageRegression");
+    SetDescription("Performs a prediction of the input image according to a regression model file.");
+
+    // Documentation
+    SetDocLongDescription(
+        "This application predict output values from an input "
+        "image, based on a regression model file produced either by "
+        "TrainVectorRegression or TrainImagesRegression. "
+        "Pixels of the output image will contain the predicted values from "
+        "the regression model (single band). The input pixels "
+        "can be optionally centered and reduced according "
+        "to the statistics file produced by the "
+        "ComputeImagesStatistics application. An optional "
+        "input mask can be provided, in which case only "
+        "input image pixels whose corresponding mask value "
+        "is greater than zero will be processed. The remaining "
+        "of pixels will be given the value zero in the output "
+        "image.");
+
+    SetDocLimitations(
+        "The input image must contain the feature bands used for "
+        "the model training. "
+        "If a statistics file was used during training by the "
+        "TrainRegression, it is mandatory to use the same "
+        "statistics file for prediction. If an input mask is "
+        "used, its size must match the input image size.");
+    SetDocAuthors("OTB-Team");
+    SetDocSeeAlso("TrainImagesRegression, TrainVectorRegression, VectorRegression, ComputeImagesStatistics");
+
+    AddDocTag(Tags::Learning);
+
+    AddParameter(ParameterType_InputImage, "in", "Input Image");
+    SetParameterDescription("in", "The input image to predict.");
+
+    AddParameter(ParameterType_InputImage, "mask", "Input Mask");
+    SetParameterDescription("mask",
+                            "The mask restrict the "
+                            "classification of the input image to the area where mask pixel values "
+                            "are greater than zero.");
+    MandatoryOff("mask");
+
+    AddParameter(ParameterType_InputFilename, "model", "Model file");
+    SetParameterDescription("model",
+                            "A regression model file (produced either by "
+                            "TrainVectorRegression application or the TrainImagesRegression application).");
+
+    AddParameter(ParameterType_InputFilename, "imstat", "Statistics file");
+    SetParameterDescription("imstat",
+                            "An XML file containing mean and standard"
+                            " deviation to center and reduce samples before prediction "
+                            "(produced by the ComputeImagesStatistics application). If this file contains "
+                            "one more band than the sample size, the last stat of the last band will be"
+                            "applied to expand the output predicted value.");
+    MandatoryOff("imstat");
+
+    AddParameter(ParameterType_OutputImage, "out", "Output Image");
+    SetParameterDescription("out", "Output image containing predicted values");
+
+    AddRAMParameter();
+
+    // Doc example parameter settings
+    SetDocExampleParameterValue("in", "QB_1_ortho.tif");
+    SetDocExampleParameterValue("imstat", "EstimateImageStatisticsQB1.xml");
+    SetDocExampleParameterValue("model", "clsvmModelQB1.svm");
+    SetDocExampleParameterValue("out", "clLabeledImageQB1.tif");
+
+    SetOfficialDocLink();
+  }
+
+  void DoUpdateParameters() override
+  {
+    // Nothing to do here : all parameters are independent
+  }
+
+  void DoExecute() override
+  {
+    // Load input image
+    auto inImage = GetParameterImage("in");
+    inImage->UpdateOutputInformation();
+    unsigned int nbFeatures = inImage->GetNumberOfComponentsPerPixel();
+
+    // Load svm model
+    otbAppLogINFO("Loading model");
+    auto model = MachineLearningModelFactoryType::CreateMachineLearningModel(GetParameterString("model"), MachineLearningModelFactoryType::ReadMode);
+
+    if (model.IsNull())
+    {
+      otbAppLogFATAL(<< "Error when loading model " << GetParameterString("model") << " : unsupported model type");
+    }
+
+    model->Load(GetParameterString("model"));
+    model->SetRegressionMode(true);
+    otbAppLogINFO("Model loaded");
+
+    // Classify
+    auto classificationFilter = ClassificationFilterType::New();
+    classificationFilter->SetModel(model);
+
+    auto outputImage = classificationFilter->GetOutput();
+
+    RescalerType::Pointer             rescaler;
+    OutputRescalerType::Pointer       outRescaler;
+    // Normalize input image if asked
+    if (IsParameterEnabled("imstat"))
+    {
+      otbAppLogINFO("Input image normalization activated.");
+      // Normalize input image (optional)
+      auto statisticsReader = StatisticsReader::New();
+      MeasurementType           meanMeasurementVector;
+      MeasurementType           stddevMeasurementVector;
+      rescaler = RescalerType::New();
+      // Load input image statistics
+      statisticsReader->SetFileName(GetParameterString("imstat"));
+      meanMeasurementVector   = statisticsReader->GetStatisticVectorByName("mean");
+      stddevMeasurementVector = statisticsReader->GetStatisticVectorByName("stddev");
+      otbAppLogINFO("mean used: " << meanMeasurementVector);
+      otbAppLogINFO("standard deviation used: " << stddevMeasurementVector);
+      if (meanMeasurementVector.Size() == nbFeatures + 1)
+      {
+        double outMean   = meanMeasurementVector[nbFeatures];
+        double outStdDev = stddevMeasurementVector[nbFeatures];
+        meanMeasurementVector.SetSize(nbFeatures, false);
+        stddevMeasurementVector.SetSize(nbFeatures, false);
+        outRescaler = OutputRescalerType::New();
+        outRescaler->SetInput(classificationFilter->GetOutput());
+        outRescaler->GetFunctor().SetA(outStdDev);
+        outRescaler->GetFunctor().SetB(outMean);
+        outputImage = outRescaler->GetOutput();
+      }
+      else if (meanMeasurementVector.Size() != nbFeatures)
+      {
+        otbAppLogFATAL("Wrong number of components in statistics file : " << meanMeasurementVector.Size());
+      }
+
+      // Rescale vector image
+      rescaler->SetScale(stddevMeasurementVector);
+      rescaler->SetShift(meanMeasurementVector);
+      rescaler->SetInput(inImage);
+
+      classificationFilter->SetInput(rescaler->GetOutput());
+    }
+    else
+    {
+      otbAppLogINFO("Input image normalization deactivated.");
+      classificationFilter->SetInput(inImage);
+    }
+
+    if (IsParameterEnabled("mask"))
+    {
+      otbAppLogINFO("Using input mask");
+      // Load mask image and cast into LabeledImageType
+      auto inMask = GetParameterUInt8Image("mask");
+      classificationFilter->SetInputMask(inMask);
+    }
+
+    SetParameterOutputImage<FloatImageType>("out", outputImage);
+    RegisterPipeline();
+  }
+};
+}
+}
+
+OTB_APPLICATION_EXPORT(otb::Wrapper::ImageRegression)
diff --git a/Modules/Applications/AppClassification/app/otbPredictRegression.cxx b/Modules/Applications/AppClassification/app/otbPredictRegression.cxx
deleted file mode 100644
index b088810145126212e8c99ed904d1232c306c1f7c..0000000000000000000000000000000000000000
--- a/Modules/Applications/AppClassification/app/otbPredictRegression.cxx
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
- *
- * This file is part of Orfeo Toolbox
- *
- *     https://www.orfeo-toolbox.org/
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "otbWrapperApplication.h"
-#include "otbWrapperApplicationFactory.h"
-
-#include "itkUnaryFunctorImageFilter.h"
-#include "otbChangeLabelImageFilter.h"
-#include "otbStandardWriterWatcher.h"
-#include "otbStatisticsXMLFileReader.h"
-#include "otbShiftScaleVectorImageFilter.h"
-#include "otbImageClassificationFilter.h"
-#include "otbMultiToMonoChannelExtractROI.h"
-#include "otbImageToVectorImageCastFilter.h"
-#include "otbMachineLearningModelFactory.h"
-
-namespace otb
-{
-namespace Functor
-{
-/**
- * simple affine function : y = ax+b
- */
-template<class TInput, class TOutput>
-class AffineFunctor
-{
-public:
-  typedef double InternalType;
-  
-  // constructor
-  AffineFunctor() : m_A(1.0),m_B(0.0) {}
-  
-  // destructor
-  virtual ~AffineFunctor() {}
-  
-  void SetA(InternalType a)
-    {
-    m_A = a;
-    }
-  
-  void SetB(InternalType b)
-    {
-    m_B = b;
-    }
-  
-  inline TOutput operator()(const TInput & x) const
-    {
-    return static_cast<TOutput>( static_cast<InternalType>(x)*m_A + m_B);
-    }
-private:
-  InternalType m_A;
-  InternalType m_B;
-};
-  
-}
-
-namespace Wrapper
-{
-
-class PredictRegression : public Application
-{
-public:
-  /** Standard class typedefs. */
-  typedef PredictRegression             Self;
-  typedef Application                   Superclass;
-  typedef itk::SmartPointer<Self>       Pointer;
-  typedef itk::SmartPointer<const Self> ConstPointer;
-
-  /** Standard macro */
-  itkNewMacro(Self);
-
-  itkTypeMacro(PredictRegression, otb::Application);
-
-  /** Filters typedef */
-  typedef UInt8ImageType                                                                       MaskImageType;
-  typedef itk::VariableLengthVector<FloatVectorImageType::InternalPixelType>                   MeasurementType;
-  typedef otb::StatisticsXMLFileReader<MeasurementType>                                        StatisticsReader;
-  typedef otb::ShiftScaleVectorImageFilter<FloatVectorImageType, FloatVectorImageType>         RescalerType;
-  typedef itk::UnaryFunctorImageFilter<
-      FloatImageType,
-      FloatImageType,
-      otb::Functor::AffineFunctor<float,float> >                                               OutputRescalerType;
-  typedef otb::ImageClassificationFilter<FloatVectorImageType, FloatImageType, MaskImageType>  ClassificationFilterType;
-  typedef ClassificationFilterType::Pointer                                                    ClassificationFilterPointerType;
-  typedef ClassificationFilterType::ModelType                                                  ModelType;
-  typedef ModelType::Pointer                                                                   ModelPointerType;
-  typedef ClassificationFilterType::ValueType                                                  ValueType;
-  typedef ClassificationFilterType::LabelType                                                  LabelType;
-  typedef otb::MachineLearningModelFactory<ValueType, LabelType>                               MachineLearningModelFactoryType;
-
-protected:
-
-  ~PredictRegression() override
-    {
-    MachineLearningModelFactoryType::CleanFactories();
-    }
-
-private:
-  void DoInit() override
-  {
-    SetName("PredictRegression");
-    SetDescription("Performs a prediction of the input image according to a regression model file.");
-
-    // Documentation
-    SetDocLongDescription("This application predict output values from an input"
-                          " image, based on a regression model file produced by"
-                          " the TrainRegression application. Pixels of the "
-                          "output image will contain the predicted values from"
-                          "the regression model (single band). The input pixels"
-                          " can be optionally centered and reduced according "
-                          "to the statistics file produced by the "
-                          "ComputeImagesStatistics application. An optional "
-                          "input mask can be provided, in which case only "
-                          "input image pixels whose corresponding mask value "
-                          "is greater than 0 will be processed. The remaining"
-                          " of pixels will be given the value 0 in the output"
-                          " image.");
-
-    SetDocLimitations("The input image must contain the feature bands used for"
-                      " the model training (without the predicted value). "
-                      "If a statistics file was used during training by the "
-                      "TrainRegression, it is mandatory to use the same "
-                      "statistics file for prediction. If an input mask is "
-                      "used, its size must match the input image size.");
-    SetDocAuthors("OTB-Team");
-    SetDocSeeAlso("TrainRegression, ComputeImagesStatistics");
-
-    AddDocTag(Tags::Learning);
-
-    AddParameter(ParameterType_InputImage, "in",  "Input Image");
-    SetParameterDescription( "in", "The input image to predict.");
-
-    // TODO : use CSV input/output ?
-
-    AddParameter(ParameterType_InputImage,  "mask",   "Input Mask");
-    SetParameterDescription( "mask", "The mask restrict the "
-      "classification of the input image to the area where mask pixel values "
-      "are greater than 0.");
-    MandatoryOff("mask");
-
-    AddParameter(ParameterType_InputFilename, "model", "Model file");
-    SetParameterDescription("model", "A regression model file (produced by "
-      "TrainRegression application).");
-
-    AddParameter(ParameterType_InputFilename, "imstat", "Statistics file");
-    SetParameterDescription("imstat", "An XML file containing mean and standard"
-      " deviation to center and reduce samples before prediction "
-      "(produced by ComputeImagesStatistics application). If this file contains"
-      "one more band than the sample size, the last stat of the last band will be"
-      "applied to expand the output predicted value");
-    MandatoryOff("imstat");
-
-    AddParameter(ParameterType_OutputImage, "out",  "Output Image");
-    SetParameterDescription( "out", "Output image containing predicted values");
-
-    AddRAMParameter();
-
-   // Doc example parameter settings
-    SetDocExampleParameterValue("in", "QB_1_ortho.tif");
-    SetDocExampleParameterValue("imstat", "EstimateImageStatisticsQB1.xml");
-    SetDocExampleParameterValue("model", "clsvmModelQB1.svm");
-    SetDocExampleParameterValue("out", "clLabeledImageQB1.tif");
-
-    SetOfficialDocLink();
-  }
-
-  void DoUpdateParameters() override
-  {
-    // Nothing to do here : all parameters are independent
-  }
-
-  void DoExecute() override
-  {
-    // Load input image
-    FloatVectorImageType::Pointer inImage = GetParameterImage("in");
-    inImage->UpdateOutputInformation();
-    unsigned int nbFeatures = inImage->GetNumberOfComponentsPerPixel();
-
-    // Load svm model
-    otbAppLogINFO("Loading model");
-    m_Model = MachineLearningModelFactoryType::CreateMachineLearningModel(GetParameterString("model"),
-                                                                          MachineLearningModelFactoryType::ReadMode);
-
-    if (m_Model.IsNull())
-      {
-      otbAppLogFATAL(<< "Error when loading model " << GetParameterString("model") << " : unsupported model type");
-      }
-
-    m_Model->Load(GetParameterString("model"));
-    m_Model->SetRegressionMode(true);
-    otbAppLogINFO("Model loaded");
-
-    // Classify
-    m_ClassificationFilter = ClassificationFilterType::New();
-    m_ClassificationFilter->SetModel(m_Model);
-    
-    FloatImageType::Pointer outputImage = m_ClassificationFilter->GetOutput();
-
-    // Normalize input image if asked
-    if(IsParameterEnabled("imstat")  )
-      {
-      otbAppLogINFO("Input image normalization activated.");
-      // Normalize input image (optional)
-      StatisticsReader::Pointer  statisticsReader = StatisticsReader::New();
-      MeasurementType  meanMeasurementVector;
-      MeasurementType  stddevMeasurementVector;
-      m_Rescaler = RescalerType::New();
-      // Load input image statistics
-      statisticsReader->SetFileName(GetParameterString("imstat"));
-      meanMeasurementVector   = statisticsReader->GetStatisticVectorByName("mean");
-      stddevMeasurementVector = statisticsReader->GetStatisticVectorByName("stddev");
-      otbAppLogINFO( "mean used: " << meanMeasurementVector );
-      otbAppLogINFO( "standard deviation used: " << stddevMeasurementVector );
-      if (meanMeasurementVector.Size() == nbFeatures + 1)
-        {
-        double outMean = meanMeasurementVector[nbFeatures];
-        double outStdDev = stddevMeasurementVector[nbFeatures];
-        meanMeasurementVector.SetSize(nbFeatures,false);
-        stddevMeasurementVector.SetSize(nbFeatures,false);
-        m_OutRescaler = OutputRescalerType::New();
-        m_OutRescaler->SetInput(m_ClassificationFilter->GetOutput());
-        m_OutRescaler->GetFunctor().SetA(outStdDev);
-        m_OutRescaler->GetFunctor().SetB(outMean);
-        outputImage = m_OutRescaler->GetOutput();
-        }
-      else if (meanMeasurementVector.Size() != nbFeatures)
-        {
-        otbAppLogFATAL("Wrong number of components in statistics file : "<<meanMeasurementVector.Size());
-        }
-        
-      // Rescale vector image
-      m_Rescaler->SetScale(stddevMeasurementVector);
-      m_Rescaler->SetShift(meanMeasurementVector);
-      m_Rescaler->SetInput(inImage);
-
-      m_ClassificationFilter->SetInput(m_Rescaler->GetOutput());
-      }
-    else
-      {
-      otbAppLogINFO("Input image normalization deactivated.");
-      m_ClassificationFilter->SetInput(inImage);
-      }
-
-
-    if(IsParameterEnabled("mask"))
-      {
-      otbAppLogINFO("Using input mask");
-      // Load mask image and cast into LabeledImageType
-      MaskImageType::Pointer inMask = GetParameterUInt8Image("mask");
-
-      m_ClassificationFilter->SetInputMask(inMask);
-      }
-
-    SetParameterOutputImage<FloatImageType>("out", outputImage);
-
-  }
-
-  ClassificationFilterType::Pointer m_ClassificationFilter;
-  ModelPointerType m_Model;
-  RescalerType::Pointer m_Rescaler;
-  OutputRescalerType::Pointer m_OutRescaler;
-
-};
-
-
-}
-}
-
-OTB_APPLICATION_EXPORT(otb::Wrapper::PredictRegression)
diff --git a/Modules/Applications/AppClassification/app/otbTrainRegression.cxx b/Modules/Applications/AppClassification/app/otbTrainRegression.cxx
index b576735070fe35c01c0954bfa7de49d055a7f4a2..9456b93c23b3e94526b8792d2e6c08c5632ab397 100644
--- a/Modules/Applications/AppClassification/app/otbTrainRegression.cxx
+++ b/Modules/Applications/AppClassification/app/otbTrainRegression.cxx
@@ -1,22 +1,22 @@
 /*
-  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
-  *
-  * This file is part of Orfeo Toolbox
-  *
-  *     https://www.orfeo-toolbox.org/
-  *
-  * Licensed under the Apache License, Version 2.0 (the "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  *     http://www.apache.org/licenses/LICENSE-2.0
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+ * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #include "otbLearningApplicationBase.h"
 #include "otbWrapperApplicationFactory.h"
diff --git a/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx b/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx
index 881e8dd97a983495e438b43cdf59da376c2f112e..95ffd94c59416207a2d8287280d5dfff519f4952 100644
--- a/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx
+++ b/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2017 National Research Institute of Science and
- * Technology for Environment and Agriculture (IRSTEA)
+ * Copyright (C) 2017 IRSTEA
  *
  * This file is part of Orfeo Toolbox
  *
diff --git a/Modules/Applications/AppClassification/test/CMakeLists.txt b/Modules/Applications/AppClassification/test/CMakeLists.txt
index b47c420c21388528cccb295d466a9304b810c781..9da705b64c50637a2417880c5b6010b075965623 100644
--- a/Modules/Applications/AppClassification/test/CMakeLists.txt
+++ b/Modules/Applications/AppClassification/test/CMakeLists.txt
@@ -785,16 +785,16 @@ if(OTB_USE_OPENCV)
     ${OTBAPP_BASELINE_FILES}/apTvClTrainRegressionTest_monovar.txt
     ${TEMP}/apTvClTrainRegressionTest_monovar.txt)
 
-  #----------- PredictRegression TESTS ----------------
-  otb_test_application(NAME apTvClPredictRegressionTest_monovar
-    APP PredictRegression
+  #----------- ImageRegression TESTS ----------------
+  otb_test_application(NAME apTvClImageRegressionTest_monovar
+    APP ImageRegression
     OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif
     -model ${OTBAPP_BASELINE_FILES}/apTvClTrainRegressionTest_monovar.rf
     -imstat ${INPUTDATA}/QB_Toulouse_Ortho_regression.xml
-    -out ${TEMP}/apTvClPredictRegressionTest_monovar.tif
+    -out ${TEMP}/apTvClImageRegressionTest_monovar.tif
     VALID    --compare-image 1
-    ${OTBAPP_BASELINE}/apTvClPredictRegressionTest_monovar.tif
-    ${TEMP}/apTvClPredictRegressionTest_monovar.tif)
+    ${OTBAPP_BASELINE}/apTvClImageRegressionTest_monovar.tif
+    ${TEMP}/apTvClImageRegressionTest_monovar.tif)
 
 endif()
 
diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
index cecb7e9045780d5011ed840afb4a4b679469c352..7ceb4f578efe22251d448e753e602430eed83d5f 100644
--- a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
+++ b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
@@ -90,31 +90,33 @@ private:
     SetName("DimensionalityReduction");
     SetDescription("Perform Dimension reduction of the input image.");
     SetDocLongDescription("Performs dimensionality reduction on input image. PCA,NA-PCA,MAF,ICA methods are available. It is also possible to compute the inverse transform to reconstruct the image and to optionally export the transformation matrix to a text file.");
-    SetDocLimitations("This application does not provide the inverse transform and the transformation matrix export for the MAF.");
+    SetDocLimitations("This application does not provide the inverse transform and the transformation matrix export for the MAF. the background value option is not supported for MAF and ICA.");
     SetDocAuthors("OTB-Team");
     SetDocSeeAlso(
                   "\"Kernel maximum autocorrelation factor and minimum noise fraction transformations,\" IEEE Transactions on Image Processing, vol. 20, no. 3, pp. 612-624, (2011)");
 
     AddDocTag(Tags::Filter);
-	AddDocTag(Tags::DimensionReduction);
+    AddDocTag(Tags::DimensionReduction);
 
     AddParameter(ParameterType_InputImage, "in", "Input Image");
     SetParameterDescription("in", "The input image to apply dimensionality reduction.");
     AddParameter(ParameterType_OutputImage, "out", "Output Image");
     SetParameterDescription("out", "output image. Components are ordered by decreasing eigenvalues.");
     MandatoryOff("out");
-    AddParameter(ParameterType_Group, "rescale", "Rescale Output");
+
+    AddParameter(ParameterType_Choice, "rescale", "Rescale Output");
+    SetParameterDescription("rescale", "Enable rescaling of the reduced output image.");
 
     MandatoryOff("rescale");
-    //  AddChoice("rescale.no","No rescale");
-    // AddChoice("rescale.minmax","rescale to min max value");
+    AddChoice("rescale.no", "No rescale");
+    AddChoice("rescale.minmax", "rescale to min max value");
 
-    AddParameter(ParameterType_Float, "rescale.outmin", "Output min value");
-    AddParameter(ParameterType_Float, "rescale.outmax", "Output max value");
-    SetDefaultParameterFloat("rescale.outmin", 0.0);
-    SetParameterDescription("rescale.outmin", "Minimum value of the output image.");
-    SetDefaultParameterFloat("rescale.outmax", 255.0);
-    SetParameterDescription("rescale.outmax", "Maximum value of the output image.");
+    AddParameter(ParameterType_Float, "rescale.minmax.outmin", "Output min value");
+    AddParameter(ParameterType_Float, "rescale.minmax.outmax", "Output max value");
+    SetDefaultParameterFloat("rescale.minmax.outmin", 0.0);
+    SetParameterDescription("rescale.minmax.outmin", "Minimum value of the output image.");
+    SetDefaultParameterFloat("rescale.minmax.outmax", 255.0);
+    SetParameterDescription("rescale.minmax.outmax", "Maximum value of the output image.");
 
     AddParameter(ParameterType_OutputImage, "outinv", " Inverse Output Image");
     SetParameterDescription("outinv", "reconstruct output image.");
@@ -125,6 +127,14 @@ private:
 
     AddChoice("method.pca", "PCA");
     SetParameterDescription("method.pca", "Principal Component Analysis.");
+    AddParameter(ParameterType_OutputFilename, "method.pca.outeigenvalues", "Output file containing eigenvalues (txt format)");
+    SetParameterDescription("method.pca.outeigenvalues", "Output file containing eigenvalues (txt format).");
+    MandatoryOff("method.pca.outeigenvalues");
+    AddParameter(ParameterType_Bool, "method.pca.whiten", "Perform pca whitening");
+    SetParameterDescription("method.pca.whiten", "Perform whitening and ensure uncorrelated outputs with unit component wise variances");
+    SetParameterInt("method.pca.whiten", 1);
+    MandatoryOff("method.pca.whiten");
+
     AddChoice("method.napca", "NA-PCA");
     SetParameterDescription("method.napca", "Noise Adjusted Principal Component Analysis.");
     AddParameter(ParameterType_Int, "method.napca.radiusx", "Set the x radius of the sliding window");
@@ -136,6 +146,7 @@ private:
 
     AddChoice("method.maf", "MAF");
     SetParameterDescription("method.maf", "Maximum Autocorrelation Factor.");
+
     AddChoice("method.ica", "ICA");
     SetParameterDescription("method.ica", "Independent Component Analysis using a stabilized fixed point FastICA algorithm.");
     AddParameter(ParameterType_Int, "method.ica.iter", "number of iterations");
@@ -164,14 +175,17 @@ private:
     MandatoryOff("nbcomp");
     SetMinimumParameterIntValue("nbcomp", 0);
 
-    AddParameter(ParameterType_Bool, "normalize", "Normalize");
-    SetParameterDescription("normalize", "Center and reduce data before Dimensionality reduction.");
+    AddParameter(ParameterType_Bool, "normalize", "Center and reduce data");
+    SetParameterDescription("normalize", "Center and reduce data before Dimensionality reduction (if this parameter is set to false, the data will be centered but not reduced.");
 
     AddParameter(ParameterType_OutputFilename, "outmatrix", "Transformation matrix output (text format)");
     SetParameterDescription("outmatrix", "Filename to store the transformation matrix (csv format)");
     MandatoryOff("outmatrix");
     DisableParameter("outmatrix");
     
+    AddParameter(ParameterType_Float, "bv", "Background Value");
+    SetParameterDescription( "bv", "Background value to ignore in computation of the transformation matrix. Note that all pixels will still be processed when applying the transformation." );
+    MandatoryOff("bv");
 
     AddRAMParameter();
 
@@ -237,74 +251,111 @@ private:
     // Get Parameters
     int nbComp = GetParameterInt("nbcomp");
     bool normalize = GetParameterInt("normalize");
-    bool rescale = IsParameterEnabled("rescale");
-
     bool invTransform = HasValue("outinv") && IsParameterEnabled("outinv");
     switch (GetParameterInt("method"))
       {
       // PCA Algorithm
       case 0:
         {
+          otbAppLogINFO("Using the PCA Algorithm ");
+          PCAForwardFilterType::Pointer filter    = PCAForwardFilterType::New();
+          m_ForwardFilter                         = filter;
+          PCAInverseFilterType::Pointer invFilter = PCAInverseFilterType::New();
+          m_InverseFilter                         = invFilter;
 
-        otbAppLogDEBUG( << "PCA Algorithm ");
-        PCAForwardFilterType::Pointer filter = PCAForwardFilterType::New();
-        m_ForwardFilter = filter;
-        PCAInverseFilterType::Pointer invFilter = PCAInverseFilterType::New();
-        m_InverseFilter = invFilter;
-
+          filter->SetInput(GetParameterFloatVectorImage("in"));
+          filter->SetNumberOfPrincipalComponentsRequired(nbComp);
+          filter->SetWhitening(GetParameterInt("method.pca.whiten"));
 
-        filter->SetInput(GetParameterFloatVectorImage("in"));
-        filter->SetNumberOfPrincipalComponentsRequired(nbComp);
-        filter->SetUseNormalization(normalize);        
-        m_ForwardFilter->GetOutput()->UpdateOutputInformation();
-        
-        if (invTransform)
-          {  
-          invFilter->SetInput(m_ForwardFilter->GetOutput());
+          // Center AND reduce the input data.
           if (normalize)
+          {
+            filter->SetUseNormalization(true);
+            filter->SetUseVarianceForNormalization(true);
+          }
+          // Only center the input data.
+          else
+          {
+            filter->SetUseNormalization(true);
+            filter->SetUseVarianceForNormalization(false);
+          }
+
+          if( HasValue( "bv" ) )
+          {
+            filter->SetStatisticsUserIgnoredValue(GetParameterFloat("bv"));
+          }
+          
+          m_ForwardFilter->GetOutput()->UpdateOutputInformation();
+
+          // Write eigenvalues
+          std::ofstream outFile;
+          outFile.open(this->GetParameterString("method.pca.outeigenvalues"));
+          if (outFile.is_open())
+          {
+            outFile << std::fixed;
+            outFile.precision(10);
+
+            outFile << filter->GetEigenValues() << std::endl;
+            ;
+            outFile.close();
+          }
+
+          if (invTransform)
+          {
+            invFilter->SetInput(m_ForwardFilter->GetOutput());
+            // Data has been centered and reduced by the forward filter
+            if (normalize)
             {
             otbAppLogINFO( << "Normalization MeanValue:"<<filter->GetMeanValues() );
             invFilter->SetMeanValues(filter->GetMeanValues());
-            // By default normalization by std dev is deactivated in
-            //forward filter, and GetStdDevValues() returns an empty
-            //vector, which confuses the invFilter.
-            //invFilter->SetStdDevValues(filter->GetStdDevValues());
+            invFilter->SetStdDevValues(filter->GetStdDevValues());
+            }
+            // Data has been centered by the forward filter
+            else
+            {
+              invFilter->SetMeanValues(filter->GetMeanValues());
             }
 
-          invFilter->SetTransformationMatrix(filter->GetTransformationMatrix());
-          m_TransformationMatrix = invFilter->GetTransformationMatrix();
+            invFilter->SetTransformationMatrix(filter->GetTransformationMatrix());
+            m_TransformationMatrix = invFilter->GetTransformationMatrix();
           }
 
         m_TransformationMatrix = filter->GetTransformationMatrix();
 
+        otbAppLogINFO("PCA transform has been computed.");
         break;
         }
       case 1:
         {
-        otbAppLogDEBUG( << "NA-PCA Algorithm ");
+          otbAppLogINFO("Using the NA-PCA Algorithm ");
 
-        // NA-PCA
+          // NA-PCA
 
-        unsigned int radiusX = static_cast<unsigned int> (GetParameterInt("method.napca.radiusx"));
-        unsigned int radiusY = static_cast<unsigned int> (GetParameterInt("method.napca.radiusy"));
+          unsigned int radiusX = static_cast<unsigned int>(GetParameterInt("method.napca.radiusx"));
+          unsigned int radiusY = static_cast<unsigned int>(GetParameterInt("method.napca.radiusy"));
 
-        // Noise filtering
-        NoiseFilterType::RadiusType radius = { { radiusX, radiusY } };
+          // Noise filtering
+          NoiseFilterType::RadiusType radius = {{radiusX, radiusY}};
 
-        NAPCAForwardFilterType::Pointer filter = NAPCAForwardFilterType::New();
-        m_ForwardFilter = filter;
-        NAPCAInverseFilterType::Pointer invFilter = NAPCAInverseFilterType::New();
-        m_InverseFilter = invFilter;
+          NAPCAForwardFilterType::Pointer filter    = NAPCAForwardFilterType::New();
+          m_ForwardFilter                           = filter;
+          NAPCAInverseFilterType::Pointer invFilter = NAPCAInverseFilterType::New();
+          m_InverseFilter                           = invFilter;
 
 
-        filter->SetInput(GetParameterFloatVectorImage("in"));
-        filter->SetNumberOfPrincipalComponentsRequired(nbComp);
-        filter->SetUseNormalization(normalize);
-        filter->GetNoiseImageFilter()->SetRadius(radius);
+          filter->SetInput(GetParameterFloatVectorImage("in"));
+          filter->SetNumberOfPrincipalComponentsRequired(nbComp);
+          filter->SetUseNormalization(normalize);
+          filter->GetNoiseImageFilter()->SetRadius(radius);
 
-        m_ForwardFilter->GetOutput()->UpdateOutputInformation();
-        
-        if (invTransform)
+          if( HasValue( "bv" ) )
+          {
+            filter->SetStatisticsUserIgnoredValue(GetParameterFloat("bv"));
+          }
+          
+          m_ForwardFilter->GetOutput()->UpdateOutputInformation();
+
+          if (invTransform)
           {
           otbAppLogDEBUG( << "Compute Inverse Transform");
           invFilter->SetInput(m_ForwardFilter->GetOutput());
@@ -322,37 +373,37 @@ private:
           }
 
         m_TransformationMatrix = filter->GetTransformationMatrix();
-
+        otbAppLogINFO("NA-PCA transform has been computed.");
         break;
         }
       case 2:
         {
-        otbAppLogDEBUG( << "MAF Algorithm ");
-        MAFForwardFilterType::Pointer filter = MAFForwardFilterType::New();
-        m_ForwardFilter = filter;
-        filter->SetInput(GetParameterFloatVectorImage("in"));
-        otbAppLogINFO( << "V :"<<std::endl<<filter->GetV()<<"Auto-Correlation :"<<std::endl <<filter->GetAutoCorrelation() );
+          otbAppLogINFO("Using the MAF Algorithm ");
+          MAFForwardFilterType::Pointer filter = MAFForwardFilterType::New();
+          m_ForwardFilter                      = filter;
+          filter->SetInput(GetParameterFloatVectorImage("in"));
+          otbAppLogINFO(<< "V :" << std::endl << filter->GetV() << "Auto-Correlation :" << std::endl << filter->GetAutoCorrelation());
 
-        break;
+          break;
         }
       case 3:
         {
-        otbAppLogDEBUG( << "Fast ICA Algorithm ");
+          otbAppLogINFO("Using the fast ICA Algorithm ");
 
-        unsigned int nbIterations = static_cast<unsigned int> (GetParameterInt("method.ica.iter"));
-        double mu = static_cast<double> (GetParameterFloat("method.ica.mu"));
+          unsigned int nbIterations = static_cast<unsigned int>(GetParameterInt("method.ica.iter"));
+          double       mu           = static_cast<double>(GetParameterFloat("method.ica.mu"));
 
-        ICAForwardFilterType::Pointer filter = ICAForwardFilterType::New();
-        m_ForwardFilter = filter;
-        ICAInverseFilterType::Pointer invFilter = ICAInverseFilterType::New();
-        m_InverseFilter = invFilter;
+          ICAForwardFilterType::Pointer filter    = ICAForwardFilterType::New();
+          m_ForwardFilter                         = filter;
+          ICAInverseFilterType::Pointer invFilter = ICAInverseFilterType::New();
+          m_InverseFilter                         = invFilter;
 
-        filter->SetInput(GetParameterFloatVectorImage("in"));
-        filter->SetNumberOfPrincipalComponentsRequired(nbComp);
-        filter->SetNumberOfIterations(nbIterations);
-        filter->SetMu(mu);
-        
-        switch (GetParameterInt("method.ica.g"))
+          filter->SetInput(GetParameterFloatVectorImage("in"));
+          filter->SetNumberOfPrincipalComponentsRequired(nbComp);
+          filter->SetNumberOfIterations(nbIterations);
+          filter->SetMu(mu);
+
+          switch (GetParameterInt("method.ica.g"))
           {
           // tanh
           case 0:
@@ -406,10 +457,10 @@ private:
           invFilter->SetPCATransformationMatrix(filter->GetPCATransformationMatrix());
           invFilter->SetTransformationMatrix(filter->GetTransformationMatrix());
           }
+          otbAppLogINFO("ICA transform has been computed.");
+          m_TransformationMatrix = filter->GetTransformationMatrix();
 
-        m_TransformationMatrix = filter->GetTransformationMatrix();
-
-        break;
+          break;
         }
 
       default:
@@ -443,52 +494,54 @@ private:
         //Write transformation matrix
         std::ofstream outFile;
         outFile.open(this->GetParameterString("outmatrix"));
-        outFile << std::fixed;
-        outFile.precision(10);
+        if (outFile.is_open())
+        {
+          outFile << std::fixed;
+          outFile.precision(10);
 
-        outFile << m_TransformationMatrix;
-        outFile.close();
+          outFile << m_TransformationMatrix;
+          outFile.close();
+        }
         }
       }
 
-    if (!rescale)
+      if (GetParameterString("rescale") == "no")
       {
       SetParameterOutputImage("out", m_ForwardFilter->GetOutput());
       }
     else
       {
-      otbAppLogDEBUG( << "Rescaling " )
-      otbAppLogDEBUG( << "Starting Min/Max computation" )
+        otbAppLogINFO("Starting Min/Max computation for rescaling");
 
-      m_MinMaxFilter = MinMaxFilterType::New();
-      m_MinMaxFilter->SetInput(m_ForwardFilter->GetOutput());
-      //m_MinMaxFilter->GetStreamer()->SetNumberOfLinesStrippedStreaming(50);
-      m_MinMaxFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
+        m_MinMaxFilter = MinMaxFilterType::New();
+        m_MinMaxFilter->SetInput(m_ForwardFilter->GetOutput());
+        m_MinMaxFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
 
-      AddProcess(m_MinMaxFilter->GetStreamer(), "Min/Max computing");
-      m_MinMaxFilter->Update();
+        AddProcess(m_MinMaxFilter->GetStreamer(), "Min/Max computing");
+        m_MinMaxFilter->Update();
 
-      otbAppLogDEBUG( << "Min/Max computation done : min=" << m_MinMaxFilter->GetMinimum()
-          << " max=" << m_MinMaxFilter->GetMaximum() )
+        otbAppLogINFO(<< "Min/Max computation done : min=" << m_MinMaxFilter->GetMinimum() << " max=" << m_MinMaxFilter->GetMaximum())
 
-      FloatVectorImageType::PixelType inMin, inMax;
+            FloatVectorImageType::PixelType inMin,
+            inMax;
 
-      m_RescaleFilter = RescaleImageFilterType::New();
-      m_RescaleFilter->SetInput(m_ForwardFilter->GetOutput());
-      m_RescaleFilter->SetInputMinimum(m_MinMaxFilter->GetMinimum());
-      m_RescaleFilter->SetInputMaximum(m_MinMaxFilter->GetMaximum());
+        m_RescaleFilter = RescaleImageFilterType::New();
+        m_RescaleFilter->SetInput(m_ForwardFilter->GetOutput());
+        m_RescaleFilter->SetAutomaticInputMinMaxComputation(false);
+        m_RescaleFilter->SetInputMinimum(m_MinMaxFilter->GetMinimum());
+        m_RescaleFilter->SetInputMaximum(m_MinMaxFilter->GetMaximum());
 
-      FloatVectorImageType::PixelType outMin, outMax;
-      outMin.SetSize(m_ForwardFilter->GetOutput()->GetNumberOfComponentsPerPixel());
-      outMax.SetSize(m_ForwardFilter->GetOutput()->GetNumberOfComponentsPerPixel());
-      outMin.Fill(GetParameterFloat("rescale.outmin"));
-      outMax.Fill(GetParameterFloat("rescale.outmax"));
+        FloatVectorImageType::PixelType outMin, outMax;
+        outMin.SetSize(m_ForwardFilter->GetOutput()->GetNumberOfComponentsPerPixel());
+        outMax.SetSize(m_ForwardFilter->GetOutput()->GetNumberOfComponentsPerPixel());
+        outMin.Fill(GetParameterFloat("rescale.minmax.outmin"));
+        outMax.Fill(GetParameterFloat("rescale.minmax.outmax"));
 
-      m_RescaleFilter->SetOutputMinimum(outMin);
-      m_RescaleFilter->SetOutputMaximum(outMax);
-      m_RescaleFilter->UpdateOutputInformation();
+        m_RescaleFilter->SetOutputMinimum(outMin);
+        m_RescaleFilter->SetOutputMaximum(outMax);
+        m_RescaleFilter->UpdateOutputInformation();
 
-      SetParameterOutputImage("out", m_RescaleFilter->GetOutput());
+        SetParameterOutputImage("out", m_RescaleFilter->GetOutput());
       }
 
 
diff --git a/Modules/Applications/AppDimensionalityReduction/test/CMakeLists.txt b/Modules/Applications/AppDimensionalityReduction/test/CMakeLists.txt
index e4037adcb0a388f34ae1ba4cc49a70200bab4d08..82d8b013b9e79e65ba95b9d872b40cfb5d0d061a 100644
--- a/Modules/Applications/AppDimensionalityReduction/test/CMakeLists.txt
+++ b/Modules/Applications/AppDimensionalityReduction/test/CMakeLists.txt
@@ -35,7 +35,7 @@ otb_test_application(NAME   apTvFEDimensionalityReductionPCA
                              -out ${TEMP}/apTvChDimensionalityReductionPCA.tif
                              -method pca
                      VALID   --compare-image 0.025
-                             ${BASELINE}/bfTvPCAImageFilter3.tif
+                             ${BASELINE}/apTvChDimensionalityReductionPCA.tif
                              ${TEMP}/apTvChDimensionalityReductionPCA.tif)
 
 #-------------------------------------------------------------------------------
diff --git a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx
index 95a859ebbecede54dad37cc8cbc1587330bd6b91..f683397e94ed19dd80675e5b78b750ca5a04538d 100644
--- a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx
+++ b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx
@@ -61,7 +61,6 @@ private:
 
     SetDescription("This application performs mathematical operations on several multiband images.");
 
-
     SetDocLongDescription(
       "This application performs a mathematical operation on several multi-band "
       "images and outputs the result into an image (multi- or mono-band, as "
@@ -87,7 +86,7 @@ private:
       "  * ``im1b2`` the 2nd component of a pixel from 1st input (band index is 1-based)\n"
       "  * ``im1b2N3x4`` a 3x4 pixels Neighbourhood of a pixel the 2nd component of a pixel from the 1st input\n"
       "  * ``im1PhyX`` horizontal (X-axis) spacing of the 1st input.\n"
-      "  * ``im1PhyY`` vertical spacing of the 1st input input.\n"
+      "  * ``im1PhyY`` vertical (Y-axis) spacing of the 1st input input.\n"
       "  * ``im1b2Mean`` mean of the 2nd component of the 1st input (global statistics)\n"
       "  * ``im1b2Mini`` minimum of the 2nd component of the 1st input (global statistics)\n"
       "  * ``im1b2Maxi`` maximum of the 2nd component of the 1st input (global statistics)\n"
@@ -100,6 +99,7 @@ private:
       "  * ``<`` less than, ``>`` greater than, ``<=`` less or equal, ``>=`` greater or equal\n"
       "  * ``==`` equal, ``!=`` not equal\n"
       "  * logical operators: ``or``, ``and``, ``xor``\n"
+      "  * bit manipulation: ``&`` (and), ``|`` (or), ``<<``(left shift) and ``>>`` (right shift)"
       "* if-then-else operator: ``(condition ? value_true : value_false)``\n"
       "* functions: abs(), exp(), log(), sin(), cos(), min(), max(), ...\n\n"
 
diff --git a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
index d66576cd568b9dcc18438687129ae08d5fb86e7b..b43ee5d510a59094dfe5c5c04099cfb745f7f256 100644
--- a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
+++ b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
@@ -133,7 +133,7 @@ private:
     SetDocLongDescription("The application allows converting pixel values from DN (for Digital Numbers) to reflectance. Calibrated values are called surface reflectivity and its values lie in the range [0, 1].\nThe first level is called Top Of Atmosphere (TOA) reflectivity. It takes into account the sensor gain, sensor spectral response and the solar illuminations.\nThe second level is called Top Of Canopy (TOC) reflectivity. In addition to sensor gain and solar illuminations, it takes into account the optical thickness of the atmosphere, the atmospheric pressure, the water vapor amount, the ozone amount, as well as the composition and amount of aerosol gasses.\nIt is also possible to indicate an AERONET file which contains atmospheric parameters (version 1 and version 2 of Aeronet file are supported. Note that computing TOC reflectivity will internally compute first TOA and then TOC reflectance. \n"
 "\n--------------------------\n\n"
 "If the sensor is not supported by the metadata interface factory of OTB, users still have the possibility to give the needed parameters to the application.\n"
-"For TOA conversion, these parameters are: \n"
+"For TOA conversion, these parameters are: \n\n"
 "- day and month of acquisition, or flux normalization coefficient, or solar distance (in AU);\n"
 "- sun elevation angle;\n"
 "- gains and biases, one pair of values for each band (passed by a file);\n"
diff --git a/Modules/Applications/AppSARUtils/CMakeLists.txt b/Modules/Applications/AppSARUtils/CMakeLists.txt
index bd7a065d1828ce742920e76cd6382c222f5f67cf..a6415e933eea99a347a8961b063236fc3aa7dcab 100644
--- a/Modules/Applications/AppSARUtils/CMakeLists.txt
+++ b/Modules/Applications/AppSARUtils/CMakeLists.txt
@@ -1,2 +1,22 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 project(OTBAppSARUtils)
 otb_module_impl()
diff --git a/Modules/Applications/AppSARUtils/otb-module.cmake b/Modules/Applications/AppSARUtils/otb-module.cmake
index 964acb5a4f4f01fcfc86bd030df4e067da8af680..145c7d6196846c08762fc5f5a32b39d1e3428dc6 100644
--- a/Modules/Applications/AppSARUtils/otb-module.cmake
+++ b/Modules/Applications/AppSARUtils/otb-module.cmake
@@ -1,3 +1,23 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 set(DOCUMENTATION "SAR Utils application.")
 
 otb_module(OTBAppSARUtils
diff --git a/Modules/Core/Transform/include/otbStreamingWarpImageFilter.hxx b/Modules/Core/Transform/include/otbStreamingWarpImageFilter.hxx
index 741f7b617dc6ed9f96f6724b7a14592f23fd7ab4..dcd43c075fe385163904dc59014297722b57abf6 100644
--- a/Modules/Core/Transform/include/otbStreamingWarpImageFilter.hxx
+++ b/Modules/Core/Transform/include/otbStreamingWarpImageFilter.hxx
@@ -230,9 +230,24 @@ StreamingWarpImageFilter<TInputImage, TOutputImage, TDisplacementField>
     {
     inputPtr->SetRequestedRegion(inputRequestedRegion);
     }
-  // Here we do not throw an exception, we just do nothing since
-  // resampling filter can legitimately ask for a region outside of
-  // input's largest possible region.
+  else
+    {
+
+    inputFinalSize.Fill(0);
+    inputRequestedRegion.SetSize(inputFinalSize);
+    inputFinalIndex.Fill(0);
+    inputRequestedRegion.SetIndex(inputFinalIndex);
+
+    // store what we tried to request (prior to trying to crop)
+    inputPtr->SetRequestedRegion(inputRequestedRegion);
+
+//    // build an exception
+//    itk::InvalidRequestedRegionError e(__FILE__, __LINE__);
+//    e.SetLocation(ITK_LOCATION);
+//    e.SetDescription("Requested region is (at least partially) outside the largest possible region.");
+//    e.SetDataObject(inputPtr);
+//    throw e;
+    }
  }
 
 
diff --git a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx
index 73fe6bde5d5525aca9815814dc44113b5550f331..c1548bdea9dc6872028d18cae99c1daf08042e61 100644
--- a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx
+++ b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx
@@ -266,6 +266,8 @@ MultivariateAlterationDetectorImageFilter<TInputImage, TOutputImage>
     sign2.set_diagonal(aux5);
     sign2 = sign2.apply(&SignOfValue);
     m_V2 = m_V2 * sign2;
+    
+    m_Rho.flip();
     }
 }
 
diff --git a/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.h b/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.h
index 9d35211893a0519a220620a151dd070721ec4744..94b9b74d9c5eee286ece13ac16222114564da46b 100644
--- a/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.h
+++ b/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.h
@@ -145,6 +145,19 @@ public:
     m_IsTransformationMatrixForward = isForward;
   }
 
+  void SetStatisticsUserIgnoredValue ( RealType value )
+  {
+    /** User ignored value for the normalizer */
+    m_Normalizer->GetCovarianceEstimator()->SetUserIgnoredValue(value);
+    m_Normalizer->GetCovarianceEstimator()->SetIgnoreUserDefinedValue(true);
+    /** User ignored value for the covariance estimator */
+    m_CovarianceEstimator->SetUserIgnoredValue(value);
+    m_CovarianceEstimator->SetIgnoreUserDefinedValue(true);
+    /** User ignored value for the noise covariance estimator */
+    m_NoiseCovarianceEstimator->SetUserIgnoredValue(value);
+    m_NoiseCovarianceEstimator->SetIgnoreUserDefinedValue(true);
+  }
+  
   itkGetConstMacro(EigenValues, VectorType);
 
 protected:
diff --git a/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.hxx
index d120bbde8ed76bf3efef89be4b33afc55828d5c6..68579a81cf7b9b4e5f6dd5679e36309879b0d3a5 100644
--- a/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.hxx
+++ b/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.hxx
@@ -376,54 +376,6 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf
 
   InternalMatrixType transf = Rn_inv * U;
 
-#if 0
-  InternalMatrixType Ax = m_CovarianceMatrix.GetVnlMatrix();
-  InternalMatrixType Ax_inv = vnl_matrix_inverse< MatrixElementType > ( Ax );
-  InternalMatrixType An = m_NoiseCovarianceMatrix.GetVnlMatrix();
-  InternalMatrixType W = An * Ax_inv;
-#endif
-
-#if 0
-  InternalMatrixType transf;
-  vnl_vector< MatrixElementType > vectValP;
-  vnl_symmetric_eigensystem_compute( W, transf, vectValP );
-
-  InternalMatrixType valP ( vectValP.size(), vectValP.size(), vnl_matrix_null );
-  for ( unsigned int i = 0; i < vectValP.size(); ++i )
-    valP(i, i) = vectValP[i];
-#endif
-
-#if 0
-  vnl_svd< MatrixElementType > solver ( W );
-  InternalMatrixType transf = solver.U();
-  InternalMatrixType valP = solver.W();
-#endif
-
-#if 0
-  MatrixType Id ( m_CovarianceMatrix );
-  Id.SetIdentity();
-
-  vnl_generalized_eigensystem solver ( W, Id.GetVnlMatrix() );
-
-  InternalMatrixType transf = solver.V;
-  transf.fliplr();
-
-  InternalMatrixType valP = solver.D;
-  valP.fliplr();
-  valP.flipud();
-#endif
-
-/*
-  InternalMatrixType normMat = transf.transpose() * Ax * transf;
-
-  for ( unsigned int i = 0; i < transf.rows(); ++i )
-  {
-    double norm = 1. / std::sqrt( normMat.get(i, i) );
-    for ( unsigned int j = 0; j < transf.cols(); ++j )
-      transf.put( j, i, transf.get(j, i) * norm );
-  }
-*/
-
   transf.inplace_transpose();
 
   if ( m_NumberOfPrincipalComponentsRequired
diff --git a/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.h b/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.h
index 3368163846bb09339b0fe29eeed9981043f66ac5..6dc5702172e5f2a2240e06e1082e37b9027cdda0 100644
--- a/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.h
+++ b/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.h
@@ -98,6 +98,9 @@ public:
   itkSetMacro(NumberOfPrincipalComponentsRequired, unsigned int);
   itkGetMacro(NumberOfPrincipalComponentsRequired, unsigned int);
 
+  itkSetMacro(Whitening, bool);
+  itkGetMacro(Whitening, bool);
+
   itkGetMacro(CovarianceEstimator, CovarianceEstimatorFilterType *);
   itkGetMacro(Transformer, TransformFilterType *);
 
@@ -158,7 +161,17 @@ public:
     m_StdDevValues = vec;
     this->Modified();
   }
-
+  
+  void SetStatisticsUserIgnoredValue ( RealType value )
+  {
+    /** User ignored value for the normalizer */
+    m_Normalizer->GetCovarianceEstimator()->SetUserIgnoredValue(value);
+    m_Normalizer->GetCovarianceEstimator()->SetIgnoreUserDefinedValue(true);
+    /** User ignored value for the covariance estimator */
+    m_CovarianceEstimator->SetUserIgnoredValue(value);
+    m_CovarianceEstimator->SetIgnoreUserDefinedValue(true);
+  }
+  
 protected:
   PCAImageFilter();
   ~PCAImageFilter() override { }
@@ -197,6 +210,7 @@ protected:
   bool         m_GivenCovarianceMatrix;
   bool         m_GivenTransformationMatrix;
   bool         m_IsTransformationMatrixForward;
+  bool         m_Whitening;
 
   VectorType m_MeanValues;
   VectorType m_StdDevValues;
diff --git a/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx
index 6e49b249ec8ffd5a589e0f900cee9be387aef40c..51633d1eafda79562947a590da19baaf9a33b7e3 100644
--- a/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx
+++ b/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx
@@ -39,7 +39,7 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation >
   this->SetNumberOfRequiredInputs(1);
 
   m_NumberOfPrincipalComponentsRequired = 0;
-
+  m_Whitening = true;
   m_UseNormalization = false;
   m_UseVarianceForNormalization = false;
   m_GivenMeanValues = false;
@@ -154,14 +154,43 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation >
         if ( !m_GivenMeanValues )
         {
           m_MeanValues = m_Normalizer->GetCovarianceEstimator()->GetMean();
+          // Set User mean value so the filter won't recompute the stats
+          m_Normalizer->SetMean( m_MeanValues );
 
           if ( !m_GivenStdDevValues )
+          {
             m_StdDevValues = m_Normalizer->GetFunctor().GetStdDev();
-
+            
+            
+          }
           if ( m_UseVarianceForNormalization )
-            m_CovarianceMatrix = m_Normalizer->GetCovarianceEstimator()->GetCorrelation();
+          {
+            // Set User std value so the filter won't recompute the stats
+            m_Normalizer->SetStdDev( m_StdDevValues );
+            
+            // Compute the correlation matrix, note that GetCovarianceEstimator()->GetCorrelation()
+            // would give us the matrix with component E[XY], which is not what we want., we want
+            // the matrix defined by its component (E[XY]-E[X]E[Y])/(sigmaX*sigmaY)
+            
+            m_CovarianceMatrix = m_Normalizer->GetCovarianceEstimator()->GetCovariance();
+            
+            auto cov = m_Normalizer->GetCovarianceEstimator()->GetCovariance();
+            auto numberOfComponent = this->GetInput()->GetNumberOfComponentsPerPixel();
+            
+            for (unsigned int r = 0; r < numberOfComponent; ++r)
+            {
+              for (unsigned int c = 0; c < numberOfComponent; ++c)
+              {
+                m_CovarianceMatrix(r,c) = cov(r,c) / std::sqrt(cov(r,r)*cov(c,c));
+              }
+            }
+          }
           else
+          {
+            m_Normalizer->SetUseStdDev(false);
             m_CovarianceMatrix = m_Normalizer->GetCovarianceEstimator()->GetCovariance();
+          }
+        
         }
         else
         {
@@ -337,50 +366,6 @@ void
 PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation >
 ::GenerateTransformationMatrix ()
 {
-#if 0
-  /*
-   * Old stuff but did work !
-   */
-
-  MatrixType Id ( m_CovarianceMatrix );
-  Id.SetIdentity();
-
-  typename MatrixType::InternalMatrixType A = m_CovarianceMatrix.GetVnlMatrix();
-  typename MatrixType::InternalMatrixType I = Id.GetVnlMatrix();
-
-  vnl_generalized_eigensystem solver ( A, I );
-
-  typename MatrixType::InternalMatrixType transf = solver.V;
-  transf.fliplr();
-  transf.inplace_transpose();
-
-  vnl_vector< double > valP = solver.D.diagonal();
-  valP.flip();
-
-  /*
-   * We used normalized PCA
-   */
-  for ( unsigned int i = 0; i < valP.size(); ++i )
-  {
-    if (  valP[i] != 0. )
-      valP[i] = 1. / std::sqrt( std::abs( valP[i] ) );
-    else
-      throw itk::ExceptionObject( __FILE__, __LINE__,
-            "Null Eigen value !!", ITK_LOCATION );
-  }
-  valP.post_multiply( transf );
-
-  if ( m_NumberOfPrincipalComponentsRequired
-      != this->GetInput()->GetNumberOfComponentsPerPixel() )
-    m_TransformationMatrix = transf.get_n_rows( 0, m_NumberOfPrincipalComponentsRequired );
-  else
-    m_TransformationMatrix = transf;
-
-
-  m_EigenValues.SetSize( m_NumberOfPrincipalComponentsRequired );
-  for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i )
-    m_EigenValues[i] = static_cast< RealType >( valP[i] );
-#else
   InternalMatrixType transf;
   vnl_vector<double> vectValP;
   vnl_symmetric_eigensystem_compute( m_CovarianceMatrix.GetVnlMatrix(), transf, vectValP );
@@ -389,17 +374,25 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation >
   for ( unsigned int i = 0; i < vectValP.size(); ++i )
     valP(i, i) = vectValP[i];
 
+  m_EigenValues.SetSize( m_NumberOfPrincipalComponentsRequired );
+  for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i )
+    m_EigenValues[m_NumberOfPrincipalComponentsRequired - 1 - i] = static_cast< RealType >( vectValP[i] );
+  
   /* We used normalized PCA */
   for ( unsigned int i = 0; i < valP.rows(); ++i )
   {
     if (  valP(i, i) > 0. )
     {
-      valP(i, i) = 1. / std::sqrt( valP(i, i) );
+      if (m_Whitening)
+        valP(i, i) = 1. / std::sqrt( valP(i, i) );
     }
     else if ( valP(i, i) < 0. )
     {
       otbMsgDebugMacro( << "ValP(" << i << ") neg : " << valP(i, i) << " taking abs value" );
-      valP(i, i) = 1. / std::sqrt( std::abs( valP(i, i) ) );
+      if (m_Whitening)
+        valP(i, i) = 1. / std::sqrt( std::abs( valP(i, i) ) );
+      else
+        valP(i, i) = std::abs( valP(i, i));
     }
     else
     {
@@ -415,12 +408,6 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation >
     m_TransformationMatrix = transf.get_n_rows( 0, m_NumberOfPrincipalComponentsRequired );
   else
     m_TransformationMatrix = transf;
-
-  m_EigenValues.SetSize( m_NumberOfPrincipalComponentsRequired );
-  for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i )
-    m_EigenValues[i] = static_cast< RealType >( valP(i, i) );
-
-#endif
 }
 
 
diff --git a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorImageFilter.h
index 47a453d10c814807facbc7233d001bf8e0d001d9..7e827ea9c525726640afa0d84ba843003b4ebcab 100644
--- a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorImageFilter.h
+++ b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorImageFilter.h
@@ -1,20 +1,23 @@
-/*=========================================================================
-
-  Program:   ORFEO Toolbox
-  Language:  C++
-  Date:      $Date$
-  Version:   $Revision$
-
-
-  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
-  See OTBCopyright.txt for details.
-
-
-     This software is distributed WITHOUT ANY WARRANTY; without even
-     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-     PURPOSE.  See the above copyright notices for more information.
+/*
+ * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
-=========================================================================*/
 #ifndef otbBinaryFunctorImageFilter_h
 #define otbBinaryFunctorImageFilter_h
 
diff --git a/Modules/Filtering/ImageManipulation/include/otbTernaryFunctorImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbTernaryFunctorImageFilter.h
index 1271eb825daf314a8d18294d15eff7b96c8af5ae..bfe45554551f0481c69e713e94b032500583cf76 100644
--- a/Modules/Filtering/ImageManipulation/include/otbTernaryFunctorImageFilter.h
+++ b/Modules/Filtering/ImageManipulation/include/otbTernaryFunctorImageFilter.h
@@ -1,20 +1,23 @@
-/*=========================================================================
-
-  Program:   ORFEO Toolbox
-  Language:  C++
-  Date:      $Date$
-  Version:   $Revision$
-
-
-  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
-  See OTBCopyright.txt for details.
-
-
-     This software is distributed WITHOUT ANY WARRANTY; without even
-     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-     PURPOSE.  See the above copyright notices for more information.
+/*
+ * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
-=========================================================================*/
 #ifndef otbTernaryFunctorImageFilter_h
 #define otbTernaryFunctorImageFilter_h
 
diff --git a/Modules/Hyperspectral/Unmixing/test/otbMDMDNMFImageFilter.cxx b/Modules/Hyperspectral/Unmixing/test/otbMDMDNMFImageFilter.cxx
index 583164e186fcdf0a8d8616831766877e69ef349f..dcdb532d06fca42a79e68beea7cbb9b2b982a846 100644
--- a/Modules/Hyperspectral/Unmixing/test/otbMDMDNMFImageFilter.cxx
+++ b/Modules/Hyperspectral/Unmixing/test/otbMDMDNMFImageFilter.cxx
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
- 
+ *
  * This file is part of Orfeo Toolbox
  *
  *     https://www.orfeo-toolbox.org/
diff --git a/Modules/IO/ImageIO/include/otbMultiImageFileWriter.h b/Modules/IO/ImageIO/include/otbMultiImageFileWriter.h
index e627b74af11694700be2216d2adf745179528d83..5d15b1832db1e84e7959d596be42f9a00cf31cc4 100644
--- a/Modules/IO/ImageIO/include/otbMultiImageFileWriter.h
+++ b/Modules/IO/ImageIO/include/otbMultiImageFileWriter.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) CS SI
+ * Copyright (C) 2017-2019 CS Systemes d'Information (CS SI)
  *
  * This file is part of Orfeo Toolbox
  *
diff --git a/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx b/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx
index 849eea28a6c957b3e53f75a1344de676beda0511..23d525eda8eb4e17f6e4e141b05fb3020a7493a0 100644
--- a/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx
+++ b/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) CS SI
+ * Copyright (C) 2017-2019 CS Systemes d'Information (CS SI)
  *
  * This file is part of Orfeo Toolbox
  *
diff --git a/Modules/IO/ImageIO/src/otbMultiImageFileWriter.cxx b/Modules/IO/ImageIO/src/otbMultiImageFileWriter.cxx
index a3f32a8d36bd404a271c2fd58d61b94488faf981..327bf23fac5cb1140d57f2c7749cd5ef764aaf59 100644
--- a/Modules/IO/ImageIO/src/otbMultiImageFileWriter.cxx
+++ b/Modules/IO/ImageIO/src/otbMultiImageFileWriter.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) CS SI
+ * Copyright (C) 2017-2019 CS Systemes d'Information (CS SI)
  *
  * This file is part of Orfeo Toolbox
  *
diff --git a/Modules/IO/ImageIO/test/otbImageFileReaderOptBandTest.cxx b/Modules/IO/ImageIO/test/otbImageFileReaderOptBandTest.cxx
index 5f308702b95f9df3c2cea8b3650c0ab85bdab715..c41c5b535e1633259916e08e3da4d3b895e7ae1c 100644
--- a/Modules/IO/ImageIO/test/otbImageFileReaderOptBandTest.cxx
+++ b/Modules/IO/ImageIO/test/otbImageFileReaderOptBandTest.cxx
@@ -1,20 +1,23 @@
-/*=========================================================================
+/*
+ * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
-  Program:   ORFEO Toolbox
-  Language:  C++
-  Date:      $Date$
-  Version:   $Revision$
-
-
-  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
-  See OTBCopyright.txt for details.
-
-
-  This software is distributed WITHOUT ANY WARRANTY; without even
-  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-  PURPOSE.  See the above copyright notices for more information.
-
-=========================================================================*/
 #include "otbImage.h"
 #include "itkMacro.h"
 #include <iostream>
diff --git a/Modules/IO/ImageIO/test/otbMultiImageFileWriterTest.cxx b/Modules/IO/ImageIO/test/otbMultiImageFileWriterTest.cxx
index 77d6ede243b19c34694ff18a74959457c060a0d0..ac34570c933cd521f9a453bcbd2b71b2f3fcf7ff 100644
--- a/Modules/IO/ImageIO/test/otbMultiImageFileWriterTest.cxx
+++ b/Modules/IO/ImageIO/test/otbMultiImageFileWriterTest.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) CS SI
+ * Copyright (C) 2017-2019 CS Systemes d'Information (CS SI)
  *
  * This file is part of Orfeo Toolbox
  *
diff --git a/Modules/Remote/Mosaic.remote.cmake b/Modules/Remote/Mosaic.remote.cmake
index 87d0e5345e8c79fc2ba9347af0f42b3ef620367d..385a4288300926bb499406ce50244a4525f8029f 100644
--- a/Modules/Remote/Mosaic.remote.cmake
+++ b/Modules/Remote/Mosaic.remote.cmake
@@ -1,3 +1,23 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 #Contact: Rémi Cresson <remi.cresson@teledetection.fr>
 otb_fetch_module(Mosaic
   "This module provides one application dedicated to images mosaicking
diff --git a/Modules/Remote/SertitObject.remote.cmake b/Modules/Remote/SertitObject.remote.cmake
index fa2d45eedf800175c44d19cedab5aaf1d575ab5d..5bb94f4a9bb078b5fa109085c6a9dd27efe3d59c 100644
--- a/Modules/Remote/SertitObject.remote.cmake
+++ b/Modules/Remote/SertitObject.remote.cmake
@@ -1,3 +1,23 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 #Contact: arnaud.durand@sertit.u-strasbg.fr
 
 #SERTIT - University of Strasbourg http://sertit.u-strasbg.fr
diff --git a/Modules/Remote/diapotb.remote.cmake b/Modules/Remote/diapotb.remote.cmake
index cc771e7f1d620088b347badb112eb4572b23719d..71cc6f2d5c094e92a5e7ec0c5999c7d622cabd7a 100644
--- a/Modules/Remote/diapotb.remote.cmake
+++ b/Modules/Remote/diapotb.remote.cmake
@@ -1,3 +1,23 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 #Contact: Gaëlle USSEGLIO
 otb_fetch_module(DiapOTBModule
   "OTB module for SAR processing in Diapason."
diff --git a/Modules/Remote/otbGRM.remote.cmake b/Modules/Remote/otbGRM.remote.cmake
index 3d2dda71f0cca6db264ff9b6cc6922719df4475e..5224df15d1fd21f8f75d459cc8f2bbedab8322e2 100644
--- a/Modules/Remote/otbGRM.remote.cmake
+++ b/Modules/Remote/otbGRM.remote.cmake
@@ -1,3 +1,23 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 #Contact: Pierre Lassalle <lassallepierre34@gmail.com> 
 otb_fetch_module(otbGRM
   "This module provides the GRM OTB application to perform multiscale
diff --git a/Modules/Wrappers/SWIG/test/python/Bug1498.py b/Modules/Wrappers/SWIG/test/python/Bug1498.py
index ab0fb77e0d50756a412ea84dab5a3067d2822039..6e6ed15dc3b8ce82882d44f58a12ec0a9f028d36 100644
--- a/Modules/Wrappers/SWIG/test/python/Bug1498.py
+++ b/Modules/Wrappers/SWIG/test/python/Bug1498.py
@@ -1,3 +1,25 @@
+#!/usr/bin/env python3
+#-*- coding: utf-8 -*-
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 import otbApplication as otb
 
 # TO RUN WITH PYTHON3
diff --git a/Modules/Wrappers/SWIG/test/python/Bug1899.py b/Modules/Wrappers/SWIG/test/python/Bug1899.py
index 02cd8cd8332e5d33cd2f4a221cb82a672119b383..93d768d9ca8217372e56821c81a870ec1794ef78 100644
--- a/Modules/Wrappers/SWIG/test/python/Bug1899.py
+++ b/Modules/Wrappers/SWIG/test/python/Bug1899.py
@@ -1,5 +1,24 @@
 #!/usr/bin/env python3
 #-*- coding: utf-8 -*-
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 import sys
 import argparse
diff --git a/Modules/Wrappers/SWIG/test/python/PythonImageInterface.py b/Modules/Wrappers/SWIG/test/python/PythonImageInterface.py
index 62aade511e61aeaf5689fdaa00f8bda03afe4b9a..ee1bfc7243cba42ba148cd04585e18068456b325 100644
--- a/Modules/Wrappers/SWIG/test/python/PythonImageInterface.py
+++ b/Modules/Wrappers/SWIG/test/python/PythonImageInterface.py
@@ -1,3 +1,24 @@
+#!/usr/bin/env python3
+#-*- coding: utf-8 -*-
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 def test(otb, argv):
   # Create a smoothing application
diff --git a/Packaging/Files/mapla.bat b/Packaging/Files/mapla.bat
index 3d208a81c56347414c6da757d42444cda2dc68a9..d5e636761496423834f4eb718f72c3f18c9d845d 100644
--- a/Packaging/Files/mapla.bat
+++ b/Packaging/Files/mapla.bat
@@ -3,13 +3,13 @@
 ::
 :: This file is part of Orfeo Toolbox
 ::
-::   https://www.orfeo-toolbox.org/
+::     https://www.orfeo-toolbox.org/
 ::
 :: Licensed under the Apache License, Version 2.0 (the "License");
 :: you may not use this file except in compliance with the License.
 :: You may obtain a copy of the License at
 ::
-::   http://www.apache.org/licenses/LICENSE-2.0
+::     http://www.apache.org/licenses/LICENSE-2.0
 ::
 :: Unless required by applicable law or agreed to in writing, software
 :: distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Packaging/Files/monteverdi.bat b/Packaging/Files/monteverdi.bat
index 59cc85f7299e0fa52a35e6aa2f7ed2eaf3fd6ed2..d8309fec7911444e5fc6203e697ae4c09633fb05 100644
--- a/Packaging/Files/monteverdi.bat
+++ b/Packaging/Files/monteverdi.bat
@@ -3,13 +3,13 @@
 ::
 :: This file is part of Orfeo Toolbox
 ::
-::    https://www.orfeo-toolbox.org/
+::     https://www.orfeo-toolbox.org/
 ::
 :: Licensed under the Apache License, Version 2.0 (the "License");
 :: you may not use this file except in compliance with the License.
 :: You may obtain a copy of the License at
 ::
-::    http://www.apache.org/licenses/LICENSE-2.0
+::     http://www.apache.org/licenses/LICENSE-2.0
 ::
 :: Unless required by applicable law or agreed to in writing, software
 :: distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Packaging/Files/otbenv.bat b/Packaging/Files/otbenv.bat
index 6b4efefb227c0767592e1210f801f62212a7aded..d6f6412c5a15c776b5cbcdfa6096124a0fdbc943 100644
--- a/Packaging/Files/otbenv.bat
+++ b/Packaging/Files/otbenv.bat
@@ -3,19 +3,20 @@
 ::
 :: This file is part of Orfeo Toolbox
 ::
-::   https://www.orfeo-toolbox.org/
+::     https://www.orfeo-toolbox.org/
 ::
 :: Licensed under the Apache License, Version 2.0 (the "License");
 :: you may not use this file except in compliance with the License.
 :: You may obtain a copy of the License at
 ::
-::   http://www.apache.org/licenses/LICENSE-2.0
+::     http://www.apache.org/licenses/LICENSE-2.0
 ::
 :: Unless required by applicable law or agreed to in writing, software
 :: distributed under the License is distributed on an "AS IS" BASIS,
 :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 :: See the License for the specific language governing permissions and
 :: limitations under the License.
+
 @echo off
 :: Setup environment for OTB package
 set CURRENT_SCRIPT_DIR=%~dp0
diff --git a/Packaging/Files/selftester.bat b/Packaging/Files/selftester.bat
index 85fe9d6d19e9804227e4c5295491d56afc2dc9e8..d30e8b350ac5576d12ae2bf150bfe9e6d7a440da 100755
--- a/Packaging/Files/selftester.bat
+++ b/Packaging/Files/selftester.bat
@@ -1,22 +1,24 @@
-@echo off
-::  Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
-:: 
-::  This file is part of Orfeo Toolbox
-:: 
-::      https://www.orfeo-toolbox.org/
-:: 
-::  Licensed under the Apache License, Version 2.0 (the "License");
-::  you may not use this file except in compliance with the License.
-::  You may obtain a copy of the License at
-:: 
-::      http://www.apache.org/licenses/LICENSE-2.0
-:: 
-::  Unless required by applicable law or agreed to in writing, software
-::  distributed under the License is distributed on an "AS IS" BASIS,
+::
+:: Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+::
+:: This file is part of Orfeo Toolbox
+::
+::     https://www.orfeo-toolbox.org/
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+::     http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
 :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 :: See the License for the specific language governing permissions and
 :: limitations under the License.
 
+@echo off
+
 rem set EXIT_ON_ERROR=0
 rem set TEST_VERBOSE=1
 rem cmd /k tools\selftester.bat /q > selftest_report.log 2>&1
diff --git a/Packaging/Files/uninstall_otb.bat b/Packaging/Files/uninstall_otb.bat
index 6ca7b67208f0e6c65e93bcf5aa1222902d784bee..9ef3871e0a1eb5fa9f343b688c6bf3cd789d4f42 100644
--- a/Packaging/Files/uninstall_otb.bat
+++ b/Packaging/Files/uninstall_otb.bat
@@ -1,16 +1,15 @@
-@echo off
-:: 
+::
 :: Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
 ::
 :: This file is part of Orfeo Toolbox
-:: 
-::    https://www.orfeo-toolbox.org/
+::
+::     https://www.orfeo-toolbox.org/
 ::
 :: Licensed under the Apache License, Version 2.0 (the "License");
 :: you may not use this file except in compliance with the License.
 :: You may obtain a copy of the License at
 ::
-::    http://www.apache.org/licenses/LICENSE-2.0
+::     http://www.apache.org/licenses/LICENSE-2.0
 ::
 :: Unless required by applicable law or agreed to in writing, software
 :: distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +17,8 @@
 :: See the License for the specific language governing permissions and
 :: limitations under the License.
 
+@echo off
+
 :: script to uninstall OTB
 
 setlocal
diff --git a/Utilities/Doxygen/mcdoc.py b/Utilities/Doxygen/mcdoc.py
index 0242dcfbea1c0a6d15ea142891f96cec738c871c..071cf8a0397622d28ea67b02c8254b79ddc209e6 100644
--- a/Utilities/Doxygen/mcdoc.py
+++ b/Utilities/Doxygen/mcdoc.py
@@ -1,4 +1,23 @@
 #!/usr/bin/env python
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 import sys, os, re, glob
 try:
diff --git a/Utilities/Doxygen/otbgroup.pl b/Utilities/Doxygen/otbgroup.pl
index 89eabdf3869eed6426e804e7a72c4c91df624d5f..c8660c92f3b37275e222279d4b64cda1a5375270 100644
--- a/Utilities/Doxygen/otbgroup.pl
+++ b/Utilities/Doxygen/otbgroup.pl
@@ -1,3 +1,23 @@
+#
+# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
+#
+# This file is part of Orfeo Toolbox
+#
+#     https://www.orfeo-toolbox.org/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 # if regular doxycomment add a @{
 # at next empty line add a //@}