Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
a5ec67b7
Commit
a5ec67b7
authored
Feb 17, 2016
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Plain Diff
Synchronization : merge branch 'develop' into sampling_polygon_analysis
parents
2122e15c
68c43d05
Changes
80
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
80 changed files
with
10088 additions
and
44 deletions
+10088
-44
.travis.yml
.travis.yml
+2
-5
CMake/CTestCustom.cmake.in
CMake/CTestCustom.cmake.in
+4
-0
CMake/FindGLEW.cmake
CMake/FindGLEW.cmake
+55
-0
CMake/FindGLFW.cmake
CMake/FindGLFW.cmake
+63
-0
CMake/OTBGroups.cmake
CMake/OTBGroups.cmake
+3
-0
Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx
...lications/AppClassification/app/otbOGRLayerClassifier.cxx
+8
-1
Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx
...Applications/AppSegmentation/app/otbLSMSVectorization.cxx
+6
-1
Modules/Applications/AppStereo/test/CMakeLists.txt
Modules/Applications/AppStereo/test/CMakeLists.txt
+1
-1
Modules/Core/Common/include/otbConfigurationManager.h
Modules/Core/Common/include/otbConfigurationManager.h
+10
-0
Modules/Core/Common/include/otbSubsampledImageRegionConstIterator.txx
.../Common/include/otbSubsampledImageRegionConstIterator.txx
+1
-1
Modules/Core/ImageBase/test/CMakeLists.txt
Modules/Core/ImageBase/test/CMakeLists.txt
+1
-1
Modules/Core/PointSet/test/CMakeLists.txt
Modules/Core/PointSet/test/CMakeLists.txt
+4
-4
Modules/Core/Streaming/include/otbPipelineMemoryPrintCalculator.h
...Core/Streaming/include/otbPipelineMemoryPrintCalculator.h
+8
-0
Modules/Filtering/ImageManipulation/include/otbMaskedIteratorDecorator.h
...ng/ImageManipulation/include/otbMaskedIteratorDecorator.h
+132
-0
Modules/Filtering/ImageManipulation/include/otbMaskedIteratorDecorator.txx
.../ImageManipulation/include/otbMaskedIteratorDecorator.txx
+237
-0
Modules/Filtering/ImageManipulation/otb-module.cmake
Modules/Filtering/ImageManipulation/otb-module.cmake
+1
-0
Modules/Filtering/ImageManipulation/test/CMakeLists.txt
Modules/Filtering/ImageManipulation/test/CMakeLists.txt
+17
-0
Modules/Filtering/ImageManipulation/test/otbImageManipulationTestDriver.cxx
...ImageManipulation/test/otbImageManipulationTestDriver.cxx
+4
-0
Modules/Filtering/ImageManipulation/test/otbMaskedIteratorDecorator.cxx
...ing/ImageManipulation/test/otbMaskedIteratorDecorator.cxx
+391
-0
Modules/Filtering/VectorDataManipulation/test/CMakeLists.txt
Modules/Filtering/VectorDataManipulation/test/CMakeLists.txt
+1
-1
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
+4
-1
Modules/IO/IOGDAL/test/otbGDALImageIOTestWriteMetadata.cxx
Modules/IO/IOGDAL/test/otbGDALImageIOTestWriteMetadata.cxx
+7
-2
Modules/IO/IOGDAL/test/otbGDALReadPxlComplex.cxx
Modules/IO/IOGDAL/test/otbGDALReadPxlComplex.cxx
+12
-5
Modules/Radiometry/SARCalibration/test/CMakeLists.txt
Modules/Radiometry/SARCalibration/test/CMakeLists.txt
+1
-1
Modules/Segmentation/Conversion/include/otbPersistentImageToOGRDataFilter.txx
.../Conversion/include/otbPersistentImageToOGRDataFilter.txx
+15
-3
Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.txx
...Conversion/include/otbPersistentImageToOGRLayerFilter.txx
+20
-7
Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.txx
...GRProcessing/include/otbOGRLayerStreamStitchingFilter.txx
+26
-6
Modules/Segmentation/OGRProcessing/test/CMakeLists.txt
Modules/Segmentation/OGRProcessing/test/CMakeLists.txt
+1
-1
Modules/ThirdParty/GLFW/CMakeLists.txt
Modules/ThirdParty/GLFW/CMakeLists.txt
+7
-0
Modules/ThirdParty/GLFW/otb-module-init.cmake
Modules/ThirdParty/GLFW/otb-module-init.cmake
+8
-0
Modules/ThirdParty/GLFW/otb-module.cmake
Modules/ThirdParty/GLFW/otb-module.cmake
+12
-0
Modules/ThirdParty/Glew/CMakeLists.txt
Modules/ThirdParty/Glew/CMakeLists.txt
+7
-0
Modules/ThirdParty/Glew/otb-module-init.cmake
Modules/ThirdParty/Glew/otb-module-init.cmake
+8
-0
Modules/ThirdParty/Glew/otb-module.cmake
Modules/ThirdParty/Glew/otb-module.cmake
+12
-0
Modules/ThirdParty/Glut/CMakeLists.txt
Modules/ThirdParty/Glut/CMakeLists.txt
+7
-0
Modules/ThirdParty/Glut/otb-module-init.cmake
Modules/ThirdParty/Glut/otb-module-init.cmake
+8
-0
Modules/ThirdParty/Glut/otb-module.cmake
Modules/ThirdParty/Glut/otb-module.cmake
+12
-0
Modules/ThirdParty/OpenGL/CMakeLists.txt
Modules/ThirdParty/OpenGL/CMakeLists.txt
+7
-0
Modules/ThirdParty/OpenGL/otb-module-init.cmake
Modules/ThirdParty/OpenGL/otb-module-init.cmake
+8
-0
Modules/ThirdParty/OpenGL/otb-module.cmake
Modules/ThirdParty/OpenGL/otb-module.cmake
+12
-0
Modules/Visualization/Ice/CMakeLists.txt
Modules/Visualization/Ice/CMakeLists.txt
+5
-0
Modules/Visualization/Ice/README
Modules/Visualization/Ice/README
+44
-0
Modules/Visualization/Ice/RELEASE_NOTES.txt
Modules/Visualization/Ice/RELEASE_NOTES.txt
+16
-0
Modules/Visualization/Ice/include/otbFragmentShader.h
Modules/Visualization/Ice/include/otbFragmentShader.h
+78
-0
Modules/Visualization/Ice/include/otbFragmentShaderRegistry.h
...les/Visualization/Ice/include/otbFragmentShaderRegistry.h
+74
-0
Modules/Visualization/Ice/include/otbGeoInterface.h
Modules/Visualization/Ice/include/otbGeoInterface.h
+118
-0
Modules/Visualization/Ice/include/otbGlActor.h
Modules/Visualization/Ice/include/otbGlActor.h
+100
-0
Modules/Visualization/Ice/include/otbGlImageActor.h
Modules/Visualization/Ice/include/otbGlImageActor.h
+323
-0
Modules/Visualization/Ice/include/otbGlROIActor.h
Modules/Visualization/Ice/include/otbGlROIActor.h
+118
-0
Modules/Visualization/Ice/include/otbGlVectorActor.h
Modules/Visualization/Ice/include/otbGlVectorActor.h
+183
-0
Modules/Visualization/Ice/include/otbGlVersionChecker.h
Modules/Visualization/Ice/include/otbGlVersionChecker.h
+118
-0
Modules/Visualization/Ice/include/otbGlView.h
Modules/Visualization/Ice/include/otbGlView.h
+678
-0
Modules/Visualization/Ice/include/otbNonOptGlImageActor.h
Modules/Visualization/Ice/include/otbNonOptGlImageActor.h
+223
-0
Modules/Visualization/Ice/include/otbStandardShader.h
Modules/Visualization/Ice/include/otbStandardShader.h
+157
-0
Modules/Visualization/Ice/include/otbViewSettings.h
Modules/Visualization/Ice/include/otbViewSettings.h
+165
-0
Modules/Visualization/Ice/otb-module.cmake
Modules/Visualization/Ice/otb-module.cmake
+22
-0
Modules/Visualization/Ice/src/CMakeLists.txt
Modules/Visualization/Ice/src/CMakeLists.txt
+29
-0
Modules/Visualization/Ice/src/otbFragmentShader.cxx
Modules/Visualization/Ice/src/otbFragmentShader.cxx
+75
-0
Modules/Visualization/Ice/src/otbFragmentShaderRegistry.cxx
Modules/Visualization/Ice/src/otbFragmentShaderRegistry.cxx
+155
-0
Modules/Visualization/Ice/src/otbGeoInterface.cxx
Modules/Visualization/Ice/src/otbGeoInterface.cxx
+121
-0
Modules/Visualization/Ice/src/otbGlActor.cxx
Modules/Visualization/Ice/src/otbGlActor.cxx
+33
-0
Modules/Visualization/Ice/src/otbGlImageActor.cxx
Modules/Visualization/Ice/src/otbGlImageActor.cxx
+1148
-0
Modules/Visualization/Ice/src/otbGlROIActor.cxx
Modules/Visualization/Ice/src/otbGlROIActor.cxx
+211
-0
Modules/Visualization/Ice/src/otbGlVectorActor.cxx
Modules/Visualization/Ice/src/otbGlVectorActor.cxx
+850
-0
Modules/Visualization/Ice/src/otbGlVersionChecker.cxx
Modules/Visualization/Ice/src/otbGlVersionChecker.cxx
+229
-0
Modules/Visualization/Ice/src/otbGlView.cxx
Modules/Visualization/Ice/src/otbGlView.cxx
+502
-0
Modules/Visualization/Ice/src/otbNonOptGlImageActor.cxx
Modules/Visualization/Ice/src/otbNonOptGlImageActor.cxx
+782
-0
Modules/Visualization/Ice/src/otbStandardShader.cxx
Modules/Visualization/Ice/src/otbStandardShader.cxx
+231
-0
Modules/Visualization/Ice/src/otbViewSettings.cxx
Modules/Visualization/Ice/src/otbViewSettings.cxx
+201
-0
Modules/Visualization/IceViewer/CMakeLists.txt
Modules/Visualization/IceViewer/CMakeLists.txt
+5
-0
Modules/Visualization/IceViewer/include/otbIceViewer.h
Modules/Visualization/IceViewer/include/otbIceViewer.h
+150
-0
Modules/Visualization/IceViewer/otb-module.cmake
Modules/Visualization/IceViewer/otb-module.cmake
+15
-0
Modules/Visualization/IceViewer/src/CMakeLists.txt
Modules/Visualization/IceViewer/src/CMakeLists.txt
+16
-0
Modules/Visualization/IceViewer/src/otbIce.cxx
Modules/Visualization/IceViewer/src/otbIce.cxx
+94
-0
Modules/Visualization/IceViewer/src/otbIceViewer.cxx
Modules/Visualization/IceViewer/src/otbIceViewer.cxx
+1579
-0
Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx
...cationEngine/src/otbWrapperElevationParametersHandler.cxx
+1
-1
Modules/Wrappers/ApplicationEngine/test/CMakeLists.txt
Modules/Wrappers/ApplicationEngine/test/CMakeLists.txt
+1
-1
RELEASE_NOTES.txt
RELEASE_NOTES.txt
+18
-0
SuperBuild/CMake/CTestCustom.cmake.in
SuperBuild/CMake/CTestCustom.cmake.in
+6
-1
Utilities/Maintenance/TravisBuild.cmake
Utilities/Maintenance/TravisBuild.cmake
+71
-0
No files found.
.travis.yml
View file @
a5ec67b7
...
...
@@ -16,15 +16,12 @@ before_script:
-
export MAKE_CMD=/tmp/ninja
-
export CMAKE_GEN='Ninja'
-
cd /tmp
-
-
wget https://cmake.org/files/v3.4/cmake-3.4.1-Linux-x86_64.tar.gz --no-check-certificate
-
wget https://raw.githubusercontent.com/rkanavath/otb_cmake_scripts/master/rashad-cm.cmake --no-check-certificate
-
tar -xzf cmake-3.4.1-Linux-x86_64.tar.gz
-
wget https://github.com/martine/ninja/releases/download/v1.6.0/ninja-linux.zip --no-check-certificate
-
unzip ninja-linux.zip
-
wget https://www.orfeo-toolbox.org/packages/xdk/OTB-5.2/OTB-5.2.0-xdk-Linux64.run
--no-check-certificate
-
wget https://www.orfeo-toolbox.org/packages/xdk/OTB-5.2/OTB-5.2.0-xdk-Linux64.run --no-check-certificate
-
chmod +x /tmp/OTB-5.2.0-xdk-Linux64.run
-
/tmp/OTB-5.2.0-xdk-Linux64.run
script
:
/tmp/cmake-3.4.1-Linux-x86_64/bin/ctest -VV -S /tmp/rashad-cm.cmake
script
:
/tmp/cmake-3.4.1-Linux-x86_64/bin/ctest -VV -S /home/travis/build/orfeotoolbox/OTB/Utilities/Maintenance/TravisBuild.cmake
CMake/CTestCustom.cmake.in
View file @
a5ec67b7
...
...
@@ -31,6 +31,10 @@ set(CTEST_CUSTOM_COVERAGE_EXCLUDE
# Exclude files from the Examples directories
#".*/Examples/.*"
# Exclude files from the Testing directories
".*/test/.*"
".*/Testing/.*"
# Exclude files from the ThirdParty Utilities directories
".*/Modules/ThirdParty/.*"
".*/Utilities/.*"
...
...
CMake/FindGLEW.cmake
0 → 100644
View file @
a5ec67b7
# Courtesy of: https://raw.github.com/progschj/OpenGL-Examples/
#
# Try to find GLEW library and include path.
# Once done this will define
#
# GLEW_FOUND
# GLEW_INCLUDE_PATH
# GLEW_LIBRARY
#
IF
(
WIN32
)
FIND_PATH
(
GLEW_INCLUDE_PATH GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include
${
GLEW_ROOT_DIR
}
/include
DOC
"The directory where GL/glew.h resides"
)
FIND_LIBRARY
(
GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${
GLEW_ROOT_DIR
}
/lib
${
PROJECT_SOURCE_DIR
}
/src/nvgl/glew/bin
${
PROJECT_SOURCE_DIR
}
/src/nvgl/glew/lib
DOC
"The GLEW library"
)
ELSE
(
WIN32
)
FIND_PATH
(
GLEW_INCLUDE_PATH GL/glew.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${
GLEW_ROOT_DIR
}
/include
DOC
"The directory where GL/glew.h resides"
)
# Prefer the static library.
FIND_LIBRARY
(
GLEW_LIBRARY
NAMES libGLEW.so GLEW
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${
GLEW_ROOT_DIR
}
/lib
DOC
"The GLEW library"
)
ENDIF
(
WIN32
)
SET
(
GLEW_FOUND
"NO"
)
IF
(
GLEW_INCLUDE_PATH AND GLEW_LIBRARY
)
SET
(
GLEW_LIBRARIES
${
GLEW_LIBRARY
}
)
SET
(
GLEW_FOUND
"YES"
)
ENDIF
(
GLEW_INCLUDE_PATH AND GLEW_LIBRARY
)
INCLUDE
(
${
CMAKE_ROOT
}
/Modules/FindPackageHandleStandardArgs.cmake
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
GLEW DEFAULT_MSG GLEW_LIBRARY
)
CMake/FindGLFW.cmake
0 → 100644
View file @
a5ec67b7
# Locate the glfw library
# This module defines the following variables:
# GLFW_LIBRARY, the name of the library;
# GLFW_INCLUDE_DIR, where to find glfw include files.
# GLFW_FOUND, true if both the GLFW_LIBRARY and GLFW_INCLUDE_DIR have been found.
#
# To help locate the library and include file, you could define an environment variable called
# GLFW_ROOT which points to the root of the glfw library installation. This is pretty useful
# on a Windows platform.
#
#
# Usage example to compile an "executable" target to the glfw library:
#
# FIND_PACKAGE (glfw REQUIRED)
# INCLUDE_DIRECTORIES (${GLFW_INCLUDE_DIR})
# ADD_EXECUTABLE (executable ${EXECUTABLE_SRCS})
# TARGET_LINK_LIBRARIES (executable ${GLFW_LIBRARY})
#
# TODO:
# Allow the user to select to link to a shared library or to a static library.
#Search for the include file...
FIND_PATH
(
GLFW_INCLUDE_DIR GLFW/glfw3.h DOC
"Path to GLFW include directory."
HINTS
$ENV{GLFW_ROOT}
PATH_SUFFIX
include
# For finding the include file under the root of the glfw expanded archive, typically on Windows.
)
FIND_LIBRARY
(
GLFW_LIBRARY DOC
"Absolute path to GLFW library."
NAMES glfw glfw3dll glfw3
HINTS
$ENV{GLFW_ROOT}
PATH_SUFFIXES
lib
# For finding the library file under the root of the glfw expanded archive, typically on Windows.
)
IF
(
GLFW_INCLUDE_DIR AND EXISTS
"
${
GLFW_INCLUDE_DIR
}
/GLFW/glfw3.h"
)
FILE
(
STRINGS
"
${
GLFW_INCLUDE_DIR
}
/GLFW/glfw3.h"
glfw_version_str
REGEX
"^#[
\t
]*define[
\t
]+GLFW_VERSION_(MAJOR|MINOR|REVISION)[
\t
]+[0-9]+$"
)
UNSET
(
GLFW_VERSION_STRING
)
FOREACH
(
VPART MAJOR MINOR REVISION
)
FOREACH
(
VLINE
${
glfw_version_str
}
)
IF
(
VLINE MATCHES
"^#[
\t
]*define[
\t
]+GLFW_VERSION_
${
VPART
}
"
)
STRING
(
REGEX REPLACE
"^#[
\t
]*define[
\t
]+GLFW_VERSION_
${
VPART
}
[
\t
]+([0-9]+)$"
"
\\
1"
GLFW_VERSION_PART
"
${
VLINE
}
"
)
IF
(
GLFW_VERSION_STRING
)
SET
(
GLFW_VERSION_STRING
"
${
GLFW_VERSION_STRING
}
.
${
GLFW_VERSION_PART
}
"
)
ELSE
()
SET
(
GLFW_VERSION_STRING
"
${
GLFW_VERSION_PART
}
"
)
ENDIF
()
UNSET
(
GLFW_VERSION_PART
)
ENDIF
()
ENDFOREACH
()
ENDFOREACH
()
ENDIF
()
INCLUDE
(
${
CMAKE_ROOT
}
/Modules/FindPackageHandleStandardArgs.cmake
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
GLFW
REQUIRED_VARS GLFW_LIBRARY GLFW_INCLUDE_DIR
VERSION_VAR GLFW_VERSION_STRING
)
\ No newline at end of file
CMake/OTBGroups.cmake
View file @
a5ec67b7
...
...
@@ -16,6 +16,7 @@ set(group_list
Remote
Segmentation
ThirdParty
Visualization
Wrappers
)
...
...
@@ -34,8 +35,10 @@ set(Radiometry_documentation "This group contains algorithms related to the proc
set
(
Registration_documentation
"This group contains algorithms related to registration of images"
)
set
(
Segmentation_documentation
"This group contains algorithms related to image segmentaiton"
)
set
(
ThirdParty_documentation
"This group contains all Orfeo ToolBox third parties"
)
set
(
Visualization_documentation
"This group contains Ice (visualization framework) and IceViewer (visualization tool)"
)
set
(
Wrappers_documentation
"This group contains the application framework and the wrappers to use it"
)
set
(
Remote_documentation
"This group of modules is for OTB based code that have
additional third-party dependencies not bundled with the toolkit,
new algorithms or implementations seeking greater exposure and adoption,
...
...
Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx
View file @
a5ec67b7
...
...
@@ -213,7 +213,14 @@ private:
goesOn2
=
feature2
.
addr
()
!=
0
;
count
++
;
}
layer2
.
ogr
().
CommitTransaction
();
const
OGRErr
err
=
layer2
.
ogr
().
CommitTransaction
();
if
(
err
!=
OGRERR_NONE
)
{
itkExceptionMacro
(
<<
"Unable to commit transaction for OGR layer "
<<
layer2
.
ogr
().
GetName
()
<<
"."
);
}
source2
->
SyncToDisk
();
clock_t
toc
=
clock
();
...
...
Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx
View file @
a5ec67b7
...
...
@@ -335,7 +335,12 @@ private:
firstFeature
=
nextFeature
;
}
layer
.
ogr
().
CommitTransaction
();
const
OGRErr
err
=
layer
.
ogr
().
CommitTransaction
();
if
(
err
!=
OGRERR_NONE
)
{
itkExceptionMacro
(
<<
"Unable to commit transaction for OGR layer "
<<
layer
.
ogr
().
GetName
()
<<
"."
);
}
if
(
extension
==
".shp"
){
sqloss
.
str
(
""
);
...
...
Modules/Applications/AppStereo/test/CMakeLists.txt
View file @
a5ec67b7
...
...
@@ -48,7 +48,7 @@ otb_test_application(NAME apTvDmStereoFramework
#----------- StereoRectificationGridGenerator TESTS ----------------
otb_test_application
(
NAME apT
u
DmStereoRectificationGridGeneratorTest
otb_test_application
(
NAME apT
v
DmStereoRectificationGridGeneratorTest
APP StereoRectificationGridGenerator
OPTIONS -io.inleft
${
EXAMPLEDATA
}
/sensor_stereo_left.tif
...
...
Modules/Core/Common/include/otbConfigurationManager.h
View file @
a5ec67b7
...
...
@@ -18,7 +18,13 @@
#ifndef _otbConfigurationManager_h
#define _otbConfigurationManager_h
#include "itkVersion.h"
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
#include "itksys/FundamentalType.h"
#else
#include "itk_kwiml.h"
#endif
#include <string>
#include <boost/cstdint.hpp>
...
...
@@ -38,7 +44,11 @@ namespace otb
class
ConfigurationManager
{
public:
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
typedef
::
itksysFundamentalType_UInt64
RAMValueType
;
#else
typedef
KWIML_INT_uint64_t
RAMValueType
;
#endif
/**
* DEMDirectory is a directory were DEM tiles are stored.
...
...
Modules/Core/Common/include/otbSubsampledImageRegionConstIterator.txx
View file @
a5ec67b7
...
...
@@ -316,7 +316,7 @@ SubsampledImageRegionConstIterator<TImage>
{
// Get the index of the first pixel on the span (row)
IndexType ind = this->m_Image->ComputeIndex(static_cast<IndexValueType>(this->m_Offset));
IndexType& startIndex = this->m_Region.GetIndex();
const
IndexType& startIndex = this->m_Region.GetIndex();
// Deccrement along a row, then wrap at the beginning of the region row.
bool done;
...
...
Modules/Core/ImageBase/test/CMakeLists.txt
View file @
a5ec67b7
...
...
@@ -90,7 +90,7 @@ otb_add_test(NAME coTvExtractROI2 COMMAND otbImageBaseTestDriver
26 97 209 100
)
otb_add_test
(
NAME bfT
u
ComplexToVectorImageCastFilterTest COMMAND otbImageBaseTestDriver
otb_add_test
(
NAME bfT
v
ComplexToVectorImageCastFilterTest COMMAND otbImageBaseTestDriver
--compare-n-images
${
NOTOL
}
2
${
BASELINE
}
/bfTvComplexToVectorImageCastFilterTest.tif
${
TEMP
}
/bfTvComplexToVectorImageCastFilterTest.tif
...
...
Modules/Core/PointSet/test/CMakeLists.txt
View file @
a5ec67b7
...
...
@@ -40,7 +40,7 @@ otb_add_test(NAME bfTuImageToPointSetFilterTest COMMAND otbPointSetTestDriver
otb_add_test
(
NAME bfTvTransformPointSetFilter COMMAND otbPointSetTestDriver
otbTransformPointSetFilterTest
)
otb_add_test
(
NAME feT
u
ThresholdImageToPointSet1 COMMAND otbPointSetTestDriver
otb_add_test
(
NAME feT
v
ThresholdImageToPointSet1 COMMAND otbPointSetTestDriver
--compare-ascii
${
EPSILON_3
}
${
BASELINE_FILES
}
/feThresholdImageToPointSet_Threshold_0To255.txt
${
TEMP
}
/feThresholdImageToPointSet_Threshold_0To255.txt
otbThresholdImageToPointSetTest
...
...
@@ -48,7 +48,7 @@ otb_add_test(NAME feTuThresholdImageToPointSet1 COMMAND otbPointSetTestDriver
${
TEMP
}
/feThresholdImageToPointSet_Threshold_0To255.txt
0 255
)
otb_add_test
(
NAME feT
u
ThresholdImageToPointSet2 COMMAND otbPointSetTestDriver
otb_add_test
(
NAME feT
v
ThresholdImageToPointSet2 COMMAND otbPointSetTestDriver
--compare-ascii
${
EPSILON_3
}
${
BASELINE_FILES
}
/feThresholdImageToPointSet_Threshold_0To0.txt
${
TEMP
}
/feThresholdImageToPointSet_Threshold_0To0.txt
otbThresholdImageToPointSetTest
...
...
@@ -56,7 +56,7 @@ otb_add_test(NAME feTuThresholdImageToPointSet2 COMMAND otbPointSetTestDriver
${
TEMP
}
/feThresholdImageToPointSet_Threshold_0To0.txt
0 0
)
otb_add_test
(
NAME feT
u
ThresholdImageToPointSet3 COMMAND otbPointSetTestDriver
otb_add_test
(
NAME feT
v
ThresholdImageToPointSet3 COMMAND otbPointSetTestDriver
--compare-ascii
${
EPSILON_3
}
${
BASELINE_FILES
}
/feThresholdImageToPointSet_Threshold_255To255.txt
${
TEMP
}
/feThresholdImageToPointSet_Threshold_255To255.txt
otbThresholdImageToPointSetTest
...
...
@@ -64,7 +64,7 @@ otb_add_test(NAME feTuThresholdImageToPointSet3 COMMAND otbPointSetTestDriver
${
TEMP
}
/feThresholdImageToPointSet_Threshold_255To255.txt
255 255
)
otb_add_test
(
NAME feT
u
ThresholdImageToPointSet4 COMMAND otbPointSetTestDriver
otb_add_test
(
NAME feT
v
ThresholdImageToPointSet4 COMMAND otbPointSetTestDriver
--compare-ascii
${
EPSILON_3
}
${
BASELINE_FILES
}
/feThresholdImageToPointSet_Threshold_1To200.txt
${
TEMP
}
/feThresholdImageToPointSet_Threshold_1To200.txt
otbThresholdImageToPointSetTest
...
...
Modules/Core/Streaming/include/otbPipelineMemoryPrintCalculator.h
View file @
a5ec67b7
...
...
@@ -19,7 +19,11 @@
#define __otbPipelineMemoryPrintCalculator_h
#include "itkProcessObject.h"
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
#include "itksys/FundamentalType.h"
#else
#include "itk_kwiml.h"
#endif
#include <set>
namespace
otb
...
...
@@ -75,7 +79,11 @@ public:
typedef
ProcessObjectType
::
Pointer
ProcessObjectPointerType
;
typedef
itk
::
DataObject
DataObjectType
;
typedef
DataObjectType
::
Pointer
DataObjectPointerType
;
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
typedef
::
itksysFundamentalType_UInt64
MemoryPrintType
;
#else
typedef
KWIML_INT_uint64_t
MemoryPrintType
;
#endif
typedef
std
::
set
<
const
ProcessObjectType
*>
ProcessObjectPointerSetType
;
/** Run-time type information (and related methods). */
...
...
Modules/Filtering/ImageManipulation/include/otbMaskedIteratorDecorator.h
0 → 100644
View file @
a5ec67b7
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef otbMaskedIteratorDecorator_h
#define otbMaskedIteratorDecorator_h
#include "itkMacro.h"
namespace
otb
{
/** \class MaskedIteratorDecorator
* \brief Decorate an iterator to ignore masked pixels
*
* An iterator that dispatches its operations on both an image and a mask using
* two iterators of the same type. It skips over pixels where the value of the
* mask is zero. There is a limitation that the image and the mask must both be
* of the same type.
*
* \ingroup ImageIterator
* \ingroup OTBCommon
*/
template
<
typename
TIteratorType
,
typename
TMaskIteratorType
=
TIteratorType
>
class
MaskedIteratorDecorator
{
public:
typedef
MaskedIteratorDecorator
<
TIteratorType
,
TMaskIteratorType
>
Self
;
typedef
typename
TMaskIteratorType
::
ImageType
MaskType
;
typedef
typename
TIteratorType
::
ImageType
ImageType
;
typedef
typename
ImageType
::
IndexType
IndexType
;
typedef
typename
ImageType
::
RegionType
RegionType
;
typedef
typename
ImageType
::
PixelType
PixelType
;
typedef
typename
MaskType
::
PixelType
MaskPixelType
;
// Run-time type information
itkTypeMacroNoParent
(
MaskedIteratorDecorator
);
/** Constructors forward arguments to both iterators
* Beware that the iterator is in a undefinite state after construction
* GoToBegin() or GoToEnd() should be called */
MaskedIteratorDecorator
(
MaskType
*
mask
,
ImageType
*
image
,
const
RegionType
&
region
);
/** Current iterator index. Wraps the underlying iterator GetIndex() */
IndexType
GetIndex
()
const
;
/** Move to the first valid iteration position. Note that this is different
* from the underlying iterators GoToBegin because their first pixels might be
* masked */
void
GoToBegin
();
/** Move one pixel past the last valid iteration index */
void
GoToEnd
();
/** True if the iterator is at the beginning */
bool
IsAtBegin
()
const
;
/** True if the iterator is at the end */
bool
IsAtEnd
()
const
;
/** Advance to the next valid iteration position. That is the next non masked
* position of the image iterator */
Self
&
operator
++
();
/** Move to the previous valid iteration position. That is the previous non
* masked position of the image iterator */
Self
&
operator
--
();
/** Set the image pixel value */
//void Set(const PixelType& value) const;
/** Get the image pixel value */
const
PixelType
&
Value
(
void
)
const
;
// Can't wrap all methods because iterator interface is open ended
// So provide access to inner iterators:
/** Underlying mask iterator accessor */
TMaskIteratorType
&
GetMaskIterator
();
/** Underlying mask iterator const accessor */
const
TMaskIteratorType
&
GetMaskIterator
()
const
;
/** Underlying image iterator accessor */
TIteratorType
&
GetImageIterator
();
/** Underlying image iterator const accessor */
const
TIteratorType
&
GetImageIterator
()
const
;
const
bool
&
HasMask
()
const
;
private:
/** Private method to compute the begin iterator position taking into account
the mask. Called by the constructor. */
void
ComputeMaskedBegin
();
private:
// Inner iterators on the image and mask
TMaskIteratorType
m_ItMask
;
TIteratorType
m_ItImage
;
// flag to check if mask is present
bool
m_UseMask
;
// Unmasked bounds
TMaskIteratorType
m_StartMask
;
TIteratorType
m_StartImage
;
};
}
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbMaskedIteratorDecorator.txx"
#endif
#endif
Modules/Filtering/ImageManipulation/include/otbMaskedIteratorDecorator.txx
0 → 100644
View file @
a5ec67b7
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef otbMaskedIteratorDecorator_hxx
#define otbMaskedIteratorDecorator_hxx
#include "otbMaskedIteratorDecorator.h"
#include "itkMacro.h"
namespace otb
{
template <typename TIteratorType, typename TMaskIteratorType>
MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>
::MaskedIteratorDecorator( MaskType* mask,
ImageType* image,
const RegionType& region)
{
m_ItImage = TIteratorType(image,region);
if (mask == NULL)
{
m_UseMask = false;
}
else
{
if (image->GetLargestPossibleRegion() != mask->GetLargestPossibleRegion())
{
itkGenericExceptionMacro("Input image and mask have different largest regions : mask is discarded!");
}
else
{
m_UseMask = true;
m_ItMask = TMaskIteratorType(mask,region);
m_StartMask = TMaskIteratorType(mask,region);
m_StartImage = TIteratorType(image,region);
}
}
}
template <typename TIteratorType, typename TMaskIteratorType>
typename MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>::IndexType
MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>
::GetIndex() const
{
return m_ItImage.GetIndex();
}
template <typename TIteratorType, typename TMaskIteratorType>
void
MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>
::GoToBegin()
{
if (m_UseMask)
{
this->ComputeMaskedBegin();
}
else
{
m_ItImage.GoToBegin();
}
}
template <typename TIteratorType, typename TMaskIteratorType>
void
MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>
::GoToEnd()
{
if (m_UseMask)
{
// make sure masked begin is computed as next calls might be operator--()
// and IsAtBegin() (for a reverse iteration)
this->ComputeMaskedBegin();
m_ItMask.GoToEnd();
}
m_ItImage.GoToEnd();
}
template <typename TIteratorType, typename TMaskIteratorType>
bool
MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>
::IsAtBegin() const
{
if (m_UseMask)
{
return m_ItMask == m_StartMask || m_ItImage == m_StartImage;
}
return m_ItImage.IsAtBegin();
}
template <typename TIteratorType, typename TMaskIteratorType>
bool
MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>
::IsAtEnd() const
{
if (m_UseMask)
{
return m_ItMask.IsAtEnd() || m_ItImage.IsAtEnd();
}
return m_ItImage.IsAtEnd();
}
// Wrap the underlying iterators to skip masked pixels
template <typename TIteratorType, typename TMaskIteratorType>
MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>&
MaskedIteratorDecorator<TIteratorType,TMaskIteratorType>
::operator++()
{
if (m_UseMask)
{
do
{
++m_ItMask;
++m_ItImage;
} while (m_ItMask.Value() == 0 && !this->IsAtEnd());
}
else
{
++m_ItImage;
}
return *this;
}