18 #ifndef itkShapeOpeningLabelMapFilter_h
19 #define itkShapeOpeningLabelMapFilter_h
48 template<
typename TImage >
72 static constexpr
unsigned int ImageDimension = TImage::ImageDimension;
80 #ifdef ITK_USE_CONCEPT_CHECKING
94 itkGetConstMacro(Lambda,
double);
95 itkSetMacro(Lambda,
double);
104 itkGetConstMacro(ReverseOrdering,
bool);
105 itkSetMacro(ReverseOrdering,
bool);
106 itkBooleanMacro(ReverseOrdering);
117 this->SetAttribute( LabelObjectType::GetAttributeFromName(s) );
125 void GenerateData()
override;
127 template<
typename TAttributeAccessor >
131 this->AllocateOutputs();
135 itkAssertInDebugAndIgnoreInReleaseMacro(this->GetNumberOfIndexedOutputs() == 2);
136 itkAssertInDebugAndIgnoreInReleaseMacro(output2 !=
nullptr);
140 output2->SetBackgroundValue( output->GetBackgroundValue() );
144 typename ImageType::Iterator it( output );
145 while ( ! it.IsAtEnd() )
147 typename LabelObjectType::LabelType label = it.GetLabel();
150 if ( ( !m_ReverseOrdering && accessor(labelObject) < m_Lambda )
151 || ( m_ReverseOrdering && accessor(labelObject) > m_Lambda ) )
156 output2->AddLabelObject(labelObject);
157 output->RemoveLabel(label);
164 progress.CompletedPixel();
168 void PrintSelf(std::ostream & os,
Indent indent)
const override;
178 #ifndef ITK_MANUAL_INSTANTIATION
179 #include "itkShapeOpeningLabelMapFilter.hxx"
typename LabelObjectType::AttributeType AttributeType
Light weight base class for most itk classes.
AttributeType m_Attribute
typename ImageType::LabelObjectType LabelObjectType
typename ImageType::Pointer ImagePointer
typename ImageType::ConstPointer ImageConstPointer
Remove objects according to the value of their shape attribute.
ImageBaseType::IndexType IndexType
Base class for filters that takes an image as input and overwrites that image as the output...
typename ImageType::IndexType IndexType
void SetAttribute(const std::string &s)
Implements progress tracking for a filter.
void TemplatedGenerateData(const TAttributeAccessor &accessor)
Control indentation during Print() invocation.
typename ImageType::PixelType PixelType