+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
+#ifndef __fpa__Image__Mori__hxx__
+#define __fpa__Image__Mori__hxx__
+
+#include <itkBinaryThresholdImageFilter.h>
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage >
+typename fpa::Image::Mori< _TInputImage, _TOutputImage >::
+TOutputImage* fpa::Image::Mori< _TInputImage, _TOutputImage >::
+GetThresholdedOutput( )
+{
+ return(
+ dynamic_cast< TOutputImage* >(
+ this->itk::ProcessObject::GetOutput( this->m_ThresholdedOutputIdx )
+ )
+ );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage >
+const typename fpa::Image::Mori< _TInputImage, _TOutputImage >::
+TOutputImage* fpa::Image::Mori< _TInputImage, _TOutputImage >::
+GetThresholdedOutput( ) const
+{
+ return(
+ dynamic_cast< const TOutputImage* >(
+ this->itk::ProcessObject::GetOutput( this->m_ThresholdedOutputIdx )
+ )
+ );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage >
+fpa::Image::Mori< _TInputImage, _TOutputImage >::
+Mori( )
+ : Superclass( )
+{
+ this->m_ThresholdedOutputIdx = this->GetNumberOfRequiredOutputs( );
+ this->itk::ProcessObject::SetNumberOfRequiredOutputs(
+ this->m_ThresholdedOutputIdx + 1
+ );
+ this->SetNthOutput( this->m_ThresholdedOutputIdx, TOutputImage::New( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage >
+fpa::Image::Mori< _TInputImage, _TOutputImage >::
+~Mori( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage >
+void fpa::Image::Mori< _TInputImage, _TOutputImage >::
+_AfterGenerateData( )
+{
+ typedef itk::BinaryThresholdImageFilter< TMarks, TOutputImage > _TFilter;
+
+ this->Superclass::_AfterGenerateData( );
+
+ typename _TFilter::Pointer filter = _TFilter::New( );
+ filter->SetInput( this->GetMarks( ) );
+ filter->SetInsideValue( this->GetInsideValue( ) );
+ filter->SetOutsideValue( this->GetOutsideValue( ) );
+ filter->SetLowerThreshold( 1 );
+ filter->SetUpperThreshold( this->GetNumberOfEvaluatedThresholds( ) - 1 );
+ filter->Update( );
+ this->GetThresholdedOutput( )->Graft( filter->GetOutput( ) );
+}
+
+#endif // __fpa__Image__Mori__hxx__
+
+// eof - $RCSfile$