Commit 0c18bc65 authored by Victor Poughon's avatar Victor Poughon

Merge branch 'develop' into remove_stale_examples

parents cbc09f48 bca41753
Pipeline #257 passed with stage
in 30 minutes and 30 seconds
......@@ -258,7 +258,6 @@ macro(otb_module_impl)
set(BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB/Files)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
set(TEMP ${CMAKE_BINARY_DIR}/Testing/Temporary)
set(EXAMPLEDATA ${OTB_DATA_ROOT}/Examples)
set(OTBAPP_BASELINE ${OTB_DATA_ROOT}/Baseline/OTB-Applications/Images)
set(OTBAPP_BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB-Applications/Files)
......
......@@ -302,7 +302,6 @@ set(BASELINE ${OTB_DATA_ROOT}/Baseline/OTB/Images)
set(BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB/Files)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
set(TEMP ${OTB_BINARY_DIR}/Testing/Temporary)
set(EXAMPLEDATA ${OTB_DATA_ROOT}/Examples)
set(OTBAPP_BASELINE ${OTB_DATA_ROOT}/Baseline/OTB-Applications/Images)
set(OTBAPP_BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB-Applications/Files)
......
......@@ -60,7 +60,7 @@ set(OTB_VERSION_STRING_FULL "${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VER
FIND_PATH(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB_SOURCE_DIR}/../OTB-Data)
# OTB_DATA_PATHS is searched recursively.. you need not enter sub-directories
SET(OTB_DATA_PATHS "${OTB_DATA_ROOT}/Examples::${OTB_DATA_ROOT}/Input" CACHE STRING "Where the OTB data is. Enter a double colon separated list.")
SET(OTB_DATA_PATHS "${OTB_DATA_ROOT}/Input" CACHE STRING "Where the OTB data is. Enter a double colon separated list.")
#
# Rebuild the Software Guide figures or not ?
......
......@@ -20,7 +20,7 @@
otb_test_application(NAME apTeGenerateAnApplicationExample
APP ApplicationExample
OPTIONS -in ${OTB_DATA_ROOT}/Examples/QB_Suburb.png
OPTIONS -in ${OTB_DATA_ROOT}/Input/QB_Suburb.png
-out ${TEMP}/apTeGenerateAnApplicationExampleOutput.png uint8)
set_tests_properties(apTeGenerateAnApplicationExample PROPERTIES DEPENDS otbapp_ApplicationExample)
......@@ -22,17 +22,17 @@
// Software Guide : BeginCommandLineArgs
// OUTPUTS: {DEMToRainbowImageGenerator.png}
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Examples/DEM_srtm
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Input/DEM_srtm
// Software Guide : EndCommandLineArgs
// Software Guide : BeginCommandLineArgs
// OUTPUTS: {DEMToHotImageGenerator.png}
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Examples/DEM_srtm hot
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Input/DEM_srtm hot
// Software Guide : EndCommandLineArgs
// Software Guide : BeginCommandLineArgs
// OUTPUTS: {DEMToReliefImageGenerator.png}
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Examples/DEM_srtm relief
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Input/DEM_srtm relief
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
......
......@@ -22,7 +22,7 @@
// Software Guide : BeginCommandLineArgs
// OUTPUTS: {HillShadingExample.png}, {HillShadingColorExample.png}
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Examples/DEM_srtm
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Input/DEM_srtm
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/BasicFilters)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
otb_add_test(NAME bfTeLeeImageFilterTest COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 1
......@@ -51,7 +51,7 @@ otb_add_test(NAME bfTeDEMToRainbowExampleTest COMMAND ${OTB_TEST_DRIVER}
${TEMP}/DEMToRainbowImageGenerator.png
Execute $<TARGET_FILE:DEMToRainbowExample>
${TEMP}/DEMToRainbowImageGenerator.png
6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Examples/DEM_srtm
6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Input/DEM_srtm
)
......@@ -139,5 +139,5 @@ otb_add_test(NAME bfTeHillShadingExampleTest COMMAND ${OTB_TEST_DRIVER}
Execute $<TARGET_FILE:HillShadingExample>
${TEMP}/HillShadingExample.png
${TEMP}/HillShadingColorExample.png
6.8 45.3 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Examples/DEM_srtm
6.8 45.3 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Input/DEM_srtm
)
......@@ -89,7 +89,6 @@ if(PROJECT_NAME STREQUAL "OTBExamples")
set(BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB/Files)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
set(TEMP ${CMAKE_BINARY_DIR}/Testing/Temporary)
set(EXAMPLEDATA ${OTB_DATA_ROOT}/Examples)
set(OTBAPP_BASELINE ${OTB_DATA_ROOT}/Baseline/OTB-Applications/Images)
set(OTBAPP_BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB-Applications/Files)
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/ChangeDetection)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# ------- CorrelChDetTest----------
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Classification)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
otb_add_test(NAME clTeNeighborhoodMajorityVotingImageFilterTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${NOTOL}
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/DisparityMap)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
if(OTBMathParser_LOADED)
#otb_add_test(NAME dmTeStereoReconstructionExampleTest COMMAND ${OTB_TEST_DRIVER}
......
......@@ -21,7 +21,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {amst.png}
// INPUTS: {amst2.png}
// OUTPUTS: {amstLineFusion.png}
// 5 1
// Software Guide : EndCommandLineArgs
......
......@@ -21,7 +21,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {amst.png}
// INPUTS: {amst2.png}
// OUTPUTS: {amstLineCorrelations.png}, {amstLineCorrelationDirections.png}
// 5 1
// Software Guide : EndCommandLineArgs
......
......@@ -21,7 +21,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {amst.png}
// INPUTS: {amst2.png}
// OUTPUTS: {amstLineRatios.png}, {amstLineRatioDirections.png}
// 5 1
// Software Guide : EndCommandLineArgs
......
......@@ -21,7 +21,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {amst.png}
// INPUTS: {amst2.png}
// OUTPUTS: {amstTouziEdges.png}, {amstTouziDirections.png}
// 3
// Software Guide : EndCommandLineArgs
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/FeatureExtraction)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# ------- CorrelationLineDetectorExampleTest----------
......@@ -30,7 +30,7 @@ otb_add_test(NAME feTeCorrelationLineDetectorExampleTest COMMAND ${OTB_TEST_DRIV
${BASELINE}/amstLineCorrelationDirections.png
${TEMP}/amstLineCorrelationDirections.png
Execute $<TARGET_FILE:CorrelationLineDetectorExample>
${INPUTDATA}/amst.png
${INPUTDATA}/amst2.png
${TEMP}/amstLineCorrelations.png
${TEMP}/amstLineCorrelationDirections.png
5 1
......@@ -57,7 +57,7 @@ otb_add_test(NAME feTeTouziEdgeDetectorExampleTest COMMAND ${OTB_TEST_DRIVER}
${BASELINE}/amstTouziDirections.png
${TEMP}/amstTouziDirections.png
Execute $<TARGET_FILE:TouziEdgeDetectorExample>
${INPUTDATA}/amst.png
${INPUTDATA}/amst2.png
${TEMP}/amstTouziEdges.png
${TEMP}/amstTouziDirections.png
3
......@@ -70,7 +70,7 @@ otb_add_test(NAME feTeAsymmetricFusionOfLineDetectorExampleTest COMMAND ${OTB_TE
${BASELINE}/amstLineFusion.png
${TEMP}/amstLineFusion.png
Execute $<TARGET_FILE:AsymmetricFusionOfLineDetectorExample>
${INPUTDATA}/amst.png
${INPUTDATA}/amst2.png
${TEMP}/amstLineFusion.png
5 1
)
......@@ -84,7 +84,7 @@ otb_add_test(NAME feTeRatioLineDetectorExampleTest COMMAND ${OTB_TEST_DRIVER}
${BASELINE}/amstLineRatioDirections.png
${TEMP}/amstLineRatioDirections.png
Execute $<TARGET_FILE:RatioLineDetectorExample>
${INPUTDATA}/amst.png
${INPUTDATA}/amst2.png
${TEMP}/amstLineRatios.png
${TEMP}/amstLineRatioDirections.png
5 1
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Filtering)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# ------- DanielssonDistanceMapImageFilterTest----------
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Fusion)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
otb_add_test(NAME fuTeBayesianFusionImageFilterTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${EPSILON_8}
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Hyperspectral)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
otb_add_test(NAME siTvHyperspectralExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 3
......
......@@ -23,7 +23,7 @@
// Software Guide : BeginCommandLineArgs
// OUTPUTS: {DEMToImageGenerator.tif}
// OUTPUTS: {pretty_DEMToImageGenerator.png}
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Examples/DEM_srtm
// 6.5 45.5 500 500 0.002 -0.002 ${OTB_DATA_ROOT}/Input/DEM_srtm
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/IO)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# ------- ExtractROITest----------
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Image)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# ------- Image5Test----------
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Iterators)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# ------- ImageRegionIteratorWithIndexTest----------
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Learning)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
if(OTBLibSVM_LOADED)
# ------- SVMImageEstimatorClassificationMultiExampleTest----------
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Markov)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
otb_add_test(NAME maTeMarkovClassification1ExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${EPSILON_8}
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/OBIA)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
#if(OTBMathParser_LOADED)
#otb_add_test(NAME trTeOBIARadiometricAttributesLabelMapFilterTest COMMAND ${OTB_TEST_DRIVER}
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Patented)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# -----SIFTDisparityMapEstimationTest---------
if(Module_OTBSiftFast)
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Projections)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
otb_add_test(NAME prTeOrthoRectificationExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${NOTOL}
......
......@@ -23,7 +23,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {Romania_Extract.tif}
// OUTPUTS: {AtmosphericCorrectionSequencement.tif}
// ${OTB_DATA_ROOT}/Examples/atmosphericCorrectionSequencement_alpha_beta.txt ${OTB_DATA_ROOT}/Examples/atmosphericCorrectionSequencement_solar_illumination.txt ${OTB_DATA_ROOT}/Examples/atmosphericCorrectionSequencement_wavelength_spectral_bands_spot4_1.txt 27.3 4 12 152.7 2.5 -77.0 1013. 2.48134 0.34400 1 0.199854 2 0.020
// ${OTB_DATA_ROOT}/Input/atmosphericCorrectionSequencement_alpha_beta.txt ${OTB_DATA_ROOT}/Input/atmosphericCorrectionSequencement_solar_illumination.txt ${OTB_DATA_ROOT}/Input/atmosphericCorrectionSequencement_wavelength_spectral_bands_spot4_1.txt 27.3 4 12 152.7 2.5 -77.0 1013. 2.48134 0.34400 1 0.199854 2 0.020
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Radiometry)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# ------- ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter ------------------------------
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Simulation)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
# ------- ProsailModelExampleTest ----------
......
......@@ -19,7 +19,7 @@
#
set(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Tutorials)
set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
otb_add_test(NAME trTeTutorialsHelloWorld COMMAND ${OTB_TEST_DRIVER}
Execute $<TARGET_FILE:HelloWorldOTB>
......
......@@ -58,7 +58,7 @@ otb_test_application(NAME apTvHyEndmemberNumberEstimation_vd
APP EndmemberNumberEstimation
OPTIONS -in ${OTB_DATA_ROOT}/Input/Hyperspectral/synthetic/hsi_cube.tif
-algo vd
-algo.vd.far 0.001
-algo.vd.far 0.2
TESTENVOPTIONS ${TEMP}/aptTvHyEndmemberNumberEstimation_vd.txt
VALID --compare-ascii ${EPSILON_7}
${BASELINE_FILES}/aptTvHyEndmemberNumberEstimation.txt
......
......@@ -165,15 +165,15 @@ otb_test_application(NAME apTvUtRescaleTest
#----------- TileFusion TESTS ----------------
otb_test_application(NAME apTvUtTileFusion
APP TileFusion
OPTIONS -il ${EXAMPLEDATA}/Scene_R1C1.png
${EXAMPLEDATA}/Scene_R1C2.png
${EXAMPLEDATA}/Scene_R2C1.png
${EXAMPLEDATA}/Scene_R2C2.png
OPTIONS -il ${INPUTDATA}/Scene_R1C1.png
${INPUTDATA}/Scene_R1C2.png
${INPUTDATA}/Scene_R2C1.png
${INPUTDATA}/Scene_R2C2.png
-cols 2
-rows 2
-out ${TEMP}/apTvUtTileFusion.png uint8
VALID --compare-image ${NOTOL}
${EXAMPLEDATA}/Scene.png
${INPUTDATA}/Scene.png
${TEMP}/apTvUtTileFusion.png)
......@@ -334,7 +334,7 @@ otb_test_application(NAME apTvUtColorMappingColorToLabelOptimalLUTQB
otb_test_application(NAME apTvUtColorMappingLabelToColorCustomLUTQB
APP ColorMapping
OPTIONS -in ${EXAMPLEDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
OPTIONS -in ${INPUTDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
-method custom
-method.custom.lut ${INPUTDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI_PNG_ColorTable.txt
-out ${TEMP}/apTvUtColorMappingLabelToColorCustomLUTQB.tif uint8
......@@ -355,7 +355,7 @@ otb_test_application(NAME apTvUtColorMappingColorToLabelOptimalLUT
otb_test_application(NAME apTvUtColorMappingLabelToColorOptimalLUTQB
APP ColorMapping
OPTIONS -in ${EXAMPLEDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
OPTIONS -in ${INPUTDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
-method optimal
-out ${TEMP}/apTvUtColorMappingLabelToColorOptimalLUTQB.tif uint8
VALID --compare-image ${NOTOL}
......@@ -371,7 +371,7 @@ otb_test_application(NAME apTvUtColorMappingColorToLabelCustomLUTQB
-method.custom.lut ${INPUTDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI_PNG_ColorTable.txt
-out ${TEMP}/apTvUtColorMappingColorToLabelCustomLUTQB.tif uint8
VALID --compare-image ${NOTOL}
${EXAMPLEDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
${INPUTDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
${TEMP}/apTvUtColorMappingColorToLabelCustomLUTQB.tif)
otb_test_application(NAME apTvUtColorMappingLabelToColorContinuousLUTJet
......@@ -388,9 +388,9 @@ otb_test_application(NAME apTvUtColorMappingLabelToColorContinuousLUTJet
otb_test_application(NAME apTvUtColorMappingLabelToColorSupportImage
APP ColorMapping
OPTIONS -in ${EXAMPLEDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
OPTIONS -in ${INPUTDATA}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
-method image
-method.image.in ${EXAMPLEDATA}/ROI_QB_MUL_1.tif
-method.image.in ${INPUTDATA}/ROI_QB_MUL_1.tif
-out ${TEMP}/apTvUtColorMappingLabelToColorSupportImage.tif uint8
VALID --compare-image ${NOTOL}
${BASELINE}/apTvUtColorMappingLabelToColorSupportImage.tif
......
......@@ -39,7 +39,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_SolarDistance
-out ${TEMP}/apTvRaOpticalCalibration_SolarDistance.tif
VALID --compare-image ${EPSILON_7}
${BASELINE}/raTvRadianceToReflectanceImageFilterAutoQuickbirdXS.tif
${TEMP}/apTvRaOpticalCalibration_QuickbirdXS.tif )
${TEMP}/apTvRaOpticalCalibration_SolarDistance.tif )
otb_test_application(NAME apTvRaOpticalCalibration_WV2PAN
APP OpticalCalibration
......@@ -89,7 +89,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_Spot5
otb_test_application(NAME apTvRaOpticalCalibration_UnknownSensor
APP OpticalCalibration
OPTIONS
-in ${EXAMPLEDATA}/Romania_Extract.tif
-in ${INPUTDATA}/Romania_Extract.tif
-out ${TEMP}/apTvRaOpticalCalibration_Spot4_UnknownSensor_test.tif
-level toc
-acqui.gainbias ${INPUTDATA}/apTvRaOpticalCalibrationUnknownSensorGainsBiases2.txt
......
......@@ -169,7 +169,7 @@ otb_test_application(NAME apTvPrGenerateRPCSensorModel
otb_test_application(NAME apTuDmGridBasedImageResamplingLeftTest
APP GridBasedImageResampling
OPTIONS -io.in ${EXAMPLEDATA}/sensor_stereo_left.tif
OPTIONS -io.in ${INPUTDATA}/sensor_stereo_left.tif
-io.out ${TEMP}/apTvDmGridBasedImageResamplingLeftTest.tif
-grid.in ${INPUTDATA}/sensor_stereo_rectif_left.tif
-out.sizex 158
......@@ -179,7 +179,7 @@ otb_test_application(NAME apTuDmGridBasedImageResamplingLeftTest
otb_test_application(NAME apTuDmGridBasedImageResamplingRightTest
APP GridBasedImageResampling
OPTIONS -io.in ${EXAMPLEDATA}/sensor_stereo_right.tif
OPTIONS -io.in ${INPUTDATA}/sensor_stereo_right.tif
-io.out ${TEMP}/apTvDmGridBasedImageResamplingRightTest.tif
-grid.in ${INPUTDATA}/sensor_stereo_rectif_right.tif
-out.sizex 158
......@@ -314,7 +314,7 @@ otb_test_application(NAME apTvPrRigidTransformResample
#----------- ImageEnvelope TESTS ----------------
otb_test_application(NAME apTvPrImageEnvelopeTest
APP ImageEnvelope
OPTIONS -in ${EXAMPLEDATA}/sensor_stereo_left.tif
OPTIONS -in ${INPUTDATA}/sensor_stereo_left.tif
-out ${TEMP}/apTvPrImageEnvelopeTest.shp
VALID --compare-ogr ${EPSILON_9}
${BASELINE_FILES}/apTvPrImageEnvelopeTest.shp
......
......@@ -174,7 +174,7 @@ otb_test_application(NAME apTvCcConnectedComponentSegmentatioNoMask
#----------- MeanShiftSmoothing TESTS ----------------
otb_test_application(NAME apTvLSMS1MeanShiftSmoothingNoModeSearch
APP MeanShiftSmoothing
OPTIONS -in ${EXAMPLEDATA}/QB_1_ortho.tif
OPTIONS -in ${INPUTDATA}/QB_1_ortho.tif
-fout ${TEMP}/apTvLSMS1_filtered_range.tif
-foutpos ${TEMP}/apTvLSMS1_filtered_spatial.tif
-ranger 30
......@@ -267,7 +267,7 @@ set_property(TEST apTvSmallRegionsMerging PROPERTY DEPENDS apTvLSMS2Segmentation
#----------- LSMSVectorization TESTS ----------------
otb_test_application(NAME apTvLSMS4Vectorization_SmallMerged
APP LSMSVectorization
OPTIONS -in ${EXAMPLEDATA}/QB_1_ortho.tif
OPTIONS -in ${INPUTDATA}/QB_1_ortho.tif
-inseg ${BASELINE}/apTvLSMS3_Segmentation_SmallMerged.tif
-out ${TEMP}/apTvLSMS4_Segmentation_SmallMerged.shp
-tilesizex 100
......@@ -281,7 +281,7 @@ set_property(TEST apTvLSMS4Vectorization_SmallMerged PROPERTY DEPENDS apTvLSMS3S
otb_test_application(NAME apTvLSMS4Vectorization_NoSmall
APP LSMSVectorization
OPTIONS -in ${EXAMPLEDATA}/QB_1_ortho.tif
OPTIONS -in ${INPUTDATA}/QB_1_ortho.tif
-inseg ${TEMP}/apTvLSMS2_Segmentation_NoSmall.tif
-out ${TEMP}/apTvLSMS4_Segmentation_NoSmall.shp
-tilesizex 100
......@@ -310,7 +310,7 @@ otb_test_application(NAME apTvSeHooverCompareSegmentationTest
#----------- LargeScaleMeanShift TESTS ----------------
otb_test_application(NAME apTvSeLargeScaleMeanShiftTest
APP LargeScaleMeanShift
OPTIONS -in ${EXAMPLEDATA}/QB_1_ortho.tif
OPTIONS -in ${INPUTDATA}/QB_1_ortho.tif
-spatialr 3
-ranger 80
-minsize 16
......
......@@ -71,8 +71,8 @@ otb_module_test()
otb_test_application(NAME apTvDmStereoRectificationGridGeneratorTest
APP StereoRectificationGridGenerator
OPTIONS -io.inleft ${EXAMPLEDATA}/sensor_stereo_left.tif
-io.inright ${EXAMPLEDATA}/sensor_stereo_right.tif
OPTIONS -io.inleft ${INPUTDATA}/sensor_stereo_left.tif
-io.inright ${INPUTDATA}/sensor_stereo_right.tif
-io.outleft ${TEMP}/apTvDmStereoRectificationGridGeneratorLeftTest.tif
-io.outright ${TEMP}/apTvDmStereoRectificationGridGeneratorRightTest.tif
-inverse.outleft ${TEMP}/apTvDmStereoRectificationGridGeneratorInverseLeftTest.tif
......@@ -144,8 +144,8 @@ otb_test_application(NAME apTvDmFineRegistrationWithWarpingTest
#otb_test_application(NAME apTvDmDisparityMapToElevationMap
#APP DisparityMapToElevationMap
#OPTIONS -io.in ${INPUTDATA}/sensor_stereo_blockmatching_output.tif
#-io.left ${EXAMPLEDATA}/sensor_stereo_left.tif
#-io.right ${EXAMPLEDATA}/sensor_stereo_right.tif
#-io.left ${INPUTDATA}/sensor_stereo_left.tif
#-io.right ${INPUTDATA}/sensor_stereo_right.tif
#-io.lgrid ${INPUTDATA}/sensor_stereo_rectif_left.tif
#-io.rgrid ${INPUTDATA}/sensor_stereo_rectif_right.tif
#-io.out ${TEMP}/apTvDmDisparityMapToElevationMapTest.tif
......
......@@ -54,12 +54,11 @@ public:
*
* See https://stackoverflow.com/questions/335369/finding-c-static-initialization-order-problems#335746
*/
static Pointer Instance();
static Logger * Instance();
itkNewMacro(Self);
// Overwrite this to provide custom formatting of log entries
std::string BuildFormattedEntry(itk::Logger::PriorityLevelType, std::string const&) override;
static Pointer New();
itkCreateAnotherMacro( Logger )
itkCloneMacro( Logger )
/** Output logs about the RAM, caching and multi-threading settings */
void LogSetupInformation();
......@@ -72,13 +71,14 @@ public:
protected:
Logger();
virtual ~Logger() override;
virtual ~Logger() override = default;
private:
Logger(const Self &) = delete;
void operator =(const Self&) = delete;
static Pointer CreateInstance();
static Logger * CreateInstance();
bool m_LogSetupInfoDone;
......
......@@ -71,28 +71,36 @@ itk::LoggerBase::PriorityLevelType ConfigurationManager::GetLoggerLevel()
// Default value is INFO
itk::LoggerBase::PriorityLevelType level = itk::LoggerBase::INFO;
if(itksys::SystemTools::GetEnv("OTB_LOGGER_LEVEL",svalue))
itksys::SystemTools::GetEnv("OTB_LOGGER_LEVEL",svalue);
// on windows a variable set with set EX="" will keep the "". We need
// to remove them.
if( !svalue.empty() )
{
if(svalue.compare("DEBUG") == 0)
auto quot_pos = svalue.find_first_not_of("\"") ;
svalue = svalue.substr( quot_pos );
quot_pos = svalue.find_last_not_of("\"") ;
svalue = svalue.substr( 0 , quot_pos + 1 );
if( svalue == "DEBUG" )
{
level = itk::LoggerBase::DEBUG;
}
else if(svalue.compare("INFO") == 0)
else if( svalue == "INFO" )
{
level = itk::LoggerBase::INFO;
}
else if(svalue.compare("WARNING") == 0)
else if( svalue == "WARNING" )
{
level = itk::LoggerBase::WARNING;
}
else if(svalue.compare("CRITICAL") == 0)
else if( svalue == "CRITICAL" )
{
level = itk::LoggerBase::CRITICAL;
}
else
{
otbLogMacro(Error,<<"Unknown value for OTB_LOGGER_LEVEL_MACRO. Possible values are DEBUG, INFO, WARNING, CRITICAL.");
otbLogMacro(Warning,<<"Unknown value for OTB_LOGGER_LEVEL_MACRO (set to: "
<<svalue<<"). Possible values are DEBUG, INFO, WARNING, CRITICAL. "
<<"Level set to INFO.");
}
}
return level;
......
......@@ -29,41 +29,50 @@
namespace otb
{
Logger::Pointer Logger::CreateInstance()
namespace
{
Logger::Pointer instance = Logger::New();
// By default, redirect logs to std::cout
itk::StdStreamLogOutput::Pointer defaultOutput = itk::StdStreamLogOutput::New();
defaultOutput->SetStream(std::cout);
instance->AddLogOutput(defaultOutput);
return instance;
static bool is_logger_singleton_level_set;
}
Logger::Pointer Logger::Instance()
Logger::Logger() :
m_LogSetupInfoDone(false)
{
// Static locales are initialized once in a thread-safe way
static Logger::Pointer instance = CreateInstance();
return instance;
m_LevelForFlushing = itk::LoggerBase::CRITICAL;
m_TimeStampFormat = itk::LoggerBase::HUMANREADABLE;
m_HumanReadableFormat = "%Y-%m-%d %H:%M:%S";
}
Logger::Logger()
Logger * Logger::CreateInstance()
{
this->SetPriorityLevel(otb::ConfigurationManager::GetLoggerLevel());
Logger * logger = new Logger;
this->SetLevelForFlushing(itk::LoggerBase::CRITICAL);
// By default, redirect logs to std::cout
itk::StdStreamLogOutput::Pointer defaultOutput =
itk::StdStreamLogOutput::New();
defaultOutput->SetStream(std::cout);
logger->AddLogOutput(defaultOutput);
return logger;
}
this->SetTimeStampFormat(itk::LoggerBase::HUMANREADABLE);
this->SetHumanReadableFormat("%Y-%m-%d %H:%M:%S");
m_LogSetupInfoDone = false;
Logger * Logger::Instance()
{
static Logger * logger_singleton = CreateInstance();
if ( !is_logger_singleton_level_set )
{
is_logger_singleton_level_set = true;
logger_singleton->SetPriorityLevel(ConfigurationManager::GetLoggerLevel());
}
return logger_singleton;
}
Logger::~Logger()
Logger::Pointer Logger::New()
{
Pointer smartPtr = new Logger;
smartPtr->UnRegister();
smartPtr->SetPriorityLevel(Instance()->GetPriorityLevel());
return smartPtr;
}
void Logger::LogSetupInformation()
......@@ -72,57 +81,32 @@ void Logger::LogSetupInformation()
{
std::ostringstream oss;
oss<<"Default RAM limit for OTB is "<<otb::ConfigurationManager::GetMaxRAMHint()<<" MB"<<std::endl;
oss<<"Default RAM limit for OTB is "<<
otb::ConfigurationManager::GetMaxRAMHint()<<" MB"<<std::endl;
this->Info(oss.str());
oss.str("");
oss.clear();
oss<<"GDAL maximum cache size is "<<GDALGetCacheMax64()/(1024*1024)<<" MB"<<std::endl;
oss<<"GDAL maximum cache size is "<<
GDALGetCacheMax64()/(1024*1024)<<" MB"<<std::endl;
this->Info(oss.str());
oss.str("");