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);
141 m_FullyConnected =
false;
142 m_AttributeValuePerPixel = 1;
149 void PrintSelf(std::ostream & os,
Indent indent)
const;
159 void GenerateInputRequestedRegion();
165 void EnlargeOutputRequestedRegion(
DataObject * itkNotUsed(output) );
208 if ( m_TFunction(l.
Val, r.
Val) )
225 m_Parent[x] = ACTIVE;
226 m_AuxData[x] = m_AttributeValuePerPixel;
231 if ( m_Parent[x] >= 0 )
233 m_Parent[x] = FindRoot(m_Parent[x]);
234 return ( m_Parent[x] );
244 return ( ( m_Raw[x] == m_Raw[y] ) || ( m_AuxData[x] < m_Lambda ) );
253 if ( Criterion(r, p) )
255 m_AuxData[p] += m_AuxData[r];
260 m_AuxData[p] = m_Lambda;
269 m_Parent[x] = ACTIVE;
270 m_AuxData[x] = m_AttributeValuePerPixel;
275 if ( ( m_Parent[y] == ACTIVE ) && ( m_Parent[x] == ACTIVE ) )
278 m_AuxData[y] = m_AuxData[x] + m_AuxData[y];
279 m_AuxData[x] = -m_AttributeValuePerPixel;
281 else if ( m_Parent[x] == ACTIVE )
283 m_AuxData[x] = -m_AttributeValuePerPixel;
287 m_AuxData[y] = -m_AttributeValuePerPixel;
288 m_Parent[y] = INACTIVE;
295 if ( m_Parent[x] >= 0 )
297 m_Parent[x] = FindRoot(m_Parent[x]);
298 return ( m_Parent[x] );
308 return ( ( m_Raw[x] == m_Raw[y] ) || ( m_Parent[x] == ACTIVE ) );
321 else if ( m_Parent[p] == ACTIVE )
323 m_Parent[p] = INACTIVE;
324 m_AuxData[p] = -m_AttributeValuePerPixel;
333 #ifndef ITK_MANUAL_INSTANTIATION
334 #include "itkAttributeMorphologyBaseImageFilter.hxx"