#ifndef RANGECUDAMEDIANIMAGEFILTER_H__
#define RANGECUDAMEDIANIMAGEFILTER_H__

#include "ritkRImageFilterWrapper.h"
#include "CUDAMedianImageFilter.h"

/**	@class	RangeCUDAMedianImageFilter
 *	@author	Jakob Wasza
 *	@brief	range wrapper class for the CUDAMedianImageFilter
 *	
 *	@details
 *	This is a range filter wrapper class for the CUDAMedianImageFilter
 *	@sa CUDAMedianImageFilter
 */
template <class TRImage>
class RangeCUDAMedianImageFilter : public ritk::RImageFilterWrapper<TRImage>
{
public:
	/** @name	Typedefs */
	//@{

	/** @name	Standard typedefs */
	//@{
	typedef RangeCUDAMedianImageFilter		Self;
	typedef ritk::RImageFilterWrapper<TRImage>		Superclass;
	typedef itk::SmartPointer<Self>					Pointer;
	typedef itk::SmartPointer<const Self>			ConstPointer;
	//@}

	/**	@name	Input and output typedefs */
	//@{
	typedef typename Superclass::InputImageType		InputImageType;
	typedef typename InputImageType::Pointer		InputImagePointer;
	typedef typename InputImageType::ConstPointer	InputImageConstPointer;
	typedef typename Superclass::OutputImageType	OutputImageType;
	typedef typename OutputImageType::Pointer		OutputImagePointer;
	//@}

	//@}

	/// Object creation
	itkNewMacro(Self);

	/// RTTI
	itkTypeMacro(RangeCUDAMedianImageFilter, RImageFilterWrapper);

	/**	@brief	Set the kernel radius
	 *	@param	Radius	The radius
	 *
	 *	@details
	 *	Will set the radius of the kernel. For a given radius
	 *	the actual kernel will be a quadratic window
	 *	with (2*Radius+1)^2 elements.
	 */
	void SetKernelRadius(unsigned int Radius);


	/**	@brief	Get the kernel radius
	 *	@return	The kernel radius
	 *
	 *	@details
	 *	Will return the current kernel radius
	 */
	unsigned int GetKernelRadius();

protected:
	/// Constructor
	RangeCUDAMedianImageFilter();
	/// Destructor
	~RangeCUDAMedianImageFilter();

	/// Filtering routine
	void DoFiltering();

protected:
	/// The size of the kernel radius
	unsigned int m_KernelRadius;

	/**	@name Typedefs for the filters */
	//@{
	typedef CUDAMedianImageFilter<typename InputImageType::RangeImageType,typename OutputImageType::RangeImageType>  RangeFilterType;
	typedef typename RangeFilterType::Pointer RangeFilterPointer;
	RangeFilterPointer m_RangeFilter;
	//@}

private:
	/// purposely not implemented
	RangeCUDAMedianImageFilter(Self&); 
	/// purposely not implemented
	void operator=(const Self&);
};

//#include "RangeCUDAMedianImageFilter.txx"


#endif // RANGECUDAMEDIANIMAGEFILTER_H__
