18#ifndef itkShapeOpeningLabelMapFilter_h
19#define itkShapeOpeningLabelMapFilter_h
48template <
typename TImage>
71 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
79#ifdef ITK_USE_CONCEPT_CHECKING
93 itkGetConstMacro(Lambda,
double);
94 itkSetMacro(Lambda,
double);
103 itkGetConstMacro(ReverseOrdering,
bool);
104 itkSetMacro(ReverseOrdering,
bool);
105 itkBooleanMacro(ReverseOrdering);
117 this->SetAttribute(LabelObjectType::GetAttributeFromName(s));
128 template <
typename TAttributeAccessor>
133 this->AllocateOutputs();
136 ImageType * output2 = this->GetOutput(1);
137 itkAssertInDebugAndIgnoreInReleaseMacro(this->GetNumberOfIndexedOutputs() == 2);
138 itkAssertInDebugAndIgnoreInReleaseMacro(output2 !=
nullptr);
142 output2->SetBackgroundValue(output->GetBackgroundValue());
146 typename ImageType::Iterator it(output);
147 while (!it.IsAtEnd())
149 typename LabelObjectType::LabelType label = it.GetLabel();
152 if ((!m_ReverseOrdering && accessor(labelObject) < m_Lambda) ||
153 (m_ReverseOrdering && accessor(labelObject) > m_Lambda))
158 output2->AddLabelObject(labelObject);
159 output->RemoveLabel(label);
175 bool m_ReverseOrdering{};
181#ifndef ITK_MANUAL_INSTANTIATION
182# include "itkShapeOpeningLabelMapFilter.hxx"
Base class for filters that takes an image as input and overwrites that image as the output.
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Implements progress tracking for a filter.
Remove objects according to the value of their shape attribute.
typename ImageType::ConstPointer ImageConstPointer
void TemplatedGenerateData(const TAttributeAccessor &accessor)
void GenerateData() override
void PrintSelf(std::ostream &os, Indent indent) const override
typename ImageType::IndexType IndexType
~ShapeOpeningLabelMapFilter() override=default
typename ImageType::LabelObjectType LabelObjectType
typename ImageType::Pointer ImagePointer
ShapeOpeningLabelMapFilter()
void SetAttribute(const std::string &s)
typename LabelObjectType::AttributeType AttributeType
typename ImageType::PixelType PixelType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
ImageBaseType::IndexType IndexType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....