diff --git a/Code/IO/otbDEMToImageGenerator.h b/Code/IO/otbDEMToImageGenerator.h
index e064699befd72628d770f836ff5ffe49436eb4c5..b3b8c703049521933bd21aa5a5c628c2e048d7e9 100644
--- a/Code/IO/otbDEMToImageGenerator.h
+++ b/Code/IO/otbDEMToImageGenerator.h
@@ -78,7 +78,8 @@ public:
 
   typedef itk::FunctionBase< PointType, PixelType>         DEMFunctionBaseType;
   typedef typename DEMFunctionBaseType::Pointer            DEMFunctionBasePointer;
-  typedef otb::ElevDatabaseHeightAboveMSLFunction<DEMImageType,typename PointType::ValueType>    SRTMFunctionType;
+  typedef otb::ElevDatabaseHeightAboveMSLFunction<PixelType,
+                        typename PointType::ValueType>     SRTMFunctionType;
 
   /** Method for creation through the object factory. */
   itkNewMacro(Self);
@@ -193,7 +194,7 @@ protected:
   SizeType                m_OutputSize;
   PixelType               m_DefaultUnknownValue;
 
-  typename DEMFunctionBaseType::Pointer m_DEMFunction;
+  DEMFunctionBasePointer  m_DEMFunction;
 
 private:
   DEMToImageGenerator(const Self &); //purposely not implemented
diff --git a/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.h b/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.h
index 6f511874d6dc4b11a18200f4965141a5713f4862..ccd5053eb59bfd5991c683c020755ed3a8795a4b 100644
--- a/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.h
+++ b/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.h
@@ -39,25 +39,22 @@ namespace otb
  * \ingroup ImageFunctions
  */
 template <
-class TOutput,
-class TCoordRep = float
+class TOutputPixel,
+class TCoordRep = float,
+unsigned int NPointDimension=2
 >
 class ElevDatabaseHeightAboveMSLFunction :
