From 6bf863699a4bdb128f19fb04b74ba301a092937f Mon Sep 17 00:00:00 2001
From: Otmane Lahlou <otmane.lahlou@c-s.fr>
Date: Tue, 9 Nov 2010 17:45:04 +0100
Subject: [PATCH] COMP : correct the test due to class changes

---
 .../otbDescriptorsListSampleGenerator.cxx           | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/Testing/Code/ObjectDetection/otbDescriptorsListSampleGenerator.cxx b/Testing/Code/ObjectDetection/otbDescriptorsListSampleGenerator.cxx
index 9787d8d669..2ee817950c 100644
--- a/Testing/Code/ObjectDetection/otbDescriptorsListSampleGenerator.cxx
+++ b/Testing/Code/ObjectDetection/otbDescriptorsListSampleGenerator.cxx
@@ -26,9 +26,11 @@
 #include "otbRadiometricMomentsImageFunction.h"
 #include "itkListSample.h"
 #include "itkFixedArray.h"
+#include "itkVariableLengthVector.h"
 #include "otbDescriptorsListSampleGenerator.h"
 #include "otbImageFileReader.h"
 #include "otbVectorDataFileReader.h"
+#include "otbImageFunctionAdapter.h"
 
 const unsigned int Dimension = 2;
 typedef int        LabelType;
@@ -39,10 +41,13 @@ typedef double     CoordRepType;
 typedef otb::Image<PixelType, Dimension>                              ImageType;
 typedef otb::VectorData<>                                             VectorDataType;
 typedef otb::RadiometricMomentsImageFunction<ImageType, CoordRepType> FunctionType;
+  typedef otb::ImageFunctionAdapter
+    <ImageType,FunctionType>                                          AdapatedFunctionType;
 
-typedef FunctionType::OutputType                        SampleType;
+//typedef FunctionType::OutputType                      SampleType;
+typedef itk::VariableLengthVector<CoordRepType>         SampleType;
 typedef itk::Statistics::ListSample<SampleType>         ListSampleType;
-typedef itk::FixedArray<LabelType, 1>                   LabelSampleType;
+typedef itk::FixedArray<LabelType>                      LabelSampleType;
 typedef itk::Statistics::ListSample<LabelSampleType>    LabelListSampleType;
 
 typedef otb::DescriptorsListSampleGenerator
@@ -127,9 +132,9 @@ int otbDescriptorsListSampleGenerator(int argc, char* argv[])
   //imageReader->Update();
   //vectorDataReader->Update();
 
-  FunctionType::Pointer descriptorsFunction = FunctionType::New();
+  AdapatedFunctionType::Pointer descriptorsFunction = AdapatedFunctionType::New();
   descriptorsFunction->SetInputImage(imageReader->GetOutput());
-  descriptorsFunction->SetNeighborhoodRadius(5);
+  descriptorsFunction->GetImageFunction()->SetNeighborhoodRadius(5);
 
   DescriptorsListSampleGeneratorType::Pointer descriptorsGenerator = DescriptorsListSampleGeneratorType::New();
   descriptorsGenerator->SetInputImage(imageReader->GetOutput());
-- 
GitLab