From f9f4ad300552e2dea8946ffcbecdbc3ebc745d22 Mon Sep 17 00:00:00 2001
From: Jordi Inglada <jordi.inglada@orfeo-toolbox.org>
Date: Fri, 3 Oct 2008 14:35:33 +0200
Subject: [PATCH] TEST: Added test (Tu) for MIRegistrationFilter

---
 Testing/Code/DisparityMap/CMakeLists.txt      |  7 +++
 .../DisparityMap/otbDisparityMapTests1.cxx    |  3 +-
 .../otbMIRegistrationFilterNew.cxx            | 46 +++++++++++++++++++
 3 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 Testing/Code/DisparityMap/otbMIRegistrationFilterNew.cxx

diff --git a/Testing/Code/DisparityMap/CMakeLists.txt b/Testing/Code/DisparityMap/CMakeLists.txt
index fe3b99d35b..6b745eaa73 100644
--- a/Testing/Code/DisparityMap/CMakeLists.txt
+++ b/Testing/Code/DisparityMap/CMakeLists.txt
@@ -61,6 +61,12 @@ ADD_TEST(dmTvNearestPointDeformationFieldGenerator ${DISPARITYMAP_TESTS1}
 ADD_TEST(dmTuNCCRegistrationFilterNew ${DISPARITYMAP_TESTS1} 
 	 otbNCCRegistrationFilterNew)
 
+# -------            otb::MIRegistrationFilter   ----------
+
+ADD_TEST(dmTuMIRegistrationFilterNew ${DISPARITYMAP_TESTS1} 
+	 otbMIRegistrationFilterNew)
+
+       
 # -------  otb::NNearestPointsLinearInterpolateDeformationFieldGenerator   ----------
 
 ADD_TEST(dmTuNNearestPointsLinearInterpolateDeformationFieldGeneratorNew ${DISPARITYMAP_TESTS1} 
@@ -310,6 +316,7 @@ SET(BasicDisparityMap_SRCS1
 otbDisparityMapEstimationMethodNew.cxx
 otbDisparityMapEstimationMethod.cxx
 otbNCCRegistrationFilterNew.cxx
+otbMIRegistrationFilterNew.cxx
 otbPointSetToDeformationFieldGeneratorNew.cxx
 otbNearestPointDeformationFieldGeneratorNew.cxx
 otbNearestPointDeformationFieldGenerator.cxx
diff --git a/Testing/Code/DisparityMap/otbDisparityMapTests1.cxx b/Testing/Code/DisparityMap/otbDisparityMapTests1.cxx
index aabc0c414f..82515423c0 100644
--- a/Testing/Code/DisparityMap/otbDisparityMapTests1.cxx
+++ b/Testing/Code/DisparityMap/otbDisparityMapTests1.cxx
@@ -36,5 +36,6 @@ REGISTER_TEST(otbNNearestPointsLinearInterpolateDeformationFieldGenerator);
 REGISTER_TEST(otbBSplinesInterpolateDeformationFieldGeneratorNew);
 REGISTER_TEST(otbBSplinesInterpolateDeformationFieldGenerator);
 REGISTER_TEST(otbPointSetWithTransformToDeformationFieldGeneratorNew);
-REGISTER_TEST(otbNCCRegistrationFilterNew); 
+REGISTER_TEST(otbNCCRegistrationFilterNew);
+REGISTER_TEST(otbMIRegistrationFilterNew);  
 }
diff --git a/Testing/Code/DisparityMap/otbMIRegistrationFilterNew.cxx b/Testing/Code/DisparityMap/otbMIRegistrationFilterNew.cxx
new file mode 100644
index 0000000000..c172705eac
--- /dev/null
+++ b/Testing/Code/DisparityMap/otbMIRegistrationFilterNew.cxx
@@ -0,0 +1,46 @@
+/*=========================================================================
+
+  Program:   ORFEO Toolbox
+  Language:  C++
+  Date:      $Date$
+  Version:   $Revision$
+
+
+  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
+  See OTBCopyright.txt for details.
+
+
+  This software is distributed WITHOUT ANY WARRANTY; without even 
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+  PURPOSE.  See the above copyright notices for more information.
+
+=========================================================================*/
+#include "otbMIRegistrationFilter.h"
+#include "otbImage.h"
+
+int otbMIRegistrationFilterNew(int argc, char* argv[])
+{
+  const unsigned int ImageDimension = 2;
+
+  typedef double                                PixelType;
+  typedef itk::Vector<double,ImageDimension>    DeformationPixelType;
+
+  typedef double                   CoordinateRepresentationType;
+
+  //Allocate Images
+  typedef otb::Image<PixelType,ImageDimension>         MovingImageType;
+  typedef otb::Image<PixelType,ImageDimension>         FixedImageType;
+  typedef otb::Image<DeformationPixelType,
+                               ImageDimension>         DeformationFieldType;
+
+  //Create the filter
+  typedef otb::MIRegistrationFilter< FixedImageType, 
+                                       MovingImageType,
+                                       DeformationFieldType >
+                                           RegistrationFilterType;
+
+  // Instantiation
+  RegistrationFilterType::Pointer registrator = RegistrationFilterType::New();
+  
+ return EXIT_SUCCESS;
+}
-- 
GitLab