18 #ifndef __itkAttributeMorphologyBaseImageFilter_h
19 #define __itkAttributeMorphologyBaseImageFilter_h
62 template<
class TInputImage,
class TOutputImage,
class TAttribute,
class TFunction >
88 typedef typename TInputImage::SizeType
SizeType;
90 itkStaticConstMacro(ImageDimension,
unsigned int,
91 TOutputImage::ImageDimension);
126 itkSetMacro(FullyConnected,
bool);
127 itkGetConstReferenceMacro(FullyConnected,
bool);
128 itkBooleanMacro(FullyConnected);
143 m_FullyConnected =
false;
144 m_AttributeValuePerPixel = 1;
150 void PrintSelf(std::ostream & os,
Indent indent)
const;
160 void GenerateInputRequestedRegion();
166 void EnlargeOutputRequestedRegion(
DataObject * itkNotUsed(output) );
210 if ( m_TFunction(l.
Val, r.
Val) )
227 m_Parent[x] = ACTIVE;
228 m_AuxData[x] = m_AttributeValuePerPixel;
233 if ( m_Parent[x] >= 0 )
235 m_Parent[x] = FindRoot(m_Parent[x]);
236 return ( m_Parent[x] );
246 return ( ( m_Raw[x] == m_Raw[y] ) || ( m_AuxData[x] < m_Lambda ) );
255 if ( Criterion(r, p) )
257 m_AuxData[p] += m_AuxData[r];
262 m_AuxData[p] = m_Lambda;
271 m_Parent[x] = ACTIVE;
272 m_AuxData[x] = m_AttributeValuePerPixel;
277 if ( ( m_Parent[y] == ACTIVE ) && ( m_Parent[x] == ACTIVE ) )
280 m_AuxData[y] = m_AuxData[x] + m_AuxData[y];
281 m_AuxData[x] = -m_AttributeValuePerPixel;
283 else if ( m_Parent[x] == ACTIVE )
285 m_AuxData[x] = -m_AttributeValuePerPixel;
289 m_AuxData[y] = -m_AttributeValuePerPixel;
290 m_Parent[y] = INACTIVE;
297 if ( m_Parent[x] >= 0 )
299 m_Parent[x] = FindRoot(m_Parent[x]);
300 return ( m_Parent[x] );
310 return ( ( m_Raw[x] == m_Raw[y] ) || ( m_Parent[x] == ACTIVE ) );
323 else if ( m_Parent[p] == ACTIVE )
325 m_Parent[p] = INACTIVE;
326 m_AuxData[p] = -m_AttributeValuePerPixel;
335 #ifndef ITK_MANUAL_INSTANTIATION
336 #include "itkAttributeMorphologyBaseImageFilter.hxx"