]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/GulsunTekMedialness.h
...
[cpPlugins.git] / lib / cpExtensions / Algorithms / GulsunTekMedialness.h
index 2fdf61cedc78d02320b39a520b169d7c8903a614..15add9eacd806149d0b399f32cc60a1d8c5e2b7a 100644 (file)
@@ -1,12 +1,7 @@
-// -------------------------------------------------------------------------
-// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
-// -------------------------------------------------------------------------
-
 #ifndef __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__H__
 #define __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__H__
 
-#include <vector>
-#include <cpExtensions/Algorithms/GradientFunctionBase.h>
+#include <cpExtensions/Algorithms/GradientImageFunctionBase.h>
 
 namespace cpExtensions
 {
@@ -14,35 +9,31 @@ namespace cpExtensions
   {
     /**
      */
-    template< class G >
+    template< class _TGradient, class _TMask = itk::Image< unsigned char, _TGradient::ImageDimension > >
     class GulsunTekMedialness
-      : public GradientFunctionBase< G >
+      : public GradientImageFunctionBase< _TGradient, _TMask >
     {
     public:
-      // Standard itk types
-      typedef GulsunTekMedialness             Self;
-      typedef GradientFunctionBase< G >       Superclass;
-      typedef itk::SmartPointer< Self >       Pointer;
-      typedef itk::SmartPointer< const Self > ConstPointer;
-
-      // Types from superclass
-      typedef typename Superclass::TGradient  TGradient;
-      typedef typename Superclass::TVector    TVector;
-      typedef typename Superclass::TScalar    TScalar;
-      typedef typename Superclass::TInput     TInput;
-      typedef typename Superclass::TOutput    TOutput;
-      typedef typename Superclass::TPoint     TPoint;
-      typedef typename Superclass::TContIndex TContIndex;
-      typedef typename Superclass::TIndex     TIndex;
-      typedef typename Superclass::TBuffer    TBuffer;
-
-      typedef typename TIndex::OffsetType TOffset;
-      typedef std::vector< double >       TProfile;
-      typedef std::vector< TOffset >      TOffsets;
+      typedef GulsunTekMedialness                             Self;
+      typedef GradientImageFunctionBase< _TGradient, _TMask > Superclass;
+      typedef itk::SmartPointer< Self >                       Pointer;
+      typedef itk::SmartPointer< const Self >                 ConstPointer;
+
+      itkStaticConstMacro( Dimension, unsigned int, Superclass::Dimension );
+
+      typedef typename Superclass::TOutput TOutput;
+      typedef typename Superclass::TScalar TScalar;
+      typedef typename Superclass::TIndex  TIndex;
+      typedef typename Superclass::TVector TVector;
+      typedef typename Superclass::TPoint  TPoint;
+      typedef typename TIndex::OffsetType  TOffset;
+
+      typedef std::vector< double >  TProfile;
+      typedef std::vector< TOffset > TOffsets;
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( GulsunTekMedialness, GradientFunctionBase );
+      itkTypeMacro( GulsunTekMedialness, GradientImageFunctionBase );
 
       itkGetConstMacro( MinRadius, double );
       itkGetConstMacro( MaxRadius, double );
@@ -58,7 +49,7 @@ namespace cpExtensions
       GulsunTekMedialness( );
       virtual ~GulsunTekMedialness( );
 
-      virtual TOutput _Evaluate( const TIndex& i ) const;
+      virtual TOutput _Evaluate( const TIndex& i ) const cpExtensions_OVERRIDE;
 
     private:
       // Purposely not implemented.
@@ -77,7 +68,7 @@ namespace cpExtensions
 } // ecapseman
 
 #ifndef ITK_MANUAL_INSTANTIATION
-#include <cpExtensions/Algorithms/GulsunTekMedialness.hxx>
+#  include <cpExtensions/Algorithms/GulsunTekMedialness.hxx>
 #endif // ITK_MANUAL_INSTANTIATION
 
 #endif // __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__H__