18 #ifndef __itkShapeOpeningLabelMapFilter_h
19 #define __itkShapeOpeningLabelMapFilter_h
48 template<
class TImage >
70 itkStaticConstMacro(ImageDimension,
unsigned int, TImage::ImageDimension);
78 #ifdef ITK_USE_CONCEPT_CHECKING
93 itkGetConstMacro(Lambda,
double);
94 itkSetMacro(Lambda,
double);
103 itkGetConstMacro(ReverseOrdering,
bool);
104 itkSetMacro(ReverseOrdering,
bool);
105 itkBooleanMacro(ReverseOrdering);
114 void SetAttribute(
const std::string & s)
116 this->SetAttribute( LabelObjectType::GetAttributeFromName(s) );
126 template<
class TAttributeAccessor >
127 void TemplatedGenerateData(
const TAttributeAccessor & accessor)
130 this->AllocateOutputs();
134 itkAssertInDebugAndIgnoreInReleaseMacro(this->GetNumberOfIndexedOutputs() == 2);
135 itkAssertInDebugAndIgnoreInReleaseMacro(output2 !=
NULL);
139 output2->SetBackgroundValue( output->GetBackgroundValue() );
143 typename ImageType::Iterator it( output );
144 while ( ! it.IsAtEnd() )
146 typename LabelObjectType::LabelType label = it.GetLabel();
149 if ( ( !m_ReverseOrdering && accessor(labelObject) < m_Lambda )
150 || ( m_ReverseOrdering && accessor(labelObject) > m_Lambda ) )
155 output2->AddLabelObject(labelObject);
156 output->RemoveLabel(label);
163 progress.CompletedPixel();
167 void PrintSelf(std::ostream & os,
Indent indent)
const;
177 void operator=(
const Self &);
181 #ifndef ITK_MANUAL_INSTANTIATION
182 #include "itkShapeOpeningLabelMapFilter.hxx"