diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index b5c6c91d4080a314458afcf37308fc8b5f24278e..2830d4092675283cf0beb0506b2d1f22f321ff61 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 f07847b7be2865e219c6b571e42020383a29b735..2830d4092675283cf0beb0506b2d1f22f321ff61 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 13f43970c475b8afb0f44b7adf7593abaa772bf0..ae1d0ae28b4cc89a9777e0611ab9a2edda40e64d 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 d3db26d4fd77568f383bdbd44d5e35a2b59462b0..b3d4df2bb8de5e6e8dc6cf94e1c608152b1b230d 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 43a5ca276d2c0acc2352b80270de1f7a019b1ae8..0bd32241d850df6890dbc7000bd44b0a05049618 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