Commit 665b5a6b authored by Guillaume Pasero's avatar Guillaume Pasero

MRG: Merge bugfixes from branch 'release-6.2' into develop

parents c6f02268 b9ec696e
......@@ -344,8 +344,8 @@ def GetApplicationExamplePythonSnippet(app,idx,expand = False, inputpath="",outp
#app.SetParameterString(param,value)
output+= "\t" + appname + ".SetParameterString(" + EncloseString(param) + "," + EncloseString(value) + ")" + linesep
if paramtype == otbApplication.ParameterType_Empty:
app.SetParameterString(param,"1")
output+= "\t" + appname + ".SetParameterString("+EncloseString(param)+",\"1\")" + linesep
app.EnableParameter(param)
output+= "\t" + appname + ".EnableParameter("+EncloseString(param)+")" + linesep
if paramtype == otbApplication.ParameterType_Int \
or paramtype == otbApplication.ParameterType_Radius \
or paramtype == otbApplication.ParameterType_RAM:
......
This diff is collapsed.
......@@ -3,4 +3,4 @@
TEXINPUTS=$TEXINPUTS:${ITK_TEXINPUTS}
export TEXINPUTS
${LATEX_COMPILER} -file-line-error -halt-on-error "$@"
${LATEX_COMPILER} -file-line-error -halt-on-error -shell-escape "$@"
......@@ -89,7 +89,7 @@ SET(DVIPS_CONVERTER_OPTIONS -D600)
# Option for html generation
SET(TEX4HT_OPTIONS html,2,sections+)
SET(TEX4HT_OPTIONS "html,2,sections+ \"\" \"\" -shell-escape")
SET (HTML_OUTPUT "SoftwareGuide-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
# Copy RELEASE_NOTES.txt from OTB source tree to Software Guide build directory
......
......@@ -112,17 +112,17 @@ section~\ref{chapter:WriteAFilter}, page~\pageref{chapter:WriteAFilter}.
The first step is to write a persistent mean image filter. We need to
include the appropriate header :
\begin{lstlisting}
\begin{cppcode}
#include "otbPersistentImageFilter.h"
\end{lstlisting}
\end{cppcode}
Then, we declare the class prototype as follows:
\begin{lstlisting}
\begin{cppcode}
template<class TInputImage >
class ITK_EXPORT PersistentMeanImageFilter :
public PersistentImageFilter<TInputImage, TInputImage>
\end{lstlisting}
\end{cppcode}
Since the output image will only be used for streaming purpose, we do
not need to declare different input and output template types.
......@@ -131,14 +131,14 @@ In the \emph{private} section of the class, we will declare a member which
will be used to store temporary results, and a member which will be
used to store the final result.
\begin{lstlisting}
\begin{cppcode}
private:
// Temporary results container
std::vector<PixelType> m_TemporarySums;
// Final result member
double m_Mean;
\end{lstlisting}
\end{cppcode}
Next, we will write the \verb?Reset()? method implementation in the
\emph{protected} section of the class. Proper allocation of the
......@@ -146,7 +146,7 @@ temporary results container with respect to the number of threads is
handled here.
\begin{lstlisting}
\begin{cppcode}
protected:
virtual void Reset()
{
......@@ -160,13 +160,13 @@ protected:
// Reset the final result
m_Mean = 0.;
}
\end{lstlisting}
\end{cppcode}
Now, we need to write the \verb?ThreadedGenerateData()? methods (also
in the \emph{protected} section), were
temporary results will be computed for each piece of stream.
\begin{lstlisting}
\begin{cppcode}
virtual void ThreadedGenerateData(const RegionType&
outputRegionForThread, itk::ThreadIdType threadId)
{
......@@ -190,12 +190,12 @@ for (it.GoToBegin(); !it.IsAtEnd(); ++it, progress.CompletedPixel())
m_TemporarySums[threadId]+= value;
}
\end{lstlisting}
\end{cppcode}
Last, we need to define the \verb?Synthetize()? method (still in the
\emph{protected} section), which will yield the final results:
\begin{lstlisting}
\begin{cppcode}
virtual void Synthetize()
{
// For each thread
......@@ -214,7 +214,7 @@ if(nbPixels!=0)
m_Mean/=nbPixels;
}
}
\end{lstlisting}
\end{cppcode}
\subsection{Second step: Decorating the filter and using it}
......@@ -222,41 +222,41 @@ Now, to use the filter, one only has to decorate it with the
\doxygen{otb}{PersistentFilterStreamingDecorator}. First step is
to include the appropriate header:
\begin{lstlisting}
\begin{cppcode}
#include "otbPersistentMeanImageFilter.h"
#include "otbPersistentFilterStreamingDecorator.h"
\end{lstlisting}
\end{cppcode}
Then, we decorate the filter with some typedefs:
\begin{lstlisting}
\begin{cppcode}
typedef otb::PersistentMeanImageFilter<ImageType>
PersitentMeanFilterType;
typedef otb::PersistentFilterStreamingDecorator
< PersitentMeanFilterType> StreamingMeanFilterType;
\end{lstlisting}
\end{cppcode}
Now, the decorated filter can be used like any standard filter:
\begin{lstlisting}
\begin{cppcode}
StreamingMeanFilterType::Pointer filter =
StreamingMeanFilterType::New();
filter->SetInput(reader->GetOutput());
filter->Update();
\end{lstlisting}
\end{cppcode}
\subsection{Third step: one class to rule them all}
It is often convenient to avoid the few typedefs of the previous
section by deriving a new class from the decorated filter:
\begin{lstlisting}
\begin{cppcode}
template<class TInputImage >
class ITK_EXPORT StreamingMeanImageFilter :
public PersistentFilterStreamingDecorator<
PersistentImageFilter<TInputImage, TInputImage> >
\end{lstlisting}
\end{cppcode}
This also allows to redefine setters and getters for parameters,
avoiding to call the \verb?GetFilter()? method to set them.
......@@ -32,40 +32,14 @@
\definecolor{listlightgray}{gray}{0.955}
\definecolor{listwhite}{gray}{1.0}
\usepackage{listings}
\newcommand{\lstsetcpp}
{
\lstset{frame = tb,
framerule = 0.25pt,
float,
fontadjust,
backgroundcolor={\color{listlightgray}},
basicstyle = {\ttfamily\footnotesize},
keywordstyle = {\ttfamily\color{listkeyword}\textbf},
identifierstyle = {\ttfamily},
commentstyle = {\ttfamily\color{listcomment}\textit},
stringstyle = {\ttfamily},
showstringspaces = false,
showtabs = false,
numbers = none,
numbersep = 6pt,
numberstyle={\ttfamily\color{listnumbers}},
tabsize = 2,
language=[ANSI]C++,
floatplacement=!h
}
}
\newcommand{\lstsetpython}
{
\lstset{language=Python
}
}
\newcommand{\lstsetjava}
{
\lstset{language=Java
}
}
\usepackage{minted}
\newminted{cpp}{fontsize=\small}
\newminted{cmake}{fontsize=\small}
\newminted{bat}{fontsize=\small}
\usepackage{mdframed}
\BeforeBeginEnvironment{cppcode}{\begin{mdframed}[leftline=false,rightline=false,backgroundcolor=listlightgray]}
\AfterEndEnvironment{cppcode}{\end{mdframed}}
\newif\ifitkFullVersion
\itkFullVersiontrue
......@@ -170,8 +144,6 @@ colorlinks,linkcolor={blue},citecolor={blue},urlcolor={blue},
\hyperbaseurl{http://www.orfeo-toolbox.org}
\lstsetcpp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
......
......@@ -36,9 +36,7 @@ directory. The \code{CMakeLists.txt} will be very similar between your projects.
Open the \code{CMakeLists.txt} file and write in the few lines:
\begin{small}
\begin{verbatim}
\begin{cmakecode}
PROJECT(Tutorials)
cmake_minimum_required(VERSION 2.6)
......@@ -53,8 +51,7 @@ ENDIF(OTB_FOUND)
ADD_EXECUTABLE(HelloWorldOTB HelloWorldOTB.cxx )
TARGET_LINK_LIBRARIES(HelloWorldOTB ${OTB_LIBRARIES})
\end{verbatim}
\end{small}
\end{cmakecode}
The first line defines the name of your project as it appears in Visual Studio
......@@ -102,8 +99,7 @@ Follow the following steps:
\item Create a CMakeLists.txt into the src repository with the following lines:
\begin{verbatim}
\begin{cmakecode}
project(MyFirstProcessing)
cmake_minimum_required(VERSION 2.8)
......@@ -114,10 +110,11 @@ include(${OTB_USE_FILE})
add_executable(MyFirstProcessing MyFirstProcessing.cxx )
target_link_libraries(MyFirstProcessing ${OTB_LIBRARIES} )
\end{verbatim}
\end{cmakecode}
\item Create a MyFirstProcessing.cxx into the src repository with the following lines:
\begin{verbatim}
\begin{cppcode}
#include "otbImage.h"
#include "otbVectorImage.h"
#include "otbImageFileReader.h"
......@@ -151,9 +148,9 @@ int main(int argc, char* argv[])
return EXIT_SUCCESS;
}
\end{verbatim}
\end{cppcode}
\item create a file named BuildMyFirstProcessing.bat into the MyFirstCode directory with the following lines:
\begin{verbatim}
\begin{batcode}
@echo off
set /A ARGS_COUNT=0
......@@ -193,7 +190,7 @@ echo You need to run this script from an OSGeo4W shell
GOTO :END
:END
\end{verbatim}
\end{batcode}
\item into a OSGEo4W shell, run the configure.bat with the right arguments: full path to your src directory, full path to your build directory, full path to the place where find OTBConfig.cmake file (should be C:\textbackslash path\textbackslash to\textbackslash MyOTBDir\textbackslash install\textbackslash lib\textbackslash otb).
\item into the OSGeo4W shell, open the MyFirstProcessing.sln
\item build the solution
......@@ -212,12 +209,10 @@ write images and the basics of the pipeline system.
First, let's add the following lines at the end of the \code{CMakeLists.txt}
file:
\begin{small}
\begin{verbatim}
\begin{cmakecode}
ADD_EXECUTABLE(Pipeline Pipeline.cxx )
TARGET_LINK_LIBRARIES(Pipeline ${OTB_LIBRARIES})
\end{verbatim}
\end{small}
\end{cmakecode}
Now, create a \code{Pipeline.cxx} file.
......@@ -264,12 +259,10 @@ reader and the writer.
Let's first add the 2 following lines to the \code{CMakeLists.txt} file:
\begin{small}
\begin{verbatim}
\begin{cmakecode}
ADD_EXECUTABLE(FilteringPipeline FilteringPipeline.cxx )
TARGET_LINK_LIBRARIES(FilteringPipeline ${OTB_LIBRARIES})
\end{verbatim}
\end{small}
\end{cmakecode}
\input{FilteringPipeline.tex}
......@@ -303,12 +296,10 @@ To realize this conversion, we will use the
Add the two lines to the \code{CMakeLists.txt} file:
\begin{small}
\begin{verbatim}
\begin{cmakecode}
ADD_EXECUTABLE(ScalingPipeline ScalingPipeline.cxx )
TARGET_LINK_LIBRARIES(ScalingPipeline ${OTB_LIBRARIES})
\end{verbatim}
\end{small}
\end{cmakecode}
\input{ScalingPipeline}
......@@ -331,12 +322,10 @@ process multispectral images.
Add the following lines in the \code{CMakeLists.txt} file:
\begin{small}
\begin{verbatim}
\begin{cmakecode}
ADD_EXECUTABLE(Multispectral Multispectral.cxx )
TARGET_LINK_LIBRARIES(Multispectral ${OTB_LIBRARIES})
\end{verbatim}
\end{small}
\end{cmakecode}
\input{Multispectral}
......@@ -355,12 +344,10 @@ try it!
Add the following lines in the \code{CMakeLists.txt} file:
\begin{small}
\begin{verbatim}
\begin{cmakecode}
ADD_EXECUTABLE(SmarterFilteringPipeline SmarterFilteringPipeline.cxx )
TARGET_LINK_LIBRARIES(SmarterFilteringPipeline ${OTB_LIBRARIES})
\end{verbatim}
\end{small}
\end{cmakecode}
\input{SmarterFilteringPipeline}
......@@ -410,12 +397,10 @@ To get the best of the image processing algorithms, you want to combine these da
First you need to add the following lines in the \code{CMakeLists.txt} file:
\begin{small}
\begin{verbatim}
\begin{cmakecode}
ADD_EXECUTABLE(OrthoFusion OrthoFusion.cxx)
TARGET_LINK_LIBRARIES(OrthoFusion ${OTB_LIBRARIES})
\end{verbatim}
\end{small}
\end{cmakecode}
\input{OrthoFusion}
......
......@@ -248,14 +248,12 @@ in order to launch each internal application. The order should be compatible wit
image parameter connexions. If you want to do "in-memory" connexions, you can do it between
two calls to \code{ExecuteInternal()}, for instance :
\small
\begin{lstlisting}
\begin{cppcode}
ExecuteInternal("a");
GetInternalApplication("b")->SetParameterInputImage("in",
GetInternalApplication("a")->GetParameterOutputImage("out"));
ExecuteInternal("b");
\end{lstlisting}
\normalsize
\end{cppcode}
The application BundleToPerfectSensor is a simple example of composite applications.
For a more complex example, you can check the application TrainImagesClassifier.
......
......@@ -92,8 +92,7 @@ sub ParseCxxFile {
$tagfound = 1;
$dumpinglatex = 0;
$dumpingcode = 1;
print OUTFILE "\\small\n";
print OUTFILE "\\begin{lstlisting}\n";
print OUTFILE "\\begin{cppcode}\n";
}
elsif( /$endlatextag/ ) {
$tagfound = 1;
......@@ -102,8 +101,7 @@ sub ParseCxxFile {
elsif( /$endcodesnippettag/ ) {
$tagfound = 1;
$dumpingcode = 0;
print OUTFILE "\\end{lstlisting}\n";
print OUTFILE "\\normalsize\n";
print OUTFILE "\\end{cppcode}\n";
}
if( !$tagfound ) {
if( $dumpinglatex ) {
......
......@@ -4,7 +4,7 @@
TEXINPUTS=$TEXINPUTS:${ITK_TEXINPUTS}
export TEXINPUTS
mkdir ${HTML_OUTPUT}
mkdir -p ${HTML_OUTPUT}
cd ${HTML_OUTPUT}
${TEX4HT_COMPILER} "$@" ${TEX4HT_OPTIONS}
......
......@@ -120,6 +120,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>When the image width or height is lower than this minimum, overview generation is not proposed</string>
</property>
<property name="text">
<string>Minimum size:</string>
</property>
......@@ -127,6 +130,9 @@
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="overviewsSpinBox">
<property name="toolTip">
<string>When the image width or height is lower than this minimum, overview generation is not proposed</string>
</property>
<property name="maximum">
<number>999999999</number>
</property>
......
......@@ -250,6 +250,10 @@ void Application::SetParameterString(std::string parameter, std::string value, b
if ( !paramDown->SetFileName(value) )
otbAppLogCRITICAL( <<"Invalid XML parameter filename " << value <<".");
}
else
{
otbAppLogWARNING( <<"This parameter can't be set using SetParameterString().");
}
this->SetParameterUserValue(parameter, hasUserValueFlag);
}
......
......@@ -18,6 +18,55 @@
# limitations under the License.
#
function(sanitize_system_paths input_file)
# does not support Windows ...
if(APPLE)
set(SHARED_EXT "\\.dylib")
elseif(UNIX)
set(SHARED_EXT "\\.so")
endif()
set(filtered_content)
file(STRINGS "${input_file}" source_file_content NEWLINE_CONSUME)
string(REGEX REPLACE "\n" "\n;" source_file_content "${source_file_content}")
set(SEARCH_REGEX "(^[^#\"]+(LIBRARIES|INCLUDE_DIR[A-Z]*) +\")(.+)(\"[^\"]*)")
foreach(line ${source_file_content})
set(filtered_line "${line}")
if(line MATCHES "${SEARCH_REGEX}")
string(REGEX REPLACE "${SEARCH_REGEX}" "\\3" extract_str "${line}" )
string(REGEX REPLACE ";;" ";" extract_str "${extract_str}")
set(_to_be_removed)
set(_to_be_added)
foreach(path ${extract_str})
if(IS_ABSOLUTE ${path})
list(APPEND _to_be_removed "${path}")
if(NOT IS_DIRECTORY ${path})
if(path MATCHES "^.*/lib[^\\.]+${SHARED_EXT}.*")
string(REGEX REPLACE "^.*/lib([^\\.]+)${SHARED_EXT}.*" "\\1" _lib_name "${path}")
list(APPEND _to_be_added "${_lib_name}")
endif()
endif()
endif()
endforeach()
if(_to_be_removed)
list(REMOVE_ITEM extract_str ${_to_be_removed})
endif()
if(_to_be_added)
list(INSERT extract_str 0 ${_to_be_added})
endif()
if(extract_str)
list(REMOVE_DUPLICATES extract_str)
endif()
string(REGEX REPLACE "${SEARCH_REGEX}" "\\1${extract_str}\\4" filtered_line "${line}" )
endif()
list(APPEND filtered_content "${filtered_line}")
endforeach()
string(REGEX REPLACE "\n;" "\n" filtered_content "${filtered_content}")
file(WRITE "${input_file}" "${filtered_content}")
endfunction()
#check variables are set
foreach(var P_DIRS P_MATCH P_REPLACE)
if(NOT ${var})
......@@ -42,5 +91,8 @@ foreach( p_dir ${P_DIRS} )
file(WRITE "${cmake_file}" "# This file is modified by OTB after installation.
\n${cmake_file_CONTENTS}")
endif()
if(UNIX)
sanitize_system_paths(${cmake_file})
endif()
endforeach() # foreach( cmake_file
endforeach() # foreach( p_dir
OTB-v.6.2.0 - Changes since version 6.0.0 (October 4th, 2017)
OTB-v.6.2.0 - Changes since version 6.0.0 (October 26th, 2017)
----------------------------------------------------------
* Request for Changes (http://wiki.orfeo-toolbox.org/index.php/Requests_for_Changes):
......@@ -31,6 +31,7 @@ OTB-v.6.2.0 - Changes since version 6.0.0 (October 4th, 2017)
* Documentation
* 0001434: Bibliography references are not set in the Software Guide (PDF version)
* 0001400: Training applications reference documentation do not include shark parameters
* 0001471: Issue with Boolean parameter in the Python application API documentation
* Monteverdi
* 0001431: RGE Alti files inverted on Monteverdi
......@@ -41,6 +42,8 @@ OTB-v.6.2.0 - Changes since version 6.0.0 (October 4th, 2017)
* 0001449: Issues with OTB 6.1 standalone packages (Linux)
* 0001404: OTB xdk 5.10.1 is not able to compile a simple program on a Ubuntu 16.04 VM
* 0001430: building 6.0.0 fails at otbSFSTextureExtraction.cxx.o
* 0001474: OTB XDK is not working on Linux
* 0001460: Unable to compile OTB 6.2.0 RC1 with superbuild (CURL issue)
* Orfeo Toolbox (OTB)
* 0001453: Applications crash with inxml paramter (GUI mode)
......@@ -70,11 +73,16 @@ OTB-v.6.2.0 - Changes since version 6.0.0 (October 4th, 2017)
* 0001426: GUI TrainimagesClassifier resets "field name" parameter when another parameter is set
* 0001421: otbenv.bash has windows endline
* 0001402: 404 link on otb-users
* 0001469: Superbuild with Visual Studio 15 2017
* 0001464: otb_module_impl() called twice in ExternalModuleTemplate
* 0001459: Patch to fix spelling errors
* OTB-applications
* 0001441: Error in param in template otbTrainLibSVM.txx
* 0001411: Training applications needs field name of type integer
* 0001410: BundleToPerfectSensor composite application does not expose parameters of internal applications
* 0001467: Convert application memory allocation issue
* 0001463: BandMathX not accepting global statistics
OTB-v.6.0.0 - Changes since version 5.10.1 (May 2th, 2017)
......
......@@ -4611,6 +4611,10 @@ Merci d&apos;en sélectionner un autre.</translation>
<source>pixel(s)</source>
<translation>pixel(s)</translation>
</message>
<message>
<source>When the image width or height is lower than this minimum, overview generation is not proposed</source>
<translation>Lorsque la hauteur ou la largeur d&apos;une image est inférieure à ce minimum, la génération des aperçus n&apos;est pas proposée</translation>
</message>
</context>
<context>
<name>mvd::ProcessObjectObserver</name>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment