Commit 876c3e5e authored by Cédric Traizet's avatar Cédric Traizet

Merge branch 'develop' into fix_fastica

parents c2fbb028 67c782b6
Pipeline #222 passed with stage
in 6 minutes and 7 seconds
variables:
DOCKER_DRIVER: overlay2
stages:
- build
.general:
only: [merge_requests]
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
# variables:
# CI_DEBUG_TRACE: "true"
native-build:
extends: .general
stage: build
image: registry.orfeo-toolbox.org/orfeotoolbox/otb:ubuntu-18.04-gcc
script:
- ctest -VV -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-gcc
shark-build:
extends: .general
stage: build
image: registry.orfeo-toolbox.org/orfeotoolbox/otb:ubuntu-18.04-gcc-shark-3.1.4
script:
- ctest -VV -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-gcc-shark-3.1.4
\ No newline at end of file
FROM ubuntu:18.04
MAINTAINER Sebastien Dinot <sebastien.dinot@c-s.fr>
ENV DEBIAN_FRONTEND noninteractive
RUN echo "Europe/Paris" > /etc/timezone
# ----------------------------------------------------------------------------
# First stage : install tools (they rarely evolve)
# ----------------------------------------------------------------------------
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
make \
cmake \
ninja-build \
g++ \
gcc \
clang \
clang-tidy \
clang-format \
ccache \
git \
libtool \
swig \
xvfb \
&& rm -rf /var/lib/apt/lists/*
# ----------------------------------------------------------------------------
# Second stage : dependencies (they evolve more often)
# ----------------------------------------------------------------------------
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
freeglut3-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-thread-dev \
libcurl4-gnutls-dev \
libexpat1-dev \
libfftw3-dev \
libgdal-dev \
libgeotiff-dev \
libglew-dev \
libglfw3-dev \
libgsl-dev \
libinsighttoolkit4-dev \
libkml-dev \
libmuparser-dev \
libmuparserx-dev \
libopencv-core-dev \
libopencv-ml-dev \
libopenmpi-dev \
libopenthreads-dev \
libossim-dev \
libpng-dev \
libqt5opengl5-dev \
libqwt-qt5-dev \
libsvm-dev \
libtinyxml-dev \
qtbase5-dev \
qttools5-dev \
default-jdk \
python-dev \
python-numpy \
python-gdal \
python3-dev \
python3-numpy \
python3-gdal \
&& rm -rf /var/lib/apt/lists/*
ENV PATH /usr/lib/ccache:$PATH
ENV OTB_USE_SHARK OFF
FROM ubuntu:18.04 as shark-provider
MAINTAINER OrfeoToolbox Core Team
ENV DEBIAN_FRONTEND noninteractive
# ----------------------------------------------------------------------------
# First stage : install tools
# (based on https://github.com/Shark-ML/Shark/blob/master/.travis.yml)
# ----------------------------------------------------------------------------
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
ca-certificates \
g++ \
make \
cmake \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-thread-dev \
libcurl4-gnutls-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN cd \tmp \
&& curl -o shark.tar.gz https://codeload.github.com/Shark-ML/Shark/tar.gz/v3.1.4 \
&& tar xzf shark.tar.gz \
&& cd Shark-3.1.4\
&& mkdir build \
&& cd build \
&& cmake -DBUILD_EXAMPLES:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DENABLE_HDF5:BOOL=OFF \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_CBLAS:BOOL=OFF \
-DENABLE_OPENMP:BOOL=OFF \
../. \
&& make install
FROM ubuntu:18.04
MAINTAINER Sebastien Dinot <sebastien.dinot@c-s.fr>
ENV DEBIAN_FRONTEND noninteractive
RUN echo "Europe/Paris" > /etc/timezone
# ----------------------------------------------------------------------------
# First stage : install tools (they rarely evolve)
# ----------------------------------------------------------------------------
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
make \
cmake \
ninja-build \
g++ \
gcc \
clang \
clang-tidy \
clang-format \
ccache \
git \
libtool \
swig \
xvfb \
&& rm -rf /var/lib/apt/lists/*
# ----------------------------------------------------------------------------
# Second stage : dependencies (they evolve more often)
# ----------------------------------------------------------------------------
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
freeglut3-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-thread-dev \
libcurl4-gnutls-dev \
libexpat1-dev \
libfftw3-dev \
libgdal-dev \
libgeotiff-dev \
libglew-dev \
libglfw3-dev \
libgsl-dev \
libinsighttoolkit4-dev \
libkml-dev \
libmuparser-dev \
libmuparserx-dev \
libopencv-core-dev \
libopencv-ml-dev \
libopenmpi-dev \
libopenthreads-dev \
libossim-dev \
libpng-dev \
libqt5opengl5-dev \
libqwt-qt5-dev \
libsvm-dev \
libtinyxml-dev \
qtbase5-dev \
qttools5-dev \
default-jdk \
python-dev \
python-numpy \
python-gdal \
python3-dev \
python3-numpy \
python3-gdal \
&& rm -rf /var/lib/apt/lists/*
COPY --from=shark-provider /usr/local/include/shark/* /usr/include/shark/
COPY --from=shark-provider /usr/local/lib/libshark* /usr/lib/
COPY --from=shark-provider /usr/local/bin/SharkVersion /usr/bin/
COPY --from=shark-provider /usr/local/lib/cmake/ /usr/lib/cmake/
ENV PATH /usr/lib/ccache:$PATH
ENV OTB_USE_SHARK ON
# CI
This folder contains files for the continuous integration.
## Docker files
The docker files are:
* Dockerfile.nat: native environment to test OTB. Shark is not on this one as the version OTB is using is not packaged (since 6.7)
* Dockerfile.shark.1.3.4: native environment and Shark version 3.1.4.
## CMake files
The docker files are:
* main_ci.cmake: main script that will launch configure, build and soon test. It aims at configuring Ctest before running the different jobs (site name, build command...)
* configure_option.cmake: script that gathers all options needed by OTB.
## Yaml file
The last file needed for the CI is the *.gitlab-ci.yml* it aims at interfacing with GitLab. Here is the basic structure:
```
Job-name:
stage: job-type
image: docker_image_that_will_be_used
script:
- script that will be launch inside the docker
```
# CDash interaction
Results of build can be seen in CDash on the track "Experimental". The site is the image docker that run the build, and the build name should be the branch name that is tested.
\ No newline at end of file
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This script is a prototype for the future CI, it may evolve rapidly in a near future
#This file set the following variable :
# * otb_build_project_option
# * otb_use_option
# * otb_wrap_option
# * CONFIGURE_OPTIONS
set (otb_build_project_option
"BUILD_COOKBOOK:BOOL=OFF
BUILD_EXAMPLES:BOOL=ON
BUILD_SHARED_LIBS:BOOL=ON
BUILD_TESTING:BOOL=ON")
set (otb_use_option
"OTB_USE_6S:BOOL=ON
OTB_USE_CURL:BOOL=ON
OTB_USE_GLEW:BOOL=ON
OTB_USE_GLFW:BOOL=ON
OTB_USE_GLUT:BOOL=ON
OTB_USE_GSL:BOOL=ON
OTB_USE_LIBKML:BOOL=ON
OTB_USE_LIBSVM:BOOL=ON
OTB_USE_MPI:BOOL=ON
OTB_USE_MUPARSER:BOOL=ON
OTB_USE_MUPARSERX:BOOL=ON
OTB_USE_OPENCV:BOOL=ON
OTB_USE_OPENGL:BOOL=ON
OTB_USE_OPENMP:BOOL=ON
OTB_USE_QT:BOOL=ON
OTB_USE_QWT:BOOL=ON
OTB_USE_SHARK:BOOL=$ENV{OTB_USESHARK}
OTB_USE_SIFTFAST:BOOL=ON
OTB_USE_SPTW:BOOL=ON
OTB_USE_SSE_FLAGS:BOOL=ON")
set (otb_wrap_option
"OTB_WRAP_JAVA:BOOL=ON
OTB_WRAP_PYTHON:BOOL=ON
OTB_WRAP_PYTHON3:BOOL=ON")
set (otb_data_option
"OTB_DATA_ROOT:PATH=${OTB_DATA_ROOT}
OTB_DATA_USE_LARGEINPUT:BOOL=OFF
OTB_DATA_LARGEINPUT_ROOT:PATH=${OTB_LARGEINPUT_ROOT}")
set (cmake_configure_option
"CMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}
CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}
CMAKE_C_FLAGS:STRING=-fPIC -Wall -Wextra
CMAKE_CXX_FLAGS:STRING=-fPIC -Wall -Wextra -Wno-cpp")
#Transform the previous string in list
string (REPLACE "\n" ";" otb_build_project_option ${otb_build_project_option})
string (REPLACE "\n" ";" otb_use_option ${otb_use_option})
string (REPLACE "\n" ";" otb_wrap_option ${otb_wrap_option})
string (REPLACE "\n" ";" otb_data_option ${otb_data_option})
set (otb_options "")
list (APPEND otb_options ${otb_build_project_option})
list (APPEND otb_options ${otb_use_option})
list (APPEND otb_options ${otb_wrap_option})
list (APPEND otb_options ${otb_data_option})
foreach(option ${otb_options})
set( CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS}-D${option};")
endforeach(option)
# This should be removed as soon as possible
set( CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS}-Dopencv_INCLUDE_DIR:PATH=/usr/include;")
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This script is a prototype for the future CI, it may evolve rapidly in a near future
get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
set (ENV{LANG} "C") # Only ascii output
# Build Configuration : Release, Debug..
set (CTEST_BUILD_CONFIGURATION "Release")
set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
set (CTEST_BUILD_NAME "$ENV{CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}_to_$ENV{CI_MERGE_REQUEST_TARGET_BRANCH_NAME}")
set (CTEST_SITE "${IMAGE_NAME}")
# Directory variable
set (CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}")
set (CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/")
set (CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/")
set (PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}")
# Ctest command value
set (CMAKE_COMMAND "cmake")
set (CTEST_BUILD_FLAGS "-j8") # number of thread used for compilation
set (CTEST_BUILD_COMMAND "make ${CTEST_BUILD_FLAGS}")
# Data directory setting
set (OTB_DATA_ROOT "${OTB_SOURCE_DIR}/otb-data/") # todo
set (OTB_LARGEINPUT_ROOT "") # todo
#The following file set the CONFIGURE_OPTIONS variable
set (CONFIGURE_OPTIONS "")
include ( "${CMAKE_CURRENT_LIST_DIR}/configure_option.cmake" )
# End of configuration
ctest_start (Experimental TRACK Experimental)
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
SOURCE "${OTB_SOURCE_DIR}"
OPTIONS "${CONFIGURE_OPTIONS}"
RETURN_VALUE _configure_rv
CAPTURE_CMAKE_ERROR _configure_error)
if ( _configure_rv EQUAL -1 )
message("An error occurs during ctest_configure:
${_configure_error}")
endif()
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
RETURN_VALUE _build_rv]
CAPTURE_CMAKE_ERROR _build_error]
)
if ( _configure_rv EQUAL -1 )
message("An error occurs during ctest_build:
${_build_error}")
endif()
# ctest_test(PARALLEL_LEVEL 8])
ctest_submit()
\ No newline at end of file
......@@ -49,11 +49,15 @@ mark_as_advanced(SPHINX_BUILD)
find_program(PDFLATEX_COMMAND NAMES pdflatex )
mark_as_advanced(PDFLATEX_COMMAND)
find_program(MAKEINDEX_COMMAND NAMES makeindex )
mark_as_advanced(MAKEINDEX_COMMAND)
# Check that we found everything we need
foreach(cmd
LATEX_COMMAND
TAR_COMMAND
PDFLATEX_COMMAND
MAKEINDEX_COMMAND
SPHINX_BUILD
SH_INTERP)
if(NOT ${cmd})
......@@ -171,9 +175,16 @@ add_custom_target(CookBookArchive
COMMENT "Generating Tex files from rst"
VERBATIM)
set(COOKBOOK_TEX CookBook-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH})
add_custom_target(CookBookPDF
ALL
COMMAND ${CMAKE_MAKE_PROGRAM} all-pdf
COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
COMMAND ${MAKEINDEX_COMMAND} -s python.ist "${COOKBOOK_TEX}.idx" || true
COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
COMMAND ${PDFLATEX_COMMAND} ${COOKBOOK_TEX}.tex
WORKING_DIRECTORY ${LATEX_DIR}
DEPENDS CookBookTexFromRST
COMMENT "Building RST documentation in pdf")
......@@ -63,10 +63,10 @@ copyright = u'@OTB_COPYRIGHT_TEXT@'
# built documents.
#
# The short X.Y version.
version = '@OTB_VERSION@'
version = '@OTB_VERSION_STRING@'
#version = '5.2.0'
# The full version, including alpha/beta/rc tags.
release = '@OTB_VERSION@'
release = '@OTB_VERSION_STRING@'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......@@ -206,6 +206,7 @@ htmlhelp_basename = 'OTBCookBookdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
'inputenc': '\\usepackage[latin10,utf8]{inputenc}',
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
......@@ -213,7 +214,7 @@ latex_elements = {
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
'preamble': '\\DeclareUnicodeCharacter{021B}{\\textcommabelow t}'
}
# Grouping the document tree into LaTeX files. List of tuples
......
......@@ -96,6 +96,13 @@ public:
unsigned int & linesOffset, unsigned int first_burstInd,
bool inputWithInvalidPixels=false);
/** Specify overlap area between two bursts */
bool Overlap(std::pair<unsigned long,unsigned long> & linesUp,
std::pair<unsigned long,unsigned long> & linesLow,
std::pair<unsigned long,unsigned long> & samplesUp,
std::pair<unsigned long,unsigned long> & samplesLow,
unsigned int burstIndUp,
bool inputWithInvalidPixels=false);
/** Transform world point (lat,lon,hgt) to input image point
(col,row) and YZ frame */
......
......@@ -128,6 +128,23 @@ SarSensorModelAdapter::DeburstAndConcatenate(std::vector<std::pair<unsigned long
return false;
}
bool
SarSensorModelAdapter::Overlap(std::pair<unsigned long,unsigned long> & linesUp,
std::pair<unsigned long,unsigned long> & linesLow,
std::pair<unsigned long,unsigned long> & samplesUp,
std::pair<unsigned long,unsigned long> & samplesLow,
unsigned int burstIndUp,
bool inputWithInvalidPixels)
{
if(m_SensorModel.get())
{
return m_SensorModel->overlap(linesUp, linesLow, samplesUp, samplesLow, burstIndUp,
inputWithInvalidPixels);
}
return false;
}
bool SarSensorModelAdapter::ImageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long imageLine, unsigned long & deburstLine)
{
return ossimplugins::ossimSarSensorModel::imageLineToDeburstLine(lines,imageLine,deburstLine);
......
......@@ -480,3 +480,8 @@ otb_add_test(NAME uaTvSarSensorModelAdapter COMMAND otbOSSIMAdaptersTestDriver
otbSarSensorModelAdapterTest
${INPUTDATA}/s1a-iw1-slc-vh-amp_xt.geom
)
otb_add_test(NAME uaTvSarSensorModelAdapter2 COMMAND otbOSSIMAdaptersTestDriver
otbSarSensorModelAdapterTest
${INPUTDATA}/s1a-iw1-slc-vv-20170111_Burst01_amp.geom
)
......@@ -83,5 +83,25 @@ int otbSarSensorModelAdapterTest(int itkNotUsed(argc), char* argv[])
unsigned int ind_Line = 2;
sensorModel->LineToSatPositionAndVelocity(ind_Line, out6, out7);
// Test overlap function (for burst index = 0)
// If version of geom file >= 3
kwl = otb::ReadGeometryFromGEOMFile(infname);
sensorModel->LoadState(kwl);
if (std::stoi(kwl.GetMetadataByKey("header.version")) >= 3)
{
std::pair<unsigned long,unsigned long> linesUp;
std::pair<unsigned long,unsigned long> linesLow;
std::pair<unsigned long,unsigned long> samplesUp;
std::pair<unsigned long,unsigned long> samplesLow;
success = sensorModel->Overlap(linesUp, linesLow, samplesUp, samplesLow, 0);
if (!success)
{
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}
......@@ -47,9 +47,6 @@ public:
typedef DoubleVectorImageType VectorImageType;
typedef DoubleImageType ImageType;
/** Filter typedefs */
typedef otb::LocalRxDetectorFilter<VectorImageType, ImageType> LocalRxDetectorFilterType; //TODO remove this
private:
void DoInit() override
{
......@@ -108,30 +105,19 @@ private:
auto inputImage = GetParameterDoubleVectorImage("in");
inputImage->UpdateOutputInformation();
// The localRxDetectionFilter can be replaced by a functorImageFilter using the appropriate
// functor. However using functorImageFilter with neighborhood is buggy (see issue #1802). Still,
// the functor has been implemented and localRxDetectionFilter will be deprecated when the
// bug is corrected.
#if 1 // Using localRxDetectionFilter
auto localRxDetectionFilter = LocalRxDetectorFilterType::New();
localRxDetectionFilter->SetInput(inputImage);
Functor::LocalRxDetectionFunctor<double> detectorFunctor;
unsigned int externalRadius = GetParameterInt("er");
unsigned int internalRadius = GetParameterInt("ir");
localRxDetectionFilter->SetInternalRadius(internalRadius);
localRxDetectionFilter->SetExternalRadius(externalRadius);
#else // Using a functorImageFilter
Functor::LocalRxDetectionFunctor<double> detectorFunctor;
detectorFunctor.SetInternalRadius(GetParameterInt("ir"), GetParameterInt("ir"));
detectorFunctor.SetInternalRadius(internalRadius, internalRadius);
// Create a functorImageFilter with the localRx functor and the appropriate
// external radius.
auto localRxDetectionFilter = otb::NewFunctorFilter
(detectorFunctor ,{{GetParameterInt("er"),GetParameterInt("er")}});
(detectorFunctor ,{{externalRadius,externalRadius}});
localRxDetectionFilter->SetInputs(inputImage);
#endif
SetParameterOutputImage("out", localRxDetectionFilter->GetOutput());
RegisterPipeline();
......
......@@ -27,7 +27,6 @@ otb_module(OTBAppHyperspectral
OTBEndmembersExtraction
OTBUnmixing
OTBAnomalyDetection
OTBFunctor
TEST_DEPENDS
OTBTestKernel
OTBCommandLine
......
......@@ -29,6 +29,8 @@
#include "itkFixedArray.h"
#include "itkDefaultConvertPixelTraits.h"
#include <type_traits>
#include "itkConstNeighborhoodIterator.h"
#include "otbImage.h"
namespace otb
{
......@@ -42,12 +44,11 @@ namespace otb
*/
template <class T> struct IsNeighborhood : std::false_type {};
/// Partial specialisation for itk::Neighborhood<T>
template <class T> struct IsNeighborhood<itk::Neighborhood<T>> : std::true_type {};
/// Partial specialisation for const ConstNeighborhoodIterator<Image::T> &
template <class T> struct IsNeighborhood<const itk::ConstNeighborhoodIterator<Image<T>>&> : std::true_type {};
/// Partial specialisation for const itk::Neighborhood<T> &
template <class T> struct IsNeighborhood<const itk::Neighborhood<T>&> : std::true_type {};
/// Partial specialisation for const ConstNeighborhoodIterator<VectorImage::T> &
template <class T> struct IsNeighborhood<const itk::ConstNeighborhoodIterator<VectorImage<T>>&> : std::true_type {};
/**
* \struct IsSuitableType
......@@ -76,9 +77,9 @@ template <class T> struct IsSuitableType<itk::RGBAPixel<T>> : IsSuitableType<T>:
* \struct PixelTypeDeduction
* \brief Helper struct to derive PixelType from template parameter.
*
* T -> PixelType = T
* itk::Neighborhood<T> -> PixelType = T
* const itk::Neighborhood<T>& -> PixelType = T
* T -> PixelType = T
* const ConstNeighborhoodIterator<Image::T>& -> PixelType = T
* const ConstNeighborhoodIterator<VectorImage::T>& -> PixelType = itk::VariableLengthVector<T>
*/
template <class T> struct PixelTypeDeduction
{
......@@ -87,14 +88,22 @@ template <class T> struct PixelTypeDeduction
using PixelType = T;
};
/// Partial specialisation for itk::Neighborhood<T>
template <class T> struct PixelTypeDeduction<itk::Neighborhood<T>>
/// Partial specialisation for itk::ConstNeighborhoodIterator<Image<T>>
template <class T> struct PixelTypeDeduction<itk::ConstNeighborhoodIterator<Image<T>>>
{
static_assert(IsSuitableType<T>::value,
"T can not be used as a template parameter for Image or VectorImage classes.");
using PixelType = T;
};
/// Partial specialisation for itk::ConstNeighborhoodIterator<VectorImage<T>>
template <class T> struct PixelTypeDeduction<itk::ConstNeighborhoodIterator<VectorImage<T>>>
{
static_assert(IsSuitableType<T>::value,
"T can not be used as a template parameter for Image or VectorImage classes.");
using PixelType = itk::VariableLengthVector<T>;
};
/**
* \struct ImageTypeDeduction
* \brief Helper struct to derive ImageType from template parameter
......@@ -227,9 +236,9 @@ template <typename C, typename R, typename... T, typename TNameMap> struct Funct
*
* \tparam Functor can be any operator() (const or non-const) that matches the following:
* - Accepts any number of arguments of T,
* (const) itk::VariableLengthVector<T> (&),(const)
* itk::Neighborhood<T> (&), (const)
* itk::Neighborhood<itk::VariableLengthVector<T>> (&) with T a scalar type
* (const) itk::VariableLengthVector<T> (&),const
* itk::ConstNeighborhoodIterator<VectorImage<T>> &, (const)
* itk::ConstNeighborhoodIterator<Image<T>> & with T a scalar type
* - returns T or itk::VariableLengthVector<T>, with T a scalar type
* or returns void and has first parameter as output (i.e. T& or itk::VariableLengthVector<T>&)
*
......@@ -239,7 +248,7 @@ template <typename C, typename R, typename... T, typename TNameMap> struct Funct
*
* \param[in] the Functor to build the filter from
* \param[in] radius The size of neighborhood to use, if there is any
* itk::Neighborhood<T> in the operator() arguments.
* ConstNeighborhoodIterator<VectorImage<T>> in the operator() arguments.
* \return A ready to use OTB filter, which accepts n input image of
* type derived from the operator() arguments, and producing an image
* correpsonding to the operator() return type.
......@@ -256,9 +265,9 @@ template <typename Functor, typename TNameMap = void> auto NewFunctorFilter(Func
*
* \tparam TFunction can be any operator() (const or non-const) that matches the following:
* - Accepts any number of arguments of T,
* (const) itk::VariableLengthVector<T> (&),(const)
* itk::Neighborhood<T> (&), (const)
* itk::Neighborhood<itk::VariableLengthVector<T>> (&) with T a scalar type
* (const) itk::VariableLengthVector<T> (&),const
* itk::ConstNeighborhoodIterator<Image<T>> &, const
* itk::ConstNeighborhoodIterator<VectorImage<T>> & with T a scalar type
* - returns T or itk::VariableLengthVector<T>, with T a scalar type
* or returns void and has first parameter as output (i.e. T& or itk::VariableLengthVector<T>&)
*
......@@ -422,7 +431,7 @@ private:
* \param[in] numberOfOutputBands The number of output bands that
* this filter will return
* \param radius The size of neighborhood to use, if there is any
* itk::Neighborhood<T> in the operator() arguments.
* ConstNeighborhoodIterator in the operator() arguments.
* \return A ready to use OTB filter, which accepts n input image of
* type derived from the operator() arguments, and producing an image
* correpsonding to the operator() return type.
......
......@@ -138,7 +138,7 @@ template <typename T> struct GetProxy<itk::ConstNeighborhoodIterator<T> >
{
static decltype(auto) Get(const itk::ConstNeighborhoodIterator<T> & t)
{
return t.GetNeighborhood();
return t;
}