+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
#ifndef __fpa__Image__MoriRegionGrow__h__
#define __fpa__Image__MoriRegionGrow__h__
-#include <itkImageToImageFilter.h>
-#include <itkBinaryThresholdImageFilter.h>
-#include <fpa/Image/MoriRegionGrowHelper.h>
+#include <fpa/Base/MoriRegionGrow.h>
+#include <fpa/Base/SeedsInterface.h>
+#include <fpa/Image/MarksInterface.h>
+#include <fpa/Image/Filter.h>
namespace fpa
{
{
/**
*/
- template< class _TInputImage, class _TOutputImage, class _TAuxPixel = unsigned short >
+ template< class _TInputImage, class _TOutputImage >
class MoriRegionGrow
- : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
+ : public fpa::Base::MoriRegionGrow< fpa::Image::Filter< _TInputImage, _TOutputImage >, fpa::Image::MarksInterface< _TInputImage::ImageDimension >, fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare > >
{
public:
- typedef MoriRegionGrow Self;
- typedef itk::ImageToImageFilter< _TInputImage, _TOutputImage > Superclass;
- typedef itk::SmartPointer< Self > Pointer;
- typedef itk::SmartPointer< const Self > ConstPointer;
-
- typedef itk::Image< _TAuxPixel, _TInputImage::ImageDimension > TAuxImage;
- typedef fpa::Image::MoriRegionGrowHelper< _TInputImage, TAuxImage > THelper;
- typedef itk::BinaryThresholdImageFilter< TAuxImage, _TOutputImage > TThreshold;
+ // Interfaces
+ typedef fpa::Image::Filter< _TInputImage, _TOutputImage > TFilter;
+ typedef fpa::Image::MarksInterface< _TInputImage::ImageDimension > TMarksInterface;
+ typedef fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare > TSeedsInterface;
- typedef typename _TInputImage::IndexType TIndex;
- typedef typename _TInputImage::PixelType TInputPixel;
- typedef typename _TOutputImage::PixelType TOutputPixel;
+ // Smart pointers
+ typedef MoriRegionGrow Self;
+ typedef fpa::Base::MoriRegionGrow< TFilter, TMarksInterface, TSeedsInterface > Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
public:
itkNewMacro( Self );
- itkTypeMacro( fpa::Image::MoriRegionGrow, itk::ImageToImageFilter );
-
- itkGetConstMacro( Seed, TIndex );
- itkSetMacro( Seed, TIndex );
-
- public:
- TAuxImage* GetAuxiliaryImage( );
- const TAuxImage* GetAuxiliaryImage( ) const;
-
- TInputPixel GetLower( ) const;
- TInputPixel GetUpper( ) const;
- TInputPixel GetStep( ) const;
- TOutputPixel GetInsideValue( ) const;
- TOutputPixel GetOutsideValue( ) const;
-
- void SetLower( const TInputPixel& v );
- void SetUpper( const TInputPixel& v );
- void SetStep( const TInputPixel& v );
- void SetInsideValue( const TOutputPixel& v );
- void SetOutsideValue( const TOutputPixel& v );
-
-
- /* TODO
- itkGetConstMacro( Lower, TPixel );
- itkGetConstMacro( Upper, TPixel );
- itkGetConstMacro( Step, TPixel );
- itkGetConstMacro( Sensitivity, double );
- itkSetMacro( Lower, TPixel );
- itkSetMacro( Upper, TPixel );
- itkSetMacro( Step, TPixel );
- itkSetMacro( Sensitivity, double );
- */
+ itkTypeMacro( fpa::Image::MoriRegionGrow, fpa::Base::MoriRegionGrow );
protected:
- MoriRegionGrow( );
- virtual ~MoriRegionGrow( );
-
- virtual void GenerateData( ) override;
+ MoriRegionGrow( ) : Superclass( ) { }
+ virtual ~MoriRegionGrow( ) { }
private:
- // Purposely not defined
MoriRegionGrow( const Self& other );
Self& operator=( const Self& other );
-
- protected:
- typename THelper::Pointer m_Helper;
- typename TThreshold::Pointer m_Threshold;
- TIndex m_Seed;
};
} // ecapseman
} // ecapseman
-#ifndef ITK_MANUAL_INSTANTIATION
-# include <fpa/Image/MoriRegionGrow.hxx>
-#endif // ITK_MANUAL_INSTANTIATION
-
#endif // __fpa__Image__MoriRegionGrow__h__
// eof - $RCSfile$