17 #ifndef __itkGrayscaleFillholeImageFilter_txx
18 #define __itkGrayscaleFillholeImageFilter_txx
31 template <
class TInputImage,
class TOutputImage>
34 : m_NumberOfIterationsUsed( 1 )
36 m_FullyConnected =
false;
39 template <
class TInputImage,
class TOutputImage>
45 Superclass::GenerateInputRequestedRegion();
51 input->SetRequestedRegion( input->GetLargestPossibleRegion() );
56 template <
class TInputImage,
class TOutputImage>
62 ->SetRequestedRegion( this->GetOutput()->GetLargestPossibleRegion() );
66 template<
class TInputImage,
class TOutputImage>
72 this->AllocateOutputs();
84 calculator->SetImage( this->GetInput() );
85 calculator->ComputeMaximum();
88 maxValue = calculator->GetMaximum();
92 markerPtr->SetRegions( this->GetInput()->GetRequestedRegion() );
93 markerPtr->CopyInformation( this->GetInput() );
94 markerPtr->Allocate();
97 markerPtr->FillBuffer( maxValue );
102 inputBoundaryIt( this->GetInput(), this->GetInput()->GetRequestedRegion());
106 markerBoundaryIt( markerPtr, this->GetInput()->GetRequestedRegion() );
112 while ( !inputBoundaryIt.
IsAtEnd() )
114 markerBoundaryIt.
Set( inputBoundaryIt.
Get() );
129 progress->SetMiniPipelineFilter(
this);
130 progress->RegisterInternalFilter(erode,1.0f);
134 erode->SetMarkerImage( markerPtr );
135 erode->SetMaskImage( this->GetInput() );
136 erode->SetFullyConnected( m_FullyConnected );
140 erode->GraftOutput( this->GetOutput() );
148 this->GraftOutput( erode->GetOutput() );
152 template<
class TInputImage,
class TOutputImage>
157 Superclass::PrintSelf(os, indent);
159 os << indent <<
"Number of iterations used to produce current output: "
160 << m_NumberOfIterationsUsed << std::endl;
161 os << indent <<
"FullyConnected: " << m_FullyConnected << std::endl;