18 #ifndef itkAttributeMorphologyBaseImageFilter_h 19 #define itkAttributeMorphologyBaseImageFilter_h 62 template<
typename TInputImage,
typename TOutputImage,
typename TAttribute,
typename TFunction >
88 typedef typename TInputImage::SizeType
SizeType;
91 TOutputImage::ImageDimension);
126 itkSetMacro(FullyConnected,
bool);
127 itkGetConstReferenceMacro(FullyConnected,
bool);
128 itkBooleanMacro(FullyConnected);
136 itkSetMacro(Lambda, AttributeType);
137 itkGetConstMacro(Lambda, AttributeType);
187 void SetupOffsetVec(OffsetDirectVecType & PosOffsets, OffsetVecType & Offsets);
210 if ( m_TFunction(l.
Val, r.
Val) )
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 ) );
257 m_AuxData[p] += m_AuxData[r];
277 if ( ( m_Parent[y] ==
ACTIVE ) && ( m_Parent[x] ==
ACTIVE ) )
280 m_AuxData[y] = m_AuxData[x] + m_AuxData[y];
283 else if ( m_Parent[x] ==
ACTIVE )
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 )
335 #ifndef ITK_MANUAL_INSTANTIATION 336 #include "itkAttributeMorphologyBaseImageFilter.hxx" OffsetValueType FindRoot(OffsetValueType x)
void EnlargeOutputRequestedRegion(DataObject *) override
bool Criterion(OffsetValueType x, OffsetValueType y)
bool operator()(GreyAndPos const &l, GreyAndPos const &r) const
signed long OffsetValueType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
InputImageType::Pointer InputImagePointer
TInputImage::InternalPixelType InputInternalPixelType
void GenerateInputRequestedRegion() override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
TInputImage::OffsetType OffsetType
TInputImage::IndexType IndexType
OffsetValueType * m_Parent
GreyAndPos * m_SortPixels
SmartPointer< Self > Pointer
void Union(OffsetValueType n, OffsetValueType p)
AttributeType * m_AuxData
static const OffsetValueType ACTIVE
SmartPointer< const Self > ConstPointer
void GenerateData() override
std::list< IndexType > ListType
TInputImage::PixelType InputPixelType
void SetupOffsetVec(OffsetDirectVecType &PosOffsets, OffsetVecType &Offsets)
TInputImage::SizeType SizeType
TOutputImage::InternalPixelType OutputInternalPixelType
static const OffsetValueType ROOT
AttributeMorphologyBaseImageFilter()
std::vector< OffsetValueType > OffsetDirectVecType
virtual ~AttributeMorphologyBaseImageFilter()
Base class for filters that take an image as input and produce an image as output.
TOutputImage::RegionType RegionType
Superclass::InputImagePointer InputImagePointer
Control indentation during Print() invocation.
AttributeMorphologyBaseImageFilter Self
TInputImage InputImageType
TOutputImage OutputImageType
AttributeMorphologyBaseImageFilter(const Self &)
void MakeSet(OffsetValueType x)
static const unsigned int ImageDimension
AttributeType m_AttributeValuePerPixel
Morphological opening by attributes.
Base class for all data objects in ITK.
static const OffsetValueType INACTIVE
void PrintSelf(std::ostream &os, Indent indent) const override
TOutputImage::PixelType OutputPixelType
std::vector< OffsetType > OffsetVecType