From a404fd965015578479b8f1500bb5912d14c91d6f Mon Sep 17 00:00:00 2001
From: Jordi Inglada <jordi.inglada@orfeo-toolbox.org>
Date: Mon, 3 Jul 2006 07:04:03 +0000
Subject: [PATCH] Exemple watershed

---
 Code/CMakeLists.txt                             | 3 ++-
 Examples/Segmentation/CMakeLists.txt            | 3 ++-
 Examples/Segmentation/WatershedSegmentation.cxx | 7 +++++--
 Examples/Visu/VisuExample1.cxx                  | 2 +-
 otbIncludeDirectories.cmake                     | 1 +
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Code/CMakeLists.txt b/Code/CMakeLists.txt
index 074a10c1f2..14ae9c84d4 100644
--- a/Code/CMakeLists.txt
+++ b/Code/CMakeLists.txt
@@ -1 +1,2 @@
-SUBDIRS(Common BasicFilters IO ChangeDetection FeatureExtraction Learning Visu)
+SUBDIRS(Common BasicFilters IO ChangeDetection FeatureExtraction
+Learning Visu Segmentation)
diff --git a/Examples/Segmentation/CMakeLists.txt b/Examples/Segmentation/CMakeLists.txt
index 85a49620e9..e7b90e4b59 100644
--- a/Examples/Segmentation/CMakeLists.txt
+++ b/Examples/Segmentation/CMakeLists.txt
@@ -74,7 +74,8 @@ TARGET_LINK_LIBRARIES(FastMarchingImageFilter OTBCommon OTBIO ITKNumerics ITKIO)
 #TARGET_LINK_LIBRARIES(CurvesLevelSetImageFilter ITKNumerics ITKIO)
 
 ADD_EXECUTABLE(WatershedSegmentation WatershedSegmentation.cxx )
-TARGET_LINK_LIBRARIES(WatershedSegmentation OTBCommon OTBIO ITKAlgorithms ITKNumerics ITKIO)
+TARGET_LINK_LIBRARIES(WatershedSegmentation OTBCommon OTBIO
+OTBSegmentation ITKAlgorithms ITKNumerics ITKIO)
 
 
 #ADD_EXECUTABLE(SegmentationExamples SegmentationExamples.cxx )
diff --git a/Examples/Segmentation/WatershedSegmentation.cxx b/Examples/Segmentation/WatershedSegmentation.cxx
index 6e63db5b91..a9b271cc97 100644
--- a/Examples/Segmentation/WatershedSegmentation.cxx
+++ b/Examples/Segmentation/WatershedSegmentation.cxx
@@ -97,7 +97,10 @@ int main( int argc, char *argv[] )
   // vector-valued data and the segmentation is done using floating point
   // scalar data.  Images are converted from RGB pixel type to
   // numerical vector type using \doxygen{VectorCastImageFilter}.
-  //\textbf{FIXME: otbImage}
+  // Please pay attention to the fact that we are using
+  // \doxygen{itk::Image}s since the
+  // \doxygen{itk::VectorGradientMagnitudeImageFilter} has some
+  // internal typedefs which make polymorfism impossible.
   // Software Guide : EndLatex
 
   // Software Guide : BeginCodeSnippet
@@ -122,7 +125,7 @@ int main( int argc, char *argv[] )
     CastFilterType;
   typedef itk::VectorGradientAnisotropicDiffusionImageFilter<VectorImageType,
     VectorImageType>  DiffusionFilterType;
-  typedef itk::VectorGradientMagnitudeImageFilter<VectorImageType>
+  typedef itk::VectorGradientMagnitudeImageFilter<VectorImageType,float,ScalarImageType>
     GradientMagnitudeFilterType; 
   typedef itk::WatershedImageFilter<ScalarImageType> WatershedFilterType;
   // Software Guide : EndCodeSnippet
diff --git a/Examples/Visu/VisuExample1.cxx b/Examples/Visu/VisuExample1.cxx
index 4977e013a4..06826c6250 100644
--- a/Examples/Visu/VisuExample1.cxx
+++ b/Examples/Visu/VisuExample1.cxx
@@ -53,7 +53,7 @@ int main( int argc, char ** argv )
   // We will build a very simple pipeline where a reader gets an image
   // from a file and gives it to the viewer. We define the types for
   // the pixel, the image and the reader. The viewer class is templated
-  // over the scalar component of the pixel type.
+  // over the scalar component of the pixel type. 
   //
   // Software Guide : EndLatex
 
diff --git a/otbIncludeDirectories.cmake b/otbIncludeDirectories.cmake
index f908ad78d6..90e8805e3e 100644
--- a/otbIncludeDirectories.cmake
+++ b/otbIncludeDirectories.cmake
@@ -16,6 +16,7 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
   ${OTB_SOURCE_DIR}/Code/FeatureExtraction
   ${OTB_SOURCE_DIR}/Code/Learning
   ${OTB_SOURCE_DIR}/Code/Visu
+  ${OTB_SOURCE_DIR}/Code/Segmentation  
 )
 
 #-----------------------------------------------------------------------------
-- 
GitLab