18 #ifndef itkAttributeMorphologyBaseImageFilter_h
19 #define itkAttributeMorphologyBaseImageFilter_h
62 template<
typename TInputImage,
typename TOutputImage,
typename TAttribute,
typename TFunction >
90 static constexpr
unsigned int ImageDimension = TOutputImage::ImageDimension;
125 itkSetMacro(FullyConnected,
bool);
126 itkGetConstReferenceMacro(FullyConnected,
bool);
127 itkBooleanMacro(FullyConnected);
142 m_FullyConnected =
false;
143 m_AttributeValuePerPixel = 1;
149 void PrintSelf(std::ostream & os,
Indent indent)
const override;
154 void GenerateData()
override;
159 void GenerateInputRequestedRegion()
override;
165 void EnlargeOutputRequestedRegion(
DataObject * itkNotUsed(output) )
override;
209 if ( m_TFunction(l.
Val, r.
Val) )
226 m_Parent[x] = ACTIVE;
227 m_AuxData[x] = m_AttributeValuePerPixel;
232 if ( m_Parent[x] >= 0 )
234 m_Parent[x] = FindRoot(m_Parent[x]);
235 return ( m_Parent[x] );
245 return ( ( m_Raw[x] == m_Raw[y] ) || ( m_AuxData[x] < m_Lambda ) );
254 if ( Criterion(r, p) )
256 m_AuxData[p] += m_AuxData[r];
261 m_AuxData[p] = m_Lambda;
270 m_Parent[x] = ACTIVE;
271 m_AuxData[x] = m_AttributeValuePerPixel;
276 if ( ( m_Parent[y] == ACTIVE ) && ( m_Parent[x] == ACTIVE ) )
279 m_AuxData[y] = m_AuxData[x] + m_AuxData[y];
280 m_AuxData[x] = -m_AttributeValuePerPixel;
282 else if ( m_Parent[x] == ACTIVE )
284 m_AuxData[x] = -m_AttributeValuePerPixel;
288 m_AuxData[y] = -m_AttributeValuePerPixel;
289 m_Parent[y] = INACTIVE;
296 if ( m_Parent[x] >= 0 )
298 m_Parent[x] = FindRoot(m_Parent[x]);
299 return ( m_Parent[x] );
309 return ( ( m_Raw[x] == m_Raw[y] ) || ( m_Parent[x] == ACTIVE ) );
322 else if ( m_Parent[p] == ACTIVE )
324 m_Parent[p] = INACTIVE;
325 m_AuxData[p] = -m_AttributeValuePerPixel;
334 #ifndef ITK_MANUAL_INSTANTIATION
335 #include "itkAttributeMorphologyBaseImageFilter.hxx"
OffsetValueType FindRoot(OffsetValueType x)
bool Criterion(OffsetValueType x, OffsetValueType y)
typename TOutputImage::RegionType RegionType
bool operator()(GreyAndPos const &l, GreyAndPos const &r) const
std::vector< OffsetValueType > OffsetDirectVecType
typename TInputImage::InternalPixelType InputInternalPixelType
std::list< IndexType > ListType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename TInputImage::SizeType SizeType
OffsetValueType * m_Parent
GreyAndPos * m_SortPixels
TInputImage InputImageType
typename TInputImage::IndexType IndexType
void Union(OffsetValueType n, OffsetValueType p)
AttributeType * m_AuxData
typename InputImageType::Pointer InputImagePointer
ImageBaseType::SizeType SizeType
ImageBaseType::IndexType IndexType
TOutputImage OutputImageType
~AttributeMorphologyBaseImageFilter() override
AttributeMorphologyBaseImageFilter()
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
typename TInputImage::OffsetType OffsetType
typename TInputImage::PixelType InputPixelType
AttributeMorphologyBaseImageFilter(const Self &)
void MakeSet(OffsetValueType x)
ImageBaseType::RegionType RegionType
std::vector< OffsetType > OffsetVecType
typename TOutputImage::PixelType OutputPixelType
AttributeType m_AttributeValuePerPixel
Morphological opening by attributes.
signed long OffsetValueType
Base class for all data objects in ITK.
typename TOutputImage::InternalPixelType OutputInternalPixelType