22 #ifndef otbAttributesMapOpeningLabelMapFilter_hxx
23 #define otbAttributesMapOpeningLabelMapFilter_hxx
30 template <
class TImage>
35 template <
class TImage>
42 template <
class TImage>
45 this->GetAccessor().SetAttributeName(name);
49 template <
class TImage>
52 return this->GetAccessor().GetAttributeName();
56 template <
class TImage>
59 m_Accessor = accessor;
63 template <
class TImage>
70 template <
class TImage>
74 this->AllocateOutputs();
76 typename Superclass::ImageType* output = this->GetOutput();
77 typename Superclass::ImageType* output2 = this->GetOutput(1);
80 output2->SetBackgroundValue(output->GetBackgroundValue());
84 itk::ProgressReporter progress(
this, 0, output->GetNumberOfLabelObjects());
86 typename Superclass::ImageType::Iterator it(output);
89 typename Superclass::LabelObjectType::LabelType label = it.GetLabel();
90 typename Superclass::LabelObjectType* labelObject = it.GetLabelObject();
92 if ((!this->GetReverseOrdering() && m_Accessor(labelObject) < this->GetLambda()) ||
93 (this->GetReverseOrdering() && m_Accessor(labelObject) > this->GetLambda()))
97 output2->AddLabelObject(labelObject);
98 output->RemoveLabel(label);
105 progress.CompletedPixel();
110 template <
class TImage>
113 Superclass::PrintSelf(os, indent);