17 #ifndef __itkRegionalMaximaImageFilter_txx
18 #define __itkRegionalMaximaImageFilter_txx
23 #include "itkNumericTraits.h"
30 template <
class TInputImage,
class TOutputImage>
34 m_FullyConnected =
false;
35 m_FlatIsMaxima =
true;
36 m_ForegroundValue = NumericTraits<OutputImagePixelType>::max();
37 m_BackgroundValue = NumericTraits<OutputImagePixelType>::NonpositiveMin();
40 template <
class TInputImage,
class TOutputImage>
46 Superclass::GenerateInputRequestedRegion();
54 input->SetRequestedRegion( input->GetLargestPossibleRegion() );
58 template <
class TInputImage,
class TOutputImage>
64 ->SetRequestedRegion( this->GetOutput()->GetLargestPossibleRegion() );
68 template<
class TInputImage,
class TOutputImage>
75 progress->SetMiniPipelineFilter(
this);
78 this->AllocateOutputs();
83 rmax->SetInput( this->GetInput() );
84 rmax->SetFullyConnected( m_FullyConnected );
85 progress->RegisterInternalFilter( rmax, 0.67f );
91 this->GetOutput()->GetRequestedRegion().GetNumberOfPixels(),
95 outIt(this->GetOutput(), this->GetOutput()->GetRequestedRegion() );
101 outIt.
Set( m_ForegroundValue );
109 outIt.
Set( m_BackgroundValue );
119 typename ThresholdType::Pointer th = ThresholdType::New();
120 th->SetInput( rmax->GetOutput() );
121 th->SetUpperThreshold( rmax->GetMarkerValue() );
122 th->SetLowerThreshold( rmax->GetMarkerValue() );
123 th->SetOutsideValue( m_ForegroundValue );
124 th->SetInsideValue( m_BackgroundValue );
125 progress->RegisterInternalFilter( th, 0.33f );
127 th->GraftOutput( this->GetOutput() );
129 this->GraftOutput( th->GetOutput() );
135 template<
class TInputImage,
class TOutputImage>
140 Superclass::PrintSelf(os, indent);
142 os << indent <<
"FullyConnected: " << m_FullyConnected << std::endl;
143 os << indent <<
"FlatIsMaxima: " << m_FlatIsMaxima << std::endl;
144 os << indent <<
"ForegroundValue: " << m_ForegroundValue << std::endl;
145 os << indent <<
"BackgroundValue: " << m_BackgroundValue << std::endl;