+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
#ifndef __fpa__Image__RegionGrow__h__
#define __fpa__Image__RegionGrow__h__
-#include <fpa/Base/RegionGrow.h>
-#include <fpa/Image/Algorithm.h>
+#include <itkImageToImageFilter.h>
+#include <itkFunctionBase.h>
+#include <set>
namespace fpa
{
*/
template< class _TInputImage, class _TOutputImage >
class RegionGrow
- : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TInputImage, _TOutputImage > >
+ : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
{
public:
- typedef fpa::Image::Algorithm< _TInputImage, _TOutputImage > TAlgorithm;
- typedef RegionGrow Self;
- typedef fpa::Base::RegionGrow< TAlgorithm > Superclass;
- typedef itk::SmartPointer< Self > Pointer;
- typedef itk::SmartPointer< const Self > ConstPointer;
+ typedef _TInputImage TInputImage;
+ typedef _TOutputImage TOutputImage;
+
+ typedef RegionGrow Self;
+ typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef typename TInputImage::IndexType TIndex;
+ typedef typename TInputImage::RegionType TRegion;
+ typedef typename TInputImage::PixelType TInputPixel;
+ typedef typename TOutputImage::PixelType TOutputPixel;
- typedef typename Superclass::TOutput TOutput;
- typedef typename Superclass::TVertex TVertex;
+ typedef itk::FunctionBase< TInputPixel, bool > TIntensityFunctor;
- typedef fpa::Image::Functors::Base< _TInputImage, typename Superclass::TGrowFunction > TGrowFunction;
+ typedef std::set< TIndex, typename TIndex::LexicographicCompare > TSeeds;
public:
itkNewMacro( Self );
- itkTypeMacro( fpa::Image::RegionGrow, fpa::Base::RegionGrow );
+ itkTypeMacro( fpa::Image::RegionGrow, itk::ImageToImageFilter );
+
+ itkGetConstMacro( InsideValue, TOutputPixel );
+ itkGetConstMacro( OutsideValue, TOutputPixel );
+
+ itkSetMacro( InsideValue, TOutputPixel );
+ itkSetMacro( OutsideValue, TOutputPixel );
+
+ public:
+ void SetPredicate( TIntensityFunctor* functor );
+
+ void AddSeed( const TIndex& seed );
protected:
RegionGrow( );
virtual ~RegionGrow( );
- virtual void _BeforeGenerateData( ) override;
+ virtual void GenerateInputRequestedRegion( ) override;
+ virtual void EnlargeOutputRequestedRegion(
+ itk::DataObject* output
+ ) override;
+ virtual void GenerateData( ) override;
private:
- // Purposely not defined
+ // Purposely not implemented
RegionGrow( const Self& other );
Self& operator=( const Self& other );
+
+ protected:
+ typename TIntensityFunctor::Pointer m_IntensityFunctor;
+ TSeeds m_Seeds;
+ TOutputPixel m_InsideValue;
+ TOutputPixel m_OutsideValue;
};
} // ecapseman