18 #ifndef itkShapeOpeningLabelMapFilter_h
19 #define itkShapeOpeningLabelMapFilter_h
48 template<
typename TImage >
70 itkStaticConstMacro(ImageDimension,
unsigned int, TImage::ImageDimension);
78 #ifdef ITK_USE_CONCEPT_CHECKING
92 itkGetConstMacro(Lambda,
double);
93 itkSetMacro(Lambda,
double);
102 itkGetConstMacro(ReverseOrdering,
bool);
103 itkSetMacro(ReverseOrdering,
bool);
104 itkBooleanMacro(ReverseOrdering);
115 this->SetAttribute( LabelObjectType::GetAttributeFromName(s) );
123 void GenerateData() ITK_OVERRIDE;
125 template< typename TAttributeAccessor >
126 void TemplatedGenerateData(const TAttributeAccessor & accessor)
129 this->AllocateOutputs();
133 itkAssertInDebugAndIgnoreInReleaseMacro(this->GetNumberOfIndexedOutputs() == 2);
134 itkAssertInDebugAndIgnoreInReleaseMacro(output2 != ITK_NULLPTR);
138 output2->SetBackgroundValue( output->GetBackgroundValue() );
142 typename ImageType::Iterator it( output );
143 while ( ! it.IsAtEnd() )
145 typename LabelObjectType::LabelType label = it.GetLabel();
148 if ( ( !m_ReverseOrdering && accessor(labelObject) < m_Lambda )
149 || ( m_ReverseOrdering && accessor(labelObject) > m_Lambda ) )
154 output2->AddLabelObject(labelObject);
155 output->RemoveLabel(label);
162 progress.CompletedPixel();
166 void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "itkShapeOpeningLabelMapFilter.hxx"
InPlaceLabelMapFilter< TImage > Superclass
ImageType::LabelObjectType LabelObjectType
Light weight base class for most itk classes.
LabelObjectType::AttributeType AttributeType
ImageType::PixelType PixelType
AttributeType m_Attribute
ImageType::ConstPointer ImageConstPointer
Remove objects according to the value of their shape attribute.
SmartPointer< const Self > ConstPointer
Base class for filters that takes an image as input and overwrites that image as the output...
ImageType::IndexType IndexType
SmartPointer< Self > Pointer
ShapeOpeningLabelMapFilter Self
void SetAttribute(const std::string &s)
Implements progress tracking for a filter.
Control indentation during Print() invocation.
ImageType::Pointer ImagePointer
ImageBaseType::IndexType IndexType
~ShapeOpeningLabelMapFilter() override