From f240f5009ce2ab3ff4e913b8d8595a05512cd890 Mon Sep 17 00:00:00 2001 From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org> Date: Mon, 24 Sep 2007 17:12:00 +0000 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20tutorial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Examples/CMakeLists.txt | 51 +++++++++++------------- Examples/Tutorials/CMakeLists.txt | 12 +++++- Examples/Tutorials/FilteringPipeline.cxx | 10 +++-- Examples/Tutorials/HelloWorldOTB.cxx | 7 ++-- Examples/Tutorials/Pipeline.cxx | 10 ++--- 5 files changed, 47 insertions(+), 43 deletions(-) diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index b5c6c91d40..2830d40926 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -1,32 +1,27 @@ -# $Id$ +PROJECT(HelloWorld) -SUBDIRS( - BasicFilters - FeatureExtraction - DataRepresentation - IO - Filtering - ChangeDetection - Learning - Classification - Segmentation - Iterators - MultiScale - DisparityMap - Registration -) +FIND_PACKAGE(OTB) +IF(OTB_FOUND) + INCLUDE(${OTB_USE_FILE}) +ELSE(OTB_FOUND) + MESSAGE(FATAL_ERROR + "Cannot build OTB project without OTB. Please set OTB_DIR.") +ENDIF(OTB_FOUND) -IF(OTB_USE_VISU) - SUBDIRS(Visu) -ENDIF(OTB_USE_VISU) +ADD_EXECUTABLE(HelloWorldOTB HelloWorldOTB.cxx ) +TARGET_LINK_LIBRARIES(HelloWorldOTB OTBCommon OTBIO) -IF(OTB_USE_PATENTED) - SUBDIRS( Patented ) -ENDIF(OTB_USE_PATENTED) +ADD_EXECUTABLE(Pipeline Pipeline.cxx ) +TARGET_LINK_LIBRARIES(Pipeline OTBCommon OTBIO) -#Recopie du fichier README.txt dans l'arborescence BINARY -IF( EXISTS ${OTB_BINARY_DIR}/Examples/README.txt ) -ELSE( EXISTS ${OTB_BINARY_DIR}/Examples/README.txt ) - CONFIGURE_FILE(${OTB_SOURCE_DIR}/Examples/README.txt - ${OTB_BINARY_DIR}/Examples/README.txt @ONLY IMMEDIATE) -ENDIF( EXISTS ${OTB_BINARY_DIR}/Examples/README.txt ) +ADD_EXECUTABLE(FilteringPipeline FilteringPipeline.cxx ) +TARGET_LINK_LIBRARIES(FilteringPipeline OTBCommon OTBIO) + +ADD_EXECUTABLE(ScalingPipeline ScalingPipeline.cxx ) +TARGET_LINK_LIBRARIES(ScalingPipeline OTBCommon OTBIO) + +ADD_EXECUTABLE(SmarterFilteringPipeline SmarterFilteringPipeline.cxx ) +TARGET_LINK_LIBRARIES(SmarterFilteringPipeline OTBCommon OTBIO) + +ADD_EXECUTABLE(SimpleViewer SimpleViewer.cxx ) +TARGET_LINK_LIBRARIES(SimpleViewer OTBCommon OTBIO OTBGui OTBVisu) \ No newline at end of file diff --git a/Examples/Tutorials/CMakeLists.txt b/Examples/Tutorials/CMakeLists.txt index f07847b7be..2830d40926 100644 --- a/Examples/Tutorials/CMakeLists.txt +++ b/Examples/Tutorials/CMakeLists.txt @@ -14,6 +14,14 @@ TARGET_LINK_LIBRARIES(HelloWorldOTB OTBCommon OTBIO) ADD_EXECUTABLE(Pipeline Pipeline.cxx ) TARGET_LINK_LIBRARIES(Pipeline OTBCommon OTBIO) -ADD_EXECUTABLE(Filtering Filtering.cxx ) -TARGET_LINK_LIBRARIES(Filtering OTBCommon OTBIO) +ADD_EXECUTABLE(FilteringPipeline FilteringPipeline.cxx ) +TARGET_LINK_LIBRARIES(FilteringPipeline OTBCommon OTBIO) +ADD_EXECUTABLE(ScalingPipeline ScalingPipeline.cxx ) +TARGET_LINK_LIBRARIES(ScalingPipeline OTBCommon OTBIO) + +ADD_EXECUTABLE(SmarterFilteringPipeline SmarterFilteringPipeline.cxx ) +TARGET_LINK_LIBRARIES(SmarterFilteringPipeline OTBCommon OTBIO) + +ADD_EXECUTABLE(SimpleViewer SimpleViewer.cxx ) +TARGET_LINK_LIBRARIES(SimpleViewer OTBCommon OTBIO OTBGui OTBVisu) \ No newline at end of file diff --git a/Examples/Tutorials/FilteringPipeline.cxx b/Examples/Tutorials/FilteringPipeline.cxx index 13f43970c4..ae1d0ae28b 100644 --- a/Examples/Tutorials/FilteringPipeline.cxx +++ b/Examples/Tutorials/FilteringPipeline.cxx @@ -23,7 +23,7 @@ // to compute the gradient of the image. The begining of the file is // similar to the Pipeline.cxx. // -// We include the required header, without forgetting to add the header +// We include the required headers, without forgetting to add the header // for the \doxygen{itk}{GradientMagnitudeImageFilter}. // // Software Guide : EndLatex @@ -49,10 +49,10 @@ int main(int argc, char ** argv) typedef otb::Image<unsigned char, 2> ImageType; typedef otb::ImageFileReader<ImageType> ReaderType; - ReaderType::Pointer reader=ReaderType::New(); + ReaderType::Pointer reader = ReaderType::New(); typedef otb::StreamingImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer=WriterType::New(); + WriterType::Pointer writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); @@ -67,9 +67,11 @@ int main(int argc, char ** argv) // // Software Guide : EndLatex + // Software Guide : BeginCodeSnippet typedef itk::GradientMagnitudeImageFilter <ImageType,ImageType> FilterType; FilterType::Pointer filter = FilterType::New(); + // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // @@ -84,7 +86,7 @@ int main(int argc, char ** argv) // Software Guide : BeginLatex // - // And finally, we trigger the pipeline execution calling the Update() + // And finally, we trigger the pipeline execution calling the \code{Update()} // method on the writer // // Software Guide : EndLatex diff --git a/Examples/Tutorials/HelloWorldOTB.cxx b/Examples/Tutorials/HelloWorldOTB.cxx index d3db26d4fd..b3d4df2bb8 100644 --- a/Examples/Tutorials/HelloWorldOTB.cxx +++ b/Examples/Tutorials/HelloWorldOTB.cxx @@ -44,11 +44,10 @@ int main() // // This code instantiates an image whose pixels are represented with // type \code{unsigned short}. The image is then constructed and assigned to a -// \doxygen{itk}{SmartPointer}. Although later in the text we will discuss -// \code{SmartPointer}'s in detail, for now think of it as a handle on an +// \doxygen{itk}{SmartPointer}. Later in the text we will discuss +// \code{SmartPointer} in detail, for now think of it as a handle on an // instance of an object (see section \ref{sec:SmartPointers} for more -// information). The \doxygen{itk}{Image} class will be described in -// Section~\ref{sec:ImageSection}. +// information). // // Software Guide : EndLatex diff --git a/Examples/Tutorials/Pipeline.cxx b/Examples/Tutorials/Pipeline.cxx index 43a5ca276d..0bd32241d8 100644 --- a/Examples/Tutorials/Pipeline.cxx +++ b/Examples/Tutorials/Pipeline.cxx @@ -18,7 +18,7 @@ // Software Guide : BeginLatex // -// Start by including some necessary header and with the +// Start by including some necessary headers and with the // usual \code{main} declaration: // // Software Guide : EndLatex @@ -35,7 +35,7 @@ int main(int argc, char ** argv) // Software Guide : BeginLatex // // Declare the image as an \doxygen{otb}{Image}, the pixel type - // is declared as an unsigned char and the image is specified as + // is declared as an unsigned char (one byte) and the image is specified as // having two dimensions. // // Software Guide : EndLatex @@ -53,7 +53,7 @@ int main(int argc, char ** argv) // Software Guide : BeginCodeSnippet typedef otb::ImageFileReader<ImageType> ReaderType; - ReaderType::Pointer reader=ReaderType::New(); + ReaderType::Pointer reader = ReaderType::New(); // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -65,13 +65,13 @@ int main(int argc, char ** argv) // Software Guide : BeginCodeSnippet typedef otb::StreamingImageFileWriter<ImageType> WriterType; - WriterType::Pointer writer=WriterType::New(); + WriterType::Pointer writer = WriterType::New(); // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // // The filenames are passed as arguments to the program. We keep it - // simple and we don't check their validity. + // simple for now and we don't check their validity. // // Software Guide : EndLatex -- GitLab