-    public itk::FunctionBase< itk::Point<TCoordRep,
-                               ::itk::GetImageDimension<TOutput>::ImageDimension>,
-                       typename TOutput::PixelType >
+    public itk::FunctionBase< itk::Point<TCoordRep, NPointDimension>,
+                              TOutputPixel >
 {
 public:
-    /** Dimension underlying input image. */
-    itkStaticConstMacro(ImageDimension, unsigned int,
-                        TOutput::ImageDimension);
-
+    /** Dimension of the Space */
+    itkStaticConstMacro(PointDimension, unsigned int, NPointDimension);
 
     /** Standard class typedefs. */
-  typedef ElevDatabaseHeightAboveMSLFunction                            Self;
+  typedef ElevDatabaseHeightAboveMSLFunction                    Self;
   typedef itk::FunctionBase<
-    itk::Point<TCoordRep, itkGetStaticConstMacro(ImageDimension)>,
-    TOutput >                                                   Superclass;
+      itk::Point<TCoordRep, NPointDimension>, TOutputPixel >    Superclass;
   typedef itk::SmartPointer<Self>                               Pointer;
   typedef itk::SmartPointer<const Self>                         ConstPointer;
 
@@ -67,24 +64,19 @@ public:
   /** Method for creation through the object factory. */
   itkNewMacro(Self);
 
-  /** OutputType typedef support. */
-  typedef TOutput OutputImageType;
-
-  /** InputPixel typedef support */
-  typedef typename OutputImageType::PixelType PixelType;
-
-  /** InputImagePointer typedef support */
-  typedef typename OutputImageType::ConstPointer ImageConstPointer;
+  /** Output Pixel typedef support */
+  typedef TOutputPixel   PixelType;
 
   /** CoordRepType typedef support. */
   typedef TCoordRep CoordRepType;
 
-  /** Index Type. */
-  typedef typename OutputImageType::IndexType      IndexType;
-  typedef typename OutputImageType::IndexValueType IndexValueType;
-
   /** Point Type. */
-  typedef itk::Point<TCoordRep,itkGetStaticConstMacro(ImageDimension)> PointType;
+  typedef itk::Point<TCoordRep,NPointDimension>    PointType;
+
+  /** Get the dimension (size) of the point. */
+  static unsigned int GetPointDimension()
+    { return NPointDimension; }
+
 
   /** Set the Elev Manager to the function. */
   virtual void SetElevManager(ossimElevManager * ptr )
diff --git a/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.txx b/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.txx
index 884463aa81b376f9ed50afd5d2fd23887bcd0dff..e4340233b761dc93252a7edf525433321710b7b2 100644
--- a/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.txx
+++ b/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.txx
@@ -37,8 +37,8 @@ namespace otb
 /**
  * Constructor
  */
-template <class TOutput, class TCoordRep>
-ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
+template <class TOutputPixel, class TCoordRep, unsigned int NPointDimension>
+ElevDatabaseHeightAboveMSLFunction<TOutputPixel, TCoordRep, NPointDimension>
 ::ElevDatabaseHeightAboveMSLFunction() :
      m_ElevManager(ossimElevManager::instance())
 {
@@ -51,9 +51,9 @@ ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
 /**
  * Standard "PrintSelf" method
  */
-template <class TOutput, class TCoordRep>
+template <class TOutputPixel, class TCoordRep, unsigned int NPointDimension>
 void
-ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
+ElevDatabaseHeightAboveMSLFunction<TOutputPixel, TCoordRep, NPointDimension>
 ::PrintSelf(
   std::ostream& os,
   itk::Indent indent) const
@@ -65,9 +65,9 @@ ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
 /**
  *
  */
-template <class TOutput, class TCoordRep>
-typename ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>::PixelType
-ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
+template <class TOutputPixel, class TCoordRep, unsigned int NPointDimension>
+typename ElevDatabaseHeightAboveMSLFunction<TOutputPixel, TCoordRep, NPointDimension>::PixelType
+ElevDatabaseHeightAboveMSLFunction<TOutputPixel, TCoordRep, NPointDimension>
 ::Evaluate(const PointType& point) const
 {
   double   height;
@@ -88,9 +88,9 @@ ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
 
 }
 
-template <class TOutput, class TCoordRep>
+template <class TOutputPixel, class TCoordRep, unsigned int NPointDimension>
 void
-ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
+ElevDatabaseHeightAboveMSLFunction<TOutputPixel, TCoordRep, NPointDimension>
 ::OpenDEMDirectory(const char* DEMDirectory)
 {
   ossimFilename ossimDEMDir;
@@ -102,9 +102,9 @@ ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
     }
 }
 
-template <class TOutput, class TCoordRep>
+template <class TOutputPixel, class TCoordRep, unsigned int NPointDimension>
 void
-ElevDatabaseHeightAboveMSLFunction<TOutput, TCoordRep>
+ElevDatabaseHeightAboveMSLFunction<TOutputPixel, TCoordRep, NPointDimension>
 ::SetDefaultHeightAboveEllipsoid(double h)
 {
   m_ElevManager->setDefaultHeightAboveEllipsoid(h);
diff --git a/Testing/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.cxx b/Testing/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.cxx
index b22d9f1b90e09963c4f13a4e93b6c6ab94bbbbb6..840e53abc207014b5b3210bba4641ab9f8029e14 100644
--- a/Testing/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.cxx
+++ b/Testing/Code/Projections/otbElevDatabaseHeightAboveMSLFunction.cxx
@@ -22,8 +22,7 @@
 
 int otbElevDatabaseHeightAboveMSLFunction(int argc, char* argv[])
 {
-  typedef otb::Image<float,2>                          ImageType;
-  typedef otb::ElevDatabaseHeightAboveMSLFunction<ImageType>   SrtmFunctionType;
+  typedef otb::ElevDatabaseHeightAboveMSLFunction<float>   SrtmFunctionType;
 
   SrtmFunctionType::Pointer srtmDem;