#include "__PLUGIN_NAME__RImageFilter.h"


template<class TRImage>
__PLUGIN_NAME__RImageFilter<TRImage>
::__PLUGIN_NAME__RImageFilter()
{
	m_RangeFilter = RangeFilterType::New();
}


template<class TRImage>
__PLUGIN_NAME__RImageFilter<TRImage>
::~__PLUGIN_NAME__RImageFilter()
{
}


//----------------------------------------------------------------------------
template<class TRImage>
void
__PLUGIN_NAME__RImageFilter<TRImage>
::DoFiltering()
{
	if ( (GetFilterMode()&RANGE) == RANGE )
	{
		m_RangeFilter->SetInput(this->GetInput()->GetRangeImage());		
		m_RangeFilter->Update();
		this->GetOutput()->SetRangeImage(m_RangeFilter->GetOutput());
		this->GetOutput()->GetRangeImage()->DisconnectPipeline();
	}

	// Filter selected components
	if ( (GetFilterMode()&RGB) == RGB )
	{
		itkExceptionMacro(<<"Filtering for grayscale values NOT supported!");
	}
	
	if ( (GetFilterMode()&WORLDCOORD) == WORLDCOORD )
	{
		itkExceptionMacro(<<"Filtering for world coords NOT supported!");
	}
}