17 #ifndef __itkMorphologyImageFilter_txx
18 #define __itkMorphologyImageFilter_txx
23 #include "itkConfigure.h"
25 #ifdef ITK_USE_CONSOLIDATED_MORPHOLOGY
33 #include "itkNumericTraits.h"
40 template<
class TInputImage,
class TOutputImage,
class TKernel>
45 m_DefaultBoundaryCondition.SetConstant( NumericTraits<PixelType>::Zero );
46 m_BoundaryCondition = &m_DefaultBoundaryCondition;
49 template <
class TInputImage,
class TOutputImage,
class TKernel>
55 Superclass::GenerateInputRequestedRegion();
59 const_cast< TInputImage *
>( this->GetInput() );
68 typename TInputImage::RegionType inputRequestedRegion;
69 inputRequestedRegion = inputPtr->GetRequestedRegion();
72 inputRequestedRegion.PadByRadius( m_Kernel.GetRadius() );
75 if ( inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion()) )
77 inputPtr->SetRequestedRegion( inputRequestedRegion );
86 inputPtr->SetRequestedRegion( inputRequestedRegion );
91 e.
SetDescription(
"Requested region is (at least partially) outside the largest possible region.");
98 template<
class TInputImage,
class TOutputImage,
class TKernel>
110 faceList = fC(this->GetInput(), outputRegionForThread, m_Kernel.GetRadius());
116 ProgressReporter progress(
this, threadId, outputRegionForThread.GetNumberOfPixels());
124 for (fit = faceList.begin(); fit != faceList.end(); ++fit)
127 this->GetInput(), *fit);
135 o_iter.Set( this->Evaluate(b_iter, kernelBegin, kernelEnd) );
138 progress.CompletedPixel();
144 template<
class TInputImage,
class TOutputImage,
class TKernel>
149 Superclass::PrintSelf(os, indent);
151 os << indent <<
"Kernel: " << m_Kernel << std::endl;
152 os << indent <<
"Boundary condition: " <<
typeid( *m_BoundaryCondition ).name() << std::endl;