diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4bc8861686dde8870ef66d00c91e95973702b12..eab3bfd0a0eaf120682e9ab5a3e3691526517bdf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -136,9 +136,13 @@ legal-check: #------------------------- prepare & build jobs -------------------------------- debian-build: extends: .common-build - image: $BUILD_IMAGE_REGISTRY/otb-debian-native:unstable + image: $BUILD_IMAGE_REGISTRY/otb-debian-native:testing + allow_failure: true script: - - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-unstable-gcc + - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-testing-gcc + after_script: + - export CI_ALLOW_FAILURE=ON + - python3 -u CI/cdash_handler.py dependencies: [] ## Ubuntu superbuild @@ -325,6 +329,7 @@ ubuntu-xdk-report: - sonar-scanner -Dproject.settings=sonar-project.properties -Dsonar.host.url=https://sonar.orfeo-toolbox.org -Dsonar.login=$SONAR_OTB_TOKEN + -Dsonar.projectKey=$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME `test -z "$CI_COMMIT_TAG" || echo "-Dsonar.projectVersion=$CI_COMMIT_TAG"` -Dsonar.branch.name=$CI_COMMIT_REF_NAME diff --git a/.mailmap b/.mailmap index ebb52908855837f5b00e97c2f34616bbb3a0d854..76e7ccc1cb898510aec54126753dc6004bdb8045 100644 --- a/.mailmap +++ b/.mailmap @@ -5,21 +5,21 @@ 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> +Aurélie Emilien <aurelie.emilien@c-s.fr> +Aurélie Emilien <aurelie.emilien@c-s.fr> Aurelie Emilien <aurelie.emilien@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> +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> Traizet Cedric <cedric.traizet@cesbio.cnes.fr> +Cédric Traizet <cedric.traizet@c-s.fr> ctraizet <cedric.traizet@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> @@ -36,7 +36,8 @@ Grégoire Mercier <gregoire.mercier@telecom-bretagne.eu> Gregoire Mercier <gre 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> +Guillaume Pernot <guillaume.pernot@c-s.fr> +Guillaume Pernot <guillaume.pernot@c-s.fr> gpernot <guillaume.pernot@c-s.fr> Jee Roen <jeroen.staab@posteo.de> Jonathan Guinet <jonathan.guinet@c-s.fr> Jordi Inglada <jordi.inglada@cesbio.eu> @@ -70,26 +71,27 @@ Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad Kanavath <moham 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> +Rémi Cresson <remi.cresson@irstea.fr> Remi Cresson <remi.cresson@irstea.fr> +Rémi Cresson <remi.cresson@irstea.fr> Rémi <remi.cresson@teledetection.fr> +Rémi Cresson <remi.cresson@irstea.fr> remi <remi.cresson@irstea.fr> +Rémi Cresson <remi.cresson@irstea.fr> remi cresson <remi.cresson@teledetection.fr> +Rémi Cresson <remi.cresson@irstea.fr> remicres <remi.cresson@teledetection.fr> 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> +Stephane Albert <stephane.albert@c-s.fr> Stephane Albert <salbert@dora.si.c-s.fr> Sylvain Poulain <kikislater@users.noreply.github.com> Sylvain POULAIN <kikislater@users.noreply.github.com> +Sébastien Dinot <sebastien.dinot@c-s.fr> +Sébastien Dinot <sebastien.dinot@c-s.fr> Achille Talon <atalon@dinot.net> +Sébastien Dinot <sebastien.dinot@c-s.fr> Sebastien Dinot <sebastien.dinot@c-s.fr> 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> Yannick TANGUY <yannick.tanguy@cnes.fr> Yannick Tanguy <yannick.tanguy@cnes.fr> ytanguy <yannick.tanguy@cnes.fr> Yin Tiangang <crsyt@nus.edu.sg> +janestar <janestar92@163.com> diff --git a/CI/cdash_handler.py b/CI/cdash_handler.py index f5662a0d00cd1c42bee04a37d8a5290bde0b3192..b890fa42d63c4f293a66683c5bce0c1c39ebc417 100644 --- a/CI/cdash_handler.py +++ b/CI/cdash_handler.py @@ -246,6 +246,9 @@ if __name__ == "__main__": if ( len(sys.argv) < 6 and len(sys.argv) > 1 ): print("Usage : "+sys.argv[0]+" commit_sha1 project_id project_directory token ref_name") sys.exit(1) + + allow_failure = os.environ.get('CI_ALLOW_FAILURE', False) + if ( len(sys.argv) >= 6): sha1 = sys.argv[1] proj = sys.argv[2] @@ -286,6 +289,10 @@ if __name__ == "__main__": sys.exit(0) gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/" gitlab_url += proj + "/statuses/" + sha1 + + if allow_failure: + state = 'success' + params = urllib.parse.urlencode({'name':'cdash:' + handler.site , 'state': state ,\ 'target_url' : cdash_url , 'description' : error , 'ref' : refn }) gitlab_request = urllib.request.Request(gitlab_url) diff --git a/CI/debian-unstable-gcc.cmake b/CI/debian-testing-gcc.cmake similarity index 95% rename from CI/debian-unstable-gcc.cmake rename to CI/debian-testing-gcc.cmake index e1579da20d663c771b67d065ba49562c03a70969..9d94b441ee8d77d81ede3b21cee6400b4215f0cd 100644 --- a/CI/debian-unstable-gcc.cmake +++ b/CI/debian-testing-gcc.cmake @@ -21,7 +21,7 @@ # Configuration options for debian-unstable-gcc set(site_option -"opencv_INCLUDE_DIR:PATH=/usr/include +"OpenCV_DIR:PATH=/usr OTB_USE_MPI:BOOL=OFF OTB_USE_SHARK:BOOL=OFF ") diff --git a/CMake/DeployQtConf.cmake b/CMake/DeployQtConf.cmake deleted file mode 100644 index 7dd7c17f1234f54f445c106072338c8bdfce3ff5..0000000000000000000000000000000000000000 --- a/CMake/DeployQtConf.cmake +++ /dev/null @@ -1,38 +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. -# - -# Deploy a qt.conf file in the specified -# target build directory, as a pre-build step -macro( deploy_qt_conf TARGET_NAME ) - - add_custom_command( - TARGET ${TARGET_NAME} - PRE_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -D QT_TRANSLATIONS_DIR:PATH=${QT_TRANSLATIONS_DIR} - -D QT_PLUGINS_DIR:PATH=${QT_PLUGINS_DIR} - -D Monteverdi_SOURCE_DIR:PATH=${Monteverdi_SOURCE_DIR} - -D TARGET_DIR:PATH=$<TARGET_FILE_DIR:${TARGET_NAME}> - -P ${Monteverdi_SOURCE_DIR}/CMake/DeployQtConfScript.cmake - COMMENT "Deploying qt.conf in ${TARGET_NAME} build dir" - VERBATIM - ) - -endmacro() diff --git a/CMake/DeployQtConfScript.cmake b/CMake/DeployQtConfScript.cmake deleted file mode 100644 index c0a495cff9657126d4a92df020e60a624373db1a..0000000000000000000000000000000000000000 --- a/CMake/DeployQtConfScript.cmake +++ /dev/null @@ -1,23 +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. -# - -configure_file(${Monteverdi_SOURCE_DIR}/CMake/qt.conf.in - ${TARGET_DIR}/qt.conf - @ONLY) \ No newline at end of file diff --git a/CMake/FindAgg.cmake b/CMake/FindAgg.cmake deleted file mode 100644 index c47d5cf1ad7e507ad5480ee11b93d0aae929c5ee..0000000000000000000000000000000000000000 --- a/CMake/FindAgg.cmake +++ /dev/null @@ -1,48 +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. -# - -# Find the AntiGrain Geometry graphical toolkit header files -# -# AGG_FOUND - True if AGG found. -# AGG_INCLUDE_DIRS - where to find agg_pixfmt_rgba.h, etc. -# - -if( AGG_INCLUDE_DIR ) - # Already in cache, be silent - set( AGG_FIND_QUIETLY TRUE ) -endif() - -find_path( AGG_INCLUDE_DIR agg_pixfmt_rgba.h - PATH_SUFFIXES agg2 - ) - -# handle the QUIETLY and REQUIRED arguments and set AGG_FOUND to TRUE if -# all listed variables are TRUE -include( FindPackageHandleStandardArgs ) -find_package_handle_standard_args( Agg DEFAULT_MSG AGG_INCLUDE_DIR ) - -mark_as_advanced( AGG_INCLUDE_DIR ) - -if(AGG_FOUND) - set(AGG_INCLUDE_DIRS ${AGG_INCLUDE_DIR}) -else() - set(AGG_INCLUDE_DIRS) -endif() - diff --git a/CMake/FindGLEW.cmake b/CMake/FindGLEW.cmake deleted file mode 100644 index 6ec4e8707ec38a78129fdc2dae16f4a941d20d19..0000000000000000000000000000000000000000 --- a/CMake/FindGLEW.cmake +++ /dev/null @@ -1,63 +0,0 @@ -# File from https://github.com/progschj/OpenGL-Examples/ -# -# ---------------------------------------------------------------------------- -# Copyright (c) 2012-2013 Jakob Progsch -# Released under ZLib license: -# -# This software is provided 'as-is', without any express or implied warranty. -# In no event will the authors be held liable for any damages arising from the -# use of this software. -# -# Permission is granted to anyone to use this software for any purpose, -# including commercial applications, and to alter it and redistribute it -# freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not -# claim that you wrote the original software. If you use this software in -# a product, an acknowledgment in the product documentation would be -# appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be -# misrepresented as being the original software. -# -# 3. This notice may not be removed or altered from any source distribution. -# ---------------------------------------------------------------------------- -# -# NOTE: This file was removed from OpenGL-Examples project on 2013-11-01: -# https://github.com/progschj/OpenGL-Examples/commit/a100ce1ec6f5f6acf6ba3a3279cd3b3b91775b20 -# -# Try to find GLEW library and include path. -# Once done this will define -#rewritten for OTB by Rashad Kanavath -# -# GLEW_FOUND -# GLEW_INCLUDE_PATH -# GLEW_LIBRARY -# - -# This whole file could be deleted. Find Packages GLEW can be used now -find_path( - GLEW_INCLUDE_DIR GL/glew.h - DOC "The directory where GL/glew.h resides" - ) - -if(WIN32) - set(GLEW_LIB_NAMES glew GLEW glew32 glew32s) -else() - set(GLEW_LIB_NAMES libGLEW GLEW) -endif() - -FIND_LIBRARY( GLEW_LIBRARY - NAMES ${GLEW_LIB_NAMES} - DOC "The GLEW library") - -set(GLEW_FOUND FALSE) -if (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) - set(GLEW_LIBRARIES ${GLEW_LIBRARY}) - set(GLEW_FOUND TRUE) -endif() - -INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(GLEW - REQUIRED_VARS GLEW_LIBRARY GLEW_INCLUDE_DIR - VERSION_VAR GLEW_VERSION_STRING) diff --git a/CMake/FindICUUC.cmake b/CMake/FindICUUC.cmake deleted file mode 100644 index 042adfdf79091b9d93fddda07bfd1572bc249968..0000000000000000000000000000000000000000 --- a/CMake/FindICUUC.cmake +++ /dev/null @@ -1,53 +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. -# - -# - Find ICUUC -# Find the native ICUUC includes and library -# -# ICUUC_FOUND - True if ICUUC found. -# ICUUC_INCLUDE_DIRS - where to find unicode/unistr.h, etc. -# ICUUC_LIBRARIES - List of libraries when using ICUUC. -# - -if( ICUUC_INCLUDE_DIR ) - # Already in cache, be silent - set( ICUUC_FIND_QUIETLY TRUE ) -endif() - -find_path( ICUUC_INCLUDE_DIR unicode/unistr.h ) - -find_library( ICUUC_LIBRARY - NAMES icuuc ) - -# handle the QUIETLY and REQUIRED arguments and set ICUUC_FOUND to TRUE if -# all listed variables are TRUE -include( FindPackageHandleStandardArgs ) -find_package_handle_standard_args( ICUUC DEFAULT_MSG ICUUC_LIBRARY ICUUC_INCLUDE_DIR ) - -mark_as_advanced( ICUUC_INCLUDE_DIR ICUUC_LIBRARY ) - -if(ICUUC_FOUND) - set(ICUUC_INCLUDE_DIRS ${ICUUC_INCLUDE_DIR}) - set(ICUUC_LIBRARIES ${ICUUC_LIBRARY}) -else() - set(ICUUC_INCLUDE_DIRS) - set(ICUUC_LIBRARIES) -endif() - diff --git a/CMake/FindKWStyle.cmake b/CMake/FindKWStyle.cmake deleted file mode 100644 index 6f912cbfdee6a41428ce1d08ad47a347f8ca10f4..0000000000000000000000000000000000000000 --- a/CMake/FindKWStyle.cmake +++ /dev/null @@ -1,54 +0,0 @@ -# - Finds the KWStyle utility -# This module looks for KWStyle. If KWStyle is found, -# the following variables are defined: -# KWSTYLE_FOUND - Set if KWStyle is found -# KWSTYLE_EXECUTABLE - Path to the KWStyle executable -# KWSTYLE_VERSION_STRING - A human-readable string containing the version of KWStyle - -#============================================================================= -# Copyright 2008-2013 Kitware, Inc. -# Copyright 2013 Brian Helba -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.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 License for more information. -#============================================================================= - -find_program( - KWSTYLE_EXECUTABLE - NAMES KWStyle - DOC "Path to the KWStyle executable" - ) -mark_as_advanced(KWSTYLE_EXECUTABLE) - -if(KWSTYLE_EXECUTABLE) - execute_process( - COMMAND ${KWSTYLE_EXECUTABLE} -version - OUTPUT_VARIABLE KWSTYLE_VERSION_STRING - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(KWSTYLE_VERSION_STRING) - # string(REPLACE ..) fails if the input is an empty string - string(REPLACE - "Version: " - "" - KWSTYLE_VERSION_STRING - ${KWSTYLE_VERSION_STRING} - ) - else(KWSTYLE_VERSION_STRING) - # CMake's find_package_handle_standard_args has a bug where the - # version empty string ("") is always acceptable - set(KWSTYLE_VERSION_STRING "?") - endif(KWSTYLE_VERSION_STRING) -endif(KWSTYLE_EXECUTABLE) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - KWStyle - REQUIRED_VARS KWSTYLE_EXECUTABLE - VERSION_VAR KWSTYLE_VERSION_STRING - ) diff --git a/CMake/FindLTDL.cmake b/CMake/FindLTDL.cmake deleted file mode 100644 index 1820b17295dcdf3867e2cb478490e6a52e361574..0000000000000000000000000000000000000000 --- a/CMake/FindLTDL.cmake +++ /dev/null @@ -1,53 +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. -# - -# - Find LTDL -# Find the native LTDL includes and library -# -# LTDL_FOUND - True if LTDL found. -# LTDL_INCLUDE_DIRS - where to find ltdl.h, etc. -# LTDL_LIBRARIES - List of libraries when using LTDL. -# - -if( LTDL_INCLUDE_DIR ) - # Already in cache, be silent - set( LTDL_FIND_QUIETLY TRUE ) -endif() - -find_path( LTDL_INCLUDE_DIR ltdl.h ) - -find_library( LTDL_LIBRARY - NAMES ltdl ) - -# handle the QUIETLY and REQUIRED arguments and set LTDL_FOUND to TRUE if -# all listed variables are TRUE -include( FindPackageHandleStandardArgs ) -find_package_handle_standard_args( LTDL DEFAULT_MSG LTDL_LIBRARY LTDL_INCLUDE_DIR ) - -mark_as_advanced( LTDL_INCLUDE_DIR LTDL_LIBRARY ) - -if(LTDL_FOUND) - set(LTDL_INCLUDE_DIRS ${LTDL_INCLUDE_DIR}) - set(LTDL_LIBRARIES ${LTDL_LIBRARY}) -else() - set(LTDL_INCLUDE_DIRS) - set(LTDL_LIBRARIES) -endif() - diff --git a/CMake/FindMercurial.cmake b/CMake/FindMercurial.cmake deleted file mode 100644 index cb84c1249830fcd25d76df3c6c9a49c96bb99616..0000000000000000000000000000000000000000 --- a/CMake/FindMercurial.cmake +++ /dev/null @@ -1,95 +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. -# - -# - Extract information from a mercurial working copy - -# Example usage: -# find_package(Mercurial) -# if(Mercurial_FOUND) -# Mercurial_WC_IDENTIFY(${PROJECT_SOURCE_DIR} Project) -# message("Current revision is ${Project_WC_REVISION}") -# message("Mercurial version is ${Mercurial_VERSION_HG}") -# endif() - -# This file can be deleted as we no longer use mercurial -set(Mercurial_FOUND FALSE) -set(Mercurial_HG_FOUND FALSE) - -find_program(Mercurial_HG_EXECUTABLE hg - DOC "mercurial command line client") -mark_as_advanced(Mercurial_HG_EXECUTABLE) - -if(Mercurial_HG_EXECUTABLE) - set(Mercurial_HG_FOUND TRUE) - set(Mercurial_FOUND TRUE) - - macro(Mercurial_WC_IDENTIFY dir prefix) - # the subversion commands should be executed with the C locale, otherwise - # the message (which are parsed) may be translated, Alex - set(_Mercurial_SAVED_LC_ALL "$ENV{LC_ALL}") - set(ENV{LC_ALL} C) - execute_process(COMMAND ${Mercurial_HG_EXECUTABLE} version - WORKING_DIRECTORY ${dir} - OUTPUT_VARIABLE Mercurial_VERSION_HG - OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) - - execute_process(COMMAND ${Mercurial_HG_EXECUTABLE} identify ${dir} - OUTPUT_VARIABLE ${prefix}_WC_IDENTIFY -# ERROR_VARIABLE Mercurial_hg_identify_error -# RESULT_VARIABLE Mercurial_hg_identify_result - OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) - - execute_process(COMMAND ${Mercurial_HG_EXECUTABLE} status -m ${dir} - OUTPUT_VARIABLE ${prefix}_WC_STATUS -# ERROR_VARIABLE Mercurial_hg_status_error -# RESULT_VARIABLE Mercurial_hg_status_result - OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) - - if(NOT ${Mercurial_hg_identify_result} EQUAL 0) - message(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} identify ${dir}\" failed with output:\n${Mercurial_hg_identify_error}") - else() - - string(REGEX REPLACE "^(.*\n)?Mercurial Distributed SCM [(]version ([.0-9]+).*" - "\\2" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}") - string(REGEX REPLACE "^(.*\n)?([0-9a-f]+).*" - "\\2" ${prefix}_WC_REVISION "${${prefix}_WC_IDENTIFY}") - - endif() - - # restore the previous LC_ALL - set(ENV{LC_ALL} ${_Mercurial_SAVED_LC_ALL}) - - endmacro() - - - -endif() - - - -if(NOT Mercurial_FOUND) - if(NOT Mercurial_FIND_QUIETLY) - message(STATUS "Mercurial was not found.") - else() - if(Mercurial_FIND_REQUIRED) - message(FATAL_ERROR "Mercurial was not found.") - endif() - endif() -endif() diff --git a/CMake/FindOpenCV.cmake b/CMake/FindOpenCV.cmake index 68090148872048fbfdf64ace8ad3d8ffb9843523..b7b99b4402bd6a7e2ea9c6935407486502ceabd5 100644 --- a/CMake/FindOpenCV.cmake +++ b/CMake/FindOpenCV.cmake @@ -21,9 +21,9 @@ set(OPENCV_SEARCH_PATH) if(OpenCV_DIR) - get_filename_component(OPENCV_SEARCH_PATH "${OpenCV_DIR}" PATH) + get_filename_component(OPENCV_SEARCH_PATH "${OpenCV_DIR}" REALPATH) if(OPENCV_SEARCH_PATH) - get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" PATH) + get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" REALPATH) endif() if(OPENCV_SEARCH_PATH) find_path( diff --git a/CMake/FindOpenThreads.cmake b/CMake/FindOpenThreads.cmake deleted file mode 100644 index 0b141d612536a43bfa56cd9ef9f9ead1f68dbdc2..0000000000000000000000000000000000000000 --- a/CMake/FindOpenThreads.cmake +++ /dev/null @@ -1,107 +0,0 @@ -# OpenThreads is a C++ based threading library. Its largest userbase -# seems to OpenSceneGraph so you might notice I accept OSGDIR as an -# environment path. -# I consider this part of the Findosg* suite used to find OpenSceneGraph -# components. -# Each component is separate and you must opt in to each module. -# -# Locate OpenThreads -# This module defines -# OPENTHREADS_LIBRARIES -# OPENTHREADS_FOUND, if false, do not try to link to OpenThreads -# OPENTHREADS_INCLUDE_DIRS, where to find the headers -# OPENTHREADS_VERSION - version string -# OPENTHREADS_VERSION_MAJOR - version major number -# OPENTHREADS_VERSION_MINOR - version minor number -# OPENTHREADS_VERSION_PATCH - version patch number -# OPENTHREADS_VERSION_NUMBER - version number ((major*100)+minor)*100+patch -# -# $OPENTHREADS_DIR is an environment variable that would -# correspond to the ./configure --prefix=$OPENTHREADS_DIR -# used in building osg. -# -# Created by Eric Wing. -# Modified by Guillaume Pasero. - -#============================================================================= -# Copyright 2007-2009 Kitware, Inc. -# Copyright 2009-2017 Centre National d'Etudes Spatiales (CNES) -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.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 License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# Header files are presumed to be included like -# #include <OpenThreads/Thread> - -# To make it easier for one-step automated configuration/builds, -# we leverage environmental paths. This is preferable -# to the -DVAR=value switches because it insulates the -# users from changes we may make in this script. -# It also offers a little more flexibility than setting -# the CMAKE_*_PATH since we can target specific components. -# However, the default CMake behavior will search system paths -# before anything else. This is problematic in the cases -# where you have an older (stable) version installed, but -# are trying to build a newer version. -# CMake doesn't offer a nice way to globally control this behavior -# so we have to do a nasty "double FIND_" in this module. -# The first FIND disables the CMAKE_ search paths and only checks -# the environmental paths. -# If nothing is found, then the second find will search the -# standard install paths. -# Explicit -DVAR=value arguments should still be able to override everything. - -# This whole file could be deleted. Find Packages OpenThreads can be used now -find_path( - OPENTHREADS_INCLUDE_DIR OpenThreads/Thread - PATH_SUFFIXES include -) -mark_as_advanced(OPENTHREADS_INCLUDE_DIR) - -if(EXISTS "${OPENTHREADS_INCLUDE_DIR}/OpenThreads/Version") - file(READ "${OPENTHREADS_INCLUDE_DIR}/OpenThreads/Version" _openthreads_version_CONTENTS) - string(REGEX REPLACE ".*# *define +OPENTHREADS_MAJOR_VERSION +([0-9]+).*" "\\1" OPENTHREADS_VERSION_MAJOR "${_openthreads_version_CONTENTS}") - string(REGEX REPLACE ".*# *define +OPENTHREADS_MINOR_VERSION +([0-9]+).*" "\\1" OPENTHREADS_VERSION_MINOR "${_openthreads_version_CONTENTS}") - string(REGEX REPLACE ".*# *define +OPENTHREADS_PATCH_VERSION +([0-9]+).*" "\\1" OPENTHREADS_VERSION_PATCH "${_openthreads_version_CONTENTS}") - - set(OPENTHREADS_VERSION "${OPENTHREADS_VERSION_MAJOR}.${OPENTHREADS_VERSION_MINOR}.${OPENTHREADS_VERSION_PATCH}") - math(EXPR OPENTHREADS_VERSION_NUMBER - "((${OPENTHREADS_VERSION_MAJOR})*100+${OPENTHREADS_VERSION_MINOR})*100+${OPENTHREADS_VERSION_PATCH}") -else() - if(NOT OPENTHREADS_FIND_QUIETLY) - message(WARNING "OpenThreads/Version not found !") - endif() -endif() - -find_library(OPENTHREADS_LIBRARY - NAMES OpenThreads OpenThreadsWin32 - PATH_SUFFIXES lib64 lib -) -mark_as_advanced(OPENTHREADS_LIBRARY) - -find_library(OPENTHREADS_LIBRARY_DEBUG - NAMES OpenThreadsd OpenThreadsWin32d - PATH_SUFFIXES lib64 lib -) -mark_as_advanced(OPENTHREADS_LIBRARY_DEBUG) - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenThreads DEFAULT_MSG - OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR) - -if(OPENTHREADS_LIBRARY_DEBUG) - set(OPENTHREADS_LIBRARIES - optimized ${OPENTHREADS_LIBRARY} - debug ${OPENTHREADS_LIBRARY_DEBUG}) -else() - set(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY}) -endif() - -set(OPENTHREADS_INCLUDE_DIRS ${OPENTHREADS_INCLUDE_DIR}) diff --git a/CMake/MinGWPackage.cmake b/CMake/MinGWPackage.cmake deleted file mode 100644 index ea19fada3e0c0ce5d2babd21ff7682b2c345be67..0000000000000000000000000000000000000000 --- a/CMake/MinGWPackage.cmake +++ /dev/null @@ -1,207 +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. -# - -macro(package_mingw) - cmake_parse_arguments(PACKAGE "" "PREFIX_DIR;ARCH;MXEROOT;WITH_OTBGUI" "SEARCHDIRS;PEFILES" ${ARGN} ) - - list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLauncherCommandLine.exe) - list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbTestDriver.exe) - if(PACKAGE_WITH_OTBGUI) - list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLauncherQt.exe) - endif() - - if("${PACKAGE_ARCH}" STREQUAL "x86") - set(MXE_BIN_DIR "${PACKAGE_MXEROOT}/usr/i686-w64-mingw32.shared/bin") - set(MXE_OBJDUMP "${PACKAGE_MXEROOT}/usr/bin/i686-w64-mingw32.shared-objdump") - elseif("${PACKAGE_ARCH}" STREQUAL "x64") - set(MXE_BIN_DIR "${PACKAGE_MXEROOT}/usr/x86_64-w64-mingw32.shared/bin") - set(MXE_OBJDUMP "${PACKAGE_MXEROOT}/usr/bin/x86_64-w64-mingw32.shared-objdump") - endif() - - file(GLOB MXE_GCC_LIB_DIR "${MXE_BIN_DIR}/gcc*") - list(APPEND PACKAGE_SEARCHDIRS ${MXE_GCC_LIB_DIR}) - list(APPEND PACKAGE_SEARCHDIRS ${MXE_BIN_DIR}) - list(APPEND PACKAGE_SEARCHDIRS "${MXE_BIN_DIR}/../qt/bin") #Qt - list(APPEND PACKAGE_SEARCHDIRS "${MXE_BIN_DIR}/../qt/lib") #Qwt - list(APPEND PACKAGE_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/bin") #mvd - list(APPEND PACKAGE_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/lib/otb/applications") #otb apps - - install_common(${PACKAGE_WITH_OTBGUI}) - - file(GLOB otbapps_list ${CMAKE_INSTALL_PREFIX}/lib/otb/applications/otbapp_*dll) # /lib/otb - list(APPEND PACKAGE_PEFILES ${otbapps_list}) - - set(alldlls) - set(notfound_dlls) - foreach(infile ${PACKAGE_PEFILES}) - get_filename_component(bn ${infile} NAME) - process_deps(${bn}) - endforeach() - - list(LENGTH notfound_dlls nos) - if(${nos} GREATER 0) - STRING(REPLACE ".dll" ".dll," notfound ${notfound_dlls}) - message(FATAL_ERROR "Following dlls were not found: ${notfound} - Please consider adding their paths to SEARCHDIRS when calling package_mingw macro.") - endif() - -endmacro(package_mingw) - -set(SYSTEM_DLLS - msvc.*dll - user32.dll - gdi32.dll - shell32.dll - kernel32.dll - advapi32.dll - crypt32.dll - ws2_32.dll - wldap32.dll - ole32.dll - opengl32.dll - glu32.dll - comdlg32.dll - imm32.dll - oleaut32.dll - comctl32.dll - winmm.dll - shfolder.dll - secur32.dll - wsock32.dll - winspool.drv) - -macro(is_system_dll matched value) - set(${matched}) - string(TOLOWER ${value} value_) - foreach (pattern ${SYSTEM_DLLS}) - string(TOLOWER ${pattern} pattern_) - if(${value_} MATCHES ${pattern_}) - set(${matched} TRUE) - endif() - endforeach() -endmacro() - -macro(list_contains var value) - set(${var}) - foreach(value2 ${ARGN}) - if(${value} STREQUAL ${value2}) - set(${var} TRUE) - endif() - endforeach(value2) -endmacro() - -function(process_deps infile) - get_filename_component(bn ${infile} NAME) - list_contains(contains "${bn}" "${alldlls}") - if(NOT contains) - set(DLL_FOUND FALSE) - foreach(SEARCHDIR ${PACKAGE_SEARCHDIRS}) - if(NOT DLL_FOUND) - if(EXISTS ${SEARCHDIR}/${infile}) - set(DLL_FOUND TRUE) - else() - string(TOLOWER ${infile} infile_lower) - if(EXISTS ${SEARCHDIR}/${infile_lower}) - set(DLL_FOUND TRUE) - set(infile ${infile_lower}) - endif() - endif() - if(DLL_FOUND) - message(STATUS "Processing ${SEARCHDIR}/${infile}") - if(NOT "${infile}" MATCHES "otbapp") - install(FILES "${SEARCHDIR}/${infile}" - DESTINATION ${PACKAGE_PREFIX_DIR}/bin) - else() - ##message(STATUS "skipping..${infile}") - endif() - if(NOT EXISTS ${MXE_OBJDUMP}) - message(FATAL_ERROR "objdump executable not found. please check MXE_OBJDUMP is set to correct cross compiled executable") - endif() - execute_process(COMMAND ${MXE_OBJDUMP} "-p" "${SEARCHDIR}/${infile}" OUTPUT_VARIABLE dlldeps) - string(REGEX MATCHALL "DLL.Name..[A-Za-z(0-9\\.0-9)+_\\-]*" OUT "${dlldeps}") - string(REGEX REPLACE "DLL.Name.." "" OUT "${OUT}") - foreach(o ${OUT}) - process_deps(${o}) - endforeach() - endif() - endif(NOT DLL_FOUND) - endforeach() - - if(NOT DLL_FOUND) - is_system_dll(iss "${infile}") - if(NOT iss) - set(notfound_dlls "${notfound_dlls};${infile}") - endif() - else(NOT DLL_FOUND) - - set( alldlls "${alldlls};${bn}" PARENT_SCOPE ) - endif(NOT DLL_FOUND) - - set(notfound_dlls "${notfound_dlls}" PARENT_SCOPE ) - endif() -endfunction() - -function(install_common with_otbgui) - set(APP_PREFIX_DIR "${PACKAGE_PREFIX_DIR}") - set(APP_BIN_DIR "${APP_PREFIX_DIR}/bin") - set(APP_OTBLIBS_DIR "${APP_PREFIX_DIR}/lib/otb") - set(APP_DATA_DIR "${APP_PREFIX_DIR}/share") - - ####################### install GDAL data ####################### - - set(GDAL_DATA ${MXE_BIN_DIR}/../share/gdal) - if(NOT EXISTS "${GDAL_DATA}/epsg.wkt") - message(FATAL_ERROR "Cannot generate package without GDAL_DATA : ${GDAL_DATA}") - endif() - - install( - DIRECTORY ${GDAL_DATA} - DESTINATION ${APP_DATA_DIR}) - - ####################### Check otb applications ####################### - - file(GLOB OTB_APPS_LIST ${CMAKE_INSTALL_PREFIX}/lib/otb/applications/otbapp_*dll) # /lib/otb - if(NOT OTB_APPS_LIST) - message(FATAL_ERROR "No OTB-applications detected") - endif() - - ## otb apps dir /lib/otb/applications - install( - DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/otb/applications" - DESTINATION ${APP_OTBLIBS_DIR}) - - file(GLOB CLI_SCRIPTS ${CMAKE_INSTALL_PREFIX}/bin/otbcli*) - foreach(CLI_SCRIPT ${CLI_SCRIPTS}) - install( - FILES "${CLI_SCRIPT}" - DESTINATION ${APP_BIN_DIR}) - endforeach() - - if(with_otbgui) - file(GLOB GUI_SCRIPTS ${CMAKE_INSTALL_PREFIX}/bin/otbgui*) - foreach(GUI_SCRIPT ${GUI_SCRIPTS}) - install( - FILES "${GUI_SCRIPT}" - DESTINATION ${APP_BIN_DIR}) - endforeach() - endif() - - -endfunction() diff --git a/CMake/OTBModuleEnablement.cmake b/CMake/OTBModuleEnablement.cmake index 143de8ad4cba37afd7e039942688bb77a54952a8..00e58e585b7a96046b9cf18092d7d910d5d1efac 100644 --- a/CMake/OTBModuleEnablement.cmake +++ b/CMake/OTBModuleEnablement.cmake @@ -247,100 +247,6 @@ foreach(otb-module ${OTB_MODULES_ALL}) endif() endforeach() -#----------------------------------------------------------------------------- -# Construct an in-build-order list of "CDash subproject" modules from the -# list of enabled modules: - -set(OTB_CDASH_SUBPROJECT_MODULES) - -if(OTB_GENERATE_PROJECT_XML OR OTB_GENERATE_SUBPROJECTS_CMAKE) - # Since a "CDash subproject" for OTB logically contains both a non-test - # module and its corresponding test module, the subproject order must take - # both modules into account. The subprojects in this list are named after - # the non-test modules in the enabled modules list. But the ordering of - # these subprojects use the dependencies of the modules *and* their test - # modules - foreach(module ${OTB_MODULES_ENABLED}) - if(${module}_TESTED_BY) - # module that HAS a test module: skip for now... will be added as a - # subproject later, in the slot when its corresponding "-test" module - # is encountered - elseif(${module}_TESTS_FOR) - # this is a test module... *now* list the module which it tests as - # the subproject name: - list(APPEND OTB_CDASH_SUBPROJECT_MODULES ${${module}_TESTS_FOR}) - else() - # a module that is not a test module, and has no tested by... - # is just a module-only subproject with no test module: - list(APPEND OTB_CDASH_SUBPROJECT_MODULES ${module}) - endif() - endforeach() -endif() - -#----------------------------------------------------------------------------- -# Write a Project.xml file to send the description of the submodules and -# their dependencies up to CDash: - -if(OTB_GENERATE_PROJECT_XML) - set(filename "${OTB_BINARY_DIR}/${main_project_name}.Project.xml") - - set(xml "<?xml version='1.0' encoding='UTF-8'?>\n") - set(xml "${xml}<Project name='${main_project_name}'>\n") - foreach(module ${OTB_CDASH_SUBPROJECT_MODULES}) - if(${module}_IS_TEST) - message(FATAL_ERROR "unexpected: subproject names should not be test modules module='${module}' tests_for='${${module}_TESTS_FOR}'") - endif() - set(xml "${xml} <SubProject name='${module}'>\n") - set(deps "") - set(dep_list ${OTB_MODULE_${module}_DEPENDS}) - if(${module}_TESTED_BY) - list(APPEND dep_list ${OTB_MODULE_${${module}_TESTED_BY}_DEPENDS}) - if(dep_list) - list(SORT dep_list) - endif() - endif() - foreach(dep ${dep_list}) - if(NOT ${dep}_IS_TEST AND NOT "${module}" STREQUAL "${dep}") - set(xml "${xml} <Dependency name='${dep}'/>\n") - endif() - endforeach() - set(xml "${xml} </SubProject>\n") - endforeach() - set(xml "${xml}</Project>\n") - - # Always write out "${filename}.in": - file(WRITE ${filename}.in "${xml}") - - # Use configure_file so "${filename}" only changes when its content changes: - configure_file(${filename}.in ${filename} COPYONLY) -endif() - -#----------------------------------------------------------------------------- -# Write the list of enabled modules out for ctest scripts to use as an -# in-order subproject list: - -if(OTB_GENERATE_SUBPROJECTS_CMAKE) - set(filename "${OTB_BINARY_DIR}/${main_project_name}.SubProjects.cmake") - - set(s "# Generated by CMake, do not edit!\n") - set(s "${s}set(otb_subprojects\n") - foreach(otb-module ${OTB_CDASH_SUBPROJECT_MODULES}) - if(${otb-module}_IS_TEST) - message(FATAL_ERROR "unexpected: subproject names should not be test modules otb-module='${otb-module}' tests_for='${${otb-module}_TESTS_FOR}'") - endif() - set(s "${s} \"${otb-module}\"\n") - endforeach() - set(s "${s})\n") - - # Always write out "${filename}.in": - file(WRITE ${filename}.in "${s}") - - # Use configure_file so "${filename}" only changes when its content changes: - configure_file(${filename}.in ${filename} COPYONLY) -endif() - -#----------------------------------------------------------------------------- - if(NOT OTB_MODULES_ENABLED) message(WARNING "No modules enabled!") file(REMOVE "${OTB_BINARY_DIR}/OTBTargets.cmake") diff --git a/CMake/OTBModuleTest.cmake b/CMake/OTBModuleTest.cmake index 25c7e308c86c51d12589e691210167501ed3270f..912f8f176244e794248fc3b6ebdabcb4910fb7e2 100644 --- a/CMake/OTBModuleTest.cmake +++ b/CMake/OTBModuleTest.cmake @@ -20,124 +20,6 @@ # This file contains CMake functions and macros used when testing ITK modules. -#----------------------------------------------------------------------------- -# Create source code, compile and link a test driver -# Two variables must be defined before including this file. -# KIT should define a unique name for the test driver. -# KitTests should contain a list of test file names. -# Arguments - Input -# KIT - the name of the test directory -# KIT_LIBS - a list of libraries needed to link the test driver -# KitTests - a list of tests to be included in the test driver -# ADDITIONAL_SRC (optional) - additional source files, which don't contain tests - -macro(CreateTestDriver KIT KIT_LIBS KitTests) - set(ADDITIONAL_SRC ${ARGN}) - if(EMSCRIPTEN) - set(emscripten_before " -EM_ASM( - var cmake_source_dir = '${CMAKE_SOURCE_DIR}'.split('/'); - // This is intentionally global so it can be unmounted at the end. - source_mount_dir = null; - if(cmake_source_dir[1] === 'home') { - source_mount_dir = cmake_source_dir.slice(0, 3).join('/'); - } - else { - source_mount_dir = cmake_source_dir.slice(0, 2).join('/'); - } - FS.mkdir(source_mount_dir); - FS.mount(NODEFS, { root: source_mount_dir }, source_mount_dir); - - var cmake_binary_dir = '${CMAKE_BINARY_DIR}'.split('/'); - // This is intentionally global so it can be unmounted at the end. - binary_mount_dir = null; - if(cmake_binary_dir[1] === 'home') { - binary_mount_dir = cmake_binary_dir.slice(0, 3).join('/'); - } - else { - binary_mount_dir = cmake_binary_dir.slice(0, 2).join('/'); - } - if(source_mount_dir != binary_mount_dir) { - FS.mkdir(binary_mount_dir); - FS.mount(NODEFS, { root: binary_mount_dir }, binary_mount_dir); - } - ); -") - set(emscripten_after " -EM_ASM( - FS.unmount(source_mount_dir); - if(source_mount_dir != binary_mount_dir) { - FS.unmount(binary_mount_dir); - } - ); -") - endif() - set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${emscripten_before}#include \"otbTestDriverBeforeTest.inc\"") - set(CMAKE_TESTDRIVER_AFTER_TESTMAIN "#include \"otbTestDriverAfterTest.inc\"${emscripten_after}") - create_test_sourcelist(Tests ${KIT}TestDriver.cxx - ${KitTests} - EXTRA_INCLUDE otbTestDriverIncludeRequiredIOFactories.h - FUNCTION ProcessArgumentsAndRegisterRequiredFactories - ) - add_executable(${KIT}TestDriver ${KIT}TestDriver.cxx ${Tests} ${ADDITIONAL_SRC}) - target_link_libraries(${KIT}TestDriver LINK_PUBLIC ${KIT_LIBS} ${OTBTestKernel_LIBRARIES}) - otb_module_target_label(${KIT}TestDriver) -endmacro() - - -macro(CreateTestDriver_SupportBuildInIOFactories KIT KIT_LIBS KitTests) - set(ADDITIONAL_SRC ${ARGN} ) - if(EMSCRIPTEN) - set(emscripten_before " -EM_ASM( - var cmake_source_dir = '${CMAKE_SOURCE_DIR}'.split('/'); - // This is intentionally global so it can be unmounted at the end. - source_mount_dir = null; - if(cmake_source_dir[1] === 'home') { - source_mount_dir = cmake_source_dir.slice(0, 3).join('/'); - } - else { - source_mount_dir = cmake_source_dir.slice(0, 2).join('/'); - } - FS.mkdir(source_mount_dir); - FS.mount(NODEFS, { root: source_mount_dir }, source_mount_dir); - - // This is intentionally global so it can be unmounted at the end. - binary_mount_dir = null; - var cmake_binary_dir = '${CMAKE_BINARY_DIR}'.split('/'); - if(cmake_binary_dir[1] === 'home') { - binary_mount_dir = cmake_binary_dir.slice(0, 3).join('/'); - } - else { - binary_mount_dir = cmake_binary_dir.slice(0, 2).join('/'); - } - if(source_mount_dir != binary_mount_dir) { - FS.mkdir(binary_mount_dir); - FS.mount(NODEFS, { root: binary_mount_dir }, binary_mount_dir); - } - ); -") - set(emscripten_after " -EM_ASM( - FS.unmount(source_mount_dir); - if(source_mount_dir != binary_mount_dir) { - FS.unmount(binary_mount_dir); - } - ); -") - endif() - set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${emscripten_before}#include \"otbTestDriverBeforeTest.inc\"") - set(CMAKE_TESTDRIVER_AFTER_TESTMAIN "#include \"otbTestDriverAfterTest.inc\"${emscripten_after}") - create_test_sourcelist(Tests ${KIT}TestDriver.cxx - ${KitTests} - EXTRA_INCLUDE otbTestDriverIncludeBuiltInIOFactories.h - FUNCTION ProcessArgumentsAndRegisterBuiltInFactories - ) - add_executable(${KIT}TestDriver ${KIT}TestDriver.cxx ${Tests} ${ADDITIONAL_SRC}) - target_link_libraries(${KIT}TestDriver LINK_PUBLIC ${KIT_LIBS} ${OTBTestKernel_LIBRARIES}) - otb_module_target_label(${KIT}TestDriver) -endmacro() - #----------------------------------------------------------------------------- # OTB wrapper for add_test that automatically sets the test's LABELS property # to the value of its containing module. diff --git a/CMake/qt.conf.in b/CMake/qt.conf.in deleted file mode 100644 index 4f62e272ce98895c871f6fdea6fe4f55f7ff0563..0000000000000000000000000000000000000000 --- a/CMake/qt.conf.in +++ /dev/null @@ -1,3 +0,0 @@ -[Paths] -Translations=@QT_TRANSLATIONS_DIR@ -Plugins=@QT_PLUGINS_DIR@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 778003cf48049248d01d3b29fc16635caba153ef..bf229cf445795ca6223fbb312ddde3ed51aff8de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,8 @@ set(OTB_MIN_MSVC_VER 19) set(OTB_MIN_Clang_VER 3.4) if(DEFINED OTB_MIN_${CMAKE_CXX_COMPILER_ID}_VER) if(CMAKE_CXX_COMPILER_VERSION AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${OTB_MIN_${CMAKE_CXX_COMPILER_ID}_VER}) - message(STATUS "WARNING: the version of your ${CMAKE_CXX_COMPILER_ID} " - "compiler is not supported by Orfeo ToolBox (C++14 support might be " - "incomplete). Please consider updating your compiler to version " + message(FATAL_ERROR "The version of your ${CMAKE_CXX_COMPILER_ID} " + "compiler is not supported by Orfeo ToolBox. Please consider updating your compiler to version " "${OTB_MIN_${CMAKE_CXX_COMPILER_ID}_VER} or later.") endif() endif() @@ -213,11 +212,6 @@ endmacro() option(BUILD_SHARED_LIBS "Build OTB with shared libraries." ON) mark_as_advanced(BUILD_SHARED_LIBS) -# The following variable can be deleted and replace by BUILD_SHARED_LIBS -# in otbConfigure.h.in -set(OTB_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) - - if(MSVC) option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Build OTB with shared libraries." ON) mark_as_advanced(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS) diff --git a/Data/Baseline/OTB-Applications/Images/apTvUtExtractROI.tif b/Data/Baseline/OTB-Applications/Images/apTvUtExtractROI.tif new file mode 100644 index 0000000000000000000000000000000000000000..845ed57fdebdda0278f0c74276e95127161f462d --- /dev/null +++ b/Data/Baseline/OTB-Applications/Images/apTvUtExtractROI.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdd57014fef13ccc7b2c8c5fb2287f02902af9af96be3ed9209b8d13764c4b40 +size 802 diff --git a/Data/Baseline/OTB/Files/apTvSeSegmentationCCVector.sqlite b/Data/Baseline/OTB/Files/apTvSeSegmentationCCVector.sqlite index c5c023b1884b4f36bcbb46f4c63cc7c370184c57..2865221a195f3c760b3333371ae5256bc6d8f5fb 100644 --- a/Data/Baseline/OTB/Files/apTvSeSegmentationCCVector.sqlite +++ b/Data/Baseline/OTB/Files/apTvSeSegmentationCCVector.sqlite @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:464a254bff3c9cfdecd177667cc3d342d8517d86dd29cf00db08807d438ca63e -size 49152 +oid sha256:81771c5421c48a85b70ab9f32fe8cdea5187c1e055313e0f247268666832368f +size 45056 diff --git a/Data/Baseline/OTB/Files/apTvSeSegmentationCCVector_ULU.sqlite b/Data/Baseline/OTB/Files/apTvSeSegmentationCCVector_ULU.sqlite index f53bf26b285b44601fc75b23a1da5956748991ac..de4a2d1054aa8a2d81122fd266901e8e4ab90749 100644 --- a/Data/Baseline/OTB/Files/apTvSeSegmentationCCVector_ULU.sqlite +++ b/Data/Baseline/OTB/Files/apTvSeSegmentationCCVector_ULU.sqlite @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ccbe0830b5b07af689934eaadfa044fec32a86287ccf6e8e63c88f86dd99f00 -size 65536 +oid sha256:1f0a0bb551d4ca950e0d0f97a3e417f450b8d401e5d7786dfca37cff221646e8 +size 61440 diff --git a/Data/Baseline/OTB/Files/ioTvMultiResolutionReadingInfoOut.3.txt b/Data/Baseline/OTB/Files/ioTvMultiResolutionReadingInfoOut.3.txt new file mode 100644 index 0000000000000000000000000000000000000000..d5c02b767356466844275089eead7cfb4e823d8f --- /dev/null +++ b/Data/Baseline/OTB/Files/ioTvMultiResolutionReadingInfoOut.3.txt @@ -0,0 +1,6 @@ +RESOLUTION: 0; DESC: Resolution: 0 (Image [w x h]: 2592x1944) +RESOLUTION: 1; DESC: Resolution: 1 (Image [w x h]: 1296x972) +RESOLUTION: 2; DESC: Resolution: 2 (Image [w x h]: 648x486) +RESOLUTION: 3; DESC: Resolution: 3 (Image [w x h]: 324x243) +RESOLUTION: 4; DESC: Resolution: 4 (Image [w x h]: 162x122) +RESOLUTION: 5; DESC: Resolution: 5 (Image [w x h]: 81x61) diff --git a/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.dbf b/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.dbf index 3d18b01366faf3f6fb07daf46d6b532822fd8d9d..968c3ba85cb0a079e32ebd93408a1624cfe76dbe 100644 --- a/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.dbf +++ b/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.dbf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:47b644e0641ff7eaec67e019420361945c54d3c4fb7fe2f6bb2c6ca18156fc6e -size 11989 +oid sha256:2a39ce861bb3af7908d145879ca3bf6bb461081ad5631b88b1c78e2eb5f323f8 +size 12100 diff --git a/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.shp b/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.shp index 9099ed1408acc16ce48057e5f72f0614ba0ff6d5..69cd8032bd9f906d373c2b9a117a681074152b7a 100644 --- a/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.shp +++ b/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.shp @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce50b6ff7c9a5f899487dccbd2c425348355de1b6b086407a6e0dda73bebddae -size 919584 +oid sha256:7a846e192be1fa015f851bd67b709ea0def0e40cba7cd59876691a8ea2f43904 +size 922160 diff --git a/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.shx b/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.shx index 62171cea873b930c8dee1d2d64b34bd2d37481d4..51e12ff1e534bf1065ef58239b3940c13e63afa1 100644 --- a/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.shx +++ b/Data/Baseline/OTB/Files/obTvFusionOGRTile.1.shx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1004fb99e63665e173bb3c5cc1df3a07e08e58f7a2daacca2ca0b8350c68742b -size 8772 +oid sha256:681e07c6c2c48c702d461270d7798e675a48d1aba427da2820a414bcf357e594 +size 8852 diff --git a/Data/Baseline/OTB/Files/obTvFusionOGRTile.dbf b/Data/Baseline/OTB/Files/obTvFusionOGRTile.dbf index f963f0f29ed9ac71ad16f280e44dd23946930d00..200c6d00d1d43c3a1412e033fd560558e56926a5 100644 --- a/Data/Baseline/OTB/Files/obTvFusionOGRTile.dbf +++ b/Data/Baseline/OTB/Files/obTvFusionOGRTile.dbf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:52d3c20f176b6fcdaf475de9669489d965571e2804863fa6db4bb8381ead8406 -size 12011 +oid sha256:2890d9b7db13d00d83ad8e724dc056d1d3faa82dce3a8ef65c15405d5c57e345 +size 12111 diff --git a/Data/Baseline/OTB/Files/obTvFusionOGRTile.shp b/Data/Baseline/OTB/Files/obTvFusionOGRTile.shp index f1e674a7cfe622542579369dafe378bb1a70c73f..34597aaca34100ed709d1d3a0eec58057060c896 100644 --- a/Data/Baseline/OTB/Files/obTvFusionOGRTile.shp +++ b/Data/Baseline/OTB/Files/obTvFusionOGRTile.shp @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8c012c7278611ee7f7910ad5fe98e1eb7563950468f62181d949dbfa482d77ce -size 917544 +oid sha256:8696e937927e4db707cac137a2fc9fb1ece8ad6350089158131978c61f6c7acf +size 922180 diff --git a/Data/Baseline/OTB/Files/obTvFusionOGRTile.shx b/Data/Baseline/OTB/Files/obTvFusionOGRTile.shx index b6fe73c0d7034d66cfb309bca55ef15b400c5c80..33d6e4d38b580dbe8853c80d956adcc577ef8db9 100644 --- a/Data/Baseline/OTB/Files/obTvFusionOGRTile.shx +++ b/Data/Baseline/OTB/Files/obTvFusionOGRTile.shx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:30b836d94e351bae53dcaf2196b32172f96c3aa22262b0296337ea51e6c756dd -size 8788 +oid sha256:b196f1a1c1903eb94eb505040b69c56a5d0a684a9869721c18bc1c7a2c4363db +size 8860 diff --git a/Data/Baseline/OTB/Images/bfTvPCAImageFilter5.tif b/Data/Baseline/OTB/Images/bfTvPCAImageFilter5.tif new file mode 100644 index 0000000000000000000000000000000000000000..dbac3617aa6642ed47d0cf50ca450fd363ebb4aa --- /dev/null +++ b/Data/Baseline/OTB/Images/bfTvPCAImageFilter5.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28049cb575b39a672cb0fafdae59bdbfcb8d736cba7bb7b693103804c12850ba +size 440678 diff --git a/Data/Baseline/OTB/Images/bfTvPCAImageFilter5Inv.tif b/Data/Baseline/OTB/Images/bfTvPCAImageFilter5Inv.tif new file mode 100644 index 0000000000000000000000000000000000000000..fb178583f16528601a5c0e16216e9709056ad135 --- /dev/null +++ b/Data/Baseline/OTB/Images/bfTvPCAImageFilter5Inv.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:237f54de08ee2ec78c71d69f6f7bacd06c1a50b1f5f2830f30915e69d173205c +size 159682 diff --git a/Data/Input/ToulousePoints-examples.prj b/Data/Input/apTvUtExtractROIExtentFitVect.prj similarity index 100% rename from Data/Input/ToulousePoints-examples.prj rename to Data/Input/apTvUtExtractROIExtentFitVect.prj diff --git a/Data/Input/apTvUtExtractROIExtentFitVect.qpj b/Data/Input/apTvUtExtractROIExtentFitVect.qpj new file mode 100644 index 0000000000000000000000000000000000000000..ddc76d5fa34c707c88d6fe241ae67b8aaf268aba --- /dev/null +++ b/Data/Input/apTvUtExtractROIExtentFitVect.qpj @@ -0,0 +1 @@ +PROJCS["WGS 84 / UTM zone 31N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32631"]] diff --git a/Data/Input/apTvUtExtractROIExtentFitVect.shp b/Data/Input/apTvUtExtractROIExtentFitVect.shp new file mode 100644 index 0000000000000000000000000000000000000000..a06bb7a89efae21fd6f7ef80cd61ceb3c0a44228 --- /dev/null +++ b/Data/Input/apTvUtExtractROIExtentFitVect.shp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:692e9f22b004700054f755f9913dc952b88f859648e51b3fd0a65e07611283ee +size 236 diff --git a/Data/Input/apTvUtExtractROIExtentFitVect.shx b/Data/Input/apTvUtExtractROIExtentFitVect.shx new file mode 100644 index 0000000000000000000000000000000000000000..8e69cab56e4e4a9e208b7234b4ec0a8b287ab472 --- /dev/null +++ b/Data/Input/apTvUtExtractROIExtentFitVect.shx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7611eb8747853960534fedd2821e2ea06af7c6ed9622439986c8e1967a7d394b +size 108 diff --git a/Data/Input/ToulousePoints-examples.dbf b/Data/Input/toulousepoints_examples.dbf similarity index 100% rename from Data/Input/ToulousePoints-examples.dbf rename to Data/Input/toulousepoints_examples.dbf diff --git a/Data/Input/toulousepoints_examples.prj b/Data/Input/toulousepoints_examples.prj new file mode 100644 index 0000000000000000000000000000000000000000..da98376fa44ea626ab3c6ca1debe4660482e548b --- /dev/null +++ b/Data/Input/toulousepoints_examples.prj @@ -0,0 +1 @@ +PROJCS["WGS_1984_UTM_Zone_31N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]] \ No newline at end of file diff --git a/Data/Input/ToulousePoints-examples.shp b/Data/Input/toulousepoints_examples.shp similarity index 100% rename from Data/Input/ToulousePoints-examples.shp rename to Data/Input/toulousepoints_examples.shp diff --git a/Data/Input/ToulousePoints-examples.shx b/Data/Input/toulousepoints_examples.shx similarity index 100% rename from Data/Input/ToulousePoints-examples.shx rename to Data/Input/toulousepoints_examples.shx diff --git a/Documentation/Cookbook/rst/CompilingOTBFromSource.rst b/Documentation/Cookbook/rst/CompilingOTBFromSource.rst index bec18da04a99938bb36f85f25457a4ef41b78100..365008a093c1d2a78b279f704db430c53298a787 100644 --- a/Documentation/Cookbook/rst/CompilingOTBFromSource.rst +++ b/Documentation/Cookbook/rst/CompilingOTBFromSource.rst @@ -23,61 +23,60 @@ majority) are optional and can be activated or not during the build process: .. table:: External libraries used in OTB - :align: center - - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | **Library** | **Mandatory** | **Minimum version** | **Superbuild Version** | - +==================================================================+=======================+==========================+==========================+ - | `ITK <http://www.itk.org>`_ | Yes | 4.6.0 | 4.13 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `GDAL <http://www.gdal.org>`_ | Yes | 2.0 | 2.4.1 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `OSSIM <http://www.ossim.org>`_ | Yes | 1.8.20-3 | 1.8.20 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `libgeotiff <http://trac.osgeo.org/geotiff/>`_ | Yes | | 1.4.2 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `boost <http://www.boost.org>`_ | Yes | | 1.60 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `openthreads <http://www.openscenegraph.org>`_ | Yes | | 3.4.0 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `tinyXML <http://www.grinninglizard.com/tinyxml>`_ | Yes | | 2.6.2 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `6S <http://6s.ltdri.org>`_ | No | | | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `Curl <http://www.curl.haxx.se>`_ | No | | 7.54.1 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `FFTW <http://www.fftw.org>`_ | No | | 3.3.8 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `GLEW <http://glew.sourceforge.net/>`_ | No | | 1.13 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `GLFW <http://www.glfw.org/>`_ | No | 3 | 3.1.2 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `GLUT <https://www.opengl.org/resources/libraries/glut/>`_ | No | | 2.8.1 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `libKML <https://github.com/google/libkml>`_ | No | 1.2 | 1.3.0 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `libSVM <http://www.csie.ntu.edu.tw/~cjlin/libsvm>`_ | No | 2.0 | 3.22 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `MPI <https://www.open-mpi.org/>`_ | No | | | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `MuParser <http://www.muparser.sourceforge.net>`_ | No | | 2.2.5 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `MuParserX <http://muparserx.beltoforion.de>`_ | No | 4.0.7 | 4.0.7 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `OpenCV <http://opencv.org>`_ | No | 2 (3.x also supported) | 3.4.1 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `OPENGL <https://www.opengl.org/>`_ | No | | | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `Qt <https://www.qt.io/developers/>`_ | No | 5 | 5.10.1 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `QWT <http://qwt.sourceforge.net>`_ | No | 6 | 6.1.3 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `Shark <http://image.diku.dk/shark/>`_ | No | 4 | 4.0 | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `SiftFast <http://libsift.sourceforge.net>`_ | No | | | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ - | `SPTW <https://github.com/remicres/sptw.git>`_ | No | | | - +------------------------------------------------------------------+-----------------------+--------------------------+--------------------------+ + + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | **Library** | **Mandatory** | **Minimum version** | **Superbuild Version** | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `ITK <http://www.itk.org>`_ | Yes | 4.6.0 | 4.13.1 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `GDAL <http://www.gdal.org>`_ | Yes | 2.0 | 2.4.1 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `OSSIM <http://www.ossim.org>`_ | Yes | 1.8.20-3 | 1.8.20 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `libgeotiff <http://trac.osgeo.org/geotiff/>`_ | Yes | | 1.4.2 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `boost <http://www.boost.org>`_ | Yes | | 1.69 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `openthreads <http://www.openscenegraph.org>`_ | Yes | | 3.4.0 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `tinyXML <http://www.grinninglizard.com/tinyxml>`_ | Yes | | 2.6.2 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `6S <http://6s.ltdri.org>`_ | No | | | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `Curl <http://www.curl.haxx.se>`_ | No | | 7.54.1 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `FFTW <http://www.fftw.org>`_ | No | | 3.3.8 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `GLEW <http://glew.sourceforge.net/>`_ | No | | 1.13 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `GLFW <http://www.glfw.org/>`_ | No | 3 | 3.1.2 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `GLUT <https://www.opengl.org/resources/libraries/glut/>`_ | No | | 2.8.1 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `libKML <https://github.com/google/libkml>`_ | No | 1.2 | 1.3.0 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `libSVM <http://www.csie.ntu.edu.tw/~cjlin/libsvm>`_ | No | 2.0 | 3.22 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `MPI <https://www.open-mpi.org/>`_ | No | | | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `MuParser <http://www.muparser.sourceforge.net>`_ | No | | 2.2.5 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `MuParserX <http://muparserx.beltoforion.de>`_ | No | 4.0.7 | 4.0.7 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `OpenCV <http://opencv.org>`_ | No | 2 (3.x and 4.x supported) | 4.1.1 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `OPENGL <https://www.opengl.org/>`_ | No | | | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `Qt <https://www.qt.io/developers/>`_ | No | 5 | 5.10.1 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `QWT <http://qwt.sourceforge.net>`_ | No | 6 | 6.1.3 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `Shark <http://image.diku.dk/shark/>`_ | No | 4 | 4.0 | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `SiftFast <http://libsift.sourceforge.net>`_ | No | | | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ + | `SPTW <https://github.com/remicres/sptw.git>`_ | No | | | + +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ GNU/Linux and macOS ------------------- @@ -85,6 +84,9 @@ GNU/Linux and macOS Setting up the build environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note: On some distibutions, gcc 5+ is not available by default. For example in CentOS 7 the default version +is 4.8 (gcc 7 can be installed using devtoolset, see devtoolset6_ and devtoolset7_). + The first thing to do is to create a directory for working with OTB. This guide will use ``~/OTB`` but you are free to choose something else. In this directory, there will be three locations: @@ -317,7 +319,7 @@ installation location: +---------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **CMake variable** | **3rd party module** | **Modules depending on it** | -+===========================+========================+===========================================================================================================================================================================+ ++---------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **OTB\_USE\_LIBKML** | OTBlibkml | OTBKMZWriter OTBIOKML OTBAppKMZ | +---------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **OTB\_USE\_QT** | OTBQt | OTBQtWidget | @@ -370,11 +372,16 @@ hours to run them all, depending on compilation options To run the tests, first make sure to set the option ``BUILD_TESTING`` to ``ON`` before building the library. -For some of the tests, you also need the test data and the baselines (~1GB): +For some of the tests, you also need the test data and the baselines (~1GB). These files are stored +using `git-lfs` in the `Data` folder at the root of otb sources. To download them, you have to make +sure `git-lfs` is installed before cloning otb (binaries for `git lfs` are available for different +OS `here <https://github.com/git-lfs/git-lfs/releases>`_). + +After downloading, add the binary to $PATH and run `git lfs install`. You can then clone otb sources : :: - git clone https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data.git + git clone https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git Once OTB is built with the tests, you just have to go to the binary directory where you built OTB and run ``ctest -N`` to have a list of all @@ -392,9 +399,6 @@ To build the CookBook documentation, the following python packages are required: pip install numpy sphinx sphinx_rtd_theme -A working installation of ``latex`` is -required for building the PDF version. - Enable Python bindings and set ``BUILD_COOKBOOK``: :: @@ -407,6 +411,5 @@ Then, build the target: make CookbookHTML -:: - - make CookBookPDF +.. _devtoolset6: https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ +.. _devtoolset7: https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ diff --git a/Documentation/Cookbook/rst/QGISInterface.rst b/Documentation/Cookbook/rst/QGISInterface.rst index 61c3765b9978ce0b6cf58101f2dcae3a56754844..380a7fde88f25cc17e8baaefb2df713f1318d81a 100644 --- a/Documentation/Cookbook/rst/QGISInterface.rst +++ b/Documentation/Cookbook/rst/QGISInterface.rst @@ -8,7 +8,7 @@ With QGIS < 3.8 you will need to manually install the plugin. You can follow the instruction here: https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin#otb-provider-for-qgis-processing -With QGIS > 3.8, the plugin is in the QGIS core. So you just need install OTB and set the plugin up. +With QGIS > 3.8, the plugin is already in the QGIS core. So you just need to install OTB and activate the plugin: https://www.orfeo-toolbox.org/CookBook/QGISInterface.html#open-processing-settings Download and Install OTB ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Modules/Adapters/GdalAdapters/test/CMakeLists.txt b/Modules/Adapters/GdalAdapters/test/CMakeLists.txt index 64765708c02c4ac0fa3ab3cf6613c680c2d8dac5..d636ed7e43d0766cc521cd6dffbff6dfe0bc0b1d 100644 --- a/Modules/Adapters/GdalAdapters/test/CMakeLists.txt +++ b/Modules/Adapters/GdalAdapters/test/CMakeLists.txt @@ -36,7 +36,7 @@ add_executable(otbOGRTestsIO otbOGRDataSourceWrapperIO.cxx) target_link_libraries(otbOGRTestsIO ${OTBGdalAdapters-Test_LIBRARIES}) otb_add_test(NAME coTuOGRDataSourceWrapperIO - COMMAND otbOGRTestsIO ${INPUTDATA}/ToulousePoints-examples.shp ) + COMMAND otbOGRTestsIO ${INPUTDATA}/toulousepoints_examples.shp ) set(OTBOGRTests otbOGRTestDriver.cxx @@ -61,7 +61,7 @@ otb_add_test(NAME TvOGRExtendedFilename # otb_add_test(NAME TvOGRExtendedFilenameGDALOpen # COMMAND otbOGRTestDriver # otbOGRExtendedFileNameGDALOpen -# ${INPUTDATA}/ToulousePoints-examples.shp?&gdal:oo:openOption=OPTION +# ${INPUTDATA}/toulousepoints_examples.shp?&gdal:oo:openOption=OPTION # ) otb_add_test(NAME TvOGRExtendedFilenameGDALCreate diff --git a/Modules/Adapters/OSSIMAdapters/test/otbOssimElevManagerTest4.cxx b/Modules/Adapters/OSSIMAdapters/test/otbOssimElevManagerTest4.cxx index d8d30b100926e7050c30a8fa4e0ddc0ae7c8d60e..312ed7b6cf276c5b70d48368b2554d8181bdbdb7 100644 --- a/Modules/Adapters/OSSIMAdapters/test/otbOssimElevManagerTest4.cxx +++ b/Modules/Adapters/OSSIMAdapters/test/otbOssimElevManagerTest4.cxx @@ -96,7 +96,7 @@ int otbOssimElevManagerTest4(int argc, char* argv[]) std::ofstream file; std::cout << outfname << std::endl; - file.open(outfname, ios::binary | ios::out); + file.open(outfname, std::ios::binary | std::ios::out); file.write(reinterpret_cast<char*>(image), sizeof(double) * size[0] * size[1]); file.close(); diff --git a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx index 98cf512acc2cb02c0c06453433165eb2e9fd063f..6a1a17c46bef370f7dc2e44786f0c9e18a64a725 100644 --- a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx +++ b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx @@ -411,7 +411,6 @@ private: lrp[1] = GetParameterFloat("mode.extent.lry"); m_IsExtentInverted = (lrp[0] < ulp[0] || lrp[1] < ulp[1]); ImageType* inImage = GetParameterImage("in"); - FloatVectorImageType::IndexType raw_uli, raw_lri; inImage->TransformPhysicalPointToIndex(ulp, raw_uli); inImage->TransformPhysicalPointToIndex(lrp, raw_lri); } @@ -572,8 +571,8 @@ private: } else if (GetParameterString("mode.radius.unitc") == "phy") { - centerp[0] = GetParameterInt("mode.radius.cx"); - centerp[1] = GetParameterInt("mode.radius.cy"); + centerp[0] = GetParameterFloat("mode.radius.cx"); + centerp[1] = GetParameterFloat("mode.radius.cy"); } else // if ( GetParameterString( "mode.radius.unitc" ) == "lon/lat" ) { @@ -714,13 +713,12 @@ private: "using mod.fit"); } } - RSTransformType::Pointer rsTransform = RSTransformType::New(); rsTransform->SetInputProjectionRef(inputProjectionRef); rsTransform->SetOutputKeywordList(inImage->GetImageKeywordlist()); rsTransform->SetOutputProjectionRef(inImage->GetProjectionRef()); rsTransform->InstantiateTransform(); - itk::Point<float, 2> ulp_in, urp_in, llp_in, lrp_in, ulp_out, urp_out, llp_out, lrp_out; + itk::Point<float, 2> ulp_in, urp_in, llp_in, lrp_in; ulp_in[0] = ulx; ulp_in[1] = uly; urp_in[0] = ulx; diff --git a/Modules/Applications/AppImageUtils/test/CMakeLists.txt b/Modules/Applications/AppImageUtils/test/CMakeLists.txt index 19c2f257fb1cd676baff27f62ab3c8091e8a83ef..44eb49e7f9cbc2842df10dac085472d759b266bd 100644 --- a/Modules/Applications/AppImageUtils/test/CMakeLists.txt +++ b/Modules/Applications/AppImageUtils/test/CMakeLists.txt @@ -19,6 +19,16 @@ # otb_module_test() + +set(OTBAppImageUtilsTests +otbAppImageUtilsTestDriver.cxx +otbExtractROIAppTests.cxx +) + +add_executable(otbAppImageUtilsTestDriver ${OTBAppImageUtilsTests}) +target_link_libraries(otbAppImageUtilsTestDriver ${OTBAppImageUtils-Test_LIBRARIES}) +otb_module_target_label(otbAppImageUtilsTestDriver) + #----------- DownloadSRTMTiles TESTS ---------------- otb_test_application(NAME apTuUtDownloadSRTMTiles APP DownloadSRTMTiles @@ -92,63 +102,23 @@ otb_test_application(NAME apTvUtDynamicConvertMask ${TEMP}/apTvUtDynamicConvertMaskOutput.tif) -#----------- PixelInfo TESTS ---------------- - -#----------- ExtractROI TESTS ---------------- -otb_test_application(NAME apTvUtExtractROISizeTooBig - APP ExtractROI - OPTIONS -in ${INPUTDATA}/couleurs_extrait.png - -out ${TEMP}/apTvUtExtractROISizeTooBig.tif - -sizex 1000000 - VALID --compare-image ${NOTOL} - ${INPUTDATA}/couleurs_extrait.png - ${TEMP}/apTvUtExtractROISizeTooBig.tif) - -otb_test_application(NAME apTvUtExtractROISizeTooBigExtent - APP ExtractROI - OPTIONS -in ${INPUTDATA}/couleurs_extrait.png - -out ${TEMP}/apTvUtExtractROISizeTooBigExtent.tif - -mode extent - -mode.extent.lrx 1000000 - VALID --compare-image ${NOTOL} - ${INPUTDATA}/couleurs_extrait.png - ${TEMP}/apTvUtExtractROISizeTooBigExtent.tif) - -otb_test_application(NAME apTvUtExtractROISizeTooBigRadius - APP ExtractROI - OPTIONS -in ${INPUTDATA}/couleurs_extrait.png - -out ${TEMP}/apTvUtExtractROISizeTooBigRadius.tif - -mode radius - -mode.radius.r 1000000 - VALID --compare-image ${NOTOL} - ${INPUTDATA}/couleurs_extrait.png - ${TEMP}/apTvUtExtractROISizeTooBigRadius.tif) - -otb_test_application(NAME apTvUtExtractROISizeNULL - APP ExtractROI - OPTIONS -in ${INPUTDATA}/couleurs_extrait.png - -out ${TEMP}/apTvUtExtractROISizeNULL.tif - -sizex 0 - VALID --compare-image ${NOTOL} - ${INPUTDATA}/couleurs_extrait.png - ${TEMP}/apTvUtExtractROISizeNULL.tif) +#----------- Extract ROI tests ---------------- -otb_test_application(NAME apTvUtExtractROIRightInputFile - APP ExtractROI - OPTIONS -in ${INPUTDATA}/couleurs_extrait.png - -out ${TEMP}/apTvUtExtractROIRightInputFile.tif - VALID --compare-image ${NOTOL} - ${INPUTDATA}/couleurs_extrait.png - ${TEMP}/apTvUtExtractROIRightInputFile.tif) +otb_add_test(NAME apTvUtExtractROI COMMAND otbAppImageUtilsTestDriver + otbExtractROIAppTests + $<TARGET_FILE_DIR:otbapp_ExtractROI> + 10 3 2 3 4 + ) -otb_test_application(NAME apTvUtExtractROIComplexInputFile +otb_test_application(NAME apTvUtExtractROIExtentFitVect APP ExtractROI - OPTIONS -in ${INPUTDATA}/complexInputCfloat.tif - -out ${TEMP}/apTvUtExtractROIComplexInputFile.tif cfloat + OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif + -out ${TEMP}/apTvUtExtractROIExtentFitVect.tif + -mode fit + -mode.fit.vect ${INPUTDATA}/apTvUtExtractROIExtentFitVect.shp VALID --compare-image ${NOTOL} - ${INPUTDATA}/complexInputCfloat.tif - ${TEMP}/apTvUtExtractROIComplexInputFile.tif) - + ${OTBAPP_BASELINE}/apTvUtExtractROI.tif + ${TEMP}/apTvUtExtractROIExtentFitVect.tif) #----------- Rescale TESTS ---------------- otb_test_application(NAME apTvUtRescaleTest diff --git a/Modules/Applications/AppImageUtils/test/otbAppImageUtilsTestDriver.cxx b/Modules/Applications/AppImageUtils/test/otbAppImageUtilsTestDriver.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c265667a05bce2cbbe8305a33ef85e4ecf5a15c2 --- /dev/null +++ b/Modules/Applications/AppImageUtils/test/otbAppImageUtilsTestDriver.cxx @@ -0,0 +1,26 @@ +/* + * 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 "otbTestMain.h" + +void RegisterTests() +{ + REGISTER_TEST(otbExtractROIAppTests); +} diff --git a/Modules/Applications/AppImageUtils/test/otbExtractROIAppTests.cxx b/Modules/Applications/AppImageUtils/test/otbExtractROIAppTests.cxx new file mode 100644 index 0000000000000000000000000000000000000000..543bc4bafb9fb69d1f2502b7926858e6ad0cd28d --- /dev/null +++ b/Modules/Applications/AppImageUtils/test/otbExtractROIAppTests.cxx @@ -0,0 +1,347 @@ +/* + * 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 <iostream> +#include "otbVectorImage.h" +#include "otbImageFileWriter.h" + +#include "otbWrapperApplicationRegistry.h" + +#include "otbImageToGenericRSOutputParameters.h" + +using VectorImageType = otb::VectorImage<unsigned char>; +using PixelType = VectorImageType::PixelType; +using ApplicationPointerType = otb::Wrapper::Application::Pointer; + +/* This function is creating and filling a georeferenced vector image */ +VectorImageType::Pointer create_vector_image(VectorImageType::SizeType size, int nb_comp, unsigned char value, const OGRSpatialReference& projRef, + VectorImageType::PointType origin, VectorImageType::SpacingType spacing) +{ + + VectorImageType::IndexType index; + index.Fill(0); + VectorImageType::RegionType region; + region.SetSize(size); + region.SetIndex(index); + + auto image = VectorImageType::New(); + + image->SetLargestPossibleRegion(region); + image->SetBufferedRegion(region); + image->SetRequestedRegion(region); + image->SetNumberOfComponentsPerPixel(nb_comp); + image->Allocate(); + PixelType val(nb_comp); + val.Fill(value); + image->FillBuffer(val); + + char* projRefWkt = nullptr; + + projRef.exportToPrettyWkt(&projRefWkt); + image->SetProjectionRef(projRefWkt); + + image->SetOrigin(origin); + + image->SetSignedSpacing(spacing); + + return image; +} + +// Compare the ROI computed by the application with a reference +bool check_roi(ApplicationPointerType app, int ref_startx, int ref_starty, int ref_sizex, int ref_sizey) +{ + auto app_startx = app->GetParameterInt("startx"); + auto app_starty = app->GetParameterInt("starty"); + auto app_sizex = app->GetParameterInt("sizex"); + auto app_sizey = app->GetParameterInt("sizey"); + + if (app_startx != ref_startx || app_starty != ref_starty || app_sizex != ref_sizex || app_sizey != ref_sizey) + { + std::cout << "The ROI computed by the application is incorrect." << std::endl; + std::cout << "Computed: " + << "startx " << app_startx << ", starty " << app_starty << ", sizex " << app_sizex << ", sizey " << app_sizey << std::endl; + std::cout << "Expected: " + << "startx " << ref_startx << ", starty " << ref_starty << ", sizex " << ref_sizex << ", sizey " << ref_sizey << std::endl; + + return false; + } + + return true; +} + +// App configuration with the standard mode +void extract_roi_standard(ApplicationPointerType app, unsigned int startx, unsigned int starty, unsigned int sizex, unsigned int sizey) +{ + app->SetParameterString("mode", "standard"); + app->UpdateParameters(); + app->SetParameterInt("startx", startx); + app->UpdateParameters(); + app->SetParameterInt("starty", starty); + app->UpdateParameters(); + app->SetParameterInt("sizex", sizex); + app->UpdateParameters(); + app->SetParameterInt("sizey", sizey); + app->UpdateParameters(); + app->Execute(); +} + +// App configuration with the extent mode +void extract_roi_extent(ApplicationPointerType app, std::string unit, double ulx, double uly, double lrx, double lry) +{ + app->SetParameterString("mode", "extent"); + app->UpdateParameters(); + app->SetParameterFloat("mode.extent.ulx", ulx); + app->UpdateParameters(); + app->SetParameterFloat("mode.extent.uly", uly); + app->UpdateParameters(); + app->SetParameterFloat("mode.extent.lrx", lrx); + app->UpdateParameters(); + app->SetParameterFloat("mode.extent.lry", lry); + app->UpdateParameters(); + app->SetParameterString("mode.extent.unit", unit); + app->UpdateParameters(); + app->Execute(); +} + +// App configuration with the radius mode +void extract_roi_radius(ApplicationPointerType app, std::string unitc, std::string unitr, double r, double cx, double cy) +{ + app->SetParameterString("mode", "radius"); + app->UpdateParameters(); + app->SetParameterFloat("mode.radius.r", r); + app->UpdateParameters(); + app->SetParameterFloat("mode.radius.cx", cx); + app->UpdateParameters(); + app->SetParameterFloat("mode.radius.cy", cy); + app->UpdateParameters(); + app->SetParameterString("mode.radius.unitc", unitc); + app->UpdateParameters(); + app->SetParameterString("mode.radius.unitr", unitr); + app->UpdateParameters(); + app->Execute(); +} + +/** This function tests the ExtractROI application. It verifies that, for different sets of parameters, + * the ROI computed by the application (startx, starty,sizex and sizey) is correct. The tested mode are : + * - Standard mode with invalid size (output is the full image) + * - Extent mode with invalid size (output is the full image) + * - Radius mode with invalid size (output is the full image) + * - Standard mode + * - Extent mode with pixel units + * - Extent mode with lonlat unit + * - Extent mode with phy unit + * - radius mode with pixel center and radius + * - radius mode with phy center and radius + * - radius mode with lonlat center and pixel radius + * - fit mode with image input + * For all these tests the application executed, but nothing is written to disk, and the output image is not updated. + * This means that the multiChannelExtractROI filter is not updated. + * Finally, in a last test, the channel option is set and the output is updated. + * Note that this test does not test the fit mode with vector data, which is tested in another test. +*/ + +int otbExtractROIAppTests(int, char* argv[]) +{ + unsigned int imageSize = std::stoi(argv[2]); + + // ROI Definition + unsigned int sizex = std::stoi(argv[3]); + unsigned int sizey = std::stoi(argv[4]); + unsigned int startx = std::stoi(argv[5]); + unsigned int starty = std::stoi(argv[6]); + + // The ROI should be contained in the input image + assert(imageSize > startx + sizex && imageSize > starty + sizey); + // sizex must be odd (for radius computation) + assert(sizex % 2 == 1); + + // Create the input image + + // Proj Ref and origin + OGRSpatialReference projRef; + + projRef.SetWellKnownGeogCS("WGS84"); + projRef.SetUTM(31, TRUE); + + // VectorImageType::PointType origin; + itk::Point<float, 2> ul_phy; + ul_phy[0] = 452256.55; + ul_phy[1] = 5412621.36; + + VectorImageType::SpacingType spacing; + spacing[0] = 1; + spacing[1] = 1; + + VectorImageType::SizeType size; + size.Fill(imageSize); + auto inImg = create_vector_image(size, 3, 0, projRef, ul_phy, spacing); + + otb::Wrapper::ApplicationRegistry::SetApplicationPath(argv[1]); + auto app = otb::Wrapper::ApplicationRegistry::CreateApplication("ExtractROI"); + + // Set the input image + app->SetParameterInputImage("in", inImg); + app->UpdateParameters(); + + // Test 1 : input image, no other parameters + std::cout << "Test: input Image set with no other parameters" << std::endl; + + if (!check_roi(app, 0, 0, imageSize, imageSize)) + return EXIT_FAILURE; + + std::cout << "Test: standard mode with too big size" << std::endl; + + extract_roi_standard(app, 0, 0, 10000000, imageSize); + if (!check_roi(app, 0, 0, imageSize, imageSize)) + return EXIT_FAILURE; + + std::cout << "Test: extent mode with too big extent" << std::endl; + extract_roi_extent(app, "pxl", 0, 0, imageSize + 1000000, imageSize); + if (!check_roi(app, 0, 0, imageSize, imageSize)) + return EXIT_FAILURE; + + std::cout << "Test: radius mode with too big radius" << std::endl; + + extract_roi_radius(app, "pxl", "pxl", 10000000, imageSize / 2, imageSize / 2); + if (!check_roi(app, 0, 0, imageSize, imageSize)) + return EXIT_FAILURE; + + + std::cout << "Test: standard mode" << std::endl; + extract_roi_standard(app, startx, starty, sizex, sizey); + if (!check_roi(app, startx, starty, sizex, sizey)) + return EXIT_FAILURE; + + + // -------------- Extent mode test -------------------------------- + + // Indexes of the extent corresponding to the input parameters + VectorImageType::IndexType uli, lri; + uli[0] = startx; + uli[1] = starty; + lri[0] = startx + sizex - 1; + lri[1] = starty + sizey - 1; + + std::cout << "Test: extent mode with pixel unit" << std::endl; + extract_roi_extent(app, "pxl", uli[0], uli[1], lri[0], lri[1]); + if (!check_roi(app, startx, starty, sizex, sizey)) + return EXIT_FAILURE; + + + std::cout << "Test: extent mode with physical unit" << std::endl; + // Find cartographic coordinated corresponding to the input image coordinates. + + itk::Point<float, 2> ulp, lrp; + + inImg->TransformIndexToPhysicalPoint(uli, ulp); + inImg->TransformIndexToPhysicalPoint(lri, lrp); + + // We may need to swap coordinates to have a non inverted extent (if the image has negative spacing). + extract_roi_extent(app, "phy", std::min(ulp[0], lrp[0]), std::min(ulp[1], lrp[1]), std::max(ulp[0], lrp[0]), std::max(ulp[1], lrp[1])); + if (!check_roi(app, startx, starty, sizex, sizey)) + return EXIT_FAILURE; + + std::cout << "Test: extent mode with long/lat unit" << std::endl; + + // Proj Ref and origin + char* projRefWkt = nullptr; + + projRef.exportToPrettyWkt(&projRefWkt); + auto transform = otb::GenericRSTransform<>::New(); + transform->SetInputProjectionRef(projRefWkt); + transform->SetOutputProjectionRef(otb::SpatialReference::FromWGS84().ToWkt()); + transform->InstantiateTransform(); + auto ulp_lonlat = transform->TransformPoint(ulp); + auto lrp_lonlat = transform->TransformPoint(lrp); + + // We may need to swap coordinates to have a non inverted extent (if the image has negative spacing). + extract_roi_extent(app, "lonlat", std::min(ulp_lonlat[0], lrp_lonlat[0]), std::min(ulp_lonlat[1], lrp_lonlat[1]), std::max(ulp_lonlat[0], lrp_lonlat[0]), + std::max(ulp_lonlat[1], lrp_lonlat[1])); + if (!check_roi(app, startx, starty, sizex, sizey)) + return EXIT_FAILURE; + + std::cout << "Test: radius mode with pxl center and pxl radius" << std::endl; + + VectorImageType::IndexType center_pxl; + center_pxl[0] = startx + (sizex - 1) / 2; + center_pxl[1] = starty + (sizex - 1) / 2; + unsigned int r = (sizex - 1) / 2; + + extract_roi_radius(app, "pxl", "pxl", r, center_pxl[0], center_pxl[1]); + if (!check_roi(app, startx, starty, sizex, sizex)) + return EXIT_FAILURE; + + float r_phy = r * inImg->GetSignedSpacing()[0]; + + itk::Point<float, 2> center_phy; + inImg->TransformIndexToPhysicalPoint(center_pxl, center_phy); + + std::cout << "Test: radius mode with phy center and phy radius" << std::endl; + + extract_roi_radius(app, "phy", "phy", r_phy, center_phy[0], center_phy[1]); + if (!check_roi(app, startx, starty, sizex, sizex)) + return EXIT_FAILURE; + + auto center_lonlat = transform->TransformPoint(center_phy); + + std::cout << "Test: radius mode with lonlat center and pxl radius" << std::endl; + + extract_roi_radius(app, "lonlat", "pxl", r, center_lonlat[0], center_lonlat[1]); + if (!check_roi(app, startx, starty, sizex, sizex)) + return EXIT_FAILURE; + + // -------------- Fit mode test -------------------------------- + + VectorImageType::SizeType fitSize; + fitSize[0] = sizex; + fitSize[1] = sizey; + itk::Point<float, 2> fitOrig; + fitOrig[0] = ulp[0]; + fitOrig[1] = ulp[1]; + + std::cout << "Test: fit mode with reference image" << std::endl; + + auto fitImg = create_vector_image(fitSize, 3, 0, projRef, ulp, spacing); + app->SetParameterString("mode", "fit"); + app->UpdateParameters(); + app->SetParameterInputImage("mode.fit.im", fitImg); + app->UpdateParameters(); + app->Execute(); + if (!check_roi(app, startx, starty, sizex, sizey)) + return EXIT_FAILURE; + + // Finally, test update the output to test the multiChannelExtractROI and the channel option. + std::cout << "Test: cl parameter" << std::endl; + + app->SetParameterStringList("cl", {"Channel1", "Channel2"}); + app->UpdateParameters(); + app->Execute(); + + auto output = app->GetParameterImageBase("out"); + output->Update(); + + // Check that the output has the requested number of bands + if (output->GetNumberOfComponentsPerPixel() != 2) + { + std::cout << "Wrong number of components after ExtractROI" << std::endl; + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx index b4354037a387f9cc82cff3d1827c80ce9d94f379..12d2886911a05bd286aa3f9fd368eea5db1d89c5 100644 --- a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx +++ b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx @@ -191,7 +191,10 @@ private: "The application is currently unable to produce one output image per " "expression, contrary to otbBandMathXImageFilter. " "Separating expressions by semicolons ``;`` will concatenate their results " - "into a unique multiband output image."); + "into a unique multiband output image. \n\n" + "Matrix variables cannot be defined directly with the `-exp` parameter (because " + "the semicolon ``;`` operator is required to define matrices and already has another meaning). " + "A context file should be used when defining matrix variables."); SetDocAuthors("OTB-Team"); SetDocSeeAlso( "[1] https://beltoforion.de/article.php?a=muparserx\n\n" diff --git a/Modules/Applications/AppProjection/test/CMakeLists.txt b/Modules/Applications/AppProjection/test/CMakeLists.txt index 28b843b2157b84c32720f2a218302b9e36942f2b..7a9e6d2c8ca9b1a50ee257fed695cd76772796ed 100644 --- a/Modules/Applications/AppProjection/test/CMakeLists.txt +++ b/Modules/Applications/AppProjection/test/CMakeLists.txt @@ -205,7 +205,7 @@ otb_test_application(NAME apTuPrVectorDataReprojectionFromImageToMap otb_test_application(NAME apTvPrVectorDataReprojectionFromMapToMap APP VectorDataReprojection - OPTIONS -in.vd ${INPUTDATA}/ToulousePoints-examples.shp + OPTIONS -in.vd ${INPUTDATA}/toulousepoints_examples.shp -out.vd ${TEMP}/apTvPrVectorDataReprojectionFromMapToMap.sqlite -out.proj user -out.proj.user.map lambert93 @@ -215,7 +215,7 @@ otb_test_application(NAME apTvPrVectorDataReprojectionFromMapToMap otb_test_application(NAME apTvPrVectorDataReprojectionFromMapToImage APP VectorDataReprojection - OPTIONS -in.vd ${INPUTDATA}/ToulousePoints-examples.shp + OPTIONS -in.vd ${INPUTDATA}/toulousepoints_examples.shp -out.vd ${TEMP}/apTvPrVectorDataReprojectionFromMapToImage.shp -out.proj image -out.proj.image.in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif @@ -225,7 +225,7 @@ otb_test_application(NAME apTvPrVectorDataReprojectionFromMapToImage otb_test_application(NAME apTvPrVectorDataReprojectionFromMapToSensor APP VectorDataReprojection - OPTIONS -in.vd ${INPUTDATA}/ToulousePoints-examples.shp + OPTIONS -in.vd ${INPUTDATA}/toulousepoints_examples.shp -out.vd ${TEMP}/apTvPrVectorDataReprojectionFromMapToSensor.shp -out.proj image -out.proj.image.in ${INPUTDATA}/QB_PAN_ROI_1000_100.tif @@ -247,7 +247,7 @@ otb_test_application(NAME apTvPrVectorDataReprojectionFromMapToMap2 otb_test_application(NAME apTvPrVectorDataReprojectionFromMapToGeo APP VectorDataReprojection - OPTIONS -in.vd ${INPUTDATA}/ToulousePoints-examples.shp + OPTIONS -in.vd ${INPUTDATA}/toulousepoints_examples.shp -out.vd ${TEMP}/apTvPrVectorDataReprojectionFromMapToGeo.shp -out.proj user -out.proj.user.map wgs diff --git a/Modules/Applications/AppSegmentation/test/CMakeLists.txt b/Modules/Applications/AppSegmentation/test/CMakeLists.txt index fb4f2e15a7fbd1054cd5bb43014fe6427529ae2c..b8a5a84d44a9f8a08939c0c56223ca40b207dd60 100644 --- a/Modules/Applications/AppSegmentation/test/CMakeLists.txt +++ b/Modules/Applications/AppSegmentation/test/CMakeLists.txt @@ -56,6 +56,7 @@ string(TOLOWER ${filter} lfilter) set(OUTFILE apTvSeSegmentation${filter}${mode}${${lmode}_output_format}) if(NOT (${filter} STREQUAL "Meanshift" AND ${mode} STREQUAL "Raster")) + OTB_TEST_APPLICATION(NAME apTvSeSegmentation${filter}${mode} APP Segmentation OPTIONS -in ${INPUTDATA}/WV2_MUL_ROI_1000_100.tif @@ -64,6 +65,7 @@ OTB_TEST_APPLICATION(NAME apTvSeSegmentation${filter}${mode} -mode ${lmode} -mode.${lmode}.out ${TEMP}/${OUTFILE} ${${lmode}_output_option} ${${lmode}_parameters} + --add-before-env ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS 4 VALID ${${lfilter}_option} ${${lmode}_comparison} ${${lmode}_ref_path}/${OUTFILE} diff --git a/Modules/Applications/AppVectorUtils/app/otbConcatenateVectorData.cxx b/Modules/Applications/AppVectorUtils/app/otbConcatenateVectorData.cxx index 58028e860e75c291c68998ca2b72d202b6b48aae..7f5dbb5e89226220ed8845845752870992109943 100644 --- a/Modules/Applications/AppVectorUtils/app/otbConcatenateVectorData.cxx +++ b/Modules/Applications/AppVectorUtils/app/otbConcatenateVectorData.cxx @@ -75,7 +75,7 @@ private: SetParameterDescription("out", "Output conctenated vector data file."); // Doc example parameter settings - SetDocExampleParameterValue("vd", "ToulousePoints-examples.shp ToulouseRoad-examples.shp"); + SetDocExampleParameterValue("vd", "toulousepoints_examples.shp ToulouseRoad-examples.shp"); SetDocExampleParameterValue("out", "ConcatenatedVectorData.shp"); SetOfficialDocLink(); diff --git a/Modules/Applications/AppVectorUtils/test/CMakeLists.txt b/Modules/Applications/AppVectorUtils/test/CMakeLists.txt index 705a4a2eaa8b54e277954963b657d1ff9fd452a9..b7c6de1e1193cb1b7c743514f02b374a98475c48 100644 --- a/Modules/Applications/AppVectorUtils/test/CMakeLists.txt +++ b/Modules/Applications/AppVectorUtils/test/CMakeLists.txt @@ -58,7 +58,7 @@ otb_test_application(NAME apTvUtVectorDataExtractROI #----------- VectorDataSetField TESTS ---------------- otb_test_application(NAME apTvUtVectorDataSetField APP VectorDataSetField - OPTIONS -in ${INPUTDATA}/ToulousePoints-examples.shp + OPTIONS -in ${INPUTDATA}/toulousepoints_examples.shp -out ${TEMP}/apTvUtVectorDataSetFieldTest.shp -fn MyField -fv MyValue diff --git a/Modules/Core/Common/src/otbConfigure.h.in b/Modules/Core/Common/src/otbConfigure.h.in index 7d16d35d426a8dfc09d70e329f1d674cfc4e4f8f..ebe59a18bc7f2f8aea0ff8db617a8f1b2c509e08 100644 --- a/Modules/Core/Common/src/otbConfigure.h.in +++ b/Modules/Core/Common/src/otbConfigure.h.in @@ -25,8 +25,6 @@ #cmakedefine OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS -#cmakedefine OTB_BUILD_SHARED_LIBS - #cmakedefine OTB_USE_OPENMP #cmakedefine OTB_USE_SSE_FLAGS diff --git a/Modules/Core/ObjectList/include/otbImageList.h b/Modules/Core/ObjectList/include/otbImageList.h index 76fb9ae13cc31aa23ebbb3d1b6535cdf2413f2b5..c4dc2fc183053d6d0f15d9a1437794eae387905f 100644 --- a/Modules/Core/ObjectList/include/otbImageList.h +++ b/Modules/Core/ObjectList/include/otbImageList.h @@ -63,7 +63,7 @@ public: * Update images in the list. */ void UpdateOutputInformation(void) override; - void PropagateRequestedRegion(void) throw(itk::InvalidRequestedRegionError) override; + void PropagateRequestedRegion(void) override; void UpdateOutputData(void) override; void SetRequestedRegion(const itk::DataObject* source) override; diff --git a/Modules/Core/ObjectList/include/otbImageList.hxx b/Modules/Core/ObjectList/include/otbImageList.hxx index a1be5e5d71ef48a73d59ad29094496ec1f15c406..d802a6be56b94234671696bc075ebdd104d71f64 100644 --- a/Modules/Core/ObjectList/include/otbImageList.hxx +++ b/Modules/Core/ObjectList/include/otbImageList.hxx @@ -44,7 +44,7 @@ void ImageList<TImage>::UpdateOutputData() } template <class TImage> -void ImageList<TImage>::PropagateRequestedRegion() throw(itk::InvalidRequestedRegionError) +void ImageList<TImage>::PropagateRequestedRegion() { Superclass::PropagateRequestedRegion(); diff --git a/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.h b/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.h index 7f93aee3ccdc0d63eda7f9b1dac8b17950635f5f..88df161d616e2e6dc7145b5ba00e22be8628d27d 100644 --- a/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.h +++ b/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.h @@ -124,7 +124,7 @@ public: /** Get the numbero of drections for line detection. */ itkGetConstReferenceMacro(NumberOfDirections, unsigned int); - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; protected: LineDetectorImageFilterBase(); diff --git a/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.hxx b/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.hxx index 2ed743ae9fc017e23d1c111cf211c7a5af1639aa..c2154443b47b7e1aadfb223ca96da9eaccde85d1 100644 --- a/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.hxx +++ b/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.hxx @@ -57,8 +57,7 @@ LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, In } template <class TInputImage, class TOutputImage, class TOutputImageDirection, class InterpolatorType> -void LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, InterpolatorType>::GenerateInputRequestedRegion() throw( - itk::InvalidRequestedRegionError) +void LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, InterpolatorType>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.h b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.h index 7fd435caeb868e7f2dec0a5595bd786c59906341..d653fd002330e4040053a3ec012567252a101aec 100644 --- a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.h +++ b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.h @@ -98,7 +98,7 @@ public: void SetInputImageDirection(const InputImageType* image); const InputImageType* GetInputImageDirection(void); - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; protected: PixelSuppressionByDirectionImageFilter(); diff --git a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx index 73352bf7a2386f548872e39b26b147def4c6ded4..fbffa2340e0eecc2afdf85f80090c623a19895ba 100644 --- a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx @@ -84,7 +84,7 @@ PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::GetInputImage } template <class TInputImage, class TOutputImage> -void PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.h b/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.h index 41a0ceb511d9e170568a08ded8f2bcac0a29ba3e..0d9d7556e78d4db977ea2f7821a8a9e453f25651 100644 --- a/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.h +++ b/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.h @@ -95,7 +95,7 @@ public: * a treatment input area larger than the output one. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; protected: TouziEdgeDetectorImageFilter(); diff --git a/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx index cddeac29fb90dfaf0dc0737804547620093603ec..507f7d2f79e0a5d6f0e88eccd9b01899cfb99eaf 100644 --- a/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx @@ -45,7 +45,7 @@ TouziEdgeDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirection>:: } template <class TInputImage, class TOutputImage, class TOutputImageDirection> -void TouziEdgeDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirection>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void TouziEdgeDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirection>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.h b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.h index 1cf877af4d24443681a58d26aa85e61530428457..50915ccd27a3974363988276bd5e98de7b865395 100644 --- a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.h +++ b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.h @@ -173,7 +173,7 @@ protected: * in order to inform the pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; private: ConvolutionImageFilter(const Self&) = delete; diff --git a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx index 3f26d675062933a884fa42d1234bfeddc9c6f628..5e05f90342ccfd4db6b13282d590f45b22549b65 100644 --- a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx @@ -44,8 +44,7 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPre } template <class TInputImage, class TOutputImage, class TBoundaryCondition, class TFilterPrecision> -void ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision>::GenerateInputRequestedRegion() throw( - itk::InvalidRequestedRegionError) +void ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Filtering/Convolution/include/otbOverlapSaveConvolutionImageFilter.h b/Modules/Filtering/Convolution/include/otbOverlapSaveConvolutionImageFilter.h index ccb4f9070758a0fdcb5cced462d92e64abc50797..1c296b6bd6cd9f229928e3d0353e2544ff55322d 100644 --- a/Modules/Filtering/Convolution/include/otbOverlapSaveConvolutionImageFilter.h +++ b/Modules/Filtering/Convolution/include/otbOverlapSaveConvolutionImageFilter.h @@ -137,7 +137,7 @@ public: /** Since this filter implements a neighborhood operation, it requests a largest input * region than the output region. */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; #ifdef ITK_USE_CONCEPT_CHECKING /** Begin concept checking */ diff --git a/Modules/Filtering/Convolution/include/otbOverlapSaveConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/otbOverlapSaveConvolutionImageFilter.hxx index 510a1b023ca47414add04baecfe754814cf71422..fc7e6fcdc74f47189b32845dafe8194ac054f4ef 100644 --- a/Modules/Filtering/Convolution/include/otbOverlapSaveConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/otbOverlapSaveConvolutionImageFilter.hxx @@ -52,7 +52,7 @@ OverlapSaveConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition> } template <class TInputImage, class TOutputImage, class TBoundaryCondition> -void OverlapSaveConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void OverlapSaveConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>::GenerateInputRequestedRegion() { #if defined ITK_USE_FFTWD // call the superclass' implementation of this method diff --git a/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx index c04129a897806de43aa1ed5604eaf35aa678cda3..a95b9f07e130636eb1d51a4c6797e906fc7dee08 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx @@ -325,36 +325,30 @@ void PCAImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation>::Gene vnl_vector<double> vectValP; vnl_symmetric_eigensystem_compute(m_CovarianceMatrix.GetVnlMatrix(), 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]; 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 (m_Whitening) { - if (valP(i, i) > 0.) - { - if (m_Whitening) - valP(i, i) = 1. / std::sqrt(valP(i, i)); - } - else if (valP(i, i) < 0.) + InternalMatrixType valP(vectValP.size(), vectValP.size(), vnl_matrix_null); + for (unsigned int i = 0; i < vectValP.size(); ++i) + valP(i, i) = vectValP[i]; + + for (unsigned int i = 0; i < valP.rows(); ++i) { - otbMsgDebugMacro(<< "ValP(" << i << ") neg : " << valP(i, i) << " taking abs value"); - if (m_Whitening) - valP(i, i) = 1. / std::sqrt(std::abs(valP(i, i))); + if (valP(i,i) != 0.0) + valP(i,i) = 1.0 / std::sqrt(std::abs(valP(i,i))); else - valP(i, i) = std::abs(valP(i, i)); - } - else - { - throw itk::ExceptionObject(__FILE__, __LINE__, "Null Eigen value !!", ITK_LOCATION); + throw itk::ExceptionObject(__FILE__, __LINE__, "Null Eigen value !!", ITK_LOCATION); } + transf = valP * transf.transpose(); } - transf = valP * transf.transpose(); + else { + transf = transf.transpose(); + } + transf.flipud(); if (m_NumberOfPrincipalComponentsRequired != this->GetInput()->GetNumberOfComponentsPerPixel()) diff --git a/Modules/Filtering/DimensionalityReduction/test/CMakeLists.txt b/Modules/Filtering/DimensionalityReduction/test/CMakeLists.txt index 22ff085ec8d32d01cb7256ce1ef369341a47e088..3dc9d283e9e87695226caaf31e086b842e15aede 100644 --- a/Modules/Filtering/DimensionalityReduction/test/CMakeLists.txt +++ b/Modules/Filtering/DimensionalityReduction/test/CMakeLists.txt @@ -301,7 +301,8 @@ otb_add_test(NAME bfTvPCAImageFilter2 COMMAND otbDimensionalityReductionTestDriv ${TEMP}/bfTvPCAImageFilter2.tif ${TEMP}/bfTvPCAImageFilter2Inv.tif true - 0) + 0 + true) otb_add_test(NAME bfTvPCAImageFilter4 COMMAND otbDimensionalityReductionTestDriver --compare-n-images ${EPSILON_7} 2 @@ -314,7 +315,8 @@ otb_add_test(NAME bfTvPCAImageFilter4 COMMAND otbDimensionalityReductionTestDriv ${TEMP}/bfTvPCAImageFilter4.tif ${TEMP}/bfTvPCAImageFilter4Inv.tif false - 4) + 4 + true) otb_add_test(NAME bfTvPCAImageFilter4Norm COMMAND otbDimensionalityReductionTestDriver --compare-n-images ${EPSILON_7} 2 @@ -327,7 +329,8 @@ otb_add_test(NAME bfTvPCAImageFilter4Norm COMMAND otbDimensionalityReductionTest ${TEMP}/bfTvPCAImageFilter4Norm.tif ${TEMP}/bfTvPCAImageFilter4InvNorm.tif true - 4) + 4 + true) otb_add_test(NAME bfTvPCAImageFilter3 COMMAND otbDimensionalityReductionTestDriver --compare-n-images ${EPSILON_7} 2 @@ -340,7 +343,22 @@ otb_add_test(NAME bfTvPCAImageFilter3 COMMAND otbDimensionalityReductionTestDriv ${TEMP}/bfTvPCAImageFilter3.tif ${TEMP}/bfTvPCAImageFilter3Inv.tif false - 0) + 0 + true) + +otb_add_test(NAME bfTvPCAImageFilter5 COMMAND otbDimensionalityReductionTestDriver + --compare-n-images ${EPSILON_7} 2 + ${BASELINE}/bfTvPCAImageFilter5.tif + ${TEMP}/bfTvPCAImageFilter5.tif + ${BASELINE}/bfTvPCAImageFilter5Inv.tif + ${TEMP}/bfTvPCAImageFilter5Inv.tif + otbPCAImageFilterTest + ${INPUTDATA}/cupriteSubHsi.tif + ${TEMP}/bfTvPCAImageFilter5.tif + ${TEMP}/bfTvPCAImageFilter5Inv.tif + false + 0 + false) otb_add_test(NAME bfTvPCAImageFilter1 COMMAND otbDimensionalityReductionTestDriver --compare-image ${EPSILON_7} @@ -351,7 +369,8 @@ otb_add_test(NAME bfTvPCAImageFilter1 COMMAND otbDimensionalityReductionTestDriv ${TEMP}/bfTvPCAImageFilter1.tif ${TEMP}/bfTvPCAImageFilter1Inv.tif false - 0) + 0 + true) otb_add_test(NAME bfTvPCAImageFilter3Norm COMMAND otbDimensionalityReductionTestDriver @@ -365,7 +384,8 @@ otb_add_test(NAME bfTvPCAImageFilter3Norm COMMAND otbDimensionalityReductionTest ${TEMP}/bfTvPCAImageFilter3Norm.tif ${TEMP}/bfTvPCAImageFilter3InvNorm.tif true - 0) + 0 + true) otb_add_test(NAME bfTvNAPCAImageFilter1 COMMAND otbDimensionalityReductionTestDriver --compare-image ${EPSILON_7} diff --git a/Modules/Filtering/DimensionalityReduction/test/otbPCAImageFilter.cxx b/Modules/Filtering/DimensionalityReduction/test/otbPCAImageFilter.cxx index bf3e94978a05e63ba842419aebe37a7ff5105cc3..4adf85db9a96b6c7c53d6905b6680889f7a03e2a 100644 --- a/Modules/Filtering/DimensionalityReduction/test/otbPCAImageFilter.cxx +++ b/Modules/Filtering/DimensionalityReduction/test/otbPCAImageFilter.cxx @@ -33,6 +33,10 @@ int otbPCAImageFilterTest(int, char* argv[]) bool normalization = false; if (std::string(argv[4]).compare("true") == 0) normalization = true; + + bool whitening = false; + if (std::string(argv[6]).compare("true") == 0) + whitening = true; // Main type definition const unsigned int Dimension = 2; @@ -50,6 +54,7 @@ int otbPCAImageFilterTest(int, char* argv[]) filter->SetInput(reader->GetOutput()); filter->SetNumberOfPrincipalComponentsRequired(nbComponents); filter->SetUseNormalization(normalization); + filter->SetWhitening(whitening); typedef otb::CommandProgressUpdate<FilterType> CommandType; CommandType::Pointer observer = CommandType::New(); diff --git a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.h b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.h index 6a8425a70facf8a9e52d1234fa19b5a0583b3847..cd9c9610885465526b6d394aa0120c4a99a0f6f8 100644 --- a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.h +++ b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.h @@ -94,7 +94,7 @@ public: /** To be allowed to use the pipeline method FrostImageFilter needs * an input processing area larger than the output one. * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; protected: FrostImageFilter(); diff --git a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx index ce6653f93c1d0eca3cef75d8e71cd3971d1767a2..5ad7df02f4dc7532e5a6c43ddbd1c9d5cf33d3a5 100644 --- a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx @@ -45,7 +45,7 @@ FrostImageFilter<TInputImage, TOutputImage>::FrostImageFilter() } template <class TInputImage, class TOutputImage> -void FrostImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void FrostImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.h b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.h index bb22f664a28745098b0d64672e8354430d77ac22..33bf241307a32387f65ebdda171ca191446bb860 100644 --- a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.h +++ b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.h @@ -86,7 +86,7 @@ public: * in order to inform the pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; protected: GammaMAPImageFilter(); diff --git a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx index af4543e9d5f2482256e8c9b011c203605602c02a..296091308dadeb7cda7919a65afe1f36148f9654 100644 --- a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx @@ -45,7 +45,7 @@ GammaMAPImageFilter<TInputImage, TOutputImage>::GammaMAPImageFilter() } template <class TInputImage, class TOutputImage> -void GammaMAPImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void GammaMAPImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.h b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.h index 645fb2d18d62077a7f21ff5e53b3415476bb39ed..6b4d01606e9314c08680702605014df62dd727ec 100644 --- a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.h +++ b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.h @@ -86,7 +86,7 @@ public: * in order to inform the pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; protected: KuanImageFilter(); diff --git a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx index ce000767d8b282465a5a2bb7ee135de282b4d63f..6c0aff7b01b4ac910b458c4460aab6eeb70f36f4 100644 --- a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx @@ -45,7 +45,7 @@ KuanImageFilter<TInputImage, TOutputImage>::KuanImageFilter() } template <class TInputImage, class TOutputImage> -void KuanImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void KuanImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.h b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.h index 3653b319b22eb4806cdcbf3861cbaa2c7c51481a..79e40f703efa3d50608eca5143cb817a62536b20 100644 --- a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.h +++ b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.h @@ -93,7 +93,7 @@ public: * in order to inform the pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; protected: LeeImageFilter(); diff --git a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx index 120e4ac007d0325f5c151ee6f603177375dec9c9..7be65acce76ab08626d173456625747985a7abce 100644 --- a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx @@ -45,7 +45,7 @@ LeeImageFilter<TInputImage, TOutputImage>::LeeImageFilter() } template <class TInputImage, class TOutputImage> -void LeeImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void LeeImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Filtering/MathParserX/src/otbParserXPlugins.cxx b/Modules/Filtering/MathParserX/src/otbParserXPlugins.cxx index 3cda0a53deba68483122302f31df74e8a199b79e..9784759177908412d6b611b7f5ae8ee84252ad23 100644 --- a/Modules/Filtering/MathParserX/src/otbParserXPlugins.cxx +++ b/Modules/Filtering/MathParserX/src/otbParserXPlugins.cxx @@ -18,10 +18,12 @@ * limitations under the License. */ +#include "itkMacro.h" #include "otbParserXPlugins.h" #include "otbMath.h" #include "itkNumericTraits.h" +#include <itkExceptionObject.h> #include <vector> @@ -42,15 +44,25 @@ void bands::Eval(mup::ptr_val_type& ret, const mup::ptr_val_type* a_pArg, int a_ mup::matrix_type a = a_pArg[0]->GetArray(); mup::matrix_type b = a_pArg[1]->GetArray(); - int nbcols = b.GetCols(); + int a_cols = a.GetCols(); + int b_cols = b.GetCols(); assert(a.GetRows() == 1); // Bands selection is done on a row vector assert(b.GetRows() == 1); // Bands selection is done by a row vector - mup::matrix_type res(1, nbcols, 0.); + mup::matrix_type res(1, b_cols, 0.); - for (int k = 0; k < nbcols; ++k) - res.At(0, k) = a.At(0, b.At(0, k).GetInteger() - 1); //-1 : to make first band have rank #1 (and not 0) + for (int k = 0; k < b_cols; ++k) { + int col = b.At(0, k).GetInteger() - 1; //-1 : to make first band have rank #1 (and not 0) + if (col >= a_cols || col < 0) { + itkSpecializedMessageExceptionMacro(RangeError, + << std::endl + << "Invalid band index " << col+1 + << ". Index must be between 1 and " << a_cols + << "." << std::endl); + } + res.At(0, k) = a.At(0, col); + } // The return value is passed by writing it to the reference ret *ret = res; diff --git a/Modules/Filtering/MathParserX/test/CMakeLists.txt b/Modules/Filtering/MathParserX/test/CMakeLists.txt index 7eebe4e1078a2d3880d562fc836825b765c4ffc3..b04f764adcdba0ccca775d05d6824e80ac3b2b10 100644 --- a/Modules/Filtering/MathParserX/test/CMakeLists.txt +++ b/Modules/Filtering/MathParserX/test/CMakeLists.txt @@ -38,6 +38,8 @@ otb_add_test(NAME bfTvBandMathXImageFilterConv COMMAND otbMathParserXTestDriver ) otb_add_test(NAME bfTvBandMathXImageFilter COMMAND otbMathParserXTestDriver otbBandMathXImageFilter) +otb_add_test(NAME bfTvBandMathXImageFilterBandsFailures COMMAND otbMathParserXTestDriver + otbBandMathXImageFilterBandsFailures) otb_add_test(NAME bfTvBandMathXImageFilterWithIdx COMMAND otbMathParserXTestDriver otbBandMathXImageFilterWithIdx ${TEMP}/bfTvBandMathImageFilterWithIdx1.tif diff --git a/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx b/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx index defb1b0d79630e613293a28719f5ed7bf0db14d0..2c076a902dd5689d22429ae95cf00fda5e399426 100644 --- a/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx +++ b/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx @@ -102,7 +102,6 @@ int otbBandMathXImageFilter(int itkNotUsed(argc), char* itkNotUsed(argv)[]) FilterType::Pointer filter = FilterType::New(); std::cout << "Number Of Threads : " << filter->GetNumberOfThreads() << std::endl; - filter->SetNthInput(0, image1); filter->SetNthInput(1, image2); filter->SetNthInput(2, image3, "canal3"); @@ -147,9 +146,9 @@ int otbBandMathXImageFilter(int itkNotUsed(argc), char* itkNotUsed(argv)[]) << " Result = " << itoutput1.Get()[0] << " Expected = " << expected1 << std::endl; */ - error1 = (result1 - expected1) * (result1 - expected1) / (result1 + expected1); - error2 = (result2 - expected2) * (result2 - expected2) / (result2 + expected2); - error3 = (result3 - expected3) * (result3 - expected3) / (result3 + expected3); + error1 = (result1 - expected1) * (result1 - expected1) / abs(result1 + expected1); + error2 = (result2 - expected2) * (result2 - expected2) / abs(result2 + expected2); + error3 = (result3 - expected3) * (result3 - expected3) / abs(result3 + expected3); if ((error1 > 1E-9) || (error2 > 1E-9) || (error3 > 1E-9)) { @@ -545,3 +544,52 @@ int otbBandMathXImageFilterWithIdx(int itkNotUsed(argc), char* argv[]) return EXIT_SUCCESS; } + +int otbBandMathXImageFilterBandsFailures(int itkNotUsed(argc), char* itkNotUsed(argv)[]) +{ + + typedef otb::VectorImage<double, 2> ImageType; + typedef otb::BandMathXImageFilter<ImageType> FilterType; + + const unsigned int N = 100, D1 = 3; + + ImageType::SizeType size; + size.Fill(N); + ImageType::IndexType index; + index.Fill(0); + ImageType::RegionType region; + region.SetSize(size); + region.SetIndex(index); + + ImageType::Pointer image = ImageType::New(); + + image->SetLargestPossibleRegion(region); + image->SetBufferedRegion(region); + image->SetRequestedRegion(region); + image->SetNumberOfComponentsPerPixel(D1); + image->Allocate(); + + FilterType::Pointer filter = FilterType::New(); + + filter->SetNthInput(0, image); + + std::vector<std::string> exps = { "bands(im1,{4,1})", "bands(im1,{1,-1})", + "bands(im1,{1,2,3,1,2,3,0})" }; + for ( std::string exp: exps ) { + filter->SetExpression(exp); + try { + filter->Update(); + throw ; + } + catch (::itk::RangeError& e) + { + std::cout << "INFO: Exception thrown as expected : " << e.what() << std::endl; + filter->ClearExpression(); + } + catch (...) { + itkGenericExceptionMacro(<< "TEST FAILLED: " << exp + << "should have raise a RangeError exception" << std::endl); + } + } + return EXIT_SUCCESS; +} diff --git a/Modules/Filtering/MathParserX/test/otbMathParserXTestDriver.cxx b/Modules/Filtering/MathParserX/test/otbMathParserXTestDriver.cxx index 9081716f261736257e29445946d67aace05f3fa2..0158d22efdf7526cd11c87aad9eecb1015caed78 100644 --- a/Modules/Filtering/MathParserX/test/otbMathParserXTestDriver.cxx +++ b/Modules/Filtering/MathParserX/test/otbMathParserXTestDriver.cxx @@ -27,4 +27,5 @@ void RegisterTests() REGISTER_TEST(otbBandMathXImageFilterConv); REGISTER_TEST(otbBandMathXImageFilterTxt); REGISTER_TEST(otbBandMathXImageFilterWithIdx); + REGISTER_TEST(otbBandMathXImageFilterBandsFailures); } diff --git a/Modules/Filtering/Projection/test/CMakeLists.txt b/Modules/Filtering/Projection/test/CMakeLists.txt index b2e82e3676835ab5d7883aee53e014939ae41d3e..4acafdfb449098acc500f462dc4a3b77c7a3d3ca 100644 --- a/Modules/Filtering/Projection/test/CMakeLists.txt +++ b/Modules/Filtering/Projection/test/CMakeLists.txt @@ -361,7 +361,7 @@ otb_add_test(NAME prTvGeometriesProjectionFilterPoints COMMAND otbProjectionTest ${BASELINE_FILES}/prTvVectorDataProjectionFilterPoints.shp ${TEMP}/prTvGeometriesProjectionFilterPoints.shp otbGeometriesProjectionFilter - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${TEMP}/prTvGeometriesProjectionFilterPoints.shp ) @@ -409,7 +409,7 @@ otb_add_test(NAME prTvVectorDataProjectionFilterFromMapToSensor COMMAND otbProje ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToSensor.shp ${TEMP}/prTvVectorDataProjectionFilterFromMapToSensor.shp otbVectorDataProjectionFilterFromMapToSensor - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${INPUTDATA}/QB_PAN_ROI_1000_100.tif ${TEMP}/prTvVectorDataProjectionFilterFromMapToSensor.shp ) @@ -431,7 +431,7 @@ otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToSensor COMMAND otbProje ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToSensor.shp ${TEMP}/prTvGeometriesProjectionFilterFromMapToSensor.shp otbGeometriesProjectionFilterFromMapToSensor - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${INPUTDATA}/QB_PAN_ROI_1000_100.tif ${TEMP}/prTvGeometriesProjectionFilterFromMapToSensor.shp ) @@ -459,7 +459,7 @@ otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToGeo COMMAND otbProjecti ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToGeo.shp ${TEMP}/prTvGeometriesProjectionFilterFromMapToGeo.shp otbGeometriesProjectionFilterFromMapToGeo - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${TEMP}/prTvGeometriesProjectionFilterFromMapToGeo.shp ) @@ -478,7 +478,7 @@ otb_add_test(NAME prTvVectorDataProjectionFilterFromMapToGeo COMMAND otbProjecti ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToGeo.shp ${TEMP}/prTvVectorDataProjectionFilterFromMapToGeo.shp otbVectorDataProjectionFilterFromMapToGeo - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${TEMP}/prTvVectorDataProjectionFilterFromMapToGeo.shp ) @@ -501,7 +501,7 @@ otb_add_test(NAME prTvVectorDataProjectionFilterFromMapToImage COMMAND otbProjec ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToImage.shp ${TEMP}/prTvVectorDataProjectionFilterFromMapToImage.shp otbVectorDataProjectionFilterFromMapToImage - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif ${TEMP}/prTvVectorDataProjectionFilterFromMapToImage.shp ) @@ -1073,7 +1073,7 @@ otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToImage COMMAND otbProjec ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToImage.shp ${TEMP}/prTvGeometriesProjectionFilterFromMapToImage.shp otbGeometriesProjectionFilterFromMapToImage - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif ${TEMP}/prTvGeometriesProjectionFilterFromMapToImage.shp ) @@ -1092,7 +1092,7 @@ otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToEPSG_WGS84 COMMAND otbP ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToGeo.shp ${TEMP}/prTvGeometriesProjectionFilterFromMapToEPSG_WGS84.shp otbGeometriesProjectionFilterFromMapToEPSG - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${TEMP}/prTvGeometriesProjectionFilterFromMapToEPSG_WGS84.shp 4326 ) @@ -1101,7 +1101,7 @@ otb_add_test(NAME prTvVectorDataProjectionFilterPoints COMMAND otbProjectionTest ${BASELINE_FILES}/prTvVectorDataProjectionFilterPoints.shp ${TEMP}/prTvVectorDataProjectionFilterPoints.shp otbVectorDataProjectionFilter - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${TEMP}/prTvVectorDataProjectionFilterPoints.shp ) diff --git a/Modules/Filtering/Smoothing/test/CMakeLists.txt b/Modules/Filtering/Smoothing/test/CMakeLists.txt index 1272ed6c4d72d15cc0e973b196d89bce31db03e1..be197b645b333a62ce1a5c63998400b29d15a25b 100644 --- a/Modules/Filtering/Smoothing/test/CMakeLists.txt +++ b/Modules/Filtering/Smoothing/test/CMakeLists.txt @@ -33,11 +33,6 @@ otb_module_target_label(otbSmoothingTestDriver) # Tests Declaration - - - - - otb_add_test(NAME bfTvMeanShiftSmoothingImageFilterOptim COMMAND otbSmoothingTestDriver --compare-image ${EPSILON_7} ${BASELINE}/bfTvMeanShiftFilterSpectralOutputOptim.tif @@ -51,6 +46,10 @@ otb_add_test(NAME bfTvMeanShiftSmoothingImageFilterOptim COMMAND otbSmoothingTes 2 10 0.1 10 1 ) +set_tests_properties(bfTvMeanShiftSmoothingImageFilterOptim PROPERTIES + ENVIRONMENT ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=4) + + otb_add_test(NAME bfTuMeanShiftSmoothingImageFilterSPOT5 COMMAND otbSmoothingTestDriver otbMeanShiftSmoothingImageFilter ${INPUTDATA}/SPOT5_EXTRACTS/Arcachon/Arcachon_extrait_3852_3319_546_542.tif diff --git a/Modules/Filtering/Statistics/include/otbVarianceImageFilter.h b/Modules/Filtering/Statistics/include/otbVarianceImageFilter.h index 49cee556ece4d5fc5294b98c50b66eb84893e125..e5e4243bac4c6f1a1a5ca5d986748219e720efde 100644 --- a/Modules/Filtering/Statistics/include/otbVarianceImageFilter.h +++ b/Modules/Filtering/Statistics/include/otbVarianceImageFilter.h @@ -89,7 +89,7 @@ public: * in order to inform the pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; #ifdef ITK_USE_CONCEPT_CHECKING /** Begin concept checking */ diff --git a/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx b/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx index baed8f0c61afd94546db7e8de461e5b5bfa198f2..fca4500f8bb98dc11af082a6de8b21740855f1f4 100644 --- a/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx @@ -40,7 +40,7 @@ VarianceImageFilter<TInputImage, TOutputImage>::VarianceImageFilter() } template <class TInputImage, class TOutputImage> -void VarianceImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void VarianceImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Filtering/VectorDataManipulation/test/CMakeLists.txt b/Modules/Filtering/VectorDataManipulation/test/CMakeLists.txt index a4f17c2c5abfea6b32e5f7bc1bdd3270b66e4334..3bd5f40e95ea82c4440f495d1a4a67e43ea141c4 100644 --- a/Modules/Filtering/VectorDataManipulation/test/CMakeLists.txt +++ b/Modules/Filtering/VectorDataManipulation/test/CMakeLists.txt @@ -39,7 +39,7 @@ otb_add_test(NAME coTvVectorDataExtractROI COMMAND otbVectorDataManipulationTest ${BASELINE_FILES}/coVectorDataExtractROIOutput.shp ${TEMP}/coVectorDataExtractROIOutput.shp otbVectorDataExtractROI - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${TEMP}/coVectorDataExtractROIOutput.shp 374369.48850211215904 4853951.786124914 # Origin of the RemoteSensingRegion 1000.25 -25000.2 # Size of the Cartoregion @@ -50,7 +50,7 @@ otb_add_test(NAME coTvVectorDataExtractROI2 COMMAND otbVectorDataManipulationTes ${BASELINE_FILES}/coVectorDataExtractROIOutput2.shp ${TEMP}/coVectorDataExtractROIOutput2.shp otbVectorDataExtractROI - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${TEMP}/coVectorDataExtractROIOutput2.shp 374369.48850211215904 4828951.58612491376698 # Origin of the RemoteSensingRegion 1000.25 25000.2 # Size of the Cartoregion diff --git a/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.h b/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.h index 756a0016a3b4f77b79ecc9094da567e679ee9776..77e7005e6411b4f27e4ed3c1b0445c4cd7b2deaf 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.h +++ b/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.h @@ -230,7 +230,7 @@ protected: * pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; /** BeforeThreadedGenerateData. * It allocates also internal images @@ -412,7 +412,7 @@ protected: * pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; /** BeforeThreadedGenerateData * If SubsampleImageFactor neq 1, it is necessary to up sample input images in the Wavelet::INVERSE mode diff --git a/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx b/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx index 4c74abb8040b8b7e4674228d5d634c876d8015d8..f762fd2402f8d43c6c98f644052baff244eeefec 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx +++ b/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx @@ -78,7 +78,7 @@ void WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FOR } template <class TInputImage, class TOutputImage, class TWaveletOperator> -void WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD>::GenerateInputRequestedRegion() { Superclass::GenerateInputRequestedRegion(); @@ -616,7 +616,7 @@ void WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INV } template <class TInputImage, class TOutputImage, class TWaveletOperator> -void WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE>::GenerateInputRequestedRegion() { Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.h b/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.h index bf505a9e69288d33e357b2ebf688449268d0a9e8..f707d864d2f372a5f2c67a008c1d2366d126e4d0 100644 --- a/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.h +++ b/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.h @@ -309,7 +309,7 @@ protected: /** Connect the pipeline and propagate the required parameters. This * is automatically called in GenerateData(). */ - void Initialize() throw(itk::ExceptionObject); + void Initialize(); virtual void ApplyMarkovRandomFieldFilter(); diff --git a/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.hxx b/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.hxx index d12ae9f6d3b713135092ea300d613b1d1eba0304..24d1de9d36cff94b90759d26daabcc9fe5ddb6f8 100644 --- a/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.hxx +++ b/Modules/Learning/Markov/include/otbMarkovRandomFieldFilter.hxx @@ -253,7 +253,7 @@ void MarkovRandomFieldFilter<TInputImage, TClassifiedImage>::Allocate() * Initialize pipeline and values */ template <class TInputImage, class TClassifiedImage> -void MarkovRandomFieldFilter<TInputImage, TClassifiedImage>::Initialize() throw(itk::ExceptionObject) +void MarkovRandomFieldFilter<TInputImage, TClassifiedImage>::Initialize() { m_ImageDeltaEnergy = 0.0; diff --git a/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.h b/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.h index e7e406e884ec71fb152b27427a58f8ff66b615c8..665befb3301249a195cc6c2ebed8f1ec507ba631 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.h +++ b/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.h @@ -157,7 +157,7 @@ protected: * in order to inform the pipeline execution model. * * \sa ImageToImageFilter::GenerateInputRequestedRegion() */ - void GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) override; + void GenerateInputRequestedRegion() override; /** Generate output information */ void GenerateOutputInformation(void) override; diff --git a/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.hxx b/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.hxx index 90ce6ac686288e92b4bcc6f73c8c1a1fde7c98f1..9c86d3c5a72a728f950c2be92f8e533429cc5140 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbDisparityMapMedianFilter.hxx @@ -123,7 +123,7 @@ void DisparityMapMedianFilter<TInputImage, TOutputImage, TMask>::GenerateOutputI template <class TInputImage, class TOutputImage, class TMask> -void DisparityMapMedianFilter<TInputImage, TOutputImage, TMask>::GenerateInputRequestedRegion() throw(itk::InvalidRequestedRegionError) +void DisparityMapMedianFilter<TInputImage, TOutputImage, TMask>::GenerateInputRequestedRegion() { // call the superclass' implementation of this method Superclass::GenerateInputRequestedRegion(); diff --git a/Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.hxx b/Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.hxx index e78e71331981647b8fe8d35bce50d36997de44ed..8bcf87e402f2a468603a0f143d797f18e624445f 100644 --- a/Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.hxx +++ b/Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.hxx @@ -245,7 +245,7 @@ void OGRLayerStreamStitchingFilter<TInputImage>::ProcessStreamingLine(bool line, { FeatureStruct upper = upperStreamFeatureList[u]; FeatureStruct lower = lowerStreamFeatureList[l]; - if (!(upper.feat == lower.feat)) + if (!(upper.feat == lower.feat) && upper.feat.GetGeometry()->IsValid() && lower.feat.GetGeometry()->IsValid()) { if (ogr::Intersects(*upper.feat.GetGeometry(), *lower.feat.GetGeometry())) { diff --git a/Modules/ThirdParty/OpenCV/CMakeLists.txt b/Modules/ThirdParty/OpenCV/CMakeLists.txt index 423cafe4715af2fb2038630793b130ed1079069d..514f0f45b4145f3f8a76fd30538a60e4c4507f5c 100644 --- a/Modules/ThirdParty/OpenCV/CMakeLists.txt +++ b/Modules/ThirdParty/OpenCV/CMakeLists.txt @@ -29,3 +29,8 @@ set(OTBOpenCV_INCLUDE_DIRS ) otb_module_impl() + +install(FILES ${OTBOpenCV_BINARY_DIR}/src/otb_opencv_api.h + DESTINATION ${OTBOpenCV_INSTALL_INCLUDE_DIR} + COMPONENT Development + ) diff --git a/Modules/ThirdParty/OssimPlugins/test/ossimSentinel1ModelTest.cpp b/Modules/ThirdParty/OssimPlugins/test/ossimSentinel1ModelTest.cpp index 644a144944f9c47abcf255d5455767292dd46359..d798c95007d1b481fdf5b2269b07aee1c5795f57 100644 --- a/Modules/ThirdParty/OssimPlugins/test/ossimSentinel1ModelTest.cpp +++ b/Modules/ThirdParty/OssimPlugins/test/ossimSentinel1ModelTest.cpp @@ -48,7 +48,7 @@ int main(int argc, char * argv[]) { std::clog.precision(20); - string annotationXml; + std::string annotationXml; Inverse inverse = undef; bool verbose = false; diff --git a/Modules/ThirdParty/SiftFast/src/otbsiftfast/siftfastpy.cpp b/Modules/ThirdParty/SiftFast/src/otbsiftfast/siftfastpy.cpp index 6b9ba20ac3198210fcf98e4b721ccd792b4c39f1..eef47b5337f9a0d73022bfa14e35a3663f94269e 100644 --- a/Modules/ThirdParty/SiftFast/src/otbsiftfast/siftfastpy.cpp +++ b/Modules/ThirdParty/SiftFast/src/otbsiftfast/siftfastpy.cpp @@ -44,8 +44,8 @@ struct siftfast_exception : std::exception { siftfast_exception() : std::exception(), _s("unknown exception") {} siftfast_exception(const string& s) : std::exception() { _s = "siftfast: " + s; } - virtual ~siftfast_exception() throw() {} - char const* what() const throw() { return _s.c_str(); } + virtual ~siftfast_exception() noexcept {} + char const* what() noexcept const { return _s.c_str(); } string _s; }; diff --git a/Modules/ThirdParty/TinyXML/CMakeLists.txt b/Modules/ThirdParty/TinyXML/CMakeLists.txt index b0a6e67ad12930ebb7ee3b41d94b971be8f0a7ea..3a85fe9c40784fc8773ca8fad1d4360d434f5b86 100644 --- a/Modules/ThirdParty/TinyXML/CMakeLists.txt +++ b/Modules/ThirdParty/TinyXML/CMakeLists.txt @@ -21,13 +21,17 @@ project(OTBTinyXML) # Check if we need to define TIXML_USE_STL -try_compile( TIXML_USE_STL +try_compile( TIXML_TEST_STL ${CMAKE_CURRENT_BINARY_DIR}/CMake ${CMAKE_CURRENT_SOURCE_DIR}/CMake/otbTestTinyXMLUseSTL.cxx CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TINYXML_INCLUDE_DIRS}" "-DLINK_LIBRARIES:STRING=${TINYXML_LIBRARIES}" COMPILE_DEFINITIONS "-DTIXML_USE_STL" OUTPUT_VARIABLE OUTPUT) +if (NOT TIXML_TEST_STL) + message(FATAL_ERROR "TIXML must be compiled with TIXML_USE_STL=ON.") +endif() + configure_file( src/otb_tinyxml.h.in src/otb_tinyxml.h ) set(OTBTinyXML_SYSTEM_INCLUDE_DIRS diff --git a/Modules/ThirdParty/TinyXML/src/otb_tinyxml.h.in b/Modules/ThirdParty/TinyXML/src/otb_tinyxml.h.in index 223e3690878b7befeec6aa91436fe267e3a30e9a..4fdb682e974920c42372d0d3887ae6a4dd74370b 100644 --- a/Modules/ThirdParty/TinyXML/src/otb_tinyxml.h.in +++ b/Modules/ThirdParty/TinyXML/src/otb_tinyxml.h.in @@ -21,9 +21,7 @@ #ifndef otb_tinyxml_h #define otb_tinyxml_h -#ifndef TIXML_USE_STL -#cmakedefine TIXML_USE_STL -#endif +#define TIXML_USE_STL #include "tinyxml.h" diff --git a/Modules/Visualization/MonteverdiCore/include/mvdAbstractWorker.h b/Modules/Visualization/MonteverdiCore/include/mvdAbstractWorker.h index fedaa3d65a8d869b4432b0acf85c6705ca20e267..873be0f3420d7857cbb68a3f6bc2f1b4cacf68da 100644 --- a/Modules/Visualization/MonteverdiCore/include/mvdAbstractWorker.h +++ b/Modules/Visualization/MonteverdiCore/include/mvdAbstractWorker.h @@ -102,7 +102,7 @@ public slots: /** * \brief Call the implemented do job/task routine. */ - void Do() throw(); + void Do() noexcept; /*-[ SIGNALS SECTION ]-----------------------------------------------------*/ diff --git a/Modules/Visualization/MonteverdiCore/include/mvdSystemError.h b/Modules/Visualization/MonteverdiCore/include/mvdSystemError.h index 6e4095bfd525c87005f0e1a3700af2191b9b98c8..84caa5a3a273c6547bb3e08278be2f1e049c1121 100644 --- a/Modules/Visualization/MonteverdiCore/include/mvdSystemError.h +++ b/Modules/Visualization/MonteverdiCore/include/mvdSystemError.h @@ -86,7 +86,7 @@ public: SystemError(const std::string& message = std::string()) : std::runtime_error(itksys::SystemTools::GetLastSystemError() + ": " + message){}; /** \brief Destructor. */ - ~SystemError() throw() override{}; + ~SystemError() noexcept override{}; /*-[ PROTECTED SECTION ]---------------------------------------------------*/ diff --git a/Modules/Visualization/MonteverdiCore/src/mvdAbstractWorker.cxx b/Modules/Visualization/MonteverdiCore/src/mvdAbstractWorker.cxx index f618704daacd0665ea7c97e6438b27ef5b2c9beb..518b1f6166746248d740987c4362c62af7c9b0c6 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdAbstractWorker.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdAbstractWorker.cxx @@ -77,7 +77,7 @@ AbstractWorker::~AbstractWorker() } /*****************************************************************************/ -void AbstractWorker::Do() throw() +void AbstractWorker::Do() noexcept { QObject* result = NULL; diff --git a/Modules/Wrappers/ApplicationEngine/test/CMakeLists.txt b/Modules/Wrappers/ApplicationEngine/test/CMakeLists.txt index b1e64b6b77c8e41a3b33f4f64ece9fc2bd50b8ce..070eed0d442c9345576c3ca30e526339c3ad4256 100644 --- a/Modules/Wrappers/ApplicationEngine/test/CMakeLists.txt +++ b/Modules/Wrappers/ApplicationEngine/test/CMakeLists.txt @@ -98,7 +98,7 @@ otb_add_test(NAME owTvInputImageListParameter COMMAND otbApplicationEngineTestDr otb_add_test(NAME owTvInputVectorDataListParameter COMMAND otbApplicationEngineTestDriver otbWrapperInputVectorDataListParameterTest1 - ${INPUTDATA}/ToulousePoints-examples.shp + ${INPUTDATA}/toulousepoints_examples.shp ${INPUTDATA}/ToulouseRoads-examples.shp "mykey" "my description" diff --git a/SuperBuild/patches/ITK/itk-3-gcc9-all.diff b/SuperBuild/patches/ITK/itk-3-gcc9-all.diff new file mode 100644 index 0000000000000000000000000000000000000000..100fac60e22f388dc84d478dc5a145031b2f27b9 --- /dev/null +++ b/SuperBuild/patches/ITK/itk-3-gcc9-all.diff @@ -0,0 +1,26 @@ +diff --git a/SuperBuild/patches/ITK/itk-3-gcc9-all.diff b/SuperBuild/patches/ITK/itk-3-gcc9-all.diff +new file mode 100644 +index 0000000000..7ff9131d9d +--- /dev/null ++++ b/SuperBuild/patches/ITK/itk-3-gcc9-all.diff +@@ -0,0 +1,20 @@ ++--- InsightToolkit-4.13.1.orig/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h 2018-08-09 00:55:23.000000000 +0200 +++++ InsightToolkit-4.13.1/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h 2019-11-12 15:49:33.893603688 +0100 ++@@ -97,6 +97,17 @@ ++ # else ++ # define VCL_GCC_80 ++ # endif +++# elif (__GNUC__==9) +++# define VCL_GCC_9 +++# if (__GNUC_MINOR__ > 2 ) +++# define VCL_GCC_92 +++# elif (__GNUC_MINOR__ > 1 ) +++# define VCL_GCC_92 +++# elif (__GNUC_MINOR__ > 0 ) +++# define VCL_GCC_91 +++# else +++# define VCL_GCC_90 +++# endif ++ # else ++ # error "Dunno about this gcc" ++ # endif diff --git a/sonar-project.properties b/sonar-project.properties index 295fbc9b31bcc708be0fed7a3d586332ab1a9631..d851e488bbbf420304d10ec0c8c8629cdadf93c3 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,3 @@ -sonar.projectKey=orfeotoolbox-otb sonar.projectName=Orfeo Toolbox sonar.projectDescription="Orfeo ToolBox is an open-source project for state-of-the-art remote sensing" sonar.links.homepage="https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb"